diff --git a/BUILD.gn b/BUILD.gn
index e1e23287..f9cb097 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -73,6 +73,7 @@
     "//skia:skia_unittests",
     "//sql:sql_unittests",
     "//sync:sync_unit_tests",
+    "//third_party/openh264/tests:openh264_unittests",
     "//ui/base:ui_base_unittests",
     "//ui/gfx:gfx_unittests",
     "//url:url_unittests",
@@ -105,7 +106,6 @@
       "//ipc/mojo:ipc_mojo_unittests",
       "//jingle:jingle_unittests",
       "//media:media_unittests",
-      "//media/cast:cast_unittests",
       "//media/midi:midi_unittests",
       "//mojo",
       "//mojo/application/public/cpp",
@@ -615,7 +615,10 @@
       "//net:net_unittests",  # TODO(GYP)
     ]
   } else if (!is_android && !is_ios) {
-    deps += [ "//breakpad:symupload" ]
+    deps += [
+      "//breakpad:symupload",
+      "//media/cast:cast_unittests",
+    ]
   }
 }
 
diff --git a/DEPS b/DEPS
index c1d48c29..a1c7ee2 100644
--- a/DEPS
+++ b/DEPS
@@ -39,11 +39,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': 'c837d8f3720db4f7ce76a6931ca1adc0c1403de1',
+  'skia_revision': '2da1a854b0836001533aa29ade89d87f420cbbc3',
   # 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': 'bd24686105a7fb031f0ad2dd4228191475b915f2',
+  'v8_revision': 'a88d3ee6e26eb25fc1a0940a862b5ee3c057fc94',
   # 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.
@@ -51,7 +51,7 @@
   # Three lines of non-changing comments so that
   # the commit queue can handle CLs rolling ANGLE
   # and whatever else without interference from each other.
-  'angle_revision': '566273222683314dfc8ac1cdb9bf6deb5d2b4c65',
+  'angle_revision': 'e73a1e847bbb984ae7c93bceee56b000fd1067f2',
   # Three lines of non-changing comments so that
   # the commit queue can handle CLs rolling build tools
   # and whatever else without interference from each other.
@@ -59,7 +59,7 @@
   # Three lines of non-changing comments so that
   # the commit queue can handle CLs rolling PDFium
   # and whatever else without interference from each other.
-  'pdfium_revision': '3acb1ef909a22368507ed13817c4988c818e3aee',
+  'pdfium_revision': '24c1eec13f277f27cb27edfb3d191e8bd2223e7c',
   # Three lines of non-changing comments so that
   # the commit queue can handle CLs rolling openmax_dl
   # and whatever else without interference from each other.
diff --git a/WATCHLISTS b/WATCHLISTS
index 75b4273..166351fa 100644
--- a/WATCHLISTS
+++ b/WATCHLISTS
@@ -1136,9 +1136,6 @@
     'blink_svg': {
       'filepath': 'third_party/WebKit/Source/core/(layout/)?svg',
     },
-    'blink_test_runner': {
-      'filepath': 'third_party/WebKit/Tools/DumpRenderTree/chromium/TestRunner',
-    },
     'blink_vibration': {
       'filepath': 'third_party/WebKit/LayoutTests/vibration/' \
                   '|third_party/WebKit/Source/modules/vibration/'
@@ -1179,7 +1176,15 @@
     },
     'blink_xmlhttprequest': {
       'filepath': 'third_party/WebKit/Source/core/xmlhttprequest/'
-    }
+    },
+    'test_runner': {
+      'filepath': 'components/test_runner/' \
+                  '|content/shell/(common|browser|renderer)/layout_test/' \
+                  '|content/test/layouttest_support.cc' \
+                  '|content/public/test/layouttest_support.h' \
+                  '|components/html_viewer/layout_test*' \
+                  '|components/html_viewer/web_test_delegate_impl.*'
+    },
   },
 
   'WATCHLISTS': {
@@ -1641,8 +1646,6 @@
                    'fs@opera.com',
                    'gyuyoung.kim@chromium.org',
                    'kouhei+svg@chromium.org' ],
-    'blink_test_runner': [ 'jochen+watch@chromium.org',
-                           'mlamouri+watch-blink@chromium.org' ],
     'blink_w3ctests' : [ 'blink-reviews-w3ctests@chromium.org' ],
     'blink_webp': [ 'urvang@chromium.org',
                     'jzern@chromium.org',
@@ -1663,5 +1666,7 @@
     'blink_wtf': [ 'mikhail.pozdnyakov@intel.com',
                    'blink-reviews-wtf@chromium.org' ],
     'blink_xmlhttprequest': [ 'tyoshino+watch@chromium.org' ],
+    'test_runner': [ 'jochen+watch@chromium.org',
+                     'mlamouri+watch-test-runner@chromium.org' ],
   },
 }
diff --git a/android_webview/apk/system_webview_apk_common.gypi b/android_webview/apk/system_webview_apk_common.gypi
index 2ccb878..f18211f9 100644
--- a/android_webview/apk/system_webview_apk_common.gypi
+++ b/android_webview/apk/system_webview_apk_common.gypi
@@ -12,7 +12,6 @@
   'variables': {
     'native_lib_target': 'libwebviewchromium',
     'native_lib_version_name': '<(version_full)',
-    'never_lint': 1,
     'shared_resources': 1,
     'extensions_to_not_compress': '.lpak,.pak,.bin,.dat',
     'asset_location': '<(INTERMEDIATE_DIR)/assets/',
diff --git a/android_webview/apk/system_webview_glue_common.gypi b/android_webview/apk/system_webview_glue_common.gypi
index 9b15be4..829fe4e 100644
--- a/android_webview/apk/system_webview_glue_common.gypi
+++ b/android_webview/apk/system_webview_glue_common.gypi
@@ -10,7 +10,6 @@
     '<(DEPTH)/android_webview/android_webview.gyp:android_webview_pak',
   ],
   'variables': {
-    'never_lint': 1,
     'resource_rewriter_package': 'com.android.webview.chromium',
     'resource_rewriter_dir': '<(intermediate_dir)/resource_rewriter',
     'resource_rewriter_path': '<(resource_rewriter_dir)/com/android/webview/chromium/ResourceRewriter.java',
diff --git a/android_webview/browser/net/aw_url_request_context_getter.cc b/android_webview/browser/net/aw_url_request_context_getter.cc
index 9c13b65..607e1d0 100644
--- a/android_webview/browser/net/aw_url_request_context_getter.cc
+++ b/android_webview/browser/net/aw_url_request_context_getter.cc
@@ -182,11 +182,10 @@
     const base::FilePath& cache_path, net::CookieStore* cookie_store,
     scoped_ptr<net::ProxyConfigService> config_service)
     : cache_path_(cache_path),
+      net_log_(new net::NetLog()),
+      proxy_config_service_(config_service.Pass()),
       cookie_store_(cookie_store),
-      net_log_(new net::NetLog()) {
-  proxy_config_service_ = config_service.Pass();
-  http_user_agent_settings_.reset(
-      new AwHttpUserAgentSettings());
+      http_user_agent_settings_(new AwHttpUserAgentSettings()) {
   // CreateSystemProxyConfigService for Android must be called on main thread.
   DCHECK_CURRENTLY_ON(BrowserThread::UI);
 }
@@ -230,17 +229,19 @@
   PopulateNetworkSessionParams(url_request_context_.get(),
                                &network_session_params);
 
-  net::HttpCache* main_cache = new net::HttpCache(
-      network_session_params,
+  http_network_session_.reset(
+      new net::HttpNetworkSession(network_session_params));
+  main_http_factory_.reset(new net::HttpCache(
+      http_network_session_.get(),
       new net::HttpCache::DefaultBackend(
           net::DISK_CACHE,
           net::CACHE_BACKEND_SIMPLE,
           cache_path_,
           20 * 1024 * 1024,  // 20M
-          BrowserThread::GetMessageLoopProxyForThread(BrowserThread::CACHE)));
+          BrowserThread::GetMessageLoopProxyForThread(BrowserThread::CACHE)),
+      true /* set_up_quic_server_info */));
 
-  main_http_factory_.reset(main_cache);
-  url_request_context_->set_http_transaction_factory(main_cache);
+  url_request_context_->set_http_transaction_factory(main_http_factory_.get());
 
   job_factory_ = CreateJobFactory(&protocol_handlers_,
                                   request_interceptors_.Pass());
diff --git a/android_webview/browser/net/aw_url_request_context_getter.h b/android_webview/browser/net/aw_url_request_context_getter.h
index a7713fe..868a670 100644
--- a/android_webview/browser/net/aw_url_request_context_getter.h
+++ b/android_webview/browser/net/aw_url_request_context_getter.h
@@ -65,13 +65,15 @@
   void InitializeURLRequestContext();
 
   const base::FilePath cache_path_;
-  scoped_refptr<net::CookieStore> cookie_store_;
+
   scoped_ptr<net::NetLog> net_log_;
-  scoped_ptr<net::URLRequestContext> url_request_context_;
   scoped_ptr<net::ProxyConfigService> proxy_config_service_;
-  scoped_ptr<net::URLRequestJobFactory> job_factory_;
+  scoped_ptr<net::HttpNetworkSession> http_network_session_;
   scoped_ptr<net::HttpTransactionFactory> main_http_factory_;
+  scoped_refptr<net::CookieStore> cookie_store_;
+  scoped_ptr<net::URLRequestJobFactory> job_factory_;
   scoped_ptr<net::HttpUserAgentSettings> http_user_agent_settings_;
+  scoped_ptr<net::URLRequestContext> url_request_context_;
 
   // ProtocolHandlers and interceptors are stored here between
   // SetHandlersAndInterceptors() and the first GetURLRequestContext() call.
diff --git a/android_webview/glue/java/src/com/android/webview/chromium/WebViewChromium.java b/android_webview/glue/java/src/com/android/webview/chromium/WebViewChromium.java
index 94e67dd84..8348baa5 100644
--- a/android_webview/glue/java/src/com/android/webview/chromium/WebViewChromium.java
+++ b/android_webview/glue/java/src/com/android/webview/chromium/WebViewChromium.java
@@ -4,6 +4,8 @@
 
 package com.android.webview.chromium;
 
+import android.annotation.SuppressLint;
+import android.annotation.TargetApi;
 import android.app.assist.AssistStructure.ViewNode;
 import android.content.Context;
 import android.content.res.Configuration;
@@ -196,6 +198,7 @@
     @Override
     // BUG=6790250 |javaScriptInterfaces| was only ever used by the obsolete DumpRenderTree
     // so is ignored. TODO: remove it from WebViewProvider.
+    @TargetApi(Build.VERSION_CODES.LOLLIPOP)
     public void init(final Map<String, Object> javaScriptInterfaces,
             final boolean privateBrowsing) {
         if (privateBrowsing) {
@@ -1712,6 +1715,7 @@
     }
 
     @Override
+    @SuppressLint("DrawAllocation")
     public void onDraw(final Canvas canvas) {
         mFactory.startYourEngines(true);
         if (checkNeedsPost()) {
@@ -2008,6 +2012,7 @@
     }
 
     @Override
+    @SuppressLint("DrawAllocation")
     public void onMeasure(final int widthMeasureSpec, final int heightMeasureSpec) {
         mFactory.startYourEngines(false);
         if (checkNeedsPost()) {
diff --git a/android_webview/glue/java/src/com/android/webview/chromium/WebViewContentsClientAdapter.java b/android_webview/glue/java/src/com/android/webview/chromium/WebViewContentsClientAdapter.java
index 289fde8..98013c9 100644
--- a/android_webview/glue/java/src/com/android/webview/chromium/WebViewContentsClientAdapter.java
+++ b/android_webview/glue/java/src/com/android/webview/chromium/WebViewContentsClientAdapter.java
@@ -4,6 +4,7 @@
 
 package com.android.webview.chromium;
 
+import android.annotation.TargetApi;
 import android.content.Context;
 import android.graphics.Bitmap;
 import android.graphics.BitmapFactory;
@@ -79,6 +80,8 @@
  * choose the latter, because it makes for a cleaner design.
  */
 @SuppressWarnings("deprecation")
+// You shouldn't change TargetApi, please see how Android M API was added.
+@TargetApi(Build.VERSION_CODES.LOLLIPOP)
 public class WebViewContentsClientAdapter extends AwContentsClient {
     // TAG is chosen for consistency with classic webview tracing.
     private static final String TAG = "WebViewCallback";
diff --git a/android_webview/glue/java/src/com/android/webview/chromium/WebViewDelegateFactory.java b/android_webview/glue/java/src/com/android/webview/chromium/WebViewDelegateFactory.java
index 212f005..56e797ff 100644
--- a/android_webview/glue/java/src/com/android/webview/chromium/WebViewDelegateFactory.java
+++ b/android_webview/glue/java/src/com/android/webview/chromium/WebViewDelegateFactory.java
@@ -4,6 +4,7 @@
 
 package com.android.webview.chromium;
 
+import android.annotation.TargetApi;
 import android.app.Application;
 import android.content.Context;
 import android.content.ContextWrapper;
@@ -11,6 +12,7 @@
 import android.content.res.AssetManager;
 import android.content.res.Resources;
 import android.graphics.Canvas;
+import android.os.Build;
 import android.os.Trace;
 import android.util.SparseArray;
 import android.view.View;
@@ -197,6 +199,7 @@
      * reflection to call into hidden frameworks APIs released in the API-21 version of the
      * framework.
      */
+    @TargetApi(Build.VERSION_CODES.LOLLIPOP)
     private static class Api21CompatibilityDelegate implements WebViewDelegate {
         /** Copy of Trace.TRACE_TAG_WEBVIEW */
         private static final long TRACE_TAG_WEBVIEW = 1L << 4;
diff --git a/android_webview/javatests/src/org/chromium/android_webview/test/AndroidScrollIntegrationTest.java b/android_webview/javatests/src/org/chromium/android_webview/test/AndroidScrollIntegrationTest.java
index 6a1d9ac..4c5d5df 100644
--- a/android_webview/javatests/src/org/chromium/android_webview/test/AndroidScrollIntegrationTest.java
+++ b/android_webview/javatests/src/org/chromium/android_webview/test/AndroidScrollIntegrationTest.java
@@ -26,6 +26,8 @@
 import java.util.concurrent.Callable;
 import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.atomic.AtomicBoolean;
+import java.util.concurrent.atomic.AtomicInteger;
+import java.util.concurrent.atomic.AtomicReference;
 
 /**
  * Integration tests for synchronous scrolling.
@@ -216,13 +218,45 @@
 
     private void assertScrollOnMainSync(final ScrollTestContainerView testContainerView,
             final int scrollXPix, final int scrollYPix) {
+        final AtomicInteger scrolledXPix = new AtomicInteger();
+        final AtomicInteger scrolledYPix = new AtomicInteger();
         getInstrumentation().runOnMainSync(new Runnable() {
             @Override
             public void run() {
-                assertEquals(scrollXPix, testContainerView.getScrollX());
-                assertEquals(scrollYPix, testContainerView.getScrollY());
+                scrolledXPix.set(testContainerView.getScrollX());
+                scrolledYPix.set(testContainerView.getScrollY());
             }
         });
+        // Actual scrolling is done using this formula:
+        // floor (scroll_offset_dip * max_offset) / max_scroll_offset_dip
+        // where max_offset is calculated using a ceil operation.
+        // This combination of ceiling and flooring can lead to a deviation from the test
+        // calculation, which simply uses the more direct:
+        // floor (scroll_offset_dip * dip_scale)
+        //
+        // While the math used in the functional code is correct (See crbug.com/261239), it can't
+        // be verified down to the pixel in this test which doesn't have all internal values.
+        // In non-rational cases, this can lead to a deviation of up to one pixel when using
+        // the floor directly. To accomodate this scenario, the test allows a -1 px deviation.
+        //
+        // For example, imagine the following valid values:
+        // scroll_offset_dip = 132
+        // max_offset = 532
+        // max_scroll_offset_dip = 399
+        // dip_scale = 1.33125
+        //
+        // The functional code will return
+        // floor (132 * 532 / 399) = 176
+        // The test code will return
+        // floor (132 * 1.33125) = 175
+        //
+        // For more information, see crbug.com/537343
+        assertTrue("Actual and expected x-scroll offsets do not match. Expected " + scrollXPix
+                + ", actual " + scrolledXPix.get(),
+                scrollXPix == scrolledXPix.get() || scrollXPix == scrolledXPix.get() - 1);
+        assertTrue("Actual and expected y-scroll offsets do not match. Expected " + scrollYPix
+                + ", actual " + scrolledYPix.get(),
+                scrollYPix == scrolledYPix.get() || scrollYPix == scrolledYPix.get() - 1);
     }
 
     private void assertScrollInJs(final AwContents awContents,
@@ -790,35 +824,51 @@
 
         loadTestPageAndWaitForFirstFrame(testContainerView, contentsClient, null, "");
 
+        // Containers to execute asserts on the test thread
+        final AtomicBoolean canZoomIn = new AtomicBoolean(false);
+        final AtomicReference<Float> atomicOldScale = new AtomicReference<Float>();
+        final AtomicReference<Float> atomicNewScale = new AtomicReference<Float>();
+        final AtomicInteger atomicOldScrollRange = new AtomicInteger();
+        final AtomicInteger atomicNewScrollRange = new AtomicInteger();
+        final AtomicInteger atomicContentHeight = new AtomicInteger();
+        final AtomicInteger atomicOldContentHeightApproximation = new AtomicInteger();
+        final AtomicInteger atomicNewContentHeightApproximation = new AtomicInteger();
         getInstrumentation().runOnMainSync(new Runnable() {
             @Override
             public void run() {
-                assertTrue(awContents.canZoomIn());
+                canZoomIn.set(awContents.canZoomIn());
 
                 int oldScrollRange =
                         awContents.computeVerticalScrollRange() - testContainerView.getHeight();
                 float oldScale = awContents.getScale();
-                int oldContentHeightApproximation =
-                        (int) Math.ceil(awContents.computeVerticalScrollRange() / oldScale);
+                atomicOldContentHeightApproximation.set(
+                        (int) Math.ceil(awContents.computeVerticalScrollRange() / oldScale));
 
                 awContents.zoomIn();
 
                 int newScrollRange =
                         awContents.computeVerticalScrollRange() - testContainerView.getHeight();
                 float newScale = awContents.getScale();
-                int newContentHeightApproximation =
-                        (int) Math.ceil(awContents.computeVerticalScrollRange() / newScale);
+                atomicNewContentHeightApproximation.set(
+                        (int) Math.ceil(awContents.computeVerticalScrollRange() / newScale));
 
-                assertTrue(String.format(Locale.ENGLISH,
-                        "Scale range should increase after zoom (%f) > (%f)",
-                        newScale, oldScale), newScale > oldScale);
-                assertTrue(String.format(Locale.ENGLISH,
-                        "Scroll range should increase after zoom (%d) > (%d)",
-                        newScrollRange, oldScrollRange), newScrollRange > oldScrollRange);
-                assertEquals(awContents.getContentHeightCss(), oldContentHeightApproximation);
-                assertEquals(awContents.getContentHeightCss(), newContentHeightApproximation);
+                atomicOldScale.set(oldScale);
+                atomicNewScale.set(newScale);
+                atomicOldScrollRange.set(oldScrollRange);
+                atomicNewScrollRange.set(newScrollRange);
+                atomicContentHeight.set(awContents.getContentHeightCss());
             }
         });
-
+        assertTrue(canZoomIn.get());
+        assertTrue(String.format(Locale.ENGLISH,
+                "Scale range should increase after zoom (%f) > (%f)",
+                atomicNewScale.get(), atomicOldScale.get()),
+                atomicNewScale.get() > atomicOldScale.get());
+        assertTrue(String.format(Locale.ENGLISH,
+                "Scroll range should increase after zoom (%d) > (%d)",
+                atomicNewScrollRange.get(), atomicOldScrollRange.get()),
+                atomicNewScrollRange.get() > atomicOldScrollRange.get());
+        assertEquals(atomicContentHeight.get(), atomicOldContentHeightApproximation.get());
+        assertEquals(atomicContentHeight.get(), atomicNewContentHeightApproximation.get());
     }
 }
diff --git a/ash/frame/default_header_painter.cc b/ash/frame/default_header_painter.cc
index a80a3c6..ab9dd18 100644
--- a/ash/frame/default_header_painter.cc
+++ b/ash/frame/default_header_painter.cc
@@ -262,18 +262,13 @@
 }
 
 void DefaultHeaderPainter::PaintHeaderContentSeparator(gfx::Canvas* canvas) {
-  SkColor color = (mode_ == MODE_ACTIVE) ?
-      kHeaderContentSeparatorColor :
-      kHeaderContentSeparatorInactiveColor;
-
+  const float scale = canvas->SaveAndUnscale();
+  gfx::RectF rect(0, painted_height_ * scale - 1, view_->width() * scale, 1);
   SkPaint paint;
-  paint.setColor(color);
-  // Draw the line as 1px thick regardless of scale factor.
-  paint.setStrokeWidth(0);
-
-  float thickness = 1 / canvas->image_scale();
-  SkScalar y = SkIntToScalar(painted_height_) - SkFloatToScalar(thickness);
-  canvas->sk_canvas()->drawLine(0, y, SkIntToScalar(view_->width()), y, paint);
+  paint.setColor((mode_ == MODE_ACTIVE) ?
+      kHeaderContentSeparatorColor : kHeaderContentSeparatorInactiveColor);
+  canvas->sk_canvas()->drawRect(gfx::RectFToSkRect(rect), paint);
+  canvas->Restore();
 }
 
 void DefaultHeaderPainter::LayoutLeftHeaderView() {
diff --git a/ash/wm/overview/scoped_transform_overview_window.cc b/ash/wm/overview/scoped_transform_overview_window.cc
index 993dcac..ce035b5 100644
--- a/ash/wm/overview/scoped_transform_overview_window.cc
+++ b/ash/wm/overview/scoped_transform_overview_window.cc
@@ -260,10 +260,9 @@
     const gfx::Rect& rect,
     const gfx::Rect& bounds) {
   DCHECK(!rect.IsEmpty());
-  DCHECK(!bounds.IsEmpty());
-  float scale = std::min(1.0f,
-      std::min(static_cast<float>(bounds.width()) / rect.width(),
-               static_cast<float>(bounds.height()) / rect.height()));
+  float scale = std::min(
+      1.0f, std::min(static_cast<float>(bounds.width()) / rect.width(),
+                     static_cast<float>(bounds.height()) / rect.height()));
   return gfx::Rect(bounds.x() + 0.5 * (bounds.width() - scale * rect.width()),
                    bounds.y() + 0.5 * (bounds.height() - scale * rect.height()),
                    rect.width() * scale,
@@ -274,7 +273,6 @@
     const gfx::Rect& src_rect,
     const gfx::Rect& dst_rect) {
   DCHECK(!src_rect.IsEmpty());
-  DCHECK(!dst_rect.IsEmpty());
   gfx::Transform transform;
   transform.Translate(dst_rect.x() - src_rect.x(),
                       dst_rect.y() - src_rect.y());
diff --git a/ash/wm/overview/window_grid.cc b/ash/wm/overview/window_grid.cc
index 2e019b3..83ae20a 100644
--- a/ash/wm/overview/window_grid.cc
+++ b/ash/wm/overview/window_grid.cc
@@ -149,7 +149,9 @@
   item_size->set_width(std::min(
       static_cast<int>(total_bounds.width() / num_columns),
       static_cast<int>(total_bounds.height() * kCardAspectRatio / num_rows)));
-  item_size->set_height(item_size->width() / kCardAspectRatio);
+  item_size->set_height(
+      static_cast<int>(item_size->width() / kCardAspectRatio));
+  item_size->SetToMax(gfx::Size(1, 1));
 
   bounding_rect->set_width(std::min(static_cast<int>(items), num_columns) *
                            item_size->width());
diff --git a/ash/wm/overview/window_selector_item.cc b/ash/wm/overview/window_selector_item.cc
index 02a9bb2a..a6b0f88 100644
--- a/ash/wm/overview/window_selector_item.cc
+++ b/ash/wm/overview/window_selector_item.cc
@@ -247,6 +247,12 @@
                                        OverviewAnimationType animation_type) {
   DCHECK(root_window_ == GetWindow()->GetRootWindow());
   gfx::Rect screen_bounds = transform_window_.GetTargetBoundsInScreen();
+
+  // Avoid division by zero by ensuring screen bounds is not empty.
+  gfx::Size screen_size(screen_bounds.size());
+  screen_size.SetToMax(gfx::Size(1, 1));
+  screen_bounds.set_size(screen_size);
+
   gfx::Rect selector_item_bounds =
       ScopedTransformOverviewWindow::ShrinkRectToFitPreservingAspectRatio(
           screen_bounds, target_bounds);
diff --git a/ash/wm/overview/window_selector_unittest.cc b/ash/wm/overview/window_selector_unittest.cc
index e937426..0e15230 100644
--- a/ash/wm/overview/window_selector_unittest.cc
+++ b/ash/wm/overview/window_selector_unittest.cc
@@ -350,6 +350,18 @@
             ui::A11Y_ALERT_WINDOW_OVERVIEW_MODE_ENTERED);
 }
 
+// Tests that there are no crashes when there is not enough screen space
+// available to show all of the windows.
+TEST_F(WindowSelectorTest, SmallDisplay) {
+  UpdateDisplay("3x1");
+  gfx::Rect bounds(0, 0, 1, 1);
+  scoped_ptr<aura::Window> window1(CreateWindow(bounds));
+  scoped_ptr<aura::Window> window2(CreateWindow(bounds));
+  scoped_ptr<aura::Window> window3(CreateWindow(bounds));
+  scoped_ptr<aura::Window> window4(CreateWindow(bounds));
+  ToggleOverview();
+}
+
 // Tests entering overview mode with two windows and selecting one by clicking.
 TEST_F(WindowSelectorTest, Basic) {
   gfx::Rect bounds(0, 0, 400, 400);
diff --git a/base/files/file_util_posix.cc b/base/files/file_util_posix.cc
index ffa79a4..eb8620d0 100644
--- a/base/files/file_util_posix.cc
+++ b/base/files/file_util_posix.cc
@@ -674,7 +674,7 @@
 
 int WriteFile(const FilePath& filename, const char* data, int size) {
   ThreadRestrictions::AssertIOAllowed();
-  int fd = HANDLE_EINTR(creat(filename.value().c_str(), 0640));
+  int fd = HANDLE_EINTR(creat(filename.value().c_str(), 0666));
   if (fd < 0)
     return -1;
 
diff --git a/base/memory/discardable_shared_memory.cc b/base/memory/discardable_shared_memory.cc
index 0f85c1fe9..d0eaca1a 100644
--- a/base/memory/discardable_shared_memory.cc
+++ b/base/memory/discardable_shared_memory.cc
@@ -340,6 +340,15 @@
          !result.GetTimestamp().is_null();
 }
 
+bool DiscardableSharedMemory::IsMemoryLocked() const {
+  DCHECK(shared_memory_.memory());
+
+  SharedState result(subtle::NoBarrier_Load(
+      &SharedStateFromSharedMemory(shared_memory_)->value.i));
+
+  return result.GetLockState() == SharedState::LOCKED;
+}
+
 void DiscardableSharedMemory::Close() {
   shared_memory_.Close();
 }
diff --git a/base/memory/discardable_shared_memory.h b/base/memory/discardable_shared_memory.h
index 74bbe8e..5dca884 100644
--- a/base/memory/discardable_shared_memory.h
+++ b/base/memory/discardable_shared_memory.h
@@ -107,6 +107,9 @@
   // Returns true if memory is still resident.
   bool IsMemoryResident() const;
 
+  // Returns true if memory is locked.
+  bool IsMemoryLocked() const;
+
   // Closes the open discardable memory segment.
   // It is safe to call Close repeatedly.
   void Close();
diff --git a/base/memory/discardable_shared_memory_unittest.cc b/base/memory/discardable_shared_memory_unittest.cc
index 91b0b68..d5b71d3 100644
--- a/base/memory/discardable_shared_memory_unittest.cc
+++ b/base/memory/discardable_shared_memory_unittest.cc
@@ -33,6 +33,7 @@
   bool rv = memory.CreateAndMap(kDataSize);
   ASSERT_TRUE(rv);
   EXPECT_GE(memory.mapped_size(), kDataSize);
+  EXPECT_TRUE(memory.IsMemoryLocked());
 }
 
 TEST(DiscardableSharedMemoryTest, CreateFromHandle) {
@@ -50,6 +51,7 @@
   TestDiscardableSharedMemory memory2(shared_handle);
   rv = memory2.Map(kDataSize);
   ASSERT_TRUE(rv);
+  EXPECT_TRUE(memory2.IsMemoryLocked());
 }
 
 TEST(DiscardableSharedMemoryTest, LockAndUnlock) {
@@ -62,6 +64,7 @@
   // Memory is initially locked. Unlock it.
   memory1.SetNow(Time::FromDoubleT(1));
   memory1.Unlock(0, 0);
+  EXPECT_FALSE(memory1.IsMemoryLocked());
 
   // Lock and unlock memory.
   auto lock_rv = memory1.Lock(0, 0);
@@ -72,6 +75,7 @@
   // Lock again before duplicating and passing ownership to new instance.
   lock_rv = memory1.Lock(0, 0);
   EXPECT_EQ(DiscardableSharedMemory::SUCCESS, lock_rv);
+  EXPECT_TRUE(memory1.IsMemoryLocked());
 
   SharedMemoryHandle shared_handle;
   ASSERT_TRUE(
@@ -86,13 +90,18 @@
   memory2.SetNow(Time::FromDoubleT(3));
   memory2.Unlock(0, 0);
 
+  // Both memory instances should be unlocked now.
+  EXPECT_FALSE(memory2.IsMemoryLocked());
+  EXPECT_FALSE(memory1.IsMemoryLocked());
+
   // Lock second instance before passing ownership back to first instance.
   lock_rv = memory2.Lock(0, 0);
   EXPECT_EQ(DiscardableSharedMemory::SUCCESS, lock_rv);
 
-  // Memory should still be resident.
+  // Memory should still be resident and locked.
   rv = memory1.IsMemoryResident();
   EXPECT_TRUE(rv);
+  EXPECT_TRUE(memory1.IsMemoryLocked());
 
   // Unlock first instance.
   memory1.SetNow(Time::FromDoubleT(4));
diff --git a/base/strings/string_util.cc b/base/strings/string_util.cc
index d7a1d54..a978891 100644
--- a/base/strings/string_util.cc
+++ b/base/strings/string_util.cc
@@ -674,6 +674,15 @@
   return 0;
 }
 
+bool IsUnicodeWhitespace(wchar_t c) {
+  // kWhitespaceWide is a NULL-terminated string
+  for (const wchar_t* cur = kWhitespaceWide; *cur; ++cur) {
+    if (*cur == c)
+      return true;
+  }
+  return false;
+}
+
 static const char* const kByteStringsUnlocalized[] = {
   " B",
   " kB",
diff --git a/base/strings/string_util.h b/base/strings/string_util.h
index 169726bc..2578569 100644
--- a/base/strings/string_util.h
+++ b/base/strings/string_util.h
@@ -358,9 +358,7 @@
 BASE_EXPORT char HexDigitToInt(wchar_t c);
 
 // Returns true if it's a Unicode whitespace character.
-inline bool IsUnicodeWhitespace(wchar_t c) {
-  return wcschr(base::kWhitespaceWide, c) != NULL;
-}
+BASE_EXPORT bool IsUnicodeWhitespace(wchar_t c);
 
 // Return a byte string in human-readable format with a unit suffix. Not
 // appropriate for use in any UI; use of FormatBytes and friends in ui/base is
diff --git a/base/strings/string_util_unittest.cc b/base/strings/string_util_unittest.cc
index 187e49e..765ba83 100644
--- a/base/strings/string_util_unittest.cc
+++ b/base/strings/string_util_unittest.cc
@@ -1080,6 +1080,26 @@
   EXPECT_FALSE(EqualsCaseInsensitiveASCII("Asdf", "aSDFz"));
 }
 
+TEST(StringUtilTest, IsUnicodeWhitespace) {
+  // NOT unicode white space.
+  EXPECT_FALSE(IsUnicodeWhitespace(L'\0'));
+  EXPECT_FALSE(IsUnicodeWhitespace(L'A'));
+  EXPECT_FALSE(IsUnicodeWhitespace(L'0'));
+  EXPECT_FALSE(IsUnicodeWhitespace(L'.'));
+  EXPECT_FALSE(IsUnicodeWhitespace(L';'));
+  EXPECT_FALSE(IsUnicodeWhitespace(L'\x4100'));
+
+  // Actual unicode whitespace.
+  EXPECT_TRUE(IsUnicodeWhitespace(L' '));
+  EXPECT_TRUE(IsUnicodeWhitespace(L'\xa0'));
+  EXPECT_TRUE(IsUnicodeWhitespace(L'\x3000'));
+  EXPECT_TRUE(IsUnicodeWhitespace(L'\t'));
+  EXPECT_TRUE(IsUnicodeWhitespace(L'\r'));
+  EXPECT_TRUE(IsUnicodeWhitespace(L'\v'));
+  EXPECT_TRUE(IsUnicodeWhitespace(L'\f'));
+  EXPECT_TRUE(IsUnicodeWhitespace(L'\n'));
+}
+
 class WriteIntoTest : public testing::Test {
  protected:
   static void WritesCorrectly(size_t num_chars) {
diff --git a/blimp/BUILD.gn b/blimp/BUILD.gn
index 8c71748..eb1c57d 100644
--- a/blimp/BUILD.gn
+++ b/blimp/BUILD.gn
@@ -2,6 +2,7 @@
 # Use of this source code is governed by a BSD-style license that can be
 # found in the LICENSE file.
 
+# Metatarget for all of Blimp's feature code.
 group("blimp") {
   deps = [
     "//blimp/client:blimp_client",
@@ -22,6 +23,7 @@
 
   deps = [
     ":blimp",
+    "//blimp/net:blimp_net_tests",
   ]
 
   if (is_android) {
diff --git a/blimp/common/BUILD.gn b/blimp/common/BUILD.gn
index a9dfd35..a1a6bbba 100644
--- a/blimp/common/BUILD.gn
+++ b/blimp/common/BUILD.gn
@@ -2,6 +2,8 @@
 # Use of this source code is governed by a BSD-style license that can be
 # found in the LICENSE file.
 
+import("//testing/test.gni")
+
 component("blimp_common") {
   sources = [
     # TODO(dtrainor): Remove this once the LayerTreeHost settings for Blimp
diff --git a/blimp/common/proto/BUILD.gn b/blimp/common/proto/BUILD.gn
index d5fc25d..db60779 100644
--- a/blimp/common/proto/BUILD.gn
+++ b/blimp/common/proto/BUILD.gn
@@ -4,7 +4,14 @@
 
 import("//third_party/protobuf/proto_library.gni")
 
-proto_library("proto") {
+group("proto") {
+  public_deps = [
+    ":proto_lib",
+    "//third_party/protobuf:protobuf_lite",
+  ]
+}
+
+proto_library("proto_lib") {
   sources = [
     "blimp_message.proto",
     "client_control.proto",
diff --git a/blimp/net/BUILD.gn b/blimp/net/BUILD.gn
new file mode 100644
index 0000000..5a1784c
--- /dev/null
+++ b/blimp/net/BUILD.gn
@@ -0,0 +1,48 @@
+# 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("//testing/test.gni")
+
+component("blimp_net") {
+  sources = [
+    "blimp_message_dispatcher.cc",
+    "blimp_message_dispatcher.h",
+    "blimp_message_receiver.h",
+    "blimp_net_export.h",
+  ]
+
+  defines = [ "BLIMP_NET_IMPLEMENTATION=1" ]
+
+  deps = [
+    "//base",
+    "//blimp/common/proto",
+    "//net",
+  ]
+}
+
+test("blimp_net_tests") {
+  sources = [
+    "blimp_message_dispatcher_unittest.cc",
+  ]
+
+  deps = [
+    ":blimp_net",
+    "//base",
+    "//base/test:run_all_unittests",
+    "//base/test:test_support",
+    "//blimp/common/proto",
+    "//net:test_support",
+    "//testing/gmock",
+    "//testing/gtest",
+  ]
+}
+
+# TODO(GYP): Delete this after we've converted everything to GN.
+# # The _run targets exist only for compatibility w/ GYP.
+group("blimp_net_tests_run") {
+  testonly = true
+  deps = [
+    ":blimp_net_tests",
+  ]
+}
diff --git a/blimp/net/blimp_message_dispatcher.cc b/blimp/net/blimp_message_dispatcher.cc
new file mode 100644
index 0000000..8c07c9f
--- /dev/null
+++ b/blimp/net/blimp_message_dispatcher.cc
@@ -0,0 +1,45 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "blimp/net/blimp_message_dispatcher.h"
+
+#include <string>
+
+#include "base/strings/stringprintf.h"
+
+namespace blimp {
+namespace {
+
+std::string BlimpMessageToDebugString(const BlimpMessage& message) {
+  return base::StringPrintf("<message type=%d>", message.type());
+}
+
+}  // namespace
+
+BlimpMessageDispatcher::BlimpMessageDispatcher() {}
+
+BlimpMessageDispatcher::~BlimpMessageDispatcher() {}
+
+void BlimpMessageDispatcher::AddReceiver(BlimpMessage::Type type,
+                                         BlimpMessageReceiver* receiver) {
+  DCHECK(receiver);
+  if (feature_receiver_map_.find(type) == feature_receiver_map_.end()) {
+    feature_receiver_map_.insert(std::make_pair(type, receiver));
+  } else {
+    DLOG(FATAL) << "Handler already registered for type=" << type << ".";
+  }
+}
+
+net::Error BlimpMessageDispatcher::OnBlimpMessage(const BlimpMessage& message) {
+  auto receiver_iter = feature_receiver_map_.find(message.type());
+  if (receiver_iter == feature_receiver_map_.end()) {
+    DLOG(FATAL) << "No registered receiver for "
+                << BlimpMessageToDebugString(message) << ".";
+    return net::ERR_NOT_IMPLEMENTED;
+  }
+
+  return receiver_iter->second->OnBlimpMessage(message);
+}
+
+}  // namespace blimp
diff --git a/blimp/net/blimp_message_dispatcher.h b/blimp/net/blimp_message_dispatcher.h
new file mode 100644
index 0000000..bf12449
--- /dev/null
+++ b/blimp/net/blimp_message_dispatcher.h
@@ -0,0 +1,44 @@
+// 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 BLIMP_NET_BLIMP_MESSAGE_DISPATCHER_H_
+#define BLIMP_NET_BLIMP_MESSAGE_DISPATCHER_H_
+
+#include <map>
+
+#include "base/containers/small_map.h"
+#include "base/threading/thread_checker.h"
+#include "blimp/common/proto/blimp_message.pb.h"
+#include "blimp/net/blimp_message_receiver.h"
+#include "blimp/net/blimp_net_export.h"
+
+namespace blimp {
+
+// Multiplexing BlimpMessageReceiver which routes BlimpMessages to other
+// receivers based on the messages' feature type.
+class BLIMP_NET_EXPORT BlimpMessageDispatcher : public BlimpMessageReceiver {
+ public:
+  BlimpMessageDispatcher();
+  ~BlimpMessageDispatcher() override;
+
+  // Registers a message receiver which will process all messages
+  // with of the specified |type|.
+  // Only one handler may be added per type.
+  //
+  // |handler| must be valid when OnBlimpMessage() is called.
+  void AddReceiver(BlimpMessage::Type type, BlimpMessageReceiver* handler);
+
+  // BlimpMessageReceiver implementation.
+  net::Error OnBlimpMessage(const BlimpMessage& message) override;
+
+ private:
+  base::SmallMap<std::map<BlimpMessage::Type, BlimpMessageReceiver*>>
+      feature_receiver_map_;
+
+  DISALLOW_COPY_AND_ASSIGN(BlimpMessageDispatcher);
+};
+
+}  // namespace blimp
+
+#endif  // BLIMP_NET_BLIMP_MESSAGE_DISPATCHER_H_
diff --git a/blimp/net/blimp_message_dispatcher_unittest.cc b/blimp/net/blimp_message_dispatcher_unittest.cc
new file mode 100644
index 0000000..8c22c0c58
--- /dev/null
+++ b/blimp/net/blimp_message_dispatcher_unittest.cc
@@ -0,0 +1,46 @@
+// 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.
+//
+// Uniitest for data encryption functions.
+
+#include "blimp/net/blimp_message_dispatcher.h"
+
+#include "base/logging.h"
+#include "testing/gmock/include/gmock/gmock.h"
+#include "testing/gtest/include/gtest/gtest.h"
+
+using testing::Ref;
+using testing::Return;
+
+namespace blimp {
+
+class MockReceiver : public BlimpMessageReceiver {
+ public:
+  MockReceiver() {}
+  ~MockReceiver() override {}
+
+  MOCK_METHOD1(OnBlimpMessage, net::Error(const BlimpMessage& message));
+};
+
+TEST(BlimpMessageDispatcherTest, AllInteractions) {
+  BlimpMessage input_msg;
+  BlimpMessage compositor_msg;
+  input_msg.set_type(BlimpMessage::INPUT);
+  compositor_msg.set_type(BlimpMessage::COMPOSITOR);
+
+  MockReceiver receiver1;
+  MockReceiver receiver2;
+  EXPECT_CALL(receiver1, OnBlimpMessage(Ref(input_msg)))
+      .WillOnce(Return(net::OK));
+  EXPECT_CALL(receiver2, OnBlimpMessage(Ref(compositor_msg)))
+      .WillOnce(Return(net::ERR_FAILED));
+
+  BlimpMessageDispatcher dispatcher;
+  dispatcher.AddReceiver(BlimpMessage::INPUT, &receiver1);
+  dispatcher.AddReceiver(BlimpMessage::COMPOSITOR, &receiver2);
+  EXPECT_EQ(net::OK, dispatcher.OnBlimpMessage(input_msg));
+  EXPECT_EQ(net::ERR_FAILED, dispatcher.OnBlimpMessage(compositor_msg));
+}
+
+}  // namespace blimp
diff --git a/blimp/net/blimp_message_receiver.h b/blimp/net/blimp_message_receiver.h
new file mode 100644
index 0000000..8170737
--- /dev/null
+++ b/blimp/net/blimp_message_receiver.h
@@ -0,0 +1,27 @@
+// 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 BLIMP_NET_BLIMP_MESSAGE_RECEIVER_H_
+#define BLIMP_NET_BLIMP_MESSAGE_RECEIVER_H_
+
+#include "net/base/net_errors.h"
+
+namespace blimp {
+
+class BlimpMessage;
+
+// Interface implemented by components that process BlimpMessages.
+class BlimpMessageReceiver {
+ public:
+  virtual ~BlimpMessageReceiver() {}
+
+  // Processes the BlimpMessage, or returns a net::ERR_* on error.
+  // If an error code is returned, callers should terminate the connection
+  // from which |message| was received.
+  virtual net::Error OnBlimpMessage(const BlimpMessage& message) = 0;
+};
+
+}  // namespace blimp
+
+#endif  // BLIMP_NET_BLIMP_MESSAGE_RECEIVER_H_
diff --git a/blimp/net/blimp_net_export.h b/blimp/net/blimp_net_export.h
new file mode 100644
index 0000000..7d0a76c4
--- /dev/null
+++ b/blimp/net/blimp_net_export.h
@@ -0,0 +1,29 @@
+// 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 BLIMP_NET_BLIMP_NET_EXPORT_H_
+#define BLIMP_NET_BLIMP_NET_EXPORT_H_
+
+#if defined(COMPONENT_BUILD)
+#if defined(WIN32)
+
+#if defined(BLIMP_NET_IMPLEMENTATION)
+#define BLIMP_NET_EXPORT __declspec(dllexport)
+#else
+#define BLIMP_NET_EXPORT __declspec(dllimport)
+#endif  // defined(BLIMP_NET_IMPLEMENTATION)
+
+#else  // defined(WIN32)
+#if defined(BLIMP_NET_IMPLEMENTATION)
+#define BLIMP_NET_EXPORT __attribute__((visibility("default")))
+#else
+#define BLIMP_NET_EXPORT
+#endif  // defined(BLIMP_NET_IMPLEMENTATION)
+#endif
+
+#else  // defined(COMPONENT_BUILD)
+#define BLIMP_NET_EXPORT
+#endif
+
+#endif  // BLIMP_NET_BLIMP_NET_EXPORT_H_
diff --git a/build/all.gyp b/build/all.gyp
index df38f99..8eabf88b 100644
--- a/build/all.gyp
+++ b/build/all.gyp
@@ -30,6 +30,7 @@
         '../testing/gtest.gyp:*',
         '../third_party/icu/icu.gyp:*',
         '../third_party/libxml/libxml.gyp:*',
+        '../third_party/openh264/tests/openh264_unittests.gyp:*',
         '../third_party/sqlite/sqlite.gyp:*',
         '../third_party/zlib/zlib.gyp:*',
         '../ui/accessibility/accessibility.gyp:*',
diff --git a/build/android/avd.py b/build/android/avd.py
index 50720ed..65c7eac 100755
--- a/build/android/avd.py
+++ b/build/android/avd.py
@@ -20,11 +20,10 @@
 from pylib import constants
 from pylib.utils import emulator
 
-
 def main(argv):
   # ANDROID_SDK_ROOT needs to be set to the location of the SDK used to launch
   # the emulator to find the system images upon launch.
-  emulator_sdk = os.path.join(constants.EMULATOR_SDK_ROOT, 'sdk')
+  emulator_sdk = constants.ANDROID_SDK_ROOT
   os.environ['ANDROID_SDK_ROOT'] = emulator_sdk
 
   opt_parser = optparse.OptionParser(description='AVD script.')
@@ -41,10 +40,13 @@
 
   options, _ = opt_parser.parse_args(argv[1:])
 
-  logging.basicConfig(level=logging.INFO,
-                      format='# %(asctime)-15s: %(message)s')
   logging.root.setLevel(logging.INFO)
 
+  # Check if SDK exist in ANDROID_SDK_ROOT
+  if not install_emulator_deps.CheckSDK():
+    raise Exception('Emulator SDK not installed in %s'
+                     % constants.ANDROID_SDK_ROOT)
+
   # Check if KVM is enabled for x86 AVD's and check for x86 system images.
   # TODO(andrewhayden) Since we can fix all of these with install_emulator_deps
   # why don't we just run it?
@@ -58,16 +60,11 @@
                        'install_emulator_deps.py')
       return 1
 
-  if not install_emulator_deps.CheckSDK():
-    logging.critical('ERROR: Emulator SDK not installed. Run '
-                     'install_emulator_deps.py.')
-    return 1
-
   # If AVD is specified, check that the SDK has the required target. If not,
   # check that the SDK has the desired target for the temporary AVD's.
   api_level = options.api_level
   if options.name:
-    android = os.path.join(constants.EMULATOR_SDK_ROOT, 'sdk', 'tools',
+    android = os.path.join(constants.ANDROID_SDK_ROOT, 'tools',
                            'android')
     avds_output = cmd_helper.GetCmdOutput([android, 'list', 'avd'])
     names = re.findall(r'Name: (\w+)', avds_output)
diff --git a/build/android/devil/android/device_utils.py b/build/android/devil/android/device_utils.py
index 73ed277c..83a806f 100644
--- a/build/android/devil/android/device_utils.py
+++ b/build/android/devil/android/device_utils.py
@@ -1009,7 +1009,8 @@
       CommandTimeoutError on timeout.
       DeviceUnreachableError on missing device.
     """
-    self.RunShellCommand(['am', 'force-stop', package], check_return=True)
+    cmd = 'p=%s;if [[ "$(ps)" = *$p* ]]; then am force-stop $p; fi'
+    self.RunShellCommand(cmd % package, check_return=True)
 
   @decorators.WithTimeoutAndRetriesFromInstance()
   def ClearApplicationState(
diff --git a/build/android/devil/android/device_utils_test.py b/build/android/devil/android/device_utils_test.py
index e474e10..db59e65 100755
--- a/build/android/devil/android/device_utils_test.py
+++ b/build/android/devil/android/device_utils_test.py
@@ -627,8 +627,7 @@
         (self.call.device._ComputeStaleApks('test.package',
             ['/fake/test/app.apk']),
          ([], None)),
-        (self.call.device.RunShellCommand(['am', 'force-stop', 'test.package'],
-                                          check_return=True))):
+        (self.call.device.ForceStop('test.package'))):
       self.device.Install(DeviceUtilsInstallTest.mock_apk,
           reinstall=True, retries=0, permissions=[])
 
@@ -1320,7 +1319,8 @@
 
   def testForceStop(self):
     with self.assertCall(
-        self.call.adb.Shell('am force-stop test.package'),
+        self.call.adb.Shell('p=test.package;if [[ "$(ps)" = *$p* ]]; then '
+                            'am force-stop $p; fi'),
         ''):
       self.device.ForceStop('test.package')
 
diff --git a/build/android/instr_action.gypi b/build/android/emma_instr_action.gypi
similarity index 100%
rename from build/android/instr_action.gypi
rename to build/android/emma_instr_action.gypi
diff --git a/build/android/gyp/create_java_binary_script.py b/build/android/gyp/create_java_binary_script.py
index 0f07a1d..b73144b8 100755
--- a/build/android/gyp/create_java_binary_script.py
+++ b/build/android/gyp/create_java_binary_script.py
@@ -30,16 +30,18 @@
 
 self_dir = os.path.dirname(__file__)
 classpath = [{classpath}]
-extra_args = {extra_args}
+extra_java_args = {extra_java_args}
+extra_program_args = {extra_program_args}
 if os.getcwd() != self_dir:
   offset = os.path.relpath(self_dir, os.getcwd())
   classpath = [os.path.join(offset, p) for p in classpath]
-java_args = [
-  "java",
-  "-classpath", ":".join(classpath),
-  "-enableassertions",
-  \"{main_class}\"] + extra_args + sys.argv[1:]
-os.execvp("java", java_args)
+java_cmd = ["java"]
+java_cmd.extend(extra_java_args)
+java_cmd.extend(
+    ["-classpath", ":".join(classpath), "-enableassertions", \"{main_class}\"])
+java_cmd.extend(extra_program_args)
+java_cmd.extend(sys.argv[1:])
+os.execvp("java", java_cmd)
 """
 
 def main(argv):
@@ -52,20 +54,28 @@
       help='Name of the java class with the "main" entry point.')
   parser.add_option('--classpath', action='append',
       help='Classpath for running the jar.')
-  options, extra_args = parser.parse_args(argv)
+  parser.add_option('--extra-java-args',
+      help='Extra args passed to the "java" cmd')
+  options, extra_program_args = parser.parse_args(argv)
 
   classpath = [options.jar_path]
   for cp_arg in options.classpath:
     classpath += build_utils.ParseGypList(cp_arg)
 
+  if options.extra_java_args:
+    extra_java_args = build_utils.ParseGypList(options.extra_java_args)
+  else:
+    extra_java_args = []
+
   run_dir = os.path.dirname(options.output)
   classpath = [os.path.relpath(p, run_dir) for p in classpath]
 
   with open(options.output, 'w') as script:
     script.write(script_template.format(
+      extra_java_args=repr(extra_java_args),
       classpath=('"%s"' % '", "'.join(classpath)),
       main_class=options.main_class,
-      extra_args=repr(extra_args)))
+      extra_program_args=repr(extra_program_args)))
 
   os.chmod(options.output, 0750)
 
diff --git a/build/android/install_emulator_deps.py b/build/android/install_emulator_deps.py
index 31fcbf0b..354c59d 100755
--- a/build/android/install_emulator_deps.py
+++ b/build/android/install_emulator_deps.py
@@ -14,7 +14,6 @@
 import optparse
 import os
 import re
-import shutil
 import sys
 
 from devil.utils import cmd_helper
@@ -25,23 +24,9 @@
 # Android API level
 DEFAULT_ANDROID_API_LEVEL = constants.ANDROID_SDK_VERSION
 
-# From the Android Developer's website.
-# Keep this up to date; the user can install older API levels as necessary.
-SDK_BASE_URL = 'http://dl.google.com/android/adt'
-SDK_ZIP = 'adt-bundle-linux-x86_64-20131030.zip'
-
-# pylint: disable=line-too-long
-# Android x86 system image from the Intel website:
-# http://software.intel.com/en-us/articles/intel-eula-x86-android-4-2-jelly-bean-bin
-# These don't exist prior to Android-15.
-# As of 08 Nov 2013, Android-19 is not yet available either.
-X86_IMG_URLS = {
-  15: 'https://software.intel.com/sites/landingpage/android/sysimg_x86-15_r01.zip',
-  16: 'https://software.intel.com/sites/landingpage/android/sysimg_x86-16_r01.zip',
-  17: 'https://software.intel.com/sites/landingpage/android/sysimg_x86-17_r01.zip',
-  18: 'https://software.intel.com/sites/landingpage/android/sysimg_x86-18_r01.zip',
-  19: 'https://software.intel.com/sites/landingpage/android/sysimg_x86-19_r01.zip'}
-#pylint: enable=line-too-long
+# Default Time out for downloading SDK component
+DOWNLOAD_SYSTEM_IMAGE_TIMEOUT = 30
+DOWNLOAD_SDK_PLATFORM_TIMEOUT = 60
 
 def CheckSDK():
   """Check if SDK is already installed.
@@ -49,7 +34,7 @@
   Returns:
     True if the emulator SDK directory (src/android_emulator_sdk/) exists.
   """
-  return os.path.exists(constants.EMULATOR_SDK_ROOT)
+  return os.path.exists(constants.ANDROID_SDK_ROOT)
 
 
 def CheckSDKPlatform(api_level=DEFAULT_ANDROID_API_LEVEL):
@@ -63,8 +48,7 @@
   Returns:
     True if the platform is already installed.
   """
-  android_binary = os.path.join(constants.EMULATOR_SDK_ROOT,
-                                'sdk', 'tools', 'android')
+  android_binary = os.path.join(constants.ANDROID_SDK_ROOT, 'tools', 'android')
   pattern = re.compile('id: [0-9]+ or "android-%d"' % api_level)
   try:
     exit_code, stdout = cmd_helper.GetCmdStatusAndOutput(
@@ -87,13 +71,12 @@
     api_level: the Android API level to check for; defaults to the latest API.
 
   Returns:
-    True if sdk/system-images/android-<api_level>/x86 exists inside
-    EMULATOR_SDK_ROOT.
+    True if x86 image has been previously downloaded.
   """
   api_target = 'android-%d' % api_level
-  return os.path.exists(os.path.join(constants.EMULATOR_SDK_ROOT,
-                                     'sdk', 'system-images',
-                                     api_target, 'x86'))
+  return os.path.exists(os.path.join(constants.ANDROID_SDK_ROOT,
+                                     'system-images', api_target, 'default',
+                                     'x86'))
 
 
 def CheckKVM():
@@ -122,25 +105,6 @@
     return False
 
 
-def GetSDK():
-  """Download the SDK and unzip it into EMULATOR_SDK_ROOT."""
-  logging.info('Download Android SDK.')
-  sdk_url = '%s/%s' % (SDK_BASE_URL, SDK_ZIP)
-  try:
-    cmd_helper.RunCmd(['curl', '-o', '/tmp/sdk.zip', sdk_url])
-    print 'curled unzipping...'
-    rc = cmd_helper.RunCmd(['unzip', '-o', '/tmp/sdk.zip', '-d', '/tmp/'])
-    if rc:
-      raise Exception('ERROR: could not download/unzip Android SDK.')
-    # Get the name of the sub-directory that everything will be extracted to.
-    dirname, _ = os.path.splitext(SDK_ZIP)
-    zip_dir = '/tmp/%s' % dirname
-    # Move the extracted directory to EMULATOR_SDK_ROOT
-    shutil.move(zip_dir, constants.EMULATOR_SDK_ROOT)
-  finally:
-    os.unlink('/tmp/sdk.zip')
-
-
 def InstallKVM():
   """Installs KVM packages."""
   rc = cmd_helper.RunCmd(['sudo', 'apt-get', 'install', 'kvm'])
@@ -160,6 +124,48 @@
                      'AMD SVM).')
 
 
+def UpdateSDK(api_level, package_name, package_pattern, timeout):
+  """This function update SDK with a filter index.
+
+  Args:
+    api_level: the Android API level to download for.
+    package_name: logging name of package that is being updated.
+    package_pattern: the pattern to match the filter index from.
+    timeout: the amount of time wait for update command.
+  """
+  android_binary = os.path.join(constants.ANDROID_SDK_ROOT, 'tools', 'android')
+
+  list_sdk_repo_command = [android_binary, 'list', 'sdk', '--all']
+
+  exit_code, stdout = cmd_helper.GetCmdStatusAndOutput(list_sdk_repo_command)
+
+  if exit_code != 0:
+    raise Exception('\'android list sdk --all\' command return %d' % exit_code)
+
+  for line in stdout.split('\n'):
+    match = package_pattern.match(line)
+    if match:
+      index = match.group(1)
+      logging.info('package %s corresponds to %s with api level %d',
+                   index, package_name, api_level)
+      update_command = [android_binary, 'update', 'sdk', '--no-ui', '--all',
+                         '--filter', index]
+      update_command_str = ' '.join(update_command)
+      logging.info('running update command: %s', update_command_str)
+      update_process = pexpect.spawn(update_command_str)
+
+      if update_process.expect('Do you accept the license') != 0:
+        raise Exception('License agreement check failed')
+      update_process.sendline('y')
+      if update_process.expect(
+        'Done. 1 package installed.', timeout=timeout) == 0:
+        logging.info('Successfully installed %s for API level %d',
+                      package_name, api_level)
+        return
+      else:
+        raise Exception('Failed to install platform update')
+  raise Exception('Could not find android-%d update for the SDK!' % api_level)
+
 def GetX86Image(api_level=DEFAULT_ANDROID_API_LEVEL):
   """Download x86 system image from Intel's website.
 
@@ -167,24 +173,12 @@
     api_level: the Android API level to download for.
   """
   logging.info('Download x86 system image directory into sdk directory.')
-  # TODO(andrewhayden): Use python tempfile lib instead
-  temp_file = '/tmp/x86_img_android-%d.zip' % api_level
-  if api_level not in X86_IMG_URLS:
-    raise Exception('ERROR: no URL known for x86 image for android-%s' %
-                    api_level)
-  try:
-    cmd_helper.RunCmd(['curl', '-o', temp_file, X86_IMG_URLS[api_level]])
-    rc = cmd_helper.RunCmd(['unzip', '-o', temp_file, '-d', '/tmp/'])
-    if rc:
-      raise Exception('ERROR: Could not download/unzip image zip.')
-    api_target = 'android-%d' % api_level
-    sys_imgs = os.path.join(constants.EMULATOR_SDK_ROOT, 'sdk',
-                            'system-images', api_target, 'x86')
-    logging.info('Deploying system image to %s', sys_imgs)
-    shutil.move('/tmp/x86', sys_imgs)
-  finally:
-    os.unlink(temp_file)
 
+  x86_package_pattern = re.compile(
+    r'\s*([0-9]+)- Intel x86 Atom System Image, Android API %d.*' % api_level)
+
+  UpdateSDK(api_level, 'x86 system image', x86_package_pattern,
+            DOWNLOAD_SYSTEM_IMAGE_TIMEOUT)
 
 def GetSDKPlatform(api_level=DEFAULT_ANDROID_API_LEVEL):
   """Update the SDK to include the platform specified.
@@ -192,63 +186,40 @@
   Args:
     api_level: the Android API level to download
   """
-  android_binary = os.path.join(constants.EMULATOR_SDK_ROOT,
-                                'sdk', 'tools', 'android')
-  pattern = re.compile(
+  logging.info('Download SDK Platform directory into sdk directory.')
+
+  platform_package_pattern = re.compile(
       r'\s*([0-9]+)- SDK Platform Android [\.,0-9]+, API %d.*' % api_level)
-  # Example:
-  #   2- SDK Platform Android 4.3, API 18, revision 2
-  exit_code, stdout = cmd_helper.GetCmdStatusAndOutput(
-      [android_binary, 'list', 'sdk'])
-  if exit_code != 0:
-    raise Exception('\'android list sdk\' command return %d' % exit_code)
-  for line in stdout.split('\n'):
-    match = pattern.match(line)
-    if match:
-      index = match.group(1)
-      print 'package %s corresponds to platform level %d' % (index, api_level)
-      # update sdk --no-ui --filter $INDEX
-      update_command = [android_binary,
-                        'update', 'sdk', '--no-ui', '--filter', index]
-      update_command_str = ' '.join(update_command)
-      logging.info('running update command: %s', update_command_str)
-      update_process = pexpect.spawn(update_command_str)
-      # TODO(andrewhayden): Do we need to bug the user about this?
-      if update_process.expect('Do you accept the license') != 0:
-        raise Exception('License agreement check failed')
-      update_process.sendline('y')
-      if update_process.expect('Done. 1 package installed.') == 0:
-        print 'Successfully installed platform for API level %d' % api_level
-        return
-      else:
-        raise Exception('Failed to install platform update')
-  raise Exception('Could not find android-%d update for the SDK!' % api_level)
+
+  UpdateSDK(api_level, 'SDK Platform', platform_package_pattern,
+            DOWNLOAD_SDK_PLATFORM_TIMEOUT)
 
 
 def main(argv):
   opt_parser = optparse.OptionParser(
       description='Install dependencies for running the Android emulator')
-  opt_parser.add_option('--api-level', dest='api_level',
-      help='The API level (e.g., 19 for Android 4.4) to ensure is available',
-      type='int', default=DEFAULT_ANDROID_API_LEVEL)
-  opt_parser.add_option('-v', dest='verbose', action='store_true',
-      help='enable verbose logging')
+  opt_parser.add_option('--api-level',
+                        dest='api_level',
+                        help=('The API level (e.g., 19 for Android 4.4) to '
+                              'ensure is available'),
+                        type='int',
+                        default=DEFAULT_ANDROID_API_LEVEL)
+  opt_parser.add_option('-v',
+                        dest='verbosity',
+                        default=1,
+                        action='count',
+                        help='Verbose level (multiple times for more)')
   options, _ = opt_parser.parse_args(argv[1:])
 
-  # run_tests_helper will set logging to INFO or DEBUG
-  # We achieve verbose output by configuring it with 2 (==DEBUG)
-  verbosity = 1
-  if options.verbose:
-    verbosity = 2
-  logging.basicConfig(level=logging.INFO,
-                      format='# %(asctime)-15s: %(message)s')
-  run_tests_helper.SetLogLevel(verbose_count=verbosity)
+  run_tests_helper.SetLogLevel(verbose_count=options.verbosity)
 
   # Calls below will download emulator SDK and/or system images only if needed.
   if CheckSDK():
-    logging.info('android_emulator_sdk/ already exists, skipping download.')
+    logging.info('android_emulator_sdk/ exists')
   else:
-    GetSDK()
+    logging.critical('ERROR: Emulator SDK not installed in %s'
+                     , constants.ANDROID_SDK_ROOT)
+    return 1
 
   # Check target. The target has to be installed in order to run the emulator.
   if CheckSDKPlatform(options.api_level):
diff --git a/build/android/lint/suppressions.xml b/build/android/lint/suppressions.xml
index 97d5373..3a6eca8 100644
--- a/build/android/lint/suppressions.xml
+++ b/build/android/lint/suppressions.xml
@@ -41,6 +41,10 @@
   <issue id="HandlerLeak">
     <ignore path="remoting/android/java/src/org/chromium/chromoting/TapGestureDetector.java"/>
   </issue>
+  <issue id="IconMissingDensityFolder">
+    <!-- see crbug.com/542435 -->
+    <ignore path="android_webview/apk/java/res" />
+  </issue>
   <issue id="IconDensities">
     <!-- crbug.com/457918 is tracking missing assets -->
     <ignore path="components/web_contents_delegate_android/android/java/res/drawable-xxhdpi"/>
diff --git a/build/android/pylib/constants/__init__.py b/build/android/pylib/constants/__init__.py
index c23edf6..dab836ac 100644
--- a/build/android/pylib/constants/__init__.py
+++ b/build/android/pylib/constants/__init__.py
@@ -166,10 +166,6 @@
 PROGUARD_SCRIPT_PATH = os.path.join(
     ANDROID_SDK_ROOT, 'tools', 'proguard', 'bin', 'proguard.sh')
 
-EMULATOR_SDK_ROOT = os.environ.get('ANDROID_EMULATOR_SDK_ROOT',
-                                   os.path.join(DIR_SOURCE_ROOT,
-                                                'android_emulator_sdk'))
-
 PROGUARD_ROOT = os.path.join(DIR_SOURCE_ROOT, 'third_party', 'proguard')
 
 BAD_DEVICES_JSON = os.path.join(DIR_SOURCE_ROOT,
diff --git a/build/android/pylib/gtest/gtest_test_instance.py b/build/android/pylib/gtest/gtest_test_instance.py
index c32adb28..e61b89c 100644
--- a/build/android/pylib/gtest/gtest_test_instance.py
+++ b/build/android/pylib/gtest/gtest_test_instance.py
@@ -197,6 +197,10 @@
       self._app_data_files = None
       self._app_data_file_dir = None
 
+  @property
+  def gtest_filter(self):
+    return self._gtest_filter
+
   #override
   def TestType(self):
     return 'gtest'
diff --git a/build/android/pylib/instrumentation/test_runner.py b/build/android/pylib/instrumentation/test_runner.py
index 9473566..ae6fb83 100644
--- a/build/android/pylib/instrumentation/test_runner.py
+++ b/build/android/pylib/instrumentation/test_runner.py
@@ -196,20 +196,21 @@
 
     self.tool.CleanUpEnvironment()
 
-    # The logic below relies on the test passing.
-    if not result or not result.DidRunPass():
+    if not result:
       return
+    if result.DidRunPass():
+      self.TearDownPerfMonitoring(test)
 
-    self.TearDownPerfMonitoring(test)
+      if self.flags and self._IsFreTest(test):
+        self.flags.AddFlags(['--disable-fre'])
 
-    if self.flags and self._IsFreTest(test):
-      self.flags.AddFlags(['--disable-fre'])
-
-    if self.coverage_dir:
-      self.device.PullFile(
-          self.coverage_device_file, self.coverage_host_file)
-      self.device.RunShellCommand(
-          'rm -f %s' % self.coverage_device_file)
+      if self.coverage_dir:
+        self.device.PullFile(
+            self.coverage_device_file, self.coverage_host_file)
+        self.device.RunShellCommand(
+            'rm -f %s' % self.coverage_device_file)
+    elif self.package_info:
+      self.device.ClearApplicationState(self.package_info.package)
 
   def TearDownPerfMonitoring(self, test):
     """Cleans up performance monitoring if the specified test required it.
diff --git a/build/android/pylib/local/device/local_device_gtest_run.py b/build/android/pylib/local/device/local_device_gtest_run.py
index 85af2bc..81d85fd 100644
--- a/build/android/pylib/local/device/local_device_gtest_run.py
+++ b/build/android/pylib/local/device/local_device_gtest_run.py
@@ -52,6 +52,32 @@
         break
     device.PullFile(device_file, host_file)
 
+
+def _ExtractTestsFromFilter(gtest_filter):
+  """Returns the list of tests specified by the given filter.
+
+  Returns:
+    None if the device should be queried for the test list instead.
+  """
+  # Empty means all tests, - means exclude filter.
+  if not gtest_filter or '-' in gtest_filter:
+    return None
+
+  patterns = gtest_filter.split(':')
+  # For a single pattern, allow it even if it has a wildcard so long as the
+  # wildcard comes at the end and there is at least one . to prove the scope is
+  # not too large.
+  # This heuristic is not necessarily faster, but normally is.
+  if len(patterns) == 1 and patterns[0].endswith('*'):
+    no_suffix = patterns[0].rstrip('*')
+    if '*' not in no_suffix and '.' in no_suffix:
+      return patterns
+
+  if '*' in gtest_filter:
+    return None
+  return patterns
+
+
 class _ApkDelegate(object):
   def __init__(self, test_instance):
     self._activity = test_instance.activity
@@ -221,6 +247,16 @@
 
   #override
   def _GetTests(self):
+    # When the exact list of tests to run is given via command-line (e.g. when
+    # locally iterating on a specific test), skip querying the device (which
+    # takes ~3 seconds).
+    tests = _ExtractTestsFromFilter(self._test_instance.gtest_filter)
+    if tests:
+      return tests
+
+    # Even when there's only one device, it still makes sense to retrieve the
+    # test list so that tests can be split up and run in batches rather than all
+    # at once (since test output is not streamed).
     @local_device_test_run.handle_shard_failures_with(
         on_failure=self._env.BlacklistDevice)
     def list_tests(dev):
@@ -230,9 +266,11 @@
       tests = self._test_instance.FilterTests(tests)
       return tests
 
+    # Query all devices in case one fails.
     test_lists = self._env.parallel_devices.pMap(list_tests).pGet(None)
-    tests = list(sorted(set().union(*[set(tl) for tl in test_lists if tl])))
-    return tests
+    # TODO(agrieve): Make this fail rather than return an empty list when
+    #     all devices fail.
+    return list(sorted(set().union(*[set(tl) for tl in test_lists if tl])))
 
   #override
   def _RunTest(self, device, test):
diff --git a/build/android/pylib/local/device/local_device_instrumentation_test_run.py b/build/android/pylib/local/device/local_device_instrumentation_test_run.py
index daf2a7d7..afae9ab 100644
--- a/build/android/pylib/local/device/local_device_instrumentation_test_run.py
+++ b/build/android/pylib/local/device/local_device_instrumentation_test_run.py
@@ -167,6 +167,8 @@
       for r in results:
         if r.GetType() == base_test_result.ResultType.UNKNOWN:
           r.SetType(base_test_result.ResultType.CRASH)
+    # TODO(jbudorick): ClearApplicationState on failure before switching
+    # instrumentation tests to platform mode.
     return results
 
   #override
diff --git a/build/android/pylib/utils/emulator.py b/build/android/pylib/utils/emulator.py
index 05fb9cfd..a4222b4 100644
--- a/build/android/pylib/utils/emulator.py
+++ b/build/android/pylib/utils/emulator.py
@@ -49,7 +49,7 @@
 hw.device.name=Galaxy Nexus
 hw.battery=yes
 hw.sensors.proximity=yes
-image.sysdir.1=system-images/android-{api.level}/{abi.type}/
+image.sysdir.1=system-images/android-{api.level}/default/{abi.type}/
 hw.sensors.orientation=yes
 hw.audioInput=yes
 hw.camera.front=none
@@ -234,7 +234,7 @@
       avd_name: name of the AVD to create
       abi: target platform for emulator being created, defaults to x86
     """
-    android_sdk_root = os.path.join(constants.EMULATOR_SDK_ROOT, 'sdk')
+    android_sdk_root = constants.ANDROID_SDK_ROOT
     self.emulator = os.path.join(android_sdk_root, 'tools', 'emulator')
     self.android = os.path.join(android_sdk_root, 'tools', 'android')
     self.popen = None
diff --git a/build/apk_browsertest.gypi b/build/apk_browsertest.gypi
index 316f52f..8cbc413 100644
--- a/build/apk_browsertest.gypi
+++ b/build/apk_browsertest.gypi
@@ -27,17 +27,18 @@
     '<(DEPTH)/tools/android/android_tools.gyp:android_tools',
   ],
   'conditions': [
-     ['OS == "android"', {
-       'variables': {
-         # These are used to configure java_apk.gypi included below.
-         'apk_name': '<(test_suite_name)',
-         'intermediate_dir': '<(PRODUCT_DIR)/<(test_suite_name)_apk',
-         'final_apk_path': '<(intermediate_dir)/<(test_suite_name)-debug.apk',
-         'native_lib_target': 'lib<(test_suite_name)',
-         # TODO(yfriedman, cjhopman): Support managed installs for gtests.
-         'gyp_managed_install': 0,
-       },
-       'includes': [ 'java_apk.gypi' ],
-     }],  # 'OS == "android"
+    ['OS == "android"', {
+      'variables': {
+        # These are used to configure java_apk.gypi included below.
+        'test_type': 'gtest',
+        'apk_name': '<(test_suite_name)',
+        'intermediate_dir': '<(PRODUCT_DIR)/<(test_suite_name)_apk',
+        'final_apk_path': '<(intermediate_dir)/<(test_suite_name)-debug.apk',
+        'native_lib_target': 'lib<(test_suite_name)',
+        # TODO(yfriedman, cjhopman): Support managed installs for gtests.
+        'gyp_managed_install': 0,
+      },
+      'includes': [ 'java_apk.gypi', 'android/test_runner.gypi' ],
+    }],  # 'OS == "android"
   ],  # conditions
 }
diff --git a/build/config/android/internal_rules.gni b/build/config/android/internal_rules.gni
index 19318a7..6950cca 100644
--- a/build/config/android/internal_rules.gni
+++ b/build/config/android/internal_rules.gni
@@ -166,6 +166,12 @@
     if (defined(invoker.wrapper_script_args)) {
       args += [ "--" ] + invoker.wrapper_script_args
     }
+    if (defined(invoker.extra_java_args)) {
+      args += [
+        "--extra-java-args",
+        invoker.extra_java_args,
+      ]
+    }
   }
 }
 
@@ -982,9 +988,14 @@
   if (defined(invoker.main_class)) {
     binary_script_target_name = "${_template_name}__java_binary_script"
     java_binary_script(binary_script_target_name) {
+      forward_variables_from(invoker,
+                             [
+                               "extra_java_args",
+                               "main_class",
+                               "wrapper_script_args",
+                             ])
       build_config = _build_config
       jar_path = _jar_path
-      main_class = invoker.main_class
       script_name = _template_name
       deps = [
         ":$build_config_target_name",
@@ -1322,6 +1333,7 @@
     java_binary_script("${_template_name}__java_binary_script") {
       forward_variables_from(invoker,
                              [
+                               "extra_java_args",
                                "main_class",
                                "wrapper_script_args",
                              ])
diff --git a/build/gn_migration.gypi b/build/gn_migration.gypi
index 2e83a2b..1c97307 100644
--- a/build/gn_migration.gypi
+++ b/build/gn_migration.gypi
@@ -183,6 +183,7 @@
         '../third_party/mojo/mojo_edk_tests.gyp:mojo_public_system_perftests',
         '../third_party/mojo/mojo_edk_tests.gyp:mojo_public_system_unittests',
         '../third_party/mojo/mojo_edk_tests.gyp:mojo_public_utility_unittests',
+        '../third_party/openh264/tests/openh264_unittests.gyp:*',
         '../third_party/pdfium/samples/samples.gyp:pdfium_diff',
         '../third_party/pdfium/samples/samples.gyp:pdfium_test',
         '../third_party/smhasher/smhasher.gyp:pmurhash',
diff --git a/build/java.gypi b/build/java.gypi
index 0fdf19b..6f55c1b 100644
--- a/build/java.gypi
+++ b/build/java.gypi
@@ -61,7 +61,7 @@
     'jar_path': '<(intermediate_dir)/<(jar_name)',
     'jar_final_path': '<(jar_dir)/<(jar_name)',
     'jar_excluded_classes': [ '*/R.class', '*/R##*.class' ],
-    'instr_stamp': '<(intermediate_dir)/instr.stamp',
+    'emma_instr_stamp': '<(intermediate_dir)/emma_instr.stamp',
     'additional_input_paths': [],
     'additional_locale_input_paths': [],
     'dex_path': '<(PRODUCT_DIR)/lib.java/<(_target_name).dex.jar',
@@ -335,12 +335,12 @@
       'includes': [ 'android/main_dex_action.gypi' ],
     },
     {
-      'action_name': 'instr_jar_<(_target_name)',
+      'action_name': 'emma_instr_jar_<(_target_name)',
       'message': 'Instrumenting <(_target_name) jar',
       'variables': {
         'input_path': '<(jar_path)',
         'output_path': '<(jar_final_path)',
-        'stamp_path': '<(instr_stamp)',
+        'stamp_path': '<(emma_instr_stamp)',
         'instr_type': 'jar',
       },
       'outputs': [
@@ -349,7 +349,7 @@
       'inputs': [
         '<(jar_path)',
       ],
-      'includes': [ 'android/instr_action.gypi' ],
+      'includes': [ 'android/emma_instr_action.gypi' ],
     },
     {
       'variables': {
diff --git a/build/java_apk.gypi b/build/java_apk.gypi
index dfc103a5..e1c2f8f 100644
--- a/build/java_apk.gypi
+++ b/build/java_apk.gypi
@@ -130,7 +130,7 @@
     'findbugs_stamp': '<(intermediate_dir)/findbugs.stamp',
     'run_findbugs%': 0,
     'java_in_dir_suffix%': '/src',
-    'instr_stamp': '<(intermediate_dir)/instr.stamp',
+    'emma_instr_stamp': '<(intermediate_dir)/emma_instr.stamp',
     'jar_stamp': '<(intermediate_dir)/jar.stamp',
     'obfuscate_stamp': '<(intermediate_dir)/obfuscate.stamp',
     'pack_relocations_stamp': '<(intermediate_dir)/pack_relocations.stamp',
@@ -937,22 +937,22 @@
       'includes': [ 'android/main_dex_action.gypi' ],
     },
     {
-      'action_name': 'instr_jar_<(_target_name)',
+      'action_name': 'emma_instr_jar_<(_target_name)',
       'message': 'Instrumenting <(_target_name) jar',
       'variables': {
         'input_path': '<(javac_jar_path)',
         'output_path': '<(jar_path)',
-        'stamp_path': '<(instr_stamp)',
+        'stamp_path': '<(emma_instr_stamp)',
         'instr_type': 'jar',
       },
       'outputs': [
-        '<(instr_stamp)',
+        '<(emma_instr_stamp)',
         '<(jar_path)',
       ],
       'inputs': [
         '<(javac_jar_path)',
       ],
-      'includes': [ 'android/instr_action.gypi' ],
+      'includes': [ 'android/emma_instr_action.gypi' ],
     },
     {
       'variables': {
@@ -1019,7 +1019,7 @@
         '>@(proguard_flags_paths)',
         '>@(obfuscate_input_jars_paths)',
         '>@(additional_obfuscate_input_paths)',
-        '<(instr_stamp)',
+        '<(emma_instr_stamp)',
       ],
       'outputs': [
         '<(obfuscate_stamp)',
@@ -1112,7 +1112,7 @@
         ['proguard_enabled == "true"', {
           'inputs': [ '<(obfuscate_stamp)' ]
         }, {
-          'inputs': [ '<(instr_stamp)' ]
+          'inputs': [ '<(emma_instr_stamp)' ]
         }],
       ],
       'includes': [ 'android/dex_action.gypi' ],
diff --git a/build/sanitizers/lsan_suppressions.cc b/build/sanitizers/lsan_suppressions.cc
index dd94d422..d1c9d22c 100644
--- a/build/sanitizers/lsan_suppressions.cc
+++ b/build/sanitizers/lsan_suppressions.cc
@@ -51,6 +51,9 @@
 // http://crbug.com/431213, http://crbug.com/416665
 "leak:gin/object_template_builder.h\n"
 
+// Leaks in swrast_dri.so. http://crbug.com/540042
+"leak:swrast_dri.so\n"
+
 // ================ Leaks in Chromium code ================
 // PLEASE DO NOT ADD SUPPRESSIONS FOR NEW LEAKS.
 // Instead, commits that introduce memory leaks should be reverted. Suppressing
diff --git a/build/secondary/third_party/android_tools/BUILD.gn b/build/secondary/third_party/android_tools/BUILD.gn
index e906290..4e38b93 100644
--- a/build/secondary/third_party/android_tools/BUILD.gn
+++ b/build/secondary/third_party/android_tools/BUILD.gn
@@ -20,10 +20,6 @@
   configs += [ "//build/config/compiler:no_chromium_code" ]
 }
 
-android_library("preview_java_sources") {
-  DEPRECATED_java_in_dir = "$android_sdk_root/sources/preview_sources/src"
-}
-
 android_java_prebuilt("android_gcm_java") {
   jar_path = "$android_sdk_root/extras/google/gcm/gcm-client/dist/gcm.jar"
 }
diff --git a/build_overrides/webrtc.gni b/build_overrides/webrtc.gni
new file mode 100644
index 0000000..c521db7
--- /dev/null
+++ b/build_overrides/webrtc.gni
@@ -0,0 +1,12 @@
+# 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.
+
+build_with_chromium = true
+
+# Exclude pulse audio on Chromium since its prerequisites don't require
+# pulse audio.
+rtc_include_pulse_audio = false
+
+# Exclude internal ADM since Chromium uses its own IO handling.
+rtc_include_internal_audio_device = false
diff --git a/cc/debug/debug_colors.cc b/cc/debug/debug_colors.cc
index 38ecf54..55d71198 100644
--- a/cc/debug/debug_colors.cc
+++ b/cc/debug/debug_colors.cc
@@ -280,19 +280,24 @@
 // ======= HUD widget colors =======
 
 SkColor DebugColors::HUDBackgroundColor() {
-  return SkColorSetARGB(215, 17, 17, 17);
+  return SkColorSetARGB(208, 17, 17, 17);
 }
 SkColor DebugColors::HUDSeparatorLineColor() {
-  return SkColorSetARGB(255, 130, 130, 130);
+  return SkColorSetARGB(64, 0, 255, 0);
 }
 SkColor DebugColors::HUDIndicatorLineColor() {
-  return SkColorSetARGB(255, 80, 80, 80);
+  return SK_ColorYELLOW;
+}
+SkColor DebugColors::HUDTitleColor() {
+  return SkColorSetARGB(255, 232, 232, 232);
 }
 
 SkColor DebugColors::PlatformLayerTreeTextColor() { return SK_ColorRED; }
-SkColor DebugColors::FPSDisplayTextAndGraphColor() { return SK_ColorRED; }
+SkColor DebugColors::FPSDisplayTextAndGraphColor() {
+  return SK_ColorGREEN;
+}
 SkColor DebugColors::MemoryDisplayTextColor() {
-  return SkColorSetARGB(255, 220, 220, 220);
+  return SK_ColorCYAN;
 }
 
 // Paint time display in green (similar to paint times in the WebInspector)
diff --git a/cc/debug/debug_colors.h b/cc/debug/debug_colors.h
index 8e4ec8d..1efabde8 100644
--- a/cc/debug/debug_colors.h
+++ b/cc/debug/debug_colors.h
@@ -115,6 +115,7 @@
   static SkColor HUDBackgroundColor();
   static SkColor HUDSeparatorLineColor();
   static SkColor HUDIndicatorLineColor();
+  static SkColor HUDTitleColor();
 
   static SkColor PlatformLayerTreeTextColor();
   static SkColor FPSDisplayTextAndGraphColor();
diff --git a/cc/layers/heads_up_display_layer_impl.cc b/cc/layers/heads_up_display_layer_impl.cc
index 1f76509..6fa7e81 100644
--- a/cc/layers/heads_up_display_layer_impl.cc
+++ b/cc/layers/heads_up_display_layer_impl.cc
@@ -22,8 +22,10 @@
 #include "skia/ext/platform_canvas.h"
 #include "third_party/skia/include/core/SkPaint.h"
 #include "third_party/skia/include/core/SkPath.h"
+#include "third_party/skia/include/core/SkRRect.h"
 #include "third_party/skia/include/core/SkTypeface.h"
 #include "third_party/skia/include/effects/SkColorMatrixFilter.h"
+#include "third_party/skia/include/effects/SkGradientShader.h"
 #include "ui/gfx/geometry/point.h"
 #include "ui/gfx/geometry/size.h"
 #include "ui/gfx/geometry/size_conversions.h"
@@ -275,7 +277,7 @@
   area = DrawGpuRasterizationStatus(canvas, 0, area.bottom(),
                                     SkMaxScalar(area.width(), 150));
 
-  if (debug_state.ShowMemoryStats())
+  if (debug_state.ShowMemoryStats() && memory_entry_.total_bytes_used)
     DrawMemoryDisplay(canvas, 0, area.bottom(), SkMaxScalar(area.width(), 150));
 }
 int HeadsUpDisplayLayerImpl::MeasureText(SkPaint* paint,
@@ -361,7 +363,8 @@
   const int kPadding = 4;
   const int kGap = 6;
 
-  const int kFontHeight = 15;
+  const int kTitleFontHeight = 13;
+  const int kFontHeight = 12;
 
   const int kGraphWidth =
       base::saturated_cast<int>(fps_counter->time_stamp_history_size()) - 2;
@@ -370,18 +373,19 @@
   const int kHistogramWidth = 37;
 
   int width = kGraphWidth + kHistogramWidth + 4 * kPadding;
-  int height = kFontHeight + kGraphHeight + 4 * kPadding + 2;
+  int height = kTitleFontHeight + kFontHeight + kGraphHeight + 6 * kPadding + 2;
   int left = bounds().width() - width - right;
   SkRect area = SkRect::MakeXYWH(left, top, width, height);
 
   SkPaint paint = CreatePaint();
   DrawGraphBackground(canvas, &paint, area);
 
+  SkRect title_bounds = SkRect::MakeXYWH(
+      left + kPadding, top + kPadding, kGraphWidth + kHistogramWidth + kGap + 2,
+      kTitleFontHeight);
   SkRect text_bounds =
-      SkRect::MakeXYWH(left + kPadding,
-                       top + kPadding,
-                       kGraphWidth + kHistogramWidth + kGap + 2,
-                       kFontHeight);
+      SkRect::MakeXYWH(left + kPadding, title_bounds.bottom() + 2 * kPadding,
+                       kGraphWidth + kHistogramWidth + kGap + 2, kFontHeight);
   SkRect graph_bounds = SkRect::MakeXYWH(left + kPadding,
                                          text_bounds.bottom() + 2 * kPadding,
                                          kGraphWidth,
@@ -391,13 +395,18 @@
                                              kHistogramWidth,
                                              kGraphHeight);
 
+  const std::string title("Frame Rate");
   const std::string value_text =
-      base::StringPrintf("FPS:%5.1f", fps_graph_.value);
+      base::StringPrintf("%5.1f fps", fps_graph_.value);
   const std::string min_max_text =
       base::StringPrintf("%.0f-%.0f", fps_graph_.min, fps_graph_.max);
 
   VLOG(1) << value_text;
 
+  paint.setColor(DebugColors::HUDTitleColor());
+  DrawText(canvas, &paint, title, SkPaint::kLeft_Align, kTitleFontHeight,
+           title_bounds.left(), title_bounds.bottom());
+
   paint.setColor(DebugColors::FPSDisplayTextAndGraphColor());
   DrawText(canvas,
            &paint,
@@ -498,13 +507,11 @@
                                                   int right,
                                                   int top,
                                                   int width) const {
-  if (!memory_entry_.total_bytes_used)
-    return SkRect::MakeEmpty();
-
   const int kPadding = 4;
-  const int kFontHeight = 13;
+  const int kTitleFontHeight = 13;
+  const int kFontHeight = 12;
 
-  const int height = 3 * kFontHeight + 4 * kPadding;
+  const int height = kTitleFontHeight + 2 * kFontHeight + 5 * kPadding;
   const int left = bounds().width() - width - right;
   const SkRect area = SkRect::MakeXYWH(left, top, width, height);
 
@@ -513,20 +520,18 @@
   SkPaint paint = CreatePaint();
   DrawGraphBackground(canvas, &paint, area);
 
-  SkPoint title_pos = SkPoint::Make(left + kPadding, top + kFontHeight);
+  SkPoint title_pos =
+      SkPoint::Make(left + kPadding, top + kFontHeight + kPadding);
   SkPoint stat1_pos = SkPoint::Make(left + width - kPadding - 1,
                                     top + kPadding + 2 * kFontHeight);
   SkPoint stat2_pos = SkPoint::Make(left + width - kPadding - 1,
                                     top + 2 * kPadding + 3 * kFontHeight);
 
-  paint.setColor(DebugColors::MemoryDisplayTextColor());
-  DrawText(canvas,
-           &paint,
-           "GPU memory",
-           SkPaint::kLeft_Align,
-           kFontHeight,
+  paint.setColor(DebugColors::HUDTitleColor());
+  DrawText(canvas, &paint, "GPU Memory", SkPaint::kLeft_Align, kTitleFontHeight,
            title_pos);
 
+  paint.setColor(DebugColors::MemoryDisplayTextColor());
   std::string text = base::StringPrintf(
       "%6.1f MB used", memory_entry_.total_bytes_used / kMegabyte);
   DrawText(canvas, &paint, text, SkPaint::kRight_Align, kFontHeight, stat1_pos);
@@ -537,6 +542,45 @@
                             memory_entry_.total_budget_in_bytes / kMegabyte);
   DrawText(canvas, &paint, text, SkPaint::kRight_Align, kFontHeight, stat2_pos);
 
+  // Draw memory graph.
+  int length = 2 * kFontHeight + kPadding + 12;
+  SkRect oval =
+      SkRect::MakeXYWH(left + kPadding * 6,
+                       top + kTitleFontHeight + kPadding * 3, length, length);
+  paint.setAntiAlias(true);
+  paint.setStyle(SkPaint::kFill_Style);
+
+  paint.setColor(SkColorSetARGB(64, 255, 255, 0));
+  canvas->drawArc(oval, 180, 180, true, paint);
+
+  int radius = length / 2;
+  int cx = oval.left() + radius;
+  int cy = oval.top() + radius;
+  double angle = ((double)memory_entry_.total_bytes_used /
+                  memory_entry_.total_budget_in_bytes) *
+                 180;
+
+  SkColor colors[] = {SK_ColorRED, SK_ColorGREEN, SK_ColorGREEN,
+                      SkColorSetARGB(255, 255, 140, 0), SK_ColorRED};
+  const SkScalar pos[] = {SkFloatToScalar(0.2f), SkFloatToScalar(0.4f),
+                          SkFloatToScalar(0.6f), SkFloatToScalar(0.8f),
+                          SkFloatToScalar(1.0f)};
+  skia::RefPtr<SkShader> gradient_shader =
+      skia::AdoptRef(SkGradientShader::CreateSweep(cx, cy, colors, pos, 5));
+  paint.setShader(gradient_shader.get());
+  paint.setFlags(SkPaint::kAntiAlias_Flag);
+
+  // Draw current status.
+  paint.setStyle(SkPaint::kStroke_Style);
+  paint.setAlpha(32);
+  paint.setStrokeWidth(4);
+  canvas->drawArc(oval, 180, angle, true, paint);
+
+  paint.setStyle(SkPaint::kFill_Style);
+  paint.setColor(SkColorSetARGB(255, 0, 255, 0));
+  canvas->drawArc(oval, 180, angle, true, paint);
+  paint.setShader(NULL);
+
   return area;
 }
 
@@ -577,9 +621,10 @@
     return SkRect::MakeEmpty();
 
   const int kPadding = 4;
-  const int kFontHeight = 13;
+  const int kTitleFontHeight = 13;
+  const int kFontHeight = 12;
 
-  const int height = 2 * kFontHeight + 3 * kPadding;
+  const int height = kTitleFontHeight + kFontHeight + 3 * kPadding;
   const int left = bounds().width() - width - right;
   const SkRect area = SkRect::MakeXYWH(left, top, width, height);
 
@@ -588,10 +633,10 @@
 
   SkPoint gpu_status_pos = SkPoint::Make(left + width - kPadding,
                                          top + 2 * kFontHeight + 2 * kPadding);
-
-  paint.setColor(color);
-  DrawText(canvas, &paint, "GPU raster: ", SkPaint::kLeft_Align, kFontHeight,
+  paint.setColor(DebugColors::HUDTitleColor());
+  DrawText(canvas, &paint, "GPU Raster", SkPaint::kLeft_Align, kTitleFontHeight,
            left + kPadding, top + kFontHeight + kPadding);
+  paint.setColor(color);
   DrawText(canvas, &paint, status, SkPaint::kRight_Align, kFontHeight,
            gpu_status_pos);
 
diff --git a/cc/layers/layer.cc b/cc/layers/layer.cc
index 4b9162ff..9db52869 100644
--- a/cc/layers/layer.cc
+++ b/cc/layers/layer.cc
@@ -1436,7 +1436,12 @@
 }
 
 void Layer::OnOpacityAnimated(float opacity) {
+  if (opacity_ == opacity)
+    return;
   opacity_ = opacity;
+  // Changing the opacity may make a previously hidden layer visible, so a new
+  // recording may be needed.
+  SetNeedsUpdate();
   if (layer_tree_host_) {
     if (EffectNode* node = layer_tree_host_->property_trees()->effect_tree.Node(
             effect_tree_index())) {
@@ -1453,6 +1458,9 @@
     return;
   transform_ = transform;
   transform_is_invertible_ = transform.IsInvertible();
+  // Changing the transform may change the visible part of this layer, so a new
+  // recording may be needed.
+  SetNeedsUpdate();
   if (layer_tree_host_) {
     if (TransformNode* node =
             layer_tree_host_->property_trees()->transform_tree.Node(
diff --git a/cc/layers/layer.h b/cc/layers/layer.h
index 800deff5..2fec3636 100644
--- a/cc/layers/layer.h
+++ b/cc/layers/layer.h
@@ -503,6 +503,18 @@
   void set_sorted_for_recursion(bool sorted_for_recursion);
   bool sorted_for_recursion();
 
+  // LayerAnimationValueProvider implementation.
+  gfx::ScrollOffset ScrollOffsetForAnimation() const override;
+
+  // LayerAnimationValueObserver implementation.
+  void OnFilterAnimated(const FilterOperations& filters) override;
+  void OnOpacityAnimated(float opacity) override;
+  void OnTransformAnimated(const gfx::Transform& transform) override;
+  void OnScrollOffsetAnimated(const gfx::ScrollOffset& scroll_offset) override;
+  void OnAnimationWaitingForDeletion() override;
+  void OnTransformIsPotentiallyAnimatingChanged(bool is_animating) override;
+  bool IsActive() const override;
+
  protected:
   friend class LayerImpl;
   friend class TreeSynchronizer;
@@ -594,18 +606,6 @@
   // This should only be called from RemoveFromParent().
   void RemoveChildOrDependent(Layer* child);
 
-  // LayerAnimationValueProvider implementation.
-  gfx::ScrollOffset ScrollOffsetForAnimation() const override;
-
-  // LayerAnimationValueObserver implementation.
-  void OnFilterAnimated(const FilterOperations& filters) override;
-  void OnOpacityAnimated(float opacity) override;
-  void OnTransformAnimated(const gfx::Transform& transform) override;
-  void OnScrollOffsetAnimated(const gfx::ScrollOffset& scroll_offset) override;
-  void OnAnimationWaitingForDeletion() override;
-  void OnTransformIsPotentiallyAnimatingChanged(bool is_animating) override;
-  bool IsActive() const override;
-
   // If this layer has a scroll parent, it removes |this| from its list of
   // scroll children.
   void RemoveFromScrollTree();
diff --git a/cc/layers/layer_unittest.cc b/cc/layers/layer_unittest.cc
index 10b1d14..6f81e8e 100644
--- a/cc/layers/layer_unittest.cc
+++ b/cc/layers/layer_unittest.cc
@@ -867,7 +867,7 @@
   EXPECT_EQ(replica.get(), replica->mask_layer()->parent());
 }
 
-TEST_F(LayerTest, CheckTranformIsInvertible) {
+TEST_F(LayerTest, CheckTransformIsInvertible) {
   scoped_refptr<Layer> layer = Layer::Create(layer_settings_);
   scoped_ptr<LayerImpl> impl_layer =
       LayerImpl::Create(host_impl_.active_tree(), 1);
@@ -898,7 +898,7 @@
   Mock::VerifyAndClearExpectations(layer_tree_host_.get());
 }
 
-TEST_F(LayerTest, TranformIsInvertibleAnimation) {
+TEST_F(LayerTest, TransformIsInvertibleAnimation) {
   scoped_refptr<Layer> layer = Layer::Create(layer_settings_);
   scoped_ptr<LayerImpl> impl_layer =
       LayerImpl::Create(host_impl_.active_tree(), 1);
@@ -920,9 +920,9 @@
 
   gfx::Transform identity_transform;
 
+  EXPECT_CALL(*layer_tree_host_, SetNeedsUpdateLayers()).Times(1);
   layer->SetTransform(identity_transform);
-  static_cast<LayerAnimationValueObserver*>(layer.get())
-      ->OnTransformAnimated(singular_transform);
+  layer->OnTransformAnimated(singular_transform);
   layer->PushPropertiesTo(impl_layer.get());
   EXPECT_FALSE(layer->transform_is_invertible());
   EXPECT_FALSE(impl_layer->transform_is_invertible());
@@ -1326,5 +1326,26 @@
   EXPECT_EQ(1, did_receive_second_result_from_this_source);
 }
 
+TEST_F(LayerTest, AnimationSchedulesLayerUpdate) {
+  scoped_refptr<Layer> layer = Layer::Create(layer_settings_);
+  EXPECT_SET_NEEDS_FULL_TREE_SYNC(1, layer_tree_host_->SetRootLayer(layer));
+
+  EXPECT_CALL(*layer_tree_host_, SetNeedsUpdateLayers()).Times(1);
+  layer->OnOpacityAnimated(0.5f);
+  Mock::VerifyAndClearExpectations(layer_tree_host_.get());
+
+  EXPECT_CALL(*layer_tree_host_, SetNeedsUpdateLayers()).Times(1);
+  gfx::Transform transform;
+  transform.Rotate(45.0);
+  layer->OnTransformAnimated(transform);
+  Mock::VerifyAndClearExpectations(layer_tree_host_.get());
+
+  // Scroll offset animation should not schedule a layer update since it is
+  // handled similarly to normal compositor scroll updates.
+  EXPECT_CALL(*layer_tree_host_, SetNeedsUpdateLayers()).Times(0);
+  layer->OnScrollOffsetAnimated(gfx::ScrollOffset(10, 10));
+  Mock::VerifyAndClearExpectations(layer_tree_host_.get());
+}
+
 }  // namespace
 }  // namespace cc
diff --git a/cc/test/test_image_factory.cc b/cc/test/test_image_factory.cc
index 3b2415c..aaf61ac 100644
--- a/cc/test/test_image_factory.cc
+++ b/cc/test/test_image_factory.cc
@@ -24,7 +24,7 @@
 
   scoped_refptr<gfx::GLImageSharedMemory> image(
       new gfx::GLImageSharedMemory(size, internalformat));
-  if (!image->Initialize(handle, format))
+  if (!image->Initialize(handle.handle, handle.id, format))
     return nullptr;
 
   return image;
diff --git a/chrome/VERSION b/chrome/VERSION
index 5ba3686..ef5f09e 100644
--- a/chrome/VERSION
+++ b/chrome/VERSION
@@ -1,4 +1,4 @@
 MAJOR=48
 MINOR=0
-BUILD=2535
+BUILD=2536
 PATCH=0
diff --git a/chrome/android/java/AndroidManifest.xml b/chrome/android/java/AndroidManifest.xml
index e1d9d7a..02baea8 100644
--- a/chrome/android/java/AndroidManifest.xml
+++ b/chrome/android/java/AndroidManifest.xml
@@ -437,7 +437,12 @@
             </intent-filter>
         </receiver>
 
-        <!-- Precache service. -->
+        <!-- Precache service.
+        Not enabled on Stable or Work channels. This is currently an experiment
+        on beta channel (crbug/309216) but the mere existence of these can lead
+        to some process churn, so omit them while not relevant. b/24776372
+        -->
+        {% if channel in ['default', 'canary', 'dev', 'beta'] %}
         <service android:name="org.chromium.chrome.browser.precache.PrecacheService"
             android:exported="false" />
         <receiver android:name="org.chromium.chrome.browser.precache.PrecacheServiceLauncher">
@@ -447,6 +452,7 @@
                 <action android:name="android.net.conn.CONNECTIVITY_CHANGE" />
             </intent-filter>
         </receiver>
+        {% endif %}
 
         <receiver android:name="org.chromium.chrome.browser.firstrun.ToSAckedReceiver"
             android:permission="{{ manifest_package }}.TOS_ACKED">
@@ -486,7 +492,7 @@
             android:exported="false" />
             
         <!-- Receiver for GCM messages. -->
-        <receiver android:name="com.google.android.gms.gcm.GcmReceiver"
+        <receiver android:name="org.chromium.chrome.browser.services.gcm.ChromeGcmReceiver"
             android:exported="true"
             android:permission="com.google.android.c2dm.permission.SEND">
             <intent-filter>
diff --git a/chrome/android/java/res/drawable-hdpi/google_logo.png b/chrome/android/java/res/drawable-hdpi/google_logo.png
index 289b7991..40e9df44d 100644
--- a/chrome/android/java/res/drawable-hdpi/google_logo.png
+++ b/chrome/android/java/res/drawable-hdpi/google_logo.png
Binary files differ
diff --git a/chrome/android/java/res/drawable-hdpi/google_play.png b/chrome/android/java/res/drawable-hdpi/google_play.png
index 243675d..ce0d501 100644
--- a/chrome/android/java/res/drawable-hdpi/google_play.png
+++ b/chrome/android/java/res/drawable-hdpi/google_play.png
Binary files differ
diff --git a/chrome/android/java/res/drawable-mdpi/data_reduction_illustration.png b/chrome/android/java/res/drawable-mdpi/data_reduction_illustration.png
index 56f7571d..5f0f082 100644
--- a/chrome/android/java/res/drawable-mdpi/data_reduction_illustration.png
+++ b/chrome/android/java/res/drawable-mdpi/data_reduction_illustration.png
Binary files differ
diff --git a/chrome/android/java/res/drawable-mdpi/google_logo.png b/chrome/android/java/res/drawable-mdpi/google_logo.png
index 7e7e9a9..f52da851 100644
--- a/chrome/android/java/res/drawable-mdpi/google_logo.png
+++ b/chrome/android/java/res/drawable-mdpi/google_logo.png
Binary files differ
diff --git a/chrome/android/java/res/drawable-mdpi/google_play.png b/chrome/android/java/res/drawable-mdpi/google_play.png
index 09f4ccaf..d9690e9 100644
--- a/chrome/android/java/res/drawable-mdpi/google_play.png
+++ b/chrome/android/java/res/drawable-mdpi/google_play.png
Binary files differ
diff --git a/chrome/android/java/res/drawable-mdpi/tabs_moved_htc.png b/chrome/android/java/res/drawable-mdpi/tabs_moved_htc.png
index 9962343..f67b606 100644
--- a/chrome/android/java/res/drawable-mdpi/tabs_moved_htc.png
+++ b/chrome/android/java/res/drawable-mdpi/tabs_moved_htc.png
Binary files differ
diff --git a/chrome/android/java/res/drawable-mdpi/tabs_moved_nexus.png b/chrome/android/java/res/drawable-mdpi/tabs_moved_nexus.png
index 8130d97..69fd0b1 100644
--- a/chrome/android/java/res/drawable-mdpi/tabs_moved_nexus.png
+++ b/chrome/android/java/res/drawable-mdpi/tabs_moved_nexus.png
Binary files differ
diff --git a/chrome/android/java/res/drawable-mdpi/tabs_moved_samsung.png b/chrome/android/java/res/drawable-mdpi/tabs_moved_samsung.png
index f1efdeb..4615d73f4 100644
--- a/chrome/android/java/res/drawable-mdpi/tabs_moved_samsung.png
+++ b/chrome/android/java/res/drawable-mdpi/tabs_moved_samsung.png
Binary files differ
diff --git a/chrome/android/java/res/drawable-sw600dp-hdpi/google_logo.png b/chrome/android/java/res/drawable-sw600dp-hdpi/google_logo.png
index 6c7e854..08e85c7 100644
--- a/chrome/android/java/res/drawable-sw600dp-hdpi/google_logo.png
+++ b/chrome/android/java/res/drawable-sw600dp-hdpi/google_logo.png
Binary files differ
diff --git a/chrome/android/java/res/drawable-sw600dp-mdpi/google_logo.png b/chrome/android/java/res/drawable-sw600dp-mdpi/google_logo.png
index a8ee5b8..d4d7f71 100644
--- a/chrome/android/java/res/drawable-sw600dp-mdpi/google_logo.png
+++ b/chrome/android/java/res/drawable-sw600dp-mdpi/google_logo.png
Binary files differ
diff --git a/chrome/android/java/res/drawable-sw600dp-xhdpi/google_logo.png b/chrome/android/java/res/drawable-sw600dp-xhdpi/google_logo.png
index ba5c312..5f48412a 100644
--- a/chrome/android/java/res/drawable-sw600dp-xhdpi/google_logo.png
+++ b/chrome/android/java/res/drawable-sw600dp-xhdpi/google_logo.png
Binary files differ
diff --git a/chrome/android/java/res/drawable-sw600dp-xxhdpi/google_logo.png b/chrome/android/java/res/drawable-sw600dp-xxhdpi/google_logo.png
index 3aedbdf6..417885b 100644
--- a/chrome/android/java/res/drawable-sw600dp-xxhdpi/google_logo.png
+++ b/chrome/android/java/res/drawable-sw600dp-xxhdpi/google_logo.png
Binary files differ
diff --git a/chrome/android/java/res/drawable-sw600dp-xxxhdpi/google_logo.png b/chrome/android/java/res/drawable-sw600dp-xxxhdpi/google_logo.png
index e21ebb6..edf02f9 100644
--- a/chrome/android/java/res/drawable-sw600dp-xxxhdpi/google_logo.png
+++ b/chrome/android/java/res/drawable-sw600dp-xxxhdpi/google_logo.png
Binary files differ
diff --git a/chrome/android/java/res/drawable-xhdpi/google_logo.png b/chrome/android/java/res/drawable-xhdpi/google_logo.png
index d0958ae..4cf1636b 100644
--- a/chrome/android/java/res/drawable-xhdpi/google_logo.png
+++ b/chrome/android/java/res/drawable-xhdpi/google_logo.png
Binary files differ
diff --git a/chrome/android/java/res/drawable-xhdpi/google_play.png b/chrome/android/java/res/drawable-xhdpi/google_play.png
index 80ee2de..624cce2 100644
--- a/chrome/android/java/res/drawable-xhdpi/google_play.png
+++ b/chrome/android/java/res/drawable-xhdpi/google_play.png
Binary files differ
diff --git a/chrome/android/java/res/drawable-xxhdpi/data_reduction_illustration.png b/chrome/android/java/res/drawable-xxhdpi/data_reduction_illustration.png
index 1f83d1ec..82930fb 100644
--- a/chrome/android/java/res/drawable-xxhdpi/data_reduction_illustration.png
+++ b/chrome/android/java/res/drawable-xxhdpi/data_reduction_illustration.png
Binary files differ
diff --git a/chrome/android/java/res/drawable-xxhdpi/google_logo.png b/chrome/android/java/res/drawable-xxhdpi/google_logo.png
index 4e0906d0..0a4f20b 100644
--- a/chrome/android/java/res/drawable-xxhdpi/google_logo.png
+++ b/chrome/android/java/res/drawable-xxhdpi/google_logo.png
Binary files differ
diff --git a/chrome/android/java/res/drawable-xxhdpi/google_play.png b/chrome/android/java/res/drawable-xxhdpi/google_play.png
index a93c586..4651a29 100644
--- a/chrome/android/java/res/drawable-xxhdpi/google_play.png
+++ b/chrome/android/java/res/drawable-xxhdpi/google_play.png
Binary files differ
diff --git a/chrome/android/java/res/drawable-xxhdpi/tabs_moved_htc.png b/chrome/android/java/res/drawable-xxhdpi/tabs_moved_htc.png
index 0c15c34..12cc47e0 100644
--- a/chrome/android/java/res/drawable-xxhdpi/tabs_moved_htc.png
+++ b/chrome/android/java/res/drawable-xxhdpi/tabs_moved_htc.png
Binary files differ
diff --git a/chrome/android/java/res/drawable-xxhdpi/tabs_moved_nexus.png b/chrome/android/java/res/drawable-xxhdpi/tabs_moved_nexus.png
index bd18fa7..a3cb6c38 100644
--- a/chrome/android/java/res/drawable-xxhdpi/tabs_moved_nexus.png
+++ b/chrome/android/java/res/drawable-xxhdpi/tabs_moved_nexus.png
Binary files differ
diff --git a/chrome/android/java/res/drawable-xxhdpi/tabs_moved_samsung.png b/chrome/android/java/res/drawable-xxhdpi/tabs_moved_samsung.png
index 90e16ee..60165710 100644
--- a/chrome/android/java/res/drawable-xxhdpi/tabs_moved_samsung.png
+++ b/chrome/android/java/res/drawable-xxhdpi/tabs_moved_samsung.png
Binary files differ
diff --git a/chrome/android/java/res/drawable-xxxhdpi/google_logo.png b/chrome/android/java/res/drawable-xxxhdpi/google_logo.png
index 12552f3..d50fd5c 100644
--- a/chrome/android/java/res/drawable-xxxhdpi/google_logo.png
+++ b/chrome/android/java/res/drawable-xxxhdpi/google_logo.png
Binary files differ
diff --git a/chrome/android/java/res/drawable-xxxhdpi/google_play.png b/chrome/android/java/res/drawable-xxxhdpi/google_play.png
index bb4178ae..ddd551e 100644
--- a/chrome/android/java/res/drawable-xxxhdpi/google_play.png
+++ b/chrome/android/java/res/drawable-xxxhdpi/google_play.png
Binary files differ
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ChromeApplication.java b/chrome/android/java/src/org/chromium/chrome/browser/ChromeApplication.java
index abd7c69d..7493b68 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/ChromeApplication.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/ChromeApplication.java
@@ -42,6 +42,7 @@
 import org.chromium.chrome.browser.banners.AppBannerManager;
 import org.chromium.chrome.browser.banners.AppDetailsDelegate;
 import org.chromium.chrome.browser.customtabs.CustomTabsConnection;
+import org.chromium.chrome.browser.datausage.ExternalDataUseObserver;
 import org.chromium.chrome.browser.document.DocumentActivity;
 import org.chromium.chrome.browser.document.IncognitoDocumentActivity;
 import org.chromium.chrome.browser.download.DownloadManagerService;
@@ -610,6 +611,14 @@
     }
 
     /**
+     * @return An external observer of data use.
+     * @param nativePtr Pointer to the native ExternalDataUseObserver object.
+     */
+    public ExternalDataUseObserver createExternalDataUseObserver(long nativePtr) {
+        return new ExternalDataUseObserver(nativePtr);
+    }
+
+    /**
      * @return The user agent string of Chrome.
      */
     public static String getBrowserUserAgent() {
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/compositor/bottombar/contextualsearch/ContextualSearchPanel.java b/chrome/android/java/src/org/chromium/chrome/browser/compositor/bottombar/contextualsearch/ContextualSearchPanel.java
index b213ea3..ff37a87 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/compositor/bottombar/contextualsearch/ContextualSearchPanel.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/compositor/bottombar/contextualsearch/ContextualSearchPanel.java
@@ -255,14 +255,11 @@
     @Override
     public void onPromoPreferenceClick() {
         super.onPromoPreferenceClick();
-        setIsPromoActive(false);
     }
 
     @Override
     public void onPromoButtonClick(boolean accepted) {
         super.onPromoButtonClick(accepted);
-        mManagementDelegate.logPromoOutcome();
-        setIsPromoActive(false);
     }
 
     // ============================================================================================
@@ -285,15 +282,11 @@
     public void setPreferenceState(boolean enabled) {
         if (mManagementDelegate != null) {
             mManagementDelegate.setPreferenceState(enabled);
+            setIsPromoActive(false);
         }
     }
 
     @Override
-    protected boolean isPromoAvailable() {
-        return mManagementDelegate != null && mManagementDelegate.isPromoAvailable();
-    }
-
-    @Override
     protected void onClose(StateChangeReason reason) {
         destroySearchBarControl();
         destroyPeekPromoControl();
@@ -557,6 +550,7 @@
 
     @Override
     public void setIsPromoActive(boolean isActive) {
+        setPromoVisibility(isActive);
         mPanelMetrics.setIsPromoActive(isActive);
     }
 
@@ -908,6 +902,38 @@
     }
 
     // ============================================================================================
+    // Promo
+    // ============================================================================================
+
+    // TODO(pedrosimonetti): refactor the rest of the promo code into its own Control.
+
+    /**
+     * Whether the Promo is visible.
+     */
+    private boolean mIsPromoVisible;
+
+
+    @Override
+    protected boolean isPromoVisible() {
+        return mIsPromoVisible;
+    }
+
+    @Override
+    protected void onPromoAcceptanceAnimationFinished() {
+        // NOTE(pedrosimonetti): We should only set the preference to true after the acceptance
+        // animation finishes, because setting the preference will make the user leave the
+        // undecided state, and that will, in turn, turn the promo off.
+        setPreferenceState(true);
+    }
+
+    /**
+     * @param isVisible Whether the Promo should be visible.
+     */
+    private void setPromoVisibility(boolean isVisible) {
+        mIsPromoVisible = isVisible;
+    }
+
+    // ============================================================================================
     // Panel Content
     // ============================================================================================
 
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/compositor/bottombar/contextualsearch/ContextualSearchPanelAnimation.java b/chrome/android/java/src/org/chromium/chrome/browser/compositor/bottombar/contextualsearch/ContextualSearchPanelAnimation.java
index fc842d3..8bd6a90 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/compositor/bottombar/contextualsearch/ContextualSearchPanelAnimation.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/compositor/bottombar/contextualsearch/ContextualSearchPanelAnimation.java
@@ -108,6 +108,11 @@
      */
     protected abstract void updateSearchBarTextOpacity(float percentage);
 
+    /**
+     * Notifies that the acceptance animation has finished.
+     */
+    protected abstract void onPromoAcceptanceAnimationFinished();
+
     // ============================================================================================
     // Animation API
     // ============================================================================================
@@ -261,7 +266,7 @@
         // maximized so this project state change is not needed.
         if (projectedState == PanelState.MAXIMIZED
                 && getPanelState() == PanelState.PEEKED
-                && isPromoAvailable() && isFullscreenSizePanel()) {
+                && isPromoVisible() && isFullscreenSizePanel()) {
             projectedState = PanelState.EXPANDED;
         }
 
@@ -419,7 +424,7 @@
     protected void onAnimationFinished() {
         if (mIsAnimatingPromoAcceptance) {
             mIsAnimatingPromoAcceptance = false;
-            setPreferenceState(true);
+            onPromoAcceptanceAnimationFinished();
         }
 
         if (mIsAnimatingPanelClosing) {
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/compositor/bottombar/contextualsearch/ContextualSearchPanelBase.java b/chrome/android/java/src/org/chromium/chrome/browser/compositor/bottombar/contextualsearch/ContextualSearchPanelBase.java
index d3c44412..b8f4752 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/compositor/bottombar/contextualsearch/ContextualSearchPanelBase.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/compositor/bottombar/contextualsearch/ContextualSearchPanelBase.java
@@ -246,9 +246,9 @@
     public abstract void setPreferenceState(boolean enabled);
 
     /**
-     * @return Whether the Panel Promo is available.
+     * @return Whether the Panel Promo is visible.
      */
-    protected abstract boolean isPromoAvailable();
+    protected abstract boolean isPromoVisible();
 
     /**
      * Animates the acceptance of the Promo.
@@ -1237,7 +1237,7 @@
      * visibility between 0 and 1 means the Promo is partially visible.
      */
     private void updatePromoVisibility(float percentage) {
-        if (isPromoAvailable()) {
+        if (isPromoVisible()) {
             mPromoVisible = true;
 
             mPromoHeightPx = Math.round(MathUtils.clamp(percentage * mPromoContentHeightPx,
@@ -1384,6 +1384,9 @@
             animatePromoAcceptance();
         } else {
             hidePromoView();
+            // NOTE(pedrosimonetti): If the user has opted out of Contextual Search, we should set
+            // the preference right away because the preference state controls whether the promo
+            // will be visible, and we want to hide the promo immediately when the user opts out.
             setPreferenceState(false);
             closePanel(StateChangeReason.OPTOUT, true);
         }
@@ -1410,7 +1413,7 @@
      * Creates the Search Promo View.
      */
     public void createPromoView() {
-        if (!isPromoAvailable()) return;
+        if (!isPromoVisible()) return;
 
         assert mContainerView != null;
 
@@ -1445,7 +1448,7 @@
      * Destroys the Search Promo View.
      */
     protected void destroyPromoView() {
-        if (!isPromoAvailable()) return;
+        if (!isPromoVisible()) return;
 
         if (mPromoView != null) {
             mContainerView.removeView(mPromoView);
@@ -1462,7 +1465,7 @@
      * @param y The Y position.
      */
     public void showPromoViewAtYPosition(float y) {
-        if (mPromoView == null || !isPromoAvailable()) return;
+        if (mPromoView == null || !isPromoVisible()) return;
 
         mPromoView.setTranslationX(getOffsetX() / mPxToDp);
         mPromoView.setTranslationY(y);
@@ -1481,7 +1484,7 @@
     public void hidePromoView() {
         if (mPromoView == null
                 || !mIsSearchPromoViewVisible
-                || !isPromoAvailable()) {
+                || !isPromoVisible()) {
             return;
         }
 
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/datausage/ExternalDataUseObserver.java b/chrome/android/java/src/org/chromium/chrome/browser/datausage/ExternalDataUseObserver.java
new file mode 100644
index 0000000..d8eb97b
--- /dev/null
+++ b/chrome/android/java/src/org/chromium/chrome/browser/datausage/ExternalDataUseObserver.java
@@ -0,0 +1,47 @@
+// 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.
+
+package org.chromium.chrome.browser.datausage;
+
+import android.content.Context;
+
+import org.chromium.base.annotations.CalledByNative;
+import org.chromium.base.annotations.JNINamespace;
+import org.chromium.chrome.browser.ChromeApplication;
+
+/**
+ * This class provides a base class implementation of a data use observer that is external to
+ * Chromium. This class should be accessed only on IO thread.
+ */
+@JNINamespace("chrome::android")
+public class ExternalDataUseObserver {
+    /**
+     * Pointer to the native ExternalDataUseObserver object.
+     */
+    private long mNativeExternalDataUseObserver;
+
+    @CalledByNative
+    private static ExternalDataUseObserver create(Context context, long nativePtr) {
+        return ((ChromeApplication) context).createExternalDataUseObserver(nativePtr);
+    }
+
+    /**
+     * Notification that the native object has been destroyed.
+     */
+    @CalledByNative
+    private void onDestroy() {
+        mNativeExternalDataUseObserver = 0;
+    }
+
+    @CalledByNative
+    private void onDataUse(String tag, long bytesDownloaded, long bytesUploaded) {}
+
+    /**
+     * Creates an instance of {@link #ExternalDataUseObserver}.
+     */
+    public ExternalDataUseObserver(long nativePtr) {
+        mNativeExternalDataUseObserver = nativePtr;
+        assert mNativeExternalDataUseObserver != 0;
+    }
+}
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/datausage/OWNERS b/chrome/android/java/src/org/chromium/chrome/browser/datausage/OWNERS
new file mode 100644
index 0000000..ea92650
--- /dev/null
+++ b/chrome/android/java/src/org/chromium/chrome/browser/datausage/OWNERS
@@ -0,0 +1,2 @@
+bengr@chromium.org
+sclittle@chromium.org
\ No newline at end of file
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/dom_distiller/ExternalFeedbackReporter.java b/chrome/android/java/src/org/chromium/chrome/browser/dom_distiller/ExternalFeedbackReporter.java
deleted file mode 100644
index cb1f2da..0000000
--- a/chrome/android/java/src/org/chromium/chrome/browser/dom_distiller/ExternalFeedbackReporter.java
+++ /dev/null
@@ -1,21 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-package org.chromium.chrome.browser.dom_distiller;
-
-import android.app.Activity;
-
-/**
- * Provides a way of reporting feedback to an external feedback service.
- */
-public interface ExternalFeedbackReporter {
-    /**
-     * Records feedback for the distilled content.
-     *
-     * @param activity the activity to take a screenshot of.
-     * @param url the URL to report feedback for.
-     * @param good whether the perceived quality of the distillation of a web page was good.
-     */
-    void reportFeedback(Activity activity, String url, boolean good);
-}
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/dom_distiller/ReaderModeManager.java b/chrome/android/java/src/org/chromium/chrome/browser/dom_distiller/ReaderModeManager.java
index 43d17175..f746bad 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/dom_distiller/ReaderModeManager.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/dom_distiller/ReaderModeManager.java
@@ -10,7 +10,6 @@
 
 import org.chromium.base.ApiCompatibilityUtils;
 import org.chromium.base.CommandLine;
-import org.chromium.base.ObserverList;
 import org.chromium.base.metrics.RecordHistogram;
 import org.chromium.chrome.R;
 import org.chromium.chrome.browser.ChromeActivity;
@@ -87,14 +86,11 @@
 
     private final ReaderModePanel mReaderModePanel;
 
-    private final ObserverList<ReaderModeManagerObserver> mObservers;
-
     private final int mHeaderBackgroundColor;
 
     public ReaderModeManager(Tab tab, Context context) {
         mTab = tab;
         mTab.addObserver(this);
-        mObservers = new ObserverList<ReaderModeManagerObserver>();
         mReaderModePanel = isEnabled(context) ? new ReaderModePanel(this) : null;
         mHeaderBackgroundColor = context != null
                 ? ApiCompatibilityUtils.getColor(
@@ -102,20 +98,6 @@
                 : 0;
     }
 
-    /**
-     * Adds an observer to be notified about changes to the reader mode status.
-     */
-    public void addObserver(ReaderModeManagerObserver observer) {
-        mObservers.addObserver(observer);
-    }
-
-    /**
-     * Removes an observer from receiving updates about the reader mode status changes.
-     */
-    public void removeObserver(ReaderModeManagerObserver observer) {
-        mObservers.removeObserver(observer);
-    }
-
     // EmptyTabObserver:
     @Override
     public void onDestroyed(Tab tab) {
@@ -145,7 +127,7 @@
             if (DomDistillerUrlUtils.isDistilledPage(tab.getUrl())) {
                 mReaderModeStatus = STARTED;
                 mReaderModePageUrl = tab.getUrl();
-                sendReaderModeStatusChangedNotification();
+                if (mReaderModePanel != null) mReaderModePanel.updateBottomButtonBar();
             }
         }
         ContextualSearchManager contextualSearchManager = getContextualSearchManager(tab);
@@ -268,7 +250,7 @@
                 if (!isMainFrame) return;
                 if (DomDistillerUrlUtils.isDistilledPage(validatedUrl)) {
                     mReaderModeStatus = STARTED;
-                    sendReaderModeStatusChangedNotification();
+                    if (mReaderModePanel != null) mReaderModePanel.updateBottomButtonBar();
                     mReaderModePageUrl = validatedUrl;
                 }
             }
@@ -292,7 +274,7 @@
                     // For ADABOOST_MODEL, it is unlikely to get valid info at this event.
                 }
                 mReaderModePageUrl = null;
-                sendReaderModeStatusChangedNotification();
+                if (mReaderModePanel != null) mReaderModePanel.updateBottomButtonBar();
             }
         };
     }
@@ -317,18 +299,11 @@
                             RecordHistogram.recordBooleanHistogram(
                                     "DomDistiller.PageDistillable", mReaderModeStatus == POSSIBLE);
                         }
-                        sendReaderModeStatusChangedNotification();
+                        if (mReaderModePanel != null) mReaderModePanel.updateBottomButtonBar();
                     }
                 });
     }
 
-    private void sendReaderModeStatusChangedNotification() {
-        for (ReaderModeManagerObserver observer : mObservers) {
-            observer.onReaderModeStatusChanged(mReaderModeStatus);
-        }
-        if (mReaderModePanel != null) mReaderModePanel.updateBottomButtonBar();
-    }
-
     private ContextualSearchManager getContextualSearchManager(Tab tab) {
         if (tab == null || tab.getWindowAndroid() == null) return null;
         Activity activity = tab.getWindowAndroid().getActivity().get();
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/preferences/autofill/AutofillPreferences.java b/chrome/android/java/src/org/chromium/chrome/browser/preferences/autofill/AutofillPreferences.java
index 0602f73..b1efafe 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/preferences/autofill/AutofillPreferences.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/preferences/autofill/AutofillPreferences.java
@@ -4,8 +4,6 @@
 
 package org.chromium.chrome.browser.preferences.autofill;
 
-import android.app.Activity;
-import android.content.Context;
 import android.graphics.PorterDuff;
 import android.graphics.drawable.Drawable;
 import android.os.Bundle;
@@ -177,22 +175,14 @@
     }
 
     @Override
-    public void onDestroy() {
-        super.onDestroy();
+    public void onActivityCreated(Bundle savedInstanceState) {
+        super.onActivityCreated(savedInstanceState);
+        PersonalDataManager.getInstance().registerDataObserver(this);
+    }
+
+    @Override
+    public void onDestroyView() {
         PersonalDataManager.getInstance().unregisterDataObserver(this);
-    }
-
-    // TODO: remove this than we only support Build.VERSION_CODES.M and newer.
-    @SuppressWarnings("deprecation")
-    @Override
-    public void onAttach(Activity activity) {
-        super.onAttach(activity);
-        PersonalDataManager.getInstance().registerDataObserver(this);
-    }
-
-    @Override
-    public void onAttach(Context context) {
-        super.onAttach(context);
-        PersonalDataManager.getInstance().registerDataObserver(this);
+        super.onDestroyView();
     }
 }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/services/gcm/ChromeGcmListenerService.java b/chrome/android/java/src/org/chromium/chrome/browser/services/gcm/ChromeGcmListenerService.java
index 26a4b62..9ca2bab 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/services/gcm/ChromeGcmListenerService.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/services/gcm/ChromeGcmListenerService.java
@@ -32,13 +32,13 @@
     @Override
     public void onMessageSent(String msgId) {
         Log.d(TAG, "Message sent successfully. Message id: " + msgId);
-        GcmUpstreamUma.recordHistogram(getApplicationContext(), GcmUpstreamUma.UMA_SUCCESS);
+        GcmUma.recordGcmUpstreamHistogram(getApplicationContext(), GcmUma.UMA_UPSTREAM_SUCCESS);
     }
 
     @Override
     public void onSendError(String msgId, String error) {
         Log.w(TAG, "Error in sending message. Message id: " + msgId + " Error: " + error);
-        GcmUpstreamUma.recordHistogram(getApplicationContext(), GcmUpstreamUma.UMA_SEND_FAILED);
+        GcmUma.recordGcmUpstreamHistogram(getApplicationContext(), GcmUma.UMA_UPSTREAM_SEND_FAILED);
     }
 
     @Override
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/services/gcm/ChromeGcmReceiver.java b/chrome/android/java/src/org/chromium/chrome/browser/services/gcm/ChromeGcmReceiver.java
new file mode 100644
index 0000000..4560049f
--- /dev/null
+++ b/chrome/android/java/src/org/chromium/chrome/browser/services/gcm/ChromeGcmReceiver.java
@@ -0,0 +1,42 @@
+// 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.
+
+package org.chromium.chrome.browser.services.gcm;
+
+import android.content.Context;
+import android.content.Intent;
+
+import com.google.android.gms.gcm.GcmListenerService;
+import com.google.android.gms.gcm.GcmReceiver;
+
+import org.chromium.base.Log;
+
+/**
+ * The {@link GcmReceiver} occasionally crashes with a SecurityException when dispatching intents
+ * to start the {@link GcmListenerService}. This is suspected to be caused by an Android bug which
+ * resolves the intent to a different package.
+ * See crbug/528219.
+ *
+ * This is a temporary workaround to catch the exception to keep the application from crashing and
+ * record the error.
+ * TODO(khushalsagar): Switch to the GcmReceiver in the GCM client library once GMS is upgraded to
+ * Urda.
+ */
+public class ChromeGcmReceiver extends GcmReceiver {
+
+    private static final String TAG = "GCM";
+
+    @Override
+    public void onReceive(Context context, Intent intent) {
+        try {
+            super.onReceive(context, intent);
+            GcmUma.recordGcmReceiverHistogram(context, GcmUma.UMA_GCM_RECEIVER_SUCCESS);
+        } catch (SecurityException exception) {
+            GcmUma.recordGcmReceiverHistogram(context,
+                    GcmUma.UMA_GCM_RECEIVER_ERROR_SECURITY_EXCEPTION);
+            Log.e(TAG, "Failure in starting GcmReceiver : %s", exception);
+        }
+    }
+
+}
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/services/gcm/GcmUma.java b/chrome/android/java/src/org/chromium/chrome/browser/services/gcm/GcmUma.java
new file mode 100644
index 0000000..a56dc79
--- /dev/null
+++ b/chrome/android/java/src/org/chromium/chrome/browser/services/gcm/GcmUma.java
@@ -0,0 +1,70 @@
+// 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.
+
+package org.chromium.chrome.browser.services.gcm;
+
+import android.content.Context;
+
+import org.chromium.base.ThreadUtils;
+import org.chromium.base.library_loader.LibraryProcessType;
+import org.chromium.base.metrics.RecordHistogram;
+import org.chromium.content.browser.BrowserStartupController;
+import org.chromium.content.browser.BrowserStartupController.StartupCallback;
+
+/**
+ * Helper Class for GCM UMA Collection.
+ */
+public class GcmUma {
+    // Values for the "Invalidations.GCMUpstreamRequest" UMA histogram. The list is append-only.
+    public static final int UMA_UPSTREAM_SUCCESS = 0;
+    public static final int UMA_UPSTREAM_SIZE_LIMIT_EXCEEDED = 1;
+    public static final int UMA_UPSTREAM_TOKEN_REQUEST_FAILED = 2;
+    public static final int UMA_UPSTREAM_SEND_FAILED = 3;
+    public static final int UMA_UPSTREAM_MAX = 4;
+
+    // Values for the "GCM.AndroidGcmReceiver" UMA histogram. The list is append-only.
+    public static final int UMA_GCM_RECEIVER_SUCCESS = 0;
+    public static final int UMA_GCM_RECEIVER_ERROR_SECURITY_EXCEPTION = 1;
+    public static final int UMA_GCM_RECEIVER_MAX = 2;
+
+    public static void recordGcmUpstreamHistogram(Context context, final int value) {
+        onNativeLaunched(context, new Runnable() {
+            @Override public void run() {
+                RecordHistogram.recordEnumeratedHistogram(
+                        "Invalidations.GCMUpstreamRequest", value, UMA_UPSTREAM_MAX);
+            }
+        });
+    }
+
+    public static void recordGcmReceiverHistogram(Context context, final int value) {
+        onNativeLaunched(context, new Runnable() {
+            @Override public void run() {
+                RecordHistogram.recordEnumeratedHistogram(
+                        "GCM.AndroidGcmReceiverError", value, UMA_GCM_RECEIVER_MAX);
+            }
+        });
+    }
+
+    private static void onNativeLaunched(final Context context, final Runnable task) {
+        ThreadUtils.postOnUiThread(new Runnable() {
+            @Override
+            public void run() {
+                BrowserStartupController.get(context, LibraryProcessType.PROCESS_BROWSER)
+                        .addStartupCompletedObserver(
+                                new StartupCallback() {
+                                    @Override
+                                    public void onSuccess(boolean alreadyStarted) {
+                                        task.run();
+                                    }
+
+                                    @Override
+                                    public void onFailure() {
+                                        // Startup failed.
+                                    }
+                                });
+            }
+        });
+    }
+}
+
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/services/gcm/GcmUpstreamUma.java b/chrome/android/java/src/org/chromium/chrome/browser/services/gcm/GcmUpstreamUma.java
deleted file mode 100644
index 6dd1579f..0000000
--- a/chrome/android/java/src/org/chromium/chrome/browser/services/gcm/GcmUpstreamUma.java
+++ /dev/null
@@ -1,48 +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.
-
-package org.chromium.chrome.browser.services.gcm;
-
-import android.content.Context;
-
-import org.chromium.base.ThreadUtils;
-import org.chromium.base.library_loader.LibraryProcessType;
-import org.chromium.base.metrics.RecordHistogram;
-import org.chromium.content.browser.BrowserStartupController;
-import org.chromium.content.browser.BrowserStartupController.StartupCallback;
-
-/**
- * Helper Class for Invalidations GCM Upstream UMA Collection.
- */
-public class GcmUpstreamUma {
-    // Values for the "Invalidations.GCMUpstreamRequest" UMA histogram. The list is append-only.
-    public static final int UMA_SUCCESS = 0;
-    public static final int UMA_SIZE_LIMIT_EXCEEDED = 1;
-    public static final int UMA_TOKEN_REQUEST_FAILED = 2;
-    public static final int UMA_SEND_FAILED = 3;
-    public static final int UMA_MAX = 4;
-
-    public static void recordHistogram(final Context context, final int value) {
-        ThreadUtils.postOnUiThread(new Runnable() {
-            @Override
-            public void run() {
-                BrowserStartupController.get(context, LibraryProcessType.PROCESS_BROWSER)
-                        .addStartupCompletedObserver(
-                                new StartupCallback() {
-                                    @Override
-                                    public void onSuccess(boolean alreadyStarted) {
-                                        RecordHistogram.recordEnumeratedHistogram(
-                                                "Invalidations.GCMUpstreamRequest", value, UMA_MAX);
-                                    }
-
-                                    @Override
-                                    public void onFailure() {
-                                        // Startup failed.
-                                    }
-                                });
-            }
-        });
-    }
-}
-
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/services/gcm/InvalidationGcmUpstreamSender.java b/chrome/android/java/src/org/chromium/chrome/browser/services/gcm/InvalidationGcmUpstreamSender.java
index 3c000e8..2a1ff4f 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/services/gcm/InvalidationGcmUpstreamSender.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/services/gcm/InvalidationGcmUpstreamSender.java
@@ -52,9 +52,8 @@
 
                     @Override
                     public void tokenUnavailable(boolean isTransientError) {
-                        GcmUpstreamUma.recordHistogram(
-                                getApplicationContext(), GcmUpstreamUma.UMA_TOKEN_REQUEST_FAILED);
-                        sendUpstreamMessage(to, data, null);
+                        GcmUma.recordGcmUpstreamHistogram(
+                                getApplicationContext(), GcmUma.UMA_UPSTREAM_TOKEN_REQUEST_FAILED);
                     }
                 });
     }
@@ -63,8 +62,8 @@
         // Add the OAuth2 token to the bundle. The token should have the prefix Bearer added to it.
         data.putString("Authorization", "Bearer " + token);
         if (!isMessageWithinLimit(data)) {
-            GcmUpstreamUma.recordHistogram(
-                    getApplicationContext(), GcmUpstreamUma.UMA_SIZE_LIMIT_EXCEEDED);
+            GcmUma.recordGcmUpstreamHistogram(
+                    getApplicationContext(), GcmUma.UMA_UPSTREAM_SIZE_LIMIT_EXCEEDED);
             return;
         }
         String msgId = UUID.randomUUID().toString();
@@ -72,7 +71,8 @@
             GoogleCloudMessaging.getInstance(getApplicationContext()).send(to, msgId, 1, data);
         } catch (IOException | IllegalArgumentException exception) {
             Log.w(TAG, "Send message failed");
-            GcmUpstreamUma.recordHistogram(getApplicationContext(), GcmUpstreamUma.UMA_SEND_FAILED);
+            GcmUma.recordGcmUpstreamHistogram(getApplicationContext(),
+                    GcmUma.UMA_UPSTREAM_SEND_FAILED);
         }
     }
 
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappActivity.java
index f5e790de..2bad5d5 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappActivity.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/webapps/WebappActivity.java
@@ -335,6 +335,12 @@
                 : mBrandColor;
 
         ApiCompatibilityUtils.setTaskDescription(this, title, icon, color);
+        ApiCompatibilityUtils.setStatusBarColor(getWindow(), color);
+    }
+
+    @Override
+    protected void setStatusBarColor(Tab tab, int color) {
+        // Intentionally do nothing as WebappActivity explicitly sets status bar color.
     }
 
     /** Returns a unique identifier for this WebappActivity. */
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/banners/InstallerDelegateTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/banners/InstallerDelegateTest.java
index 7366d2c..779078fb 100644
--- a/chrome/android/javatests/src/org/chromium/chrome/browser/banners/InstallerDelegateTest.java
+++ b/chrome/android/javatests/src/org/chromium/chrome/browser/banners/InstallerDelegateTest.java
@@ -6,6 +6,7 @@
 
 import android.content.pm.PackageInfo;
 import android.os.HandlerThread;
+import android.test.FlakyTest;
 import android.test.InstrumentationTestCase;
 import android.test.mock.MockPackageManager;
 import android.test.suitebuilder.annotation.SmallTest;
@@ -158,6 +159,8 @@
     /**
      * Makes sure that the runnable isn't called until returning from start().
      */
+    /* Appears to be flaky crbug.com/542627 */
+    @FlakyTest
     @SmallTest
     public void testRunnableRaceCondition() throws InterruptedException {
         mPackageManager.isInstalled = true;
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchManagerTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchManagerTest.java
index 174b782f..c482783 100644
--- a/chrome/android/javatests/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchManagerTest.java
+++ b/chrome/android/javatests/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchManagerTest.java
@@ -26,6 +26,7 @@
 
 import org.chromium.base.ThreadUtils;
 import org.chromium.base.test.util.CommandLineFlags;
+import org.chromium.base.test.util.DisabledTest;
 import org.chromium.base.test.util.Feature;
 import org.chromium.base.test.util.Restriction;
 import org.chromium.chrome.R;
@@ -1227,10 +1228,12 @@
 
     /**
      * Tests that a Tap gesture on an element with an ARIA attribute does not trigger.
-     */
+     * http://crbug.com/542874
     @SmallTest
     @Feature({"ContextualSearch"})
     @Restriction(RESTRICTION_TYPE_NON_LOW_END_DEVICE)
+    */
+    @DisabledTest
     public void testTapOnARIAIgnored() throws InterruptedException, TimeoutException {
         clickNode("aria");
         assertPanelNeverOpened();
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/sync/ui/PassphraseActivityTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/sync/ui/PassphraseActivityTest.java
index 377cfd7..ab24af12 100644
--- a/chrome/android/javatests/src/org/chromium/chrome/browser/sync/ui/PassphraseActivityTest.java
+++ b/chrome/android/javatests/src/org/chromium/chrome/browser/sync/ui/PassphraseActivityTest.java
@@ -11,6 +11,7 @@
 import android.os.Bundle;
 
 import org.chromium.base.ThreadUtils;
+import org.chromium.base.test.util.DisabledTest;
 import org.chromium.base.test.util.Feature;
 import org.chromium.chrome.browser.sync.FakeProfileSyncService;
 import org.chromium.chrome.browser.sync.ProfileSyncService;
@@ -46,8 +47,10 @@
     /**
      * This is a regression test for http://crbug.com/469890.
      * @SmallTest
-     * Constantly fails on M, fine on other platforms: http://crbug.com/517590
+     * Constantly fails on M: http://crbug.com/517590
+     * Does not clean up its test accounts: http//crbug.com/542962
      */
+    @DisabledTest
     @Feature({"Sync"})
     public void testCallbackAfterBackgrounded() throws Exception {
         getInstrumentation().waitForIdleSync();
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/webapps/WebappActivityTestBase.java b/chrome/android/javatests/src/org/chromium/chrome/browser/webapps/WebappActivityTestBase.java
index 6e38730c..57b1ce4 100644
--- a/chrome/android/javatests/src/org/chromium/chrome/browser/webapps/WebappActivityTestBase.java
+++ b/chrome/android/javatests/src/org/chromium/chrome/browser/webapps/WebappActivityTestBase.java
@@ -5,6 +5,7 @@
 package org.chromium.chrome.browser.webapps;
 
 import android.content.Intent;
+import android.graphics.Color;
 import android.net.Uri;
 
 import org.chromium.base.ThreadUtils;
@@ -46,6 +47,7 @@
         Intent intent = new Intent(getInstrumentation().getTargetContext(), WebappActivity0.class);
         intent.setData(Uri.parse(WebappActivity.WEBAPP_SCHEME + "://" + WEBAPP_ID));
         intent.putExtra(ShortcutHelper.EXTRA_ID, WEBAPP_ID);
+        intent.putExtra(ShortcutHelper.EXTRA_THEME_COLOR, (long) Color.MAGENTA);
         intent.putExtra(ShortcutHelper.EXTRA_URL, "about:blank");
         setActivityIntent(intent);
 
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/webapps/WebappSplashScreenTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/webapps/WebappSplashScreenTest.java
index fc0b766..1dc22e4d 100644
--- a/chrome/android/javatests/src/org/chromium/chrome/browser/webapps/WebappSplashScreenTest.java
+++ b/chrome/android/javatests/src/org/chromium/chrome/browser/webapps/WebappSplashScreenTest.java
@@ -4,9 +4,11 @@
 
 package org.chromium.chrome.browser.webapps;
 
+import android.annotation.TargetApi;
 import android.graphics.Bitmap;
 import android.graphics.Color;
 import android.graphics.drawable.BitmapDrawable;
+import android.os.Build;
 import android.test.UiThreadTest;
 import android.test.suitebuilder.annotation.SmallTest;
 import android.view.ViewGroup;
@@ -19,11 +21,9 @@
 import org.chromium.content_public.common.ScreenOrientationValues;
 
 /**
- * Tests whether the splash screen is displayed with the correct elements in place.
+ * Tests for splashscreen.
  */
 public class WebappSplashScreenTest extends WebappActivityTestBase {
-    private static final String WEBAPP_URL = "http://originalwebsite.com";
-
     @UiThreadTest
     @SmallTest
     @Feature({"Webapps"})
@@ -60,8 +60,17 @@
         assertEquals(minSizePx, drawable.getBitmap().getHeight());
     }
 
+    @SmallTest
+    @Feature({"Webapps"})
+    @TargetApi(Build.VERSION_CODES.LOLLIPOP)
+    public void testSplashscreenThemeColor() {
+        if (Build.VERSION.SDK_INT < Build.VERSION_CODES.LOLLIPOP) return;
+
+        assertEquals(Color.MAGENTA, getActivity().getWindow().getStatusBarColor());
+    }
+
     private void setActivityWebappInfoFromBitmap(Bitmap image) {
-        WebappInfo mockInfo = WebappInfo.create(WEBAPP_ID, WEBAPP_URL,
+        WebappInfo mockInfo = WebappInfo.create(WEBAPP_ID, "about:blank",
                 ShortcutHelper.encodeBitmapAsString(image), null, null,
                 ScreenOrientationValues.DEFAULT, ShortcutSource.UNKNOWN,
                 ShortcutHelper.MANIFEST_COLOR_INVALID_OR_MISSING,
diff --git a/chrome/app/generated_resources.grd b/chrome/app/generated_resources.grd
index 13460ddd..0fb2c67 100644
--- a/chrome/app/generated_resources.grd
+++ b/chrome/app/generated_resources.grd
@@ -4659,7 +4659,7 @@
         The following extensions depend on this extension:
       </message>
       <message name="IDS_EXTENSIONS_LOCKED_SUPERVISED_USER" desc="The error message (either shown in the extensions UI or logged) informing a supervised user that extensions cannot be changed.">
-        Applications and extensions cannot be modified by supervised users.
+        Apps and extensions can only be modified by the manager (<ph name="CUSTODIAN_NAME">$1<ex>Jane Doe</ex></ph>).
       </message>
       <message name="IDS_EXTENSIONS_LOADING" desc="Placeholder text shown when loading the list of extensions.">
         Loading...
@@ -6329,12 +6329,6 @@
       <message name="IDS_FLAGS_ENABLE_HOSTED_APP_QUIT_NOTIFICATION_DESCRIPTION" desc="Description for the flag to enable a notification when quitting with hosted apps.">
         Display a notification when quitting Chrome if hosted apps are currently running.
       </message>
-      <message name="IDS_FLAGS_ENABLE_EPHEMERAL_APPS_IN_WEBSTORE_NAME" desc="Name of the flag to enable ephemeral apps in the webstore.">
-        Enable experimental ephemeral apps from the webstore.
-      </message>
-      <message name="IDS_FLAGS_ENABLE_EPHEMERAL_APPS_IN_WEBSTORE_DESCRIPTION" desc="Description for the flag to enable ephemeral apps.">
-        Enables ephemeral apps, which are launched without installing in Chrome, to be launched from the Chrome WebStore. Requires the experimental App Launcher to be enabled.
-      </message>
       <if expr="is_android">
         <message name="IDS_FLAGS_DISABLE_PULL_TO_REFRESH_EFFECT_NAME" desc="Name of the flag to disable the pull-to-refresh effect.">
           Disable the pull-to-refresh effect.
diff --git a/chrome/app/settings_chromium_strings.grdp b/chrome/app/settings_chromium_strings.grdp
index 7c58c0a..2e1b7df 100644
--- a/chrome/app/settings_chromium_strings.grdp
+++ b/chrome/app/settings_chromium_strings.grdp
@@ -15,9 +15,12 @@
     <message name="IDS_SETTINGS_DEFAULT_BROWSER_UNKNOWN" desc="The text displayed when Chrome cannot determine or set the default browser">
       Chromium cannot determine or set the default browser.
     </message>
-    <message name="IDS_SETTINGS_DEFAULT_BROWSER_SECONDARY" desc="The text displayed when Chrome is installed in side-by-side mode, which does not support setting as the default browser.">
+    <message name="IDS_SETTINGS_DEFAULT_BROWSER_SECONDARY" desc="The text displayed when Chromium is installed in side-by-side mode, which does not support setting as the default browser.">
       This is a secondary installation of Chromium, and cannot be made your default browser.
     </message>
+    <message name="IDS_SETTINGS_DEFAULT_BROWSER_ERROR" desc="The text displayed when Chromium is unable to become the default browser after the user requests that it became the default browser.  This is a general error message.">
+      Chromium was not able to become the default browser.
+    </message>
   </if>
 
   <!-- Privacy Page -->
diff --git a/chrome/app/settings_google_chrome_strings.grdp b/chrome/app/settings_google_chrome_strings.grdp
index 29c00e6..d65d911 100644
--- a/chrome/app/settings_google_chrome_strings.grdp
+++ b/chrome/app/settings_google_chrome_strings.grdp
@@ -18,6 +18,9 @@
     <message name="IDS_SETTINGS_DEFAULT_BROWSER_SECONDARY" desc="The text displayed when Chrome is installed in side-by-side mode, which does not support setting as the default browser.">
       This is a secondary installation of Google Chrome, and cannot be made your default browser.
     </message>
+    <message name="IDS_SETTINGS_DEFAULT_BROWSER_ERROR" desc="The text displayed when Chrome is unable to become the default browser after the user requests that it became the default browser.  This is a general error message.">
+      Google Chrome was not able to become the default browser.
+    </message>
   </if>
 
   <!-- Privacy Page -->
diff --git a/chrome/app/theme/default_100_percent/common/omnibox_ev_bubble_https_valid.png b/chrome/app/theme/default_100_percent/common/omnibox_ev_bubble_https_valid.png
new file mode 100644
index 0000000..765756e
--- /dev/null
+++ b/chrome/app/theme/default_100_percent/common/omnibox_ev_bubble_https_valid.png
Binary files differ
diff --git a/chrome/app/theme/default_100_percent/common/omnibox_selected_keyword_bubble_search.png b/chrome/app/theme/default_100_percent/common/omnibox_selected_keyword_bubble_search.png
new file mode 100644
index 0000000..98d6dd1
--- /dev/null
+++ b/chrome/app/theme/default_100_percent/common/omnibox_selected_keyword_bubble_search.png
Binary files differ
diff --git a/chrome/app/theme/default_200_percent/common/omnibox_ev_bubble_https_valid.png b/chrome/app/theme/default_200_percent/common/omnibox_ev_bubble_https_valid.png
new file mode 100644
index 0000000..a8c89b4
--- /dev/null
+++ b/chrome/app/theme/default_200_percent/common/omnibox_ev_bubble_https_valid.png
Binary files differ
diff --git a/chrome/app/theme/default_200_percent/common/omnibox_selected_keyword_bubble_search.png b/chrome/app/theme/default_200_percent/common/omnibox_selected_keyword_bubble_search.png
new file mode 100644
index 0000000..3a86607
--- /dev/null
+++ b/chrome/app/theme/default_200_percent/common/omnibox_selected_keyword_bubble_search.png
Binary files differ
diff --git a/chrome/app/theme/theme_resources.grd b/chrome/app/theme/theme_resources.grd
index f5553ee..0536514 100644
--- a/chrome/app/theme/theme_resources.grd
+++ b/chrome/app/theme/theme_resources.grd
@@ -497,6 +497,7 @@
         <structure type="chrome_scaled_image" name="IDR_OMNIBOX_DROPDOWN_SHADOW_BOTTOM" file="common/omnibox_dropdown_shadow_bottom.png" />
         <structure type="chrome_scaled_image" name="IDR_OMNIBOX_DROPDOWN_SHADOW_TOP" file="common/omnibox_dropdown_shadow_top.png" />
         <structure type="chrome_scaled_image" name="IDR_OMNIBOX_EV_BUBBLE" file="common/omnibox_ev_bubble.png" />
+        <structure type="chrome_scaled_image" name="IDR_OMNIBOX_EV_BUBBLE_HTTPS_VALID" file="common/omnibox_ev_bubble_https_valid.png" />
       </if>
       <structure type="chrome_scaled_image" name="IDR_OMNIBOX_EV_BUBBLE_BOTTOM" file="common/omnibox_ev_bubble_bottom.png" />
       <structure type="chrome_scaled_image" name="IDR_OMNIBOX_EV_BUBBLE_BOTTOM_LEFT" file="common/omnibox_ev_bubble_bottom_left.png" />
@@ -538,6 +539,7 @@
       <structure type="chrome_scaled_image" name="IDR_OMNIBOX_SEARCH_SELECTED" file="common/omnibox_search_selected.png" />
       <if expr="enable_topchrome_md">
         <structure type="chrome_scaled_image" name="IDR_OMNIBOX_SELECTED_KEYWORD_BUBBLE" file="common/omnibox_selected_keyword_bubble.png" />
+        <structure type="chrome_scaled_image" name="IDR_OMNIBOX_SELECTED_KEYWORD_BUBBLE_SEARCH" file="common/omnibox_selected_keyword_bubble_search.png" />
       </if>
       <structure type="chrome_scaled_image" name="IDR_OMNIBOX_SELECTED_KEYWORD_BUBBLE_BOTTOM" file="common/omnibox_selected_keyword_bubble_bottom.png" />
       <structure type="chrome_scaled_image" name="IDR_OMNIBOX_SELECTED_KEYWORD_BUBBLE_BOTTOM_LEFT" file="common/omnibox_selected_keyword_bubble_bottom_left.png" />
diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn
index de72288..c22e542a 100644
--- a/chrome/browser/BUILD.gn
+++ b/chrome/browser/BUILD.gn
@@ -534,21 +534,10 @@
     deps += [ "//chrome/browser/chromeos" ]
   }
 
-  if (is_ios) {
-    sources -= [
-      "metrics/signin_status_metrics_provider_base.cc",
-      "metrics/signin_status_metrics_provider_base.h",
-    ]
-  }
-
   if (is_chromeos || is_ios) {
     sources -= [
-      "metrics/chrome_signin_status_metrics_provider_delegate.cc",
-      "metrics/chrome_signin_status_metrics_provider_delegate.h",
-      "metrics/signin_status_metrics_provider.cc",
-      "metrics/signin_status_metrics_provider.h",
-      "metrics/signin_status_metrics_provider_delegate.cc",
-      "metrics/signin_status_metrics_provider_delegate.h",
+      "signin/chrome_signin_status_metrics_provider_delegate.cc",
+      "signin/chrome_signin_status_metrics_provider_delegate.h",
     ]
   }
 
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc
index 805876c..95affd34 100644
--- a/chrome/browser/about_flags.cc
+++ b/chrome/browser/about_flags.cc
@@ -1458,11 +1458,6 @@
      kOsMac,
      SINGLE_VALUE_TYPE(switches::kHostedAppQuitNotification)},
 #endif
-    {"enable-ephemeral-apps-in-webstore",
-     IDS_FLAGS_ENABLE_EPHEMERAL_APPS_IN_WEBSTORE_NAME,
-     IDS_FLAGS_ENABLE_EPHEMERAL_APPS_IN_WEBSTORE_DESCRIPTION,
-     kOsAll,
-     SINGLE_VALUE_TYPE(switches::kEnableEphemeralAppsInWebstore)},
 #if defined(OS_ANDROID)
     {"disable-pull-to-refresh-effect",
      IDS_FLAGS_DISABLE_PULL_TO_REFRESH_EFFECT_NAME,
diff --git a/chrome/browser/android/chrome_jni_registrar.cc b/chrome/browser/android/chrome_jni_registrar.cc
index 210bbd9..b57311a 100644
--- a/chrome/browser/android/chrome_jni_registrar.cc
+++ b/chrome/browser/android/chrome_jni_registrar.cc
@@ -30,6 +30,7 @@
 #include "chrome/browser/android/contextualsearch/contextual_search_manager.h"
 #include "chrome/browser/android/contextualsearch/contextual_search_tab_helper.h"
 #include "chrome/browser/android/cookies/cookies_fetcher.h"
+#include "chrome/browser/android/datausage/external_data_use_observer.h"
 #include "chrome/browser/android/dev_tools_server.h"
 #include "chrome/browser/android/document/document_web_contents_delegate.h"
 #include "chrome/browser/android/dom_distiller/external_feedback_reporter_android.h"
@@ -240,6 +241,7 @@
     {"DownloadOverwriteInfoBarDelegate",
      RegisterDownloadOverwriteInfoBarDelegate},
     {"EditBookmarkHelper", RegisterEditBookmarkHelper},
+    {"ExternalDataUseObserver", RegisterExternalDataUseObserver},
     {"ExternalPrerenderRequestHandler",
      prerender::ExternalPrerenderHandlerAndroid::
          RegisterExternalPrerenderHandlerAndroid},
@@ -324,8 +326,7 @@
     {"TabModelJniBridge", TabModelJniBridge::Register},
     {"TabState", RegisterTabState},
     {"TabStripSceneLayer", RegisterTabStripSceneLayer},
-    {"TabWebContentsDelegateAndroid",
-     RegisterTabWebContentsDelegateAndroid},
+    {"TabWebContentsDelegateAndroid", RegisterTabWebContentsDelegateAndroid},
     {"TemplateUrlServiceAndroid", TemplateUrlServiceAndroid::Register},
     {"ThumbnailTabHelperAndroid", RegisterThumbnailTabHelperAndroid},
     {"ToolbarModelAndroid", ToolbarModelAndroid::RegisterToolbarModelAndroid},
diff --git a/chrome/browser/android/datausage/OWNERS b/chrome/browser/android/datausage/OWNERS
new file mode 100644
index 0000000..ea92650
--- /dev/null
+++ b/chrome/browser/android/datausage/OWNERS
@@ -0,0 +1,2 @@
+bengr@chromium.org
+sclittle@chromium.org
\ No newline at end of file
diff --git a/chrome/browser/android/datausage/external_data_use_observer.cc b/chrome/browser/android/datausage/external_data_use_observer.cc
new file mode 100644
index 0000000..180037ba
--- /dev/null
+++ b/chrome/browser/android/datausage/external_data_use_observer.cc
@@ -0,0 +1,111 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/android/datausage/external_data_use_observer.h"
+
+#include "base/android/jni_string.h"
+#include "jni/ExternalDataUseObserver_jni.h"
+#include "third_party/re2/re2/re2.h"
+#include "url/gurl.h"
+
+using base::android::ConvertUTF8ToJavaString;
+
+namespace chrome {
+
+namespace android {
+
+ExternalDataUseObserver::ExternalDataUseObserver(
+    data_usage::DataUseAggregator* data_use_aggregator)
+    : data_use_aggregator_(data_use_aggregator) {
+  DCHECK(data_use_aggregator_);
+
+  JNIEnv* env = base::android::AttachCurrentThread();
+  j_external_data_use_observer_.Reset(Java_ExternalDataUseObserver_create(
+      env, base::android::GetApplicationContext(),
+      reinterpret_cast<intptr_t>(this)));
+  DCHECK(!j_external_data_use_observer_.is_null());
+}
+
+ExternalDataUseObserver::~ExternalDataUseObserver() {
+  DCHECK(thread_checker_.CalledOnValidThread());
+
+  JNIEnv* env = base::android::AttachCurrentThread();
+
+  Java_ExternalDataUseObserver_onDestroy(env,
+                                         j_external_data_use_observer_.obj());
+
+  if (url_patterns_.size() > 0)
+    data_use_aggregator_->RemoveObserver(this);
+}
+
+bool ExternalDataUseObserver::Matches(const GURL& gurl) const {
+  if (!gurl.is_valid() || gurl.is_empty())
+    return false;
+
+  for (const re2::RE2* pattern : url_patterns_) {
+    if (re2::RE2::FullMatch(gurl.spec(), *pattern))
+      return true;
+  }
+
+  return false;
+}
+
+void ExternalDataUseObserver::OnDataUse(
+    const std::vector<data_usage::DataUse>& data_use_sequence) {
+  DCHECK(thread_checker_.CalledOnValidThread());
+  DCHECK(!j_external_data_use_observer_.is_null());
+
+  JNIEnv* env = base::android::AttachCurrentThread();
+
+  for (const auto& data_use : data_use_sequence) {
+    if (!Matches(data_use.url))
+      continue;
+
+    // TODO(tbansal): Use buffering to avoid frequent JNI calls.
+    std::string tag = "";  // data_use.tab_id;
+    int64_t bytes_downloaded = data_use.rx_bytes;
+    int64_t bytes_uploaded = data_use.tx_bytes;
+    Java_ExternalDataUseObserver_onDataUse(
+        env, j_external_data_use_observer_.obj(),
+        ConvertUTF8ToJavaString(env, tag).obj(), bytes_downloaded,
+        bytes_uploaded);
+  }
+}
+
+void ExternalDataUseObserver::RegisterURLRegexes(
+    const std::vector<std::string>& url_regexes) {
+  DCHECK(thread_checker_.CalledOnValidThread());
+
+  bool registered_as_observer = url_patterns_.size() > 0;
+  if (!registered_as_observer && url_regexes.size() > 0) {
+    registered_as_observer = true;
+    data_use_aggregator_->AddObserver(this);
+  }
+
+  url_patterns_.clear();
+
+  re2::RE2::Options options(re2::RE2::DefaultOptions);
+  options.set_case_sensitive(false);
+
+  for (const std::string& url_regex : url_regexes) {
+    if (url_regex.empty())
+      continue;
+    scoped_ptr<re2::RE2> pattern(new re2::RE2(url_regex, options));
+    if (!pattern->ok())
+      continue;
+    url_patterns_.push_back(pattern.Pass());
+  }
+
+  // Unregister as an observer if no regular expressions were received.
+  if (url_patterns_.size() == 0 && registered_as_observer)
+    data_use_aggregator_->RemoveObserver(this);
+}
+
+bool RegisterExternalDataUseObserver(JNIEnv* env) {
+  return RegisterNativesImpl(env);
+}
+
+}  // namespace android
+
+}  // namespace chrome
diff --git a/chrome/browser/android/datausage/external_data_use_observer.h b/chrome/browser/android/datausage/external_data_use_observer.h
new file mode 100644
index 0000000..1199ec86
--- /dev/null
+++ b/chrome/browser/android/datausage/external_data_use_observer.h
@@ -0,0 +1,84 @@
+// 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 CHROME_BROWSER_ANDROID_DATAUSAGE_EXTERNAL_DATA_USE_OBSERVER_H_
+#define CHROME_BROWSER_ANDROID_DATAUSAGE_EXTERNAL_DATA_USE_OBSERVER_H_
+
+#include <jni.h>
+#include <string>
+#include <vector>
+
+#include "base/android/scoped_java_ref.h"
+#include "base/gtest_prod_util.h"
+#include "base/macros.h"
+#include "base/memory/scoped_vector.h"
+#include "base/threading/thread_checker.h"
+#include "components/data_usage/core/data_use.h"
+#include "components/data_usage/core/data_use_aggregator.h"
+
+namespace re2 {
+class RE2;
+}
+
+namespace chrome {
+
+namespace android {
+
+// This class allows platform APIs that are external to Chromium to observe how
+// much data is used by Chromium on the current Android device. It creates and
+// owns a Java listener object that is notified of the data usage observations
+// of Chromium. This class receives regular expressions from the Java listener
+// object. It also registers as a data use observer with DataUseAggregator,
+// filters the received observations by applying the regex matching to the URLs
+// of the requests, and notifies the filtered data use to the Java listener. The
+// Java object in turn may notify the platform APIs of the data usage
+// observations.
+class ExternalDataUseObserver : public data_usage::DataUseAggregator::Observer {
+ public:
+  explicit ExternalDataUseObserver(
+      data_usage::DataUseAggregator* data_use_aggregator);
+  ~ExternalDataUseObserver() override;
+
+ private:
+  FRIEND_TEST_ALL_PREFIXES(ExternalDataUseObserverTest, SingleRegex);
+  FRIEND_TEST_ALL_PREFIXES(ExternalDataUseObserverTest, TwoRegex);
+  FRIEND_TEST_ALL_PREFIXES(ExternalDataUseObserverTest, MultipleRegex);
+  FRIEND_TEST_ALL_PREFIXES(ExternalDataUseObserverTest, ChangeRegex);
+
+  // data_usage::DataUseAggregator::Observer implementation:
+  void OnDataUse(
+      const std::vector<data_usage::DataUse>& data_use_sequence) override;
+
+  // Called by |j_external_data_use_observer_| to register multiple
+  // case-insensitive regular expressions. If the url of the data use request
+  // matches any of the regular expression, the observation is passed to the
+  // Java listener.
+  void RegisterURLRegexes(const std::vector<std::string>& url_regexes);
+
+  // Returns true if the |gurl| matches the registered regular expressions.
+  bool Matches(const GURL& gurl) const;
+
+  // Aggregator that sends data use observations.
+  data_usage::DataUseAggregator* data_use_aggregator_;
+
+  // Java listener that provides regular expressions to this class. The
+  // regular expressions are applied to the request URLs, and filtered
+  // data use is notified to |j_external_data_use_observer_|.
+  base::android::ScopedJavaGlobalRef<jobject> j_external_data_use_observer_;
+
+  // Registered RE2 patterns that are matched against the URLs.
+  ScopedVector<re2::RE2> url_patterns_;
+
+  base::ThreadChecker thread_checker_;
+
+  DISALLOW_COPY_AND_ASSIGN(ExternalDataUseObserver);
+};
+
+bool RegisterExternalDataUseObserver(JNIEnv* env);
+
+}  // namespace android
+
+}  // namespace chrome
+
+#endif  // CHROME_BROWSER_ANDROID_DATAUSAGE_EXTERNAL_DATA_USE_OBSERVER_H_
diff --git a/chrome/browser/android/datausage/external_data_use_observer_unittest.cc b/chrome/browser/android/datausage/external_data_use_observer_unittest.cc
new file mode 100644
index 0000000..0904755
--- /dev/null
+++ b/chrome/browser/android/datausage/external_data_use_observer_unittest.cc
@@ -0,0 +1,197 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/android/datausage/external_data_use_observer.h"
+
+#include <string>
+#include <vector>
+
+#include "base/memory/scoped_ptr.h"
+#include "components/data_usage/core/data_use.h"
+#include "components/data_usage/core/data_use_aggregator.h"
+#include "testing/gtest/include/gtest/gtest.h"
+#include "url/gurl.h"
+
+namespace chrome {
+
+namespace android {
+
+TEST(ExternalDataUseObserverTest, SingleRegex) {
+  scoped_ptr<data_usage::DataUseAggregator> data_use_aggregator(
+      new data_usage::DataUseAggregator());
+  scoped_ptr<ExternalDataUseObserver> external_data_use_observer(
+      new ExternalDataUseObserver(data_use_aggregator.get()));
+
+  const struct {
+    std::string url;
+    std::string regex;
+    bool expect_match;
+  } tests[] = {
+      {"http://www.google.com", "http://www.google.com/", true},
+      {"http://www.Google.com", "http://www.google.com/", true},
+      {"http://www.googleacom", "http://www.google.com/", true},
+      {"http://www.googleaacom", "http://www.google.com/", false},
+      {"http://www.google.com", "https://www.google.com/", false},
+      {"http://www.google.com", "{http|https}://www\\.google\\.com/search.*",
+       false},
+      {"https://www.google.com/search=test",
+       "https://www\\.google\\.com/search.*", true},
+      {"https://www.googleacom/search=test",
+       "https://www\\.google\\.com/search.*", false},
+      {"https://www.google.com/Search=test",
+       "https://www\\.google\\.com/search.*", true},
+      {"www.google.com", "http://www.google.com", false},
+      {"www.google.com:80", "http://www.google.com", false},
+      {"http://www.google.com:80", "http://www.google.com", false},
+      {"http://www.google.com:80/", "http://www.google.com/", true},
+      {"", "http://www.google.com", false},
+      {"", "", false},
+      {"https://www.google.com", "http://www.google.com", false},
+  };
+
+  for (size_t i = 0; i < arraysize(tests); ++i) {
+    external_data_use_observer->RegisterURLRegexes(
+        std::vector<std::string>(1, tests[i].regex));
+    EXPECT_EQ(tests[i].expect_match,
+              external_data_use_observer->Matches(GURL(tests[i].url)))
+        << i;
+  }
+}
+
+TEST(ExternalDataUseObserverTest, TwoRegex) {
+  scoped_ptr<data_usage::DataUseAggregator> data_use_aggregator(
+      new data_usage::DataUseAggregator());
+  scoped_ptr<ExternalDataUseObserver> external_data_use_observer(
+      new ExternalDataUseObserver(data_use_aggregator.get()));
+
+  const struct {
+    std::string url;
+    std::string regex1;
+    std::string regex2;
+    bool expect_match;
+  } tests[] = {
+      {"http://www.google.com", "http://www.google.com/",
+       "https://www.google.com/", true},
+      {"http://www.googleacom", "http://www.google.com/",
+       "http://www.google.com/", true},
+      {"https://www.google.com", "http://www.google.com/",
+       "https://www.google.com/", true},
+      {"https://www.googleacom", "http://www.google.com/",
+       "https://www.google.com/", true},
+      {"http://www.google.com", "{http|https}://www\\.google\\.com/search.*",
+       "", false},
+      {"http://www.google.com/search=test",
+       "http://www\\.google\\.com/search.*",
+       "https://www\\.google\\.com/search.*", true},
+      {"https://www.google.com/search=test",
+       "http://www\\.google\\.com/search.*",
+       "https://www\\.google\\.com/search.*", true},
+      {"http://google.com/search=test", "http://www\\.google\\.com/search.*",
+       "https://www\\.google\\.com/search.*", false},
+      {"https://www.googleacom/search=test", "",
+       "https://www\\.google\\.com/search.*", false},
+      {"https://www.google.com/Search=test", "",
+       "https://www\\.google\\.com/search.*", true},
+      {"www.google.com", "http://www.google.com", "", false},
+      {"www.google.com:80", "http://www.google.com", "", false},
+      {"http://www.google.com:80", "http://www.google.com", "", false},
+      {"", "http://www.google.com", "", false},
+      {"https://www.google.com", "http://www.google.com", "", false},
+  };
+
+  for (size_t i = 0; i < arraysize(tests); ++i) {
+    std::vector<std::string> url_regexes;
+    url_regexes.push_back(tests[i].regex1);
+    url_regexes.push_back(tests[i].regex2);
+    external_data_use_observer->RegisterURLRegexes(url_regexes);
+    EXPECT_EQ(tests[i].expect_match,
+              external_data_use_observer->Matches(GURL(tests[i].url)))
+        << i;
+  }
+}
+
+TEST(ExternalDataUseObserverTest, MultipleRegex) {
+  scoped_ptr<data_usage::DataUseAggregator> data_use_aggregator(
+      new data_usage::DataUseAggregator());
+  scoped_ptr<ExternalDataUseObserver> external_data_use_observer(
+      new ExternalDataUseObserver(data_use_aggregator.get()));
+
+  std::vector<std::string> url_regexes;
+  url_regexes.push_back("http://www\\.google\\.com/#q=.*");
+  url_regexes.push_back("https://www\\.google\\.com/#q=.*");
+  url_regexes.push_back("http://www\\.google\\.co\\.in/#q=.*");
+  url_regexes.push_back("https://www\\.google\\.co\\.in/#q=.*");
+  external_data_use_observer->RegisterURLRegexes(url_regexes);
+
+  const struct {
+    std::string url;
+    bool expect_match;
+  } tests[] = {
+      {"", false},
+      {"http://www.google.com", false},
+      {"http://www.googleacom", false},
+      {"https://www.google.com", false},
+      {"https://www.googleacom", false},
+      {"http://www.google.com", false},
+      {"quic://www.google.com/q=test", false},
+      {"http://www.google.com/q=test", false},
+      {"http://www.google.com/.q=test", false},
+      {"http://www.google.com/#q=test", true},
+      {"https://www.google.com/#q=test", true},
+      {"http://www.google.co.in/#q=test", true},
+      {"https://www.google.co.in/#q=test", true},
+      {"http://www.google.co.br/#q=test", false},
+      {"http://google.com/#q=test", false},
+      {"https://www.googleacom/#q=test", false},
+      {"https://www.google.com/#Q=test", true},  // case in-sensitive
+      {"www.google.com/#q=test", false},
+      {"www.google.com:80/#q=test", false},
+      {"http://www.google.com:80/#q=test", true},
+  };
+
+  for (size_t i = 0; i < arraysize(tests); ++i) {
+    EXPECT_EQ(tests[i].expect_match,
+              external_data_use_observer->Matches(GURL(tests[i].url)))
+        << i << tests[i].url;
+  }
+}
+
+TEST(ExternalDataUseObserverTest, ChangeRegex) {
+  scoped_ptr<data_usage::DataUseAggregator> data_use_aggregator(
+      new data_usage::DataUseAggregator());
+  scoped_ptr<ExternalDataUseObserver> external_data_use_observer(
+      new ExternalDataUseObserver(data_use_aggregator.get()));
+
+  // When no regex is specified, the URL match should fail.
+  EXPECT_FALSE(external_data_use_observer->Matches(GURL("")));
+  EXPECT_FALSE(
+      external_data_use_observer->Matches(GURL("http://www.google.com")));
+
+  std::vector<std::string> url_regexes;
+  url_regexes.push_back("http://www\\.google\\.com/#q=.*");
+  url_regexes.push_back("https://www\\.google\\.com/#q=.*");
+  external_data_use_observer->RegisterURLRegexes(url_regexes);
+
+  EXPECT_FALSE(external_data_use_observer->Matches(GURL("")));
+  EXPECT_TRUE(
+      external_data_use_observer->Matches(GURL("http://www.google.com#q=abc")));
+  EXPECT_FALSE(external_data_use_observer->Matches(
+      GURL("http://www.google.co.in#q=abc")));
+
+  // Change the regular expressions to verify that the new regexes replace
+  // the ones specified before.
+  url_regexes.clear();
+  url_regexes.push_back("http://www\\.google\\.co\\.in/#q=.*");
+  url_regexes.push_back("https://www\\.google\\.co\\.in/#q=.*");
+  external_data_use_observer->RegisterURLRegexes(url_regexes);
+  EXPECT_FALSE(external_data_use_observer->Matches(GURL("")));
+  EXPECT_FALSE(
+      external_data_use_observer->Matches(GURL("http://www.google.com#q=abc")));
+  EXPECT_TRUE(external_data_use_observer->Matches(
+      GURL("http://www.google.co.in#q=abc")));
+}
+
+}  // namespace android
+
+}  // namespace chrome
diff --git a/chrome/browser/apps/ephemeral_app_launcher.cc b/chrome/browser/apps/ephemeral_app_launcher.cc
deleted file mode 100644
index c9d4fa06..0000000
--- a/chrome/browser/apps/ephemeral_app_launcher.cc
+++ /dev/null
@@ -1,477 +0,0 @@
-// Copyright 2013 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "chrome/browser/apps/ephemeral_app_launcher.h"
-
-#include "base/command_line.h"
-#include "base/strings/utf_string_conversions.h"
-#include "chrome/browser/extensions/extension_install_checker.h"
-#include "chrome/browser/extensions/extension_install_prompt.h"
-#include "chrome/browser/extensions/extension_util.h"
-#include "chrome/browser/profiles/profile.h"
-#include "chrome/browser/ui/browser_navigator.h"
-#include "chrome/browser/ui/browser_navigator_params.h"
-#include "chrome/browser/ui/extensions/app_launch_params.h"
-#include "chrome/browser/ui/extensions/application_launch.h"
-#include "chrome/browser/ui/extensions/extension_enable_flow.h"
-#include "chrome/browser/ui/native_window_tracker.h"
-#include "chrome/browser/ui/scoped_tabbed_browser_displayer.h"
-#include "chrome/common/chrome_switches.h"
-#include "chrome/common/extensions/manifest_handlers/app_launch_info.h"
-#include "content/public/browser/web_contents.h"
-#include "extensions/browser/extension_prefs.h"
-#include "extensions/browser/extension_registry.h"
-#include "extensions/browser/extension_system.h"
-#include "extensions/browser/management_policy.h"
-#include "extensions/common/constants.h"
-#include "extensions/common/permissions/permissions_data.h"
-#include "ui/app_list/app_list_switches.h"
-
-using content::WebContents;
-using extensions::Extension;
-using extensions::ExtensionInstallChecker;
-using extensions::ExtensionPrefs;
-using extensions::ExtensionRegistry;
-using extensions::ExtensionSystem;
-using extensions::ManagementPolicy;
-using extensions::WebstoreInstaller;
-namespace webstore_install = extensions::webstore_install;
-
-namespace {
-
-const char kInvalidManifestError[] = "Invalid manifest";
-const char kExtensionTypeError[] = "Not an app";
-const char kAppTypeError[] = "Ephemeral legacy packaged apps not supported";
-const char kUserCancelledError[] = "Launch cancelled by the user";
-const char kBlacklistedError[] = "App is blacklisted for malware";
-const char kRequirementsError[] = "App has missing requirements";
-const char kFeatureDisabledError[] = "Launching ephemeral apps is not enabled";
-const char kMissingAppError[] = "App is not installed";
-const char kAppDisabledError[] = "App is disabled";
-
-Profile* ProfileForWebContents(content::WebContents* contents) {
-  if (!contents)
-    return NULL;
-
-  return Profile::FromBrowserContext(contents->GetBrowserContext());
-}
-
-gfx::NativeWindow NativeWindowForWebContents(content::WebContents* contents) {
-  if (!contents)
-    return NULL;
-
-  return contents->GetTopLevelNativeWindow();
-}
-
-// Check whether an extension can be launched. The extension does not need to
-// be currently installed.
-bool CheckCommonLaunchCriteria(Profile* profile,
-                               const Extension* extension,
-                               webstore_install::Result* reason,
-                               std::string* error) {
-  // Only apps can be launched.
-  if (!extension->is_app()) {
-    *reason = webstore_install::LAUNCH_UNSUPPORTED_EXTENSION_TYPE;
-    *error = kExtensionTypeError;
-    return false;
-  }
-
-  // Do not launch apps blocked by management policies.
-  ManagementPolicy* management_policy =
-      ExtensionSystem::Get(profile)->management_policy();
-  base::string16 policy_error;
-  if (!management_policy->UserMayLoad(extension, &policy_error)) {
-    *reason = webstore_install::BLOCKED_BY_POLICY;
-    *error = base::UTF16ToUTF8(policy_error);
-    return false;
-  }
-
-  return true;
-}
-
-}  // namespace
-
-// static
-bool EphemeralAppLauncher::IsFeatureEnabled() {
-  return base::CommandLine::ForCurrentProcess()->HasSwitch(
-             switches::kEnableEphemeralAppsInWebstore);
-}
-
-// static
-scoped_refptr<EphemeralAppLauncher> EphemeralAppLauncher::CreateForLauncher(
-    const std::string& webstore_item_id,
-    Profile* profile,
-    gfx::NativeWindow parent_window,
-    const LaunchCallback& callback) {
-  scoped_refptr<EphemeralAppLauncher> installer =
-      new EphemeralAppLauncher(webstore_item_id,
-                               profile,
-                               parent_window,
-                               callback);
-  installer->set_install_source(WebstoreInstaller::INSTALL_SOURCE_APP_LAUNCHER);
-  return installer;
-}
-
-// static
-scoped_refptr<EphemeralAppLauncher> EphemeralAppLauncher::CreateForWebContents(
-    const std::string& webstore_item_id,
-    content::WebContents* web_contents,
-    const LaunchCallback& callback) {
-  scoped_refptr<EphemeralAppLauncher> installer =
-      new EphemeralAppLauncher(webstore_item_id, web_contents, callback);
-  installer->set_install_source(WebstoreInstaller::INSTALL_SOURCE_OTHER);
-  return installer;
-}
-
-void EphemeralAppLauncher::Start() {
-  if (!IsFeatureEnabled()) {
-    InvokeCallback(webstore_install::LAUNCH_FEATURE_DISABLED,
-                   kFeatureDisabledError);
-    return;
-  }
-
-  // Check whether the app already exists in extension system before downloading
-  // from the webstore.
-  const Extension* extension =
-      ExtensionRegistry::Get(profile())
-          ->GetExtensionById(id(), ExtensionRegistry::EVERYTHING);
-  if (extension) {
-    webstore_install::Result result = webstore_install::OTHER_ERROR;
-    std::string error;
-    if (!CanLaunchInstalledApp(extension, &result, &error)) {
-      InvokeCallback(result, error);
-      return;
-    }
-
-    if (extensions::util::IsAppLaunchableWithoutEnabling(extension->id(),
-                                                         profile())) {
-      LaunchApp(extension);
-      InvokeCallback(webstore_install::SUCCESS, std::string());
-      return;
-    }
-
-    EnableInstalledApp(extension);
-    return;
-  }
-
-  // Install the app ephemerally and launch when complete.
-  BeginInstall();
-}
-
-EphemeralAppLauncher::EphemeralAppLauncher(const std::string& webstore_item_id,
-                                           Profile* profile,
-                                           gfx::NativeWindow parent_window,
-                                           const LaunchCallback& callback)
-    : WebstoreStandaloneInstaller(webstore_item_id, profile, Callback()),
-      launch_callback_(callback),
-      parent_window_(parent_window),
-      dummy_web_contents_(
-          WebContents::Create(WebContents::CreateParams(profile))) {
-  if (parent_window_)
-    parent_window_tracker_ = NativeWindowTracker::Create(parent_window);
-}
-
-EphemeralAppLauncher::EphemeralAppLauncher(const std::string& webstore_item_id,
-                                           content::WebContents* web_contents,
-                                           const LaunchCallback& callback)
-    : WebstoreStandaloneInstaller(webstore_item_id,
-                                  ProfileForWebContents(web_contents),
-                                  Callback()),
-      content::WebContentsObserver(web_contents),
-      launch_callback_(callback),
-      parent_window_(NativeWindowForWebContents(web_contents)) {
-}
-
-EphemeralAppLauncher::~EphemeralAppLauncher() {}
-
-scoped_ptr<extensions::ExtensionInstallChecker>
-EphemeralAppLauncher::CreateInstallChecker() {
-  return make_scoped_ptr(new ExtensionInstallChecker(profile()));
-}
-
-scoped_ptr<ExtensionInstallPrompt> EphemeralAppLauncher::CreateInstallUI() {
-  if (web_contents())
-    return make_scoped_ptr(new ExtensionInstallPrompt(web_contents()));
-
-  return make_scoped_ptr(new ExtensionInstallPrompt(profile(), parent_window_));
-}
-
-scoped_ptr<WebstoreInstaller::Approval> EphemeralAppLauncher::CreateApproval()
-    const {
-  scoped_ptr<WebstoreInstaller::Approval> approval =
-      WebstoreStandaloneInstaller::CreateApproval();
-  approval->is_ephemeral = true;
-  return approval.Pass();
-}
-
-bool EphemeralAppLauncher::CanLaunchInstalledApp(
-    const extensions::Extension* extension,
-    webstore_install::Result* reason,
-    std::string* error) {
-  if (!CheckCommonLaunchCriteria(profile(), extension, reason, error))
-    return false;
-
-  // Do not launch blacklisted apps.
-  if (ExtensionPrefs::Get(profile())->IsExtensionBlacklisted(extension->id())) {
-    *reason = webstore_install::BLACKLISTED;
-    *error = kBlacklistedError;
-    return false;
-  }
-
-  // If the app has missing requirements, it cannot be launched.
-  if (!extensions::util::IsAppLaunchable(extension->id(), profile())) {
-    *reason = webstore_install::REQUIREMENT_VIOLATIONS;
-    *error = kRequirementsError;
-    return false;
-  }
-
-  return true;
-}
-
-void EphemeralAppLauncher::EnableInstalledApp(const Extension* extension) {
-  // Check whether an install is already in progress.
-  webstore_install::Result result = webstore_install::OTHER_ERROR;
-  std::string error;
-  if (!EnsureUniqueInstall(&result, &error)) {
-    InvokeCallback(result, error);
-    return;
-  }
-
-  // Keep this object alive until the enable flow is complete. Either
-  // ExtensionEnableFlowFinished() or ExtensionEnableFlowAborted() will be
-  // called.
-  AddRef();
-
-  extension_enable_flow_.reset(
-      new ExtensionEnableFlow(profile(), extension->id(), this));
-  if (web_contents())
-    extension_enable_flow_->StartForWebContents(web_contents());
-  else
-    extension_enable_flow_->StartForNativeWindow(parent_window_);
-}
-
-void EphemeralAppLauncher::MaybeLaunchApp() {
-  webstore_install::Result result = webstore_install::OTHER_ERROR;
-  std::string error;
-
-  ExtensionRegistry* registry = ExtensionRegistry::Get(profile());
-  const Extension* extension =
-      registry->GetExtensionById(id(), ExtensionRegistry::EVERYTHING);
-  if (extension) {
-    // Although the installation was successful, the app may not be
-    // launchable.
-    if (registry->enabled_extensions().Contains(extension->id())) {
-      result = webstore_install::SUCCESS;
-      LaunchApp(extension);
-    } else {
-      error = kAppDisabledError;
-      // Determine why the app cannot be launched.
-      CanLaunchInstalledApp(extension, &result, &error);
-    }
-  } else {
-    // The extension must be present in the registry if installed.
-    NOTREACHED();
-    error = kMissingAppError;
-  }
-
-  InvokeCallback(result, error);
-}
-
-void EphemeralAppLauncher::LaunchApp(const Extension* extension) const {
-  DCHECK(extension && extension->is_app() &&
-         ExtensionRegistry::Get(profile())
-             ->GetExtensionById(extension->id(), ExtensionRegistry::ENABLED));
-
-  AppLaunchParams params(profile(), extension, NEW_FOREGROUND_TAB,
-                         extensions::SOURCE_EPHEMERAL_APP);
-  params.desktop_type =
-      chrome::GetHostDesktopTypeForNativeWindow(parent_window_);
-  OpenApplication(params);
-}
-
-bool EphemeralAppLauncher::LaunchHostedApp(const Extension* extension) const {
-  GURL launch_url = extensions::AppLaunchInfo::GetLaunchWebURL(extension);
-  if (!launch_url.is_valid())
-    return false;
-
-  chrome::ScopedTabbedBrowserDisplayer displayer(
-      profile(), chrome::GetHostDesktopTypeForNativeWindow(parent_window_));
-  chrome::NavigateParams params(
-      displayer.browser(), launch_url, ui::PAGE_TRANSITION_AUTO_TOPLEVEL);
-  params.disposition = NEW_FOREGROUND_TAB;
-  chrome::Navigate(&params);
-  return true;
-}
-
-void EphemeralAppLauncher::InvokeCallback(webstore_install::Result result,
-                                          const std::string& error) {
-  if (!launch_callback_.is_null()) {
-    LaunchCallback callback = launch_callback_;
-    launch_callback_.Reset();
-    callback.Run(result, error);
-  }
-}
-
-void EphemeralAppLauncher::AbortLaunch(webstore_install::Result result,
-                                       const std::string& error) {
-  InvokeCallback(result, error);
-  WebstoreStandaloneInstaller::CompleteInstall(result, error);
-}
-
-void EphemeralAppLauncher::CheckEphemeralInstallPermitted() {
-  scoped_refptr<const Extension> extension = GetLocalizedExtensionForDisplay();
-  DCHECK(extension.get());  // Checked in OnManifestParsed().
-
-  install_checker_ = CreateInstallChecker();
-  DCHECK(install_checker_.get());
-
-  install_checker_->set_extension(extension);
-  install_checker_->Start(ExtensionInstallChecker::CHECK_BLACKLIST |
-                              ExtensionInstallChecker::CHECK_REQUIREMENTS,
-                          true,
-                          base::Bind(&EphemeralAppLauncher::OnInstallChecked,
-                                     base::Unretained(this)));
-}
-
-void EphemeralAppLauncher::OnInstallChecked(int check_failures) {
-  if (!CheckRequestorAlive()) {
-    AbortLaunch(webstore_install::OTHER_ERROR, std::string());
-    return;
-  }
-
-  if (install_checker_->blacklist_state() == extensions::BLACKLISTED_MALWARE) {
-    AbortLaunch(webstore_install::BLACKLISTED, kBlacklistedError);
-    return;
-  }
-
-  if (!install_checker_->requirement_errors().empty()) {
-    AbortLaunch(webstore_install::REQUIREMENT_VIOLATIONS,
-                install_checker_->requirement_errors().front());
-    return;
-  }
-
-  // Proceed with the normal install flow.
-  ProceedWithInstallPrompt();
-}
-
-void EphemeralAppLauncher::InitInstallData(
-    extensions::ActiveInstallData* install_data) const {
-  install_data->is_ephemeral = true;
-}
-
-bool EphemeralAppLauncher::CheckRequestorAlive() const {
-  if (!parent_window_) {
-    // Assume the requestor is always alive if |parent_window_| is null.
-    return true;
-  }
-
-  return (web_contents() != nullptr ||
-          (parent_window_tracker_ &&
-              !parent_window_tracker_->WasNativeWindowClosed()));
-}
-
-const GURL& EphemeralAppLauncher::GetRequestorURL() const {
-  return GURL::EmptyGURL();
-}
-
-bool EphemeralAppLauncher::ShouldShowPostInstallUI() const {
-  return false;
-}
-
-bool EphemeralAppLauncher::ShouldShowAppInstalledBubble() const {
-  return false;
-}
-
-WebContents* EphemeralAppLauncher::GetWebContents() const {
-  return web_contents() ? web_contents() : dummy_web_contents_.get();
-}
-
-scoped_refptr<ExtensionInstallPrompt::Prompt>
-EphemeralAppLauncher::CreateInstallPrompt() const {
-  const Extension* extension = localized_extension_for_display();
-  DCHECK(extension);  // Checked in OnManifestParsed().
-
-  // Skip the prompt by returning null if the app does not need to display
-  // permission warnings.
-  if (extension->permissions_data()->GetPermissionMessages().empty())
-    return NULL;
-
-  return make_scoped_refptr(new ExtensionInstallPrompt::Prompt(
-      ExtensionInstallPrompt::LAUNCH_PROMPT));
-}
-
-bool EphemeralAppLauncher::CheckInlineInstallPermitted(
-    const base::DictionaryValue& webstore_data,
-    std::string* error) const {
-  *error = "";
-  return true;
-}
-
-bool EphemeralAppLauncher::CheckRequestorPermitted(
-    const base::DictionaryValue& webstore_data,
-    std::string* error) const {
-  *error = "";
-  return true;
-}
-
-void EphemeralAppLauncher::OnManifestParsed() {
-  scoped_refptr<const Extension> extension = GetLocalizedExtensionForDisplay();
-  if (!extension.get()) {
-    AbortLaunch(webstore_install::INVALID_MANIFEST, kInvalidManifestError);
-    return;
-  }
-
-  webstore_install::Result result = webstore_install::OTHER_ERROR;
-  std::string error;
-  if (!CheckCommonLaunchCriteria(profile(), extension.get(), &result, &error)) {
-    AbortLaunch(result, error);
-    return;
-  }
-
-  if (extension->is_legacy_packaged_app()) {
-    AbortLaunch(webstore_install::LAUNCH_UNSUPPORTED_EXTENSION_TYPE,
-                kAppTypeError);
-    return;
-  }
-
-  if (extension->is_hosted_app()) {
-    // Hosted apps do not need to be installed ephemerally. Just navigate to
-    // their launch url.
-    if (LaunchHostedApp(extension.get()))
-      AbortLaunch(webstore_install::SUCCESS, std::string());
-    else
-      AbortLaunch(webstore_install::INVALID_MANIFEST, kInvalidManifestError);
-    return;
-  }
-
-  CheckEphemeralInstallPermitted();
-}
-
-void EphemeralAppLauncher::CompleteInstall(webstore_install::Result result,
-                                           const std::string& error) {
-  if (result == webstore_install::SUCCESS)
-    MaybeLaunchApp();
-  else if (!launch_callback_.is_null())
-    InvokeCallback(result, error);
-
-  WebstoreStandaloneInstaller::CompleteInstall(result, error);
-}
-
-void EphemeralAppLauncher::WebContentsDestroyed() {
-  launch_callback_.Reset();
-  AbortInstall();
-}
-
-void EphemeralAppLauncher::ExtensionEnableFlowFinished() {
-  MaybeLaunchApp();
-
-  // CompleteInstall will call Release.
-  WebstoreStandaloneInstaller::CompleteInstall(webstore_install::SUCCESS,
-                                               std::string());
-}
-
-void EphemeralAppLauncher::ExtensionEnableFlowAborted(bool user_initiated) {
-  // CompleteInstall will call Release.
-  CompleteInstall(webstore_install::USER_CANCELLED, kUserCancelledError);
-}
diff --git a/chrome/browser/apps/ephemeral_app_launcher.h b/chrome/browser/apps/ephemeral_app_launcher.h
deleted file mode 100644
index 1ffab65..0000000
--- a/chrome/browser/apps/ephemeral_app_launcher.h
+++ /dev/null
@@ -1,157 +0,0 @@
-// Copyright 2013 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef CHROME_BROWSER_APPS_EPHEMERAL_APP_LAUNCHER_H_
-#define CHROME_BROWSER_APPS_EPHEMERAL_APP_LAUNCHER_H_
-
-#include <string>
-#include <vector>
-
-#include "base/basictypes.h"
-#include "base/callback.h"
-#include "base/scoped_observer.h"
-#include "chrome/browser/extensions/webstore_standalone_installer.h"
-#include "chrome/browser/ui/extensions/extension_enable_flow_delegate.h"
-#include "content/public/browser/web_contents_observer.h"
-
-class ExtensionEnableFlow;
-class NativeWindowTracker;
-class Profile;
-
-namespace content {
-class WebContents;
-}
-
-namespace extensions {
-class Extension;
-class ExtensionInstallChecker;
-class ExtensionRegistry;
-}
-
-// EphemeralAppLauncher manages the launching of ephemeral apps. It handles
-// display of a prompt, initiates install of the app (if necessary) and finally
-// launches the app.
-class EphemeralAppLauncher : public extensions::WebstoreStandaloneInstaller,
-                             public content::WebContentsObserver,
-                             public ExtensionEnableFlowDelegate {
- public:
-  typedef base::Callback<void(extensions::webstore_install::Result result,
-                              const std::string& error)> LaunchCallback;
-
-  // Returns true if launching ephemeral apps from the webstore is enabled.
-  static bool IsFeatureEnabled();
-
-  // Create for the app launcher.
-  static scoped_refptr<EphemeralAppLauncher> CreateForLauncher(
-      const std::string& webstore_item_id,
-      Profile* profile,
-      gfx::NativeWindow parent_window,
-      const LaunchCallback& callback);
-
-  // Create for a web contents.
-  static scoped_refptr<EphemeralAppLauncher> CreateForWebContents(
-      const std::string& webstore_item_id,
-      content::WebContents* web_contents,
-      const LaunchCallback& callback);
-
-  // Initiate app launch.
-  void Start();
-
- protected:
-  EphemeralAppLauncher(const std::string& webstore_item_id,
-                       Profile* profile,
-                       gfx::NativeWindow parent_window,
-                       const LaunchCallback& callback);
-  EphemeralAppLauncher(const std::string& webstore_item_id,
-                       content::WebContents* web_contents,
-                       const LaunchCallback& callback);
-
-  ~EphemeralAppLauncher() override;
-
-  // Creates an install checker. Allows tests to mock the install checker.
-  virtual scoped_ptr<extensions::ExtensionInstallChecker>
-      CreateInstallChecker();
-
-  // WebstoreStandaloneInstaller implementation overridden in tests.
-  scoped_ptr<ExtensionInstallPrompt> CreateInstallUI() override;
-  scoped_ptr<extensions::WebstoreInstaller::Approval> CreateApproval()
-      const override;
-
- private:
-  friend class base::RefCountedThreadSafe<EphemeralAppLauncher>;
-  friend class EphemeralAppLauncherTest;
-
-  // Returns true if an app that is already installed in extension system can
-  // be launched.
-  bool CanLaunchInstalledApp(const extensions::Extension* extension,
-                             extensions::webstore_install::Result* reason,
-                             std::string* error);
-
-  // Initiates the enable flow for an app before it can be launched.
-  void EnableInstalledApp(const extensions::Extension* extension);
-
-  // After the ephemeral installation or enable flow are complete, attempts to
-  // launch the app and notify the client of the outcome.
-  void MaybeLaunchApp();
-
-  // Launches an app. At this point, it is assumed that the app is enabled and
-  // can be launched.
-  void LaunchApp(const extensions::Extension* extension) const;
-
-  // Navigates to the launch URL of a hosted app in a new browser tab.
-  bool LaunchHostedApp(const extensions::Extension* extension) const;
-
-  // Notifies the client of the launch outcome.
-  void InvokeCallback(extensions::webstore_install::Result result,
-                      const std::string& error);
-
-  // Aborts the ephemeral install and notifies the client of the outcome.
-  void AbortLaunch(extensions::webstore_install::Result result,
-                   const std::string& error);
-
-  // Determines whether the app can be installed ephemerally.
-  void CheckEphemeralInstallPermitted();
-
-  // Install checker callback.
-  void OnInstallChecked(int check_failures);
-
-  // WebstoreStandaloneInstaller implementation.
-  void InitInstallData(
-      extensions::ActiveInstallData* install_data) const override;
-  bool CheckRequestorAlive() const override;
-  const GURL& GetRequestorURL() const override;
-  bool ShouldShowPostInstallUI() const override;
-  bool ShouldShowAppInstalledBubble() const override;
-  content::WebContents* GetWebContents() const override;
-  scoped_refptr<ExtensionInstallPrompt::Prompt> CreateInstallPrompt()
-      const override;
-  bool CheckInlineInstallPermitted(const base::DictionaryValue& webstore_data,
-                                   std::string* error) const override;
-  bool CheckRequestorPermitted(const base::DictionaryValue& webstore_data,
-                               std::string* error) const override;
-  void OnManifestParsed() override;
-  void CompleteInstall(extensions::webstore_install::Result result,
-                       const std::string& error) override;
-
-  // content::WebContentsObserver implementation.
-  void WebContentsDestroyed() override;
-
-  // ExtensionEnableFlowDelegate implementation.
-  void ExtensionEnableFlowFinished() override;
-  void ExtensionEnableFlowAborted(bool user_initiated) override;
-
-  LaunchCallback launch_callback_;
-
-  gfx::NativeWindow parent_window_;
-  scoped_ptr<NativeWindowTracker> parent_window_tracker_;
-  scoped_ptr<content::WebContents> dummy_web_contents_;
-
-  scoped_ptr<ExtensionEnableFlow> extension_enable_flow_;
-
-  scoped_ptr<extensions::ExtensionInstallChecker> install_checker_;
-
-  DISALLOW_COPY_AND_ASSIGN(EphemeralAppLauncher);
-};
-
-#endif  // CHROME_BROWSER_APPS_EPHEMERAL_APP_LAUNCHER_H_
diff --git a/chrome/browser/apps/ephemeral_app_launcher_browsertest.cc b/chrome/browser/apps/ephemeral_app_launcher_browsertest.cc
deleted file mode 100644
index fbeb7f87..0000000
--- a/chrome/browser/apps/ephemeral_app_launcher_browsertest.cc
+++ /dev/null
@@ -1,563 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "base/thread_task_runner_handle.h"
-#include "chrome/browser/apps/ephemeral_app_launcher.h"
-#include "chrome/browser/apps/ephemeral_app_service.h"
-#include "chrome/browser/extensions/extension_install_checker.h"
-#include "chrome/browser/extensions/extension_service.h"
-#include "chrome/browser/extensions/install_tracker.h"
-#include "chrome/browser/extensions/test_blacklist.h"
-#include "chrome/browser/extensions/webstore_installer_test.h"
-#include "chrome/browser/ui/browser_finder.h"
-#include "chrome/browser/ui/tabs/tab_strip_model.h"
-#include "chrome/common/chrome_switches.h"
-#include "content/public/browser/web_contents.h"
-#include "content/public/test/test_utils.h"
-#include "extensions/browser/extension_prefs.h"
-#include "extensions/browser/extension_registry.h"
-#include "extensions/browser/extension_system.h"
-#include "extensions/browser/extension_util.h"
-#include "extensions/browser/management_policy.h"
-#include "extensions/browser/process_manager.h"
-#include "extensions/browser/test_extension_registry_observer.h"
-#include "extensions/test/extension_test_message_listener.h"
-
-using extensions::Extension;
-using extensions::ExtensionPrefs;
-using extensions::ExtensionRegistry;
-using extensions::ExtensionSystem;
-using extensions::InstallTracker;
-namespace webstore_install = extensions::webstore_install;
-
-namespace {
-
-const char kWebstoreDomain[] = "cws.com";
-const char kAppDomain[] = "app.com";
-const char kNonAppDomain[] = "nonapp.com";
-const char kTestDataPath[] = "extensions/platform_apps/ephemeral_launcher";
-
-const char kExtensionId[] = "eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeid";
-const char kExtensionTestPath[] = "extension";
-const char kLegacyAppId[] = "lnbochkobjfnhbnbljgfgokadhmbahcn";
-const char kLegacyAppTestPath[] = "legacy_app";
-const char kNonExistentId[] = "baaaaaaaaaaaaaaaaaaaaaaaaaaaadid";
-const char kDefaultAppId[] = "kbiancnbopdghkfedjhfdoegjadfjeal";
-const char kDefaultAppCrxFilename[] = "app.crx";
-const char kDefaultAppTestPath[] = "app";
-const char kAppWithPermissionsId[] = "mbfcnecjknjpipkfkoangpfnhhlpamki";
-const char kAppWithPermissionsFilename[] = "app_with_permissions.crx";
-const char kHostedAppId[] = "haaaaaaaaaaaaaaaaaaaaaaaaaaappid";
-const char kHostedAppLaunchUrl[] = "http://foo.bar.com";
-
-class ExtensionInstallCheckerMock : public extensions::ExtensionInstallChecker {
- public:
-  ExtensionInstallCheckerMock(Profile* profile,
-                              const std::string& requirements_error)
-      : extensions::ExtensionInstallChecker(profile),
-        requirements_error_(requirements_error) {}
-
-  ~ExtensionInstallCheckerMock() override {}
-
- private:
-  void CheckRequirements() override {
-    // Simulate an asynchronous operation.
-    base::ThreadTaskRunnerHandle::Get()->PostTask(
-        FROM_HERE,
-        base::Bind(&ExtensionInstallCheckerMock::RequirementsErrorCheckDone,
-                   base::Unretained(this), current_sequence_number()));
-  }
-
-  void RequirementsErrorCheckDone(int sequence_number) {
-    std::vector<std::string> errors;
-    errors.push_back(requirements_error_);
-    OnRequirementsCheckDone(sequence_number, errors);
-  }
-
-  std::string requirements_error_;
-};
-
-class EphemeralAppLauncherForTest : public EphemeralAppLauncher {
- public:
-  EphemeralAppLauncherForTest(const std::string& id,
-                              Profile* profile,
-                              const LaunchCallback& callback)
-      : EphemeralAppLauncher(id, profile, NULL, callback),
-        install_initiated_(false),
-        install_prompt_created_(false) {}
-
-  EphemeralAppLauncherForTest(const std::string& id, Profile* profile)
-      : EphemeralAppLauncher(id, profile, NULL, LaunchCallback()),
-        install_initiated_(false),
-        install_prompt_created_(false) {}
-
-  bool install_initiated() const { return install_initiated_; }
-  bool install_prompt_created() const { return install_prompt_created_; }
-
-  void set_requirements_error(const std::string& error) {
-    requirements_check_error_ = error;
-  }
-
- private:
-  // Override necessary functions for testing.
-
-  scoped_ptr<extensions::ExtensionInstallChecker> CreateInstallChecker()
-      override {
-    if (requirements_check_error_.empty()) {
-      return EphemeralAppLauncher::CreateInstallChecker();
-    } else {
-      return scoped_ptr<extensions::ExtensionInstallChecker>(
-          new ExtensionInstallCheckerMock(profile(),
-                                          requirements_check_error_));
-    }
-  }
-
-  scoped_ptr<ExtensionInstallPrompt> CreateInstallUI() override {
-    install_prompt_created_ = true;
-    return EphemeralAppLauncher::CreateInstallUI();
-  }
-
-  scoped_ptr<extensions::WebstoreInstaller::Approval> CreateApproval()
-      const override {
-    install_initiated_ = true;
-    return EphemeralAppLauncher::CreateApproval();
-  }
-
- private:
-  ~EphemeralAppLauncherForTest() override {}
-  friend class base::RefCountedThreadSafe<EphemeralAppLauncherForTest>;
-
-  mutable bool install_initiated_;
-  std::string requirements_check_error_;
-  bool install_prompt_created_;
-};
-
-class LaunchObserver {
- public:
-  LaunchObserver()
-      : done_(false),
-        waiting_(false),
-        result_(webstore_install::OTHER_ERROR) {}
-
-  webstore_install::Result result() const { return result_; }
-  const std::string& error() const { return error_; }
-
-  void OnLaunchCallback(webstore_install::Result result,
-                        const std::string& error) {
-    result_ = result;
-    error_ = error;
-    done_ = true;
-    if (waiting_) {
-      waiting_ = false;
-      base::MessageLoopForUI::current()->QuitWhenIdle();
-    }
-  }
-
-  void Wait() {
-    if (done_)
-      return;
-
-    waiting_ = true;
-    content::RunMessageLoop();
-  }
-
- private:
-  bool done_;
-  bool waiting_;
-  webstore_install::Result result_;
-  std::string error_;
-};
-
-class ManagementPolicyMock : public extensions::ManagementPolicy::Provider {
- public:
-  ManagementPolicyMock() {}
-
-  std::string GetDebugPolicyProviderName() const override {
-    return "ManagementPolicyMock";
-  }
-
-  bool UserMayLoad(const Extension* extension,
-                   base::string16* error) const override {
-    return false;
-  }
-};
-
-}  // namespace
-
-class EphemeralAppLauncherTest : public WebstoreInstallerTest {
- public:
-  EphemeralAppLauncherTest()
-      : WebstoreInstallerTest(kWebstoreDomain,
-                              kTestDataPath,
-                              kDefaultAppCrxFilename,
-                              kAppDomain,
-                              kNonAppDomain) {}
-
-  void SetUpCommandLine(base::CommandLine* command_line) override {
-    WebstoreInstallerTest::SetUpCommandLine(command_line);
-
-    // Make event pages get suspended immediately.
-    extensions::ProcessManager::SetEventPageIdleTimeForTesting(1);
-    extensions::ProcessManager::SetEventPageSuspendingTimeForTesting(1);
-
-    // Enable ephemeral apps flag.
-    command_line->AppendSwitch(switches::kEnableEphemeralAppsInWebstore);
-  }
-
-  void SetUpOnMainThread() override {
-    WebstoreInstallerTest::SetUpOnMainThread();
-
-    // Disable ephemeral apps immediately after they stop running in tests.
-    EphemeralAppService::Get(profile())->set_disable_delay_for_test(0);
-  }
-
-  base::FilePath GetTestPath(const char* test_name) {
-    return test_data_dir_.AppendASCII("platform_apps/ephemeral_launcher")
-        .AppendASCII(test_name);
-  }
-
-  const Extension* GetInstalledExtension(const std::string& id) {
-    return ExtensionRegistry::Get(profile())
-        ->GetExtensionById(id, ExtensionRegistry::EVERYTHING);
-  }
-
-  void SetCrxFilename(const std::string& filename) {
-    GURL crx_url = GenerateTestServerUrl(kWebstoreDomain, filename);
-    base::CommandLine::ForCurrentProcess()->AppendSwitchASCII(
-        switches::kAppsGalleryUpdateURL, crx_url.spec());
-  }
-
-  void StartLauncherAndCheckResult(EphemeralAppLauncherForTest* launcher,
-                                   webstore_install::Result expected_result,
-                                   bool expect_install_initiated) {
-    ExtensionTestMessageListener launched_listener("launched", false);
-    LaunchObserver launch_observer;
-
-    launcher->launch_callback_ = base::Bind(&LaunchObserver::OnLaunchCallback,
-                                            base::Unretained(&launch_observer));
-    launcher->Start();
-    launch_observer.Wait();
-
-    // Verify the launch result.
-    EXPECT_EQ(expected_result, launch_observer.result());
-    EXPECT_EQ(expect_install_initiated, launcher->install_initiated());
-
-    // Verify that the app was actually launched if the launcher succeeded.
-    if (launch_observer.result() == webstore_install::SUCCESS)
-      EXPECT_TRUE(launched_listener.WaitUntilSatisfied());
-    else
-      EXPECT_FALSE(launched_listener.was_satisfied());
-
-    // Check the reference count to ensure the launcher instance will not be
-    // leaked.
-    EXPECT_TRUE(launcher->HasOneRef());
-  }
-
-  void RunLaunchTest(const std::string& id,
-                     webstore_install::Result expected_result,
-                     bool expect_install_initiated) {
-    InstallTracker* tracker = InstallTracker::Get(profile());
-    ASSERT_TRUE(tracker);
-    bool was_install_active = !!tracker->GetActiveInstall(id);
-
-    scoped_refptr<EphemeralAppLauncherForTest> launcher(
-        new EphemeralAppLauncherForTest(id, profile()));
-    StartLauncherAndCheckResult(
-        launcher.get(), expected_result, expect_install_initiated);
-
-    // Verify that the install was deregistered from the InstallTracker.
-    EXPECT_EQ(was_install_active, !!tracker->GetActiveInstall(id));
-  }
-
-  void ValidateAppInstalledEphemerally(const std::string& id) {
-    EXPECT_TRUE(GetInstalledExtension(id));
-    EXPECT_TRUE(extensions::util::IsEphemeralApp(id, profile()));
-  }
-
-  const Extension* InstallAndDisableApp(
-      const char* test_path,
-      Extension::DisableReason disable_reason) {
-    const Extension* app = InstallExtension(GetTestPath(test_path), 1);
-    EXPECT_TRUE(app);
-    if (!app)
-      return NULL;
-
-    ExtensionService* service =
-        ExtensionSystem::Get(profile())->extension_service();
-    service->DisableExtension(app->id(), disable_reason);
-
-    EXPECT_TRUE(
-        ExtensionRegistry::Get(profile())->disabled_extensions().Contains(
-            app->id()));
-    return app;
-  }
-};
-
-class EphemeralAppLauncherTestDisabled : public EphemeralAppLauncherTest {
- public:
-  void SetUpCommandLine(base::CommandLine* command_line) override {
-    // Skip EphemeralAppLauncherTest as it enables the feature.
-    WebstoreInstallerTest::SetUpCommandLine(command_line);
-  }
-};
-
-// Verifies that an ephemeral app will not be installed and launched if the
-// feature is disabled.
-IN_PROC_BROWSER_TEST_F(EphemeralAppLauncherTestDisabled, FeatureDisabled) {
-  RunLaunchTest(
-      kDefaultAppCrxFilename, webstore_install::LAUNCH_FEATURE_DISABLED, false);
-  EXPECT_FALSE(GetInstalledExtension(kDefaultAppId));
-}
-
-// Verifies that an app with no permission warnings will be installed
-// ephemerally and launched without prompting the user.
-IN_PROC_BROWSER_TEST_F(EphemeralAppLauncherTest,
-                       LaunchAppWithNoPermissionWarnings) {
-  extensions::TestExtensionRegistryObserver observer(
-      ExtensionRegistry::Get(profile()));
-
-  scoped_refptr<EphemeralAppLauncherForTest> launcher(
-      new EphemeralAppLauncherForTest(kDefaultAppId, profile()));
-  StartLauncherAndCheckResult(launcher.get(), webstore_install::SUCCESS, true);
-  ValidateAppInstalledEphemerally(kDefaultAppId);
-
-  // Apps with no permission warnings should not result in a prompt.
-  EXPECT_FALSE(launcher->install_prompt_created());
-
-  // Ephemeral apps are unloaded after they stop running.
-  observer.WaitForExtensionUnloaded();
-
-  // After an app has been installed ephemerally, it can be launched again
-  // without installing from the web store.
-  RunLaunchTest(kDefaultAppId, webstore_install::SUCCESS, false);
-}
-
-// Verifies that an app with permission warnings will be installed
-// ephemerally and launched if accepted by the user.
-IN_PROC_BROWSER_TEST_F(EphemeralAppLauncherTest,
-                       LaunchAppWithPermissionsWarnings) {
-  SetCrxFilename(kAppWithPermissionsFilename);
-  AutoAcceptInstall();
-
-  scoped_refptr<EphemeralAppLauncherForTest> launcher(
-      new EphemeralAppLauncherForTest(kAppWithPermissionsId, profile()));
-  StartLauncherAndCheckResult(launcher.get(), webstore_install::SUCCESS, true);
-  ValidateAppInstalledEphemerally(kAppWithPermissionsId);
-  EXPECT_TRUE(launcher->install_prompt_created());
-}
-
-// Verifies that an app with permission warnings will not be installed
-// ephemerally if cancelled by the user.
-IN_PROC_BROWSER_TEST_F(EphemeralAppLauncherTest,
-                       CancelInstallAppWithPermissionWarnings) {
-  SetCrxFilename(kAppWithPermissionsFilename);
-  AutoCancelInstall();
-
-  scoped_refptr<EphemeralAppLauncherForTest> launcher(
-      new EphemeralAppLauncherForTest(kAppWithPermissionsId, profile()));
-  StartLauncherAndCheckResult(
-      launcher.get(), webstore_install::USER_CANCELLED, false);
-  EXPECT_FALSE(GetInstalledExtension(kAppWithPermissionsId));
-  EXPECT_TRUE(launcher->install_prompt_created());
-}
-
-// Verifies that an extension will not be installed ephemerally.
-IN_PROC_BROWSER_TEST_F(EphemeralAppLauncherTest, InstallExtension) {
-  RunLaunchTest(
-      kExtensionId, webstore_install::LAUNCH_UNSUPPORTED_EXTENSION_TYPE, false);
-  EXPECT_FALSE(GetInstalledExtension(kExtensionId));
-}
-
-// Verifies that an already installed extension will not be launched.
-IN_PROC_BROWSER_TEST_F(EphemeralAppLauncherTest, LaunchExtension) {
-  const Extension* extension =
-      InstallExtension(GetTestPath(kExtensionTestPath), 1);
-  ASSERT_TRUE(extension);
-  RunLaunchTest(extension->id(),
-                webstore_install::LAUNCH_UNSUPPORTED_EXTENSION_TYPE,
-                false);
-}
-
-// Verifies that a legacy packaged app will not be installed ephemerally.
-IN_PROC_BROWSER_TEST_F(EphemeralAppLauncherTest, InstallLegacyApp) {
-  RunLaunchTest(
-      kLegacyAppId, webstore_install::LAUNCH_UNSUPPORTED_EXTENSION_TYPE, false);
-  EXPECT_FALSE(GetInstalledExtension(kLegacyAppId));
-}
-
-// Verifies that a legacy packaged app that is already installed can be
-// launched.
-IN_PROC_BROWSER_TEST_F(EphemeralAppLauncherTest, LaunchLegacyApp) {
-  const Extension* extension =
-      InstallExtension(GetTestPath(kLegacyAppTestPath), 1);
-  ASSERT_TRUE(extension);
-  RunLaunchTest(extension->id(), webstore_install::SUCCESS, false);
-}
-
-// Verifies that a hosted app is not installed. Launch succeeds because we
-// navigate to its launch url.
-IN_PROC_BROWSER_TEST_F(EphemeralAppLauncherTest, LaunchHostedApp) {
-  LaunchObserver launch_observer;
-
-  scoped_refptr<EphemeralAppLauncherForTest> launcher(
-      new EphemeralAppLauncherForTest(
-          kHostedAppId,
-          profile(),
-          base::Bind(&LaunchObserver::OnLaunchCallback,
-                     base::Unretained(&launch_observer))));
-  launcher->Start();
-  launch_observer.Wait();
-
-  EXPECT_EQ(webstore_install::SUCCESS, launch_observer.result());
-  EXPECT_FALSE(launcher->install_initiated());
-  EXPECT_FALSE(GetInstalledExtension(kHostedAppId));
-
-  // Verify that a navigation to the launch url was attempted.
-  Browser* browser =
-      FindBrowserWithProfile(profile(), chrome::GetActiveDesktop());
-  ASSERT_TRUE(browser);
-  content::WebContents* web_contents =
-      browser->tab_strip_model()->GetActiveWebContents();
-  ASSERT_TRUE(web_contents);
-  EXPECT_EQ(GURL(kHostedAppLaunchUrl), web_contents->GetVisibleURL());
-}
-
-// Verifies that the EphemeralAppLauncher handles non-existent extension ids.
-IN_PROC_BROWSER_TEST_F(EphemeralAppLauncherTest, NonExistentExtensionId) {
-  RunLaunchTest(
-      kNonExistentId, webstore_install::WEBSTORE_REQUEST_ERROR, false);
-  EXPECT_FALSE(GetInstalledExtension(kNonExistentId));
-}
-
-// Verifies that an app blocked by management policy is not installed
-// ephemerally.
-IN_PROC_BROWSER_TEST_F(EphemeralAppLauncherTest, BlockedByPolicy) {
-  // Register a provider that blocks the installation of all apps.
-  ManagementPolicyMock policy;
-  ExtensionSystem::Get(profile())->management_policy()->RegisterProvider(
-      &policy);
-
-  RunLaunchTest(kDefaultAppId, webstore_install::BLOCKED_BY_POLICY, false);
-  EXPECT_FALSE(GetInstalledExtension(kDefaultAppId));
-}
-
-// The blacklist relies on safe-browsing database infrastructure.
-#if defined(SAFE_BROWSING_DB_LOCAL)
-// Verifies that an app blacklisted for malware is not installed ephemerally.
-IN_PROC_BROWSER_TEST_F(EphemeralAppLauncherTest, BlacklistedForMalware) {
-  // Mock a BLACKLISTED_MALWARE return status.
-  extensions::TestBlacklist blacklist_tester(
-      extensions::Blacklist::Get(profile()));
-  blacklist_tester.SetBlacklistState(
-      kDefaultAppId, extensions::BLACKLISTED_MALWARE, false);
-
-  RunLaunchTest(kDefaultAppId, webstore_install::BLACKLISTED, false);
-  EXPECT_FALSE(GetInstalledExtension(kDefaultAppId));
-}
-
-// Verifies that an app with unknown blacklist status is installed ephemerally
-// and launched.
-IN_PROC_BROWSER_TEST_F(EphemeralAppLauncherTest, BlacklistStateUnknown) {
-  // Mock a BLACKLISTED_MALWARE return status.
-  extensions::TestBlacklist blacklist_tester(
-      extensions::Blacklist::Get(profile()));
-  blacklist_tester.SetBlacklistState(
-      kDefaultAppId, extensions::BLACKLISTED_UNKNOWN, false);
-
-  RunLaunchTest(kDefaultAppId, webstore_install::SUCCESS, true);
-  ValidateAppInstalledEphemerally(kDefaultAppId);
-}
-#endif
-
-// Verifies that an app with unsupported requirements is not installed
-// ephemerally.
-IN_PROC_BROWSER_TEST_F(EphemeralAppLauncherTest, UnsupportedRequirements) {
-  scoped_refptr<EphemeralAppLauncherForTest> launcher(
-      new EphemeralAppLauncherForTest(kDefaultAppId, profile()));
-  launcher->set_requirements_error("App has unsupported requirements");
-
-  StartLauncherAndCheckResult(
-      launcher.get(), webstore_install::REQUIREMENT_VIOLATIONS, false);
-  EXPECT_FALSE(GetInstalledExtension(kDefaultAppId));
-}
-
-// Verifies that an app disabled due to permissions increase can be enabled
-// and launched.
-IN_PROC_BROWSER_TEST_F(EphemeralAppLauncherTest, EnableAndLaunchApp) {
-  const Extension* app = InstallAndDisableApp(
-      kDefaultAppTestPath, Extension::DISABLE_PERMISSIONS_INCREASE);
-  ASSERT_TRUE(app);
-
-  AutoAcceptInstall();
-  RunLaunchTest(app->id(), webstore_install::SUCCESS, false);
-}
-
-// Verifies that if the user cancels the enable flow, the app will not be
-// enabled and launched.
-IN_PROC_BROWSER_TEST_F(EphemeralAppLauncherTest, EnableCancelled) {
-  const Extension* app = InstallAndDisableApp(
-      kDefaultAppTestPath, Extension::DISABLE_PERMISSIONS_INCREASE);
-  ASSERT_TRUE(app);
-
-  AutoCancelInstall();
-  RunLaunchTest(app->id(), webstore_install::USER_CANCELLED, false);
-}
-
-// Verifies that an installed app that had been blocked by policy cannot be
-// launched.
-IN_PROC_BROWSER_TEST_F(EphemeralAppLauncherTest, LaunchAppBlockedByPolicy) {
-  const Extension* app = InstallExtension(GetTestPath(kDefaultAppTestPath), 1);
-  ASSERT_TRUE(app);
-
-  // Simulate blocking of the app after it has been installed.
-  ManagementPolicyMock policy;
-  ExtensionSystem::Get(profile())->management_policy()->RegisterProvider(
-      &policy);
-  ExtensionSystem::Get(profile())->extension_service()->CheckManagementPolicy();
-
-  RunLaunchTest(app->id(), webstore_install::BLOCKED_BY_POLICY, false);
-}
-
-// Verifies that an installed blacklisted app cannot be launched.
-IN_PROC_BROWSER_TEST_F(EphemeralAppLauncherTest, LaunchBlacklistedApp) {
-  const Extension* app = InstallExtension(GetTestPath(kDefaultAppTestPath), 1);
-  ASSERT_TRUE(app);
-
-  ExtensionService* service =
-      ExtensionSystem::Get(profile())->extension_service();
-  service->BlacklistExtensionForTest(app->id());
-  ASSERT_TRUE(
-      ExtensionRegistry::Get(profile())->blacklisted_extensions().Contains(
-          app->id()));
-
-  RunLaunchTest(app->id(), webstore_install::BLACKLISTED, false);
-}
-
-// Verifies that an installed app with unsupported requirements cannot be
-// launched.
-IN_PROC_BROWSER_TEST_F(EphemeralAppLauncherTest,
-                       LaunchAppWithUnsupportedRequirements) {
-  const Extension* app = InstallAndDisableApp(
-      kDefaultAppTestPath, Extension::DISABLE_UNSUPPORTED_REQUIREMENT);
-  ASSERT_TRUE(app);
-
-  RunLaunchTest(app->id(), webstore_install::REQUIREMENT_VIOLATIONS, false);
-}
-
-// Verifies that a launch will fail if the app is currently being installed.
-IN_PROC_BROWSER_TEST_F(EphemeralAppLauncherTest, InstallInProgress) {
-  extensions::ActiveInstallData install_data(kDefaultAppId);
-  InstallTracker::Get(profile())->AddActiveInstall(install_data);
-
-  RunLaunchTest(kDefaultAppId, webstore_install::INSTALL_IN_PROGRESS, false);
-}
-
-// Verifies that a launch will fail if a duplicate launch is in progress.
-IN_PROC_BROWSER_TEST_F(EphemeralAppLauncherTest, DuplicateLaunchInProgress) {
-  extensions::ActiveInstallData install_data(kDefaultAppId);
-  install_data.is_ephemeral = true;
-  InstallTracker::Get(profile())->AddActiveInstall(install_data);
-
-  RunLaunchTest(kDefaultAppId, webstore_install::LAUNCH_IN_PROGRESS, false);
-}
diff --git a/chrome/browser/banners/app_banner_debug_log.cc b/chrome/browser/banners/app_banner_debug_log.cc
index f51e015..5f2eb0f0 100644
--- a/chrome/browser/banners/app_banner_debug_log.cc
+++ b/chrome/browser/banners/app_banner_debug_log.cc
@@ -6,10 +6,8 @@
 
 #include "base/command_line.h"
 #include "chrome/common/chrome_switches.h"
-#include "chrome/common/render_messages.h"
 #include "content/public/browser/render_frame_host.h"
 #include "content/public/browser/web_contents.h"
-#include "content/public/browser/web_contents_observer.h"
 
 namespace banners {
 
@@ -52,10 +50,10 @@
                                  const std::string& message) {
   std::string log_message = "App banner " + message;
   if (base::CommandLine::ForCurrentProcess()->HasSwitch(
-          switches::kBypassAppBannerEngagementChecks) && web_contents) {
-    web_contents->GetMainFrame()->Send(
-        new ChromeViewMsg_AppBannerDebugMessageRequest(
-            web_contents->GetMainFrame()->GetRoutingID(), log_message));
+          switches::kBypassAppBannerEngagementChecks) &&
+      web_contents) {
+    web_contents->GetMainFrame()->AddMessageToConsole(
+        content::CONSOLE_MESSAGE_LEVEL_DEBUG, log_message);
   }
 }
 
diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc
index a3910fb..5b4af92 100644
--- a/chrome/browser/chrome_content_browser_client.cc
+++ b/chrome/browser/chrome_content_browser_client.cc
@@ -1591,7 +1591,6 @@
       switches::kEnableNaClNonSfiMode,
       switches::kEnablePNaClSubzero,
       switches::kNaClDangerousNoSandboxNonSfi,
-      switches::kUseNaClHelperNonSfi,
 #endif
       switches::kPpapiFlashPath,
       switches::kPpapiFlashVersion,
diff --git a/chrome/browser/chromeos/file_manager/file_manager_jstest.cc b/chrome/browser/chromeos/file_manager/file_manager_jstest.cc
index 7e84058..16ce3ac 100644
--- a/chrome/browser/chromeos/file_manager/file_manager_jstest.cc
+++ b/chrome/browser/chromeos/file_manager/file_manager_jstest.cc
@@ -174,9 +174,9 @@
       FILE_PATH_LITERAL("foreground/js/providers_model_unittest.html")));
 }
 
-IN_PROC_BROWSER_TEST_F(FileManagerJsTest, TooltipController) {
+IN_PROC_BROWSER_TEST_F(FileManagerJsTest, FilesTooltip) {
   RunTest(base::FilePath(
-      FILE_PATH_LITERAL("foreground/js/tooltip_controller_unittest.html")));
+      FILE_PATH_LITERAL("foreground/elements/files_tooltip_unittest.html")));
 }
 
 IN_PROC_BROWSER_TEST_F(FileManagerJsTest, SpinnerController) {
diff --git a/chrome/browser/chromeos/file_manager/gallery_browsertest.cc b/chrome/browser/chromeos/file_manager/gallery_browsertest.cc
index 48411d61..dae943c 100644
--- a/chrome/browser/chromeos/file_manager/gallery_browsertest.cc
+++ b/chrome/browser/chromeos/file_manager/gallery_browsertest.cc
@@ -41,7 +41,7 @@
 }
 
 IN_PROC_BROWSER_TEST_F(GalleryBrowserTestInGuestMode,
-                       OpenSingleImageOnDownloads) {
+                       MAYBE_OpenSingleImageOnDownloads) {
   set_test_case_name("openSingleImageOnDownloads");
   StartTest();
 }
@@ -67,7 +67,13 @@
   StartTest();
 }
 
-IN_PROC_BROWSER_TEST_F(GalleryBrowserTest, OpenMultipleImagesOnDrive) {
+// http://crbug.com/508949
+#if defined(MEMORY_SANITIZER)
+#define MAYBE_OpenMultipleImagesOnDrive DISABLED_OpenMultipleImagesOnDrive
+#else
+#define MAYBE_OpenMultipleImagesOnDrive OpenMultipleImagesOnDrive
+#endif
+IN_PROC_BROWSER_TEST_F(GalleryBrowserTest, MAYBE_OpenMultipleImagesOnDrive) {
   set_test_case_name("openMultipleImagesOnDrive");
   StartTest();
 }
@@ -91,7 +97,13 @@
   StartTest();
 }
 
-IN_PROC_BROWSER_TEST_F(GalleryBrowserTest, TraverseSlideImagesOnDrive) {
+// http://crbug.com/508949
+#if defined(MEMORY_SANITIZER)
+#define MAYBE_TraverseSlideImagesOnDrive DISABLED_TraverseSlideImagesOnDrive
+#else
+#define MAYBE_TraverseSlideImagesOnDrive TraverseSlideImagesOnDrive
+#endif
+IN_PROC_BROWSER_TEST_F(GalleryBrowserTest, MAYBE_TraverseSlideImagesOnDrive) {
   set_test_case_name("traverseSlideImagesOnDrive");
   StartTest();
 }
@@ -102,7 +114,16 @@
   StartTest();
 }
 
-IN_PROC_BROWSER_TEST_F(GalleryBrowserTest, TraverseSlideThumbnailsOnDownloads) {
+// http://crbug.com/508949
+#if defined(MEMORY_SANITIZER)
+#define MAYBE_TraverseSlideThumbnailsOnDownloads \
+  DISABLED_TraverseSlideThumbnailsOnDownloads
+#else
+#define MAYBE_TraverseSlideThumbnailsOnDownloads \
+  TraverseSlideThumbnailsOnDownloads
+#endif
+IN_PROC_BROWSER_TEST_F(GalleryBrowserTest,
+                       MAYBE_TraverseSlideThumbnailsOnDownloads) {
   set_test_case_name("traverseSlideThumbnailsOnDownloads");
   StartTest();
 }
@@ -117,7 +138,14 @@
   StartTest();
 }
 
-IN_PROC_BROWSER_TEST_F(GalleryBrowserTestInGuestMode, RenameImageOnDownloads) {
+// http://crbug.com/508949
+#if defined(MEMORY_SANITIZER)
+#define MAYBE_RenameImageOnDownloads DISABLED_RenameImageOnDownloads
+#else
+#define MAYBE_RenameImageOnDownloads RenameImageOnDownloads
+#endif
+IN_PROC_BROWSER_TEST_F(GalleryBrowserTestInGuestMode,
+                       MAYBE_RenameImageOnDownloads) {
   set_test_case_name("renameImageOnDownloads");
   StartTest();
 }
@@ -191,7 +219,13 @@
   StartTest();
 }
 
-IN_PROC_BROWSER_TEST_F(GalleryBrowserTest, RotateImageOnDownloads) {
+// http://crbug.com/508949
+#if defined(MEMORY_SANITIZER)
+#define MAYBE_RotateImageOnDownloads DISABLED_RotateImageOnDownloads
+#else
+#define MAYBE_RotateImageOnDownloads RotateImageOnDownloads
+#endif
+IN_PROC_BROWSER_TEST_F(GalleryBrowserTest, MAYBE_RotateImageOnDownloads) {
   set_test_case_name("rotateImageOnDownloads");
   StartTest();
 }
@@ -201,7 +235,13 @@
   StartTest();
 }
 
-IN_PROC_BROWSER_TEST_F(GalleryBrowserTest, RotateImageOnDrive) {
+// http://crbug.com/508949
+#if defined(MEMORY_SANITIZER)
+#define MAYBE_RotateImageOnDrive DISABLED_RotateImageOnDrive
+#else
+#define MAYBE_RotateImageOnDrive RotateImageOnDrive
+#endif
+IN_PROC_BROWSER_TEST_F(GalleryBrowserTest, MAYBE_RotateImageOnDrive) {
   set_test_case_name("rotateImageOnDrive");
   StartTest();
 }
@@ -285,13 +325,30 @@
   StartTest();
 }
 
+// http://crbug.com/508949
+#if defined(MEMORY_SANITIZER)
+#define MAYBE_RenameImageInThumbnailModeOnDownloads \
+  DISABLED_RenameImageInThumbnailModeOnDownloads
+#else
+#define MAYBE_RenameImageInThumbnailModeOnDownloads \
+  RenameImageInThumbnailModeOnDownloads
+#endif
 IN_PROC_BROWSER_TEST_F(GalleryBrowserTest,
-                       RenameImageInThumbnailModeOnDownloads) {
+                       MAYBE_RenameImageInThumbnailModeOnDownloads) {
   set_test_case_name("renameImageInThumbnailModeOnDownloads");
   StartTest();
 }
 
-IN_PROC_BROWSER_TEST_F(GalleryBrowserTest, RenameImageInThumbnailModeOnDrive) {
+// http://crbug.com/508949
+#if defined(MEMORY_SANITIZER)
+#define MAYBE_RenameImageInThumbnailModeOnDrive \
+  DISABLED_RenameImageInThumbnailModeOnDrive
+#else
+#define MAYBE_RenameImageInThumbnailModeOnDrive \
+  RenameImageInThumbnailModeOnDrive
+#endif
+IN_PROC_BROWSER_TEST_F(GalleryBrowserTest,
+                       MAYBE_RenameImageInThumbnailModeOnDrive) {
   set_test_case_name("renameImageInThumbnailModeOnDrive");
   StartTest();
 }
@@ -375,6 +432,19 @@
   StartTest();
 }
 
+#if defined(DISABLE_SLOW_FILESAPP_TESTS)
+#define MAYBE_SelectMultipleImagesWithShiftKeyOnDownloads \
+  DISABLED_SelectMultipleImagesWithShiftKeyOnDownloads
+#else
+#define MAYBE_SelectMultipleImagesWithShiftKeyOnDownloads \
+  SelectMultipleImagesWithShiftKeyOnDownloads
+#endif
+IN_PROC_BROWSER_TEST_F(GalleryBrowserTest,
+                       MAYBE_SelectMultipleImagesWithShiftKeyOnDownloads) {
+  set_test_case_name("selectMultipleImagesWithShiftKeyOnDownloads");
+  StartTest();
+}
+
 IN_PROC_BROWSER_TEST_F(GalleryBrowserTestInGuestMode,
                        SlideshowTraversalOnDownloads) {
   set_test_case_name("slideshowTraversalOnDownloads");
@@ -397,12 +467,26 @@
   StartTest();
 }
 
-IN_PROC_BROWSER_TEST_F(GalleryBrowserTest, StopStartSlideshowOnDownloads) {
+// http://crbug.com/508949
+#if defined(MEMORY_SANITIZER)
+#define MAYBE_StopStartSlideshowOnDownloads \
+  DISABLED_StopStartSlideshowOnDownloads
+#else
+#define MAYBE_StopStartSlideshowOnDownloads StopStartSlideshowOnDownloads
+#endif
+IN_PROC_BROWSER_TEST_F(GalleryBrowserTest,
+                       MAYBE_StopStartSlideshowOnDownloads) {
   set_test_case_name("stopStartSlideshowOnDownloads");
   StartTest();
 }
 
-IN_PROC_BROWSER_TEST_F(GalleryBrowserTest, StopStartSlideshowOnDrive) {
+// http://crbug.com/508949
+#if defined(MEMORY_SANITIZER)
+#define MAYBE_StopStartSlideshowOnDrive DISABLED_StopStartSlideshowOnDrive
+#else
+#define MAYBE_StopStartSlideshowOnDrive StopStartSlideshowOnDrive
+#endif
+IN_PROC_BROWSER_TEST_F(GalleryBrowserTest, MAYBE_StopStartSlideshowOnDrive) {
   set_test_case_name("stopStartSlideshowOnDrive");
   StartTest();
 }
diff --git a/chrome/browser/chromeos/login/existing_user_controller.cc b/chrome/browser/chromeos/login/existing_user_controller.cc
index 97baaa0..26d80b7f 100644
--- a/chrome/browser/chromeos/login/existing_user_controller.cc
+++ b/chrome/browser/chromeos/login/existing_user_controller.cc
@@ -693,8 +693,6 @@
 
   if (auth_status_consumer_)
     auth_status_consumer_->OnPasswordChangeDetected();
-
-  display_email_.clear();
 }
 
 void ExistingUserController::WhiteListCheckFailed(const std::string& email) {
diff --git a/chrome/browser/chromeos/login/test/oobe_base_test.cc b/chrome/browser/chromeos/login/test/oobe_base_test.cc
index ebfe728a..1327096 100644
--- a/chrome/browser/chromeos/login/test/oobe_base_test.cc
+++ b/chrome/browser/chromeos/login/test/oobe_base_test.cc
@@ -15,6 +15,7 @@
 #include "chrome/browser/chromeos/login/ui/webui_login_view.h"
 #include "chrome/browser/chromeos/net/network_portal_detector_test_impl.h"
 #include "chrome/browser/lifetime/application_lifetime.h"
+#include "chrome/browser/ui/webui/chromeos/login/gaia_screen_handler.h"
 #include "chrome/browser/ui/webui/signin/inline_login_ui.h"
 #include "chrome/common/chrome_paths.h"
 #include "chrome/common/chrome_switches.h"
@@ -195,6 +196,14 @@
                     base::Unretained(this));
 }
 
+void OobeBaseTest::DisableRestrictiveProxyCheck() {
+  static_cast<chromeos::LoginDisplayHostImpl*>(
+      chromeos::LoginDisplayHostImpl::default_host())
+      ->GetOobeUI()
+      ->GetGaiaScreenActor()
+      ->DisableRestrictiveProxyCheckForTest();
+}
+
 void OobeBaseTest::JsExpect(const std::string& expression) {
   JS().ExpectTrue(expression);
 }
@@ -214,13 +223,18 @@
 
 void OobeBaseTest::WaitForGaiaPageLoad() {
   WaitForSigninScreen();
+  WaitForGaiaPageReload();
+}
 
-  JS().Evaluate(
-      "$('gaia-signin').gaiaAuthHost_.addEventListener('ready',"
-      "function() {"
-      "window.domAutomationController.setAutomationId(0);"
-      "window.domAutomationController.send('GaiaReady');"
-      "});");
+void OobeBaseTest::WaitForGaiaPageReload() {
+  JS()
+      .Evaluate(
+          "$('gaia-signin').gaiaAuthHost_.addEventListener('ready',"
+          "function f() {"
+          "$(\'gaia-signin\').gaiaAuthHost_.removeEventListener(\'ready\', f);"
+          "window.domAutomationController.setAutomationId(0);"
+          "window.domAutomationController.send('GaiaReady');"
+          "});");
 
   content::DOMMessageQueue message_queue;
   std::string message;
diff --git a/chrome/browser/chromeos/login/test/oobe_base_test.h b/chrome/browser/chromeos/login/test/oobe_base_test.h
index 0acadf7..3a8d4398 100644
--- a/chrome/browser/chromeos/login/test/oobe_base_test.h
+++ b/chrome/browser/chromeos/login/test/oobe_base_test.h
@@ -71,6 +71,8 @@
   base::Closure SimulateNetworkOnlineClosure();
   base::Closure SimulateNetworkPortalClosure();
 
+  void DisableRestrictiveProxyCheck();
+
   // Checks JavaScript |expression| in login screen.
   void JsExpect(const std::string& expression);
 
@@ -90,6 +92,7 @@
   WebUILoginDisplay* GetLoginDisplay();
 
   void WaitForGaiaPageLoad();
+  void WaitForGaiaPageReload();
   void WaitForSigninScreen();
   void ExecuteJsInSigninFrame(const std::string& js);
   void SetSignFormField(const std::string& field_id,
diff --git a/chrome/browser/chromeos/login/webview_login_browsertest.cc b/chrome/browser/chromeos/login/webview_login_browsertest.cc
index 520538a..82030be 100644
--- a/chrome/browser/chromeos/login/webview_login_browsertest.cc
+++ b/chrome/browser/chromeos/login/webview_login_browsertest.cc
@@ -83,8 +83,26 @@
 IN_PROC_BROWSER_TEST_F(WebviewLoginTest, AllowGuest) {
   WaitForGaiaPageLoad();
   JsExpect("!$('guest-user-header-bar-item').hidden");
-  chromeos::CrosSettings::Get()->SetBoolean(kAccountsPrefAllowGuest, false);
+  CrosSettings::Get()->SetBoolean(kAccountsPrefAllowGuest, false);
   JsExpect("$('guest-user-header-bar-item').hidden");
 }
 
+// Create new account option should be available only if the settings allow it.
+IN_PROC_BROWSER_TEST_F(WebviewLoginTest, AllowNewUser) {
+  DisableRestrictiveProxyCheck();
+  WaitForGaiaPageLoad();
+
+  std::string frame_url = "$('gaia-signin').gaiaAuthHost_.reloadUrl_";
+  // New users are allowed.
+  JsExpect(frame_url + ".search('flow=nosignup') == -1");
+
+  // Disallow new users - we also need to set a whitelist due to weird logic.
+  CrosSettings::Get()->Set(kAccountsPrefUsers, base::ListValue());
+  CrosSettings::Get()->SetBoolean(kAccountsPrefAllowNewUser, false);
+  WaitForGaiaPageReload();
+
+  // flow=nosignup indicates that user creation is not allowed.
+  JsExpect(frame_url + ".search('flow=nosignup') != -1");
+}
+
 }  // namespace chromeos
diff --git a/chrome/browser/engagement/site_engagement_eviction_policy.cc b/chrome/browser/engagement/site_engagement_eviction_policy.cc
index ba7a885..79ebe1f9e 100644
--- a/chrome/browser/engagement/site_engagement_eviction_policy.cc
+++ b/chrome/browser/engagement/site_engagement_eviction_policy.cc
@@ -2,7 +2,6 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
-#include "base/barrier_closure.h"
 #include "chrome/browser/browser_process.h"
 #include "chrome/browser/engagement/site_engagement_eviction_policy.h"
 #include "chrome/browser/engagement/site_engagement_service.h"
@@ -64,6 +63,7 @@
       origin_to_evict = origin;
     }
   }
+
   return origin_to_evict;
 }
 
@@ -73,16 +73,18 @@
     const std::map<GURL, int64>& usage_map,
     int64 global_quota) {
   DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
+
   Profile* profile = Profile::FromBrowserContext(browser_context);
-  SiteEngagementService* service =
+  SiteEngagementScoreProvider* score_provider =
       g_browser_process->profile_manager()->IsValidProfile(profile)
           ? SiteEngagementService::Get(profile)
           : nullptr;
-  if (!service)
+
+  if (!score_provider)
     return GURL();
 
-  return DoCalculateEvictionOrigin(special_storage_policy, service, usage_map,
-                                   global_quota);
+  return DoCalculateEvictionOrigin(special_storage_policy, score_provider,
+                                   usage_map, global_quota);
 }
 
 }  // namespace
@@ -98,6 +100,8 @@
     const std::map<GURL, int64>& usage_map,
     int64 global_quota,
     const storage::GetOriginCallback& callback) {
+  DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
+
   content::BrowserThread::PostTaskAndReplyWithResult(
       content::BrowserThread::UI, FROM_HERE,
       base::Bind(&GetSiteEngagementEvictionOriginOnUIThread,
@@ -107,7 +111,7 @@
 }
 
 // static
-GURL SiteEngagementEvictionPolicy::CalculateEvictionOrigin(
+GURL SiteEngagementEvictionPolicy::CalculateEvictionOriginForTests(
     const scoped_refptr<storage::SpecialStoragePolicy>& special_storage_policy,
     SiteEngagementScoreProvider* score_provider,
     const std::map<GURL, int64>& usage_map,
diff --git a/chrome/browser/engagement/site_engagement_eviction_policy.h b/chrome/browser/engagement/site_engagement_eviction_policy.h
index 470b0ec..60c87683 100644
--- a/chrome/browser/engagement/site_engagement_eviction_policy.h
+++ b/chrome/browser/engagement/site_engagement_eviction_policy.h
@@ -23,7 +23,7 @@
  public:
   explicit SiteEngagementEvictionPolicy(
       content::BrowserContext* browser_context);
-  virtual ~SiteEngagementEvictionPolicy();
+  ~SiteEngagementEvictionPolicy() override;
 
   // Overridden from storage::QuotaEvictionPolicy:
   void GetEvictionOrigin(const scoped_refptr<storage::SpecialStoragePolicy>&
@@ -35,14 +35,14 @@
  private:
   friend class SiteEngagementEvictionPolicyTest;
 
-  static GURL CalculateEvictionOrigin(
+  static GURL CalculateEvictionOriginForTests(
       const scoped_refptr<storage::SpecialStoragePolicy>&
           special_storage_policy,
       SiteEngagementScoreProvider* score_provider,
       const std::map<GURL, int64>& usage_map,
       int64 global_quota);
 
-  content::BrowserContext* browser_context_;
+  content::BrowserContext* const browser_context_;
 
   DISALLOW_COPY_AND_ASSIGN(SiteEngagementEvictionPolicy);
 };
diff --git a/chrome/browser/engagement/site_engagement_eviction_policy_unittest.cc b/chrome/browser/engagement/site_engagement_eviction_policy_unittest.cc
index 733c5aa6..19c948e 100644
--- a/chrome/browser/engagement/site_engagement_eviction_policy_unittest.cc
+++ b/chrome/browser/engagement/site_engagement_eviction_policy_unittest.cc
@@ -2,9 +2,18 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
+#include "base/files/scoped_temp_dir.h"
+#include "base/memory/scoped_ptr.h"
+#include "base/memory/weak_ptr.h"
+#include "base/run_loop.h"
+#include "base/thread_task_runner_handle.h"
 #include "chrome/browser/engagement/site_engagement_eviction_policy.h"
 #include "chrome/browser/engagement/site_engagement_service.h"
 #include "content/public/test/mock_special_storage_policy.h"
+#include "content/public/test/mock_storage_client.h"
+#include "content/public/test/test_browser_thread_bundle.h"
+#include "storage/browser/quota/quota_manager.h"
+#include "storage/browser/quota/quota_manager_proxy.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
 namespace {
@@ -49,7 +58,7 @@
   ~SiteEngagementEvictionPolicyTest() override {}
 
   GURL CalculateEvictionOrigin(const std::map<GURL, int64>& usage) {
-    return SiteEngagementEvictionPolicy::CalculateEvictionOrigin(
+    return SiteEngagementEvictionPolicy::CalculateEvictionOriginForTests(
         storage_policy_, score_provider_.get(), usage, kGlobalQuota);
   }
 
diff --git a/chrome/browser/extensions/active_install_data.cc b/chrome/browser/extensions/active_install_data.cc
index f9c9a0c..ee6cdfe 100644
--- a/chrome/browser/extensions/active_install_data.cc
+++ b/chrome/browser/extensions/active_install_data.cc
@@ -11,11 +11,11 @@
 // ActiveInstallData:
 
 ActiveInstallData::ActiveInstallData()
-    : percent_downloaded(0), is_ephemeral(false) {
+    : percent_downloaded(0) {
 }
 
 ActiveInstallData::ActiveInstallData(const std::string& extension_id)
-    : extension_id(extension_id), percent_downloaded(0), is_ephemeral(false) {
+    : extension_id(extension_id), percent_downloaded(0) {
 }
 
 // ScopedActiveInstall:
diff --git a/chrome/browser/extensions/active_install_data.h b/chrome/browser/extensions/active_install_data.h
index 4aa5887..c7dd9ba 100644
--- a/chrome/browser/extensions/active_install_data.h
+++ b/chrome/browser/extensions/active_install_data.h
@@ -23,7 +23,6 @@
 
   std::string extension_id;
   int percent_downloaded;
-  bool is_ephemeral;
 };
 
 // Registers and deregisters and an active extension install with the
diff --git a/chrome/browser/extensions/api/content_settings/content_settings_api.cc b/chrome/browser/extensions/api/content_settings/content_settings_api.cc
index bad9a31..007767c 100644
--- a/chrome/browser/extensions/api/content_settings/content_settings_api.cc
+++ b/chrome/browser/extensions/api/content_settings/content_settings_api.cc
@@ -234,15 +234,12 @@
     // TODO(msramek): Get the same human readable name as is presented
     // externally in the API, i.e. chrome.contentSettings.<name>.set().
     std::string readable_type_name;
-    switch (content_type) {
-      case CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC:
-        readable_type_name = "microphone";
-        break;
-      case CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA:
-        readable_type_name = "camera";
-        break;
-      default:
-        DCHECK(false) << "No human-readable type name defined for this type.";
+    if (content_type == CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC) {
+      readable_type_name = "microphone";
+    } else if (content_type == CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA) {
+      readable_type_name = "camera";
+    } else {
+      NOTREACHED() << "No human-readable type name defined for this type.";
     }
 
     error_ = base::StringPrintf(
diff --git a/chrome/browser/extensions/api/webstore_private/webstore_private_api.cc b/chrome/browser/extensions/api/webstore_private/webstore_private_api.cc
index 8f28c8c..f1276432 100644
--- a/chrome/browser/extensions/api/webstore_private/webstore_private_api.cc
+++ b/chrome/browser/extensions/api/webstore_private/webstore_private_api.cc
@@ -10,10 +10,10 @@
 #include "base/metrics/histogram.h"
 #include "base/prefs/pref_service.h"
 #include "base/strings/stringprintf.h"
+#include "base/strings/utf_string_conversions.h"
 #include "base/thread_task_runner_handle.h"
 #include "base/values.h"
 #include "base/version.h"
-#include "chrome/browser/apps/ephemeral_app_launcher.h"
 #include "chrome/browser/bitmap_fetcher/bitmap_fetcher.h"
 #include "chrome/browser/extensions/crx_installer.h"
 #include "chrome/browser/extensions/extension_install_ui_util.h"
@@ -99,46 +99,6 @@
       contents->GetTopLevelNativeWindow());
 }
 
-api::webstore_private::Result WebstoreInstallResultToApiResult(
-    webstore_install::Result result) {
-  switch (result) {
-    case webstore_install::SUCCESS:
-      return api::webstore_private::RESULT_SUCCESS;
-    case webstore_install::OTHER_ERROR:
-      return api::webstore_private::RESULT_UNKNOWN_ERROR;
-    case webstore_install::INVALID_ID:
-      return api::webstore_private::RESULT_INVALID_ID;
-    case webstore_install::NOT_PERMITTED:
-    case webstore_install::WEBSTORE_REQUEST_ERROR:
-    case webstore_install::INVALID_WEBSTORE_RESPONSE:
-      return api::webstore_private::RESULT_INSTALL_ERROR;
-    case webstore_install::INVALID_MANIFEST:
-      return api::webstore_private::RESULT_MANIFEST_ERROR;
-    case webstore_install::ICON_ERROR:
-      return api::webstore_private::RESULT_ICON_ERROR;
-    case webstore_install::ABORTED:
-    case webstore_install::USER_CANCELLED:
-      return api::webstore_private::RESULT_USER_CANCELLED;
-    case webstore_install::BLACKLISTED:
-      return api::webstore_private::RESULT_BLACKLISTED;
-    case webstore_install::MISSING_DEPENDENCIES:
-    case webstore_install::REQUIREMENT_VIOLATIONS:
-      return api::webstore_private::RESULT_MISSING_DEPENDENCIES;
-    case webstore_install::BLOCKED_BY_POLICY:
-      return api::webstore_private::RESULT_BLOCKED_BY_POLICY;
-    case webstore_install::LAUNCH_FEATURE_DISABLED:
-      return api::webstore_private::RESULT_FEATURE_DISABLED;
-    case webstore_install::LAUNCH_UNSUPPORTED_EXTENSION_TYPE:
-      return api::webstore_private::RESULT_UNSUPPORTED_EXTENSION_TYPE;
-    case webstore_install::INSTALL_IN_PROGRESS:
-      return api::webstore_private::RESULT_INSTALL_IN_PROGRESS;
-    case webstore_install::LAUNCH_IN_PROGRESS:
-      return api::webstore_private::RESULT_LAUNCH_IN_PROGRESS;
-  }
-  NOTREACHED();
-  return api::webstore_private::RESULT_NONE;
-}
-
 api::webstore_private::Result WebstoreInstallHelperResultToApiResult(
     WebstoreInstallHelper::Delegate::InstallHelperResultCode result) {
   switch (result) {
@@ -170,10 +130,11 @@
 const char kInvalidManifestError[] = "Invalid manifest";
 const char kNoPreviousBeginInstallWithManifestError[] =
     "* does not match a previous call to beginInstallWithManifest3";
-const char kBlockedByPolicyError[] = "Blocked by policy";
 const char kUserCancelledError[] = "User cancelled install";
 const char kIncognitoError[] =
     "Apps cannot be installed in guest/incognito mode";
+const char kEphemeralAppLaunchingNotSupported[] =
+    "Ephemeral launching of apps is no longer supported.";
 
 WebstoreInstaller::Delegate* test_webstore_installer_delegate = nullptr;
 
@@ -303,12 +264,12 @@
   }
 
   // Check the management policy before the installation process begins
+  base::string16 policy_error;
   bool allow = ExtensionSystem::Get(chrome_details_.GetProfile())->
-      management_policy()->UserMayLoad(extension_.get(),
-                                       NULL);
+      management_policy()->UserMayLoad(dummy_extension_.get(), &policy_error);
   if (!allow) {
     Respond(BuildResponse(api::webstore_private::RESULT_BLOCKED_BY_POLICY,
-                          kBlockedByPolicyError));
+                          base::UTF16ToUTF8(policy_error)));
     // Matches the AddRef in Run().
     Release();
     return;
@@ -746,60 +707,8 @@
 
 ExtensionFunction::ResponseAction
 WebstorePrivateLaunchEphemeralAppFunction::Run() {
-  // Check whether the browser window still exists.
-  content::WebContents* web_contents =
-      chrome_details_.GetAssociatedWebContents();
-  if (!web_contents)
-    return RespondNow(Error("aborted"));
-
-  if (!user_gesture()) {
-    return RespondNow(BuildResponse(
-        api::webstore_private::RESULT_USER_GESTURE_REQUIRED,
-        "User gesture is required"));
-  }
-
-  scoped_ptr<LaunchEphemeralApp::Params> params(
-      LaunchEphemeralApp::Params::Create(*args_));
-  EXTENSION_FUNCTION_VALIDATE(params);
-
-  AddRef();  // Balanced in OnLaunchComplete()
-
-  scoped_refptr<EphemeralAppLauncher> launcher =
-      EphemeralAppLauncher::CreateForWebContents(
-          params->id,
-          web_contents,
-          base::Bind(
-              &WebstorePrivateLaunchEphemeralAppFunction::OnLaunchComplete,
-              base::Unretained(this)));
-  launcher->Start();
-
-  return RespondLater();
-}
-
-void WebstorePrivateLaunchEphemeralAppFunction::OnLaunchComplete(
-    webstore_install::Result result, const std::string& error) {
-  Respond(BuildResponse(WebstoreInstallResultToApiResult(result), error));
-  Release();  // Matches AddRef() in Run()
-}
-
-ExtensionFunction::ResponseValue
-WebstorePrivateLaunchEphemeralAppFunction::BuildResponse(
-    api::webstore_private::Result result, const std::string& error) {
-  if (result != api::webstore_private::RESULT_SUCCESS) {
-    std::string error_message;
-    if (error.empty()) {
-      error_message = base::StringPrintf(
-          "[%s]", api::webstore_private::ToString(result).c_str());
-    } else {
-      error_message = base::StringPrintf(
-          "[%s]: %s",
-          api::webstore_private::ToString(result).c_str(),
-          error.c_str());
-    }
-    return ErrorWithArguments(LaunchEphemeralApp::Results::Create(result),
-                              error_message);
-  }
-  return ArgumentList(LaunchEphemeralApp::Results::Create(result));
+  // Just fail as this is no longer supported.
+  return RespondNow(Error(kEphemeralAppLaunchingNotSupported));
 }
 
 WebstorePrivateGetEphemeralAppsEnabledFunction::
@@ -811,7 +720,7 @@
 ExtensionFunction::ResponseAction
 WebstorePrivateGetEphemeralAppsEnabledFunction::Run() {
   return RespondNow(ArgumentList(GetEphemeralAppsEnabled::Results::Create(
-      EphemeralAppLauncher::IsFeatureEnabled())));
+      false)));
 }
 
 }  // namespace extensions
diff --git a/chrome/browser/extensions/api/webstore_private/webstore_private_apitest.cc b/chrome/browser/extensions/api/webstore_private/webstore_private_apitest.cc
index 6d63a6a6..656b7d3 100644
--- a/chrome/browser/extensions/api/webstore_private/webstore_private_apitest.cc
+++ b/chrome/browser/extensions/api/webstore_private/webstore_private_apitest.cc
@@ -32,7 +32,6 @@
 #include "gpu/config/gpu_feature_type.h"
 #include "gpu/config/gpu_info.h"
 #include "net/dns/mock_host_resolver.h"
-#include "ui/app_list/app_list_switches.h"
 #include "ui/gl/gl_switches.h"
 
 using gpu::GpuFeatureType;
@@ -398,45 +397,6 @@
   RunTest(webgl_allowed);
 }
 
-class EphemeralAppWebstorePrivateApiTest
-    : public ExtensionWebstorePrivateApiTest {
- public:
-  void SetUpInProcessBrowserTestFixture() override {
-    ExtensionWebstorePrivateApiTest::SetUpInProcessBrowserTestFixture();
-
-    net::HostPortPair host_port = test_server()->host_port_pair();
-    std::string test_gallery_url = base::StringPrintf(
-        "http://www.example.com:%d/files/extensions/platform_apps/"
-        "ephemeral_launcher",
-        host_port.port());
-    base::CommandLine::ForCurrentProcess()->AppendSwitchASCII(
-        switches::kAppsGalleryURL, test_gallery_url);
-  }
-
-  GURL GetTestServerURL(const std::string& path) override {
-    return DoGetTestServerURL(
-        std::string("files/extensions/platform_apps/ephemeral_launcher/") +
-        path);
-  }
-};
-
-// Run tests when the --enable-ephemeral-apps switch is not enabled.
-IN_PROC_BROWSER_TEST_F(EphemeralAppWebstorePrivateApiTest,
-                       EphemeralAppsFeatureDisabled) {
-  base::CommandLine::ForCurrentProcess()->AppendSwitch(
-      app_list::switches::kDisableExperimentalAppList);
-  ASSERT_TRUE(RunInstallTest("webstore_launch_disabled.html", "app.crx"));
-}
-
-// Run tests when the --enable-ephemeral-apps switch is enabled.
-IN_PROC_BROWSER_TEST_F(EphemeralAppWebstorePrivateApiTest, LaunchEphemeralApp) {
-  base::CommandLine::ForCurrentProcess()->AppendSwitch(
-      switches::kEnableEphemeralAppsInWebstore);
-  base::CommandLine::ForCurrentProcess()->AppendSwitch(
-      app_list::switches::kEnableExperimentalAppList);
-  ASSERT_TRUE(RunInstallTest("webstore_launch_app.html", "app.crx"));
-}
-
 class BundleWebstorePrivateApiTest
     : public ExtensionWebstorePrivateApiTest {
  public:
diff --git a/chrome/browser/extensions/crx_installer.cc b/chrome/browser/extensions/crx_installer.cc
index bcfd265..898c814 100644
--- a/chrome/browser/extensions/crx_installer.cc
+++ b/chrome/browser/extensions/crx_installer.cc
@@ -157,7 +157,6 @@
     minimum_version_ = base::Version(*approval->minimum_version);
 
   show_dialog_callback_ = approval->show_dialog_callback;
-  set_is_ephemeral(approval->is_ephemeral);
 }
 
 CrxInstaller::~CrxInstaller() {
diff --git a/chrome/browser/extensions/extension_service_unittest.cc b/chrome/browser/extensions/extension_service_unittest.cc
index d22415f5..00fcdc7 100644
--- a/chrome/browser/extensions/extension_service_unittest.cc
+++ b/chrome/browser/extensions/extension_service_unittest.cc
@@ -6889,6 +6889,55 @@
   }
 }
 
+TEST_F(ExtensionServiceTest, ProcessSyncDataDeferredEnable) {
+  InitializeEmptyExtensionService();
+  extension_sync_service()->MergeDataAndStartSyncing(
+      syncer::EXTENSIONS,
+      syncer::SyncDataList(),
+      scoped_ptr<syncer::SyncChangeProcessor>(
+          new syncer::FakeSyncChangeProcessor),
+      scoped_ptr<syncer::SyncErrorFactory>(new syncer::SyncErrorFactoryMock()));
+
+  base::FilePath base_path = data_dir().AppendASCII("permissions_increase");
+  base::FilePath pem_path = base_path.AppendASCII("permissions.pem");
+
+  base::FilePath path = base_path.AppendASCII("v1");
+  const Extension* extension = PackAndInstallCRX(path, pem_path, INSTALL_NEW);
+  // The extension must now be installed and enabled.
+  ASSERT_TRUE(extension);
+  ASSERT_TRUE(registry()->enabled_extensions().Contains(extension->id()));
+
+  // Save the id, as the extension object will be destroyed during updating.
+  std::string id = extension->id();
+
+  // Update to a new version with increased permissions.
+  path = base_path.AppendASCII("v2");
+  PackCRXAndUpdateExtension(id, path, pem_path, DISABLED);
+
+  // Now a sync update comes in, telling us to re-enable a *newer* version.
+  sync_pb::EntitySpecifics specifics;
+  sync_pb::ExtensionSpecifics* ext_specifics = specifics.mutable_extension();
+  ext_specifics->set_id(id);
+  ext_specifics->set_version("3");
+  ext_specifics->set_enabled(true);
+  ext_specifics->set_disable_reasons(Extension::DISABLE_NONE);
+
+  syncer::SyncData sync_data =
+      syncer::SyncData::CreateLocalData(good_crx, "Name", specifics);
+  syncer::SyncChange sync_change(FROM_HERE,
+                                 syncer::SyncChange::ACTION_UPDATE,
+                                 sync_data);
+  syncer::SyncChangeList list(1, sync_change);
+  extension_sync_service()->ProcessSyncChanges(FROM_HERE, list);
+
+  // Since the version didn't match, the extension should still be disabled.
+  EXPECT_TRUE(registry()->disabled_extensions().Contains(id));
+
+  // After we update to the matching version, the extension should get enabled.
+  path = base_path.AppendASCII("v3");
+  PackCRXAndUpdateExtension(id, path, pem_path, ENABLED);
+}
+
 TEST_F(ExtensionServiceTest, ProcessSyncDataPermissionApproval) {
   // This is the update URL specified in the test extension. Setting it here is
   // necessary to make it considered syncable.
diff --git a/chrome/browser/extensions/extension_sync_data.h b/chrome/browser/extensions/extension_sync_data.h
index a294f61..3505c86 100644
--- a/chrome/browser/extensions/extension_sync_data.h
+++ b/chrome/browser/extensions/extension_sync_data.h
@@ -86,6 +86,7 @@
   // currently-installed extension doesn't match |version|).
   bool uninstalled() const { return uninstalled_; }
   bool enabled() const { return enabled_; }
+  void set_enabled(bool enabled) { enabled_ = enabled; }
   bool supports_disable_reasons() const { return supports_disable_reasons_; }
   int disable_reasons() const { return disable_reasons_; }
   bool incognito_enabled() const { return incognito_enabled_; }
diff --git a/chrome/browser/extensions/extension_sync_service.cc b/chrome/browser/extensions/extension_sync_service.cc
index 6a64f78d..eb9d3ab 100644
--- a/chrome/browser/extensions/extension_sync_service.cc
+++ b/chrome/browser/extensions/extension_sync_service.cc
@@ -92,6 +92,17 @@
 
 }  // namespace
 
+struct ExtensionSyncService::PendingUpdate {
+  PendingUpdate() : grant_permissions_and_reenable(false) {}
+  PendingUpdate(const base::Version& version,
+                bool grant_permissions_and_reenable)
+    : version(version),
+      grant_permissions_and_reenable(grant_permissions_and_reenable) {}
+
+  base::Version version;
+  bool grant_permissions_and_reenable;
+};
+
 ExtensionSyncService::ExtensionSyncService(Profile* profile)
     : profile_(profile),
       registry_observer_(this),
@@ -245,12 +256,16 @@
 
   // If there's a pending update, send the new version to sync instead of the
   // installed one.
-  auto it = pending_update_versions_.find(extension.id());
-  if (it != pending_update_versions_.end()) {
-    const base::Version& version = it->second;
+  auto it = pending_updates_.find(extension.id());
+  if (it != pending_updates_.end()) {
+    const base::Version& version = it->second.version;
     // If we have a pending version, it should be newer than the installed one.
     DCHECK_EQ(-1, extension.version()->CompareTo(version));
     result.set_version(version);
+    // If we'll re-enable the extension once it's updated, also send that back
+    // to sync.
+    if (it->second.grant_permissions_and_reenable)
+      result.set_enabled(true);
   }
   return result;
 }
@@ -297,6 +312,7 @@
       extension->version()->CompareTo(extension_sync_data.version()) : 0;
 
   // Enable/disable the extension.
+  bool reenable_after_update = false;
   if (extension_sync_data.enabled()) {
     DCHECK(!extension_sync_data.disable_reasons());
 
@@ -309,7 +325,7 @@
                                (version_compare_result == 0);
       if (grant_permissions) {
         extension_service()->GrantPermissionsAndEnableExtension(extension);
-      } else {
+      } else if (!extension_service()->IsExtensionEnabled(extension->id())) {
         // Only enable if the extension already has all required permissions.
         scoped_ptr<const extensions::PermissionSet> granted_permissions =
             extension_prefs->GetGrantedPermissions(extension->id());
@@ -321,6 +337,8 @@
                 extension->GetType());
         if (!is_privilege_increase)
           extension_service()->EnableExtension(id);
+        else if (extension_sync_data.supports_disable_reasons())
+          reenable_after_update = true;
       }
     } else {
       // The extension is not installed yet. Set it to enabled; we'll check for
@@ -331,8 +349,8 @@
     int disable_reasons = extension_sync_data.disable_reasons();
     if (extension_sync_data.remote_install()) {
       if (!(disable_reasons & Extension::DISABLE_REMOTE_INSTALL)) {
-        // In the non-legacy case (>=M45) where disable reasons are synced at
-        // all, DISABLE_REMOTE_INSTALL should be among them already.
+        // Since disabled reasons are synced since M45, DISABLE_REMOTE_INSTALL
+        // should be among them already.
         DCHECK(!extension_sync_data.supports_disable_reasons());
         disable_reasons |= Extension::DISABLE_REMOTE_INSTALL;
       }
@@ -402,7 +420,8 @@
   if (extension_installed) {
     // If the extension is installed but outdated, store the new version.
     if (version_compare_result < 0) {
-      pending_update_versions_[id] = extension_sync_data.version();
+      pending_updates_[id] = PendingUpdate(extension_sync_data.version(),
+                                           reenable_after_update);
       check_for_updates = true;
     }
   } else {
@@ -495,11 +514,13 @@
     bool is_update) {
   DCHECK_EQ(profile_, browser_context);
   // Clear pending version if the installed one has caught up.
-  auto it = pending_update_versions_.find(extension->id());
-  if (it != pending_update_versions_.end()) {
-    const base::Version& pending_version = it->second;
-    if (extension->version()->CompareTo(pending_version) >= 0)
-      pending_update_versions_.erase(it);
+  auto it = pending_updates_.find(extension->id());
+  if (it != pending_updates_.end()) {
+    int compare_result = extension->version()->CompareTo(it->second.version);
+    if (compare_result == 0 && it->second.grant_permissions_and_reenable)
+      extension_service()->GrantPermissionsAndEnableExtension(extension);
+    if (compare_result >= 0)
+      pending_updates_.erase(it);
   }
   SyncExtensionChangeIfNeeded(*extension);
 }
@@ -530,7 +551,7 @@
     flare_.Run(type);  // Tell sync to start ASAP.
   }
 
-  pending_update_versions_.erase(extension->id());
+  pending_updates_.erase(extension->id());
 }
 
 void ExtensionSyncService::OnExtensionStateChanged(
diff --git a/chrome/browser/extensions/extension_sync_service.h b/chrome/browser/extensions/extension_sync_service.h
index a91d1dc..9bbb2cd 100644
--- a/chrome/browser/extensions/extension_sync_service.h
+++ b/chrome/browser/extensions/extension_sync_service.h
@@ -121,9 +121,12 @@
   extensions::SyncBundle app_sync_bundle_;
   extensions::SyncBundle extension_sync_bundle_;
 
-  // Map from extension id to new version. Used to send the new version back to
-  // the sync server while we're waiting for an extension to update.
-  std::map<std::string, base::Version> pending_update_versions_;
+  // Map from extension id to pending update data. Used for two things:
+  // - To send the new version back to the sync server while we're waiting for
+  //   an extension to update.
+  // - For re-enables, to defer granting permissions until the version matches.
+  struct PendingUpdate;
+  std::map<std::string, PendingUpdate> pending_updates_;
 
   // Run()ning tells sync to try and start soon, because syncable changes
   // have started happening. It will cause sync to call us back
diff --git a/chrome/browser/extensions/install_observer.cc b/chrome/browser/extensions/install_observer.cc
index 37c7565c..1145951c 100644
--- a/chrome/browser/extensions/install_observer.cc
+++ b/chrome/browser/extensions/install_observer.cc
@@ -16,7 +16,6 @@
           extension_name(extension_name),
           installing_icon(installing_icon),
           is_app(is_app),
-          is_platform_app(is_platform_app),
-          is_ephemeral(false) {}
+          is_platform_app(is_platform_app) {}
 
 }  // namespace extensions
diff --git a/chrome/browser/extensions/install_observer.h b/chrome/browser/extensions/install_observer.h
index faecf14..0185dd3 100644
--- a/chrome/browser/extensions/install_observer.h
+++ b/chrome/browser/extensions/install_observer.h
@@ -28,7 +28,6 @@
     gfx::ImageSkia installing_icon;
     bool is_app;
     bool is_platform_app;
-    bool is_ephemeral;
   };
 
   // Called at the beginning of the complete installation process, i.e., this
diff --git a/chrome/browser/extensions/install_tracker.cc b/chrome/browser/extensions/install_tracker.cc
index 29758b2f..67e0cbb 100644
--- a/chrome/browser/extensions/install_tracker.cc
+++ b/chrome/browser/extensions/install_tracker.cc
@@ -79,7 +79,6 @@
       active_installs_.find(params.extension_id);
   if (install_data == active_installs_.end()) {
     ActiveInstallData install_data(params.extension_id);
-    install_data.is_ephemeral = params.is_ephemeral;
     active_installs_.insert(std::make_pair(params.extension_id, install_data));
   }
 
diff --git a/chrome/browser/extensions/install_tracker_unittest.cc b/chrome/browser/extensions/install_tracker_unittest.cc
index e02400f..84572cd 100644
--- a/chrome/browser/extensions/install_tracker_unittest.cc
+++ b/chrome/browser/extensions/install_tracker_unittest.cc
@@ -61,7 +61,6 @@
   void VerifyInstallData(const ActiveInstallData& original,
                          const ActiveInstallData& retrieved) {
     EXPECT_EQ(original.extension_id, retrieved.extension_id);
-    EXPECT_EQ(original.is_ephemeral, retrieved.is_ephemeral);
     EXPECT_EQ(original.percent_downloaded, retrieved.percent_downloaded);
   }
 
@@ -75,7 +74,6 @@
   ActiveInstallData install_data1(kExtensionId1);
   install_data1.percent_downloaded = 76;
   ActiveInstallData install_data2(kExtensionId2);
-  install_data2.is_ephemeral = true;
 
   tracker_->AddActiveInstall(install_data1);
   tracker_->AddActiveInstall(install_data2);
@@ -174,7 +172,6 @@
 TEST_F(InstallTrackerTest, ExtensionInstallFailure) {
   InstallObserver::ExtensionInstallParams install_params(
       kExtensionId1, std::string(), gfx::ImageSkia(), false, false);
-  install_params.is_ephemeral = true;
   tracker_->OnBeginExtensionInstall(install_params);
 
   const ActiveInstallData* retrieved_data =
@@ -182,7 +179,6 @@
   ASSERT_TRUE(retrieved_data);
   EXPECT_EQ(0, retrieved_data->percent_downloaded);
   EXPECT_EQ(install_params.extension_id, retrieved_data->extension_id);
-  EXPECT_EQ(install_params.is_ephemeral, retrieved_data->is_ephemeral);
   retrieved_data = NULL;
 
   tracker_->OnInstallFailure(kExtensionId1);
@@ -200,7 +196,6 @@
   ASSERT_TRUE(retrieved_data);
   EXPECT_EQ(0, retrieved_data->percent_downloaded);
   EXPECT_EQ(install_params.extension_id, retrieved_data->extension_id);
-  EXPECT_EQ(install_params.is_ephemeral, retrieved_data->is_ephemeral);
   retrieved_data = NULL;
 
   // Simulate an extension install.
diff --git a/chrome/browser/extensions/webstore_installer.cc b/chrome/browser/extensions/webstore_installer.cc
index d85cfad..f824dd6 100644
--- a/chrome/browser/extensions/webstore_installer.cc
+++ b/chrome/browser/extensions/webstore_installer.cc
@@ -241,8 +241,7 @@
       skip_post_install_ui(false),
       skip_install_dialog(false),
       enable_launcher(false),
-      manifest_check_level(MANIFEST_CHECK_LEVEL_STRICT),
-      is_ephemeral(false) {
+      manifest_check_level(MANIFEST_CHECK_LEVEL_STRICT) {
 }
 
 scoped_ptr<WebstoreInstaller::Approval>
@@ -358,7 +357,6 @@
       approval_->installing_icon,
       approval_->manifest->is_app(),
       approval_->manifest->is_platform_app());
-  params.is_ephemeral = approval_->is_ephemeral;
   tracker->OnBeginExtensionInstall(params);
 
   tracker->OnBeginExtensionDownload(id_);
diff --git a/chrome/browser/extensions/webstore_installer.h b/chrome/browser/extensions/webstore_installer.h
index 21f71a7..e02cbc6d 100644
--- a/chrome/browser/extensions/webstore_installer.h
+++ b/chrome/browser/extensions/webstore_installer.h
@@ -161,9 +161,6 @@
     // Required minimum version.
     scoped_ptr<Version> minimum_version;
 
-    // Ephemeral apps are transiently installed.
-    bool is_ephemeral;
-
     // The authuser index required to download the item being installed. May be
     // the empty string, in which case no authuser parameter is used.
     std::string authuser;
diff --git a/chrome/browser/extensions/webstore_standalone_installer.cc b/chrome/browser/extensions/webstore_standalone_installer.cc
index 5b3ad15..760cb00e 100644
--- a/chrome/browser/extensions/webstore_standalone_installer.cc
+++ b/chrome/browser/extensions/webstore_standalone_installer.cc
@@ -35,7 +35,6 @@
 const char kUserCancelledError[] = "User cancelled install";
 const char kExtensionIsBlacklisted[] = "Extension is blacklisted";
 const char kInstallInProgressError[] = "An install is already in progress";
-const char kLaunchInProgressError[] = "A launch is already in progress";
 
 WebstoreStandaloneInstaller::WebstoreStandaloneInstaller(
     const std::string& webstore_item_id,
@@ -111,13 +110,8 @@
   const ActiveInstallData* existing_install_data =
       tracker->GetActiveInstall(id_);
   if (existing_install_data) {
-    if (existing_install_data->is_ephemeral) {
-      *reason = webstore_install::LAUNCH_IN_PROGRESS;
-      *error = kLaunchInProgressError;
-    } else {
-      *reason = webstore_install::INSTALL_IN_PROGRESS;
-      *error = kInstallInProgressError;
-    }
+    *reason = webstore_install::INSTALL_IN_PROGRESS;
+    *error = kInstallInProgressError;
     return false;
   }
 
@@ -215,8 +209,7 @@
       // Don't install a blacklisted extension.
       install_result = webstore_install::BLACKLISTED;
       install_message = kExtensionIsBlacklisted;
-    } else if (util::IsEphemeralApp(installed_extension->id(), profile_) &&
-               !approval->is_ephemeral) {
+    } else if (util::IsEphemeralApp(installed_extension->id(), profile_)) {
       // If the target extension has already been installed ephemerally and is
       // up to date, it can be promoted to a regular installed extension and
       // downloading from the Web Store is not necessary.
diff --git a/chrome/browser/io_thread.cc b/chrome/browser/io_thread.cc
index 952964b..091d171 100644
--- a/chrome/browser/io_thread.cc
+++ b/chrome/browser/io_thread.cc
@@ -41,7 +41,6 @@
 #include "components/data_reduction_proxy/core/browser/data_reduction_proxy_prefs.h"
 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_params.h"
 #include "components/data_reduction_proxy/core/common/data_reduction_proxy_pref_names.h"
-#include "components/data_usage/core/data_use_aggregator.h"
 #include "components/net_log/chrome_net_log.h"
 #include "components/policy/core/common/policy_service.h"
 #include "components/proxy_config/pref_proxy_config_tracker.h"
@@ -73,6 +72,7 @@
 #include "net/http/http_auth_filter.h"
 #include "net/http/http_auth_handler_factory.h"
 #include "net/http/http_network_layer.h"
+#include "net/http/http_network_session.h"
 #include "net/http/http_server_properties_impl.h"
 #include "net/proxy/proxy_config_service.h"
 #include "net/proxy/proxy_script_fetcher_impl.h"
@@ -110,6 +110,7 @@
 
 #if defined(OS_ANDROID)
 #include "base/android/build_info.h"
+#include "chrome/browser/android/datausage/external_data_use_observer.h"
 #include "chrome/browser/android/net/external_estimate_provider_android.h"
 #endif
 
@@ -570,7 +571,7 @@
       extension_event_router_forwarder_;
 #endif
 
-  globals_->data_use_aggregator.reset(new data_usage::DataUseAggregator());
+  data_use_aggregator_.reset(new data_usage::DataUseAggregator());
 
   // TODO(erikchen): Remove ScopedTracker below once http://crbug.com/466432
   // is fixed.
@@ -582,8 +583,12 @@
                                 &system_enable_referrers_));
   // By default, data usage is considered off the record.
   chrome_network_delegate->set_data_use_aggregator(
-      globals_->data_use_aggregator.get(),
-      true /* is_data_usage_off_the_record */);
+      data_use_aggregator(), true /* is_data_usage_off_the_record */);
+
+#if defined(OS_ANDROID)
+  external_data_use_observer_.reset(
+      new chrome::android::ExternalDataUseObserver(data_use_aggregator()));
+#endif
 
   // TODO(erikchen): Remove ScopedTracker below once http://crbug.com/466432
   // is fixed.
@@ -1059,6 +1064,10 @@
   return creation_time_;
 }
 
+data_usage::DataUseAggregator* IOThread::data_use_aggregator() const {
+  return data_use_aggregator_.get();
+}
+
 net::SSLConfigService* IOThread::GetSSLConfigService() {
   return ssl_config_service_manager_->Get();
 }
@@ -1507,8 +1516,10 @@
   net::URLRequestContextBuilder::SetHttpNetworkSessionComponents(
       context, &system_params);
 
+  globals->system_http_network_session.reset(
+      new net::HttpNetworkSession(system_params));
   globals->system_http_transaction_factory.reset(
-      new net::HttpNetworkLayer(new net::HttpNetworkSession(system_params)));
+      new net::HttpNetworkLayer(globals->system_http_network_session.get()));
   context->set_http_transaction_factory(
       globals->system_http_transaction_factory.get());
 
@@ -1558,15 +1569,16 @@
   tracked_objects::ScopedTracker tracking_profile2(
       FROM_HERE_WITH_EXPLICIT_FUNCTION(
           "466432 IOThread::ConstructProxyScriptFetcherContext2"));
-  scoped_refptr<net::HttpNetworkSession> network_session(
+  globals->proxy_script_fetcher_http_network_session.reset(
       new net::HttpNetworkSession(session_params));
   // TODO(erikchen): Remove ScopedTracker below once http://crbug.com/466432
   // is fixed.
   tracked_objects::ScopedTracker tracking_profile3(
       FROM_HERE_WITH_EXPLICIT_FUNCTION(
           "466432 IOThread::ConstructProxyScriptFetcherContext3"));
-  globals->proxy_script_fetcher_http_transaction_factory
-      .reset(new net::HttpNetworkLayer(network_session.get()));
+  globals->proxy_script_fetcher_http_transaction_factory.reset(
+      new net::HttpNetworkLayer(
+          globals->proxy_script_fetcher_http_network_session.get()));
   context->set_http_transaction_factory(
       globals->proxy_script_fetcher_http_transaction_factory.get());
 
diff --git a/chrome/browser/io_thread.h b/chrome/browser/io_thread.h
index 5ef542f..2d798f6 100644
--- a/chrome/browser/io_thread.h
+++ b/chrome/browser/io_thread.h
@@ -20,6 +20,7 @@
 #include "base/time/time.h"
 #include "chrome/browser/net/chrome_network_delegate.h"
 #include "chrome/browser/net/ssl_config_service_manager.h"
+#include "components/data_usage/core/data_use_aggregator.h"
 #include "content/public/browser/browser_thread.h"
 #include "content/public/browser/browser_thread_delegate.h"
 #include "net/base/network_change_notifier.h"
@@ -43,10 +44,6 @@
 class EventRouterForwarder;
 }
 
-namespace data_usage {
-class DataUseAggregator;
-}
-
 namespace net {
 class CertPolicyEnforcer;
 class CertVerifier;
@@ -57,6 +54,7 @@
 class HostMappingRules;
 class HostResolver;
 class HttpAuthHandlerFactory;
+class HttpNetworkSession;
 class HttpServerProperties;
 class HttpTransactionFactory;
 class HttpUserAgentSettings;
@@ -126,9 +124,6 @@
     Globals();
     ~Globals();
 
-    // Global aggregator of data use. It must outlive the
-    // |system_network_delegate|.
-    scoped_ptr<data_usage::DataUseAggregator> data_use_aggregator;
     // The "system" NetworkDelegate, used for Profile-agnostic network events.
     scoped_ptr<net::NetworkDelegate> system_network_delegate;
     scoped_ptr<net::HostResolver> host_resolver;
@@ -145,6 +140,8 @@
     scoped_ptr<net::HttpAuthHandlerFactory> http_auth_handler_factory;
     scoped_ptr<net::HttpServerProperties> http_server_properties;
     scoped_ptr<net::ProxyService> proxy_script_fetcher_proxy_service;
+    scoped_ptr<net::HttpNetworkSession>
+        proxy_script_fetcher_http_network_session;
     scoped_ptr<net::HttpTransactionFactory>
         proxy_script_fetcher_http_transaction_factory;
     scoped_ptr<net::FtpTransactionFactory>
@@ -161,6 +158,7 @@
     // ProxyService, since we always directly connect to fetch the PAC script.
     scoped_ptr<net::URLRequestContext> proxy_script_fetcher_context;
     scoped_ptr<net::ProxyService> system_proxy_service;
+    scoped_ptr<net::HttpNetworkSession> system_http_network_session;
     scoped_ptr<net::HttpTransactionFactory> system_http_transaction_factory;
     scoped_ptr<net::URLRequestJobFactory> system_url_request_job_factory;
     scoped_ptr<net::URLRequestContext> system_request_context;
@@ -252,6 +250,8 @@
 
   base::TimeTicks creation_time() const;
 
+  data_usage::DataUseAggregator* data_use_aggregator() const;
+
   // Returns true if QUIC should be enabled for data reduction proxy, either as
   // a result of a field trial or a command line flag.
   static bool ShouldEnableQuicForDataReductionProxy();
@@ -513,6 +513,13 @@
   // True if QUIC is allowed by policy.
   bool is_quic_allowed_by_policy_;
 
+  // Global aggregator of data use. It must outlive the
+  // |system_network_delegate|.
+  scoped_ptr<data_usage::DataUseAggregator> data_use_aggregator_;
+  // An external observer of data use.
+  scoped_ptr<data_usage::DataUseAggregator::Observer>
+      external_data_use_observer_;
+
   const base::TimeTicks creation_time_;
 
   base::WeakPtrFactory<IOThread> weak_factory_;
diff --git a/chrome/browser/manifest/manifest_icon_downloader.cc b/chrome/browser/manifest/manifest_icon_downloader.cc
index 4a5e1449..ec1e2ec85 100644
--- a/chrome/browser/manifest/manifest_icon_downloader.cc
+++ b/chrome/browser/manifest/manifest_icon_downloader.cc
@@ -8,10 +8,41 @@
 
 #include "chrome/browser/manifest/manifest_icon_selector.h"
 #include "content/public/browser/browser_thread.h"
+#include "content/public/browser/render_frame_host.h"
 #include "content/public/browser/web_contents.h"
+#include "content/public/browser/web_contents_observer.h"
+#include "content/public/common/console_message_level.h"
 #include "skia/ext/image_operations.h"
 #include "ui/gfx/screen.h"
 
+// DevToolsConsoleHelper is a class that holds a WebContents in order to be able
+// to send a message to the WebContents' main frame. It is used so
+// ManifestIconDownloader and the callers do not have to worry about
+// |web_contents| lifetime. If the |web_contents| is invalidated before the
+// message can be sent, the message will simply be ignored.
+class ManifestIconDownloader::DevToolsConsoleHelper
+    : public content::WebContentsObserver {
+ public:
+  explicit DevToolsConsoleHelper(content::WebContents* web_contents);
+  ~DevToolsConsoleHelper() override = default;
+
+  void AddMessage(content::ConsoleMessageLevel level,
+                  const std::string& message);
+};
+
+ManifestIconDownloader::DevToolsConsoleHelper::DevToolsConsoleHelper(
+    content::WebContents* web_contents)
+    : WebContentsObserver(web_contents) {
+}
+
+void ManifestIconDownloader::DevToolsConsoleHelper::AddMessage(
+    content::ConsoleMessageLevel level,
+    const std::string& message) {
+  if (!web_contents())
+    return;
+  web_contents()->GetMainFrame()->AddMessageToConsole(level, message);
+}
+
 bool ManifestIconDownloader::Download(
     content::WebContents* web_contents,
     const GURL& icon_url,
@@ -40,6 +71,7 @@
       base::Bind(&ManifestIconDownloader::OnIconFetched,
                  ideal_icon_size_in_px,
                  minimum_icon_size_in_px,
+                 base::Owned(new DevToolsConsoleHelper(web_contents)),
                  callback));
   return true;
 }
@@ -47,6 +79,7 @@
 void ManifestIconDownloader::OnIconFetched(
     int ideal_icon_size_in_px,
     int minimum_icon_size_in_px,
+    DevToolsConsoleHelper* console_helper,
     const ManifestIconDownloader::IconFetchCallback& callback,
     int id,
     int http_status_code,
@@ -55,10 +88,26 @@
     const std::vector<gfx::Size>& sizes) {
   DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
 
+  if (bitmaps.empty()) {
+    console_helper->AddMessage(
+        content::CONSOLE_MESSAGE_LEVEL_ERROR,
+        "Error while trying to use the following icon from the Manifest: "
+            + url.spec() + " (Download error or resource isn't a valid image)");
+
+    callback.Run(SkBitmap());
+    return;
+  }
+
   const int closest_index = FindClosestBitmapIndex(
       ideal_icon_size_in_px, minimum_icon_size_in_px, bitmaps);
 
   if (closest_index == -1) {
+    console_helper->AddMessage(
+        content::CONSOLE_MESSAGE_LEVEL_ERROR,
+        "Error while trying to use the following icon from the Manifest: "
+            + url.spec()
+            + " (Resource size is not correct - typo in the Manifest?)");
+
     callback.Run(SkBitmap());
     return;
   }
diff --git a/chrome/browser/manifest/manifest_icon_downloader.h b/chrome/browser/manifest/manifest_icon_downloader.h
index fa7b38f..4ae7e63 100644
--- a/chrome/browser/manifest/manifest_icon_downloader.h
+++ b/chrome/browser/manifest/manifest_icon_downloader.h
@@ -44,10 +44,13 @@
                        const IconFetchCallback& callback);
 
  private:
+  class DevToolsConsoleHelper;
+
   // Callback run after the manifest icon downloaded successfully or the
   // download failed.
   static void OnIconFetched(int ideal_icon_size_in_px,
                             int minimum_icon_size_in_px,
+                            DevToolsConsoleHelper* console_helper,
                             const IconFetchCallback& callback,
                             int id,
                             int http_status_code,
diff --git a/chrome/browser/memory/tab_manager.cc b/chrome/browser/memory/tab_manager.cc
index cd75f1f..1f52fb7 100644
--- a/chrome/browser/memory/tab_manager.cc
+++ b/chrome/browser/memory/tab_manager.cc
@@ -279,10 +279,7 @@
 }
 
 void TabManager::RecordDiscardStatistics() {
-  // Record a raw count so we can compare to discard reloads.
   discard_count_++;
-  UMA_HISTOGRAM_CUSTOM_COUNTS("Tabs.Discard.DiscardCount", discard_count_, 1,
-                              1000, 50);
 
   // TODO(jamescook): Maybe incorporate extension count?
   UMA_HISTOGRAM_CUSTOM_COUNTS("Tabs.Discard.TabCount", GetTabCount(), 1, 100,
diff --git a/chrome/browser/metrics/chrome_metrics_service_client.cc b/chrome/browser/metrics/chrome_metrics_service_client.cc
index 275d600..244f62f9 100644
--- a/chrome/browser/metrics/chrome_metrics_service_client.cc
+++ b/chrome/browser/metrics/chrome_metrics_service_client.cc
@@ -67,7 +67,7 @@
 
 #if defined(OS_CHROMEOS)
 #include "chrome/browser/metrics/chromeos_metrics_provider.h"
-#include "chrome/browser/metrics/signin_status_metrics_provider_chromeos.h"
+#include "chrome/browser/signin/signin_status_metrics_provider_chromeos.h"
 #endif
 
 #if defined(OS_WIN)
@@ -77,8 +77,8 @@
 #endif
 
 #if !defined(OS_CHROMEOS)
-#include "chrome/browser/metrics/chrome_signin_status_metrics_provider_delegate.h"
-#include "chrome/browser/metrics/signin_status_metrics_provider.h"
+#include "chrome/browser/signin/chrome_signin_status_metrics_provider_delegate.h"
+#include "components/signin/core/browser/signin_status_metrics_provider.h"
 #endif  // !defined(OS_CHROMEOS)
 
 namespace {
diff --git a/chrome/browser/metrics/chrome_signin_status_metrics_provider_delegate.cc b/chrome/browser/metrics/chrome_signin_status_metrics_provider_delegate.cc
deleted file mode 100644
index 2aa770fb..0000000
--- a/chrome/browser/metrics/chrome_signin_status_metrics_provider_delegate.cc
+++ /dev/null
@@ -1,140 +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.
-
-#include "chrome/browser/metrics/chrome_signin_status_metrics_provider_delegate.h"
-
-#include <string>
-#include <vector>
-
-#include "chrome/browser/browser_process.h"
-#include "chrome/browser/metrics/signin_status_metrics_provider.h"
-#include "chrome/browser/profiles/profile.h"
-#include "chrome/browser/profiles/profile_info_cache.h"
-#include "chrome/browser/profiles/profile_manager.h"
-#include "chrome/browser/ui/browser.h"
-#include "chrome/browser/ui/browser_list.h"
-#include "components/signin/core/browser/signin_manager.h"
-
-#if !defined(OS_ANDROID) && !defined(OS_IOS)
-#include "chrome/browser/ui/browser_finder.h"
-#endif
-
-ChromeSigninStatusMetricsProviderDelegate::
-    ChromeSigninStatusMetricsProviderDelegate() {}
-
-ChromeSigninStatusMetricsProviderDelegate::
-    ~ChromeSigninStatusMetricsProviderDelegate() {
-#if !defined(OS_ANDROID) && !defined(OS_IOS)
-  BrowserList::RemoveObserver(this);
-#endif
-
-  SigninManagerFactory* factory = SigninManagerFactory::GetInstance();
-  if (factory)
-    factory->RemoveObserver(this);
-}
-
-void ChromeSigninStatusMetricsProviderDelegate::Initialize() {
-#if !defined(OS_ANDROID) && !defined(OS_IOS)
-  // On Android, there is always only one profile in any situation, opening new
-  // windows (which is possible with only some Android devices) will not change
-  // the opened profiles signin status.
-  BrowserList::AddObserver(this);
-#endif
-
-  SigninManagerFactory* factory = SigninManagerFactory::GetInstance();
-  if (factory)
-    factory->AddObserver(this);
-}
-
-AccountsStatus
-ChromeSigninStatusMetricsProviderDelegate::GetStatusOfAllAccounts() {
-  ProfileManager* profile_manager = g_browser_process->profile_manager();
-  std::vector<Profile*> profile_list = profile_manager->GetLoadedProfiles();
-
-  AccountsStatus accounts_status;
-  accounts_status.num_accounts = profile_list.size();
-  for (Profile* profile : profile_list) {
-#if !defined(OS_ANDROID) && !defined(OS_IOS)
-    if (chrome::GetTotalBrowserCountForProfile(profile) == 0) {
-      // The profile is loaded, but there's no opened browser for this profile.
-      continue;
-    }
-#endif
-    accounts_status.num_opened_accounts++;
-
-    SigninManager* manager =
-        SigninManagerFactory::GetForProfile(profile->GetOriginalProfile());
-    if (manager && manager->IsAuthenticated())
-      accounts_status.num_signed_in_accounts++;
-  }
-
-  return accounts_status;
-}
-
-std::vector<SigninManager*>
-ChromeSigninStatusMetricsProviderDelegate::GetSigninManagersForAllAccounts() {
-  ProfileManager* profile_manager = g_browser_process->profile_manager();
-  std::vector<Profile*> profiles = profile_manager->GetLoadedProfiles();
-
-  std::vector<SigninManager*> managers;
-  for (Profile* profile : profiles) {
-    SigninManager* manager =
-        SigninManagerFactory::GetForProfileIfExists(profile);
-    if (manager)
-      managers.push_back(manager);
-  }
-
-  return managers;
-}
-
-void ChromeSigninStatusMetricsProviderDelegate::OnBrowserAdded(
-    Browser* browser) {
-  SigninManager* manager =
-      SigninManagerFactory::GetForProfile(browser->profile());
-
-  // Nothing will change if the opened browser is in incognito mode.
-  if (!manager)
-    return;
-
-  const bool signed_in = manager->IsAuthenticated();
-  UpdateStatusWhenBrowserAdded(signed_in);
-}
-
-void ChromeSigninStatusMetricsProviderDelegate::SigninManagerCreated(
-    SigninManagerBase* manager) {
-  owner()->OnSigninManagerCreated(manager);
-}
-
-void ChromeSigninStatusMetricsProviderDelegate::SigninManagerShutdown(
-    SigninManagerBase* manager) {
-  owner()->OnSigninManagerShutdown(manager);
-}
-
-void ChromeSigninStatusMetricsProviderDelegate::UpdateStatusWhenBrowserAdded(
-    bool signed_in) {
-#if !defined(OS_ANDROID) && !defined(OS_IOS)
-  SigninStatusMetricsProviderBase::SigninStatus status =
-      owner()->signin_status();
-
-  // NOTE: If |status| is MIXED_SIGNIN_STATUS, this method
-  // intentionally does not update it.
-  if ((status == SigninStatusMetricsProviderBase::ALL_PROFILES_NOT_SIGNED_IN &&
-       signed_in) ||
-      (status == SigninStatusMetricsProviderBase::ALL_PROFILES_SIGNED_IN &&
-       !signed_in)) {
-    owner()->UpdateSigninStatus(
-        SigninStatusMetricsProviderBase::MIXED_SIGNIN_STATUS);
-  } else if (status == SigninStatusMetricsProviderBase::UNKNOWN_SIGNIN_STATUS) {
-    // If when function ProvideGeneralMetrics() is called, Chrome is
-    // running in the background with no browser window opened, |signin_status_|
-    // will be reset to |UNKNOWN_SIGNIN_STATUS|. Then this newly added browser
-    // is the only opened browser/profile and its signin status represents
-    // the whole status.
-    owner()->UpdateSigninStatus(
-        signed_in
-            ? SigninStatusMetricsProviderBase::ALL_PROFILES_SIGNED_IN
-            : SigninStatusMetricsProviderBase::ALL_PROFILES_NOT_SIGNED_IN);
-  }
-#endif
-}
diff --git a/chrome/browser/metrics/chrome_signin_status_metrics_provider_delegate.h b/chrome/browser/metrics/chrome_signin_status_metrics_provider_delegate.h
deleted file mode 100644
index 647ad0f2..0000000
--- a/chrome/browser/metrics/chrome_signin_status_metrics_provider_delegate.h
+++ /dev/null
@@ -1,43 +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 CHROME_BROWSER_METRICS_CHROME_SIGNIN_STATUS_METRICS_PROVIDER_DELEGATE_H_
-#define CHROME_BROWSER_METRICS_CHROME_SIGNIN_STATUS_METRICS_PROVIDER_DELEGATE_H_
-
-#include "base/gtest_prod_util.h"
-#include "chrome/browser/metrics/signin_status_metrics_provider_delegate.h"
-#include "chrome/browser/signin/signin_manager_factory.h"
-#include "chrome/browser/ui/browser_list_observer.h"
-
-class ChromeSigninStatusMetricsProviderDelegate
-    : public SigninStatusMetricsProviderDelegate,
-      public chrome::BrowserListObserver,
-      public SigninManagerFactory::Observer {
- public:
-  ChromeSigninStatusMetricsProviderDelegate();
-  ~ChromeSigninStatusMetricsProviderDelegate() override;
-
- private:
-  FRIEND_TEST_ALL_PREFIXES(ChromeSigninStatusMetricsProviderDelegateTest,
-                           UpdateStatusWhenBrowserAdded);
-
-  // SigninStatusMetricsProviderDelegate:
-  void Initialize() override;
-  AccountsStatus GetStatusOfAllAccounts() override;
-  std::vector<SigninManager*> GetSigninManagersForAllAccounts() override;
-
-  // chrome::BrowserListObserver:
-  void OnBrowserAdded(Browser* browser) override;
-
-  // SigninManagerFactoryObserver:
-  void SigninManagerCreated(SigninManagerBase* manager) override;
-  void SigninManagerShutdown(SigninManagerBase* manager) override;
-
-  // Updates the sign-in status right after a new browser is opened.
-  void UpdateStatusWhenBrowserAdded(bool signed_in);
-
-  DISALLOW_COPY_AND_ASSIGN(ChromeSigninStatusMetricsProviderDelegate);
-};
-
-#endif  // CHROME_BROWSER_METRICS_CHROME_SIGNIN_STATUS_METRICS_PROVIDER_DELEGATE_H_
diff --git a/chrome/browser/metrics/chrome_signin_status_metrics_provider_delegate_unittest.cc b/chrome/browser/metrics/chrome_signin_status_metrics_provider_delegate_unittest.cc
deleted file mode 100644
index 8442f01..0000000
--- a/chrome/browser/metrics/chrome_signin_status_metrics_provider_delegate_unittest.cc
+++ /dev/null
@@ -1,58 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "chrome/browser/metrics/chrome_signin_status_metrics_provider_delegate.h"
-
-#include "chrome/browser/metrics/signin_status_metrics_provider.h"
-#include "content/public/test/test_browser_thread_bundle.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-#if !defined(OS_ANDROID) && !defined(OS_IOS)
-TEST(ChromeSigninStatusMetricsProviderDelegateTest,
-     UpdateStatusWhenBrowserAdded) {
-  content::TestBrowserThreadBundle thread_bundle;
-
-  scoped_ptr<ChromeSigninStatusMetricsProviderDelegate> delegate(
-      new ChromeSigninStatusMetricsProviderDelegate);
-  ChromeSigninStatusMetricsProviderDelegate* raw_delegate = delegate.get();
-  scoped_ptr<SigninStatusMetricsProvider> metrics_provider(
-      SigninStatusMetricsProvider::CreateInstance(delegate.Pass()));
-
-  // Initial status is all signed in and then a signed-in browser is opened.
-  metrics_provider->UpdateInitialSigninStatusForTesting(2, 2);
-  raw_delegate->UpdateStatusWhenBrowserAdded(true);
-  EXPECT_EQ(SigninStatusMetricsProviderBase::ALL_PROFILES_SIGNED_IN,
-            metrics_provider->GetSigninStatusForTesting());
-
-  // Initial status is all signed in and then a signed-out browser is opened.
-  metrics_provider->UpdateInitialSigninStatusForTesting(2, 2);
-  raw_delegate->UpdateStatusWhenBrowserAdded(false);
-  EXPECT_EQ(SigninStatusMetricsProviderBase::MIXED_SIGNIN_STATUS,
-            metrics_provider->GetSigninStatusForTesting());
-
-  // Initial status is all signed out and then a signed-in browser is opened.
-  metrics_provider->UpdateInitialSigninStatusForTesting(2, 0);
-  raw_delegate->UpdateStatusWhenBrowserAdded(true);
-  EXPECT_EQ(SigninStatusMetricsProviderBase::MIXED_SIGNIN_STATUS,
-            metrics_provider->GetSigninStatusForTesting());
-
-  // Initial status is all signed out and then a signed-out browser is opened.
-  metrics_provider->UpdateInitialSigninStatusForTesting(2, 0);
-  raw_delegate->UpdateStatusWhenBrowserAdded(false);
-  EXPECT_EQ(SigninStatusMetricsProviderBase::ALL_PROFILES_NOT_SIGNED_IN,
-            metrics_provider->GetSigninStatusForTesting());
-
-  // Initial status is mixed and then a signed-in browser is opened.
-  metrics_provider->UpdateInitialSigninStatusForTesting(2, 1);
-  raw_delegate->UpdateStatusWhenBrowserAdded(true);
-  EXPECT_EQ(SigninStatusMetricsProviderBase::MIXED_SIGNIN_STATUS,
-            metrics_provider->GetSigninStatusForTesting());
-
-  // Initial status is mixed and then a signed-out browser is opened.
-  metrics_provider->UpdateInitialSigninStatusForTesting(2, 1);
-  raw_delegate->UpdateStatusWhenBrowserAdded(false);
-  EXPECT_EQ(SigninStatusMetricsProviderBase::MIXED_SIGNIN_STATUS,
-            metrics_provider->GetSigninStatusForTesting());
-}
-#endif
diff --git a/chrome/browser/metrics/signin_status_metrics_provider.cc b/chrome/browser/metrics/signin_status_metrics_provider.cc
deleted file mode 100644
index 5b78456..0000000
--- a/chrome/browser/metrics/signin_status_metrics_provider.cc
+++ /dev/null
@@ -1,182 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "chrome/browser/metrics/signin_status_metrics_provider.h"
-
-#include "base/bind.h"
-#include "base/location.h"
-#include "base/metrics/histogram.h"
-#include "base/single_thread_task_runner.h"
-#include "base/thread_task_runner_handle.h"
-#include "components/signin/core/browser/signin_manager.h"
-
-namespace {
-
-// The event of calling function ComputeCurrentSigninStatus and the errors
-// occurred during the function execution.
-enum ComputeSigninStatus {
-  ENTERED_COMPUTE_SIGNIN_STATUS,
-  ERROR_NO_PROFILE_FOUND,
-  NO_BROWSER_OPENED,
-  USER_SIGNIN_WHEN_STATUS_UNKNOWN,
-  USER_SIGNOUT_WHEN_STATUS_UNKNOWN,
-  TRY_TO_OVERRIDE_ERROR_STATUS,
-  COMPUTE_SIGNIN_STATUS_MAX,
-};
-
-void RecordComputeSigninStatusHistogram(ComputeSigninStatus status) {
-  UMA_HISTOGRAM_ENUMERATION("UMA.ComputeCurrentSigninStatus", status,
-                            COMPUTE_SIGNIN_STATUS_MAX);
-}
-
-}  // namespace
-
-SigninStatusMetricsProvider::SigninStatusMetricsProvider(
-    scoped_ptr<SigninStatusMetricsProviderDelegate> delegate,
-    bool is_test)
-    : delegate_(delegate.Pass()),
-      scoped_observer_(this),
-      is_test_(is_test),
-      weak_ptr_factory_(this) {
-  DCHECK(delegate_ || is_test_);
-  if (is_test_)
-    return;
-
-  delegate_->SetOwner(this);
-
-  // Postpone the initialization until all threads are created.
-  base::ThreadTaskRunnerHandle::Get()->PostTask(
-      FROM_HERE, base::Bind(&SigninStatusMetricsProvider::Initialize,
-                            weak_ptr_factory_.GetWeakPtr()));
-}
-
-SigninStatusMetricsProvider::~SigninStatusMetricsProvider() {}
-
-void SigninStatusMetricsProvider::ProvideGeneralMetrics(
-    metrics::ChromeUserMetricsExtension* uma_proto) {
-  RecordSigninStatusHistogram(signin_status());
-  // After a histogram value is recorded, a new UMA session will be started, so
-  // we need to re-check the current sign-in status regardless of the previous
-  // recorded |signin_status_| value.
-  ResetSigninStatus();
-  ComputeCurrentSigninStatus();
-}
-
-// static
-SigninStatusMetricsProvider* SigninStatusMetricsProvider::CreateInstance(
-    scoped_ptr<SigninStatusMetricsProviderDelegate> delegate) {
-  return new SigninStatusMetricsProvider(delegate.Pass(), false);
-}
-
-void SigninStatusMetricsProvider::OnSigninManagerCreated(
-    SigninManagerBase* manager) {
-  // Whenever a new profile is created, a new SigninManagerBase will be created
-  // for it. This ensures that all sign-in or sign-out actions of all opened
-  // profiles are being monitored.
-  scoped_observer_.Add(manager);
-
-  // If the status is unknown, it means this is the first created
-  // SigninManagerBase and the corresponding profile should be the only opened
-  // profile.
-  if (signin_status() == UNKNOWN_SIGNIN_STATUS) {
-    size_t signed_in_count = manager->IsAuthenticated() ? 1 : 0;
-    UpdateInitialSigninStatus(1, signed_in_count);
-  }
-}
-
-void SigninStatusMetricsProvider::OnSigninManagerShutdown(
-    SigninManagerBase* manager) {
-  if (scoped_observer_.IsObserving(manager))
-    scoped_observer_.Remove(manager);
-}
-
-void SigninStatusMetricsProvider::GoogleSigninSucceeded(
-    const std::string& account_id,
-    const std::string& username,
-    const std::string& password) {
-  SigninStatus recorded_signin_status = signin_status();
-  if (recorded_signin_status == ALL_PROFILES_NOT_SIGNED_IN) {
-    UpdateSigninStatus(MIXED_SIGNIN_STATUS);
-  } else if (recorded_signin_status == UNKNOWN_SIGNIN_STATUS) {
-    // There should have at least one browser opened if the user can sign in, so
-    // signin_status_ value should not be unknown.
-    UpdateSigninStatus(ERROR_GETTING_SIGNIN_STATUS);
-    RecordComputeSigninStatusHistogram(USER_SIGNIN_WHEN_STATUS_UNKNOWN);
-  }
-}
-
-void SigninStatusMetricsProvider::GoogleSignedOut(const std::string& account_id,
-                                                  const std::string& username) {
-  SigninStatus recorded_signin_status = signin_status();
-  if (recorded_signin_status == ALL_PROFILES_SIGNED_IN) {
-    UpdateSigninStatus(MIXED_SIGNIN_STATUS);
-  } else if (recorded_signin_status == UNKNOWN_SIGNIN_STATUS) {
-    // There should have at least one browser opened if the user can sign out,
-    // so signin_status_ value should not be unknown.
-    UpdateSigninStatus(ERROR_GETTING_SIGNIN_STATUS);
-    RecordComputeSigninStatusHistogram(USER_SIGNOUT_WHEN_STATUS_UNKNOWN);
-  }
-}
-
-void SigninStatusMetricsProvider::Initialize() {
-  delegate_->Initialize();
-
-  // Start observing all already-created SigninManagers.
-  for (SigninManager* manager : delegate_->GetSigninManagersForAllAccounts()) {
-    DCHECK(!scoped_observer_.IsObserving(manager));
-    scoped_observer_.Add(manager);
-  }
-
-  // It is possible that when this object is created, no SigninManager is
-  // created yet, for example, when Chrome is opened for the first time after
-  // installation on desktop, or when Chrome on Android is loaded into memory.
-  if (delegate_->GetStatusOfAllAccounts().num_accounts == 0) {
-    UpdateSigninStatus(UNKNOWN_SIGNIN_STATUS);
-  } else {
-    ComputeCurrentSigninStatus();
-  }
-}
-
-void SigninStatusMetricsProvider::UpdateInitialSigninStatus(
-    size_t total_count,
-    size_t signed_in_profiles_count) {
-  // total_count is known to be bigger than 0.
-  if (signed_in_profiles_count == 0) {
-    UpdateSigninStatus(ALL_PROFILES_NOT_SIGNED_IN);
-  } else if (total_count == signed_in_profiles_count) {
-    UpdateSigninStatus(ALL_PROFILES_SIGNED_IN);
-  } else {
-    UpdateSigninStatus(MIXED_SIGNIN_STATUS);
-  }
-}
-
-void SigninStatusMetricsProvider::ComputeCurrentSigninStatus() {
-  RecordComputeSigninStatusHistogram(ENTERED_COMPUTE_SIGNIN_STATUS);
-
-  AccountsStatus accounts_status = delegate_->GetStatusOfAllAccounts();
-  if (accounts_status.num_accounts == 0) {
-    // This should not happen. If it does, record it in histogram.
-    RecordComputeSigninStatusHistogram(ERROR_NO_PROFILE_FOUND);
-    UpdateSigninStatus(ERROR_GETTING_SIGNIN_STATUS);
-  } else if (accounts_status.num_opened_accounts == 0) {
-    // The code indicates that Chrome is running in the background but no
-    // browser window is opened.
-    RecordComputeSigninStatusHistogram(NO_BROWSER_OPENED);
-    UpdateSigninStatus(UNKNOWN_SIGNIN_STATUS);
-  } else {
-    UpdateInitialSigninStatus(accounts_status.num_opened_accounts,
-                              accounts_status.num_signed_in_accounts);
-  }
-}
-
-void SigninStatusMetricsProvider::UpdateInitialSigninStatusForTesting(
-    size_t total_count,
-    size_t signed_in_profiles_count) {
-  UpdateInitialSigninStatus(total_count, signed_in_profiles_count);
-}
-
-SigninStatusMetricsProvider::SigninStatus
-SigninStatusMetricsProvider::GetSigninStatusForTesting() {
-  return signin_status();
-}
diff --git a/chrome/browser/metrics/signin_status_metrics_provider.h b/chrome/browser/metrics/signin_status_metrics_provider.h
deleted file mode 100644
index 8aff120..0000000
--- a/chrome/browser/metrics/signin_status_metrics_provider.h
+++ /dev/null
@@ -1,102 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef CHROME_BROWSER_METRICS_SIGNIN_STATUS_METRICS_PROVIDER_H_
-#define CHROME_BROWSER_METRICS_SIGNIN_STATUS_METRICS_PROVIDER_H_
-
-#include "base/gtest_prod_util.h"
-#include "base/memory/scoped_ptr.h"
-#include "base/memory/weak_ptr.h"
-#include "base/scoped_observer.h"
-#include "build/build_config.h"
-#include "chrome/browser/metrics/signin_status_metrics_provider_base.h"
-#include "chrome/browser/metrics/signin_status_metrics_provider_delegate.h"
-#include "components/signin/core/browser/signin_manager_base.h"
-
-namespace metrics {
-class ChromeUserMetricsExtension;
-}
-
-class SigninStatusMetricsProviderDelegate;
-
-// Collect login status of all opened profiles during one UMA session and
-// record the value into a histogram before UMA log is uploaded on platform
-// Windows, Linux, Mac and Android.
-class SigninStatusMetricsProvider : public SigninStatusMetricsProviderBase,
-                                    public SigninManagerBase::Observer {
- public:
-  ~SigninStatusMetricsProvider() override;
-
-  // SigninStatusMetricsProviderBase:
-  void ProvideGeneralMetrics(
-      metrics::ChromeUserMetricsExtension* uma_proto) override;
-
-  // Factory method, creates a new instance of this class.
-  static SigninStatusMetricsProvider* CreateInstance(
-      scoped_ptr<SigninStatusMetricsProviderDelegate> delegate);
-
-  // Update the sign-in status when a SigninManager is created.
-  void OnSigninManagerCreated(SigninManagerBase* manager);
-
-  // Update the sign-in status when a SigninManager is shut down.
-  void OnSigninManagerShutdown(SigninManagerBase* manager);
-
-  // Updates the initial sign-in status. For testing purpose only.
-  void UpdateInitialSigninStatusForTesting(size_t total_count,
-                                           size_t signed_in_count);
-
-  // Get the current recorded sign-in status. For testing purpose only.
-  SigninStatus GetSigninStatusForTesting();
-
- private:
-  FRIEND_TEST_ALL_PREFIXES(SigninStatusMetricsProviderTest,
-                           UpdateInitialSigninStatus);
-  FRIEND_TEST_ALL_PREFIXES(SigninStatusMetricsProviderTest,
-                           GoogleSigninSucceeded);
-  FRIEND_TEST_ALL_PREFIXES(SigninStatusMetricsProviderTest, GoogleSignedOut);
-
-  // The boolean |is_test| indicates whether or not this is an instance for
-  // testing purpose. If so, skip the initialization. Except for testing
-  // purpose, this class's instance should be created through the static
-  // CreateInstance() method.
-  SigninStatusMetricsProvider(
-      scoped_ptr<SigninStatusMetricsProviderDelegate> delegate,
-      bool is_test);
-
-  // SigninManagerBase::Observer:
-  void GoogleSigninSucceeded(const std::string& account_id,
-                             const std::string& username,
-                             const std::string& password) override;
-  void GoogleSignedOut(const std::string& account_id,
-                       const std::string& username) override;
-
-  // Obtain sign-in status and add observers.
-  void Initialize();
-
-  // Update the sign-in status based on all currently opened profiles. Called by
-  // ComputeCurrentSigninStatus at class construction and right after each UMA
-  // log upload. |total_count| is the number of opened profiles and
-  // |signed_in_count| represents the number of signed-in profiles among those
-  // |total_count| profiles.
-  void UpdateInitialSigninStatus(size_t total_count, size_t signed_in_count);
-
-  // Compute current sign-in status of all opened profiles.
-  void ComputeCurrentSigninStatus();
-
-  scoped_ptr<SigninStatusMetricsProviderDelegate> delegate_;
-
-  // Used to track the SigninManagers that this instance is observing so that
-  // this instance can be removed as an observer on its destruction.
-  ScopedObserver<SigninManagerBase, SigninManagerBase::Observer>
-      scoped_observer_;
-
-  // Whether the instance is for testing or not.
-  bool is_test_;
-
-  base::WeakPtrFactory<SigninStatusMetricsProvider> weak_ptr_factory_;
-
-  DISALLOW_COPY_AND_ASSIGN(SigninStatusMetricsProvider);
-};
-
-#endif  // CHROME_BROWSER_METRICS_SIGNIN_STATUS_METRICS_PROVIDER_H_
diff --git a/chrome/browser/metrics/signin_status_metrics_provider_base.cc b/chrome/browser/metrics/signin_status_metrics_provider_base.cc
deleted file mode 100644
index 69c103ba..0000000
--- a/chrome/browser/metrics/signin_status_metrics_provider_base.cc
+++ /dev/null
@@ -1,31 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "chrome/browser/metrics/signin_status_metrics_provider_base.h"
-
-#include "base/metrics/histogram.h"
-
-SigninStatusMetricsProviderBase::SigninStatusMetricsProviderBase()
-    : signin_status_(UNKNOWN_SIGNIN_STATUS) {}
-
-SigninStatusMetricsProviderBase::~SigninStatusMetricsProviderBase() {}
-
-void SigninStatusMetricsProviderBase::RecordSigninStatusHistogram(
-    SigninStatus signin_status) {
-  UMA_HISTOGRAM_ENUMERATION("UMA.ProfileSignInStatus", signin_status,
-                            SIGNIN_STATUS_MAX);
-}
-
-void SigninStatusMetricsProviderBase::UpdateSigninStatus(
-    SigninStatus new_status) {
-  // The recorded sign-in status value can't be changed once it's recorded as
-  // error until the next UMA upload.
-  if (signin_status_ == ERROR_GETTING_SIGNIN_STATUS)
-    return;
-  signin_status_ = new_status;
-}
-
-void SigninStatusMetricsProviderBase::ResetSigninStatus() {
-  signin_status_ = UNKNOWN_SIGNIN_STATUS;
-}
diff --git a/chrome/browser/metrics/signin_status_metrics_provider_base.h b/chrome/browser/metrics/signin_status_metrics_provider_base.h
deleted file mode 100644
index 36f1dc8..0000000
--- a/chrome/browser/metrics/signin_status_metrics_provider_base.h
+++ /dev/null
@@ -1,56 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef CHROME_BROWSER_METRICS_SIGNIN_STATUS_METRICS_PROVIDER_BASE_H_
-#define CHROME_BROWSER_METRICS_SIGNIN_STATUS_METRICS_PROVIDER_BASE_H_
-
-#include "components/metrics/metrics_provider.h"
-
-// The base class for collecting login status of all opened profiles during one
-// UMA session and recording the value into a histogram before UMA log is
-// uploaded. Overriding class SigninStatusMetricsProvider supports platform
-// Window, Linux, Macintosh and Android, and overriding class
-// SigninStatusMetricsProviderChromeOS supports ChromeOS. It is currently not
-// supported on iOS.
-class SigninStatusMetricsProviderBase : public metrics::MetricsProvider {
- public:
-  SigninStatusMetricsProviderBase();
-  ~SigninStatusMetricsProviderBase() override;
-
-  // Possible sign-in status of all opened profiles during one UMA session. For
-  // MIXED_SIGNIN_STATUS, at least one signed-in profile and at least one
-  // unsigned-in profile were opened between two UMA log uploads. Not every
-  // possibilities can be applied to each platform.
-  enum SigninStatus {
-    ALL_PROFILES_SIGNED_IN,
-    ALL_PROFILES_NOT_SIGNED_IN,
-    MIXED_SIGNIN_STATUS,
-    UNKNOWN_SIGNIN_STATUS,
-    ERROR_GETTING_SIGNIN_STATUS,
-    SIGNIN_STATUS_MAX,
-  };
-
-  // Sets the value of |signin_status_|. It ensures that |signin_status_| will
-  // not be changed if its value is already ERROR_GETTING_SIGNIN_STATUS.
-  void UpdateSigninStatus(SigninStatus new_status);
-
-  SigninStatus signin_status() const { return signin_status_; }
-
- protected:
-  // Record the sign in status into the proper histogram bucket. This should be
-  // called exactly once for each UMA session.
-  void RecordSigninStatusHistogram(SigninStatus signin_status);
-
-  // Resets the value of |signin_status_| to be UNKNOWN_SIGNIN_STATUS regardless
-  // of its current value;
-  void ResetSigninStatus();
-
- private:
-  // Sign-in status of all profiles seen so far.
-  SigninStatus signin_status_;
-
-  DISALLOW_COPY_AND_ASSIGN(SigninStatusMetricsProviderBase);
-};
-
-#endif  // CHROME_BROWSER_METRICS_SIGNIN_STATUS_METRICS_PROVIDER_BASE_H_
diff --git a/chrome/browser/metrics/signin_status_metrics_provider_chromeos.cc b/chrome/browser/metrics/signin_status_metrics_provider_chromeos.cc
deleted file mode 100644
index 4eb0c79..0000000
--- a/chrome/browser/metrics/signin_status_metrics_provider_chromeos.cc
+++ /dev/null
@@ -1,70 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "chrome/browser/metrics/signin_status_metrics_provider_chromeos.h"
-
-#include "chrome/browser/browser_process.h"
-#include "chrome/browser/profiles/profile_manager.h"
-#include "chromeos/login/login_state.h"
-
-namespace {
-
-// Returns true if user is signed in to a non-guest profile.
-bool IsSignedInNonGuest() {
-  ProfileManager* profile_manager = g_browser_process->profile_manager();
-  if (profile_manager &&
-      profile_manager->IsLoggedIn() &&
-      chromeos::LoginState::Get() &&
-      !chromeos::LoginState::Get()->IsGuestSessionUser()) {
-    return true;
-  }
-  return false;
-}
-
-} // namespace
-
-SigninStatusMetricsProviderChromeOS::SigninStatusMetricsProviderChromeOS() {
-  SetCurrentSigninStatus();
-}
-
-SigninStatusMetricsProviderChromeOS::~SigninStatusMetricsProviderChromeOS() {
-}
-
-void SigninStatusMetricsProviderChromeOS::ProvideGeneralMetrics(
-    metrics::ChromeUserMetricsExtension* uma_proto) {
-  // Compare the current logged-in status with the recorded one and compute
-  // sign-in status that should be reported.
-  RecordSigninStatusHistogram(ComputeSigninStatusToUpload(
-      signin_status(), IsSignedInNonGuest()));
-  // After reporting the sign-in status for previous UMA session, start fresh
-  // again regardless what was the status before.
-  ResetSigninStatus();
-  SetCurrentSigninStatus();
-}
-
-void SigninStatusMetricsProviderChromeOS::SetCurrentSigninStatus() {
-  if (IsSignedInNonGuest())
-    UpdateSigninStatus(ALL_PROFILES_SIGNED_IN);
-  UpdateSigninStatus(ALL_PROFILES_NOT_SIGNED_IN);
-}
-
-SigninStatusMetricsProviderBase::SigninStatus
-SigninStatusMetricsProviderChromeOS::ComputeSigninStatusToUpload(
-    SigninStatusMetricsProviderBase::SigninStatus recorded_status,
-    bool logged_in_now) {
-  if ((recorded_status == ALL_PROFILES_SIGNED_IN && logged_in_now) ||
-      (recorded_status == ALL_PROFILES_NOT_SIGNED_IN && !logged_in_now)) {
-    // If the status hasn't changed since we last recorded, report as it is.
-    return recorded_status;
-  } else if (recorded_status == ALL_PROFILES_NOT_SIGNED_IN && logged_in_now) {
-    // It possible that the browser goes from not signed-in to signed-in (i.e.
-    // user performed a login action through the login manager.)
-    return MIXED_SIGNIN_STATUS;
-  } else {
-    // There should not be other possibilities, for example the browser on
-    // ChromeOS can not go from signed-in to not signed-in. Record it as an
-    // error.
-    return ERROR_GETTING_SIGNIN_STATUS;
-  }
-}
diff --git a/chrome/browser/metrics/signin_status_metrics_provider_chromeos.h b/chrome/browser/metrics/signin_status_metrics_provider_chromeos.h
deleted file mode 100644
index bb843a1..0000000
--- a/chrome/browser/metrics/signin_status_metrics_provider_chromeos.h
+++ /dev/null
@@ -1,43 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef CHROME_BROWSER_METRICS_SIGNIN_STATUS_METRICS_PROVIDER_CHROMEOS_H_
-#define CHROME_BROWSER_METRICS_SIGNIN_STATUS_METRICS_PROVIDER_CHROMEOS_H_
-
-#include "base/gtest_prod_util.h"
-#include "chrome/browser/metrics/signin_status_metrics_provider_base.h"
-
-// Record and report the browser sign-in status on ChromeOS during each UMA
-// session. On ChromeOS, the browser can only be at unsigned-in status when
-// browsing as a guest, or before the user logs in (i.e. the user sees a login
-// window.) When user logs out, the browser process is terminated. Therefore,
-// the browser's sign-in status during one UMA session can only be alway
-// signed-in, or always unsigned-in, or changing from unsigned-in to signed-in.
-class SigninStatusMetricsProviderChromeOS
-    : public SigninStatusMetricsProviderBase {
- public:
-  SigninStatusMetricsProviderChromeOS();
-  ~SigninStatusMetricsProviderChromeOS() override;
-
-  // SigninStatusMetricsProviderBase:
-  void ProvideGeneralMetrics(
-      metrics::ChromeUserMetricsExtension* uma_proto) override;
-
- private:
-  FRIEND_TEST_ALL_PREFIXES(SigninStatusMetricsProviderChromeOS,
-                           ComputeSigninStatusToUpload);
-
-  // Sets the |signin_status_| purely based on if the user is currently logged
-  // in to a non-guest profile.
-  void SetCurrentSigninStatus();
-
-  // Compute the sign-in status to upload to UMA log given the recorded sign-in
-  // status and if user is logged in now.
-  SigninStatus ComputeSigninStatusToUpload(SigninStatus recorded_status,
-                                           bool logged_in_now);
-
-  DISALLOW_COPY_AND_ASSIGN(SigninStatusMetricsProviderChromeOS);
-};
-
-#endif  // CHROME_BROWSER_METRICS_SIGNIN_STATUS_METRICS_PROVIDER_CHROMEOS_H_
diff --git a/chrome/browser/metrics/signin_status_metrics_provider_chromeos_unittest.cc b/chrome/browser/metrics/signin_status_metrics_provider_chromeos_unittest.cc
deleted file mode 100644
index 2448169a..0000000
--- a/chrome/browser/metrics/signin_status_metrics_provider_chromeos_unittest.cc
+++ /dev/null
@@ -1,36 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "chrome/browser/metrics/signin_status_metrics_provider_chromeos.h"
-
-#include <string>
-
-#include "base/files/file_path.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-TEST(SigninStatusMetricsProviderChromeOS, ComputeSigninStatusToUpload) {
-  SigninStatusMetricsProviderChromeOS metrics_provider =
-      SigninStatusMetricsProviderChromeOS();
-
-  SigninStatusMetricsProviderBase::SigninStatus status_to_upload =
-      metrics_provider.ComputeSigninStatusToUpload(
-          SigninStatusMetricsProviderBase::ALL_PROFILES_SIGNED_IN, true);
-  EXPECT_EQ(SigninStatusMetricsProviderBase::ALL_PROFILES_SIGNED_IN,
-            status_to_upload);
-
-  status_to_upload = metrics_provider.ComputeSigninStatusToUpload(
-      SigninStatusMetricsProviderBase::ALL_PROFILES_NOT_SIGNED_IN, false);
-  EXPECT_EQ(SigninStatusMetricsProviderBase::ALL_PROFILES_NOT_SIGNED_IN,
-            status_to_upload);
-
-  status_to_upload = metrics_provider.ComputeSigninStatusToUpload(
-      SigninStatusMetricsProviderBase::ALL_PROFILES_NOT_SIGNED_IN, true);
-  EXPECT_EQ(SigninStatusMetricsProviderBase::MIXED_SIGNIN_STATUS,
-            status_to_upload);
-
-  status_to_upload = metrics_provider.ComputeSigninStatusToUpload(
-      SigninStatusMetricsProviderBase::ALL_PROFILES_SIGNED_IN, false);
-  EXPECT_EQ(SigninStatusMetricsProviderBase::ERROR_GETTING_SIGNIN_STATUS,
-            status_to_upload);
-}
diff --git a/chrome/browser/metrics/signin_status_metrics_provider_delegate.cc b/chrome/browser/metrics/signin_status_metrics_provider_delegate.cc
deleted file mode 100644
index 2f439cb..0000000
--- a/chrome/browser/metrics/signin_status_metrics_provider_delegate.cc
+++ /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.
-
-#include "chrome/browser/metrics/signin_status_metrics_provider_delegate.h"
-
-#include "base/logging.h"
-#include "chrome/browser/metrics/signin_status_metrics_provider.h"
-
-AccountsStatus::AccountsStatus()
-    : num_accounts(0), num_opened_accounts(0), num_signed_in_accounts(0) {}
-
-SigninStatusMetricsProviderDelegate::SigninStatusMetricsProviderDelegate()
-    : owner_(nullptr) {}
-
-SigninStatusMetricsProviderDelegate::~SigninStatusMetricsProviderDelegate() {}
-
-void SigninStatusMetricsProviderDelegate::SetOwner(
-    SigninStatusMetricsProvider* owner) {
-  DCHECK(owner);
-  DCHECK(!owner_);
-  owner_ = owner;
-}
diff --git a/chrome/browser/metrics/signin_status_metrics_provider_delegate.h b/chrome/browser/metrics/signin_status_metrics_provider_delegate.h
deleted file mode 100644
index 02e520d..0000000
--- a/chrome/browser/metrics/signin_status_metrics_provider_delegate.h
+++ /dev/null
@@ -1,57 +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 CHROME_BROWSER_METRICS_SIGNIN_STATUS_METRICS_PROVIDER_DELEGATE_H_
-#define CHROME_BROWSER_METRICS_SIGNIN_STATUS_METRICS_PROVIDER_DELEGATE_H_
-
-#include <vector>
-
-#include "base/macros.h"
-#include "build/build_config.h"
-
-class SigninManager;
-class SigninStatusMetricsProvider;
-
-// Provides information relating to the status of accounts in the embedder: how
-// many there are, how many are open, and how many are signed in. Note that
-// "open" is an embedder-defined concept; in some embedders, all accounts are
-// open.
-struct AccountsStatus {
-  AccountsStatus();
-
-  size_t num_accounts;
-  size_t num_opened_accounts;
-  size_t num_signed_in_accounts;
-};
-
-// Delegate for SigninStatusMetricsProvider to abstract dependencies on
-// embedder.
-class SigninStatusMetricsProviderDelegate {
- public:
-  SigninStatusMetricsProviderDelegate();
-  virtual ~SigninStatusMetricsProviderDelegate();
-
-  // Set the |owner_| field to the owning SigninStatusMetricsProvider.
-  void SetOwner(SigninStatusMetricsProvider* owner);
-
-  // Initializes the instance. SetOwner() must have been called before this
-  // method.
-  virtual void Initialize() = 0;
-
-  // Returns the status of all accounts.
-  virtual AccountsStatus GetStatusOfAllAccounts() = 0;
-
-  // Returns the SigninManager instance (if any) associated with each account.
-  virtual std::vector<SigninManager*> GetSigninManagersForAllAccounts() = 0;
-
- protected:
-  SigninStatusMetricsProvider* owner() { return owner_; }
-
- private:
-  SigninStatusMetricsProvider* owner_;
-
-  DISALLOW_COPY_AND_ASSIGN(SigninStatusMetricsProviderDelegate);
-};
-
-#endif  // CHROME_BROWSER_METRICS_SIGNIN_STATUS_METRICS_PROVIDER_DELEGATE_H_
diff --git a/chrome/browser/metrics/signin_status_metrics_provider_unittest.cc b/chrome/browser/metrics/signin_status_metrics_provider_unittest.cc
deleted file mode 100644
index 2d803a33..0000000
--- a/chrome/browser/metrics/signin_status_metrics_provider_unittest.cc
+++ /dev/null
@@ -1,57 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "chrome/browser/metrics/signin_status_metrics_provider.h"
-
-#include <string>
-
-#include "testing/gtest/include/gtest/gtest.h"
-
-TEST(SigninStatusMetricsProviderTest, UpdateInitialSigninStatus) {
-  SigninStatusMetricsProvider metrics_provider(nullptr, true);
-
-  metrics_provider.UpdateInitialSigninStatus(2, 2);
-  EXPECT_EQ(SigninStatusMetricsProviderBase::ALL_PROFILES_SIGNED_IN,
-            metrics_provider.GetSigninStatusForTesting());
-  metrics_provider.UpdateInitialSigninStatus(2, 0);
-  EXPECT_EQ(SigninStatusMetricsProviderBase::ALL_PROFILES_NOT_SIGNED_IN,
-            metrics_provider.GetSigninStatusForTesting());
-  metrics_provider.UpdateInitialSigninStatus(2, 1);
-  EXPECT_EQ(SigninStatusMetricsProviderBase::MIXED_SIGNIN_STATUS,
-            metrics_provider.GetSigninStatusForTesting());
-}
-
-TEST(SigninStatusMetricsProviderTest, GoogleSigninSucceeded) {
-  SigninStatusMetricsProvider metrics_provider(nullptr, true);
-
-  // Initial status is all signed out and then one of the profiles is signed in.
-  metrics_provider.UpdateInitialSigninStatus(2, 0);
-  metrics_provider.GoogleSigninSucceeded(std::string(), std::string(),
-                                         std::string());
-  EXPECT_EQ(SigninStatusMetricsProviderBase::MIXED_SIGNIN_STATUS,
-            metrics_provider.GetSigninStatusForTesting());
-
-  // Initial status is mixed and then one of the profiles is signed in.
-  metrics_provider.UpdateInitialSigninStatus(2, 1);
-  metrics_provider.GoogleSigninSucceeded(std::string(), std::string(),
-                                         std::string());
-  EXPECT_EQ(SigninStatusMetricsProviderBase::MIXED_SIGNIN_STATUS,
-            metrics_provider.GetSigninStatusForTesting());
-}
-
-TEST(SigninStatusMetricsProviderTest, GoogleSignedOut) {
-  SigninStatusMetricsProvider metrics_provider(nullptr, true);
-
-  // Initial status is all signed in and then one of the profiles is signed out.
-  metrics_provider.UpdateInitialSigninStatus(2, 2);
-  metrics_provider.GoogleSignedOut(std::string(), std::string());
-  EXPECT_EQ(SigninStatusMetricsProviderBase::MIXED_SIGNIN_STATUS,
-            metrics_provider.GetSigninStatusForTesting());
-
-  // Initial status is mixed and then one of the profiles is signed out.
-  metrics_provider.UpdateInitialSigninStatus(2, 1);
-  metrics_provider.GoogleSignedOut(std::string(), std::string());
-  EXPECT_EQ(SigninStatusMetricsProviderBase::MIXED_SIGNIN_STATUS,
-            metrics_provider.GetSigninStatusForTesting());
-}
diff --git a/chrome/browser/password_manager/chrome_password_manager_client.cc b/chrome/browser/password_manager/chrome_password_manager_client.cc
index da2db8e..d89309e 100644
--- a/chrome/browser/password_manager/chrome_password_manager_client.cc
+++ b/chrome/browser/password_manager/chrome_password_manager_client.cc
@@ -289,11 +289,12 @@
 }
 
 void ChromePasswordManagerClient::PasswordWasAutofilled(
-    const autofill::PasswordFormMap& best_matches) const {
+    const autofill::PasswordFormMap& best_matches,
+    const GURL& origin) const {
   ManagePasswordsUIController* manage_passwords_ui_controller =
       ManagePasswordsUIController::FromWebContents(web_contents());
   if (manage_passwords_ui_controller && IsTheHotNewBubbleUIEnabled())
-    manage_passwords_ui_controller->OnPasswordAutofilled(best_matches);
+    manage_passwords_ui_controller->OnPasswordAutofilled(best_matches, origin);
 }
 
 void ChromePasswordManagerClient::PasswordAutofillWasBlocked(
diff --git a/chrome/browser/password_manager/chrome_password_manager_client.h b/chrome/browser/password_manager/chrome_password_manager_client.h
index 93d5a1d..97fc901 100644
--- a/chrome/browser/password_manager/chrome_password_manager_client.h
+++ b/chrome/browser/password_manager/chrome_password_manager_client.h
@@ -63,8 +63,8 @@
       ScopedVector<autofill::PasswordForm> local_forms) override;
   void AutomaticPasswordSave(scoped_ptr<password_manager::PasswordFormManager>
                                  saved_form_manager) override;
-  void PasswordWasAutofilled(
-      const autofill::PasswordFormMap& best_matches) const override;
+  void PasswordWasAutofilled(const autofill::PasswordFormMap& best_matches,
+                             const GURL& origin) const override;
   void PasswordAutofillWasBlocked(
       const autofill::PasswordFormMap& best_matches) const override;
   PrefService* GetPrefs() override;
diff --git a/chrome/browser/platform_util_mac.mm b/chrome/browser/platform_util_mac.mm
index e156ad0..507b23b 100644
--- a/chrome/browser/platform_util_mac.mm
+++ b/chrome/browser/platform_util_mac.mm
@@ -27,7 +27,7 @@
   DCHECK([NSThread isMainThread]);
   NSString* path_string = base::SysUTF8ToNSString(full_path.value());
   if (!path_string || ![[NSWorkspace sharedWorkspace] selectFile:path_string
-                                        inFileViewerRootedAtPath:nil])
+                                        inFileViewerRootedAtPath:@""])
     LOG(WARNING) << "NSWorkspace failed to select file " << full_path.value();
 }
 
diff --git a/chrome/browser/profiles/off_the_record_profile_io_data.cc b/chrome/browser/profiles/off_the_record_profile_io_data.cc
index b7609d7..c0f8e5c57 100644
--- a/chrome/browser/profiles/off_the_record_profile_io_data.cc
+++ b/chrome/browser/profiles/off_the_record_profile_io_data.cc
@@ -249,7 +249,9 @@
 
   net::HttpCache::BackendFactory* main_backend =
       net::HttpCache::DefaultBackend::InMemory(0);
-  main_http_factory_ = CreateMainHttpFactory(profile_params, main_backend);
+  http_network_session_ = CreateHttpNetworkSession(*profile_params);
+  main_http_factory_ = CreateMainHttpFactory(http_network_session_.get(),
+                                             main_backend);
 
   main_context->set_http_transaction_factory(main_http_factory_.get());
 #if !defined(DISABLE_FTP_SUPPORT)
@@ -347,10 +349,8 @@
   // Use a separate in-memory cache for the app.
   net::HttpCache::BackendFactory* app_backend =
       net::HttpCache::DefaultBackend::InMemory(0);
-  net::HttpNetworkSession* main_network_session =
-      main_http_factory_->GetSession();
   scoped_ptr<net::HttpCache> app_http_cache =
-      CreateHttpFactory(main_network_session, app_backend);
+      CreateHttpFactory(http_network_session_.get(), app_backend);
 
   context->SetHttpTransactionFactory(app_http_cache.Pass());
 
diff --git a/chrome/browser/profiles/off_the_record_profile_io_data.h b/chrome/browser/profiles/off_the_record_profile_io_data.h
index f1cd12e..ae229bd 100644
--- a/chrome/browser/profiles/off_the_record_profile_io_data.h
+++ b/chrome/browser/profiles/off_the_record_profile_io_data.h
@@ -20,6 +20,7 @@
 
 namespace net {
 class FtpTransactionFactory;
+class HttpNetworkSession;
 class HttpTransactionFactory;
 class SdchManager;
 class SdchOwner;
@@ -144,6 +145,7 @@
 
   mutable scoped_ptr<ChromeNetworkDelegate> network_delegate_;
 
+  mutable scoped_ptr<net::HttpNetworkSession> http_network_session_;
   mutable scoped_ptr<net::HttpTransactionFactory> main_http_factory_;
   mutable scoped_ptr<net::FtpTransactionFactory> ftp_factory_;
 
diff --git a/chrome/browser/profiles/profile_impl_io_data.cc b/chrome/browser/profiles/profile_impl_io_data.cc
index 0f389fc..0ad1af73 100644
--- a/chrome/browser/profiles/profile_impl_io_data.cc
+++ b/chrome/browser/profiles/profile_impl_io_data.cc
@@ -57,6 +57,7 @@
 #include "net/base/sdch_manager.h"
 #include "net/ftp/ftp_network_layer.h"
 #include "net/http/http_cache.h"
+#include "net/http/http_network_session.h"
 #include "net/http/http_server_properties_manager.h"
 #include "net/sdch/sdch_owner.h"
 #include "net/ssl/channel_id_service.h"
@@ -537,22 +538,22 @@
   set_channel_id_service(channel_id_service);
   main_context->set_channel_id_service(channel_id_service);
 
-  scoped_ptr<net::HttpCache> main_cache;
   {
     // TODO(ttuttle): Remove ScopedTracker below once crbug.com/436671 is fixed.
     tracked_objects::ScopedTracker tracking_profile(
         FROM_HERE_WITH_EXPLICIT_FUNCTION("436671 HttpCache construction"));
-    net::HttpCache::DefaultBackend* main_backend =
+    net::HttpCache::BackendFactory* main_backend(
         new net::HttpCache::DefaultBackend(
             net::DISK_CACHE,
             ChooseCacheBackendType(),
             lazy_params_->cache_path,
             lazy_params_->cache_max_size,
-            BrowserThread::GetMessageLoopProxyForThread(BrowserThread::CACHE));
-    main_cache = CreateMainHttpFactory(profile_params, main_backend);
+            BrowserThread::GetMessageLoopProxyForThread(BrowserThread::CACHE)));
+    http_network_session_ = CreateHttpNetworkSession(*profile_params);
+    main_http_factory_ = CreateMainHttpFactory(http_network_session_.get(),
+                                               main_backend);
   }
 
-  main_http_factory_.reset(main_cache.release());
   main_context->set_http_transaction_factory(main_http_factory_.get());
 
 #if !defined(DISABLE_FTP_SUPPORT)
@@ -663,7 +664,7 @@
       partition_descriptor.path.Append(chrome::kCacheDirname);
 
   // Use a separate HTTP disk cache for isolated apps.
-  net::HttpCache::BackendFactory* app_backend = NULL;
+  net::HttpCache::BackendFactory* app_backend;
   if (partition_descriptor.in_memory) {
     app_backend = net::HttpCache::DefaultBackend::InMemory(0);
   } else {
@@ -674,10 +675,8 @@
         app_cache_max_size_,
         BrowserThread::GetMessageLoopProxyForThread(BrowserThread::CACHE));
   }
-  net::HttpNetworkSession* main_network_session =
-      main_http_factory_->GetSession();
   scoped_ptr<net::HttpCache> app_http_cache =
-      CreateHttpFactory(main_network_session, app_backend);
+      CreateHttpFactory(http_network_session_.get(), app_backend);
 
   scoped_refptr<net::CookieStore> cookie_store = NULL;
   if (partition_descriptor.in_memory) {
@@ -757,10 +756,8 @@
           cache_path,
           cache_max_size,
           BrowserThread::GetMessageLoopProxyForThread(BrowserThread::CACHE));
-  net::HttpNetworkSession* main_network_session =
-      main_http_factory_->GetSession();
   scoped_ptr<net::HttpCache> media_http_cache =
-      CreateHttpFactory(main_network_session, media_backend);
+      CreateHttpFactory(http_network_session_.get(), media_backend);
 
   // Transfer ownership of the cache to MediaRequestContext.
   context->SetHttpTransactionFactory(media_http_cache.Pass());
diff --git a/chrome/browser/profiles/profile_impl_io_data.h b/chrome/browser/profiles/profile_impl_io_data.h
index 214ec74..e8046fc 100644
--- a/chrome/browser/profiles/profile_impl_io_data.h
+++ b/chrome/browser/profiles/profile_impl_io_data.h
@@ -32,6 +32,7 @@
 namespace net {
 class CookieCryptoDelegate;
 class FtpTransactionFactory;
+class HttpNetworkSession;
 class HttpServerProperties;
 class HttpServerPropertiesManager;
 class HttpTransactionFactory;
@@ -215,6 +216,7 @@
 
   mutable scoped_refptr<JsonPrefStore> network_json_store_;
 
+  mutable scoped_ptr<net::HttpNetworkSession> http_network_session_;
   mutable scoped_ptr<net::HttpTransactionFactory> main_http_factory_;
   mutable scoped_ptr<net::FtpTransactionFactory> ftp_factory_;
 
diff --git a/chrome/browser/profiles/profile_io_data.cc b/chrome/browser/profiles/profile_io_data.cc
index 9150d985..52d9bc1 100644
--- a/chrome/browser/profiles/profile_io_data.cc
+++ b/chrome/browser/profiles/profile_io_data.cc
@@ -69,6 +69,7 @@
 #include "net/base/network_quality_estimator.h"
 #include "net/cert/cert_verifier.h"
 #include "net/cookies/canonical_cookie.h"
+#include "net/http/http_network_session.h"
 #include "net/http/http_transaction_factory.h"
 #include "net/http/http_util.h"
 #include "net/http/transport_security_persister.h"
@@ -1068,8 +1069,8 @@
   network_delegate->set_enable_do_not_track(&enable_do_not_track_);
   network_delegate->set_force_google_safe_search(&force_google_safesearch_);
   network_delegate->set_force_youtube_safety_mode(&force_youtube_safety_mode_);
-  network_delegate->set_data_use_aggregator(
-      io_thread_globals->data_use_aggregator.get(), IsOffTheRecord());
+  network_delegate->set_data_use_aggregator(io_thread->data_use_aggregator(),
+                                            IsOffTheRecord());
 
   // NOTE: Proxy service uses the default io thread network delegate, not the
   // delegate just created.
@@ -1304,13 +1305,12 @@
   resource_context_.reset();
 }
 
-scoped_ptr<net::HttpCache> ProfileIOData::CreateMainHttpFactory(
-    const ProfileParams* profile_params,
-    net::HttpCache::BackendFactory* main_backend) const {
+scoped_ptr<net::HttpNetworkSession> ProfileIOData::CreateHttpNetworkSession(
+    const ProfileParams& profile_params) const {
   net::HttpNetworkSession::Params params;
   net::URLRequestContext* context = main_request_context();
 
-  IOThread* const io_thread = profile_params->io_thread;
+  IOThread* const io_thread = profile_params.io_thread;
 
   io_thread->InitializeNetworkSessionParams(&params);
   net::URLRequestContextBuilder::SetHttpNetworkSessionComponents(context,
@@ -1324,11 +1324,19 @@
   if (data_reduction_proxy_io_data_.get())
     params.proxy_delegate = data_reduction_proxy_io_data_->proxy_delegate();
 
-  net::HttpNetworkSession* session = new net::HttpNetworkSession(params);
+  return scoped_ptr<net::HttpNetworkSession>(
+      new net::HttpNetworkSession(params));
+}
+
+scoped_ptr<net::HttpCache> ProfileIOData::CreateMainHttpFactory(
+    net::HttpNetworkSession* session,
+    net::HttpCache::BackendFactory* main_backend) const {
+  net::URLRequestContext* context = main_request_context();
   return scoped_ptr<net::HttpCache>(new net::HttpCache(
       new DevToolsNetworkTransactionFactory(
           network_controller_handle_.GetController(), session),
-      context->net_log(), main_backend));
+      context->net_log(), main_backend,
+      true /* set_up_quic_server_info */));
 }
 
 scoped_ptr<net::HttpCache> ProfileIOData::CreateHttpFactory(
@@ -1337,7 +1345,8 @@
   return scoped_ptr<net::HttpCache>(new net::HttpCache(
       new DevToolsNetworkTransactionFactory(
           network_controller_handle_.GetController(), shared_session),
-      shared_session->net_log(), backend));
+      shared_session->net_log(), backend,
+      true /* set_up_quic_server_info */));
 }
 
 void ProfileIOData::SetCookieSettingsForTesting(
diff --git a/chrome/browser/profiles/profile_io_data.h b/chrome/browser/profiles/profile_io_data.h
index 9b94833e..ea807b0 100644
--- a/chrome/browser/profiles/profile_io_data.h
+++ b/chrome/browser/profiles/profile_io_data.h
@@ -383,9 +383,12 @@
   // URLRequests may be accessing.
   void DestroyResourceContext();
 
-  // Creates network session and main network transaction factory.
+  scoped_ptr<net::HttpNetworkSession> CreateHttpNetworkSession(
+      const ProfileParams& profile_params) const;
+
+  // Creates main network transaction factory.
   scoped_ptr<net::HttpCache> CreateMainHttpFactory(
-      const ProfileParams* profile_params,
+      net::HttpNetworkSession* session,
       net::HttpCache::BackendFactory* main_backend) const;
 
   // Creates network transaction factory.
diff --git a/chrome/browser/profiles/profile_window.cc b/chrome/browser/profiles/profile_window.cc
index 3cd7828..a5ffc71 100644
--- a/chrome/browser/profiles/profile_window.cc
+++ b/chrome/browser/profiles/profile_window.cc
@@ -94,7 +94,12 @@
   void OnBrowserAdded(Browser* browser) override {
     if (browser->profile() == profile_) {
       BrowserList::RemoveObserver(this);
-      callback_.Run(profile_, Profile::CREATE_STATUS_INITIALIZED);
+      // By the time the browser is added a tab (or multiple) are about to be
+      // added. Post the callback to the message loop so it gets executed after
+      // the tabs are created.
+      base::MessageLoop::current()->PostTask(
+          FROM_HERE,
+          base::Bind(callback_, profile_, Profile::CREATE_STATUS_INITIALIZED));
       base::MessageLoop::current()->DeleteSoon(FROM_HERE, this);
     }
   }
diff --git a/chrome/browser/renderer_context_menu/render_view_context_menu.cc b/chrome/browser/renderer_context_menu/render_view_context_menu.cc
index 58c3860..cf6bdd76 100644
--- a/chrome/browser/renderer_context_menu/render_view_context_menu.cc
+++ b/chrome/browser/renderer_context_menu/render_view_context_menu.cc
@@ -183,7 +183,7 @@
     {4, 15, IDC_CONTENT_CONTEXT_OPENLINKNEWWINDOW},
     {5, 1, IDC_CONTENT_CONTEXT_OPENLINKOFFTHERECORD},
     {6, 5, IDC_CONTENT_CONTEXT_SAVELINKAS},
-    {7, 17, IDC_CONTENT_CONTEXT_SAVEAVAS},
+    {7, 18, IDC_CONTENT_CONTEXT_SAVEAVAS},
     {8, 6, IDC_CONTENT_CONTEXT_SAVEIMAGEAS},
     {9, 2, IDC_CONTENT_CONTEXT_COPYLINKLOCATION},
     {10, 10, IDC_CONTENT_CONTEXT_COPYIMAGELOCATION},
@@ -1153,6 +1153,10 @@
 
     case IDC_VIEW_SOURCE:
     case IDC_CONTENT_CONTEXT_VIEWFRAMESOURCE:
+      if (!!extensions::MimeHandlerViewGuest::FromWebContents(
+              source_web_contents_)) {
+        return false;
+      }
       return (params_.media_type != WebContextMenuData::MediaTypePlugin) &&
              embedder_web_contents_->GetController().CanViewSource();
 
diff --git a/chrome/browser/resources/about_version.html b/chrome/browser/resources/about_version.html
index 8e4bfbe1..238bd26c 100644
--- a/chrome/browser/resources/about_version.html
+++ b/chrome/browser/resources/about_version.html
@@ -101,6 +101,12 @@
           <td class="version" i18n-content="build_id"></td>
         </tr>
 </if>
+<if expr="is_win">
+        <tr id="compiler-section">
+          <td class="label">Compiler</td>
+          <td class="version" id="compiler" i18n-content="compiler"></td>
+        </tr>
+</if>
       </table>
     </div>
     <script src="chrome://resources/js/i18n_template.js"></script>
diff --git a/chrome/browser/resources/chromeos/chromevox/cvox2/background/background.js b/chrome/browser/resources/chromeos/chromevox/cvox2/background/background.js
index aaf20bdd..0a32096 100644
--- a/chrome/browser/resources/chromeos/chromevox/cvox2/background/background.js
+++ b/chrome/browser/resources/chromeos/chromevox/cvox2/background/background.js
@@ -503,7 +503,7 @@
       node = node.find({state: {focused: true}}) || node;
     }
 
-    if (evt.target.role == RoleType.textField)
+    if (evt.target.state.editable)
       this.createEditableTextHandlerIfNeeded_(evt.target);
 
     this.onEventDefault({target: node, type: 'focus'});
@@ -555,6 +555,9 @@
    * @param {Object} evt
    */
   onTextOrTextSelectionChanged: function(evt) {
+    if (!evt.target.state.editable)
+      return;
+
     // Don't process nodes inside of web content if ChromeVox Next is inactive.
     if (evt.target.root.role != RoleType.desktop &&
         this.mode_ === ChromeVoxMode.CLASSIC)
@@ -572,6 +575,7 @@
     }
 
     this.createEditableTextHandlerIfNeeded_(evt.target);
+
     var textChangeEvent = new cvox.TextChangeEvent(
         evt.target.value,
         evt.target.textSelStart,
@@ -646,6 +650,7 @@
       output.format(opt_prependFormatStr);
     }
     output.withSpeech(range, null, Output.EventType.NAVIGATE);
+    output.withSpeechCategory(cvox.TtsCategory.LIVE);
     output.go();
   },
 
diff --git a/chrome/browser/resources/chromeos/chromevox/cvox2/background/background_test.extjs b/chrome/browser/resources/chromeos/chromevox/cvox2/background/background_test.extjs
index 82810f9..a795073 100644
--- a/chrome/browser/resources/chromeos/chromevox/cvox2/background/background_test.extjs
+++ b/chrome/browser/resources/chromeos/chromevox/cvox2/background/background_test.extjs
@@ -23,6 +23,7 @@
   /** @override */
   setUp: function() {
     global.backgroundObj.forceChromeVoxNextActive();
+    window.RoleType = chrome.automation.RoleType;
   },
 
   /**
@@ -229,7 +230,7 @@
       </script>
     */},
     function(rootNode) {
-      var go = rootNode.find({ role: chrome.automation.RoleType.button });
+      var go = rootNode.find({ role: RoleType.button });
       mockFeedback.call(go.doDefault.bind(go))
           .expectSpeech('Hello, world');
       mockFeedback.replay();
@@ -250,7 +251,7 @@
       </script>
     */},
     function(rootNode) {
-      var go = rootNode.find({ role: chrome.automation.RoleType.button });
+      var go = rootNode.find({ role: RoleType.button });
       go.doDefault();
       mockFeedback.expectSpeech('removed:')
           .expectSpeech('Hello, world');
@@ -294,7 +295,7 @@
           });
       mockFeedback.replay();
 
-      var go = rootNode.find({ role: chrome.automation.RoleType.link });
+      var go = rootNode.find({ role: RoleType.link });
       this.listenOnce(go, 'focus', function(e) {
         this.doCmd('showContextMenu')();
       }.bind(this), true);
@@ -325,10 +326,10 @@
         </script>
       */},
       function(rootNode) {
-        var button1 = rootNode.find({role: chrome.automation.RoleType.button,
+        var button1 = rootNode.find({role: RoleType.button,
                                      name: 'Click me'});
         var textField = rootNode.find(
-            {role: chrome.automation.RoleType.textField});
+            {role: RoleType.textField});
         mockFeedback.expectBraille('start')
             .call(button1.focus.bind(button1))
             .expectBraille(/^Click me btn/)
@@ -368,3 +369,30 @@
       mockFeedback.replay();
     }.bind(this));
 });
+
+TEST_F('BackgroundTest', 'UseEditableState', function() {
+  this.runWithLoadedTree(
+    function() {/*!
+      <input type="text"></input>
+      <p tabindex=0>hi</p>
+    */},
+    function(rootNode) {
+      var assertExists = this.newCallback(function (evt) {
+        assertNotNullNorUndefined(global.backgroundObj.editableTextHandler_);
+        evt.stopPropagation();
+      });
+      var assertDoesntExist = this.newCallback(function (evt) {
+        assertTrue(!global.backgroundObj.editableTextHandler_);
+        evt.stopPropagation();
+      });
+
+      var editable = rootNode.find({ role: RoleType.textField });
+      var nonEditable = rootNode.find({ role: RoleType.paragraph });
+
+      this.listenOnce(editable, 'focus', assertExists);
+      this.listenOnce(nonEditable, 'focus', assertDoesntExist);
+
+      editable.focus();
+      nonEditable.focus();
+    }.bind(this));
+});
diff --git a/chrome/browser/resources/chromeos/chromevox/cvox2/background/output.js b/chrome/browser/resources/chromeos/chromevox/cvox2/background/output.js
index 6770308..af35f3a 100644
--- a/chrome/browser/resources/chromeos/chromevox/cvox2/background/output.js
+++ b/chrome/browser/resources/chromeos/chromevox/cvox2/background/output.js
@@ -645,6 +645,16 @@
   },
 
   /**
+   * Applies the given speech category to the output.
+   * @param {cvox.TtsCategory} category
+   * @return {!Output}
+   */
+  withSpeechCategory: function(category) {
+    this.speechProperties_['category'] = category;
+    return this;
+  },
+
+  /**
    * Apply a format string directly to the output buffer. This lets you
    * output a message directly to the buffer using the format syntax.
    * @param {string} formatStr
@@ -677,7 +687,8 @@
    */
   go: function() {
     // Speech.
-    var queueMode = cvox.QueueMode.FLUSH;
+    var queueMode = this.speechProperties_['category'] ?
+        cvox.QueueMode.CATEGORY_FLUSH : cvox.QueueMode.FLUSH;
     this.speechBuffer_.forEach(function(buff, i, a) {
       if (buff.toString()) {
         (function() {
diff --git a/chrome/browser/resources/chromeos/chromevox/testing/chromevox_next_e2e_test_base.js b/chrome/browser/resources/chromeos/chromevox/testing/chromevox_next_e2e_test_base.js
index 8822e31f4..5a84dc2b 100644
--- a/chrome/browser/resources/chromeos/chromevox/testing/chromevox_next_e2e_test_base.js
+++ b/chrome/browser/resources/chromeos/chromevox/testing/chromevox_next_e2e_test_base.js
@@ -51,7 +51,7 @@
   listenOnce: function(node, eventType, callback, capture) {
     var innerCallback = this.newCallback(function() {
       node.removeEventListener(eventType, innerCallback, capture);
-      callback();
+      callback.apply(this, arguments);
     });
     node.addEventListener(eventType, innerCallback, capture);
   }
diff --git a/chrome/browser/resources/md_downloads/item.html b/chrome/browser/resources/md_downloads/item.html
index e2ada57..56d7e1b 100644
--- a/chrome/browser/resources/md_downloads/item.html
+++ b/chrome/browser/resources/md_downloads/item.html
@@ -5,7 +5,6 @@
 <link rel="import" href="chrome://resources/polymer/v1_0/iron-icon/iron-icon.html">
 <link rel="import" href="chrome://resources/polymer/v1_0/iron-icons/iron-icons.html">
 <link rel="import" href="chrome://resources/polymer/v1_0/paper-button/paper-button.html">
-<link rel="import" href="chrome://resources/polymer/v1_0/paper-material/paper-material.html">
 <link rel="import" href="chrome://resources/polymer/v1_0/paper-progress/paper-progress.html">
 <link rel="import" href="chrome://downloads/action_service.html">
 <link rel="import" href="chrome://downloads/constants.html">
diff --git a/chrome/browser/resources/media_router/elements/media_router_container/media_router_container.js b/chrome/browser/resources/media_router/elements/media_router_container/media_router_container.js
index 3e2b959..8193bac 100644
--- a/chrome/browser/resources/media_router/elements/media_router_container/media_router_container.js
+++ b/chrome/browser/resources/media_router/elements/media_router_container/media_router_container.js
@@ -681,7 +681,6 @@
    * @private
    */
   showCastModeList_: function() {
-    this.currentRoute_ = null;
     this.currentView_ = this.CONTAINER_VIEW_.CAST_MODE_LIST;
   },
 
@@ -723,7 +722,6 @@
    * @private
    */
   showSinkList_: function() {
-    this.currentRoute_ = null;
     this.currentView_ = this.CONTAINER_VIEW_.SINK_LIST;
   },
 
diff --git a/chrome/browser/resources/net_internals/spdy_view.html b/chrome/browser/resources/net_internals/spdy_view.html
index 964b111e..63015fa 100644
--- a/chrome/browser/resources/net_internals/spdy_view.html
+++ b/chrome/browser/resources/net_internals/spdy_view.html
@@ -5,7 +5,7 @@
          https://crrev.com/1268313004.  "use_alternate_protocols" is here to
          support importing netlog json files from earlier browsers.
          TODO(bnc): Deprecate around 2016 February. -->
-    <li>Use Alternative Service: <span jscontent="$this.use_alternative_services || $this.use_alternate_protocols"></span></li>
+    <li>Use Alternative Service: <span jscontent="$this.use_alternative_services == undefined ? $this.use_alternate_protocols : $this.use_alternative_services"></span></li>
     <li>Next Protocols: <span jscontent="next_protos"></span></li>
   </ul>
 
diff --git a/chrome/browser/resources/settings/basic_page/basic_page.html b/chrome/browser/resources/settings/basic_page/basic_page.html
index e1519a4..64914a1d 100644
--- a/chrome/browser/resources/settings/basic_page/basic_page.html
+++ b/chrome/browser/resources/settings/basic_page/basic_page.html
@@ -1,6 +1,5 @@
 <link rel="import" href="chrome://resources/polymer/v1_0/polymer/polymer.html">
 <link rel="import" href="chrome://md-settings/appearance_page/appearance_page.html">
-<link rel="import" href="chrome://md-settings/default_browser_page/default_browser_page.html">
 <link rel="import" href="chrome://md-settings/search_page/search_page.html">
 <link rel="import" href="chrome://md-settings/settings_page/settings_section.html">
 <link rel="import" href="chrome://md-settings/on_startup_page/on_startup_page.html">
@@ -11,6 +10,7 @@
 </if>
 
 <if expr="not chromeos">
+<link rel="import" href="chrome://md-settings/default_browser_page/default_browser_page.html">
 <link rel="import" href="chrome://md-settings/signin_page/signin_page.html">
 </if>
 
@@ -57,12 +57,14 @@
     </settings-section>
 </if>
 
+<if expr="not chromeos">
     <settings-section i18n-values="page-title:defaultBrowser"
         expand-container="{{expandContainer}}"
         current-route="[[currentRoute]]" section="defaultBrowser">
       <settings-default-browser-page>
       </settings-default-browser-page>
     </settings-section>
+</if>
   </template>
   <script src="basic_page.js"></script>
 </dom-module>
diff --git a/chrome/browser/resources/settings/default_browser_page/default_browser_page.html b/chrome/browser/resources/settings/default_browser_page/default_browser_page.html
index 46ea982..6e49233 100644
--- a/chrome/browser/resources/settings/default_browser_page/default_browser_page.html
+++ b/chrome/browser/resources/settings/default_browser_page/default_browser_page.html
@@ -13,7 +13,8 @@
       <paper-button on-tap="onSetDefaultBrowserTap_"
           >[[i18n('defaultBrowserMakeDefault')]]</paper-button>
       <template is="dom-if" if="[[showError_]]">
-        <iron-icon icon="error" class="error-icon"></iron-icon>
+        <iron-icon icon="error" class="error-icon"
+            title="[[i18n('unableToSetDefaultBrowser')]]"></iron-icon>
       </template>
     </template>
   </template>
diff --git a/chrome/browser/resources/settings/settings_resources.grd b/chrome/browser/resources/settings/settings_resources.grd
index ba83b63d..70785765 100644
--- a/chrome/browser/resources/settings/settings_resources.grd
+++ b/chrome/browser/resources/settings/settings_resources.grd
@@ -194,17 +194,19 @@
       <structure name="IDR_SETTINGS_CONTROLS_RADIO_GROUP_CSS"
                  file="controls/settings_radio_group.css"
                  type="chrome_html" />
-      <structure name="IDR_SETTINGS_DEFAULT_BROWSER_PAGE_CSS"
-                 file="default_browser_page/default_browser_page.css"
-                 type="chrome_html" />
-      <structure name="IDR_SETTINGS_DEFAULT_BROWSER_PAGE_HTML"
-                 file="default_browser_page/default_browser_page.html"
-                 type="chrome_html"
-                 flattenhtml="true"
-                 allowexternalscript="true" />
-      <structure name="IDR_SETTINGS_DEFAULT_BROWSERE_PAGE_JS"
-                 file="default_browser_page/default_browser_page.js"
-                 type="chrome_html" />
+      <if expr="not chromeos">
+        <structure name="IDR_SETTINGS_DEFAULT_BROWSER_PAGE_CSS"
+                   file="default_browser_page/default_browser_page.css"
+                   type="chrome_html" />
+        <structure name="IDR_SETTINGS_DEFAULT_BROWSER_PAGE_HTML"
+                   file="default_browser_page/default_browser_page.html"
+                   type="chrome_html"
+                   flattenhtml="true"
+                   allowexternalscript="true" />
+        <structure name="IDR_SETTINGS_DEFAULT_BROWSERE_PAGE_JS"
+                   file="default_browser_page/default_browser_page.js"
+                   type="chrome_html" />
+      </if>
       <structure name="IDR_SETTINGS_DOWNLOADS_PAGE_CSS"
                  file="downloads_page/downloads_page.css"
                  type="chrome_html" />
@@ -362,14 +364,16 @@
       <structure name="IDR_SETTINGS_SEARCH_PAGE_CSS"
                  file="search_page/search_page.css"
                  type="chrome_html" />
-      <structure name="IDR_SETTINGS_SIGNIN_PAGE_JS"
-                 file="signin_page/signin_page.js"
-                 type="chrome_html" />
-      <structure name="IDR_SETTINGS_SIGNIN_PAGE_HTML"
-                 file="signin_page/signin_page.html"
-                 type="chrome_html"
-                 flattenhtml="true"
-                 allowexternalscript="true" />
+      <if expr="not chromeos">
+        <structure name="IDR_SETTINGS_SIGNIN_PAGE_JS"
+                   file="signin_page/signin_page.js"
+                   type="chrome_html" />
+        <structure name="IDR_SETTINGS_SIGNIN_PAGE_HTML"
+                   file="signin_page/signin_page.html"
+                   type="chrome_html"
+                   flattenhtml="true"
+                   allowexternalscript="true" />
+      </if>
       <structure name="IDR_SETTINGS_SYNC_PAGE_JS"
                  file="sync_page/sync_page.js"
                  type="chrome_html" />
diff --git a/chrome/browser/resources/settings/sync_page/sync_page.html b/chrome/browser/resources/settings/sync_page/sync_page.html
index c8a856c..2ad0b9fc0 100644
--- a/chrome/browser/resources/settings/sync_page/sync_page.html
+++ b/chrome/browser/resources/settings/sync_page/sync_page.html
@@ -1,73 +1,146 @@
+<link rel="import" href="chrome://resources/polymer/v1_0/iron-pages/iron-pages.html">
 <link rel="import" href="chrome://resources/polymer/v1_0/polymer/polymer.html">
 <link rel="import" href="chrome://resources/polymer/v1_0/paper-button/paper-button.html">
 <link rel="import" href="chrome://resources/polymer/v1_0/paper-checkbox/paper-checkbox.html">
+<link rel="import" href="chrome://resources/polymer/v1_0/paper-dropdown-menu/paper-dropdown-menu.html">
+<link rel="import" href="chrome://resources/polymer/v1_0/paper-input/paper-input.html">
 <link rel="import" href="chrome://resources/polymer/v1_0/paper-radio-button/paper-radio-button.html">
 <link rel="import" href="chrome://resources/polymer/v1_0/paper-radio-group/paper-radio-group.html">
 <link rel="import" href="chrome://md-settings/controls/settings_checkbox.html">
+<link rel="import" href="chrome://md-settings/i18n_behavior/i18n_behavior.html">
+<link rel="import" href="chrome://md-settings/sync_page/sync_private_api.html">
 
 <dom-module id="settings-sync-page">
   <link rel="import" type="css"
       href="chrome://md-settings/settings_page/settings_page.css">
   <link rel="import" type="css" href="sync_page.css">
   <template>
-    <select>
-      <option value="sync-everything"
-          i18n-content="syncEverythingMenuOption">
-      </option>
-      <option value="choose-what-to-sync"
-          i18n-content="chooseWhatToSyncMenuOption">
-      </option>
-    </select>
-    <div class="checkbox-container">
-      <div class="checkbox-container-row">
-        <paper-checkbox>
-          <span i18n-content="appCheckboxLabel"></span>
-        </paper-checkbox>
-        <paper-checkbox>
-          <span i18n-content="extensionsCheckboxLabel"></span>
-        </paper-checkbox>
-        <paper-checkbox>
-          <span i18n-content="settingsCheckboxLabel"></span>
-        </paper-checkbox>
+    <iron-pages id="pages" selected="spinner" attr-for-selected="id">
+      <div id="loading" i18n-content="syncLoading"></div>
+      <div id="timeout" i18n-content="syncTimeout"></div>
+      <div id="main">
+        <paper-dropdown-menu>
+          <paper-menu id="syncSelector" class="dropdown-content"
+              selected="[[selectedSyncSelectorIndex_(syncPrefs.syncAllDataTypes)]]"
+              on-iron-select="onSyncSelectorChanged_">
+            <paper-item name="sync-everything"
+                i18n-content="syncEverythingMenuOption">
+            </paper-item>
+            <paper-item name="choose-what-to-sync"
+                i18n-content="chooseWhatToSyncMenuOption">
+            </paper-item>
+          </paper-menu>
+        </paper-dropdown-menu>
+
+        <div class="checkbox-container">
+          <div class="checkbox-container-row">
+            <paper-checkbox checked="{{syncPrefs.appsSynced}}"
+                hidden="[[!syncPrefs.appsRegistered]]"
+                disabled="[[shouldSyncCheckboxBeDisabled_(syncPrefs.syncAllDataTypes, syncPrefs.appsEnforced)]]">
+              <span i18n-content="appCheckboxLabel"></span>
+            </paper-checkbox>
+            <paper-checkbox checked="{{syncPrefs.extensionsSynced}}"
+                hidden="[[!syncPrefs.extensionsRegistered]]"
+                disabled="[[shouldSyncCheckboxBeDisabled_(syncPrefs.syncAllDataTypes, syncPrefs.extensionsEnforced)]]">
+              <span i18n-content="extensionsCheckboxLabel"></span>
+            </paper-checkbox>
+            <paper-checkbox checked="{{syncPrefs.preferencesSynced}}"
+                hidden="[[!syncPrefs.preferencesRegistered]]"
+                disabled="[[shouldSyncCheckboxBeDisabled_(syncPrefs.syncAllDataTypes, syncPrefs.preferencesEnforced)]]">
+              <span i18n-content="settingsCheckboxLabel"></span>
+            </paper-checkbox>
+          </div>
+          <div class="checkbox-container-row">
+            <paper-checkbox checked="{{syncPrefs.autofillSynced}}"
+                hidden="[[!syncPrefs.autofillRegistered]]"
+                disabled="[[shouldSyncCheckboxBeDisabled_(syncPrefs.syncAllDataTypes, syncPrefs.autofillEnforced)]]">
+              <span i18n-content="autofillCheckboxLabel"></span>
+            </paper-checkbox>
+            <paper-checkbox checked="{{syncPrefs.typedUrlsSynced}}"
+                hidden="[[!syncPrefs.typedUrlsRegistered]]"
+                disabled="[[shouldSyncCheckboxBeDisabled_(syncPrefs.syncAllDataTypes, syncPrefs.typedUrlsEnforced)]]">
+              <span i18n-content="historyCheckboxLabel"></span>
+            </paper-checkbox>
+            <paper-checkbox checked="{{syncPrefs.themesSynced}}"
+                hidden="[[!syncPrefs.themesRegistered]]"
+                disabled="[[shouldSyncCheckboxBeDisabled_(syncPrefs.syncAllDataTypes, syncPrefs.themesEnforced)]]">
+              <span i18n-content="themesAndWallpapersCheckboxLabel"></span>
+            </paper-checkbox>
+          </div>
+          <div class="checkbox-container-row">
+            <paper-checkbox checked="{{syncPrefs.bookmarksSynced}}"
+                hidden="[[!syncPrefs.bookmarksRegistered]]"
+                disabled="[[shouldSyncCheckboxBeDisabled_(syncPrefs.syncAllDataTypes, syncPrefs.bookmarksEnforced)]]">
+              <span i18n-content="bookmarksCheckboxLabel"></span>
+            </paper-checkbox>
+            <paper-checkbox checked="{{syncPrefs.passwordsSynced}}"
+                hidden="[[!syncPrefs.passwordsRegistered]]"
+                disabled="[[shouldSyncCheckboxBeDisabled_(syncPrefs.syncAllDataTypes, syncPrefs.passwordsEnforced)]]">
+              <span i18n-content="passwordsCheckboxLabel"></span>
+            </paper-checkbox>
+            <paper-checkbox checked="{{syncPrefs.tabsSynced}}"
+                hidden="[[!syncPrefs.tabsRegistered]]"
+                disabled="[[shouldSyncCheckboxBeDisabled_(syncPrefs.syncAllDataTypes, syncPrefs.tabsEnforced)]]">
+              <span i18n-content="openTabsCheckboxLabel"></span>
+            </paper-checkbox>
+          </div>
+        </div>
+
+        <h2 i18n-content="encryptionOptionsTitle"></h2>
+        <p i18n-content="syncDataEncryptedText"></p>
+
+        <template is="dom-if" if="[[!syncPrefs.showPassphrase]]">
+          <paper-radio-group id="encryptRadioGroup"
+              selected="[[selectedEncryptionRadio_(syncPrefs.usePassphrase, syncPrefs.encryptAllData)]]"
+              on-paper-radio-group-changed="onEncryptionRadioSelectionChanged_">
+            <paper-radio-button name="encrypt-with-google"
+                disabled="[[encryptionRadiosDisabled_(syncPrefs.usePassphrase, syncPrefs.encryptAllData)]]">
+              <span>[[i18n('encryptWithGoogleCredentialsLabel')]]</span>
+            </paper-radio-button>
+            <paper-radio-button name="encrypt-with-passphrase"
+                disabled="[[encryptionRadiosDisabled_(syncPrefs.usePassphrase, syncPrefs.encryptAllData)]]">
+              <span>[[encryptWithPassphraseBody_(syncPrefs.fullEncryptionBody)]]</span>
+            </paper-radio-button>
+          </paper-radio-group>
+        </template>
+
+        <template is="dom-if" if="[[creatingNewPassphrase]]">
+          <div>[[i18n('passphraseExplanationText')]]</div>
+          <paper-input id="passphraseInput" type="password"
+              placeholder="[[i18n('passphrasePlaceholder')]]">
+          </paper-input>
+          <paper-input id="passphraseConfirmationInput" type="password"
+              placeholder="[[i18n('passphraseConfirmationPlaceholder')]]">
+          </paper-input>
+          <div id="emptyPassphraseError" hidden>[[i18n('emptyPassphraseError')]]</div>
+          <div id="mismatchedPassphraseError" hidden>[[i18n('mismatchedPassphraseError')]]</div>
+        </template>
+
+        <template is="dom-if" if="[[syncPrefs.showPassphrase]]">
+          <div id="askCustomPassphraseMessage"
+              hidden="[[askOldGooglePassphrase]]">[[syncPrefs.enterPassphraseBody]]</div>
+          <div id="askOldGooglePassphraseMessage"
+              hidden="[[!askOldGooglePassphrase]]">[[syncPrefs.enterGooglePassphraseBody]]</div>
+          <paper-input id="existingPassphraseInput" type="password"
+              placeholder="[[i18n('passphrasePlaceholder')]]">
+          </paper-input>
+          <div id="incorrectPassphraseError" hidden>[[i18n('incorrectPassphraseError')]]</div>
+        </template>
+
+        <div class="button-row">
+          <div class="flex">
+            <paper-button i18n-content="useDefaultSettingsButton"
+                on-tap="onUseDefaultsTap_"
+                hidden="[[syncPrefs.showPassphrase]]">
+            </paper-button>
+          </div>
+          <paper-button i18n-content="cancelButton" on-tap="onCancelTap_">
+          </paper-button>
+          <paper-button i18n-content="okButton" on-tap="onOkTap_" raised>
+          </paper-button>
+        </div>
       </div>
-      <div class="checkbox-container-row">
-        <paper-checkbox>
-          <span i18n-content="autofillCheckboxLabel"></span>
-        </paper-checkbox>
-        <paper-checkbox>
-          <span i18n-content="historyCheckboxLabel"></span>
-        </paper-checkbox>
-        <paper-checkbox>
-          <span i18n-content="themesAndWallpapersCheckboxLabel"></span>
-        </paper-checkbox>
-      </div>
-      <div class="checkbox-container-row">
-        <paper-checkbox>
-          <span i18n-content="bookmarksCheckboxLabel"></span>
-        </paper-checkbox>
-        <paper-checkbox>
-          <span i18n-content="passwordsCheckboxLabel"></span>
-        </paper-checkbox>
-        <paper-checkbox>
-          <span i18n-content="openTabsCheckboxLabel"></span>
-        </paper-checkbox>
-      </div>
-    </div>
-    <div i18n-content="encryptionOptionsTitle"></div>
-    <div i18n-content="syncDataEncryptedText"></div>
-    <paper-radio-group selected="encrypt-with-google">
-      <paper-radio-button name="encrypt-with-google"
-          i18n-content="encryptWithGoogleCredentialsLabel">
-      </paper-radio-button>
-      <paper-radio-button name="encrypt-with-passphrase"
-          i18n-content="encryptWithSyncPassphraseLabel">
-      </paper-radio-button>
-    </paper-radio-group>
-    <div>
-      <paper-button i18n-content="useDefaultSettingsButton"></paper-button>
-      <paper-button i18n-content="cancelButton"></paper-button>
-      <paper-button i18n-content="okButton"></paper-button>
-    </div>
+    </iron-pages>
   </template>
   <script src="sync_page.js"></script>
 </dom-module>
diff --git a/chrome/browser/resources/settings/sync_page/sync_page.js b/chrome/browser/resources/settings/sync_page/sync_page.js
index d63575d..bd22258 100644
--- a/chrome/browser/resources/settings/sync_page/sync_page.js
+++ b/chrome/browser/resources/settings/sync_page/sync_page.js
@@ -2,6 +2,27 @@
 // Use of this source code is governed by a BSD-style license that can be
 // found in the LICENSE file.
 
+(function() {
+
+/**
+ * Indices of the options in the sync selector menu.
+ * @enum {number}
+ */
+var SyncSelectorIndices = {
+  SYNC_EVERYTHING: 0,
+  CHOOSE_WHAT_TO_SYNC: 1,
+};
+
+/**
+ * Names of the radio buttons which allow the user to choose his encryption
+ * mechanism.
+ * @enum {string}
+ */
+var RadioButtonNames = {
+  ENCRYPT_WITH_GOOGLE: 'encrypt-with-google',
+  ENCRYPT_WITH_PASSPHRASE: 'encrypt-with-passphrase',
+};
+
 /**
  * @fileoverview
  * 'settings-sync-page' is the settings page containing sync settings.
@@ -18,4 +39,254 @@
  */
 Polymer({
   is: 'settings-sync-page',
+
+  behaviors: [
+    I18nBehavior,
+  ],
+
+  properties: {
+    /**
+     * The current active route.
+     */
+    currentRoute: {
+      type: Object,
+      observer: 'currentRouteChanged_',
+    },
+
+    /**
+     * The current sync preferences, supplied by settings.SyncPrivateApi.
+     * @type {?settings.SyncPrivateApi.SyncPrefs}
+     */
+    syncPrefs: {
+      type: Object,
+    },
+
+    /**
+     * Whether the "create passphrase" inputs should be shown. These inputs
+     * give the user the opportunity to use a custom passphrase instead of
+     * authenticating with his Google credentials.
+     */
+    creatingNewPassphrase: {
+      type: Boolean,
+      value: false,
+    },
+
+    /**
+     * True if subpage needs the user's old Google password. This can happen
+     * when the user changes his password after encrypting his sync data.
+     *
+     * TODO(tommycli): FROM the C++ handler, the syncPrefs.usePassphrase field
+     * is true if and only if there is a custom non-Google Sync password.
+     *
+     * But going TO the C++ handler, the syncPrefs.usePassphrase field is true
+     * if there is either a custom or Google password. There is a separate
+     * syncPrefs.isGooglePassphrase field.
+     *
+     * We keep an extra state variable here because we mutate the
+     * syncPrefs.usePassphrase field in the OK button handler.
+     * Remove this once we fix refactor the legacy SyncSetupHandler.
+     */
+    askOldGooglePassphrase: {
+      type: Boolean,
+      value: false,
+    },
+  },
+
+  created: function() {
+    settings.SyncPrivateApi.setSyncPrefsCallback(
+        this.handleSyncPrefsFetched_.bind(this));
+  },
+
+  /** @private */
+  currentRouteChanged_: function() {
+    if (this.currentRoute.section == 'signin' &&
+        this.currentRoute.subpage.length == 1 &&
+        this.currentRoute.subpage[0] == 'sync') {
+      // Display loading page until the settings have been retrieved.
+      this.$.pages.selected = 'loading';
+      settings.SyncPrivateApi.didNavigateToSyncPage();
+    } else {
+      settings.SyncPrivateApi.didNavigateAwayFromSyncPage();
+    }
+  },
+
+  /**
+   * Handler for when the sync state is pushed from settings.SyncPrivateApi.
+   * @private
+   */
+  handleSyncPrefsFetched_: function(syncPrefs) {
+    this.syncPrefs = syncPrefs;
+
+    this.askOldGooglePassphrase =
+        this.syncPrefs.showPassphrase && !this.syncPrefs.usePassphrase;
+
+    this.creatingNewPassphrase = false;
+
+    this.$.pages.selected = 'main';
+  },
+
+  /** @private */
+  onCancelTap_: function() {
+    // Event is caught by settings-animated-pages.
+    this.fire('subpage-back');
+  },
+
+  /**
+   * Sets the sync data by sending it to the settings.SyncPrivateApi.
+   * @private
+   */
+  onOkTap_: function() {
+    if (this.creatingNewPassphrase) {
+      // If a new password has been entered but it is invalid, do not send the
+      // sync state to the API.
+      if (!this.validateCreatedPassphrases_())
+        return;
+
+      this.syncPrefs.encryptAllData = true;
+    }
+
+    this.syncPrefs.isGooglePassphrase = this.askOldGooglePassphrase;
+    this.syncPrefs.usePassphrase =
+        this.creatingNewPassphrase || this.syncPrefs.showPassphrase;
+
+    if (this.syncPrefs.usePassphrase) {
+      var field = this.creatingNewPassphrase ?
+          this.$$('#passphraseInput') : this.$$('#existingPassphraseInput');
+      this.syncPrefs.passphrase = field.value;
+      field.value = '';
+    }
+
+    settings.SyncPrivateApi.setSyncPrefs(
+        this.syncPrefs, this.setPageStatusCallback_.bind(this));
+  },
+
+  /**
+   * Applies the default settings (i.e., sync everything).
+   * @private
+   */
+  onUseDefaultsTap_: function() {
+    this.set('syncPrefs.syncAllDataTypes', true);
+    this.set('syncPrefs.appsSynced', true);
+    this.set('syncPrefs.extensionsSynced', true);
+    this.set('syncPrefs.preferencesSynced', true);
+    this.set('syncPrefs.autofillSynced', true);
+    this.set('syncPrefs.typedUrlsSynced', true);
+    this.set('syncPrefs.themesSynced', true);
+    this.set('syncPrefs.bookmarksSynced', true);
+    this.set('syncPrefs.passwordsSynced', true);
+    this.set('syncPrefs.tabsSynced', true);
+  },
+
+  /**
+   * Callback invoked from calling settings.SyncPrivateApi.setSyncPrefs().
+   * @param {!SyncPrivatApi.SetSyncCallbackState} callbackState
+   * @private
+   */
+  setPageStatusCallback_: function(callbackState) {
+    if (callbackState == settings.SyncPrivateApi.PageStatus.DONE) {
+      this.onCancelTap_();
+    } else if (callbackState == settings.SyncPrivateApi.PageStatus.TIMEOUT) {
+      this.$.pages.selected = 'timeout';
+    } else if (callbackState ==
+               settings.SyncPrivateApi.PageStatus.PASSPHRASE_ERROR) {
+      this.$$('#incorrectPassphraseError').hidden = false;
+    }
+  },
+
+  /**
+   * Called when the encryption
+   * @private
+   */
+  onEncryptionRadioSelectionChanged_: function(event) {
+    this.creatingNewPassphrase =
+        event.target.selected == RadioButtonNames.ENCRYPT_WITH_PASSPHRASE;
+  },
+
+  /**
+   * Computed binding returning the selected index for the sync dropdown.
+   * @private
+   */
+  selectedSyncSelectorIndex_: function() {
+    return this.syncPrefs.syncAllDataTypes ?
+        SyncSelectorIndices.SYNC_EVERYTHING :
+        SyncSelectorIndices.CHOOSE_WHAT_TO_SYNC;
+  },
+
+  /**
+   * Computed binding returning the selected encryption radio button.
+   * @private
+   */
+  selectedEncryptionRadio_: function() {
+    return this.encryptionRadiosDisabled_() ?
+        RadioButtonNames.ENCRYPT_WITH_PASSPHRASE :
+        RadioButtonNames.ENCRYPT_WITH_GOOGLE;
+  },
+
+  /**
+   * Computed binding returning the selected encryption radio button.
+   * @private
+   */
+  encryptionRadiosDisabled_: function() {
+    return this.syncPrefs.usePassphrase || this.syncPrefs.encryptAllData;
+  },
+
+  /**
+   * Computed binding returning the encryption text body.
+   * @private
+   */
+  encryptWithPassphraseBody_: function() {
+    if (this.syncPrefs && this.syncPrefs.fullEncryptionBody)
+      return this.syncPrefs.fullEncryptionBody;
+
+    return this.i18n('encryptWithSyncPassphraseLabel');
+  },
+
+  /**
+   * Handler for when the sync selector menu has changed its active option.
+   * @private
+   */
+  onSyncSelectorChanged_: function(event) {
+    if (event.target.selected == SyncSelectorIndices.SYNC_EVERYTHING)
+      this.onUseDefaultsTap_();
+    else
+      this.set('syncPrefs.syncAllDataTypes', false);
+  },
+
+  /**
+   * @param {boolean} syncAllDataTypes
+   * @param {boolean} enforced
+   * @return {boolean} Whether the sync checkbox should be disabled.
+   */
+  shouldSyncCheckboxBeDisabled_: function(syncAllDataTypes, enforced) {
+    return syncAllDataTypes || enforced;
+  },
+
+  /**
+   * Checks the supplied passphrases to ensure that they are not empty and that
+   * they match each other. Additionally, displays error UI if they are
+   * invalid.
+   * @return {boolean} Whether the check was successful (i.e., that the
+   *     passphrases were valid).
+   * @private
+   */
+  validateCreatedPassphrases_: function() {
+    this.$$('#emptyPassphraseError').hidden = true;
+    this.$$('#mismatchedPassphraseError').hidden = true;
+
+    var passphrase = this.$$('#passphraseInput').value;
+    if (!passphrase) {
+      this.$$('#emptyPassphraseError').hidden = false;
+      return false;
+    }
+
+    var confirmation = this.$$('#passphraseConfirmationInput').value;
+    if (passphrase != confirmation) {
+      this.$$('#mismatchedPassphraseError').hidden = false;
+      return false;
+    }
+
+    return true;
+  },
 });
+
+})();
diff --git a/chrome/browser/resources/settings/sync_page/sync_private_api.js b/chrome/browser/resources/settings/sync_page/sync_private_api.js
index d89302b..14375a9 100644
--- a/chrome/browser/resources/settings/sync_page/sync_private_api.js
+++ b/chrome/browser/resources/settings/sync_page/sync_private_api.js
@@ -63,10 +63,11 @@
    * @enum {string}
    */
   SyncPrivateApi.PageStatus = {
-    CONFIGURE: 'configure',
-    TIMED_OUT: 'timeout',
-    DONE: 'done',
-    PASSPHRASE_ERROR: 'passphraseError',
+    SPINNER: 'spinner',                   // Before the page has loaded.
+    CONFIGURE: 'configure',               // Preferences ready to be configured.
+    TIMEOUT: 'timeout',                   // Preferences loading has timed out.
+    DONE: 'done',                         // Sync subpage can be closed now.
+    PASSPHRASE_ERROR: 'passphraseError',  // Error in the passphrase.
   };
 
   /** @private {?function(SyncPrivateApi.SyncPrefs)} */
@@ -148,7 +149,7 @@
    */
   SyncSetupOverlay.showSyncSetupPage = function(status, prefs) {
     switch (status) {
-      case SyncPrivateApi.PageStatus.TIMED_OUT:
+      case SyncPrivateApi.PageStatus.TIMEOUT:
       case SyncPrivateApi.PageStatus.DONE:
         SyncPrivateApi.setPageStatus_(status);
         break;
diff --git a/chrome/browser/services/gcm/gcm_profile_service.cc b/chrome/browser/services/gcm/gcm_profile_service.cc
index 50d2de2b..0f9650b 100644
--- a/chrome/browser/services/gcm/gcm_profile_service.cc
+++ b/chrome/browser/services/gcm/gcm_profile_service.cc
@@ -133,30 +133,9 @@
 }
 
 #if defined(OS_ANDROID)
-static GCMProfileService* debug_instance = nullptr;
-
 GCMProfileService::GCMProfileService(Profile* profile)
     : profile_(profile) {
-  CHECK(!profile->IsOffTheRecord());
-
-  // TODO(johnme): Remove debug_instance and this logging code once
-  // crbug.com/437827 is fixed.
-  if (debug_instance != nullptr) {
-    LOG(FATAL) << "An instance of GCMProfileService already exists!"
-               << " Old profile: " << debug_instance->profile_ << " "
-               << debug_instance->profile_->GetDebugName() << " "
-               << debug_instance->profile_->GetProfileType() << " "
-               << debug_instance->profile_->IsSupervised() << " "
-               << debug_instance->profile_->IsNewProfile() << " "
-               << debug_instance->profile_->GetStartTime().ToInternalValue()
-               << ", new profile: " << profile << " "
-               << profile->GetDebugName() << " "
-               << profile->GetProfileType() << " "
-               << profile->IsSupervised() << " "
-               << profile->IsNewProfile() << " "
-               << profile->GetStartTime().ToInternalValue();
-  }
-  debug_instance = this;
+  DCHECK(!profile->IsOffTheRecord());
 
   scoped_refptr<base::SequencedWorkerPool> worker_pool(
       content::BrowserThread::GetBlockingPool());
@@ -204,9 +183,6 @@
 }
 
 GCMProfileService::~GCMProfileService() {
-#if defined(OS_ANDROID)
-  debug_instance = nullptr;
-#endif
 }
 
 void GCMProfileService::Shutdown() {
diff --git a/chrome/browser/signin/chrome_signin_status_metrics_provider_delegate.cc b/chrome/browser/signin/chrome_signin_status_metrics_provider_delegate.cc
new file mode 100644
index 0000000..b307e5f
--- /dev/null
+++ b/chrome/browser/signin/chrome_signin_status_metrics_provider_delegate.cc
@@ -0,0 +1,140 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/signin/chrome_signin_status_metrics_provider_delegate.h"
+
+#include <string>
+#include <vector>
+
+#include "chrome/browser/browser_process.h"
+#include "chrome/browser/profiles/profile.h"
+#include "chrome/browser/profiles/profile_info_cache.h"
+#include "chrome/browser/profiles/profile_manager.h"
+#include "chrome/browser/ui/browser.h"
+#include "chrome/browser/ui/browser_list.h"
+#include "components/signin/core/browser/signin_manager.h"
+#include "components/signin/core/browser/signin_status_metrics_provider.h"
+
+#if !defined(OS_ANDROID) && !defined(OS_IOS)
+#include "chrome/browser/ui/browser_finder.h"
+#endif
+
+ChromeSigninStatusMetricsProviderDelegate::
+    ChromeSigninStatusMetricsProviderDelegate() {}
+
+ChromeSigninStatusMetricsProviderDelegate::
+    ~ChromeSigninStatusMetricsProviderDelegate() {
+#if !defined(OS_ANDROID) && !defined(OS_IOS)
+  BrowserList::RemoveObserver(this);
+#endif
+
+  SigninManagerFactory* factory = SigninManagerFactory::GetInstance();
+  if (factory)
+    factory->RemoveObserver(this);
+}
+
+void ChromeSigninStatusMetricsProviderDelegate::Initialize() {
+#if !defined(OS_ANDROID) && !defined(OS_IOS)
+  // On Android, there is always only one profile in any situation, opening new
+  // windows (which is possible with only some Android devices) will not change
+  // the opened profiles signin status.
+  BrowserList::AddObserver(this);
+#endif
+
+  SigninManagerFactory* factory = SigninManagerFactory::GetInstance();
+  if (factory)
+    factory->AddObserver(this);
+}
+
+AccountsStatus
+ChromeSigninStatusMetricsProviderDelegate::GetStatusOfAllAccounts() {
+  ProfileManager* profile_manager = g_browser_process->profile_manager();
+  std::vector<Profile*> profile_list = profile_manager->GetLoadedProfiles();
+
+  AccountsStatus accounts_status;
+  accounts_status.num_accounts = profile_list.size();
+  for (Profile* profile : profile_list) {
+#if !defined(OS_ANDROID) && !defined(OS_IOS)
+    if (chrome::GetTotalBrowserCountForProfile(profile) == 0) {
+      // The profile is loaded, but there's no opened browser for this profile.
+      continue;
+    }
+#endif
+    accounts_status.num_opened_accounts++;
+
+    SigninManager* manager =
+        SigninManagerFactory::GetForProfile(profile->GetOriginalProfile());
+    if (manager && manager->IsAuthenticated())
+      accounts_status.num_signed_in_accounts++;
+  }
+
+  return accounts_status;
+}
+
+std::vector<SigninManager*>
+ChromeSigninStatusMetricsProviderDelegate::GetSigninManagersForAllAccounts() {
+  ProfileManager* profile_manager = g_browser_process->profile_manager();
+  std::vector<Profile*> profiles = profile_manager->GetLoadedProfiles();
+
+  std::vector<SigninManager*> managers;
+  for (Profile* profile : profiles) {
+    SigninManager* manager =
+        SigninManagerFactory::GetForProfileIfExists(profile);
+    if (manager)
+      managers.push_back(manager);
+  }
+
+  return managers;
+}
+
+void ChromeSigninStatusMetricsProviderDelegate::OnBrowserAdded(
+    Browser* browser) {
+  SigninManager* manager =
+      SigninManagerFactory::GetForProfile(browser->profile());
+
+  // Nothing will change if the opened browser is in incognito mode.
+  if (!manager)
+    return;
+
+  const bool signed_in = manager->IsAuthenticated();
+  UpdateStatusWhenBrowserAdded(signed_in);
+}
+
+void ChromeSigninStatusMetricsProviderDelegate::SigninManagerCreated(
+    SigninManagerBase* manager) {
+  owner()->OnSigninManagerCreated(manager);
+}
+
+void ChromeSigninStatusMetricsProviderDelegate::SigninManagerShutdown(
+    SigninManagerBase* manager) {
+  owner()->OnSigninManagerShutdown(manager);
+}
+
+void ChromeSigninStatusMetricsProviderDelegate::UpdateStatusWhenBrowserAdded(
+    bool signed_in) {
+#if !defined(OS_ANDROID) && !defined(OS_IOS)
+  SigninStatusMetricsProviderBase::SigninStatus status =
+      owner()->signin_status();
+
+  // NOTE: If |status| is MIXED_SIGNIN_STATUS, this method
+  // intentionally does not update it.
+  if ((status == SigninStatusMetricsProviderBase::ALL_PROFILES_NOT_SIGNED_IN &&
+       signed_in) ||
+      (status == SigninStatusMetricsProviderBase::ALL_PROFILES_SIGNED_IN &&
+       !signed_in)) {
+    owner()->UpdateSigninStatus(
+        SigninStatusMetricsProviderBase::MIXED_SIGNIN_STATUS);
+  } else if (status == SigninStatusMetricsProviderBase::UNKNOWN_SIGNIN_STATUS) {
+    // If when function ProvideGeneralMetrics() is called, Chrome is
+    // running in the background with no browser window opened, |signin_status_|
+    // will be reset to |UNKNOWN_SIGNIN_STATUS|. Then this newly added browser
+    // is the only opened browser/profile and its signin status represents
+    // the whole status.
+    owner()->UpdateSigninStatus(
+        signed_in
+            ? SigninStatusMetricsProviderBase::ALL_PROFILES_SIGNED_IN
+            : SigninStatusMetricsProviderBase::ALL_PROFILES_NOT_SIGNED_IN);
+  }
+#endif
+}
diff --git a/chrome/browser/signin/chrome_signin_status_metrics_provider_delegate.h b/chrome/browser/signin/chrome_signin_status_metrics_provider_delegate.h
new file mode 100644
index 0000000..be6a2ab
--- /dev/null
+++ b/chrome/browser/signin/chrome_signin_status_metrics_provider_delegate.h
@@ -0,0 +1,43 @@
+// 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 CHROME_BROWSER_SIGNIN_CHROME_SIGNIN_STATUS_METRICS_PROVIDER_DELEGATE_H_
+#define CHROME_BROWSER_SIGNIN_CHROME_SIGNIN_STATUS_METRICS_PROVIDER_DELEGATE_H_
+
+#include "base/gtest_prod_util.h"
+#include "chrome/browser/signin/signin_manager_factory.h"
+#include "chrome/browser/ui/browser_list_observer.h"
+#include "components/signin/core/browser/signin_status_metrics_provider_delegate.h"
+
+class ChromeSigninStatusMetricsProviderDelegate
+    : public SigninStatusMetricsProviderDelegate,
+      public chrome::BrowserListObserver,
+      public SigninManagerFactory::Observer {
+ public:
+  ChromeSigninStatusMetricsProviderDelegate();
+  ~ChromeSigninStatusMetricsProviderDelegate() override;
+
+ private:
+  FRIEND_TEST_ALL_PREFIXES(ChromeSigninStatusMetricsProviderDelegateTest,
+                           UpdateStatusWhenBrowserAdded);
+
+  // SigninStatusMetricsProviderDelegate:
+  void Initialize() override;
+  AccountsStatus GetStatusOfAllAccounts() override;
+  std::vector<SigninManager*> GetSigninManagersForAllAccounts() override;
+
+  // chrome::BrowserListObserver:
+  void OnBrowserAdded(Browser* browser) override;
+
+  // SigninManagerFactoryObserver:
+  void SigninManagerCreated(SigninManagerBase* manager) override;
+  void SigninManagerShutdown(SigninManagerBase* manager) override;
+
+  // Updates the sign-in status right after a new browser is opened.
+  void UpdateStatusWhenBrowserAdded(bool signed_in);
+
+  DISALLOW_COPY_AND_ASSIGN(ChromeSigninStatusMetricsProviderDelegate);
+};
+
+#endif  // CHROME_BROWSER_SIGNIN_CHROME_SIGNIN_STATUS_METRICS_PROVIDER_DELEGATE_H_
diff --git a/chrome/browser/signin/chrome_signin_status_metrics_provider_delegate_unittest.cc b/chrome/browser/signin/chrome_signin_status_metrics_provider_delegate_unittest.cc
new file mode 100644
index 0000000..453c89f
--- /dev/null
+++ b/chrome/browser/signin/chrome_signin_status_metrics_provider_delegate_unittest.cc
@@ -0,0 +1,58 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/signin/chrome_signin_status_metrics_provider_delegate.h"
+
+#include "components/signin/core/browser/signin_status_metrics_provider.h"
+#include "content/public/test/test_browser_thread_bundle.h"
+#include "testing/gtest/include/gtest/gtest.h"
+
+#if !defined(OS_ANDROID) && !defined(OS_IOS)
+TEST(ChromeSigninStatusMetricsProviderDelegateTest,
+     UpdateStatusWhenBrowserAdded) {
+  content::TestBrowserThreadBundle thread_bundle;
+
+  scoped_ptr<ChromeSigninStatusMetricsProviderDelegate> delegate(
+      new ChromeSigninStatusMetricsProviderDelegate);
+  ChromeSigninStatusMetricsProviderDelegate* raw_delegate = delegate.get();
+  scoped_ptr<SigninStatusMetricsProvider> metrics_provider(
+      SigninStatusMetricsProvider::CreateInstance(delegate.Pass()));
+
+  // Initial status is all signed in and then a signed-in browser is opened.
+  metrics_provider->UpdateInitialSigninStatusForTesting(2, 2);
+  raw_delegate->UpdateStatusWhenBrowserAdded(true);
+  EXPECT_EQ(SigninStatusMetricsProviderBase::ALL_PROFILES_SIGNED_IN,
+            metrics_provider->GetSigninStatusForTesting());
+
+  // Initial status is all signed in and then a signed-out browser is opened.
+  metrics_provider->UpdateInitialSigninStatusForTesting(2, 2);
+  raw_delegate->UpdateStatusWhenBrowserAdded(false);
+  EXPECT_EQ(SigninStatusMetricsProviderBase::MIXED_SIGNIN_STATUS,
+            metrics_provider->GetSigninStatusForTesting());
+
+  // Initial status is all signed out and then a signed-in browser is opened.
+  metrics_provider->UpdateInitialSigninStatusForTesting(2, 0);
+  raw_delegate->UpdateStatusWhenBrowserAdded(true);
+  EXPECT_EQ(SigninStatusMetricsProviderBase::MIXED_SIGNIN_STATUS,
+            metrics_provider->GetSigninStatusForTesting());
+
+  // Initial status is all signed out and then a signed-out browser is opened.
+  metrics_provider->UpdateInitialSigninStatusForTesting(2, 0);
+  raw_delegate->UpdateStatusWhenBrowserAdded(false);
+  EXPECT_EQ(SigninStatusMetricsProviderBase::ALL_PROFILES_NOT_SIGNED_IN,
+            metrics_provider->GetSigninStatusForTesting());
+
+  // Initial status is mixed and then a signed-in browser is opened.
+  metrics_provider->UpdateInitialSigninStatusForTesting(2, 1);
+  raw_delegate->UpdateStatusWhenBrowserAdded(true);
+  EXPECT_EQ(SigninStatusMetricsProviderBase::MIXED_SIGNIN_STATUS,
+            metrics_provider->GetSigninStatusForTesting());
+
+  // Initial status is mixed and then a signed-out browser is opened.
+  metrics_provider->UpdateInitialSigninStatusForTesting(2, 1);
+  raw_delegate->UpdateStatusWhenBrowserAdded(false);
+  EXPECT_EQ(SigninStatusMetricsProviderBase::MIXED_SIGNIN_STATUS,
+            metrics_provider->GetSigninStatusForTesting());
+}
+#endif
diff --git a/chrome/browser/signin/signin_status_metrics_provider_chromeos.cc b/chrome/browser/signin/signin_status_metrics_provider_chromeos.cc
new file mode 100644
index 0000000..fc8856e
--- /dev/null
+++ b/chrome/browser/signin/signin_status_metrics_provider_chromeos.cc
@@ -0,0 +1,70 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/signin/signin_status_metrics_provider_chromeos.h"
+
+#include "chrome/browser/browser_process.h"
+#include "chrome/browser/profiles/profile_manager.h"
+#include "chromeos/login/login_state.h"
+
+namespace {
+
+// Returns true if user is signed in to a non-guest profile.
+bool IsSignedInNonGuest() {
+  ProfileManager* profile_manager = g_browser_process->profile_manager();
+  if (profile_manager &&
+      profile_manager->IsLoggedIn() &&
+      chromeos::LoginState::Get() &&
+      !chromeos::LoginState::Get()->IsGuestSessionUser()) {
+    return true;
+  }
+  return false;
+}
+
+} // namespace
+
+SigninStatusMetricsProviderChromeOS::SigninStatusMetricsProviderChromeOS() {
+  SetCurrentSigninStatus();
+}
+
+SigninStatusMetricsProviderChromeOS::~SigninStatusMetricsProviderChromeOS() {
+}
+
+void SigninStatusMetricsProviderChromeOS::ProvideGeneralMetrics(
+    metrics::ChromeUserMetricsExtension* uma_proto) {
+  // Compare the current logged-in status with the recorded one and compute
+  // sign-in status that should be reported.
+  RecordSigninStatusHistogram(ComputeSigninStatusToUpload(
+      signin_status(), IsSignedInNonGuest()));
+  // After reporting the sign-in status for previous UMA session, start fresh
+  // again regardless what was the status before.
+  ResetSigninStatus();
+  SetCurrentSigninStatus();
+}
+
+void SigninStatusMetricsProviderChromeOS::SetCurrentSigninStatus() {
+  if (IsSignedInNonGuest())
+    UpdateSigninStatus(ALL_PROFILES_SIGNED_IN);
+  UpdateSigninStatus(ALL_PROFILES_NOT_SIGNED_IN);
+}
+
+SigninStatusMetricsProviderBase::SigninStatus
+SigninStatusMetricsProviderChromeOS::ComputeSigninStatusToUpload(
+    SigninStatusMetricsProviderBase::SigninStatus recorded_status,
+    bool logged_in_now) {
+  if ((recorded_status == ALL_PROFILES_SIGNED_IN && logged_in_now) ||
+      (recorded_status == ALL_PROFILES_NOT_SIGNED_IN && !logged_in_now)) {
+    // If the status hasn't changed since we last recorded, report as it is.
+    return recorded_status;
+  } else if (recorded_status == ALL_PROFILES_NOT_SIGNED_IN && logged_in_now) {
+    // It possible that the browser goes from not signed-in to signed-in (i.e.
+    // user performed a login action through the login manager.)
+    return MIXED_SIGNIN_STATUS;
+  } else {
+    // There should not be other possibilities, for example the browser on
+    // ChromeOS can not go from signed-in to not signed-in. Record it as an
+    // error.
+    return ERROR_GETTING_SIGNIN_STATUS;
+  }
+}
diff --git a/chrome/browser/signin/signin_status_metrics_provider_chromeos.h b/chrome/browser/signin/signin_status_metrics_provider_chromeos.h
new file mode 100644
index 0000000..c594558
--- /dev/null
+++ b/chrome/browser/signin/signin_status_metrics_provider_chromeos.h
@@ -0,0 +1,43 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_SIGNIN_SIGNIN_STATUS_METRICS_PROVIDER_CHROMEOS_H_
+#define CHROME_BROWSER_SIGNIN_SIGNIN_STATUS_METRICS_PROVIDER_CHROMEOS_H_
+
+#include "base/gtest_prod_util.h"
+#include "components/signin/core/browser/signin_status_metrics_provider_base.h"
+
+// Record and report the browser sign-in status on ChromeOS during each UMA
+// session. On ChromeOS, the browser can only be at unsigned-in status when
+// browsing as a guest, or before the user logs in (i.e. the user sees a login
+// window.) When user logs out, the browser process is terminated. Therefore,
+// the browser's sign-in status during one UMA session can only be alway
+// signed-in, or always unsigned-in, or changing from unsigned-in to signed-in.
+class SigninStatusMetricsProviderChromeOS
+    : public SigninStatusMetricsProviderBase {
+ public:
+  SigninStatusMetricsProviderChromeOS();
+  ~SigninStatusMetricsProviderChromeOS() override;
+
+  // SigninStatusMetricsProviderBase:
+  void ProvideGeneralMetrics(
+      metrics::ChromeUserMetricsExtension* uma_proto) override;
+
+ private:
+  FRIEND_TEST_ALL_PREFIXES(SigninStatusMetricsProviderChromeOS,
+                           ComputeSigninStatusToUpload);
+
+  // Sets the |signin_status_| purely based on if the user is currently logged
+  // in to a non-guest profile.
+  void SetCurrentSigninStatus();
+
+  // Compute the sign-in status to upload to UMA log given the recorded sign-in
+  // status and if user is logged in now.
+  SigninStatus ComputeSigninStatusToUpload(SigninStatus recorded_status,
+                                           bool logged_in_now);
+
+  DISALLOW_COPY_AND_ASSIGN(SigninStatusMetricsProviderChromeOS);
+};
+
+#endif  // CHROME_BROWSER_SIGNIN_SIGNIN_STATUS_METRICS_PROVIDER_CHROMEOS_H_
diff --git a/chrome/browser/signin/signin_status_metrics_provider_chromeos_unittest.cc b/chrome/browser/signin/signin_status_metrics_provider_chromeos_unittest.cc
new file mode 100644
index 0000000..0a41d3bf
--- /dev/null
+++ b/chrome/browser/signin/signin_status_metrics_provider_chromeos_unittest.cc
@@ -0,0 +1,36 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/signin/signin_status_metrics_provider_chromeos.h"
+
+#include <string>
+
+#include "base/files/file_path.h"
+#include "testing/gtest/include/gtest/gtest.h"
+
+TEST(SigninStatusMetricsProviderChromeOS, ComputeSigninStatusToUpload) {
+  SigninStatusMetricsProviderChromeOS metrics_provider =
+      SigninStatusMetricsProviderChromeOS();
+
+  SigninStatusMetricsProviderBase::SigninStatus status_to_upload =
+      metrics_provider.ComputeSigninStatusToUpload(
+          SigninStatusMetricsProviderBase::ALL_PROFILES_SIGNED_IN, true);
+  EXPECT_EQ(SigninStatusMetricsProviderBase::ALL_PROFILES_SIGNED_IN,
+            status_to_upload);
+
+  status_to_upload = metrics_provider.ComputeSigninStatusToUpload(
+      SigninStatusMetricsProviderBase::ALL_PROFILES_NOT_SIGNED_IN, false);
+  EXPECT_EQ(SigninStatusMetricsProviderBase::ALL_PROFILES_NOT_SIGNED_IN,
+            status_to_upload);
+
+  status_to_upload = metrics_provider.ComputeSigninStatusToUpload(
+      SigninStatusMetricsProviderBase::ALL_PROFILES_NOT_SIGNED_IN, true);
+  EXPECT_EQ(SigninStatusMetricsProviderBase::MIXED_SIGNIN_STATUS,
+            status_to_upload);
+
+  status_to_upload = metrics_provider.ComputeSigninStatusToUpload(
+      SigninStatusMetricsProviderBase::ALL_PROFILES_SIGNED_IN, false);
+  EXPECT_EQ(SigninStatusMetricsProviderBase::ERROR_GETTING_SIGNIN_STATUS,
+            status_to_upload);
+}
diff --git a/chrome/browser/supervised_user/supervised_user_service.cc b/chrome/browser/supervised_user/supervised_user_service.cc
index e3593a6..5ea32d6 100644
--- a/chrome/browser/supervised_user/supervised_user_service.cc
+++ b/chrome/browser/supervised_user/supervised_user_service.cc
@@ -253,24 +253,26 @@
 }
 
 std::string SupervisedUserService::GetCustodianEmailAddress() const {
-  std::string custodian_email = profile_->GetPrefs()->GetString(
+  std::string email = profile_->GetPrefs()->GetString(
       prefs::kSupervisedUserCustodianEmail);
 #if defined(OS_CHROMEOS)
-  if (custodian_email.empty()) {
-    custodian_email = chromeos::ChromeUserManager::Get()
+  // |GetActiveUser()| can return null in unit tests.
+  if (email.empty() && !!user_manager::UserManager::Get()->GetActiveUser()) {
+    email = chromeos::ChromeUserManager::Get()
         ->GetSupervisedUserManager()
         ->GetManagerDisplayEmail(
             user_manager::UserManager::Get()->GetActiveUser()->email());
   }
 #endif
-  return custodian_email;
+  return email;
 }
 
 std::string SupervisedUserService::GetCustodianName() const {
   std::string name = profile_->GetPrefs()->GetString(
       prefs::kSupervisedUserCustodianName);
 #if defined(OS_CHROMEOS)
-  if (name.empty()) {
+  // |GetActiveUser()| can return null in unit tests.
+  if (name.empty() && !!user_manager::UserManager::Get()->GetActiveUser()) {
     name = base::UTF16ToUTF8(chromeos::ChromeUserManager::Get()
         ->GetSupervisedUserManager()
         ->GetManagerDisplayName(
@@ -291,6 +293,11 @@
   return name.empty() ? GetSecondCustodianEmailAddress() : name;
 }
 
+base::string16 SupervisedUserService::GetExtensionsLockedMessage() const {
+  return l10n_util::GetStringFUTF16(IDS_EXTENSIONS_LOCKED_SUPERVISED_USER,
+                                    base::UTF8ToUTF16(GetCustodianName()));
+}
+
 #if !defined(OS_ANDROID) && !defined(OS_IOS)
 void SupervisedUserService::InitSync(const std::string& refresh_token) {
   StartSetupSync();
@@ -878,7 +885,7 @@
   ExtensionState result = GetExtensionState(extension);
   bool may_load = (result != EXTENSION_BLOCKED);
   if (!may_load && error)
-    *error = l10n_util::GetStringUTF16(IDS_EXTENSIONS_LOCKED_SUPERVISED_USER);
+    *error = GetExtensionsLockedMessage();
   return may_load;
 }
 
@@ -889,7 +896,7 @@
   ExtensionState result = GetExtensionState(extension);
   bool may_modify = (result == EXTENSION_ALLOWED);
   if (!may_modify && error)
-    *error = l10n_util::GetStringUTF16(IDS_EXTENSIONS_LOCKED_SUPERVISED_USER);
+    *error = GetExtensionsLockedMessage();
   return may_modify;
 }
 
@@ -903,7 +910,7 @@
   ExtensionState result = GetExtensionState(extension);
   bool may_not_uninstall = (result == EXTENSION_FORCED);
   if (may_not_uninstall && error)
-    *error = l10n_util::GetStringUTF16(IDS_EXTENSIONS_LOCKED_SUPERVISED_USER);
+    *error = GetExtensionsLockedMessage();
   return may_not_uninstall;
 }
 
diff --git a/chrome/browser/supervised_user/supervised_user_service.h b/chrome/browser/supervised_user/supervised_user_service.h
index abdbb805..32f115d3 100644
--- a/chrome/browser/supervised_user/supervised_user_service.h
+++ b/chrome/browser/supervised_user/supervised_user_service.h
@@ -132,6 +132,10 @@
   // is empty, or the empty string is there is no second custodian.
   std::string GetSecondCustodianName() const;
 
+  // Returns a message saying that extensions can only be modified by the
+  // custodian.
+  base::string16 GetExtensionsLockedMessage() const;
+
 #if !defined(OS_ANDROID) && !defined(OS_IOS)
   // Initializes this profile for syncing, using the provided |refresh_token| to
   // mint access tokens for Sync.
diff --git a/chrome/browser/sync/glue/synced_tab_delegate.cc b/chrome/browser/sync/glue/synced_tab_delegate.cc
index 4d51259e..54fde076b 100644
--- a/chrome/browser/sync/glue/synced_tab_delegate.cc
+++ b/chrome/browser/sync/glue/synced_tab_delegate.cc
@@ -36,10 +36,10 @@
   if (ProfileIsSupervised() && GetBlockedNavigations()->size() > 0)
     return true;
 
-  int entry_count = GetEntryCount();
-  if (entry_count == 0)
+  if (IsInitialBlankNavigation())
     return false;  // This deliberately ignores a new pending entry.
 
+  int entry_count = GetEntryCount();
   bool found_valid_url = false;
   for (int i = 0; i < entry_count; ++i) {
     const content::NavigationEntry* entry = GetEntryAtIndexMaybePending(i);
diff --git a/chrome/browser/sync/glue/synced_tab_delegate.h b/chrome/browser/sync/glue/synced_tab_delegate.h
index a223478..b026c537 100644
--- a/chrome/browser/sync/glue/synced_tab_delegate.h
+++ b/chrome/browser/sync/glue/synced_tab_delegate.h
@@ -40,7 +40,7 @@
   virtual std::string GetExtensionAppId() const = 0;
 
   // Methods from NavigationController.
-
+  virtual bool IsInitialBlankNavigation() const = 0;
   virtual int GetCurrentEntryIndex() const = 0;
   virtual int GetEntryCount() const = 0;
   virtual int GetPendingEntryIndex() const = 0;
diff --git a/chrome/browser/sync/glue/synced_tab_delegate_android.cc b/chrome/browser/sync/glue/synced_tab_delegate_android.cc
index 9002387..a3b04d7 100644
--- a/chrome/browser/sync/glue/synced_tab_delegate_android.cc
+++ b/chrome/browser/sync/glue/synced_tab_delegate_android.cc
@@ -46,6 +46,10 @@
   return tab_contents_delegate_->GetExtensionAppId();
 }
 
+bool SyncedTabDelegateAndroid::IsInitialBlankNavigation() const {
+  return tab_contents_delegate_->IsInitialBlankNavigation();
+}
+
 int SyncedTabDelegateAndroid::GetCurrentEntryIndex() const {
   return tab_contents_delegate_->GetCurrentEntryIndex();
 }
diff --git a/chrome/browser/sync/glue/synced_tab_delegate_android.h b/chrome/browser/sync/glue/synced_tab_delegate_android.h
index 7a94fc42f..c7bd04a 100644
--- a/chrome/browser/sync/glue/synced_tab_delegate_android.h
+++ b/chrome/browser/sync/glue/synced_tab_delegate_android.h
@@ -32,6 +32,7 @@
   bool IsBeingDestroyed() const override;
   Profile* profile() const override;
   std::string GetExtensionAppId() const override;
+  bool IsInitialBlankNavigation() const override;
   int GetCurrentEntryIndex() const override;
   int GetEntryCount() const override;
   int GetPendingEntryIndex() const override;
diff --git a/chrome/browser/sync/glue/synced_tab_delegate_unittest.cc b/chrome/browser/sync/glue/synced_tab_delegate_unittest.cc
index ee848ee..f6b0623 100644
--- a/chrome/browser/sync/glue/synced_tab_delegate_unittest.cc
+++ b/chrome/browser/sync/glue/synced_tab_delegate_unittest.cc
@@ -44,6 +44,11 @@
   bool IsBeingDestroyed() const override { return false; }
   Profile* profile() const override { return NULL; }
   std::string GetExtensionAppId() const override { return ""; }
+  bool IsInitialBlankNavigation() const override {
+    // This differs from NavigationControllerImpl, which has an initial blank
+    // NavigationEntry.
+    return GetEntryCount() == 0;
+  }
   int GetCurrentEntryIndex() const override { return current_index_; }
   int GetEntryCount() const override { return indexed_entries_.size(); }
   int GetPendingEntryIndex() const override { return pending_index_; }
diff --git a/chrome/browser/sync/profile_sync_components_factory_impl.cc b/chrome/browser/sync/profile_sync_components_factory_impl.cc
index a0eecba..211f7f69 100644
--- a/chrome/browser/sync/profile_sync_components_factory_impl.cc
+++ b/chrome/browser/sync/profile_sync_components_factory_impl.cc
@@ -117,11 +117,7 @@
 
 syncer::ModelTypeSet GetEnabledTypesFromCommandLine(
     const base::CommandLine& command_line) {
-  syncer::ModelTypeSet enabled_types;
-  if (command_line.HasSwitch(autofill::switches::kEnableWalletMetadataSync))
-    enabled_types.Put(syncer::AUTOFILL_WALLET_METADATA);
-
-  return enabled_types;
+  return syncer::ModelTypeSet();
 }
 
 }  // namespace
@@ -195,10 +191,10 @@
             error_callback, sync_client, syncer::AUTOFILL_WALLET_DATA));
   }
 
-  // Wallet metadata sync depends on Wallet data sync and is disabled by
-  // default. Register if Wallet data is syncing and metadata sync is explicitly
-  // enabled.
-  if (!wallet_disabled && enabled_types.Has(syncer::AUTOFILL_WALLET_METADATA)) {
+  // Wallet metadata sync depends on Wallet data sync. Register if Wallet data
+  // is syncing and metadata sync is not explicitly disabled.
+  if (!wallet_disabled &&
+      !disabled_types.Has(syncer::AUTOFILL_WALLET_METADATA)) {
     sync_service->RegisterDataTypeController(
         new browser_sync::AutofillWalletDataTypeController(
             BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI),
diff --git a/chrome/browser/sync/profile_sync_components_factory_impl_unittest.cc b/chrome/browser/sync/profile_sync_components_factory_impl_unittest.cc
index 1525972..df46117 100644
--- a/chrome/browser/sync/profile_sync_components_factory_impl_unittest.cc
+++ b/chrome/browser/sync/profile_sync_components_factory_impl_unittest.cc
@@ -52,6 +52,7 @@
     datatypes.push_back(syncer::AUTOFILL);
     datatypes.push_back(syncer::AUTOFILL_PROFILE);
     datatypes.push_back(syncer::AUTOFILL_WALLET_DATA);
+    datatypes.push_back(syncer::AUTOFILL_WALLET_METADATA);
     datatypes.push_back(syncer::BOOKMARKS);
     datatypes.push_back(syncer::DEVICE_INFO);
 #if defined(OS_LINUX) || defined(OS_WIN) || defined(OS_CHROMEOS)
diff --git a/chrome/browser/sync/sessions/page_revisit_broadcaster.cc b/chrome/browser/sync/sessions/page_revisit_broadcaster.cc
index a9c31505..a2973f53 100644
--- a/chrome/browser/sync/sessions/page_revisit_broadcaster.cc
+++ b/chrome/browser/sync/sessions/page_revisit_broadcaster.cc
@@ -8,9 +8,13 @@
 #include <vector>
 
 #include "base/metrics/field_trial.h"
+#include "chrome/browser/history/history_service_factory.h"
+#include "chrome/browser/profiles/profile.h"
 #include "chrome/browser/sync/glue/synced_session_util.h"
 #include "chrome/browser/sync/sessions/sessions_sync_manager.h"
+#include "components/history/core/browser/history_service.h"
 #include "components/sync_sessions/revisit/sessions_page_revisit_observer.h"
+#include "components/sync_sessions/revisit/typed_url_page_revisit_observer.h"
 
 namespace browser_sync {
 
@@ -47,8 +51,13 @@
         scoped_ptr<sync_sessions::ForeignSessionsProvider>(
             new SessionsSyncManagerWrapper(manager))));
 
+    history::HistoryService* history =
+        HistoryServiceFactory::GetForProfileWithoutCreating(profile);
+    if (history) {
+      revisit_observers_.push_back(
+          new sync_sessions::TypedUrlPageRevisitObserver(history));
+    }
     // TODO(skym): Add bookmarks observer.
-    // TODO(skym): Add typed URL observer.
   }
 }
 
diff --git a/chrome/browser/sync/sessions/sessions_sync_manager_unittest.cc b/chrome/browser/sync/sessions/sessions_sync_manager_unittest.cc
index 2bea561..c0cc2fc 100644
--- a/chrome/browser/sync/sessions/sessions_sync_manager_unittest.cc
+++ b/chrome/browser/sync/sessions/sessions_sync_manager_unittest.cc
@@ -379,6 +379,11 @@
                             blocked_navigations_(NULL) {}
   ~SyncedTabDelegateFake() override {}
 
+  bool IsInitialBlankNavigation() const override {
+    // This differs from NavigationControllerImpl, which has an initial blank
+    // NavigationEntry.
+    return GetEntryCount() == 0;
+  }
   int GetCurrentEntryIndex() const override { return current_entry_index_; }
   void set_current_entry_index(int i) {
     current_entry_index_ = i;
diff --git a/chrome/browser/sync/test/integration/single_client_wallet_sync_test.cc b/chrome/browser/sync/test/integration/single_client_wallet_sync_test.cc
index 3a49d89..9acd993 100644
--- a/chrome/browser/sync/test/integration/single_client_wallet_sync_test.cc
+++ b/chrome/browser/sync/test/integration/single_client_wallet_sync_test.cc
@@ -137,7 +137,7 @@
       syncer::AUTOFILL_WALLET_DATA));
   // TODO(pvalenzuela): Assert that the local root node for AUTOFILL_WALLET_DATA
   // exists.
-  ASSERT_FALSE(GetClient(0)->service()->GetActiveDataTypes().Has(
+  ASSERT_TRUE(GetClient(0)->service()->GetActiveDataTypes().Has(
       syncer::AUTOFILL_WALLET_METADATA));
 }
 
@@ -157,7 +157,7 @@
   ASSERT_TRUE(SetupSync()) << "SetupSync() failed";
   ASSERT_TRUE(GetClient(0)->service()->GetActiveDataTypes().Has(
       syncer::AUTOFILL_WALLET_DATA));
-  ASSERT_FALSE(GetClient(0)->service()->GetActiveDataTypes().Has(
+  ASSERT_TRUE(GetClient(0)->service()->GetActiveDataTypes().Has(
       syncer::AUTOFILL_WALLET_METADATA));
 }
 
@@ -185,7 +185,7 @@
   ASSERT_FALSE(enabled_checker.TimedOut());
   ASSERT_TRUE(GetClient(0)->service()->GetActiveDataTypes().Has(
       syncer::AUTOFILL_WALLET_DATA));
-  ASSERT_FALSE(GetClient(0)->service()->GetActiveDataTypes().Has(
+  ASSERT_TRUE(GetClient(0)->service()->GetActiveDataTypes().Has(
       syncer::AUTOFILL_WALLET_METADATA));
 
   // Then disable the experiment.
diff --git a/chrome/browser/sync/test/integration/two_client_extensions_sync_test.cc b/chrome/browser/sync/test/integration/two_client_extensions_sync_test.cc
index 1b841a7..095afa8 100644
--- a/chrome/browser/sync/test/integration/two_client_extensions_sync_test.cc
+++ b/chrome/browser/sync/test/integration/two_client_extensions_sync_test.cc
@@ -36,8 +36,14 @@
   ASSERT_TRUE(AwaitAllProfilesHaveSameExtensions());
 }
 
+// Flaky on Mac: http://crbug.com/535996
+#if defined(OS_MACOSX)
+#define MAYBE_StartWithSameExtensions_E2ETest DISABLED_StartWithSameExtensions_E2ETest
+#else
+#define MAYBE_StartWithSameExtensions_E2ETest StartWithSameExtensions_E2ETest
+#endif
 IN_PROC_BROWSER_TEST_F(TwoClientExtensionsSyncTest,
-                       StartWithSameExtensions_E2ETest) {
+                       MAYBE_StartWithSameExtensions_E2ETest) {
   ASSERT_TRUE(SetupClients());
 
   const int kNumExtensions = 5;
diff --git a/chrome/browser/ui/BUILD.gn b/chrome/browser/ui/BUILD.gn
index 7b6a902..38628cb 100644
--- a/chrome/browser/ui/BUILD.gn
+++ b/chrome/browser/ui/BUILD.gn
@@ -18,6 +18,11 @@
   defines = []
   libs = []
 
+  if (is_clang) {
+    # TODO(thakis): Remove this once http://crbug.com/383820 is figured out
+    cflags = [ "-Wno-nonnull" ]
+  }
+
   configs += [
     "//build/config:precompiled_headers",
     "//build/config/compiler:wexit_time_destructors",
diff --git a/chrome/browser/ui/app_list/extension_app_model_builder.cc b/chrome/browser/ui/app_list/extension_app_model_builder.cc
index 32bc979..ec4c287 100644
--- a/chrome/browser/ui/app_list/extension_app_model_builder.cc
+++ b/chrome/browser/ui/app_list/extension_app_model_builder.cc
@@ -128,7 +128,7 @@
 
 void ExtensionAppModelBuilder::OnBeginExtensionInstall(
     const ExtensionInstallParams& params) {
-  if (!params.is_app || params.is_ephemeral)
+  if (!params.is_app)
     return;
 
   DVLOG(2) << service_ << ": OnBeginExtensionInstall: "
diff --git a/chrome/browser/ui/app_list/search/webstore/webstore_result.cc b/chrome/browser/ui/app_list/search/webstore/webstore_result.cc
index 80f9b35..d160709 100644
--- a/chrome/browser/ui/app_list/search/webstore/webstore_result.cc
+++ b/chrome/browser/ui/app_list/search/webstore/webstore_result.cc
@@ -9,7 +9,6 @@
 #include "base/bind.h"
 #include "base/memory/ref_counted.h"
 #include "base/strings/utf_string_conversions.h"
-#include "chrome/browser/apps/ephemeral_app_launcher.h"
 #include "chrome/browser/extensions/extension_service.h"
 #include "chrome/browser/extensions/install_tracker.h"
 #include "chrome/browser/extensions/install_tracker_factory.h"
diff --git a/chrome/browser/ui/browser_content_setting_bubble_model_delegate.cc b/chrome/browser/ui/browser_content_setting_bubble_model_delegate.cc
index 8736fa5f..79e8569 100644
--- a/chrome/browser/ui/browser_content_setting_bubble_model_delegate.cc
+++ b/chrome/browser/ui/browser_content_setting_bubble_model_delegate.cc
@@ -32,31 +32,26 @@
 
 void BrowserContentSettingBubbleModelDelegate::ShowContentSettingsPage(
     ContentSettingsType type) {
-  switch (type) {
-    case CONTENT_SETTINGS_TYPE_MIXEDSCRIPT:
-      // We don't (yet?) implement user-settable exceptions for mixed script
-      // blocking, so bounce to an explanatory page for now.
-      content_settings::RecordMixedScriptAction(
-          content_settings::MIXED_SCRIPT_ACTION_CLICKED_LEARN_MORE);
-      chrome::AddSelectedTabWithURL(browser_,
-                                    GURL(kInsecureScriptHelpUrl),
-                                    ui::PAGE_TRANSITION_LINK);
-      return;
-    case CONTENT_SETTINGS_TYPE_PROTOCOL_HANDLERS:
-      chrome::ShowSettingsSubPage(browser_, chrome::kHandlerSettingsSubPage);
-      return;
-    case CONTENT_SETTINGS_TYPE_MEDIASTREAM:
-      // If the user requested to see the settings page for both camera
-      // and microphone, point them to the default settings instead of
-      // exceptions, as camera and microphone exceptions are now in two
-      // different overlays. Specifically, point them to the microphone
-      // default settings, as those appear first in the list.
-      chrome::ShowContentSettings(
-          browser_, CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC);
-      return;
-    default:
-      chrome::ShowContentSettingsExceptions(browser_, type);
-      return;
+  if (type == CONTENT_SETTINGS_TYPE_MIXEDSCRIPT) {
+    // We don't (yet?) implement user-settable exceptions for mixed script
+    // blocking, so bounce to an explanatory page for now.
+    content_settings::RecordMixedScriptAction(
+        content_settings::MIXED_SCRIPT_ACTION_CLICKED_LEARN_MORE);
+    chrome::AddSelectedTabWithURL(browser_,
+                                  GURL(kInsecureScriptHelpUrl),
+                                  ui::PAGE_TRANSITION_LINK);
+  } else if (type == CONTENT_SETTINGS_TYPE_PROTOCOL_HANDLERS) {
+    chrome::ShowSettingsSubPage(browser_, chrome::kHandlerSettingsSubPage);
+  } else if (type == CONTENT_SETTINGS_TYPE_MEDIASTREAM) {
+    // If the user requested to see the settings page for both camera
+    // and microphone, point them to the default settings instead of
+    // exceptions, as camera and microphone exceptions are now in two
+    // different overlays. Specifically, point them to the microphone
+    // default settings, as those appear first in the list.
+    chrome::ShowContentSettings(
+        browser_, CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC);
+  } else {
+    chrome::ShowContentSettingsExceptions(browser_, type);
   }
 }
 
diff --git a/chrome/browser/ui/cocoa/first_run_dialog.mm b/chrome/browser/ui/cocoa/first_run_dialog.mm
index d6946e4..2fa51f9 100644
--- a/chrome/browser/ui/cocoa/first_run_dialog.mm
+++ b/chrome/browser/ui/cocoa/first_run_dialog.mm
@@ -38,19 +38,6 @@
 
 namespace {
 
-// Compare function for -[NSArray sortedArrayUsingFunction:context:] that
-// sorts the views in Y order bottom up.
-NSInteger CompareFrameY(id view1, id view2, void* context) {
-  CGFloat y1 = NSMinY([view1 frame]);
-  CGFloat y2 = NSMinY([view2 frame]);
-  if (y1 < y2)
-    return NSOrderedAscending;
-  else if (y1 > y2)
-    return NSOrderedDescending;
-  else
-    return NSOrderedSame;
-}
-
 class FirstRunShowBridge : public base::RefCounted<FirstRunShowBridge> {
  public:
   FirstRunShowBridge(FirstRunDialogController* controller);
@@ -220,8 +207,16 @@
 
     // Walk bottom up shuffling for all the hidden views.
     NSArray* subViews =
-        [[[win contentView] subviews] sortedArrayUsingFunction:CompareFrameY
-                                                       context:NULL];
+        [[[win contentView] subviews] sortedArrayUsingComparator:^(id a, id b) {
+          CGFloat y1 = NSMinY([a frame]);
+          CGFloat y2 = NSMinY([b frame]);
+          if (y1 < y2)
+            return NSOrderedAscending;
+          else if (y1 > y2)
+            return NSOrderedDescending;
+          else
+            return NSOrderedSame;
+        }];
     CGFloat moveDown = 0.0;
     NSUInteger numSubViews = [subViews count];
     for (NSUInteger idx = 0 ; idx < numSubViews ; ++idx) {
diff --git a/chrome/browser/ui/cocoa/handoff_active_url_observer.cc b/chrome/browser/ui/cocoa/handoff_active_url_observer.cc
index 592a757..a2862e4 100644
--- a/chrome/browser/ui/cocoa/handoff_active_url_observer.cc
+++ b/chrome/browser/ui/cocoa/handoff_active_url_observer.cc
@@ -14,25 +14,21 @@
 HandoffActiveURLObserver::HandoffActiveURLObserver(
     HandoffActiveURLObserverDelegate* delegate)
     : delegate_(delegate),
-      active_tab_strip_model_(nullptr),
       active_browser_(nullptr) {
   DCHECK(delegate_);
 
-  active_browser_ = chrome::FindLastActiveWithHostDesktopType(
-      chrome::HOST_DESKTOP_TYPE_NATIVE);
   BrowserList::AddObserver(this);
-  UpdateObservations();
+  SetActiveBrowser(chrome::FindLastActiveWithHostDesktopType(
+      chrome::HOST_DESKTOP_TYPE_NATIVE));
 }
 
 HandoffActiveURLObserver::~HandoffActiveURLObserver() {
   BrowserList::RemoveObserver(this);
-  StopObservingTabStripModel();
-  StopObservingWebContents();
+  SetActiveBrowser(nullptr);
 }
 
 void HandoffActiveURLObserver::OnBrowserSetLastActive(Browser* browser) {
-  active_browser_ = browser;
-  UpdateObservations();
+  SetActiveBrowser(browser);
   delegate_->HandoffActiveURLChanged(GetActiveWebContents());
 }
 
@@ -40,9 +36,8 @@
   if (active_browser_ != removed_browser)
     return;
 
-  active_browser_ = chrome::FindLastActiveWithHostDesktopType(
-      chrome::HOST_DESKTOP_TYPE_NATIVE);
-  UpdateObservations();
+  SetActiveBrowser(chrome::FindLastActiveWithHostDesktopType(
+      chrome::HOST_DESKTOP_TYPE_NATIVE));
   delegate_->HandoffActiveURLChanged(GetActiveWebContents());
 }
 
@@ -55,54 +50,28 @@
   delegate_->HandoffActiveURLChanged(new_contents);
 }
 
-void HandoffActiveURLObserver::TabStripModelDeleted() {
-  StopObservingTabStripModel();
-  StopObservingWebContents();
-}
-
 void HandoffActiveURLObserver::DidNavigateMainFrame(
     const content::LoadCommittedDetails& details,
     const content::FrameNavigateParams& params) {
   delegate_->HandoffActiveURLChanged(web_contents());
 }
 
-void HandoffActiveURLObserver::WebContentsDestroyed() {
-  StopObservingWebContents();
-}
-
-void HandoffActiveURLObserver::UpdateObservations() {
-  if (!active_browser_) {
-    StopObservingTabStripModel();
-    StopObservingWebContents();
+void HandoffActiveURLObserver::SetActiveBrowser(Browser* active_browser) {
+  if (active_browser == active_browser_)
     return;
+
+  if (active_browser_) {
+    active_browser_->tab_strip_model()->RemoveObserver(this);
+    StopObservingWebContents();
   }
 
-  TabStripModel* model = active_browser_->tab_strip_model();
-  StartObservingTabStripModel(model);
+  active_browser_ = active_browser;
 
-  content::WebContents* web_contents = model->GetActiveWebContents();
-  if (web_contents)
-    StartObservingWebContents(web_contents);
-  else
-    StopObservingWebContents();
-}
-
-void HandoffActiveURLObserver::StartObservingTabStripModel(
-    TabStripModel* tab_strip_model) {
-  DCHECK(tab_strip_model);
-
-  if (active_tab_strip_model_ == tab_strip_model)
-    return;
-
-  StopObservingTabStripModel();
-  tab_strip_model->AddObserver(this);
-  active_tab_strip_model_ = tab_strip_model;
-}
-
-void HandoffActiveURLObserver::StopObservingTabStripModel() {
-  if (active_tab_strip_model_) {
-    active_tab_strip_model_->RemoveObserver(this);
-    active_tab_strip_model_ = nullptr;
+  if (active_browser_) {
+    active_browser_->tab_strip_model()->AddObserver(this);
+    content::WebContents* web_contents = GetActiveWebContents();
+    if (web_contents)
+      StartObservingWebContents(web_contents);
   }
 }
 
diff --git a/chrome/browser/ui/cocoa/handoff_active_url_observer.h b/chrome/browser/ui/cocoa/handoff_active_url_observer.h
index a46ed98..d866d46 100644
--- a/chrome/browser/ui/cocoa/handoff_active_url_observer.h
+++ b/chrome/browser/ui/cocoa/handoff_active_url_observer.h
@@ -37,24 +37,14 @@
                         content::WebContents* new_contents,
                         int index,
                         int reason) override;
-  void TabStripModelDeleted() override;
 
   // content::WebContentsObserver
   void DidNavigateMainFrame(
       const content::LoadCommittedDetails& details,
       const content::FrameNavigateParams& params) override;
-  void WebContentsDestroyed() override;
 
-  // This method ensures that the instance is registered as an observer of the
-  // correct TabStripModel and WebContents for |active_browser_|.
-  void UpdateObservations();
-
-  // Makes this object start observing the TabStripModel, if it is not already
-  // doing so. This method is idempotent.
-  void StartObservingTabStripModel(TabStripModel* tab_strip_model);
-
-  // Makes this object stop observing the TabStripModel.
-  void StopObservingTabStripModel();
+  // Updates the active browser.
+  void SetActiveBrowser(Browser* active_browser);
 
   // Makes this object start observing the WebContents, if it is not already
   // doing so. This method is idempotent.
@@ -69,10 +59,6 @@
   // Instances of this class should be owned by their |delegate_|.
   HandoffActiveURLObserverDelegate* delegate_;
 
-  // When this pointer is not nullptr, this object is registered as an observer
-  // of the TabStripModel.
-  TabStripModel* active_tab_strip_model_;
-
   // This pointer is always up to date, and points to the most recently
   // activated browser, or nullptr if no browsers exist.
   Browser* active_browser_;
diff --git a/chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_editor.mm b/chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_editor.mm
index 1d8b1da1..33fbafa 100644
--- a/chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_editor.mm
+++ b/chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_editor.mm
@@ -393,14 +393,6 @@
   [super insertText:aString];
 }
 
-- (void)setMarkedText:(id)aString selectedRange:(NSRange)selRange {
-  [super setMarkedText:aString selectedRange:selRange];
-
-  // Because the OmniboxViewMac class treats marked text as content,
-  // we need to treat the change to marked text as content change as well.
-  [self didChangeText];
-}
-
 - (NSRange)selectionRangeForProposedRange:(NSRange)proposedSelRange
                               granularity:(NSSelectionGranularity)granularity {
   AutocompleteTextFieldObserver* observer = [self observer];
diff --git a/chrome/browser/ui/cocoa/one_click_signin_bubble_controller_browsertest.mm b/chrome/browser/ui/cocoa/one_click_signin_bubble_controller_browsertest.mm
index 3b6eff27..5976a85d 100644
--- a/chrome/browser/ui/cocoa/one_click_signin_bubble_controller_browsertest.mm
+++ b/chrome/browser/ui/cocoa/one_click_signin_bubble_controller_browsertest.mm
@@ -4,11 +4,13 @@
 
 #import "chrome/browser/ui/cocoa/one_click_signin_bubble_controller.h"
 
+#include "base/mac/foundation_util.h"
 #include "chrome/browser/ui/browser.h"
 #include "chrome/browser/ui/browser_finder.h"
 #import "chrome/browser/ui/cocoa/browser_window_cocoa.h"
 #import "chrome/browser/ui/cocoa/one_click_signin_view_controller.h"
 #include "chrome/browser/ui/tabs/tab_strip_model.h"
+#include "chrome/common/url_constants.h"
 #include "chrome/test/base/in_process_browser_test.h"
 #import "testing/gtest_mac.h"
 
@@ -84,9 +86,12 @@
 IN_PROC_BROWSER_TEST_F(OneClickSigninBubbleControllerTest, LearnMore) {
   EXPECT_EQ(1u, chrome::GetTotalBrowserCount());
   EXPECT_EQ(1, browser()->tab_strip_model()->count());
-  [[controller_ viewController] textView:nil
-                           clickedOnLink:nil
-                                 atIndex:0];
+  OneClickSigninViewController* view_controller =
+      base::mac::ObjCCastStrict<OneClickSigninViewController>(
+          [controller_ viewController]);
+  [view_controller textView:[view_controller linkViewForTesting]
+              clickedOnLink:@(chrome::kChromeSyncLearnMoreURL)
+                    atIndex:0];
   EXPECT_EQ(1u, chrome::GetTotalBrowserCount());
   EXPECT_EQ(2, browser()->tab_strip_model()->count());
   EXPECT_EQ(0, callback_count_);
diff --git a/chrome/browser/ui/cocoa/one_click_signin_dialog_controller_browsertest.mm b/chrome/browser/ui/cocoa/one_click_signin_dialog_controller_browsertest.mm
index 4047e3a..32cad33 100644
--- a/chrome/browser/ui/cocoa/one_click_signin_dialog_controller_browsertest.mm
+++ b/chrome/browser/ui/cocoa/one_click_signin_dialog_controller_browsertest.mm
@@ -4,10 +4,12 @@
 
 #import "chrome/browser/ui/cocoa/one_click_signin_dialog_controller.h"
 
+#include "base/mac/foundation_util.h"
 #include "chrome/browser/ui/browser.h"
 #include "chrome/browser/ui/browser_finder.h"
 #import "chrome/browser/ui/cocoa/one_click_signin_view_controller.h"
 #include "chrome/browser/ui/tabs/tab_strip_model.h"
+#include "chrome/common/url_constants.h"
 #include "chrome/test/base/in_process_browser_test.h"
 #import "testing/gtest_mac.h"
 
@@ -81,8 +83,11 @@
 // Test that clicking the learn more link opens a new window.
 IN_PROC_BROWSER_TEST_F(OneClickSigninDialogControllerTest, LearnMore) {
   EXPECT_EQ(1u, chrome::GetTotalBrowserCount());
-  [controller_->view_controller() textView:nil
-                             clickedOnLink:nil
-                                   atIndex:0];
+  OneClickSigninViewController* view_controller =
+      base::mac::ObjCCastStrict<OneClickSigninViewController>(
+          controller_->view_controller());
+  [view_controller textView:[view_controller linkViewForTesting]
+              clickedOnLink:@(chrome::kChromeSyncLearnMoreURL)
+                    atIndex:0];
   EXPECT_EQ(2u, chrome::GetTotalBrowserCount());
 }
diff --git a/chrome/browser/ui/cocoa/one_click_signin_view_controller.h b/chrome/browser/ui/cocoa/one_click_signin_view_controller.h
index 9e293c1b2..0bc98534 100644
--- a/chrome/browser/ui/cocoa/one_click_signin_view_controller.h
+++ b/chrome/browser/ui/cocoa/one_click_signin_view_controller.h
@@ -78,4 +78,8 @@
 
 @end
 
+@interface OneClickSigninViewController (TestingAPI)
+- (NSTextView*)linkViewForTesting;
+@end
+
 #endif  // CHROME_BROWSER_UI_COCOA_ONE_CLICK_SIGNIN_VIEW_CONTROLLER_H_
diff --git a/chrome/browser/ui/cocoa/one_click_signin_view_controller.mm b/chrome/browser/ui/cocoa/one_click_signin_view_controller.mm
index 3af047b..0cc0502 100644
--- a/chrome/browser/ui/cocoa/one_click_signin_view_controller.mm
+++ b/chrome/browser/ui/cocoa/one_click_signin_view_controller.mm
@@ -42,7 +42,6 @@
 
 @implementation OneClickSigninViewController
 
-
 - (id)initWithNibName:(NSString*)nibName
           webContents:(content::WebContents*)webContents
          syncCallback:(const BrowserWindow::StartSyncCallback&)syncCallback
@@ -303,3 +302,11 @@
 }
 
 @end
+
+@implementation OneClickSigninViewController (TestingAPI)
+
+- (NSTextView*)linkViewForTesting {
+  return informativeTextView_.get();
+}
+
+@end
diff --git a/chrome/browser/ui/cocoa/passwords/manage_passwords_bubble_manage_view_controller_unittest.mm b/chrome/browser/ui/cocoa/passwords/manage_passwords_bubble_manage_view_controller_unittest.mm
index 8da3740..6cedc26 100644
--- a/chrome/browser/ui/cocoa/passwords/manage_passwords_bubble_manage_view_controller_unittest.mm
+++ b/chrome/browser/ui/cocoa/passwords/manage_passwords_bubble_manage_view_controller_unittest.mm
@@ -78,7 +78,7 @@
   map.insert(base::ASCIIToUTF16("username2"), form2.Pass());
 
   // Add the entries to the model.
-  ui_controller()->OnPasswordAutofilled(map);
+  ui_controller()->OnPasswordAutofilled(map, map.begin()->second->origin);
   model()->set_state(password_manager::ui::MANAGE_STATE);
 
   // Check the view state.
diff --git a/chrome/browser/ui/cocoa/tabs/tab_strip_model_observer_bridge.h b/chrome/browser/ui/cocoa/tabs/tab_strip_model_observer_bridge.h
index d5244162..878c252 100644
--- a/chrome/browser/ui/cocoa/tabs/tab_strip_model_observer_bridge.h
+++ b/chrome/browser/ui/cocoa/tabs/tab_strip_model_observer_bridge.h
@@ -54,7 +54,6 @@
   void TabPinnedStateChanged(content::WebContents* contents,
                              int index) override;
   void TabStripEmpty() override;
-  void TabStripModelDeleted() override;
 
  private:
   id controller_;  // weak, owns me
@@ -89,7 +88,6 @@
 - (void)tabPinnedStateChangedWithContents:(content::WebContents*)contents
                                   atIndex:(NSInteger)index;
 - (void)tabStripEmpty;
-- (void)tabStripModelDeleted;
 - (void)tabSelectionChanged;
 @end
 
diff --git a/chrome/browser/ui/cocoa/tabs/tab_strip_model_observer_bridge.mm b/chrome/browser/ui/cocoa/tabs/tab_strip_model_observer_bridge.mm
index 248862c..fd5db4d 100644
--- a/chrome/browser/ui/cocoa/tabs/tab_strip_model_observer_bridge.mm
+++ b/chrome/browser/ui/cocoa/tabs/tab_strip_model_observer_bridge.mm
@@ -125,8 +125,3 @@
   if ([controller_ respondsToSelector:@selector(tabStripEmpty)])
     [controller_ tabStripEmpty];
 }
-
-void TabStripModelObserverBridge::TabStripModelDeleted() {
-  if ([controller_ respondsToSelector:@selector(tabStripModelDeleted)])
-    [controller_ tabStripModelDeleted];
-}
diff --git a/chrome/browser/ui/cocoa/wrench_menu/wrench_menu_controller_unittest.mm b/chrome/browser/ui/cocoa/wrench_menu/wrench_menu_controller_unittest.mm
index 57fa5f44..1a6ae6d 100644
--- a/chrome/browser/ui/cocoa/wrench_menu/wrench_menu_controller_unittest.mm
+++ b/chrome/browser/ui/cocoa/wrench_menu/wrench_menu_controller_unittest.mm
@@ -40,15 +40,7 @@
 class MockWrenchMenuModel : public WrenchMenuModel {
  public:
   MockWrenchMenuModel() : WrenchMenuModel() {}
-  ~MockWrenchMenuModel() {
-    // This dirty, ugly hack gets around a bug in the test. In
-    // ~WrenchMenuModel(), there's a call to TabstripModel::RemoveObserver(this)
-    // which mysteriously leads to this crash: http://crbug.com/49206 .  It
-    // seems that the vector of observers is getting hosed somewhere between
-    // |-[ToolbarController dealloc]| and ~MockWrenchMenuModel(). This line
-    // short-circuits the parent destructor to avoid this crash.
-    tab_strip_model_ = NULL;
-  }
+  ~MockWrenchMenuModel() {}
   MOCK_METHOD2(ExecuteCommand, void(int command_id, int event_flags));
 };
 
diff --git a/chrome/browser/ui/libgtk2ui/BUILD.gn b/chrome/browser/ui/libgtk2ui/BUILD.gn
index 3ad3e5c5..7fb0bed4 100644
--- a/chrome/browser/ui/libgtk2ui/BUILD.gn
+++ b/chrome/browser/ui/libgtk2ui/BUILD.gn
@@ -33,14 +33,10 @@
     "chrome_gtk_frame.h",
     "chrome_gtk_menu_subclasses.cc",
     "chrome_gtk_menu_subclasses.h",
-    "g_object_destructor_filo.cc",
-    "g_object_destructor_filo.h",
     "gtk2_event_loop.cc",
     "gtk2_event_loop.h",
     "gtk2_key_bindings_handler.cc",
     "gtk2_key_bindings_handler.h",
-    "gtk2_signal_registrar.cc",
-    "gtk2_signal_registrar.h",
     "gtk2_status_icon.cc",
     "gtk2_status_icon.h",
     "gtk2_ui.cc",
diff --git a/chrome/browser/ui/libgtk2ui/g_object_destructor_filo.cc b/chrome/browser/ui/libgtk2ui/g_object_destructor_filo.cc
deleted file mode 100644
index 54ed7ee..0000000
--- a/chrome/browser/ui/libgtk2ui/g_object_destructor_filo.cc
+++ /dev/null
@@ -1,89 +0,0 @@
-// Copyright (c) 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.
-
-#include "chrome/browser/ui/libgtk2ui/g_object_destructor_filo.h"
-
-#include <glib-object.h>
-
-#include "base/logging.h"
-#include "base/memory/singleton.h"
-
-namespace libgtk2ui {
-
-GObjectDestructorFILO::GObjectDestructorFILO() {
-}
-
-GObjectDestructorFILO::~GObjectDestructorFILO() {
-  // Probably CHECK(handler_map_.empty()) would look natural here. But
-  // some tests (some views_unittests) violate this assertion.
-}
-
-// static
-GObjectDestructorFILO* GObjectDestructorFILO::GetInstance() {
-  return base::Singleton<GObjectDestructorFILO>::get();
-}
-
-void GObjectDestructorFILO::Connect(
-    GObject* object, DestructorHook callback, void* context) {
-  const Hook hook(object, callback, context);
-  HandlerMap::iterator iter = handler_map_.find(object);
-  if (iter == handler_map_.end()) {
-    g_object_weak_ref(object, WeakNotifyThunk, this);
-    handler_map_[object].push_front(hook);
-  } else {
-    iter->second.push_front(hook);
-  }
-}
-
-void GObjectDestructorFILO::Disconnect(
-    GObject* object, DestructorHook callback, void* context) {
-  HandlerMap::iterator iter = handler_map_.find(object);
-  if (iter == handler_map_.end()) {
-    LOG(DFATAL) << "Unable to disconnect destructor hook for object " << object
-                << ": hook not found (" << callback << ", " << context << ").";
-    return;
-  }
-  HandlerList& dtors = iter->second;
-  if (dtors.empty()) {
-    LOG(DFATAL) << "Destructor list is empty for specified object " << object
-                << " Maybe it is being executed?";
-    return;
-  }
-  if (!dtors.front().equal(object, callback, context)) {
-    // Reenable this warning once this bug is fixed:
-    // http://code.google.com/p/chromium/issues/detail?id=85603
-    DVLOG(1) << "Destructors should be unregistered the reverse order they "
-             << "were registered. But for object " << object << " "
-             << "deleted hook is "<< context << ", the last queued hook is "
-             << dtors.front().context;
-  }
-  for (HandlerList::iterator i = dtors.begin(); i != dtors.end(); ++i) {
-    if (i->equal(object, callback, context)) {
-      dtors.erase(i);
-      break;
-    }
-  }
-  if (dtors.empty()) {
-    g_object_weak_unref(object, WeakNotifyThunk, this);
-    handler_map_.erase(iter);
-  }
-}
-
-void GObjectDestructorFILO::WeakNotify(GObject* where_the_object_was) {
-  HandlerMap::iterator iter = handler_map_.find(where_the_object_was);
-  DCHECK(iter != handler_map_.end());
-  DCHECK(!iter->second.empty());
-
-  // Save destructor list for given object into local copy to avoid reentrancy
-  // problem: if callee wants to modify the caller list.
-  HandlerList dtors;
-  iter->second.swap(dtors);
-  handler_map_.erase(iter);
-
-  // Execute hooks in local list in FILO order.
-  for (HandlerList::iterator i = dtors.begin(); i != dtors.end(); ++i)
-    i->callback(i->context, where_the_object_was);
-}
-
-}  // namespace libgtk2ui
diff --git a/chrome/browser/ui/libgtk2ui/g_object_destructor_filo.h b/chrome/browser/ui/libgtk2ui/g_object_destructor_filo.h
deleted file mode 100644
index b32f3df..0000000
--- a/chrome/browser/ui/libgtk2ui/g_object_destructor_filo.h
+++ /dev/null
@@ -1,92 +0,0 @@
-// Copyright (c) 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 CHROME_BROWSER_UI_LIBGTK2UI_G_OBJECT_DESTRUCTOR_FILO_H_
-#define CHROME_BROWSER_UI_LIBGTK2UI_G_OBJECT_DESTRUCTOR_FILO_H_
-
-#include <glib.h>
-#include <list>
-#include <map>
-
-#include "base/basictypes.h"
-
-namespace base {
-template <typename T> struct DefaultSingletonTraits;
-}
-
-typedef struct _GObject GObject;
-
-namespace libgtk2ui {
-
-// This class hooks calls to g_object_weak_ref()/unref() and executes them in
-// FILO order. This is important if there are several hooks to the single object
-// (set up at different levels of class hierarchy) and the lowest hook (set up
-// first) is deleting self - it must be called last (among hooks for the given
-// object). Unfortunately Glib does not provide this guarantee.
-//
-// Use it as follows:
-//
-// static void OnDestroyedThunk(gpointer data, GObject *where_the_object_was) {
-//   reinterpret_cast<MyClass*>(data)->OnDestroyed(where_the_object_was);
-// }
-// void MyClass::OnDestroyed(GObject *where_the_object_was) {
-//   destroyed_ = true;
-//   delete this;
-// }
-// MyClass::Init() {
-//   ...
-//   ui::GObjectDestructorFILO::GetInstance()->Connect(
-//       G_OBJECT(my_widget), &OnDestroyedThunk, this);
-// }
-// MyClass::~MyClass() {
-//   if (!destroyed_) {
-//     ui::GObjectDestructorFILO::GetInstance()->Disconnect(
-//         G_OBJECT(my_widget), &OnDestroyedThunk, this);
-//   }
-// }
-//
-// TODO(glotov): Probably worth adding ScopedGObjectDtor<T>.
-//
-// This class is a singleton. Not thread safe. Must be called within UI thread.
-class GObjectDestructorFILO {
- public:
-  typedef void (*DestructorHook)(void* context, GObject* where_the_object_was);
-
-  static GObjectDestructorFILO* GetInstance();
-  void Connect(GObject* object, DestructorHook callback, void* context);
-  void Disconnect(GObject* object, DestructorHook callback, void* context);
-
- private:
-  struct Hook {
-    Hook(GObject* o, DestructorHook cb, void* ctx)
-        : object(o), callback(cb), context(ctx) {
-    }
-    bool equal(GObject* o, DestructorHook cb, void* ctx) const {
-      return object == o && callback == cb && context == ctx;
-    }
-    GObject* object;
-    DestructorHook callback;
-    void* context;
-  };
-  typedef std::list<Hook> HandlerList;
-  typedef std::map<GObject*, HandlerList> HandlerMap;
-
-  GObjectDestructorFILO();
-  ~GObjectDestructorFILO();
-  friend struct base::DefaultSingletonTraits<GObjectDestructorFILO>;
-
-  void WeakNotify(GObject* where_the_object_was);
-  static void WeakNotifyThunk(gpointer data, GObject* where_the_object_was) {
-    reinterpret_cast<GObjectDestructorFILO*>(data)->WeakNotify(
-        where_the_object_was);
-  }
-
-  HandlerMap handler_map_;
-
-  DISALLOW_COPY_AND_ASSIGN(GObjectDestructorFILO);
-};
-
-}  // namespace libgtk2ui
-
-#endif  // CHROME_BROWSER_UI_LIBGTK2UI_G_OBJECT_DESTRUCTOR_FILO_H_
diff --git a/chrome/browser/ui/libgtk2ui/gtk2_signal_registrar.cc b/chrome/browser/ui/libgtk2ui/gtk2_signal_registrar.cc
deleted file mode 100644
index 9d878e2..0000000
--- a/chrome/browser/ui/libgtk2ui/gtk2_signal_registrar.cc
+++ /dev/null
@@ -1,98 +0,0 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "chrome/browser/ui/libgtk2ui/gtk2_signal_registrar.h"
-
-#include <glib-object.h>
-
-#include "base/logging.h"
-#include "chrome/browser/ui/libgtk2ui/g_object_destructor_filo.h"
-
-namespace libgtk2ui {
-
-Gtk2SignalRegistrar::Gtk2SignalRegistrar() {
-}
-
-Gtk2SignalRegistrar::~Gtk2SignalRegistrar() {
-  for (HandlerMap::iterator list_iter = handler_lists_.begin();
-       list_iter != handler_lists_.end(); ++list_iter) {
-    GObject* object = list_iter->first;
-    GObjectDestructorFILO::GetInstance()->Disconnect(
-        object, WeakNotifyThunk, this);
-
-    HandlerList& handlers = list_iter->second;
-    for (HandlerList::iterator ids_iter = handlers.begin();
-         ids_iter != handlers.end(); ++ids_iter) {
-      g_signal_handler_disconnect(object, *ids_iter);
-    }
-  }
-}
-
-glong Gtk2SignalRegistrar::Connect(gpointer instance,
-                                   const gchar* detailed_signal,
-                                   GCallback signal_handler,
-                                   gpointer data) {
-  return ConnectInternal(instance, detailed_signal, signal_handler, data,
-                         false);
-}
-
-glong Gtk2SignalRegistrar::ConnectAfter(gpointer instance,
-                                        const gchar* detailed_signal,
-                                        GCallback signal_handler,
-                                        gpointer data) {
-  return ConnectInternal(instance, detailed_signal, signal_handler, data, true);
-}
-
-glong Gtk2SignalRegistrar::ConnectInternal(gpointer instance,
-                                          const gchar* detailed_signal,
-                                          GCallback signal_handler,
-                                          gpointer data,
-                                          bool after) {
-  GObject* object = G_OBJECT(instance);
-
-  HandlerMap::iterator iter = handler_lists_.find(object);
-  if (iter == handler_lists_.end()) {
-    GObjectDestructorFILO::GetInstance()->Connect(
-        object, WeakNotifyThunk, this);
-    handler_lists_[object] = HandlerList();
-    iter = handler_lists_.find(object);
-  }
-
-  glong handler_id = after ?
-      g_signal_connect_after(instance, detailed_signal, signal_handler, data) :
-      g_signal_connect(instance, detailed_signal, signal_handler, data);
-  iter->second.push_back(handler_id);
-
-  return handler_id;
-}
-
-void Gtk2SignalRegistrar::WeakNotify(GObject* where_the_object_was) {
-  HandlerMap::iterator iter = handler_lists_.find(where_the_object_was);
-  if (iter == handler_lists_.end()) {
-    NOTREACHED();
-    return;
-  }
-  // The signal handlers will be disconnected automatically. Just erase the
-  // handler id list.
-  handler_lists_.erase(iter);
-}
-
-void Gtk2SignalRegistrar::DisconnectAll(gpointer instance) {
-  GObject* object = G_OBJECT(instance);
-  HandlerMap::iterator iter = handler_lists_.find(object);
-  if (iter == handler_lists_.end())
-    return;
-
-  GObjectDestructorFILO::GetInstance()->Disconnect(
-      object, WeakNotifyThunk, this);
-  HandlerList& handlers = iter->second;
-  for (HandlerList::iterator ids_iter = handlers.begin();
-       ids_iter != handlers.end(); ++ids_iter) {
-    g_signal_handler_disconnect(object, *ids_iter);
-  }
-
-  handler_lists_.erase(iter);
-}
-
-}  // namespace libgtk2ui
diff --git a/chrome/browser/ui/libgtk2ui/gtk2_signal_registrar.h b/chrome/browser/ui/libgtk2ui/gtk2_signal_registrar.h
deleted file mode 100644
index e83fbad..0000000
--- a/chrome/browser/ui/libgtk2ui/gtk2_signal_registrar.h
+++ /dev/null
@@ -1,74 +0,0 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef CHROME_BROWSER_UI_LIBGTK2UI_GTK2_SIGNAL_REGISTRAR_H_
-#define CHROME_BROWSER_UI_LIBGTK2UI_GTK2_SIGNAL_REGISTRAR_H_
-
-#include <glib.h>
-#include <map>
-#include <vector>
-
-#include "base/basictypes.h"
-
-typedef void (*GCallback) (void);
-typedef struct _GObject GObject;
-typedef struct _GtkWidget GtkWidget;
-
-namespace libgtk2ui {
-
-// A class that ensures that callbacks don't run on stale owner objects. Similar
-// in spirit to NotificationRegistrar. Use as follows:
-//
-//   class ChromeObject {
-//    public:
-//     ChromeObject() {
-//       ...
-//
-//       signals_.Connect(widget, "event", CallbackThunk, this);
-//     }
-//
-//     ...
-//
-//    private:
-//     Gtk2SignalRegistrar signals_;
-//   };
-//
-// When |signals_| goes down, it will disconnect the handlers connected via
-// Connect.
-class Gtk2SignalRegistrar {
- public:
-  Gtk2SignalRegistrar();
-  ~Gtk2SignalRegistrar();
-
-  // Connect before the default handler. Returns the handler id.
-  glong Connect(gpointer instance, const gchar* detailed_signal,
-                GCallback signal_handler, gpointer data);
-  // Connect after the default handler. Returns the handler id.
-  glong ConnectAfter(gpointer instance, const gchar* detailed_signal,
-                     GCallback signal_handler, gpointer data);
-
-  // Disconnects all signal handlers connected to |instance|.
-  void DisconnectAll(gpointer instance);
-
- private:
-  typedef std::vector<glong> HandlerList;
-  typedef std::map<GObject*, HandlerList> HandlerMap;
-
-  static void WeakNotifyThunk(gpointer data, GObject* where_the_object_was) {
-    reinterpret_cast<Gtk2SignalRegistrar*>(data)->WeakNotify(
-        where_the_object_was);
-  }
-  void WeakNotify(GObject* where_the_object_was);
-
-  glong ConnectInternal(gpointer instance, const gchar* detailed_signal,
-                        GCallback signal_handler, gpointer data, bool after);
-
-  HandlerMap handler_lists_;
-
-  DISALLOW_COPY_AND_ASSIGN(Gtk2SignalRegistrar);
-};
-
-}  // namespace libgtk2ui
-
-#endif  // CHROME_BROWSER_UI_LIBGTK2UI_GTK2_SIGNAL_REGISTRAR_H_
diff --git a/chrome/browser/ui/libgtk2ui/gtk2_ui.cc b/chrome/browser/ui/libgtk2ui/gtk2_ui.cc
index 9774c055..3e20da3 100644
--- a/chrome/browser/ui/libgtk2ui/gtk2_ui.cc
+++ b/chrome/browser/ui/libgtk2ui/gtk2_ui.cc
@@ -23,7 +23,6 @@
 #include "chrome/browser/ui/libgtk2ui/app_indicator_icon.h"
 #include "chrome/browser/ui/libgtk2ui/gtk2_event_loop.h"
 #include "chrome/browser/ui/libgtk2ui/gtk2_key_bindings_handler.h"
-#include "chrome/browser/ui/libgtk2ui/gtk2_signal_registrar.h"
 #include "chrome/browser/ui/libgtk2ui/gtk2_status_icon.h"
 #include "chrome/browser/ui/libgtk2ui/gtk2_util.h"
 #include "chrome/browser/ui/libgtk2ui/native_theme_gtk2.h"
@@ -165,12 +164,9 @@
 
 class GtkButtonImageSource : public gfx::ImageSkiaSource {
   public:
-    GtkButtonImageSource(bool is_blue, bool focus, ui::NativeTheme::State state)
-        : is_blue_(is_blue),
-          focus_(focus),
-          state_(state) {
-    }
-    explicit GtkButtonImageSource(const char* idr_string) {
+    GtkButtonImageSource(const char* idr_string, gfx::Size size)
+        : width_(size.width()),
+          height_(size.height()) {
       is_blue_ = !!strstr(idr_string, "IDR_BLUE");
       focus_ = !!strstr(idr_string, "_FOCUSED_");
 
@@ -188,8 +184,8 @@
     ~GtkButtonImageSource() override {}
 
     gfx::ImageSkiaRep GetImageForScale(float scale) override {
-      int width = 32 * scale;
-      int height = 32 * scale;
+      int width = width_ * scale;
+      int height = height_ * scale;
 
       SkBitmap border;
       border.allocN32Pixels(width, height);
@@ -221,6 +217,9 @@
       cairo_t* cr = cairo_create(surface);
 
 #if GTK_MAJOR_VERSION == 2
+      if (focus_)
+        GTK_WIDGET_SET_FLAGS(button, GTK_HAS_FOCUS);
+
       int w, h;
       GdkPixmap* pixmap;
 
@@ -244,21 +243,12 @@
       g_object_unref(pixmap);
 #else
       gtk_widget_draw(button, cr);
-#endif
 
-      if (focus_) {
-        SkColor button_color = NativeThemeGtk2::instance()->GetSystemColor(
-            is_blue_ ? ui::NativeTheme::kColorId_BlueButtonEnabledColor
-                     : ui::NativeTheme::kColorId_ButtonEnabledColor);
-        cairo_set_source_rgba(cr,
-                              SkColorGetR(button_color) / 256.0,
-                              SkColorGetG(button_color) / 256.0,
-                              SkColorGetB(button_color) / 256.0,
-                              0.5);
-        cairo_set_line_width(cr, 1);
-        cairo_rectangle(cr, 4.5, 4.5, width - 9, height - 9);
-        cairo_stroke(cr);
-      }
+      // There's probably a better way to do this
+      if (focus_)
+        gtk_render_focus(gtk_widget_get_style_context(button),
+                         cr, 0, 0, width, height);
+#endif
 
       cairo_destroy(cr);
       cairo_surface_destroy(surface);
@@ -272,11 +262,35 @@
     bool is_blue_;
     bool focus_;
     ui::NativeTheme::State state_;
+    int width_;
+    int height_;
 
     DISALLOW_COPY_AND_ASSIGN(GtkButtonImageSource);
 };
 
 
+class GtkButtonPainter : public views::Painter {
+  public:
+    explicit GtkButtonPainter(std::string idr) : idr_(idr) {}
+    ~GtkButtonPainter() override {}
+
+    gfx::Size GetMinimumSize() const override {
+      return gfx::Size();
+    }
+    void Paint(gfx::Canvas* canvas, const gfx::Size& size) override {
+      gfx::ImageSkiaSource* source =
+          new GtkButtonImageSource(idr_.c_str(), size);
+      gfx::ImageSkia image(source, 1);
+      canvas->DrawImageInt(image, 0, 0);
+    }
+
+  private:
+    std::string idr_;
+
+    DISALLOW_COPY_AND_ASSIGN(GtkButtonPainter);
+};
+
+
 
 struct GObjectDeleter {
   void operator()(void* ptr) {
@@ -754,63 +768,53 @@
   scoped_ptr<views::LabelButtonAssetBorder> gtk_border(
       new views::LabelButtonAssetBorder(owning_button->style()));
 
-  // Arbitrarily chosen
-  const gfx::Insets insets(6, 6, 6, 6);
   gtk_border->set_insets(border->GetInsets());
 
-  // Clear default LabelButtonAssetBorder values
-  gtk_border->SetPainter(false, views::Button::STATE_NORMAL, NULL);
-  gtk_border->SetPainter(false, views::Button::STATE_HOVERED, NULL);
-  gtk_border->SetPainter(false, views::Button::STATE_PRESSED, NULL);
-  gtk_border->SetPainter(false, views::Button::STATE_DISABLED, NULL);
-  gtk_border->SetPainter(true, views::Button::STATE_NORMAL, NULL);
-  gtk_border->SetPainter(true, views::Button::STATE_HOVERED, NULL);
-  gtk_border->SetPainter(true, views::Button::STATE_PRESSED, NULL);
-  gtk_border->SetPainter(true, views::Button::STATE_DISABLED, NULL);
-
-
   static struct {
-    int idr;
-    int idr_blue;
+    const char* idr;
+    const char* idr_blue;
     bool focus;
     views::Button::ButtonState state;
-  } const painters[] = {
-    { IDR_BUTTON_NORMAL, IDR_BLUE_BUTTON_NORMAL,
-      false, views::Button::STATE_NORMAL},
+  } const paintstate[] = {
+    { "IDR_BUTTON_NORMAL",
+      "IDR_BLUE_BUTTON_NORMAL",
+      false, views::Button::STATE_NORMAL, },
+    { "IDR_BUTTON_HOVER",
+      "IDR_BLUE_BUTTON_HOVER",
+      false, views::Button::STATE_HOVERED, },
+    { "IDR_BUTTON_PRESSED",
+      "IDR_BLUE_BUTTON_PRESSED",
+      false, views::Button::STATE_PRESSED, },
+    { "IDR_BUTTON_DISABLED",
+      "IDR_BLUE_BUTTON_DISABLED",
+      false, views::Button::STATE_DISABLED, },
 
-    { IDR_BUTTON_HOVER, IDR_BLUE_BUTTON_HOVER,
-      false, views::Button::STATE_HOVERED},
-
-    { IDR_BUTTON_PRESSED, IDR_BLUE_BUTTON_PRESSED,
-      false, views::Button::STATE_PRESSED},
-
-    { IDR_BUTTON_FOCUSED_NORMAL, IDR_BLUE_BUTTON_FOCUSED_NORMAL,
-      true, views::Button::STATE_NORMAL},
-
-    { IDR_BUTTON_FOCUSED_HOVER, IDR_BLUE_BUTTON_FOCUSED_HOVER,
-      true, views::Button::STATE_HOVERED},
-
-    { IDR_BUTTON_FOCUSED_PRESSED, IDR_BLUE_BUTTON_FOCUSED_PRESSED,
-      true, views::Button::STATE_PRESSED},
-
-
-    { IDR_BUTTON_DISABLED, IDR_BLUE_BUTTON_DISABLED,
-      false, views::Button::STATE_DISABLED},
-    { IDR_BUTTON_DISABLED, IDR_BLUE_BUTTON_DISABLED,
-      true, views::Button::STATE_DISABLED},
+    { "IDR_BUTTON_FOCUSED_NORMAL",
+      "IDR_BLUE_BUTTON_FOCUSED_NORMAL",
+      true, views::Button::STATE_NORMAL, },
+    { "IDR_BUTTON_FOCUSED_HOVER",
+      "IDR_BLUE_BUTTON_FOCUSED_HOVER",
+      true, views::Button::STATE_HOVERED, },
+    { "IDR_BUTTON_FOCUSED_PRESSED",
+      "IDR_BLUE_BUTTON_FOCUSED_PRESSED",
+      true, views::Button::STATE_PRESSED, },
+    { "IDR_BUTTON_DISABLED",
+      "IDR_BLUE_BUTTON_DISABLED",
+      true, views::Button::STATE_DISABLED, },
   };
 
   bool is_blue =
       owning_button->GetClassName() == views::BlueButton::kViewClassName;
 
-  for (unsigned i = 0; i < (sizeof(painters) / sizeof(painters[0])); i++) {
-    if (border->PaintsButtonState(painters[i].focus, painters[i].state)) {
-      int idr = is_blue ? painters[i].idr_blue : painters[i].idr;
-      const gfx::ImageSkia* img = GetThemeImageNamed(idr).ToImageSkia();
+  for (unsigned i = 0; i < arraysize(paintstate); i++) {
+    views::Painter* painter = nullptr;
 
-      gtk_border->SetPainter(painters[i].focus, painters[i].state,
-                             views::Painter::CreateImagePainter(*img, insets));
+    if (border->PaintsButtonState(paintstate[i].focus, paintstate[i].state)) {
+      std::string idr = is_blue ? paintstate[i].idr_blue : paintstate[i].idr;
+      painter = new GtkButtonPainter(idr);
     }
+
+    gtk_border->SetPainter(paintstate[i].focus, paintstate[i].state, painter);
   }
 
   return gtk_border.Pass();;
@@ -1145,37 +1149,18 @@
 
     // The toolbar bezels don't seem to be in use anymore, remove at your
     // discretion
-    case IDR_TOOLBAR_BEZEL_HOVER:
-      source = new GtkButtonImageSource(false, false,
-                                        ui::NativeTheme::kHovered);
+    case IDR_TOOLBAR_BEZEL_HOVER: {
+      gfx::Size size = ResourceBundle::GetSharedInstance().
+          GetImageSkiaNamed(id)->size();
+      source = new GtkButtonImageSource("IDR_BUTTON_HOVER", size);
       break;
-    case IDR_TOOLBAR_BEZEL_PRESSED:
-      source = new GtkButtonImageSource(false, false,
-                                        ui::NativeTheme::kPressed);
+    }
+    case IDR_TOOLBAR_BEZEL_PRESSED: {
+      gfx::Size size = ResourceBundle::GetSharedInstance().
+          GetImageSkiaNamed(id)->size();
+      source = new GtkButtonImageSource("IDR_BUTTON_PRESSED", size);
       break;
-
-    // Macro to prevent the cases here from getting ridiculous
-#   define BUTTON_IMAGE_CASE(IDR_MACRO_) \
-    case IDR_MACRO_: \
-      source = new GtkButtonImageSource(#IDR_MACRO_); \
-      break;
-
-    BUTTON_IMAGE_CASE(IDR_BUTTON_DISABLED);
-    BUTTON_IMAGE_CASE(IDR_BUTTON_HOVER);
-    BUTTON_IMAGE_CASE(IDR_BUTTON_NORMAL);
-    BUTTON_IMAGE_CASE(IDR_BUTTON_PRESSED);
-    BUTTON_IMAGE_CASE(IDR_BUTTON_FOCUSED_HOVER);
-    BUTTON_IMAGE_CASE(IDR_BUTTON_FOCUSED_NORMAL);
-    BUTTON_IMAGE_CASE(IDR_BUTTON_FOCUSED_PRESSED);
-    BUTTON_IMAGE_CASE(IDR_BLUE_BUTTON_DISABLED);
-    BUTTON_IMAGE_CASE(IDR_BLUE_BUTTON_HOVER);
-    BUTTON_IMAGE_CASE(IDR_BLUE_BUTTON_NORMAL);
-    BUTTON_IMAGE_CASE(IDR_BLUE_BUTTON_PRESSED);
-    BUTTON_IMAGE_CASE(IDR_BLUE_BUTTON_FOCUSED_HOVER);
-    BUTTON_IMAGE_CASE(IDR_BLUE_BUTTON_FOCUSED_NORMAL);
-    BUTTON_IMAGE_CASE(IDR_BLUE_BUTTON_FOCUSED_PRESSED);
-
-#   undef BUTTON_IMAGE_CASE
+    }
   }
 
   if (source)
diff --git a/chrome/browser/ui/libgtk2ui/gtk2_ui.h b/chrome/browser/ui/libgtk2ui/gtk2_ui.h
index 69e23c8..781569c 100644
--- a/chrome/browser/ui/libgtk2ui/gtk2_ui.h
+++ b/chrome/browser/ui/libgtk2ui/gtk2_ui.h
@@ -13,7 +13,6 @@
 #include "base/memory/scoped_ptr.h"
 #include "base/observer_list.h"
 #include "chrome/browser/ui/libgtk2ui/gtk2_signal.h"
-#include "chrome/browser/ui/libgtk2ui/gtk2_signal_registrar.h"
 #include "chrome/browser/ui/libgtk2ui/libgtk2ui_export.h"
 #include "ui/events/linux/text_edit_key_bindings_delegate_auralinux.h"
 #include "ui/gfx/color_utils.h"
@@ -33,7 +32,6 @@
 namespace libgtk2ui {
 class Gtk2Border;
 class Gtk2KeyBindingsHandler;
-class Gtk2SignalRegistrar;
 class GConfListener;
 
 // Interface to GTK2 desktop features.
diff --git a/chrome/browser/ui/libgtk2ui/libgtk2ui.gyp b/chrome/browser/ui/libgtk2ui/libgtk2ui.gyp
index 3660035..c57b3b7 100644
--- a/chrome/browser/ui/libgtk2ui/libgtk2ui.gyp
+++ b/chrome/browser/ui/libgtk2ui/libgtk2ui.gyp
@@ -58,16 +58,12 @@
         'chrome_gtk_frame.h',
         'chrome_gtk_menu_subclasses.cc',
         'chrome_gtk_menu_subclasses.h',
-        'g_object_destructor_filo.cc',
-        'g_object_destructor_filo.h',
         'gconf_listener.cc',
         'gconf_listener.h',
         'gtk2_event_loop.cc',
         'gtk2_event_loop.h',
         'gtk2_key_bindings_handler.cc',
         'gtk2_key_bindings_handler.h',
-        'gtk2_signal_registrar.cc',
-        'gtk2_signal_registrar.h',
         'gtk2_status_icon.cc',
         'gtk2_status_icon.h',
         'gtk2_ui.cc',
diff --git a/chrome/browser/ui/passwords/manage_passwords_state.cc b/chrome/browser/ui/passwords/manage_passwords_state.cc
index 33649b866..c8f70c7 100644
--- a/chrome/browser/ui/passwords/manage_passwords_state.cc
+++ b/chrome/browser/ui/passwords/manage_passwords_state.cc
@@ -145,7 +145,8 @@
 }
 
 void ManagePasswordsState::OnPasswordAutofilled(
-    const PasswordFormMap& password_form_map) {
+    const PasswordFormMap& password_form_map,
+    const GURL& origin) {
   // TODO(vabr): Revert back to DCHECK once http://crbug.com/486931 is fixed.
   CHECK(!password_form_map.empty());
   ClearData();
@@ -156,7 +157,7 @@
     SetState(password_manager::ui::INACTIVE_STATE);
   } else {
     local_credentials_forms_ = DeepCopyMapToVector(password_form_map);
-    origin_ = local_credentials_forms_.front()->origin;
+    origin_ = origin;
     SetState(password_manager::ui::MANAGE_STATE);
   }
 }
diff --git a/chrome/browser/ui/passwords/manage_passwords_state.h b/chrome/browser/ui/passwords/manage_passwords_state.h
index f05f0db..990758c 100644
--- a/chrome/browser/ui/passwords/manage_passwords_state.h
+++ b/chrome/browser/ui/passwords/manage_passwords_state.h
@@ -61,7 +61,11 @@
       scoped_ptr<password_manager::PasswordFormManager> form_manager);
 
   // Move to MANAGE_STATE or INACTIVE_STATE for PSL matched passwords.
-  void OnPasswordAutofilled(const autofill::PasswordFormMap& password_form_map);
+  // |password_form_map| contains best matches from the password store for the
+  // form which was autofilled, |origin| is an origin of the form which was
+  // autofilled.
+  void OnPasswordAutofilled(const autofill::PasswordFormMap& password_form_map,
+                            const GURL& origin);
 
   // Move to INACTIVE_STATE.
   void OnInactive();
diff --git a/chrome/browser/ui/passwords/manage_passwords_state_unittest.cc b/chrome/browser/ui/passwords/manage_passwords_state_unittest.cc
index cff7239..aa84354e 100644
--- a/chrome/browser/ui/passwords/manage_passwords_state_unittest.cc
+++ b/chrome/browser/ui/passwords/manage_passwords_state_unittest.cc
@@ -349,13 +349,14 @@
   password_form_map.insert(
       test_local_form().username_value,
       make_scoped_ptr(new autofill::PasswordForm(test_local_form())));
-  passwords_data().OnPasswordAutofilled(password_form_map);
+  GURL origin("https://example.com");
+  passwords_data().OnPasswordAutofilled(password_form_map, origin);
 
   EXPECT_THAT(passwords_data().GetCurrentForms(),
               ElementsAre(Pointee(test_local_form())));
   EXPECT_THAT(passwords_data().federated_credentials_forms(), IsEmpty());
   EXPECT_EQ(password_manager::ui::MANAGE_STATE, passwords_data().state());
-  EXPECT_EQ(test_local_form().origin, passwords_data().origin());
+  EXPECT_EQ(origin, passwords_data().origin());
 
   // |passwords_data| should hold a separate copy of test_local_form().
   EXPECT_THAT(passwords_data().GetCurrentForms(),
@@ -370,7 +371,8 @@
   password_form_map.insert(
       psl_matched_test_form.username_value,
       make_scoped_ptr(new autofill::PasswordForm(psl_matched_test_form)));
-  passwords_data().OnPasswordAutofilled(password_form_map);
+  passwords_data().OnPasswordAutofilled(password_form_map,
+                                        GURL("https://m.example.com/"));
 
   EXPECT_THAT(passwords_data().GetCurrentForms(), IsEmpty());
   EXPECT_THAT(passwords_data().federated_credentials_forms(), IsEmpty());
@@ -454,7 +456,8 @@
   password_form_map.insert(
       test_local_form().username_value,
       make_scoped_ptr(new autofill::PasswordForm(test_local_form())));
-  passwords_data().OnPasswordAutofilled(password_form_map);
+  passwords_data().OnPasswordAutofilled(
+      password_form_map, password_form_map.begin()->second->origin);
   EXPECT_EQ(password_manager::ui::MANAGE_STATE, passwords_data().state());
 
   TestBlacklistedUpdates();
diff --git a/chrome/browser/ui/passwords/manage_passwords_test.cc b/chrome/browser/ui/passwords/manage_passwords_test.cc
index 2b81ae2..c57cbf8 100644
--- a/chrome/browser/ui/passwords/manage_passwords_test.cc
+++ b/chrome/browser/ui/passwords/manage_passwords_test.cc
@@ -48,7 +48,7 @@
   autofill::PasswordFormMap map;
   map.insert(kTestUsername,
              make_scoped_ptr(new autofill::PasswordForm(*test_form())));
-  GetController()->OnPasswordAutofilled(map);
+  GetController()->OnPasswordAutofilled(map, map.begin()->second->origin);
 }
 
 void ManagePasswordsTest::SetupPendingPassword() {
diff --git a/chrome/browser/ui/passwords/manage_passwords_ui_controller.cc b/chrome/browser/ui/passwords/manage_passwords_ui_controller.cc
index bac8325..55525e2 100644
--- a/chrome/browser/ui/passwords/manage_passwords_ui_controller.cc
+++ b/chrome/browser/ui/passwords/manage_passwords_ui_controller.cc
@@ -157,7 +157,8 @@
 }
 
 void ManagePasswordsUIController::OnPasswordAutofilled(
-    const PasswordFormMap& password_form_map) {
+    const PasswordFormMap& password_form_map,
+    const GURL& origin) {
   // If we fill a form while a dialog is open, then skip the state change; we
   // have
   // the information we need, and the dialog will change its own state once the
@@ -166,7 +167,7 @@
           password_manager::ui::AUTO_SIGNIN_STATE &&
       passwords_data_.state() !=
           password_manager::ui::CREDENTIAL_REQUEST_STATE) {
-    passwords_data_.OnPasswordAutofilled(password_form_map);
+    passwords_data_.OnPasswordAutofilled(password_form_map, origin);
     UpdateBubbleAndIconVisibility();
   }
 }
diff --git a/chrome/browser/ui/passwords/manage_passwords_ui_controller.h b/chrome/browser/ui/passwords/manage_passwords_ui_controller.h
index 924a996..33011572 100644
--- a/chrome/browser/ui/passwords/manage_passwords_ui_controller.h
+++ b/chrome/browser/ui/passwords/manage_passwords_ui_controller.h
@@ -70,7 +70,8 @@
   // password credentials for the current site which are stored in
   // |password_form_map|. This stores a copy of |password_form_map| and shows
   // the manage password icon.
-  void OnPasswordAutofilled(const autofill::PasswordFormMap& password_form_map);
+  void OnPasswordAutofilled(const autofill::PasswordFormMap& password_form_map,
+                            const GURL& origin);
 
   // TODO(vasilii): remove this method. It's obsolete.
   void OnBlacklistBlockedAutofill(
diff --git a/chrome/browser/ui/passwords/manage_passwords_ui_controller_unittest.cc b/chrome/browser/ui/passwords/manage_passwords_ui_controller_unittest.cc
index 4be1ec6..582d41c 100644
--- a/chrome/browser/ui/passwords/manage_passwords_ui_controller_unittest.cc
+++ b/chrome/browser/ui/passwords/manage_passwords_ui_controller_unittest.cc
@@ -234,7 +234,7 @@
   base::string16 kTestUsername = test_form->username_value;
   autofill::PasswordFormMap map;
   map.insert(kTestUsername, test_form.Pass());
-  controller()->OnPasswordAutofilled(map);
+  controller()->OnPasswordAutofilled(map, map.begin()->second->origin);
 
   EXPECT_EQ(password_manager::ui::MANAGE_STATE, controller()->state());
   EXPECT_FALSE(controller()->PasswordPendingUserDecision());
@@ -381,7 +381,7 @@
   autofill::PasswordFormMap map;
   map.insert(kTestUsername,
              make_scoped_ptr(new autofill::PasswordForm(test_local_form())));
-  controller()->OnPasswordAutofilled(map);
+  controller()->OnPasswordAutofilled(map, map.begin()->second->origin);
 
   test_local_form().blacklisted_by_user = true;
   password_manager::PasswordStoreChange change(
@@ -561,7 +561,7 @@
   autofill::PasswordFormMap map;
   base::string16 kTestUsername = test_form->username_value;
   map.insert(kTestUsername, test_form.Pass());
-  controller()->OnPasswordAutofilled(map);
+  controller()->OnPasswordAutofilled(map, map.begin()->second->origin);
 
   ExpectIconAndControllerStateIs(password_manager::ui::AUTO_SIGNIN_STATE);
 }
@@ -573,7 +573,7 @@
       new autofill::PasswordForm(test_local_form()));
   psl_matched_test_form->is_public_suffix_match = true;
   map.insert(kTestUsername, psl_matched_test_form.Pass());
-  controller()->OnPasswordAutofilled(map);
+  controller()->OnPasswordAutofilled(map, map.begin()->second->origin);
 
   EXPECT_EQ(password_manager::ui::INACTIVE_STATE, controller()->state());
 }
diff --git a/chrome/browser/ui/sync/tab_contents_synced_tab_delegate.cc b/chrome/browser/ui/sync/tab_contents_synced_tab_delegate.cc
index 194407f..2dd3d542a 100644
--- a/chrome/browser/ui/sync/tab_contents_synced_tab_delegate.cc
+++ b/chrome/browser/ui/sync/tab_contents_synced_tab_delegate.cc
@@ -57,6 +57,10 @@
   return std::string();
 }
 
+bool TabContentsSyncedTabDelegate::IsInitialBlankNavigation() const {
+  return web_contents_->GetController().IsInitialBlankNavigation();
+}
+
 int TabContentsSyncedTabDelegate::GetCurrentEntryIndex() const {
   return web_contents_->GetController().GetCurrentEntryIndex();
 }
diff --git a/chrome/browser/ui/sync/tab_contents_synced_tab_delegate.h b/chrome/browser/ui/sync/tab_contents_synced_tab_delegate.h
index 4e3c5de..84719fa 100644
--- a/chrome/browser/ui/sync/tab_contents_synced_tab_delegate.h
+++ b/chrome/browser/ui/sync/tab_contents_synced_tab_delegate.h
@@ -26,6 +26,7 @@
   bool IsBeingDestroyed() const override;
   Profile* profile() const override;
   std::string GetExtensionAppId() const override;
+  bool IsInitialBlankNavigation() const override;
   int GetCurrentEntryIndex() const override;
   int GetEntryCount() const override;
   int GetPendingEntryIndex() const override;
diff --git a/chrome/browser/ui/tabs/tab_strip_model.cc b/chrome/browser/ui/tabs/tab_strip_model.cc
index c722fd7a5..7dd211e 100644
--- a/chrome/browser/ui/tabs/tab_strip_model.cc
+++ b/chrome/browser/ui/tabs/tab_strip_model.cc
@@ -249,8 +249,6 @@
 }
 
 TabStripModel::~TabStripModel() {
-  FOR_EACH_OBSERVER(TabStripModelObserver, observers_,
-                    TabStripModelDeleted());
   STLDeleteElements(&contents_data_);
   order_controller_.reset();
 }
diff --git a/chrome/browser/ui/tabs/tab_strip_model_observer.cc b/chrome/browser/ui/tabs/tab_strip_model_observer.cc
index 9fdf1a1..7fb0e5f 100644
--- a/chrome/browser/ui/tabs/tab_strip_model_observer.cc
+++ b/chrome/browser/ui/tabs/tab_strip_model_observer.cc
@@ -66,6 +66,3 @@
 
 void TabStripModelObserver::CloseAllTabsCanceled() {
 }
-
-void TabStripModelObserver::TabStripModelDeleted() {
-}
diff --git a/chrome/browser/ui/tabs/tab_strip_model_observer.h b/chrome/browser/ui/tabs/tab_strip_model_observer.h
index 8f84fe5..cc00b02 100644
--- a/chrome/browser/ui/tabs/tab_strip_model_observer.h
+++ b/chrome/browser/ui/tabs/tab_strip_model_observer.h
@@ -148,10 +148,6 @@
   virtual void WillCloseAllTabs();
   virtual void CloseAllTabsCanceled();
 
-  // Sent when the tabstrip model is about to be deleted and any reference held
-  // must be dropped.
-  virtual void TabStripModelDeleted();
-
  protected:
   virtual ~TabStripModelObserver() {}
 };
diff --git a/chrome/browser/ui/tabs/tab_strip_model_stats_recorder.cc b/chrome/browser/ui/tabs/tab_strip_model_stats_recorder.cc
index 4ae9351b..e61fc3dd 100644
--- a/chrome/browser/ui/tabs/tab_strip_model_stats_recorder.cc
+++ b/chrome/browser/ui/tabs/tab_strip_model_stats_recorder.cc
@@ -15,23 +15,13 @@
 #include "chrome/browser/ui/browser_list.h"
 #include "chrome/browser/ui/tabs/tab_strip_model.h"
 
-TabStripModelStatsRecorder::TabStripModelStatsRecorder() {
-  BrowserList::AddObserver(this);
+TabStripModelStatsRecorder::TabStripModelStatsRecorder()
+    : browser_tab_strip_tracker_(this, nullptr, nullptr) {
+  browser_tab_strip_tracker_.Init(
+      BrowserTabStripTracker::InitWith::ALL_BROWERS);
 }
 
 TabStripModelStatsRecorder::~TabStripModelStatsRecorder() {
-  for (chrome::BrowserIterator iterator; !iterator.done(); iterator.Next())
-    iterator->tab_strip_model()->RemoveObserver(this);
-
-  BrowserList::RemoveObserver(this);
-}
-
-void TabStripModelStatsRecorder::OnBrowserAdded(Browser* browser) {
-  browser->tab_strip_model()->AddObserver(this);
-}
-
-void TabStripModelStatsRecorder::OnBrowserRemoved(Browser* browser) {
-  browser->tab_strip_model()->RemoveObserver(this);
 }
 
 class TabStripModelStatsRecorder::TabInfo
diff --git a/chrome/browser/ui/tabs/tab_strip_model_stats_recorder.h b/chrome/browser/ui/tabs/tab_strip_model_stats_recorder.h
index 57a7a9a..fbb980d 100644
--- a/chrome/browser/ui/tabs/tab_strip_model_stats_recorder.h
+++ b/chrome/browser/ui/tabs/tab_strip_model_stats_recorder.h
@@ -8,8 +8,7 @@
 #include <vector>
 
 #include "base/macros.h"
-
-#include "chrome/browser/ui/browser_list_observer.h"
+#include "chrome/browser/ui/browser_tab_strip_tracker.h"
 #include "chrome/browser/ui/tabs/tab_strip_model_observer.h"
 
 namespace content {
@@ -19,8 +18,7 @@
 // TabStripModelStatsRecorder records user tab interaction stats.
 // In particular, we record tab's lifetime and state transition probability to
 // study user interaction with background tabs. (crbug.com/517335)
-class TabStripModelStatsRecorder : public chrome::BrowserListObserver,
-                                   public TabStripModelObserver {
+class TabStripModelStatsRecorder : public TabStripModelObserver {
  public:
   // TabState represents a lifecycle of a tab in TabStripModel.
   // This should match {Current,Next}TabState defined in
@@ -50,10 +48,6 @@
   ~TabStripModelStatsRecorder() override;
 
  private:
-  // chrome::BrowserListObserver implementation.
-  void OnBrowserAdded(Browser* browser) override;
-  void OnBrowserRemoved(Browser* browser) override;
-
   // TabStripModelObserver implementation.
   void TabClosingAt(TabStripModel* tab_strip_model,
                     content::WebContents* contents,
@@ -71,6 +65,8 @@
 
   std::vector<content::WebContents*> active_tab_history_;
 
+  BrowserTabStripTracker browser_tab_strip_tracker_;
+
   DISALLOW_COPY_AND_ASSIGN(TabStripModelStatsRecorder);
 };
 
diff --git a/chrome/browser/ui/tabs/tab_strip_model_unittest.cc b/chrome/browser/ui/tabs/tab_strip_model_unittest.cc
index 173497ff..9e650b8 100644
--- a/chrome/browser/ui/tabs/tab_strip_model_unittest.cc
+++ b/chrome/browser/ui/tabs/tab_strip_model_unittest.cc
@@ -264,7 +264,6 @@
  public:
   explicit MockTabStripModelObserver(TabStripModel* model)
       : empty_(true),
-        deleted_(false),
         model_(model) {}
   ~MockTabStripModelObserver() override {}
 
@@ -409,21 +408,18 @@
   void CloseAllTabsCanceled() override {
     states_.push_back(State(NULL, -1, CLOSE_ALL_CANCELED));
   }
-  void TabStripModelDeleted() override { deleted_ = true; }
 
   void ClearStates() {
     states_.clear();
   }
 
   bool empty() const { return empty_; }
-  bool deleted() const { return deleted_; }
   TabStripModel* model() { return model_; }
 
  private:
   std::vector<State> states_;
 
   bool empty_;
-  bool deleted_;
   TabStripModel* model_;
 
   DISALLOW_COPY_AND_ASSIGN(MockTabStripModelObserver);
@@ -2281,7 +2277,6 @@
   DeleteWebContentsOnDestroyedObserver observer(contents2, contents1, strip);
   strip->CloseAllTabs();
   EXPECT_TRUE(tab_strip_model_observer.empty());
-  EXPECT_TRUE(tab_strip_model_observer.deleted());
 }
 
 TEST_F(TabStripModelTest, MoveSelectedTabsTo) {
diff --git a/chrome/browser/ui/toolbar/wrench_menu_model.cc b/chrome/browser/ui/toolbar/wrench_menu_model.cc
index 08d6b93..81eed59c 100644
--- a/chrome/browser/ui/toolbar/wrench_menu_model.cc
+++ b/chrome/browser/ui/toolbar/wrench_menu_model.cc
@@ -342,8 +342,7 @@
     : ui::SimpleMenuModel(this),
       uma_action_recorded_(false),
       provider_(provider),
-      browser_(browser),
-      tab_strip_model_(browser_->tab_strip_model()) {
+      browser_(browser) {
   Build();
   UpdateZoomControls();
 
@@ -352,15 +351,15 @@
           ->AddZoomLevelChangedCallback(base::Bind(
               &WrenchMenuModel::OnZoomLevelChanged, base::Unretained(this)));
 
-  tab_strip_model_->AddObserver(this);
+  browser_->tab_strip_model()->AddObserver(this);
 
   registrar_.Add(this, content::NOTIFICATION_NAV_ENTRY_COMMITTED,
                  content::NotificationService::AllSources());
 }
 
 WrenchMenuModel::~WrenchMenuModel() {
-  if (tab_strip_model_)
-    tab_strip_model_->RemoveObserver(this);
+  if (browser_)  // Null in tests.
+    browser_->tab_strip_model()->RemoveObserver(this);
 }
 
 bool WrenchMenuModel::DoesCommandIdDismissMenu(int command_id) const {
@@ -821,13 +820,6 @@
   UpdateZoomControls();
 }
 
-void WrenchMenuModel::TabStripModelDeleted() {
-  // During views shutdown, the tabstrip model/browser is deleted first, while
-  // it is the opposite in gtk land.
-  tab_strip_model_->RemoveObserver(this);
-  tab_strip_model_ = NULL;
-}
-
 void WrenchMenuModel::Observe(int type,
                               const content::NotificationSource& source,
                               const content::NotificationDetails& details) {
@@ -839,9 +831,8 @@
 WrenchMenuModel::WrenchMenuModel()
     : ui::SimpleMenuModel(this),
       uma_action_recorded_(false),
-      provider_(NULL),
-      browser_(NULL),
-      tab_strip_model_(NULL) {}
+      provider_(nullptr),
+      browser_(nullptr) {}
 
 bool WrenchMenuModel::ShouldShowNewIncognitoWindowMenuItem() {
   if (browser_->profile()->IsGuestSession())
diff --git a/chrome/browser/ui/toolbar/wrench_menu_model.h b/chrome/browser/ui/toolbar/wrench_menu_model.h
index 525f47d..d0def8be 100644
--- a/chrome/browser/ui/toolbar/wrench_menu_model.h
+++ b/chrome/browser/ui/toolbar/wrench_menu_model.h
@@ -20,7 +20,6 @@
 class BookmarkSubMenuModel;
 class Browser;
 class RecentTabsSubMenuModel;
-class TabStripModel;
 
 namespace {
 class MockWrenchMenuModel;
@@ -158,7 +157,6 @@
                      content::WebContents* old_contents,
                      content::WebContents* new_contents,
                      int index) override;
-  void TabStripModelDeleted() override;
 
   // Overridden from content::NotificationObserver:
   void Observe(int type,
@@ -245,7 +243,6 @@
   ui::AcceleratorProvider* provider_;  // weak
 
   Browser* browser_;  // weak
-  TabStripModel* tab_strip_model_; // weak
 
   scoped_ptr<content::HostZoomMap::Subscription> browser_zoom_subscription_;
   content::NotificationRegistrar registrar_;
diff --git a/chrome/browser/ui/views/ash/tab_scrubber_browsertest.cc b/chrome/browser/ui/views/ash/tab_scrubber_browsertest.cc
index 5209b396..7bb69db 100644
--- a/chrome/browser/ui/views/ash/tab_scrubber_browsertest.cc
+++ b/chrome/browser/ui/views/ash/tab_scrubber_browsertest.cc
@@ -236,7 +236,6 @@
   void TabBlockedStateChanged(content::WebContents* contents,
                               int index) override {}
   void TabStripEmpty() override {}
-  void TabStripModelDeleted() override {}
 
   // History of tab activation. Scrub() resets it.
   std::vector<int> activation_order_;
diff --git a/chrome/browser/ui/views/find_bar_view.cc b/chrome/browser/ui/views/find_bar_view.cc
index 026e3f75e6..17c95a8b 100644
--- a/chrome/browser/ui/views/find_bar_view.cc
+++ b/chrome/browser/ui/views/find_bar_view.cc
@@ -36,6 +36,9 @@
 #include "ui/native_theme/common_theme.h"
 #include "ui/native_theme/native_theme.h"
 #include "ui/resources/grit/ui_resources.h"
+#include "ui/views/animation/ink_drop_animation_controller.h"
+#include "ui/views/animation/ink_drop_animation_controller_factory.h"
+#include "ui/views/animation/ink_drop_host.h"
 #include "ui/views/background.h"
 #include "ui/views/border.h"
 #include "ui/views/bubble/bubble_border.h"
@@ -97,6 +100,26 @@
 // number brings the width on a "regular fonts" system to about 300px.
 const int kDefaultCharWidth = 43;
 
+class FindBarButton : public views::ImageButton, public views::InkDropHost {
+ public:
+  explicit FindBarButton(views::ButtonListener* listener);
+  ~FindBarButton() override;
+
+ private:
+  void Layout() override;
+  void AddInkDropLayer(ui::Layer* ink_drop_layer) override;
+  void RemoveInkDropLayer(ui::Layer* ink_drop_layer) override;
+  bool OnMousePressed(const ui::MouseEvent& event) override;
+  void OnGestureEvent(ui::GestureEvent* event) override;
+  void OnMouseReleased(const ui::MouseEvent& event) override;
+  void NotifyClick(const ui::Event& event) override;
+
+  // Animation controller for the ink drop ripple effect.
+  scoped_ptr<views::InkDropAnimationController> ink_drop_animation_controller_;
+
+  DISALLOW_COPY_AND_ASSIGN(FindBarButton);
+};
+
 // The match count label is like a normal label, but can process events (which
 // makes it easier to forward events to the text input --- see
 // FindBarView::TargetForRect).
@@ -115,6 +138,104 @@
 }  // namespace
 
 ////////////////////////////////////////////////////////////////////////////////
+// FindBarButton, public:
+
+FindBarButton::FindBarButton(views::ButtonListener* listener)
+    : views::ImageButton(listener),
+      ink_drop_animation_controller_(
+          views::InkDropAnimationControllerFactory::
+              CreateInkDropAnimationController(this)) {
+  const int kInkDropLargeSize = 32;
+  const int kInkDropLargeCornerRadius = 4;
+  const int kInkDropSmallSize = 24;
+  const int kInkDropSmallCornerRadius = 2;
+
+  ink_drop_animation_controller_->SetInkDropSize(
+      gfx::Size(kInkDropLargeSize, kInkDropLargeSize),
+      kInkDropLargeCornerRadius,
+      gfx::Size(kInkDropSmallSize, kInkDropSmallSize),
+      kInkDropSmallCornerRadius);
+}
+
+FindBarButton::~FindBarButton() {}
+
+////////////////////////////////////////////////////////////////////////////////
+// FindBarButton, private:
+
+void FindBarButton::Layout() {
+  ImageButton::Layout();
+
+  ink_drop_animation_controller_->SetInkDropCenter(
+      GetLocalBounds().CenterPoint());
+}
+
+void FindBarButton::AddInkDropLayer(ui::Layer* ink_drop_layer) {
+  SetPaintToLayer(true);
+  SetFillsBoundsOpaquely(false);
+  layer()->Add(ink_drop_layer);
+  layer()->StackAtBottom(ink_drop_layer);
+}
+
+void FindBarButton::RemoveInkDropLayer(ui::Layer* ink_drop_layer) {
+  layer()->Remove(ink_drop_layer);
+  SetFillsBoundsOpaquely(true);
+  SetPaintToLayer(false);
+}
+
+bool FindBarButton::OnMousePressed(const ui::MouseEvent& event) {
+  if (IsTriggerableEvent(event)) {
+    ink_drop_animation_controller_->AnimateToState(
+        views::InkDropState::ACTION_PENDING);
+  }
+
+  return ImageButton::OnMousePressed(event);
+}
+
+void FindBarButton::OnGestureEvent(ui::GestureEvent* event) {
+  views::InkDropState ink_drop_state = views::InkDropState::HIDDEN;
+  switch (event->type()) {
+    case ui::ET_GESTURE_TAP_DOWN:
+      ink_drop_state = views::InkDropState::ACTION_PENDING;
+      // The ui::ET_GESTURE_TAP_DOWN event needs to be marked as handled so
+      // that subsequent events for the gesture are sent to |this|.
+      event->SetHandled();
+      break;
+    case ui::ET_GESTURE_LONG_PRESS:
+      ink_drop_state = views::InkDropState::SLOW_ACTION_PENDING;
+      break;
+    case ui::ET_GESTURE_TAP:
+      ink_drop_state = views::InkDropState::QUICK_ACTION;
+      break;
+    case ui::ET_GESTURE_LONG_TAP:
+      ink_drop_state = views::InkDropState::SLOW_ACTION;
+      break;
+    case ui::ET_GESTURE_END:
+    case ui::ET_GESTURE_TAP_CANCEL:
+      ink_drop_state = views::InkDropState::HIDDEN;
+      break;
+    default:
+      return;
+  }
+  ink_drop_animation_controller_->AnimateToState(ink_drop_state);
+
+  ImageButton::OnGestureEvent(event);
+}
+
+void FindBarButton::OnMouseReleased(const ui::MouseEvent& event) {
+  if (!HitTestPoint(event.location()))
+    ink_drop_animation_controller_->AnimateToState(views::InkDropState::HIDDEN);
+
+  ImageButton::OnMouseReleased(event);
+}
+
+void FindBarButton::NotifyClick(const ui::Event& event) {
+  ink_drop_animation_controller_->AnimateToState(
+      views::InkDropState::QUICK_ACTION);
+
+  ImageButton::NotifyClick(event);
+}
+
+////////////////////////////////////////////////////////////////////////////////
 // FindBarView, public:
 
 FindBarView::FindBarView(FindBarHost* host)
@@ -133,7 +254,7 @@
   find_text_->SetTextInputFlags(ui::TEXT_INPUT_FLAG_AUTOCORRECT_OFF);
   AddChildView(find_text_);
 
-  find_previous_button_ = new views::ImageButton(this);
+  find_previous_button_ = new FindBarButton(this);
   find_previous_button_->set_tag(FIND_PREVIOUS_TAG);
   find_previous_button_->SetFocusable(true);
   find_previous_button_->SetTooltipText(
@@ -142,7 +263,7 @@
       l10n_util::GetStringUTF16(IDS_ACCNAME_PREVIOUS));
   AddChildView(find_previous_button_);
 
-  find_next_button_ = new views::ImageButton(this);
+  find_next_button_ = new FindBarButton(this);
   find_next_button_->set_tag(FIND_NEXT_TAG);
   find_next_button_->SetFocusable(true);
   find_next_button_->SetTooltipText(
@@ -151,7 +272,7 @@
       l10n_util::GetStringUTF16(IDS_ACCNAME_NEXT));
   AddChildView(find_next_button_);
 
-  close_button_ = new views::ImageButton(this);
+  close_button_ = new FindBarButton(this);
   close_button_->set_tag(CLOSE_TAG);
   close_button_->SetFocusable(true);
   close_button_->SetTooltipText(
diff --git a/chrome/browser/ui/views/frame/browser_view.cc b/chrome/browser/ui/views/frame/browser_view.cc
index a7aa3f8..bea29703 100644
--- a/chrome/browser/ui/views/frame/browser_view.cc
+++ b/chrome/browser/ui/views/frame/browser_view.cc
@@ -550,17 +550,12 @@
 void BrowserView::Paint1pxHorizontalLine(gfx::Canvas* canvas,
                                          SkColor color,
                                          const gfx::Rect& bounds) {
-  canvas->Save();
-  SkScalar scale_factor = 1.0f / canvas->image_scale();
-  canvas->sk_canvas()->scale(scale_factor, scale_factor);
-
-  gfx::RectF line_rect =
-      gfx::ScaleRect(gfx::RectF(bounds), canvas->image_scale());
-  line_rect.Inset(0, line_rect.height() - 1, 0, 0);
-
+  const float scale = canvas->SaveAndUnscale();
+  gfx::RectF rect(gfx::ScaleRect(gfx::RectF(bounds), scale));
+  rect.Inset(0, rect.height() - 1, 0, 0);
   SkPaint paint;
   paint.setColor(color);
-  canvas->sk_canvas()->drawRect(gfx::RectFToSkRect(line_rect), paint);
+  canvas->sk_canvas()->drawRect(gfx::RectFToSkRect(rect), paint);
   canvas->Restore();
 }
 
diff --git a/chrome/browser/ui/views/frame/browser_view_layout.cc b/chrome/browser/ui/views/frame/browser_view_layout.cc
index a8d1c719..25e1df6b 100644
--- a/chrome/browser/ui/views/frame/browser_view_layout.cc
+++ b/chrome/browser/ui/views/frame/browser_view_layout.cc
@@ -223,13 +223,12 @@
     // miniature immersive style tab strip is visible. Do not overlap the
     // find bar and the tab strip.
     find_bar_y = top_container_bounds.bottom();
-  } else if (ui::MaterialDesignController::IsModeMaterial()) {
-    find_bar_y = top_container_bounds.bottom() - 6;
   } else {
-    // Position the find bar 1 pixel above the bottom of the top container
-    // so that it occludes the border between the content area and the top
-    // container and looks connected to the top container.
-    find_bar_y = top_container_bounds.bottom() - 1;
+    // Overlap the find bar atop |top_container_|.
+    // The find bar should look connected to the top container when material
+    // design is not enabled.
+    find_bar_y = top_container_bounds.bottom() -
+                 GetLayoutConstant(FIND_BAR_TOOLBAR_OVERLAP);
   }
 
   // Grow the height of |bounding_box| by the height of any elements between
diff --git a/chrome/browser/ui/views/frame/browser_view_unittest.cc b/chrome/browser/ui/views/frame/browser_view_unittest.cc
index a693b05..23f3e7d 100644
--- a/chrome/browser/ui/views/frame/browser_view_unittest.cc
+++ b/chrome/browser/ui/views/frame/browser_view_unittest.cc
@@ -201,6 +201,6 @@
 
   // The find bar should overlap the 1px header/web-contents separator at the
   // bottom of the header.
-  EXPECT_EQ(browser_view()->frame()->GetTopInset() - 1,
-            browser_view()->GetFindBarBoundingBox().y());
+  EXPECT_LT(browser_view()->GetFindBarBoundingBox().y(),
+            browser_view()->frame()->GetTopInset());
 }
diff --git a/chrome/browser/ui/views/layout_constants.cc b/chrome/browser/ui/views/layout_constants.cc
index dedc0ea2f..7e8a081 100644
--- a/chrome/browser/ui/views/layout_constants.cc
+++ b/chrome/browser/ui/views/layout_constants.cc
@@ -8,6 +8,7 @@
 #include "ui/base/resource/material_design/material_design_controller.h"
 
 int GetLayoutConstant(LayoutConstant constant) {
+  const int kFindBarVerticalOffset[] = {1, 6, 6};
   const int kIconLabelViewInternalPadding[] = {3, 2, 2};
   const int kIconLabelViewTrailingPadding[] = {2, 8, 8};
   const int kLocationBarBubbleHorizontalPadding[] = {1, 5, 5};
@@ -38,6 +39,8 @@
 
   const int mode = ui::MaterialDesignController::GetMode();
   switch (constant) {
+    case FIND_BAR_TOOLBAR_OVERLAP:
+      return kFindBarVerticalOffset[mode];
     case ICON_LABEL_VIEW_INTERNAL_PADDING:
       return kIconLabelViewInternalPadding[mode];
     case ICON_LABEL_VIEW_TRAILING_PADDING:
diff --git a/chrome/browser/ui/views/layout_constants.h b/chrome/browser/ui/views/layout_constants.h
index 14a629b..1f66273 100644
--- a/chrome/browser/ui/views/layout_constants.h
+++ b/chrome/browser/ui/views/layout_constants.h
@@ -8,6 +8,9 @@
 #include "ui/gfx/geometry/insets.h"
 
 enum LayoutConstant {
+  // Vertical offset from top of content to the top of find bar.
+  FIND_BAR_TOOLBAR_OVERLAP,
+
   // Horizontal padding applied between items of icon-label views.
   ICON_LABEL_VIEW_INTERNAL_PADDING,
 
diff --git a/chrome/browser/ui/views/location_bar/location_bar_view.cc b/chrome/browser/ui/views/location_bar/location_bar_view.cc
index 958977d..423a35d 100644
--- a/chrome/browser/ui/views/location_bar/location_bar_view.cc
+++ b/chrome/browser/ui/views/location_bar/location_bar_view.cc
@@ -1290,10 +1290,7 @@
 
   if (ui::MaterialDesignController::IsModeMaterial()) {
     gfx::Canvas* canvas = recorder.canvas();
-    const float display_scale = canvas->image_scale();
-    canvas->Save();
-    SkScalar scale_factor = 1.0f / display_scale;
-    canvas->sk_canvas()->scale(scale_factor, scale_factor);
+    const float scale = canvas->SaveAndUnscale();
 
     SkPaint paint;
     paint.setStyle(SkPaint::Style::kStroke_Style);
@@ -1303,11 +1300,11 @@
 
     const float kOffset = 0.5f;
     gfx::RectF border_rect_f(border_rect);
-    border_rect_f.Scale(display_scale);
+    border_rect_f.Scale(scale);
     gfx::InsetsF insets(kOffset, kOffset, kOffset, kOffset);
     border_rect_f.Inset(insets);
 
-    const SkScalar kCornerRadius = SkDoubleToScalar(2.5f * display_scale);
+    const SkScalar kCornerRadius = SkDoubleToScalar(2.5f * scale);
     canvas->sk_canvas()->drawRoundRect(gfx::RectFToSkRect(border_rect_f),
                                        kCornerRadius, kCornerRadius, paint);
     recorder.canvas()->Restore();
diff --git a/chrome/browser/ui/views/omnibox/omnibox_view_views.cc b/chrome/browser/ui/views/omnibox/omnibox_view_views.cc
index 02f5d5db9..91adf437 100644
--- a/chrome/browser/ui/views/omnibox/omnibox_view_views.cc
+++ b/chrome/browser/ui/views/omnibox/omnibox_view_views.cc
@@ -845,6 +845,7 @@
   if (popup_window_mode_) {
     state->AddStateFlag(ui::AX_STATE_READ_ONLY);
   } else {
+    state->AddStateFlag(ui::AX_STATE_EDITABLE);
     state->set_value_callback =
         base::Bind(&OmniboxViewViews::AccessibilitySetValue,
                    weak_ptr_factory_.GetWeakPtr());
diff --git a/chrome/browser/ui/views/tabs/tab.cc b/chrome/browser/ui/views/tabs/tab.cc
index 6df01e27..809d656 100644
--- a/chrome/browser/ui/views/tabs/tab.cc
+++ b/chrome/browser/ui/views/tabs/tab.cc
@@ -390,6 +390,8 @@
 
   set_id(VIEW_ID_TAB);
 
+  SetBorder(views::Border::CreateEmptyBorder(GetLayoutInsets(TAB)));
+
   title_->SetHorizontalAlignment(gfx::ALIGN_TO_HEAD);
   title_->SetElideBehavior(gfx::FADE_TAIL);
   title_->SetHandlesTooltips(false);
@@ -779,7 +781,7 @@
 }
 
 void Tab::Layout() {
-  gfx::Rect lb = GetInteriorBounds();
+  gfx::Rect lb = GetContentsBounds();
   if (lb.IsEmpty())
     return;
 
@@ -1346,7 +1348,7 @@
   gfx::Rect bounds = favicon_bounds_;
   bounds.set_x(GetMirroredXForRect(bounds));
   bounds.Offset(0, favicon_hiding_offset_);
-  bounds.Intersect(GetInteriorBounds());
+  bounds.Intersect(GetContentsBounds());
   if (bounds.IsEmpty())
     return;
 
@@ -1521,12 +1523,6 @@
   SchedulePaintInRect(bounds);
 }
 
-gfx::Rect Tab::GetInteriorBounds() const {
-  gfx::Rect bounds(GetContentsBounds());
-  bounds.Inset(GetLayoutInsets(TAB));
-  return bounds;
-}
-
 gfx::Rect Tab::GetImmersiveBarRect() const {
   // The main bar is as wide as the normal tab's horizontal top line.
   // This top line of the tab extends a few pixels left and right of the
diff --git a/chrome/browser/ui/views/tabs/tab.h b/chrome/browser/ui/views/tabs/tab.h
index fc0937e0..8ecd591 100644
--- a/chrome/browser/ui/views/tabs/tab.h
+++ b/chrome/browser/ui/views/tabs/tab.h
@@ -288,9 +288,6 @@
   // Schedules repaint task for icon.
   void ScheduleIconPaint();
 
-  // Returns the rect that can be used for content inside the tab borders.
-  gfx::Rect GetInteriorBounds() const;
-
   // Returns the rectangle for the light bar in immersive mode.
   gfx::Rect GetImmersiveBarRect() const;
 
diff --git a/chrome/browser/ui/views/tabs/tab_unittest.cc b/chrome/browser/ui/views/tabs/tab_unittest.cc
index d5641ad4..5c67ac25 100644
--- a/chrome/browser/ui/views/tabs/tab_unittest.cc
+++ b/chrome/browser/ui/views/tabs/tab_unittest.cc
@@ -197,9 +197,15 @@
                   tab.close_button_->bounds().x() +
                       tab.close_button_->GetInsets().left());
       }
-      EXPECT_LE(tab.close_button_->bounds().right(), contents_bounds.right());
-      EXPECT_LE(contents_bounds.y(), tab.close_button_->bounds().y());
-      EXPECT_LE(tab.close_button_->bounds().bottom(), contents_bounds.bottom());
+      // We need to use the close button contents bounds instead of its bounds,
+      // since it has an empty border around it to extend its clickable area for
+      // touch.
+      // Note: The close button right edge can be outside the nominal contents
+      // bounds, but shouldn't leave the local bounds.
+      const gfx::Rect close_bounds = tab.close_button_->GetContentsBounds();
+      EXPECT_LE(close_bounds.right(), tab.GetLocalBounds().right());
+      EXPECT_LE(contents_bounds.y(), close_bounds.y());
+      EXPECT_LE(close_bounds.bottom(), contents_bounds.bottom());
     }
   }
 
diff --git a/chrome/browser/ui/views/toolbar/toolbar_button.cc b/chrome/browser/ui/views/toolbar/toolbar_button.cc
index 4a2e41a6..33cfcd0 100644
--- a/chrome/browser/ui/views/toolbar/toolbar_button.cc
+++ b/chrome/browser/ui/views/toolbar/toolbar_button.cc
@@ -32,10 +32,22 @@
       model_(model),
       menu_showing_(false),
       y_position_on_lbuttondown_(0),
+      ink_drop_animation_controller_(
+          views::InkDropAnimationControllerFactory::
+              CreateInkDropAnimationController(this)),
       show_menu_factory_(this) {
-  ink_drop_animation_controller_ = views::InkDropAnimationControllerFactory::
-      CreateInkDropAnimationController(this);
   set_context_menu_controller(this);
+
+  const int kInkDropLargeSize = 32;
+  const int kInkDropLargeCornerRadius = 5;
+  const int kInkDropSmallSize = 24;
+  const int kInkDropSmallCornerRadius = 2;
+
+  ink_drop_animation_controller_->SetInkDropSize(
+      gfx::Size(kInkDropLargeSize, kInkDropLargeSize),
+      kInkDropLargeCornerRadius,
+      gfx::Size(kInkDropSmallSize, kInkDropSmallSize),
+      kInkDropSmallCornerRadius);
 }
 
 ToolbarButton::~ToolbarButton() {
@@ -78,18 +90,6 @@
 
 void ToolbarButton::Layout() {
   LabelButton::Layout();
-
-  // Sizes for the the ink drop.
-  const int kInkDropLargeSize = 32;
-  const int kInkDropLargeCornerRadius = 5;
-  const int kInkDropSmallSize = 24;
-  const int kInkDropSmallCornerRadius = 2;
-
-  ink_drop_animation_controller_->SetInkDropSize(
-      gfx::Size(kInkDropLargeSize, kInkDropLargeSize),
-      kInkDropLargeCornerRadius,
-      gfx::Size(kInkDropSmallSize, kInkDropSmallSize),
-      kInkDropSmallCornerRadius);
   ink_drop_animation_controller_->SetInkDropCenter(CalculateInkDropCenter());
 }
 
@@ -144,7 +144,8 @@
   if (IsTriggerableEvent(event))
     show_menu_factory_.InvalidateWeakPtrs();
 
-  ink_drop_animation_controller_->AnimateToState(views::InkDropState::HIDDEN);
+  if (!HitTestPoint(event.location()))
+    ink_drop_animation_controller_->AnimateToState(views::InkDropState::HIDDEN);
 }
 
 void ToolbarButton::OnMouseCaptureLost() {
diff --git a/chrome/browser/ui/views/toolbar/wrench_toolbar_button.cc b/chrome/browser/ui/views/toolbar/wrench_toolbar_button.cc
index ff2638f..9c815d0 100644
--- a/chrome/browser/ui/views/toolbar/wrench_toolbar_button.cc
+++ b/chrome/browser/ui/views/toolbar/wrench_toolbar_button.cc
@@ -24,6 +24,8 @@
 #include "ui/gfx/paint_vector_icon.h"
 #include "ui/gfx/vector_icons_public.h"
 #include "ui/keyboard/keyboard_controller.h"
+#include "ui/views/animation/ink_drop_animation_controller.h"
+#include "ui/views/animation/ink_drop_animation_controller_factory.h"
 #include "ui/views/controls/button/label_button_border.h"
 #include "ui/views/controls/menu/menu_listener.h"
 #include "ui/views/metrics.h"
@@ -35,16 +37,33 @@
 WrenchToolbarButton::WrenchToolbarButton(ToolbarView* toolbar_view)
     : views::MenuButton(NULL, base::string16(), toolbar_view, false),
       severity_(WrenchIconPainter::SEVERITY_NONE),
+      ink_drop_animation_controller_(
+          views::InkDropAnimationControllerFactory::
+              CreateInkDropAnimationController(this)),
       toolbar_view_(toolbar_view),
       allow_extension_dragging_(
           extensions::FeatureSwitch::extension_action_redesign()
               ->IsEnabled()),
+      destroyed_(nullptr),
       weak_factory_(this) {
   if (!ui::MaterialDesignController::IsModeMaterial())
     wrench_icon_painter_.reset(new WrenchIconPainter(this));
+
+  const int kInkDropLargeSize = 32;
+  const int kInkDropLargeCornerRadius = 5;
+  const int kInkDropSmallSize = 24;
+  const int kInkDropSmallCornerRadius = 2;
+
+  ink_drop_animation_controller_->SetInkDropSize(
+      gfx::Size(kInkDropLargeSize, kInkDropLargeSize),
+      kInkDropLargeCornerRadius,
+      gfx::Size(kInkDropSmallSize, kInkDropSmallSize),
+      kInkDropSmallCornerRadius);
 }
 
 WrenchToolbarButton::~WrenchToolbarButton() {
+  if (destroyed_)
+    *destroyed_ = true;
 }
 
 void WrenchToolbarButton::SetSeverity(WrenchIconPainter::Severity severity,
@@ -80,7 +99,23 @@
 
   FOR_EACH_OBSERVER(views::MenuListener, menu_listeners_, OnMenuOpened());
 
+  // Because running the menu below spins a nested message loop, |this| can be
+  // deleted by the time RunMenu() returns. To detect this, we set |destroyed_|
+  // (which is normally null) to point to a local. If our destructor runs during
+  // RunMenu(), then this local will be set to true on return, and we'll know
+  // it's not safe to access any member variables.
+  bool destroyed = false;
+  destroyed_ = &destroyed;
+
+  ink_drop_animation_controller_->AnimateToState(
+      views::InkDropState::ACTIVATED);
   menu_->RunMenu(this);
+
+  if (!destroyed) {
+    ink_drop_animation_controller_->AnimateToState(
+        views::InkDropState::DEACTIVATED);
+    destroyed_ = nullptr;
+  }
 }
 
 void WrenchToolbarButton::CloseMenu() {
@@ -146,6 +181,23 @@
                                  color));
 }
 
+void WrenchToolbarButton::AddInkDropLayer(ui::Layer* ink_drop_layer) {
+  SetPaintToLayer(true);
+  image()->SetPaintToLayer(true);
+  image()->SetFillsBoundsOpaquely(false);
+
+  layer()->Add(ink_drop_layer);
+  layer()->StackAtBottom(ink_drop_layer);
+}
+
+void WrenchToolbarButton::RemoveInkDropLayer(ui::Layer* ink_drop_layer) {
+  layer()->Remove(ink_drop_layer);
+
+  image()->SetFillsBoundsOpaquely(true);
+  image()->SetPaintToLayer(false);
+  SetPaintToLayer(false);
+}
+
 const char* WrenchToolbarButton::GetClassName() const {
   return "WrenchToolbarButton";
 }
@@ -157,11 +209,13 @@
       BrowserActionDragData::GetDropFormats(format_types) :
       views::View::GetDropFormats(formats, format_types);
 }
+
 bool WrenchToolbarButton::AreDropTypesRequired() {
   return allow_extension_dragging_ ?
       BrowserActionDragData::AreDropTypesRequired() :
       views::View::AreDropTypesRequired();
 }
+
 bool WrenchToolbarButton::CanDrop(const ui::OSExchangeData& data) {
   return allow_extension_dragging_ ?
       BrowserActionDragData::CanDrop(data,
@@ -169,6 +223,16 @@
       views::View::CanDrop(data);
 }
 
+void WrenchToolbarButton::Layout() {
+  MenuButton::Layout();
+
+  // ToolbarView extends the bounds of the app button to the right in maximized
+  // mode. So instead of using the center point of local bounds, we use the
+  // center point of preferred size which doesn't change in maximized mode.
+  ink_drop_animation_controller_->SetInkDropCenter(
+      gfx::Rect(GetPreferredSize()).CenterPoint());
+}
+
 void WrenchToolbarButton::OnDragEntered(const ui::DropTargetEvent& event) {
   DCHECK(allow_extension_dragging_);
   DCHECK(!weak_factory_.HasWeakPtrs());
diff --git a/chrome/browser/ui/views/toolbar/wrench_toolbar_button.h b/chrome/browser/ui/views/toolbar/wrench_toolbar_button.h
index 49bd103..0f845ca 100644
--- a/chrome/browser/ui/views/toolbar/wrench_toolbar_button.h
+++ b/chrome/browser/ui/views/toolbar/wrench_toolbar_button.h
@@ -9,6 +9,7 @@
 #include "base/memory/scoped_ptr.h"
 #include "base/memory/weak_ptr.h"
 #include "chrome/browser/ui/toolbar/wrench_icon_painter.h"
+#include "ui/views/animation/ink_drop_host.h"
 #include "ui/views/controls/button/menu_button.h"
 #include "ui/views/controls/button/menu_button_listener.h"
 #include "ui/views/view.h"
@@ -17,6 +18,7 @@
 class WrenchMenuModel;
 
 namespace views {
+class InkDropAnimationController;
 class LabelButtonBorder;
 class MenuListener;
 }
@@ -24,7 +26,8 @@
 class ToolbarView;
 
 // TODO(gbillock): Rename this? No longer a wrench.
-class WrenchToolbarButton : public views::MenuButton,
+class WrenchToolbarButton : public views::InkDropHost,
+                            public views::MenuButton,
                             public WrenchIconPainter::Delegate {
  public:
   explicit WrenchToolbarButton(ToolbarView* toolbar_view);
@@ -65,6 +68,10 @@
   static bool g_open_app_immediately_for_testing;
 
  private:
+  // views::InkDropHost:
+  void AddInkDropLayer(ui::Layer* ink_drop_layer) override;
+  void RemoveInkDropLayer(ui::Layer* ink_drop_layer) override;
+
   // views::MenuButton:
   const char* GetClassName() const override;
   bool GetDropFormats(
@@ -72,6 +79,7 @@
       std::set<ui::Clipboard::FormatType>* format_types) override;
   bool AreDropTypesRequired() override;
   bool CanDrop(const ui::OSExchangeData& data) override;
+  void Layout() override;
   void OnDragEntered(const ui::DropTargetEvent& event) override;
   int OnDragUpdated(const ui::DropTargetEvent& event) override;
   void OnDragExited() override;
@@ -84,6 +92,9 @@
   // Only used in MD.
   WrenchIconPainter::Severity severity_;
 
+  // Animation controller for the ink drop ripple effect.
+  scoped_ptr<views::InkDropAnimationController> ink_drop_animation_controller_;
+
   // Our owning toolbar view.
   ToolbarView* toolbar_view_;
 
@@ -100,6 +111,10 @@
   scoped_ptr<WrenchMenuModel> menu_model_;
   scoped_ptr<WrenchMenu> menu_;
 
+  // Used by ShowMenu() to detect when |this| has been deleted; see comments
+  // there.
+  bool* destroyed_;
+
   // Used to spawn weak pointers for delayed tasks to open the overflow menu.
   base::WeakPtrFactory<WrenchToolbarButton> weak_factory_;
 
diff --git a/chrome/browser/ui/webui/chromeos/login/gaia_screen_handler.cc b/chrome/browser/ui/webui/chromeos/login/gaia_screen_handler.cc
index 92adcb5..1c03631 100644
--- a/chrome/browser/ui/webui/chromeos/login/gaia_screen_handler.cc
+++ b/chrome/browser/ui/webui/chromeos/login/gaia_screen_handler.cc
@@ -917,10 +917,17 @@
 }
 
 bool GaiaScreenHandler::IsRestrictiveProxy() const {
+  if (disable_restrictive_proxy_check_for_test_)
+    return false;
+
   return captive_portal_status_ ==
              NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_PORTAL ||
          captive_portal_status_ ==
              NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_OFFLINE;
 }
 
+void GaiaScreenHandler::DisableRestrictiveProxyCheckForTest() {
+  disable_restrictive_proxy_check_for_test_ = true;
+}
+
 }  // namespace chromeos
diff --git a/chrome/browser/ui/webui/chromeos/login/gaia_screen_handler.h b/chrome/browser/ui/webui/chromeos/login/gaia_screen_handler.h
index ef93835..cef320c 100644
--- a/chrome/browser/ui/webui/chromeos/login/gaia_screen_handler.h
+++ b/chrome/browser/ui/webui/chromeos/login/gaia_screen_handler.h
@@ -79,6 +79,8 @@
   // pre-loads it.
   void MaybePreloadAuthExtension();
 
+  void DisableRestrictiveProxyCheckForTest();
+
  private:
   // TODO (antrim@): remove this dependency.
   friend class SigninScreenHandler;
@@ -278,6 +280,7 @@
       NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_UNKNOWN;
 
   scoped_ptr<NetworkPortalDetector> network_portal_detector_;
+  bool disable_restrictive_proxy_check_for_test_ = false;
 
   // Non-owning ptr to SigninScreenHandler instance. Should not be used
   // in dtor.
diff --git a/chrome/browser/ui/webui/extensions/extension_settings_handler.cc b/chrome/browser/ui/webui/extensions/extension_settings_handler.cc
index 41d5d4bb..d6c0174 100644
--- a/chrome/browser/ui/webui/extensions/extension_settings_handler.cc
+++ b/chrome/browser/ui/webui/extensions/extension_settings_handler.cc
@@ -35,6 +35,11 @@
 #include "ui/base/l10n/l10n_util.h"
 #include "url/gurl.h"
 
+#if defined(ENABLE_SUPERVISED_USERS)
+#include "chrome/browser/supervised_user/supervised_user_service.h"
+#include "chrome/browser/supervised_user/supervised_user_service_factory.h"
+#endif
+
 namespace extensions {
 
 ExtensionSettingsHandler::ExtensionSettingsHandler()
@@ -142,8 +147,12 @@
       l10n_util::GetStringUTF16(IDS_EXTENSIONS_POLICY_RECOMMENDED));
   source->AddString("extensionSettingsDependentExtensions",
       l10n_util::GetStringUTF16(IDS_EXTENSIONS_DEPENDENT_EXTENSIONS));
+#if defined(ENABLE_SUPERVISED_USERS)
+  const SupervisedUserService* supervised_user_service =
+      SupervisedUserServiceFactory::GetForProfile(Profile::FromWebUI(web_ui()));
   source->AddString("extensionSettingsSupervisedUser",
-      l10n_util::GetStringUTF16(IDS_EXTENSIONS_LOCKED_SUPERVISED_USER));
+                    supervised_user_service->GetExtensionsLockedMessage());
+#endif
   source->AddString("loading",
       l10n_util::GetStringUTF16(IDS_EXTENSIONS_LOADING));
   source->AddString("extensionSettingsCorruptInstall",
diff --git a/chrome/browser/ui/webui/extensions/extension_settings_handler.h b/chrome/browser/ui/webui/extensions/extension_settings_handler.h
index 50ff902d..c380ede6 100644
--- a/chrome/browser/ui/webui/extensions/extension_settings_handler.h
+++ b/chrome/browser/ui/webui/extensions/extension_settings_handler.h
@@ -31,6 +31,8 @@
 
   static void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry);
 
+  // Note: This uses |web_ui()| from |WebUIMessageHandler|, so it must only be
+  // called after |web_ui->AddMessageHandler(this)| has been called.
   void GetLocalizedValues(content::WebUIDataSource* source);
 
  private:
diff --git a/chrome/browser/ui/webui/extensions/extensions_ui.cc b/chrome/browser/ui/webui/extensions/extensions_ui.cc
index 551906a..8ceb602 100644
--- a/chrome/browser/ui/webui/extensions/extensions_ui.cc
+++ b/chrome/browser/ui/webui/extensions/extensions_ui.cc
@@ -90,8 +90,8 @@
     source = CreateExtensionsHTMLSource();
 
     ExtensionSettingsHandler* handler = new ExtensionSettingsHandler();
-    handler->GetLocalizedValues(source);
     web_ui->AddMessageHandler(handler);
+    handler->GetLocalizedValues(source);
 
     ExtensionLoaderHandler* extension_loader_handler =
         new ExtensionLoaderHandler(profile);
diff --git a/chrome/browser/ui/webui/settings/md_settings_localized_strings_provider.cc b/chrome/browser/ui/webui/settings/md_settings_localized_strings_provider.cc
index cfbd54b..28a2e2a1 100644
--- a/chrome/browser/ui/webui/settings/md_settings_localized_strings_provider.cc
+++ b/chrome/browser/ui/webui/settings/md_settings_localized_strings_provider.cc
@@ -206,6 +206,8 @@
       "defaultBrowserUnknown", IDS_SETTINGS_DEFAULT_BROWSER_UNKNOWN);
   html_source->AddLocalizedString(
       "defaultBrowserSecondary", IDS_SETTINGS_DEFAULT_BROWSER_SECONDARY);
+  html_source->AddLocalizedString(
+      "unableToSetDefaultBrowser", IDS_SETTINGS_DEFAULT_BROWSER_ERROR);
 }
 #endif
 
diff --git a/chrome/browser/ui/webui/version_ui.cc b/chrome/browser/ui/webui/version_ui.cc
index 7629f50..25cd92d 100644
--- a/chrome/browser/ui/webui/version_ui.cc
+++ b/chrome/browser/ui/webui/version_ui.cc
@@ -122,6 +122,14 @@
   html_source->AddLocalizedString("variations_name",
                                   IDS_ABOUT_VERSION_VARIATIONS);
 
+#if defined(OS_WIN)
+#if defined(__clang__)
+  html_source->AddString("compiler", "clang");
+#else
+  html_source->AddString("compiler", "MSVC");
+#endif
+#endif
+
   html_source->SetJsonPath("strings.js");
   html_source->AddResourcePath("version.js", IDR_ABOUT_VERSION_JS);
   html_source->AddResourcePath("about_version.css", IDR_ABOUT_VERSION_CSS);
diff --git a/chrome/browser/web_applications/web_app_mac.mm b/chrome/browser/web_applications/web_app_mac.mm
index f48a500..51022c4 100644
--- a/chrome/browser/web_applications/web_app_mac.mm
+++ b/chrome/browser/web_applications/web_app_mac.mm
@@ -1020,7 +1020,7 @@
     // shim selected.
     [[NSWorkspace sharedWorkspace]
                       selectFile:base::mac::FilePathToNSString(app_path)
-        inFileViewerRootedAtPath:nil];
+        inFileViewerRootedAtPath:@""];
     return;
   }
 
diff --git a/chrome/browser_tests.isolate b/chrome/browser_tests.isolate
index 26218a2..7e793888 100644
--- a/chrome/browser_tests.isolate
+++ b/chrome/browser_tests.isolate
@@ -92,6 +92,14 @@
         ],
       },
     }],
+    ['OS=="linux" or OS=="win"', {
+      'variables': {
+        'files': [
+          '<(PRODUCT_DIR)/chrome_material_100_percent.pak',
+          '<(PRODUCT_DIR)/chrome_100_percent.pak',
+        ],
+      },
+    }],
     ['disable_nacl==0 and (OS=="linux" or OS=="mac" or OS=="win")', {
       'variables': {
         'files': [
@@ -241,6 +249,7 @@
           '../ui/file_manager/integration_tests/',
           '../ui/webui/resources/js/',
           '../third_party/analytics/',
+          '../third_party/polymer/v1_0/components-chromium/polymer/',
           '../chrome/browser/resources/chromeos/wallpaper_manager/',
           '<(PRODUCT_DIR)/chromevox_test_data/',
           '<(PRODUCT_DIR)/content_shell.pak',
diff --git a/chrome/chrome_browser.gypi b/chrome/chrome_browser.gypi
index 55427b73..5676166 100644
--- a/chrome/chrome_browser.gypi
+++ b/chrome/chrome_browser.gypi
@@ -102,6 +102,8 @@
       'browser/android/contextualsearch/contextual_search_tab_helper.h',
       'browser/android/cookies/cookies_fetcher.cc',
       'browser/android/cookies/cookies_fetcher.h',
+      'browser/android/datausage/external_data_use_observer.cc',
+      'browser/android/datausage/external_data_use_observer.h',
       'browser/android/dev_tools_discovery_provider_android.cc',
       'browser/android/dev_tools_discovery_provider_android.h',
       'browser/android/dev_tools_server.cc',
@@ -1759,6 +1761,7 @@
       'android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchManager.java',
       'android/java/src/org/chromium/chrome/browser/contextualsearch/ContextualSearchTabHelper.java',
       'android/java/src/org/chromium/chrome/browser/cookies/CookiesFetcher.java',
+      'android/java/src/org/chromium/chrome/browser/datausage/ExternalDataUseObserver.java',
       'android/java/src/org/chromium/chrome/browser/DevToolsServer.java',
       'android/java/src/org/chromium/chrome/browser/database/SQLiteCursor.java',
       'android/java/src/org/chromium/chrome/browser/document/DocumentWebContentsDelegate.java',
@@ -1886,16 +1889,6 @@
       'browser/metrics/metrics_services_manager.h',
       'browser/metrics/perf/perf_provider_chromeos.cc',
       'browser/metrics/perf/perf_provider_chromeos.h',
-      'browser/metrics/chrome_signin_status_metrics_provider_delegate.cc',
-      'browser/metrics/chrome_signin_status_metrics_provider_delegate.h',
-      'browser/metrics/signin_status_metrics_provider.cc',
-      'browser/metrics/signin_status_metrics_provider.h',
-      'browser/metrics/signin_status_metrics_provider_base.cc',
-      'browser/metrics/signin_status_metrics_provider_base.h',
-      'browser/metrics/signin_status_metrics_provider_chromeos.cc',
-      'browser/metrics/signin_status_metrics_provider_chromeos.h',
-      'browser/metrics/signin_status_metrics_provider_delegate.cc',
-      'browser/metrics/signin_status_metrics_provider_delegate.h',
       'browser/metrics/thread_watcher.cc',
       'browser/metrics/thread_watcher.h',
       'browser/metrics/thread_watcher_android.cc',
@@ -2692,6 +2685,8 @@
       'browser/signin/chrome_signin_client_factory.h',
       'browser/signin/chrome_signin_helper.cc',
       'browser/signin/chrome_signin_helper.h',
+      'browser/signin/chrome_signin_status_metrics_provider_delegate.cc',
+      'browser/signin/chrome_signin_status_metrics_provider_delegate.h',
       'browser/signin/gaia_cookie_manager_service_factory.cc',
       'browser/signin/gaia_cookie_manager_service_factory.h',
       'browser/signin/local_auth.cc',
@@ -2704,6 +2699,8 @@
       'browser/signin/signin_error_controller_factory.h',
       'browser/signin/signin_manager_factory.cc',
       'browser/signin/signin_manager_factory.h',
+      'browser/signin/signin_status_metrics_provider_chromeos.cc',
+      'browser/signin/signin_status_metrics_provider_chromeos.h',
       'browser/signin/signin_tracker_factory.cc',
       'browser/signin/signin_tracker_factory.h',
     ],
@@ -3386,12 +3383,8 @@
         }],
         ['chromeos==1', {
           'sources!': [
-            'browser/metrics/chrome_signin_status_metrics_provider_delegate.cc',
-            'browser/metrics/chrome_signin_status_metrics_provider_delegate.h',
-            'browser/metrics/signin_status_metrics_provider.cc',
-            'browser/metrics/signin_status_metrics_provider.h',
-            'browser/metrics/signin_status_metrics_provider_delegate.cc',
-            'browser/metrics/signin_status_metrics_provider_delegate.h',
+            'browser/signin/chrome_signin_status_metrics_provider_delegate.cc',
+            'browser/signin/chrome_signin_status_metrics_provider_delegate.h',
           ],
         }],
         ['enable_extensions==1', {
diff --git a/chrome/chrome_browser_extensions.gypi b/chrome/chrome_browser_extensions.gypi
index 14ca531..7153cbe 100644
--- a/chrome/chrome_browser_extensions.gypi
+++ b/chrome/chrome_browser_extensions.gypi
@@ -74,8 +74,6 @@
       'browser/apps/app_url_redirector.h',
       'browser/apps/app_window_registry_util.cc',
       'browser/apps/app_window_registry_util.h',
-      'browser/apps/ephemeral_app_launcher.cc',
-      'browser/apps/ephemeral_app_launcher.h',
       'browser/apps/ephemeral_app_service.cc',
       'browser/apps/ephemeral_app_service.h',
       'browser/apps/ephemeral_app_service_factory.cc',
diff --git a/chrome/chrome_tests.gypi b/chrome/chrome_tests.gypi
index 4668ad15..483e875 100644
--- a/chrome/chrome_tests.gypi
+++ b/chrome/chrome_tests.gypi
@@ -56,7 +56,6 @@
       'browser/apps/app_window_browsertest.cc',
       'browser/apps/ephemeral_app_browsertest.cc',
       'browser/apps/ephemeral_app_browsertest.h',
-      'browser/apps/ephemeral_app_launcher_browsertest.cc',
       'browser/apps/ephemeral_app_service_browsertest.cc',
       'browser/apps/event_page_browsertest.cc',
       'browser/apps/guest_view/app_view_browsertest.cc',
@@ -3189,6 +3188,19 @@
           ],
         },
         {
+         'target_name': 'telemetry_gpu_unittests',
+         'type': 'none',
+         'dependencies': [
+            '../content/content_shell_and_tests.gyp:telemetry_base',
+         ],
+         'includes': [
+           '../build/isolate.gypi',
+          ],
+          'sources': [
+            'telemetry_gpu_unittests.isolate',
+          ],
+        },
+        {
           'target_name': 'chromedriver_unittests_run',
           'type': 'none',
           'dependencies': [
@@ -3271,19 +3283,6 @@
               },
             },
             {
-             'target_name': 'telemetry_gpu_unittests_run',
-             'type': 'none',
-             'dependencies': [
-                '../content/content_shell_and_tests.gyp:telemetry_base',
-             ],
-             'includes': [
-               '../build/isolate.gypi',
-              ],
-              'sources': [
-                'telemetry_gpu_unittests.isolate',
-              ],
-            },
-            {
               'target_name': 'telemetry_chrome_test_base',
               'type': 'none',
               'dependencies': [
diff --git a/chrome/chrome_tests_unit.gypi b/chrome/chrome_tests_unit.gypi
index e89a272b..d9263ea 100644
--- a/chrome/chrome_tests_unit.gypi
+++ b/chrome/chrome_tests_unit.gypi
@@ -13,6 +13,7 @@
       'browser/after_startup_task_utils_unittest.cc',
       'browser/android/bookmarks/partner_bookmarks_shim_unittest.cc',
       'browser/android/contextualsearch/contextual_search_delegate_unittest.cc',
+      'browser/android/datausage/external_data_use_observer_unittest.cc',
       'browser/android/history_report/delta_file_backend_leveldb_unittest.cc',
       'browser/android/history_report/delta_file_commons_unittest.cc',
       'browser/android/history_report/usage_reports_buffer_backend_unittest.cc',
@@ -136,9 +137,6 @@
       'browser/metrics/chrome_metrics_service_accessor_unittest.cc',
       'browser/metrics/cloned_install_detector_unittest.cc',
       'browser/metrics/perf/perf_provider_chromeos_unittest.cc',
-      'browser/metrics/chrome_signin_status_metrics_provider_delegate_unittest.cc',
-      'browser/metrics/signin_status_metrics_provider_chromeos_unittest.cc',
-      'browser/metrics/signin_status_metrics_provider_unittest.cc',
       'browser/metrics/thread_watcher_android_unittest.cc',
       'browser/metrics/thread_watcher_unittest.cc',
       'browser/metrics/time_ticks_experiment_unittest.cc',
@@ -209,8 +207,10 @@
       'browser/shell_integration_win_unittest.cc',
       'browser/signin/account_reconcilor_unittest.cc',
       'browser/signin/chrome_signin_client_unittest.cc',
+      'browser/signin/chrome_signin_status_metrics_provider_delegate_unittest.cc',
       'browser/signin/local_auth_unittest.cc',
       'browser/signin/signin_manager_unittest.cc',
+      'browser/signin/signin_status_metrics_provider_chromeos_unittest.cc',
       'browser/signin/signin_tracker_unittest.cc',
       'browser/signin/test_signin_client_builder.cc',
       'browser/ssl/security_state_model_unittest.cc',
@@ -2286,8 +2286,7 @@
         }],
         ['chromeos==1', {
           'sources!': [
-            'browser/metrics/chrome_signin_status_metrics_provider_delegate_unittest.cc',
-            'browser/metrics/signin_status_metrics_provider_unittest.cc',
+            'browser/signin/chrome_signin_status_metrics_provider_delegate_unittest.cc',
           ],
         }],
         ['enable_background==1', {
diff --git a/chrome/common/chrome_switches.cc b/chrome/common/chrome_switches.cc
index 5d310e3..bbc05e8b 100644
--- a/chrome/common/chrome_switches.cc
+++ b/chrome/common/chrome_switches.cc
@@ -414,10 +414,6 @@
 // Download Notification. (value is "", "enabled" or "disabled")
 const char kEnableDownloadNotification[] = "enable-download-notification";
 
-// Enables experimentation with ephemeral apps to be launched from the webstore.
-const char kEnableEphemeralAppsInWebstore[] =
-    "enable-ephemeral-apps-in-webstore";
-
 // Enables experimental hotword features specific to always-on.
 const char kEnableExperimentalHotwordHardware[] = "enable-hotword-hardware";
 
diff --git a/chrome/common/chrome_switches.h b/chrome/common/chrome_switches.h
index 69b5c48..5e53039 100644
--- a/chrome/common/chrome_switches.h
+++ b/chrome/common/chrome_switches.h
@@ -124,7 +124,6 @@
 extern const char kEnableDeviceDiscoveryNotifications[];
 extern const char kEnableDownloadNotification[];
 extern const char kEnableDomainReliability[];
-extern const char kEnableEphemeralAppsInWebstore[];
 extern const char kEnableExperimentalHotwordHardware[];
 extern const char kEnableExtensionActivityLogging[];
 extern const char kEnableExtensionActivityLogTesting[];
diff --git a/chrome/common/extensions/api/automation.idl b/chrome/common/extensions/api/automation.idl
index 8887cf1..f9037c5 100644
--- a/chrome/common/extensions/api/automation.idl
+++ b/chrome/common/extensions/api/automation.idl
@@ -20,6 +20,7 @@
     blur,
     checkedStateChanged,
     childrenChanged,
+    documentSelectionChanged,
     focus,
     hide,
     hover,
diff --git a/chrome/common/extensions/docs/templates/articles/richNotifications.html b/chrome/common/extensions/docs/templates/articles/richNotifications.html
index 9a5dff3..51a7a99 100644
--- a/chrome/common/extensions/docs/templates/articles/richNotifications.html
+++ b/chrome/common/extensions/docs/templates/articles/richNotifications.html
@@ -55,20 +55,18 @@
 <h2 id="behave">How they behave</h2>
 
 <p>
-Notifications show up in a user's system tray,
-and stay in the system tray until the user dismisses them.
-On most platforms,
-the bell icon is lit when there's new notifications;
-On Chrome OS,
-the system tray keeps a count of all new notifications.
-Once a users sees the notifications in the system tray,
-the count is reset to zero;
+On Chrome OS, notifications show up in a user's system tray, and stay in the
+system tray until the user dismisses them. The system tray keeps a count of all
+new notifications. Once a users sees the notifications in the system tray, the
+count is reset to zero.
 </p>
 
 <p>
 Notifications can be assigned a priority between -2 to 2.
-Priorities < 0 are only shown in the center;
-priorities > 0 are shown for increasing duration and
+Priorities < 0 are shown in the ChromeOS notification center, and produce an
+error on other platforms.
+Priority 0 is the default priority.
+Priorities > 0 are shown for increasing duration and
 more high priority notifications can be displayed in the system tray.
 </p>
 
diff --git a/chrome/common/localized_error.cc b/chrome/common/localized_error.cc
index 24628b0..907ebc2 100644
--- a/chrome/common/localized_error.cc
+++ b/chrome/common/localized_error.cc
@@ -48,9 +48,6 @@
     "https://support.google.com/chrome/answer/95626";
 static const char kWeakDHKeyLearnMoreUrl[] =
     "https://support.google.com/chrome?p=dh_error";
-static const char kCachedCopyButtonFieldTrial[] =
-    "EnableGoogleCachedCopyTextExperiment";
-static const char kCachedCopyButtonExpTypeControl[] = "control";
 static const int kGoogleCachedCopySuggestionType = 0;
 
 enum NAV_SUGGESTIONS {
@@ -517,6 +514,36 @@
   return "icon-generic";
 }
 
+// If the first suggestion is for a Google cache copy link. Promote the
+// suggestion to a separate set of strings for displaying as a button.
+void AddGoogleCachedCopyButton(base::ListValue* suggestions,
+                               base::DictionaryValue* error_strings) {
+  if (!suggestions->empty()) {
+    base::DictionaryValue* suggestion;
+    suggestions->GetDictionary(0, &suggestion);
+    int type = -1;
+    suggestion->GetInteger("type", &type);
+
+    if (type == kGoogleCachedCopySuggestionType) {
+      base::string16 cache_url;
+      suggestion->GetString("urlCorrection", &cache_url);
+      int cache_tracking_id = -1;
+      suggestion->GetInteger("trackingId", &cache_tracking_id);
+      scoped_ptr<base::DictionaryValue> cache_button(new base::DictionaryValue);
+      cache_button->SetString(
+            "msg",
+            l10n_util::GetStringUTF16(IDS_ERRORPAGES_BUTTON_SHOW_SAVED_COPY));
+      cache_button->SetString("cacheUrl", cache_url);
+      cache_button->SetInteger("trackingId", cache_tracking_id);
+      error_strings->Set("cacheButton", cache_button.release());
+
+      // Remove the item from suggestions dictionary so that it does not get
+      // displayed by the template in the details section.
+      suggestions->Remove(0, nullptr);
+    }
+  }
+}
+
 }  // namespace
 
 const char LocalizedError::kHttpErrorDomain[] = "http";
@@ -672,9 +699,8 @@
   } else {
     suggestions = params->override_suggestions.release();
     use_default_suggestions = false;
-    EnableGoogleCachedCopyButtonExperiment(suggestions, error_strings);
+    AddGoogleCachedCopyButton(suggestions, error_strings);
   }
-
   error_strings->Set("suggestions", suggestions);
 
   if (params->search_url.is_valid()) {
@@ -892,39 +918,3 @@
   // not.
   return LookupErrorMap(error_domain, error_code, /*is_post=*/false) != NULL;
 }
-
-void LocalizedError::EnableGoogleCachedCopyButtonExperiment(
-    base::ListValue* suggestions,
-    base::DictionaryValue* error_strings) {
-  std::string field_trial_exp_type_ =
-      base::FieldTrialList::FindFullName(kCachedCopyButtonFieldTrial);
-
-  // Google cache copy button experiment.
-  // If the first suggestion is for a Google cache copy. Promote the
-  // suggestion to a separate set of strings for displaying as a button.
-  if (!suggestions->empty() && !field_trial_exp_type_.empty() &&
-      field_trial_exp_type_ != kCachedCopyButtonExpTypeControl) {
-    base::DictionaryValue* suggestion;
-    suggestions->GetDictionary(0, &suggestion);
-    int type = -1;
-    suggestion->GetInteger("type", &type);
-
-    if (type == kGoogleCachedCopySuggestionType) {
-      base::string16 cache_url;
-      suggestion->GetString("urlCorrection", &cache_url);
-      int cache_tracking_id = -1;
-      suggestion->GetInteger("trackingId", &cache_tracking_id);
-      scoped_ptr<base::DictionaryValue> cache_button(new base::DictionaryValue);
-      cache_button->SetString(
-            "msg",
-            l10n_util::GetStringUTF16(IDS_ERRORPAGES_BUTTON_SHOW_SAVED_COPY));
-      cache_button->SetString("cacheUrl", cache_url);
-      cache_button->SetInteger("trackingId", cache_tracking_id);
-      error_strings->Set("cacheButton", cache_button.release());
-
-      // Remove the item from suggestions dictionary so that it does not get
-      // displayed by the template in the details section.
-      suggestions->Remove(0, nullptr);
-    }
-  }
-}
diff --git a/chrome/common/localized_error.h b/chrome/common/localized_error.h
index 395668ca..c79c72ce 100644
--- a/chrome/common/localized_error.h
+++ b/chrome/common/localized_error.h
@@ -14,7 +14,6 @@
 
 namespace base {
 class DictionaryValue;
-class ListValue;
 }
 
 namespace blink {
@@ -50,13 +49,6 @@
   static const char kHttpErrorDomain[];
 
  private:
-  // Sets up the Google Cached Copy button experiment if part of the
-  // field trial. This promotes the Google cached copy suggestion from under
-  // the details section to a blue button. Also experiments with the
-  // button label.
-  static void EnableGoogleCachedCopyButtonExperiment(
-      base::ListValue* suggestions,
-      base::DictionaryValue* error_strings);
 
   DISALLOW_IMPLICIT_CONSTRUCTORS(LocalizedError);
 };
diff --git a/chrome/common/render_messages.h b/chrome/common/render_messages.h
index ec6025c..8dd3bef 100644
--- a/chrome/common/render_messages.h
+++ b/chrome/common/render_messages.h
@@ -435,11 +435,6 @@
 IPC_MESSAGE_ROUTED1(ChromeViewMsg_AppBannerDismissed,
                     int32_t /* request_id */)
 
-// Asks the renderer to log a debug message to console regarding an
-// app banner.
-IPC_MESSAGE_ROUTED1(ChromeViewMsg_AppBannerDebugMessageRequest,
-                    std::string /* message */)
-
 // Notification that the page has an OpenSearch description document
 // associated with it.
 IPC_MESSAGE_ROUTED3(ChromeViewHostMsg_PageHasOSDD,
diff --git a/chrome/installer/mini_installer/chrome.release b/chrome/installer/mini_installer/chrome.release
index e82cb4f..98453be 100644
--- a/chrome/installer/mini_installer/chrome.release
+++ b/chrome/installer/mini_installer/chrome.release
@@ -20,6 +20,7 @@
 #
 chrome.dll: %(VersionDir)s\
 chrome_100_percent.pak: %(VersionDir)s\
+chrome_material_100_percent.pak: %(VersionDir)s\
 chrome_child.dll: %(VersionDir)s\
 chrome_elf.dll: %(VersionDir)s\
 chrome_watcher.dll: %(VersionDir)s\
@@ -50,6 +51,7 @@
 
 [HIDPI]
 chrome_200_percent.pak: %(VersionDir)s\
+chrome_material_200_percent.pak: %(VersionDir)s\
 
 [TOUCH]
 
diff --git a/chrome/installer/util/BUILD.gn b/chrome/installer/util/BUILD.gn
index 164e1b9..d6286a4 100644
--- a/chrome/installer/util/BUILD.gn
+++ b/chrome/installer/util/BUILD.gn
@@ -277,10 +277,6 @@
       "//chrome/installer/test:alternate_version_generator_lib",
       "//components/variations",
       "//content/public/common",
-
-      # TODO(rockot): Remove this hack when we fix mojo environment deps.
-      # See http://crbug.com/501385
-      "//mojo/environment:chromium",
       "//testing/gmock",
       "//testing/gtest",
     ]
diff --git a/chrome/interactive_ui_tests.isolate b/chrome/interactive_ui_tests.isolate
index fbb78b2..d5af58e 100644
--- a/chrome/interactive_ui_tests.isolate
+++ b/chrome/interactive_ui_tests.isolate
@@ -63,6 +63,7 @@
     ['OS=="linux" or OS=="win"', {
       'variables': {
         'files': [
+          '<(PRODUCT_DIR)/chrome_material_100_percent.pak',
           '<(PRODUCT_DIR)/chrome_100_percent.pak',
           '<(PRODUCT_DIR)/locales/en-US.pak',
           '<(PRODUCT_DIR)/locales/fr.pak',
diff --git a/chrome/renderer/chrome_render_frame_observer.cc b/chrome/renderer/chrome_render_frame_observer.cc
index 6f71da9..3f364567 100644
--- a/chrome/renderer/chrome_render_frame_observer.cc
+++ b/chrome/renderer/chrome_render_frame_observer.cc
@@ -215,8 +215,6 @@
                         OnPrintNodeUnderContextMenu)
     IPC_MESSAGE_HANDLER(ChromeViewMsg_AppBannerPromptRequest,
                         OnAppBannerPromptRequest)
-    IPC_MESSAGE_HANDLER(ChromeViewMsg_AppBannerDebugMessageRequest,
-                        OnAppBannerDebugMessageRequest)
     IPC_MESSAGE_UNHANDLED(handled = false)
   IPC_END_MESSAGE_MAP()
 
@@ -354,12 +352,6 @@
       routing_id(), request_id, reply, referrer));
 }
 
-void ChromeRenderFrameObserver::OnAppBannerDebugMessageRequest(
-    const std::string& message) {
-  render_frame()->GetWebFrame()->addMessageToConsole(blink::WebConsoleMessage(
-      blink::WebConsoleMessage::LevelDebug, base::UTF8ToUTF16(message)));
-}
-
 void ChromeRenderFrameObserver::DidFinishLoad() {
   WebLocalFrame* frame = render_frame()->GetWebFrame();
   // Don't do anything for subframes.
diff --git a/chrome/renderer/chrome_render_frame_observer.h b/chrome/renderer/chrome_render_frame_observer.h
index 283729d7..c98de30 100644
--- a/chrome/renderer/chrome_render_frame_observer.h
+++ b/chrome/renderer/chrome_render_frame_observer.h
@@ -98,7 +98,6 @@
   void OnSetClientSidePhishingDetection(bool enable_phishing_detection);
   void OnAppBannerPromptRequest(int request_id,
                                 const std::string& platform);
-  void OnAppBannerDebugMessageRequest(const std::string& message);
 
   // PageInfoReceiver implementation.
   void PageCaptured(base::string16* content, CaptureType capture_type) override;
diff --git a/chrome/telemetry_binary_manager.isolate b/chrome/telemetry_binary_manager.isolate
index 5aafc2b6..aac7eaf7 100644
--- a/chrome/telemetry_binary_manager.isolate
+++ b/chrome/telemetry_binary_manager.isolate
@@ -17,7 +17,7 @@
       'variables': {
         'files': [
           # Chromium local path information for Telemetry's binary_manager.
-          '../tools/perf/core/binary_dependencies.json',
+          '../tools/perf/chrome_telemetry_build/',
         ],
       },
     }],
diff --git a/chrome/telemetry_gpu_unittests.isolate b/chrome/telemetry_gpu_unittests.isolate
index 4b5d5b66..4d5c1ae 100644
--- a/chrome/telemetry_gpu_unittests.isolate
+++ b/chrome/telemetry_gpu_unittests.isolate
@@ -12,6 +12,8 @@
           # Other dependencies of the tests and their harness.
           '../third_party/typ/',
           '../third_party/catapult/',
+          '../testing/test_env.py',
+          '../testing/xvfb.py',
           '../testing/scripts/common.py',
           '../testing/scripts/run_telemetry_as_googletest.py',
           # The following represent the actual tests.
diff --git a/chrome/test/BUILD.gn b/chrome/test/BUILD.gn
index e6cd5875..218f1d4 100644
--- a/chrome/test/BUILD.gn
+++ b/chrome/test/BUILD.gn
@@ -258,7 +258,7 @@
   data_deps = []
 
   data = [
-    "//tools/perf/core/binary_dependencies.json",
+    "//tools/perf/chrome_telemetry_build/",
   ]
 
   if (is_win) {
@@ -314,6 +314,7 @@
     if (is_linux || is_win) {
       data += [
         "$root_out_dir/chrome_100_percent.pak",
+        "$root_out_dir/chrome_material_100_percent.pak",
         "$root_out_dir/locales/en-US.pak",
         "$root_out_dir/locales/fr.pak",
       ]
@@ -779,7 +780,9 @@
   # The _run targets exist only for compatibility w/ GYP.
   group("browser_tests_run") {
     testonly = true
-    data_deps = [ ":browser_tests" ]
+    data_deps = [
+      ":browser_tests",
+    ]
   }
 
   test("browser_tests") {
@@ -824,6 +827,7 @@
       "$root_out_dir/pyproto/",
       "$root_out_dir/browser_tests.pak",
       "$root_out_dir/chrome_100_percent.pak",
+      "$root_out_dir/chrome_material_100_percent.pak",
       "$root_out_dir/locales/",
       "$root_out_dir/remoting/unittests/",
       "$root_out_dir/resources.pak",
@@ -1301,6 +1305,7 @@
     if (is_linux || is_win) {
       data += [
         "$root_out_dir/chrome_100_percent.pak",
+        "$root_out_dir/chrome_material_100_percent.pak",
         "$root_out_dir/locales/en-US.pak",
       ]
     }
@@ -1328,7 +1333,9 @@
       "//third_party/WebKit/public:blink",
     ]
 
-    data_deps = [ "//third_party/mesa:osmesa" ]
+    data_deps = [
+      "//third_party/mesa:osmesa",
+    ]
 
     if (cld_version == 2) {
       # Language detection is irrelevant to sync, so it can depend on any
@@ -1524,6 +1531,9 @@
         "$root_out_dir/locales/en-US.pak",
       ]
     }
+    if (is_linux || is_win) {
+      data += [ "$root_out_dir/chrome_material_100_percent.pak" ]
+    }
 
     defines = []
 
@@ -1617,11 +1627,9 @@
               "//chrome")
       sources -= [ "../browser/download/download_request_infobar_delegate_unittest.cc" ]
     }
+
     if (is_ios || is_chromeos) {
-      sources -= [
-        "../browser/metrics/chrome_signin_status_metrics_provider_delegate_unittest.cc",
-        "../browser/metrics/signin_status_metrics_provider_unittest.cc",
-      ]
+      sources -= [ "../browser/signin/chrome_signin_status_metrics_provider_delegate_unittest.cc" ]
     }
     if (enable_background) {
       sources += rebase_path(
diff --git a/chrome/test/android/javatests/src/org/chromium/chrome/test/util/ApplicationData.java b/chrome/test/android/javatests/src/org/chromium/chrome/test/util/ApplicationData.java
index 3f778fd..d834291 100644
--- a/chrome/test/android/javatests/src/org/chromium/chrome/test/util/ApplicationData.java
+++ b/chrome/test/android/javatests/src/org/chromium/chrome/test/util/ApplicationData.java
@@ -87,7 +87,9 @@
         if (files == null) return true;
         for (File file : files) {
             if (!(file.getAbsolutePath().endsWith("/lib")
-                    || file.getAbsolutePath().endsWith("/etp_native")) && !removeFile(file)) {
+                    || file.getAbsolutePath().endsWith("/etp_native") // Work Chrome
+                    || file.getAbsolutePath().endsWith("/sdk_dex")) // Work Chrome
+                    && !removeFile(file)) {
                 return false;
             }
         }
diff --git a/chrome/test/chromedriver/chrome/preferences.txt b/chrome/test/chromedriver/chrome/preferences.txt
index 1ad1f7a1..ab32bab 100644
--- a/chrome/test/chromedriver/chrome/preferences.txt
+++ b/chrome/test/chromedriver/chrome/preferences.txt
@@ -37,6 +37,9 @@
          "popups": 1,
          "ppapi-broker": 1
       },
+      "default_content_setting_values": {
+        "geolocation": 1
+      },
       "password_manager_enabled": false
    },
    "safebrowsing": {
diff --git a/chrome/test/data/extensions/api_test/automation/tests/tabs/document_selection.js b/chrome/test/data/extensions/api_test/automation/tests/tabs/document_selection.js
index e049050..ef13f25 100644
--- a/chrome/test/data/extensions/api_test/automation/tests/tabs/document_selection.js
+++ b/chrome/test/data/extensions/api_test/automation/tests/tabs/document_selection.js
@@ -23,7 +23,7 @@
                                             anchorOffset: 0,
                                             focusObject: textNode,
                                             focusOffset: 3});
-    listenOnce(rootNode, EventType.textSelectionChanged, function(evt) {
+    listenOnce(rootNode, EventType.documentSelectionChanged, function(evt) {
       assertEq(textNode, rootNode.anchorObject);
       assertEq(0, rootNode.anchorOffset);
       assertEq(textNode, rootNode.focusObject);
@@ -36,22 +36,19 @@
     var textField = rootNode.find({role: RoleType.textField});
     assertTrue(!!textField);
     textField.focus();
-    listenOnce(rootNode, EventType.textSelectionChanged, function(evt) {
-      assertTrue(evt.target === rootNode || evt.target === textField);
-      assertEq(textField, rootNode.anchorObject);
-      assertEq(0, rootNode.anchorOffset);
-      assertEq(textField, rootNode.focusObject);
-      assertEq(0, rootNode.focusOffset);
-      // Wait for another text selection change event.  There's one for
-      // the document root and one for the text field.
-      listenOnce(rootNode, EventType.textSelectionChanged, function() {
-        assertTrue(evt.target === rootNode || evt.target === textField);
-        assertTrue(evt.target === rootNode || evt.target === textField);
+    listenOnce(textField, EventType.textSelectionChanged, function(evt) {
+      listenOnce(rootNode, EventType.documentSelectionChanged, function(evt) {
+        assertTrue(evt.target === rootNode);
+        assertEq(textField, rootNode.anchorObject);
+        assertEq(0, rootNode.anchorOffset);
+        assertEq(textField, rootNode.focusObject);
+        assertEq(0, rootNode.focusOffset);
         chrome.automation.setDocumentSelection({anchorObject: textField,
                                                 anchorOffset: 1,
                                                 focusObject: textField,
                                                 focusOffset: 3});
-        listenOnce(rootNode, EventType.textSelectionChanged, function(evt) {
+        listenOnce(rootNode, EventType.documentSelectionChanged,
+                   function(evt) {
           assertEq(textField, rootNode.anchorObject);
           assertEq(1, rootNode.anchorOffset);
           assertEq(textField, rootNode.focusObject);
diff --git a/chrome/test/data/extensions/api_test/tabs/basics/crud.js b/chrome/test/data/extensions/api_test/tabs/basics/crud.js
index 542d3b2..86a19f62bf 100644
--- a/chrome/test/data/extensions/api_test/tabs/basics/crud.js
+++ b/chrome/test/data/extensions/api_test/tabs/basics/crud.js
@@ -132,7 +132,7 @@
     }));
   }
 
-  /* Disabled -- see http://bugs.chromium.org/58229.
+  /* Disabled -- see http://crbug.com/58229.
   function windowSetFocused() {
     chrome.windows.getCurrent(function(oldWin) {
       chrome.windows.create({}, function(newWin) {
diff --git a/chrome/test/data/extensions/api_test/webstore_inline_install/install_prohibited.html b/chrome/test/data/extensions/api_test/webstore_inline_install/install_prohibited.html
index 091b9ba..4095832 100644
--- a/chrome/test/data/extensions/api_test/webstore_inline_install/install_prohibited.html
+++ b/chrome/test/data/extensions/api_test/webstore_inline_install/install_prohibited.html
@@ -23,7 +23,7 @@
             window.domAutomationController.send(false);
           },
           function(error, errorCode) {
-            if (error.indexOf('cannot be modified') != -1 &&
+            if (error.indexOf('can only be modified by the manager') != -1 &&
                 errorCode == 'otherError') {
               console.log('Ran test, sending response');
               window.domAutomationController.send(true);
diff --git a/chrome/test/data/extensions/platform_apps/ephemeral_launcher/app.crx b/chrome/test/data/extensions/platform_apps/ephemeral_launcher/app.crx
deleted file mode 100644
index 0a8502b..0000000
--- a/chrome/test/data/extensions/platform_apps/ephemeral_launcher/app.crx
+++ /dev/null
Binary files differ
diff --git a/chrome/test/data/extensions/platform_apps/ephemeral_launcher/app.pem b/chrome/test/data/extensions/platform_apps/ephemeral_launcher/app.pem
deleted file mode 100644
index 6d2b6ae..0000000
--- a/chrome/test/data/extensions/platform_apps/ephemeral_launcher/app.pem
+++ /dev/null
@@ -1,28 +0,0 @@
------BEGIN PRIVATE KEY-----
-MIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQDBUe9m01dbRMdT
-irq/xyQojlugvSchBty8H/qWVs471yggJjkuN1A70Fmnk/oQCHkPhF5O6hV3ud0g
-u89dDG0NPDSWl2qX0No4jqyeQ2VFOV31ZHPVrtGO21xNjIebAQZ/svNrce9Q8bVy
-A3wUQXGvV+sOt7BhFU8AfYIqeQ5VldFeLM1zaLC8CsO8Eq12wsB/+h15EEKQtcDN
-c+y/BnKd1tq89Vl+CcUe5d5mZS11E9SsxdNxzY3JTh/0OSNF71edKYFchnNbe0/3
-Z85CfwktoQcIY7LovESm5o8Xf+3T1XBbc6Ifa4bfNjULGZuLXaNmksIz6nOw2GYt
-jKJHNoDVAgMBAAECggEBAIpD6N75PxyG9603ptOtQZ5EGyK+xrKnbs6abKaEFWLV
-QtyjmfgFFbyCCu2BN7Op67P+b1kvsQT9iTt1OB2L2p9BtTcTuug0Ny+GU82p1E+L
-dTkijHqDW1w6Zi0M2pwxQo2o1tK9HXYeOjD+bwspt366eeL/3AXDsMpf+e4YwPjS
-PT9ZFUr58pJH3e9p9oWa1i7LQssEqtgvHQjsLch05kj2V/pyJnydgwffcRQNguYE
-uVfxSUnrmE2w438pJbOXWOMiGNnWeI01gTs7hhjOETX6uGmQyoPCo/wMm9fd3vCc
-mjtJojsExxXHL1Mgbz4455SHPc33JCtI1My+RG4mSQ0CgYEA36XkTgYDVLnFBwfh
-2MytmI0PlU5uZP78t0E6rnshbaseQPos5e+/tfn1/Vb64Qmk528+6fbTzM4e3vLo
-d4KsvGf9SPs19ypm8OmAAu/3M6KjKOgG5YqoDsd6ED5qUjsTVB9LLjr9Xb5dPhte
-0ErFG8dqS7IkIRwr/lLBRkM7ec8CgYEA3UjxICZk7i+7apOmutr6Y9vcRiVFoDhj
-YHwZkr3CoRbwU0fPR1nm5qDXTAGDJ4S3iq7HsiSFByvzKizu4eIAyUz6028yKQ64
-di98B79S+Lh7PykWx27nujVMWWw4du46kkr1qEVHvOu0exPMlfGgUEb8zSSDZrnk
-31LDRRi22BsCgYEAkdMtJeKt0VS/r3HoROBQYKO5gXT+bkQEq8iQZqxKg6OLunpl
-RBgrPJCbYHCSbKFJMM5Mi2kxeNz9LAneoe5GiyKS+D80VNEFBhh6K3AkEzr8f/Oq
-a4kZQ2m1oVnRIYT7eWJeNuqnwbQaQCDAlbfrBc3k9S5WeHBSDyYOd63m3ekCgYEA
-mAUHWf3mctep2nLrJQ1Q3Q9rCWmLpqF2bA91hiEFN6PJoH0BwlPZ0/EFV3rmflyn
-tweRuylpll60I/JQfi/EOIbA/kYy4I/zW4YNoEjpGGOsj9yLgKEJYxxAgmJdfB73
-cA89KsfFm90V1UPp1cz0RJIwFEKUXxswR9fUvIBZBKcCgYAngAbZkkaq1VWo0qYy
-6tk7DyYob5kLvMY/FCDPx5+FZKz5NaJkIWkEvtytphidk2r4vqaCa9tp0VaTIe2Q
-2BShVaBnkKyF0Qn0f1XXiTfVIa/zduQc580vqI1FTCoXaPO/3wYa345AjrQoRZls
-nviXEgVqFDhTgBG0yzpSnHhhsg==
------END PRIVATE KEY-----
diff --git a/chrome/test/data/extensions/platform_apps/ephemeral_launcher/app/index.html b/chrome/test/data/extensions/platform_apps/ephemeral_launcher/app/index.html
deleted file mode 100644
index c341a40..0000000
--- a/chrome/test/data/extensions/platform_apps/ephemeral_launcher/app/index.html
+++ /dev/null
@@ -1 +0,0 @@
-<!-- empty -->
diff --git a/chrome/test/data/extensions/platform_apps/ephemeral_launcher/app/main.js b/chrome/test/data/extensions/platform_apps/ephemeral_launcher/app/main.js
deleted file mode 100644
index 0c871282..0000000
--- a/chrome/test/data/extensions/platform_apps/ephemeral_launcher/app/main.js
+++ /dev/null
@@ -1,10 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-chrome.app.runtime.onLaunched.addListener(function() {
-  chrome.app.window.create('index.html', {}, function(win) {
-    chrome.test.sendMessage('launched');
-    win.close();
-  });
-});
diff --git a/chrome/test/data/extensions/platform_apps/ephemeral_launcher/app/manifest.json b/chrome/test/data/extensions/platform_apps/ephemeral_launcher/app/manifest.json
deleted file mode 100644
index d57532b2..0000000
--- a/chrome/test/data/extensions/platform_apps/ephemeral_launcher/app/manifest.json
+++ /dev/null
@@ -1,10 +0,0 @@
-{
-  "name": "Simple Test App",
-  "manifest_version": 2,
-  "version": "1",
-  "app": {
-    "background": {
-      "scripts": ["main.js"]
-    }
-  }
-}
diff --git a/chrome/test/data/extensions/platform_apps/ephemeral_launcher/app_with_permissions.crx b/chrome/test/data/extensions/platform_apps/ephemeral_launcher/app_with_permissions.crx
deleted file mode 100644
index a87cd95..0000000
--- a/chrome/test/data/extensions/platform_apps/ephemeral_launcher/app_with_permissions.crx
+++ /dev/null
Binary files differ
diff --git a/chrome/test/data/extensions/platform_apps/ephemeral_launcher/app_with_permissions.pem b/chrome/test/data/extensions/platform_apps/ephemeral_launcher/app_with_permissions.pem
deleted file mode 100644
index a552b2e..0000000
--- a/chrome/test/data/extensions/platform_apps/ephemeral_launcher/app_with_permissions.pem
+++ /dev/null
@@ -1,28 +0,0 @@
------BEGIN PRIVATE KEY-----
-MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQC5ZOMEtT5hrz5k
-Mh9cbalNWt8P81unURX+Q5sPx1PxOlCylF6EiciE+pQjcXSqFm2OsKQuNojqyEM6
-93LMQnT1UKRxrV7tSNALqGiQ6Xh4JKKe0sLqW4rFscw9Hjrzop8KeOpwUygiFgdD
-6t0NAVErSr85PNatureoC+nYEZxA7ESHI0X7SVnWoew7AFULfdWPYwQzmBbldFxx
-UNeGklYlxviahey9HHiHC/kWomwQ0NvdN9jGAhI5W9nuFs5XY+fSiO/HPYSX37vP
-0fkTyRPTkrRcncH9/YTh2vaEHDbHKsGZKuY8/nz2B32SX5zP+jjSQPJ8dfqjEFX6
-He6d4C7tAgMBAAECggEAMm4J/sbacDH+M70aoMbHrd4RHUKiZNH+vIphTJp47/5f
-4yPOzhi4rcuHrlh3VqkBJjZQgq2c8tiEyS50ULGnJO/Ju45gawVKalFmGD0Z4vx8
-K93C3YMHLZ2eo+VsPce3oV6gzusf2J3LXiMt/BKmpLMRbx1ofBt1R8Xt1zN7IIFt
-mR9gPF7EIzYRlD5M6Lj76j2e0dv/QZVdDOsNEcww1bys9If00BgLCPZmlAUz7rE5
-uQytekLwrb5EM3jb3MTANHivNwWWMY1BR2hQTgRQ+QDKmK020GIRzth3B0Xa3fkJ
-WpG26JbznF079IAFpb/+6b365mkTPs8TX3dyAa7iwQKBgQDpZYCh15bznP2jodfi
-LpT40xuyxvhiKLvH1WlRxgcm3QewoZvKHfZXQ6HUCOcfirunlNdQviiByIr8za7A
-qIXAsqg9W5BLCeLCMSAlRV4CnAF4457PShoFTaSN8Hu7MbpHSvM+NaDXm/lv5gNF
-XSrH0wBP/PmtInn4mb6BzZFTcQKBgQDLWUgYPuF6sFcsD1ve2gKoj71jGEnuPdqP
-5RF/ZIitS9sk+TP8KgsSycNFX1u/HrcuiOClVz3bZC39oKgqyEMiaUKYYBc+Tk71
-ymJkAdGoLoJnaINXqTTRUZO8zaErhyNQxFut6X+ejgqLgGPV5Mc/HQXVr8eG0NA7
-4W5Lo8OdPQKBgHu3PRcMw0xA1EXPfTK8hGTc6lq6k2DcvKTxn9Ejyhi0ouXi1ESv
-2ytogzh0u6aBkHUFNZjsI2agGeRlVpNzAOsjCID1ryfHhrZu+d4nxexWK4WcCktQ
-uThEbsx6Q+v3MQmnVgaMwMRpPjAtWWCEQTAIzaqYqvQ2STcYr934TGdRAoGAS997
-Q/iqXwHO9NSiPctwdH51drUIWMlhdJFO7w6O5MJJ+Ui2ed8iFJeNsaO78tq+FLHj
-yC1+Gg8ODfVU6emhCwTlYT9xTMEhOxqRjakUFkGMTJM1do7e8z8R9b9v5HLe3XL2
-ljRqdrme+6AjIBrlsQneNHYK56WgHMenRLfM9C0CgYEA4SW4+QaO7AYJIJhWCZ8I
-blFj6q95FUfsMEUBlEqJQJxKUSdn58AJ96RcwLD1KmXhyTNctD5BidkApFmi8IXa
-qJcbbCOinEJn2NFT6/C8ZbF8w6cvJaG8c3iLZaUwDmmX+oKC2GbqSYhqN2K96HUp
-tpcPgbZnwkbs/8pYq2jxTLk=
------END PRIVATE KEY-----
diff --git a/chrome/test/data/extensions/platform_apps/ephemeral_launcher/app_with_permissions/index.html b/chrome/test/data/extensions/platform_apps/ephemeral_launcher/app_with_permissions/index.html
deleted file mode 100644
index c341a40..0000000
--- a/chrome/test/data/extensions/platform_apps/ephemeral_launcher/app_with_permissions/index.html
+++ /dev/null
@@ -1 +0,0 @@
-<!-- empty -->
diff --git a/chrome/test/data/extensions/platform_apps/ephemeral_launcher/app_with_permissions/main.js b/chrome/test/data/extensions/platform_apps/ephemeral_launcher/app_with_permissions/main.js
deleted file mode 100644
index 0c871282..0000000
--- a/chrome/test/data/extensions/platform_apps/ephemeral_launcher/app_with_permissions/main.js
+++ /dev/null
@@ -1,10 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-chrome.app.runtime.onLaunched.addListener(function() {
-  chrome.app.window.create('index.html', {}, function(win) {
-    chrome.test.sendMessage('launched');
-    win.close();
-  });
-});
diff --git a/chrome/test/data/extensions/platform_apps/ephemeral_launcher/app_with_permissions/manifest.json b/chrome/test/data/extensions/platform_apps/ephemeral_launcher/app_with_permissions/manifest.json
deleted file mode 100644
index 534ff17..0000000
--- a/chrome/test/data/extensions/platform_apps/ephemeral_launcher/app_with_permissions/manifest.json
+++ /dev/null
@@ -1,11 +0,0 @@
-{
-  "name": "Test App With Permissions",
-  "manifest_version": 2,
-  "version": "1",
-  "app": {
-    "background": {
-      "scripts": ["main.js"]
-    }
-  },
-  "permissions": ["audioCapture"]
-}
diff --git a/chrome/test/data/extensions/platform_apps/ephemeral_launcher/extension/manifest.json b/chrome/test/data/extensions/platform_apps/ephemeral_launcher/extension/manifest.json
deleted file mode 100644
index 0f9cc06..0000000
--- a/chrome/test/data/extensions/platform_apps/ephemeral_launcher/extension/manifest.json
+++ /dev/null
@@ -1,5 +0,0 @@
-{
-  "name": "Test Extension",
-  "version": "0.1",
-  "manifest_version": 2
-}
diff --git a/chrome/test/data/extensions/platform_apps/ephemeral_launcher/inlineinstall/detail/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeid b/chrome/test/data/extensions/platform_apps/ephemeral_launcher/inlineinstall/detail/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeid
deleted file mode 100644
index b5895ac..0000000
--- a/chrome/test/data/extensions/platform_apps/ephemeral_launcher/inlineinstall/detail/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeid
+++ /dev/null
@@ -1,6 +0,0 @@
-{
-  "users": "371,674",
-  "average_rating": 4.36,
-  "rating_count": 788,
-  "manifest": "{\"name\":\"Test Extension\",\"version\":\"0.1\"}"
-}
diff --git a/chrome/test/data/extensions/platform_apps/ephemeral_launcher/inlineinstall/detail/haaaaaaaaaaaaaaaaaaaaaaaaaaappid b/chrome/test/data/extensions/platform_apps/ephemeral_launcher/inlineinstall/detail/haaaaaaaaaaaaaaaaaaaaaaaaaaappid
deleted file mode 100644
index 9d13885..0000000
--- a/chrome/test/data/extensions/platform_apps/ephemeral_launcher/inlineinstall/detail/haaaaaaaaaaaaaaaaaaaaaaaaaaappid
+++ /dev/null
@@ -1,6 +0,0 @@
-{
-  "users": "371,674",
-  "average_rating": 4.36,
-  "rating_count": 788,
-  "manifest": "{\"name\":\"Hosted App\",\"manifest_version\":2,\"version\":\"1\",\"app\": {\"launch\":{\"web_url\":\"http://foo.bar.com\"}}}"
-}
diff --git a/chrome/test/data/extensions/platform_apps/ephemeral_launcher/inlineinstall/detail/kbiancnbopdghkfedjhfdoegjadfjeal b/chrome/test/data/extensions/platform_apps/ephemeral_launcher/inlineinstall/detail/kbiancnbopdghkfedjhfdoegjadfjeal
deleted file mode 100644
index b3ef1c78..0000000
--- a/chrome/test/data/extensions/platform_apps/ephemeral_launcher/inlineinstall/detail/kbiancnbopdghkfedjhfdoegjadfjeal
+++ /dev/null
@@ -1,6 +0,0 @@
-{
-  "users": "371,674",
-  "average_rating": 4.36,
-  "rating_count": 788,
-  "manifest": "{\"name\":\"Simple Test App\",\"manifest_version\":2,\"version\":\"1\",\"app\": {\"background\":{\"scripts\":[\"main.js\"]}}}"
-}
diff --git a/chrome/test/data/extensions/platform_apps/ephemeral_launcher/inlineinstall/detail/lnbochkobjfnhbnbljgfgokadhmbahcn b/chrome/test/data/extensions/platform_apps/ephemeral_launcher/inlineinstall/detail/lnbochkobjfnhbnbljgfgokadhmbahcn
deleted file mode 100644
index add5618..0000000
--- a/chrome/test/data/extensions/platform_apps/ephemeral_launcher/inlineinstall/detail/lnbochkobjfnhbnbljgfgokadhmbahcn
+++ /dev/null
@@ -1,6 +0,0 @@
-{
-  "users": "371,674",
-  "average_rating": 4.36,
-  "rating_count": 788,
-  "manifest": "{\"name\":\"Legacy Test App\",\"manifest_version\":2,\"version\":\"1\",\"app\": {\"launch\":{\"local_path\":\"main.html\"}}}"
-}
diff --git a/chrome/test/data/extensions/platform_apps/ephemeral_launcher/inlineinstall/detail/mbfcnecjknjpipkfkoangpfnhhlpamki b/chrome/test/data/extensions/platform_apps/ephemeral_launcher/inlineinstall/detail/mbfcnecjknjpipkfkoangpfnhhlpamki
deleted file mode 100644
index 90a4ce7..0000000
--- a/chrome/test/data/extensions/platform_apps/ephemeral_launcher/inlineinstall/detail/mbfcnecjknjpipkfkoangpfnhhlpamki
+++ /dev/null
@@ -1,6 +0,0 @@
-{
-  "users": "371,674",
-  "average_rating": 4.36,
-  "rating_count": 788,
-  "manifest": "{\"name\":\"Test App With Permissions\",\"manifest_version\":2,\"version\":\"1\",\"app\":{\"background\":{\"scripts\":[\"main.js\"]}},\"permissions\":[\"audioCapture\"]}"
-}
diff --git a/chrome/test/data/extensions/platform_apps/ephemeral_launcher/legacy_app.pem b/chrome/test/data/extensions/platform_apps/ephemeral_launcher/legacy_app.pem
deleted file mode 100644
index d8a09ee..0000000
--- a/chrome/test/data/extensions/platform_apps/ephemeral_launcher/legacy_app.pem
+++ /dev/null
@@ -1,28 +0,0 @@
------BEGIN PRIVATE KEY-----
-MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDFKMlqF/85M27R
-i/cy5yHx/KHnzqmLtB7UjtHWFejeB+aKM4c6HHc9yXkbomEcTbR1hgy6VC02xYxX
-+0dZX1/tuBQS/aIVrk7Bd8Jnv5/4pHDfX/w8likmR04yqZrdIutoQCa30vZ/GgMu
-/nWV7oP7ehfRzNK6apfH9mYmKvyMJ/i5rZZnQtIukApdMPuwq04U7z1A7OolmloA
-lnZLj3F3PWE5RStpJmFZ/kAHT3p/QXm3Putj6exfEw+4oho97h2F/uhbgR06+eBp
-vy5/bTfE22wV56VFuTa2MhY+76mDsnMNIRCIcn68qW7ZUOa+0FgRtYt91rGoLfRq
-bCYjfDU/AgMBAAECggEBAJLp4KRI+2rhU4ub83kf2CCcsvyr95TdhDe5sM0JiHui
-gXysBvEbcxM8hR09c4WGtZj5aZSS0xpEPF73JGSJeE8IYxT/oH7tY0ww9FEg7pB1
-4JHi0W9IKaOXcMK5tWdg9O+7Fd7Wuc1eUc772B0AHaMPiJ5SNRiqAy4DAn0gfQ3m
-D6r5TQ+cBeptCsNBj9HaHxhJVg7SCv4GohBqP8HkMEv4trg8/ugEv0NfOgd+LiVO
-ewX/f2El7gP6nvTDNbx0gRT0HoTzBGZkQlUuvcX2xPr1AvXhYaRMpmq18yHzXpae
-iqGL//jk4TMQW0qzvfsyQc3Pw5xnoU54hU1goVTBpaECgYEA7z8HXVZ3Ed0q9pmG
-R7+f+PVJPW1JWTFi4XtR5SxgNwfQFyUGWsB7DoMuUQrc+8ZY0ckUWIPYXF3yUuPg
-rf5iBtjtfAn1zung1qpPC98G+TNR9A8cK/4S4XV7FQ75QBaP3/SZRXHiuQB5RQU7
-UQWHbfY0YfIW/o1fHIifv1VGNc8CgYEA0vdEAt4ZRO/BQmA6Fz8dpMKWca9qSqQI
-64scdq4Bxc1QSUWkwMUVXYr+GVa/TgUvFnFSbCn10KP3aK6k8eX9PMYGXBaoB/Gy
-pmbTELCCycUP4g9WdLc0y4IlNgSnkopdU8PZzyQPl0+dfzOgnlz21piIKeARQiWC
-EsR9b3wGVZECgYBxAaiM4gakHX/ps2LGCTGa+uF5bmGzC6zVLNbmFSvtUndsN0Tl
-IP3/QN9j0GnJU0so7H37wWs1VfrcRF8gUIQlD9o9OMcu0TIus4ta5CH7G86eJXT9
-IqnwbPmSXNxG9WFIO9UaBE0/bYXaoDoAb0glHKJpkVxjKIvAgphSXAkp6QKBgQCW
-0XappiXihpRe43QkElca5pGvDHysh8Bow7bBkXxq8HCpMUSrGzo++ZLWgpGZMVOM
-c888zHKTieThzZjV5lm4DMmXJAtUQpI5K+FQWR/nJx5HujdQkXkI1C3OBF3YAVre
-+3DHCTysK5qoyTvWexdsKveNGEa+RxpKWHZkMQJGQQKBgBisFK4JxCu9s44wL5Ce
-OrlEX1XDnuHN3NGC1vPn1hJz+AEqxL0OH08T6Q8AbiXqFhWrzPG4M4wXHqAIUjid
-IbgLZYmL6PzgKPvs/vlTC1O3MncsJs8S8wVRu2REfnLHdRhrWQESPhzr7XUXHlNf
-mApQ0hAp8tztYwHjEgZBm6TG
------END PRIVATE KEY-----
diff --git a/chrome/test/data/extensions/platform_apps/ephemeral_launcher/legacy_app/main.html b/chrome/test/data/extensions/platform_apps/ephemeral_launcher/legacy_app/main.html
deleted file mode 100644
index 8060cb2..0000000
--- a/chrome/test/data/extensions/platform_apps/ephemeral_launcher/legacy_app/main.html
+++ /dev/null
@@ -1,11 +0,0 @@
-<!--
- * Copyright 2014 The Chromium Authors. All rights reserved.  Use of this
- * source code is governed by a BSD-style license that can be found in the
- * LICENSE file.
--->
-
-<html>
-<body>
-<script src="main.js"></script>
-</body>
-</html>
diff --git a/chrome/test/data/extensions/platform_apps/ephemeral_launcher/legacy_app/main.js b/chrome/test/data/extensions/platform_apps/ephemeral_launcher/legacy_app/main.js
deleted file mode 100644
index e92d3e59..0000000
--- a/chrome/test/data/extensions/platform_apps/ephemeral_launcher/legacy_app/main.js
+++ /dev/null
@@ -1,5 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-chrome.test.sendMessage('launched');
diff --git a/chrome/test/data/extensions/platform_apps/ephemeral_launcher/legacy_app/manifest.json b/chrome/test/data/extensions/platform_apps/ephemeral_launcher/legacy_app/manifest.json
deleted file mode 100644
index 95fe281..0000000
--- a/chrome/test/data/extensions/platform_apps/ephemeral_launcher/legacy_app/manifest.json
+++ /dev/null
@@ -1,10 +0,0 @@
-{
-  "name": "Legacy Test App",
-  "manifest_version": 2,
-  "version": "1",
-  "app": {
-    "launch": {
-      "local_path": "main.html"
-    }
-  }
-}
diff --git a/chrome/test/data/extensions/platform_apps/ephemeral_launcher/webstore_common.js b/chrome/test/data/extensions/platform_apps/ephemeral_launcher/webstore_common.js
deleted file mode 100644
index f79d086eb..0000000
--- a/chrome/test/data/extensions/platform_apps/ephemeral_launcher/webstore_common.js
+++ /dev/null
@@ -1,39 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Error codes and messages.
-var kFeatureDisabledCode = "feature_disabled";
-var kFeatureDisabledError =
-    "[feature_disabled]: Launching ephemeral apps is not enabled";
-var kFeatureUserGestureCode = "user_gesture_required";
-var kFeatureUserGestureError =
-    "[user_gesture_required]: User gesture is required";
-var kInstallInProgressCode = "install_in_progress";
-var kInstallInProgressError =
-    "[install_in_progress]: An install is already in progress";
-var kUnsupportedExtensionTypeCode = "unsupported_extension_type";
-var kUnsupportedExtensionTypeError =
-    "[unsupported_extension_type]: Not an app";
-
-// App ids.
-var kDefaultAppId = "kbiancnbopdghkfedjhfdoegjadfjeal";
-var kDefaultAppManifestPath = "app/manifest.json";
-var kAppWithPermissionsId = "mbfcnecjknjpipkfkoangpfnhhlpamki";
-var kAppWithPermissionsManifestPath = "app_with_permissions/manifest.json";
-var kExtensionId = "eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeid";
-
-var assertEq = chrome.test.assertEq;
-var assertFalse = chrome.test.assertFalse;
-var assertTrue = chrome.test.assertTrue;
-var callbackFail = chrome.test.callbackFail;
-var callbackPass = chrome.test.callbackPass;
-
-// Returns the string contents of the app's manifest file.
-function getManifest(path) {
-  // Do a synchronous XHR to get the manifest.
-  var xhr = new XMLHttpRequest();
-  xhr.open("GET", path, false);
-  xhr.send(null);
-  return xhr.responseText;
-}
diff --git a/chrome/test/data/extensions/platform_apps/ephemeral_launcher/webstore_launch_app.html b/chrome/test/data/extensions/platform_apps/ephemeral_launcher/webstore_launch_app.html
deleted file mode 100644
index 4667add..0000000
--- a/chrome/test/data/extensions/platform_apps/ephemeral_launcher/webstore_launch_app.html
+++ /dev/null
@@ -1,8 +0,0 @@
-<!--
- * Copyright 2014 The Chromium Authors. All rights reserved.  Use of this
- * source code is governed by a BSD-style license that can be found in the
- * LICENSE file.
--->
-
-<script src="webstore_common.js"></script>
-<script src="webstore_launch_app.js"></script>
diff --git a/chrome/test/data/extensions/platform_apps/ephemeral_launcher/webstore_launch_app.js b/chrome/test/data/extensions/platform_apps/ephemeral_launcher/webstore_launch_app.js
deleted file mode 100644
index 0c08950..0000000
--- a/chrome/test/data/extensions/platform_apps/ephemeral_launcher/webstore_launch_app.js
+++ /dev/null
@@ -1,69 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-var tests = [
-
-  // Verifies that getEphemeralAppsEnabled() will return true.
-  function canLaunchEphemeralApp() {
-    chrome.webstorePrivate.getEphemeralAppsEnabled(
-        callbackPass(function(isEnabled) {
-          assertTrue(isEnabled);
-        }));
-  },
-
-  // Verifies that launchEphemeralApp() will fail without a user gesture.
-  function noUserGesture() {
-    chrome.webstorePrivate.launchEphemeralApp(
-        kDefaultAppId,
-        callbackFail(kFeatureUserGestureError, function(result) {
-          assertEq(kFeatureUserGestureCode, result);
-        }));
-  },
-
-  // Test an attempt to launch an extension.
-  function launchExtension() {
-    chrome.test.runWithUserGesture(function() {
-      chrome.webstorePrivate.launchEphemeralApp(
-          kExtensionId,
-          callbackFail(kUnsupportedExtensionTypeError, function(result) {
-            assertEq(kUnsupportedExtensionTypeCode, result);
-          }));
-    });
-  },
-
-  // Test a successful ephemeral install and launch.
-  function launchSuccess() {
-    chrome.test.runWithUserGesture(function() {
-      chrome.webstorePrivate.launchEphemeralApp(
-          kDefaultAppId,
-          callbackPass(function(result) {
-            assertEq("success", result);
-          }));
-    });
-  },
-
-  // Verifies that launchEphemeralApp() will fail if a full install is in
-  // progress.
-  function pendingInstall() {
-    // First initiate a full install of the app.
-    var manifest = getManifest(kAppWithPermissionsManifestPath);
-    chrome.webstorePrivate.beginInstallWithManifest3(
-        { "id": kAppWithPermissionsId, "manifest": manifest },
-        callbackPass(function(result) {
-          assertEq(result, "");
-
-          // Attempt to launch the app ephemerally.
-          chrome.test.runWithUserGesture(function() {
-            chrome.webstorePrivate.launchEphemeralApp(
-                kAppWithPermissionsId,
-                callbackFail(kInstallInProgressError, function(result) {
-                  assertEq(kInstallInProgressCode, result);
-                }));
-        });
-    }));
-  }
-
-];
-
-chrome.test.runTests(tests);
diff --git a/chrome/test/data/extensions/platform_apps/ephemeral_launcher/webstore_launch_disabled.html b/chrome/test/data/extensions/platform_apps/ephemeral_launcher/webstore_launch_disabled.html
deleted file mode 100644
index 086e37076..0000000
--- a/chrome/test/data/extensions/platform_apps/ephemeral_launcher/webstore_launch_disabled.html
+++ /dev/null
@@ -1,8 +0,0 @@
-<!--
- * Copyright 2014 The Chromium Authors. All rights reserved.  Use of this
- * source code is governed by a BSD-style license that can be found in the
- * LICENSE file.
--->
-
-<script src="webstore_common.js"></script>
-<script src="webstore_launch_disabled.js"></script>
diff --git a/chrome/test/data/extensions/platform_apps/ephemeral_launcher/webstore_launch_disabled.js b/chrome/test/data/extensions/platform_apps/ephemeral_launcher/webstore_launch_disabled.js
deleted file mode 100644
index 9c7f4ed3..0000000
--- a/chrome/test/data/extensions/platform_apps/ephemeral_launcher/webstore_launch_disabled.js
+++ /dev/null
@@ -1,30 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-var tests = [
-
-  // Verifies that getEphemeralAppsEnabled() will return false if the feature
-  // is not enabled.
-  function canLaunchEphemeralApp() {
-    chrome.webstorePrivate.getEphemeralAppsEnabled(
-        callbackPass(function(isEnabled) {
-          assertFalse(isEnabled);
-        }));
-  },
-
-  // Verifies that if the feature is not enabled, launchEphemeralApp() will not
-  // succeed.
-  function launchEphemeralApp() {
-    chrome.test.runWithUserGesture(function() {
-      chrome.webstorePrivate.launchEphemeralApp(
-          kDefaultAppId,
-          callbackFail(kFeatureDisabledError, function(result) {
-            assertEq(kFeatureDisabledCode, result);
-          }));
-    });
-  }
-
-];
-
-chrome.test.runTests(tests);
diff --git a/chrome/tools/build/chromeos/FILES.cfg b/chrome/tools/build/chromeos/FILES.cfg
index 192713a..cfe7217 100644
--- a/chrome/tools/build/chromeos/FILES.cfg
+++ b/chrome/tools/build/chromeos/FILES.cfg
@@ -37,6 +37,18 @@
     'buildtype': ['dev', 'official'],
   },
   {
+    'filename': 'chrome_200_percent.pak',
+    'buildtype': ['dev', 'official'],
+  },
+  {
+    'filename': 'chrome_material_100_percent.pak',
+    'buildtype': ['dev', 'official'],
+  },
+  {
+    'filename': 'chrome_material_200_percent.pak',
+    'buildtype': ['dev', 'official'],
+  },
+  {
     'filename': 'chrome_sandbox',
     'buildtype': ['dev', 'official'],
   },
diff --git a/chrome/tools/build/win/FILES.cfg b/chrome/tools/build/win/FILES.cfg
index 73d1141..7807d426 100644
--- a/chrome/tools/build/win/FILES.cfg
+++ b/chrome/tools/build/win/FILES.cfg
@@ -87,6 +87,15 @@
     'optional': ['dev', 'official'],
   },
   {
+    'filename': 'chrome_material_100_percent.pak',
+    'buildtype': ['dev', 'official'],
+  },
+  {
+    'filename': 'chrome_material_200_percent.pak',
+    'buildtype': ['dev', 'official'],
+    'optional': ['dev', 'official'],
+  },
+  {
     'filename': 'crash_service.exe',
     'buildtype': ['dev', 'official'],
   },
diff --git a/chrome/unit_tests.isolate b/chrome/unit_tests.isolate
index a3bff84..e67d527e 100644
--- a/chrome/unit_tests.isolate
+++ b/chrome/unit_tests.isolate
@@ -152,6 +152,7 @@
       'variables': {
         'files': [
           '../chromeos/test/data/network/',
+          '<(PRODUCT_DIR)/keyboard_resources.pak',
           '<(PRODUCT_DIR)/libexif.so',
           '<(PRODUCT_DIR)/test_data/chrome/browser/resources/chromeos/',
         ],
diff --git a/chromecast/base/device_capabilities.h b/chromecast/base/device_capabilities.h
index 2a3c265..bffd37a0 100644
--- a/chromecast/base/device_capabilities.h
+++ b/chromecast/base/device_capabilities.h
@@ -104,26 +104,30 @@
 
   // Registers a Validator for a capability. A given key must only be
   // registered once, and must be unregistered before calling Register() again.
-  // The capability also gets added to the class with an initial value passed
-  // in. If the capability has a value of Dictionary type, |key| must be just
+  // If the capability has a value of Dictionary type, |key| must be just
   // the capability's top-level key and not include path expansions to levels
   // farther down. For example, "foo" is a valid value for |key|, but "foo.bar"
   // is not. Note that if "foo.bar" is updated in SetCapability(), the
   // Validate() method for "foo"'s Validator will be called, with a |path| of
   // "foo.bar". Both Register() and Unregister() must be called on cast
   // receiver main thread; the Validator provided will also be called on cast
-  // receiver main thread.
+  // receiver main thread. Note that this method does not add or modify
+  // the capability. To do this, SetCapability() should be called, or
+  // Validators can call SetValidatedValue().
   virtual void Register(const std::string& key,
-                        scoped_ptr<base::Value> init_value,
                         Validator* validator) = 0;
-  // Unregisters Validator for |key| and removes capability. |validator|
-  // argument must match |validator| argument that was passed in to Register()
-  // for |key|.
+  // Unregisters Validator for |key|. |validator| argument must match
+  // |validator| argument that was passed in to Register() for |key|. Note that
+  // the capability and its value remain untouched.
   virtual void Unregister(const std::string& key,
                           const Validator* validator) = 0;
+  // Gets the Validator currently registered for |key|. Returns nullptr if
+  // no Validator is registered.
+  virtual Validator* GetValidator(const std::string& key) const = 0;
 
   // Accessors for default capabilities. Note that the capability must be added
-  // through Register() or SetCapability() before accessors are called.
+  // through SetCapability() or SetValidatedValue() (for Validators) before
+  // accessors are called.
   virtual bool BluetoothSupported() const = 0;
   virtual bool DisplaySupported() const = 0;
 
diff --git a/chromecast/base/device_capabilities_impl.cc b/chromecast/base/device_capabilities_impl.cc
index bc4be65..7361390 100644
--- a/chromecast/base/device_capabilities_impl.cc
+++ b/chromecast/base/device_capabilities_impl.cc
@@ -83,33 +83,31 @@
 }
 
 void DeviceCapabilitiesImpl::Register(const std::string& key,
-                                      scoped_ptr<base::Value> init_value,
                                       Validator* validator) {
   DCHECK(thread_checker_.CalledOnValidThread());
   DCHECK(IsValidRegisterKey(key));
-  DCHECK(init_value.get());
   DCHECK(validator);
 
-  AddValidator(key, validator);
-
-  capabilities_->Set(key, init_value.Pass());
-  UpdateStrAndNotifyChanged(key);
+  bool added = validator_map_.insert(std::make_pair(key, validator)).second;
+  // Check that a validator has not already been registered for this key
+  DCHECK(added);
 }
 
 void DeviceCapabilitiesImpl::Unregister(const std::string& key,
                                         const Validator* validator) {
   DCHECK(thread_checker_.CalledOnValidThread());
-  auto validator_it = validator_map_.find(key);
-  DCHECK(validator_it != validator_map_.end());
   // Check that validator being unregistered matches the original for |key|.
   // This prevents managers from accidentally unregistering incorrect
   // validators.
-  DCHECK_EQ(validator, validator_it->second);
-  validator_map_.erase(validator_it);
+  DCHECK_EQ(validator, GetValidator(key));
+  bool erased = validator_map_.erase(key);
+  DCHECK(erased);
+}
 
-  bool removed = capabilities_->Remove(key, nullptr);
-  DCHECK(removed);
-  UpdateStrAndNotifyChanged(key);
+DeviceCapabilities::Validator* DeviceCapabilitiesImpl::GetValidator(
+    const std::string& key) const {
+  auto validator_it = validator_map_.find(key);
+  return validator_it == validator_map_.end() ? nullptr : validator_it->second;
 }
 
 bool DeviceCapabilitiesImpl::BluetoothSupported() const {
@@ -208,14 +206,6 @@
   UpdateStrAndNotifyChanged(path);
 }
 
-void DeviceCapabilitiesImpl::AddValidator(const std::string& key,
-                                          Validator* validator) {
-  DCHECK(validator);
-  bool added = validator_map_.insert(std::make_pair(key, validator)).second;
-  // Check that a validator has not already been registered for this key
-  DCHECK(added);
-}
-
 void DeviceCapabilitiesImpl::UpdateStrAndNotifyChanged(
     const std::string& path) {
   // Update capabilities string here since all updates to capabilities must
diff --git a/chromecast/base/device_capabilities_impl.h b/chromecast/base/device_capabilities_impl.h
index a0701ef..e58774c 100644
--- a/chromecast/base/device_capabilities_impl.h
+++ b/chromecast/base/device_capabilities_impl.h
@@ -17,10 +17,9 @@
   ~DeviceCapabilitiesImpl() override;
 
   // DeviceCapabilities implementation:
-  void Register(const std::string& key,
-                scoped_ptr<base::Value> init_value,
-                Validator* validator) override;
+  void Register(const std::string& key, Validator* validator) override;
   void Unregister(const std::string& key, const Validator* validator) override;
+  Validator* GetValidator(const std::string& key) const override;
   bool BluetoothSupported() const override;
   bool DisplaySupported() const override;
   bool GetCapability(const std::string& path,
@@ -48,8 +47,6 @@
 
   void SetValidatedValueInternal(const std::string& path,
                                  scoped_ptr<base::Value> new_value) override;
-
-  void AddValidator(const std::string& key, Validator* validator);
   void UpdateStrAndNotifyChanged(const std::string& path);
 
   scoped_ptr<base::DictionaryValue> capabilities_;
diff --git a/chromecast/base/device_capabilities_impl_unittest.cc b/chromecast/base/device_capabilities_impl_unittest.cc
index f83f62c..eab7a9e 100644
--- a/chromecast/base/device_capabilities_impl_unittest.cc
+++ b/chromecast/base/device_capabilities_impl_unittest.cc
@@ -26,14 +26,25 @@
 // argument.
 class FakeCapabilityManagerSimple : public DeviceCapabilities::Validator {
  public:
+  // Registers itself as Validator in constructor. If init_value is not null,
+  // the capability gets initialized to that value. Else capability remains
+  // untouched.
   FakeCapabilityManagerSimple(DeviceCapabilities* capabilities,
                               const std::string& key,
+                              scoped_ptr<base::Value> init_value,
                               bool accept_changes)
       : DeviceCapabilities::Validator(capabilities),
         key_(key),
-        accept_changes_(accept_changes) {}
+        accept_changes_(accept_changes) {
+    capabilities->Register(key, this);
+    if (init_value)
+      SetValidatedValue(key, init_value.Pass());
+  }
 
-  ~FakeCapabilityManagerSimple() override {}
+  // Unregisters itself as Validator.
+  ~FakeCapabilityManagerSimple() override {
+    capabilities()->Unregister(key_, this);
+  }
 
   void Validate(const std::string& path,
                 scoped_ptr<base::Value> proposed_value) override {
@@ -151,16 +162,16 @@
   std::string key;
   scoped_ptr<base::Value> init_value;
   GetSampleDefaultCapability(&key, &init_value);
-  FakeCapabilityManagerSimple manager(capabilities(), key, true);
 
-  EXPECT_CALL(*capabilities_observer(), OnCapabilitiesChanged(key)).Times(2);
-  capabilities()->Register(key, init_value->CreateDeepCopy(), &manager);
-  EXPECT_TRUE(JsonStringEquals(capabilities()->GetCapabilitiesString(), key,
-                               *init_value));
-  const base::Value* dict_value;
-  EXPECT_TRUE(capabilities()->GetCapabilities()->Get(key, &dict_value));
-  EXPECT_TRUE(base::Value::Equals(init_value.get(), dict_value));
-  capabilities()->Unregister(key, &manager);
+  EXPECT_CALL(*capabilities_observer(), OnCapabilitiesChanged(key)).Times(0);
+  FakeCapabilityManagerSimple manager(capabilities(), key, nullptr, true);
+
+  EXPECT_EQ(capabilities()->GetValidator(key), &manager);
+  scoped_ptr<const std::string> empty_dict_string(
+      SerializeToJson(base::DictionaryValue()));
+  EXPECT_EQ(capabilities()->GetCapabilitiesString(), *empty_dict_string);
+  const base::Value* value = nullptr;
+  EXPECT_FALSE(capabilities()->GetCapability(key, &value));
 }
 
 // Tests Unregister() of a default capability.
@@ -168,15 +179,19 @@
   std::string key;
   scoped_ptr<base::Value> init_value;
   GetSampleDefaultCapability(&key, &init_value);
-  FakeCapabilityManagerSimple manager(capabilities(), key, true);
 
-  capabilities()->Register(key, init_value->CreateDeepCopy(), &manager);
+  EXPECT_CALL(*capabilities_observer(), OnCapabilitiesChanged(key)).Times(0);
+  FakeCapabilityManagerSimple* manager =
+      new FakeCapabilityManagerSimple(capabilities(), key, nullptr, true);
 
-  capabilities()->Unregister(key, &manager);
+  delete manager;
+
+  EXPECT_EQ(capabilities()->GetValidator(key), nullptr);
   scoped_ptr<const std::string> empty_dict_string(
       SerializeToJson(base::DictionaryValue()));
   EXPECT_EQ(capabilities()->GetCapabilitiesString(), *empty_dict_string);
-  EXPECT_TRUE(capabilities()->GetCapabilities()->empty());
+  const base::Value* value = nullptr;
+  EXPECT_FALSE(capabilities()->GetCapability(key, &value));
 }
 
 // Tests GetCapability() and updating the value through SetCapability().
@@ -184,9 +199,8 @@
   std::string key;
   scoped_ptr<base::Value> init_value;
   GetSampleDefaultCapability(&key, &init_value);
-  FakeCapabilityManagerSimple manager(capabilities(), key, true);
-
-  capabilities()->Register(key, init_value->CreateDeepCopy(), &manager);
+  FakeCapabilityManagerSimple manager(capabilities(), key,
+                                      init_value->CreateDeepCopy(), true);
 
   const base::Value* value = nullptr;
   EXPECT_TRUE(capabilities()->GetCapability(key, &value));
@@ -197,49 +211,32 @@
   value = nullptr;
   EXPECT_TRUE(capabilities()->GetCapability(key, &value));
   EXPECT_TRUE(base::Value::Equals(value, new_value.get()));
-
-  capabilities()->Unregister(key, &manager);
-  value = nullptr;
-  EXPECT_FALSE(capabilities()->GetCapability(key, &value));
-  EXPECT_EQ(value, nullptr);
 }
 
 // Tests BluetoothSupported() and updating this value through SetCapability().
 TEST_F(DeviceCapabilitiesImplTest, BluetoothSupportedAndSetCapability) {
   FakeCapabilityManagerSimple manager(
-      capabilities(), DeviceCapabilities::kKeyBluetoothSupported, true);
-
-  capabilities()->Register(DeviceCapabilities::kKeyBluetoothSupported,
-                           make_scoped_ptr(new base::FundamentalValue(true)),
-                           &manager);
+      capabilities(), DeviceCapabilities::kKeyBluetoothSupported,
+      make_scoped_ptr(new base::FundamentalValue(true)), true);
 
   EXPECT_TRUE(capabilities()->BluetoothSupported());
   capabilities()->SetCapability(
       DeviceCapabilities::kKeyBluetoothSupported,
       make_scoped_ptr(new base::FundamentalValue(false)));
   EXPECT_FALSE(capabilities()->BluetoothSupported());
-
-  capabilities()->Unregister(DeviceCapabilities::kKeyBluetoothSupported,
-                             &manager);
 }
 
 // Tests DisplaySupported() and updating this value through SetCapability().
 TEST_F(DeviceCapabilitiesImplTest, DisplaySupportedAndSetCapability) {
   FakeCapabilityManagerSimple manager(
-      capabilities(), DeviceCapabilities::kKeyDisplaySupported, true);
-
-  capabilities()->Register(DeviceCapabilities::kKeyDisplaySupported,
-                           make_scoped_ptr(new base::FundamentalValue(true)),
-                           &manager);
+      capabilities(), DeviceCapabilities::kKeyDisplaySupported,
+      make_scoped_ptr(new base::FundamentalValue(true)), true);
 
   EXPECT_TRUE(capabilities()->DisplaySupported());
   capabilities()->SetCapability(
       DeviceCapabilities::kKeyDisplaySupported,
       make_scoped_ptr(new base::FundamentalValue(false)));
   EXPECT_FALSE(capabilities()->DisplaySupported());
-
-  capabilities()->Unregister(DeviceCapabilities::kKeyDisplaySupported,
-                             &manager);
 }
 
 // Tests SetCapability() for a default capability when the capability's manager
@@ -248,17 +245,14 @@
   std::string key;
   scoped_ptr<base::Value> init_value;
   GetSampleDefaultCapability(&key, &init_value);
-  FakeCapabilityManagerSimple manager(capabilities(), key, false);
-
-  capabilities()->Register(key, init_value->CreateDeepCopy(), &manager);
+  FakeCapabilityManagerSimple manager(capabilities(), key,
+                                      init_value->CreateDeepCopy(), false);
 
   capabilities()->SetCapability(key, GetSampleDefaultCapabilityNewValue());
 
-  const base::Value* dict_value = nullptr;
-  EXPECT_TRUE(capabilities()->GetCapabilities()->Get(key, &dict_value));
-  EXPECT_TRUE(base::Value::Equals(init_value.get(), dict_value));
-
-  capabilities()->Unregister(key, &manager);
+  const base::Value* value = nullptr;
+  EXPECT_TRUE(capabilities()->GetCapability(key, &value));
+  EXPECT_TRUE(base::Value::Equals(init_value.get(), value));
 }
 
 // Test that SetCapability() updates the capabilities string correctly
@@ -266,9 +260,8 @@
   std::string key;
   scoped_ptr<base::Value> init_value;
   GetSampleDefaultCapability(&key, &init_value);
-  FakeCapabilityManagerSimple manager(capabilities(), key, true);
-
-  capabilities()->Register(key, init_value->CreateDeepCopy(), &manager);
+  FakeCapabilityManagerSimple manager(capabilities(), key,
+                                      init_value->CreateDeepCopy(), true);
 
   EXPECT_TRUE(JsonStringEquals(capabilities()->GetCapabilitiesString(), key,
                                *init_value));
@@ -277,8 +270,6 @@
   capabilities()->SetCapability(key, new_value->CreateDeepCopy());
   EXPECT_TRUE(JsonStringEquals(capabilities()->GetCapabilitiesString(), key,
                                *new_value));
-
-  capabilities()->Unregister(key, &manager);
 }
 
 // Test that SetCapability() notifies Observers when the capability's value
@@ -287,43 +278,43 @@
   std::string key;
   scoped_ptr<base::Value> init_value;
   GetSampleDefaultCapability(&key, &init_value);
-  FakeCapabilityManagerSimple manager(capabilities(), key, true);
 
-  EXPECT_CALL(*capabilities_observer(), OnCapabilitiesChanged(key)).Times(4);
+  EXPECT_CALL(*capabilities_observer(), OnCapabilitiesChanged(key)).Times(3);
 
-  capabilities()->Register(key, init_value->CreateDeepCopy(), &manager);
+  // 1st call (register)
+  FakeCapabilityManagerSimple manager(capabilities(), key,
+                                      init_value->CreateDeepCopy(), true);
 
+  // 2nd call
   capabilities()->SetCapability(key, GetSampleDefaultCapabilityNewValue());
 
   // Observer should not get called when value does not change
   capabilities()->SetCapability(key, GetSampleDefaultCapabilityNewValue());
 
+  // 3rd call
   capabilities()->SetCapability(key, init_value.Pass());
-
-  capabilities()->Unregister(key, &manager);
 }
 
 // Test adding dynamic capabilities
 TEST_F(DeviceCapabilitiesImplTest, SetCapabilityDynamic) {
   std::string key;
   scoped_ptr<base::Value> init_value;
-
-  ASSERT_FALSE(capabilities()->GetCapabilities()->HasKey(key));
-
   GetSampleDynamicCapability(&key, &init_value);
+
+  const base::Value* value = nullptr;
+  ASSERT_FALSE(capabilities()->GetCapability(key, &value));
   capabilities()->SetCapability(key, init_value->CreateDeepCopy());
 
-  const base::Value* dict_value = nullptr;
-  EXPECT_TRUE(capabilities()->GetCapabilities()->Get(key, &dict_value));
-  EXPECT_TRUE(base::Value::Equals(init_value.get(), dict_value));
+  EXPECT_TRUE(capabilities()->GetCapability(key, &value));
+  EXPECT_TRUE(base::Value::Equals(init_value.get(), value));
   EXPECT_TRUE(JsonStringEquals(capabilities()->GetCapabilitiesString(), key,
                                *init_value));
 
   scoped_ptr<base::Value> new_value = GetSampleDynamicCapabilityNewValue();
   capabilities()->SetCapability(key, new_value->CreateDeepCopy());
-  dict_value = nullptr;
-  EXPECT_TRUE(capabilities()->GetCapabilities()->Get(key, &dict_value));
-  EXPECT_TRUE(base::Value::Equals(new_value.get(), dict_value));
+  value = nullptr;
+  EXPECT_TRUE(capabilities()->GetCapability(key, &value));
+  EXPECT_TRUE(base::Value::Equals(new_value.get(), value));
   EXPECT_TRUE(JsonStringEquals(capabilities()->GetCapabilitiesString(), key,
                                *new_value));
 }
@@ -335,94 +326,84 @@
   scoped_ptr<base::Value> init_value =
       DeserializeFromJson(kSampleDictionaryCapability);
   ASSERT_NE(init_value, nullptr);
-  FakeCapabilityManagerSimple manager(capabilities(), key, true);
-
-  capabilities()->Register(key, init_value.Pass(), &manager);
+  FakeCapabilityManagerSimple manager(capabilities(), key, init_value.Pass(),
+                                      true);
 
   capabilities()->SetCapability(
       "dummy_dictionary_key.dummy_field_bool",
       make_scoped_ptr(new base::FundamentalValue(false)));
-  const base::Value* dict_value = nullptr;
-  bool dict_value_bool = true;
-  EXPECT_TRUE(capabilities()->GetCapabilities()->Get(
-      "dummy_dictionary_key.dummy_field_bool", &dict_value));
-  EXPECT_TRUE(dict_value->GetAsBoolean(&dict_value_bool));
-  EXPECT_FALSE(dict_value_bool);
+  const base::Value* value = nullptr;
+  bool value_bool = true;
+  EXPECT_TRUE(capabilities()->GetCapability(
+      "dummy_dictionary_key.dummy_field_bool", &value));
+  EXPECT_TRUE(value->GetAsBoolean(&value_bool));
+  EXPECT_FALSE(value_bool);
 
   capabilities()->SetCapability(
       "dummy_dictionary_key.dummy_field_int",
       make_scoped_ptr(new base::FundamentalValue(100)));
-  dict_value = nullptr;
-  int dict_value_int = 0;
-  EXPECT_TRUE(capabilities()->GetCapabilities()->Get(
-      "dummy_dictionary_key.dummy_field_int", &dict_value));
-  EXPECT_TRUE(dict_value->GetAsInteger(&dict_value_int));
-  EXPECT_EQ(dict_value_int, 100);
-
-  capabilities()->Unregister(key, &manager);
+  value = nullptr;
+  int value_int = 0;
+  EXPECT_TRUE(capabilities()->GetCapability(
+      "dummy_dictionary_key.dummy_field_int", &value));
+  EXPECT_TRUE(value->GetAsInteger(&value_int));
+  EXPECT_EQ(value_int, 100);
 }
 
 // Tests that SetCapability() works with expanded paths when there is a
-// capability of type DictionaryValue and invalid changes are proposed. Ensures
-// that the manager's ValidationCallback is getting called for expanded paths
-// passed to SetCapability().
+// capability of type DictionaryValue and invalid changes are proposed.
 TEST_F(DeviceCapabilitiesImplTest, SetCapabilityDictionaryInvalid) {
   std::string key("dummy_dictionary_key");
   scoped_ptr<base::Value> init_value =
       DeserializeFromJson(kSampleDictionaryCapability);
   ASSERT_NE(init_value, nullptr);
-  FakeCapabilityManagerSimple manager(capabilities(), key, false);
-
-  capabilities()->Register(key, init_value.Pass(), &manager);
+  FakeCapabilityManagerSimple manager(capabilities(), key, init_value.Pass(),
+                                      false);
 
   capabilities()->SetCapability(
       "dummy_dictionary_key.dummy_field_bool",
       make_scoped_ptr(new base::FundamentalValue(false)));
-  const base::Value* dict_value = nullptr;
-  bool dict_value_bool = false;
-  EXPECT_TRUE(capabilities()->GetCapabilities()->Get(
-      "dummy_dictionary_key.dummy_field_bool", &dict_value));
-  EXPECT_TRUE(dict_value->GetAsBoolean(&dict_value_bool));
-  EXPECT_TRUE(dict_value_bool);
+  const base::Value* value = nullptr;
+  bool value_bool = false;
+  EXPECT_TRUE(capabilities()->GetCapability(
+      "dummy_dictionary_key.dummy_field_bool", &value));
+  EXPECT_TRUE(value->GetAsBoolean(&value_bool));
+  EXPECT_TRUE(value_bool);
 
   capabilities()->SetCapability(
       "dummy_dictionary_key.dummy_field_int",
       make_scoped_ptr(new base::FundamentalValue(100)));
-  dict_value = nullptr;
-  int dict_value_int = 0;
-  EXPECT_TRUE(capabilities()->GetCapabilities()->Get(
-      "dummy_dictionary_key.dummy_field_int", &dict_value));
-  EXPECT_TRUE(dict_value->GetAsInteger(&dict_value_int));
-  EXPECT_EQ(dict_value_int, 99);
-
-  capabilities()->Unregister(key, &manager);
+  value = nullptr;
+  int value_int = 0;
+  EXPECT_TRUE(capabilities()->GetCapability(
+      "dummy_dictionary_key.dummy_field_int", &value));
+  EXPECT_TRUE(value->GetAsInteger(&value_int));
+  EXPECT_EQ(value_int, 99);
 }
 
 // Test  MergeDictionary.
 TEST_F(DeviceCapabilitiesImplTest, MergeDictionary) {
-  scoped_ptr<base::Value> value =
+  scoped_ptr<base::Value> deserialized_value =
       DeserializeFromJson(kSampleDictionaryCapability);
-  ASSERT_NE(value, nullptr);
+  ASSERT_NE(deserialized_value, nullptr);
   base::DictionaryValue* dict_value = nullptr;
-  ASSERT_TRUE(value->GetAsDictionary(&dict_value));
+  ASSERT_TRUE(deserialized_value->GetAsDictionary(&dict_value));
   ASSERT_NE(dict_value, nullptr);
 
   capabilities()->MergeDictionary(*dict_value);
 
   // First make sure that capabilities get created if they do not exist
-  const base::Value* internal_value = nullptr;
-  bool dict_value_bool = false;
-  EXPECT_TRUE(capabilities()->GetCapabilities()->Get("dummy_field_bool",
-                                                     &internal_value));
-  EXPECT_TRUE(internal_value->GetAsBoolean(&dict_value_bool));
-  EXPECT_TRUE(dict_value_bool);
+  const base::Value* value = nullptr;
+  bool value_bool = false;
+  EXPECT_TRUE(capabilities()->GetCapability("dummy_field_bool", &value));
+  EXPECT_TRUE(value->GetAsBoolean(&value_bool));
+  EXPECT_TRUE(value_bool);
 
-  internal_value = nullptr;
-  int dict_value_int = 0;
-  EXPECT_TRUE(capabilities()->GetCapabilities()->Get("dummy_field_int",
-                                                     &internal_value));
-  EXPECT_TRUE(internal_value->GetAsInteger(&dict_value_int));
-  EXPECT_EQ(dict_value_int, 99);
+  value = nullptr;
+  int value_int = 0;
+  EXPECT_TRUE(capabilities()->GetCapability("dummy_field_int", &value));
+  EXPECT_TRUE(value->GetAsInteger(&value_int));
+  EXPECT_EQ(value_int, 99);
 
   // Now just update one of the fields. Make sure the updated value is changed
   // in DeviceCapabilities and the other field remains untouched.
@@ -431,18 +412,16 @@
 
   capabilities()->MergeDictionary(*dict_value);
 
-  internal_value = nullptr;
-  dict_value_bool = false;
-  EXPECT_TRUE(capabilities()->GetCapabilities()->Get("dummy_field_bool",
-                                                     &internal_value));
-  EXPECT_TRUE(internal_value->GetAsBoolean(&dict_value_bool));
-  EXPECT_TRUE(dict_value_bool);
+  value = nullptr;
+  value_bool = false;
+  EXPECT_TRUE(capabilities()->GetCapability("dummy_field_bool", &value));
+  EXPECT_TRUE(value->GetAsBoolean(&value_bool));
+  EXPECT_TRUE(value_bool);
 
-  internal_value = nullptr;
-  EXPECT_TRUE(capabilities()->GetCapabilities()->Get("dummy_field_int",
-                                                     &internal_value));
-  EXPECT_TRUE(internal_value->GetAsInteger(&dict_value_int));
-  EXPECT_EQ(dict_value_int, 100);
+  value = nullptr;
+  EXPECT_TRUE(capabilities()->GetCapability("dummy_field_int", &value));
+  EXPECT_TRUE(value->GetAsInteger(&value_int));
+  EXPECT_EQ(value_int, 100);
 }
 
 }  // namespace chromecast
diff --git a/chromeos/CHROMEOS_LKGM b/chromeos/CHROMEOS_LKGM
index 19b7306..1334527b 100644
--- a/chromeos/CHROMEOS_LKGM
+++ b/chromeos/CHROMEOS_LKGM
@@ -1 +1 @@
-7534.0.0
\ No newline at end of file
+7544.0.0
\ No newline at end of file
diff --git a/components/autofill/content/browser/risk/fingerprint_browsertest.cc b/components/autofill/content/browser/risk/fingerprint_browsertest.cc
index 1c1ddd73..b7ee261e 100644
--- a/components/autofill/content/browser/risk/fingerprint_browsertest.cc
+++ b/components/autofill/content/browser/risk/fingerprint_browsertest.cc
@@ -163,7 +163,7 @@
     EXPECT_EQ(kAccuracy, location.accuracy());
     EXPECT_EQ(kGeolocationTime, location.time_in_ms());
 
-    message_loop_.Quit();
+    message_loop_.QuitWhenIdle();
   }
 
  protected:
diff --git a/components/autofill/core/browser/personal_data_manager_unittest.cc b/components/autofill/core/browser/personal_data_manager_unittest.cc
index f0a51b5..08809ea 100644
--- a/components/autofill/core/browser/personal_data_manager_unittest.cc
+++ b/components/autofill/core/browser/personal_data_manager_unittest.cc
@@ -46,7 +46,9 @@
 
 enum UserMode { USER_MODE_NORMAL, USER_MODE_INCOGNITO };
 
-ACTION(QuitMainMessageLoop) { base::MessageLoop::current()->Quit(); }
+ACTION(QuitMainMessageLoop) {
+  base::MessageLoop::current()->QuitWhenIdle();
+}
 
 class PersonalDataLoadedObserverMock : public PersonalDataManagerObserver {
  public:
diff --git a/components/autofill/core/browser/webdata/web_data_service_unittest.cc b/components/autofill/core/browser/webdata/web_data_service_unittest.cc
index d3cc875..5f3d80b 100644
--- a/components/autofill/core/browser/webdata/web_data_service_unittest.cc
+++ b/components/autofill/core/browser/webdata/web_data_service_unittest.cc
@@ -59,7 +59,7 @@
         static_cast<const WDResult<T>*>(result);
     result_ = wrapped_result->GetValue();
 
-    base::MessageLoop::current()->Quit();
+    base::MessageLoop::current()->QuitWhenIdle();
   }
 
   WebDataServiceBase::Handle handle() { return handle_; }
@@ -120,7 +120,7 @@
     WaitForDatabaseThread();
 
     base::ThreadTaskRunnerHandle::Get()->PostTask(
-        FROM_HERE, base::MessageLoop::QuitClosure());
+        FROM_HERE, base::MessageLoop::QuitWhenIdleClosure());
     base::MessageLoop::current()->Run();
     db_thread_.Stop();
   }
diff --git a/components/autofill/core/common/autofill_switches.cc b/components/autofill/core/common/autofill_switches.cc
index 0bd07e07..79e8db4 100644
--- a/components/autofill/core/common/autofill_switches.cc
+++ b/components/autofill/core/common/autofill_switches.cc
@@ -64,10 +64,6 @@
 const char kEnableSuggestionsWithSubstringMatch[] =
     "enable-suggestions-with-substring-match";
 
-// Enables syncing usage counts and last use dates of Wallet addresses and
-// cards.
-const char kEnableWalletMetadataSync[]      = "enable-wallet-metadata-sync";
-
 // Ignores autocomplete="off" for Autofill data (profiles + credit cards).
 const char kIgnoreAutocompleteOffForAutofill[] =
     "ignore-autocomplete-off-autofill";
diff --git a/components/autofill/core/common/autofill_switches.h b/components/autofill/core/common/autofill_switches.h
index fb48e39..b4e7a35 100644
--- a/components/autofill/core/common/autofill_switches.h
+++ b/components/autofill/core/common/autofill_switches.h
@@ -26,7 +26,6 @@
 extern const char kEnablePasswordGeneration[];
 extern const char kEnableSingleClickAutofill[];
 extern const char kEnableSuggestionsWithSubstringMatch[];
-extern const char kEnableWalletMetadataSync[];
 extern const char kIgnoreAutocompleteOffForAutofill[];
 extern const char kLocalHeuristicsOnlyForPasswordGeneration[];
 extern const char kShowAutofillTypePredictions[];
diff --git a/components/components_tests.gyp b/components/components_tests.gyp
index 21bf32a..24a280d 100644
--- a/components/components_tests.gyp
+++ b/components/components_tests.gyp
@@ -592,6 +592,7 @@
       'scheduler/renderer/task_cost_estimator_unittest.cc',
       'scheduler/renderer/user_model_unittest.cc',
       'scheduler/renderer/webthread_impl_for_renderer_scheduler_unittest.cc',
+      'scheduler/renderer/web_frame_host_scheduler_impl_unittest.cc',
     ],
     'search_unittest_sources': [
       'search/search_android_unittest.cc',
@@ -624,6 +625,7 @@
       'signin/core/browser/gaia_cookie_manager_service_unittest.cc',
       'signin/core/browser/refresh_token_annotation_request_unittest.cc',
       'signin/core/browser/signin_error_controller_unittest.cc',
+      'signin/core/browser/signin_status_metrics_provider_unittest.cc',
       'signin/core/browser/webdata/token_service_table_unittest.cc',
       'signin/ios/browser/account_consistency_service_unittest.mm',
       'signin/ios/browser/profile_oauth2_token_service_ios_delegate_unittest.mm',
@@ -668,6 +670,7 @@
       'sync_sessions/revisit/current_tab_matcher_unittest.cc',
       'sync_sessions/revisit/offset_tab_matcher_unittest.cc',
       'sync_sessions/revisit/sessions_page_revisit_observer_unittest.cc',
+      'sync_sessions/revisit/typed_url_page_revisit_task_unittest.cc',
     ],
     'syncable_prefs_unittest_sources': [
       'syncable_prefs/pref_model_associator_unittest.cc',
@@ -1317,6 +1320,7 @@
             '<@(ownership_unittest_sources)',
           ],
           'sources!': [
+            'signin/core/browser/signin_status_metrics_provider_unittest.cc',
             'storage_monitor/storage_monitor_linux_unittest.cc',
           ],
           'dependencies': [
@@ -1539,6 +1543,27 @@
           'includes': [ '../build/host_jar.gypi' ],
          },
       ],
+      'conditions': [
+        ['test_isolation_mode != "noop"',
+          {
+            'targets': [
+              {
+                'target_name': 'components_unittests_apk_run',
+                'type': 'none',
+                'dependencies': [
+                  'components_unittests_apk',
+                ],
+                'includes': [
+                  '../build/isolate.gypi',
+                ],
+                'sources': [
+                  'components_unittests_apk.isolate',
+                ],
+              },
+            ],
+          },
+        ],
+      ],
     }],
     ['OS != "ios"', {
       'targets': [
diff --git a/components/components_unittests_apk.isolate b/components/components_unittests_apk.isolate
new file mode 100644
index 0000000..14a3401
--- /dev/null
+++ b/components/components_unittests_apk.isolate
@@ -0,0 +1,25 @@
+# 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.
+{
+  'includes': [
+    '../build/android/android.isolate',
+    'components_unittests.isolate',
+  ],
+  'variables': {
+    'command': [
+     '<(PRODUCT_DIR)/bin/run_components_unittests',
+    ],
+    'files': [
+      '../base/base.isolate',
+      '../build/config/',
+      '../third_party/angle/angle.isolate',
+      '../third_party/icu/icu.isolate',
+      '../third_party/instrumented_libraries/instrumented_libraries.isolate',
+      '../ui/gl/gl.isolate',
+      '<(PRODUCT_DIR)/bin/run_components_unittests',
+      '<(PRODUCT_DIR)/components_unittests_apk/',
+      'components_unittests.isolate',
+    ]
+  },
+}
diff --git a/components/cronet/android/java/src/org/chromium/net/CronetEngine.java b/components/cronet/android/java/src/org/chromium/net/CronetEngine.java
index 31334aa..ad3664d 100644
--- a/components/cronet/android/java/src/org/chromium/net/CronetEngine.java
+++ b/components/cronet/android/java/src/org/chromium/net/CronetEngine.java
@@ -75,6 +75,11 @@
         /**
          * Sets directory for HTTP Cache and Cookie Storage. The directory must
          * exist.
+         * <p>
+         * <b>NOTE:</b> Do not use the same storage directory with more than one
+         * {@code CronetEngine} at a time. Access to the storage directory does
+         * not support concurrent access by multiple {@code CronetEngine}s.
+         *
          * @param value path to existing directory.
          * @return the builder to facilitate chaining.
          */
diff --git a/components/dom_distiller/core/dom_distiller_store.cc b/components/dom_distiller/core/dom_distiller_store.cc
index 6d87e311..6fdb295 100644
--- a/components/dom_distiller/core/dom_distiller_store.cc
+++ b/components/dom_distiller/core/dom_distiller_store.cc
@@ -25,6 +25,14 @@
 using syncer::SyncError;
 using syncer::SyncMergeResult;
 
+namespace {
+// Statistics are logged to UMA with this string as part of histogram name. They
+// can all be found under LevelDB.*.DomDistillerStore. Changing this needs to
+// synchronize with histograms.xml, AND will also become incompatible with older
+// browsers still reporting the previous values.
+const char kDatabaseUMAClientName[] = "DomDistillerStore";
+}
+
 namespace dom_distiller {
 
 DomDistillerStore::DomDistillerStore(
@@ -34,8 +42,9 @@
       database_loaded_(false),
       attachment_store_(syncer::AttachmentStore::CreateInMemoryStore()),
       weak_ptr_factory_(this) {
-  database_->Init(database_dir, base::Bind(&DomDistillerStore::OnDatabaseInit,
-                                           weak_ptr_factory_.GetWeakPtr()));
+  database_->Init(kDatabaseUMAClientName, database_dir,
+                  base::Bind(&DomDistillerStore::OnDatabaseInit,
+                             weak_ptr_factory_.GetWeakPtr()));
 }
 
 DomDistillerStore::DomDistillerStore(
@@ -47,8 +56,9 @@
       attachment_store_(syncer::AttachmentStore::CreateInMemoryStore()),
       model_(initial_data),
       weak_ptr_factory_(this) {
-  database_->Init(database_dir, base::Bind(&DomDistillerStore::OnDatabaseInit,
-                                           weak_ptr_factory_.GetWeakPtr()));
+  database_->Init(kDatabaseUMAClientName, database_dir,
+                  base::Bind(&DomDistillerStore::OnDatabaseInit,
+                             weak_ptr_factory_.GetWeakPtr()));
 }
 
 DomDistillerStore::~DomDistillerStore() {}
diff --git a/components/favicon/core/favicon_handler.cc b/components/favicon/core/favicon_handler.cc
index aea23c5..d8ec1ea 100644
--- a/components/favicon/core/favicon_handler.cc
+++ b/components/favicon/core/favicon_handler.cc
@@ -384,17 +384,9 @@
 void FaviconHandler::ProcessCurrentUrl() {
   DCHECK(!image_urls_.empty());
 
-  if (current_candidate()->icon_type == favicon_base::FAVICON &&
-      !download_largest_icon_) {
-    if (!favicon_expired_or_incomplete_ &&
-        driver_->GetActiveFaviconValidity() &&
-        DoUrlAndIconMatch(*current_candidate(),
-                          driver_->GetActiveFaviconURL(),
-                          favicon_base::FAVICON))
-      return;
-  } else if (!favicon_expired_or_incomplete_ && got_favicon_from_history_ &&
-             HasValidResult(history_results_) &&
-             DoUrlsAndIconsMatch(*current_candidate(), history_results_)) {
+  if (!favicon_expired_or_incomplete_ && got_favicon_from_history_ &&
+      HasValidResult(history_results_) &&
+      DoUrlsAndIconsMatch(*current_candidate(), history_results_)) {
     return;
   }
 
diff --git a/components/gcm_driver/crypto/gcm_key_store.cc b/components/gcm_driver/crypto/gcm_key_store.cc
index a9776fb4c..d853b781 100644
--- a/components/gcm_driver/crypto/gcm_key_store.cc
+++ b/components/gcm_driver/crypto/gcm_key_store.cc
@@ -13,6 +13,12 @@
 
 namespace gcm {
 
+// Statistics are logged to UMA with this string as part of histogram name. They
+// can all be found under LevelDB.*.GCMKeyStore. Changing this needs to
+// synchronize with histograms.xml, AND will also become incompatible with older
+// browsers still reporting the previous values.
+const char kDatabaseUMAClientName[] = "GCMKeyStore";
+
 enum class GCMKeyStore::State {
    UNINITIALIZED,
    INITIALIZING,
@@ -174,8 +180,9 @@
   database_.reset(new leveldb_proto::ProtoDatabaseImpl<EncryptionData>(
       blocking_task_runner_));
 
-  database_->Init(key_store_path_, base::Bind(&GCMKeyStore::DidInitialize,
-                                              weak_factory_.GetWeakPtr()));
+  database_->Init(
+      kDatabaseUMAClientName, key_store_path_,
+      base::Bind(&GCMKeyStore::DidInitialize, weak_factory_.GetWeakPtr()));
 }
 
 void GCMKeyStore::DidInitialize(bool success) {
diff --git a/components/gcm_driver/gcm_client.h b/components/gcm_driver/gcm_client.h
index 0aa9a1a..5f7f293 100644
--- a/components/gcm_driver/gcm_client.h
+++ b/components/gcm_driver/gcm_client.h
@@ -217,9 +217,10 @@
   // |chrome_build_info|: chrome info, i.e., version, channel and etc.
   // |store_path|: path to the GCM store.
   // |blocking_task_runner|: for running blocking file tasks.
-  // |url_request_context_getter|: for url requests.
+  // |url_request_context_getter|: for url requests. The GCMClient must be
+  //     deleted before the Getter's underlying URLRequestContext.
   // |delegate|: the delegate whose methods will be called asynchronously in
-  //             response to events and messages.
+  //     response to events and messages.
   virtual void Initialize(
       const ChromeBuildInfo& chrome_build_info,
       const base::FilePath& store_path,
diff --git a/components/gcm_driver/gcm_client_impl.cc b/components/gcm_driver/gcm_client_impl.cc
index 1a95809..b0f298f8 100644
--- a/components/gcm_driver/gcm_client_impl.cc
+++ b/components/gcm_driver/gcm_client_impl.cc
@@ -255,16 +255,15 @@
 scoped_ptr<ConnectionFactory> GCMInternalsBuilder::BuildConnectionFactory(
       const std::vector<GURL>& endpoints,
       const net::BackoffEntry::Policy& backoff_policy,
-      const scoped_refptr<net::HttpNetworkSession>& gcm_network_session,
-      const scoped_refptr<net::HttpNetworkSession>& http_network_session,
-      net::NetLog* net_log,
+      net::HttpNetworkSession* gcm_network_session,
+      net::HttpNetworkSession* http_network_session,
       GCMStatsRecorder* recorder) {
   return make_scoped_ptr<ConnectionFactory>(
       new ConnectionFactoryImpl(endpoints,
                                 backoff_policy,
                                 gcm_network_session,
                                 http_network_session,
-                                net_log,
+                                nullptr,
                                 recorder));
 }
 
@@ -326,7 +325,7 @@
       url_request_context_getter_->GetURLRequestContext()->
           GetNetworkSessionParams();
   DCHECK(network_session_params);
-  network_session_ = new net::HttpNetworkSession(*network_session_params);
+  network_session_.reset(new net::HttpNetworkSession(*network_session_params));
 
   chrome_build_info_ = chrome_build_info;
 
@@ -483,11 +482,10 @@
   connection_factory_ = internals_builder_->BuildConnectionFactory(
       endpoints,
       GetGCMBackoffPolicy(),
-      network_session_,
+      network_session_.get(),
       url_request_context_getter_->GetURLRequestContext()
           ->http_transaction_factory()
           ->GetSession(),
-      net_log_.net_log(),
       &recorder_);
   connection_factory_->SetConnectionListener(this);
   mcs_client_ = internals_builder_->BuildMCSClient(
diff --git a/components/gcm_driver/gcm_client_impl.h b/components/gcm_driver/gcm_client_impl.h
index 2542c68..176ee78 100644
--- a/components/gcm_driver/gcm_client_impl.h
+++ b/components/gcm_driver/gcm_client_impl.h
@@ -26,7 +26,6 @@
 #include "google_apis/gcm/engine/unregistration_request.h"
 #include "google_apis/gcm/protocol/android_checkin.pb.h"
 #include "google_apis/gcm/protocol/checkin.pb.h"
-#include "net/log/net_log.h"
 #include "net/url_request/url_request_context_getter.h"
 
 class GURL;
@@ -67,9 +66,8 @@
   virtual scoped_ptr<ConnectionFactory> BuildConnectionFactory(
       const std::vector<GURL>& endpoints,
       const net::BackoffEntry::Policy& backoff_policy,
-      const scoped_refptr<net::HttpNetworkSession>& gcm_network_session,
-      const scoped_refptr<net::HttpNetworkSession>& http_network_session,
-      net::NetLog* net_log,
+      net::HttpNetworkSession* gcm_network_session,
+      net::HttpNetworkSession* http_network_session,
       GCMStatsRecorder* recorder);
 };
 
@@ -336,12 +334,12 @@
   // resetting and loading from the store again and again.
   bool gcm_store_reset_;
 
-  scoped_refptr<net::HttpNetworkSession> network_session_;
-  net::BoundNetLog net_log_;
+  scoped_ptr<net::HttpNetworkSession> network_session_;
   scoped_ptr<ConnectionFactory> connection_factory_;
   scoped_refptr<net::URLRequestContextGetter> url_request_context_getter_;
 
   // Controls receiving and sending of packets and reliable message queueing.
+  // Must be destroyed before |network_session_|.
   scoped_ptr<MCSClient> mcs_client_;
 
   scoped_ptr<CheckinRequest> checkin_request_;
diff --git a/components/gcm_driver/gcm_client_impl_unittest.cc b/components/gcm_driver/gcm_client_impl_unittest.cc
index 27fe726c..3ba8c436 100644
--- a/components/gcm_driver/gcm_client_impl_unittest.cc
+++ b/components/gcm_driver/gcm_client_impl_unittest.cc
@@ -200,9 +200,8 @@
   scoped_ptr<ConnectionFactory> BuildConnectionFactory(
       const std::vector<GURL>& endpoints,
       const net::BackoffEntry::Policy& backoff_policy,
-      const scoped_refptr<net::HttpNetworkSession>& gcm_network_session,
-      const scoped_refptr<net::HttpNetworkSession>& http_network_session,
-      net::NetLog* net_log,
+      net::HttpNetworkSession* gcm_network_session,
+      net::HttpNetworkSession* http_network_session,
       GCMStatsRecorder* recorder) override;
 
  private:
@@ -234,9 +233,8 @@
 scoped_ptr<ConnectionFactory> FakeGCMInternalsBuilder::BuildConnectionFactory(
     const std::vector<GURL>& endpoints,
     const net::BackoffEntry::Policy& backoff_policy,
-    const scoped_refptr<net::HttpNetworkSession>& gcm_network_session,
-    const scoped_refptr<net::HttpNetworkSession>& http_network_session,
-    net::NetLog* net_log,
+    net::HttpNetworkSession* gcm_network_session,
+    net::HttpNetworkSession* http_network_session,
     GCMStatsRecorder* recorder) {
   return make_scoped_ptr<ConnectionFactory>(new FakeConnectionFactory());
 }
diff --git a/components/history/core/browser/history_querying_unittest.cc b/components/history/core/browser/history_querying_unittest.cc
index 535688c0..98dd62f 100644
--- a/components/history/core/browser/history_querying_unittest.cc
+++ b/components/history/core/browser/history_querying_unittest.cc
@@ -180,7 +180,8 @@
 
   void TearDown() override {
     if (history_) {
-      history_->SetOnBackendDestroyTask(base::MessageLoop::QuitClosure());
+      history_->SetOnBackendDestroyTask(
+          base::MessageLoop::QuitWhenIdleClosure());
       history_->Cleanup();
       history_.reset();
       base::MessageLoop::current()->Run();  // Wait for the other thread.
@@ -189,7 +190,8 @@
 
   void QueryHistoryComplete(QueryResults* results) {
     results->Swap(&last_query_results_);
-    base::MessageLoop::current()->Quit();  // Will return out to QueryHistory.
+    base::MessageLoop::current()
+        ->QuitWhenIdle();  // Will return out to QueryHistory.
   }
 
   base::ScopedTempDir temp_dir_;
diff --git a/components/history/core/browser/history_service_unittest.cc b/components/history/core/browser/history_service_unittest.cc
index d333526..84390a9 100644
--- a/components/history/core/browser/history_service_unittest.cc
+++ b/components/history/core/browser/history_service_unittest.cc
@@ -53,7 +53,7 @@
 
   void OnMostVisitedURLsAvailable(const MostVisitedURLList* url_list) {
     most_visited_urls_ = *url_list;
-    base::MessageLoop::current()->Quit();
+    base::MessageLoop::current()->QuitWhenIdle();
   }
 
  protected:
@@ -79,7 +79,7 @@
     // Make sure we don't have any event pending that could disrupt the next
     // test.
     base::ThreadTaskRunnerHandle::Get()->PostTask(
-        FROM_HERE, base::MessageLoop::QuitClosure());
+        FROM_HERE, base::MessageLoop::QuitWhenIdleClosure());
     base::MessageLoop::current()->Run();
   }
 
@@ -87,7 +87,8 @@
     DCHECK(history_service_);
 
     history_service_->ClearCachedDataForContextID(0);
-    history_service_->SetOnBackendDestroyTask(base::MessageLoop::QuitClosure());
+    history_service_->SetOnBackendDestroyTask(
+        base::MessageLoop::QuitWhenIdleClosure());
     history_service_->Cleanup();
     history_service_.reset();
 
@@ -123,7 +124,7 @@
       query_url_row_ = URLRow();
       query_url_visits_.clear();
     }
-    base::MessageLoop::current()->Quit();
+    base::MessageLoop::current()->QuitWhenIdle();
   }
 
   // Fills in saved_redirects_ with the redirect information for the given URL,
@@ -144,7 +145,7 @@
       saved_redirects_.insert(
           saved_redirects_.end(), redirects->begin(), redirects->end());
     }
-    base::MessageLoop::current()->Quit();
+    base::MessageLoop::current()->QuitWhenIdle();
   }
 
   base::ScopedTempDir temp_dir_;
@@ -567,7 +568,7 @@
 
   void DoneRunOnMainThread() override {
     *done_invoked_ = true;
-    base::MessageLoop::current()->Quit();
+    base::MessageLoop::current()->QuitWhenIdle();
   }
 
   int* invoke_count_;
diff --git a/components/history/core/browser/top_sites_impl_unittest.cc b/components/history/core/browser/top_sites_impl_unittest.cc
index f6dc42e2..de40df0 100644
--- a/components/history/core/browser/top_sites_impl_unittest.cc
+++ b/components/history/core/browser/top_sites_impl_unittest.cc
@@ -53,7 +53,9 @@
     return true;
   }
 
-  void DoneRunOnMainThread() override { base::MessageLoop::current()->Quit(); }
+  void DoneRunOnMainThread() override {
+    base::MessageLoop::current()->QuitWhenIdle();
+  }
 
  private:
   ~WaitForHistoryTask() override {}
@@ -104,7 +106,7 @@
     urls_ = data;
     number_of_callbacks_++;
     if (waiting_) {
-      base::MessageLoop::current()->Quit();
+      base::MessageLoop::current()->QuitWhenIdle();
       waiting_ = false;
     }
   }
@@ -211,7 +213,7 @@
 
   // Quit the current message loop when invoked. Useful when running a nested
   // message loop.
-  void QuitCallback() { base::MessageLoop::current()->Quit(); }
+  void QuitCallback() { base::MessageLoop::current()->QuitWhenIdle(); }
 
   // Adds a page to history.
   void AddPageToHistory(const GURL& url) {
diff --git a/components/history/core/test/history_backend_db_base_test.cc b/components/history/core/test/history_backend_db_base_test.cc
index f384a0e..4c1dbcb 100644
--- a/components/history/core/test/history_backend_db_base_test.cc
+++ b/components/history/core/test/history_backend_db_base_test.cc
@@ -78,7 +78,7 @@
   // Make sure we don't have any event pending that could disrupt the next
   // test.
   base::ThreadTaskRunnerHandle::Get()->PostTask(
-      FROM_HERE, base::MessageLoop::QuitClosure());
+      FROM_HERE, base::MessageLoop::QuitWhenIdleClosure());
   base::MessageLoop::current()->Run();
 }
 
diff --git a/components/html_viewer/ax_provider_impl_unittest.cc b/components/html_viewer/ax_provider_impl_unittest.cc
index 5b22ef2..ebad0b44 100644
--- a/components/html_viewer/ax_provider_impl_unittest.cc
+++ b/components/html_viewer/ax_provider_impl_unittest.cc
@@ -35,7 +35,9 @@
 class TestWebFrameClient : public WebFrameClient {
  public:
   ~TestWebFrameClient() override {}
-  void didStopLoading() override { base::MessageLoop::current()->Quit(); }
+  void didStopLoading() override {
+    base::MessageLoop::current()->QuitWhenIdle();
+  }
 };
 
 class TestWebViewClient : public WebViewClient {
diff --git a/components/html_viewer/web_url_loader_impl.cc b/components/html_viewer/web_url_loader_impl.cc
index 2de84cd..2dfbcce 100644
--- a/components/html_viewer/web_url_loader_impl.cc
+++ b/components/html_viewer/web_url_loader_impl.cc
@@ -349,9 +349,4 @@
   ReadMore();
 }
 
-void WebURLLoaderImpl::setLoadingTaskRunner(
-    blink::WebTaskRunner* web_task_runner) {
-  // TODO(alexclarke): Consider hooking this up.
-}
-
 }  // namespace html_viewer
diff --git a/components/html_viewer/web_url_loader_impl.h b/components/html_viewer/web_url_loader_impl.h
index f829331..c8a788f 100644
--- a/components/html_viewer/web_url_loader_impl.h
+++ b/components/html_viewer/web_url_loader_impl.h
@@ -47,7 +47,6 @@
                                   blink::WebURLLoaderClient* client);
   virtual void cancel();
   virtual void setDefersLoading(bool defers_loading);
-  virtual void setLoadingTaskRunner(blink::WebTaskRunner* web_task_runner);
 
   void OnReceivedResponse(const blink::WebURLRequest& request,
                           mojo::URLResponsePtr response);
diff --git a/components/leveldb_proto/leveldb_database.cc b/components/leveldb_proto/leveldb_database.cc
index 80df115..cf85e6d1 100644
--- a/components/leveldb_proto/leveldb_database.cc
+++ b/components/leveldb_proto/leveldb_database.cc
@@ -10,6 +10,7 @@
 #include "base/files/file_path.h"
 #include "base/files/file_util.h"
 #include "base/memory/scoped_ptr.h"
+#include "base/metrics/histogram.h"
 #include "base/strings/string_split.h"
 #include "base/threading/thread_checker.h"
 #include "third_party/leveldatabase/env_chromium.h"
@@ -24,7 +25,14 @@
 
 namespace leveldb_proto {
 
-LevelDB::LevelDB() {}
+LevelDB::LevelDB(const char* client_name) : open_histogram_(nullptr) {
+  // Used in lieu of UMA_HISTOGRAM_ENUMERATION because the histogram name is
+  // not a constant.
+  open_histogram_ = base::LinearHistogram::FactoryGet(
+      std::string("LevelDB.Open.") + client_name, 1,
+      leveldb_env::LEVELDB_STATUS_MAX, leveldb_env::LEVELDB_STATUS_MAX + 1,
+      base::Histogram::kUmaTargetedHistogramFlag);
+}
 
 LevelDB::~LevelDB() {
   DFAKE_SCOPED_LOCK(thread_checker_);
@@ -38,6 +46,8 @@
 
   leveldb::DB* db = NULL;
   leveldb::Status status = leveldb::DB::Open(options, path, &db);
+  if (open_histogram_)
+    open_histogram_->Add(leveldb_env::GetLevelDBStatusUMAValue(status));
   if (status.IsCorruption()) {
     base::DeleteFile(database_dir, true);
     status = leveldb::DB::Open(options, path, &db);
diff --git a/components/leveldb_proto/leveldb_database.h b/components/leveldb_proto/leveldb_database.h
index 67d0707..070b4b7 100644
--- a/components/leveldb_proto/leveldb_database.h
+++ b/components/leveldb_proto/leveldb_database.h
@@ -13,6 +13,10 @@
 #include "base/strings/string_split.h"
 #include "base/threading/thread_collision_warner.h"
 
+namespace base {
+class HistogramBase;
+}  // namespace base
+
 namespace leveldb {
 class DB;
 class Env;
@@ -26,7 +30,11 @@
 // same thread (not necessarily the same as the constructor).
 class LevelDB {
  public:
-  LevelDB();
+  // Constructor. Does *not* open a leveldb - only initialize this class.
+  // |client_name| is the name of the "client" that owns this instance. Used
+  // for UMA statics as so: LevelDB.<value>.<client name>. It is best to not
+  // change once shipped.
+  explicit LevelDB(const char* client_name);
   virtual ~LevelDB();
 
   virtual bool InitWithOptions(const base::FilePath& database_dir,
@@ -43,6 +51,9 @@
   // therefore has to be destructed first.
   scoped_ptr<leveldb::Env> env_;
   scoped_ptr<leveldb::DB> db_;
+  base::HistogramBase* open_histogram_;
+
+  DISALLOW_COPY_AND_ASSIGN(LevelDB);
 };
 
 }  // namespace leveldb_proto
diff --git a/components/leveldb_proto/proto_database.h b/components/leveldb_proto/proto_database.h
index 119ff5d..319d0b8e9 100644
--- a/components/leveldb_proto/proto_database.h
+++ b/components/leveldb_proto/proto_database.h
@@ -35,7 +35,8 @@
 
   // Asynchronously initializes the object. |callback| will be invoked on the
   // calling thread when complete.
-  virtual void Init(const base::FilePath& database_dir,
+  virtual void Init(const char* client_name,
+                    const base::FilePath& database_dir,
                     const InitCallback& callback) = 0;
 
   // Asynchronously saves |entries_to_save| and deletes entries from
diff --git a/components/leveldb_proto/proto_database_impl.h b/components/leveldb_proto/proto_database_impl.h
index 0875201..71ee23b 100644
--- a/components/leveldb_proto/proto_database_impl.h
+++ b/components/leveldb_proto/proto_database_impl.h
@@ -40,7 +40,8 @@
   // ProtoDatabase implementation.
   // TODO(cjhopman): Perhaps Init() shouldn't be exposed to users and not just
   //     part of the constructor
-  void Init(const base::FilePath& database_dir,
+  void Init(const char* client_name,
+            const base::FilePath& database_dir,
             const typename ProtoDatabase<T>::InitCallback& callback) override;
   void UpdateEntries(
       scoped_ptr<typename ProtoDatabase<T>::KeyEntryVector> entries_to_save,
@@ -153,10 +154,12 @@
 
 template <typename T>
 void ProtoDatabaseImpl<T>::Init(
+    const char* client_name,
     const base::FilePath& database_dir,
     const typename ProtoDatabase<T>::InitCallback& callback) {
   DCHECK(thread_checker_.CalledOnValidThread());
-  InitWithDatabase(make_scoped_ptr(new LevelDB()), database_dir, callback);
+  InitWithDatabase(make_scoped_ptr(new LevelDB(client_name)), database_dir,
+                   callback);
 }
 
 template <typename T>
diff --git a/components/leveldb_proto/proto_database_impl_unittest.cc b/components/leveldb_proto/proto_database_impl_unittest.cc
index 76b4ae5..ca145c4 100644
--- a/components/leveldb_proto/proto_database_impl_unittest.cc
+++ b/components/leveldb_proto/proto_database_impl_unittest.cc
@@ -30,13 +30,15 @@
 
 typedef std::map<std::string, TestProto> EntryMap;
 
+const char kTestLevelDBClientName[] = "Test";
+
 class MockDB : public LevelDB {
  public:
   MOCK_METHOD1(Init, bool(const base::FilePath&));
   MOCK_METHOD2(Save, bool(const KeyValueVector&, const KeyVector&));
   MOCK_METHOD1(Load, bool(std::vector<std::string>*));
 
-  MockDB() {
+  MockDB() : LevelDB(kTestLevelDBClientName) {
     ON_CALL(*this, Init(_)).WillByDefault(Return(true));
     ON_CALL(*this, Save(_, _)).WillByDefault(Return(true));
     ON_CALL(*this, Load(_)).WillByDefault(Return(true));
@@ -340,8 +342,9 @@
 
   MockDatabaseCaller caller;
   EXPECT_CALL(caller, InitCallback(_));
-  db->Init(temp_dir.path(), base::Bind(&MockDatabaseCaller::InitCallback,
-                                       base::Unretained(&caller)));
+  db->Init(
+      kTestLevelDBClientName, temp_dir.path(),
+      base::Bind(&MockDatabaseCaller::InitCallback, base::Unretained(&caller)));
 
   db.reset();
 
@@ -369,12 +372,12 @@
         std::make_pair(pair.second.id(), pair.second.SerializeAsString()));
   }
 
-  scoped_ptr<LevelDB> db(new LevelDB());
+  scoped_ptr<LevelDB> db(new LevelDB(kTestLevelDBClientName));
   EXPECT_TRUE(db->Init(temp_dir.path()));
   EXPECT_TRUE(db->Save(save_entries, remove_keys));
 
   if (close_after_save) {
-    db.reset(new LevelDB());
+    db.reset(new LevelDB(kTestLevelDBClientName));
     EXPECT_TRUE(db->Init(temp_dir.path()));
   }
 
@@ -405,7 +408,7 @@
 
   leveldb::Options options;
   options.create_if_missing = false;
-  scoped_ptr<LevelDB> db(new LevelDB());
+  scoped_ptr<LevelDB> db(new LevelDB(kTestLevelDBClientName));
 
   KeyValueVector save_entries;
   std::vector<std::string> load_entries;
@@ -417,7 +420,7 @@
 }
 
 TEST(ProtoDatabaseImplLevelDBTest, TestMemoryDatabase) {
-  scoped_ptr<LevelDB> db(new LevelDB());
+  scoped_ptr<LevelDB> db(new LevelDB(kTestLevelDBClientName));
 
   std::vector<std::string> load_entries;
 
diff --git a/components/leveldb_proto/testing/fake_db.h b/components/leveldb_proto/testing/fake_db.h
index e5cd177..273778a8 100644
--- a/components/leveldb_proto/testing/fake_db.h
+++ b/components/leveldb_proto/testing/fake_db.h
@@ -28,7 +28,8 @@
   ~FakeDB() override;
 
   // ProtoDatabase implementation.
-  void Init(const base::FilePath& database_dir,
+  void Init(const char* client_name,
+            const base::FilePath& database_dir,
             const typename ProtoDatabase<T>::InitCallback& callback) override;
   void UpdateEntries(
       scoped_ptr<typename ProtoDatabase<T>::KeyEntryVector> entries_to_save,
@@ -69,7 +70,8 @@
 FakeDB<T>::~FakeDB() {}
 
 template <typename T>
-void FakeDB<T>::Init(const base::FilePath& database_dir,
+void FakeDB<T>::Init(const char* client_name,
+                     const base::FilePath& database_dir,
                      const typename ProtoDatabase<T>::InitCallback& callback) {
   dir_ = database_dir;
   init_callback_ = callback;
diff --git a/components/metrics.gypi b/components/metrics.gypi
index 1004449..3b6695e 100644
--- a/components/metrics.gypi
+++ b/components/metrics.gypi
@@ -85,6 +85,17 @@
             'metrics_serialization',
           ],
         }],
+        ['OS == "mac"', {
+          'link_settings': {
+            'libraries': [
+              # The below are all needed for drive_metrics_provider_mac.mm.
+              '$(SDKROOT)/System/Library/Frameworks/CoreFoundation.framework',
+              '$(SDKROOT)/System/Library/Frameworks/DiskArbitration.framework',
+              '$(SDKROOT)/System/Library/Frameworks/Foundation.framework',
+              '$(SDKROOT)/System/Library/Frameworks/IOKit.framework',
+            ],
+          },
+        }],
         ['OS=="win"', {
           'sources!': [
             'metrics/machine_id_provider_stub.cc',
diff --git a/components/metrics/BUILD.gn b/components/metrics/BUILD.gn
index 52d75281..b6c7edb 100644
--- a/components/metrics/BUILD.gn
+++ b/components/metrics/BUILD.gn
@@ -77,6 +77,16 @@
     deps += [ ":serialization" ]
   }
 
+  if (is_mac) {
+    libs = [
+      # The below are all needed for drive_metrics_provider_mac.mm.
+      "CoreFoundation.framework",
+      "DiskArbitration.framework",
+      "Foundation.framework",
+      "IOKit.framework",
+    ]
+  }
+
   if (is_win) {
     sources -= [ "machine_id_provider_stub.cc" ]
   }
diff --git a/components/mus/BUILD.gn b/components/mus/BUILD.gn
index 098bd30..ec34ba81 100644
--- a/components/mus/BUILD.gn
+++ b/components/mus/BUILD.gn
@@ -58,7 +58,6 @@
     "//mojo/common:tracing_impl",
     "//ui/events",
     "//ui/gl:gl",
-    "//ui/gl:test_support",
     "//ui/platform_window:platform_impls",
     "//ui/platform_window:platform_window",
   ]
diff --git a/components/mus/example/BUILD.gn b/components/mus/example/BUILD.gn
new file mode 100644
index 0000000..10a5e97
--- /dev/null
+++ b/components/mus/example/BUILD.gn
@@ -0,0 +1,13 @@
+# 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.
+
+group("example") {
+  testonly = true
+
+  deps = [
+    "//components/mus/example/client",
+    "//components/mus/example/window_type_launcher",
+    "//components/mus/example/wm",
+  ]
+}
diff --git a/components/mus/example/client/BUILD.gn b/components/mus/example/client/BUILD.gn
new file mode 100644
index 0000000..2310d55
--- /dev/null
+++ b/components/mus/example/client/BUILD.gn
@@ -0,0 +1,56 @@
+# Copyright 2014 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+import("//build/config/ui.gni")
+import("//mojo/public/mojo_application.gni")
+import("//third_party/mojo/src/mojo/public/tools/bindings/mojom.gni")
+import("//tools/grit/repack.gni")
+
+mojo_native_application("client") {
+  output_name = "example_client"
+  testonly = true
+
+  sources = [
+    "client_application_delegate.cc",
+    "client_application_delegate.h",
+    "main.cc",
+  ]
+
+  deps = [
+    ":resources",
+    "//base",
+    "//components/mus/example/wm:interfaces",
+    "//mojo/application/public/cpp",
+    "//mandoline/ui/aura",
+    "//mojo/application/public/cpp:sources",
+    "//mojo/converters/geometry",
+    "//skia",
+    "//third_party/mojo/src/mojo/public/cpp/bindings",
+    "//ui/gfx",
+    "//ui/gfx/geometry",
+    "//ui/mojo/events:interfaces",
+    "//ui/views",
+  ]
+
+  resources = [ "$root_out_dir/example_resources.pak" ]
+
+  data_deps = [
+    "//components/mus",
+  ]
+}
+
+repack("resources") {
+  sources = [
+    "$root_gen_dir/ui/resources/ui_resources_100_percent.pak",
+    "$root_gen_dir/ui/strings/app_locale_settings_en-US.pak",
+    "$root_gen_dir/ui/strings/ui_strings_en-US.pak",
+    "$root_gen_dir/ui/views/resources/views_resources_100_percent.pak",
+  ]
+  output = "$root_out_dir/example_resources.pak"
+  deps = [
+    "//ui/strings",
+    "//ui/resources",
+    "//ui/views/resources",
+  ]
+}
diff --git a/components/mus/example/client/DEPS b/components/mus/example/client/DEPS
new file mode 100644
index 0000000..7caf211
--- /dev/null
+++ b/components/mus/example/client/DEPS
@@ -0,0 +1,4 @@
+include_rules = [
+  # TODO(sky): nuke this. Refactor mandoline/ui/aura into mojo.
+  "+mandoline/ui/aura",
+]
diff --git a/components/mus/example/client/client_application_delegate.cc b/components/mus/example/client/client_application_delegate.cc
new file mode 100644
index 0000000..e73d4a4
--- /dev/null
+++ b/components/mus/example/client/client_application_delegate.cc
@@ -0,0 +1,66 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "components/mus/example/client/client_application_delegate.h"
+
+#include "components/mus/example/wm/wm.mojom.h"
+#include "components/mus/public/cpp/view_tree_connection.h"
+#include "components/mus/public/cpp/view_tree_host_factory.h"
+#include "mandoline/ui/aura/aura_init.h"
+#include "mandoline/ui/aura/native_widget_view_manager.h"
+#include "mojo/application/public/cpp/application_connection.h"
+#include "mojo/application/public/cpp/application_impl.h"
+#include "mojo/converters/geometry/geometry_type_converters.h"
+#include "ui/views/background.h"
+#include "ui/views/widget/widget.h"
+#include "ui/views/widget/widget_delegate.h"
+
+ClientApplicationDelegate::ClientApplicationDelegate() : app_(nullptr) {}
+
+ClientApplicationDelegate::~ClientApplicationDelegate() {}
+
+void ClientApplicationDelegate::Initialize(mojo::ApplicationImpl* app) {
+  app_ = app;
+
+  mojom::WMPtr wm;
+  mojo::URLRequestPtr request(mojo::URLRequest::New());
+  request->url = "mojo:example_wm";
+  app->ConnectToService(request.Pass(), &wm);
+
+  for (int i = 0; i < 3; ++i) {
+    mojo::ViewTreeClientPtr view_tree_client;
+    mus::ViewTreeConnection::Create(this, GetProxy(&view_tree_client).Pass());
+    wm->OpenWindow(view_tree_client.Pass());
+  }
+}
+
+bool ClientApplicationDelegate::ConfigureIncomingConnection(
+    mojo::ApplicationConnection* connection) {
+  return false;
+}
+
+void ClientApplicationDelegate::OnEmbed(mus::View* root) {
+  if (!aura_init_) {
+    aura_init_.reset(
+        new mandoline::AuraInit(root, app_->shell(), "example_resources.pak"));
+  }
+
+  views::WidgetDelegateView* widget_delegate = new views::WidgetDelegateView;
+  widget_delegate->GetContentsView()->set_background(
+      views::Background::CreateSolidBackground(0xFFDDDDDD));
+
+  views::Widget* widget = new views::Widget;
+  views::Widget::InitParams params(views::Widget::InitParams::TYPE_WINDOW);
+  params.delegate = widget_delegate;
+  params.native_widget =
+      new mandoline::NativeWidgetViewManager(widget, app_->shell(), root);
+  params.bounds = root->bounds().To<gfx::Rect>();
+  params.bounds.set_x(0);
+  params.bounds.set_y(0);
+  widget->Init(params);
+  widget->Show();
+}
+
+void ClientApplicationDelegate::OnConnectionLost(
+    mus::ViewTreeConnection* connection) {}
diff --git a/components/mus/example/client/client_application_delegate.h b/components/mus/example/client/client_application_delegate.h
new file mode 100644
index 0000000..3a8f28d
--- /dev/null
+++ b/components/mus/example/client/client_application_delegate.h
@@ -0,0 +1,43 @@
+// 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 COMPONENTS_MUS_EXAMPLE_CLIENT_CLIENT_APPLICATION_DELEGATE_H_
+#define COMPONENTS_MUS_EXAMPLE_CLIENT_CLIENT_APPLICATION_DELEGATE_H_
+
+#include "base/macros.h"
+#include "base/memory/scoped_ptr.h"
+#include "components/mus/public/cpp/view_tree_delegate.h"
+#include "mojo/application/public/cpp/application_delegate.h"
+#include "mojo/application/public/cpp/interface_factory_impl.h"
+
+namespace mandoline {
+class AuraInit;
+}
+
+class ClientApplicationDelegate : public mojo::ApplicationDelegate,
+                                  public mus::ViewTreeDelegate {
+ public:
+  ClientApplicationDelegate();
+  ~ClientApplicationDelegate() override;
+
+  // Overridden from ApplicationDelegate:
+  void Initialize(mojo::ApplicationImpl* app) override;
+
+ private:
+  // ApplicationDelegate:
+  bool ConfigureIncomingConnection(
+      mojo::ApplicationConnection* connection) override;
+
+  // mus::ViewTreeDelegate:
+  void OnEmbed(mus::View* root) override;
+  void OnConnectionLost(mus::ViewTreeConnection* connection) override;
+
+  mojo::ApplicationImpl* app_;
+
+  scoped_ptr<mandoline::AuraInit> aura_init_;
+
+  DISALLOW_COPY_AND_ASSIGN(ClientApplicationDelegate);
+};
+
+#endif  // COMPONENTS_MUS_EXAMPLE_CLIENT_CLIENT_APPLICATION_DELEGATE_H_
diff --git a/components/mus/example/client/main.cc b/components/mus/example/client/main.cc
new file mode 100644
index 0000000..913d391c
--- /dev/null
+++ b/components/mus/example/client/main.cc
@@ -0,0 +1,12 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "components/mus/example/client/client_application_delegate.h"
+#include "mojo/application/public/cpp/application_runner.h"
+#include "third_party/mojo/src/mojo/public/c/system/main.h"
+
+MojoResult MojoMain(MojoHandle shell_handle) {
+  mojo::ApplicationRunner runner(new ClientApplicationDelegate);
+  return runner.Run(shell_handle);
+}
diff --git a/components/mus/example/window_type_launcher/BUILD.gn b/components/mus/example/window_type_launcher/BUILD.gn
new file mode 100644
index 0000000..16b5c8c5
--- /dev/null
+++ b/components/mus/example/window_type_launcher/BUILD.gn
@@ -0,0 +1,58 @@
+# 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("//build/config/ui.gni")
+import("//mojo/public/mojo_application.gni")
+import("//third_party/mojo/src/mojo/public/tools/bindings/mojom.gni")
+import("//tools/grit/repack.gni")
+
+mojo_native_application("window_type_launcher") {
+  output_name = "window_type_launcher"
+  testonly = true
+
+  sources = [
+    "main.cc",
+    "window_type_launcher.cc",
+    "window_type_launcher.h",
+  ]
+
+  deps = [
+    ":resources",
+    "//base",
+    "//components/mus/example/wm:interfaces",
+    "//mojo/application/public/cpp",
+    "//mandoline/ui/aura",
+    "//mojo/application/public/cpp:sources",
+    "//mojo/converters/geometry",
+    "//skia",
+    "//third_party/mojo/src/mojo/public/cpp/bindings",
+    "//ui/aura",
+    "//ui/gfx",
+    "//ui/gfx/geometry",
+    "//ui/mojo/events:interfaces",
+    "//ui/views",
+    "//ui/wm",
+  ]
+
+  resources = [ "$root_out_dir/example_resources.pak" ]
+
+  data_deps = [
+    "//components/mus",
+  ]
+}
+
+repack("resources") {
+  sources = [
+    "$root_gen_dir/ui/resources/ui_resources_100_percent.pak",
+    "$root_gen_dir/ui/strings/app_locale_settings_en-US.pak",
+    "$root_gen_dir/ui/strings/ui_strings_en-US.pak",
+    "$root_gen_dir/ui/views/resources/views_resources_100_percent.pak",
+  ]
+  output = "$root_out_dir/example_resources.pak"
+  deps = [
+    "//ui/strings",
+    "//ui/resources",
+    "//ui/views/resources",
+  ]
+}
diff --git a/components/mus/example/window_type_launcher/DEPS b/components/mus/example/window_type_launcher/DEPS
new file mode 100644
index 0000000..7caf211
--- /dev/null
+++ b/components/mus/example/window_type_launcher/DEPS
@@ -0,0 +1,4 @@
+include_rules = [
+  # TODO(sky): nuke this. Refactor mandoline/ui/aura into mojo.
+  "+mandoline/ui/aura",
+]
diff --git a/components/mus/example/window_type_launcher/main.cc b/components/mus/example/window_type_launcher/main.cc
new file mode 100644
index 0000000..38337c8
--- /dev/null
+++ b/components/mus/example/window_type_launcher/main.cc
@@ -0,0 +1,12 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "components/mus/example/window_type_launcher/window_type_launcher.h"
+#include "mojo/application/public/cpp/application_runner.h"
+#include "third_party/mojo/src/mojo/public/c/system/main.h"
+
+MojoResult MojoMain(MojoHandle shell_handle) {
+  mojo::ApplicationRunner runner(new WindowTypeLauncher);
+  return runner.Run(shell_handle);
+}
diff --git a/components/mus/example/window_type_launcher/window_type_launcher.cc b/components/mus/example/window_type_launcher/window_type_launcher.cc
new file mode 100644
index 0000000..c7c436f
--- /dev/null
+++ b/components/mus/example/window_type_launcher/window_type_launcher.cc
@@ -0,0 +1,396 @@
+// Copyright (c) 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.
+
+#include "components/mus/example/window_type_launcher/window_type_launcher.h"
+
+#include "base/strings/utf_string_conversions.h"
+#include "components/mus/example/wm/wm.mojom.h"
+#include "components/mus/public/cpp/view_tree_connection.h"
+#include "components/mus/public/cpp/view_tree_host_factory.h"
+#include "mandoline/ui/aura/aura_init.h"
+#include "mandoline/ui/aura/native_widget_view_manager.h"
+#include "mojo/application/public/cpp/application_connection.h"
+#include "mojo/application/public/cpp/application_impl.h"
+#include "mojo/converters/geometry/geometry_type_converters.h"
+#include "ui/aura/window.h"
+#include "ui/aura/window_event_dispatcher.h"
+#include "ui/compositor/layer.h"
+#include "ui/gfx/canvas.h"
+#include "ui/views/context_menu_controller.h"
+#include "ui/views/controls/button/button.h"
+#include "ui/views/controls/button/label_button.h"
+#include "ui/views/controls/menu/menu_delegate.h"
+#include "ui/views/controls/menu/menu_item_view.h"
+#include "ui/views/controls/menu/menu_runner.h"
+#include "ui/views/layout/grid_layout.h"
+#include "ui/views/widget/widget.h"
+#include "ui/views/widget/widget_delegate.h"
+#include "ui/wm/core/shadow_types.h"
+
+using views::MenuItemView;
+using views::MenuRunner;
+
+namespace {
+
+SkColor g_colors[] = { SK_ColorRED,
+                       SK_ColorYELLOW,
+                       SK_ColorBLUE,
+                       SK_ColorGREEN };
+int g_color_index = 0;
+
+class ModalWindow : public views::WidgetDelegateView,
+                    public views::ButtonListener {
+ public:
+  explicit ModalWindow(ui::ModalType modal_type)
+      : modal_type_(modal_type),
+        color_(g_colors[g_color_index]),
+        open_button_(new views::LabelButton(this,
+                                            base::ASCIIToUTF16("Moar!"))) {
+    ++g_color_index %= arraysize(g_colors);
+    open_button_->SetStyle(views::Button::STYLE_BUTTON);
+    AddChildView(open_button_);
+  }
+  ~ModalWindow() override {}
+
+  static void OpenModalWindow(aura::Window* parent, ui::ModalType modal_type) {
+    views::Widget* widget =
+        views::Widget::CreateWindowWithParent(new ModalWindow(modal_type),
+                                              parent);
+    widget->GetNativeView()->SetName("ModalWindow");
+    widget->Show();
+  }
+
+  // Overridden from views::View:
+  void OnPaint(gfx::Canvas* canvas) override {
+    canvas->FillRect(GetLocalBounds(), color_);
+  }
+  gfx::Size GetPreferredSize() const override { return gfx::Size(200, 200); }
+  void Layout() override {
+    gfx::Size open_ps = open_button_->GetPreferredSize();
+    gfx::Rect local_bounds = GetLocalBounds();
+    open_button_->SetBounds(
+        5, local_bounds.bottom() - open_ps.height() - 5,
+        open_ps.width(), open_ps.height());
+  }
+
+  // Overridden from views::WidgetDelegate:
+  views::View* GetContentsView() override { return this; }
+  bool CanResize() const override { return true; }
+  base::string16 GetWindowTitle() const override {
+    return base::ASCIIToUTF16("Modal Window");
+  }
+  ui::ModalType GetModalType() const override { return modal_type_; }
+
+  // Overridden from views::ButtonListener:
+  void ButtonPressed(views::Button* sender, const ui::Event& event) override {
+    DCHECK(sender == open_button_);
+    OpenModalWindow(GetWidget()->GetNativeView(), modal_type_);
+  }
+
+ private:
+  ui::ModalType modal_type_;
+  SkColor color_;
+  views::LabelButton* open_button_;
+
+  DISALLOW_COPY_AND_ASSIGN(ModalWindow);
+};
+
+class NonModalTransient : public views::WidgetDelegateView {
+ public:
+  NonModalTransient()
+      : color_(g_colors[g_color_index]) {
+    ++g_color_index %= arraysize(g_colors);
+  }
+  ~NonModalTransient() override {}
+
+  static void OpenNonModalTransient(aura::Window* parent) {
+    views::Widget* widget =
+        views::Widget::CreateWindowWithParent(new NonModalTransient, parent);
+    widget->GetNativeView()->SetName("NonModalTransient");
+    widget->Show();
+  }
+
+  static void ToggleNonModalTransient(aura::Window* parent) {
+    if (!non_modal_transient_) {
+      non_modal_transient_ =
+          views::Widget::CreateWindowWithParent(new NonModalTransient, parent);
+      non_modal_transient_->GetNativeView()->SetName("NonModalTransient");
+    }
+    if (non_modal_transient_->IsVisible())
+      non_modal_transient_->Hide();
+    else
+      non_modal_transient_->Show();
+  }
+
+  // Overridden from views::View:
+  void OnPaint(gfx::Canvas* canvas) override {
+    canvas->FillRect(GetLocalBounds(), color_);
+  }
+  gfx::Size GetPreferredSize() const override { return gfx::Size(250, 250); }
+
+  // Overridden from views::WidgetDelegate:
+  views::View* GetContentsView() override { return this; }
+  bool CanResize() const override { return true; }
+  base::string16 GetWindowTitle() const override {
+    return base::ASCIIToUTF16("Non-Modal Transient");
+  }
+  void DeleteDelegate() override {
+    if (GetWidget() == non_modal_transient_)
+      non_modal_transient_ = NULL;
+
+    delete this;
+  }
+
+ private:
+  SkColor color_;
+
+  static views::Widget* non_modal_transient_;
+
+  DISALLOW_COPY_AND_ASSIGN(NonModalTransient);
+};
+
+// static
+views::Widget* NonModalTransient::non_modal_transient_ = NULL;
+
+void AddViewToLayout(views::GridLayout* layout, views::View* view) {
+  layout->StartRow(0, 0);
+  layout->AddView(view);
+  layout->AddPaddingRow(0, 5);
+}
+
+// The contents view/delegate of a window that shows some buttons that create
+// various window types.
+class WindowTypeLauncherView : public views::WidgetDelegateView,
+                               public views::ButtonListener,
+                               public views::MenuDelegate,
+                               public views::ContextMenuController {
+ public:
+  WindowTypeLauncherView()
+      : create_button_(new views::LabelButton(
+            this, base::ASCIIToUTF16("Create Window"))),
+        panel_button_(new views::LabelButton(
+            this, base::ASCIIToUTF16("Create Panel"))),
+        create_nonresizable_button_(new views::LabelButton(
+            this, base::ASCIIToUTF16("Create Non-Resizable Window"))),
+        bubble_button_(new views::LabelButton(
+            this, base::ASCIIToUTF16("Create Pointy Bubble"))),
+        lock_button_(new views::LabelButton(
+            this, base::ASCIIToUTF16("Lock Screen"))),
+        widgets_button_(new views::LabelButton(
+            this, base::ASCIIToUTF16("Show Example Widgets"))),
+        system_modal_button_(new views::LabelButton(
+            this, base::ASCIIToUTF16("Open System Modal Window"))),
+        window_modal_button_(new views::LabelButton(
+            this, base::ASCIIToUTF16("Open Window Modal Window"))),
+        child_modal_button_(new views::LabelButton(
+            this, base::ASCIIToUTF16("Open Child Modal Window"))),
+        transient_button_(new views::LabelButton(
+            this, base::ASCIIToUTF16("Open Non-Modal Transient Window"))),
+        examples_button_(new views::LabelButton(
+            this, base::ASCIIToUTF16("Open Views Examples Window"))),
+        show_hide_window_button_(new views::LabelButton(
+            this, base::ASCIIToUTF16("Show/Hide a Window"))),
+        show_web_notification_(new views::LabelButton(
+            this, base::ASCIIToUTF16("Show a web/app notification"))) {
+    create_button_->SetStyle(views::Button::STYLE_BUTTON);
+    panel_button_->SetStyle(views::Button::STYLE_BUTTON);
+    create_nonresizable_button_->SetStyle(views::Button::STYLE_BUTTON);
+    bubble_button_->SetStyle(views::Button::STYLE_BUTTON);
+    lock_button_->SetStyle(views::Button::STYLE_BUTTON);
+    widgets_button_->SetStyle(views::Button::STYLE_BUTTON);
+    system_modal_button_->SetStyle(views::Button::STYLE_BUTTON);
+    window_modal_button_->SetStyle(views::Button::STYLE_BUTTON);
+    child_modal_button_->SetStyle(views::Button::STYLE_BUTTON);
+    transient_button_->SetStyle(views::Button::STYLE_BUTTON);
+    examples_button_->SetStyle(views::Button::STYLE_BUTTON);
+    show_hide_window_button_->SetStyle(views::Button::STYLE_BUTTON);
+    show_web_notification_->SetStyle(views::Button::STYLE_BUTTON);
+
+    views::GridLayout* layout = new views::GridLayout(this);
+    layout->SetInsets(5, 5, 5, 5);
+    SetLayoutManager(layout);
+    views::ColumnSet* column_set = layout->AddColumnSet(0);
+    column_set->AddColumn(views::GridLayout::LEADING,
+                          views::GridLayout::CENTER,
+                          0,
+                          views::GridLayout::USE_PREF,
+                          0,
+                          0);
+    AddViewToLayout(layout, create_button_);
+    AddViewToLayout(layout, panel_button_);
+    AddViewToLayout(layout, create_nonresizable_button_);
+    AddViewToLayout(layout, bubble_button_);
+    AddViewToLayout(layout, lock_button_);
+    AddViewToLayout(layout, widgets_button_);
+    AddViewToLayout(layout, system_modal_button_);
+    AddViewToLayout(layout, window_modal_button_);
+    AddViewToLayout(layout, child_modal_button_);
+    AddViewToLayout(layout, transient_button_);
+    AddViewToLayout(layout, examples_button_);
+    AddViewToLayout(layout, show_hide_window_button_);
+    AddViewToLayout(layout, show_web_notification_);
+    set_context_menu_controller(this);
+  }
+  ~WindowTypeLauncherView() override {}
+
+ private:
+  typedef std::pair<aura::Window*, gfx::Rect> WindowAndBoundsPair;
+
+  enum MenuCommands {
+    COMMAND_NEW_WINDOW = 1,
+    COMMAND_TOGGLE_FULLSCREEN = 3,
+  };
+
+  // Overridden from views::View:
+  void OnPaint(gfx::Canvas* canvas) override {
+    canvas->FillRect(GetLocalBounds(), SK_ColorWHITE);
+  }
+  bool OnMousePressed(const ui::MouseEvent& event) override {
+    // Overridden so we get OnMouseReleased and can show the context menu.
+    return true;
+  }
+
+  // Overridden from views::WidgetDelegate:
+  views::View* GetContentsView() override { return this;  }
+  bool CanResize() const override { return true;  }
+  base::string16 GetWindowTitle() const override {
+    return base::ASCIIToUTF16("Examples: Window Builder");
+  }
+  bool CanMaximize() const override { return true; }
+  bool CanMinimize() const override { return true; }
+
+  // Overridden from views::ButtonListener:
+  void ButtonPressed(views::Button* sender, const ui::Event& event) override {
+    if (sender == create_button_) {
+      NOTIMPLEMENTED();
+    } else if (sender == panel_button_) {
+      NOTIMPLEMENTED();
+    }
+    else if (sender == create_nonresizable_button_) {
+      NOTIMPLEMENTED();
+    }
+    else if (sender == bubble_button_) {
+      NOTIMPLEMENTED();
+    }
+    else if (sender == lock_button_) {
+      NOTIMPLEMENTED();
+    }
+    else if (sender == widgets_button_) {
+      NOTIMPLEMENTED();
+    }
+    else if (sender == system_modal_button_) {
+      ModalWindow::OpenModalWindow(GetWidget()->GetNativeView(),
+                                   ui::MODAL_TYPE_SYSTEM);
+    } else if (sender == window_modal_button_) {
+      ModalWindow::OpenModalWindow(GetWidget()->GetNativeView(),
+                                   ui::MODAL_TYPE_WINDOW);
+    } else if (sender == child_modal_button_) {
+    } else if (sender == transient_button_) {
+      NonModalTransient::OpenNonModalTransient(GetWidget()->GetNativeView());
+    } else if (sender == show_hide_window_button_) {
+      NonModalTransient::ToggleNonModalTransient(GetWidget()->GetNativeView());
+    }
+  }
+
+  // Overridden from views::MenuDelegate:
+  void ExecuteCommand(int id, int event_flags) override {
+    switch (id) {
+      case COMMAND_NEW_WINDOW:
+        NOTIMPLEMENTED();
+        break;
+      case COMMAND_TOGGLE_FULLSCREEN:
+        GetWidget()->SetFullscreen(!GetWidget()->IsFullscreen());
+        break;
+      default:
+        break;
+    }
+  }
+
+  // Override from views::ContextMenuController:
+  void ShowContextMenuForView(views::View* source,
+                              const gfx::Point& point,
+                              ui::MenuSourceType source_type) override {
+    MenuItemView* root = new MenuItemView(this);
+    root->AppendMenuItem(COMMAND_NEW_WINDOW,
+                         base::ASCIIToUTF16("New Window"),
+                         MenuItemView::NORMAL);
+    root->AppendMenuItem(COMMAND_TOGGLE_FULLSCREEN,
+                         base::ASCIIToUTF16("Toggle FullScreen"),
+                         MenuItemView::NORMAL);
+    // MenuRunner takes ownership of root.
+    menu_runner_.reset(new MenuRunner(
+        root, MenuRunner::HAS_MNEMONICS | views::MenuRunner::CONTEXT_MENU));
+    if (menu_runner_->RunMenuAt(GetWidget(),
+                                NULL,
+                                gfx::Rect(point, gfx::Size()),
+                                views::MENU_ANCHOR_TOPLEFT,
+                                source_type) == MenuRunner::MENU_DELETED) {
+      return;
+    }
+  }
+
+  views::LabelButton* create_button_;
+  views::LabelButton* panel_button_;
+  views::LabelButton* create_nonresizable_button_;
+  views::LabelButton* bubble_button_;
+  views::LabelButton* lock_button_;
+  views::LabelButton* widgets_button_;
+  views::LabelButton* system_modal_button_;
+  views::LabelButton* window_modal_button_;
+  views::LabelButton* child_modal_button_;
+  views::LabelButton* transient_button_;
+  views::LabelButton* examples_button_;
+  views::LabelButton* show_hide_window_button_;
+  views::LabelButton* show_web_notification_;
+  scoped_ptr<views::MenuRunner> menu_runner_;
+
+  DISALLOW_COPY_AND_ASSIGN(WindowTypeLauncherView);
+};
+
+}  // namespace
+
+WindowTypeLauncher::WindowTypeLauncher() : app_(nullptr) {}
+WindowTypeLauncher::~WindowTypeLauncher() {}
+
+void WindowTypeLauncher::Initialize(mojo::ApplicationImpl* app) {
+  app_ = app;
+
+  mojom::WMPtr wm;
+  mojo::URLRequestPtr request(mojo::URLRequest::New());
+  request->url = "mojo:example_wm";
+  app->ConnectToService(request.Pass(), &wm);
+
+  mojo::ViewTreeClientPtr view_tree_client;
+  mus::ViewTreeConnection::Create(this, GetProxy(&view_tree_client).Pass());
+  wm->OpenWindow(view_tree_client.Pass());
+}
+
+bool WindowTypeLauncher::ConfigureIncomingConnection(
+  mojo::ApplicationConnection* connection) {
+  return false;
+}
+
+void WindowTypeLauncher::OnEmbed(mus::View* root) {
+  if (!aura_init_) {
+    aura_init_.reset(
+      new mandoline::AuraInit(root, app_->shell(), "example_resources.pak"));
+  }
+
+  views::Widget* widget = new views::Widget;
+  // TODO(sky): make this TYPE_WINDOW. I need to fix resources in order to use
+  // TYPE_WINDOW.
+  views::Widget::InitParams params(
+    views::Widget::InitParams::TYPE_WINDOW_FRAMELESS);
+  params.delegate = new WindowTypeLauncherView;
+  params.native_widget =
+      new mandoline::NativeWidgetViewManager(widget, app_->shell(), root);
+  params.bounds = root->bounds().To<gfx::Rect>();
+  params.bounds.set_x(0);
+  params.bounds.set_y(0);
+  widget->Init(params);
+  widget->Show();
+}
+
+void WindowTypeLauncher::OnConnectionLost(mus::ViewTreeConnection* connection) {
+}
diff --git a/components/mus/example/window_type_launcher/window_type_launcher.h b/components/mus/example/window_type_launcher/window_type_launcher.h
new file mode 100644
index 0000000..f3136f3
--- /dev/null
+++ b/components/mus/example/window_type_launcher/window_type_launcher.h
@@ -0,0 +1,43 @@
+// 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 COMPONENTS_MUS_EXAMPLE_WINDOW_TYPE_LAUNCHER_WINDOW_TYPE_LAUNCHER_H_
+#define COMPONENTS_MUS_EXAMPLE_WINDOW_TYPE_LAUNCHER_WINDOW_TYPE_LAUNCHER_H_
+
+#include "base/macros.h"
+#include "base/memory/scoped_ptr.h"
+#include "components/mus/public/cpp/view_tree_delegate.h"
+#include "mojo/application/public/cpp/application_delegate.h"
+#include "mojo/application/public/cpp/interface_factory_impl.h"
+
+namespace mandoline {
+  class AuraInit;
+}
+
+class WindowTypeLauncher : public mojo::ApplicationDelegate,
+                           public mus::ViewTreeDelegate {
+public:
+  WindowTypeLauncher();
+  ~WindowTypeLauncher() override;
+
+  // Overridden from ApplicationDelegate:
+  void Initialize(mojo::ApplicationImpl* app) override;
+
+private:
+  // ApplicationDelegate:
+  bool ConfigureIncomingConnection(
+    mojo::ApplicationConnection* connection) override;
+
+  // mus::ViewTreeDelegate:
+  void OnEmbed(mus::View* root) override;
+  void OnConnectionLost(mus::ViewTreeConnection* connection) override;
+
+  mojo::ApplicationImpl* app_;
+
+  scoped_ptr<mandoline::AuraInit> aura_init_;
+
+  DISALLOW_COPY_AND_ASSIGN(WindowTypeLauncher);
+};
+
+#endif  // COMPONENTS_MUS_EXAMPLE_WINDOW_TYPE_LAUNCHER_WINDOW_TYPE_LAUNCHER_H_
diff --git a/components/mus/example/wm/BUILD.gn b/components/mus/example/wm/BUILD.gn
new file mode 100644
index 0000000..671a5b8b
--- /dev/null
+++ b/components/mus/example/wm/BUILD.gn
@@ -0,0 +1,50 @@
+# 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("//build/config/ui.gni")
+import("//mojo/public/mojo_application.gni")
+import("//third_party/mojo/src/mojo/public/tools/bindings/mojom.gni")
+
+mojom("interfaces") {
+  testonly = true
+
+  sources = [
+    "wm.mojom",
+  ]
+
+  import_dirs = [
+    get_path_info("../../../..", "abspath"),
+    "//mojo/services",
+  ]
+
+  deps = [
+    "//components/mus/public/interfaces",
+  ]
+}
+
+mojo_native_application("wm") {
+  output_name = "example_wm"
+  testonly = true
+
+  sources = [
+    "container.h",
+    "main.cc",
+    "wm.cc",
+    "wm.h",
+    "wm_application_delegate.cc",
+    "wm_application_delegate.h",
+  ]
+
+  deps = [
+    ":interfaces",
+    "//base",
+    "//components/mus/public/cpp",
+    "//mojo/application/public/cpp",
+    "//mojo/common:common_base",
+  ]
+
+  data_deps = [
+    "//components/mus",
+  ]
+}
diff --git a/components/mus/example/wm/container.h b/components/mus/example/wm/container.h
new file mode 100644
index 0000000..70d636a
--- /dev/null
+++ b/components/mus/example/wm/container.h
@@ -0,0 +1,27 @@
+// 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 COMPONENTS_MUS_EXAMPLE_WM_IDS_H_
+#define COMPONENTS_MUS_EXAMPLE_WM_IDS_H_
+
+enum class Container {
+  ALL_USER_BACKGROUND = 1,
+  USER_WORKSPACE,
+  USER_BACKGROUND,
+  USER_PRIVATE,
+  USER_WINDOWS,
+  USER_STICKY_WINDOWS,
+  USER_PRESENTATION_WINDOWS,
+  USER_LAUNCHER,
+  LOGIN_WINDOWS,
+  LOGIN_APP,
+  LOGIN_LAUNCHER,
+  SYSTEM_MODAL_WINDOWS,
+  KEYBOARD,
+  MENUS,
+  TOOLTIPS,
+  COUNT
+};
+
+#endif  // COMPONENTS_MUS_EXAMPLE_WM_IDS_H_
diff --git a/components/mus/example/wm/main.cc b/components/mus/example/wm/main.cc
new file mode 100644
index 0000000..14727c0
--- /dev/null
+++ b/components/mus/example/wm/main.cc
@@ -0,0 +1,12 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "components/mus/example/wm/wm_application_delegate.h"
+#include "mojo/application/public/cpp/application_runner.h"
+#include "third_party/mojo/src/mojo/public/c/system/main.h"
+
+MojoResult MojoMain(MojoHandle shell_handle) {
+  mojo::ApplicationRunner runner(new WMApplicationDelegate);
+  return runner.Run(shell_handle);
+}
diff --git a/components/mus/example/wm/wm.cc b/components/mus/example/wm/wm.cc
new file mode 100644
index 0000000..3acfc26d
--- /dev/null
+++ b/components/mus/example/wm/wm.cc
@@ -0,0 +1,78 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "components/mus/example/wm/wm.h"
+
+#include "components/mus/example/wm/container.h"
+#include "components/mus/public/cpp/types.h"
+#include "components/mus/public/cpp/util.h"
+#include "components/mus/public/cpp/view.h"
+#include "components/mus/public/cpp/view_tree_connection.h"
+
+namespace {
+
+mus::Id GetViewIdForContainer(mus::ViewTreeConnection* connection,
+                              Container container) {
+  return connection->GetConnectionId() << 16 | static_cast<uint16>(container);
+}
+
+}  // namespace
+
+WM::WM() : root_(nullptr), window_counter_(0) {}
+
+WM::~WM() {
+  // TODO(sky): shutdown if necessary.
+}
+
+void WM::OnEmbed(mus::View* root) {
+  root_ = root;
+  CreateContainers();
+  for (mojo::ViewTreeClientPtr* client : pending_embeds_)
+    OpenWindow(client->Pass());
+  pending_embeds_.clear();
+}
+
+void WM::OnConnectionLost(mus::ViewTreeConnection* connection) {
+  // TODO(sky): shutdown.
+  NOTIMPLEMENTED();
+}
+
+void WM::OpenWindow(mojo::ViewTreeClientPtr client) {
+  if (!root_) {
+    pending_embeds_.push_back(new mojo::ViewTreeClientPtr(client.Pass()));
+    return;
+  }
+
+  mus::Id container_view_id = GetViewIdForContainer(root_->connection(),
+                                                    Container::USER_WINDOWS);
+  mus::View* container_view = root_->GetChildById(container_view_id);
+
+  const int width = (root_->bounds().width - 240);
+  const int height = (root_->bounds().height - 240);
+
+  mus::View* child_view = root_->connection()->CreateView();
+  mojo::Rect bounds;
+  bounds.x = 40 + (window_counter_ % 4) * 40;
+  bounds.y = 40 + (window_counter_ % 4) * 40;
+  bounds.width = width;
+  bounds.height = height;
+  child_view->SetBounds(bounds);
+  container_view->AddChild(child_view);
+  child_view->Embed(client.Pass());
+
+  window_counter_++;
+}
+
+void WM::CreateContainers() {
+  for (uint16 container = static_cast<uint16>(Container::ALL_USER_BACKGROUND);
+       container < static_cast<uint16>(Container::COUNT); ++container) {
+    mus::View* view = root_->connection()->CreateView();
+    DCHECK_EQ(mus::LoWord(view->id()), container)
+        << "Containers must be created before other views!";
+    view->SetBounds(root_->bounds());
+    view->SetVisible(true);
+    root_->AddChild(view);
+  }
+}
+
diff --git a/components/mus/example/wm/wm.h b/components/mus/example/wm/wm.h
new file mode 100644
index 0000000..0c3cc7b0
--- /dev/null
+++ b/components/mus/example/wm/wm.h
@@ -0,0 +1,34 @@
+// 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 COMPONENTS_MUS_EXAMPLE_WM_WM_H_
+#define COMPONENTS_MUS_EXAMPLE_WM_WM_H_
+
+#include "base/memory/scoped_vector.h"
+#include "components/mus/example/wm/wm.mojom.h"
+#include "components/mus/public/cpp/view_tree_delegate.h"
+
+class WM : public mojom::WM, public mus::ViewTreeDelegate {
+ public:
+  WM();
+  ~WM() override;
+
+ private:
+  // ViewTreeDelegate:
+  void OnEmbed(mus::View* root) override;
+  void OnConnectionLost(mus::ViewTreeConnection* connection) override;
+
+  // WM:
+  void OpenWindow(mojo::ViewTreeClientPtr client) override;
+
+  void CreateContainers();
+
+  mus::View* root_;
+  ScopedVector<mojo::ViewTreeClientPtr> pending_embeds_;
+  int window_counter_;
+
+  DISALLOW_COPY_AND_ASSIGN(WM);
+};
+
+#endif  // COMPONENTS_MUS_EXAMPLE_WM_WM_H_
diff --git a/components/mus/example/wm/wm.mojom b/components/mus/example/wm/wm.mojom
new file mode 100644
index 0000000..637a0bb
--- /dev/null
+++ b/components/mus/example/wm/wm.mojom
@@ -0,0 +1,11 @@
+// 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.
+
+module mojom;
+
+import "components/mus/public/interfaces/view_tree.mojom";
+
+interface WM {
+  OpenWindow(mojo.ViewTreeClient client);
+};
diff --git a/components/mus/example/wm/wm_application_delegate.cc b/components/mus/example/wm/wm_application_delegate.cc
new file mode 100644
index 0000000..26b79f04
--- /dev/null
+++ b/components/mus/example/wm/wm_application_delegate.cc
@@ -0,0 +1,29 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "components/mus/example/wm/wm_application_delegate.h"
+
+#include "components/mus/example/wm/wm.h"
+#include "components/mus/public/cpp/view_tree_host_factory.h"
+#include "mojo/application/public/cpp/application_connection.h"
+
+WMApplicationDelegate::WMApplicationDelegate() {}
+
+WMApplicationDelegate::~WMApplicationDelegate() {}
+
+void WMApplicationDelegate::Initialize(mojo::ApplicationImpl* app) {
+  wm_.reset(new WM);
+  mus::CreateSingleViewTreeHost(app, wm_.get(), &host_);
+}
+
+bool WMApplicationDelegate::ConfigureIncomingConnection(
+    mojo::ApplicationConnection* connection) {
+  connection->AddService(this);
+  return true;
+}
+
+void WMApplicationDelegate::Create(mojo::ApplicationConnection* connection,
+                                   mojo::InterfaceRequest<mojom::WM> request) {
+  wm_bindings_.AddBinding(wm_.get(), request.Pass());
+}
diff --git a/components/mus/example/wm/wm_application_delegate.h b/components/mus/example/wm/wm_application_delegate.h
new file mode 100644
index 0000000..c1e09d4
--- /dev/null
+++ b/components/mus/example/wm/wm_application_delegate.h
@@ -0,0 +1,42 @@
+// 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 COMPONENTS_MUS_EXAMPLE_WM_WM_APPLICATION_DELEGATE_H_
+#define COMPONENTS_MUS_EXAMPLE_WM_WM_APPLICATION_DELEGATE_H_
+
+#include "base/macros.h"
+#include "components/mus/example/wm/wm.mojom.h"
+#include "components/mus/public/interfaces/view_tree_host.mojom.h"
+#include "mojo/application/public/cpp/application_delegate.h"
+#include "mojo/application/public/cpp/interface_factory_impl.h"
+#include "mojo/common/weak_binding_set.h"
+
+class WM;
+
+class WMApplicationDelegate : public mojo::ApplicationDelegate,
+                              public mojo::InterfaceFactory<mojom::WM> {
+ public:
+  WMApplicationDelegate();
+  ~WMApplicationDelegate() override;
+
+  // Overridden from ApplicationDelegate:
+  void Initialize(mojo::ApplicationImpl* app) override;
+
+ private:
+  // ApplicationDelegate:
+  bool ConfigureIncomingConnection(
+      mojo::ApplicationConnection* connection) override;
+
+  // InterfaceFactory<mojom::WM>:
+  void Create(mojo::ApplicationConnection* connection,
+              mojo::InterfaceRequest<mojom::WM> request) override;
+
+  scoped_ptr<WM> wm_;
+  mojo::ViewTreeHostPtr host_;
+  mojo::WeakBindingSet<mojom::WM> wm_bindings_;
+
+  DISALLOW_COPY_AND_ASSIGN(WMApplicationDelegate);
+};
+
+#endif  // COMPONENTS_MUS_EXAMPLE_WM_WM_APPLICATION_DELEGATE_H_
diff --git a/components/mus/gles2/command_buffer_driver.cc b/components/mus/gles2/command_buffer_driver.cc
index aca7d41..a03ad56 100644
--- a/components/mus/gles2/command_buffer_driver.cc
+++ b/components/mus/gles2/command_buffer_driver.cc
@@ -234,11 +234,6 @@
     return;
   }
 
-  gfx::GpuMemoryBufferHandle gfx_handle;
-  // TODO(jam): create mojo enum for this and converter
-  gfx_handle.type = static_cast<gfx::GpuMemoryBufferType>(type);
-  gfx_handle.id = gfx::GpuMemoryBufferId(id);
-
   MojoPlatformHandle platform_handle;
   MojoResult extract_result = MojoExtractPlatformHandle(
       memory_handle.release().value(), &platform_handle);
@@ -247,17 +242,17 @@
     return;
   }
 
+  base::SharedMemoryHandle handle;
 #if defined(OS_WIN)
-  gfx_handle.handle =
-      base::SharedMemoryHandle(platform_handle, base::GetCurrentProcId());
+  handle = base::SharedMemoryHandle(platform_handle, base::GetCurrentProcId());
 #else
-  gfx_handle.handle = base::FileDescriptor(platform_handle, false);
+  handle = base::FileDescriptor(platform_handle, false);
 #endif
 
   scoped_refptr<gfx::GLImageSharedMemory> image =
       new gfx::GLImageSharedMemory(gfx_size, internal_format);
   // TODO(jam): also need a mojo enum for this enum
-  if (!image->Initialize(gfx_handle, gpu_format)) {
+  if (!image->Initialize(handle, gfx::GpuMemoryBufferId(id), gpu_format)) {
     NOTREACHED();
     return;
   }
diff --git a/components/mus/main.cc b/components/mus/main.cc
index 0d10d9c..c1d4ac8 100644
--- a/components/mus/main.cc
+++ b/components/mus/main.cc
@@ -8,5 +8,6 @@
 
 MojoResult MojoMain(MojoHandle shell_handle) {
   mojo::ApplicationRunner runner(new mus::MandolineUIServicesApp);
+  runner.set_message_loop_type(base::MessageLoop::TYPE_UI);
   return runner.Run(shell_handle);
 }
diff --git a/components/mus/mus_app.cc b/components/mus/mus_app.cc
index 4c302400..120fc79f 100644
--- a/components/mus/mus_app.cc
+++ b/components/mus/mus_app.cc
@@ -21,7 +21,6 @@
 #include "ui/events/event_switches.h"
 #include "ui/events/platform/platform_event_source.h"
 #include "ui/gl/gl_surface.h"
-#include "ui/gl/test/gl_surface_test_support.h"
 
 #if defined(USE_X11)
 #include <X11/Xlib.h>
diff --git a/components/mus/public/cpp/lib/view_tree_client_impl.cc b/components/mus/public/cpp/lib/view_tree_client_impl.cc
index 43a1935..2a8516c2 100644
--- a/components/mus/public/cpp/lib/view_tree_client_impl.cc
+++ b/components/mus/public/cpp/lib/view_tree_client_impl.cc
@@ -222,7 +222,7 @@
 
 Id ViewTreeClientImpl::CreateViewOnServer() {
   DCHECK(tree_);
-  const Id view_id = MakeTransportId(connection_id_, ++next_id_);
+  const Id view_id = MakeTransportId(connection_id_, next_id_++);
   tree_->CreateView(view_id, [this](mojo::ErrorCode code) {
     OnActionCompleted(code == mojo::ERROR_CODE_NONE);
   });
diff --git a/components/mus/vm/BUILD.gn b/components/mus/vm/BUILD.gn
index d660c849..4bb7241 100644
--- a/components/mus/vm/BUILD.gn
+++ b/components/mus/vm/BUILD.gn
@@ -68,7 +68,6 @@
     "//ui/gfx",
     "//ui/gfx/geometry",
     "//ui/gl:gl",
-    "//ui/gl:test_support",
     "//ui/mojo/events:interfaces",
     "//ui/mojo/geometry:interfaces",
     "//ui/platform_window:platform_impls",
diff --git a/components/mus/vm/view_tree_apptest.cc b/components/mus/vm/view_tree_apptest.cc
index d0ae5b3..14c812a5 100644
--- a/components/mus/vm/view_tree_apptest.cc
+++ b/components/mus/vm/view_tree_apptest.cc
@@ -246,7 +246,7 @@
   // Runs a nested MessageLoop until |count| changes (calls to
   // ViewTreeClient functions) have been received.
   void WaitForChangeCount(size_t count) {
-    if (count == tracker_.changes()->size())
+    if (tracker_.changes()->size() >= count)
       return;
 
     ASSERT_TRUE(wait_state_.get() == nullptr);
@@ -294,7 +294,7 @@
   // TestChangeTracker::Delegate:
   void OnChangeAdded() override {
     if (wait_state_.get() &&
-        wait_state_->change_count == tracker_.changes()->size()) {
+        tracker_.changes()->size() >= wait_state_->change_count) {
       wait_state_->run_loop.Quit();
     }
   }
@@ -354,7 +354,8 @@
   void OnViewInputEvent(Id view_id,
                         EventPtr event,
                         const Callback<void()>& callback) override {
-    tracker()->OnViewInputEvent(view_id, event.Pass());
+    // Don't log input events as none of the tests care about them and they
+    // may come in at random points.
     callback.Run();
   }
   void OnViewSharedPropertyChanged(uint32_t view,
diff --git a/components/nacl/broker/nacl_broker_listener.cc b/components/nacl/broker/nacl_broker_listener.cc
index a9b8c6b..f150049 100644
--- a/components/nacl/broker/nacl_broker_listener.cc
+++ b/components/nacl/broker/nacl_broker_listener.cc
@@ -85,7 +85,7 @@
 
 void NaClBrokerListener::OnChannelError() {
   // The browser died unexpectedly, quit to avoid a zombie process.
-  base::MessageLoop::current()->Quit();
+  base::MessageLoop::current()->QuitWhenIdle();
 }
 
 void NaClBrokerListener::OnLaunchLoaderThroughBroker(
@@ -138,5 +138,5 @@
 }
 
 void NaClBrokerListener::OnStopBroker() {
-  base::MessageLoop::current()->Quit();
+  base::MessageLoop::current()->QuitWhenIdle();
 }
diff --git a/components/nacl/common/nacl_paths.cc b/components/nacl/common/nacl_paths.cc
index f709380..6d486b01 100644
--- a/components/nacl/common/nacl_paths.cc
+++ b/components/nacl/common/nacl_paths.cc
@@ -40,15 +40,6 @@
     case FILE_NACL_HELPER:
       return GetNaClHelperPath(kInternalNaClHelperFileName, result);
     case FILE_NACL_HELPER_NONSFI:
-      if (base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
-              switches::kUseNaClHelperNonSfi) == "false") {
-        // nacl_helper_nonsfi is disabled by the flag. So, use nacl_helper
-        // in Non-SFI mode instead. This is old behavior just in case.
-        // TODO(hidehiko): Remove this code path, when the old feature is
-        // cleaned after nacl_helper_nonsfi is officially launched and
-        // its stability is confirmed.
-        return GetNaClHelperPath(kInternalNaClHelperFileName, result);
-      }
       return GetNaClHelperPath(kInternalNaClHelperNonSfiFileName, result);
     case FILE_NACL_HELPER_BOOTSTRAP:
       return GetNaClHelperPath(kInternalNaClHelperBootstrapFileName, result);
diff --git a/components/nacl/common/nacl_switches.cc b/components/nacl/common/nacl_switches.cc
index 6c5c81c..331e2a5 100644
--- a/components/nacl/common/nacl_switches.cc
+++ b/components/nacl/common/nacl_switches.cc
@@ -52,11 +52,4 @@
 // for SFI mode.
 const char kNaClLoaderProcess[]             = "nacl-loader";
 
-// Use nacl_helper_nonsfi executable (the new, newlib-based version of the
-// Non-SFI runtime) to run Non-SFI nexe, instead of nacl_helper executable
-// (which uses the older, glib-based runtime for Non-SFI mode).
-// TODO(hidehiko): Make this default and then remove this flag after
-// nacl_helper_nonsfi is supported.
-const char kUseNaClHelperNonSfi[]           = "use-nacl-helper-nonsfi";
-
 }  // namespace switches
diff --git a/components/nacl/common/nacl_switches.h b/components/nacl/common/nacl_switches.h
index f6a4b4f..8738946 100644
--- a/components/nacl/common/nacl_switches.h
+++ b/components/nacl/common/nacl_switches.h
@@ -22,7 +22,6 @@
 extern const char kNaClGdb[];
 extern const char kNaClLoaderNonSfiProcess[];
 extern const char kNaClLoaderProcess[];
-extern const char kUseNaClHelperNonSfi[];
 
 }  // namespace switches
 
diff --git a/components/offline_pages/offline_page_metadata_store_impl.cc b/components/offline_pages/offline_page_metadata_store_impl.cc
index b9801f74..0a10d4e 100644
--- a/components/offline_pages/offline_page_metadata_store_impl.cc
+++ b/components/offline_pages/offline_page_metadata_store_impl.cc
@@ -4,6 +4,9 @@
 
 #include "components/offline_pages/offline_page_metadata_store_impl.h"
 
+#include <string>
+#include <vector>
+
 #include "base/bind.h"
 #include "base/files/file_path.h"
 #include "base/location.h"
@@ -22,6 +25,14 @@
 
 using leveldb_proto::ProtoDatabase;
 
+namespace {
+// Statistics are logged to UMA with this string as part of histogram name. They
+// can all be found under LevelDB.*.OfflinePageMetadataStore. Changing this
+// needs to synchronize with histograms.xml, AND will also become incompatible
+// with older browsers still reporting the previous values.
+const char kDatabaseUMAClientName[] = "OfflinePageMetadataStore";
+}
+
 namespace offline_pages {
 namespace {
 
@@ -125,7 +136,7 @@
     scoped_ptr<ProtoDatabase<OfflinePageEntry>> database,
     const base::FilePath& database_dir)
     : database_(database.Pass()), weak_ptr_factory_(this) {
-  database_->Init(database_dir,
+  database_->Init(kDatabaseUMAClientName, database_dir,
                   base::Bind(&OfflinePageMetadataStoreImpl::OnInitDone,
                              weak_ptr_factory_.GetWeakPtr()));
 }
diff --git a/components/omnibox/browser/omnibox_edit_model.cc b/components/omnibox/browser/omnibox_edit_model.cc
index c33278f..2a424b8 100644
--- a/components/omnibox/browser/omnibox_edit_model.cc
+++ b/components/omnibox/browser/omnibox_edit_model.cc
@@ -676,7 +676,7 @@
   AutocompleteResult fake_single_entry_result;
   fake_single_entry_result.AppendMatches(input_, fake_single_entry_matches);
   OmniboxLog log(
-      input_text,
+      input_.from_omnibox_focus() ? base::string16() : input_text,
       just_deleted_text_,
       input_.type(),
       popup_model()->IsOpen(),
diff --git a/components/password_manager/core/browser/password_manager.cc b/components/password_manager/core/browser/password_manager.cc
index d5584986..b609e6f 100644
--- a/components/password_manager/core/browser/password_manager.cc
+++ b/components/password_manager/core/browser/password_manager.cc
@@ -740,7 +740,7 @@
       PreferredRealmIsFromAndroid(fill_data));
   driver->FillPasswordForm(fill_data);
 
-  client_->PasswordWasAutofilled(best_matches);
+  client_->PasswordWasAutofilled(best_matches, form_for_autofill.origin);
 }
 
 void PasswordManager::AutofillHttpAuth(
@@ -758,8 +758,9 @@
 
   FOR_EACH_OBSERVER(LoginModelObserver, observers_,
                     OnAutofillDataAvailable(preferred_match));
-
-  client_->PasswordWasAutofilled(best_matches);
+  DCHECK(!best_matches.empty());
+  client_->PasswordWasAutofilled(best_matches,
+                                 best_matches.begin()->second->origin);
 }
 
 void PasswordManager::ProcessAutofillPredictions(
diff --git a/components/password_manager/core/browser/password_manager_client.cc b/components/password_manager/core/browser/password_manager_client.cc
index d8511550..b3c6436b 100644
--- a/components/password_manager/core/browser/password_manager_client.cc
+++ b/components/password_manager/core/browser/password_manager_client.cc
@@ -22,8 +22,8 @@
 }
 
 void PasswordManagerClient::PasswordWasAutofilled(
-    const autofill::PasswordFormMap& best_matches) const {
-}
+    const autofill::PasswordFormMap& best_matches,
+    const GURL& origin) const {}
 
 void PasswordManagerClient::PasswordAutofillWasBlocked(
     const autofill::PasswordFormMap& best_matches) const {
diff --git a/components/password_manager/core/browser/password_manager_client.h b/components/password_manager/core/browser/password_manager_client.h
index b7cc4b9..a3aae545 100644
--- a/components/password_manager/core/browser/password_manager_client.h
+++ b/components/password_manager/core/browser/password_manager_client.h
@@ -108,10 +108,12 @@
 
   // Called when a password is autofilled. |best_matches| contains the
   // PasswordForm into which a password was filled: the client may choose to
-  // save this to the PasswordStore, for example. Default implementation is a
+  // save this to the PasswordStore, for example. |origin| is the origin of the
+  // form into which a password was filled. Default implementation is a
   // noop.
   virtual void PasswordWasAutofilled(
-      const autofill::PasswordFormMap& best_matches) const;
+      const autofill::PasswordFormMap& best_matches,
+      const GURL& origin) const;
 
   // Called when password autofill is blocked by the blacklist. |best_matches|
   // contains the PasswordForm that flags the current site as being on the
diff --git a/components/password_manager/core/browser/password_store.cc b/components/password_manager/core/browser/password_store.cc
index 82ff912f5..8c5ed6e 100644
--- a/components/password_manager/core/browser/password_store.cc
+++ b/components/password_manager/core/browser/password_store.cc
@@ -14,6 +14,7 @@
 #include "components/password_manager/core/browser/affiliated_match_helper.h"
 #include "components/password_manager/core/browser/password_store_consumer.h"
 #include "components/password_manager/core/browser/password_syncable_service.h"
+#include "url/origin.h"
 
 using autofill::PasswordForm;
 
@@ -108,6 +109,15 @@
   ScheduleTask(base::Bind(&PasswordStore::RemoveLoginInternal, this, form));
 }
 
+void PasswordStore::RemoveLoginsByOriginAndTime(
+    const url::Origin& origin,
+    base::Time delete_begin,
+    base::Time delete_end,
+    const base::Closure& completion) {
+  ScheduleTask(base::Bind(&PasswordStore::RemoveLoginsByOriginAndTimeInternal,
+                          this, origin, delete_begin, delete_end, completion));
+}
+
 void PasswordStore::RemoveLoginsCreatedBetween(
     base::Time delete_begin,
     base::Time delete_end,
@@ -332,6 +342,18 @@
   NotifyLoginsChanged(all_changes);
 }
 
+void PasswordStore::RemoveLoginsByOriginAndTimeInternal(
+    const url::Origin& origin,
+    base::Time delete_begin,
+    base::Time delete_end,
+    const base::Closure& completion) {
+  PasswordStoreChangeList changes =
+      RemoveLoginsByOriginAndTimeImpl(origin, delete_begin, delete_end);
+  NotifyLoginsChanged(changes);
+  if (!completion.is_null())
+    main_thread_runner_->PostTask(FROM_HERE, completion);
+}
+
 void PasswordStore::RemoveLoginsCreatedBetweenInternal(
     base::Time delete_begin,
     base::Time delete_end,
@@ -541,4 +563,16 @@
   syncable_service_.reset();
 }
 
+// No-op implementation of RemoveLoginsByOriginAndTimeImpl to please the
+// compiler on derived classes that have not yet provided an implementation on
+// their own.
+// TODO(ttr314@googlemail.com): Once crbug.com/113973 is done, remove default
+// implementation and mark method as pure virtual.
+PasswordStoreChangeList PasswordStore::RemoveLoginsByOriginAndTimeImpl(
+    const url::Origin& origin,
+    base::Time delete_begin,
+    base::Time delete_end) {
+  return PasswordStoreChangeList();
+}
+
 }  // namespace password_manager
diff --git a/components/password_manager/core/browser/password_store.h b/components/password_manager/core/browser/password_store.h
index b21edb7..c0ef993 100644
--- a/components/password_manager/core/browser/password_store.h
+++ b/components/password_manager/core/browser/password_store.h
@@ -18,6 +18,10 @@
 #include "components/password_manager/core/browser/statistics_table.h"
 #include "sync/api/syncable_service.h"
 
+namespace url {
+class Origin;
+}
+
 namespace autofill {
 struct PasswordForm;
 }
@@ -103,6 +107,15 @@
   // Removes the matching PasswordForm from the secure password store (async).
   virtual void RemoveLogin(const autofill::PasswordForm& form);
 
+  // Remove all logins which are same-origin with the given origin and created
+  // in the given date range. |completion| will be posted to the
+  // |main_thread_runner_| after deletions have been completed and notification
+  // have been sent out.
+  virtual void RemoveLoginsByOriginAndTime(const url::Origin& origin,
+                                           base::Time delete_begin,
+                                           base::Time delete_end,
+                                           const base::Closure& completion);
+
   // Removes all logins created in the given date range. If |completion| is not
   // null, it will be posted to the |main_thread_runner_| after deletions have
   // be completed and notification have been sent out.
@@ -221,6 +234,12 @@
                                  bool custom_passphrase_sync_enabled) = 0;
 
   // Synchronous implementation to remove the given logins.
+  virtual PasswordStoreChangeList RemoveLoginsByOriginAndTimeImpl(
+      const url::Origin& origin,
+      base::Time delete_begin,
+      base::Time delete_end);
+
+  // Synchronous implementation to remove the given logins.
   virtual PasswordStoreChangeList RemoveLoginsCreatedBetweenImpl(
       base::Time delete_begin,
       base::Time delete_end) = 0;
@@ -320,6 +339,10 @@
   void UpdateLoginWithPrimaryKeyInternal(
       const autofill::PasswordForm& new_form,
       const autofill::PasswordForm& old_primary_key);
+  void RemoveLoginsByOriginAndTimeInternal(const url::Origin& origin,
+                                           base::Time delete_begin,
+                                           base::Time delete_end,
+                                           const base::Closure& completion);
   void RemoveLoginsCreatedBetweenInternal(base::Time delete_begin,
                                           base::Time delete_end,
                                           const base::Closure& completion);
diff --git a/components/password_manager/core/browser/password_store_default.cc b/components/password_manager/core/browser/password_store_default.cc
index 95eee906..26599ce 100644
--- a/components/password_manager/core/browser/password_store_default.cc
+++ b/components/password_manager/core/browser/password_store_default.cc
@@ -10,6 +10,7 @@
 #include "base/prefs/pref_service.h"
 #include "base/stl_util.h"
 #include "components/password_manager/core/browser/password_store_change.h"
+#include "url/origin.h"
 
 using autofill::PasswordForm;
 
@@ -80,6 +81,26 @@
   return changes;
 }
 
+PasswordStoreChangeList PasswordStoreDefault::RemoveLoginsByOriginAndTimeImpl(
+    const url::Origin& origin,
+    base::Time delete_begin,
+    base::Time delete_end) {
+  ScopedVector<autofill::PasswordForm> forms;
+  PasswordStoreChangeList changes;
+  if (login_db_ &&
+      login_db_->GetLoginsCreatedBetween(delete_begin, delete_end, &forms)) {
+    for (autofill::PasswordForm* form : forms) {
+      if (origin.IsSameOriginWith(url::Origin(form->origin)) &&
+          login_db_->RemoveLogin(*form))
+        changes.push_back(
+            PasswordStoreChange(PasswordStoreChange::REMOVE, *form));
+    }
+    if (!changes.empty())
+      LogStatsForBulkDeletion(changes.size());
+  }
+  return changes;
+}
+
 PasswordStoreChangeList PasswordStoreDefault::RemoveLoginsCreatedBetweenImpl(
     base::Time delete_begin,
     base::Time delete_end) {
diff --git a/components/password_manager/core/browser/password_store_default.h b/components/password_manager/core/browser/password_store_default.h
index 3218de3..f31be5f 100644
--- a/components/password_manager/core/browser/password_store_default.h
+++ b/components/password_manager/core/browser/password_store_default.h
@@ -46,6 +46,10 @@
       const autofill::PasswordForm& form) override;
   PasswordStoreChangeList RemoveLoginImpl(
       const autofill::PasswordForm& form) override;
+  PasswordStoreChangeList RemoveLoginsByOriginAndTimeImpl(
+      const url::Origin& origin,
+      base::Time delete_begin,
+      base::Time delete_end) override;
   PasswordStoreChangeList RemoveLoginsCreatedBetweenImpl(
       base::Time delete_begin,
       base::Time delete_end) override;
diff --git a/components/password_manager/core/browser/password_store_default_unittest.cc b/components/password_manager/core/browser/password_store_default_unittest.cc
index 8cdf4b9..1d8a899 100644
--- a/components/password_manager/core/browser/password_store_default_unittest.cc
+++ b/components/password_manager/core/browser/password_store_default_unittest.cc
@@ -8,6 +8,7 @@
 #include "base/files/file_util.h"
 #include "base/files/scoped_temp_dir.h"
 #include "base/prefs/pref_service.h"
+#include "base/run_loop.h"
 #include "base/stl_util.h"
 #include "base/strings/string_util.h"
 #include "base/strings/utf_string_conversions.h"
@@ -19,10 +20,13 @@
 #include "components/password_manager/core/browser/password_store_default.h"
 #include "testing/gmock/include/gmock/gmock.h"
 #include "testing/gtest/include/gtest/gtest.h"
+#include "url/origin.h"
 
 using autofill::PasswordForm;
+using testing::ElementsAre;
 using testing::ElementsAreArray;
 using testing::IsEmpty;
+using testing::_;
 
 namespace password_manager {
 
@@ -75,6 +79,22 @@
   return data;
 }
 
+PasswordFormData CreateTestPasswordFormDataByOrigin(const char* origin_url) {
+  PasswordFormData data = {PasswordForm::SCHEME_HTML,
+                           origin_url,
+                           origin_url,
+                           origin_url,
+                           L"submit_element",
+                           L"username_element",
+                           L"password_element",
+                           L"username_value",
+                           L"password_value",
+                           true,
+                           false,
+                           base::Time::Now().ToDoubleT()};
+  return data;
+}
+
 }  // anonymous namespace
 
 class PasswordStoreDefaultTest : public testing::Test {
@@ -83,12 +103,25 @@
     ASSERT_TRUE(temp_dir_.CreateUniqueTempDir());
   }
 
-  void TearDown() override { ASSERT_TRUE(temp_dir_.Delete()); }
+  void TearDown() override {
+    base::MessageLoop::current()->RunUntilIdle();
+    ASSERT_TRUE(temp_dir_.Delete());
+  }
 
   base::FilePath test_login_db_file_path() const {
     return temp_dir_.path().Append(FILE_PATH_LITERAL("login_test"));
   }
 
+  scoped_refptr<PasswordStoreDefault> CreateInitializedStore() {
+    scoped_refptr<PasswordStoreDefault> store(new PasswordStoreDefault(
+        base::ThreadTaskRunnerHandle::Get(),
+        base::ThreadTaskRunnerHandle::Get(),
+        make_scoped_ptr(new LoginDatabase(test_login_db_file_path()))));
+    store->Init(syncer::SyncableService::StartSyncFlare());
+
+    return store;
+  }
+
   base::MessageLoopForUI message_loop_;
   base::ScopedTempDir temp_dir_;
 };
@@ -138,7 +171,6 @@
   base::MessageLoop::current()->RunUntilIdle();
 
   store->Shutdown();
-  base::MessageLoop::current()->RunUntilIdle();
 }
 
 TEST_F(PasswordStoreDefaultTest, Notifications) {
@@ -191,7 +223,6 @@
 
   store->RemoveObserver(&observer);
   store->Shutdown();
-  base::MessageLoop::current()->RunUntilIdle();
 }
 
 // Verify that operations on a PasswordStore with a bad database cause no
@@ -256,7 +287,84 @@
   // Ensure no notifications and no explosions during shutdown either.
   bad_store->RemoveObserver(&mock_observer);
   bad_store->Shutdown();
+}
+
+TEST_F(PasswordStoreDefaultTest,
+       RemoveLoginsByOriginAndTimeImpl_FittingOriginAndTime) {
+  scoped_refptr<PasswordStoreDefault> store = CreateInitializedStore();
+
+  const char origin_url[] = "http://foo.example.com";
+  scoped_ptr<autofill::PasswordForm> form =
+      CreatePasswordFormFromDataForTesting(
+          CreateTestPasswordFormDataByOrigin(origin_url));
+  store->AddLogin(*form);
   base::MessageLoop::current()->RunUntilIdle();
+
+  MockPasswordStoreObserver observer;
+  store->AddObserver(&observer);
+  EXPECT_CALL(observer, OnLoginsChanged(ElementsAre(PasswordStoreChange(
+                            PasswordStoreChange::REMOVE, *form))));
+
+  const url::Origin origin((GURL(origin_url)));
+  base::RunLoop run_loop;
+  store->RemoveLoginsByOriginAndTime(origin, base::Time(), base::Time::Max(),
+                                     run_loop.QuitClosure());
+  run_loop.Run();
+
+  store->RemoveObserver(&observer);
+  store->Shutdown();
+}
+
+TEST_F(PasswordStoreDefaultTest,
+       RemoveLoginsByOriginAndTimeImpl_NonMatchingOrigin) {
+  scoped_refptr<PasswordStoreDefault> store = CreateInitializedStore();
+
+  const char origin_url[] = "http://foo.example.com";
+  scoped_ptr<autofill::PasswordForm> form =
+      CreatePasswordFormFromDataForTesting(
+          CreateTestPasswordFormDataByOrigin(origin_url));
+  store->AddLogin(*form);
+  base::MessageLoop::current()->RunUntilIdle();
+
+  MockPasswordStoreObserver observer;
+  store->AddObserver(&observer);
+  EXPECT_CALL(observer, OnLoginsChanged(_)).Times(0);
+
+  const url::Origin other_origin(GURL("http://bar.example.com"));
+  base::RunLoop run_loop;
+  store->RemoveLoginsByOriginAndTime(other_origin, base::Time(),
+                                     base::Time::Max(), run_loop.QuitClosure());
+  run_loop.Run();
+
+  store->RemoveObserver(&observer);
+  store->Shutdown();
+}
+
+TEST_F(PasswordStoreDefaultTest,
+       RemoveLoginsByOriginAndTimeImpl_NotWithinTimeInterval) {
+  scoped_refptr<PasswordStoreDefault> store = CreateInitializedStore();
+
+  const char origin_url[] = "http://foo.example.com";
+  scoped_ptr<autofill::PasswordForm> form =
+      CreatePasswordFormFromDataForTesting(
+          CreateTestPasswordFormDataByOrigin(origin_url));
+  store->AddLogin(*form);
+  base::MessageLoop::current()->RunUntilIdle();
+
+  MockPasswordStoreObserver observer;
+  store->AddObserver(&observer);
+  EXPECT_CALL(observer, OnLoginsChanged(_)).Times(0);
+
+  const url::Origin origin((GURL(origin_url)));
+  base::Time time_after_creation_date =
+      form->date_created + base::TimeDelta::FromDays(1);
+  base::RunLoop run_loop;
+  store->RemoveLoginsByOriginAndTime(origin, time_after_creation_date,
+                                     base::Time::Max(), run_loop.QuitClosure());
+  run_loop.Run();
+
+  store->RemoveObserver(&observer);
+  store->Shutdown();
 }
 
 }  // namespace password_manager
diff --git a/components/password_manager/core/browser/password_store_unittest.cc b/components/password_manager/core/browser/password_store_unittest.cc
index d94445d9..9f29f1560 100644
--- a/components/password_manager/core/browser/password_store_unittest.cc
+++ b/components/password_manager/core/browser/password_store_unittest.cc
@@ -386,7 +386,7 @@
   EXPECT_CALL(mock_observer, OnLoginsChanged(testing::SizeIs(1u)));
   store->RemoveLoginsCreatedBetween(
       base::Time::FromDoubleT(0), base::Time::FromDoubleT(2),
-      base::MessageLoop::current()->QuitClosure());
+      base::MessageLoop::current()->QuitWhenIdleClosure());
   base::MessageLoop::current()->Run();
   testing::Mock::VerifyAndClearExpectations(&mock_observer);
 
diff --git a/components/scheduler/BUILD.gn b/components/scheduler/BUILD.gn
index 2795fdbf..f8ea25c 100644
--- a/components/scheduler/BUILD.gn
+++ b/components/scheduler/BUILD.gn
@@ -51,6 +51,7 @@
     "renderer/renderer_scheduler_impl_unittest.cc",
     "renderer/task_cost_estimator_unittest.cc",
     "renderer/user_model_unittest.cc",
+    "renderer/web_frame_host_scheduler_impl_unittest.cc",
     "renderer/webthread_impl_for_renderer_scheduler_unittest.cc",
   ]
 
diff --git a/components/scheduler/base/task_queue_manager.cc b/components/scheduler/base/task_queue_manager.cc
index fda6e7e..df22aff 100644
--- a/components/scheduler/base/task_queue_manager.cc
+++ b/components/scheduler/base/task_queue_manager.cc
@@ -275,7 +275,8 @@
   }
   DCHECK(main_thread_checker_.CalledOnValidThread());
 
-  queues_to_delete_.clear();
+  if (!main_task_runner_->IsNested())
+    queues_to_delete_.clear();
 
   // Pass false and nullptr to UpdateWorkQueues here to prevent waking up a
   // pump-after-wakeup queue.
diff --git a/components/scheduler/base/task_queue_manager_perftest.cc b/components/scheduler/base/task_queue_manager_perftest.cc
index 41380baf..66e2e32 100644
--- a/components/scheduler/base/task_queue_manager_perftest.cc
+++ b/components/scheduler/base/task_queue_manager_perftest.cc
@@ -36,7 +36,7 @@
 
   void TestDelayedTask() {
     if (--num_tasks_to_run_ == 0) {
-      message_loop_->Quit();
+      message_loop_->QuitWhenIdle();
     }
 
     num_tasks_in_flight_--;
diff --git a/components/scheduler/base/task_queue_manager_unittest.cc b/components/scheduler/base/task_queue_manager_unittest.cc
index 39972eb8..453c2af 100644
--- a/components/scheduler/base/task_queue_manager_unittest.cc
+++ b/components/scheduler/base/task_queue_manager_unittest.cc
@@ -1320,4 +1320,50 @@
   test_task_runner_->RunUntilIdle();
 }
 
+void HasOneRefTask(std::vector<bool>* log, internal::TaskQueueImpl* tq) {
+  log->push_back(tq->HasOneRef());
+}
+
+TEST_F(TaskQueueManagerTest, UnregisterTaskQueueInNestedLoop) {
+  InitializeWithRealMessageLoop(1u);
+
+  // We retain a reference to the task queue even when the manager has deleted
+  // its reference.
+  scoped_refptr<internal::TaskQueueImpl> task_queue =
+      manager_->NewTaskQueue(TaskQueue::Spec("test_queue"));
+
+  std::vector<bool> log;
+  std::vector<std::pair<base::Closure, bool>> tasks_to_post_from_nested_loop;
+
+  // Inside a nested run loop, call task_queue->UnregisterTaskQueue, bookended
+  // by calls to HasOneRefTask to make sure the manager doesn't release its
+  // reference until the nested run loop exits.
+  // NB: This first HasOneRefTask is a sanity check.
+  tasks_to_post_from_nested_loop.push_back(
+      std::make_pair(base::Bind(&HasOneRefTask, base::Unretained(&log),
+                                base::Unretained(task_queue.get())),
+                     true));
+  tasks_to_post_from_nested_loop.push_back(std::make_pair(
+      base::Bind(&internal::TaskQueueImpl::UnregisterTaskQueue,
+                 base::Unretained(task_queue.get())), true));
+  tasks_to_post_from_nested_loop.push_back(
+      std::make_pair(base::Bind(&HasOneRefTask, base::Unretained(&log),
+                                base::Unretained(task_queue.get())),
+                     true));
+  runners_[0]->PostTask(
+      FROM_HERE,
+      base::Bind(&PostFromNestedRunloop, message_loop_.get(), runners_[0],
+                 base::Unretained(&tasks_to_post_from_nested_loop)));
+  message_loop_->RunUntilIdle();
+
+  // Add a final call to HasOneRefTask.  This gives the manager a chance to
+  // release its reference, and checks that it has.
+  runners_[0]->PostTask(FROM_HERE,
+                        base::Bind(&HasOneRefTask, base::Unretained(&log),
+                                   base::Unretained(task_queue.get())));
+  message_loop_->RunUntilIdle();
+
+  EXPECT_THAT(log, ElementsAre(false, false, true));
+}
+
 }  // namespace scheduler
diff --git a/components/scheduler/child/web_task_runner_impl.cc b/components/scheduler/child/web_task_runner_impl.cc
index 56591ac4..b4794a4c 100644
--- a/components/scheduler/child/web_task_runner_impl.cc
+++ b/components/scheduler/child/web_task_runner_impl.cc
@@ -36,8 +36,4 @@
       base::TimeDelta::FromMillisecondsD(delayMs));
 }
 
-blink::WebTaskRunner* WebTaskRunnerImpl::clone() {
-  return new WebTaskRunnerImpl(task_runner_);
-}
-
 }  // namespace scheduler
diff --git a/components/scheduler/child/web_task_runner_impl.h b/components/scheduler/child/web_task_runner_impl.h
index c9cc55d..73a1e46f 100644
--- a/components/scheduler/child/web_task_runner_impl.h
+++ b/components/scheduler/child/web_task_runner_impl.h
@@ -34,7 +34,6 @@
   void postDelayedTask(const blink::WebTraceLocation& web_location,
                        blink::WebTaskRunner::Task* task,
                        double delayMs) override;
-  blink::WebTaskRunner* clone() override;
 
  private:
   scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
diff --git a/components/scheduler/renderer/web_frame_host_scheduler_impl.cc b/components/scheduler/renderer/web_frame_host_scheduler_impl.cc
index 2b44fdf..a8fad7f 100644
--- a/components/scheduler/renderer/web_frame_host_scheduler_impl.cc
+++ b/components/scheduler/renderer/web_frame_host_scheduler_impl.cc
@@ -14,8 +14,11 @@
     : render_scheduler_(render_scheduler), background_(false) {}
 
 WebFrameHostSchedulerImpl::~WebFrameHostSchedulerImpl() {
-  DCHECK(frame_schedulers_.empty()) << "WebFrameHostSchedulerImpl should "
-                                       "outlive its WebFrameSchedulers";
+  // TODO(alexclarke): Find out why we can't rely on the frame host outliving
+  // the frame.
+  for (WebFrameSchedulerImpl* frame_scheduler : frame_schedulers_) {
+    frame_scheduler->DetachFromFrameHostScheduler();
+  }
 }
 
 void WebFrameHostSchedulerImpl::setPageInBackground(bool background) {
diff --git a/components/scheduler/renderer/web_frame_host_scheduler_impl.h b/components/scheduler/renderer/web_frame_host_scheduler_impl.h
index c23dceb..37432a4 100644
--- a/components/scheduler/renderer/web_frame_host_scheduler_impl.h
+++ b/components/scheduler/renderer/web_frame_host_scheduler_impl.h
@@ -31,9 +31,11 @@
   virtual void setPageInBackground(bool background);
   virtual blink::WebFrameScheduler* createFrameScheduler();
 
+ private:
+  friend class WebFrameSchedulerImpl;
+
   void Unregister(WebFrameSchedulerImpl* frame_scheduler);
 
- private:
   std::set<WebFrameSchedulerImpl*> frame_schedulers_;
   RendererScheduler* render_scheduler_;
   bool background_;
diff --git a/components/scheduler/renderer/web_frame_host_scheduler_impl_unittest.cc b/components/scheduler/renderer/web_frame_host_scheduler_impl_unittest.cc
new file mode 100644
index 0000000..81defdf
--- /dev/null
+++ b/components/scheduler/renderer/web_frame_host_scheduler_impl_unittest.cc
@@ -0,0 +1,61 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "components/scheduler/renderer/web_frame_host_scheduler_impl.h"
+
+#include "base/callback.h"
+#include "base/memory/scoped_ptr.h"
+#include "base/test/simple_test_tick_clock.h"
+#include "cc/test/ordered_simple_task_runner.h"
+#include "components/scheduler/child/scheduler_task_runner_delegate_for_test.h"
+#include "components/scheduler/renderer/renderer_scheduler_impl.h"
+#include "components/scheduler/renderer/web_frame_scheduler_impl.h"
+#include "testing/gtest/include/gtest/gtest.h"
+
+namespace scheduler {
+
+class WebFrameHostSchedulerImplTest : public testing::Test {
+ public:
+  WebFrameHostSchedulerImplTest() {}
+  ~WebFrameHostSchedulerImplTest() override {}
+
+  void SetUp() override {
+    clock_.reset(new base::SimpleTestTickClock());
+    clock_->Advance(base::TimeDelta::FromMicroseconds(5000));
+    mock_task_runner_ = make_scoped_refptr(
+        new cc::OrderedSimpleTaskRunner(clock_.get(), false));
+    main_task_runner_ =
+        SchedulerTaskRunnerDelegateForTest::Create(mock_task_runner_);
+    scheduler_.reset(new RendererSchedulerImpl(main_task_runner_));
+    frame_host_scheduler_.reset(
+        new WebFrameHostSchedulerImpl(scheduler_.get()));
+  }
+
+  void TearDown() override {
+    scheduler_->Shutdown();
+  }
+
+  scoped_ptr<base::SimpleTestTickClock> clock_;
+  scoped_refptr<cc::OrderedSimpleTaskRunner> mock_task_runner_;
+  scoped_refptr<SchedulerTaskRunnerDelegate> main_task_runner_;
+  scoped_ptr<RendererSchedulerImpl> scheduler_;
+  scoped_ptr<WebFrameHostSchedulerImpl> frame_host_scheduler_;
+};
+
+TEST_F(WebFrameHostSchedulerImplTest, TestDestructionOfFrameSchedulersBefore) {
+  scoped_ptr<blink::WebFrameScheduler> frame1(
+      frame_host_scheduler_->createFrameScheduler());
+  scoped_ptr<blink::WebFrameScheduler> frame2(
+      frame_host_scheduler_->createFrameScheduler());
+}
+
+TEST_F(WebFrameHostSchedulerImplTest, TestDestructionOfFrameSchedulersAfter) {
+  scoped_ptr<blink::WebFrameScheduler> frame1(
+      frame_host_scheduler_->createFrameScheduler());
+  scoped_ptr<blink::WebFrameScheduler> frame2(
+      frame_host_scheduler_->createFrameScheduler());
+  frame_host_scheduler_.reset();
+}
+
+}  // namespace scheduler
diff --git a/components/scheduler/renderer/web_frame_scheduler_impl.cc b/components/scheduler/renderer/web_frame_scheduler_impl.cc
index b7bd1a61..4aeff7b6 100644
--- a/components/scheduler/renderer/web_frame_scheduler_impl.cc
+++ b/components/scheduler/renderer/web_frame_scheduler_impl.cc
@@ -25,7 +25,12 @@
   if (timer_task_queue_.get())
     timer_task_queue_->UnregisterTaskQueue();
 
-  parent_frame_host_scheduler_->Unregister(this);
+  if (parent_frame_host_scheduler_)
+    parent_frame_host_scheduler_->Unregister(this);
+}
+
+void WebFrameSchedulerImpl::DetachFromFrameHostScheduler() {
+  parent_frame_host_scheduler_ = nullptr;
 }
 
 void WebFrameSchedulerImpl::setFrameVisible(bool visible) {
diff --git a/components/scheduler/renderer/web_frame_scheduler_impl.h b/components/scheduler/renderer/web_frame_scheduler_impl.h
index 2191cfd..0149715 100644
--- a/components/scheduler/renderer/web_frame_scheduler_impl.h
+++ b/components/scheduler/renderer/web_frame_scheduler_impl.h
@@ -31,12 +31,16 @@
   ~WebFrameSchedulerImpl() override;
 
   // blink::WebFrameScheduler implementation:
-  virtual void setFrameVisible(bool visible);
-  virtual blink::WebTaskRunner* loadingTaskRunner();
-  virtual blink::WebTaskRunner* timerTaskRunner();
-  virtual void setFrameOrigin(const blink::WebSecurityOrigin* origin);
+  void setFrameVisible(bool visible) override;
+  blink::WebTaskRunner* loadingTaskRunner() override;
+  blink::WebTaskRunner* timerTaskRunner() override;
+  void setFrameOrigin(const blink::WebSecurityOrigin* origin) override;
 
  private:
+  friend class WebFrameHostSchedulerImpl;
+
+  void DetachFromFrameHostScheduler();
+
   scoped_refptr<TaskQueue> loading_task_queue_;
   scoped_refptr<TaskQueue> timer_task_queue_;
   scoped_ptr<WebTaskRunnerImpl> loading_web_task_runner_;
diff --git a/components/search_engines/template_url_fetcher_unittest.cc b/components/search_engines/template_url_fetcher_unittest.cc
index 6eb5a43..005deff 100644
--- a/components/search_engines/template_url_fetcher_unittest.cc
+++ b/components/search_engines/template_url_fetcher_unittest.cc
@@ -114,7 +114,7 @@
 void TemplateURLFetcherTest::DestroyedCallback() {
   callbacks_destroyed_++;
   if (waiting_for_download_)
-    base::MessageLoop::current()->Quit();
+    base::MessageLoop::current()->QuitWhenIdle();
 }
 
 void TemplateURLFetcherTest::ConfirmAddSearchProvider(
diff --git a/components/sessions/content/content_live_tab.cc b/components/sessions/content/content_live_tab.cc
index f64c2c7..d660712 100644
--- a/components/sessions/content/content_live_tab.cc
+++ b/components/sessions/content/content_live_tab.cc
@@ -28,8 +28,8 @@
 
 ContentLiveTab::~ContentLiveTab() {}
 
-bool ContentLiveTab::IsInitialNavigation() {
-  return navigation_controller().IsInitialNavigation();
+bool ContentLiveTab::IsInitialBlankNavigation() {
+  return navigation_controller().IsInitialBlankNavigation();
 }
 
 int ContentLiveTab::GetCurrentEntryIndex() {
diff --git a/components/sessions/content/content_live_tab.h b/components/sessions/content/content_live_tab.h
index 1a86b06..14991fdb 100644
--- a/components/sessions/content/content_live_tab.h
+++ b/components/sessions/content/content_live_tab.h
@@ -35,7 +35,7 @@
   static ContentLiveTab* GetForWebContents(content::WebContents* web_contents);
 
   // LiveTab:
-  bool IsInitialNavigation() override;
+  bool IsInitialBlankNavigation() override;
   int GetCurrentEntryIndex() override;
   int GetPendingEntryIndex() override;
   sessions::SerializedNavigationEntry GetEntryAtIndex(int index) override;
diff --git a/components/sessions/core/live_tab.h b/components/sessions/core/live_tab.h
index bf0485e..f6be5e3 100644
--- a/components/sessions/core/live_tab.h
+++ b/components/sessions/core/live_tab.h
@@ -21,7 +21,7 @@
   virtual ~LiveTab();
 
   // Methods that return information about the navigation state of the tab.
-  virtual bool IsInitialNavigation() = 0;
+  virtual bool IsInitialBlankNavigation() = 0;
   virtual int GetCurrentEntryIndex() = 0;
   virtual int GetPendingEntryIndex() = 0;
   virtual SerializedNavigationEntry GetEntryAtIndex(int index) = 0;
diff --git a/components/sessions/core/tab_restore_service_helper.cc b/components/sessions/core/tab_restore_service_helper.cc
index e219686..07651f9 100644
--- a/components/sessions/core/tab_restore_service_helper.cc
+++ b/components/sessions/core/tab_restore_service_helper.cc
@@ -361,7 +361,7 @@
                                           LiveTab* live_tab) {
   const int pending_index = live_tab->GetPendingEntryIndex();
   int entry_count =
-      live_tab->IsInitialNavigation() ? 0 : live_tab->GetEntryCount();
+      live_tab->IsInitialBlankNavigation() ? 0 : live_tab->GetEntryCount();
   if (entry_count == 0 && pending_index == 0)
     entry_count++;
   tab->navigations.resize(static_cast<int>(entry_count));
diff --git a/components/sessions/ios/ios_live_tab.cc b/components/sessions/ios/ios_live_tab.cc
index 717dab7..a6f32a9 100644
--- a/components/sessions/ios/ios_live_tab.cc
+++ b/components/sessions/ios/ios_live_tab.cc
@@ -28,7 +28,7 @@
 
 IOSLiveTab::~IOSLiveTab() {}
 
-bool IOSLiveTab::IsInitialNavigation() {
+bool IOSLiveTab::IsInitialBlankNavigation() {
   return navigation_manager()->GetEntryCount() == 0;
 }
 
diff --git a/components/sessions/ios/ios_live_tab.h b/components/sessions/ios/ios_live_tab.h
index 67dfb33..ced2923 100644
--- a/components/sessions/ios/ios_live_tab.h
+++ b/components/sessions/ios/ios_live_tab.h
@@ -30,7 +30,7 @@
   static IOSLiveTab* GetForWebState(web::WebState* web_state);
 
   // LiveTab:
-  bool IsInitialNavigation() override;
+  bool IsInitialBlankNavigation() override;
   int GetCurrentEntryIndex() override;
   int GetPendingEntryIndex() override;
   sessions::SerializedNavigationEntry GetEntryAtIndex(int index) override;
diff --git a/components/signin.gypi b/components/signin.gypi
index 800859ef..2fda80b 100644
--- a/components/signin.gypi
+++ b/components/signin.gypi
@@ -40,6 +40,7 @@
         'google_core_browser',
         'invalidation_public',
         'keyed_service_core',
+        'metrics',
         'os_crypt',
         'signin_core_common',
         'webdata_common',
@@ -93,10 +94,14 @@
         'signin/core/browser/signin_manager.h',
         'signin/core/browser/signin_manager_base.cc',
         'signin/core/browser/signin_manager_base.h',
-        'signin/core/browser/signin_manager_cookie_helper.cc',
-        'signin/core/browser/signin_manager_cookie_helper.h',
         'signin/core/browser/signin_metrics.cc',
         'signin/core/browser/signin_metrics.h',
+        'signin/core/browser/signin_status_metrics_provider.cc',
+        'signin/core/browser/signin_status_metrics_provider.h',
+        'signin/core/browser/signin_status_metrics_provider_base.cc',
+        'signin/core/browser/signin_status_metrics_provider_base.h',
+        'signin/core/browser/signin_status_metrics_provider_delegate.cc',
+        'signin/core/browser/signin_status_metrics_provider_delegate.h',
         'signin/core/browser/signin_tracker.cc',
         'signin/core/browser/signin_tracker.h',
         'signin/core/browser/webdata/token_service_table.cc',
@@ -117,6 +122,8 @@
         ['chromeos==1', {
           'sources!': [
             'signin/core/browser/signin_manager.cc',
+            'signin/core/browser/signin_status_metrics_provider.cc',
+            'signin/core/browser/signin_status_metrics_provider_delegate.cc',
           ],
         }],
       ],
diff --git a/components/signin/core/browser/BUILD.gn b/components/signin/core/browser/BUILD.gn
index 94098fb..a7a01573 100644
--- a/components/signin/core/browser/BUILD.gn
+++ b/components/signin/core/browser/BUILD.gn
@@ -48,10 +48,14 @@
     "signin_manager.h",
     "signin_manager_base.cc",
     "signin_manager_base.h",
-    "signin_manager_cookie_helper.cc",
-    "signin_manager_cookie_helper.h",
     "signin_metrics.cc",
     "signin_metrics.h",
+    "signin_status_metrics_provider.cc",
+    "signin_status_metrics_provider.h",
+    "signin_status_metrics_provider_base.cc",
+    "signin_status_metrics_provider_base.h",
+    "signin_status_metrics_provider_delegate.cc",
+    "signin_status_metrics_provider_delegate.h",
     "signin_tracker.cc",
     "signin_tracker.h",
     "webdata/token_service_table.cc",
@@ -75,12 +79,17 @@
     "//components/google/core/browser",
     "//components/invalidation/public",
     "//components/keyed_service/core",
+    "//components/metrics",
     "//components/os_crypt",
     "//components/webdata/common",
   ]
 
   if (is_chromeos) {
-    sources -= [ "signin_manager.cc" ]
+    sources -= [
+      "signin_manager.cc",
+      "signin_status_metrics_provider.cc",
+      "signin_status_metrics_provider_delegate.cc",
+    ]
   }
 
   if (is_android) {
@@ -120,6 +129,7 @@
     "gaia_cookie_manager_service_unittest.cc",
     "refresh_token_annotation_request_unittest.cc",
     "signin_error_controller_unittest.cc",
+    "signin_status_metrics_provider_unittest.cc",
     "webdata/token_service_table_unittest.cc",
   ]
 
@@ -127,4 +137,8 @@
     ":test_support",
     "//testing/gmock",
   ]
+
+  if (is_chromeos) {
+    sources -= [ "signin_status_metrics_provider_unittest.cc" ]
+  }
 }
diff --git a/components/signin/core/browser/DEPS b/components/signin/core/browser/DEPS
index 8486a6ba..501594a2 100644
--- a/components/signin/core/browser/DEPS
+++ b/components/signin/core/browser/DEPS
@@ -6,6 +6,7 @@
 }
 include_rules = [
   "+components/invalidation/public",
+  "+components/metrics",
   "+google/cacheinvalidation",
   "+jni",
 ]
diff --git a/components/signin/core/browser/account_tracker_service.cc b/components/signin/core/browser/account_tracker_service.cc
index d9ba735..b57c585 100644
--- a/components/signin/core/browser/account_tracker_service.cc
+++ b/components/signin/core/browser/account_tracker_service.cc
@@ -100,15 +100,17 @@
 }
 
 AccountInfo AccountTrackerService::GetAccountInfo(
-    const std::string& account_id) {
-  if (ContainsKey(accounts_, account_id))
-    return accounts_[account_id].info;
+    const std::string& account_id) const {
+  std::map<std::string, AccountState>::const_iterator it =
+      accounts_.find(account_id);
+  if (it != accounts_.end())
+    return it->second.info;
 
   return AccountInfo();
 }
 
 AccountInfo AccountTrackerService::FindAccountInfoByGaiaId(
-    const std::string& gaia_id) {
+    const std::string& gaia_id) const {
   if (!gaia_id.empty()) {
     for (std::map<std::string, AccountState>::const_iterator it =
              accounts_.begin();
@@ -124,7 +126,7 @@
 }
 
 AccountInfo AccountTrackerService::FindAccountInfoByEmail(
-    const std::string& email) {
+    const std::string& email) const {
   if (!email.empty()) {
     for (std::map<std::string, AccountState>::const_iterator it =
              accounts_.begin();
@@ -140,7 +142,7 @@
 }
 
 AccountTrackerService::AccountIdMigrationState
-AccountTrackerService::GetMigrationState() {
+AccountTrackerService::GetMigrationState() const {
   return GetMigrationState(signin_client_->GetPrefs());
 }
 
@@ -155,7 +157,7 @@
 
 // static
 AccountTrackerService::AccountIdMigrationState
-AccountTrackerService::GetMigrationState(PrefService* pref_service) {
+AccountTrackerService::GetMigrationState(const PrefService* pref_service) {
   return static_cast<AccountTrackerService::AccountIdMigrationState>(
       pref_service->GetInteger(prefs::kAccountIdMigrationState));
 }
@@ -249,7 +251,7 @@
   SaveToPrefs(state);
 }
 
-bool AccountTrackerService::IsMigratable() {
+bool AccountTrackerService::IsMigratable() const {
 #if !defined(OS_CHROMEOS)
   for (std::map<std::string, AccountState>::const_iterator it =
            accounts_.begin();
@@ -434,13 +436,13 @@
 
 std::string AccountTrackerService::PickAccountIdForAccount(
     const std::string& gaia,
-    const std::string& email) {
+    const std::string& email) const {
   return PickAccountIdForAccount(signin_client_->GetPrefs(), gaia, email);
 }
 
 // static
 std::string AccountTrackerService::PickAccountIdForAccount(
-    PrefService* pref_service,
+    const PrefService* pref_service,
     const std::string& gaia,
     const std::string& email) {
   DCHECK(!gaia.empty() ||
diff --git a/components/signin/core/browser/account_tracker_service.h b/components/signin/core/browser/account_tracker_service.h
index 2a05ed2..81baaa8 100644
--- a/components/signin/core/browser/account_tracker_service.h
+++ b/components/signin/core/browser/account_tracker_service.h
@@ -89,15 +89,15 @@
   // Returns the list of known accounts and for which gaia IDs
   // have been fetched.
   std::vector<AccountInfo> GetAccounts() const;
-  AccountInfo GetAccountInfo(const std::string& account_id);
-  AccountInfo FindAccountInfoByGaiaId(const std::string& gaia_id);
-  AccountInfo FindAccountInfoByEmail(const std::string& email);
+  AccountInfo GetAccountInfo(const std::string& account_id) const;
+  AccountInfo FindAccountInfoByGaiaId(const std::string& gaia_id) const;
+  AccountInfo FindAccountInfoByEmail(const std::string& email) const;
 
   // Picks the correct account_id for the specified account depending on the
   // migration state.
   std::string PickAccountIdForAccount(const std::string& gaia,
-                                      const std::string& email);
-  static std::string PickAccountIdForAccount(PrefService* pref_service,
+                                      const std::string& email) const;
+  static std::string PickAccountIdForAccount(const PrefService* pref_service,
                                              const std::string& gaia,
                                              const std::string& email);
 
@@ -110,9 +110,10 @@
 
   void RemoveAccount(const std::string& account_id);
 
-  AccountIdMigrationState GetMigrationState();
+  AccountIdMigrationState GetMigrationState() const;
   void SetMigrationDone();
-  static AccountIdMigrationState GetMigrationState(PrefService* pref_service);
+  static AccountIdMigrationState GetMigrationState(
+      const PrefService* pref_service);
 
  protected:
   // Available to be called in tests.
@@ -141,7 +142,7 @@
   void RemoveFromPrefs(const AccountState& account);
 
   // Gaia id migration.
-  bool IsMigratable();
+  bool IsMigratable() const;
   void MigrateToGaiaId();
   void SetMigrationState(AccountIdMigrationState state);
 
diff --git a/components/signin/core/browser/gaia_cookie_manager_service_unittest.cc b/components/signin/core/browser/gaia_cookie_manager_service_unittest.cc
index 4f602470..78b5c289 100644
--- a/components/signin/core/browser/gaia_cookie_manager_service_unittest.cc
+++ b/components/signin/core/browser/gaia_cookie_manager_service_unittest.cc
@@ -221,7 +221,7 @@
   DCHECK(helper.is_running());
   // Transient error incurs a retry after 1 second.
   base::ThreadTaskRunnerHandle::Get()->PostDelayedTask(
-      FROM_HERE, base::MessageLoop::QuitClosure(),
+      FROM_HERE, base::MessageLoop::QuitWhenIdleClosure(),
       base::TimeDelta::FromMilliseconds(1100));
   base::MessageLoop::current()->Run();
   SimulateMergeSessionSuccess(&helper, "token");
@@ -243,14 +243,14 @@
   DCHECK(helper.is_running());
   // Transient error incurs a retry after 1 second.
   base::ThreadTaskRunnerHandle::Get()->PostDelayedTask(
-      FROM_HERE, base::MessageLoop::QuitClosure(),
+      FROM_HERE, base::MessageLoop::QuitWhenIdleClosure(),
       base::TimeDelta::FromMilliseconds(1100));
   base::MessageLoop::current()->Run();
   SimulateMergeSessionFailure(&helper, canceled());
   DCHECK(helper.is_running());
   // Next transient error incurs a retry after 3 seconds.
   base::ThreadTaskRunnerHandle::Get()->PostDelayedTask(
-      FROM_HERE, base::MessageLoop::QuitClosure(),
+      FROM_HERE, base::MessageLoop::QuitWhenIdleClosure(),
       base::TimeDelta::FromMilliseconds(3100));
   base::MessageLoop::current()->Run();
   SimulateMergeSessionSuccess(&helper, "token");
diff --git a/components/signin/core/browser/signin_manager.cc b/components/signin/core/browser/signin_manager.cc
index f8607771..d939c76 100644
--- a/components/signin/core/browser/signin_manager.cc
+++ b/components/signin/core/browser/signin_manager.cc
@@ -17,7 +17,6 @@
 #include "components/signin/core/browser/gaia_cookie_manager_service.h"
 #include "components/signin/core/browser/signin_client.h"
 #include "components/signin/core/browser/signin_internals_util.h"
-#include "components/signin/core/browser/signin_manager_cookie_helper.h"
 #include "components/signin/core/browser/signin_metrics.h"
 #include "components/signin/core/common/signin_pref_names.h"
 #include "google_apis/gaia/gaia_auth_util.h"
diff --git a/components/signin/core/browser/signin_manager_cookie_helper.cc b/components/signin/core/browser/signin_manager_cookie_helper.cc
deleted file mode 100644
index 846ba67..0000000
--- a/components/signin/core/browser/signin_manager_cookie_helper.cc
+++ /dev/null
@@ -1,73 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "components/signin/core/browser/signin_manager_cookie_helper.h"
-
-#include <vector>
-
-#include "base/location.h"
-#include "base/single_thread_task_runner.h"
-#include "google_apis/gaia/gaia_urls.h"
-#include "net/cookies/cookie_monster.h"
-#include "net/url_request/url_request_context.h"
-
-SigninManagerCookieHelper::SigninManagerCookieHelper(
-    net::URLRequestContextGetter* request_context_getter,
-    scoped_refptr<base::SingleThreadTaskRunner> ui_thread,
-    scoped_refptr<base::SingleThreadTaskRunner> io_thread)
-    : request_context_getter_(request_context_getter),
-      ui_thread_(ui_thread),
-      io_thread_(io_thread) {
-  DCHECK(ui_thread_->BelongsToCurrentThread());
-}
-
-SigninManagerCookieHelper::~SigninManagerCookieHelper() {
-}
-
-void SigninManagerCookieHelper::StartFetchingGaiaCookiesOnUIThread(
-    const base::Callback<void(const net::CookieList& cookies)>& callback) {
-  StartFetchingCookiesOnUIThread(
-      GaiaUrls::GetInstance()->gaia_url(), callback);
-}
-
-void SigninManagerCookieHelper::StartFetchingCookiesOnUIThread(
-    const GURL& url,
-    const base::Callback<void(const net::CookieList& cookies)>& callback) {
-  DCHECK(ui_thread_->BelongsToCurrentThread());
-  DCHECK(!callback.is_null());
-  DCHECK(completion_callback_.is_null());
-
-  completion_callback_ = callback;
-  io_thread_->PostTask(FROM_HERE,
-      base::Bind(&SigninManagerCookieHelper::FetchCookiesOnIOThread,
-                 this,
-                 url));
-}
-
-void SigninManagerCookieHelper::FetchCookiesOnIOThread(const GURL& url) {
-  DCHECK(io_thread_->BelongsToCurrentThread());
-
-  scoped_refptr<net::CookieMonster> cookie_monster =
-      request_context_getter_->GetURLRequestContext()->
-      cookie_store()->GetCookieMonster();
-  if (cookie_monster.get()) {
-    cookie_monster->GetAllCookiesForURLAsync(
-        url, base::Bind(&SigninManagerCookieHelper::OnCookiesFetched, this));
-  } else {
-    OnCookiesFetched(net::CookieList());
-  }
-}
-
-void SigninManagerCookieHelper::OnCookiesFetched(
-    const net::CookieList& cookies) {
-  DCHECK(io_thread_->BelongsToCurrentThread());
-  ui_thread_->PostTask(FROM_HERE,
-      base::Bind(&SigninManagerCookieHelper::NotifyOnUIThread, this, cookies));
-}
-
-void SigninManagerCookieHelper::NotifyOnUIThread(
-    const net::CookieList& cookies) {
-  DCHECK(ui_thread_->BelongsToCurrentThread());
-  base::ResetAndReturn(&completion_callback_).Run(cookies);
-}
diff --git a/components/signin/core/browser/signin_manager_cookie_helper.h b/components/signin/core/browser/signin_manager_cookie_helper.h
deleted file mode 100644
index 14458aa..0000000
--- a/components/signin/core/browser/signin_manager_cookie_helper.h
+++ /dev/null
@@ -1,66 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef COMPONENTS_SIGNIN_CORE_BROWSER_SIGNIN_MANAGER_COOKIE_HELPER_H_
-#define COMPONENTS_SIGNIN_CORE_BROWSER_SIGNIN_MANAGER_COOKIE_HELPER_H_
-
-#include "base/callback_helpers.h"
-#include "base/memory/ref_counted.h"
-#include "net/cookies/canonical_cookie.h"
-#include "net/url_request/url_request_context_getter.h"
-
-namespace base {
-class SingleThreadTaskRunner;
-}
-
-namespace net {
-class URLRequestContextGetter;
-}
-
-// This class fetches GAIA cookie on IO thread on behalf of SigninManager which
-// only lives on the UI thread.
-class SigninManagerCookieHelper
-    : public base::RefCountedThreadSafe<SigninManagerCookieHelper> {
- public:
-  explicit SigninManagerCookieHelper(
-      net::URLRequestContextGetter* request_context_getter,
-      scoped_refptr<base::SingleThreadTaskRunner> ui_thread,
-      scoped_refptr<base::SingleThreadTaskRunner> io_thread);
-
-  // Starts fetching gaia cookies, which will notify its completion via
-  // callback.
-  void StartFetchingGaiaCookiesOnUIThread(
-      const base::Callback<void(const net::CookieList& cookies)>& callback);
-
-  // Starts fetching cookies for the given URL. This must be called on
-  // |ui_thread_|.
-  void StartFetchingCookiesOnUIThread(
-      const GURL& url,
-      const base::Callback<void(const net::CookieList& cookies)>& callback);
-
- private:
-  friend class base::RefCountedThreadSafe<SigninManagerCookieHelper>;
-  ~SigninManagerCookieHelper();
-
-  // Fetch cookies for the given URL. This must be called on |io_thread_|.
-  void FetchCookiesOnIOThread(const GURL& url);
-
-  // Callback for fetching cookies. This must be called on |io_thread_|.
-  void OnCookiesFetched(const net::CookieList& cookies);
-
-  // Notifies the completion callback. This must be called on |ui_thread_|.
-  void NotifyOnUIThread(const net::CookieList& cookies);
-
-  scoped_refptr<net::URLRequestContextGetter> request_context_getter_;
-  // This only mutates on |ui_thread_|.
-  base::Callback<void(const net::CookieList& cookies)> completion_callback_;
-
-  // The task runner that this class uses as its UI thread.
-  scoped_refptr<base::SingleThreadTaskRunner> ui_thread_;
-  // The task runner that this class uses as its IO thread.
-  scoped_refptr<base::SingleThreadTaskRunner> io_thread_;
-  DISALLOW_COPY_AND_ASSIGN(SigninManagerCookieHelper);
-};
-
-#endif  // COMPONENTS_SIGNIN_CORE_BROWSER_SIGNIN_MANAGER_COOKIE_HELPER_H_
diff --git a/components/signin/core/browser/signin_status_metrics_provider.cc b/components/signin/core/browser/signin_status_metrics_provider.cc
new file mode 100644
index 0000000..4d937db
--- /dev/null
+++ b/components/signin/core/browser/signin_status_metrics_provider.cc
@@ -0,0 +1,182 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "components/signin/core/browser/signin_status_metrics_provider.h"
+
+#include "base/bind.h"
+#include "base/location.h"
+#include "base/metrics/histogram.h"
+#include "base/single_thread_task_runner.h"
+#include "base/thread_task_runner_handle.h"
+#include "components/signin/core/browser/signin_manager.h"
+
+namespace {
+
+// The event of calling function ComputeCurrentSigninStatus and the errors
+// occurred during the function execution.
+enum ComputeSigninStatus {
+  ENTERED_COMPUTE_SIGNIN_STATUS,
+  ERROR_NO_PROFILE_FOUND,
+  NO_BROWSER_OPENED,
+  USER_SIGNIN_WHEN_STATUS_UNKNOWN,
+  USER_SIGNOUT_WHEN_STATUS_UNKNOWN,
+  TRY_TO_OVERRIDE_ERROR_STATUS,
+  COMPUTE_SIGNIN_STATUS_MAX,
+};
+
+void RecordComputeSigninStatusHistogram(ComputeSigninStatus status) {
+  UMA_HISTOGRAM_ENUMERATION("UMA.ComputeCurrentSigninStatus", status,
+                            COMPUTE_SIGNIN_STATUS_MAX);
+}
+
+}  // namespace
+
+SigninStatusMetricsProvider::SigninStatusMetricsProvider(
+    scoped_ptr<SigninStatusMetricsProviderDelegate> delegate,
+    bool is_test)
+    : delegate_(delegate.Pass()),
+      scoped_observer_(this),
+      is_test_(is_test),
+      weak_ptr_factory_(this) {
+  DCHECK(delegate_ || is_test_);
+  if (is_test_)
+    return;
+
+  delegate_->SetOwner(this);
+
+  // Postpone the initialization until all threads are created.
+  base::ThreadTaskRunnerHandle::Get()->PostTask(
+      FROM_HERE, base::Bind(&SigninStatusMetricsProvider::Initialize,
+                            weak_ptr_factory_.GetWeakPtr()));
+}
+
+SigninStatusMetricsProvider::~SigninStatusMetricsProvider() {}
+
+void SigninStatusMetricsProvider::ProvideGeneralMetrics(
+    metrics::ChromeUserMetricsExtension* uma_proto) {
+  RecordSigninStatusHistogram(signin_status());
+  // After a histogram value is recorded, a new UMA session will be started, so
+  // we need to re-check the current sign-in status regardless of the previous
+  // recorded |signin_status_| value.
+  ResetSigninStatus();
+  ComputeCurrentSigninStatus();
+}
+
+// static
+SigninStatusMetricsProvider* SigninStatusMetricsProvider::CreateInstance(
+    scoped_ptr<SigninStatusMetricsProviderDelegate> delegate) {
+  return new SigninStatusMetricsProvider(delegate.Pass(), false);
+}
+
+void SigninStatusMetricsProvider::OnSigninManagerCreated(
+    SigninManagerBase* manager) {
+  // Whenever a new profile is created, a new SigninManagerBase will be created
+  // for it. This ensures that all sign-in or sign-out actions of all opened
+  // profiles are being monitored.
+  scoped_observer_.Add(manager);
+
+  // If the status is unknown, it means this is the first created
+  // SigninManagerBase and the corresponding profile should be the only opened
+  // profile.
+  if (signin_status() == UNKNOWN_SIGNIN_STATUS) {
+    size_t signed_in_count = manager->IsAuthenticated() ? 1 : 0;
+    UpdateInitialSigninStatus(1, signed_in_count);
+  }
+}
+
+void SigninStatusMetricsProvider::OnSigninManagerShutdown(
+    SigninManagerBase* manager) {
+  if (scoped_observer_.IsObserving(manager))
+    scoped_observer_.Remove(manager);
+}
+
+void SigninStatusMetricsProvider::GoogleSigninSucceeded(
+    const std::string& account_id,
+    const std::string& username,
+    const std::string& password) {
+  SigninStatus recorded_signin_status = signin_status();
+  if (recorded_signin_status == ALL_PROFILES_NOT_SIGNED_IN) {
+    UpdateSigninStatus(MIXED_SIGNIN_STATUS);
+  } else if (recorded_signin_status == UNKNOWN_SIGNIN_STATUS) {
+    // There should have at least one browser opened if the user can sign in, so
+    // signin_status_ value should not be unknown.
+    UpdateSigninStatus(ERROR_GETTING_SIGNIN_STATUS);
+    RecordComputeSigninStatusHistogram(USER_SIGNIN_WHEN_STATUS_UNKNOWN);
+  }
+}
+
+void SigninStatusMetricsProvider::GoogleSignedOut(const std::string& account_id,
+                                                  const std::string& username) {
+  SigninStatus recorded_signin_status = signin_status();
+  if (recorded_signin_status == ALL_PROFILES_SIGNED_IN) {
+    UpdateSigninStatus(MIXED_SIGNIN_STATUS);
+  } else if (recorded_signin_status == UNKNOWN_SIGNIN_STATUS) {
+    // There should have at least one browser opened if the user can sign out,
+    // so signin_status_ value should not be unknown.
+    UpdateSigninStatus(ERROR_GETTING_SIGNIN_STATUS);
+    RecordComputeSigninStatusHistogram(USER_SIGNOUT_WHEN_STATUS_UNKNOWN);
+  }
+}
+
+void SigninStatusMetricsProvider::Initialize() {
+  delegate_->Initialize();
+
+  // Start observing all already-created SigninManagers.
+  for (SigninManager* manager : delegate_->GetSigninManagersForAllAccounts()) {
+    DCHECK(!scoped_observer_.IsObserving(manager));
+    scoped_observer_.Add(manager);
+  }
+
+  // It is possible that when this object is created, no SigninManager is
+  // created yet, for example, when Chrome is opened for the first time after
+  // installation on desktop, or when Chrome on Android is loaded into memory.
+  if (delegate_->GetStatusOfAllAccounts().num_accounts == 0) {
+    UpdateSigninStatus(UNKNOWN_SIGNIN_STATUS);
+  } else {
+    ComputeCurrentSigninStatus();
+  }
+}
+
+void SigninStatusMetricsProvider::UpdateInitialSigninStatus(
+    size_t total_count,
+    size_t signed_in_profiles_count) {
+  // total_count is known to be bigger than 0.
+  if (signed_in_profiles_count == 0) {
+    UpdateSigninStatus(ALL_PROFILES_NOT_SIGNED_IN);
+  } else if (total_count == signed_in_profiles_count) {
+    UpdateSigninStatus(ALL_PROFILES_SIGNED_IN);
+  } else {
+    UpdateSigninStatus(MIXED_SIGNIN_STATUS);
+  }
+}
+
+void SigninStatusMetricsProvider::ComputeCurrentSigninStatus() {
+  RecordComputeSigninStatusHistogram(ENTERED_COMPUTE_SIGNIN_STATUS);
+
+  AccountsStatus accounts_status = delegate_->GetStatusOfAllAccounts();
+  if (accounts_status.num_accounts == 0) {
+    // This should not happen. If it does, record it in histogram.
+    RecordComputeSigninStatusHistogram(ERROR_NO_PROFILE_FOUND);
+    UpdateSigninStatus(ERROR_GETTING_SIGNIN_STATUS);
+  } else if (accounts_status.num_opened_accounts == 0) {
+    // The code indicates that Chrome is running in the background but no
+    // browser window is opened.
+    RecordComputeSigninStatusHistogram(NO_BROWSER_OPENED);
+    UpdateSigninStatus(UNKNOWN_SIGNIN_STATUS);
+  } else {
+    UpdateInitialSigninStatus(accounts_status.num_opened_accounts,
+                              accounts_status.num_signed_in_accounts);
+  }
+}
+
+void SigninStatusMetricsProvider::UpdateInitialSigninStatusForTesting(
+    size_t total_count,
+    size_t signed_in_profiles_count) {
+  UpdateInitialSigninStatus(total_count, signed_in_profiles_count);
+}
+
+SigninStatusMetricsProvider::SigninStatus
+SigninStatusMetricsProvider::GetSigninStatusForTesting() {
+  return signin_status();
+}
diff --git a/components/signin/core/browser/signin_status_metrics_provider.h b/components/signin/core/browser/signin_status_metrics_provider.h
new file mode 100644
index 0000000..c9665981
--- /dev/null
+++ b/components/signin/core/browser/signin_status_metrics_provider.h
@@ -0,0 +1,102 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef COMPONENTS_SIGNIN_CORE_BROWSER_SIGNIN_STATUS_METRICS_PROVIDER_H_
+#define COMPONENTS_SIGNIN_CORE_BROWSER_SIGNIN_STATUS_METRICS_PROVIDER_H_
+
+#include "base/gtest_prod_util.h"
+#include "base/memory/scoped_ptr.h"
+#include "base/memory/weak_ptr.h"
+#include "base/scoped_observer.h"
+#include "build/build_config.h"
+#include "components/signin/core/browser/signin_manager_base.h"
+#include "components/signin/core/browser/signin_status_metrics_provider_base.h"
+#include "components/signin/core/browser/signin_status_metrics_provider_delegate.h"
+
+namespace metrics {
+class ChromeUserMetricsExtension;
+}
+
+class SigninStatusMetricsProviderDelegate;
+
+// Collect login status of all opened profiles during one UMA session and
+// record the value into a histogram before UMA log is uploaded on platform
+// Windows, Linux, Mac and Android.
+class SigninStatusMetricsProvider : public SigninStatusMetricsProviderBase,
+                                    public SigninManagerBase::Observer {
+ public:
+  ~SigninStatusMetricsProvider() override;
+
+  // SigninStatusMetricsProviderBase:
+  void ProvideGeneralMetrics(
+      metrics::ChromeUserMetricsExtension* uma_proto) override;
+
+  // Factory method, creates a new instance of this class.
+  static SigninStatusMetricsProvider* CreateInstance(
+      scoped_ptr<SigninStatusMetricsProviderDelegate> delegate);
+
+  // Update the sign-in status when a SigninManager is created.
+  void OnSigninManagerCreated(SigninManagerBase* manager);
+
+  // Update the sign-in status when a SigninManager is shut down.
+  void OnSigninManagerShutdown(SigninManagerBase* manager);
+
+  // Updates the initial sign-in status. For testing purpose only.
+  void UpdateInitialSigninStatusForTesting(size_t total_count,
+                                           size_t signed_in_count);
+
+  // Get the current recorded sign-in status. For testing purpose only.
+  SigninStatus GetSigninStatusForTesting();
+
+ private:
+  FRIEND_TEST_ALL_PREFIXES(SigninStatusMetricsProviderTest,
+                           UpdateInitialSigninStatus);
+  FRIEND_TEST_ALL_PREFIXES(SigninStatusMetricsProviderTest,
+                           GoogleSigninSucceeded);
+  FRIEND_TEST_ALL_PREFIXES(SigninStatusMetricsProviderTest, GoogleSignedOut);
+
+  // The boolean |is_test| indicates whether or not this is an instance for
+  // testing purpose. If so, skip the initialization. Except for testing
+  // purpose, this class's instance should be created through the static
+  // CreateInstance() method.
+  SigninStatusMetricsProvider(
+      scoped_ptr<SigninStatusMetricsProviderDelegate> delegate,
+      bool is_test);
+
+  // SigninManagerBase::Observer:
+  void GoogleSigninSucceeded(const std::string& account_id,
+                             const std::string& username,
+                             const std::string& password) override;
+  void GoogleSignedOut(const std::string& account_id,
+                       const std::string& username) override;
+
+  // Obtain sign-in status and add observers.
+  void Initialize();
+
+  // Update the sign-in status based on all currently opened profiles. Called by
+  // ComputeCurrentSigninStatus at class construction and right after each UMA
+  // log upload. |total_count| is the number of opened profiles and
+  // |signed_in_count| represents the number of signed-in profiles among those
+  // |total_count| profiles.
+  void UpdateInitialSigninStatus(size_t total_count, size_t signed_in_count);
+
+  // Compute current sign-in status of all opened profiles.
+  void ComputeCurrentSigninStatus();
+
+  scoped_ptr<SigninStatusMetricsProviderDelegate> delegate_;
+
+  // Used to track the SigninManagers that this instance is observing so that
+  // this instance can be removed as an observer on its destruction.
+  ScopedObserver<SigninManagerBase, SigninManagerBase::Observer>
+      scoped_observer_;
+
+  // Whether the instance is for testing or not.
+  bool is_test_;
+
+  base::WeakPtrFactory<SigninStatusMetricsProvider> weak_ptr_factory_;
+
+  DISALLOW_COPY_AND_ASSIGN(SigninStatusMetricsProvider);
+};
+
+#endif  // COMPONENTS_SIGNIN_CORE_BROWSER_SIGNIN_STATUS_METRICS_PROVIDER_H_
diff --git a/components/signin/core/browser/signin_status_metrics_provider_base.cc b/components/signin/core/browser/signin_status_metrics_provider_base.cc
new file mode 100644
index 0000000..89f0ab5b
--- /dev/null
+++ b/components/signin/core/browser/signin_status_metrics_provider_base.cc
@@ -0,0 +1,31 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "components/signin/core/browser/signin_status_metrics_provider_base.h"
+
+#include "base/metrics/histogram.h"
+
+SigninStatusMetricsProviderBase::SigninStatusMetricsProviderBase()
+    : signin_status_(UNKNOWN_SIGNIN_STATUS) {}
+
+SigninStatusMetricsProviderBase::~SigninStatusMetricsProviderBase() {}
+
+void SigninStatusMetricsProviderBase::RecordSigninStatusHistogram(
+    SigninStatus signin_status) {
+  UMA_HISTOGRAM_ENUMERATION("UMA.ProfileSignInStatus", signin_status,
+                            SIGNIN_STATUS_MAX);
+}
+
+void SigninStatusMetricsProviderBase::UpdateSigninStatus(
+    SigninStatus new_status) {
+  // The recorded sign-in status value can't be changed once it's recorded as
+  // error until the next UMA upload.
+  if (signin_status_ == ERROR_GETTING_SIGNIN_STATUS)
+    return;
+  signin_status_ = new_status;
+}
+
+void SigninStatusMetricsProviderBase::ResetSigninStatus() {
+  signin_status_ = UNKNOWN_SIGNIN_STATUS;
+}
diff --git a/components/signin/core/browser/signin_status_metrics_provider_base.h b/components/signin/core/browser/signin_status_metrics_provider_base.h
new file mode 100644
index 0000000..44f54a2f
--- /dev/null
+++ b/components/signin/core/browser/signin_status_metrics_provider_base.h
@@ -0,0 +1,56 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef COMPONENTS_SIGNIN_CORE_BROWSER_SIGNIN_STATUS_METRICS_PROVIDER_BASE_H_
+#define COMPONENTS_SIGNIN_CORE_BROWSER_SIGNIN_STATUS_METRICS_PROVIDER_BASE_H_
+
+#include "components/metrics/metrics_provider.h"
+
+// The base class for collecting login status of all opened profiles during one
+// UMA session and recording the value into a histogram before UMA log is
+// uploaded. Overriding class SigninStatusMetricsProvider supports platform
+// Window, Linux, Macintosh and Android, and overriding class
+// SigninStatusMetricsProviderChromeOS supports ChromeOS. It is currently not
+// supported on iOS.
+class SigninStatusMetricsProviderBase : public metrics::MetricsProvider {
+ public:
+  SigninStatusMetricsProviderBase();
+  ~SigninStatusMetricsProviderBase() override;
+
+  // Possible sign-in status of all opened profiles during one UMA session. For
+  // MIXED_SIGNIN_STATUS, at least one signed-in profile and at least one
+  // unsigned-in profile were opened between two UMA log uploads. Not every
+  // possibilities can be applied to each platform.
+  enum SigninStatus {
+    ALL_PROFILES_SIGNED_IN,
+    ALL_PROFILES_NOT_SIGNED_IN,
+    MIXED_SIGNIN_STATUS,
+    UNKNOWN_SIGNIN_STATUS,
+    ERROR_GETTING_SIGNIN_STATUS,
+    SIGNIN_STATUS_MAX,
+  };
+
+  // Sets the value of |signin_status_|. It ensures that |signin_status_| will
+  // not be changed if its value is already ERROR_GETTING_SIGNIN_STATUS.
+  void UpdateSigninStatus(SigninStatus new_status);
+
+  SigninStatus signin_status() const { return signin_status_; }
+
+ protected:
+  // Record the sign in status into the proper histogram bucket. This should be
+  // called exactly once for each UMA session.
+  void RecordSigninStatusHistogram(SigninStatus signin_status);
+
+  // Resets the value of |signin_status_| to be UNKNOWN_SIGNIN_STATUS regardless
+  // of its current value;
+  void ResetSigninStatus();
+
+ private:
+  // Sign-in status of all profiles seen so far.
+  SigninStatus signin_status_;
+
+  DISALLOW_COPY_AND_ASSIGN(SigninStatusMetricsProviderBase);
+};
+
+#endif  // COMPONENTS_SIGNIN_CORE_BROWSER_SIGNIN_STATUS_METRICS_PROVIDER_BASE_H_
diff --git a/components/signin/core/browser/signin_status_metrics_provider_delegate.cc b/components/signin/core/browser/signin_status_metrics_provider_delegate.cc
new file mode 100644
index 0000000..be0111a
--- /dev/null
+++ b/components/signin/core/browser/signin_status_metrics_provider_delegate.cc
@@ -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.
+
+#include "components/signin/core/browser/signin_status_metrics_provider_delegate.h"
+
+#include "base/logging.h"
+#include "components/signin/core/browser/signin_status_metrics_provider.h"
+
+AccountsStatus::AccountsStatus()
+    : num_accounts(0), num_opened_accounts(0), num_signed_in_accounts(0) {}
+
+SigninStatusMetricsProviderDelegate::SigninStatusMetricsProviderDelegate()
+    : owner_(nullptr) {}
+
+SigninStatusMetricsProviderDelegate::~SigninStatusMetricsProviderDelegate() {}
+
+void SigninStatusMetricsProviderDelegate::SetOwner(
+    SigninStatusMetricsProvider* owner) {
+  DCHECK(owner);
+  DCHECK(!owner_);
+  owner_ = owner;
+}
diff --git a/components/signin/core/browser/signin_status_metrics_provider_delegate.h b/components/signin/core/browser/signin_status_metrics_provider_delegate.h
new file mode 100644
index 0000000..7aed6858
--- /dev/null
+++ b/components/signin/core/browser/signin_status_metrics_provider_delegate.h
@@ -0,0 +1,57 @@
+// 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 COMPONENTS_SIGNIN_CORE_BROWSER_SIGNIN_STATUS_METRICS_PROVIDER_DELEGATE_H_
+#define COMPONENTS_SIGNIN_CORE_BROWSER_SIGNIN_STATUS_METRICS_PROVIDER_DELEGATE_H_
+
+#include <vector>
+
+#include "base/macros.h"
+#include "build/build_config.h"
+
+class SigninManager;
+class SigninStatusMetricsProvider;
+
+// Provides information relating to the status of accounts in the embedder: how
+// many there are, how many are open, and how many are signed in. Note that
+// "open" is an embedder-defined concept; in some embedders, all accounts are
+// open.
+struct AccountsStatus {
+  AccountsStatus();
+
+  size_t num_accounts;
+  size_t num_opened_accounts;
+  size_t num_signed_in_accounts;
+};
+
+// Delegate for SigninStatusMetricsProvider to abstract dependencies on
+// embedder.
+class SigninStatusMetricsProviderDelegate {
+ public:
+  SigninStatusMetricsProviderDelegate();
+  virtual ~SigninStatusMetricsProviderDelegate();
+
+  // Set the |owner_| field to the owning SigninStatusMetricsProvider.
+  void SetOwner(SigninStatusMetricsProvider* owner);
+
+  // Initializes the instance. SetOwner() must have been called before this
+  // method.
+  virtual void Initialize() = 0;
+
+  // Returns the status of all accounts.
+  virtual AccountsStatus GetStatusOfAllAccounts() = 0;
+
+  // Returns the SigninManager instance (if any) associated with each account.
+  virtual std::vector<SigninManager*> GetSigninManagersForAllAccounts() = 0;
+
+ protected:
+  SigninStatusMetricsProvider* owner() { return owner_; }
+
+ private:
+  SigninStatusMetricsProvider* owner_;
+
+  DISALLOW_COPY_AND_ASSIGN(SigninStatusMetricsProviderDelegate);
+};
+
+#endif  // COMPONENTS_SIGNIN_CORE_BROWSER_SIGNIN_STATUS_METRICS_PROVIDER_DELEGATE_H_
diff --git a/components/signin/core/browser/signin_status_metrics_provider_unittest.cc b/components/signin/core/browser/signin_status_metrics_provider_unittest.cc
new file mode 100644
index 0000000..13f54ab
--- /dev/null
+++ b/components/signin/core/browser/signin_status_metrics_provider_unittest.cc
@@ -0,0 +1,57 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "components/signin/core/browser/signin_status_metrics_provider.h"
+
+#include <string>
+
+#include "testing/gtest/include/gtest/gtest.h"
+
+TEST(SigninStatusMetricsProviderTest, UpdateInitialSigninStatus) {
+  SigninStatusMetricsProvider metrics_provider(nullptr, true);
+
+  metrics_provider.UpdateInitialSigninStatus(2, 2);
+  EXPECT_EQ(SigninStatusMetricsProviderBase::ALL_PROFILES_SIGNED_IN,
+            metrics_provider.GetSigninStatusForTesting());
+  metrics_provider.UpdateInitialSigninStatus(2, 0);
+  EXPECT_EQ(SigninStatusMetricsProviderBase::ALL_PROFILES_NOT_SIGNED_IN,
+            metrics_provider.GetSigninStatusForTesting());
+  metrics_provider.UpdateInitialSigninStatus(2, 1);
+  EXPECT_EQ(SigninStatusMetricsProviderBase::MIXED_SIGNIN_STATUS,
+            metrics_provider.GetSigninStatusForTesting());
+}
+
+TEST(SigninStatusMetricsProviderTest, GoogleSigninSucceeded) {
+  SigninStatusMetricsProvider metrics_provider(nullptr, true);
+
+  // Initial status is all signed out and then one of the profiles is signed in.
+  metrics_provider.UpdateInitialSigninStatus(2, 0);
+  metrics_provider.GoogleSigninSucceeded(std::string(), std::string(),
+                                         std::string());
+  EXPECT_EQ(SigninStatusMetricsProviderBase::MIXED_SIGNIN_STATUS,
+            metrics_provider.GetSigninStatusForTesting());
+
+  // Initial status is mixed and then one of the profiles is signed in.
+  metrics_provider.UpdateInitialSigninStatus(2, 1);
+  metrics_provider.GoogleSigninSucceeded(std::string(), std::string(),
+                                         std::string());
+  EXPECT_EQ(SigninStatusMetricsProviderBase::MIXED_SIGNIN_STATUS,
+            metrics_provider.GetSigninStatusForTesting());
+}
+
+TEST(SigninStatusMetricsProviderTest, GoogleSignedOut) {
+  SigninStatusMetricsProvider metrics_provider(nullptr, true);
+
+  // Initial status is all signed in and then one of the profiles is signed out.
+  metrics_provider.UpdateInitialSigninStatus(2, 2);
+  metrics_provider.GoogleSignedOut(std::string(), std::string());
+  EXPECT_EQ(SigninStatusMetricsProviderBase::MIXED_SIGNIN_STATUS,
+            metrics_provider.GetSigninStatusForTesting());
+
+  // Initial status is mixed and then one of the profiles is signed out.
+  metrics_provider.UpdateInitialSigninStatus(2, 1);
+  metrics_provider.GoogleSignedOut(std::string(), std::string());
+  EXPECT_EQ(SigninStatusMetricsProviderBase::MIXED_SIGNIN_STATUS,
+            metrics_provider.GetSigninStatusForTesting());
+}
diff --git a/components/storage_monitor/media_storage_util_unittest.cc b/components/storage_monitor/media_storage_util_unittest.cc
index 5dab94c..5ee7b9d1 100644
--- a/components/storage_monitor/media_storage_util_unittest.cc
+++ b/components/storage_monitor/media_storage_util_unittest.cc
@@ -71,9 +71,8 @@
   }
 
   static void PostQuitToUIThread() {
-    BrowserThread::PostTask(BrowserThread::UI,
-                            FROM_HERE,
-                            base::MessageLoop::QuitClosure());
+    BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
+                            base::MessageLoop::QuitWhenIdleClosure());
   }
 
   static void WaitForFileThread() {
diff --git a/components/storage_monitor/storage_monitor_chromeos_unittest.cc b/components/storage_monitor/storage_monitor_chromeos_unittest.cc
index 72111be..e2d3df3 100644
--- a/components/storage_monitor/storage_monitor_chromeos_unittest.cc
+++ b/components/storage_monitor/storage_monitor_chromeos_unittest.cc
@@ -245,7 +245,7 @@
 // static
 void StorageMonitorCrosTest::PostQuitToUIThread() {
   BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
-                          base::MessageLoop::QuitClosure());
+                          base::MessageLoop::QuitWhenIdleClosure());
 }
 
 // static
diff --git a/components/storage_monitor/storage_monitor_linux_unittest.cc b/components/storage_monitor/storage_monitor_linux_unittest.cc
index 1a95b199..eee2bd3 100644
--- a/components/storage_monitor/storage_monitor_linux_unittest.cc
+++ b/components/storage_monitor/storage_monitor_linux_unittest.cc
@@ -134,7 +134,7 @@
       const MtabWatcherLinux::MountPointDeviceMap& new_mtab) override {
     StorageMonitorLinux::UpdateMtab(new_mtab);
     base::ThreadTaskRunnerHandle::Get()->PostTask(
-        FROM_HERE, base::MessageLoop::QuitClosure());
+        FROM_HERE, base::MessageLoop::QuitWhenIdleClosure());
   }
 
   DISALLOW_COPY_AND_ASSIGN(TestStorageMonitorLinux);
diff --git a/components/suggestions/image_manager.cc b/components/suggestions/image_manager.cc
index fae4f96..8b50dd39 100644
--- a/components/suggestions/image_manager.cc
+++ b/components/suggestions/image_manager.cc
@@ -14,6 +14,12 @@
 
 namespace {
 
+// Statistics are logged to UMA with this string as part of histogram name. They
+// can all be found under LevelDB.*.ImageManager. Changing this needs to
+// synchronize with histograms.xml, AND will also become incompatible with older
+// browsers still reporting the previous values.
+const char kDatabaseUMAClientName[] = "ImageManager";
+
 scoped_ptr<SkBitmap> DecodeImage(
     scoped_refptr<base::RefCountedMemory> encoded_data) {
   return scoped_ptr<SkBitmap>(suggestions::DecodeJPEGToSkBitmap(
@@ -37,8 +43,9 @@
       database_ready_(false),
       weak_ptr_factory_(this) {
   image_fetcher_->SetImageFetcherDelegate(this);
-  database_->Init(database_dir, base::Bind(&ImageManager::OnDatabaseInit,
-                                           weak_ptr_factory_.GetWeakPtr()));
+  database_->Init(kDatabaseUMAClientName, database_dir,
+                  base::Bind(&ImageManager::OnDatabaseInit,
+                             weak_ptr_factory_.GetWeakPtr()));
 }
 
 ImageManager::~ImageManager() {}
diff --git a/components/sync_sessions.gypi b/components/sync_sessions.gypi
index 78a1f27..e7aed28 100644
--- a/components/sync_sessions.gypi
+++ b/components/sync_sessions.gypi
@@ -14,6 +14,7 @@
       'dependencies': [
         '../base/base.gyp:base',
         '../sync/sync.gyp:sync',
+        'history_core_browser',
         'sync_driver',
       ],
       'sources': [
@@ -26,6 +27,10 @@
         'sync_sessions/revisit/page_visit_observer.h',
         'sync_sessions/revisit/sessions_page_revisit_observer.cc',
         'sync_sessions/revisit/sessions_page_revisit_observer.h',
+        'sync_sessions/revisit/typed_url_page_revisit_observer.cc',
+        'sync_sessions/revisit/typed_url_page_revisit_observer.h',
+        'sync_sessions/revisit/typed_url_page_revisit_task.cc',
+        'sync_sessions/revisit/typed_url_page_revisit_task.h',
       ],
       'conditions': [
         ['OS!="ios"', {
diff --git a/components/sync_sessions/BUILD.gn b/components/sync_sessions/BUILD.gn
index 33db9cfd..59275aa 100644
--- a/components/sync_sessions/BUILD.gn
+++ b/components/sync_sessions/BUILD.gn
@@ -13,10 +13,15 @@
     "revisit/page_visit_observer.h",
     "revisit/sessions_page_revisit_observer.cc",
     "revisit/sessions_page_revisit_observer.h",
+    "revisit/typed_url_page_revisit_observer.cc",
+    "revisit/typed_url_page_revisit_observer.h",
+    "revisit/typed_url_page_revisit_task.cc",
+    "revisit/typed_url_page_revisit_task.h",
   ]
 
   deps = [
     "//base",
+    "//components/history/core/browser",
     "//components/sessions",
     "//components/sync_driver",
     "//sync",
@@ -29,6 +34,7 @@
     "revisit/current_tab_matcher_unittest.cc",
     "revisit/offset_tab_matcher_unittest.cc",
     "revisit/sessions_page_revisit_observer_unittest.cc",
+    "revisit/typed_url_page_revisit_task_unittest.cc",
   ]
 
   deps = [
diff --git a/components/sync_sessions/DEPS b/components/sync_sessions/DEPS
index 50254f9..030230f 100644
--- a/components/sync_sessions/DEPS
+++ b/components/sync_sessions/DEPS
@@ -1,4 +1,5 @@
 include_rules = [
+  "+components/history/core/browser",
   "+components/sessions",
   "+components/sync_driver",
 ]
diff --git a/components/sync_sessions/revisit/current_tab_matcher.cc b/components/sync_sessions/revisit/current_tab_matcher.cc
index a7e4f7a..2f70eb3 100644
--- a/components/sync_sessions/revisit/current_tab_matcher.cc
+++ b/components/sync_sessions/revisit/current_tab_matcher.cc
@@ -35,10 +35,8 @@
     UMA_HISTOGRAM_ENUMERATION("Sync.PageRevisitTabMissTransition", transition,
                               PageVisitObserver::kTransitionTypeLast);
   } else {
-    base::TimeDelta age(base::Time::Now() - most_recent_match_->timestamp);
-    UMA_HISTOGRAM_CUSTOM_TIMES("Sync.PageRevisitTabMatchAge", age,
-                               base::TimeDelta::FromSeconds(1),
-                               base::TimeDelta::FromDays(14), 100);
+    REVISIT_HISTOGRAM_AGE("Sync.PageRevisitTabMatchAge",
+                          most_recent_match_->timestamp);
     UMA_HISTOGRAM_ENUMERATION("Sync.PageRevisitTabMatchTransition", transition,
                               PageVisitObserver::kTransitionTypeLast);
   }
diff --git a/components/sync_sessions/revisit/offset_tab_matcher.cc b/components/sync_sessions/revisit/offset_tab_matcher.cc
index a827a52..7cbb7ec8 100644
--- a/components/sync_sessions/revisit/offset_tab_matcher.cc
+++ b/components/sync_sessions/revisit/offset_tab_matcher.cc
@@ -65,10 +65,8 @@
     // be sure no unexpected data causes problems.
     UMA_HISTOGRAM_SPARSE_SLOWLY("Sync.PageRevisitNavigationMatchOffset",
                                 Clamp(best_offset_, -kMaxOffset, kMaxOffset));
-    UMA_HISTOGRAM_CUSTOM_TIMES("Sync.PageRevisitNavigationMatchAge",
-                               (base::Time::Now() - best_tab_->timestamp),
-                               base::TimeDelta::FromSeconds(1),
-                               base::TimeDelta::FromDays(14), 100);
+    REVISIT_HISTOGRAM_AGE("Sync.PageRevisitNavigationMatchAge",
+                          best_tab_->timestamp);
     UMA_HISTOGRAM_ENUMERATION("Sync.PageRevisitNavigationMatchTransition",
                               transition,
                               PageVisitObserver::kTransitionTypeLast);
diff --git a/components/sync_sessions/revisit/page_visit_observer.h b/components/sync_sessions/revisit/page_visit_observer.h
index 701f9a3..477d724 100644
--- a/components/sync_sessions/revisit/page_visit_observer.h
+++ b/components/sync_sessions/revisit/page_visit_observer.h
@@ -7,12 +7,26 @@
 
 #include <string>
 
+#include "base/metrics/histogram_macros.h"
 #include "base/time/time.h"
 
 class GURL;
 
 namespace sync_sessions {
 
+// The upper bound of 90 days and the bucket count of 100 try to strike a
+// balance. We want multiple single minute digit buckets, but also notice
+// differences that happen many weeks ago. It also helps that typed URLs age out
+// around 90 days, which makes these values even more fitting. These might not
+// handle bookmarks quite as elegantly, but we're less interested in knowing the
+// age of very old objects. This must be defind as a macro instead of a static
+// method because the histogram macro makes an inline static variable that must
+// be unique for separately named histograms.
+#define REVISIT_HISTOGRAM_AGE(name, timestamp)                                \
+  UMA_HISTOGRAM_CUSTOM_COUNTS(name,                                           \
+                              (base::Time::Now() - timestamp).InMinutes(), 1, \
+                              base::TimeDelta::FromDays(90).InMinutes(), 100)
+
 // An interface that allows observers to be notified when a page is visited.
 class PageVisitObserver {
  public:
diff --git a/components/sync_sessions/revisit/typed_url_page_revisit_observer.cc b/components/sync_sessions/revisit/typed_url_page_revisit_observer.cc
new file mode 100644
index 0000000..15918957
--- /dev/null
+++ b/components/sync_sessions/revisit/typed_url_page_revisit_observer.cc
@@ -0,0 +1,30 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "components/sync_sessions/revisit/typed_url_page_revisit_observer.h"
+
+#include "base/memory/scoped_ptr.h"
+#include "components/history/core/browser/history_service.h"
+#include "components/sync_sessions/revisit/typed_url_page_revisit_task.h"
+#include "url/gurl.h"
+
+namespace sync_sessions {
+
+TypedUrlPageRevisitObserver::TypedUrlPageRevisitObserver(
+    history::HistoryService* history)
+    : history_(base::AsWeakPtr(history)) {}
+
+TypedUrlPageRevisitObserver::~TypedUrlPageRevisitObserver() {}
+
+void TypedUrlPageRevisitObserver::OnPageVisit(
+    const GURL& url,
+    const PageVisitObserver::TransitionType transition) {
+  if (history_) {
+    history_->ScheduleDBTask(scoped_ptr<history::HistoryDBTask>(
+                                 new TypedUrlPageRevisitTask(url, transition)),
+                             &task_tracker_);
+  }
+}
+
+}  // namespace sync_sessions
diff --git a/components/sync_sessions/revisit/typed_url_page_revisit_observer.h b/components/sync_sessions/revisit/typed_url_page_revisit_observer.h
new file mode 100644
index 0000000..972a670
--- /dev/null
+++ b/components/sync_sessions/revisit/typed_url_page_revisit_observer.h
@@ -0,0 +1,41 @@
+// 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 COMPONENTS_SYNC_SESSIONS_REVISIT_TYPED_URL_PAGE_REVISIT_OBSERVER_H_
+#define COMPONENTS_SYNC_SESSIONS_REVISIT_TYPED_URL_PAGE_REVISIT_OBSERVER_H_
+
+#include "base/memory/weak_ptr.h"
+#include "base/task/cancelable_task_tracker.h"
+#include "components/sync_sessions/revisit/page_visit_observer.h"
+
+class GURL;
+
+namespace history {
+class HistoryService;
+}  // namespace history
+
+namespace sync_sessions {
+
+// This class's job is to respond to OnPageVisit events and launch a task to
+// the history thread to perform the requisite checks and instrumentation. It is
+// important that this object is created and called on the same thread, since it
+// creates and uses a weak pointer to the HistoryService.
+class TypedUrlPageRevisitObserver : public PageVisitObserver {
+ public:
+  explicit TypedUrlPageRevisitObserver(history::HistoryService* history);
+  ~TypedUrlPageRevisitObserver() override;
+  void OnPageVisit(const GURL& url,
+                   const PageVisitObserver::TransitionType transition) override;
+
+ private:
+  const base::WeakPtr<history::HistoryService> history_;
+  // This is never used to cancel tasks, but required by the history interface.
+  base::CancelableTaskTracker task_tracker_;
+
+  DISALLOW_COPY_AND_ASSIGN(TypedUrlPageRevisitObserver);
+};
+
+}  // namespace sync_sessions
+
+#endif  // COMPONENTS_SYNC_SESSIONS_REVISIT_TYPED_URL_PAGE_REVISIT_OBSERVER_H_
diff --git a/components/sync_sessions/revisit/typed_url_page_revisit_task.cc b/components/sync_sessions/revisit/typed_url_page_revisit_task.cc
new file mode 100644
index 0000000..240cdc3
--- /dev/null
+++ b/components/sync_sessions/revisit/typed_url_page_revisit_task.cc
@@ -0,0 +1,76 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "components/sync_sessions/revisit/typed_url_page_revisit_task.h"
+
+#include "base/metrics/histogram_macros.h"
+#include "base/time/time.h"
+#include "components/history/core/browser/history_backend.h"
+#include "components/history/core/browser/history_service.h"
+#include "components/history/core/browser/url_row.h"
+
+namespace sync_sessions {
+
+TypedUrlPageRevisitTask::TypedUrlPageRevisitTask(
+    const GURL& url,
+    const PageVisitObserver::TransitionType transition)
+    : url_(url), transition_(transition) {}
+
+TypedUrlPageRevisitTask::~TypedUrlPageRevisitTask() {}
+
+bool TypedUrlPageRevisitTask::FillVisitsAndSources(
+    history::HistoryBackend* backend,
+    history::VisitVector* visits,
+    history::VisitSourceMap* sources) {
+  history::URLRow row;
+  return backend->GetURL(url_, &row) &&
+         backend->GetVisitsForURL(row.id(), visits) &&
+         backend->GetVisitsSource(*visits, sources);
+}
+
+bool TypedUrlPageRevisitTask::FindLastSyncedMatchAge(
+    history::HistoryBackend* backend,
+    base::Time* lastVisitTime) {
+  history::VisitVector visits;
+  history::VisitSourceMap sources;
+  if (FillVisitsAndSources(backend, &visits, &sources)) {
+    // The visits are in chronological order. We only care about the most
+    // recent remote visit, so iterate backwards.
+    for (auto row_itr = visits.rbegin(); row_itr != visits.rend(); ++row_itr) {
+      auto map_itr = sources.find(row_itr->visit_id);
+      if (map_itr != sources.end() &&
+          map_itr->second == history::SOURCE_SYNCED) {
+        *lastVisitTime = row_itr->visit_time;
+        return true;
+      }
+    }
+  }
+  return false;
+}
+
+bool TypedUrlPageRevisitTask::RunOnDBThread(history::HistoryBackend* backend,
+                                            history::HistoryDatabase* db) {
+  base::TimeTicks start(base::TimeTicks::Now());
+  base::Time lastVisitTime;
+  if (FindLastSyncedMatchAge(backend, &lastVisitTime)) {
+    REVISIT_HISTOGRAM_AGE("Sync.PageRevisitTypedUrlMatchAge", lastVisitTime);
+    UMA_HISTOGRAM_ENUMERATION("Sync.PageRevisitTypedUrlMatchTransition",
+                              transition_,
+                              PageVisitObserver::kTransitionTypeLast);
+  } else {
+    UMA_HISTOGRAM_ENUMERATION("Sync.PageRevisitTypedUrlMissTransition",
+                              transition_,
+                              PageVisitObserver::kTransitionTypeLast);
+  }
+
+  base::TimeDelta duration(base::TimeTicks::Now() - start);
+  UMA_HISTOGRAM_TIMES("Sync.PageRevisitTypedUrlDuration", duration);
+
+  // This indicates success and retring is not needed.
+  return true;
+}
+
+void TypedUrlPageRevisitTask::DoneRunOnMainThread() {}
+
+}  // namespace sync_sessions
diff --git a/components/sync_sessions/revisit/typed_url_page_revisit_task.h b/components/sync_sessions/revisit/typed_url_page_revisit_task.h
new file mode 100644
index 0000000..2851109f
--- /dev/null
+++ b/components/sync_sessions/revisit/typed_url_page_revisit_task.h
@@ -0,0 +1,62 @@
+// 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 COMPONENTS_SYNC_SESSIONS_REVISIT_TYPED_URL_PAGE_REVISIT_TASK_H_
+#define COMPONENTS_SYNC_SESSIONS_REVISIT_TYPED_URL_PAGE_REVISIT_TASK_H_
+
+#include "base/gtest_prod_util.h"
+#include "components/history/core/browser/history_db_task.h"
+#include "components/history/core/browser/history_types.h"
+#include "components/sync_sessions/revisit/page_visit_observer.h"
+#include "url/gurl.h"
+
+namespace base {
+class Time;
+}  // namespace base
+
+namespace history {
+class HistoryBackend;
+class HistoryDatabase;
+}  // namespace history
+
+namespace sync_sessions {
+
+// This is the actual logic to check if the history database has a foreign,
+// synced, typed URL record for a given page/URL or not. This class implements
+// the HistoryDBTask interface with the assumption that is is being run by the
+// history mechanisms and on the correct thread.
+class TypedUrlPageRevisitTask : public history::HistoryDBTask {
+ public:
+  TypedUrlPageRevisitTask(const GURL& url,
+                          const PageVisitObserver::TransitionType transition);
+  ~TypedUrlPageRevisitTask() override;
+  bool RunOnDBThread(history::HistoryBackend* backend,
+                     history::HistoryDatabase* db) override;
+  void DoneRunOnMainThread() override;
+
+ private:
+  FRIEND_TEST_ALL_PREFIXES(TypedUrlPageRevisitTaskTest, MultipleMatches);
+
+  // Returns if there was a previously synced match. lastVisitTime is an out
+  // parameter. Its value is not read, but will be set if the return value is
+  // true.
+  bool FindLastSyncedMatchAge(history::HistoryBackend* backend,
+                              base::Time* lastVisitTime);
+
+  // Returns if there are visits and sources the instance url value, and
+  // populates the parameters repspectively. Virtual so that unit tests can
+  // override this functionality.
+  virtual bool FillVisitsAndSources(history::HistoryBackend* backend,
+                                    history::VisitVector* visits,
+                                    history::VisitSourceMap* sources);
+
+  const GURL url_;
+  const PageVisitObserver::TransitionType transition_;
+
+  DISALLOW_COPY_AND_ASSIGN(TypedUrlPageRevisitTask);
+};
+
+}  // namespace sync_sessions
+
+#endif  // COMPONENTS_SYNC_SESSIONS_REVISIT_TYPED_URL_PAGE_REVISIT_TASK_H_
diff --git a/components/sync_sessions/revisit/typed_url_page_revisit_task_unittest.cc b/components/sync_sessions/revisit/typed_url_page_revisit_task_unittest.cc
new file mode 100644
index 0000000..d8bf3fa
--- /dev/null
+++ b/components/sync_sessions/revisit/typed_url_page_revisit_task_unittest.cc
@@ -0,0 +1,150 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "components/sync_sessions/revisit/typed_url_page_revisit_task.h"
+
+#include "base/test/histogram_tester.h"
+#include "base/time/time.h"
+#include "components/history/core/browser/history_backend.h"
+#include "components/history/core/browser/history_types.h"
+#include "components/sync_sessions/revisit/page_visit_observer.h"
+#include "testing/gtest/include/gtest/gtest.h"
+#include "url/gurl.h"
+
+namespace sync_sessions {
+
+namespace {
+
+class FakeTask : public TypedUrlPageRevisitTask {
+ public:
+  FakeTask(const PageVisitObserver::TransitionType transition,
+           bool result,
+           const history::VisitVector& visits,
+           const history::VisitSourceMap& sources)
+      : TypedUrlPageRevisitTask(GURL("http://www.example.com"), transition),
+        result_(result),
+        visits_(visits),
+        sources_(sources) {}
+
+  bool FillVisitsAndSources(history::HistoryBackend* backend,
+                            history::VisitVector* visits,
+                            history::VisitSourceMap* sources) override {
+    *visits = visits_;
+    *sources = sources_;
+    return result_;
+  }
+
+ private:
+  const bool result_;
+  const history::VisitVector visits_;
+  const history::VisitSourceMap sources_;
+};
+
+void VerifyMatch(TypedUrlPageRevisitTask* task,
+                 const PageVisitObserver::TransitionType transition) {
+  base::HistogramTester histogram_tester;
+  task->RunOnDBThread(nullptr, nullptr);
+  histogram_tester.ExpectTotalCount("Sync.PageRevisitTypedUrlMatchAge", 1);
+  histogram_tester.ExpectUniqueSample("Sync.PageRevisitTypedUrlMatchTransition",
+                                      PageVisitObserver::kTransitionPage, 1);
+  histogram_tester.ExpectTotalCount("Sync.PageRevisitTypedUrlDuration", 1);
+}
+
+void VerifyMiss(TypedUrlPageRevisitTask* task,
+                const PageVisitObserver::TransitionType transition) {
+  base::HistogramTester histogram_tester;
+  task->RunOnDBThread(nullptr, nullptr);
+  histogram_tester.ExpectUniqueSample("Sync.PageRevisitTypedUrlMissTransition",
+                                      PageVisitObserver::kTransitionPage, 1);
+  histogram_tester.ExpectTotalCount("Sync.PageRevisitTypedUrlDuration", 1);
+}
+
+history::VisitRow Row(history::VisitID id) {
+  history::VisitRow row;
+  row.visit_id = id;
+  return row;
+}
+
+history::VisitRow Row(history::VisitID id, base::Time visit_time) {
+  history::VisitRow row;
+  row.visit_id = id;
+  row.visit_time = visit_time;
+  return row;
+}
+
+}  // namespace
+
+TEST(TypedUrlPageRevisitTaskTest, NoMatchesFillReturnsFalse) {
+  history::VisitVector visits;
+  history::VisitSourceMap sources;
+  FakeTask task(PageVisitObserver::TransitionType::kTransitionPage, false,
+                visits, sources);
+  VerifyMiss(&task, PageVisitObserver::kTransitionPage);
+}
+
+TEST(TypedUrlPageRevisitTaskTest, NoMatchesFillReturnsTrue) {
+  history::VisitVector visits;
+  history::VisitSourceMap sources;
+  FakeTask task(PageVisitObserver::TransitionType::kTransitionPage, true,
+                visits, sources);
+  VerifyMiss(&task, PageVisitObserver::kTransitionPage);
+}
+
+TEST(TypedUrlPageRevisitTaskTest, NoSyncedSources) {
+  history::VisitVector visits;
+  visits.push_back(Row(1));
+  visits.push_back(Row(2));
+  visits.push_back(Row(3));
+  visits.push_back(Row(4));
+  visits.push_back(Row(5));
+  visits.push_back(Row(6));
+  visits.push_back(Row(7));
+
+  history::VisitSourceMap sources;
+  sources[1] = history::SOURCE_BROWSED;
+  sources[2] = history::SOURCE_EXTENSION;
+  sources[3] = history::SOURCE_EXTENSION;
+  sources[4] = history::SOURCE_FIREFOX_IMPORTED;
+  sources[5] = history::SOURCE_IE_IMPORTED;
+  sources[6] = history::SOURCE_SAFARI_IMPORTED;
+  // No source for id 7.
+
+  FakeTask task(PageVisitObserver::TransitionType::kTransitionPage, true,
+                visits, sources);
+  VerifyMiss(&task, PageVisitObserver::kTransitionPage);
+}
+
+TEST(TypedUrlPageRevisitTaskTest, SingleMatch) {
+  history::VisitVector visits;
+  visits.push_back(Row(1));
+
+  history::VisitSourceMap sources;
+  sources[1] = history::SOURCE_SYNCED;
+
+  FakeTask task(PageVisitObserver::TransitionType::kTransitionPage, true,
+                visits, sources);
+  VerifyMatch(&task, PageVisitObserver::kTransitionPage);
+}
+
+TEST(TypedUrlPageRevisitTaskTest, MultipleMatches) {
+  base::Time expected = base::Time::UnixEpoch() + base::TimeDelta::FromDays(1);
+  history::VisitVector visits;
+  visits.push_back(Row(1, base::Time::UnixEpoch()));
+  visits.push_back(Row(2, expected));
+  visits.push_back(
+      Row(3, base::Time::UnixEpoch() + base::TimeDelta::FromDays(2)));
+
+  history::VisitSourceMap sources;
+  sources[1] = history::SOURCE_SYNCED;
+  sources[2] = history::SOURCE_SYNCED;
+  // No source for id 3.
+
+  FakeTask task(PageVisitObserver::TransitionType::kTransitionPage, true,
+                visits, sources);
+  base::Time lastVisitTime;
+  ASSERT_TRUE(task.FindLastSyncedMatchAge(nullptr, &lastVisitTime));
+  ASSERT_EQ(expected, lastVisitTime);
+}
+
+}  // namespace sync_sessions
diff --git a/components/test/data/password_manager/automated_tests/tests.py b/components/test/data/password_manager/automated_tests/tests.py
index ce7a809..e506529 100644
--- a/components/test/data/password_manager/automated_tests/tests.py
+++ b/components/test/data/password_manager/automated_tests/tests.py
@@ -55,6 +55,7 @@
   def Login(self):
     self.GoTo("https://accounts.google.com/ServiceLogin?sacu=1&continue=")
     self.FillUsernameInto("#Email")
+    self.Submit("#Email")
     self.FillPasswordInto("#Passwd")
     self.Submit("#Passwd")
 
diff --git a/components/test_runner/web_test_proxy.cc b/components/test_runner/web_test_proxy.cc
index 1dc3bf2..bc55b0c 100644
--- a/components/test_runner/web_test_proxy.cc
+++ b/components/test_runner/web_test_proxy.cc
@@ -813,6 +813,9 @@
     case blink::WebAXEventChildrenChanged:
       event_name = "ChildrenChanged";
       break;
+    case blink::WebAXEventDocumentSelectionChanged:
+      event_name = "DocumentSelectionChanged";
+      break;
     case blink::WebAXEventFocus:
       event_name = "Focus";
       break;
diff --git a/components/wallpaper/wallpaper_resizer_unittest.cc b/components/wallpaper/wallpaper_resizer_unittest.cc
index 98c314ad5..5a3245a 100644
--- a/components/wallpaper/wallpaper_resizer_unittest.cc
+++ b/components/wallpaper/wallpaper_resizer_unittest.cc
@@ -74,7 +74,7 @@
 
   void WaitForResize() { message_loop_.Run(); }
 
-  void OnWallpaperResized() override { message_loop_.Quit(); }
+  void OnWallpaperResized() override { message_loop_.QuitWhenIdle(); }
 
  private:
   base::MessageLoop message_loop_;
diff --git a/components/wifi/wifi_test.cc b/components/wifi/wifi_test.cc
index 490de32c..31e615b0 100644
--- a/components/wifi/wifi_test.cc
+++ b/components/wifi/wifi_test.cc
@@ -50,7 +50,7 @@
     DCHECK_NE(RESULT_PENDING, result);
     result_ = result;
     if (base::MessageLoop::current())
-      base::MessageLoop::current()->Quit();
+      base::MessageLoop::current()->QuitWhenIdle();
   }
 
   void OnNetworksChanged(
diff --git a/content/browser/BUILD.gn b/content/browser/BUILD.gn
index 9160cc7..5d9e5889 100644
--- a/content/browser/BUILD.gn
+++ b/content/browser/BUILD.gn
@@ -485,6 +485,10 @@
     deps += [ "//third_party/boringssl" ]
   }
 
+  if (enable_mojo_media != "none") {
+    configs += [ "//media/mojo/services:enable_mojo_media_config" ]
+  }
+
   if (enable_mojo_media == "browser") {
     deps += [ "//media/mojo/services:application" ]
   }
diff --git a/content/browser/accessibility/accessibility_ipc_error_browsertest.cc b/content/browser/accessibility/accessibility_ipc_error_browsertest.cc
index 6c47f947..d3b80a4 100644
--- a/content/browser/accessibility/accessibility_ipc_error_browsertest.cc
+++ b/content/browser/accessibility/accessibility_ipc_error_browsertest.cc
@@ -131,8 +131,14 @@
   EXPECT_TRUE(button->data().state >> ui::AX_STATE_FOCUSED & 1);
 }
 
+#if defined(OS_ANDROID)
+// http://crbug.com/542704
+#define MAYBE_MultipleBadAccessibilityIPCsKillsRenderer DISABLED_MultipleBadAccessibilityIPCsKillsRenderer
+#else
+#define MAYBE_MultipleBadAccessibilityIPCsKillsRenderer MultipleBadAccessibilityIPCsKillsRenderer
+#endif
 IN_PROC_BROWSER_TEST_F(AccessibilityIpcErrorBrowserTest,
-                       MultipleBadAccessibilityIPCsKillsRenderer) {
+                       MAYBE_MultipleBadAccessibilityIPCsKillsRenderer) {
   // Create a data url and load it.
   const char url_str[] =
       "data:text/html,"
diff --git a/content/browser/accessibility/browser_accessibility.cc b/content/browser/accessibility/browser_accessibility.cc
index b568e25..00d5f47 100644
--- a/content/browser/accessibility/browser_accessibility.cc
+++ b/content/browser/accessibility/browser_accessibility.cc
@@ -174,9 +174,12 @@
 
 BrowserAccessibility* BrowserAccessibility::InternalGetChild(
     uint32 child_index) const {
-  if (!node_ || !manager_)
-    return NULL;
-  return manager_->GetFromAXNode(node_->ChildAtIndex(child_index));
+  if (!node_ || !manager_ || child_index >= InternalChildCount())
+    return nullptr;
+
+  const auto child_node = node_->ChildAtIndex(child_index);
+  DCHECK(child_node);
+  return manager_->GetFromAXNode(child_node);
 }
 
 BrowserAccessibility* BrowserAccessibility::GetParent() const {
diff --git a/content/browser/accessibility/browser_accessibility_manager.cc b/content/browser/accessibility/browser_accessibility_manager.cc
index b727902..8a5d539 100644
--- a/content/browser/accessibility/browser_accessibility_manager.cc
+++ b/content/browser/accessibility/browser_accessibility_manager.cc
@@ -177,16 +177,18 @@
 }
 
 BrowserAccessibility* BrowserAccessibilityManager::GetFromAXNode(
-    ui::AXNode* node) {
+    const ui::AXNode* node) const {
+  if (!node)
+    return nullptr;
   return GetFromID(node->id());
 }
 
-BrowserAccessibility* BrowserAccessibilityManager::GetFromID(int32 id) {
-  base::hash_map<int32, BrowserAccessibility*>::iterator iter =
-      id_wrapper_map_.find(id);
+BrowserAccessibility* BrowserAccessibilityManager::GetFromID(int32 id) const {
+  const auto iter = id_wrapper_map_.find(id);
   if (iter != id_wrapper_map_.end())
     return iter->second;
-  return NULL;
+
+  return nullptr;
 }
 
 BrowserAccessibility*
@@ -251,6 +253,9 @@
 }
 
 void BrowserAccessibilityManager::GotMouseDown() {
+  if (!focus_)
+    return;
+
   osk_state_ = OSK_ALLOWED_WITHIN_FOCUSED_OBJECT;
   NotifyAccessibilityEvent(ui::AX_EVENT_FOCUS, GetFromAXNode(focus_));
 }
@@ -387,12 +392,13 @@
 BrowserAccessibility* BrowserAccessibilityManager::GetFocus(
     BrowserAccessibility* root) {
   if (!focus_)
-    return NULL;
+    return nullptr;
 
   if (root && !focus_->IsDescendantOf(root->node()))
-    return NULL;
+    return nullptr;
 
   BrowserAccessibility* obj = GetFromAXNode(focus_);
+  DCHECK(obj);
   if (obj->HasIntAttribute(ui::AX_ATTR_CHILD_TREE_ID)) {
     BrowserAccessibilityManager* child_manager =
         BrowserAccessibilityManager::FromID(
@@ -478,7 +484,7 @@
     return node->PlatformGetChild(0);
 
   while (node) {
-    auto sibling = node->GetNextSibling();
+    const auto sibling = node->GetNextSibling();
     if (sibling)
       return sibling;
 
@@ -493,7 +499,7 @@
   if (!node)
     return nullptr;
 
-  auto sibling = node->GetPreviousSibling();
+  const auto sibling = node->GetPreviousSibling();
   if (!sibling)
     return node->GetParent();
 
@@ -523,6 +529,7 @@
 
 void BrowserAccessibilityManager::OnNodeWillBeDeleted(ui::AXTree* tree,
                                                       ui::AXNode* node) {
+  DCHECK(node);
   if (node == focus_ && tree_) {
     if (node != tree_->root())
       SetFocus(tree_->root(), false);
@@ -537,6 +544,7 @@
 
 void BrowserAccessibilityManager::OnSubtreeWillBeDeleted(ui::AXTree* tree,
                                                          ui::AXNode* node) {
+  DCHECK(node);
   BrowserAccessibility* obj = GetFromAXNode(node);
   if (obj)
     obj->OnSubtreeWillBeDeleted();
@@ -552,6 +560,7 @@
 
 void BrowserAccessibilityManager::OnNodeChanged(ui::AXTree* tree,
                                                 ui::AXNode* node) {
+  DCHECK(node);
   GetFromAXNode(node)->OnDataChanged();
 }
 
diff --git a/content/browser/accessibility/browser_accessibility_manager.h b/content/browser/accessibility/browser_accessibility_manager.h
index 87d5dac..669489a 100644
--- a/content/browser/accessibility/browser_accessibility_manager.h
+++ b/content/browser/accessibility/browser_accessibility_manager.h
@@ -138,11 +138,11 @@
   BrowserAccessibility* GetRoot();
 
   // Returns a pointer to the BrowserAccessibility object for a given AXNode.
-  BrowserAccessibility* GetFromAXNode(ui::AXNode* node);
+  BrowserAccessibility* GetFromAXNode(const ui::AXNode* node) const;
 
   // Return a pointer to the object corresponding to the given id,
   // does not make a new reference.
-  BrowserAccessibility* GetFromID(int32 id);
+  BrowserAccessibility* GetFromID(int32 id) const;
 
   // If this tree has a parent tree, return the parent node in that tree.
   BrowserAccessibility* GetParentNodeFromParentTree();
diff --git a/content/browser/accessibility/browser_accessibility_manager_mac.mm b/content/browser/accessibility/browser_accessibility_manager_mac.mm
index 8d57b692..5727262 100644
--- a/content/browser/accessibility/browser_accessibility_manager_mac.mm
+++ b/content/browser/accessibility/browser_accessibility_manager_mac.mm
@@ -97,6 +97,9 @@
     case ui::AX_EVENT_CHILDREN_CHANGED:
       // TODO(dtseng): no clear equivalent on Mac.
       return;
+    case ui::AX_EVENT_DOCUMENT_SELECTION_CHANGED:
+      // Not used on Mac.
+      return;
     case ui::AX_EVENT_FOCUS:
       event_id = NSAccessibilityFocusedUIElementChangedNotification;
       break;
@@ -172,7 +175,10 @@
   for (size_t i = 0; i < changes.size(); ++i) {
     if (changes[i].type != NODE_CREATED && changes[i].type != SUBTREE_CREATED)
       continue;
-    BrowserAccessibility* obj = GetFromAXNode(changes[i].node);
+
+    const ui::AXNode* changed_node = changes[i].node;
+    DCHECK(changed_node);
+    BrowserAccessibility* obj = GetFromAXNode(changed_node);
     if (obj && obj->HasStringAttribute(ui::AX_ATTR_LIVE_STATUS)) {
       created_live_region = true;
       break;
diff --git a/content/browser/accessibility/browser_accessibility_manager_unittest.cc b/content/browser/accessibility/browser_accessibility_manager_unittest.cc
index 8b99fa5f..d721c3ac 100644
--- a/content/browser/accessibility/browser_accessibility_manager_unittest.cc
+++ b/content/browser/accessibility/browser_accessibility_manager_unittest.cc
@@ -935,7 +935,7 @@
             root_accessible->GetLocalBoundsForRange(0, 4).ToString());
 }
 
-TEST(BrowserAccessibilityManagerTest, NextPreviousInTreeOrder) {
+TEST(BrowserAccessibilityManagerTest, TestNextPreviousInTreeOrder) {
   ui::AXNodeData root;
   root.id = 1;
   root.role = ui::AX_ROLE_ROOT_WEB_AREA;
@@ -963,10 +963,17 @@
           new CountedBrowserAccessibilityFactory()));
 
   auto root_accessible = manager->GetRoot();
+  ASSERT_NE(nullptr, root_accessible);
+  ASSERT_EQ(3U, root_accessible->PlatformChildCount());
   auto node2_accessible = root_accessible->PlatformGetChild(0);
+  ASSERT_NE(nullptr, node2_accessible);
   auto node3_accessible = root_accessible->PlatformGetChild(1);
+  ASSERT_NE(nullptr, node3_accessible);
+  ASSERT_EQ(1U, node3_accessible->PlatformChildCount());
   auto node4_accessible = node3_accessible->PlatformGetChild(0);
+  ASSERT_NE(nullptr, node4_accessible);
   auto node5_accessible = root_accessible->PlatformGetChild(2);
+  ASSERT_NE(nullptr, node5_accessible);
 
   EXPECT_EQ(nullptr, manager->NextInTreeOrder(nullptr));
   EXPECT_EQ(node2_accessible, manager->NextInTreeOrder(root_accessible));
@@ -982,7 +989,7 @@
   EXPECT_EQ(root_accessible, manager->PreviousInTreeOrder(node2_accessible));
 }
 
-TEST(BrowserAccessibilityManagerTest, NextPreviousTextOnlyObject) {
+TEST(BrowserAccessibilityManagerTest, TestNextPreviousTextOnlyObject) {
   ui::AXNodeData root;
   root.id = 1;
   root.role = ui::AX_ROLE_ROOT_WEB_AREA;
@@ -1031,14 +1038,26 @@
           new CountedBrowserAccessibilityFactory()));
 
   auto root_accessible = manager->GetRoot();
+  ASSERT_NE(nullptr, root_accessible);
+  ASSERT_EQ(4U, root_accessible->PlatformChildCount());
   auto node2_accessible = root_accessible->PlatformGetChild(0);
+  ASSERT_NE(nullptr, node2_accessible);
   auto text1_accessible = root_accessible->PlatformGetChild(1);
+  ASSERT_NE(nullptr, text1_accessible);
   auto node3_accessible = root_accessible->PlatformGetChild(2);
+  ASSERT_NE(nullptr, node3_accessible);
+  ASSERT_EQ(3U, node3_accessible->PlatformChildCount());
   auto text2_accessible = node3_accessible->PlatformGetChild(0);
+  ASSERT_NE(nullptr, text2_accessible);
   auto node4_accessible = node3_accessible->PlatformGetChild(1);
+  ASSERT_NE(nullptr, node4_accessible);
   auto text3_accessible = node3_accessible->PlatformGetChild(2);
+  ASSERT_NE(nullptr, text3_accessible);
   auto node5_accessible = root_accessible->PlatformGetChild(3);
+  ASSERT_NE(nullptr, node5_accessible);
+  ASSERT_EQ(1U, node5_accessible->PlatformChildCount());
   auto text4_accessible = node5_accessible->PlatformGetChild(0);
+  ASSERT_NE(nullptr, text4_accessible);
 
   EXPECT_EQ(nullptr, manager->NextTextOnlyObject(nullptr));
   EXPECT_EQ(text1_accessible, manager->NextTextOnlyObject(root_accessible));
diff --git a/content/browser/accessibility/browser_accessibility_manager_win.cc b/content/browser/accessibility/browser_accessibility_manager_win.cc
index d28423b70..5098953 100644
--- a/content/browser/accessibility/browser_accessibility_manager_win.cc
+++ b/content/browser/accessibility/browser_accessibility_manager_win.cc
@@ -290,6 +290,7 @@
 
 void BrowserAccessibilityManagerWin::OnNodeCreated(ui::AXTree* tree,
                                                    ui::AXNode* node) {
+  DCHECK(node);
   BrowserAccessibilityManager::OnNodeCreated(tree, node);
   BrowserAccessibility* obj = GetFromAXNode(node);
   if (!obj)
@@ -303,6 +304,7 @@
 
 void BrowserAccessibilityManagerWin::OnNodeWillBeDeleted(ui::AXTree* tree,
                                                          ui::AXNode* node) {
+  DCHECK(node);
   BrowserAccessibilityManager::OnNodeWillBeDeleted(tree, node);
   BrowserAccessibility* obj = GetFromAXNode(node);
   if (!obj)
@@ -337,7 +339,9 @@
   // The first step moves win_attributes_ to old_win_attributes_ and then
   // recomputes all of win_attributes_ other than IAccessibleText.
   for (size_t i = 0; i < changes.size(); ++i) {
-    BrowserAccessibility* obj = GetFromAXNode(changes[i].node);
+    const ui::AXNode* changed_node = changes[i].node;
+    DCHECK(changed_node);
+    BrowserAccessibility* obj = GetFromAXNode(changed_node);
     if (obj && obj->IsNative() && !obj->PlatformIsChildOfLeaf())
       obj->ToBrowserAccessibilityWin()->UpdateStep1ComputeWinAttributes();
   }
@@ -346,7 +350,9 @@
   // concatenation of all of its child text nodes, so it can't run until
   // the text of all of the nodes was computed in the previous step.
   for (size_t i = 0; i < changes.size(); ++i) {
-    BrowserAccessibility* obj = GetFromAXNode(changes[i].node);
+    const ui::AXNode* changed_node = changes[i].node;
+    DCHECK(changed_node);
+    BrowserAccessibility* obj = GetFromAXNode(changed_node);
     if (obj && obj->IsNative() && !obj->PlatformIsChildOfLeaf())
       obj->ToBrowserAccessibilityWin()->UpdateStep2ComputeHypertext();
   }
@@ -360,7 +366,9 @@
   // At the end, it deletes old_win_attributes_ since they're not needed
   // anymore.
   for (size_t i = 0; i < changes.size(); ++i) {
-    BrowserAccessibility* obj = GetFromAXNode(changes[i].node);
+    const ui::AXNode* changed_node = changes[i].node;
+    DCHECK(changed_node);
+    BrowserAccessibility* obj = GetFromAXNode(changed_node);
     if (obj && obj->IsNative() && !obj->PlatformIsChildOfLeaf()) {
       obj->ToBrowserAccessibilityWin()->UpdateStep3FireEvents(
           changes[i].type == AXTreeDelegate::SUBTREE_CREATED);
diff --git a/content/browser/accessibility/browser_accessibility_win.cc b/content/browser/accessibility/browser_accessibility_win.cc
index 71cf9b6..c0a64e0 100644
--- a/content/browser/accessibility/browser_accessibility_win.cc
+++ b/content/browser/accessibility/browser_accessibility_win.cc
@@ -3405,44 +3405,7 @@
     relations_.push_back(relation);
   }
 
-  // Expose slider value.
-  if (ia_role() == ROLE_SYSTEM_PROGRESSBAR ||
-      ia_role() == ROLE_SYSTEM_SCROLLBAR ||
-      ia_role() == ROLE_SYSTEM_SLIDER) {
-    base::string16 value_text = GetValueText();
-    SanitizeStringAttributeForIA2(value_text, &value_text);
-    win_attributes_->ia2_attributes.push_back(L"valuetext:" + value_text);
-  }
-
-  // Expose dropeffect attribute.
-  base::string16 drop_effect;
-  if (GetHtmlAttribute("aria-dropeffect", &drop_effect)) {
-    SanitizeStringAttributeForIA2(drop_effect, &drop_effect);
-    win_attributes_->ia2_attributes.push_back(L"dropeffect:" + drop_effect);
-  }
-
-  // Expose grabbed attribute.
-  base::string16 grabbed;
-  if (GetHtmlAttribute("aria-grabbed", &grabbed)) {
-    SanitizeStringAttributeForIA2(grabbed, &grabbed);
-    win_attributes_->ia2_attributes.push_back(L"grabbed:" + grabbed);
-  }
-
-  // Expose datetime attribute.
-  base::string16 datetime;
-  if (GetRole() == ui::AX_ROLE_TIME &&
-      GetHtmlAttribute("datetime", &datetime)) {
-    SanitizeStringAttributeForIA2(datetime, &datetime);
-    win_attributes_->ia2_attributes.push_back(L"datetime:" + datetime);
-  }
-
-  // Expose input-text type attribute.
-  base::string16 type;
-  if (GetRole() == ui::AX_ROLE_TEXT_FIELD && GetHtmlAttribute("type", &type)) {
-    SanitizeStringAttributeForIA2(type, &type);
-    win_attributes_->ia2_attributes.push_back(L"text-input-type:" + type);
-  }
-
+  UpdateRequiredAttributes();
   // If this is a web area for a presentational iframe, give it a role of
   // something other than DOCUMENT so that the fact that it's a separate doc
   // is not exposed to AT.
@@ -4099,6 +4062,69 @@
   return false;
 }
 
+void BrowserAccessibilityWin::UpdateRequiredAttributes() {
+  // Expose slider value.
+  if (ia_role() == ROLE_SYSTEM_PROGRESSBAR ||
+      ia_role() == ROLE_SYSTEM_SCROLLBAR ||
+      ia_role() == ROLE_SYSTEM_SLIDER) {
+    base::string16 value_text = GetValueText();
+    SanitizeStringAttributeForIA2(value_text, &value_text);
+    win_attributes_->ia2_attributes.push_back(L"valuetext:" + value_text);
+  }
+
+  // Expose dropeffect attribute.
+  base::string16 drop_effect;
+  if (GetHtmlAttribute("aria-dropeffect", &drop_effect)) {
+    SanitizeStringAttributeForIA2(drop_effect, &drop_effect);
+    win_attributes_->ia2_attributes.push_back(L"dropeffect:" + drop_effect);
+  }
+
+  // Expose grabbed attribute.
+  base::string16 grabbed;
+  if (GetHtmlAttribute("aria-grabbed", &grabbed)) {
+    SanitizeStringAttributeForIA2(grabbed, &grabbed);
+    win_attributes_->ia2_attributes.push_back(L"grabbed:" + grabbed);
+  }
+
+  // Expose class attribute.
+  base::string16 class_attr;
+  if (GetHtmlAttribute("class", &class_attr)) {
+    SanitizeStringAttributeForIA2(class_attr, &class_attr);
+    win_attributes_->ia2_attributes.push_back(L"class:" + class_attr);
+  }
+
+  // Expose datetime attribute.
+  base::string16 datetime;
+  if (GetRole() == ui::AX_ROLE_TIME &&
+      GetHtmlAttribute("datetime", &datetime)) {
+    SanitizeStringAttributeForIA2(datetime, &datetime);
+    win_attributes_->ia2_attributes.push_back(L"datetime:" + datetime);
+  }
+
+  // Expose id attribute.
+  base::string16 id;
+  if (GetHtmlAttribute("id", &id)) {
+    SanitizeStringAttributeForIA2(id, &id);
+    win_attributes_->ia2_attributes.push_back(L"id:" + id);
+  }
+
+  // Expose src attribute.
+  base::string16 src;
+  if (GetRole() == ui::AX_ROLE_IMAGE && GetHtmlAttribute("src", &src)) {
+    SanitizeStringAttributeForIA2(src, &src);
+    win_attributes_->ia2_attributes.push_back(L"src:" + src);
+  }
+
+  // Expose input-text type attribute.
+  base::string16 type;
+  base::string16 html_tag = GetString16Attribute(ui::AX_ATTR_HTML_TAG);
+  if (GetRole() == ui::AX_ROLE_TEXT_FIELD && html_tag == L"input" &&
+      GetHtmlAttribute("type", &type)) {
+    SanitizeStringAttributeForIA2(type, &type);
+    win_attributes_->ia2_attributes.push_back(L"text-input-type:" + type);
+  }
+}
+
 void BrowserAccessibilityWin::InitRoleAndState() {
   int32 ia_role = 0;
   int32 ia_state = 0;
diff --git a/content/browser/accessibility/browser_accessibility_win.h b/content/browser/accessibility/browser_accessibility_win.h
index 0cb77443..8d2971b 100644
--- a/content/browser/accessibility/browser_accessibility_win.h
+++ b/content/browser/accessibility/browser_accessibility_win.h
@@ -848,6 +848,9 @@
   // or a menu list option with a parent of type menu list popup.
   bool IsListBoxOptionOrMenuListOption();
 
+  // Updates object attributes of IA2 with html attributes.
+  void UpdateRequiredAttributes();
+
   // Windows-specific unique ID (unique within the browser process),
   // used for get_accChild, NotifyWinEvent, and as the unique ID for
   // IAccessible2 and ISimpleDOM.
diff --git a/content/browser/accessibility/browser_accessibility_win_unittest.cc b/content/browser/accessibility/browser_accessibility_win_unittest.cc
index 77d0cfc..7b4fbcd 100644
--- a/content/browser/accessibility/browser_accessibility_win_unittest.cc
+++ b/content/browser/accessibility/browser_accessibility_win_unittest.cc
@@ -395,7 +395,7 @@
   BrowserAccessibilityWin* root_obj =
       manager->GetRoot()->ToBrowserAccessibilityWin();
   ASSERT_NE(nullptr, root_obj);
-  ASSERT_EQ(1, root_obj->PlatformChildCount());
+  ASSERT_EQ(1U, root_obj->PlatformChildCount());
 
   BrowserAccessibilityWin* text_field_obj =
       root_obj->PlatformGetChild(0)->ToBrowserAccessibilityWin();
@@ -801,7 +801,7 @@
   BrowserAccessibilityWin* root_accessible =
       manager->GetRoot()->ToBrowserAccessibilityWin();
       ASSERT_NE(nullptr, root_accessible);
-      ASSERT_EQ(2, root_accessible->PlatformChildCount());
+      ASSERT_EQ(2U, root_accessible->PlatformChildCount());
 
       BrowserAccessibilityWin* pseudo_accessible =
           root_accessible->PlatformGetChild(0)->ToBrowserAccessibilityWin();
@@ -873,7 +873,7 @@
   BrowserAccessibilityWin* root_accessible =
       manager->GetRoot()->ToBrowserAccessibilityWin();
       ASSERT_NE(nullptr, root_accessible);
-  ASSERT_EQ(2, root_accessible->PlatformChildCount());
+      ASSERT_EQ(2U, root_accessible->PlatformChildCount());
 
   BrowserAccessibilityWin* combo_box_accessible =
       root_accessible->PlatformGetChild(0)->ToBrowserAccessibilityWin();
@@ -991,12 +991,12 @@
   BrowserAccessibilityWin* root_accessible =
       manager->GetRoot()->ToBrowserAccessibilityWin();
       ASSERT_NE(nullptr, root_accessible);
-  ASSERT_EQ(1, root_accessible->PlatformChildCount());
+      ASSERT_EQ(1U, root_accessible->PlatformChildCount());
 
   BrowserAccessibilityWin* div_editable_accessible =
       root_accessible->PlatformGetChild(0)->ToBrowserAccessibilityWin();
   ASSERT_NE(nullptr, div_editable_accessible);
-  ASSERT_EQ(2, div_editable_accessible->PlatformChildCount());
+  ASSERT_EQ(2U, div_editable_accessible->PlatformChildCount());
 
   // -2 is never a valid offset.
   LONG caret_offset = -2;
@@ -1024,7 +1024,7 @@
   BrowserAccessibilityWin* link_accessible =
       div_editable_accessible->PlatformGetChild(1)->ToBrowserAccessibilityWin();
   ASSERT_NE(nullptr, link_accessible);
-  ASSERT_EQ(1, link_accessible->PlatformChildCount());
+  ASSERT_EQ(1U, link_accessible->PlatformChildCount());
 
   BrowserAccessibilityWin* link_text_accessible =
       link_accessible->PlatformGetChild(0)->ToBrowserAccessibilityWin();
@@ -1106,12 +1106,12 @@
   BrowserAccessibilityWin* root_accessible =
       manager->GetRoot()->ToBrowserAccessibilityWin();
       ASSERT_NE(nullptr, root_accessible);
-  ASSERT_EQ(1, root_accessible->PlatformChildCount());
+      ASSERT_EQ(1U, root_accessible->PlatformChildCount());
 
   BrowserAccessibilityWin* div_editable_accessible =
       root_accessible->PlatformGetChild(0)->ToBrowserAccessibilityWin();
   ASSERT_NE(nullptr, div_editable_accessible);
-  ASSERT_EQ(2, div_editable_accessible->PlatformChildCount());
+  ASSERT_EQ(2U, div_editable_accessible->PlatformChildCount());
 
   // -2 is never a valid offset.
   LONG caret_offset = -2;
@@ -1125,7 +1125,7 @@
   BrowserAccessibilityWin* link_accessible =
       div_editable_accessible->PlatformGetChild(1)->ToBrowserAccessibilityWin();
   ASSERT_NE(nullptr, link_accessible);
-  ASSERT_EQ(1, link_accessible->PlatformChildCount());
+  ASSERT_EQ(1U, link_accessible->PlatformChildCount());
 
   BrowserAccessibilityWin* link_text_accessible =
       link_accessible->PlatformGetChild(0)->ToBrowserAccessibilityWin();
@@ -1233,12 +1233,12 @@
 
   auto root_accessible = manager->GetRoot();
   ASSERT_NE(nullptr, root_accessible);
-  ASSERT_EQ(2, root_accessible->PlatformChildCount());
+  ASSERT_EQ(2U, root_accessible->PlatformChildCount());
   auto child1_accessible = root_accessible->PlatformGetChild(0);
   ASSERT_NE(nullptr, child1_accessible);
   auto child2_accessible = root_accessible->PlatformGetChild(1);
   ASSERT_NE(nullptr, child2_accessible);
-  ASSERT_EQ(2, child2_accessible->PlatformChildCount());
+  ASSERT_EQ(2U, child2_accessible->PlatformChildCount());
   auto child2_child1_accessible = child2_accessible->PlatformGetChild(0);
   ASSERT_NE(nullptr, child2_child1_accessible);
   auto child2_child2_accessible = child2_accessible->PlatformGetChild(1);
diff --git a/content/browser/accessibility/dump_accessibility_tree_browsertest.cc b/content/browser/accessibility/dump_accessibility_tree_browsertest.cc
index e4d8840..36f8e4a 100644
--- a/content/browser/accessibility/dump_accessibility_tree_browsertest.cc
+++ b/content/browser/accessibility/dump_accessibility_tree_browsertest.cc
@@ -719,6 +719,11 @@
   RunHtmlTest(FILE_PATH_LITERAL("contenteditable-descendants.html"));
 }
 
+IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest,
+                       AccessibilityElementClassIdSrcAttr) {
+  RunHtmlTest(FILE_PATH_LITERAL("element-class-id-src-attr.html"));
+}
+
 #if defined(OS_ANDROID)
 // Flaky failures: http://crbug.com/445929.
 #define MAYBE_AccessibilityContenteditableDescendantsWithSelection \
diff --git a/content/browser/android/in_process/synchronous_compositor_factory_impl.cc b/content/browser/android/in_process/synchronous_compositor_factory_impl.cc
index bb73d12..ec0c3f0 100644
--- a/content/browser/android/in_process/synchronous_compositor_factory_impl.cc
+++ b/content/browser/android/in_process/synchronous_compositor_factory_impl.cc
@@ -81,24 +81,6 @@
   return holder;
 }
 
-scoped_ptr<WebGraphicsContext3DCommandBufferImpl> CreateContext3D(
-    int surface_id,
-    const blink::WebGraphicsContext3D::Attributes& attributes,
-    const content::WebGraphicsContext3DCommandBufferImpl::SharedMemoryLimits&
-        mem_limits) {
-  DCHECK(RenderThreadImpl::current());
-  CauseForGpuLaunch cause =
-      CAUSE_FOR_GPU_LAUNCH_WEBGRAPHICSCONTEXT3DCOMMANDBUFFERIMPL_INITIALIZE;
-  scoped_refptr<GpuChannelHost> gpu_channel_host(
-      RenderThreadImpl::current()->EstablishGpuChannelSync(cause));
-  CHECK(gpu_channel_host.get());
-
-  bool lose_context_when_out_of_memory = true;
-  return make_scoped_ptr(new WebGraphicsContext3DCommandBufferImpl(
-      surface_id, GURL(), gpu_channel_host.get(), attributes,
-      lose_context_when_out_of_memory, mem_limits, NULL));
-}
-
 }  // namespace
 
 class SynchronousCompositorFactoryImpl::VideoContextProvider
@@ -165,11 +147,9 @@
 scoped_ptr<cc::OutputSurface>
 SynchronousCompositorFactoryImpl::CreateOutputSurface(
     int routing_id,
-    scoped_refptr<content::FrameSwapMessageQueue> frame_swap_message_queue) {
-  scoped_refptr<cc::ContextProvider> onscreen_context =
-      CreateContextProviderForCompositor(0, RENDER_COMPOSITOR_CONTEXT);
-  scoped_refptr<cc::ContextProvider> worker_context =
-      GetSharedWorkerContextProvider();
+    const scoped_refptr<FrameSwapMessageQueue>& frame_swap_message_queue,
+    const scoped_refptr<cc::ContextProvider>& onscreen_context,
+    const scoped_refptr<cc::ContextProvider>& worker_context) {
   return make_scoped_ptr(new SynchronousCompositorOutputSurface(
       onscreen_context, worker_context, routing_id,
       SynchronousCompositorRegistryInProc::GetInstance(),
@@ -188,60 +168,6 @@
       routing_id, SynchronousCompositorRegistryInProc::GetInstance()));
 }
 
-scoped_refptr<cc::ContextProvider>
-SynchronousCompositorFactoryImpl::CreateContextProviderForCompositor(
-    int surface_id,
-    CommandBufferContextType type) {
-  // This is half of what RenderWidget uses because synchronous compositor
-  // pipeline is only one frame deep. But twice of half for low end here
-  // because 16bit texture is not supported.
-  // TODO(reveman): This limit is based on the usage required by async
-  // uploads. Determine what a good limit is now that async uploads are
-  // no longer used.
-  unsigned int mapped_memory_reclaim_limit =
-      (base::SysInfo::IsLowEndDevice() ? 2 : 6) * 1024 * 1024;
-  blink::WebGraphicsContext3D::Attributes attributes = GetDefaultAttribs();
-
-  WebGraphicsContext3DCommandBufferImpl::SharedMemoryLimits mem_limits;
-  mem_limits.mapped_memory_reclaim_limit = mapped_memory_reclaim_limit;
-  scoped_ptr<WebGraphicsContext3DCommandBufferImpl> context =
-      CreateContext3D(surface_id, GetDefaultAttribs(), mem_limits);
-  return ContextProviderCommandBuffer::Create(context.Pass(), type);
-}
-
-scoped_refptr<cc::ContextProvider>
-SynchronousCompositorFactoryImpl::GetSharedWorkerContextProvider() {
-  // TODO(reveman): This limit is based on the usage required by async
-  // uploads. Determine what a good limit is now that async uploads are
-  // no longer used.
-  unsigned int mapped_memory_reclaim_limit =
-      (base::SysInfo::IsLowEndDevice() ? 2 : 6) * 1024 * 1024;
-
-  bool shared_worker_context_lost = false;
-  if (shared_worker_context_) {
-    // Note: If context is lost, we delete reference after releasing the lock.
-    base::AutoLock lock(*shared_worker_context_->GetLock());
-    if (shared_worker_context_->ContextGL()->GetGraphicsResetStatusKHR() !=
-        GL_NO_ERROR) {
-      shared_worker_context_lost = true;
-    }
-  }
-  if (!shared_worker_context_ || shared_worker_context_lost) {
-    WebGraphicsContext3DCommandBufferImpl::SharedMemoryLimits mem_limits;
-    mem_limits.mapped_memory_reclaim_limit = mapped_memory_reclaim_limit;
-    scoped_ptr<WebGraphicsContext3DCommandBufferImpl> context =
-        CreateContext3D(0, GetDefaultAttribs(), mem_limits);
-    shared_worker_context_ = ContextProviderCommandBuffer::Create(
-        context.Pass(), RENDER_WORKER_CONTEXT);
-    if (!shared_worker_context_->BindToCurrentThread())
-      shared_worker_context_ = nullptr;
-    if (shared_worker_context_)
-      shared_worker_context_->SetupLock();
-  }
-
-  return shared_worker_context_;
-}
-
 scoped_refptr<StreamTextureFactory>
 SynchronousCompositorFactoryImpl::CreateStreamTextureFactory(int frame_id) {
   scoped_refptr<StreamTextureFactorySynchronousImpl> factory(
diff --git a/content/browser/android/in_process/synchronous_compositor_factory_impl.h b/content/browser/android/in_process/synchronous_compositor_factory_impl.h
index a297c21..ad6d05cf 100644
--- a/content/browser/android/in_process/synchronous_compositor_factory_impl.h
+++ b/content/browser/android/in_process/synchronous_compositor_factory_impl.h
@@ -40,8 +40,9 @@
       override;
   scoped_ptr<cc::OutputSurface> CreateOutputSurface(
       int routing_id,
-      scoped_refptr<content::FrameSwapMessageQueue> frame_swap_message_queue)
-      override;
+      const scoped_refptr<FrameSwapMessageQueue>& frame_swap_message_queue,
+      const scoped_refptr<cc::ContextProvider>& onscreen_context,
+      const scoped_refptr<cc::ContextProvider>& worker_context) override;
   InputHandlerManagerClient* GetInputHandlerManagerClient() override;
   scoped_ptr<cc::BeginFrameSource> CreateExternalBeginFrameSource(
       int routing_id) override;
@@ -61,9 +62,6 @@
 
 
  private:
-  scoped_refptr<cc::ContextProvider> CreateContextProviderForCompositor(
-      int surface_id,
-      CommandBufferContextType type);
   scoped_refptr<cc::ContextProvider> GetSharedWorkerContextProvider();
   bool CanCreateMainThreadContext();
   scoped_refptr<StreamTextureFactorySynchronousImpl::ContextProvider>
@@ -77,8 +75,6 @@
   class VideoContextProvider;
   scoped_refptr<VideoContextProvider> video_context_provider_;
 
-  scoped_refptr<ContextProviderCommandBuffer> shared_worker_context_;
-
   // |num_hardware_compositor_lock_| is updated on UI thread only but can be
   // read on renderer main thread.
   base::Lock num_hardware_compositor_lock_;
diff --git a/content/browser/appcache/appcache_url_request_job.cc b/content/browser/appcache/appcache_url_request_job.cc
index d66c795c..87498f1 100644
--- a/content/browser/appcache/appcache_url_request_job.cc
+++ b/content/browser/appcache/appcache_url_request_job.cc
@@ -272,7 +272,6 @@
 void AppCacheURLRequestJob::OnResponseInfoLoaded(
       AppCacheResponseInfo* response_info, int64 response_id) {
   DCHECK(is_delivering_appcache_response());
-  scoped_refptr<AppCacheURLRequestJob> protect(this);
   if (response_info) {
     info_ = response_info;
     reader_.reset(storage_->CreateResponseReader(
diff --git a/content/browser/browser_main_loop.cc b/content/browser/browser_main_loop.cc
index bf3da73..f1f28187 100644
--- a/content/browser/browser_main_loop.cc
+++ b/content/browser/browser_main_loop.cc
@@ -60,7 +60,6 @@
 #include "content/public/common/content_switches.h"
 #include "content/public/common/main_function_params.h"
 #include "content/public/common/result_codes.h"
-#include "crypto/nss_util.h"
 #include "device/battery/battery_status_service.h"
 #include "media/audio/audio_manager.h"
 #include "media/base/media.h"
@@ -243,9 +242,9 @@
                << "http://crbug.com/179797";
   } else if (strstr(message, "Attempting to store changes into") ||
              strstr(message, "Attempting to set the permissions of")) {
-    LOG(ERROR) << message << " (http://bugs.chromium.org/161366)";
+    LOG(ERROR) << message << " (http://crbug.com/161366)";
   } else if (strstr(message, "drawable is not a native X11 window")) {
-    LOG(ERROR) << message << " (http://bugs.chromium.org/329991)";
+    LOG(ERROR) << message << " (http://crbug.com/329991)";
   } else if (strstr(message, "Cannot do system-bus activation with no user")) {
     LOG(ERROR) << message << " (http://crbug.com/431005)";
   } else if (strstr(message, "deprecated")) {
@@ -460,10 +459,10 @@
   // definitely harmless, so retained as a reminder of this
   // requirement for gconf.
   g_type_init();
-#endif
+#endif  // !GLIB_CHECK_VERSION(2, 35, 0)
 
   SetUpGLibLogHandler();
-#endif
+#endif  // defined(USE_GLIB)
 
   if (parts_)
     parts_->PreEarlyInitialization();
@@ -472,7 +471,13 @@
   // We use quite a few file descriptors for our IPC, and the default limit on
   // the Mac is low (256), so bump it up.
   base::SetFdLimit(1024);
-#endif
+#elif defined(OS_LINUX)
+  // Same for Linux. The default various per distro, but it is 1024 on Fedora.
+  // Low soft limits combined with liberal use of file descriptors means power
+  // users can easily hit this limit with many open tabs. Bump up the limit to
+  // an arbitrarily high number. See https://crbug.com/539567
+  base::SetFdLimit(8192);
+#endif  // default(OS_MACOSX)
 
 #if defined(OS_WIN)
   net::EnsureWinsockInit();
diff --git a/content/browser/frame_host/navigation_controller_impl.cc b/content/browser/frame_host/navigation_controller_impl.cc
index 8a0c207..c28f2e3 100644
--- a/content/browser/frame_host/navigation_controller_impl.cc
+++ b/content/browser/frame_host/navigation_controller_impl.cc
@@ -402,6 +402,13 @@
   return is_initial_navigation_;
 }
 
+bool NavigationControllerImpl::IsInitialBlankNavigation() const {
+  // TODO(creis): Once we create a NavigationEntry for the initial blank page,
+  // we'll need to check for entry count 1 and restore_type RESTORE_NONE (to
+  // exclude the cloned tab case).
+  return IsInitialNavigation() && GetEntryCount() == 0;
+}
+
 NavigationEntryImpl* NavigationControllerImpl::GetEntryWithPageID(
   SiteInstance* instance, int32 page_id) const {
   int index = GetEntryIndexWithPageID(instance, page_id);
diff --git a/content/browser/frame_host/navigation_controller_impl.h b/content/browser/frame_host/navigation_controller_impl.h
index a5136d93..736f637 100644
--- a/content/browser/frame_host/navigation_controller_impl.h
+++ b/content/browser/frame_host/navigation_controller_impl.h
@@ -79,6 +79,7 @@
   void CancelPendingReload() override;
   void ContinuePendingReload() override;
   bool IsInitialNavigation() const override;
+  bool IsInitialBlankNavigation() const override;
   void Reload(bool check_for_repost) override;
   void ReloadIgnoringCache(bool check_for_repost) override;
   void ReloadOriginalRequestURL(bool check_for_repost) override;
diff --git a/content/browser/frame_host/navigation_controller_impl_unittest.cc b/content/browser/frame_host/navigation_controller_impl_unittest.cc
index 4be1b1a..acbca290 100644
--- a/content/browser/frame_host/navigation_controller_impl_unittest.cc
+++ b/content/browser/frame_host/navigation_controller_impl_unittest.cc
@@ -4561,6 +4561,7 @@
 
   // Initial state.
   EXPECT_TRUE(controller.IsInitialNavigation());
+  EXPECT_TRUE(controller.IsInitialBlankNavigation());
 
   // After commit, it stays false.
   const GURL url1("http://foo1");
@@ -4568,11 +4569,20 @@
   EXPECT_EQ(1U, navigation_entry_committed_counter_);
   navigation_entry_committed_counter_ = 0;
   EXPECT_FALSE(controller.IsInitialNavigation());
+  EXPECT_FALSE(controller.IsInitialBlankNavigation());
 
   // After starting a new navigation, it stays false.
   const GURL url2("http://foo2");
   controller.LoadURL(
       url2, Referrer(), ui::PAGE_TRANSITION_TYPED, std::string());
+  EXPECT_FALSE(controller.IsInitialNavigation());
+  EXPECT_FALSE(controller.IsInitialBlankNavigation());
+
+  // For cloned tabs, IsInitialNavigationShould be true but
+  // IsInitialBlankNavigation should be false.
+  scoped_ptr<WebContents> clone(controller.GetWebContents()->Clone());
+  EXPECT_TRUE(clone->GetController().IsInitialNavigation());
+  EXPECT_FALSE(clone->GetController().IsInitialBlankNavigation());
 }
 
 // Check that the favicon is not reused across a client redirect.
diff --git a/content/browser/indexed_db/indexed_db_browsertest.cc b/content/browser/indexed_db/indexed_db_browsertest.cc
index c8ff36f..f4c949a4 100644
--- a/content/browser/indexed_db/indexed_db_browsertest.cc
+++ b/content/browser/indexed_db/indexed_db_browsertest.cc
@@ -47,7 +47,8 @@
 
 // This browser test is aimed towards exercising the IndexedDB bindings and
 // the actual implementation that lives in the browser side.
-class IndexedDBBrowserTest : public ContentBrowserTest {
+class IndexedDBBrowserTest : public ContentBrowserTest,
+                             public ::testing::WithParamInterface<const char*> {
  public:
   IndexedDBBrowserTest() : disk_usage_(-1) {}
 
@@ -187,16 +188,6 @@
   DISALLOW_COPY_AND_ASSIGN(IndexedDBBrowserTest);
 };
 
-class IndexedDBBrowserTestWithExperimentalAPIs
-    : public IndexedDBBrowserTest,
-      public ::testing::WithParamInterface<const char*> {
- public:
-  void SetUpCommandLine(base::CommandLine* command_line) override {
-    command_line->AppendSwitch(
-        switches::kEnableExperimentalWebPlatformFeatures);
-  }
-};
-
 IN_PROC_BROWSER_TEST_F(IndexedDBBrowserTest, CursorTest) {
   SimpleTest(GetTestUrl("indexeddb", "cursor_test.html"));
 }
@@ -242,8 +233,7 @@
   SimpleTest(GetTestUrl("indexeddb", "callback_accounting.html"));
 }
 
-IN_PROC_BROWSER_TEST_F(IndexedDBBrowserTestWithExperimentalAPIs,
-                       GetAllMaxMessageSize) {
+IN_PROC_BROWSER_TEST_F(IndexedDBBrowserTest, GetAllMaxMessageSize) {
   SimpleTest(GetTestUrl("indexeddb", "getall_max_message_size.html"));
 }
 
@@ -701,11 +691,7 @@
 
 }  // namespace
 
-// Experimental for IDBObjectStore.getAll()
-using IndexedDBBrowserCorruptionTest = IndexedDBBrowserTestWithExperimentalAPIs;
-
-IN_PROC_BROWSER_TEST_P(IndexedDBBrowserCorruptionTest,
-                       OperationOnCorruptedOpenDatabase) {
+IN_PROC_BROWSER_TEST_P(IndexedDBBrowserTest, OperationOnCorruptedOpenDatabase) {
   ASSERT_TRUE(embedded_test_server()->Started() ||
               embedded_test_server()->InitializeAndWaitUntilReady());
   const GURL& origin_url = embedded_test_server()->base_url();
@@ -724,8 +710,8 @@
   SimpleTest(embedded_test_server()->GetURL(test_file));
 }
 
-INSTANTIATE_TEST_CASE_P(IndexedDBBrowserCorruptionTestInstantiation,
-                        IndexedDBBrowserCorruptionTest,
+INSTANTIATE_TEST_CASE_P(IndexedDBBrowserTestInstantiation,
+                        IndexedDBBrowserTest,
                         ::testing::Values("failGetBlobJournal",
                                           "get",
                                           "getAll",
diff --git a/content/browser/media/android/media_session.cc b/content/browser/media/android/media_session.cc
index 37a6995..2a4dd1c 100644
--- a/content/browser/media/android/media_session.cc
+++ b/content/browser/media/android/media_session.cc
@@ -13,6 +13,9 @@
 
 namespace content {
 
+using MediaSessionSuspendedSource =
+    MediaSessionUmaHelper::MediaSessionSuspendedSource;
+
 DEFINE_WEB_CONTENTS_USER_DATA_KEY(MediaSession);
 
 MediaSession::PlayerIdentifier::PlayerIdentifier(MediaSessionObserver* observer,
@@ -69,8 +72,9 @@
   }
 
   State old_audio_focus_state = audio_focus_state_;
-  audio_focus_state_ = RequestSystemAudioFocus(type) ? State::ACTIVE
-                                                     : State::INACTIVE;
+  State audio_focus_state = RequestSystemAudioFocus(type) ? State::ACTIVE
+                                                          : State::INACTIVE;
+  SetAudioFocusState(audio_focus_state);
   audio_focus_type_ = type;
 
   if (audio_focus_state_ != State::ACTIVE)
@@ -108,12 +112,19 @@
 }
 
 void MediaSession::OnSuspend(JNIEnv* env, jobject obj, jboolean temporary) {
+  // TODO(mlamouri): this check makes it so that if a MediaSession is paused and
+  // then loses audio focus, it will still stay in the Suspended state.
+  // See https://crbug.com/539998
   if (audio_focus_state_ != State::ACTIVE)
     return;
 
   OnSuspendInternal(SuspendType::SYSTEM);
   if (!temporary)
-    audio_focus_state_ = State::INACTIVE;
+    SetAudioFocusState(State::INACTIVE);
+
+  uma_helper_.RecordSessionSuspended(
+      temporary ? MediaSessionSuspendedSource::SystemTransient
+                : MediaSessionSuspendedSource::SystemPermanent);
   UpdateWebContents();
 }
 
@@ -130,9 +141,11 @@
 
   // Request audio focus again in case we lost it because another app started
   // playing while the playback was paused.
-  audio_focus_state_ = RequestSystemAudioFocus(audio_focus_type_)
-                           ? State::ACTIVE
-                           : State::INACTIVE;
+  State audio_focus_state = RequestSystemAudioFocus(audio_focus_type_)
+                                ? State::ACTIVE
+                                : State::INACTIVE;
+  SetAudioFocusState(audio_focus_state);
+
   if (audio_focus_state_ != State::ACTIVE)
     return;
 
@@ -179,13 +192,22 @@
   return audio_focus_type_;
 }
 
+MediaSessionUmaHelper* MediaSession::uma_helper_for_test() {
+  return &uma_helper_;
+}
+
 void MediaSession::RemoveAllPlayersForTest() {
   players_.clear();
   AbandonSystemAudioFocusIfNeeded();
 }
 
 void MediaSession::OnSuspendInternal(SuspendType type) {
-  audio_focus_state_ = State::SUSPENDED;
+  // SuspendType::System will handle the UMA recording at the calling point
+  // because there are more than one type.
+  if (type == SuspendType::UI)
+    uma_helper_.RecordSessionSuspended(MediaSessionSuspendedSource::UI);
+
+  SetAudioFocusState(State::SUSPENDED);
   suspend_type_ = type;
 
   for (const auto& it : players_)
@@ -196,7 +218,7 @@
   if (suspend_type_ != type && type != SuspendType::UI)
     return;
 
-  audio_focus_state_ = State::ACTIVE;
+  SetAudioFocusState(State::ACTIVE);
 
   for (const auto& it : players_)
     it.observer->OnResume(it.player_id);
@@ -238,7 +260,7 @@
     Java_MediaSession_abandonAudioFocus(env, j_media_session_.obj());
   }
 
-  audio_focus_state_ = State::INACTIVE;
+  SetAudioFocusState(State::INACTIVE);
   UpdateWebContents();
 }
 
@@ -246,4 +268,22 @@
   static_cast<WebContentsImpl*>(web_contents())->OnMediaSessionStateChanged();
 }
 
+void MediaSession::SetAudioFocusState(State audio_focus_state) {
+  if (audio_focus_state == audio_focus_state_)
+    return;
+
+  audio_focus_state_ = audio_focus_state;
+  switch (audio_focus_state_) {
+    case State::ACTIVE:
+      uma_helper_.OnSessionActive();
+      break;
+    case State::SUSPENDED:
+      uma_helper_.OnSessionSuspended();
+      break;
+    case State::INACTIVE:
+      uma_helper_.OnSessionInactive();
+      break;
+  }
+}
+
 }  // namespace content
diff --git a/content/browser/media/android/media_session.h b/content/browser/media/android/media_session.h
index b7a6f8a..992ad4f 100644
--- a/content/browser/media/android/media_session.h
+++ b/content/browser/media/android/media_session.h
@@ -9,6 +9,7 @@
 
 #include "base/android/scoped_java_ref.h"
 #include "base/id_map.h"
+#include "content/browser/media/android/media_session_uma_helper.h"
 #include "content/common/content_export.h"
 #include "content/public/browser/web_contents_observer.h"
 #include "content/public/browser/web_contents_user_data.h"
@@ -95,6 +96,7 @@
   bool IsActiveForTest() const;
   Type audio_focus_type_for_test() const;
   void RemoveAllPlayersForTest();
+  MediaSessionUmaHelper* uma_helper_for_test();
 
   enum class State {
     ACTIVE,
@@ -147,6 +149,10 @@
   // Notifies WebContents about the state change of the media session.
   void UpdateWebContents();
 
+  // Internal method that should be used instead of setting audio_focus_state_.
+  // It sets audio_focus_state_ and notifies observers about the state change.
+  void SetAudioFocusState(State audio_focus_state);
+
   base::android::ScopedJavaGlobalRef<jobject> j_media_session_;
   PlayersMap players_;
 
@@ -154,6 +160,8 @@
   SuspendType suspend_type_;
   Type audio_focus_type_;
 
+  MediaSessionUmaHelper uma_helper_;
+
   DISALLOW_COPY_AND_ASSIGN(MediaSession);
 };
 
diff --git a/content/browser/media/android/media_session_browsertest.cc b/content/browser/media/android/media_session_browsertest.cc
index f977c1bd..99553b4a 100644
--- a/content/browser/media/android/media_session_browsertest.cc
+++ b/content/browser/media/android/media_session_browsertest.cc
@@ -7,6 +7,9 @@
 #include <list>
 #include <vector>
 
+#include "base/metrics/histogram_samples.h"
+#include "base/test/histogram_tester.h"
+#include "base/test/simple_test_clock.h"
 #include "content/browser/media/android/media_session_observer.h"
 #include "content/public/browser/web_contents.h"
 #include "content/public/browser/web_contents_observer.h"
@@ -18,6 +21,7 @@
 using content::WebContentsObserver;
 using content::MediaSession;
 using content::MediaSessionObserver;
+using content::MediaSessionUmaHelper;
 
 using ::testing::Expectation;
 
@@ -138,12 +142,6 @@
     media_session_->RemovePlayers(media_session_observer);
   }
 
-  void OnSuspendSession(bool isTemporary) {
-    media_session_->OnSuspend(nullptr, nullptr, isTemporary);
-  }
-
-  void OnResumeSession() { media_session_->OnResume(nullptr, nullptr); }
-
   bool HasAudioFocus() { return media_session_->IsActiveForTest(); }
 
   MediaSession::Type GetSessionType() {
@@ -155,27 +153,33 @@
   bool IsSuspended() { return media_session_->IsSuspended(); }
 
   void UIResume() {
-    media_session_->OnResumeInternal(content::MediaSession::SuspendType::UI);
+    media_session_->Resume();
   }
 
   void SystemResume() {
-    media_session_->OnResumeInternal(
-        content::MediaSession::SuspendType::SYSTEM);
+    media_session_->OnResume(nullptr, nullptr);
   }
 
   void UISuspend() {
-    media_session_->OnSuspendInternal(content::MediaSession::SuspendType::UI);
+    media_session_->Suspend();
   }
 
-  void SystemSuspend() {
-    media_session_->OnSuspendInternal(
-        content::MediaSession::SuspendType::SYSTEM);
+  void SystemSuspend(bool temporary) {
+    media_session_->OnSuspend(nullptr, nullptr, temporary);
   }
 
   MockWebContentsObserver* mock_web_contents_observer() {
     return mock_web_contents_observer_.get();
   }
 
+  scoped_ptr<MediaSession> CreateDummyMediaSession() {
+      return scoped_ptr<MediaSession>(new MediaSession(nullptr));
+  }
+
+  MediaSessionUmaHelper* GetMediaSessionUMAHelper() {
+    return media_session_->uma_helper_for_test();
+  }
+
  protected:
   MediaSession* media_session_;
   scoped_ptr<MockWebContentsObserver> mock_web_contents_observer_;
@@ -225,7 +229,7 @@
   StartNewPlayer(media_session_observer.get(), MediaSession::Type::Content);
   StartNewPlayer(media_session_observer.get(), MediaSession::Type::Content);
 
-  OnSuspendSession(true);
+  SystemSuspend(true);
 
   EXPECT_FALSE(media_session_observer->IsPlaying(0));
   EXPECT_FALSE(media_session_observer->IsPlaying(1));
@@ -241,8 +245,8 @@
   StartNewPlayer(media_session_observer.get(), MediaSession::Type::Content);
   StartNewPlayer(media_session_observer.get(), MediaSession::Type::Content);
 
-  OnSuspendSession(true);
-  OnResumeSession();
+  SystemSuspend(true);
+  SystemResume();
 
   EXPECT_TRUE(media_session_observer->IsPlaying(0));
   EXPECT_TRUE(media_session_observer->IsPlaying(1));
@@ -258,7 +262,7 @@
 
   EXPECT_TRUE(media_session_observer->IsPlaying(0));
 
-  OnSuspendSession(true);
+  SystemSuspend(true);
 
   EXPECT_FALSE(media_session_observer->IsPlaying(0));
 
@@ -293,7 +297,7 @@
 
   StartNewPlayer(media_session_observer.get(), MediaSession::Type::Content);
 
-  OnSuspendSession(true);
+  SystemSuspend(true);
 
   EXPECT_FALSE(HasAudioFocus());
 }
@@ -304,8 +308,8 @@
 
   StartNewPlayer(media_session_observer.get(), MediaSession::Type::Content);
 
-  OnSuspendSession(true);
-  OnResumeSession();
+  SystemSuspend(true);
+  SystemResume();
 
   EXPECT_TRUE(HasAudioFocus());
 }
@@ -392,10 +396,10 @@
   EXPECT_EQ(0, media_session_observer->received_suspend_calls());
   EXPECT_EQ(0, media_session_observer->received_resume_calls());
 
-  OnSuspendSession(true);
+  SystemSuspend(true);
   EXPECT_EQ(3, media_session_observer->received_suspend_calls());
 
-  OnResumeSession();
+  SystemResume();
   EXPECT_EQ(3, media_session_observer->received_resume_calls());
 }
 
@@ -419,10 +423,10 @@
   EXPECT_EQ(0, media_session_observer->received_suspend_calls());
   EXPECT_EQ(0, media_session_observer->received_resume_calls());
 
-  OnSuspendSession(true);
+  SystemSuspend(true);
   EXPECT_EQ(3, media_session_observer->received_suspend_calls());
 
-  OnResumeSession();
+  SystemResume();
   EXPECT_EQ(3, media_session_observer->received_resume_calls());
 }
 
@@ -462,7 +466,7 @@
   EXPECT_TRUE(media_session_observer->IsPlaying(2));
   EXPECT_TRUE(media_session_observer->IsPlaying(3));
 
-  OnSuspendSession(true);
+  SystemSuspend(true);
 
   EXPECT_FALSE(media_session_observer->IsPlaying(0));
   EXPECT_FALSE(media_session_observer->IsPlaying(1));
@@ -471,7 +475,7 @@
 
   EXPECT_EQ(MediaSession::Type::Content, GetSessionType());
 
-  OnResumeSession();
+  SystemResume();
 
   EXPECT_TRUE(media_session_observer->IsPlaying(0));
   EXPECT_TRUE(media_session_observer->IsPlaying(1));
@@ -639,7 +643,7 @@
 
   StartNewPlayer(media_session_observer.get(), MediaSession::Type::Content);
 
-  OnSuspendSession(true);
+  SystemSuspend(true);
 
   EXPECT_TRUE(IsControllable());
   EXPECT_TRUE(IsSuspended());
@@ -659,8 +663,8 @@
       new MockMediaSessionObserver);
 
   StartNewPlayer(media_session_observer.get(), MediaSession::Type::Content);
-  OnSuspendSession(true);
-  OnResumeSession();
+  SystemSuspend(true);
+  SystemResume();
 
   EXPECT_TRUE(IsControllable());
   EXPECT_FALSE(IsSuspended());
@@ -679,7 +683,7 @@
 
   StartNewPlayer(media_session_observer.get(), MediaSession::Type::Content);
 
-  OnSuspendSession(false);
+  SystemSuspend(false);
 
   EXPECT_FALSE(IsControllable());
   EXPECT_TRUE(IsSuspended());
@@ -700,7 +704,7 @@
       new MockMediaSessionObserver);
 
   StartNewPlayer(media_session_observer.get(), MediaSession::Type::Content);
-  OnSuspendSession(true);
+  SystemSuspend(true);
 
   // This should reset the session and change it to a transient, so
   // hide the controls.
@@ -725,7 +729,7 @@
       new MockMediaSessionObserver);
 
   StartNewPlayer(media_session_observer.get(), MediaSession::Type::Content);
-  OnSuspendSession(true);
+  SystemSuspend(true);
 
   // This should reset the session and update the controls.
   StartNewPlayer(media_session_observer.get(), MediaSession::Type::Content);
@@ -749,7 +753,7 @@
       new MockMediaSessionObserver);
 
   StartNewPlayer(media_session_observer.get(), MediaSession::Type::Content);
-  OnSuspendSession(true);
+  SystemSuspend(true);
 
   // This should resume the session and update the controls.
   AddPlayer(media_session_observer.get(), 0, MediaSession::Type::Content);
@@ -810,7 +814,7 @@
       new MockMediaSessionObserver);
   StartNewPlayer(media_session_observer.get(), MediaSession::Type::Content);
 
-  SystemSuspend();
+  SystemSuspend(true);
   EXPECT_TRUE(IsControllable());
   EXPECT_TRUE(IsSuspended());
 
@@ -838,7 +842,7 @@
       new MockMediaSessionObserver);
   StartNewPlayer(media_session_observer.get(), MediaSession::Type::Content);
 
-  SystemSuspend();
+  SystemSuspend(true);
   EXPECT_TRUE(IsControllable());
   EXPECT_TRUE(IsSuspended());
 
@@ -846,3 +850,302 @@
   EXPECT_TRUE(IsControllable());
   EXPECT_FALSE(IsSuspended());
 }
+
+IN_PROC_BROWSER_TEST_F(MediaSessionBrowserTest, UMA_Suspended_SystemTransient) {
+  scoped_ptr<MockMediaSessionObserver> media_session_observer(
+      new MockMediaSessionObserver);
+  base::HistogramTester tester;
+
+  StartNewPlayer(media_session_observer.get(), MediaSession::Type::Content);
+  SystemSuspend(true);
+
+  scoped_ptr<base::HistogramSamples> samples(
+      tester.GetHistogramSamplesSinceCreation("Media.Session.Suspended"));
+  EXPECT_EQ(1, samples->TotalCount());
+  EXPECT_EQ(1, samples->GetCount(0)); // System Transient
+  EXPECT_EQ(0, samples->GetCount(1)); // System Permanent
+  EXPECT_EQ(0, samples->GetCount(2)); // UI
+}
+
+
+IN_PROC_BROWSER_TEST_F(MediaSessionBrowserTest,
+                       UMA_Suspended_SystemPermantent) {
+  scoped_ptr<MockMediaSessionObserver> media_session_observer(
+      new MockMediaSessionObserver);
+  base::HistogramTester tester;
+
+  StartNewPlayer(media_session_observer.get(), MediaSession::Type::Content);
+  SystemSuspend(false);
+
+  scoped_ptr<base::HistogramSamples> samples(
+      tester.GetHistogramSamplesSinceCreation("Media.Session.Suspended"));
+  EXPECT_EQ(1, samples->TotalCount());
+  EXPECT_EQ(0, samples->GetCount(0)); // System Transient
+  EXPECT_EQ(1, samples->GetCount(1)); // System Permanent
+  EXPECT_EQ(0, samples->GetCount(2)); // UI
+}
+
+IN_PROC_BROWSER_TEST_F(MediaSessionBrowserTest, UMA_Suspended_UI) {
+  scoped_ptr<MockMediaSessionObserver> media_session_observer(
+      new MockMediaSessionObserver);
+  base::HistogramTester tester;
+
+  StartNewPlayer(media_session_observer.get(), MediaSession::Type::Content);
+  UISuspend();
+
+  scoped_ptr<base::HistogramSamples> samples(
+      tester.GetHistogramSamplesSinceCreation("Media.Session.Suspended"));
+  EXPECT_EQ(1, samples->TotalCount());
+  EXPECT_EQ(0, samples->GetCount(0)); // System Transient
+  EXPECT_EQ(0, samples->GetCount(1)); // System Permanent
+  EXPECT_EQ(1, samples->GetCount(2)); // UI
+}
+
+IN_PROC_BROWSER_TEST_F(MediaSessionBrowserTest, UMA_Suspended_Multiple) {
+  scoped_ptr<MockMediaSessionObserver> media_session_observer(
+      new MockMediaSessionObserver);
+  base::HistogramTester tester;
+
+  StartNewPlayer(media_session_observer.get(), MediaSession::Type::Content);
+
+  UISuspend();
+  UIResume();
+
+  SystemSuspend(true);
+  SystemResume();
+
+  UISuspend();
+  UIResume();
+
+  SystemSuspend(false);
+
+  scoped_ptr<base::HistogramSamples> samples(
+      tester.GetHistogramSamplesSinceCreation("Media.Session.Suspended"));
+  EXPECT_EQ(4, samples->TotalCount());
+  EXPECT_EQ(1, samples->GetCount(0)); // System Transient
+  EXPECT_EQ(1, samples->GetCount(1)); // System Permanent
+  EXPECT_EQ(2, samples->GetCount(2)); // UI
+}
+
+IN_PROC_BROWSER_TEST_F(MediaSessionBrowserTest, UMA_Suspended_Crossing) {
+  scoped_ptr<MockMediaSessionObserver> media_session_observer(
+      new MockMediaSessionObserver);
+  base::HistogramTester tester;
+
+  StartNewPlayer(media_session_observer.get(), MediaSession::Type::Content);
+
+  UISuspend();
+  SystemSuspend(true);
+  SystemSuspend(false);
+  UIResume();
+
+  SystemSuspend(true);
+  SystemSuspend(true);
+  SystemSuspend(false);
+  SystemResume();
+
+  scoped_ptr<base::HistogramSamples> samples(
+      tester.GetHistogramSamplesSinceCreation("Media.Session.Suspended"));
+  EXPECT_EQ(2, samples->TotalCount());
+  EXPECT_EQ(1, samples->GetCount(0)); // System Transient
+  EXPECT_EQ(0, samples->GetCount(1)); // System Permanent
+  EXPECT_EQ(1, samples->GetCount(2)); // UI
+}
+
+IN_PROC_BROWSER_TEST_F(MediaSessionBrowserTest, UMA_Suspended_Stop) {
+  scoped_ptr<MockMediaSessionObserver> media_session_observer(
+      new MockMediaSessionObserver);
+  base::HistogramTester tester;
+
+  StartNewPlayer(media_session_observer.get(), MediaSession::Type::Content);
+  media_session_->Stop();
+
+  scoped_ptr<base::HistogramSamples> samples(
+      tester.GetHistogramSamplesSinceCreation("Media.Session.Suspended"));
+  EXPECT_EQ(1, samples->TotalCount());
+  EXPECT_EQ(0, samples->GetCount(0)); // System Transient
+  EXPECT_EQ(0, samples->GetCount(1)); // System Permanent
+  EXPECT_EQ(1, samples->GetCount(2)); // UI
+}
+
+IN_PROC_BROWSER_TEST_F(MediaSessionBrowserTest, UMA_ActiveTime_NoActivation) {
+  base::HistogramTester tester;
+
+  scoped_ptr<MediaSession> media_session = CreateDummyMediaSession();
+  media_session.reset();
+
+  // A MediaSession that wasn't active doesn't register an active time.
+  scoped_ptr<base::HistogramSamples> samples(
+      tester.GetHistogramSamplesSinceCreation("Media.Session.ActiveTime"));
+  EXPECT_EQ(0, samples->TotalCount());
+}
+
+IN_PROC_BROWSER_TEST_F(MediaSessionBrowserTest,
+                       UMA_ActiveTime_SimpleActivation) {
+  scoped_ptr<MockMediaSessionObserver> media_session_observer(
+    new MockMediaSessionObserver);
+  base::HistogramTester tester;
+
+  MediaSessionUmaHelper* media_session_uma_helper = GetMediaSessionUMAHelper();
+  base::SimpleTestClock* clock = new base::SimpleTestClock();
+  clock->SetNow(base::Time::Now());
+  media_session_uma_helper->SetClockForTest(
+      scoped_ptr<base::SimpleTestClock>(clock));
+
+  StartNewPlayer(media_session_observer.get(), MediaSession::Type::Content);
+
+  clock->Advance(base::TimeDelta::FromMilliseconds(1000));
+  media_session_->Stop();
+
+  scoped_ptr<base::HistogramSamples> samples(
+      tester.GetHistogramSamplesSinceCreation("Media.Session.ActiveTime"));
+  EXPECT_EQ(1, samples->TotalCount());
+  EXPECT_EQ(1, samples->GetCount(1000));
+}
+
+IN_PROC_BROWSER_TEST_F(MediaSessionBrowserTest,
+                       UMA_ActiveTime_ActivationWithUISuspension) {
+  scoped_ptr<MockMediaSessionObserver> media_session_observer(
+    new MockMediaSessionObserver);
+  base::HistogramTester tester;
+
+  MediaSessionUmaHelper* media_session_uma_helper = GetMediaSessionUMAHelper();
+  base::SimpleTestClock* clock = new base::SimpleTestClock();
+  clock->SetNow(base::Time::Now());
+  media_session_uma_helper->SetClockForTest(
+      scoped_ptr<base::SimpleTestClock>(clock));
+
+  StartNewPlayer(media_session_observer.get(), MediaSession::Type::Content);
+
+  clock->Advance(base::TimeDelta::FromMilliseconds(1000));
+  UISuspend();
+
+  clock->Advance(base::TimeDelta::FromMilliseconds(2000));
+  UIResume();
+
+  clock->Advance(base::TimeDelta::FromMilliseconds(1000));
+  media_session_->Stop();
+
+  scoped_ptr<base::HistogramSamples> samples(
+      tester.GetHistogramSamplesSinceCreation("Media.Session.ActiveTime"));
+  EXPECT_EQ(1, samples->TotalCount());
+  EXPECT_EQ(1, samples->GetCount(2000));
+}
+
+IN_PROC_BROWSER_TEST_F(MediaSessionBrowserTest,
+                       UMA_ActiveTime_ActivationWithSystemSuspension) {
+  scoped_ptr<MockMediaSessionObserver> media_session_observer(
+    new MockMediaSessionObserver);
+  base::HistogramTester tester;
+
+  MediaSessionUmaHelper* media_session_uma_helper = GetMediaSessionUMAHelper();
+  base::SimpleTestClock* clock = new base::SimpleTestClock();
+  clock->SetNow(base::Time::Now());
+  media_session_uma_helper->SetClockForTest(
+      scoped_ptr<base::SimpleTestClock>(clock));
+
+  StartNewPlayer(media_session_observer.get(), MediaSession::Type::Content);
+
+  clock->Advance(base::TimeDelta::FromMilliseconds(1000));
+  SystemSuspend(true);
+
+  clock->Advance(base::TimeDelta::FromMilliseconds(2000));
+  SystemResume();
+
+  clock->Advance(base::TimeDelta::FromMilliseconds(1000));
+  media_session_->Stop();
+
+  scoped_ptr<base::HistogramSamples> samples(
+      tester.GetHistogramSamplesSinceCreation("Media.Session.ActiveTime"));
+  EXPECT_EQ(1, samples->TotalCount());
+  EXPECT_EQ(1, samples->GetCount(2000));
+}
+
+IN_PROC_BROWSER_TEST_F(MediaSessionBrowserTest,
+                       UMA_ActiveTime_ActivateSuspendedButNotStopped) {
+  scoped_ptr<MockMediaSessionObserver> media_session_observer(
+    new MockMediaSessionObserver);
+  base::HistogramTester tester;
+
+  MediaSessionUmaHelper* media_session_uma_helper = GetMediaSessionUMAHelper();
+  base::SimpleTestClock* clock = new base::SimpleTestClock();
+  clock->SetNow(base::Time::Now());
+  media_session_uma_helper->SetClockForTest(
+      scoped_ptr<base::SimpleTestClock>(clock));
+
+  StartNewPlayer(media_session_observer.get(), MediaSession::Type::Content);
+  clock->Advance(base::TimeDelta::FromMilliseconds(500));
+  SystemSuspend(true);
+
+  {
+    scoped_ptr<base::HistogramSamples> samples(
+        tester.GetHistogramSamplesSinceCreation("Media.Session.ActiveTime"));
+    EXPECT_EQ(0, samples->TotalCount());
+  }
+
+  SystemResume();
+  clock->Advance(base::TimeDelta::FromMilliseconds(5000));
+  UISuspend();
+
+  {
+    scoped_ptr<base::HistogramSamples> samples(
+        tester.GetHistogramSamplesSinceCreation("Media.Session.ActiveTime"));
+    EXPECT_EQ(0, samples->TotalCount());
+  }
+}
+
+IN_PROC_BROWSER_TEST_F(MediaSessionBrowserTest,
+                       UMA_ActiveTime_ActivateSuspendStopTwice) {
+  scoped_ptr<MockMediaSessionObserver> media_session_observer(
+    new MockMediaSessionObserver);
+  base::HistogramTester tester;
+
+  MediaSessionUmaHelper* media_session_uma_helper = GetMediaSessionUMAHelper();
+  base::SimpleTestClock* clock = new base::SimpleTestClock();
+  clock->SetNow(base::Time::Now());
+  media_session_uma_helper->SetClockForTest(
+      scoped_ptr<base::SimpleTestClock>(clock));
+
+  StartNewPlayer(media_session_observer.get(), MediaSession::Type::Content);
+  clock->Advance(base::TimeDelta::FromMilliseconds(500));
+  SystemSuspend(true);
+  media_session_->Stop();
+
+  StartNewPlayer(media_session_observer.get(), MediaSession::Type::Content);
+  clock->Advance(base::TimeDelta::FromMilliseconds(5000));
+  SystemResume();
+  media_session_->Stop();
+
+  scoped_ptr<base::HistogramSamples> samples(
+      tester.GetHistogramSamplesSinceCreation("Media.Session.ActiveTime"));
+  EXPECT_EQ(2, samples->TotalCount());
+  EXPECT_EQ(1, samples->GetCount(500));
+  EXPECT_EQ(1, samples->GetCount(5000));
+}
+
+IN_PROC_BROWSER_TEST_F(MediaSessionBrowserTest,
+                       UMA_ActiveTime_MultipleActivations) {
+  scoped_ptr<MockMediaSessionObserver> media_session_observer(
+    new MockMediaSessionObserver);
+  base::HistogramTester tester;
+
+  MediaSessionUmaHelper* media_session_uma_helper = GetMediaSessionUMAHelper();
+  base::SimpleTestClock* clock = new base::SimpleTestClock();
+  clock->SetNow(base::Time::Now());
+  media_session_uma_helper->SetClockForTest(
+      scoped_ptr<base::SimpleTestClock>(clock));
+
+  StartNewPlayer(media_session_observer.get(), MediaSession::Type::Content);
+  clock->Advance(base::TimeDelta::FromMilliseconds(10000));
+  RemovePlayer(media_session_observer.get(), 0);
+
+  StartNewPlayer(media_session_observer.get(), MediaSession::Type::Content);
+  clock->Advance(base::TimeDelta::FromMilliseconds(1000));
+  media_session_->Stop();
+
+  scoped_ptr<base::HistogramSamples> samples(
+      tester.GetHistogramSamplesSinceCreation("Media.Session.ActiveTime"));
+  EXPECT_EQ(2, samples->TotalCount());
+  EXPECT_EQ(1, samples->GetCount(1000));
+  EXPECT_EQ(1, samples->GetCount(10000));
+}
diff --git a/content/browser/media/android/media_session_uma_helper.cc b/content/browser/media/android/media_session_uma_helper.cc
new file mode 100644
index 0000000..4752401d
--- /dev/null
+++ b/content/browser/media/android/media_session_uma_helper.cc
@@ -0,0 +1,60 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "content/browser/media/android/media_session_uma_helper.h"
+
+#include "base/metrics/histogram_base.h"
+#include "base/metrics/histogram_macros.h"
+#include "base/time/default_clock.h"
+
+namespace content {
+
+using HistogramBase = base::HistogramBase;
+
+MediaSessionUmaHelper::MediaSessionUmaHelper()
+    : clock_(new base::DefaultClock())
+{}
+
+MediaSessionUmaHelper::~MediaSessionUmaHelper()
+{}
+
+void MediaSessionUmaHelper::RecordSessionSuspended(
+    MediaSessionSuspendedSource source) const {
+  UMA_HISTOGRAM_ENUMERATION(
+      "Media.Session.Suspended",
+      static_cast<HistogramBase::Sample>(source),
+      static_cast<HistogramBase::Sample>(MediaSessionSuspendedSource::Count));
+}
+
+void MediaSessionUmaHelper::OnSessionActive() {
+  current_active_time_ = clock_->Now();
+}
+
+void MediaSessionUmaHelper::OnSessionSuspended() {
+  if (current_active_time_.is_null())
+    return;
+
+  total_active_time_ += clock_->Now() - current_active_time_;
+  current_active_time_ = base::Time();
+}
+
+void MediaSessionUmaHelper::OnSessionInactive() {
+  if (!current_active_time_.is_null()) {
+    total_active_time_ += clock_->Now() - current_active_time_;
+    current_active_time_ = base::Time();
+  }
+
+  if (total_active_time_.is_zero())
+    return;
+
+  UMA_HISTOGRAM_LONG_TIMES("Media.Session.ActiveTime", total_active_time_);
+  total_active_time_ = base::TimeDelta();
+}
+
+void MediaSessionUmaHelper::SetClockForTest(
+    scoped_ptr<base::Clock> testing_clock) {
+  clock_ = testing_clock.Pass();
+}
+
+}  // namespace content
diff --git a/content/browser/media/android/media_session_uma_helper.h b/content/browser/media/android/media_session_uma_helper.h
new file mode 100644
index 0000000..35f6456
--- /dev/null
+++ b/content/browser/media/android/media_session_uma_helper.h
@@ -0,0 +1,48 @@
+// 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 CONTENT_BROWSER_MEDIA_ANDROID_MEDIA_SESSION_UMA_HELPER_H_
+#define CONTENT_BROWSER_MEDIA_ANDROID_MEDIA_SESSION_UMA_HELPER_H_
+
+#include "base/memory/scoped_ptr.h"
+#include "base/time/clock.h"
+#include "content/common/content_export.h"
+
+namespace base {
+class Clock;
+}  // base namespace
+
+namespace content {
+
+class CONTENT_EXPORT MediaSessionUmaHelper {
+ public:
+  // This is used for UMA histogram (Media.Session.Suspended). New values should
+  // be appended only and must be added before |Count|.
+  enum class MediaSessionSuspendedSource {
+    SystemTransient = 0,
+    SystemPermanent = 1,
+    UI = 2,
+    Count // Leave at the end.
+  };
+
+  MediaSessionUmaHelper();
+  ~MediaSessionUmaHelper();
+
+  void RecordSessionSuspended(MediaSessionSuspendedSource source) const;
+
+  void OnSessionActive();
+  void OnSessionSuspended();
+  void OnSessionInactive();
+
+  void SetClockForTest(scoped_ptr<base::Clock> testing_clock);
+
+ private:
+  base::TimeDelta total_active_time_;
+  base::Time current_active_time_;
+  scoped_ptr<base::Clock> clock_;
+};
+
+}  // namespace content
+
+#endif // CONTENT_BROWSER_MEDIA_ANDROID_MEDIA_SESSION_UMA_HELPER_H_
diff --git a/content/browser/media/android/media_session_uma_helper_unittest.cc b/content/browser/media/android/media_session_uma_helper_unittest.cc
new file mode 100644
index 0000000..c4b3fc3d
--- /dev/null
+++ b/content/browser/media/android/media_session_uma_helper_unittest.cc
@@ -0,0 +1,315 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "content/browser/media/android/media_session_uma_helper.h"
+
+#include "base/metrics/histogram_samples.h"
+#include "base/test/histogram_tester.h"
+#include "base/test/simple_test_clock.h"
+#include "testing/gtest/include/gtest/gtest.h"
+
+namespace content {
+
+using MediaSessionSuspendedSource =
+    MediaSessionUmaHelper::MediaSessionSuspendedSource;
+
+namespace {
+
+class MediaSessionUmaHelperTest : public testing::Test {
+ public:
+  MediaSessionUmaHelperTest() = default;
+
+  void SetUp() override {
+    clock_ = new base::SimpleTestClock();
+    clock_->SetNow(base::Time::Now());
+    media_session_uma_helper_.SetClockForTest(
+        scoped_ptr<base::SimpleTestClock>(clock_));
+  }
+
+  void TearDown() override {
+    clock_ = nullptr;
+  }
+
+  base::SimpleTestClock* clock() { return clock_; }
+
+  MediaSessionUmaHelper& media_session_uma_helper() {
+    return media_session_uma_helper_;
+  };
+
+  scoped_ptr<base::HistogramSamples> GetHistogramSamplesSinceTestStart(
+      const std::string& name) {
+    return histogram_tester_.GetHistogramSamplesSinceCreation(name);
+  }
+
+ private:
+  base::SimpleTestClock* clock_ = nullptr;
+  MediaSessionUmaHelper media_session_uma_helper_;
+  base::HistogramTester histogram_tester_;
+};
+
+}  // anonymous namespace
+
+TEST_F(MediaSessionUmaHelperTest, CreateAndKillDoesNothing) {
+  {
+    MediaSessionUmaHelper* uma_helper = new MediaSessionUmaHelper();
+    delete uma_helper;
+  }
+
+  {
+    scoped_ptr<base::HistogramSamples> samples(
+        GetHistogramSamplesSinceTestStart("Media.Session.Suspended"));
+    EXPECT_EQ(0, samples->TotalCount());
+  }
+
+  {
+    scoped_ptr<base::HistogramSamples> samples(
+        GetHistogramSamplesSinceTestStart("Media.Session.ActiveTime"));
+    EXPECT_EQ(0, samples->TotalCount());
+  }
+}
+
+TEST_F(MediaSessionUmaHelperTest, SuspendRegisterImmediately) {
+  media_session_uma_helper().RecordSessionSuspended(
+      MediaSessionSuspendedSource::SystemTransient);
+
+  scoped_ptr<base::HistogramSamples> samples(
+      GetHistogramSamplesSinceTestStart("Media.Session.Suspended"));
+  EXPECT_EQ(1, samples->TotalCount());
+  EXPECT_EQ(1, samples->GetCount(0)); // System Transient
+  EXPECT_EQ(0, samples->GetCount(1)); // System Permanent
+  EXPECT_EQ(0, samples->GetCount(2)); // UI
+}
+
+TEST_F(MediaSessionUmaHelperTest, MultipleSuspend) {
+  media_session_uma_helper().RecordSessionSuspended(
+      MediaSessionSuspendedSource::SystemTransient);
+  media_session_uma_helper().RecordSessionSuspended(
+      MediaSessionSuspendedSource::SystemPermanent);
+  media_session_uma_helper().RecordSessionSuspended(
+      MediaSessionSuspendedSource::UI);
+
+  scoped_ptr<base::HistogramSamples> samples(
+      GetHistogramSamplesSinceTestStart("Media.Session.Suspended"));
+  EXPECT_EQ(3, samples->TotalCount());
+  EXPECT_EQ(1, samples->GetCount(0)); // System Transient
+  EXPECT_EQ(1, samples->GetCount(1)); // System Permanent
+  EXPECT_EQ(1, samples->GetCount(2)); // UI
+}
+
+TEST_F(MediaSessionUmaHelperTest, MultipleSuspendSame) {
+  media_session_uma_helper().RecordSessionSuspended(
+      MediaSessionSuspendedSource::SystemPermanent);
+  media_session_uma_helper().RecordSessionSuspended(
+      MediaSessionSuspendedSource::SystemTransient);
+  media_session_uma_helper().RecordSessionSuspended(
+      MediaSessionSuspendedSource::UI);
+  media_session_uma_helper().RecordSessionSuspended(
+      MediaSessionSuspendedSource::SystemTransient);
+  media_session_uma_helper().RecordSessionSuspended(
+      MediaSessionSuspendedSource::SystemPermanent);
+  media_session_uma_helper().RecordSessionSuspended(
+      MediaSessionSuspendedSource::UI);
+
+  scoped_ptr<base::HistogramSamples> samples(
+      GetHistogramSamplesSinceTestStart("Media.Session.Suspended"));
+  EXPECT_EQ(6, samples->TotalCount());
+  EXPECT_EQ(2, samples->GetCount(0)); // System Transient
+  EXPECT_EQ(2, samples->GetCount(1)); // System Permanent
+  EXPECT_EQ(2, samples->GetCount(2)); // UI
+}
+
+TEST_F(MediaSessionUmaHelperTest, ActivationNotTerminatedDoesNotCommit) {
+  media_session_uma_helper().OnSessionActive();
+  clock()->Advance(base::TimeDelta::FromMilliseconds(1000));
+
+  scoped_ptr<base::HistogramSamples> samples(
+      GetHistogramSamplesSinceTestStart("Media.Session.ActiveTime"));
+  EXPECT_EQ(0, samples->TotalCount());
+}
+
+TEST_F(MediaSessionUmaHelperTest, SuspendActivationNotTerminatedDoesNotCommit) {
+  media_session_uma_helper().OnSessionActive();
+
+  clock()->Advance(base::TimeDelta::FromMilliseconds(1000));
+  media_session_uma_helper().OnSessionSuspended();
+
+  scoped_ptr<base::HistogramSamples> samples(
+      GetHistogramSamplesSinceTestStart("Media.Session.ActiveTime"));
+  EXPECT_EQ(0, samples->TotalCount());
+}
+
+TEST_F(MediaSessionUmaHelperTest, FullActivation) {
+  media_session_uma_helper().OnSessionActive();
+
+  clock()->Advance(base::TimeDelta::FromMilliseconds(1000));
+  media_session_uma_helper().OnSessionInactive();
+
+  scoped_ptr<base::HistogramSamples> samples(
+      GetHistogramSamplesSinceTestStart("Media.Session.ActiveTime"));
+  EXPECT_EQ(1, samples->TotalCount());
+  EXPECT_EQ(1, samples->GetCount(1000));
+}
+
+TEST_F(MediaSessionUmaHelperTest, ActivationCycleWithSuspend) {
+  media_session_uma_helper().OnSessionActive();
+
+  clock()->Advance(base::TimeDelta::FromMilliseconds(1000));
+  media_session_uma_helper().OnSessionSuspended();
+
+  clock()->Advance(base::TimeDelta::FromMilliseconds(2000));
+  media_session_uma_helper().OnSessionActive();
+
+  clock()->Advance(base::TimeDelta::FromMilliseconds(1000));
+  media_session_uma_helper().OnSessionInactive();
+
+  scoped_ptr<base::HistogramSamples> samples(
+      GetHistogramSamplesSinceTestStart("Media.Session.ActiveTime"));
+  EXPECT_EQ(1, samples->TotalCount());
+  EXPECT_EQ(1, samples->GetCount(2000));
+}
+
+TEST_F(MediaSessionUmaHelperTest, ActivationCycleWithMultipleSuspend) {
+  media_session_uma_helper().OnSessionActive();
+
+  clock()->Advance(base::TimeDelta::FromMilliseconds(1000));
+  media_session_uma_helper().OnSessionSuspended();
+
+  clock()->Advance(base::TimeDelta::FromMilliseconds(2000));
+  media_session_uma_helper().OnSessionActive();
+
+  clock()->Advance(base::TimeDelta::FromMilliseconds(1000));
+  media_session_uma_helper().OnSessionSuspended();
+
+  clock()->Advance(base::TimeDelta::FromMilliseconds(2000));
+  media_session_uma_helper().OnSessionActive();
+
+  clock()->Advance(base::TimeDelta::FromMilliseconds(1000));
+  media_session_uma_helper().OnSessionInactive();
+
+  scoped_ptr<base::HistogramSamples> samples(
+      GetHistogramSamplesSinceTestStart("Media.Session.ActiveTime"));
+  EXPECT_EQ(1, samples->TotalCount());
+  EXPECT_EQ(1, samples->GetCount(3000));
+}
+
+TEST_F(MediaSessionUmaHelperTest, MultipleActivations) {
+  media_session_uma_helper().OnSessionActive();
+
+  clock()->Advance(base::TimeDelta::FromMilliseconds(1000));
+  media_session_uma_helper().OnSessionSuspended();
+
+  clock()->Advance(base::TimeDelta::FromMilliseconds(2000));
+  media_session_uma_helper().OnSessionActive();
+
+  clock()->Advance(base::TimeDelta::FromMilliseconds(1000));
+  media_session_uma_helper().OnSessionInactive();
+
+  media_session_uma_helper().OnSessionActive();
+
+  clock()->Advance(base::TimeDelta::FromMilliseconds(1000));
+  media_session_uma_helper().OnSessionSuspended();
+
+  clock()->Advance(base::TimeDelta::FromMilliseconds(2000));
+  media_session_uma_helper().OnSessionActive();
+
+  clock()->Advance(base::TimeDelta::FromMilliseconds(1000));
+  media_session_uma_helper().OnSessionSuspended();
+
+  clock()->Advance(base::TimeDelta::FromMilliseconds(2000));
+  media_session_uma_helper().OnSessionActive();
+
+  clock()->Advance(base::TimeDelta::FromMilliseconds(1000));
+  media_session_uma_helper().OnSessionInactive();
+
+  scoped_ptr<base::HistogramSamples> samples(
+      GetHistogramSamplesSinceTestStart("Media.Session.ActiveTime"));
+  EXPECT_EQ(2, samples->TotalCount());
+  EXPECT_EQ(1, samples->GetCount(2000));
+  EXPECT_EQ(1, samples->GetCount(3000));
+}
+
+TEST_F(MediaSessionUmaHelperTest, MultipleActivationCalls) {
+  media_session_uma_helper().OnSessionActive();
+
+  clock()->Advance(base::TimeDelta::FromMilliseconds(1000));
+  media_session_uma_helper().OnSessionActive();
+
+  clock()->Advance(base::TimeDelta::FromMilliseconds(2000));
+  media_session_uma_helper().OnSessionActive();
+
+  clock()->Advance(base::TimeDelta::FromMilliseconds(500));
+  media_session_uma_helper().OnSessionInactive();
+
+  // Calling OnSessionActive() multiple times reset the start time of the
+  // session.
+  scoped_ptr<base::HistogramSamples> samples(
+      GetHistogramSamplesSinceTestStart("Media.Session.ActiveTime"));
+  EXPECT_EQ(1, samples->TotalCount());
+  EXPECT_EQ(1, samples->GetCount(500));
+}
+
+TEST_F(MediaSessionUmaHelperTest, MultipleSuspendCalls_WhileSuspended) {
+  media_session_uma_helper().OnSessionActive();
+
+  clock()->Advance(base::TimeDelta::FromMilliseconds(1000));
+  media_session_uma_helper().OnSessionSuspended();
+
+  clock()->Advance(base::TimeDelta::FromMilliseconds(2000));
+  media_session_uma_helper().OnSessionSuspended();
+
+  clock()->Advance(base::TimeDelta::FromMilliseconds(500));
+  media_session_uma_helper().OnSessionSuspended();
+
+  media_session_uma_helper().OnSessionInactive();
+
+  // If the session is already suspended, OnSessionSuspended() calls are
+  // ignored.
+  scoped_ptr<base::HistogramSamples> samples(
+      GetHistogramSamplesSinceTestStart("Media.Session.ActiveTime"));
+  EXPECT_EQ(1, samples->TotalCount());
+  EXPECT_EQ(1, samples->GetCount(1000));
+}
+
+TEST_F(MediaSessionUmaHelperTest, MultipleSuspendCalls_WhileInactive) {
+  media_session_uma_helper().OnSessionActive();
+
+  clock()->Advance(base::TimeDelta::FromMilliseconds(1000));
+  media_session_uma_helper().OnSessionInactive();
+
+  clock()->Advance(base::TimeDelta::FromMilliseconds(2000));
+  media_session_uma_helper().OnSessionSuspended();
+
+  clock()->Advance(base::TimeDelta::FromMilliseconds(500));
+  media_session_uma_helper().OnSessionSuspended();
+
+  media_session_uma_helper().OnSessionInactive();
+
+  // If the session is already inactive, OnSessionSuspended() calls are
+  // ignored.
+  scoped_ptr<base::HistogramSamples> samples(
+      GetHistogramSamplesSinceTestStart("Media.Session.ActiveTime"));
+  EXPECT_EQ(1, samples->TotalCount());
+  EXPECT_EQ(1, samples->GetCount(1000));
+}
+
+TEST_F(MediaSessionUmaHelperTest, MultipleInactiveCalls) {
+  media_session_uma_helper().OnSessionActive();
+
+  clock()->Advance(base::TimeDelta::FromMilliseconds(3000));
+  media_session_uma_helper().OnSessionInactive();
+
+  clock()->Advance(base::TimeDelta::FromMilliseconds(2000));
+  media_session_uma_helper().OnSessionInactive();
+
+  clock()->Advance(base::TimeDelta::FromMilliseconds(500));
+  media_session_uma_helper().OnSessionInactive();
+
+  // If the session is already inactive, OnSessionInactive() calls are ignored.
+  scoped_ptr<base::HistogramSamples> samples(
+      GetHistogramSamplesSinceTestStart("Media.Session.ActiveTime"));
+  EXPECT_EQ(1, samples->TotalCount());
+  EXPECT_EQ(1, samples->GetCount(3000));
+}
+
+}  // namespace content
diff --git a/content/browser/media/capture/web_contents_video_capture_device_unittest.cc b/content/browser/media/capture/web_contents_video_capture_device_unittest.cc
index 22930e5..9a72b8a 100644
--- a/content/browser/media/capture/web_contents_video_capture_device_unittest.cc
+++ b/content/browser/media/capture/web_contents_video_capture_device_unittest.cc
@@ -275,15 +275,13 @@
     gfx::Size size = controller_->GetCopyResultSize();
     SkColor color = controller_->GetSolidColor();
 
-    // Although it's not necessary, use a PlatformBitmap here (instead of a
-    // regular SkBitmap) to exercise possible threading issues.
-    skia::PlatformBitmap output;
-    EXPECT_TRUE(output.Allocate(size.width(), size.height(), false));
+    SkBitmap output;
+    EXPECT_TRUE(output.tryAllocN32Pixels(size.width(), size.height()));
     {
-      SkAutoLockPixels locker(output.GetBitmap());
-      output.GetBitmap().eraseColor(color);
+      SkAutoLockPixels locker(output);
+      output.eraseColor(color);
     }
-    callback.Run(output.GetBitmap(), content::READBACK_SUCCESS);
+    callback.Run(output, content::READBACK_SUCCESS);
     controller_->SignalCopy();
   }
 
diff --git a/content/browser/mojo/mojo_shell_context.cc b/content/browser/mojo/mojo_shell_context.cc
index 77e34e8..e359694 100644
--- a/content/browser/mojo/mojo_shell_context.cc
+++ b/content/browser/mojo/mojo_shell_context.cc
@@ -28,7 +28,8 @@
 #include "third_party/mojo/src/mojo/public/cpp/bindings/interface_request.h"
 #include "third_party/mojo/src/mojo/public/cpp/bindings/string.h"
 
-#if defined(ENABLE_MOJO_MEDIA_IN_BROWSER_PROCESS)
+#if defined(ENABLE_MOJO_MEDIA_IN_BROWSER_PROCESS) || \
+    defined(ENABLE_MOJO_MEDIA_IN_GPU_PROCESS)
 #include "media/mojo/services/mojo_media_application.h"
 #endif
 
@@ -252,7 +253,11 @@
       scoped_ptr<mojo::shell::ApplicationLoader>(
           new mojo::shell::StaticApplicationLoader(
               base::Bind(&media::MojoMediaApplication::CreateApp))),
-      media::MojoMediaApplication::AppUrl());
+      GURL("mojo:media"));
+#elif(ENABLE_MOJO_MEDIA_IN_GPU_PROCESS)
+  application_manager_->SetLoaderForURL(
+      scoped_ptr<mojo::shell::ApplicationLoader>(new GpuProcessLoader()),
+      GURL("mojo:media"));
 #endif
 }
 
diff --git a/content/browser/quota/quota_manager_unittest.cc b/content/browser/quota/quota_manager_unittest.cc
index 39c2315..56cfba41 100644
--- a/content/browser/quota/quota_manager_unittest.cc
+++ b/content/browser/quota/quota_manager_unittest.cc
@@ -58,11 +58,28 @@
 const int64 kMinimumPreserveForSystem = QuotaManager::kMinimumPreserveForSystem;
 const int kPerHostTemporaryPortion = QuotaManager::kPerHostTemporaryPortion;
 
+const GURL kTestEvictionOrigin = GURL("http://test.eviction.policy/result");
+
 // Returns a deterministic value for the amount of available disk space.
 int64 GetAvailableDiskSpaceForTest(const base::FilePath&) {
   return kAvailableSpaceForApp + kMinimumPreserveForSystem;
 }
 
+class TestEvictionPolicy : public storage::QuotaEvictionPolicy {
+ public:
+  TestEvictionPolicy() {}
+  ~TestEvictionPolicy() override {}
+
+  // Overridden from storage::QuotaEvictionPolicy:
+  void GetEvictionOrigin(const scoped_refptr<storage::SpecialStoragePolicy>&
+                             special_storage_policy,
+                         const std::map<GURL, int64>& usage_map,
+                         int64 global_quota,
+                         const storage::GetOriginCallback& callback) override {
+    callback.Run(kTestEvictionOrigin);
+  }
+};
+
 }  // namespace
 
 class QuotaManagerTest : public testing::Test {
@@ -277,12 +294,13 @@
     quota_manager_->DeleteOriginFromDatabase(origin, type);
   }
 
-  void GetLRUOrigin(StorageType type) {
-    lru_origin_ = GURL();
-    quota_manager_->GetLRUOrigin(
-        type,
-        base::Bind(&QuotaManagerTest::DidGetLRUOrigin,
-                   weak_factory_.GetWeakPtr()));
+  void GetEvictionOrigin(StorageType type) {
+    eviction_origin_ = GURL();
+    // The quota manager's default eviction policy is to use an LRU eviction
+    // policy.
+    quota_manager_->GetEvictionOrigin(
+        type, 0, base::Bind(&QuotaManagerTest::DidGetEvictionOrigin,
+                            weak_factory_.GetWeakPtr()));
   }
 
   void NotifyOriginInUse(const GURL& origin) {
@@ -366,8 +384,8 @@
     available_space_ = usage_and_quota.available_disk_space;
   }
 
-  void DidGetLRUOrigin(const GURL& origin) {
-    lru_origin_ = origin;
+  void DidGetEvictionOrigin(const GURL& origin) {
+    eviction_origin_ = origin;
   }
 
   void DidGetModifiedOrigins(const std::set<GURL>& origins, StorageType type) {
@@ -408,7 +426,7 @@
   int64 unlimited_usage() const { return unlimited_usage_; }
   int64 quota() const { return quota_; }
   int64 available_space() const { return available_space_; }
-  const GURL& lru_origin() const { return lru_origin_; }
+  const GURL& eviction_origin() const { return eviction_origin_; }
   const std::set<GURL>& modified_origins() const { return modified_origins_; }
   StorageType modified_origins_type() const { return modified_origins_type_; }
   const QuotaTableEntries& quota_entries() const { return quota_entries_; }
@@ -438,7 +456,7 @@
   int64 unlimited_usage_;
   int64 quota_;
   int64 available_space_;
-  GURL lru_origin_;
+  GURL eviction_origin_;
   std::set<GURL> modified_origins_;
   StorageType modified_origins_type_;
   QuotaTableEntries quota_entries_;
@@ -1263,6 +1281,15 @@
   EXPECT_LE(0, available_space());
 }
 
+TEST_F(QuotaManagerTest, SetTemporaryStorageEvictionPolicy) {
+  quota_manager()->SetTemporaryStorageEvictionPolicy(
+      make_scoped_ptr(new TestEvictionPolicy));
+
+  GetEvictionOrigin(kTemp);
+  base::RunLoop().RunUntilIdle();
+  EXPECT_EQ(kTestEvictionOrigin, eviction_origin());
+}
+
 TEST_F(QuotaManagerTest, EvictOriginData) {
   static const MockOriginData kData1[] = {
     { "http://foo.com/",   kTemp,     1 },
@@ -1387,19 +1414,19 @@
   EXPECT_TRUE(found_origin_in_database);
 
   for (size_t i = 0; i < kNumberOfTemporaryOrigins - 1; ++i) {
-    GetLRUOrigin(kTemp);
+    GetEvictionOrigin(kTemp);
     base::RunLoop().RunUntilIdle();
-    EXPECT_FALSE(lru_origin().is_empty());
+    EXPECT_FALSE(eviction_origin().is_empty());
     // The origin "http://foo.com/" should not be in the LRU list.
-    EXPECT_NE(std::string("http://foo.com/"), lru_origin().spec());
-    DeleteOriginFromDatabase(lru_origin(), kTemp);
+    EXPECT_NE(std::string("http://foo.com/"), eviction_origin().spec());
+    DeleteOriginFromDatabase(eviction_origin(), kTemp);
     base::RunLoop().RunUntilIdle();
   }
 
   // Now the LRU list must be empty.
-  GetLRUOrigin(kTemp);
+  GetEvictionOrigin(kTemp);
   base::RunLoop().RunUntilIdle();
-  EXPECT_TRUE(lru_origin().is_empty());
+  EXPECT_TRUE(eviction_origin().is_empty());
 
   // Deleting origins from the database should not affect the results of the
   // following checks.
@@ -1728,31 +1755,31 @@
   RegisterClient(client);
 
   GURL origin;
-  GetLRUOrigin(kTemp);
+  GetEvictionOrigin(kTemp);
   base::RunLoop().RunUntilIdle();
-  EXPECT_TRUE(lru_origin().is_empty());
+  EXPECT_TRUE(eviction_origin().is_empty());
 
   NotifyStorageAccessed(client, GURL("http://a.com/"), kTemp);
-  GetLRUOrigin(kTemp);
+  GetEvictionOrigin(kTemp);
   base::RunLoop().RunUntilIdle();
-  EXPECT_EQ("http://a.com/", lru_origin().spec());
+  EXPECT_EQ("http://a.com/", eviction_origin().spec());
 
   NotifyStorageAccessed(client, GURL("http://b.com/"), kPerm);
   NotifyStorageAccessed(client, GURL("https://a.com/"), kTemp);
   NotifyStorageAccessed(client, GURL("http://c.com/"), kTemp);
-  GetLRUOrigin(kTemp);
+  GetEvictionOrigin(kTemp);
   base::RunLoop().RunUntilIdle();
-  EXPECT_EQ("http://a.com/", lru_origin().spec());
+  EXPECT_EQ("http://a.com/", eviction_origin().spec());
 
-  DeleteOriginFromDatabase(lru_origin(), kTemp);
-  GetLRUOrigin(kTemp);
+  DeleteOriginFromDatabase(eviction_origin(), kTemp);
+  GetEvictionOrigin(kTemp);
   base::RunLoop().RunUntilIdle();
-  EXPECT_EQ("https://a.com/", lru_origin().spec());
+  EXPECT_EQ("https://a.com/", eviction_origin().spec());
 
-  DeleteOriginFromDatabase(lru_origin(), kTemp);
-  GetLRUOrigin(kTemp);
+  DeleteOriginFromDatabase(eviction_origin(), kTemp);
+  GetEvictionOrigin(kTemp);
   base::RunLoop().RunUntilIdle();
-  EXPECT_EQ("http://c.com/", lru_origin().spec());
+  EXPECT_EQ("http://c.com/", eviction_origin().spec());
 }
 
 TEST_F(QuotaManagerTest, GetLRUOriginWithOriginInUse) {
@@ -1768,46 +1795,46 @@
   RegisterClient(client);
 
   GURL origin;
-  GetLRUOrigin(kTemp);
+  GetEvictionOrigin(kTemp);
   base::RunLoop().RunUntilIdle();
-  EXPECT_TRUE(lru_origin().is_empty());
+  EXPECT_TRUE(eviction_origin().is_empty());
 
   NotifyStorageAccessed(client, GURL("http://a.com/"), kTemp);
   NotifyStorageAccessed(client, GURL("http://b.com/"), kPerm);
   NotifyStorageAccessed(client, GURL("https://a.com/"), kTemp);
   NotifyStorageAccessed(client, GURL("http://c.com/"), kTemp);
 
-  GetLRUOrigin(kTemp);
+  GetEvictionOrigin(kTemp);
   base::RunLoop().RunUntilIdle();
-  EXPECT_EQ("http://a.com/", lru_origin().spec());
+  EXPECT_EQ("http://a.com/", eviction_origin().spec());
 
   // Notify origin http://a.com is in use.
   NotifyOriginInUse(GURL("http://a.com/"));
-  GetLRUOrigin(kTemp);
+  GetEvictionOrigin(kTemp);
   base::RunLoop().RunUntilIdle();
-  EXPECT_EQ("https://a.com/", lru_origin().spec());
+  EXPECT_EQ("https://a.com/", eviction_origin().spec());
 
-  // Notify origin https://a.com is in use while GetLRUOrigin is running.
-  GetLRUOrigin(kTemp);
+  // Notify origin https://a.com is in use while GetEvictionOrigin is running.
+  GetEvictionOrigin(kTemp);
   NotifyOriginInUse(GURL("https://a.com/"));
   base::RunLoop().RunUntilIdle();
   // Post-filtering must have excluded the returned origin, so we will
   // see empty result here.
-  EXPECT_TRUE(lru_origin().is_empty());
+  EXPECT_TRUE(eviction_origin().is_empty());
 
-  // Notify access for http://c.com while GetLRUOrigin is running.
-  GetLRUOrigin(kTemp);
+  // Notify access for http://c.com while GetEvictionOrigin is running.
+  GetEvictionOrigin(kTemp);
   NotifyStorageAccessed(client, GURL("http://c.com/"), kTemp);
   base::RunLoop().RunUntilIdle();
   // Post-filtering must have excluded the returned origin, so we will
   // see empty result here.
-  EXPECT_TRUE(lru_origin().is_empty());
+  EXPECT_TRUE(eviction_origin().is_empty());
 
   NotifyOriginNoLongerInUse(GURL("http://a.com/"));
   NotifyOriginNoLongerInUse(GURL("https://a.com/"));
-  GetLRUOrigin(kTemp);
+  GetEvictionOrigin(kTemp);
   base::RunLoop().RunUntilIdle();
-  EXPECT_EQ("http://a.com/", lru_origin().spec());
+  EXPECT_EQ("http://a.com/", eviction_origin().spec());
 }
 
 TEST_F(QuotaManagerTest, GetOriginsModifiedSince) {
diff --git a/content/browser/quota/quota_temporary_storage_evictor_unittest.cc b/content/browser/quota/quota_temporary_storage_evictor_unittest.cc
index 2d63362c..d386a532 100644
--- a/content/browser/quota/quota_temporary_storage_evictor_unittest.cc
+++ b/content/browser/quota/quota_temporary_storage_evictor_unittest.cc
@@ -60,6 +60,7 @@
   }
 
   void GetEvictionOrigin(StorageType type,
+                         int64 global_quota,
                          const storage::GetOriginCallback& callback) override {
     if (origin_order_.empty())
       callback.Run(GURL());
diff --git a/content/browser/renderer_host/media/audio_input_renderer_host.cc b/content/browser/renderer_host/media/audio_input_renderer_host.cc
index 74330b9..d6011ff 100644
--- a/content/browser/renderer_host/media/audio_input_renderer_host.cc
+++ b/content/browser/renderer_host/media/audio_input_renderer_host.cc
@@ -451,8 +451,11 @@
         entry->writer.get(),
         user_input_monitor_);
   } else {
-    DCHECK_EQ(config.params.format(),
-              media::AudioParameters::AUDIO_PCM_LOW_LATENCY);
+    // We call CreateLowLatency regardless of the value of
+    // |audio_params.format|. Low latency can currently mean different things in
+    // different parts of the stack.
+    // TODO(grunell): Clean up the low latency terminology so that it's less
+    // confusing.
     entry->controller = media::AudioInputController::CreateLowLatency(
         audio_manager_,
         this,
diff --git a/content/browser/renderer_host/media/audio_renderer_host.cc b/content/browser/renderer_host/media/audio_renderer_host.cc
index 8555aab6a..c086b0f 100644
--- a/content/browser/renderer_host/media/audio_renderer_host.cc
+++ b/content/browser/renderer_host/media/audio_renderer_host.cc
@@ -404,10 +404,13 @@
     return;
   }
 
-  // If attempting to use the output device associated to an opened input
-  // device and the output device is found, reuse the input device
+  // If |device_id| is not empty, ignore |session_id| and select the device
+  // indicated by |device_id|.
+  // If |device_id| is empty and |session_id| is nonzero, try to use the
+  // output device associated with the opened input device designated by
+  // |session_id| and, if such output device is found, reuse the input device
   // permissions.
-  if (session_id != 0) {
+  if (session_id != 0 && device_id.empty()) {
     const StreamDeviceInfo* info =
         media_stream_manager_->audio_input_device_manager()
             ->GetOpenedDeviceInfoById(session_id);
diff --git a/content/child/blink_platform_impl.cc b/content/child/blink_platform_impl.cc
index 3b26b61..c8f4168 100644
--- a/content/child/blink_platform_impl.cc
+++ b/content/child/blink_platform_impl.cc
@@ -34,7 +34,6 @@
 #include "blink/public/resources/grit/blink_image_resources.h"
 #include "blink/public/resources/grit/blink_resources.h"
 #include "components/mime_util/mime_util.h"
-#include "components/scheduler/child/web_task_runner_impl.h"
 #include "components/scheduler/child/webthread_impl_for_worker_scheduler.h"
 #include "content/app/resources/grit/content_resources.h"
 #include "content/app/strings/grit/content_strings.h"
@@ -479,8 +478,7 @@
   // data URLs to bypass the ResourceDispatcher.
   return new WebURLLoaderImpl(
       child_thread ? child_thread->resource_dispatcher() : NULL,
-      make_scoped_ptr(new scheduler::WebTaskRunnerImpl(
-            base::ThreadTaskRunnerHandle::Get())));
+      MainTaskRunnerForCurrentThread());
 }
 
 blink::WebSocketHandle* BlinkPlatformImpl::createWebSocketHandle() {
@@ -1365,6 +1363,16 @@
   return base::trace_event::TraceLog::GetInstance()->process_id();
 }
 
+scoped_refptr<base::SingleThreadTaskRunner>
+BlinkPlatformImpl::MainTaskRunnerForCurrentThread() {
+  if (main_thread_task_runner_.get() &&
+      main_thread_task_runner_->BelongsToCurrentThread()) {
+    return main_thread_task_runner_;
+  } else {
+    return base::ThreadTaskRunnerHandle::Get();
+  }
+}
+
 bool BlinkPlatformImpl::IsMainThread() const {
   return main_thread_task_runner_.get() &&
          main_thread_task_runner_->BelongsToCurrentThread();
diff --git a/content/child/blink_platform_impl.h b/content/child/blink_platform_impl.h
index f9bf754b9..4ec1659 100644
--- a/content/child/blink_platform_impl.h
+++ b/content/child/blink_platform_impl.h
@@ -195,6 +195,8 @@
 
   bool IsMainThread() const;
 
+  scoped_refptr<base::SingleThreadTaskRunner> MainTaskRunnerForCurrentThread();
+
   scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner_;
   WebThemeEngineImpl native_theme_engine_;
   WebFallbackThemeEngineImpl fallback_theme_engine_;
diff --git a/content/child/child_discardable_shared_memory_manager.cc b/content/child/child_discardable_shared_memory_manager.cc
index cbe069a..1069fa7 100644
--- a/content/child/child_discardable_shared_memory_manager.cc
+++ b/content/child/child_discardable_shared_memory_manager.cc
@@ -149,6 +149,8 @@
       continue;
     }
 
+    free_span->set_is_locked(true);
+
     // Memory usage is guaranteed to have changed after having removed
     // at least one span from the free lists.
     MemoryUsageChanged(heap_.GetSize(), heap_.GetSizeOfFreeLists());
@@ -179,6 +181,7 @@
   scoped_ptr<DiscardableSharedMemoryHeap::Span> new_span(heap_.Grow(
       shared_memory.Pass(), allocation_size_in_bytes, new_id,
       base::Bind(&SendDeletedDiscardableSharedMemoryMessage, sender_, new_id)));
+  new_span->set_is_locked(true);
 
   // Unlock and insert any left over memory into free lists.
   if (pages < pages_to_allocate) {
@@ -188,6 +191,7 @@
         leftover->start() * base::GetPageSize() -
             reinterpret_cast<size_t>(leftover->shared_memory()->memory()),
         leftover->length() * base::GetPageSize());
+    leftover->set_is_locked(false);
     heap_.MergeIntoFreeLists(leftover.Pass());
   }
 
@@ -229,9 +233,11 @@
 
   switch (span->shared_memory()->Lock(offset, length)) {
     case base::DiscardableSharedMemory::SUCCESS:
+      span->set_is_locked(true);
       return true;
     case base::DiscardableSharedMemory::PURGED:
       span->shared_memory()->Unlock(offset, length);
+      span->set_is_locked(false);
       return false;
     case base::DiscardableSharedMemory::FAILED:
       return false;
@@ -250,6 +256,7 @@
       reinterpret_cast<size_t>(span->shared_memory()->memory());
   size_t length = span->length() * base::GetPageSize();
 
+  span->set_is_locked(false);
   return span->shared_memory()->Unlock(offset, length);
 }
 
diff --git a/content/child/request_info.cc b/content/child/request_info.cc
index 2af34cd5d..b115b7d 100644
--- a/content/child/request_info.cc
+++ b/content/child/request_info.cc
@@ -27,8 +27,7 @@
       enable_upload_progress(false),
       do_not_prompt_for_login(false),
       report_raw_headers(false),
-      extra_data(NULL),
-      loading_web_task_runner(nullptr) {}
+      extra_data(NULL) {}
 
 RequestInfo::~RequestInfo() {}
 
diff --git a/content/child/request_info.h b/content/child/request_info.h
index 037c1db..e610ac8 100644
--- a/content/child/request_info.h
+++ b/content/child/request_info.h
@@ -17,14 +17,9 @@
 #include "content/public/common/resource_type.h"
 #include "net/base/request_priority.h"
 #include "third_party/WebKit/public/platform/WebReferrerPolicy.h"
-#include "third_party/WebKit/public/platform/WebTaskRunner.h"
 #include "third_party/WebKit/public/platform/WebURLRequest.h"
 #include "url/gurl.h"
 
-namespace blink {
-class WebTaskRunner;
-} // namespace blink
-
 namespace content {
 
 // Structure used when calling BlinkPlatformImpl::CreateResourceLoader().
@@ -115,9 +110,6 @@
   // Extra data associated with this request.  We do not own this pointer.
   blink::WebURLRequest::ExtraData* extra_data;
 
-  // Optional, the specific task queue to execute loading tasks on.
-  scoped_ptr<blink::WebTaskRunner> loading_web_task_runner;
-
  private:
   DISALLOW_COPY_AND_ASSIGN(RequestInfo);
 };
diff --git a/content/child/resource_dispatcher.cc b/content/child/resource_dispatcher.cc
index 0c990721..684f3ee 100644
--- a/content/child/resource_dispatcher.cc
+++ b/content/child/resource_dispatcher.cc
@@ -18,7 +18,6 @@
 #include "base/strings/string_util.h"
 #include "content/child/request_extra_data.h"
 #include "content/child/request_info.h"
-#include "content/child/resource_scheduling_filter.h"
 #include "content/child/shared_memory_received_data_factory.h"
 #include "content/child/site_isolation_stats_gatherer.h"
 #include "content/child/sync_load_response.h"
@@ -415,9 +414,6 @@
         new ResourceHostMsg_ReleaseDownloadedFile(request_id));
   }
 
-  if (resource_scheduling_filter_.get())
-    resource_scheduling_filter_->ClearRequestIdTaskRunner(request_id);
-
   return true;
 }
 
@@ -603,13 +599,6 @@
                          request->url,
                          request_info.download_to_file);
 
-  if (resource_scheduling_filter_.get() &&
-      request_info.loading_web_task_runner) {
-    resource_scheduling_filter_->SetRequestIdTaskRunner(
-        request_id,
-        make_scoped_ptr(request_info.loading_web_task_runner->clone()));
-  }
-
   message_sender_->Send(new ResourceHostMsg_RequestResource(
       request_info.routing_id, request_id, *request));
 
@@ -816,9 +805,4 @@
   return request.Pass();
 }
 
-void ResourceDispatcher::SetResourceSchedulingFilter(
-    scoped_refptr<ResourceSchedulingFilter> resource_scheduling_filter) {
-  resource_scheduling_filter_ = resource_scheduling_filter;
-}
-
 }  // namespace content
diff --git a/content/child/resource_dispatcher.h b/content/child/resource_dispatcher.h
index 05500f5..864b081 100644
--- a/content/child/resource_dispatcher.h
+++ b/content/child/resource_dispatcher.h
@@ -39,7 +39,6 @@
 class RequestPeer;
 class ResourceDispatcherDelegate;
 class ResourceRequestBody;
-class ResourceSchedulingFilter;
 class ThreadedDataProvider;
 struct ResourceResponseInfo;
 struct RequestInfo;
@@ -130,9 +129,6 @@
     main_thread_task_runner_ = main_thread_task_runner;
   }
 
-  void SetResourceSchedulingFilter(
-      scoped_refptr<ResourceSchedulingFilter> resource_scheduling_filter);
-
  private:
   friend class ResourceDispatcherTest;
 
@@ -253,7 +249,6 @@
   base::TimeTicks io_timestamp_;
 
   scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner_;
-  scoped_refptr<ResourceSchedulingFilter> resource_scheduling_filter_;
 
   base::WeakPtrFactory<ResourceDispatcher> weak_factory_;
 
diff --git a/content/child/resource_scheduling_filter.cc b/content/child/resource_scheduling_filter.cc
index 6445c00..843cd871 100644
--- a/content/child/resource_scheduling_filter.cc
+++ b/content/child/resource_scheduling_filter.cc
@@ -9,32 +9,9 @@
 #include "content/child/resource_dispatcher.h"
 #include "ipc/ipc_message.h"
 #include "ipc/ipc_message_start.h"
-#include "third_party/WebKit/public/platform/WebTaskRunner.h"
-#include "third_party/WebKit/public/platform/WebTraceLocation.h"
 
 namespace content {
 
-namespace {
-class DispatchMessageTask : public blink::WebTaskRunner::Task {
- public:
-  DispatchMessageTask(
-      base::WeakPtr<ResourceSchedulingFilter> resource_scheduling_filter,
-      const IPC::Message& message)
-    : resource_scheduling_filter_(resource_scheduling_filter),
-      message_(message) {}
-
-  void run() override {
-    if (!resource_scheduling_filter_.get())
-      return;
-    resource_scheduling_filter_->DispatchMessage(message_);
-  }
-
- private:
-  base::WeakPtr<ResourceSchedulingFilter> resource_scheduling_filter_;
-  const IPC::Message message_;
-};
-} // namespace
-
 ResourceSchedulingFilter::ResourceSchedulingFilter(
     const scoped_refptr<base::SingleThreadTaskRunner>& main_thread_task_runner,
     ResourceDispatcher* resource_dispatcher)
@@ -49,42 +26,12 @@
 }
 
 bool ResourceSchedulingFilter::OnMessageReceived(const IPC::Message& message) {
-  base::AutoLock lock(request_id_to_task_runner_map_lock_);
-  int request_id;
-
-  base::PickleIterator pickle_iterator(message);
-  if (!pickle_iterator.ReadInt(&request_id)) {
-    NOTREACHED() << "malformed resource message";
-    return true;
-  }
-  // Dispatch the message on the request id specific task runner, if there is
-  // one, or on the general main_thread_task_runner if there isn't.
-  RequestIdToTaskRunnerMap::const_iterator iter =
-      request_id_to_task_runner_map_.find(request_id);
-  if (iter != request_id_to_task_runner_map_.end()) {
-    // TODO(alexclarke): Find a way to let blink and chromium FROM_HERE coexist.
-    iter->second->postTask(
-        blink::WebTraceLocation(__FUNCTION__, __FILE__),
-        new DispatchMessageTask(weak_ptr_factory_.GetWeakPtr(), message));
-  } else {
-    main_thread_task_runner_->PostTask(
-        FROM_HERE, base::Bind(&ResourceSchedulingFilter::DispatchMessage,
-                              weak_ptr_factory_.GetWeakPtr(), message));
-  }
+  main_thread_task_runner_->PostTask(
+      FROM_HERE, base::Bind(&ResourceSchedulingFilter::DispatchMessage,
+                            weak_ptr_factory_.GetWeakPtr(), message));
   return true;
 }
 
-void ResourceSchedulingFilter::SetRequestIdTaskRunner(
-    int id, scoped_ptr<blink::WebTaskRunner> web_task_runner) {
-  base::AutoLock lock(request_id_to_task_runner_map_lock_);
-  request_id_to_task_runner_map_.insert(id, web_task_runner.Pass());
-}
-
-void ResourceSchedulingFilter::ClearRequestIdTaskRunner(int id) {
-  base::AutoLock lock(request_id_to_task_runner_map_lock_);
-  request_id_to_task_runner_map_.erase(id);
-}
-
 bool ResourceSchedulingFilter::GetSupportedMessageClasses(
     std::vector<uint32>* supported_message_classes) const {
   supported_message_classes->push_back(ResourceMsgStart);
diff --git a/content/child/resource_scheduling_filter.h b/content/child/resource_scheduling_filter.h
index fd245592..7ea73c90 100644
--- a/content/child/resource_scheduling_filter.h
+++ b/content/child/resource_scheduling_filter.h
@@ -5,19 +5,12 @@
 #ifndef CONTENT_CHILD_RESOURCE_SCHEDULING_FILTER_H_
 #define CONTENT_CHILD_RESOURCE_SCHEDULING_FILTER_H_
 
-#include <map>
-
 #include "base/containers/hash_tables.h"
-#include "base/containers/scoped_ptr_map.h"
 #include "base/memory/weak_ptr.h"
 #include "base/single_thread_task_runner.h"
 #include "content/common/content_export.h"
 #include "ipc/message_filter.h"
 
-namespace blink {
-class WebTaskRunner;
-}
-
 namespace content {
 class ResourceDispatcher;
 
@@ -35,24 +28,10 @@
   bool GetSupportedMessageClasses(
       std::vector<uint32>* supported_message_classes) const override;
 
-  // Sets the task runner associated with request messages with |id|.
-  void SetRequestIdTaskRunner(
-      int id, scoped_ptr<blink::WebTaskRunner> web_task_runner);
-
-  // Removes the task runner associated with |id|.
-  void ClearRequestIdTaskRunner(int id);
-
-  void DispatchMessage(const IPC::Message& message);
-
- private:
+ protected:
   ~ResourceSchedulingFilter() override;
 
-  typedef base::ScopedPtrMap<int, scoped_ptr<blink::WebTaskRunner>>
-      RequestIdToTaskRunnerMap;
-
-  // This lock guards |request_id_to_task_runner_map_|
-  base::Lock request_id_to_task_runner_map_lock_;
-  RequestIdToTaskRunnerMap request_id_to_task_runner_map_;
+  void DispatchMessage(const IPC::Message& message);
 
   scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner_;
   ResourceDispatcher* resource_dispatcher_;  // NOT OWNED
diff --git a/content/child/web_url_loader_impl.cc b/content/child/web_url_loader_impl.cc
index 68851d4..bf669cc 100644
--- a/content/child/web_url_loader_impl.cc
+++ b/content/child/web_url_loader_impl.cc
@@ -16,7 +16,6 @@
 #include "base/strings/string_util.h"
 #include "base/time/time.h"
 #include "components/mime_util/mime_util.h"
-#include "components/scheduler/child/web_task_runner_impl.h"
 #include "content/child/child_thread_impl.h"
 #include "content/child/ftp_directory_listing_response_delegate.h"
 #include "content/child/multipart_response_delegate.h"
@@ -43,7 +42,6 @@
 #include "net/ssl/ssl_connection_status_flags.h"
 #include "net/url_request/url_request_data_job.h"
 #include "third_party/WebKit/public/platform/WebHTTPLoadInfo.h"
-#include "third_party/WebKit/public/platform/WebTraceLocation.h"
 #include "third_party/WebKit/public/platform/WebURL.h"
 #include "third_party/WebKit/public/platform/WebURLError.h"
 #include "third_party/WebKit/public/platform/WebURLLoadTiming.h"
@@ -256,7 +254,7 @@
  public:
   Context(WebURLLoaderImpl* loader,
           ResourceDispatcher* resource_dispatcher,
-          scoped_ptr<blink::WebTaskRunner> task_runner);
+          scoped_refptr<base::SingleThreadTaskRunner> task_runner);
 
   WebURLLoaderClient* client() const { return client_; }
   void set_client(WebURLLoaderClient* client) { client_ = client; }
@@ -269,7 +267,6 @@
       blink::WebThreadedDataReceiver* threaded_data_receiver);
   void Start(const WebURLRequest& request,
              SyncLoadResponse* sync_load_response);
-  void SetWebTaskRunner(scoped_ptr<blink::WebTaskRunner> task_runner);
 
   // RequestPeer methods:
   void OnUploadProgress(uint64 position, uint64 size) override;
@@ -298,19 +295,6 @@
   friend class base::RefCounted<Context>;
   ~Context() override;
 
-  class HandleDataURLTask : public blink::WebTaskRunner::Task {
-   public:
-    explicit HandleDataURLTask(scoped_refptr<Context> context)
-        : context_(context) {}
-
-    void run() override {
-      context_->HandleDataURL();
-    }
-
-   private:
-    scoped_refptr<Context> context_;
-  };
-
   // Called when the body data stream is detached from the reader side.
   void CancelBodyStreaming();
   // We can optimize the handling of data URLs in most cases.
@@ -321,7 +305,7 @@
   WebURLRequest request_;
   WebURLLoaderClient* client_;
   ResourceDispatcher* resource_dispatcher_;
-  scoped_ptr<blink::WebTaskRunner> web_task_runner_;
+  scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
   WebReferrerPolicy referrer_policy_;
   scoped_ptr<FtpDirectoryListingResponseDelegate> ftp_listing_delegate_;
   scoped_ptr<MultipartResponseDelegate> multipart_delegate_;
@@ -335,11 +319,11 @@
 WebURLLoaderImpl::Context::Context(
     WebURLLoaderImpl* loader,
     ResourceDispatcher* resource_dispatcher,
-    scoped_ptr<blink::WebTaskRunner> web_task_runner)
+    scoped_refptr<base::SingleThreadTaskRunner> task_runner)
     : loader_(loader),
       client_(NULL),
       resource_dispatcher_(resource_dispatcher),
-      web_task_runner_(web_task_runner.Pass()),
+      task_runner_(task_runner),
       referrer_policy_(blink::WebReferrerPolicyDefault),
       defers_loading_(NOT_DEFERRING),
       request_id_(-1) {
@@ -375,11 +359,8 @@
     defers_loading_ = SHOULD_DEFER;
   } else if (!value && defers_loading_ != NOT_DEFERRING) {
     if (defers_loading_ == DEFERRED_DATA) {
-      // TODO(alexclarke): Find a way to let blink and chromium FROM_HERE
-      // coexist.
-      web_task_runner_->postTask(
-          ::blink::WebTraceLocation(__FUNCTION__, __FILE__),
-          new HandleDataURLTask(this));
+      task_runner_->PostTask(FROM_HERE,
+                             base::Bind(&Context::HandleDataURL, this));
     }
     defers_loading_ = NOT_DEFERRING;
   }
@@ -437,11 +418,8 @@
           GetInfoFromDataURL(sync_load_response->url, sync_load_response,
                              &sync_load_response->data);
     } else {
-      // TODO(alexclarke): Find a way to let blink and chromium FROM_HERE
-      // coexist.
-      web_task_runner_->postTask(
-          ::blink::WebTraceLocation(__FUNCTION__, __FILE__),
-          new HandleDataURLTask(this));
+      task_runner_->PostTask(FROM_HERE,
+                             base::Bind(&Context::HandleDataURL, this));
     }
     return;
   }
@@ -504,7 +482,6 @@
       GetRequestContextFrameTypeForWebURLRequest(request);
   request_info.extra_data = request.extraData();
   request_info.report_raw_headers = request.reportRawHeaders();
-  request_info.loading_web_task_runner.reset(web_task_runner_->clone());
 
   scoped_refptr<ResourceRequestBody> request_body =
       GetRequestBodyForWebURLRequest(request).get();
@@ -519,11 +496,6 @@
       request_info, request_body.get(), this);
 }
 
-void WebURLLoaderImpl::Context::SetWebTaskRunner(
-    scoped_ptr<blink::WebTaskRunner> web_task_runner) {
-  web_task_runner_ = web_task_runner.Pass();
-}
-
 void WebURLLoaderImpl::Context::OnUploadProgress(uint64 position, uint64 size) {
   if (client_)
     client_->didSendData(loader_, position, size);
@@ -869,8 +841,8 @@
 
 WebURLLoaderImpl::WebURLLoaderImpl(
     ResourceDispatcher* resource_dispatcher,
-    scoped_ptr<blink::WebTaskRunner> web_task_runner)
-    : context_(new Context(this, resource_dispatcher, web_task_runner.Pass())) {
+    scoped_refptr<base::SingleThreadTaskRunner> task_runner)
+    : context_(new Context(this, resource_dispatcher, task_runner)) {
 }
 
 WebURLLoaderImpl::~WebURLLoaderImpl() {
@@ -1087,11 +1059,4 @@
   return context_->AttachThreadedDataReceiver(threaded_data_receiver);
 }
 
-void WebURLLoaderImpl::setLoadingTaskRunner(
-    blink::WebTaskRunner* loading_task_runner) {
-  // There's no guarantee on the lifetime of |loading_task_runner| so we take a
-  // copy.
-  context_->SetWebTaskRunner(make_scoped_ptr(loading_task_runner->clone()));
-}
-
 }  // namespace content
diff --git a/content/child/web_url_loader_impl.h b/content/child/web_url_loader_impl.h
index b31b57e..ebad018 100644
--- a/content/child/web_url_loader_impl.h
+++ b/content/child/web_url_loader_impl.h
@@ -36,10 +36,9 @@
 class CONTENT_EXPORT WebURLLoaderImpl
     : public NON_EXPORTED_BASE(blink::WebURLLoader) {
  public:
-
-  // Takes ownership of |web_task_runner|.
-  WebURLLoaderImpl(ResourceDispatcher* resource_dispatcher,
-                   scoped_ptr<blink::WebTaskRunner> web_task_runner);
+  explicit WebURLLoaderImpl(
+      ResourceDispatcher* resource_dispatcher,
+      scoped_refptr<base::SingleThreadTaskRunner> task_runner);
   ~WebURLLoaderImpl() override;
 
   static void PopulateURLResponse(const GURL& url,
@@ -68,7 +67,6 @@
                          int intra_priority_value) override;
   bool attachThreadedDataReceiver(
       blink::WebThreadedDataReceiver* threaded_data_receiver) override;
-  void setLoadingTaskRunner(blink::WebTaskRunner* loading_task_runner) override;
 
  private:
   class Context;
diff --git a/content/child/web_url_loader_impl_unittest.cc b/content/child/web_url_loader_impl_unittest.cc
index 00354dd..6fb686e4 100644
--- a/content/child/web_url_loader_impl_unittest.cc
+++ b/content/child/web_url_loader_impl_unittest.cc
@@ -13,7 +13,6 @@
 #include "base/message_loop/message_loop.h"
 #include "base/single_thread_task_runner.h"
 #include "base/time/time.h"
-#include "components/scheduler/child/web_task_runner_impl.h"
 #include "content/child/request_extra_data.h"
 #include "content/child/request_info.h"
 #include "content/child/resource_dispatcher.h"
@@ -107,10 +106,7 @@
   TestWebURLLoaderClient(
       ResourceDispatcher* dispatcher,
       scoped_refptr<base::SingleThreadTaskRunner> task_runner)
-      : loader_(
-          new WebURLLoaderImpl(
-              dispatcher,
-              make_scoped_ptr(new scheduler::WebTaskRunnerImpl(task_runner)))),
+      : loader_(new WebURLLoaderImpl(dispatcher, task_runner)),
         expect_multipart_response_(false),
         delete_on_receive_redirect_(false),
         delete_on_receive_response_(false),
diff --git a/content/common/content_switches_internal.cc b/content/common/content_switches_internal.cc
index c97af030..933d0144 100644
--- a/content/common/content_switches_internal.cc
+++ b/content/common/content_switches_internal.cc
@@ -109,4 +109,10 @@
   }
 }
 
+bool IsUseZoomForDSFEnabled() {
+  static bool enabled = base::CommandLine::ForCurrentProcess()->HasSwitch(
+      switches::kEnableUseZoomForDSF);
+  return enabled;
+}
+
 } // namespace content
diff --git a/content/common/content_switches_internal.h b/content/common/content_switches_internal.h
index e2b1cc6..692e1a7 100644
--- a/content/common/content_switches_internal.h
+++ b/content/common/content_switches_internal.h
@@ -21,6 +21,8 @@
 #endif
 V8CacheOptions GetV8CacheOptions();
 
+bool IsUseZoomForDSFEnabled();
+
 } // namespace content
 
 #endif  // CONTENT_COMMON_CONTENT_SWITCHES_INTERNAL_H_
diff --git a/content/common/discardable_shared_memory_heap.cc b/content/common/discardable_shared_memory_heap.cc
index ccf2729..bf124f7 100644
--- a/content/common/discardable_shared_memory_heap.cc
+++ b/content/common/discardable_shared_memory_heap.cc
@@ -28,8 +28,10 @@
     base::DiscardableSharedMemory* shared_memory,
     size_t start,
     size_t length)
-    : shared_memory_(shared_memory), start_(start), length_(length) {
-}
+    : shared_memory_(shared_memory),
+      start_(start),
+      length_(length),
+      is_locked_(false) {}
 
 DiscardableSharedMemoryHeap::Span::~Span() {
 }
@@ -278,6 +280,7 @@
   if (extra) {
     scoped_ptr<Span> leftover(
         new Span(serving->shared_memory_, serving->start_ + blocks, extra));
+    leftover->set_is_locked(false);
     DCHECK_IMPLIES(extra > 1, spans_.find(leftover->start_) == spans_.end());
     RegisterSpan(leftover.get());
 
@@ -366,18 +369,24 @@
     int32_t segment_id,
     base::trace_event::ProcessMemoryDump* pmd) {
   size_t allocated_objects_count = 0;
-  size_t allocated_objects_size_in_bytes = 0;
+  size_t allocated_objects_size_in_blocks = 0;
+  size_t locked_objects_size_in_blocks = 0;
   size_t offset =
       reinterpret_cast<size_t>(shared_memory->memory()) / block_size_;
   size_t end = offset + size / block_size_;
   while (offset < end) {
     Span* span = spans_[offset];
     if (!IsInFreeList(span)) {
+      allocated_objects_size_in_blocks += span->length_;
+      locked_objects_size_in_blocks += span->is_locked_ ? span->length_ : 0;
       allocated_objects_count++;
-      allocated_objects_size_in_bytes += span->length_ * block_size_;
     }
     offset += span->length_;
   }
+  size_t allocated_objects_size_in_bytes =
+      allocated_objects_size_in_blocks * block_size_;
+  size_t locked_objects_size_in_bytes =
+      locked_objects_size_in_blocks * block_size_;
 
   std::string segment_dump_name =
       base::StringPrintf("discardable/segment_%d", segment_id);
@@ -385,16 +394,19 @@
       pmd->CreateAllocatorDump(segment_dump_name);
   segment_dump->AddScalar(base::trace_event::MemoryAllocatorDump::kNameSize,
                           base::trace_event::MemoryAllocatorDump::kUnitsBytes,
-                          static_cast<uint64_t>(size));
+                          size);
 
   base::trace_event::MemoryAllocatorDump* obj_dump =
       pmd->CreateAllocatorDump(segment_dump_name + "/allocated_objects");
   obj_dump->AddScalar(base::trace_event::MemoryAllocatorDump::kNameObjectCount,
                       base::trace_event::MemoryAllocatorDump::kUnitsObjects,
-                      static_cast<uint64_t>(allocated_objects_count));
+                      allocated_objects_count);
   obj_dump->AddScalar(base::trace_event::MemoryAllocatorDump::kNameSize,
                       base::trace_event::MemoryAllocatorDump::kUnitsBytes,
-                      static_cast<uint64_t>(allocated_objects_size_in_bytes));
+                      allocated_objects_size_in_bytes);
+  obj_dump->AddScalar("locked_size",
+                      base::trace_event::MemoryAllocatorDump::kUnitsBytes,
+                      locked_objects_size_in_bytes);
 
   // Emit an ownership edge towards a global allocator dump node. This allows
   // to avoid double-counting segments when both browser and child process emit
diff --git a/content/common/discardable_shared_memory_heap.h b/content/common/discardable_shared_memory_heap.h
index 100b03f..ce8787a 100644
--- a/content/common/discardable_shared_memory_heap.h
+++ b/content/common/discardable_shared_memory_heap.h
@@ -30,6 +30,7 @@
     base::DiscardableSharedMemory* shared_memory() { return shared_memory_; }
     size_t start() const { return start_; }
     size_t length() const { return length_; }
+    void set_is_locked(bool is_locked) { is_locked_ = is_locked; }
 
    private:
     friend class DiscardableSharedMemoryHeap;
@@ -41,6 +42,7 @@
     base::DiscardableSharedMemory* shared_memory_;
     size_t start_;
     size_t length_;
+    bool is_locked_;
 
     DISALLOW_COPY_AND_ASSIGN(Span);
   };
diff --git a/content/common/gpu/gpu_channel.cc b/content/common/gpu/gpu_channel.cc
index 8f09dc4..114ee31 100644
--- a/content/common/gpu/gpu_channel.cc
+++ b/content/common/gpu/gpu_channel.cc
@@ -1042,7 +1042,7 @@
     case gfx::SHARED_MEMORY_BUFFER: {
       scoped_refptr<gfx::GLImageSharedMemory> image(
           new gfx::GLImageSharedMemory(size, internalformat));
-      if (!image->Initialize(handle, format))
+      if (!image->Initialize(handle.handle, handle.id, format))
         return scoped_refptr<gfx::GLImage>();
 
       return image;
diff --git a/content/common/gpu/gpu_memory_buffer_factory_io_surface.cc b/content/common/gpu/gpu_memory_buffer_factory_io_surface.cc
index 7590f32..f57ea95 100644
--- a/content/common/gpu/gpu_memory_buffer_factory_io_surface.cc
+++ b/content/common/gpu/gpu_memory_buffer_factory_io_surface.cc
@@ -220,8 +220,8 @@
     return scoped_refptr<gfx::GLImage>();
 
   scoped_refptr<gfx::GLImageIOSurface> image(
-      new gfx::GLImageIOSurface(handle.id, size, internalformat));
-  if (!image->Initialize(it->second.get(), format))
+      new gfx::GLImageIOSurface(size, internalformat));
+  if (!image->Initialize(it->second.get(), handle.id, format))
     return scoped_refptr<gfx::GLImage>();
 
   return image;
diff --git a/content/common/gpu/gpu_process_launch_causes.h b/content/common/gpu/gpu_process_launch_causes.h
index a605a230..533a5943 100644
--- a/content/common/gpu/gpu_process_launch_causes.h
+++ b/content/common/gpu/gpu_process_launch_causes.h
@@ -8,7 +8,7 @@
 namespace content {
 
 // If you change this enum you also need to update
-// http://cs/file:chrome/histograms.xml
+// tools/metrics/histograms/histograms.xml
 enum CauseForGpuLaunch {
   // Start enum from 2 to keep the same values for the histogram.
   CAUSE_FOR_GPU_LAUNCH_GPUDATAMANAGER_REQUESTCOMPLETEGPUINFOIFNEEDED = 2,
@@ -31,5 +31,4 @@
 
 }  // namespace content
 
-
 #endif  // CONTENT_COMMON_GPU_GPU_PROCESS_LAUNCH_CAUSES_H_
diff --git a/content/common/gpu/media/h264_decoder.cc b/content/common/gpu/media/h264_decoder.cc
index 6f9c9180..6caedb5 100644
--- a/content/common/gpu/media/h264_decoder.cc
+++ b/content/common/gpu/media/h264_decoder.cc
@@ -21,13 +21,10 @@
 }
 
 H264Decoder::H264Decoder(H264Accelerator* accelerator)
-    : max_pic_order_cnt_lsb_(0),
-      max_frame_num_(0),
+    : max_frame_num_(0),
       max_pic_num_(0),
       max_long_term_frame_idx_(0),
       max_num_reorder_frames_(0),
-      curr_sps_id_(-1),
-      curr_pps_id_(-1),
       accelerator_(accelerator) {
   DCHECK(accelerator_);
   Reset();
@@ -41,10 +38,13 @@
   curr_pic_ = nullptr;
   curr_nalu_ = nullptr;
   curr_slice_hdr_ = nullptr;
+  curr_sps_id_ = -1;
+  curr_pps_id_ = -1;
 
-  frame_num_ = 0;
   prev_frame_num_ = -1;
+  prev_ref_frame_num_ = -1;
   prev_frame_num_offset_ = -1;
+  prev_has_memmgmnt5_ = false;
 
   prev_ref_has_memmgmnt5_ = false;
   prev_ref_top_field_order_cnt_ = -1;
@@ -65,14 +65,15 @@
     state_ = kAfterReset;
 }
 
-void H264Decoder::PrepareRefPicLists(media::H264SliceHeader* slice_hdr) {
+void H264Decoder::PrepareRefPicLists(const media::H264SliceHeader* slice_hdr) {
   ConstructReferencePicListsP(slice_hdr);
   ConstructReferencePicListsB(slice_hdr);
 }
 
-bool H264Decoder::ModifyReferencePicLists(media::H264SliceHeader* slice_hdr,
-                                          H264Picture::Vector* ref_pic_list0,
-                                          H264Picture::Vector* ref_pic_list1) {
+bool H264Decoder::ModifyReferencePicLists(
+    const media::H264SliceHeader* slice_hdr,
+    H264Picture::Vector* ref_pic_list0,
+    H264Picture::Vector* ref_pic_list1) {
   ref_pic_list0->clear();
   ref_pic_list1->clear();
 
@@ -97,10 +98,25 @@
   return accelerator_->SubmitDecode(curr_pic_);
 }
 
-bool H264Decoder::InitCurrPicture(media::H264SliceHeader* slice_hdr) {
+bool H264Decoder::InitNonexistingPicture(scoped_refptr<H264Picture> pic,
+                                         int frame_num) {
+  pic->nonexisting = true;
+  pic->nal_ref_idc = 1;
+  pic->frame_num = pic->pic_num = frame_num;
+  pic->adaptive_ref_pic_marking_mode_flag = false;
+  pic->ref = true;
+  pic->long_term_reference_flag = false;
+  pic->field = H264Picture::FIELD_NONE;
+
+  return CalculatePicOrderCounts(pic);
+}
+
+bool H264Decoder::InitCurrPicture(const media::H264SliceHeader* slice_hdr) {
   DCHECK(curr_pic_.get());
 
   curr_pic_->idr = slice_hdr->idr_pic_flag;
+  if (curr_pic_->idr)
+    curr_pic_->idr_pic_id = slice_hdr->idr_pic_id;
 
   if (slice_hdr->field_pic_flag) {
     curr_pic_->field = slice_hdr->bottom_field_flag ? H264Picture::FIELD_BOTTOM
@@ -109,11 +125,43 @@
     curr_pic_->field = H264Picture::FIELD_NONE;
   }
 
+  if (curr_pic_->field != H264Picture::FIELD_NONE) {
+    DVLOG(1) << "Interlaced video not supported.";
+    return false;
+  }
+
+  curr_pic_->nal_ref_idc = slice_hdr->nal_ref_idc;
   curr_pic_->ref = slice_hdr->nal_ref_idc != 0;
   // This assumes non-interlaced stream.
   curr_pic_->frame_num = curr_pic_->pic_num = slice_hdr->frame_num;
 
-  if (!CalculatePicOrderCounts(slice_hdr))
+  DCHECK_NE(curr_sps_id_, -1);
+  const media::H264SPS* sps = parser_.GetSPS(curr_sps_id_);
+  if (!sps)
+    return false;
+
+  curr_pic_->pic_order_cnt_type = sps->pic_order_cnt_type;
+  switch (curr_pic_->pic_order_cnt_type) {
+    case 0:
+      curr_pic_->pic_order_cnt_lsb = slice_hdr->pic_order_cnt_lsb;
+      curr_pic_->delta_pic_order_cnt_bottom =
+          slice_hdr->delta_pic_order_cnt_bottom;
+      break;
+
+    case 1:
+      curr_pic_->delta_pic_order_cnt0 = slice_hdr->delta_pic_order_cnt0;
+      curr_pic_->delta_pic_order_cnt1 = slice_hdr->delta_pic_order_cnt1;
+      break;
+
+    case 2:
+      break;
+
+    default:
+      NOTREACHED();
+      return false;
+  }
+
+  if (!CalculatePicOrderCounts(curr_pic_))
     return false;
 
   curr_pic_->long_term_reference_flag = slice_hdr->long_term_reference_flag;
@@ -134,18 +182,17 @@
   return true;
 }
 
-bool H264Decoder::CalculatePicOrderCounts(media::H264SliceHeader* slice_hdr) {
-  DCHECK_NE(curr_sps_id_, -1);
+bool H264Decoder::CalculatePicOrderCounts(scoped_refptr<H264Picture> pic) {
   const media::H264SPS* sps = parser_.GetSPS(curr_sps_id_);
+  if (!sps)
+    return false;
 
-  int pic_order_cnt_lsb = slice_hdr->pic_order_cnt_lsb;
-  curr_pic_->pic_order_cnt_lsb = pic_order_cnt_lsb;
-
-  switch (sps->pic_order_cnt_type) {
-    case 0:
+  switch (pic->pic_order_cnt_type) {
+    case 0: {
       // See spec 8.2.1.1.
       int prev_pic_order_cnt_msb, prev_pic_order_cnt_lsb;
-      if (slice_hdr->idr_pic_flag) {
+
+      if (pic->idr) {
         prev_pic_order_cnt_msb = prev_pic_order_cnt_lsb = 0;
       } else {
         if (prev_ref_has_memmgmnt5_) {
@@ -162,57 +209,57 @@
         }
       }
 
-      DCHECK_NE(max_pic_order_cnt_lsb_, 0);
-      if ((pic_order_cnt_lsb < prev_pic_order_cnt_lsb) &&
-          (prev_pic_order_cnt_lsb - pic_order_cnt_lsb >=
-           max_pic_order_cnt_lsb_ / 2)) {
-        curr_pic_->pic_order_cnt_msb = prev_pic_order_cnt_msb +
-          max_pic_order_cnt_lsb_;
-      } else if ((pic_order_cnt_lsb > prev_pic_order_cnt_lsb) &&
-          (pic_order_cnt_lsb - prev_pic_order_cnt_lsb >
-           max_pic_order_cnt_lsb_ / 2)) {
-        curr_pic_->pic_order_cnt_msb = prev_pic_order_cnt_msb -
-          max_pic_order_cnt_lsb_;
+      int max_pic_order_cnt_lsb =
+          1 << (sps->log2_max_pic_order_cnt_lsb_minus4 + 4);
+      DCHECK_NE(max_pic_order_cnt_lsb, 0);
+      if ((pic->pic_order_cnt_lsb < prev_pic_order_cnt_lsb) &&
+          (prev_pic_order_cnt_lsb - pic->pic_order_cnt_lsb >=
+           max_pic_order_cnt_lsb / 2)) {
+        pic->pic_order_cnt_msb = prev_pic_order_cnt_msb + max_pic_order_cnt_lsb;
+      } else if ((pic->pic_order_cnt_lsb > prev_pic_order_cnt_lsb) &&
+                 (pic->pic_order_cnt_lsb - prev_pic_order_cnt_lsb >
+                  max_pic_order_cnt_lsb / 2)) {
+        pic->pic_order_cnt_msb = prev_pic_order_cnt_msb - max_pic_order_cnt_lsb;
       } else {
-        curr_pic_->pic_order_cnt_msb = prev_pic_order_cnt_msb;
+        pic->pic_order_cnt_msb = prev_pic_order_cnt_msb;
       }
 
-      if (curr_pic_->field != H264Picture::FIELD_BOTTOM) {
-        curr_pic_->top_field_order_cnt = curr_pic_->pic_order_cnt_msb +
-          pic_order_cnt_lsb;
+      if (pic->field != H264Picture::FIELD_BOTTOM) {
+        pic->top_field_order_cnt =
+            pic->pic_order_cnt_msb + pic->pic_order_cnt_lsb;
       }
 
-      if (curr_pic_->field != H264Picture::FIELD_TOP) {
-        // TODO posciak: perhaps replace with pic->field?
-        if (!slice_hdr->field_pic_flag) {
-          curr_pic_->bottom_field_order_cnt = curr_pic_->top_field_order_cnt +
-            slice_hdr->delta_pic_order_cnt_bottom;
+      if (pic->field != H264Picture::FIELD_TOP) {
+        if (pic->field == H264Picture::FIELD_NONE) {
+          pic->bottom_field_order_cnt =
+              pic->top_field_order_cnt + pic->delta_pic_order_cnt_bottom;
         } else {
-          curr_pic_->bottom_field_order_cnt = curr_pic_->pic_order_cnt_msb +
-            pic_order_cnt_lsb;
+          pic->bottom_field_order_cnt =
+              pic->pic_order_cnt_msb + pic->pic_order_cnt_lsb;
         }
       }
       break;
+    }
 
     case 1: {
       // See spec 8.2.1.2.
       if (prev_has_memmgmnt5_)
         prev_frame_num_offset_ = 0;
 
-      if (slice_hdr->idr_pic_flag)
-        curr_pic_->frame_num_offset = 0;
-      else if (prev_frame_num_ > slice_hdr->frame_num)
-        curr_pic_->frame_num_offset = prev_frame_num_offset_ + max_frame_num_;
+      if (pic->idr)
+        pic->frame_num_offset = 0;
+      else if (prev_frame_num_ > pic->frame_num)
+        pic->frame_num_offset = prev_frame_num_offset_ + max_frame_num_;
       else
-        curr_pic_->frame_num_offset = prev_frame_num_offset_;
+        pic->frame_num_offset = prev_frame_num_offset_;
 
       int abs_frame_num = 0;
       if (sps->num_ref_frames_in_pic_order_cnt_cycle != 0)
-        abs_frame_num = curr_pic_->frame_num_offset + slice_hdr->frame_num;
+        abs_frame_num = pic->frame_num_offset + pic->frame_num;
       else
         abs_frame_num = 0;
 
-      if (slice_hdr->nal_ref_idc == 0 && abs_frame_num > 0)
+      if (pic->nal_ref_idc == 0 && abs_frame_num > 0)
         --abs_frame_num;
 
       int expected_pic_order_cnt = 0;
@@ -235,91 +282,90 @@
           expected_pic_order_cnt += sps->offset_for_ref_frame[i];
       }
 
-      if (!slice_hdr->nal_ref_idc)
+      if (!pic->nal_ref_idc)
         expected_pic_order_cnt += sps->offset_for_non_ref_pic;
 
-      if (!slice_hdr->field_pic_flag) {
-        curr_pic_->top_field_order_cnt = expected_pic_order_cnt +
-            slice_hdr->delta_pic_order_cnt0;
-        curr_pic_->bottom_field_order_cnt = curr_pic_->top_field_order_cnt +
-            sps->offset_for_top_to_bottom_field +
-            slice_hdr->delta_pic_order_cnt1;
-      } else if (!slice_hdr->bottom_field_flag) {
-        curr_pic_->top_field_order_cnt = expected_pic_order_cnt +
-            slice_hdr->delta_pic_order_cnt0;
+      if (pic->field == H264Picture::FIELD_NONE) {
+        pic->top_field_order_cnt =
+            expected_pic_order_cnt + pic->delta_pic_order_cnt0;
+        pic->bottom_field_order_cnt = pic->top_field_order_cnt +
+                                      sps->offset_for_top_to_bottom_field +
+                                      pic->delta_pic_order_cnt1;
+      } else if (pic->field != H264Picture::FIELD_BOTTOM) {
+        pic->top_field_order_cnt =
+            expected_pic_order_cnt + pic->delta_pic_order_cnt0;
       } else {
-        curr_pic_->bottom_field_order_cnt = expected_pic_order_cnt +
-            sps->offset_for_top_to_bottom_field +
-            slice_hdr->delta_pic_order_cnt0;
+        pic->bottom_field_order_cnt = expected_pic_order_cnt +
+                                      sps->offset_for_top_to_bottom_field +
+                                      pic->delta_pic_order_cnt0;
       }
       break;
     }
 
-    case 2:
+    case 2: {
       // See spec 8.2.1.3.
       if (prev_has_memmgmnt5_)
         prev_frame_num_offset_ = 0;
 
-      if (slice_hdr->idr_pic_flag)
-        curr_pic_->frame_num_offset = 0;
-      else if (prev_frame_num_ > slice_hdr->frame_num)
-        curr_pic_->frame_num_offset = prev_frame_num_offset_ + max_frame_num_;
+      if (pic->idr)
+        pic->frame_num_offset = 0;
+      else if (prev_frame_num_ > pic->frame_num)
+        pic->frame_num_offset = prev_frame_num_offset_ + max_frame_num_;
       else
-        curr_pic_->frame_num_offset = prev_frame_num_offset_;
+        pic->frame_num_offset = prev_frame_num_offset_;
 
       int temp_pic_order_cnt;
-      if (slice_hdr->idr_pic_flag) {
+      if (pic->idr) {
         temp_pic_order_cnt = 0;
-      } else if (!slice_hdr->nal_ref_idc) {
-        temp_pic_order_cnt =
-            2 * (curr_pic_->frame_num_offset + slice_hdr->frame_num) - 1;
+      } else if (!pic->nal_ref_idc) {
+        temp_pic_order_cnt = 2 * (pic->frame_num_offset + pic->frame_num) - 1;
       } else {
-        temp_pic_order_cnt = 2 * (curr_pic_->frame_num_offset +
-            slice_hdr->frame_num);
+        temp_pic_order_cnt = 2 * (pic->frame_num_offset + pic->frame_num);
       }
 
-      if (!slice_hdr->field_pic_flag) {
-        curr_pic_->top_field_order_cnt = temp_pic_order_cnt;
-        curr_pic_->bottom_field_order_cnt = temp_pic_order_cnt;
-      } else if (slice_hdr->bottom_field_flag) {
-        curr_pic_->bottom_field_order_cnt = temp_pic_order_cnt;
+      if (pic->field == H264Picture::FIELD_NONE) {
+        pic->top_field_order_cnt = temp_pic_order_cnt;
+        pic->bottom_field_order_cnt = temp_pic_order_cnt;
+      } else if (pic->field == H264Picture::FIELD_BOTTOM) {
+        pic->bottom_field_order_cnt = temp_pic_order_cnt;
       } else {
-        curr_pic_->top_field_order_cnt = temp_pic_order_cnt;
+        pic->top_field_order_cnt = temp_pic_order_cnt;
       }
       break;
+    }
 
     default:
       DVLOG(1) << "Invalid pic_order_cnt_type: " << sps->pic_order_cnt_type;
       return false;
   }
 
-  switch (curr_pic_->field) {
+  switch (pic->field) {
     case H264Picture::FIELD_NONE:
-      curr_pic_->pic_order_cnt = std::min(curr_pic_->top_field_order_cnt,
-                                          curr_pic_->bottom_field_order_cnt);
+      pic->pic_order_cnt =
+          std::min(pic->top_field_order_cnt, pic->bottom_field_order_cnt);
       break;
     case H264Picture::FIELD_TOP:
-      curr_pic_->pic_order_cnt = curr_pic_->top_field_order_cnt;
+      pic->pic_order_cnt = pic->top_field_order_cnt;
       break;
     case H264Picture::FIELD_BOTTOM:
-      curr_pic_->pic_order_cnt = curr_pic_->bottom_field_order_cnt;
+      pic->pic_order_cnt = pic->bottom_field_order_cnt;
       break;
   }
 
   return true;
 }
 
-void H264Decoder::UpdatePicNums() {
+void H264Decoder::UpdatePicNums(int frame_num) {
   for (auto& pic : dpb_) {
     if (!pic->ref)
       continue;
 
-    // Below assumes non-interlaced stream.
+    // 8.2.4.1. Assumes non-interlaced stream.
     DCHECK_EQ(pic->field, H264Picture::FIELD_NONE);
     if (pic->long_term) {
       pic->long_term_pic_num = pic->long_term_frame_idx;
     } else {
-      if (pic->frame_num > frame_num_)
+      if (pic->frame_num > frame_num)
         pic->frame_num_wrap = pic->frame_num - max_frame_num_;
       else
         pic->frame_num_wrap = pic->frame_num;
@@ -344,7 +390,7 @@
 };
 
 void H264Decoder::ConstructReferencePicListsP(
-    media::H264SliceHeader* slice_hdr) {
+    const media::H264SliceHeader* slice_hdr) {
   // RefPicList0 (8.2.4.2.1) [[1] [2]], where:
   // [1] shortterm ref pics sorted by descending pic_num,
   // [2] longterm ref pics by ascending long_term_pic_num.
@@ -379,7 +425,7 @@
 };
 
 void H264Decoder::ConstructReferencePicListsB(
-    media::H264SliceHeader* slice_hdr) {
+    const media::H264SliceHeader* slice_hdr) {
   // RefPicList0 (8.2.4.2.3) [[1] [2] [3]], where:
   // [1] shortterm ref pics with POC < curr_pic's POC sorted by descending POC,
   // [2] shortterm ref pics with POC > curr_pic's POC by ascending POC,
@@ -477,12 +523,13 @@
   (*v)[from] = pic;
 }
 
-bool H264Decoder::ModifyReferencePicList(media::H264SliceHeader* slice_hdr,
-                                         int list,
-                                         H264Picture::Vector* ref_pic_listx) {
+bool H264Decoder::ModifyReferencePicList(
+    const media::H264SliceHeader* slice_hdr,
+    int list,
+    H264Picture::Vector* ref_pic_listx) {
   bool ref_pic_list_modification_flag_lX;
   int num_ref_idx_lX_active_minus1;
-  media::H264ModificationOfPicNum* list_mod;
+  const media::H264ModificationOfPicNum* list_mod;
 
   // This can process either ref_pic_list0 or ref_pic_list1, depending on
   // the list argument. Set up pointers to proper list to be processed here.
@@ -618,8 +665,14 @@
   DCHECK(!pic->outputted);
   pic->outputted = true;
 
+  if (pic->nonexisting) {
+    DVLOG(4) << "Skipping output, non-existing frame_num: " << pic->frame_num;
+    return;
+  }
+
   DVLOG_IF(1, pic->pic_order_cnt < last_output_poc_)
-      << "Outputting out of order, likely a broken stream";
+      << "Outputting out of order, likely a broken stream: "
+      << last_output_poc_ << " -> " << pic->pic_order_cnt;
   last_output_poc_ = pic->pic_order_cnt;
 
   DVLOG(4) << "Posting output task for POC: " << pic->pic_order_cnt;
@@ -657,24 +710,39 @@
   return true;
 }
 
-bool H264Decoder::StartNewFrame(media::H264SliceHeader* slice_hdr) {
+bool H264Decoder::StartNewFrame(const media::H264SliceHeader* slice_hdr) {
   // TODO posciak: add handling of max_num_ref_frames per spec.
   CHECK(curr_pic_.get());
+  DCHECK(slice_hdr);
+
+  curr_pps_id_ = slice_hdr->pic_parameter_set_id;
+  const media::H264PPS* pps = parser_.GetPPS(curr_pps_id_);
+  if (!pps)
+    return false;
+
+  curr_sps_id_ = pps->seq_parameter_set_id;
+  const media::H264SPS* sps = parser_.GetSPS(curr_sps_id_);
+  if (!sps)
+    return false;
+
+  max_frame_num_ = 1 << (sps->log2_max_frame_num_minus4 + 4);
+  int frame_num = slice_hdr->frame_num;
+  if (slice_hdr->idr_pic_flag)
+    prev_ref_frame_num_ = 0;
+
+  // 7.4.3
+  if (frame_num != prev_ref_frame_num_ &&
+      frame_num != (prev_ref_frame_num_ + 1) % max_frame_num_) {
+    if (!HandleFrameNumGap(frame_num))
+      return false;
+  }
 
   if (!InitCurrPicture(slice_hdr))
     return false;
 
-  DCHECK_GT(max_frame_num_, 0);
-
-  UpdatePicNums();
-  DCHECK(slice_hdr);
+  UpdatePicNums(frame_num);
   PrepareRefPicLists(slice_hdr);
 
-  const media::H264PPS* pps = parser_.GetPPS(curr_pps_id_);
-  DCHECK(pps);
-  const media::H264SPS* sps = parser_.GetSPS(pps->seq_parameter_set_id);
-  DCHECK(sps);
-
   if (!accelerator_->SubmitFrameMetadata(sps, pps, dpb_, ref_pic_list_p0_,
                                          ref_pic_list_b0_, ref_pic_list_b1_,
                                          curr_pic_.get()))
@@ -683,12 +751,11 @@
   return true;
 }
 
-bool H264Decoder::HandleMemoryManagementOps() {
+bool H264Decoder::HandleMemoryManagementOps(scoped_refptr<H264Picture> pic) {
   // 8.2.5.4
-  for (unsigned int i = 0; i < arraysize(curr_pic_->ref_pic_marking); ++i) {
+  for (size_t i = 0; i < arraysize(pic->ref_pic_marking); ++i) {
     // Code below does not support interlaced stream (per-field pictures).
-    media::H264DecRefPicMarking* ref_pic_marking =
-        &curr_pic_->ref_pic_marking[i];
+    media::H264DecRefPicMarking* ref_pic_marking = &pic->ref_pic_marking[i];
     scoped_refptr<H264Picture> to_mark;
     int pic_num_x;
 
@@ -700,8 +767,8 @@
       case 1:
         // Mark a short term reference picture as unused so it can be removed
         // if outputted.
-        pic_num_x = curr_pic_->pic_num -
-                    (ref_pic_marking->difference_of_pic_nums_minus1 + 1);
+        pic_num_x =
+            pic->pic_num - (ref_pic_marking->difference_of_pic_nums_minus1 + 1);
         to_mark = dpb_.GetShortRefPicByPicNum(pic_num_x);
         if (to_mark) {
           to_mark->ref = false;
@@ -726,8 +793,8 @@
 
       case 3:
         // Mark a short term reference picture as long term reference.
-        pic_num_x = curr_pic_->pic_num -
-                    (ref_pic_marking->difference_of_pic_nums_minus1 + 1);
+        pic_num_x =
+            pic->pic_num - (ref_pic_marking->difference_of_pic_nums_minus1 + 1);
         to_mark = dpb_.GetShortRefPicByPicNum(pic_num_x);
         if (to_mark) {
           DCHECK(to_mark->ref && !to_mark->long_term);
@@ -746,12 +813,12 @@
         H264Picture::Vector long_terms;
         dpb_.GetLongTermRefPicsAppending(&long_terms);
         for (size_t i = 0; i < long_terms.size(); ++i) {
-          scoped_refptr<H264Picture>& pic = long_terms[i];
-          DCHECK(pic->ref && pic->long_term);
+          scoped_refptr<H264Picture>& long_term_pic = long_terms[i];
+          DCHECK(long_term_pic->ref && long_term_pic->long_term);
           // Ok to cast, max_long_term_frame_idx is much smaller than 16bit.
-          if (pic->long_term_frame_idx >
+          if (long_term_pic->long_term_frame_idx >
               static_cast<int>(max_long_term_frame_idx_))
-            pic->ref = false;
+            long_term_pic->ref = false;
         }
         break;
       }
@@ -760,7 +827,7 @@
         // Unmark all reference pictures.
         dpb_.MarkAllUnusedForRef();
         max_long_term_frame_idx_ = -1;
-        curr_pic_->mem_mgmt_5 = true;
+        pic->mem_mgmt_5 = true;
         break;
 
       case 6: {
@@ -769,18 +836,18 @@
         H264Picture::Vector long_terms;
         dpb_.GetLongTermRefPicsAppending(&long_terms);
         for (size_t i = 0; i < long_terms.size(); ++i) {
-          scoped_refptr<H264Picture>& pic = long_terms[i];
-          DCHECK(pic->ref && pic->long_term);
+          scoped_refptr<H264Picture>& long_term_pic = long_terms[i];
+          DCHECK(long_term_pic->ref && long_term_pic->long_term);
           // Ok to cast, long_term_frame_idx is much smaller than 16bit.
-          if (pic->long_term_frame_idx ==
+          if (long_term_pic->long_term_frame_idx ==
               static_cast<int>(ref_pic_marking->long_term_frame_idx))
-            pic->ref = false;
+            long_term_pic->ref = false;
         }
 
         // and mark the current one instead.
-        curr_pic_->ref = true;
-        curr_pic_->long_term = true;
-        curr_pic_->long_term_frame_idx = ref_pic_marking->long_term_frame_idx;
+        pic->ref = true;
+        pic->long_term = true;
+        pic->long_term_frame_idx = ref_pic_marking->long_term_frame_idx;
         break;
       }
 
@@ -798,91 +865,86 @@
 // procedure to remove the oldest one.
 // It also performs marking and unmarking pictures as reference.
 // See spac 8.2.5.1.
-void H264Decoder::ReferencePictureMarking() {
-  if (curr_pic_->idr) {
-    // If current picture is an IDR, all reference pictures are unmarked.
+bool H264Decoder::ReferencePictureMarking(scoped_refptr<H264Picture> pic) {
+  // If the current picture is an IDR, all reference pictures are unmarked.
+  if (pic->idr) {
     dpb_.MarkAllUnusedForRef();
 
-    if (curr_pic_->long_term_reference_flag) {
-      curr_pic_->long_term = true;
-      curr_pic_->long_term_frame_idx = 0;
+    if (pic->long_term_reference_flag) {
+      pic->long_term = true;
+      pic->long_term_frame_idx = 0;
       max_long_term_frame_idx_ = 0;
     } else {
-      curr_pic_->long_term = false;
+      pic->long_term = false;
       max_long_term_frame_idx_ = -1;
     }
+
+    return true;
+  }
+
+  // Not an IDR. If the stream contains instructions on how to discard pictures
+  // from DPB and how to mark/unmark existing reference pictures, do so.
+  // Otherwise, fall back to default sliding window process.
+  if (pic->adaptive_ref_pic_marking_mode_flag) {
+    DCHECK(!pic->nonexisting);
+    return HandleMemoryManagementOps(pic);
   } else {
-    if (!curr_pic_->adaptive_ref_pic_marking_mode_flag) {
-      // If non-IDR, and the stream does not indicate what we should do to
-      // ensure DPB doesn't overflow, discard oldest picture.
-      // See spec 8.2.5.3.
-      if (curr_pic_->field == H264Picture::FIELD_NONE) {
-        DCHECK_LE(
-            dpb_.CountRefPics(),
-            std::max<int>(parser_.GetSPS(curr_sps_id_)->max_num_ref_frames, 1));
-        if (dpb_.CountRefPics() ==
-            std::max<int>(parser_.GetSPS(curr_sps_id_)->max_num_ref_frames,
-                          1)) {
-          // Max number of reference pics reached,
-          // need to remove one of the short term ones.
-          // Find smallest frame_num_wrap short reference picture and mark
-          // it as unused.
-          scoped_refptr<H264Picture> to_unmark =
-              dpb_.GetLowestFrameNumWrapShortRefPic();
-          if (to_unmark == NULL) {
-            DVLOG(1) << "Couldn't find a short ref picture to unmark";
-            return;
-          }
-          to_unmark->ref = false;
-        }
-      } else {
-        // Shouldn't get here.
-        DVLOG(1) << "Interlaced video not supported.";
-      }
-    } else {
-      // Stream has instructions how to discard pictures from DPB and how
-      // to mark/unmark existing reference pictures. Do it.
-      // Spec 8.2.5.4.
-      if (curr_pic_->field == H264Picture::FIELD_NONE) {
-        HandleMemoryManagementOps();
-      } else {
-        // Shouldn't get here.
-        DVLOG(1) << "Interlaced video not supported.";
-      }
-    }
+    return SlidingWindowPictureMarking();
   }
 }
 
-bool H264Decoder::FinishPicture() {
-  DCHECK(curr_pic_.get());
+bool H264Decoder::SlidingWindowPictureMarking() {
+  const media::H264SPS* sps = parser_.GetSPS(curr_sps_id_);
+  if (!sps)
+    return false;
 
-  // Finish processing previous picture.
-  // Start by storing previous reference picture data for later use,
-  // if picture being finished is a reference picture.
-  if (curr_pic_->ref) {
-    ReferencePictureMarking();
-    prev_ref_has_memmgmnt5_ = curr_pic_->mem_mgmt_5;
-    prev_ref_top_field_order_cnt_ = curr_pic_->top_field_order_cnt;
-    prev_ref_pic_order_cnt_msb_ = curr_pic_->pic_order_cnt_msb;
-    prev_ref_pic_order_cnt_lsb_ = curr_pic_->pic_order_cnt_lsb;
-    prev_ref_field_ = curr_pic_->field;
+  // 8.2.5.3. Ensure the DPB doesn't overflow by discarding the oldest picture.
+  int num_ref_pics = dpb_.CountRefPics();
+  DCHECK_LE(num_ref_pics, std::max<int>(sps->max_num_ref_frames, 1));
+  if (num_ref_pics == std::max<int>(sps->max_num_ref_frames, 1)) {
+    // Max number of reference pics reached, need to remove one of the short
+    // term ones. Find smallest frame_num_wrap short reference picture and mark
+    // it as unused.
+    scoped_refptr<H264Picture> to_unmark =
+        dpb_.GetLowestFrameNumWrapShortRefPic();
+    if (!to_unmark) {
+      DVLOG(1) << "Couldn't find a short ref picture to unmark";
+      return false;
+    }
+
+    to_unmark->ref = false;
   }
-  prev_has_memmgmnt5_ = curr_pic_->mem_mgmt_5;
-  prev_frame_num_offset_ = curr_pic_->frame_num_offset;
+
+  return true;
+}
+
+bool H264Decoder::FinishPicture(scoped_refptr<H264Picture> pic) {
+  // Finish processing the picture.
+  // Start by storing previous picture data for later use.
+  if (pic->ref) {
+    ReferencePictureMarking(pic);
+    prev_ref_has_memmgmnt5_ = pic->mem_mgmt_5;
+    prev_ref_top_field_order_cnt_ = pic->top_field_order_cnt;
+    prev_ref_pic_order_cnt_msb_ = pic->pic_order_cnt_msb;
+    prev_ref_pic_order_cnt_lsb_ = pic->pic_order_cnt_lsb;
+    prev_ref_field_ = pic->field;
+    prev_ref_frame_num_ = pic->frame_num;
+  }
+  prev_frame_num_ = pic->frame_num;
+  prev_has_memmgmnt5_ = pic->mem_mgmt_5;
+  prev_frame_num_offset_ = pic->frame_num_offset;
 
   // Remove unused (for reference or later output) pictures from DPB, marking
   // them as such.
   dpb_.DeleteUnused();
 
-  DVLOG(4) << "Finishing picture, entries in DPB: " << dpb_.size();
+  DVLOG(4) << "Finishing picture frame_num: " << pic->frame_num
+           << ", entries in DPB: " << dpb_.size();
 
-  // Whatever happens below, curr_pic_ will stop managing the pointer to the
-  // picture after this. The ownership will either be transferred to DPB, if
-  // the image is still needed (for output and/or reference), or the memory
-  // will be released if we manage to output it here without having to store
-  // it for future reference.
-  scoped_refptr<H264Picture> pic = curr_pic_;
-  curr_pic_ = nullptr;
+  // The ownership of pic will either be transferred to DPB - if the picture is
+  // still needed (for output and/or reference) - or we will release it
+  // immediately if we manage to output it here and won't have to store it for
+  // future reference.
 
   // Get all pictures that haven't been outputted yet.
   H264Picture::Vector not_outputted;
@@ -1004,9 +1066,11 @@
 }
 
 bool H264Decoder::ProcessSPS(int sps_id, bool* need_new_buffers) {
+  DVLOG(4) << "Processing SPS id:" << sps_id;
+
   const media::H264SPS* sps = parser_.GetSPS(sps_id);
-  DCHECK(sps);
-  DVLOG(4) << "Processing SPS";
+  if (!sps)
+    return false;
 
   *need_new_buffers = false;
 
@@ -1015,13 +1079,6 @@
     return false;
   }
 
-  if (sps->gaps_in_frame_num_value_allowed_flag) {
-    DVLOG(1) << "Gaps in frame numbers not supported";
-    return false;
-  }
-
-  curr_sps_id_ = sps->seq_parameter_set_id;
-
   // Calculate picture height/width in macroblocks and pixels
   // (spec 7.4.2.1.1, 7.4.3).
   int width_mb = sps->pic_width_in_mbs_minus1 + 1;
@@ -1043,9 +1100,6 @@
   pic_size_ = new_pic_size;
   DVLOG(1) << "New picture size: " << pic_size_.ToString();
 
-  max_pic_order_cnt_lsb_ = 1 << (sps->log2_max_pic_order_cnt_lsb_minus4 + 4);
-  max_frame_num_ = 1 << (sps->log2_max_frame_num_minus4 + 4);
-
   int level = sps->level_idc;
   int max_dpb_mbs = LevelToMaxDpbMbs(level);
   if (max_dpb_mbs == 0)
@@ -1069,81 +1123,143 @@
   return true;
 }
 
-bool H264Decoder::ProcessPPS(int pps_id) {
-  const media::H264PPS* pps = parser_.GetPPS(pps_id);
-  DCHECK(pps);
-
-  curr_pps_id_ = pps->pic_parameter_set_id;
-
-  return true;
-}
-
 bool H264Decoder::FinishPrevFrameIfPresent() {
   // If we already have a frame waiting to be decoded, decode it and finish.
   if (curr_pic_ != NULL) {
     if (!DecodePicture())
       return false;
-    return FinishPicture();
+
+    scoped_refptr<H264Picture> pic = curr_pic_;
+    curr_pic_ = nullptr;
+    return FinishPicture(pic);
   }
 
   return true;
 }
 
-bool H264Decoder::PreprocessSlice(media::H264SliceHeader* slice_hdr) {
-  prev_frame_num_ = frame_num_;
-  frame_num_ = slice_hdr->frame_num;
+bool H264Decoder::HandleFrameNumGap(int frame_num) {
+  const media::H264SPS* sps = parser_.GetSPS(curr_sps_id_);
+  if (!sps)
+    return false;
 
-  if (prev_frame_num_ > 0 && prev_frame_num_ < frame_num_ - 1) {
-    DVLOG(1) << "Gap in frame_num!";
+  if (!sps->gaps_in_frame_num_value_allowed_flag) {
+    DVLOG(1) << "Invalid frame_num: " << frame_num;
     return false;
   }
 
+  DVLOG(2) << "Handling frame_num gap: " << prev_ref_frame_num_ << "->"
+           << frame_num;
+
+  // 7.4.3/7-23
+  int unused_short_term_frame_num = (prev_ref_frame_num_ + 1) % max_frame_num_;
+  while (unused_short_term_frame_num != frame_num) {
+    scoped_refptr<H264Picture> pic = new H264Picture();
+    if (!InitNonexistingPicture(pic, unused_short_term_frame_num))
+      return false;
+
+    UpdatePicNums(unused_short_term_frame_num);
+
+    if (!FinishPicture(pic))
+      return false;
+
+    unused_short_term_frame_num++;
+    unused_short_term_frame_num %= max_frame_num_;
+  }
+
+  return true;
+}
+
+bool H264Decoder::IsNewPrimaryCodedPicture(
+    const media::H264SliceHeader* slice_hdr) const {
+  if (!curr_pic_)
+    return true;
+
+  // 7.4.1.2.4, assumes non-interlaced.
+  if (slice_hdr->frame_num != curr_pic_->frame_num ||
+      slice_hdr->pic_parameter_set_id != curr_pps_id_ ||
+      slice_hdr->nal_ref_idc != curr_pic_->nal_ref_idc ||
+      slice_hdr->idr_pic_flag != curr_pic_->idr ||
+      (slice_hdr->idr_pic_flag &&
+       slice_hdr->idr_pic_id != curr_pic_->idr_pic_id))
+    return true;
+
+  const media::H264SPS* sps = parser_.GetSPS(curr_sps_id_);
+  if (!sps)
+    return false;
+
+  if (sps->pic_order_cnt_type == curr_pic_->pic_order_cnt_type) {
+    if (curr_pic_->pic_order_cnt_type == 0) {
+      if (slice_hdr->pic_order_cnt_lsb != curr_pic_->pic_order_cnt_lsb ||
+          slice_hdr->delta_pic_order_cnt_bottom !=
+              curr_pic_->delta_pic_order_cnt_bottom)
+        return true;
+    } else if (curr_pic_->pic_order_cnt_type == 1) {
+      if (slice_hdr->delta_pic_order_cnt0 != curr_pic_->delta_pic_order_cnt0 ||
+          slice_hdr->delta_pic_order_cnt1 != curr_pic_->delta_pic_order_cnt1)
+        return true;
+    }
+  }
+
+  return false;
+}
+
+bool H264Decoder::PreprocessCurrentSlice() {
+  const media::H264SliceHeader* slice_hdr = curr_slice_hdr_.get();
+  DCHECK(slice_hdr);
+
+  if (IsNewPrimaryCodedPicture(slice_hdr)) {
+    // New picture, so first finish the previous one before processing it.
+    if (!FinishPrevFrameIfPresent())
+      return false;
+
+    DCHECK(!curr_pic_);
+
+    if (slice_hdr->first_mb_in_slice != 0) {
+      DVLOG(1) << "ASO/invalid stream, first_mb_in_slice: "
+               << slice_hdr->first_mb_in_slice;
+      return false;
+    }
+
+    // If the new picture is an IDR, flush DPB.
+    if (slice_hdr->idr_pic_flag) {
+      // Output all remaining pictures, unless we are explicitly instructed
+      // not to do so.
+      if (!slice_hdr->no_output_of_prior_pics_flag) {
+        if (!Flush())
+          return false;
+      }
+      dpb_.Clear();
+      last_output_poc_ = std::numeric_limits<int>::min();
+    }
+  }
+
+  return true;
+}
+
+bool H264Decoder::ProcessCurrentSlice() {
+  DCHECK(curr_pic_);
+
+  const media::H264SliceHeader* slice_hdr = curr_slice_hdr_.get();
+  DCHECK(slice_hdr);
+
   if (slice_hdr->field_pic_flag == 0)
     max_pic_num_ = max_frame_num_;
   else
     max_pic_num_ = 2 * max_frame_num_;
 
-  // TODO posciak: switch to new picture detection per 7.4.1.2.4.
-  if (curr_pic_ != NULL && slice_hdr->first_mb_in_slice != 0) {
-    // More slice data of the current picture.
-    return true;
-  } else {
-    // A new frame, so first finish the previous one before processing it...
-    if (!FinishPrevFrameIfPresent())
-      return false;
-  }
-
-  // If the new frame is an IDR, output what's left to output and clear DPB
-  if (slice_hdr->idr_pic_flag) {
-    // (unless we are explicitly instructed not to do so).
-    if (!slice_hdr->no_output_of_prior_pics_flag) {
-      // Output DPB contents.
-      if (!Flush())
-        return false;
-    }
-    dpb_.Clear();
-    last_output_poc_ = std::numeric_limits<int>::min();
-  }
-
-  return true;
-}
-
-bool H264Decoder::ProcessSlice(media::H264SliceHeader* slice_hdr) {
-  DCHECK(curr_pic_.get());
   H264Picture::Vector ref_pic_list0, ref_pic_list1;
-
   if (!ModifyReferencePicLists(slice_hdr, &ref_pic_list0, &ref_pic_list1))
     return false;
 
-  const media::H264PPS* pps = parser_.GetPPS(slice_hdr->pic_parameter_set_id);
-  DCHECK(pps);
+  const media::H264PPS* pps = parser_.GetPPS(curr_pps_id_);
+  if (!pps)
+    return false;
 
   if (!accelerator_->SubmitSlice(pps, slice_hdr, ref_pic_list0, ref_pic_list1,
                                  curr_pic_.get(), slice_hdr->nalu_data,
                                  slice_hdr->nalu_size))
     return false;
 
-  curr_slice_hdr_.reset();
   return true;
 }
 
@@ -1163,7 +1279,10 @@
 }
 
 H264Decoder::DecodeResult H264Decoder::Decode() {
-  DCHECK_NE(state_, kError);
+  if (state_ == kError) {
+    DVLOG(1) << "Decoder in error state";
+    return kDecodeError;
+  }
 
   while (1) {
     media::H264Parser::Result par_res;
@@ -1175,9 +1294,9 @@
         return kRanOutOfStreamData;
       else if (par_res != media::H264Parser::kOk)
         SET_ERROR_AND_RETURN();
-    }
 
-    DVLOG(4) << "NALU found: " << static_cast<int>(curr_nalu_->nal_unit_type);
+      DVLOG(4) << "New NALU: " << static_cast<int>(curr_nalu_->nal_unit_type);
+    }
 
     switch (curr_nalu_->nal_unit_type) {
       case media::H264NALU::kNonIDRSlice:
@@ -1195,6 +1314,8 @@
         }
 
         // If after reset, we should be able to recover from an IDR.
+        state_ = kDecoding;
+
         if (!curr_slice_hdr_) {
           curr_slice_hdr_.reset(new media::H264SliceHeader());
           par_res =
@@ -1202,7 +1323,7 @@
           if (par_res != media::H264Parser::kOk)
             SET_ERROR_AND_RETURN();
 
-          if (!PreprocessSlice(curr_slice_hdr_.get()))
+          if (!PreprocessCurrentSlice())
             SET_ERROR_AND_RETURN();
         }
 
@@ -1217,10 +1338,10 @@
             SET_ERROR_AND_RETURN();
         }
 
-        if (!ProcessSlice(curr_slice_hdr_.get()))
+        if (!ProcessCurrentSlice())
           SET_ERROR_AND_RETURN();
 
-        state_ = kDecoding;
+        curr_slice_hdr_.reset();
         break;
       }
 
@@ -1268,8 +1389,6 @@
         if (par_res != media::H264Parser::kOk)
           SET_ERROR_AND_RETURN();
 
-        if (!ProcessPPS(pps_id))
-          SET_ERROR_AND_RETURN();
         break;
       }
 
@@ -1278,7 +1397,7 @@
         break;
     }
 
-    DVLOG(4) << "Dropping nalu";
+    DVLOG(4) << "NALU done";
     curr_nalu_.reset();
   }
 }
diff --git a/content/common/gpu/media/h264_decoder.h b/content/common/gpu/media/h264_decoder.h
index a82a6aa8..532291b7 100644
--- a/content/common/gpu/media/h264_decoder.h
+++ b/content/common/gpu/media/h264_decoder.h
@@ -129,34 +129,43 @@
 
   // Process H264 stream structures.
   bool ProcessSPS(int sps_id, bool* need_new_buffers);
-  bool ProcessPPS(int pps_id);
-  bool PreprocessSlice(media::H264SliceHeader* slice_hdr);
-  bool ProcessSlice(media::H264SliceHeader* slice_hdr);
+  // Process current slice header to discover if we need to start a new picture,
+  // finishing up the current one.
+  bool PreprocessCurrentSlice();
+  // Process current slice as a slice of the current picture.
+  bool ProcessCurrentSlice();
+
+  // Return true if we need to start a new picture.
+  bool IsNewPrimaryCodedPicture(const media::H264SliceHeader* slice_hdr) const;
 
   // Initialize the current picture according to data in |slice_hdr|.
-  bool InitCurrPicture(media::H264SliceHeader* slice_hdr);
+  bool InitCurrPicture(const media::H264SliceHeader* slice_hdr);
 
-  // Calculate picture order counts for the new picture
-  // on initialization of a new frame (see spec).
-  bool CalculatePicOrderCounts(media::H264SliceHeader* slice_hdr);
+  // Initialize |pic| as a "non-existing" picture (see spec) with |frame_num|,
+  // to be used for frame gap concealment.
+  bool InitNonexistingPicture(scoped_refptr<H264Picture> pic, int frame_num);
 
-  // Update PicNum values in pictures stored in DPB on creation of new
-  // frame (see spec).
-  void UpdatePicNums();
+  // Calculate picture order counts for |pic| on initialization
+  // of a new frame (see spec).
+  bool CalculatePicOrderCounts(scoped_refptr<H264Picture> pic);
+
+  // Update PicNum values in pictures stored in DPB on creation of
+  // a picture with |frame_num|.
+  void UpdatePicNums(int frame_num);
 
   bool UpdateMaxNumReorderFrames(const media::H264SPS* sps);
 
   // Prepare reference picture lists for the current frame.
-  void PrepareRefPicLists(media::H264SliceHeader* slice_hdr);
+  void PrepareRefPicLists(const media::H264SliceHeader* slice_hdr);
   // Prepare reference picture lists for the given slice.
-  bool ModifyReferencePicLists(media::H264SliceHeader* slice_hdr,
+  bool ModifyReferencePicLists(const media::H264SliceHeader* slice_hdr,
                                H264Picture::Vector* ref_pic_list0,
                                H264Picture::Vector* ref_pic_list1);
 
   // Construct initial reference picture lists for use in decoding of
   // P and B pictures (see 8.2.4 in spec).
-  void ConstructReferencePicListsP(media::H264SliceHeader* slice_hdr);
-  void ConstructReferencePicListsB(media::H264SliceHeader* slice_hdr);
+  void ConstructReferencePicListsP(const media::H264SliceHeader* slice_hdr);
+  void ConstructReferencePicListsB(const media::H264SliceHeader* slice_hdr);
 
   // Helper functions for reference list construction, per spec.
   int PicNumF(const scoped_refptr<H264Picture>& pic);
@@ -166,27 +175,33 @@
   // specified in spec (8.2.4).
   //
   // |list| indicates list number and should be either 0 or 1.
-  bool ModifyReferencePicList(media::H264SliceHeader* slice_hdr,
+  bool ModifyReferencePicList(const media::H264SliceHeader* slice_hdr,
                               int list,
                               H264Picture::Vector* ref_pic_listx);
 
   // Perform reference picture memory management operations (marking/unmarking
   // of reference pictures, long term picture management, discarding, etc.).
   // See 8.2.5 in spec.
-  bool HandleMemoryManagementOps();
-  void ReferencePictureMarking();
+  bool HandleMemoryManagementOps(scoped_refptr<H264Picture> pic);
+  bool ReferencePictureMarking(scoped_refptr<H264Picture> pic);
+  bool SlidingWindowPictureMarking();
+
+  // Handle a gap in frame_num in the stream up to |frame_num|, by creating
+  // "non-existing" pictures (see spec).
+  bool HandleFrameNumGap(int frame_num);
 
   // Start processing a new frame.
-  bool StartNewFrame(media::H264SliceHeader* slice_hdr);
+  bool StartNewFrame(const media::H264SliceHeader* slice_hdr);
 
   // All data for a frame received, process it and decode.
   bool FinishPrevFrameIfPresent();
 
-  // Called after decoding, performs all operations to be done after decoding,
-  // including DPB management, reference picture marking and memory management
-  // operations.
-  // This will also output a picture if one is ready for output.
-  bool FinishPicture();
+  // Called after we are done processing |pic|. Performs all operations to be
+  // done after decoding, including DPB management, reference picture marking
+  // and memory management operations.
+  // This will also output pictures if any have become ready to be outputted
+  // after processing |pic|.
+  bool FinishPicture(scoped_refptr<H264Picture> pic);
 
   // Clear DPB contents and remove all surfaces in DPB from *in_use_ list.
   // Cleared pictures will be made available for decode, unless they are
@@ -220,14 +235,13 @@
   H264Picture::Vector ref_pic_list_b1_;
 
   // Global state values, needed in decoding. See spec.
-  int max_pic_order_cnt_lsb_;
   int max_frame_num_;
   int max_pic_num_;
   int max_long_term_frame_idx_;
   size_t max_num_reorder_frames_;
 
-  int frame_num_;
   int prev_frame_num_;
+  int prev_ref_frame_num_;
   int prev_frame_num_offset_;
   bool prev_has_memmgmnt5_;
 
diff --git a/content/common/gpu/media/h264_dpb.cc b/content/common/gpu/media/h264_dpb.cc
index 1220d59..0bc32e8 100644
--- a/content/common/gpu/media/h264_dpb.cc
+++ b/content/common/gpu/media/h264_dpb.cc
@@ -11,11 +11,15 @@
 namespace content {
 
 H264Picture::H264Picture()
-    : top_field_order_cnt(0),
+    : pic_order_cnt_type(0),
+      top_field_order_cnt(0),
       bottom_field_order_cnt(0),
       pic_order_cnt(0),
       pic_order_cnt_msb(0),
       pic_order_cnt_lsb(0),
+      delta_pic_order_cnt_bottom(0),
+      delta_pic_order_cnt0(0),
+      delta_pic_order_cnt1(0),
       pic_num(0),
       long_term_pic_num(0),
       frame_num(0),
@@ -23,11 +27,14 @@
       frame_num_wrap(0),
       long_term_frame_idx(0),
       type(media::H264SliceHeader::kPSlice),
+      nal_ref_idc(0),
       idr(false),
+      idr_pic_id(0),
       ref(false),
       long_term(false),
       outputted(false),
       mem_mgmt_5(false),
+      nonexisting(false),
       field(FIELD_NONE),
       long_term_reference_flag(false),
       adaptive_ref_pic_marking_mode_flag(false),
diff --git a/content/common/gpu/media/h264_dpb.h b/content/common/gpu/media/h264_dpb.h
index 67330d9..a1b4ba2 100644
--- a/content/common/gpu/media/h264_dpb.h
+++ b/content/common/gpu/media/h264_dpb.h
@@ -39,11 +39,15 @@
   // Values calculated per H.264 specification or taken from slice header.
   // See spec for more details on each (some names have been converted from
   // CamelCase in spec to Chromium-style names).
+  int pic_order_cnt_type;
   int top_field_order_cnt;
   int bottom_field_order_cnt;
   int pic_order_cnt;
   int pic_order_cnt_msb;
   int pic_order_cnt_lsb;
+  int delta_pic_order_cnt_bottom;
+  int delta_pic_order_cnt0;
+  int delta_pic_order_cnt1;
 
   int pic_num;
   int long_term_pic_num;
@@ -53,7 +57,9 @@
   int long_term_frame_idx;
 
   media::H264SliceHeader::Type type;
+  int nal_ref_idc;
   bool idr;  // IDR picture?
+  int idr_pic_id;  // Valid only if idr == true.
   bool ref;  // reference picture?
   bool long_term;  // long term reference picture?
   bool outputted;
@@ -61,6 +67,10 @@
   // picture has finished decoding?
   bool mem_mgmt_5;
 
+  // Created by the decoding process for gaps in frame_num.
+  // Not for decode or output.
+  bool nonexisting;
+
   Field field;
 
   // Values from slice_hdr to be used during reference marking and
diff --git a/content/common/gpu/media/v4l2_slice_video_decode_accelerator.cc b/content/common/gpu/media/v4l2_slice_video_decode_accelerator.cc
index dafcf7e..4d98f2a 100644
--- a/content/common/gpu/media/v4l2_slice_video_decode_accelerator.cc
+++ b/content/common/gpu/media/v4l2_slice_video_decode_accelerator.cc
@@ -1777,18 +1777,23 @@
       DVLOG(1) << "Invalid DPB size";
       break;
     }
+
+    int index = VIDEO_MAX_FRAME;
+    if (!pic->nonexisting) {
+      scoped_refptr<V4L2DecodeSurface> dec_surface =
+          H264PictureToV4L2DecodeSurface(pic);
+      index = dec_surface->output_record();
+      ref_surfaces->push_back(dec_surface);
+    }
+
     struct v4l2_h264_dpb_entry& entry = v4l2_decode_param_.dpb[i++];
-    scoped_refptr<V4L2DecodeSurface> dec_surface =
-        H264PictureToV4L2DecodeSurface(pic);
-    entry.buf_index = dec_surface->output_record();
+    entry.buf_index = index;
     entry.frame_num = pic->frame_num;
     entry.pic_num = pic->pic_num;
     entry.top_field_order_cnt = pic->top_field_order_cnt;
     entry.bottom_field_order_cnt = pic->bottom_field_order_cnt;
     entry.flags = (pic->ref ? V4L2_H264_DPB_ENTRY_FLAG_ACTIVE : 0) |
                   (pic->long_term ? V4L2_H264_DPB_ENTRY_FLAG_LONG_TERM : 0);
-
-    ref_surfaces->push_back(dec_surface);
   }
 }
 
diff --git a/content/common/gpu/media/vaapi_video_decode_accelerator.cc b/content/common/gpu/media/vaapi_video_decode_accelerator.cc
index 20977f2..b0ecbd045 100644
--- a/content/common/gpu/media/vaapi_video_decode_accelerator.cc
+++ b/content/common/gpu/media/vaapi_video_decode_accelerator.cc
@@ -1292,10 +1292,15 @@
 void VaapiVideoDecodeAccelerator::VaapiH264Accelerator::FillVAPicture(
     VAPictureH264* va_pic,
     scoped_refptr<H264Picture> pic) {
-  scoped_refptr<VaapiDecodeSurface> dec_surface =
-      H264PictureToVaapiDecodeSurface(pic);
+  VASurfaceID va_surface_id = VA_INVALID_SURFACE;
 
-  va_pic->picture_id = dec_surface->va_surface()->id();
+  if (!pic->nonexisting) {
+    scoped_refptr<VaapiDecodeSurface> dec_surface =
+        H264PictureToVaapiDecodeSurface(pic);
+    va_surface_id = dec_surface->va_surface()->id();
+  }
+
+  va_pic->picture_id = va_surface_id;
   va_pic->frame_idx = pic->frame_num;
   va_pic->flags = 0;
 
diff --git a/content/common/gpu/media/vt_video_decode_accelerator.cc b/content/common/gpu/media/vt_video_decode_accelerator.cc
index 722a969..076c9dc 100644
--- a/content/common/gpu/media/vt_video_decode_accelerator.cc
+++ b/content/common/gpu/media/vt_video_decode_accelerator.cc
@@ -1044,9 +1044,10 @@
   }
 
   bool allow_overlay = false;
-  scoped_refptr<gfx::GLImageIOSurface> gl_image(new gfx::GLImageIOSurface(
-      gfx::GenericSharedMemoryId(), frame.coded_size, GL_BGRA_EXT));
-  if (gl_image->Initialize(surface, gfx::BufferFormat::BGRA_8888)) {
+  scoped_refptr<gfx::GLImageIOSurface> gl_image(
+      new gfx::GLImageIOSurface(frame.coded_size, GL_BGRA_EXT));
+  if (gl_image->Initialize(surface, gfx::GenericSharedMemoryId(),
+                           gfx::BufferFormat::BGRA_8888)) {
     allow_overlay = true;
   } else {
     gl_image = nullptr;
diff --git a/content/common/host_discardable_shared_memory_manager.cc b/content/common/host_discardable_shared_memory_manager.cc
index 8d904e1d..90eee02 100644
--- a/content/common/host_discardable_shared_memory_manager.cc
+++ b/content/common/host_discardable_shared_memory_manager.cc
@@ -176,14 +176,24 @@
     for (const auto& segment_entry : process_segments) {
       const int segment_id = segment_entry.first;
       const MemorySegment* segment = segment_entry.second.get();
+      if (!segment->memory()->mapped_size())
+        continue;
+
       std::string dump_name = base::StringPrintf(
           "discardable/process_%x/segment_%d", child_process_id, segment_id);
       base::trace_event::MemoryAllocatorDump* dump =
           pmd->CreateAllocatorDump(dump_name);
+
       dump->AddScalar(base::trace_event::MemoryAllocatorDump::kNameSize,
                       base::trace_event::MemoryAllocatorDump::kUnitsBytes,
                       segment->memory()->mapped_size());
 
+      // Host can only tell if whole segment is locked or not.
+      dump->AddScalar(
+          "locked_size", base::trace_event::MemoryAllocatorDump::kUnitsBytes,
+          segment->memory()->IsMemoryLocked() ? segment->memory()->mapped_size()
+                                              : 0u);
+
       // Create the cross-process ownership edge. If the child creates a
       // corresponding dump for the same segment, this will avoid to
       // double-count them in tracing. If, instead, no other process will emit a
diff --git a/content/common/site_isolation_policy.cc b/content/common/site_isolation_policy.cc
index afe4f14..d36786e 100644
--- a/content/common/site_isolation_policy.cc
+++ b/content/common/site_isolation_policy.cc
@@ -73,7 +73,7 @@
 
 // static
 bool SiteIsolationPolicy::IsSwappedOutStateForbidden() {
-  return AreCrossProcessFramesPossible();
+  return true;
 }
 
 // static
diff --git a/content/content_browser.gypi b/content/content_browser.gypi
index a108385..d302f64 100644
--- a/content/content_browser.gypi
+++ b/content/content_browser.gypi
@@ -1032,6 +1032,8 @@
       'browser/media/android/media_session.cc',
       'browser/media/android/media_session.h',
       'browser/media/android/media_session_observer.h',
+      'browser/media/android/media_session_uma_helper.cc',
+      'browser/media/android/media_session_uma_helper.h',
       'browser/media/android/media_throttler.cc',
       'browser/media/android/media_throttler.h',
       'browser/media/audio_stream_monitor.cc',
diff --git a/content/content_tests.gypi b/content/content_tests.gypi
index 212adaa..13b8121 100644
--- a/content/content_tests.gypi
+++ b/content/content_tests.gypi
@@ -485,6 +485,7 @@
       'browser/loader/temporary_file_stream_unittest.cc',
       'browser/loader/upload_data_stream_builder_unittest.cc',
       'browser/mach_broker_mac_unittest.cc',
+      'browser/media/android/media_session_uma_helper_unittest.cc',
       'browser/media/capture/audio_mirroring_manager_unittest.cc',
       'browser/media/capture/web_contents_audio_input_stream_unittest.cc',
       'browser/media/capture/web_contents_video_capture_device_unittest.cc',
diff --git a/content/gpu/BUILD.gn b/content/gpu/BUILD.gn
index 879f7448..74c0142 100644
--- a/content/gpu/BUILD.gn
+++ b/content/gpu/BUILD.gn
@@ -4,6 +4,7 @@
 
 import("//build/config/ui.gni")
 import("//content/content.gni")
+import("//media/media_options.gni")
 
 # See //content/BUILD.gn for how this works.
 group("gpu") {
@@ -48,6 +49,10 @@
     "//ui/gl",
   ]
 
+  if (enable_mojo_media == "gpu") {
+    deps += [ "//media/mojo/services:application" ]
+  }
+
   if (is_win) {
     configs += [
       "//third_party/khronos:khronos_headers",
diff --git a/content/gpu/DEPS b/content/gpu/DEPS
index 1831675..87a7a0d 100644
--- a/content/gpu/DEPS
+++ b/content/gpu/DEPS
@@ -2,6 +2,8 @@
   "+content/child",
   "+libEGL",
   "+libGLESv2",
+  "+media/mojo/services",
+  "+mojo/shell",
   "+sandbox",
   "+skia",
 ]
diff --git a/content/gpu/gpu_process_control_impl.cc b/content/gpu/gpu_process_control_impl.cc
index c087c83..cb3175b8 100644
--- a/content/gpu/gpu_process_control_impl.cc
+++ b/content/gpu/gpu_process_control_impl.cc
@@ -4,7 +4,12 @@
 
 #include "content/gpu/gpu_process_control_impl.h"
 
-#include "base/logging.h"
+#if defined(ENABLE_MOJO_MEDIA_IN_GPU_PROCESS)
+#include "base/bind.h"
+#include "base/bind_helpers.h"
+#include "media/mojo/services/mojo_media_application.h"
+#include "mojo/shell/static_application_loader.h"
+#endif
 
 namespace content {
 
@@ -14,9 +19,12 @@
 
 void GpuProcessControlImpl::RegisterApplicationLoaders(
     URLToLoaderMap* url_to_loader_map) {
-  // TODO(xhwang): Support MojoMediaApplication here.
-  // See http://crbug.com/521755
-  NOTIMPLEMENTED();
+#if defined(ENABLE_MOJO_MEDIA_IN_GPU_PROCESS)
+  (*url_to_loader_map)[GURL("mojo:media")] =
+      new mojo::shell::StaticApplicationLoader(
+          base::Bind(&media::MojoMediaApplication::CreateApp),
+          base::Bind(&base::DoNothing));
+#endif
 }
 
 }  // namespace content
diff --git a/content/public/android/java/src/org/chromium/content/browser/input/AdapterInputConnection.java b/content/public/android/java/src/org/chromium/content/browser/input/AdapterInputConnection.java
index 5a22cbf..10bf9fd6 100644
--- a/content/public/android/java/src/org/chromium/content/browser/input/AdapterInputConnection.java
+++ b/content/public/android/java/src/org/chromium/content/browser/input/AdapterInputConnection.java
@@ -7,7 +7,6 @@
 import android.text.Editable;
 import android.text.InputType;
 import android.text.Selection;
-import android.text.TextUtils;
 import android.util.StringBuilderPrinter;
 import android.view.KeyCharacterMap;
 import android.view.KeyEvent;
@@ -247,7 +246,6 @@
     @Override
     public boolean setComposingText(CharSequence text, int newCursorPosition) {
         Log.d(TAG, "setComposingText [%s] [%d]", text, newCursorPosition);
-        if (maybePerformEmptyCompositionWorkaround(text)) return true;
         mPendingAccent = 0;
         super.setComposingText(text, newCursorPosition);
         updateSelectionIfRequired();
@@ -260,7 +258,6 @@
     @Override
     public boolean commitText(CharSequence text, int newCursorPosition) {
         Log.d(TAG, "commitText [%s] [%d]", text, newCursorPosition);
-        if (maybePerformEmptyCompositionWorkaround(text)) return true;
         mPendingAccent = 0;
         super.commitText(text, newCursorPosition);
         updateSelectionIfRequired();
@@ -535,33 +532,6 @@
         return mImeAdapter.getInputMethodManagerWrapper();
     }
 
-    /**
-     * This method works around the issue crbug.com/373934 where Blink does not cancel
-     * the composition when we send a commit with the empty text.
-     *
-     * TODO(aurimas) Remove this once crbug.com/373934 is fixed.
-     *
-     * @param text Text that software keyboard requested to commit.
-     * @return Whether the workaround was performed.
-     */
-    private boolean maybePerformEmptyCompositionWorkaround(CharSequence text) {
-        int selectionStart = Selection.getSelectionStart(mEditable);
-        int selectionEnd = Selection.getSelectionEnd(mEditable);
-        int compositionStart = getComposingSpanStart(mEditable);
-        int compositionEnd = getComposingSpanEnd(mEditable);
-        if (TextUtils.isEmpty(text) && (selectionStart == selectionEnd)
-                && compositionStart != INVALID_COMPOSITION
-                && compositionEnd != INVALID_COMPOSITION) {
-            beginBatchEdit();
-            finishComposingText();
-            int selection = Selection.getSelectionStart(mEditable);
-            deleteSurroundingText(selection - compositionStart, selection - compositionEnd);
-            endBatchEdit();
-            return true;
-        }
-        return false;
-    }
-
     @VisibleForTesting
     static class ImeState {
         public final String text;
diff --git a/content/public/browser/navigation_controller.h b/content/public/browser/navigation_controller.h
index c0c1899..3ad7e03 100644
--- a/content/public/browser/navigation_controller.h
+++ b/content/public/browser/navigation_controller.h
@@ -410,10 +410,15 @@
   // Continues a repost that brought up a warning.
   virtual void ContinuePendingReload() = 0;
 
-  // Returns true if we are navigating to the URL the tab is opened with.
-  // Returns false after the initial navigation has committed.
+  // Returns true if this is a newly created tab or a cloned tab, which has not
+  // yet committed a real page. Returns false after the initial navigation has
+  // committed.
   virtual bool IsInitialNavigation() const = 0;
 
+  // Returns true if this is a newly created tab (not a clone) that has not yet
+  // committed a real page.
+  virtual bool IsInitialBlankNavigation() const = 0;
+
   // Broadcasts the NOTIFICATION_NAV_ENTRY_CHANGED notification for the given
   // entry. This will keep things in sync like the saved session.
   virtual void NotifyEntryChanged(const NavigationEntry* entry) = 0;
diff --git a/content/public/common/content_switches.cc b/content/public/common/content_switches.cc
index 2a98bdb..ace7157 100644
--- a/content/public/common/content_switches.cc
+++ b/content/public/common/content_switches.cc
@@ -458,6 +458,9 @@
 const char kEnableUserMediaScreenCapturing[] =
     "enable-usermedia-screen-capturing";
 
+// Enable the mode that uses zooming to implment device scale factor behavior.
+const char kEnableUseZoomForDSF[]            = "enable-use-zoom-for-dsf";
+
 // Enables the use of the @viewport CSS rule, which allows
 // pages to control aspects of their own layout. This also turns on touch-screen
 // pinch gestures.
diff --git a/content/public/common/content_switches.h b/content/public/common/content_switches.h
index 7812dc6..5d47e85 100644
--- a/content/public/common/content_switches.h
+++ b/content/public/common/content_switches.h
@@ -137,6 +137,7 @@
 CONTENT_EXPORT extern const char kEnableTracing[];
 CONTENT_EXPORT extern const char kEnableTracingOutput[];
 CONTENT_EXPORT extern const char kEnableUserMediaScreenCapturing[];
+extern const char kEnableUseZoomForDSF[];
 CONTENT_EXPORT extern const char kEnableViewport[];
 CONTENT_EXPORT extern const char kEnableVtune[];
 CONTENT_EXPORT extern const char kEnableWebGLDraftExtensions[];
diff --git a/content/renderer/accessibility/blink_ax_enum_conversion.cc b/content/renderer/accessibility/blink_ax_enum_conversion.cc
index 11aa9d5..5c56c3c4 100644
--- a/content/renderer/accessibility/blink_ax_enum_conversion.cc
+++ b/content/renderer/accessibility/blink_ax_enum_conversion.cc
@@ -358,6 +358,8 @@
       return ui::AX_EVENT_CHECKED_STATE_CHANGED;
     case blink::WebAXEventChildrenChanged:
       return ui::AX_EVENT_CHILDREN_CHANGED;
+    case blink::WebAXEventDocumentSelectionChanged:
+      return ui::AX_EVENT_DOCUMENT_SELECTION_CHANGED;
     case blink::WebAXEventFocus:
       return ui::AX_EVENT_FOCUS;
     case blink::WebAXEventHover:
diff --git a/content/renderer/accessibility/renderer_accessibility.cc b/content/renderer/accessibility/renderer_accessibility.cc
index 84b8a10..c672c6b 100644
--- a/content/renderer/accessibility/renderer_accessibility.cc
+++ b/content/renderer/accessibility/renderer_accessibility.cc
@@ -186,15 +186,6 @@
     }
   }
 
-  if (event == ui::AX_EVENT_TEXT_SELECTION_CHANGED &&
-      obj.isFocused() &&
-      !obj.equals(document.accessibilityObject())) {
-    // Changing the text selection in a text field may invalidate
-    // the anchor/focus attributes on the tree root.  Send a generic
-    // notification to have it updated.
-    HandleAXEvent(document.accessibilityObject(), event);
-  }
-
   // Add the accessibility object to our cache and ensure it's valid.
   AccessibilityHostMsg_EventParams acc_event;
   acc_event.id = obj.axID();
diff --git a/content/renderer/accessibility/renderer_accessibility_browsertest.cc b/content/renderer/accessibility/renderer_accessibility_browsertest.cc
index c20ee53..7f2747e 100644
--- a/content/renderer/accessibility/renderer_accessibility_browsertest.cc
+++ b/content/renderer/accessibility/renderer_accessibility_browsertest.cc
@@ -435,46 +435,4 @@
   ASSERT_EQ(0U, base::get<0>(param).size());
 }
 
-TEST_F(RendererAccessibilityTest, TextSelectionShouldSendRoot) {
-  // A text selection change in a text field will be reflected in attributes
-  // of the root node.  Verify that the root node is updated as the result
-  // of a text change event.
-  std::string html =
-      "<body>"
-      "  <div role='group'>"
-      "    <input id='input' type='text' value='hello there'>"
-      "  </div>"
-      "</body>";
-  LoadHTML(html.c_str());
-
-  scoped_ptr<TestRendererAccessibility> accessibility(
-      new TestRendererAccessibility(frame()));
-  accessibility->SendPendingAccessibilityEvents();
-  sink_->ClearMessages();
-
-  WebDocument document = view()->GetWebView()->mainFrame()->document();
-  WebAXObject root_obj = document.accessibilityObject();
-  WebAXObject input_obj =
-      document.getElementById("input").accessibilityObject();
-  ASSERT_EQ(blink::WebAXRoleTextField, input_obj.role());
-  ExecuteJavaScriptForTests("document.getElementById('input').focus();");
-  accessibility->HandleAXEvent(
-      input_obj,
-      ui::AX_EVENT_TEXT_SELECTION_CHANGED);
-  accessibility->SendPendingAccessibilityEvents();
-  std::vector<AccessibilityHostMsg_EventParams> all_events;
-  GetAllAccEvents(&all_events);
-  EXPECT_EQ(2U, all_events.size());
-  bool had_root_update = false, had_input_update = false;
-  for (auto i = all_events.begin(); i != all_events.end(); ++i) {
-    ASSERT_EQ(ui::AX_EVENT_TEXT_SELECTION_CHANGED, i->event_type);
-    ASSERT_EQ(1U, i->update.nodes.size());
-    if (root_obj.axID() == i->update.nodes[0].id)
-      had_root_update = true;
-    if (input_obj.axID() == i->update.nodes[0].id)
-      had_input_update = true;
-  }
-  ASSERT_TRUE(had_root_update);
-  ASSERT_TRUE(had_input_update);
-}
 }  // namespace content
diff --git a/content/renderer/android/synchronous_compositor_factory.h b/content/renderer/android/synchronous_compositor_factory.h
index 8c94cd2..0f001fb 100644
--- a/content/renderer/android/synchronous_compositor_factory.h
+++ b/content/renderer/android/synchronous_compositor_factory.h
@@ -49,7 +49,9 @@
   GetCompositorTaskRunner() = 0;
   virtual scoped_ptr<cc::OutputSurface> CreateOutputSurface(
       int routing_id,
-      scoped_refptr<FrameSwapMessageQueue> frame_swap_message_queue) = 0;
+      const scoped_refptr<FrameSwapMessageQueue>& frame_swap_message_queue,
+      const scoped_refptr<cc::ContextProvider>& onscreen_context,
+      const scoped_refptr<cc::ContextProvider>& worker_context) = 0;
 
   // The factory maintains ownership of the returned interface.
   virtual InputHandlerManagerClient* GetInputHandlerManagerClient() = 0;
diff --git a/content/renderer/input/synchronous_input_handler_proxy.h b/content/renderer/input/synchronous_input_handler_proxy.h
index 438f41ce..3bf3990 100644
--- a/content/renderer/input/synchronous_input_handler_proxy.h
+++ b/content/renderer/input/synchronous_input_handler_proxy.h
@@ -6,6 +6,7 @@
 #define CONTENT_RENDERER_INPUT_SYNCHRONOUS_INPUT_HANDLER_PROXY_H_
 
 #include "base/time/time.h"
+#include "content/common/content_export.h"
 
 namespace gfx {
 class ScrollOffset;
@@ -16,6 +17,8 @@
 
 class CONTENT_EXPORT SynchronousInputHandler {
  public:
+  virtual ~SynchronousInputHandler() {}
+
   // Informs the Android WebView embedder that a fling animation is running, and
   // that it should call SynchronouslyAnimate() if it wants to execute that
   // animation. The embedder/app may choose to override and ignore the
@@ -39,6 +42,8 @@
 // animations.
 class CONTENT_EXPORT SynchronousInputHandlerProxy {
  public:
+  virtual ~SynchronousInputHandlerProxy() {}
+
   // Tell the proxy that we will control the timing of root fling animations
   // from the SynchronousInputHandler. Once this is set, the InputHandler is
   // not requested to Animate() the InputHandlerProxy for root layer flings.
diff --git a/content/renderer/media/media_stream_audio_processor.cc b/content/renderer/media/media_stream_audio_processor.cc
index 23547d1..ed94baa3 100644
--- a/content/renderer/media/media_stream_audio_processor.cc
+++ b/content/renderer/media/media_stream_audio_processor.cc
@@ -137,7 +137,8 @@
            new MediaStreamAudioBus(destination_channels, destination_frames)),
        data_available_(false) {
     DCHECK_GE(source_channels, destination_channels);
-    DCHECK_GT(sample_rate_, 0);
+    DCHECK_GE(sample_rate_, 8000);
+    DCHECK_LE(sample_rate_, 48000);
 
     if (source_channels > destination_channels) {
       audio_source_intermediate_ =
diff --git a/content/renderer/media/media_stream_audio_processor_unittest.cc b/content/renderer/media/media_stream_audio_processor_unittest.cc
index 20eb181..e0492bb 100644
--- a/content/renderer/media/media_stream_audio_processor_unittest.cc
+++ b/content/renderer/media/media_stream_audio_processor_unittest.cc
@@ -456,7 +456,7 @@
   EXPECT_TRUE(audio_processor->has_audio_processing());
 
   static const int kSupportedSampleRates[] =
-      { 8000, 16000, 22050, 32000, 44100, 48000, 88200, 96000 };
+      { 8000, 16000, 22050, 32000, 44100, 48000 };
   for (size_t i = 0; i < arraysize(kSupportedSampleRates); ++i) {
     int buffer_size = (kSupportedSampleRates[i] / 100)  < 128 ?
         kSupportedSampleRates[i] / 100 : 128;
diff --git a/content/renderer/media/webmediaplayer_ms.cc b/content/renderer/media/webmediaplayer_ms.cc
index 10b9a566..db0c6db 100644
--- a/content/renderer/media/webmediaplayer_ms.cc
+++ b/content/renderer/media/webmediaplayer_ms.cc
@@ -269,7 +269,7 @@
     audio_renderer_->SetVolume(volume_);
 }
 
-void WebMediaPlayerMS::setSinkId(const blink::WebString& device_id,
+void WebMediaPlayerMS::setSinkId(const blink::WebString& sink_id,
                                  media::WebSetSinkIdCB* web_callback) {
   DCHECK(thread_checker_.CalledOnValidThread());
   DVLOG(1) << __FUNCTION__;
@@ -278,11 +278,8 @@
   if (audio_renderer_.get()) {
     media::OutputDevice* output_device = audio_renderer_->GetOutputDevice();
     if (output_device) {
-      const std::string device_id_str(device_id.utf8());
-      const url::Origin security_origin(
-          GURL(frame_->securityOrigin().toString().utf8()));
-      output_device->SwitchOutputDevice(device_id_str, security_origin,
-                                        callback);
+      output_device->SwitchOutputDevice(sink_id.utf8(),
+                                        frame_->securityOrigin(), callback);
       return;
     }
   }
diff --git a/content/renderer/media/webmediaplayer_ms.h b/content/renderer/media/webmediaplayer_ms.h
index 4493f07..15cd854d 100644
--- a/content/renderer/media/webmediaplayer_ms.h
+++ b/content/renderer/media/webmediaplayer_ms.h
@@ -79,7 +79,7 @@
   void seek(double seconds) override;
   void setRate(double rate) override;
   void setVolume(double volume) override;
-  void setSinkId(const blink::WebString& device_id,
+  void setSinkId(const blink::WebString& sink_id,
                  media::WebSetSinkIdCB* web_callback) override;
   void setPreload(blink::WebMediaPlayer::Preload preload) override;
   blink::WebTimeRanges buffered() const override;
diff --git a/content/renderer/media/webrtc_audio_device_impl.cc b/content/renderer/media/webrtc_audio_device_impl.cc
index c939e64..7b0616c 100644
--- a/content/renderer/media/webrtc_audio_device_impl.cc
+++ b/content/renderer/media/webrtc_audio_device_impl.cc
@@ -36,6 +36,7 @@
   main_thread_checker_.DetachFromThread();
 
   worker_thread_checker_.DetachFromThread();
+  audio_renderer_thread_checker_.DetachFromThread();
 }
 
 WebRtcAudioDeviceImpl::~WebRtcAudioDeviceImpl() {
@@ -64,6 +65,7 @@
                                        int sample_rate,
                                        int audio_delay_milliseconds,
                                        base::TimeDelta* current_time) {
+  DCHECK(audio_renderer_thread_checker_.CalledOnValidThread());
   {
     base::AutoLock auto_lock(lock_);
     if (!playing_) {
@@ -135,6 +137,16 @@
   renderer_ = NULL;
 }
 
+void WebRtcAudioDeviceImpl::AudioRendererThreadStopped() {
+  DCHECK(main_thread_checker_.CalledOnValidThread());
+  audio_renderer_thread_checker_.DetachFromThread();
+  // Notify the playout sink of the change.
+  // Not holding |lock_| because the caller must guarantee that the audio
+  // renderer thread is dead, so no race is possible with |playout_sinks_|
+  for (const auto& sink : playout_sinks_)
+    sink->OnPlayoutDataSourceChanged();
+}
+
 int32_t WebRtcAudioDeviceImpl::RegisterAudioCallback(
     webrtc::AudioTransport* audio_callback) {
   DVLOG(1) << "WebRtcAudioDeviceImpl::RegisterAudioCallback()";
diff --git a/content/renderer/media/webrtc_audio_device_impl.h b/content/renderer/media/webrtc_audio_device_impl.h
index a89e407..e9e9d856 100644
--- a/content/renderer/media/webrtc_audio_device_impl.h
+++ b/content/renderer/media/webrtc_audio_device_impl.h
@@ -197,6 +197,11 @@
   // Callback to notify the client that the renderer is going away.
   virtual void RemoveAudioRenderer(WebRtcAudioRenderer* renderer) = 0;
 
+  // Callback to notify the client that the audio renderer thread stopped.
+  // This function must be called only when that thread is actually stopped.
+  // Otherwise a race may occur.
+  virtual void AudioRendererThreadStopped() = 0;
+
  protected:
   virtual ~WebRtcAudioRendererSource() {}
 };
@@ -341,6 +346,7 @@
 
   // Called on the main render thread.
   void RemoveAudioRenderer(WebRtcAudioRenderer* renderer) override;
+  void AudioRendererThreadStopped() override;
 
   // WebRtcPlayoutDataSource implementation.
   void AddPlayoutSink(WebRtcPlayoutDataSource::Sink* sink) override;
@@ -351,6 +357,7 @@
   // Used to check methods that are called on libjingle's signaling thread.
   base::ThreadChecker signaling_thread_checker_;
   base::ThreadChecker worker_thread_checker_;
+  base::ThreadChecker audio_renderer_thread_checker_;
 
   mutable int ref_count_;
 
@@ -378,7 +385,7 @@
   int output_delay_ms_;
 
   // Protects |recording_|, |output_delay_ms_|, |input_delay_ms_|, |renderer_|
-  // |recording_| and |microphone_volume_|.
+  // |recording_|, |microphone_volume_| and |playout_sinks_|.
   mutable base::Lock lock_;
 
   // Used to protect the racing of calling OnData() since there can be more
diff --git a/content/renderer/media/webrtc_audio_renderer.cc b/content/renderer/media/webrtc_audio_renderer.cc
index 4c85dbe..9015afc 100644
--- a/content/renderer/media/webrtc_audio_renderer.cc
+++ b/content/renderer/media/webrtc_audio_renderer.cc
@@ -107,7 +107,6 @@
   }
 
   media::OutputDevice* GetOutputDevice() override {
-    DVLOG(1) << __FUNCTION__;
     DCHECK(thread_checker_.CalledOnValidThread());
     return delegate_->GetOutputDevice();
   }
@@ -194,6 +193,7 @@
   WebRtcLogMessage(base::StringPrintf(
       "WAR::WAR. source_render_frame_id=%d, session_id=%d, effects=%i",
       source_render_frame_id, session_id, sink_params_.effects()));
+  audio_renderer_thread_checker_.DetachFromThread();
 }
 
 WebRtcAudioRenderer::~WebRtcAudioRenderer() {
@@ -204,87 +204,33 @@
 bool WebRtcAudioRenderer::Initialize(WebRtcAudioRendererSource* source) {
   DVLOG(1) << "WebRtcAudioRenderer::Initialize()";
   DCHECK(thread_checker_.CalledOnValidThread());
-  base::AutoLock auto_lock(lock_);
-  DCHECK_EQ(state_, UNINITIALIZED);
   DCHECK(source);
   DCHECK(!sink_.get());
-  DCHECK(!source_);
+  DCHECK_GE(session_id_, 0);
+  {
+    base::AutoLock auto_lock(lock_);
+    DCHECK_EQ(state_, UNINITIALIZED);
+    DCHECK(!source_);
+  }
 
   sink_ =
       AudioDeviceFactory::NewOutputDevice(source_render_frame_id_, session_id_,
                                           output_device_id_, security_origin_);
-  DCHECK_EQ(sink_->GetDeviceStatus(), media::OUTPUT_DEVICE_STATUS_OK);
-  // WebRTC does not yet support higher rates than 96000 on the client side
-  // and 48000 is the preferred sample rate. Therefore, if 192000 is detected,
-  // we change the rate to 48000 instead. The consequence is that the native
-  // layer will be opened up at 192kHz but WebRTC will provide data at 48kHz
-  // which will then be resampled by the audio converted on the browser side
-  // to match the native audio layer.
-  int sample_rate = sink_->GetOutputParameters().sample_rate();
-  DVLOG(1) << "Audio output hardware sample rate: " << sample_rate;
-  if (sample_rate == 192000) {
-    DVLOG(1) << "Resampling from 48000 to 192000 is required";
-    sample_rate = 48000;
+  if (sink_->GetDeviceStatus() != media::OUTPUT_DEVICE_STATUS_OK)
+    return false;
+
+  PrepareSink();
+  {
+    // No need to reassert the preconditions because the other thread accessing
+    // the fields (checked by |audio_renderer_thread_checker_|) only reads them.
+    base::AutoLock auto_lock(lock_);
+    source_ = source;
+
+    // User must call Play() before any audio can be heard.
+    state_ = PAUSED;
   }
-  media::AudioSampleRate asr;
-  if (media::ToAudioSampleRate(sample_rate, &asr)) {
-    UMA_HISTOGRAM_ENUMERATION(
-        "WebRTC.AudioOutputSampleRate", asr, media::kAudioSampleRateMax + 1);
-  } else {
-    UMA_HISTOGRAM_COUNTS("WebRTC.AudioOutputSampleRateUnexpected",
-                         sample_rate);
-  }
-
-  // Set up audio parameters for the source, i.e., the WebRTC client.
-
-  // The WebRTC client only supports multiples of 10ms as buffer size where
-  // 10ms is preferred for lowest possible delay.
-  const int frames_per_10ms = (sample_rate / 100);
-  DVLOG(1) << "Using WebRTC output buffer size: " << frames_per_10ms;
-  media::AudioParameters source_params(
-      media::AudioParameters::AUDIO_PCM_LOW_LATENCY,
-      sink_params_.channel_layout(), sample_rate, 16, frames_per_10ms);
-  source_params.set_channels_for_discrete(sink_params_.channels());
-
-  const int frames_per_buffer = GetOptimalBufferSize(
-      sample_rate, sink_->GetOutputParameters().frames_per_buffer());
-
-  sink_params_.Reset(sink_params_.format(), sink_params_.channel_layout(),
-                     sample_rate, 16, frames_per_buffer);
-
-  // Create a FIFO if re-buffering is required to match the source input with
-  // the sink request. The source acts as provider here and the sink as
-  // consumer.
-  fifo_delay_milliseconds_ = 0;
-  if (source_params.frames_per_buffer() != sink_params_.frames_per_buffer()) {
-    DVLOG(1) << "Rebuffering from " << source_params.frames_per_buffer()
-             << " to " << sink_params_.frames_per_buffer();
-    audio_fifo_.reset(new media::AudioPullFifo(
-        source_params.channels(),
-        source_params.frames_per_buffer(),
-        base::Bind(
-            &WebRtcAudioRenderer::SourceCallback,
-            base::Unretained(this))));
-
-    if (sink_params_.frames_per_buffer() > source_params.frames_per_buffer()) {
-      int frame_duration_milliseconds = base::Time::kMillisecondsPerSecond /
-          static_cast<double>(source_params.sample_rate());
-      fifo_delay_milliseconds_ = (sink_params_.frames_per_buffer() -
-        source_params.frames_per_buffer()) * frame_duration_milliseconds;
-    }
-  }
-
-  source_ = source;
-
-  // Configure the audio rendering client and start rendering.
-  DCHECK_GE(session_id_, 0);
-  sink_->Initialize(sink_params_, this);
-
   sink_->Start();
 
-  // User must call Play() before any audio can be heard.
-  state_ = PAUSED;
-
   return true;
 }
 
@@ -385,7 +331,7 @@
   }
 
   // Make sure to stop the sink while _not_ holding the lock since the Render()
-  // callback may currently be executing and try to grab the lock while we're
+  // callback may currently be executing and trying to grab the lock while we're
   // stopping the thread on which it runs.
   sink_->Stop();
 }
@@ -399,10 +345,8 @@
 }
 
 media::OutputDevice* WebRtcAudioRenderer::GetOutputDevice() {
-  DVLOG(1) << __FUNCTION__;
   DCHECK(thread_checker_.CalledOnValidThread());
-  DCHECK(sink_);
-  return sink_->GetOutputDevice();
+  return this;
 }
 
 base::TimeDelta WebRtcAudioRenderer::GetCurrentRenderTime() const {
@@ -415,8 +359,64 @@
   return false;
 }
 
+void WebRtcAudioRenderer::SwitchOutputDevice(
+    const std::string& device_id,
+    const url::Origin& security_origin,
+    const media::SwitchOutputDeviceCB& callback) {
+  DVLOG(1) << "WebRtcAudioRenderer::SwitchOutputDevice()";
+  DCHECK(thread_checker_.CalledOnValidThread());
+  DCHECK_GE(session_id_, 0);
+  {
+    base::AutoLock auto_lock(lock_);
+    DCHECK(source_);
+    DCHECK_NE(state_, UNINITIALIZED);
+  }
+
+  scoped_refptr<media::AudioOutputDevice> new_sink =
+      AudioDeviceFactory::NewOutputDevice(source_render_frame_id_, session_id_,
+                                          device_id, security_origin);
+  if (new_sink->GetDeviceStatus() != media::OUTPUT_DEVICE_STATUS_OK) {
+    callback.Run(new_sink->GetDeviceStatus());
+    return;
+  }
+
+  // Make sure to stop the sink while _not_ holding the lock since the Render()
+  // callback may currently be executing and trying to grab the lock while we're
+  // stopping the thread on which it runs.
+  sink_->Stop();
+  audio_renderer_thread_checker_.DetachFromThread();
+  sink_ = new_sink;
+  output_device_id_ = device_id;
+  security_origin_ = security_origin;
+  {
+    base::AutoLock auto_lock(lock_);
+    source_->AudioRendererThreadStopped();
+  }
+  PrepareSink();
+  sink_->Start();
+
+  callback.Run(media::OUTPUT_DEVICE_STATUS_OK);
+}
+
+media::AudioParameters WebRtcAudioRenderer::GetOutputParameters() {
+  DCHECK(thread_checker_.CalledOnValidThread());
+  if (!sink_.get())
+    return media::AudioParameters();
+
+  return sink_->GetOutputParameters();
+}
+
+media::OutputDeviceStatus WebRtcAudioRenderer::GetDeviceStatus() {
+  DCHECK(thread_checker_.CalledOnValidThread());
+  if (!sink_.get())
+    return media::OUTPUT_DEVICE_STATUS_ERROR_INTERNAL;
+
+  return sink_->GetDeviceStatus();
+}
+
 int WebRtcAudioRenderer::Render(media::AudioBus* audio_bus,
                                 int audio_delay_milliseconds) {
+  DCHECK(audio_renderer_thread_checker_.CalledOnValidThread());
   base::AutoLock auto_lock(lock_);
   if (!source_)
     return 0;
@@ -442,6 +442,7 @@
 // Called by AudioPullFifo when more data is necessary.
 void WebRtcAudioRenderer::SourceCallback(
     int fifo_frame_delay, media::AudioBus* audio_bus) {
+  DCHECK(audio_renderer_thread_checker_.CalledOnValidThread());
   base::TimeTicks start_time = base::TimeTicks::Now();
   DVLOG(2) << "WebRtcAudioRenderer::SourceCallback("
            << fifo_frame_delay << ", "
@@ -546,6 +547,7 @@
 void WebRtcAudioRenderer::OnPlayStateChanged(
     const scoped_refptr<webrtc::MediaStreamInterface>& media_stream,
     PlayingState* state) {
+  DCHECK(thread_checker_.CalledOnValidThread());
   webrtc::AudioTrackVector tracks(media_stream->GetAudioTracks());
   for (webrtc::AudioTrackVector::iterator it = tracks.begin();
        it != tracks.end(); ++it) {
@@ -561,4 +563,82 @@
   }
 }
 
+void WebRtcAudioRenderer::PrepareSink() {
+  DCHECK(thread_checker_.CalledOnValidThread());
+  media::AudioParameters sink_params;
+  {
+    base::AutoLock lock(lock_);
+    sink_params = sink_params_;
+  }
+  // WebRTC does not yet support higher rates than 96000 on the client side
+  // and 48000 is the preferred sample rate. Therefore, if 192000 is detected,
+  // we change the rate to 48000 instead. The consequence is that the native
+  // layer will be opened up at 192kHz but WebRTC will provide data at 48kHz
+  // which will then be resampled by the audio converted on the browser side
+  // to match the native audio layer.
+  int sample_rate = sink_->GetOutputParameters().sample_rate();
+  DVLOG(1) << "Audio output hardware sample rate: " << sample_rate;
+  if (sample_rate == 192000) {
+    DVLOG(1) << "Resampling from 48000 to 192000 is required";
+    sample_rate = 48000;
+  }
+  media::AudioSampleRate asr;
+  if (media::ToAudioSampleRate(sample_rate, &asr)) {
+    UMA_HISTOGRAM_ENUMERATION("WebRTC.AudioOutputSampleRate", asr,
+                              media::kAudioSampleRateMax + 1);
+  } else {
+    UMA_HISTOGRAM_COUNTS("WebRTC.AudioOutputSampleRateUnexpected", sample_rate);
+  }
+
+  // Set up audio parameters for the source, i.e., the WebRTC client.
+
+  // The WebRTC client only supports multiples of 10ms as buffer size where
+  // 10ms is preferred for lowest possible delay.
+  const int frames_per_10ms = (sample_rate / 100);
+  DVLOG(1) << "Using WebRTC output buffer size: " << frames_per_10ms;
+  media::AudioParameters source_params(
+      media::AudioParameters::AUDIO_PCM_LOW_LATENCY,
+      sink_params.channel_layout(), sample_rate, 16, frames_per_10ms);
+  source_params.set_channels_for_discrete(sink_params.channels());
+
+  const int frames_per_buffer = GetOptimalBufferSize(
+      sample_rate, sink_->GetOutputParameters().frames_per_buffer());
+
+  sink_params.Reset(sink_params.format(), sink_params.channel_layout(),
+                    sample_rate, 16, frames_per_buffer);
+
+  // Create a FIFO if re-buffering is required to match the source input with
+  // the sink request. The source acts as provider here and the sink as
+  // consumer.
+  int fifo_delay_milliseconds = 0;
+  scoped_ptr<media::AudioPullFifo> audio_fifo;
+  if (source_params.frames_per_buffer() != sink_params_.frames_per_buffer()) {
+    DVLOG(1) << "Rebuffering from " << source_params.frames_per_buffer()
+             << " to " << sink_params_.frames_per_buffer();
+    audio_fifo.reset(new media::AudioPullFifo(
+        source_params.channels(), source_params.frames_per_buffer(),
+        base::Bind(&WebRtcAudioRenderer::SourceCallback,
+                   base::Unretained(this))));
+
+    if (sink_params.frames_per_buffer() > source_params.frames_per_buffer()) {
+      int frame_duration_milliseconds =
+          base::Time::kMillisecondsPerSecond /
+          static_cast<double>(source_params.sample_rate());
+      fifo_delay_milliseconds = (sink_params_.frames_per_buffer() -
+                                 source_params.frames_per_buffer()) *
+                                frame_duration_milliseconds;
+    }
+  }
+
+  {
+    base::AutoLock lock(lock_);
+    sink_params_ = sink_params;
+    fifo_delay_milliseconds_ = fifo_delay_milliseconds;
+    if (audio_fifo.get())
+      audio_fifo_ = audio_fifo.Pass();
+  }
+
+  sink_->Initialize(sink_params, this);
+}
+
 }  // namespace content
diff --git a/content/renderer/media/webrtc_audio_renderer.h b/content/renderer/media/webrtc_audio_renderer.h
index b39d9a7f..5f0a8aa 100644
--- a/content/renderer/media/webrtc_audio_renderer.h
+++ b/content/renderer/media/webrtc_audio_renderer.h
@@ -17,6 +17,7 @@
 #include "media/base/audio_pull_fifo.h"
 #include "media/base/audio_renderer_sink.h"
 #include "media/base/channel_layout.h"
+#include "media/base/output_device.h"
 
 namespace media {
 class AudioOutputDevice;
@@ -35,7 +36,8 @@
 // for connecting WebRtc MediaStream with the audio pipeline.
 class CONTENT_EXPORT WebRtcAudioRenderer
     : NON_EXPORTED_BASE(public media::AudioRendererSink::RenderCallback),
-      NON_EXPORTED_BASE(public MediaStreamAudioRenderer) {
+      NON_EXPORTED_BASE(public MediaStreamAudioRenderer),
+      NON_EXPORTED_BASE(public media::OutputDevice) {
  public:
   // This is a little utility class that holds the configured state of an audio
   // stream.
@@ -120,6 +122,13 @@
   base::TimeDelta GetCurrentRenderTime() const override;
   bool IsLocalRenderer() const override;
 
+  // media::OutputDevice implementation
+  void SwitchOutputDevice(const std::string& device_id,
+                          const url::Origin& security_origin,
+                          const media::SwitchOutputDeviceCB& callback) override;
+  media::AudioParameters GetOutputParameters() override;
+  media::OutputDeviceStatus GetDeviceStatus() override;
+
   // Called when an audio renderer, either the main or a proxy, starts playing.
   // Here we maintain a reference count of how many renderers are currently
   // playing so that the shared play state of all the streams can be reflected
@@ -150,6 +159,7 @@
 
   // Used to DCHECK that we are called on the correct thread.
   base::ThreadChecker thread_checker_;
+  base::ThreadChecker audio_renderer_thread_checker_;
 
   // Flag to keep track the state of the renderer.
   State state_;
@@ -187,6 +197,10 @@
       const scoped_refptr<webrtc::MediaStreamInterface>& media_stream,
       PlayingState* state);
 
+  // Updates |sink_params_|, |audio_fifo_| and |fifo_delay_milliseconds_| based
+  // on |sink_|, and initializes |sink_|.
+  void PrepareSink();
+
   // The RenderFrame in which the audio is rendered into |sink_|.
   const int source_render_frame_id_;
   const int session_id_;
@@ -202,7 +216,9 @@
   // Audio data source from the browser process.
   WebRtcAudioRendererSource* source_;
 
-  // Protects access to |state_|, |source_|, |sink_| and |current_time_|.
+  // Protects access to |state_|, |source_|, |audio_fifo_|,
+  // |audio_delay_milliseconds_|, |fifo_delay_milliseconds_|, |current_time_|,
+  // |sink_params_| and |render_callback_count_|
   mutable base::Lock lock_;
 
   // Ref count for the MediaPlayers which are playing audio.
@@ -231,9 +247,9 @@
   media::AudioParameters sink_params_;
 
   // The preferred device id of the output device or empty for the default
-  // output device.
-  const std::string output_device_id_;
-  const url::Origin security_origin_;
+  // output device. Can change as a result of a SetSinkId() call.
+  std::string output_device_id_;
+  url::Origin security_origin_;
 
   // Maps audio sources to a list of active audio renderers.
   // Pointers to PlayingState objects are only kept in this map while the
diff --git a/content/renderer/media/webrtc_audio_renderer_unittest.cc b/content/renderer/media/webrtc_audio_renderer_unittest.cc
index 6e3eae7..9461dc7 100644
--- a/content/renderer/media/webrtc_audio_renderer_unittest.cc
+++ b/content/renderer/media/webrtc_audio_renderer_unittest.cc
@@ -5,6 +5,7 @@
 #include <string>
 #include <vector>
 
+#include "base/run_loop.h"
 #include "base/single_thread_task_runner.h"
 #include "content/public/renderer/media_stream_audio_renderer.h"
 #include "content/renderer/media/audio_device_factory.h"
@@ -31,6 +32,7 @@
 const int kHardwareBufferSize = 512;
 const char kDefaultOutputDeviceId[] = "";
 const char kOtherOutputDeviceId[] = "other-output-device";
+const char kInvalidOutputDeviceId[] = "invalid-device";
 
 class MockAudioOutputIPC : public media::AudioOutputIPC {
  public:
@@ -74,7 +76,9 @@
   MOCK_METHOD1(SetVolume, bool(double volume));
 
   media::OutputDeviceStatus GetDeviceStatus() override {
-    return media::OUTPUT_DEVICE_STATUS_OK;
+    return device_id_ == kInvalidOutputDeviceId
+               ? media::OUTPUT_DEVICE_STATUS_ERROR_INTERNAL
+               : media::OUTPUT_DEVICE_STATUS_OK;
   }
 
   std::string GetDeviceId() const { return device_id_; }
@@ -101,12 +105,21 @@
                                 int audio_delay_milliseconds,
                                 base::TimeDelta* current_time));
   MOCK_METHOD1(RemoveAudioRenderer, void(WebRtcAudioRenderer* renderer));
+  MOCK_METHOD0(AudioRendererThreadStopped, void());
 };
 
 }  // namespace
 
 class WebRtcAudioRendererTest : public testing::Test,
                                 public AudioDeviceFactory {
+ public:
+  MOCK_METHOD1(MockSwitchDeviceCallback, void(media::OutputDeviceStatus));
+  void SwitchDeviceCallback(base::RunLoop* loop,
+                            media::OutputDeviceStatus result) {
+    MockSwitchDeviceCallback(result);
+    loop->Quit();
+  }
+
  protected:
   WebRtcAudioRendererTest()
       : message_loop_(new base::MessageLoopForIO),
@@ -133,15 +146,19 @@
       int session_id,
       const std::string& device_id,
       const url::Origin& security_origin) {
-    mock_output_device_ = nullptr;
-    mock_ipc_ = new MockAudioOutputIPC();
-    mock_output_device_ =
-        new FakeAudioOutputDevice(scoped_ptr<media::AudioOutputIPC>(mock_ipc_),
+    MockAudioOutputIPC* fake_ipc = new MockAudioOutputIPC();
+    FakeAudioOutputDevice* fake_device =
+        new FakeAudioOutputDevice(scoped_ptr<media::AudioOutputIPC>(fake_ipc),
                                   message_loop_->task_runner(), device_id);
+    if (device_id != kInvalidOutputDeviceId) {
+      mock_output_device_ = fake_device;
+      mock_ipc_ = fake_ipc;
+      EXPECT_CALL(*mock_output_device_.get(), Start());
+    }
+
     MockCreateOutputDevice(render_frame_id, session_id, device_id,
                            security_origin);
-    EXPECT_CALL(*mock_output_device_.get(), Start());
-    return mock_output_device_.get();
+    return fake_device;
   }
 
   // Used to construct |mock_output_device_|.
@@ -240,4 +257,47 @@
   renderer_proxy_->Stop();
 }
 
+TEST_F(WebRtcAudioRendererTest, SwitchOutputDevice) {
+  SetupRenderer(kDefaultOutputDeviceId);
+  EXPECT_EQ(kDefaultOutputDeviceId, mock_output_device_->GetDeviceId());
+  renderer_proxy_->Start();
+
+  EXPECT_CALL(*mock_output_device_.get(), Stop());
+  EXPECT_CALL(*this, MockCreateOutputDevice(_, _, kOtherOutputDeviceId, _));
+  EXPECT_CALL(*source_.get(), AudioRendererThreadStopped());
+  EXPECT_CALL(*this, MockSwitchDeviceCallback(media::OUTPUT_DEVICE_STATUS_OK));
+  base::RunLoop loop;
+  renderer_proxy_->GetOutputDevice()->SwitchOutputDevice(
+      kOtherOutputDeviceId, url::Origin(),
+      base::Bind(&WebRtcAudioRendererTest::SwitchDeviceCallback,
+                 base::Unretained(this), &loop));
+  loop.Run();
+  EXPECT_EQ(kOtherOutputDeviceId, mock_output_device_->GetDeviceId());
+
+  EXPECT_CALL(*mock_output_device_.get(), Stop());
+  EXPECT_CALL(*source_.get(), RemoveAudioRenderer(renderer_.get()));
+  renderer_proxy_->Stop();
+}
+
+TEST_F(WebRtcAudioRendererTest, SwitchOutputDeviceInvalidDevice) {
+  SetupRenderer(kDefaultOutputDeviceId);
+  EXPECT_EQ(kDefaultOutputDeviceId, mock_output_device_->GetDeviceId());
+  renderer_proxy_->Start();
+
+  EXPECT_CALL(*this, MockCreateOutputDevice(_, _, kInvalidOutputDeviceId, _));
+  EXPECT_CALL(*this, MockSwitchDeviceCallback(
+                         media::OUTPUT_DEVICE_STATUS_ERROR_INTERNAL));
+  base::RunLoop loop;
+  renderer_proxy_->GetOutputDevice()->SwitchOutputDevice(
+      kInvalidOutputDeviceId, url::Origin(),
+      base::Bind(&WebRtcAudioRendererTest::SwitchDeviceCallback,
+                 base::Unretained(this), &loop));
+  loop.Run();
+  EXPECT_EQ(kDefaultOutputDeviceId, mock_output_device_->GetDeviceId());
+
+  EXPECT_CALL(*mock_output_device_.get(), Stop());
+  EXPECT_CALL(*source_.get(), RemoveAudioRenderer(renderer_.get()));
+  renderer_proxy_->Stop();
+}
+
 }  // namespace content
diff --git a/content/renderer/media/webrtc_local_audio_renderer.cc b/content/renderer/media/webrtc_local_audio_renderer.cc
index 2ef52c9..9746e0e 100644
--- a/content/renderer/media/webrtc_local_audio_renderer.cc
+++ b/content/renderer/media/webrtc_local_audio_renderer.cc
@@ -212,9 +212,8 @@
 }
 
 media::OutputDevice* WebRtcLocalAudioRenderer::GetOutputDevice() {
-  DVLOG(1) << __FUNCTION__;
   DCHECK(task_runner_->BelongsToCurrentThread());
-  return sink_.get();
+  return this;
 }
 
 base::TimeDelta WebRtcLocalAudioRenderer::GetCurrentRenderTime() const {
@@ -229,6 +228,57 @@
   return true;
 }
 
+void WebRtcLocalAudioRenderer::SwitchOutputDevice(
+    const std::string& device_id,
+    const url::Origin& security_origin,
+    const media::SwitchOutputDeviceCB& callback) {
+  DVLOG(1) << "WebRtcLocalAudioRenderer::SwitchOutputDevice()";
+  DCHECK(task_runner_->BelongsToCurrentThread());
+
+  scoped_refptr<media::AudioOutputDevice> new_sink =
+      AudioDeviceFactory::NewOutputDevice(source_render_frame_id_, session_id_,
+                                          device_id, security_origin);
+  if (new_sink->GetDeviceStatus() != media::OUTPUT_DEVICE_STATUS_OK) {
+    callback.Run(new_sink->GetDeviceStatus());
+    return;
+  }
+
+  output_device_id_ = device_id;
+  security_origin_ = security_origin;
+  bool was_sink_started = sink_started_;
+
+  if (sink_.get())
+    sink_->Stop();
+
+  sink_started_ = false;
+  sink_ = new_sink;
+  int frames_per_buffer = sink_->GetOutputParameters().frames_per_buffer();
+  sink_params_ = source_params_;
+  sink_params_.set_frames_per_buffer(WebRtcAudioRenderer::GetOptimalBufferSize(
+      source_params_.sample_rate(), frames_per_buffer));
+
+  if (was_sink_started)
+    MaybeStartSink();
+
+  callback.Run(media::OUTPUT_DEVICE_STATUS_OK);
+}
+
+media::AudioParameters WebRtcLocalAudioRenderer::GetOutputParameters() {
+  DCHECK(task_runner_->BelongsToCurrentThread());
+  if (!sink_.get())
+    return media::AudioParameters();
+
+  return sink_->GetOutputParameters();
+}
+
+media::OutputDeviceStatus WebRtcLocalAudioRenderer::GetDeviceStatus() {
+  DCHECK(task_runner_->BelongsToCurrentThread());
+  if (!sink_.get())
+    return media::OUTPUT_DEVICE_STATUS_ERROR_INTERNAL;
+
+  return sink_->GetDeviceStatus();
+}
+
 void WebRtcLocalAudioRenderer::MaybeStartSink() {
   DCHECK(task_runner_->BelongsToCurrentThread());
   DVLOG(1) << "WebRtcLocalAudioRenderer::MaybeStartSink()";
@@ -286,18 +336,13 @@
   if (!sink_.get())
     return;  // WebRtcLocalAudioRenderer has not yet been started.
 
-  scoped_refptr<media::AudioOutputDevice> new_sink =
-      AudioDeviceFactory::NewOutputDevice(source_render_frame_id_, session_id_,
-                                          output_device_id_, security_origin_);
-  if (new_sink->GetDeviceStatus() != media::OUTPUT_DEVICE_STATUS_OK)
-    return;
-
   // Stop |sink_| and re-create a new one to be initialized with different audio
   // parameters.  Then, invoke MaybeStartSink() to restart everything again.
   sink_->Stop();
   sink_started_ = false;
-
-  sink_ = new_sink;
+  sink_ =
+      AudioDeviceFactory::NewOutputDevice(source_render_frame_id_, session_id_,
+                                          output_device_id_, security_origin_);
   int frames_per_buffer = sink_->GetOutputParameters().frames_per_buffer();
   sink_params_ = source_params_;
   sink_params_.set_frames_per_buffer(WebRtcAudioRenderer::GetOptimalBufferSize(
diff --git a/content/renderer/media/webrtc_local_audio_renderer.h b/content/renderer/media/webrtc_local_audio_renderer.h
index f26d6ee..89734c35 100644
--- a/content/renderer/media/webrtc_local_audio_renderer.h
+++ b/content/renderer/media/webrtc_local_audio_renderer.h
@@ -18,6 +18,7 @@
 #include "content/public/renderer/media_stream_audio_sink.h"
 #include "content/renderer/media/webrtc_audio_device_impl.h"
 #include "content/renderer/media/webrtc_local_audio_track.h"
+#include "media/base/output_device.h"
 #include "third_party/WebKit/public/platform/WebMediaStreamTrack.h"
 
 namespace media {
@@ -46,7 +47,8 @@
 class CONTENT_EXPORT WebRtcLocalAudioRenderer
     : NON_EXPORTED_BASE(public MediaStreamAudioRenderer),
       NON_EXPORTED_BASE(public MediaStreamAudioSink),
-      NON_EXPORTED_BASE(public media::AudioRendererSink::RenderCallback) {
+      NON_EXPORTED_BASE(public media::AudioRendererSink::RenderCallback),
+      NON_EXPORTED_BASE(public media::OutputDevice) {
  public:
   // Creates a local renderer and registers a capturing |source| object.
   // The |source| is owned by the WebRtcAudioDeviceImpl.
@@ -68,6 +70,13 @@
   base::TimeDelta GetCurrentRenderTime() const override;
   bool IsLocalRenderer() const override;
 
+  // media::OutputDevice implementation
+  void SwitchOutputDevice(const std::string& device_id,
+                          const url::Origin& security_origin,
+                          const media::SwitchOutputDeviceCB& callback) override;
+  media::AudioParameters GetOutputParameters() override;
+  media::OutputDeviceStatus GetDeviceStatus() override;
+
   const base::TimeDelta& total_render_time() const {
     return total_render_time_;
   }
@@ -143,13 +152,14 @@
   // Set when playing, cleared when paused.
   bool playing_;
 
-  // Protects |audio_shifter_|, |playing_| and |sink_|.
+  // Protects |audio_shifter_|, |playing_|, |last_render_time_|,
+  // |total_render_time_| and |volume_|.
   mutable base::Lock thread_lock_;
 
   // The preferred device id of the output device or empty for the default
   // output device.
-  const std::string output_device_id_;
-  const url::Origin security_origin_;
+  std::string output_device_id_;
+  url::Origin security_origin_;
 
   // Cache value for the volume.
   float volume_;
diff --git a/content/renderer/render_thread_impl.cc b/content/renderer/render_thread_impl.cc
index c24ed13..5aab6d02 100644
--- a/content/renderer/render_thread_impl.cc
+++ b/content/renderer/render_thread_impl.cc
@@ -1040,10 +1040,9 @@
     const scoped_refptr<base::SingleThreadTaskRunner>& resource_task_queue) {
   // Add a filter that forces resource messages to be dispatched via a
   // particular task runner.
-  scoped_refptr<ResourceSchedulingFilter> filter(
-      new ResourceSchedulingFilter(resource_task_queue, resource_dispatcher()));
-  channel()->AddFilter(filter.get());
-  resource_dispatcher()->SetResourceSchedulingFilter(filter);
+  resource_scheduling_filter_ =
+      new ResourceSchedulingFilter(resource_task_queue, resource_dispatcher());
+  channel()->AddFilter(resource_scheduling_filter_.get());
 
   // The ChildResourceMessageFilter and the ResourceDispatcher need to use the
   // same queue to ensure tasks are executed in the expected order.
diff --git a/content/renderer/render_thread_impl.h b/content/renderer/render_thread_impl.h
index 9eed365..190d5578 100644
--- a/content/renderer/render_thread_impl.h
+++ b/content/renderer/render_thread_impl.h
@@ -109,6 +109,7 @@
 class RendererBlinkPlatformImpl;
 class RendererDemuxerAndroid;
 class ResourceDispatchThrottler;
+class ResourceSchedulingFilter;
 class V8SamplingProfiler;
 class VideoCaptureImplManager;
 class WebGraphicsContext3DCommandBufferImpl;
@@ -615,6 +616,8 @@
   scoped_refptr<base::SingleThreadTaskRunner>
       main_thread_compositor_task_runner_;
 
+  scoped_refptr<ResourceSchedulingFilter> resource_scheduling_filter_;
+
   // Compositor settings.
   bool is_gpu_rasterization_enabled_;
   bool is_gpu_rasterization_forced_;
diff --git a/content/renderer/render_widget.cc b/content/renderer/render_widget.cc
index 081f083..353d9ea 100644
--- a/content/renderer/render_widget.cc
+++ b/content/renderer/render_widget.cc
@@ -7,6 +7,7 @@
 #include "base/auto_reset.h"
 #include "base/bind.h"
 #include "base/command_line.h"
+#include "base/debug/dump_without_crashing.h"
 #include "base/logging.h"
 #include "base/memory/scoped_ptr.h"
 #include "base/memory/singleton.h"
@@ -969,14 +970,6 @@
   // never get a request for a cc::OutputSurface.
   DCHECK(!compositor_never_visible_);
 
-#if defined(OS_ANDROID)
-  if (SynchronousCompositorFactory* factory =
-      SynchronousCompositorFactory::GetInstance()) {
-    return factory->CreateOutputSurface(routing_id(),
-                                        frame_swap_message_queue_);
-  }
-#endif
-
   const base::CommandLine& command_line =
       *base::CommandLine::ForCurrentProcess();
   bool use_software = fallback;
@@ -998,6 +991,15 @@
       // Cause the compositor to wait and try again.
       return nullptr;
     }
+
+#if defined(OS_ANDROID)
+    if (SynchronousCompositorFactory* factory =
+            SynchronousCompositorFactory::GetInstance()) {
+      return factory->CreateOutputSurface(
+          routing_id(), frame_swap_message_queue_, context_provider,
+          worker_context_provider);
+    }
+#endif
   }
 
   uint32 output_surface_id = next_output_surface_id_++;
@@ -1292,6 +1294,20 @@
 
 void RenderWidget::OnSetFocus(bool enable) {
   has_focus_ = enable;
+
+  // TODO(nasko): This code is here to help diagnose https://crbug.com/541578.
+  if (webwidget_->isWebView()) {
+    blink::WebView* view = static_cast<blink::WebView*>(webwidget_);
+    if (view->mainFrame()->isWebRemoteFrame()) {
+      blink::WebFrame* mainFrame = view->mainFrame();
+
+      base::debug::Alias(&mainFrame);
+      base::debug::Alias(&is_swapped_out_);
+
+      base::debug::DumpWithoutCrashing();
+    }
+  }
+
   if (webwidget_)
     webwidget_->setFocus(enable);
 }
@@ -2325,12 +2341,17 @@
   bool lose_context_when_out_of_memory = true;
   WebGraphicsContext3DCommandBufferImpl::SharedMemoryLimits limits;
 #if defined(OS_ANDROID)
+  bool using_synchronous_compositing =
+      SynchronousCompositorFactory::GetInstance();
   // If we raster too fast we become upload bound, and pending
   // uploads consume memory. For maximum upload throughput, we would
   // want to allow for upload_throughput * pipeline_time of pending
   // uploads, after which we are just wasting memory. Since we don't
   // know our upload throughput yet, this just caps our memory usage.
-  size_t divider = 1;
+  // Synchronous compositor uses half because synchronous compositor
+  // pipeline is only one frame deep. But twice of half for low end
+  // because 16bit texture is not supported.
+  size_t divider = using_synchronous_compositing ? 2 : 1;
   if (base::SysInfo::IsLowEndDevice())
     divider = 6;
   // For reference Nexus10 can upload 1MB in about 2.5ms.
diff --git a/content/renderer/renderer_blink_platform_impl.cc b/content/renderer/renderer_blink_platform_impl.cc
index 9da0779..c2ca182 100644
--- a/content/renderer/renderer_blink_platform_impl.cc
+++ b/content/renderer/renderer_blink_platform_impl.cc
@@ -19,7 +19,6 @@
 #include "build/build_config.h"
 #include "cc/blink/context_provider_web_context.h"
 #include "components/scheduler/child/web_scheduler_impl.h"
-#include "components/scheduler/child/web_task_runner_impl.h"
 #include "components/scheduler/renderer/renderer_scheduler.h"
 #include "components/scheduler/renderer/webthread_impl_for_renderer_scheduler.h"
 #include "components/url_formatter/url_formatter.h"
@@ -33,7 +32,6 @@
 #include "content/child/simple_webmimeregistry_impl.h"
 #include "content/child/thread_safe_sender.h"
 #include "content/child/web_database_observer_impl.h"
-#include "content/child/web_url_loader_impl.h"
 #include "content/child/webblobregistry_impl.h"
 #include "content/child/webfileutilities_impl.h"
 #include "content/child/webmessageportchannel_impl.h"
@@ -239,7 +237,6 @@
       sudden_termination_disables_(0),
       plugin_refresh_allowed_(true),
       default_task_runner_(renderer_scheduler->DefaultTaskRunner()),
-      loading_task_runner_(renderer_scheduler->LoadingTaskRunner()),
       web_scrollbar_behavior_(new WebScrollbarBehaviorImpl) {
 #if !defined(OS_ANDROID) && !defined(OS_WIN)
   if (g_sandbox_enabled && sandboxEnabled()) {
@@ -276,19 +273,6 @@
 
 //------------------------------------------------------------------------------
 
-blink::WebURLLoader* RendererBlinkPlatformImpl::createURLLoader() {
-  ChildThreadImpl* child_thread = ChildThreadImpl::current();
-  // There may be no child thread in RenderViewTests.  These tests can still use
-  // data URLs to bypass the ResourceDispatcher.
-  scoped_ptr<scheduler::WebTaskRunnerImpl> task_runner(
-      new scheduler::WebTaskRunnerImpl(
-        loading_task_runner_->BelongsToCurrentThread()
-            ? loading_task_runner_ : base::ThreadTaskRunnerHandle::Get()));
-  return new content::WebURLLoaderImpl(
-      child_thread ? child_thread->resource_dispatcher() : NULL,
-      task_runner.Pass());
-}
-
 blink::WebThread* RendererBlinkPlatformImpl::currentThread() {
   if (main_thread_->isCurrentThread())
     return main_thread_.get();
diff --git a/content/renderer/renderer_blink_platform_impl.h b/content/renderer/renderer_blink_platform_impl.h
index 32edd5f..6a64c59 100644
--- a/content/renderer/renderer_blink_platform_impl.h
+++ b/content/renderer/renderer_blink_platform_impl.h
@@ -205,8 +205,6 @@
     return web_database_observer_impl_.get();
   }
 
-  blink::WebURLLoader* createURLLoader() override;
-
  private:
   bool CheckPreparsedJsCachingEnabled() const;
 
@@ -256,7 +254,6 @@
   scoped_ptr<DeviceOrientationEventPump> device_orientation_event_pump_;
 
   scoped_refptr<base::SingleThreadTaskRunner> default_task_runner_;
-  scoped_refptr<base::SingleThreadTaskRunner> loading_task_runner_;
   scoped_refptr<IPC::SyncMessageFilter> sync_message_filter_;
   scoped_refptr<ThreadSafeSender> thread_safe_sender_;
   scoped_refptr<QuotaMessageFilter> quota_message_filter_;
diff --git a/content/renderer/service_worker/service_worker_type_util.cc b/content/renderer/service_worker/service_worker_type_util.cc
index 720ea2d..9e5878f 100644
--- a/content/renderer/service_worker/service_worker_type_util.cc
+++ b/content/renderer/service_worker/service_worker_type_util.cc
@@ -25,10 +25,9 @@
 
   void visitHeader(const blink::WebString& name,
                    const blink::WebString& value) override {
-    const std::string header_name =
-        base::UTF16ToASCII(base::StringPiece16(name));
-    const std::string header_value =
-        base::UTF16ToASCII(base::StringPiece16(value));
+    // Headers are ISO Latin 1.
+    const std::string& header_name = name.latin1();
+    const std::string& header_value = value.latin1();
     CHECK(header_name.find('\0') == std::string::npos);
     CHECK(header_value.find('\0') == std::string::npos);
     headers_->insert(ServiceWorkerHeaderMap::value_type(
diff --git a/content/renderer/usb/web_usb_client_impl.cc b/content/renderer/usb/web_usb_client_impl.cc
index 43e7b62..fc87597e 100644
--- a/content/renderer/usb/web_usb_client_impl.cc
+++ b/content/renderer/usb/web_usb_client_impl.cc
@@ -66,16 +66,15 @@
 
 }  // namespace
 
-WebUSBClientImpl::WebUSBClientImpl(content::ServiceRegistry* service_registry) {
-  service_registry->ConnectToRemoteService(mojo::GetProxy(&device_manager_));
-}
+WebUSBClientImpl::WebUSBClientImpl(content::ServiceRegistry* service_registry)
+    : service_registry_(service_registry) {}
 
 WebUSBClientImpl::~WebUSBClientImpl() {}
 
 void WebUSBClientImpl::getDevices(
     blink::WebUSBClientGetDevicesCallbacks* callbacks) {
   auto scoped_callbacks = MakeScopedUSBCallbacks(callbacks);
-  device_manager_->GetDevices(
+  GetDeviceManager()->GetDevices(
       nullptr,
       base::Bind(&OnGetDevicesComplete, base::Passed(&scoped_callbacks),
                  base::Unretained(device_manager_.get())));
@@ -92,15 +91,22 @@
 void WebUSBClientImpl::setObserver(Observer* observer) {
   if (!observer_) {
     // Set up two sequential calls to GetDeviceChanges to avoid latency.
-    device_manager_->GetDeviceChanges(base::Bind(
+    device::usb::DeviceManager* device_manager = GetDeviceManager();
+    device_manager->GetDeviceChanges(base::Bind(
         &WebUSBClientImpl::OnDeviceChangeNotification, base::Unretained(this)));
-    device_manager_->GetDeviceChanges(base::Bind(
+    device_manager->GetDeviceChanges(base::Bind(
         &WebUSBClientImpl::OnDeviceChangeNotification, base::Unretained(this)));
   }
 
   observer_ = observer;
 }
 
+device::usb::DeviceManager* WebUSBClientImpl::GetDeviceManager() {
+  if (!device_manager_)
+    service_registry_->ConnectToRemoteService(mojo::GetProxy(&device_manager_));
+  return device_manager_.get();
+}
+
 void WebUSBClientImpl::OnDeviceChangeNotification(
     device::usb::DeviceChangeNotificationPtr notification) {
   if (!observer_)
diff --git a/content/renderer/usb/web_usb_client_impl.h b/content/renderer/usb/web_usb_client_impl.h
index 612f842..b7bc2b7 100644
--- a/content/renderer/usb/web_usb_client_impl.h
+++ b/content/renderer/usb/web_usb_client_impl.h
@@ -15,7 +15,7 @@
 
 class WebUSBClientImpl : public blink::WebUSBClient {
  public:
-  explicit WebUSBClientImpl(content::ServiceRegistry* service_registry);
+  explicit WebUSBClientImpl(ServiceRegistry* service_registry);
   ~WebUSBClientImpl() override;
 
  private:
@@ -26,9 +26,11 @@
       blink::WebUSBClientRequestDeviceCallbacks* callbacks) override;
   void setObserver(Observer* observer) override;
 
+  device::usb::DeviceManager* GetDeviceManager();
   void OnDeviceChangeNotification(
       device::usb::DeviceChangeNotificationPtr notification);
 
+  ServiceRegistry* const service_registry_;
   device::usb::DeviceManagerPtr device_manager_;
   Observer* observer_ = nullptr;
 
diff --git a/content/shell/BUILD.gn b/content/shell/BUILD.gn
index a49204f..16c5d7f 100644
--- a/content/shell/BUILD.gn
+++ b/content/shell/BUILD.gn
@@ -178,6 +178,11 @@
     "//build/config/compiler:no_size_t_to_int_warning",
   ]
 
+  if (is_clang) {
+    # TODO(thakis): Remove this once http://crbug.com/383820 is figured out
+    cflags = [ "-Wno-nonnull" ]
+  }
+
   defines = [ "CONTENT_SHELL_VERSION=\"$content_shell_version\"" ]
 
   public_deps = [
diff --git a/content/shell/browser/shell_url_request_context_getter.cc b/content/shell/browser/shell_url_request_context_getter.cc
index 837eb82..354f9c6 100644
--- a/content/shell/browser/shell_url_request_context_getter.cc
+++ b/content/shell/browser/shell_url_request_context_getter.cc
@@ -201,8 +201,11 @@
     network_session_params.host_resolver =
         url_request_context_->host_resolver();
 
+    storage_->set_http_network_session(
+        make_scoped_ptr(new net::HttpNetworkSession(network_session_params)));
     storage_->set_http_transaction_factory(make_scoped_ptr(
-        new net::HttpCache(network_session_params, main_backend)));
+        new net::HttpCache(storage_->http_network_session(), main_backend,
+                           true /* set_up_quic_server_info */)));
 
     scoped_ptr<net::URLRequestJobFactoryImpl> job_factory(
         new net::URLRequestJobFactoryImpl());
diff --git a/content/test/data/accessibility/html/element-class-id-src-attr-expected-android.txt b/content/test/data/accessibility/html/element-class-id-src-attr-expected-android.txt
new file mode 100644
index 0000000..83437c7
--- /dev/null
+++ b/content/test/data/accessibility/html/element-class-id-src-attr-expected-android.txt
@@ -0,0 +1,4 @@
+android.webkit.WebView focusable focused scrollable
+++android.view.View clickable heading name='Image'
+++android.view.View
+++++android.widget.Image clickable name='ImageAlt'
\ No newline at end of file
diff --git a/content/test/data/accessibility/html/element-class-id-src-attr-expected-mac.txt b/content/test/data/accessibility/html/element-class-id-src-attr-expected-mac.txt
new file mode 100644
index 0000000..db4e81c
--- /dev/null
+++ b/content/test/data/accessibility/html/element-class-id-src-attr-expected-mac.txt
@@ -0,0 +1,5 @@
+AXWebArea
+++AXHeading AXTitle='Image' AXValue='1'
+++++AXStaticText AXValue='Image'
+++AXGroup
+++++AXImage
\ No newline at end of file
diff --git a/content/test/data/accessibility/html/element-class-id-src-attr-expected-win.txt b/content/test/data/accessibility/html/element-class-id-src-attr-expected-win.txt
new file mode 100644
index 0000000..4000678
--- /dev/null
+++ b/content/test/data/accessibility/html/element-class-id-src-attr-expected-win.txt
@@ -0,0 +1,5 @@
+ROLE_SYSTEM_DOCUMENT READONLY FOCUSABLE
+++IA2_ROLE_HEADING name='Image' class:headerClass id:headerID
+++++ROLE_SYSTEM_STATICTEXT name='Image'
+++IA2_ROLE_SECTION
+++++ROLE_SYSTEM_GRAPHIC name='ImageAlt' READONLY class:imageClass id:imageID src:greenbox.png
\ No newline at end of file
diff --git a/content/test/data/accessibility/html/element-class-id-src-attr.html b/content/test/data/accessibility/html/element-class-id-src-attr.html
new file mode 100644
index 0000000..4478b31
--- /dev/null
+++ b/content/test/data/accessibility/html/element-class-id-src-attr.html
@@ -0,0 +1,12 @@
+<!--
+@WIN-ALLOW:class:*
+@WIN-ALLOW:id:*
+@WIN-ALLOW:src:*
+-->
+<!DOCTYPE html>
+<html>
+  <body>
+    <h1 id="headerID" class="headerClass">Image</h1>
+    <img id="imageID" class="imageClass" src="greenbox.png" alt="ImageAlt" height="100" width="200">
+  </body>
+</html>
\ No newline at end of file
diff --git a/content/test/gpu/gpu_project_config.py b/content/test/gpu/gpu_project_config.py
new file mode 100644
index 0000000..0347091
--- /dev/null
+++ b/content/test/gpu/gpu_project_config.py
@@ -0,0 +1,18 @@
+# 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 os
+import re
+import subprocess
+import sys
+
+from gpu_tests import path_util
+
+path_util.AddDirToPathIfNeeded(path_util.GetChromiumSrcDir(), 'tools', 'perf')
+
+from chrome_telemetry_build import chromium_config
+
+CONFIG = chromium_config.ChromiumConfig(
+    top_level_dir=path_util.GetGpuTestDir(),
+    benchmark_dirs=[os.path.join(path_util.GetGpuTestDir(), 'gpu_tests')])
diff --git a/content/test/gpu/gpu_tests/path_util.py b/content/test/gpu/gpu_tests/path_util.py
index 34790ce..1a43269 100644
--- a/content/test/gpu/gpu_tests/path_util.py
+++ b/content/test/gpu/gpu_tests/path_util.py
@@ -3,8 +3,19 @@
 # found in the LICENSE file.
 
 import os
+import sys
 
 
 def GetChromiumSrcDir():
   return os.path.abspath(os.path.join(
       os.path.dirname(__file__), os.pardir, os.pardir, os.pardir, os.pardir))
+
+
+def GetGpuTestDir():
+  return os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir))
+
+
+def AddDirToPathIfNeeded(*path_parts):
+  path = os.path.abspath(os.path.join(*path_parts))
+  if os.path.isdir(path) and path not in sys.path:
+    sys.path.append(path)
diff --git a/content/test/gpu/gpu_tests/test_expectations.py b/content/test/gpu/gpu_tests/test_expectations.py
index 501ee005..9879e9f7 100644
--- a/content/test/gpu/gpu_tests/test_expectations.py
+++ b/content/test/gpu/gpu_tests/test_expectations.py
@@ -165,6 +165,11 @@
     # assume that.
     if (url_path and url_path[0] == '/'):
       url_path = url_path[1:]
+    # Python's urlsplit doesn't seem to handle query arguments for
+    # file:// URLs properly. Split them off manually.
+    query_index = url_path.find('?')
+    if query_index > 0:
+      url_path = url_path[0:query_index]
     return url_path
 
   def _GetExpectationObjectForPage(self, browser, page):
diff --git a/content/test/gpu/gpu_tests/test_expectations_unittest.py b/content/test/gpu/gpu_tests/test_expectations_unittest.py
index 8e0719e..6faf0dc 100644
--- a/content/test/gpu/gpu_tests/test_expectations_unittest.py
+++ b/content/test/gpu/gpu_tests/test_expectations_unittest.py
@@ -222,3 +222,9 @@
     self.assertExpectationEquals('fail', page)
     page = page_module.Page('http://test.com/conformance/glsl/page15.html', ps)
     self.assertExpectationEquals('skip', page)
+
+  def testQueryArgsAreStrippedFromFileURLs(self):
+    ps = story_set.StorySet()
+    page = page_module.Page(
+      'file://conformance/glsl/page15.html?webglVersion=2', ps)
+    self.assertExpectationEquals('skip', page)
diff --git a/content/test/gpu/gpu_tests/webgl2_conformance_expectations.py b/content/test/gpu/gpu_tests/webgl2_conformance_expectations.py
index 371afa2..ae0ab0f 100644
--- a/content/test/gpu/gpu_tests/webgl2_conformance_expectations.py
+++ b/content/test/gpu/gpu_tests/webgl2_conformance_expectations.py
@@ -147,6 +147,12 @@
     self.Fail('conformance2/textures/video/tex-image-and-sub-image-2d' +
         '-with-video-rgb5_a1-rgba-unsigned_byte.html',
         ['win8'], bug=483282)
+    # Windows Debug. Causing assertions in the GPU process which raise
+    # a dialog box, so have to skip them rather than mark them as
+    # failing.
+    self.Skip('conformance2/textures/canvas/tex-image-and-sub-image-2d' +
+        '-with-canvas-rgba8-rgba-unsigned_byte.html',
+        ['win', 'debug'], bug=542901)
 
     # Mac only.
     self.Skip('deqp/data/gles3/shaders/qualification_order.html',
diff --git a/content/test/gpu/gpu_tests/webgl_conformance_expectations.py b/content/test/gpu/gpu_tests/webgl_conformance_expectations.py
index b965bc0..4d99f3e 100644
--- a/content/test/gpu/gpu_tests/webgl_conformance_expectations.py
+++ b/content/test/gpu/gpu_tests/webgl_conformance_expectations.py
@@ -38,12 +38,6 @@
         bug=478572)
     self.Fail('conformance/extensions/ext-sRGB.html',
         bug=540900)
-    self.Fail('conformance/extensions/oes-standard-derivatives.html',
-        bug=5400916)
-    self.Fail('conformance/extensions/ext-frag-depth.html',
-        bug=5400916)
-    self.Fail('conformance/misc/expando-loss.html',
-        bug=485634)
 
     # Win failures
     self.Fail('conformance/glsl/bugs/' +
diff --git a/content/test/gpu/run_gpu_test.py b/content/test/gpu/run_gpu_test.py
index 00091d6..9927f98 100755
--- a/content/test/gpu/run_gpu_test.py
+++ b/content/test/gpu/run_gpu_test.py
@@ -8,11 +8,14 @@
 import subprocess
 import sys
 
-sys.path.append(os.path.join(os.path.dirname(__file__),
-    os.pardir, os.pardir, os.pardir, 'tools', 'telemetry'))
+from gpu_tests import path_util
+path_util.AddDirToPathIfNeeded(path_util.GetChromiumSrcDir(), 'tools',
+                               'telemetry')
 
 from telemetry import benchmark_runner
 
+import gpu_project_config
+
 
 def _LaunchDBus():
   """Launches DBus to work around a bug in GLib.
@@ -84,17 +87,9 @@
 
 
 if __name__ == '__main__':
-  top_level_dir = os.path.dirname(os.path.realpath(__file__))
-  config = benchmark_runner.ProjectConfig(
-      top_level_dir=top_level_dir,
-      benchmark_dirs=[os.path.join(top_level_dir, 'gpu_tests')],
-      client_config=os.path.abspath(os.path.join(
-          top_level_dir, os.pardir, os.pardir, os.pardir, 'tools', 'perf',
-          'core', 'binary_dependencies.json')))
-
   did_launch_dbus = _LaunchDBus()
   try:
-    retcode = benchmark_runner.main(config)
+    retcode = benchmark_runner.main(gpu_project_config.CONFIG)
   finally:
     if did_launch_dbus:
       _ShutdownDBus()
diff --git a/content/test/gpu/run_unittests.py b/content/test/gpu/run_unittests.py
index 6deff622..201350f4 100755
--- a/content/test/gpu/run_unittests.py
+++ b/content/test/gpu/run_unittests.py
@@ -13,22 +13,15 @@
 import sys
 
 from gpu_tests import path_util
+import gpu_project_config
 
-if __name__ == '__main__':
-  gpu_test_dir = os.path.dirname(os.path.realpath(__file__))
-  telemetry_dir = os.path.join(path_util.GetChromiumSrcDir(), 'tools',
+path_util.AddDirToPathIfNeeded(path_util.GetChromiumSrcDir(), 'tools',
                                'telemetry')
 
-  env = os.environ.copy()
-  if 'PYTHONPATH' in env:
-    env['PYTHONPATH'] = env['PYTHONPATH'] + os.pathsep + telemetry_dir
-  else:
-    env['PYTHONPATH'] = telemetry_dir
+from telemetry.testing import unittest_runner
 
-  path_to_run_tests = os.path.realpath(os.path.join(
-      telemetry_dir, 'telemetry', 'testing', 'run_tests.py'))
-  client_config = os.path.join(path_util.GetChromiumSrcDir(), 'tools', 'perf',
-                               'core', 'binary_dependencies.json')
-  argv = ['--no-browser', '--top-level-dir', gpu_test_dir,
-          '--client-config', client_config] + sys.argv[1:]
-  sys.exit(subprocess.call([sys.executable, path_to_run_tests] + argv, env=env))
+def main():
+  return unittest_runner.Run(gpu_project_config.CONFIG, no_browser=True)
+
+if __name__ == '__main__':
+  sys.exit(main())
diff --git a/content/test/mock_weburlloader.h b/content/test/mock_weburlloader.h
index 4b96ed3d..db26111a 100644
--- a/content/test/mock_weburlloader.h
+++ b/content/test/mock_weburlloader.h
@@ -23,8 +23,6 @@
                                         blink::WebURLLoaderClient* client));
   MOCK_METHOD0(cancel, void());
   MOCK_METHOD1(setDefersLoading, void(bool value));
-  MOCK_METHOD1(setLoadingTaskRunner,
-               void(blink::WebTaskRunner* loading_task_runner));
 
  private:
   DISALLOW_COPY_AND_ASSIGN(MockWebURLLoader);
diff --git a/content/test/weburl_loader_mock.cc b/content/test/weburl_loader_mock.cc
index 9e534722..b7f29e4 100644
--- a/content/test/weburl_loader_mock.cc
+++ b/content/test/weburl_loader_mock.cc
@@ -147,7 +147,3 @@
   }
   NOTIMPLEMENTED();
 }
-
-void WebURLLoaderMock::setLoadingTaskRunner(blink::WebTaskRunner*) {
-  NOTIMPLEMENTED();
-}
diff --git a/content/test/weburl_loader_mock.h b/content/test/weburl_loader_mock.h
index a098a8e..025eaef5 100644
--- a/content/test/weburl_loader_mock.h
+++ b/content/test/weburl_loader_mock.h
@@ -55,8 +55,6 @@
 
   bool isDeferred() { return is_deferred_; }
 
-  void setLoadingTaskRunner(blink::WebTaskRunner*) override;
-
  private:
   WebURLLoaderMockFactory* factory_;
   blink::WebURLLoaderClient* client_;
diff --git a/content/utility/utility_process_control_impl.cc b/content/utility/utility_process_control_impl.cc
index 7878cbd..1a886e1 100644
--- a/content/utility/utility_process_control_impl.cc
+++ b/content/utility/utility_process_control_impl.cc
@@ -43,10 +43,9 @@
   }
 
 #if defined(ENABLE_MOJO_MEDIA_IN_UTILITY_PROCESS)
-  map_ref[media::MojoMediaApplication::AppUrl()] =
-      new mojo::shell::StaticApplicationLoader(
-          base::Bind(&media::MojoMediaApplication::CreateApp),
-          base::Bind(&QuitProcess));
+  map_ref[GURL("mojo:media")] = new mojo::shell::StaticApplicationLoader(
+      base::Bind(&media::MojoMediaApplication::CreateApp),
+      base::Bind(&QuitProcess));
 #endif
 }
 
diff --git a/device/bluetooth/test/bluetooth_test_mac.mm b/device/bluetooth/test/bluetooth_test_mac.mm
index 9c80acf..744747b 100644
--- a/device/bluetooth/test/bluetooth_test_mac.mm
+++ b/device/bluetooth/test/bluetooth_test_mac.mm
@@ -124,7 +124,7 @@
       [central_manager_delegate centralManager:central_manager
                          didDiscoverPeripheral:peripheral
                              advertisementData:advertisement_data
-                                          RSSI:0];
+                                          RSSI:[NSNumber numberWithInt:0]];
       break;
     }
     case 2: {
@@ -144,7 +144,7 @@
       [central_manager_delegate centralManager:central_manager
                          didDiscoverPeripheral:peripheral
                              advertisementData:advertisement_data
-                                          RSSI:0];
+                                          RSSI:[NSNumber numberWithInt:0]];
       break;
     }
     case 3: {
@@ -157,7 +157,7 @@
       [central_manager_delegate centralManager:central_manager
                          didDiscoverPeripheral:peripheral
                              advertisementData:advertisement_data
-                                          RSSI:0];
+                                          RSSI:[NSNumber numberWithInt:0]];
       break;
     }
     case 4: {
@@ -170,7 +170,7 @@
       [central_manager_delegate centralManager:central_manager
                          didDiscoverPeripheral:peripheral
                              advertisementData:advertisement_data
-                                          RSSI:0];
+                                          RSSI:[NSNumber numberWithInt:0]];
       break;
     }
   }
diff --git a/extensions/browser/api/app_runtime/app_runtime_api.cc b/extensions/browser/api/app_runtime/app_runtime_api.cc
index 60c2c0d4..e2b1b630 100644
--- a/extensions/browser/api/app_runtime/app_runtime_api.cc
+++ b/extensions/browser/api/app_runtime/app_runtime_api.cc
@@ -98,7 +98,7 @@
       return app_runtime::LAUNCH_SOURCE_EXTENSIONS_PAGE;
     case extensions::SOURCE_MANAGEMENT_API:
       return app_runtime::LAUNCH_SOURCE_MANAGEMENT_API;
-    case extensions::SOURCE_EPHEMERAL_APP:
+    case extensions::SOURCE_EPHEMERAL_APP_UNUSED:
       return app_runtime::LAUNCH_SOURCE_EPHEMERAL_APP;
     case extensions::SOURCE_BACKGROUND:
       return app_runtime::LAUNCH_SOURCE_BACKGROUND;
diff --git a/extensions/common/constants.h b/extensions/common/constants.h
index 702095b9..7af8701 100644
--- a/extensions/common/constants.h
+++ b/extensions/common/constants.h
@@ -126,7 +126,7 @@
   SOURCE_KEYBOARD,
   SOURCE_EXTENSIONS_PAGE,
   SOURCE_MANAGEMENT_API,
-  SOURCE_EPHEMERAL_APP,
+  SOURCE_EPHEMERAL_APP_UNUSED,
   SOURCE_BACKGROUND,
   SOURCE_KIOSK,
   SOURCE_CHROME_INTERNAL,
diff --git a/google_apis/gcm/engine/connection_factory_impl.cc b/google_apis/gcm/engine/connection_factory_impl.cc
index 4c4f279..19f456c 100644
--- a/google_apis/gcm/engine/connection_factory_impl.cc
+++ b/google_apis/gcm/engine/connection_factory_impl.cc
@@ -16,6 +16,7 @@
 #include "net/base/net_errors.h"
 #include "net/http/http_network_session.h"
 #include "net/http/http_request_headers.h"
+#include "net/log/net_log.h"
 #include "net/proxy/proxy_info.h"
 #include "net/socket/client_socket_handle.h"
 #include "net/socket/client_socket_pool_manager.h"
@@ -47,8 +48,8 @@
 ConnectionFactoryImpl::ConnectionFactoryImpl(
     const std::vector<GURL>& mcs_endpoints,
     const net::BackoffEntry::Policy& backoff_policy,
-    const scoped_refptr<net::HttpNetworkSession>& gcm_network_session,
-    const scoped_refptr<net::HttpNetworkSession>& http_network_session,
+    net::HttpNetworkSession* gcm_network_session,
+    net::HttpNetworkSession* http_network_session,
     net::NetLog* net_log,
     GCMStatsRecorder* recorder)
   : mcs_endpoints_(mcs_endpoints),
@@ -68,8 +69,8 @@
     listener_(NULL),
     weak_ptr_factory_(this) {
   DCHECK_GE(mcs_endpoints_.size(), 1U);
-  DCHECK(!http_network_session_.get() ||
-         (gcm_network_session_.get() != http_network_session_.get()));
+  DCHECK(!http_network_session_ ||
+         (gcm_network_session_ != http_network_session_));
 }
 
 ConnectionFactoryImpl::~ConnectionFactoryImpl() {
@@ -457,7 +458,7 @@
   gcm_network_session_->ssl_config_service()->GetSSLConfig(&ssl_config);
   status = net::InitSocketHandleForTlsConnect(
       net::HostPortPair::FromURL(GetCurrentEndpoint()),
-      gcm_network_session_.get(),
+      gcm_network_session_,
       proxy_info_,
       ssl_config,
       ssl_config,
@@ -558,7 +559,7 @@
 }
 
 void ConnectionFactoryImpl::ReportSuccessfulProxyConnection() {
-  if (gcm_network_session_.get() && gcm_network_session_->proxy_service())
+  if (gcm_network_session_ && gcm_network_session_->proxy_service())
     gcm_network_session_->proxy_service()->ReportSuccess(proxy_info_, NULL);
 }
 
@@ -574,7 +575,7 @@
 }
 
 void ConnectionFactoryImpl::RebuildNetworkSessionAuthCache() {
-  if (!http_network_session_.get() || !http_network_session_->http_auth_cache())
+  if (!http_network_session_ || !http_network_session_->http_auth_cache())
     return;
 
   gcm_network_session_->http_auth_cache()->UpdateAllFrom(
diff --git a/google_apis/gcm/engine/connection_factory_impl.h b/google_apis/gcm/engine/connection_factory_impl.h
index d979208..a07de12 100644
--- a/google_apis/gcm/engine/connection_factory_impl.h
+++ b/google_apis/gcm/engine/connection_factory_impl.h
@@ -36,11 +36,14 @@
   // for proxy auth credentials (via its HttpAuthCache). |gcm_network_session|
   // is the network session through which GCM connections should be made, and
   // must not be the same as |http_network_session|.
+  //
+  // The caller is responsible for making sure the ConnectionFactoryImpl is
+  // destroyed before the |gcm_network_session| and |http_network_session|.
   ConnectionFactoryImpl(
       const std::vector<GURL>& mcs_endpoints,
       const net::BackoffEntry::Policy& backoff_policy,
-      const scoped_refptr<net::HttpNetworkSession>& gcm_network_session,
-      const scoped_refptr<net::HttpNetworkSession>& http_network_session,
+      net::HttpNetworkSession* gcm_network_session,
+      net::HttpNetworkSession* http_network_session,
       net::NetLog* net_log,
       GCMStatsRecorder* recorder);
   ~ConnectionFactoryImpl() override;
@@ -135,10 +138,10 @@
 
   // ---- net:: components for establishing connections. ----
   // Network session for creating new GCM connections.
-  const scoped_refptr<net::HttpNetworkSession> gcm_network_session_;
+  net::HttpNetworkSession* gcm_network_session_;
   // HTTP Network session. If set, is used for extracting proxy auth
-  // credentials. If not set, is ignored.
-  const scoped_refptr<net::HttpNetworkSession> http_network_session_;
+  // credentials. If nullptr, is ignored.
+  net::HttpNetworkSession* http_network_session_;
   // Net log to use in connection attempts.
   net::BoundNetLog bound_net_log_;
   // The current PAC request, if one exists. Owned by the proxy service.
diff --git a/google_apis/gcm/tools/mcs_probe.cc b/google_apis/gcm/tools/mcs_probe.cc
index 1063db9..b2acc197 100644
--- a/google_apis/gcm/tools/mcs_probe.cc
+++ b/google_apis/gcm/tools/mcs_probe.cc
@@ -229,7 +229,7 @@
   scoped_ptr<net::HttpAuthHandlerFactory> http_auth_handler_factory_;
   scoped_ptr<net::HttpServerPropertiesImpl> http_server_properties_;
   scoped_ptr<net::HostMappingRules> host_mapping_rules_;
-  scoped_refptr<net::HttpNetworkSession> network_session_;
+  scoped_ptr<net::HttpNetworkSession> network_session_;
   scoped_ptr<net::ProxyService> proxy_service_;
 
   FakeGCMStatsRecorder recorder_;
@@ -293,7 +293,7 @@
   connection_factory_.reset(
       new ConnectionFactoryImpl(endpoints,
                                 kDefaultBackoffPolicy,
-                                network_session_,
+                                network_session_.get(),
                                 NULL,
                                 &net_log_,
                                 &recorder_));
@@ -403,7 +403,7 @@
   session_params.net_log = &net_log_;
   session_params.proxy_service = proxy_service_.get();
 
-  network_session_ = new net::HttpNetworkSession(session_params);
+  network_session_.reset(new net::HttpNetworkSession(session_params));
 }
 
 void MCSProbe::ErrorCallback() {
diff --git a/gpu/command_buffer/service/feature_info.cc b/gpu/command_buffer/service/feature_info.cc
index b781b96..b2ccbd4ff8 100644
--- a/gpu/command_buffer/service/feature_info.cc
+++ b/gpu/command_buffer/service/feature_info.cc
@@ -116,6 +116,8 @@
   if (workarounds->max_vertex_uniform_vectors_256)
     workarounds->max_vertex_uniform_vectors = 256;
 
+  if (workarounds->max_copy_texture_chromium_size_1048576)
+    workarounds->max_copy_texture_chromium_size = 1048576;
   if (workarounds->max_copy_texture_chromium_size_262144)
     workarounds->max_copy_texture_chromium_size = 262144;
 }
diff --git a/gpu/command_buffer/service/in_process_command_buffer.cc b/gpu/command_buffer/service/in_process_command_buffer.cc
index a798710d..17f087ee 100644
--- a/gpu/command_buffer/service/in_process_command_buffer.cc
+++ b/gpu/command_buffer/service/in_process_command_buffer.cc
@@ -713,7 +713,7 @@
     case gfx::SHARED_MEMORY_BUFFER: {
       scoped_refptr<gfx::GLImageSharedMemory> image(
           new gfx::GLImageSharedMemory(size, internalformat));
-      if (!image->Initialize(handle, format)) {
+      if (!image->Initialize(handle.handle, handle.id, format)) {
         LOG(ERROR) << "Failed to initialize image.";
         return;
       }
diff --git a/gpu/config/gpu_driver_bug_list_json.cc b/gpu/config/gpu_driver_bug_list_json.cc
index fbf7bd91..81ac1d8aa 100644
--- a/gpu/config/gpu_driver_bug_list_json.cc
+++ b/gpu/config/gpu_driver_bug_list_json.cc
@@ -19,7 +19,7 @@
 {
   "name": "gpu driver bug list",
   // Please update the version number whenever you change this file.
-  "version": "8.28",
+  "version": "8.29",
   "entries": [
     {
       "id": 1,
@@ -1554,6 +1554,18 @@
       "features": [
         "disable_msaa_on_non_webgl_contexts"
       ]
+    },
+    {
+      "id": 133,
+      "description": "CHROMIUM_copy_texture with 1MB copy per flush to avoid unwanted cache growth on Adreno",
+      "cr_bugs": [542478],
+      "os": {
+        "type": "android"
+      },
+      "gl_renderer": "Adreno.*",
+      "features": [
+        "max_copy_texture_chromium_size_1048576"
+      ]
     }
   ]
 }
diff --git a/gpu/config/gpu_driver_bug_workaround_type.h b/gpu/config/gpu_driver_bug_workaround_type.h
index eb2877f..9bbbb73 100644
--- a/gpu/config/gpu_driver_bug_workaround_type.h
+++ b/gpu/config/gpu_driver_bug_workaround_type.h
@@ -80,6 +80,8 @@
          init_varyings_without_static_use)                   \
   GPU_OP(INIT_VERTEX_ATTRIBUTES,                             \
          init_vertex_attributes)                             \
+  GPU_OP(MAX_COPY_TEXTURE_CHROMIUM_SIZE_1048576,             \
+         max_copy_texture_chromium_size_1048576)             \
   GPU_OP(MAX_COPY_TEXTURE_CHROMIUM_SIZE_262144,              \
          max_copy_texture_chromium_size_262144)              \
   GPU_OP(MAX_CUBE_MAP_TEXTURE_SIZE_LIMIT_1024,               \
diff --git a/infra/config/cq.cfg b/infra/config/cq.cfg
index 50fc7ce..bd043e2 100644
--- a/infra/config/cq.cfg
+++ b/infra/config/cq.cfg
@@ -35,9 +35,9 @@
       builders { name: "android_compile_dbg" }
       builders { name: "cast_shell_android" }
       builders { name: "cast_shell_linux" }
-      builders { name: "chromeos_x86-generic_chromium_compile_only_ng" }
       builders { name: "chromeos_amd64-generic_chromium_compile_only_ng" }
       builders { name: "chromeos_daisy_chromium_compile_only_ng" }
+      builders { name: "chromeos_x86-generic_chromium_compile_only_ng" }
       builders { name: "chromium_presubmit" }
       builders { name: "linux_android_rel_ng" }
       builders { name: "linux_chromium_asan_rel_ng" }
@@ -46,12 +46,9 @@
       builders { name: "linux_chromium_chromeos_rel_ng" }
       builders { name: "linux_chromium_clobber_rel_ng" }
       builders { name: "linux_chromium_compile_dbg_32_ng" }
+      builders { name: "linux_chromium_compile_dbg_ng" }
       builders { name: "linux_chromium_gn_chromeos_rel" }
       builders { name: "linux_chromium_rel_ng" }
-      builders {
-        name: "linux_chromium_compile_dbg_ng"
-        experiment_percentage: 10
-      }
     }
     buckets {
       name: "tryserver.chromium.mac"
diff --git a/ios/chrome/app/strings/ios_chromium_strings.grd b/ios/chrome/app/strings/ios_chromium_strings.grd
index ec2a8fec..0e0db44 100644
--- a/ios/chrome/app/strings/ios_chromium_strings.grd
+++ b/ios/chrome/app/strings/ios_chromium_strings.grd
@@ -130,6 +130,9 @@
   </translations>
   <release seq="1" allow_pseudo="false">
     <messages fallback_to_english="true">
+      <message name="IDS_IOS_SHORT_PRODUCT_NAME" desc="The Chrome application short name.">
+        Chromium
+      </message>
       <message name="IDS_IOS_AUTOFILL_DESCRIBE_LOCAL_COPY" desc="Text label that describes a Wallet credit card which has been copied to the local Chromium instance. Title case. [Length: 20em] [iOS only]">
         Copied to Chrome
       </message>
diff --git a/ios/chrome/app/strings/ios_google_chrome_strings.grd b/ios/chrome/app/strings/ios_google_chrome_strings.grd
index 1040a464..725aa9ca 100644
--- a/ios/chrome/app/strings/ios_google_chrome_strings.grd
+++ b/ios/chrome/app/strings/ios_google_chrome_strings.grd
@@ -130,6 +130,9 @@
   </translations>
   <release seq="1" allow_pseudo="false">
     <messages fallback_to_english="true">
+      <message name="IDS_IOS_SHORT_PRODUCT_NAME" desc="The Chrome application short name">
+        Chrome
+      </message>
       <message name="IDS_IOS_AUTOFILL_DESCRIBE_LOCAL_COPY" desc="Text label that describes a Wallet credit card which has been copied to the local Chrome instance. Title case. [Length: 20em] [iOS only]">
         Copied to Chrome
       </message>
diff --git a/ios/chrome/browser/DEPS b/ios/chrome/browser/DEPS
index f5ef641b..5a4e50be 100644
--- a/ios/chrome/browser/DEPS
+++ b/ios/chrome/browser/DEPS
@@ -7,6 +7,7 @@
   "+components/bookmarks",
   "+components/component_updater",
   "+components/content_settings/core",
+  "+components/crash/core/browser",
   "+components/crash/core/common",
   "+components/data_reduction_proxy/core/browser",
   "+components/data_reduction_proxy/core/common",
@@ -81,7 +82,10 @@
   "+skia/ext/skia_utils_ios.h",
 
   # Strings and resources.
+  "+grit/components_chromium_strings.h",
+  "+grit/components_google_chrome_strings.h",
   "+grit/components_resources.h",
+  "+grit/components_scaled_resources.h",
   "+grit/components_strings.h",
   "+ios/chrome/grit",
 ]
diff --git a/ios/chrome/browser/favicon/favicon_client_impl.cc b/ios/chrome/browser/favicon/favicon_client_impl.cc
index 06beba0..3dbb5ce2 100644
--- a/ios/chrome/browser/favicon/favicon_client_impl.cc
+++ b/ios/chrome/browser/favicon/favicon_client_impl.cc
@@ -4,16 +4,34 @@
 
 #include "ios/chrome/browser/favicon/favicon_client_impl.h"
 
+#include "base/bind.h"
 #include "base/logging.h"
+#include "base/task/cancelable_task_tracker.h"
+#include "ios/chrome/browser/chrome_url_constants.h"
+#include "ios/public/provider/chrome/browser/chrome_browser_provider.h"
+#include "url/gurl.h"
 
-FaviconClientImpl::FaviconClientImpl() {
+namespace {
+
+void RunFaviconCallbackIfNotCanceled(
+    const base::CancelableTaskTracker::IsCanceledCallback& is_canceled_cb,
+    const favicon_base::FaviconResultsCallback& original_callback,
+    const std::vector<favicon_base::FaviconRawBitmapResult>& results) {
+  if (!is_canceled_cb.Run()) {
+    original_callback.Run(results);
+  }
 }
 
+}  // namespace
+
+FaviconClientImpl::FaviconClientImpl(ios::ChromeBrowserState* browser_state)
+    : browser_state_(browser_state) {}
+
 FaviconClientImpl::~FaviconClientImpl() {
 }
 
 bool FaviconClientImpl::IsNativeApplicationURL(const GURL& url) {
-  return false;
+  return url.SchemeIs(kChromeUIScheme);
 }
 
 base::CancelableTaskTracker::TaskId
@@ -22,6 +40,15 @@
     const std::vector<int>& desired_sizes_in_pixel,
     const favicon_base::FaviconResultsCallback& callback,
     base::CancelableTaskTracker* tracker) {
-  NOTREACHED();
-  return base::CancelableTaskTracker::kBadTaskId;
+  DCHECK(tracker);
+  DCHECK(IsNativeApplicationURL(url));
+  base::CancelableTaskTracker::IsCanceledCallback is_canceled_cb;
+  base::CancelableTaskTracker::TaskId task_id =
+      tracker->NewTrackedTaskId(&is_canceled_cb);
+  if (task_id != base::CancelableTaskTracker::kBadTaskId) {
+    ios::GetChromeBrowserProvider()->GetFaviconForURL(
+        browser_state_, url, desired_sizes_in_pixel,
+        base::Bind(&RunFaviconCallbackIfNotCanceled, is_canceled_cb, callback));
+  }
+  return task_id;
 }
diff --git a/ios/chrome/browser/favicon/favicon_client_impl.h b/ios/chrome/browser/favicon/favicon_client_impl.h
index 0680303..3874fb5 100644
--- a/ios/chrome/browser/favicon/favicon_client_impl.h
+++ b/ios/chrome/browser/favicon/favicon_client_impl.h
@@ -12,12 +12,16 @@
 #include "components/favicon/core/favicon_client.h"
 #include "components/favicon_base/favicon_callback.h"
 
+namespace ios {
+class ChromeBrowserState;
+}
+
 class GURL;
 
 // FaviconClientImpl implements the favicon::FaviconClient interface on iOS.
 class FaviconClientImpl : public favicon::FaviconClient {
  public:
-  FaviconClientImpl();
+  FaviconClientImpl(ios::ChromeBrowserState* browser_state);
   ~FaviconClientImpl() override;
 
  private:
@@ -29,6 +33,8 @@
       const favicon_base::FaviconResultsCallback& callback,
       base::CancelableTaskTracker* tracker) override;
 
+  ios::ChromeBrowserState* browser_state_;
+
   DISALLOW_COPY_AND_ASSIGN(FaviconClientImpl);
 };
 
diff --git a/ios/chrome/browser/favicon/favicon_service_factory.cc b/ios/chrome/browser/favicon/favicon_service_factory.cc
index 414103c..1edd1644 100644
--- a/ios/chrome/browser/favicon/favicon_service_factory.cc
+++ b/ios/chrome/browser/favicon/favicon_service_factory.cc
@@ -52,7 +52,7 @@
   ios::ChromeBrowserState* browser_state =
       ios::ChromeBrowserState::FromBrowserState(context);
   return make_scoped_ptr(new favicon::FaviconService(
-      make_scoped_ptr(new FaviconClientImpl),
+      make_scoped_ptr(new FaviconClientImpl(browser_state)),
       ios::HistoryServiceFactory::GetForBrowserState(
           browser_state, ServiceAccessType::EXPLICIT_ACCESS)));
 }
diff --git a/ios/chrome/browser/signin/ios_chrome_signin_status_metrics_provider_delegate.cc b/ios/chrome/browser/signin/ios_chrome_signin_status_metrics_provider_delegate.cc
new file mode 100644
index 0000000..4ee19343
--- /dev/null
+++ b/ios/chrome/browser/signin/ios_chrome_signin_status_metrics_provider_delegate.cc
@@ -0,0 +1,78 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "ios/chrome/browser/signin/ios_chrome_signin_status_metrics_provider_delegate.h"
+
+#include "components/signin/core/browser/signin_manager.h"
+#include "components/signin/core/browser/signin_status_metrics_provider.h"
+#include "ios/chrome/browser/application_context.h"
+#include "ios/chrome/browser/signin/signin_manager_factory.h"
+#include "ios/public/provider/chrome/browser/browser_state/chrome_browser_state.h"
+#include "ios/public/provider/chrome/browser/browser_state/chrome_browser_state_manager.h"
+
+IOSChromeSigninStatusMetricsProviderDelegate::
+    IOSChromeSigninStatusMetricsProviderDelegate() {}
+
+IOSChromeSigninStatusMetricsProviderDelegate::
+    ~IOSChromeSigninStatusMetricsProviderDelegate() {
+  ios::SigninManagerFactory* factory = ios::SigninManagerFactory::GetInstance();
+  if (factory)
+    factory->RemoveObserver(this);
+}
+
+void IOSChromeSigninStatusMetricsProviderDelegate::Initialize() {
+  ios::SigninManagerFactory* factory = ios::SigninManagerFactory::GetInstance();
+  if (factory)
+    factory->AddObserver(this);
+}
+
+AccountsStatus
+IOSChromeSigninStatusMetricsProviderDelegate::GetStatusOfAllAccounts() {
+  std::vector<ios::ChromeBrowserState*> browser_state_list =
+      GetLoadedChromeBrowserStates();
+  AccountsStatus accounts_status;
+  accounts_status.num_accounts = browser_state_list.size();
+  accounts_status.num_opened_accounts = accounts_status.num_accounts;
+
+  for (ios::ChromeBrowserState* browser_state : browser_state_list) {
+    SigninManager* manager = ios::SigninManagerFactory::GetForBrowserState(
+        browser_state->GetOriginalChromeBrowserState());
+    if (manager && manager->IsAuthenticated())
+      accounts_status.num_signed_in_accounts++;
+  }
+
+  return accounts_status;
+}
+
+std::vector<SigninManager*> IOSChromeSigninStatusMetricsProviderDelegate::
+    GetSigninManagersForAllAccounts() {
+  std::vector<SigninManager*> managers;
+  for (ios::ChromeBrowserState* browser_state :
+       GetLoadedChromeBrowserStates()) {
+    SigninManager* manager =
+        ios::SigninManagerFactory::GetForBrowserStateIfExists(browser_state);
+    if (manager) {
+      managers.push_back(manager);
+    }
+  }
+
+  return managers;
+}
+
+void IOSChromeSigninStatusMetricsProviderDelegate::SigninManagerCreated(
+    SigninManager* manager) {
+  owner()->OnSigninManagerCreated(manager);
+}
+
+void IOSChromeSigninStatusMetricsProviderDelegate::SigninManagerShutdown(
+    SigninManager* manager) {
+  owner()->OnSigninManagerShutdown(manager);
+}
+
+std::vector<ios::ChromeBrowserState*>
+IOSChromeSigninStatusMetricsProviderDelegate::GetLoadedChromeBrowserStates() {
+  return GetApplicationContext()
+      ->GetChromeBrowserStateManager()
+      ->GetLoadedChromeBrowserStates();
+}
diff --git a/ios/chrome/browser/signin/ios_chrome_signin_status_metrics_provider_delegate.h b/ios/chrome/browser/signin/ios_chrome_signin_status_metrics_provider_delegate.h
new file mode 100644
index 0000000..2e1a3ca
--- /dev/null
+++ b/ios/chrome/browser/signin/ios_chrome_signin_status_metrics_provider_delegate.h
@@ -0,0 +1,40 @@
+// 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_SIGNIN_IOS_CHROME_SIGNIN_STATUS_METRICS_PROVIDER_DELEGATE_H_
+#define IOS_CHROME_BROWSER_SIGNIN_IOS_CHROME_SIGNIN_STATUS_METRICS_PROVIDER_DELEGATE_H_
+
+#include <vector>
+
+#include "components/signin/core/browser/signin_status_metrics_provider_delegate.h"
+#include "ios/chrome/browser/signin/signin_manager_factory_observer.h"
+
+namespace ios {
+class ChromeBrowserState;
+}
+
+class IOSChromeSigninStatusMetricsProviderDelegate
+    : public SigninStatusMetricsProviderDelegate,
+      public SigninManagerFactoryObserver {
+ public:
+  IOSChromeSigninStatusMetricsProviderDelegate();
+  ~IOSChromeSigninStatusMetricsProviderDelegate() override;
+
+ private:
+  // SigninStatusMetricsProviderDelegate implementation.
+  void Initialize() override;
+  AccountsStatus GetStatusOfAllAccounts() override;
+  std::vector<SigninManager*> GetSigninManagersForAllAccounts() override;
+
+  // SigninManagerFactoryObserver implementation.
+  void SigninManagerCreated(SigninManager* manager) override;
+  void SigninManagerShutdown(SigninManager* manager) override;
+
+  // Returns the loaded ChromeBrowserState instances.
+  std::vector<ios::ChromeBrowserState*> GetLoadedChromeBrowserStates();
+
+  DISALLOW_COPY_AND_ASSIGN(IOSChromeSigninStatusMetricsProviderDelegate);
+};
+
+#endif  // IOS_CHROME_BROWSER_SIGNIN_IOS_CHROME_SIGNIN_STATUS_METRICS_PROVIDER_DELEGATE_H_
diff --git a/ios/chrome/browser/ui/webui/crashes_ui.cc b/ios/chrome/browser/ui/webui/crashes_ui.cc
new file mode 100644
index 0000000..ebfe9d5e
--- /dev/null
+++ b/ios/chrome/browser/ui/webui/crashes_ui.cc
@@ -0,0 +1,152 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "ios/chrome/browser/ui/webui/crashes_ui.h"
+
+#include "base/bind.h"
+#include "base/bind_helpers.h"
+#include "base/memory/ref_counted_memory.h"
+#include "base/strings/utf_string_conversions.h"
+#include "base/values.h"
+#include "components/crash/core/browser/crashes_ui_util.h"
+#include "components/version_info/version_info.h"
+#include "grit/components_chromium_strings.h"
+#include "grit/components_google_chrome_strings.h"
+#include "grit/components_resources.h"
+#include "grit/components_scaled_resources.h"
+#include "grit/components_strings.h"
+#include "ios/chrome/browser/chrome_url_constants.h"
+#include "ios/chrome/browser/crash_report/crash_upload_list.h"
+#include "ios/chrome/browser/metrics/ios_chrome_metrics_service_accessor.h"
+#include "ios/chrome/grit/ios_chromium_strings.h"
+#include "ios/public/provider/chrome/browser/browser_state/chrome_browser_state.h"
+#include "ios/public/provider/web/web_ui_ios.h"
+#include "ios/public/provider/web/web_ui_ios_message_handler.h"
+#include "ios/web/public/web_ui_ios_data_source.h"
+#include "ui/base/resource/resource_bundle.h"
+
+namespace {
+
+web::WebUIIOSDataSource* CreateCrashesUIHTMLSource() {
+  web::WebUIIOSDataSource* source =
+      web::WebUIIOSDataSource::Create(kChromeUICrashesHost);
+
+  for (size_t i = 0; i < crash::kCrashesUILocalizedStringsCount; ++i) {
+    source->AddLocalizedString(
+        crash::kCrashesUILocalizedStrings[i].name,
+        crash::kCrashesUILocalizedStrings[i].resource_id);
+  }
+
+  source->AddLocalizedString(crash::kCrashesUIShortProductName,
+                             IDS_IOS_SHORT_PRODUCT_NAME);
+
+  source->SetJsonPath("strings.js");
+  source->AddResourcePath(crash::kCrashesUICrashesJS, IDR_CRASH_CRASHES_JS);
+  source->SetDefaultResource(IDR_CRASH_CRASHES_HTML);
+  return source;
+}
+
+////////////////////////////////////////////////////////////////////////////////
+//
+// CrashesDOMHandler
+//
+////////////////////////////////////////////////////////////////////////////////
+
+// The handler for Javascript messages for the chrome://crashes/ page.
+class CrashesDOMHandler : public web::WebUIIOSMessageHandler,
+                          public CrashUploadList::Delegate {
+ public:
+  CrashesDOMHandler();
+  ~CrashesDOMHandler() override;
+
+  // WebUIMessageHandler implementation.
+  void RegisterMessages() override;
+
+  // CrashUploadList::Delegate implemenation.
+  void OnUploadListAvailable() override;
+
+ private:
+  // Asynchronously fetches the list of crashes. Called from JS.
+  void HandleRequestCrashes(const base::ListValue* args);
+
+  // Sends the recent crashes list JS.
+  void UpdateUI();
+
+  scoped_refptr<CrashUploadList> upload_list_;
+  bool list_available_;
+  bool first_load_;
+
+  DISALLOW_COPY_AND_ASSIGN(CrashesDOMHandler);
+};
+
+CrashesDOMHandler::CrashesDOMHandler()
+    : list_available_(false), first_load_(true) {
+  upload_list_ = ios::CreateCrashUploadList(this);
+}
+
+CrashesDOMHandler::~CrashesDOMHandler() {
+  upload_list_->ClearDelegate();
+}
+
+void CrashesDOMHandler::RegisterMessages() {
+  upload_list_->LoadUploadListAsynchronously();
+  web_ui()->RegisterMessageCallback(
+      crash::kCrashesUIRequestCrashList,
+      base::Bind(&CrashesDOMHandler::HandleRequestCrashes,
+                 base::Unretained(this)));
+}
+
+void CrashesDOMHandler::HandleRequestCrashes(const base::ListValue* args) {
+  if (first_load_) {
+    first_load_ = false;
+    if (list_available_)
+      UpdateUI();
+  } else {
+    list_available_ = false;
+    upload_list_->LoadUploadListAsynchronously();
+  }
+}
+
+void CrashesDOMHandler::OnUploadListAvailable() {
+  list_available_ = true;
+  if (!first_load_)
+    UpdateUI();
+}
+
+void CrashesDOMHandler::UpdateUI() {
+  bool crash_reporting_enabled =
+      IOSChromeMetricsServiceAccessor::IsMetricsAndCrashReportingEnabled();
+  base::ListValue crash_list;
+  if (crash_reporting_enabled)
+    crash::UploadListToValue(upload_list_.get(), &crash_list);
+  base::FundamentalValue enabled(crash_reporting_enabled);
+  base::FundamentalValue dynamic_backend(false);
+  base::StringValue version(version_info::GetVersionNumber());
+
+  web_ui()->CallJavascriptFunction(crash::kCrashesUIUpdateCrashList, enabled,
+                                   dynamic_backend, crash_list, version);
+}
+
+}  // namespace
+
+///////////////////////////////////////////////////////////////////////////////
+//
+// CrashesUI
+//
+///////////////////////////////////////////////////////////////////////////////
+
+CrashesUI::CrashesUI(web::WebUIIOS* web_ui) : web::WebUIIOSController(web_ui) {
+  web_ui->AddMessageHandler(new CrashesDOMHandler());
+
+  // Set up the chrome://crashes/ source.
+  web::WebUIIOSDataSource::Add(ios::ChromeBrowserState::FromWebUIIOS(web_ui),
+                               CreateCrashesUIHTMLSource());
+}
+
+// static
+base::RefCountedMemory* CrashesUI::GetFaviconResourceBytes(
+    ui::ScaleFactor scale_factor) {
+  return ResourceBundle::GetSharedInstance().LoadDataResourceBytesForScale(
+      IDR_CRASH_SAD_FAVICON, scale_factor);
+}
diff --git a/ios/chrome/browser/ui/webui/crashes_ui.h b/ios/chrome/browser/ui/webui/crashes_ui.h
new file mode 100644
index 0000000..b0605a1
--- /dev/null
+++ b/ios/chrome/browser/ui/webui/crashes_ui.h
@@ -0,0 +1,31 @@
+// 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_WEBUI_CRASHES_UI_H_
+#define IOS_CHROME_BROWSER_UI_WEBUI_CRASHES_UI_H_
+
+#include "base/macros.h"
+#include "ios/public/provider/web/web_ui_ios_controller.h"
+#include "ui/base/layout.h"
+
+namespace base {
+class RefCountedMemory;
+}
+
+namespace web {
+class WebUIIOS;
+}
+
+class CrashesUI : public web::WebUIIOSController {
+ public:
+  explicit CrashesUI(web::WebUIIOS* web_ui);
+
+  static base::RefCountedMemory* GetFaviconResourceBytes(
+      ui::ScaleFactor scale_factor);
+
+ private:
+  DISALLOW_COPY_AND_ASSIGN(CrashesUI);
+};
+
+#endif  // CHROME_BROWSER_UI_WEBUI_CRASHES_UI_H_
diff --git a/ios/chrome/ios_chrome.gyp b/ios/chrome/ios_chrome.gyp
index 7756f92..2eeb37e8 100644
--- a/ios/chrome/ios_chrome.gyp
+++ b/ios/chrome/ios_chrome.gyp
@@ -51,6 +51,7 @@
         '../../components/components.gyp:bookmarks_managed',
         '../../components/components.gyp:component_updater',
         '../../components/components.gyp:content_settings_core_browser',
+        '../../components/components.gyp:crash_core_browser',
         '../../components/components.gyp:crash_core_common',
         '../../components/components.gyp:data_reduction_proxy_core_common',
         '../../components/components.gyp:dom_distiller_core',
@@ -365,6 +366,8 @@
         'browser/signin/gaia_auth_fetcher_ios_private.h',
         'browser/signin/gaia_cookie_manager_service_factory.cc',
         'browser/signin/gaia_cookie_manager_service_factory.h',
+        'browser/signin/ios_chrome_signin_status_metrics_provider_delegate.cc',
+        'browser/signin/ios_chrome_signin_status_metrics_provider_delegate.h',
         'browser/signin/oauth2_token_service_factory.cc',
         'browser/signin/oauth2_token_service_factory.h',
         'browser/signin/signin_client_factory.cc',
@@ -473,6 +476,8 @@
         'browser/ui/url_loader.h',
         'browser/ui/webui/about_ui.cc',
         'browser/ui/webui/about_ui.h',
+        'browser/ui/webui/crashes_ui.cc',
+        'browser/ui/webui/crashes_ui.h',
         'browser/ui/webui/net_export/net_export_ui.cc',
         'browser/ui/webui/net_export/net_export_ui.h',
         'browser/ui/webui/sync_internals/sync_internals_message_handler.cc',
diff --git a/ios/crnet/crnet_environment.mm b/ios/crnet/crnet_environment.mm
index bba2eb1..57bf231 100644
--- a/ios/crnet/crnet_environment.mm
+++ b/ios/crnet/crnet_environment.mm
@@ -451,7 +451,12 @@
         base::WorkerPool::GetTaskRunner(true));
   }
 
-  net::HttpCache* main_cache = new net::HttpCache(params, main_backend);
+  // TODO(mmenke):  These really shouldn't be leaked.
+  //                See https://crbug.com/523858.
+  net::HttpNetworkSession* http_network_session =
+      new net::HttpNetworkSession(params);
+  net::HttpCache* main_cache = new net::HttpCache(
+      http_network_session, main_backend, true /* set_up_quic_server_info */);
   main_context_->set_http_transaction_factory(main_cache);
 
   // Cookies
diff --git a/ios/public/provider/chrome/DEPS b/ios/public/provider/chrome/DEPS
index 4780237e..2635c94 100644
--- a/ios/public/provider/chrome/DEPS
+++ b/ios/public/provider/chrome/DEPS
@@ -1,4 +1,5 @@
 include_rules = [
   "+components/autofill/core/browser",
+  "+components/favicon_base",
   "+ios/web/public",
 ]
diff --git a/ios/public/provider/chrome/browser/chrome_browser_provider.cc b/ios/public/provider/chrome/browser/chrome_browser_provider.cc
index b683726..49b917a 100644
--- a/ios/public/provider/chrome/browser/chrome_browser_provider.cc
+++ b/ios/public/provider/chrome/browser/chrome_browser_provider.cc
@@ -5,6 +5,7 @@
 #include "ios/public/provider/chrome/browser/chrome_browser_provider.h"
 
 #include "base/logging.h"
+#include "ios/public/provider/chrome/browser/keyed_service_provider.h"
 
 namespace ios {
 
@@ -120,4 +121,10 @@
   return false;
 }
 
+void ChromeBrowserProvider::GetFaviconForURL(
+    ios::ChromeBrowserState* browser_state,
+    const GURL& page_url,
+    const std::vector<int>& desired_sizes_in_pixel,
+    const favicon_base::FaviconResultsCallback& callback) const {}
+
 }  // namespace ios
diff --git a/ios/public/provider/chrome/browser/chrome_browser_provider.h b/ios/public/provider/chrome/browser/chrome_browser_provider.h
index 8105253..83f31fc 100644
--- a/ios/public/provider/chrome/browser/chrome_browser_provider.h
+++ b/ios/public/provider/chrome/browser/chrome_browser_provider.h
@@ -8,7 +8,11 @@
 #include <CoreGraphics/CoreGraphics.h>
 
 #include <string>
+#include <vector>
 
+#include "components/favicon_base/favicon_callback.h"
+
+class GURL;
 class InfoBarViewDelegate;
 class PrefRegistrySimple;
 class PrefService;
@@ -58,6 +62,7 @@
 namespace ios {
 
 class ChromeBrowserProvider;
+class ChromeBrowserState;
 class ChromeBrowserStateManager;
 class ChromeIdentityService;
 class GeolocationUpdaterProvider;
@@ -126,6 +131,13 @@
   virtual rappor::RapporService* GetRapporService();
   // Returns whether there is an Off-The-Record session active.
   virtual bool IsOffTheRecordSessionActive();
+  // Get the favicon for |page_url| and run |callback| with result when loaded.
+  // Note. |callback| is always run asynchronously.
+  virtual void GetFaviconForURL(
+      ChromeBrowserState* browser_state,
+      const GURL& page_url,
+      const std::vector<int>& desired_sizes_in_pixel,
+      const favicon_base::FaviconResultsCallback& callback) const;
 };
 
 }  // namespace ios
diff --git a/ios/web/shell/shell_url_request_context_getter.cc b/ios/web/shell/shell_url_request_context_getter.cc
index 8de48364..2f862c0 100644
--- a/ios/web/shell/shell_url_request_context_getter.cc
+++ b/ios/web/shell/shell_url_request_context_getter.cc
@@ -135,8 +135,11 @@
                                            net::CACHE_BACKEND_DEFAULT,
                                            cache_path, 0, cache_task_runner_);
 
+    storage_->set_http_network_session(
+        make_scoped_ptr(new net::HttpNetworkSession(network_session_params)));
     storage_->set_http_transaction_factory(make_scoped_ptr(
-        new net::HttpCache(network_session_params, main_backend)));
+        new net::HttpCache(storage_->http_network_session(), main_backend,
+                           true /* set_up_quic_server_info */)));
 
     scoped_ptr<net::URLRequestJobFactoryImpl> job_factory(
         new net::URLRequestJobFactoryImpl());
diff --git a/ios/web/web_view_creation_util.mm b/ios/web/web_view_creation_util.mm
index ec7d3d3c..cd8bc22e 100644
--- a/ios/web/web_view_creation_util.mm
+++ b/ios/web/web_view_creation_util.mm
@@ -16,8 +16,9 @@
 namespace web {
 
 bool IsWKWebViewSupported() {
-  // WKWebView is available starting from iOS8.
-  if (!base::ios::IsRunningOnIOS8OrLater())
+  // WKWebView is available starting from iOS 8, but only supported by the
+  // web layer starting from iOS 9 due to iOS 8 limitations.
+  if (!base::ios::IsRunningOnIOS9OrLater())
     return false;
 
 // WKWebView does not work with 32-bit binaries running on 64-bit hardware.
diff --git a/ipc/ipc.gyp b/ipc/ipc.gyp
index c4869c3..bc8659f 100644
--- a/ipc/ipc.gyp
+++ b/ipc/ipc.gyp
@@ -215,9 +215,29 @@
             'test_suite_name': 'ipc_perftests',
           },
           'includes': [ '../build/apk_test.gypi' ],
+        }
+      ],
+      'conditions': [
+        ['test_isolation_mode != "noop"', {
+          'targets': [
+            {
+              'target_name': 'ipc_tests_apk_run',
+              'type': 'none',
+              'dependencies': [
+                'ipc_tests_apk',
+              ],
+              'includes': [
+                '../build/isolate.gypi',
+              ],
+              'sources': [
+                'ipc_tests_apk.isolate',
+              ],
+            },
+          ],
         }],
+      ],
     }],
-    ['test_isolation_mode != "noop"', {
+    ['test_isolation_mode != "noop" and OS != "android"', {
       'targets': [
         {
           'target_name': 'ipc_tests_run',
diff --git a/ipc/ipc_tests_apk.isolate b/ipc/ipc_tests_apk.isolate
new file mode 100644
index 0000000..0c0cf1c
--- /dev/null
+++ b/ipc/ipc_tests_apk.isolate
@@ -0,0 +1,17 @@
+# 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.
+{
+  'includes': [
+    '../build/android/android.isolate',
+  ],
+  'variables': {
+    'command': [
+      '<(PRODUCT_DIR)/bin/run_ipc_tests',
+    ],
+    'files': [
+      '<(PRODUCT_DIR)/bin/run_ipc_tests',
+      '<(PRODUCT_DIR)/ipc_tests_apk/',
+    ]
+  },
+}
diff --git a/jingle/glue/proxy_resolving_client_socket.cc b/jingle/glue/proxy_resolving_client_socket.cc
index 1fdb3ea..e71f362 100644
--- a/jingle/glue/proxy_resolving_client_socket.cc
+++ b/jingle/glue/proxy_resolving_client_socket.cc
@@ -90,7 +90,7 @@
         reference_params->use_alternative_services;
   }
 
-  network_session_ = new net::HttpNetworkSession(session_params);
+  network_session_.reset(new net::HttpNetworkSession(session_params));
 }
 
 ProxyResolvingClientSocket::~ProxyResolvingClientSocket() {
diff --git a/jingle/glue/proxy_resolving_client_socket.h b/jingle/glue/proxy_resolving_client_socket.h
index e8f22ceb..14c8e24 100644
--- a/jingle/glue/proxy_resolving_client_socket.h
+++ b/jingle/glue/proxy_resolving_client_socket.h
@@ -89,7 +89,7 @@
   net::CompletionCallback proxy_resolve_callback_;
   net::CompletionCallback connect_callback_;
 
-  scoped_refptr<net::HttpNetworkSession> network_session_;
+  scoped_ptr<net::HttpNetworkSession> network_session_;
 
   // The transport socket.
   scoped_ptr<net::ClientSocketHandle> transport_;
diff --git a/mandoline/BUILD.gn b/mandoline/BUILD.gn
index 3df7ccd..b14dfd2 100644
--- a/mandoline/BUILD.gn
+++ b/mandoline/BUILD.gn
@@ -16,7 +16,10 @@
     if (is_android) {
       deps += [ "//mandoline/app/android" ]
     } else {
-      deps += [ "//mandoline/app/desktop" ]
+      deps += [
+        "//components/mus/example",
+        "//mandoline/app/desktop",
+      ]
     }
   }
 }
diff --git a/mandoline/ui/aura/BUILD.gn b/mandoline/ui/aura/BUILD.gn
index 873539fb..425f207 100644
--- a/mandoline/ui/aura/BUILD.gn
+++ b/mandoline/ui/aura/BUILD.gn
@@ -53,7 +53,12 @@
     "//ui/wm",
   ]
 
+  data_deps = [
+    "//components/resource_provider",
+  ]
+
   if (is_linux && !is_android) {
     deps += [ "//components/font_service/public/cpp" ]
+    data_deps += [ "//components/font_service" ]
   }
 }
diff --git a/mandoline/ui/aura/aura_init.cc b/mandoline/ui/aura/aura_init.cc
index 26f76193..b51dc9e 100644
--- a/mandoline/ui/aura/aura_init.cc
+++ b/mandoline/ui/aura/aura_init.cc
@@ -23,12 +23,9 @@
 
 namespace {
 
-// Paths resources are loaded from.
-const char kResourceUIPak[] = "mandoline_ui.pak";
-
-std::set<std::string> GetResourcePaths() {
+std::set<std::string> GetResourcePaths(const std::string& resource_file) {
   std::set<std::string> paths;
-  paths.insert(kResourceUIPak);
+  paths.insert(resource_file);
   return paths;
 }
 
@@ -37,8 +34,11 @@
 // TODO(sky): the 1.f should be view->viewport_metrics().device_scale_factor,
 // but that causes clipping problems. No doubt we're not scaling a size
 // correctly.
-AuraInit::AuraInit(mus::View* view, mojo::Shell* shell)
-    : ui_init_(view->viewport_metrics().size_in_pixels.To<gfx::Size>(), 1.f) {
+AuraInit::AuraInit(mus::View* view,
+                   mojo::Shell* shell,
+                   const std::string& resource_file)
+    : ui_init_(view->viewport_metrics().size_in_pixels.To<gfx::Size>(), 1.f),
+      resource_file_(resource_file) {
   aura::Env::CreateInstance(false);
 
   InitializeResources(shell);
@@ -61,7 +61,8 @@
 void AuraInit::InitializeResources(mojo::Shell* shell) {
   if (ui::ResourceBundle::HasSharedInstance())
     return;
-  resource_provider::ResourceLoader resource_loader(shell, GetResourcePaths());
+  resource_provider::ResourceLoader resource_loader(
+      shell, GetResourcePaths(resource_file_));
   if (!resource_loader.BlockUntilLoaded())
     return;
   CHECK(resource_loader.loaded());
@@ -69,10 +70,12 @@
       resource_loader.GetICUFile().TakePlatformFile(),
       base::MemoryMappedFile::Region::kWholeFile);
   ui::RegisterPathProvider();
-  ui::ResourceBundle::InitSharedInstanceWithPakPath(base::FilePath());
+  base::File pak_file = resource_loader.ReleaseFile(resource_file_);
+  base::File pak_file_2 = pak_file.Duplicate();
+  ui::ResourceBundle::InitSharedInstanceWithPakFileRegion(
+      pak_file.Pass(), base::MemoryMappedFile::Region::kWholeFile);
   ui::ResourceBundle::GetSharedInstance().AddDataPackFromFile(
-      resource_loader.ReleaseFile(kResourceUIPak),
-      ui::SCALE_FACTOR_100P);
+      pak_file_2.Pass(), ui::SCALE_FACTOR_100P);
 
   // Initialize the skia font code to go ask fontconfig underneath.
 #if defined(OS_LINUX) && !defined(OS_ANDROID)
diff --git a/mandoline/ui/aura/aura_init.h b/mandoline/ui/aura/aura_init.h
index 505adb4..029f8ad 100644
--- a/mandoline/ui/aura/aura_init.h
+++ b/mandoline/ui/aura/aura_init.h
@@ -5,6 +5,8 @@
 #ifndef MANDOLINE_UI_AURA_AURA_INIT_H_
 #define MANDOLINE_UI_AURA_AURA_INIT_H_
 
+#include <string>
+
 #include "skia/ext/refptr.h"
 #include "ui/mojo/init/ui_init.h"
 
@@ -23,9 +25,13 @@
 namespace mandoline {
 
 // Sets up necessary state for aura when run with the viewmanager.
+// TODO(sky): move this out of mandoline.
+// |resource_file| is the path to the apk file containing the resources.
 class AuraInit {
  public:
-  AuraInit(mus::View* root, mojo::Shell* shell);
+  AuraInit(mus::View* root,
+           mojo::Shell* shell,
+           const std::string& resource_file);
   ~AuraInit();
 
  private:
@@ -37,6 +43,8 @@
   skia::RefPtr<font_service::FontLoader> font_loader_;
 #endif
 
+  const std::string resource_file_;
+
   DISALLOW_COPY_AND_ASSIGN(AuraInit);
 };
 
diff --git a/mandoline/ui/desktop_ui/browser_window.cc b/mandoline/ui/desktop_ui/browser_window.cc
index 0a8079d..c968065 100644
--- a/mandoline/ui/desktop_ui/browser_window.cc
+++ b/mandoline/ui/desktop_ui/browser_window.cc
@@ -373,7 +373,7 @@
 void BrowserWindow::Init(mus::View* root) {
   DCHECK_GT(root->viewport_metrics().device_pixel_ratio, 0);
   if (!aura_init_)
-    aura_init_.reset(new AuraInit(root, app_->shell()));
+    aura_init_.reset(new AuraInit(root, app_->shell(), "mandoline_ui.pak"));
 
   root_ = root;
   omnibox_view_ = root_->connection()->CreateView();
diff --git a/mandoline/ui/omnibox/omnibox_application.cc b/mandoline/ui/omnibox/omnibox_application.cc
index c3b42de5..893c0a3 100644
--- a/mandoline/ui/omnibox/omnibox_application.cc
+++ b/mandoline/ui/omnibox/omnibox_application.cc
@@ -116,7 +116,7 @@
   root_ = root;
 
   if (!aura_init_.get()) {
-    aura_init_.reset(new AuraInit(root, app_->shell()));
+    aura_init_.reset(new AuraInit(root, app_->shell(), "mandoline_ui.pak"));
     edit_ = new views::Textfield;
     edit_->set_controller(this);
     edit_->SetTextInputType(ui::TEXT_INPUT_TYPE_URL);
diff --git a/media/audio/audio_output_ipc.h b/media/audio/audio_output_ipc.h
index fa9c08e..0326506c 100644
--- a/media/audio/audio_output_ipc.h
+++ b/media/audio/audio_output_ipc.h
@@ -75,11 +75,14 @@
 
   // Sends a request to authorize the use of a specific audio output device
   // in the peer process.
-  // If |session_id| is nonzero, the browser selects the output device
-  // associated with an opened input device indicated by |session_id|. If no
-  // such device is found, the browser attempts to select the device indicated
-  // by |device_id|. If |device_id| is the empty string, the default
-  // audio output device will be selected.
+  // If |device_id| is nonempty, the browser selects the device
+  // indicated by |device_id|, regardless of the value of |session_id|.
+  // If |device_id| is empty and |session_id| is nonzero, the browser selects
+  // the output device associated with an opened input device indicated by
+  // |session_id|. If no such device is found, the default device will be
+  // selected.
+  // If |device_id| is empty and |session_id| is zero, the browser selects
+  // the default device.
   // Once the authorization process is complete, the implementation will
   // notify |delegate| by calling OnDeviceAuthorized().
   virtual void RequestDeviceAuthorization(
@@ -91,6 +94,8 @@
   // Sends a request to create an AudioOutputController object in the peer
   // process and configures it to use the specified audio |params| including
   // number of synchronized input channels.
+  // If no authorization for an output device has been previously requested,
+  // the default device will be used.
   // Once the stream has been created, the implementation will notify
   // |delegate| by calling OnStreamCreated().
   virtual void CreateStream(AudioOutputIPCDelegate* delegate,
diff --git a/media/base/android/java/src/org/chromium/media/AudioManagerAndroid.java b/media/base/android/java/src/org/chromium/media/AudioManagerAndroid.java
index 7916f62..572f19c4 100644
--- a/media/base/android/java/src/org/chromium/media/AudioManagerAndroid.java
+++ b/media/base/android/java/src/org/chromium/media/AudioManagerAndroid.java
@@ -105,6 +105,7 @@
             "Nexus 4", // Nexus 4
             "Nexus 5", // Nexus 5
             "Nexus 7", // Nexus 7
+            "Nexus 9", // Nexus 9
             "SM-N9005", // Galaxy Note 3
             "SM-T310", // Galaxy Tab 3 8.0 (WiFi)
     };
diff --git a/media/blink/mock_weburlloader.h b/media/blink/mock_weburlloader.h
index 68cf6da..70dd5a6 100644
--- a/media/blink/mock_weburlloader.h
+++ b/media/blink/mock_weburlloader.h
@@ -23,7 +23,6 @@
                                         blink::WebURLLoaderClient* client));
   MOCK_METHOD0(cancel, void());
   MOCK_METHOD1(setDefersLoading, void(bool value));
-  MOCK_METHOD1(setLoadingTaskRunner, void(blink::WebTaskRunner* task_runner));
 
  private:
   DISALLOW_COPY_AND_ASSIGN(MockWebURLLoader);
diff --git a/media/filters/h264_parser.cc b/media/filters/h264_parser.cc
index fe2a443..299f388 100644
--- a/media/filters/h264_parser.cc
+++ b/media/filters/h264_parser.cc
@@ -159,12 +159,24 @@
   }
 }
 
-const H264PPS* H264Parser::GetPPS(int pps_id) {
-  return active_PPSes_[pps_id];
+const H264PPS* H264Parser::GetPPS(int pps_id) const {
+  auto it = active_PPSes_.find(pps_id);
+  if (it == active_PPSes_.end()) {
+    DVLOG(1) << "Requested a nonexistent PPS id " << pps_id;
+    return nullptr;
+  }
+
+  return it->second;
 }
 
-const H264SPS* H264Parser::GetSPS(int sps_id) {
-  return active_SPSes_[sps_id];
+const H264SPS* H264Parser::GetSPS(int sps_id) const {
+  auto it = active_SPSes_.find(sps_id);
+  if (it == active_SPSes_.end()) {
+    DVLOG(1) << "Requested a nonexistent SPS id " << sps_id;
+    return nullptr;
+  }
+
+  return it->second;
 }
 
 static inline bool IsStartCode(const uint8* data) {
@@ -835,9 +847,6 @@
   READ_UE_OR_RETURN(&sps->max_num_ref_frames);
   READ_BOOL_OR_RETURN(&sps->gaps_in_frame_num_value_allowed_flag);
 
-  if (sps->gaps_in_frame_num_value_allowed_flag)
-    return kUnsupportedStream;
-
   READ_UE_OR_RETURN(&sps->pic_width_in_mbs_minus1);
   READ_UE_OR_RETURN(&sps->pic_height_in_map_units_minus1);
 
@@ -884,6 +893,11 @@
   READ_UE_OR_RETURN(&pps->seq_parameter_set_id);
   TRUE_OR_RETURN(pps->seq_parameter_set_id < 32);
 
+  if (active_SPSes_.find(pps->seq_parameter_set_id) == active_SPSes_.end()) {
+    DVLOG(1) << "Invalid stream, no SPS id: " << pps->seq_parameter_set_id;
+    return kInvalidStream;
+  }
+
   sps = GetSPS(pps->seq_parameter_set_id);
   TRUE_OR_RETURN(sps);
 
diff --git a/media/filters/h264_parser.h b/media/filters/h264_parser.h
index 36467ba..389fe0d1 100644
--- a/media/filters/h264_parser.h
+++ b/media/filters/h264_parser.h
@@ -386,8 +386,8 @@
 
   // Return a pointer to SPS/PPS with given |sps_id|/|pps_id| or NULL if not
   // present.
-  const H264SPS* GetSPS(int sps_id);
-  const H264PPS* GetPPS(int pps_id);
+  const H264SPS* GetSPS(int sps_id) const;
+  const H264PPS* GetPPS(int pps_id) const;
 
   // Slice headers and SEI messages are not used across NALUs by the parser
   // and can be discarded after current NALU, so the parser does not store
diff --git a/media/media_options.gni b/media/media_options.gni
index b6c63fb4e..466b6c54 100644
--- a/media/media_options.gni
+++ b/media/media_options.gni
@@ -64,6 +64,7 @@
   # Valid options are:
   # - "none": Do not use mojo media application.
   # - "browser": Use mojo media application hosted in the browser process.
+  # - "gpu": Use mojo media application hosted in the gpu process.
   # - "utility": Use mojo media application hosted in the utility process.
   enable_mojo_media = "none"
 
diff --git a/media/mojo/services/BUILD.gn b/media/mojo/services/BUILD.gn
index 0df256a..08b15c9 100644
--- a/media/mojo/services/BUILD.gn
+++ b/media/mojo/services/BUILD.gn
@@ -15,7 +15,7 @@
 
 config("enable_mojo_media_config") {
   assert(enable_mojo_media == "none" || enable_mojo_media == "browser" ||
-         enable_mojo_media == "utility")
+         enable_mojo_media == "gpu" || enable_mojo_media == "utility")
 
   if (enable_mojo_media != "none") {
     defines = [ "ENABLE_MOJO_MEDIA" ]
@@ -23,6 +23,8 @@
 
   if (enable_mojo_media == "browser") {
     defines += [ "ENABLE_MOJO_MEDIA_IN_BROWSER_PROCESS" ]
+  } else if (enable_mojo_media == "gpu") {
+    defines += [ "ENABLE_MOJO_MEDIA_IN_GPU_PROCESS" ]
   } else if (enable_mojo_media == "utility") {
     defines += [ "ENABLE_MOJO_MEDIA_IN_UTILITY_PROCESS" ]
   }
@@ -209,7 +211,9 @@
       "//testing/gtest",
     ]
 
-    data_deps = [ ":media" ]
+    data_deps = [
+      ":media",
+    ]
   }
 
   mojo_native_application("media_pipeline_integration_apptests") {
@@ -219,7 +223,9 @@
       "//media/test:mojo_pipeline_integration_tests",
     ]
 
-    data_deps = [ ":media" ]
+    data_deps = [
+      ":media",
+    ]
   }
 }
 
diff --git a/media/mojo/services/mojo_media_application.cc b/media/mojo/services/mojo_media_application.cc
index 566f43f3..fae648b 100644
--- a/media/mojo/services/mojo_media_application.cc
+++ b/media/mojo/services/mojo_media_application.cc
@@ -12,13 +12,6 @@
 
 namespace media {
 
-const char kMojoMediaAppUrl[] = "mojo:media";
-
-// static
-GURL MojoMediaApplication::AppUrl() {
-  return GURL(kMojoMediaAppUrl);
-}
-
 // static
 scoped_ptr<mojo::ApplicationDelegate> MojoMediaApplication::CreateApp() {
   return scoped_ptr<mojo::ApplicationDelegate>(new MojoMediaApplication());
diff --git a/media/mojo/services/mojo_media_application.h b/media/mojo/services/mojo_media_application.h
index 3233e03d..379c4b93 100644
--- a/media/mojo/services/mojo_media_application.h
+++ b/media/mojo/services/mojo_media_application.h
@@ -16,7 +16,6 @@
     : public mojo::ApplicationDelegate,
       public mojo::InterfaceFactory<interfaces::ServiceFactory> {
  public:
-  static GURL AppUrl();
   static scoped_ptr<mojo::ApplicationDelegate> CreateApp();
 
   MojoMediaApplication();
diff --git a/media/video/gpu_memory_buffer_video_frame_pool.cc b/media/video/gpu_memory_buffer_video_frame_pool.cc
index f1965d10..c0ab7a9f 100644
--- a/media/video/gpu_memory_buffer_video_frame_pool.cc
+++ b/media/video/gpu_memory_buffer_video_frame_pool.cc
@@ -237,10 +237,10 @@
     DCHECK_NE(dest_stride, 0);
     DCHECK_LE(bytes_per_row, std::abs(dest_stride));
     DCHECK_LE(bytes_per_row, source_stride);
-    for (int row = first_row; row < first_row + rows; ++row) {
-      memcpy(output + dest_stride * row, source + source_stride * row,
-             bytes_per_row);
-    }
+
+    libyuv::CopyPlane(source + source_stride * first_row, source_stride,
+                      output + dest_stride * first_row, dest_stride,
+                      bytes_per_row, rows);
   }
   done.Run();
 }
diff --git a/mojo/edk/js/tests/BUILD.gn b/mojo/edk/js/tests/BUILD.gn
index a6be00f..ee2af69 100644
--- a/mojo/edk/js/tests/BUILD.gn
+++ b/mojo/edk/js/tests/BUILD.gn
@@ -28,4 +28,6 @@
   sources = [
     "js_to_cpp.mojom",
   ]
+
+  with_environment = false
 }
diff --git a/mojo/edk/system/BUILD.gn b/mojo/edk/system/BUILD.gn
index b1ac614d..577a072 100644
--- a/mojo/edk/system/BUILD.gn
+++ b/mojo/edk/system/BUILD.gn
@@ -22,13 +22,15 @@
   sources = [
     "master.mojom",
   ]
+
+  with_environment = false
 }
 
 static_library("system") {
-# TODO(use_chrome_edk): this should be a component to match third_party,
-# but since third_party includes it, we either make it a static library
-# or we have to change the export macros to be different than third_party.
-#component("system") {
+  # TODO(use_chrome_edk): this should be a component to match third_party,
+  # but since third_party includes it, we either make it a static library
+  # or we have to change the export macros to be different than third_party.
+  #component("system") {
   # TODO(use_chrome_edk): remove "2"
   output_name = "mojo_system_impl2"
 
@@ -55,6 +57,7 @@
     "handle_table.h",
     "mapping_table.cc",
     "mapping_table.h",
+
     #"master_impl.cc",
     #"master_impl.h",
     "message_in_transit.cc",
@@ -98,6 +101,7 @@
   deps = [
     "//base",
     "//base/third_party/dynamic_annotations",
+
     #":master",
   ]
 
@@ -149,6 +153,7 @@
     "core_unittest.cc",
     "data_pipe_unittest.cc",
     "dispatcher_unittest.cc",
+
     #"master_impl_unittest.cc",
 
     "message_in_transit_queue_unittest.cc",
@@ -160,7 +165,6 @@
     "multiprocess_message_pipe_unittest.cc",
     "options_validation_unittest.cc",
     "platform_handle_dispatcher_unittest.cc",
-
     "raw_channel_unittest.cc",
     "run_all_unittests.cc",
     "shared_buffer_dispatcher_unittest.cc",
diff --git a/mojo/edk/system/data_pipe.cc b/mojo/edk/system/data_pipe.cc
index 2b61729..d320e52b 100644
--- a/mojo/edk/system/data_pipe.cc
+++ b/mojo/edk/system/data_pipe.cc
@@ -131,6 +131,8 @@
   if (serialization->shared_memory_size) {
     serialization->shared_memory_handle_index = platform_handles->size();
     platform_handles->push_back(shared_memory_handle.release());
+  } else {
+    serialization->shared_memory_handle_index = kInvalidDataPipeHandleIndex;
   }
 
   *actual_size = sizeof(SerializedDataPipeHandleDispatcher);
@@ -144,7 +146,7 @@
     ScopedPlatformHandle* shared_memory_handle,
     size_t* shared_memory_size) {
   if (size != sizeof(SerializedDataPipeHandleDispatcher)) {
-    LOG(ERROR) << "Invalid serialized platform handle dispatcher (bad size)";
+    LOG(ERROR) << "Invalid serialized data pipe dispatcher (bad size)";
     return ScopedPlatformHandle();
   }
 
@@ -158,7 +160,7 @@
     if (!platform_handles ||
         platform_handle_index >= platform_handles->size()) {
       LOG(ERROR)
-          << "Invalid serialized platform handle dispatcher (missing handles)";
+          << "Invalid serialized data pipe dispatcher (missing handles)";
       return ScopedPlatformHandle();
     }
 
@@ -177,10 +179,10 @@
     if (*shared_memory_size) {
       DCHECK(serialization->shared_memory_handle_index !=
              kInvalidDataPipeHandleIndex);
-      if (!serialization->shared_memory_handle_index ||
+      if (!platform_handles ||
           serialization->shared_memory_handle_index >=
               platform_handles->size()) {
-        LOG(ERROR) << "Invalid serialized platform handle dispatcher "
+        LOG(ERROR) << "Invalid serialized data pipe dispatcher "
                    << "(missing handles)";
         return ScopedPlatformHandle();
       }
diff --git a/mojo/edk/system/data_pipe_consumer_dispatcher.cc b/mojo/edk/system/data_pipe_consumer_dispatcher.cc
index 798537de..6e0c35b9 100644
--- a/mojo/edk/system/data_pipe_consumer_dispatcher.cc
+++ b/mojo/edk/system/data_pipe_consumer_dispatcher.cc
@@ -81,8 +81,7 @@
     SharedMemoryHeader* header = reinterpret_cast<SharedMemoryHeader*>(buffer);
     buffer += sizeof(SharedMemoryHeader);
     if (header->data_size) {
-      rv->data_.resize(header->data_size);
-      memcpy(&rv->data_[0], buffer, header->data_size);
+      rv->data_.assign(buffer, buffer + header->data_size);
       buffer += header->data_size;
     }
 
@@ -96,6 +95,12 @@
   if (platform_handle.is_valid()) {
     rv->Init(platform_handle.Pass(), serialized_read_buffer,
              serialized_read_buffer_size);
+  } else {
+    // The data pipe consumer could have read all the data and the producer
+    // closed its end subsequently (before the consumer was sent). In that case
+    // when we deserialize the consumer we must make sure to set error_ or
+    // otherwise the peer-closed signal will never be satisfied.
+    rv->error_ = true;
   }
   return rv;
 }
@@ -134,9 +139,6 @@
   SerializeInternal();
 
   scoped_refptr<DataPipeConsumerDispatcher> rv = Create(options_);
-  rv->channel_ = channel_;
-  channel_ = nullptr;
-  rv->options_ = options_;
   data_.swap(rv->data_);
   serialized_read_buffer_.swap(rv->serialized_read_buffer_);
   rv->serialized_platform_handle_ = serialized_platform_handle_.Pass();
@@ -245,6 +247,15 @@
 
   in_two_phase_read_ = false;
   two_phase_max_bytes_read_ = 0;
+  if (!data_received_during_two_phase_read_.empty()) {
+    if (data_.empty()) {
+      data_received_during_two_phase_read_.swap(data_);
+    } else {
+      data_.insert(data_.end(), data_received_during_two_phase_read_.begin(),
+                   data_received_during_two_phase_read_.end());
+      data_received_during_two_phase_read_.clear();
+    }
+  }
 
   HandleSignalsState new_state = GetHandleSignalsStateImplNoLock();
   if (!new_state.equals(old_state))
@@ -388,8 +399,8 @@
 void DataPipeConsumerDispatcher::OnReadMessage(
     const MessageInTransit::View& message_view,
     ScopedPlatformHandleVectorPtr platform_handles) {
-  scoped_ptr<MessageInTransit> message(new MessageInTransit(message_view));
-
+  const char* bytes_start = static_cast<const char*>(message_view.bytes());
+  const char* bytes_end = bytes_start + message_view.num_bytes();
   if (started_transport_.Try()) {
     // We're not in the middle of being sent.
 
@@ -399,16 +410,20 @@
       locker.reset(new base::AutoLock(lock()));
     }
 
-    size_t old_size = data_.size();
-    data_.resize(old_size + message->num_bytes());
-    memcpy(&data_[old_size], message->bytes(), message->num_bytes());
-    if (!old_size)
-      awakable_list_.AwakeForStateChange(GetHandleSignalsStateImplNoLock());
+    if (in_two_phase_read_) {
+      data_received_during_two_phase_read_.insert(
+          data_received_during_two_phase_read_.end(), bytes_start, bytes_end);
+    } else {
+      bool was_empty = data_.empty();
+      data_.insert(data_.end(), bytes_start, bytes_end);
+      if (was_empty)
+        awakable_list_.AwakeForStateChange(GetHandleSignalsStateImplNoLock());
+    }
     started_transport_.Release();
   } else {
-    size_t old_size = data_.size();
-    data_.resize(old_size + message->num_bytes());
-    memcpy(&data_[old_size], message->bytes(), message->num_bytes());
+    // See comment in MessagePipeDispatcher about why we can't and don't need
+    // to lock here.
+    data_.insert(data_.end(), bytes_start, bytes_end);
   }
 }
 
@@ -451,6 +466,7 @@
 }
 
 void DataPipeConsumerDispatcher::SerializeInternal() {
+  DCHECK(!in_two_phase_read_);
   // We need to stop watching handle immediately, even though not on IO thread,
   // so that other messages aren't read after this.
   if (channel_) {
@@ -461,8 +477,9 @@
     CHECK(serialized_write_buffer.empty());
 
     channel_ = nullptr;
-    serialized_ = true;
   }
+
+  serialized_ = true;
 }
 
 }  // namespace edk
diff --git a/mojo/edk/system/data_pipe_consumer_dispatcher.h b/mojo/edk/system/data_pipe_consumer_dispatcher.h
index 6a55d83..7c09346 100644
--- a/mojo/edk/system/data_pipe_consumer_dispatcher.h
+++ b/mojo/edk/system/data_pipe_consumer_dispatcher.h
@@ -102,6 +102,9 @@
 
   bool in_two_phase_read_;
   uint32_t two_phase_max_bytes_read_;
+  // If we get data from the channel while we're in two-phase read, we can't
+  // resize data_ since it's being used. So instead we store it temporarly.
+  std::vector<char> data_received_during_two_phase_read_;
 
   bool error_;
 
diff --git a/mojo/edk/system/data_pipe_producer_dispatcher.cc b/mojo/edk/system/data_pipe_producer_dispatcher.cc
index 3a579c8..4ae4ba8 100644
--- a/mojo/edk/system/data_pipe_producer_dispatcher.cc
+++ b/mojo/edk/system/data_pipe_producer_dispatcher.cc
@@ -81,7 +81,7 @@
 
 DataPipeProducerDispatcher::DataPipeProducerDispatcher(
     const MojoCreateDataPipeOptions& options)
-    : options_(options), channel_(nullptr), error_(false) {
+    : options_(options), channel_(nullptr), error_(false), serialized_(false) {
 }
 
 DataPipeProducerDispatcher::~DataPipeProducerDispatcher() {
@@ -104,10 +104,12 @@
 DataPipeProducerDispatcher::CreateEquivalentDispatcherAndCloseImplNoLock() {
   lock().AssertAcquired();
 
+  SerializeInternal();
+
   scoped_refptr<DataPipeProducerDispatcher> rv = Create(options_);
-  rv->channel_ = channel_;
-  channel_ = nullptr;
-  rv->options_ = options_;
+  serialized_write_buffer_.swap(rv->serialized_write_buffer_);
+  rv->serialized_platform_handle_ = serialized_platform_handle_.Pass();
+  rv->serialized_ = true;
   return scoped_refptr<Dispatcher>(rv.get());
 }
 
@@ -256,14 +258,9 @@
     size_t* max_size,
     size_t* max_platform_handles) {
   DCHECK(HasOneRef());  // Only one ref => no need to take the lock.
+  if (!serialized_)
+    SerializeInternal();
 
-  if (channel_) {
-    std::vector<char> serialized_read_buffer;
-    serialized_platform_handle_ = channel_->ReleaseHandle(
-        &serialized_read_buffer, &serialized_write_buffer_);
-    channel_ = nullptr;
-    CHECK(serialized_read_buffer.empty());
-  }
   DataPipe::StartSerialize(serialized_platform_handle_.is_valid(),
                            !serialized_write_buffer_.empty(), max_size,
                            max_platform_handles);
@@ -378,5 +375,18 @@
   return true;
 }
 
+void DataPipeProducerDispatcher::SerializeInternal() {
+  // We need to stop watching handle immediately, even though not on IO thread,
+  // so that other messages aren't read after this.
+  if (channel_) {
+    std::vector<char> serialized_read_buffer;
+    serialized_platform_handle_ = channel_->ReleaseHandle(
+        &serialized_read_buffer, &serialized_write_buffer_);
+    CHECK(serialized_read_buffer.empty());
+    channel_ = nullptr;
+  }
+  serialized_ = true;
+}
+
 }  // namespace edk
 }  // namespace mojo
diff --git a/mojo/edk/system/data_pipe_producer_dispatcher.h b/mojo/edk/system/data_pipe_producer_dispatcher.h
index d8c86e4..daf038b 100644
--- a/mojo/edk/system/data_pipe_producer_dispatcher.h
+++ b/mojo/edk/system/data_pipe_producer_dispatcher.h
@@ -85,6 +85,9 @@
   bool InTwoPhaseWrite() const;
   bool WriteDataIntoMessages(const void* elements, uint32_t num_bytes);
 
+  // See comment in MessagePipeDispatcher for this method.
+  void SerializeInternal();
+
   MojoCreateDataPipeOptions options_;
 
   // Protected by |lock()|:
@@ -98,6 +101,7 @@
 
   bool error_;
 
+  bool serialized_;
   ScopedPlatformHandle serialized_platform_handle_;
   std::vector<char> serialized_write_buffer_;
   std::vector<char> two_phase_data_;
diff --git a/mojo/edk/system/data_pipe_unittest.cc b/mojo/edk/system/data_pipe_unittest.cc
index bfb3aef..d32f73fe 100644
--- a/mojo/edk/system/data_pipe_unittest.cc
+++ b/mojo/edk/system/data_pipe_unittest.cc
@@ -15,6 +15,7 @@
 #include "mojo/edk/system/waiter.h"
 #include "mojo/public/c/system/data_pipe.h"
 #include "mojo/public/c/system/functions.h"
+#include "mojo/public/c/system/message_pipe.h"
 #include "mojo/public/cpp/system/macros.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
@@ -1293,13 +1294,72 @@
   const void* read_buffer_ptr = nullptr;
   num_bytes = 0u;
   ASSERT_EQ(MOJO_RESULT_FAILED_PRECONDITION,
-            ReadData(&read_buffer_ptr, &num_bytes));
+            BeginReadData(&read_buffer_ptr, &num_bytes));
 
   // Ditto for discard.
   num_bytes = 10u;
   ASSERT_EQ(MOJO_RESULT_FAILED_PRECONDITION, DiscardData(&num_bytes));
 }
 
+// Test that during a two phase read the memory stays valid even if more data
+// comes in.
+TEST_F(DataPipeTest, TwoPhaseReadMemoryStable) {
+  const char kTestData[] = "hello world";
+  const uint32_t kTestDataSize = static_cast<uint32_t>(sizeof(kTestData));
+
+  const MojoCreateDataPipeOptions options = {
+      kSizeOfOptions,                           // |struct_size|.
+      MOJO_CREATE_DATA_PIPE_OPTIONS_FLAG_NONE,  // |flags|.
+      1u,                                       // |element_num_bytes|.
+      1000u                                     // |capacity_num_bytes|.
+  };
+  ASSERT_EQ(MOJO_RESULT_OK, Create(&options));
+  MojoHandleSignalsState hss;
+
+  // Write some data.
+  uint32_t num_bytes = kTestDataSize;
+  ASSERT_EQ(MOJO_RESULT_OK, WriteData(kTestData, &num_bytes));
+  ASSERT_EQ(kTestDataSize, num_bytes);
+
+  // Wait for the data.
+  hss = MojoHandleSignalsState();
+  ASSERT_EQ(MOJO_RESULT_OK,
+            MojoWait(consumer_, MOJO_HANDLE_SIGNAL_READABLE,
+                     MOJO_DEADLINE_INDEFINITE, &hss));
+  ASSERT_EQ(MOJO_HANDLE_SIGNAL_READABLE, hss.satisfied_signals);
+  ASSERT_EQ(MOJO_HANDLE_SIGNAL_READABLE | MOJO_HANDLE_SIGNAL_PEER_CLOSED,
+            hss.satisfiable_signals);
+
+  // Begin a two-phase read.
+  const void* read_buffer_ptr = nullptr;
+  uint32_t read_buffer_size = 0u;
+  ASSERT_EQ(MOJO_RESULT_OK, BeginReadData(&read_buffer_ptr, &read_buffer_size));
+
+  // Write more data.
+  const char kExtraData[] = "bye world";
+  const uint32_t kExtraDataSize = static_cast<uint32_t>(sizeof(kExtraData));
+  num_bytes = kExtraDataSize;
+  ASSERT_EQ(MOJO_RESULT_OK, WriteData(kExtraData, &num_bytes));
+  ASSERT_EQ(kExtraDataSize, num_bytes);
+
+  // Close the producer.
+  CloseProducer();
+
+  // Wait. (Note that once the consumer knows that the producer is closed, it
+  // must also have received the extra data).
+  hss = MojoHandleSignalsState();
+  ASSERT_EQ(MOJO_RESULT_OK,
+            MojoWait(consumer_, MOJO_HANDLE_SIGNAL_PEER_CLOSED,
+                     MOJO_DEADLINE_INDEFINITE, &hss));
+  ASSERT_EQ(MOJO_HANDLE_SIGNAL_PEER_CLOSED, hss.satisfied_signals);
+  ASSERT_EQ(MOJO_HANDLE_SIGNAL_READABLE | MOJO_HANDLE_SIGNAL_PEER_CLOSED,
+            hss.satisfiable_signals);
+
+  // Read the two phase memory to check it's still valid.
+  ASSERT_EQ(0, memcmp(read_buffer_ptr, kTestData, kTestDataSize));
+  EndReadData(read_buffer_size);
+}
+
 // Test that two-phase reads/writes behave correctly when given invalid
 // arguments.
 TEST_F(DataPipeTest, TwoPhaseMoreInvalidArguments) {
@@ -1422,6 +1482,149 @@
   ASSERT_EQ(1u * sizeof(int32_t), num_bytes);
 }
 
+// Test that a producer can be sent over a MP.
+TEST_F(DataPipeTest, SendProducer) {
+  const char kTestData[] = "hello world";
+  const uint32_t kTestDataSize = static_cast<uint32_t>(sizeof(kTestData));
+
+  const MojoCreateDataPipeOptions options = {
+      kSizeOfOptions,                           // |struct_size|.
+      MOJO_CREATE_DATA_PIPE_OPTIONS_FLAG_NONE,  // |flags|.
+      1u,                                       // |element_num_bytes|.
+      1000u                                     // |capacity_num_bytes|.
+  };
+  ASSERT_EQ(MOJO_RESULT_OK, Create(&options));
+  MojoHandleSignalsState hss;
+
+  // Write some data.
+  uint32_t num_bytes = kTestDataSize;
+  ASSERT_EQ(MOJO_RESULT_OK, WriteData(kTestData, &num_bytes));
+  ASSERT_EQ(kTestDataSize, num_bytes);
+
+  // Wait for the data.
+  hss = MojoHandleSignalsState();
+  ASSERT_EQ(MOJO_RESULT_OK,
+            MojoWait(consumer_, MOJO_HANDLE_SIGNAL_READABLE,
+                     MOJO_DEADLINE_INDEFINITE, &hss));
+  ASSERT_EQ(MOJO_HANDLE_SIGNAL_READABLE, hss.satisfied_signals);
+  ASSERT_EQ(MOJO_HANDLE_SIGNAL_READABLE | MOJO_HANDLE_SIGNAL_PEER_CLOSED,
+            hss.satisfiable_signals);
+
+  // Check the data.
+  const void* read_buffer = nullptr;
+  num_bytes = 0u;
+  ASSERT_EQ(MOJO_RESULT_OK,
+            BeginReadData(&read_buffer, &num_bytes, false));
+  ASSERT_EQ(0, memcmp(read_buffer, kTestData, kTestDataSize));
+  EndReadData(num_bytes);
+
+  // Now send the producer over a MP so that it's serialized.
+  MojoHandle pipe0, pipe1;
+  ASSERT_EQ(MOJO_RESULT_OK,
+            MojoCreateMessagePipe(nullptr, &pipe0, &pipe1));
+
+  ASSERT_EQ(MOJO_RESULT_OK,
+            MojoWriteMessage(pipe0, nullptr, 0, &producer_, 1,
+                             MOJO_WRITE_MESSAGE_FLAG_NONE));
+  producer_ = MOJO_HANDLE_INVALID;
+  ASSERT_EQ(MOJO_RESULT_OK, MojoWait(pipe1, MOJO_HANDLE_SIGNAL_READABLE,
+                                     MOJO_DEADLINE_INDEFINITE, &hss));
+  uint32_t num_handles = 1;
+  ASSERT_EQ(MOJO_RESULT_OK,
+            MojoReadMessage(pipe1, nullptr, 0, &producer_, &num_handles,
+                            MOJO_READ_MESSAGE_FLAG_NONE));
+  ASSERT_EQ(num_handles, 1u);
+
+  // Write more data.
+  const char kExtraData[] = "bye world";
+  const uint32_t kExtraDataSize = static_cast<uint32_t>(sizeof(kExtraData));
+  num_bytes = kExtraDataSize;
+  ASSERT_EQ(MOJO_RESULT_OK, WriteData(kExtraData, &num_bytes));
+  ASSERT_EQ(kExtraDataSize, num_bytes);
+
+  // Wait for it.
+  hss = MojoHandleSignalsState();
+  ASSERT_EQ(MOJO_RESULT_OK,
+            MojoWait(consumer_, MOJO_HANDLE_SIGNAL_READABLE,
+                     MOJO_DEADLINE_INDEFINITE, &hss));
+  ASSERT_EQ(MOJO_HANDLE_SIGNAL_READABLE, hss.satisfied_signals);
+  ASSERT_EQ(MOJO_HANDLE_SIGNAL_READABLE | MOJO_HANDLE_SIGNAL_PEER_CLOSED,
+            hss.satisfiable_signals);
+
+  // Check the second write.
+  num_bytes = 0u;
+  ASSERT_EQ(MOJO_RESULT_OK,
+            BeginReadData(&read_buffer, &num_bytes, false));
+  ASSERT_EQ(0, memcmp(read_buffer, kExtraData, kExtraDataSize));
+  EndReadData(num_bytes);
+
+  ASSERT_EQ(MOJO_RESULT_OK, MojoClose(pipe0));
+  ASSERT_EQ(MOJO_RESULT_OK, MojoClose(pipe1));
+}
+
+// Ensures that if a data pipe consumer whose producer has closed is passed over
+// a message pipe, the deserialized dispatcher is also marked as having a closed
+// peer.
+TEST_F(DataPipeTest, ConsumerWithClosedProducerSent) {
+  const MojoCreateDataPipeOptions options = {
+      kSizeOfOptions,                           // |struct_size|.
+      MOJO_CREATE_DATA_PIPE_OPTIONS_FLAG_NONE,  // |flags|.
+      static_cast<uint32_t>(sizeof(int32_t)),   // |element_num_bytes|.
+      1000 * sizeof(int32_t)                    // |capacity_num_bytes|.
+  };
+
+  ASSERT_EQ(MOJO_RESULT_OK, Create(&options));
+
+  // We can write to a data pipe handle immediately.
+  int32_t data = 123;
+  uint32_t num_bytes = sizeof(data);
+  ASSERT_EQ(MOJO_RESULT_OK, WriteData(&data, &num_bytes));
+  ASSERT_EQ(MOJO_RESULT_OK, CloseProducer());
+
+  // Now wait for the other side to become readable and to see the peer closed.
+  MojoHandleSignalsState state;
+  ASSERT_EQ(MOJO_RESULT_OK,
+            MojoWait(consumer_, MOJO_HANDLE_SIGNAL_PEER_CLOSED,
+                     MOJO_DEADLINE_INDEFINITE, &state));
+  ASSERT_EQ(MOJO_HANDLE_SIGNAL_READABLE | MOJO_HANDLE_SIGNAL_PEER_CLOSED,
+            state.satisfied_signals);
+  ASSERT_EQ(MOJO_HANDLE_SIGNAL_READABLE | MOJO_HANDLE_SIGNAL_PEER_CLOSED,
+            state.satisfiable_signals);
+
+  // Now send the consumer over a MP so that it's serialized.
+  MojoHandle pipe0, pipe1;
+  ASSERT_EQ(MOJO_RESULT_OK,
+            MojoCreateMessagePipe(nullptr, &pipe0, &pipe1));
+
+  ASSERT_EQ(MOJO_RESULT_OK,
+            MojoWriteMessage(pipe0, nullptr, 0, &consumer_, 1,
+                             MOJO_WRITE_MESSAGE_FLAG_NONE));
+  consumer_ = MOJO_HANDLE_INVALID;
+  ASSERT_EQ(MOJO_RESULT_OK, MojoWait(pipe1, MOJO_HANDLE_SIGNAL_READABLE,
+                                     MOJO_DEADLINE_INDEFINITE, &state));
+  uint32_t num_handles = 1;
+  ASSERT_EQ(MOJO_RESULT_OK,
+            MojoReadMessage(pipe1, nullptr, 0, &consumer_, &num_handles,
+                            MOJO_READ_MESSAGE_FLAG_NONE));
+  ASSERT_EQ(num_handles, 1u);
+
+  ASSERT_EQ(MOJO_RESULT_OK,
+            MojoWait(consumer_, MOJO_HANDLE_SIGNAL_PEER_CLOSED,
+                     MOJO_DEADLINE_INDEFINITE, &state));
+  ASSERT_EQ(MOJO_HANDLE_SIGNAL_READABLE | MOJO_HANDLE_SIGNAL_PEER_CLOSED,
+            state.satisfied_signals);
+  ASSERT_EQ(MOJO_HANDLE_SIGNAL_READABLE | MOJO_HANDLE_SIGNAL_PEER_CLOSED,
+            state.satisfiable_signals);
+
+  uint32 read_data;
+  ASSERT_EQ(MOJO_RESULT_OK, ReadData(&read_data, &num_bytes));
+  ASSERT_EQ(sizeof(read_data), num_bytes);
+  ASSERT_EQ(data, read_data);
+
+  ASSERT_EQ(MOJO_RESULT_OK, MojoClose(pipe0));
+  ASSERT_EQ(MOJO_RESULT_OK, MojoClose(pipe1));
+}
+
 }  // namespace
 }  // namespace edk
 }  // namespace mojo
diff --git a/mojo/edk/system/message_pipe_dispatcher.cc b/mojo/edk/system/message_pipe_dispatcher.cc
index 1af5b4d..e3bc13b 100644
--- a/mojo/edk/system/message_pipe_dispatcher.cc
+++ b/mojo/edk/system/message_pipe_dispatcher.cc
@@ -348,12 +348,8 @@
   }
 
   DCHECK(serialized_message_queue_.empty());
-  // see comment in method below, this is only temporary till we implement a
-  // solution with shared buffer
   while (!message_queue_.IsEmpty()) {
     scoped_ptr<MessageInTransit> message = message_queue_.GetMessage();
-    size_t cur_size = serialized_message_queue_.size();
-
 
     // When MojoWriteMessage is called, the MessageInTransit doesn't have
     // dispatchers set and CreateEquivaent... is called since the dispatchers
@@ -371,15 +367,14 @@
     message->SerializeAndCloseDispatchers();
     // cont'd below
 
-
     size_t main_buffer_size = message->main_buffer_size();
     size_t transport_data_buffer_size = message->transport_data() ?
         message->transport_data()->buffer_size() : 0;
-    size_t total_size = message->total_size();
 
-    serialized_message_queue_.resize(cur_size + total_size);
-    memcpy(&serialized_message_queue_[cur_size], message->main_buffer(),
-           main_buffer_size);
+    serialized_message_queue_.insert(
+        serialized_message_queue_.end(),
+        static_cast<const char*>(message->main_buffer()),
+        static_cast<const char*>(message->main_buffer()) + main_buffer_size);
 
     // cont'd
     if (transport_data_buffer_size != 0) {
@@ -404,9 +399,11 @@
         }
       }
 
-      memcpy(&serialized_message_queue_[
-                 cur_size + total_size - transport_data_buffer_size],
-             message->transport_data()->buffer(), transport_data_buffer_size);
+      serialized_message_queue_.insert(
+          serialized_message_queue_.end(),
+          static_cast<const char*>(message->transport_data()->buffer()),
+          static_cast<const char*>(message->transport_data()->buffer()) +
+              transport_data_buffer_size);
 #else
       NOTREACHED() << "TODO(jam) implement";
 #endif
diff --git a/mojo/edk/system/raw_channel.cc b/mojo/edk/system/raw_channel.cc
index 5ba9a6e..819762b3 100644
--- a/mojo/edk/system/raw_channel.cc
+++ b/mojo/edk/system/raw_channel.cc
@@ -481,10 +481,8 @@
     std::vector<WriteBuffer::Buffer> buffers;
     write_buffer_no_lock()->GetBuffers(&buffers);
     for (size_t i = 0; i < buffers.size(); ++i) {
-      size_t orig_size = buffer->size();
-      buffer->resize(orig_size + buffers[i].size);
-      memcpy(&((*buffer)[orig_size]), buffers[i].addr,
-              buffers[i].size);
+      buffer->insert(buffer->end(), buffers[i].addr,
+                     buffers[i].addr + buffers[i].size);
     }
     write_buffer_->message_queue_.DiscardMessage();
   }
diff --git a/net/cert/cert_policy_enforcer_unittest.cc b/net/cert/cert_policy_enforcer_unittest.cc
index 8a6b0675..2facbc2 100644
--- a/net/cert/cert_policy_enforcer_unittest.cc
+++ b/net/cert/cert_policy_enforcer_unittest.cc
@@ -49,8 +49,8 @@
 const char kGoogleAviatorLogID[] =
     "\x68\xf6\x98\xf8\x1f\x64\x82\xbe\x3a\x8c\xee\xb9\x28\x1d\x4c\xfc\x71\x51"
     "\x5d\x67\x93\xd4\x44\xd1\x0a\x67\xac\xbb\x4f\x4f\xfb\xc4";
-COMPILE_ASSERT(arraysize(kGoogleAviatorLogID) - 1 == crypto::kSHA256Length,
-               "Incorrect log ID length.");
+static_assert(arraysize(kGoogleAviatorLogID) - 1 == crypto::kSHA256Length,
+              "Incorrect log ID length.");
 
 class CertPolicyEnforcerTest : public ::testing::Test {
  public:
diff --git a/net/cert_net/cert_net_fetcher_impl_unittest.cc b/net/cert_net/cert_net_fetcher_impl_unittest.cc
index 16988557e..e3337a0 100644
--- a/net/cert_net/cert_net_fetcher_impl_unittest.cc
+++ b/net/cert_net/cert_net_fetcher_impl_unittest.cc
@@ -49,12 +49,11 @@
     params.proxy_service = proxy_service();
     params.ssl_config_service = ssl_config_service();
     params.http_server_properties = http_server_properties();
-    scoped_refptr<HttpNetworkSession> network_session(
-        new HttpNetworkSession(params));
-    storage_.set_http_transaction_factory(
-        make_scoped_ptr(new HttpCache(network_session.get(),
-                                      HttpCache::DefaultBackend::InMemory(0)))
-            .Pass());
+    storage_.set_http_network_session(
+        make_scoped_ptr(new HttpNetworkSession(params)));
+    storage_.set_http_transaction_factory(make_scoped_ptr(new HttpCache(
+        storage_.http_network_session(), HttpCache::DefaultBackend::InMemory(0),
+        false /* set_up_quic_server_info */)));
     storage_.set_job_factory(make_scoped_ptr(new URLRequestJobFactoryImpl()));
   }
 
diff --git a/net/http/http_cache.cc b/net/http/http_cache.cc
index b3a6b2c..7494b862 100644
--- a/net/http/http_cache.cc
+++ b/net/http/http_cache.cc
@@ -294,39 +294,20 @@
 };
 
 //-----------------------------------------------------------------------------
-HttpCache::HttpCache(const HttpNetworkSession::Params& params,
-                     BackendFactory* backend_factory)
-    : net_log_(params.net_log),
-      backend_factory_(backend_factory),
-      building_backend_(false),
-      bypass_lock_for_test_(false),
-      fail_conditionalization_for_test_(false),
-      mode_(NORMAL),
-      network_layer_(new HttpNetworkLayer(new HttpNetworkSession(params))),
-      clock_(new base::DefaultClock()),
-      weak_factory_(this) {
-  SetupQuicServerInfoFactory(network_layer_->GetSession());
-}
-
-
 // This call doesn't change the shared |session|'s QuicServerInfoFactory because
 // |session| is shared.
 HttpCache::HttpCache(HttpNetworkSession* session,
-                     BackendFactory* backend_factory)
-    : net_log_(session->net_log()),
-      backend_factory_(backend_factory),
-      building_backend_(false),
-      bypass_lock_for_test_(false),
-      fail_conditionalization_for_test_(false),
-      mode_(NORMAL),
-      network_layer_(new HttpNetworkLayer(session)),
-      clock_(new base::DefaultClock()),
-      weak_factory_(this) {
-}
+                     BackendFactory* backend_factory,
+                     bool set_up_quic_server_info)
+    : HttpCache(new HttpNetworkLayer(session),
+                session->net_log(),
+                backend_factory,
+                set_up_quic_server_info) {}
 
 HttpCache::HttpCache(HttpTransactionFactory* network_layer,
                      NetLog* net_log,
-                     BackendFactory* backend_factory)
+                     BackendFactory* backend_factory,
+                     bool set_up_quic_server_info)
     : net_log_(net_log),
       backend_factory_(backend_factory),
       building_backend_(false),
@@ -336,7 +317,8 @@
       network_layer_(network_layer),
       clock_(new base::DefaultClock()),
       weak_factory_(this) {
-  SetupQuicServerInfoFactory(network_layer_->GetSession());
+  if (set_up_quic_server_info)
+    SetupQuicServerInfoFactory(network_layer_->GetSession());
 }
 
 HttpCache::~HttpCache() {
diff --git a/net/http/http_cache.h b/net/http/http_cache.h
index 6c58e3aa2..d504941 100644
--- a/net/http/http_cache.h
+++ b/net/http/http_cache.h
@@ -126,23 +126,26 @@
   static const int kPrefetchReuseMins = 5;
 
   // The disk cache is initialized lazily (by CreateTransaction) in this case.
-  // The HttpCache takes ownership of the |backend_factory|.
-  HttpCache(const HttpNetworkSession::Params& params,
-            BackendFactory* backend_factory);
-
-  // The disk cache is initialized lazily (by CreateTransaction) in this case.
   // Provide an existing HttpNetworkSession, the cache can construct a
   // network layer with a shared HttpNetworkSession in order for multiple
   // network layers to share information (e.g. authentication data). The
   // HttpCache takes ownership of the |backend_factory|.
-  HttpCache(HttpNetworkSession* session, BackendFactory* backend_factory);
+  //
+  // The HttpCache must be destroyed before the HttpNetworkSession.
+  //
+  // If |set_up_quic_server_info| is true, configures the cache to track
+  // information about servers supporting QUIC.
+  HttpCache(HttpNetworkSession* session,
+            BackendFactory* backend_factory,
+            bool set_up_quic_server_info);
 
   // Initialize the cache from its component parts. The lifetime of the
   // |network_layer| and |backend_factory| are managed by the HttpCache and
   // will be destroyed using |delete| when the HttpCache is destroyed.
   HttpCache(HttpTransactionFactory* network_layer,
             NetLog* net_log,
-            BackendFactory* backend_factory);
+            BackendFactory* backend_factory,
+            bool set_up_quic_server_info);
 
   ~HttpCache() override;
 
diff --git a/net/http/http_network_layer.cc b/net/http/http_network_layer.cc
index 8e6b35cb..169a1cc1 100644
--- a/net/http/http_network_layer.cc
+++ b/net/http/http_network_layer.cc
@@ -22,11 +22,11 @@
 HttpNetworkLayer::HttpNetworkLayer(HttpNetworkSession* session)
     : session_(session),
       suspended_(false) {
-  DCHECK(session_.get());
+  DCHECK(session_);
 #if defined(OS_WIN)
- base::PowerMonitor* power_monitor = base::PowerMonitor::Get();
- if (power_monitor)
-   power_monitor->AddObserver(this);
+  base::PowerMonitor* power_monitor = base::PowerMonitor::Get();
+  if (power_monitor)
+    power_monitor->AddObserver(this);
 #endif
 }
 
@@ -51,13 +51,13 @@
   return NULL;
 }
 
-HttpNetworkSession* HttpNetworkLayer::GetSession() { return session_.get(); }
+HttpNetworkSession* HttpNetworkLayer::GetSession() {
+  return session_;
+}
 
 void HttpNetworkLayer::OnSuspend() {
   suspended_ = true;
-
-  if (session_.get())
-    session_->CloseIdleConnections();
+  session_->CloseIdleConnections();
 }
 
 void HttpNetworkLayer::OnResume() {
diff --git a/net/http/http_network_layer.h b/net/http/http_network_layer.h
index 5ade926..89ff8eb 100644
--- a/net/http/http_network_layer.h
+++ b/net/http/http_network_layer.h
@@ -26,7 +26,8 @@
       NON_EXPORTED_BASE(public base::NonThreadSafe) {
  public:
   // Construct a HttpNetworkLayer with an existing HttpNetworkSession which
-  // contains a valid ProxyService.
+  // contains a valid ProxyService. The HttpNetworkLayer must be destroyed
+  // before |session|.
   explicit HttpNetworkLayer(HttpNetworkSession* session);
   ~HttpNetworkLayer() override;
 
@@ -41,7 +42,7 @@
   void OnResume() override;
 
  private:
-  const scoped_refptr<HttpNetworkSession> session_;
+  HttpNetworkSession* const session_;
   bool suspended_;
 
   DISALLOW_COPY_AND_ASSIGN(HttpNetworkLayer);
diff --git a/net/http/http_network_layer_unittest.cc b/net/http/http_network_layer_unittest.cc
index 153423e..7840902 100644
--- a/net/http/http_network_layer_unittest.cc
+++ b/net/http/http_network_layer_unittest.cc
@@ -45,7 +45,7 @@
     session_params.ssl_config_service = ssl_config_service_.get();
     session_params.http_server_properties =
         http_server_properties_.GetWeakPtr();
-    network_session_ = new HttpNetworkSession(session_params);
+    network_session_.reset(new HttpNetworkSession(session_params));
     factory_.reset(new HttpNetworkLayer(network_session_.get()));
   }
 
@@ -259,7 +259,7 @@
   scoped_ptr<TransportSecurityState> transport_security_state_;
   scoped_ptr<ProxyService> proxy_service_;
   const scoped_refptr<SSLConfigService> ssl_config_service_;
-  scoped_refptr<HttpNetworkSession> network_session_;
+  scoped_ptr<HttpNetworkSession> network_session_;
   scoped_ptr<HttpNetworkLayer> factory_;
   HttpServerPropertiesImpl http_server_properties_;
 };
diff --git a/net/http/http_network_session.h b/net/http/http_network_session.h
index a587acf..27ed595 100644
--- a/net/http/http_network_session.h
+++ b/net/http/http_network_session.h
@@ -57,8 +57,7 @@
 
 // This class holds session objects used by HttpNetworkTransaction objects.
 class NET_EXPORT HttpNetworkSession
-    : public base::RefCounted<HttpNetworkSession>,
-      NON_EXPORTED_BASE(public base::NonThreadSafe) {
+    : NON_EXPORTED_BASE(public base::NonThreadSafe) {
  public:
   struct NET_EXPORT Params {
     Params();
@@ -142,6 +141,7 @@
   };
 
   explicit HttpNetworkSession(const Params& params);
+  ~HttpNetworkSession();
 
   HttpAuthCache* http_auth_cache() { return &http_auth_cache_; }
   SSLClientAuthCache* ssl_client_auth_cache() {
@@ -214,11 +214,8 @@
   bool HasSpdyExclusion(HostPortPair host_port_pair) const;
 
  private:
-  friend class base::RefCounted<HttpNetworkSession>;
   friend class HttpNetworkSessionPeer;
 
-  ~HttpNetworkSession();
-
   ClientSocketPoolManager* GetSocketPoolManager(SocketPoolType pool_type);
 
   NetLog* const net_log_;
diff --git a/net/http/http_network_session_peer.cc b/net/http/http_network_session_peer.cc
index a32e48b..a5fb8a5 100644
--- a/net/http/http_network_session_peer.cc
+++ b/net/http/http_network_session_peer.cc
@@ -14,8 +14,7 @@
 
 namespace net {
 
-HttpNetworkSessionPeer::HttpNetworkSessionPeer(
-    const scoped_refptr<HttpNetworkSession>& session)
+HttpNetworkSessionPeer::HttpNetworkSessionPeer(HttpNetworkSession* session)
     : session_(session) {}
 
 HttpNetworkSessionPeer::~HttpNetworkSessionPeer() {}
diff --git a/net/http/http_network_session_peer.h b/net/http/http_network_session_peer.h
index 755e539c..ae57f39 100644
--- a/net/http/http_network_session_peer.h
+++ b/net/http/http_network_session_peer.h
@@ -18,8 +18,8 @@
 
 class NET_EXPORT_PRIVATE HttpNetworkSessionPeer {
  public:
-  explicit HttpNetworkSessionPeer(
-      const scoped_refptr<HttpNetworkSession>& session);
+  // |session| should outlive the HttpNetworkSessionPeer.
+  explicit HttpNetworkSessionPeer(HttpNetworkSession* session);
   ~HttpNetworkSessionPeer();
 
   void SetClientSocketPoolManager(
@@ -32,7 +32,7 @@
       scoped_ptr<HttpStreamFactory> http_stream_factory_for_websocket);
 
  private:
-  const scoped_refptr<HttpNetworkSession> session_;
+  HttpNetworkSession* const session_;
 
   DISALLOW_COPY_AND_ASSIGN(HttpNetworkSessionPeer);
 };
diff --git a/net/http/http_network_transaction_ssl_unittest.cc b/net/http/http_network_transaction_ssl_unittest.cc
index da28d9cd7..82b905d 100644
--- a/net/http/http_network_transaction_ssl_unittest.cc
+++ b/net/http/http_network_transaction_ssl_unittest.cc
@@ -127,16 +127,14 @@
   StaticSocketDataProvider data3(NULL, 0, NULL, 0);
   mock_socket_factory_.AddSocketDataProvider(&data3);
 
-  scoped_refptr<HttpNetworkSession> session(
-      new HttpNetworkSession(session_params_));
-  scoped_ptr<HttpNetworkTransaction> trans(
-      new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get()));
+  HttpNetworkSession session(session_params_);
+  HttpNetworkTransaction trans(DEFAULT_PRIORITY, &session);
 
   TestCompletionCallback callback;
   // This will consume |ssl_data1|, |ssl_data2| and |ssl_data3|.
-  int rv = callback.GetResult(
-      trans->Start(GetRequestInfo("https://www.paypal.com/"),
-                   callback.callback(), BoundNetLog()));
+  int rv =
+      callback.GetResult(trans.Start(GetRequestInfo("https://www.paypal.com/"),
+                                     callback.callback(), BoundNetLog()));
   EXPECT_EQ(ERR_SSL_PROTOCOL_ERROR, rv);
 
   SocketDataProviderArray<SocketDataProvider>& mock_data =
@@ -144,7 +142,7 @@
   // Confirms that |ssl_data1|, |ssl_data2| and |ssl_data3| are consumed.
   EXPECT_EQ(3u, mock_data.next_index());
 
-  SSLConfig& ssl_config = GetServerSSLConfig(trans.get());
+  SSLConfig& ssl_config = GetServerSSLConfig(&trans);
   // |version_max| fallbacks to TLS 1.0.
   EXPECT_EQ(SSL_PROTOCOL_VERSION_TLS1, ssl_config.version_max);
   EXPECT_TRUE(ssl_config.version_fallback);
diff --git a/net/http/http_network_transaction_unittest.cc b/net/http/http_network_transaction_unittest.cc
index 670db0b6..2de6429 100644
--- a/net/http/http_network_transaction_unittest.cc
+++ b/net/http/http_network_transaction_unittest.cc
@@ -232,7 +232,8 @@
   headers->SetHeader("Sec-WebSocket-Key", "dGhlIHNhbXBsZSBub25jZQ==");
 }
 
-HttpNetworkSession* CreateSession(SpdySessionDependencies* session_deps) {
+scoped_ptr<HttpNetworkSession> CreateSession(
+    SpdySessionDependencies* session_deps) {
   return SpdySessionDependencies::SpdyCreateSession(session_deps);
 }
 
@@ -328,7 +329,7 @@
 
     BoundTestNetLog log;
     session_deps_.net_log = log.bound().net_log();
-    scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+    scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
     scoped_ptr<HttpTransaction> trans(
         new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get()));
 
@@ -679,7 +680,7 @@
 }  // namespace
 
 TEST_P(HttpNetworkTransactionTest, Basic) {
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
   scoped_ptr<HttpTransaction> trans(
       new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get()));
 }
@@ -1000,7 +1001,7 @@
   request.url = GURL("http://redirect.com/");
   request.load_flags = 0;
 
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
   scoped_ptr<HttpTransaction> trans(
       new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get()));
 
@@ -1045,7 +1046,7 @@
   request.url = GURL("http://www.example.org/");
   request.load_flags = 0;
 
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
   scoped_ptr<HttpTransaction> trans(
       new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get()));
   BeforeProxyHeadersSentHandler proxy_headers_handler;
@@ -1105,7 +1106,7 @@
 }
 
 TEST_P(HttpNetworkTransactionTest, ReuseConnection) {
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
 
   MockRead data_reads[] = {
     MockRead("HTTP/1.1 200 OK\r\nContent-Length: 5\r\n\r\n"),
@@ -1163,7 +1164,7 @@
   request.upload_data_stream = &upload_data_stream;
   request.load_flags = 0;
 
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
   scoped_ptr<HttpTransaction> trans(
       new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get()));
 
@@ -1205,7 +1206,7 @@
   request.url = GURL("http://www.foo.com/");
   request.load_flags = 0;
 
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
   scoped_ptr<HttpTransaction> trans(
       new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get()));
 
@@ -1244,7 +1245,7 @@
   request.url = GURL("http://www.foo.com/");
   request.load_flags = 0;
 
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
   scoped_ptr<HttpTransaction> trans(
       new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get()));
 
@@ -1275,7 +1276,7 @@
   request.url = GURL("http://www.foo.com/");
   request.load_flags = 0;
 
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
   scoped_ptr<HttpTransaction> trans(
       new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get()));
 
@@ -1304,7 +1305,7 @@
 
   TestNetLog net_log;
   session_deps_.net_log = &net_log;
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
 
   // Written data for successfully sending both requests.
   MockWrite data1_writes[] = {
@@ -1394,7 +1395,7 @@
 
   TestNetLog net_log;
   session_deps_.net_log = &net_log;
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
 
   SSLSocketDataProvider ssl1(ASYNC, OK);
   SSLSocketDataProvider ssl2(ASYNC, OK);
@@ -1590,7 +1591,7 @@
   request.url = GURL("http://www.example.org/");
   request.load_flags = 0;
 
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
   scoped_ptr<HttpTransaction> trans(
       new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get()));
 
@@ -1644,7 +1645,7 @@
   request.url = GURL("http://www.example.org/");
   request.load_flags = 0;
 
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
   scoped_ptr<HttpTransaction> trans(
       new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get()));
 
@@ -1693,7 +1694,7 @@
   request.url = GURL("http://www.example.org/");
   request.load_flags = 0;
 
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
   scoped_ptr<HttpTransaction> trans(
       new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get()));
 
@@ -1724,7 +1725,7 @@
   request.url = GURL("http://www.example.org/");
   request.load_flags = 0;
 
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
   scoped_ptr<HttpTransaction> trans(
       new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get()));
 
@@ -1765,7 +1766,7 @@
   request.url = GURL("http://www.example.org/");
   request.load_flags = 0;
 
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
   scoped_ptr<HttpTransaction> trans(
       new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get()));
 
@@ -1807,7 +1808,7 @@
 
   TestNetLog net_log;
   session_deps_.net_log = &net_log;
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
 
   // Note that because all these reads happen in the same
   // StaticSocketDataProvider, it shows that the same socket is being reused for
@@ -1916,7 +1917,7 @@
 
   TestNetLog log;
   session_deps_.net_log = &log;
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
   scoped_ptr<HttpTransaction> trans(
       new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get()));
 
@@ -2027,7 +2028,7 @@
   MockHostResolver* resolver = new MockHostResolver();
   session_deps_.net_log = &log;
   session_deps_.host_resolver.reset(resolver);
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session = CreateSession(&session_deps_);
   scoped_ptr<HttpTransaction> trans(
       new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get()));
 
@@ -2137,7 +2138,7 @@
   request.url = GURL("http://www.example.org/");
   request.load_flags = LOAD_DO_NOT_SEND_AUTH_DATA;
 
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
   scoped_ptr<HttpTransaction> trans(
       new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get()));
 
@@ -2188,7 +2189,7 @@
 
   TestNetLog log;
   session_deps_.net_log = &log;
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
 
   MockWrite data_writes1[] = {
       MockWrite(
@@ -2291,7 +2292,7 @@
   request.url = GURL("http://www.example.org/");
   request.load_flags = 0;
 
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
 
   MockWrite data_writes1[] = {
       MockWrite(
@@ -2369,7 +2370,7 @@
   request.url = GURL("http://www.example.org/");
   request.load_flags = 0;
 
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
 
   MockWrite data_writes1[] = {
       MockWrite(
@@ -2455,7 +2456,7 @@
   request.url = GURL("http://www.example.org/");
   request.load_flags = 0;
 
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
 
   MockWrite data_writes1[] = {
       MockWrite(
@@ -2550,7 +2551,7 @@
       ProxyService::CreateFixedFromPacResult("PROXY myproxy:70");
   BoundTestNetLog log;
   session_deps_.net_log = log.bound().net_log();
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
 
   // Since we have proxy, should try to establish tunnel.
   MockWrite data_writes1[] = {
@@ -2674,7 +2675,7 @@
       ProxyService::CreateFixedFromPacResult("PROXY myproxy:70");
   BoundTestNetLog log;
   session_deps_.net_log = log.bound().net_log();
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
 
   // Since we have proxy, should try to establish tunnel.
   MockWrite data_writes1[] = {
@@ -2798,7 +2799,7 @@
   session_deps_.proxy_service = ProxyService::CreateFixed("myproxy:70");
   BoundTestNetLog log;
   session_deps_.net_log = log.bound().net_log();
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
 
   scoped_ptr<HttpTransaction> trans(
       new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get()));
@@ -2905,7 +2906,7 @@
   session_deps_.proxy_service = ProxyService::CreateFixed("myproxy:70");
   BoundTestNetLog log;
   session_deps_.net_log = log.bound().net_log();
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
 
   scoped_ptr<HttpTransaction> trans(
       new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get()));
@@ -3009,7 +3010,7 @@
 
   // Configure against proxy server "myproxy:70".
   session_deps_.proxy_service = ProxyService::CreateFixed("myproxy:70");
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session = CreateSession(&session_deps_);
 
   scoped_ptr<HttpTransaction> trans(
       new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get()));
@@ -3099,7 +3100,7 @@
   // Configure against proxy server "myproxy:70".
   session_deps_.proxy_service = ProxyService::CreateFixed("myproxy:70");
 
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
 
   scoped_ptr<HttpTransaction> trans(
       new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get()));
@@ -3159,7 +3160,7 @@
   // Configure against proxy server "myproxy:70".
   session_deps_.proxy_service = ProxyService::CreateFixed("myproxy:70");
 
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
 
   scoped_ptr<HttpTransaction> trans(
       new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get()));
@@ -3220,7 +3221,7 @@
   request.load_flags = 0;
 
   // We are using a DIRECT connection (i.e. no proxy) for this session.
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
   scoped_ptr<HttpTransaction> trans(
       new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get()));
 
@@ -3268,7 +3269,7 @@
   session_deps_.proxy_service = ProxyService::CreateFixed("myproxy:70");
   BoundTestNetLog log;
   session_deps_.net_log = log.bound().net_log();
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
 
   // Since we have proxy, should try to establish tunnel.
   MockWrite data_writes1[] = {
@@ -3343,7 +3344,7 @@
   // Add NetLog just so can verify load timing information gets a NetLog ID.
   NetLog net_log;
   session_deps_.net_log = &net_log;
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session = CreateSession(&session_deps_);
 
   // Since we have proxy, should try to establish tunnel.
   MockWrite data_writes1[] = {
@@ -3460,7 +3461,7 @@
   // Add NetLog just so can verify load timing information gets a NetLog ID.
   NetLog net_log;
   session_deps_.net_log = &net_log;
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session = CreateSession(&session_deps_);
 
   // Should try to establish tunnel.
   MockWrite data_writes1[] = {
@@ -3582,7 +3583,7 @@
   // Add NetLog just so can verify load timing information gets a NetLog ID.
   NetLog net_log;
   session_deps_.net_log = &net_log;
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session = CreateSession(&session_deps_);
 
   // Should try to establish tunnel.
   MockWrite data_writes1[] = {
@@ -3686,7 +3687,7 @@
   // Add NetLog just so can verify load timing information gets a NetLog ID.
   NetLog net_log;
   session_deps_.net_log = &net_log;
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session = CreateSession(&session_deps_);
 
   // Should try to establish tunnel.
   MockWrite data_writes1[] = {
@@ -3773,7 +3774,7 @@
   session_deps_.proxy_service = ProxyService::CreateFixed("PROXY myproxy:70");
   BoundTestNetLog log;
   session_deps_.net_log = log.bound().net_log();
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
 
   // Since we have proxy, should try to establish tunnel.
   MockWrite data_writes1[] = {
@@ -3874,7 +3875,7 @@
       ProxyService::CreateFixedFromPacResult("PROXY myproxy:70");
   BoundTestNetLog log;
   session_deps_.net_log = log.bound().net_log();
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
 
   // Since we have proxy, should try to establish tunnel.
   MockWrite data_writes1[] = {
@@ -3971,7 +3972,7 @@
   session_deps_.proxy_service = ProxyService::CreateFixed("https://proxy:70");
   BoundTestNetLog log;
   session_deps_.net_log = log.bound().net_log();
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
 
   // Since we have proxy, should use full url
   MockWrite data_writes1[] = {
@@ -4033,7 +4034,7 @@
   session_deps_.proxy_service = ProxyService::CreateFixed("https://proxy:70");
   BoundTestNetLog log;
   session_deps_.net_log = log.bound().net_log();
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
 
   // fetch http://www.example.org/ via SPDY
   scoped_ptr<SpdyFrame> req(
@@ -4093,7 +4094,7 @@
   session_deps_.proxy_service = ProxyService::CreateFixed("https://proxy:70");
   BoundTestNetLog log;
   session_deps_.net_log = log.bound().net_log();
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
 
   // Fetch http://www.example.org/ through the SPDY proxy.
   scoped_ptr<SpdyFrame> req(
@@ -4131,7 +4132,7 @@
   SpdySessionKey key(
       HostPortPair("proxy", 70), ProxyServer::Direct(), PRIVACY_MODE_DISABLED);
   base::WeakPtr<SpdySession> spdy_session =
-      CreateSecureSpdySession(session, key, log.bound());
+      CreateSecureSpdySession(session.get(), key, log.bound());
 
   // Unstall the resolution begun by the transaction.
   session_deps_.host_resolver->set_ondemand_mode(true);
@@ -4162,7 +4163,7 @@
   session_deps_.proxy_service = ProxyService::CreateFixed("https://myproxy:70");
   BoundTestNetLog log;
   session_deps_.net_log = log.bound().net_log();
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
 
   // The first request will be a bare GET, the second request will be a
   // GET with a Proxy-Authorization header.
@@ -4262,7 +4263,7 @@
   session_deps_.proxy_service = ProxyService::CreateFixed("https://proxy:70");
   BoundTestNetLog log;
   session_deps_.net_log = log.bound().net_log();
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
 
   scoped_ptr<HttpTransaction> trans(
       new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get()));
@@ -4346,7 +4347,7 @@
   session_deps_.proxy_service = ProxyService::CreateFixed("https://proxy:70");
   BoundTestNetLog log;
   session_deps_.net_log = log.bound().net_log();
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
 
   scoped_ptr<HttpTransaction> trans(
       new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get()));
@@ -4437,7 +4438,7 @@
   session_deps_.proxy_service = ProxyService::CreateFixed("https://proxy:70");
   BoundTestNetLog log;
   session_deps_.net_log = log.bound().net_log();
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
 
   scoped_ptr<HttpTransaction> trans(
       new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get()));
@@ -4488,7 +4489,7 @@
   session_deps_.proxy_service = ProxyService::CreateFixed("https://proxy:70");
   BoundTestNetLog log;
   session_deps_.net_log = log.bound().net_log();
-  scoped_refptr<HttpNetworkSession> session(
+  scoped_ptr<HttpNetworkSession> session(
       SpdySessionDependencies::SpdyCreateSession(&session_deps_));
 
   HttpRequestInfo request1;
@@ -4630,7 +4631,7 @@
   session_deps_.proxy_service = ProxyService::CreateFixed("https://proxy:70");
   BoundTestNetLog log;
   session_deps_.net_log = log.bound().net_log();
-  scoped_refptr<HttpNetworkSession> session(
+  scoped_ptr<HttpNetworkSession> session(
       SpdySessionDependencies::SpdyCreateSession(&session_deps_));
 
   HttpRequestInfo request1;
@@ -4753,7 +4754,7 @@
   session_deps_.proxy_service = ProxyService::CreateFixed("https://proxy:70");
   BoundTestNetLog log;
   session_deps_.net_log = log.bound().net_log();
-  scoped_refptr<HttpNetworkSession> session(
+  scoped_ptr<HttpNetworkSession> session(
       SpdySessionDependencies::SpdyCreateSession(&session_deps_));
 
   HttpRequestInfo request1;
@@ -4859,7 +4860,7 @@
   session_deps_.proxy_service = ProxyService::CreateFixed("https://myproxy:70");
   BoundTestNetLog log;
   session_deps_.net_log = log.bound().net_log();
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
 
   // Since we have proxy, should use full url
   MockWrite data_writes1[] = {
@@ -4956,7 +4957,7 @@
 
   // Configure against proxy server "myproxy:70".
   session_deps_.proxy_service = ProxyService::CreateFixed("myproxy:70");
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
 
   // Since we have proxy, should try to establish tunnel.
   MockWrite data_writes[] = {
@@ -5174,7 +5175,7 @@
 
   // Configure against proxy server "myproxy:70".
   session_deps_.proxy_service = ProxyService::CreateFixed("myproxy:70");
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
 
   scoped_ptr<HttpTransaction> trans(
       new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get()));
@@ -5310,7 +5311,7 @@
 
   HttpAuthHandlerNTLM::ScopedProcSetter proc_setter(MockGenerateRandom1,
                                                     MockGetHostName);
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
 
   MockWrite data_writes1[] = {
     MockWrite("GET /kids/login.aspx HTTP/1.1\r\n"
@@ -5439,7 +5440,7 @@
 
   HttpAuthHandlerNTLM::ScopedProcSetter proc_setter(MockGenerateRandom2,
                                                     MockGetHostName);
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
 
   MockWrite data_writes1[] = {
     MockWrite("GET /kids/login.aspx HTTP/1.1\r\n"
@@ -5639,7 +5640,7 @@
   request.url = GURL("http://www.example.org/");
   request.load_flags = 0;
 
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
   scoped_ptr<HttpTransaction> trans(
       new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get()));
 
@@ -5678,7 +5679,7 @@
   // Configure against proxy server "myproxy:70".
   session_deps_.proxy_service = ProxyService::CreateFixed("myproxy:70");
 
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
 
   scoped_ptr<HttpTransaction> trans(
       new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get()));
@@ -5732,7 +5733,7 @@
   request.url = GURL("http://www.example.org/");
   request.load_flags = 0;
 
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
 
   scoped_ptr<HttpTransaction> trans(
       new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get()));
@@ -5811,7 +5812,7 @@
 
   TestCompletionCallback callback;
 
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
   scoped_ptr<HttpTransaction> trans(
       new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get()));
 
@@ -5881,7 +5882,7 @@
 
   TestCompletionCallback callback;
 
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
   scoped_ptr<HttpTransaction> trans(
       new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get()));
 
@@ -5949,7 +5950,7 @@
       "rt=prt.2642,ol.2649,xjs.2951");
   request.load_flags = 0;
 
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
 
   scoped_ptr<HttpTransaction> trans(
       new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get()));
@@ -6015,7 +6016,7 @@
   request[1].upload_data_stream = &upload_data_stream;
   request[1].load_flags = 0;
 
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
 
   // The first socket is used for transaction 1 and the first attempt of
   // transaction 2.
@@ -6093,7 +6094,7 @@
   request.url = GURL("http://foo:b@r@www.example.org/");
   request.load_flags = LOAD_NORMAL;
 
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
   scoped_ptr<HttpTransaction> trans(
       new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get()));
 
@@ -6176,7 +6177,7 @@
 
   request.load_flags = LOAD_NORMAL;
 
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
   scoped_ptr<HttpTransaction> trans(
       new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get()));
 
@@ -6287,7 +6288,7 @@
   request.url = GURL("http://foo:bar@www.example.org/");
   request.load_flags = LOAD_DO_NOT_USE_EMBEDDED_IDENTITY;
 
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
   scoped_ptr<HttpTransaction> trans(
       new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get()));
 
@@ -6361,7 +6362,7 @@
 
 // Test that previously tried username/passwords for a realm get re-used.
 TEST_P(HttpNetworkTransactionTest, BasicAuthCacheAndPreauth) {
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
 
   // Transaction 1: authenticate (foo, bar) on MyRealm1
   {
@@ -6761,7 +6762,7 @@
       new HttpAuthHandlerDigest::FixedNonceGenerator("0123456789abcdef");
   digest_factory->set_nonce_generator(nonce_generator);
   session_deps_.http_auth_handler_factory.reset(digest_factory);
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
 
   // Transaction 1: authenticate (foo, bar) on MyRealm1
   {
@@ -6893,7 +6894,7 @@
 // Test the ResetStateForRestart() private method.
 TEST_P(HttpNetworkTransactionTest, ResetStateForRestart) {
   // Create a transaction (the dependencies aren't important).
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
   scoped_ptr<HttpNetworkTransaction> trans(
       new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get()));
 
@@ -6940,7 +6941,7 @@
   request.url = GURL("https://www.example.org/");
   request.load_flags = 0;
 
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
   scoped_ptr<HttpTransaction> trans(
       new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get()));
 
@@ -7048,7 +7049,7 @@
   for (int i = 0; i < 2; i++) {
     session_deps_.socket_factory->ResetNextMockIndexes();
 
-    scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+    scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
     scoped_ptr<HttpTransaction> trans(
         new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get()));
 
@@ -7114,7 +7115,7 @@
 
   TestCompletionCallback callback;
 
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
   scoped_ptr<HttpTransaction> trans(
       new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get()));
 
@@ -7173,7 +7174,7 @@
 
   TestCompletionCallback callback;
 
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
   scoped_ptr<HttpTransaction> trans(
       new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get()));
 
@@ -7254,7 +7255,7 @@
 
   TestCompletionCallback callback;
 
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
   scoped_ptr<HttpTransaction> trans(
       new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get()));
 
@@ -7306,7 +7307,7 @@
 
   TestCompletionCallback callback;
 
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
   scoped_ptr<HttpTransaction> trans(
       new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get()));
 
@@ -7363,7 +7364,7 @@
 
   TestCompletionCallback callback;
 
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
   scoped_ptr<HttpTransaction> trans(
       new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get()));
 
@@ -7390,7 +7391,7 @@
       ProxyService::CreateFixedFromPacResult("HTTPS myproxy:70");
   BoundTestNetLog log;
   session_deps_.net_log = log.bound().net_log();
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
 
   // Since we have proxy, should try to establish tunnel.
   scoped_ptr<SpdyFrame> req(spdy_util_.ConstructSpdyConnect(
@@ -7535,7 +7536,7 @@
   // Enable cross-origin push.
   session_deps_.trusted_spdy_proxy = "myproxy:70";
 
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
 
   scoped_ptr<SpdyFrame> stream1_syn(
       spdy_util_.ConstructSpdyGet(NULL, 0, false, 1, LOWEST, false));
@@ -7648,7 +7649,7 @@
   // Enable cross-origin push.
   session_deps_.trusted_spdy_proxy = "myproxy:70";
 
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
 
   scoped_ptr<SpdyFrame> stream1_syn(
       spdy_util_.ConstructSpdyGet(NULL, 0, false, 1, LOWEST, false));
@@ -7776,7 +7777,7 @@
 
   TestCompletionCallback callback;
 
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
   scoped_ptr<HttpTransaction> trans(
       new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get()));
 
@@ -7805,7 +7806,7 @@
   request.extra_headers.SetHeader(HttpRequestHeaders::kUserAgent,
                                   "Chromium Ultra Awesome X Edition");
 
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
   scoped_ptr<HttpTransaction> trans(
       new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get()));
 
@@ -7846,7 +7847,7 @@
                                   "Chromium Ultra Awesome X Edition");
 
   session_deps_.proxy_service = ProxyService::CreateFixed("myproxy:70");
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
   scoped_ptr<HttpTransaction> trans(
       new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get()));
 
@@ -7886,7 +7887,7 @@
   request.extra_headers.SetHeader(HttpRequestHeaders::kReferer,
                                   "http://the.previous.site.com/");
 
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
   scoped_ptr<HttpTransaction> trans(
       new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get()));
 
@@ -7924,7 +7925,7 @@
   request.method = "POST";
   request.url = GURL("http://www.example.org/");
 
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
   scoped_ptr<HttpTransaction> trans(
       new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get()));
 
@@ -7962,7 +7963,7 @@
   request.method = "PUT";
   request.url = GURL("http://www.example.org/");
 
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
   scoped_ptr<HttpTransaction> trans(
       new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get()));
 
@@ -8000,7 +8001,7 @@
   request.method = "HEAD";
   request.url = GURL("http://www.example.org/");
 
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
   scoped_ptr<HttpTransaction> trans(
       new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get()));
 
@@ -8037,7 +8038,7 @@
   request.url = GURL("http://www.example.org/");
   request.load_flags = LOAD_BYPASS_CACHE;
 
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
   scoped_ptr<HttpTransaction> trans(
       new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get()));
 
@@ -8078,7 +8079,7 @@
   request.url = GURL("http://www.example.org/");
   request.load_flags = LOAD_VALIDATE_CACHE;
 
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
   scoped_ptr<HttpTransaction> trans(
       new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get()));
 
@@ -8117,7 +8118,7 @@
   request.url = GURL("http://www.example.org/");
   request.extra_headers.SetHeader("FooHeader", "Bar");
 
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
   scoped_ptr<HttpTransaction> trans(
       new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get()));
 
@@ -8158,7 +8159,7 @@
   request.extra_headers.SetHeader("hEllo", "Kitty");
   request.extra_headers.SetHeader("FoO", "bar");
 
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
   scoped_ptr<HttpTransaction> trans(
       new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get()));
 
@@ -8204,7 +8205,7 @@
   TestNetLog net_log;
   session_deps_.net_log = &net_log;
 
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
   scoped_ptr<HttpTransaction> trans(
       new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get()));
 
@@ -8263,7 +8264,7 @@
   TestNetLog net_log;
   session_deps_.net_log = &net_log;
 
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
   scoped_ptr<HttpTransaction> trans(
       new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get()));
 
@@ -8327,7 +8328,7 @@
   TestNetLog net_log;
   session_deps_.net_log = &net_log;
 
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
   scoped_ptr<HttpTransaction> trans(
       new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get()));
 
@@ -8386,7 +8387,7 @@
   TestNetLog net_log;
   session_deps_.net_log = &net_log;
 
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
   scoped_ptr<HttpTransaction> trans(
       new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get()));
 
@@ -8458,7 +8459,7 @@
   TestNetLog net_log;
   session_deps_.net_log = &net_log;
 
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
   scoped_ptr<HttpTransaction> trans(
       new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get()));
 
@@ -8535,10 +8536,10 @@
   bool ssl;
 };
 
-scoped_refptr<HttpNetworkSession> SetupSessionForGroupNameTests(
+scoped_ptr<HttpNetworkSession> SetupSessionForGroupNameTests(
     NextProto next_proto,
     SpdySessionDependencies* session_deps_) {
-  scoped_refptr<HttpNetworkSession> session(CreateSession(session_deps_));
+  scoped_ptr<HttpNetworkSession> session(CreateSession(session_deps_));
 
   base::WeakPtr<HttpServerProperties> http_server_properties =
       session->http_server_properties();
@@ -8552,16 +8553,15 @@
   return session;
 }
 
-int GroupNameTransactionHelper(
-    const std::string& url,
-    const scoped_refptr<HttpNetworkSession>& session) {
+int GroupNameTransactionHelper(const std::string& url,
+                               HttpNetworkSession* session) {
   HttpRequestInfo request;
   request.method = "GET";
   request.url = GURL(url);
   request.load_flags = 0;
 
   scoped_ptr<HttpTransaction> trans(
-      new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get()));
+      new HttpNetworkTransaction(DEFAULT_PRIORITY, session));
 
   TestCompletionCallback callback;
 
@@ -8612,10 +8612,10 @@
   for (size_t i = 0; i < arraysize(tests); ++i) {
     session_deps_.proxy_service =
         ProxyService::CreateFixed(tests[i].proxy_server);
-    scoped_refptr<HttpNetworkSession> session(
+    scoped_ptr<HttpNetworkSession> session(
         SetupSessionForGroupNameTests(GetParam(), &session_deps_));
 
-    HttpNetworkSessionPeer peer(session);
+    HttpNetworkSessionPeer peer(session.get());
     CaptureGroupNameTransportSocketPool* transport_conn_pool =
         new CaptureGroupNameTransportSocketPool(NULL, NULL);
     CaptureGroupNameSSLSocketPool* ssl_conn_pool =
@@ -8627,7 +8627,7 @@
     peer.SetClientSocketPoolManager(mock_pool_manager.Pass());
 
     EXPECT_EQ(ERR_IO_PENDING,
-              GroupNameTransactionHelper(tests[i].url, session));
+              GroupNameTransactionHelper(tests[i].url, session.get()));
     if (tests[i].ssl)
       EXPECT_EQ(tests[i].expected_group_name,
                 ssl_conn_pool->last_group_name_received());
@@ -8674,10 +8674,10 @@
   for (size_t i = 0; i < arraysize(tests); ++i) {
     session_deps_.proxy_service =
         ProxyService::CreateFixed(tests[i].proxy_server);
-    scoped_refptr<HttpNetworkSession> session(
+    scoped_ptr<HttpNetworkSession> session(
         SetupSessionForGroupNameTests(GetParam(), &session_deps_));
 
-    HttpNetworkSessionPeer peer(session);
+    HttpNetworkSessionPeer peer(session.get());
 
     HostPortPair proxy_host("http_proxy", 80);
     CaptureGroupNameHttpProxySocketPool* http_proxy_pool =
@@ -8692,7 +8692,7 @@
     peer.SetClientSocketPoolManager(mock_pool_manager.Pass());
 
     EXPECT_EQ(ERR_IO_PENDING,
-              GroupNameTransactionHelper(tests[i].url, session));
+              GroupNameTransactionHelper(tests[i].url, session.get()));
     if (tests[i].ssl)
       EXPECT_EQ(tests[i].expected_group_name,
                 ssl_conn_pool->last_group_name_received());
@@ -8744,10 +8744,10 @@
   for (size_t i = 0; i < arraysize(tests); ++i) {
     session_deps_.proxy_service =
         ProxyService::CreateFixed(tests[i].proxy_server);
-    scoped_refptr<HttpNetworkSession> session(
+    scoped_ptr<HttpNetworkSession> session(
         SetupSessionForGroupNameTests(GetParam(), &session_deps_));
 
-    HttpNetworkSessionPeer peer(session);
+    HttpNetworkSessionPeer peer(session.get());
 
     HostPortPair proxy_host("socks_proxy", 1080);
     CaptureGroupNameSOCKSSocketPool* socks_conn_pool =
@@ -8765,7 +8765,7 @@
         new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get()));
 
     EXPECT_EQ(ERR_IO_PENDING,
-              GroupNameTransactionHelper(tests[i].url, session));
+              GroupNameTransactionHelper(tests[i].url, session.get()));
     if (tests[i].ssl)
       EXPECT_EQ(tests[i].expected_group_name,
                 ssl_conn_pool->last_group_name_received());
@@ -8787,7 +8787,7 @@
   // connecting to both proxies (myproxy:70 and foobar:80).
   session_deps_.host_resolver->rules()->AddSimulatedFailure("*");
 
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
   scoped_ptr<HttpTransaction> trans(
       new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get()));
 
@@ -8813,7 +8813,7 @@
   // Select a host resolver that does caching.
   session_deps_.host_resolver.reset(new MockCachingHostResolver);
 
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
   scoped_ptr<HttpTransaction> trans(
       new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get()));
 
@@ -8882,7 +8882,7 @@
   StaticSocketDataProvider data(NULL, 0,
                                 write_failure, arraysize(write_failure));
   session_deps_.socket_factory->AddSocketDataProvider(&data);
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
 
   TestCompletionCallback callback;
 
@@ -8914,7 +8914,7 @@
 
   StaticSocketDataProvider data(data_reads, arraysize(data_reads), NULL, 0);
   session_deps_.socket_factory->AddSocketDataProvider(&data);
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
 
   TestCompletionCallback callback;
 
@@ -8992,7 +8992,7 @@
   StaticSocketDataProvider data2(data_reads2, arraysize(data_reads2),
                                  data_writes2, arraysize(data_writes2));
   session_deps_.socket_factory->AddSocketDataProvider(&data2);
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
 
   TestCompletionCallback callback1;
 
@@ -9048,7 +9048,7 @@
 
   session_deps_.socket_factory->ResetNextMockIndexes();
 
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
   scoped_ptr<HttpTransaction> trans(
       new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get()));
 
@@ -9065,7 +9065,7 @@
   request.url = GURL("http://www.example.org/");
   request.load_flags = 0;
 
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
   scoped_ptr<HttpTransaction> trans(
       new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get()));
 
@@ -9114,7 +9114,7 @@
   request.upload_data_stream = &upload_data_stream;
   request.load_flags = 0;
 
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
   scoped_ptr<HttpTransaction> trans(
       new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get()));
 
@@ -9169,7 +9169,7 @@
   request.load_flags = 0;
 
   // If we try to upload an unreadable file, the transaction should fail.
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
   scoped_ptr<HttpTransaction> trans(
       new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get()));
 
@@ -9223,7 +9223,7 @@
   request.upload_data_stream = &upload_data_stream;
   request.load_flags = 0;
 
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
   scoped_ptr<HttpTransaction> trans(
       new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get()));
 
@@ -9330,7 +9330,7 @@
 
   TestCompletionCallback callback1;
 
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
   scoped_ptr<HttpTransaction> trans(
       new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get()));
 
@@ -9425,7 +9425,7 @@
 
   TestCompletionCallback callback;
 
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
   scoped_ptr<HttpTransaction> trans(
       new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get()));
 
@@ -9489,7 +9489,7 @@
 
   TestCompletionCallback callback;
 
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session = CreateSession(&session_deps_);
   scoped_ptr<HttpTransaction> trans(
       new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get()));
 
@@ -9546,7 +9546,7 @@
 
   TestCompletionCallback callback;
 
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
   scoped_ptr<HttpTransaction> trans(
       new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get()));
 
@@ -9613,7 +9613,7 @@
 
   TestCompletionCallback callback;
 
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
   scoped_ptr<HttpTransaction> trans(
       new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get()));
 
@@ -9670,7 +9670,7 @@
 
   TestCompletionCallback callback;
 
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
 
   HostPortPair http_host_port_pair("www.example.org", 80);
   HttpServerProperties& http_server_properties =
@@ -9737,7 +9737,7 @@
 
   TestCompletionCallback callback;
 
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
   scoped_ptr<HttpTransaction> trans(
       new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get()));
 
@@ -9796,7 +9796,7 @@
                                        nullptr, 0);
   session_deps_.socket_factory->AddSocketDataProvider(&second_data);
 
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session = CreateSession(&session_deps_);
 
   base::WeakPtr<HttpServerProperties> http_server_properties =
       session->http_server_properties();
@@ -9840,7 +9840,7 @@
       data_reads, arraysize(data_reads), NULL, 0);
   session_deps_.socket_factory->AddSocketDataProvider(&second_data);
 
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
 
   base::WeakPtr<HttpServerProperties> http_server_properties =
       session->http_server_properties();
@@ -9906,7 +9906,7 @@
       data_reads, arraysize(data_reads), NULL, 0);
   session_deps_.socket_factory->AddSocketDataProvider(&second_data);
 
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
 
   base::WeakPtr<HttpServerProperties> http_server_properties =
       session->http_server_properties();
@@ -9958,7 +9958,7 @@
       data_reads, arraysize(data_reads), NULL, 0);
   session_deps_.socket_factory->AddSocketDataProvider(&second_data);
 
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
 
   base::WeakPtr<HttpServerProperties> http_server_properties =
       session->http_server_properties();
@@ -10009,7 +10009,7 @@
       data_reads, arraysize(data_reads), NULL, 0);
   session_deps_.socket_factory->AddSocketDataProvider(&second_data);
 
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
 
   base::WeakPtr<HttpServerProperties> http_server_properties =
       session->http_server_properties();
@@ -10061,7 +10061,7 @@
       data_reads, arraysize(data_reads), NULL, 0);
   session_deps_.socket_factory->AddSocketDataProvider(&second_data);
 
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
 
   base::WeakPtr<HttpServerProperties> http_server_properties =
       session->http_server_properties();
@@ -10112,7 +10112,7 @@
       data_reads, arraysize(data_reads), NULL, 0);
   session_deps_.socket_factory->AddSocketDataProvider(&second_data);
 
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
 
   base::WeakPtr<HttpServerProperties> http_server_properties =
       session->http_server_properties();
@@ -10158,7 +10158,7 @@
       data_reads, arraysize(data_reads), NULL, 0);
   session_deps_.socket_factory->AddSocketDataProvider(&data);
 
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
 
   base::WeakPtr<HttpServerProperties> http_server_properties =
       session->http_server_properties();
@@ -10243,7 +10243,7 @@
 
   TestCompletionCallback callback;
 
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
   scoped_ptr<HttpTransaction> trans(
       new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get()));
 
@@ -10345,7 +10345,7 @@
   // Socket 5 is the unsuccessful non-Alternate-Protocol for transaction 3.
   session_deps_.socket_factory->AddSocketDataProvider(&hanging_socket);
 
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
   TestCompletionCallback callback1;
   HttpNetworkTransaction trans1(DEFAULT_PRIORITY, session.get());
 
@@ -10436,7 +10436,7 @@
 
   TestCompletionCallback callback;
 
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
   scoped_ptr<HttpTransaction> trans(
       new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get()));
 
@@ -10600,7 +10600,7 @@
 
   TestCompletionCallback callback;
 
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
   scoped_ptr<HttpTransaction> trans(
       new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get()));
 
@@ -10693,7 +10693,7 @@
 
   TestCompletionCallback callback;
 
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
 
   scoped_ptr<HttpTransaction> trans(
       new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get()));
@@ -10716,7 +10716,7 @@
   SpdySessionKey key(host_port_pair, ProxyServer::Direct(),
                      PRIVACY_MODE_DISABLED);
   base::WeakPtr<SpdySession> spdy_session =
-      CreateSecureSpdySession(session, key, BoundNetLog());
+      CreateSecureSpdySession(session.get(), key, BoundNetLog());
 
   trans.reset(new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get()));
 
@@ -11085,7 +11085,7 @@
     request.url = GURL(test_config.server_url);
     request.load_flags = 0;
 
-    scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+    scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
     HttpNetworkTransaction trans(DEFAULT_PRIORITY, session.get());
 
     SSLSocketDataProvider ssl_socket_data_provider(SYNCHRONOUS, OK);
@@ -11184,12 +11184,12 @@
   request.url = origin;
   request.load_flags = 0;
 
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
 
   // Use a TCP Socket Pool with only one connection per group. This is used
   // to validate that the TCP socket is not released to the pool between
   // each round of multi-round authentication.
-  HttpNetworkSessionPeer session_peer(session);
+  HttpNetworkSessionPeer session_peer(session.get());
   TransportClientSocketPool* transport_pool = new TransportClientSocketPool(
       50,  // Max sockets for pool
       1,   // Max sockets per group
@@ -11384,7 +11384,7 @@
 
   TestCompletionCallback callback;
 
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
   scoped_ptr<HttpTransaction> trans(
       new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get()));
 
@@ -11436,7 +11436,7 @@
 
   TestCompletionCallback callback;
 
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
   scoped_ptr<HttpTransaction> trans(
       new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get()));
 
@@ -11590,7 +11590,7 @@
   session_deps_.socket_factory->AddSSLSocketDataProvider(&ssl);
   session_deps_.socket_factory->AddSocketDataProvider(
       &hanging_non_alternate_protocol_socket);
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
 
   // First round should work and provide the Alternate-Protocol state.
   TestCompletionCallback callback_1;
@@ -11650,7 +11650,7 @@
   request.load_flags = 0;
 
   session_deps_.host_resolver->set_synchronous_mode(true);
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
   scoped_ptr<HttpTransaction> trans(
       new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get()));
 
@@ -11688,7 +11688,7 @@
   StaticSocketDataProvider data(data_reads, arraysize(data_reads), NULL, 0);
   session_deps_.socket_factory->AddSocketDataProvider(&data);
 
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
 
   {
     HttpRequestInfo request;
@@ -11724,7 +11724,7 @@
       ProxyService::CreateFixedFromPacResult("PROXY myproxy:70");
   BoundTestNetLog log;
   session_deps_.net_log = log.bound().net_log();
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
 
   HttpRequestInfo request;
   request.method = "GET";
@@ -11788,7 +11788,7 @@
       ProxyService::CreateFixedFromPacResult("PROXY myproxy:70");
   BoundTestNetLog log;
   session_deps_.net_log = log.bound().net_log();
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
 
   HttpRequestInfo request;
   request.method = "GET";
@@ -11865,7 +11865,7 @@
   session_deps_.proxy_service = ProxyService::CreateFixed("myproxy:70");
   BoundTestNetLog log;
   session_deps_.net_log = log.bound().net_log();
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
 
   HttpRequestInfo request;
   request.method = "GET";
@@ -11937,14 +11937,14 @@
   ssl.SetNextProto(GetParam());
   session_deps_.socket_factory->AddSSLSocketDataProvider(&ssl);
 
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
 
   // Set up an initial SpdySession in the pool to reuse.
   HostPortPair host_port_pair("www.example.org", 443);
   SpdySessionKey key(host_port_pair, ProxyServer::Direct(),
                      PRIVACY_MODE_DISABLED);
   base::WeakPtr<SpdySession> spdy_session =
-      CreateInsecureSpdySession(session, key, BoundNetLog());
+      CreateInsecureSpdySession(session.get(), key, BoundNetLog());
 
   HttpRequestInfo request;
   request.method = "GET";
@@ -11980,7 +11980,7 @@
   session_deps_.socket_factory->AddSocketDataProvider(&data);
   session_deps_.socket_factory->AddSSLSocketDataProvider(&ssl_data);
 
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
   scoped_ptr<HttpTransaction> trans(
       new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get()));
 
@@ -12067,7 +12067,7 @@
   StaticSocketDataProvider data4(NULL, 0, NULL, 0);
   session_deps_.socket_factory->AddSocketDataProvider(&data4);
 
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
   scoped_ptr<HttpTransaction> trans(
       new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get()));
 
@@ -12184,7 +12184,7 @@
   StaticSocketDataProvider data5(data2_reads, arraysize(data2_reads), NULL, 0);
   session_deps_.socket_factory->AddSocketDataProvider(&data5);
 
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
   scoped_ptr<HttpTransaction> trans(
       new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get()));
 
@@ -12276,7 +12276,7 @@
 
   for (size_t i = 0; i < arraysize(requests); ++i) {
     session_deps_.socket_factory->ResetNextMockIndexes();
-    scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+    scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
     scoped_ptr<HttpNetworkTransaction> trans(
         new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get()));
 
@@ -12329,7 +12329,7 @@
 
   // Set up a special HttpNetworkSession with a MockCachingHostResolver.
   session_deps_.host_resolver.reset(new MockCachingHostResolver());
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
   SpdySessionPoolPeer pool_peer(session->spdy_session_pool());
   pool_peer.DisableDomainAuthenticationVerification();
 
@@ -12428,7 +12428,7 @@
 
   // Set up a special HttpNetworkSession with a MockCachingHostResolver.
   session_deps_.host_resolver.reset(new MockCachingHostResolver());
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
   SpdySessionPoolPeer pool_peer(session->spdy_session_pool());
   pool_peer.DisableDomainAuthenticationVerification();
 
@@ -12558,7 +12558,7 @@
   HttpNetworkSession::Params params =
       SpdySessionDependencies::CreateSessionParams(&session_deps_);
   params.host_resolver = &host_resolver;
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
   SpdySessionPoolPeer pool_peer(session->spdy_session_pool());
   pool_peer.DisableDomainAuthenticationVerification();
 
@@ -12698,7 +12698,7 @@
   session_deps_.socket_factory->AddSocketDataProvider(&data1);
   session_deps_.socket_factory->AddSocketDataProvider(&data2);
 
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
 
   // Start the first transaction to set up the SpdySession
   HttpRequestInfo request1;
@@ -12810,7 +12810,7 @@
     session_deps_.socket_factory->AddSocketDataProvider(&data_refused);
 
     session_deps_.use_alternative_services = true;
-    scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+    scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
     base::WeakPtr<HttpServerProperties> http_server_properties =
         session->http_server_properties();
     AlternativeService alternative_service(
@@ -12914,7 +12914,7 @@
 
   // Set up alternative service for origin.
   session_deps_.use_alternative_services = true;
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
   base::WeakPtr<HttpServerProperties> http_server_properties =
       session->http_server_properties();
   AlternativeService alternative_service(
@@ -12987,7 +12987,7 @@
 
   // Set up alternative service for origin.
   session_deps_.use_alternative_services = true;
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
   base::WeakPtr<HttpServerProperties> http_server_properties =
       session->http_server_properties();
   AlternativeService alternative_service(
@@ -13096,7 +13096,7 @@
 
   // Set up alternative service for origin.
   session_deps_.use_alternative_services = true;
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
   base::WeakPtr<HttpServerProperties> http_server_properties =
       session->http_server_properties();
   AlternativeService alternative_service(
@@ -13230,7 +13230,7 @@
   session_deps_.deterministic_socket_factory->AddSSLSocketDataProvider(&ssl2);
   session_deps_.deterministic_socket_factory->AddSocketDataProvider(&data1);
 
-  scoped_refptr<HttpNetworkSession> session(
+  scoped_ptr<HttpNetworkSession> session(
       SpdySessionDependencies::SpdyCreateSessionDeterministic(&session_deps_));
 
   // Start the first transaction to set up the SpdySession
@@ -13365,7 +13365,7 @@
   session_deps_.host_resolver->rules()->AddRule("news.example.org", ip_addr);
   session_deps_.host_resolver->rules()->AddRule("proxy", ip_addr);
 
-  scoped_refptr<HttpNetworkSession> session(
+  scoped_ptr<HttpNetworkSession> session(
       SpdySessionDependencies::SpdyCreateSessionDeterministic(&session_deps_));
 
   // Start the first transaction to set up the SpdySession
@@ -13440,7 +13440,7 @@
   session_deps_.socket_factory->AddSSLSocketDataProvider(&ssl2);
   session_deps_.socket_factory->AddSocketDataProvider(&data2);
 
-  scoped_refptr<HttpNetworkSession> session(
+  scoped_ptr<HttpNetworkSession> session(
       SpdySessionDependencies::SpdyCreateSession(&session_deps_));
 
   // Start the first transaction to set up the SpdySession and verify that
@@ -13479,7 +13479,7 @@
   // Use two different hosts with different IPs so they don't get pooled.
   session_deps_.host_resolver->rules()->AddRule("www.a.com", "10.0.0.1");
   session_deps_.host_resolver->rules()->AddRule("www.b.com", "10.0.0.2");
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
 
   SSLSocketDataProvider ssl1(ASYNC, OK);
   ssl1.SetNextProto(GetParam());
@@ -13639,7 +13639,7 @@
   request.url = GURL("http://www.example.org/");
   request.load_flags = 0;
 
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
   scoped_ptr<HttpTransaction> trans(
       new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get()));
 
@@ -13676,7 +13676,7 @@
   request.url = GURL("http://www.example.org/");
   request.load_flags = 0;
 
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
   scoped_ptr<HttpTransaction> trans(
       new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get()));
 
@@ -13713,7 +13713,7 @@
   request.url = GURL("http://www.example.org/");
   request.load_flags = 0;
 
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
   scoped_ptr<HttpTransaction> trans(
       new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get()));
 
@@ -13747,7 +13747,7 @@
   request.url = GURL("http://www.example.org/");
   request.load_flags = 0;
 
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
   scoped_ptr<HttpTransaction> trans(
       new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get()));
 
@@ -13781,7 +13781,7 @@
   request.url = GURL("http://www.example.org/");
   request.load_flags = 0;
 
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
   scoped_ptr<HttpTransaction> trans(
       new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get()));
 
@@ -13818,7 +13818,7 @@
   request.url = GURL("http://www.example.org/");
   request.load_flags = 0;
 
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
   scoped_ptr<HttpTransaction> trans(
       new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get()));
 
@@ -13856,7 +13856,7 @@
   request.load_flags = 0;
   request.extra_headers.SetHeader("X-Foo", "bar");
 
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
   scoped_ptr<HttpTransaction> trans(
       new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get()));
 
@@ -14246,8 +14246,8 @@
 // Make sure that HttpNetworkTransaction passes on its priority to its
 // stream request on start.
 TEST_P(HttpNetworkTransactionTest, SetStreamRequestPriorityOnStart) {
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
-  HttpNetworkSessionPeer peer(session);
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  HttpNetworkSessionPeer peer(session.get());
   FakeStreamFactory* fake_factory = new FakeStreamFactory();
   peer.SetHttpStreamFactory(scoped_ptr<HttpStreamFactory>(fake_factory));
 
@@ -14269,8 +14269,8 @@
 // Make sure that HttpNetworkTransaction passes on its priority
 // updates to its stream request.
 TEST_P(HttpNetworkTransactionTest, SetStreamRequestPriority) {
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
-  HttpNetworkSessionPeer peer(session);
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  HttpNetworkSessionPeer peer(session.get());
   FakeStreamFactory* fake_factory = new FakeStreamFactory();
   peer.SetHttpStreamFactory(scoped_ptr<HttpStreamFactory>(fake_factory));
 
@@ -14294,8 +14294,8 @@
 // Make sure that HttpNetworkTransaction passes on its priority
 // updates to its stream.
 TEST_P(HttpNetworkTransactionTest, SetStreamPriority) {
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
-  HttpNetworkSessionPeer peer(session);
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  HttpNetworkSessionPeer peer(session.get());
   FakeStreamFactory* fake_factory = new FakeStreamFactory();
   peer.SetHttpStreamFactory(scoped_ptr<HttpStreamFactory>(fake_factory));
 
@@ -14324,8 +14324,8 @@
   std::string test_cases[] = {"ws://www.example.org/",
                               "wss://www.example.org/"};
   for (size_t i = 0; i < arraysize(test_cases); ++i) {
-    scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
-    HttpNetworkSessionPeer peer(session);
+    scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+    HttpNetworkSessionPeer peer(session.get());
     FakeStreamFactory* fake_factory = new FakeStreamFactory();
     FakeWebSocketStreamCreateHelper websocket_stream_create_helper;
     peer.SetHttpStreamFactoryForWebSocket(
@@ -14406,7 +14406,7 @@
                                      http_writes, arraysize(http_writes));
   session_deps_.socket_factory->AddSocketDataProvider(&http_data);
 
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
 
   // Start the SSL request.
   TestCompletionCallback ssl_callback;
@@ -14488,7 +14488,7 @@
                                      http_writes, arraysize(http_writes));
   session_deps_.socket_factory->AddSocketDataProvider(&http_data);
 
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
 
   // Preconnect an SSL socket.  A preconnect is needed because connect jobs are
   // cancelled when a normal transaction is cancelled.
@@ -14529,7 +14529,7 @@
   request.upload_data_stream = &upload_data_stream;
   request.load_flags = 0;
 
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
   scoped_ptr<HttpTransaction> trans(
       new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get()));
   // Send headers successfully, but get an error while sending the body.
@@ -14574,7 +14574,7 @@
 // response from a server that rejected a POST with a CONNECTION_RESET.
 TEST_P(HttpNetworkTransactionTest,
        PostReadsErrorResponseAfterResetOnReusedSocket) {
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
   MockWrite data_writes[] = {
     MockWrite("GET / HTTP/1.1\r\n"
               "Host: www.foo.com\r\n"
@@ -14668,7 +14668,7 @@
   request.upload_data_stream = &upload_data_stream;
   request.load_flags = 0;
 
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
   scoped_ptr<HttpTransaction> trans(
       new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get()));
   // Send headers successfully, but get an error while sending the body.
@@ -14723,7 +14723,7 @@
   request.upload_data_stream = &upload_data_stream;
   request.load_flags = 0;
 
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
   scoped_ptr<HttpTransaction> trans(
       new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get()));
   // Send headers successfully, but get an error while sending the body.
@@ -14782,7 +14782,7 @@
   request.upload_data_stream = &upload_data_stream;
   request.load_flags = 0;
 
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
   scoped_ptr<HttpTransaction> trans(
       new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get()));
 
@@ -14835,7 +14835,7 @@
   request.upload_data_stream = &upload_data_stream;
   request.load_flags = 0;
 
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
   scoped_ptr<HttpTransaction> trans(
       new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get()));
   // Send headers successfully, but get an error while sending the body.
@@ -14877,7 +14877,7 @@
   request.upload_data_stream = &upload_data_stream;
   request.load_flags = 0;
 
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
   scoped_ptr<HttpTransaction> trans(
       new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get()));
   // Send headers successfully, but get an error while sending the body.
@@ -14920,7 +14920,7 @@
   request.upload_data_stream = &upload_data_stream;
   request.load_flags = 0;
 
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
   scoped_ptr<HttpTransaction> trans(
       new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get()));
   // Send headers successfully, but get an error while sending the body.
@@ -14960,7 +14960,7 @@
   request.upload_data_stream = &upload_data_stream;
   request.load_flags = 0;
 
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
   scoped_ptr<HttpTransaction> trans(
       new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get()));
   // Send headers successfully, but get an error while sending the body.
@@ -15001,7 +15001,7 @@
   session_deps_.proxy_service =
       ProxyService::CreateFixedFromPacResult("PROXY myproxy:70");
 
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
 
   // Since a proxy is configured, try to establish a tunnel.
   MockWrite data_writes[] = {
@@ -15108,7 +15108,7 @@
   session_deps_.proxy_service =
       ProxyService::CreateFixedFromPacResult("PROXY myproxy:70");
 
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
 
   MockWrite data_writes[] = {
       // Try to establish a tunnel for the WebSocket connection, with
@@ -15184,7 +15184,7 @@
   request.url = GURL("http://www.foo.com/");
   request.upload_data_stream = &upload_data_stream;
 
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
   scoped_ptr<HttpTransaction> trans(
       new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get()));
   MockWrite data_writes[] = {
@@ -15228,7 +15228,7 @@
   request.url = GURL("http://www.foo.com/");
   request.upload_data_stream = &upload_data_stream;
 
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
   scoped_ptr<HttpTransaction> trans(
       new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get()));
   MockWrite data_writes[] = {
@@ -15273,7 +15273,7 @@
   request.url = GURL("http://www.foo.com/");
   request.upload_data_stream = &upload_data_stream;
 
-  scoped_refptr<HttpNetworkSession> session(CreateSession(&session_deps_));
+  scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
   scoped_ptr<HttpTransaction> trans(
       new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get()));
   // Send headers successfully, but get an error while sending the body.
diff --git a/net/http/http_proxy_client_socket_pool_unittest.cc b/net/http/http_proxy_client_socket_pool_unittest.cc
index 4a36144..bcc6299d 100644
--- a/net/http/http_proxy_client_socket_pool_unittest.cc
+++ b/net/http/http_proxy_client_socket_pool_unittest.cc
@@ -287,7 +287,7 @@
     ssl_data_->SetNextProto(GetParam().protocol);
   }
 
-  HttpNetworkSession* CreateNetworkSession() {
+  scoped_ptr<HttpNetworkSession> CreateNetworkSession() {
     return SpdySessionDependencies::SpdyCreateSession(&session_deps_);
   }
 
@@ -303,7 +303,7 @@
   scoped_ptr<CertVerifier> cert_verifier_;
   SSLClientSocketPool ssl_socket_pool_;
 
-  const scoped_refptr<HttpNetworkSession> session_;
+  const scoped_ptr<HttpNetworkSession> session_;
 
  protected:
   SpdyTestUtil spdy_util_;
diff --git a/net/http/http_response_body_drainer_unittest.cc b/net/http/http_response_body_drainer_unittest.cc
index 2062d4d..358cea7 100644
--- a/net/http/http_response_body_drainer_unittest.cc
+++ b/net/http/http_response_body_drainer_unittest.cc
@@ -232,7 +232,7 @@
   scoped_refptr<SSLConfigService> ssl_config_service_;
   scoped_ptr<HttpServerPropertiesImpl> http_server_properties_;
   scoped_ptr<TransportSecurityState> transport_security_state_;
-  const scoped_refptr<HttpNetworkSession> session_;
+  const scoped_ptr<HttpNetworkSession> session_;
   CloseResultWaiter result_waiter_;
   MockHttpStream* const mock_stream_;  // Owned by |drainer_|.
   HttpResponseBodyDrainer* const drainer_;  // Deletes itself.
diff --git a/net/http/http_stream_factory.cc b/net/http/http_stream_factory.cc
index 1b6e66f..003933b7 100644
--- a/net/http/http_stream_factory.cc
+++ b/net/http/http_stream_factory.cc
@@ -61,7 +61,7 @@
         base::Time::Now() +
         base::TimeDelta::FromSeconds(alternative_service_entry.max_age);
     AlternativeServiceInfo alternative_service_info(
-        alternative_service, alternative_service_entry.p, expiration);
+        alternative_service, alternative_service_entry.probability, expiration);
     alternative_service_info_vector.push_back(alternative_service_info);
   }
 
diff --git a/net/http/http_stream_factory_impl_request_unittest.cc b/net/http/http_stream_factory_impl_request_unittest.cc
index 7a54831..a68d164 100644
--- a/net/http/http_stream_factory_impl_request_unittest.cc
+++ b/net/http/http_stream_factory_impl_request_unittest.cc
@@ -64,8 +64,8 @@
   SpdySessionDependencies session_deps(GetParam(),
                                        ProxyService::CreateDirect());
 
-  scoped_refptr<HttpNetworkSession>
-      session(SpdySessionDependencies::SpdyCreateSession(&session_deps));
+  scoped_ptr<HttpNetworkSession> session =
+      SpdySessionDependencies::SpdyCreateSession(&session_deps);
   HttpStreamFactoryImpl* factory =
       static_cast<HttpStreamFactoryImpl*>(session->http_stream_factory());
 
diff --git a/net/http/http_stream_factory_impl_unittest.cc b/net/http/http_stream_factory_impl_unittest.cc
index 8c404e7..a5e1a85 100644
--- a/net/http/http_stream_factory_impl_unittest.cc
+++ b/net/http/http_stream_factory_impl_unittest.cc
@@ -431,9 +431,9 @@
   for (size_t i = 0; i < arraysize(kTests); ++i) {
     SpdySessionDependencies session_deps(
         GetParam(), ProxyService::CreateDirect());
-    scoped_refptr<HttpNetworkSession> session(
+    scoped_ptr<HttpNetworkSession> session(
         SpdySessionDependencies::SpdyCreateSession(&session_deps));
-    HttpNetworkSessionPeer peer(session);
+    HttpNetworkSessionPeer peer(session.get());
     CapturePreconnectsTransportSocketPool* transport_conn_pool =
         new CapturePreconnectsTransportSocketPool(
             session_deps.host_resolver.get(),
@@ -459,9 +459,9 @@
   for (size_t i = 0; i < arraysize(kTests); ++i) {
     SpdySessionDependencies session_deps(
         GetParam(), ProxyService::CreateFixed("http_proxy"));
-    scoped_refptr<HttpNetworkSession> session(
+    scoped_ptr<HttpNetworkSession> session(
         SpdySessionDependencies::SpdyCreateSession(&session_deps));
-    HttpNetworkSessionPeer peer(session);
+    HttpNetworkSessionPeer peer(session.get());
     HostPortPair proxy_host("http_proxy", 80);
     CapturePreconnectsHttpProxySocketPool* http_proxy_pool =
         new CapturePreconnectsHttpProxySocketPool(
@@ -488,9 +488,9 @@
   for (size_t i = 0; i < arraysize(kTests); ++i) {
     SpdySessionDependencies session_deps(
         GetParam(), ProxyService::CreateFixed("socks4://socks_proxy:1080"));
-    scoped_refptr<HttpNetworkSession> session(
+    scoped_ptr<HttpNetworkSession> session(
         SpdySessionDependencies::SpdyCreateSession(&session_deps));
-    HttpNetworkSessionPeer peer(session);
+    HttpNetworkSessionPeer peer(session.get());
     HostPortPair proxy_host("socks_proxy", 1080);
     CapturePreconnectsSOCKSSocketPool* socks_proxy_pool =
         new CapturePreconnectsSOCKSSocketPool(
@@ -517,9 +517,9 @@
   for (size_t i = 0; i < arraysize(kTests); ++i) {
     SpdySessionDependencies session_deps(
         GetParam(), ProxyService::CreateDirect());
-    scoped_refptr<HttpNetworkSession> session(
+    scoped_ptr<HttpNetworkSession> session(
         SpdySessionDependencies::SpdyCreateSession(&session_deps));
-    HttpNetworkSessionPeer peer(session);
+    HttpNetworkSessionPeer peer(session.get());
 
     // Put a SpdySession in the pool.
     HostPortPair host_port_pair("www.google.com", 443);
@@ -558,9 +558,9 @@
 
   SpdySessionDependencies session_deps(
       GetParam(), ProxyService::CreateDirect());
-  scoped_refptr<HttpNetworkSession> session(
+  scoped_ptr<HttpNetworkSession> session(
       SpdySessionDependencies::SpdyCreateSession(&session_deps));
-  HttpNetworkSessionPeer peer(session);
+  HttpNetworkSessionPeer peer(session.get());
   CapturePreconnectsTransportSocketPool* transport_conn_pool =
       new CapturePreconnectsTransportSocketPool(
           session_deps.host_resolver.get(),
@@ -589,7 +589,7 @@
   socket_data2.set_connect_data(MockConnect(ASYNC, OK));
   session_deps.socket_factory->AddSocketDataProvider(&socket_data2);
 
-  scoped_refptr<HttpNetworkSession> session(
+  scoped_ptr<HttpNetworkSession> session(
       SpdySessionDependencies::SpdyCreateSession(&session_deps));
 
   // Now request a stream. It should succeed using the second proxy in the
@@ -638,8 +638,7 @@
     params.ssl_config_service = ssl_config_service.get();
     params.http_server_properties = http_server_properties.GetWeakPtr();
 
-    scoped_refptr<HttpNetworkSession> session;
-    session = new HttpNetworkSession(params);
+    scoped_ptr<HttpNetworkSession> session(new HttpNetworkSession(params));
     session->quic_stream_factory()->set_require_confirmation(false);
 
     StaticSocketDataProvider socket_data1;
@@ -700,8 +699,7 @@
   params.http_server_properties = http_server_properties.GetWeakPtr();
   params.quic_max_number_of_lossy_connections = 2;
 
-  scoped_refptr<HttpNetworkSession> session;
-  session = new HttpNetworkSession(params);
+  scoped_ptr<HttpNetworkSession> session(new HttpNetworkSession(params));
   session->quic_stream_factory()->set_require_confirmation(false);
 
   session->quic_stream_factory()->number_of_lossy_connections_[99] =
@@ -748,7 +746,7 @@
   SSLSocketDataProvider ssl(ASYNC, OK);
   session_deps.socket_factory->AddSSLSocketDataProvider(&ssl);
 
-  scoped_refptr<HttpNetworkSession> session(
+  scoped_ptr<HttpNetworkSession> session(
       SpdySessionDependencies::SpdyCreateSession(&session_deps));
 
   // Set an existing SpdySession in the pool.
@@ -814,7 +812,7 @@
   SSLSocketDataProvider ssl(ASYNC, OK);
   session_deps.socket_factory->AddSSLSocketDataProvider(&ssl);
 
-  scoped_refptr<HttpNetworkSession> session(
+  scoped_ptr<HttpNetworkSession> session(
       SpdySessionDependencies::SpdyCreateSession(&session_deps));
   SSLClientSocketPool* ssl_pool = session->GetSSLSocketPool(
       HttpNetworkSession::NORMAL_SOCKET_POOL);
@@ -864,7 +862,7 @@
   socket_data.set_connect_data(MockConnect(ASYNC, OK));
   session_deps.socket_factory->AddSocketDataProvider(&socket_data);
 
-  scoped_refptr<HttpNetworkSession> session(
+  scoped_ptr<HttpNetworkSession> session(
       SpdySessionDependencies::SpdyCreateSession(&session_deps));
 
   HttpRequestInfo request_info;
@@ -891,7 +889,7 @@
   socket_data.set_connect_data(MockConnect(ASYNC, OK));
   session_deps.socket_factory->AddSocketDataProvider(&socket_data);
 
-  scoped_refptr<HttpNetworkSession> session(
+  scoped_ptr<HttpNetworkSession> session(
       SpdySessionDependencies::SpdyCreateSession(&session_deps));
 
   // Now request a stream.  It should succeed using the second proxy in the
@@ -941,7 +939,7 @@
   SSLSocketDataProvider ssl_socket_data(ASYNC, OK);
   session_deps.socket_factory->AddSSLSocketDataProvider(&ssl_socket_data);
 
-  scoped_refptr<HttpNetworkSession> session(
+  scoped_ptr<HttpNetworkSession> session(
       SpdySessionDependencies::SpdyCreateSession(&session_deps));
 
   // Now request a stream.
@@ -986,7 +984,7 @@
   socket_data.set_connect_data(MockConnect(ASYNC, OK));
   session_deps.socket_factory->AddSocketDataProvider(&socket_data);
 
-  scoped_refptr<HttpNetworkSession> session(
+  scoped_ptr<HttpNetworkSession> session(
       SpdySessionDependencies::SpdyCreateSession(&session_deps));
 
   // Now request a stream.  It should succeed using the second proxy in the
@@ -1039,7 +1037,7 @@
   socket_data.set_connect_data(MockConnect(ASYNC, OK));
   session_deps.socket_factory->AddSocketDataProvider(&socket_data);
 
-  scoped_refptr<HttpNetworkSession> session(
+  scoped_ptr<HttpNetworkSession> session(
       SpdySessionDependencies::SpdyCreateSession(&session_deps));
 
   // Now request a stream.
@@ -1087,7 +1085,7 @@
   SSLSocketDataProvider ssl_socket_data(ASYNC, OK);
   session_deps.socket_factory->AddSSLSocketDataProvider(&ssl_socket_data);
 
-  scoped_refptr<HttpNetworkSession> session(
+  scoped_ptr<HttpNetworkSession> session(
       SpdySessionDependencies::SpdyCreateSession(&session_deps));
 
   // Now request a stream.
@@ -1132,7 +1130,7 @@
   socket_data.set_connect_data(MockConnect(ASYNC, OK));
   session_deps.socket_factory->AddSocketDataProvider(&socket_data);
 
-  scoped_refptr<HttpNetworkSession> session(
+  scoped_ptr<HttpNetworkSession> session(
       SpdySessionDependencies::SpdyCreateSession(&session_deps));
 
   // Now request a stream.
@@ -1193,7 +1191,7 @@
   session_deps.socket_factory->AddSSLSocketDataProvider(&ssl_socket_data);
 
   HostPortPair host_port_pair("www.google.com", 443);
-  scoped_refptr<HttpNetworkSession> session(
+  scoped_ptr<HttpNetworkSession> session(
       SpdySessionDependencies::SpdyCreateSession(&session_deps));
 
   // Now request a stream.
@@ -1246,8 +1244,8 @@
   session_deps.socket_factory->AddSSLSocketDataProvider(&ssl_socket_data);
 
   HostPortPair host_port_pair("www.google.com", 80);
-  scoped_refptr<HttpNetworkSession>
-      session(SpdySessionDependencies::SpdyCreateSession(&session_deps));
+  scoped_ptr<HttpNetworkSession> session(
+      SpdySessionDependencies::SpdyCreateSession(&session_deps));
 
   // Now request a stream.
   HttpRequestInfo request_info;
@@ -1298,8 +1296,8 @@
   session_deps.socket_factory->AddSSLSocketDataProvider(&ssl_socket_data);
 
   HostPortPair host_port_pair("www.google.com", 80);
-  scoped_refptr<HttpNetworkSession>
-      session(SpdySessionDependencies::SpdyCreateSession(&session_deps));
+  scoped_ptr<HttpNetworkSession> session(
+      SpdySessionDependencies::SpdyCreateSession(&session_deps));
 
   // Now request a stream.
   HttpRequestInfo request_info;
@@ -1380,7 +1378,7 @@
   ssl_socket_data.SetNextProto(GetParam());
   session_deps.socket_factory->AddSSLSocketDataProvider(&ssl_socket_data);
 
-  scoped_refptr<HttpNetworkSession> session(
+  scoped_ptr<HttpNetworkSession> session(
       SpdySessionDependencies::SpdyCreateSession(&session_deps));
 
   // Now request a stream.
diff --git a/net/http/mock_http_cache.cc b/net/http/mock_http_cache.cc
index c483323..ce49d33 100644
--- a/net/http/mock_http_cache.cc
+++ b/net/http/mock_http_cache.cc
@@ -524,13 +524,10 @@
 
 //-----------------------------------------------------------------------------
 
-MockHttpCache::MockHttpCache()
-    : http_cache_(new MockNetworkLayer(), NULL, new MockBackendFactory()) {
-}
+MockHttpCache::MockHttpCache() : MockHttpCache(new MockBackendFactory()) {}
 
 MockHttpCache::MockHttpCache(HttpCache::BackendFactory* disk_cache_factory)
-    : http_cache_(new MockNetworkLayer(), NULL, disk_cache_factory) {
-}
+    : http_cache_(new MockNetworkLayer(), nullptr, disk_cache_factory, true) {}
 
 disk_cache::Backend* MockHttpCache::backend() {
   TestCompletionCallback cb;
diff --git a/net/proxy/proxy_config_service_android.cc b/net/proxy/proxy_config_service_android.cc
index 66065fb..44c4522251 100644
--- a/net/proxy/proxy_config_service_android.cc
+++ b/net/proxy/proxy_config_service_android.cc
@@ -99,11 +99,6 @@
   // http.nonProxyHosts property to *.android.com|*.kernel.org will cause
   // requests to http://developer.android.com to be made without a proxy.
 
-  // Force localhost to be on the proxy exclusion list;
-  // otherwise all localhost traffic is routed through
-  // the proxy which is not desired.
-  bypass_rules->AddRuleToBypassLocal();
-
   std::string non_proxy_hosts =
       get_property.Run(scheme + ".nonProxyHosts");
   if (non_proxy_hosts.empty())
diff --git a/net/proxy/proxy_script_fetcher_impl_unittest.cc b/net/proxy/proxy_script_fetcher_impl_unittest.cc
index 62a332b..437d88ab 100644
--- a/net/proxy/proxy_script_fetcher_impl_unittest.cc
+++ b/net/proxy/proxy_script_fetcher_impl_unittest.cc
@@ -76,12 +76,11 @@
     params.proxy_service = proxy_service();
     params.ssl_config_service = ssl_config_service();
     params.http_server_properties = http_server_properties();
-    scoped_refptr<HttpNetworkSession> network_session(
-        new HttpNetworkSession(params));
-    storage_.set_http_transaction_factory(
-        make_scoped_ptr(new HttpCache(network_session.get(),
-                                      HttpCache::DefaultBackend::InMemory(0)))
-            .Pass());
+    storage_.set_http_network_session(
+        make_scoped_ptr(new HttpNetworkSession(params)));
+    storage_.set_http_transaction_factory(make_scoped_ptr(
+        new HttpCache(storage_.http_network_session(),
+                      HttpCache::DefaultBackend::InMemory(0), false)));
     scoped_ptr<URLRequestJobFactoryImpl> job_factory =
         make_scoped_ptr(new URLRequestJobFactoryImpl());
 #if !defined(DISABLE_FILE_SUPPORT)
diff --git a/net/quic/crypto/crypto_server_test.cc b/net/quic/crypto/crypto_server_test.cc
index 60bf9377..a905597 100644
--- a/net/quic/crypto/crypto_server_test.cc
+++ b/net/quic/crypto/crypto_server_test.cc
@@ -285,7 +285,7 @@
       size_t expected_count) {
     const uint32* reject_reasons;
     size_t num_reject_reasons;
-    COMPILE_ASSERT(sizeof(QuicTag) == sizeof(uint32), header_out_of_sync);
+    static_assert(sizeof(QuicTag) == sizeof(uint32), "header_out_of_sync");
     QuicErrorCode error_code =
         out_.GetTaglist(kRREJ, &reject_reasons, &num_reject_reasons);
     ASSERT_EQ(QUIC_NO_ERROR, error_code);
diff --git a/net/quic/quic_end_to_end_unittest.cc b/net/quic/quic_end_to_end_unittest.cc
index 86bb9cd..7b4bb5a 100644
--- a/net/quic/quic_end_to_end_unittest.cc
+++ b/net/quic/quic_end_to_end_unittest.cc
@@ -48,7 +48,7 @@
 // Factory for creating HttpTransactions, used by TestTransactionConsumer.
 class TestTransactionFactory : public HttpTransactionFactory {
  public:
-  TestTransactionFactory(const HttpNetworkSession::Params& params)
+  explicit TestTransactionFactory(const HttpNetworkSession::Params& params)
       : session_(new HttpNetworkSession(params)) {}
 
   ~TestTransactionFactory() override {}
@@ -65,7 +65,7 @@
   HttpNetworkSession* GetSession() override { return session_.get(); };
 
  private:
-  scoped_refptr<HttpNetworkSession> session_;
+  scoped_ptr<HttpNetworkSession> session_;
 };
 
 }  // namespace
diff --git a/net/quic/quic_network_transaction_unittest.cc b/net/quic/quic_network_transaction_unittest.cc
index 1bac0f4..9411ccb7 100644
--- a/net/quic/quic_network_transaction_unittest.cc
+++ b/net/quic/quic_network_transaction_unittest.cc
@@ -319,7 +319,7 @@
       params_.next_protos = NextProtosWithSpdyAndQuic(true, true);
     }
 
-    session_ = new HttpNetworkSession(params_);
+    session_.reset(new HttpNetworkSession(params_));
     session_->quic_stream_factory()->set_require_confirmation(false);
     ASSERT_EQ(params_.quic_socket_receive_buffer_size,
               session_->quic_stream_factory()->socket_receive_buffer_size());
@@ -426,7 +426,7 @@
 
   MockClock* clock_;  // Owned by QuicStreamFactory after CreateSession.
   QuicTestPacketMaker maker_;
-  scoped_refptr<HttpNetworkSession> session_;
+  scoped_ptr<HttpNetworkSession> session_;
   MockClientSocketFactory socket_factory_;
   MockCryptoClientStreamFactory crypto_client_stream_factory_;
   MockHostResolver host_resolver_;
diff --git a/net/quic/quic_packet_creator.cc b/net/quic/quic_packet_creator.cc
index 3dcfe6e..18a719a4 100644
--- a/net/quic/quic_packet_creator.cc
+++ b/net/quic/quic_packet_creator.cc
@@ -266,7 +266,7 @@
                                             QuicStreamOffset offset,
                                             bool fin,
                                             QuicFrame* frame,
-                                            scoped_ptr<char[]>* buffer) {
+                                            UniqueStreamBuffer* buffer) {
   DCHECK_GT(max_packet_length_,
             StreamFramePacketOverhead(connection_id_length_, kIncludeVersion,
                                       PACKET_6BYTE_PACKET_NUMBER, offset,
@@ -294,7 +294,7 @@
   size_t bytes_consumed = min<size_t>(BytesFree() - min_frame_size, data_size);
 
   bool set_fin = fin && bytes_consumed == data_size;  // Last frame.
-  buffer->reset(new char[bytes_consumed]);
+  *buffer = NewStreamBuffer(bytes_consumed);
   CopyToBuffer(iov, iov_offset, bytes_consumed, buffer->get());
   *frame = QuicFrame(new QuicStreamFrame(
       id, set_fin, offset, StringPiece(buffer->get(), bytes_consumed)));
@@ -417,17 +417,18 @@
                   /*needs_padding=*/false, nullptr);
 }
 
-bool QuicPacketCreator::AddSavedFrame(const QuicFrame& frame, char* buffer) {
+bool QuicPacketCreator::AddSavedFrame(const QuicFrame& frame,
+                                      UniqueStreamBuffer buffer) {
   return AddFrame(frame,
                   /*save_retransmittable_frames=*/true,
-                  /*needs_padding=*/false, buffer);
+                  /*needs_padding=*/false, buffer.Pass());
 }
 
 bool QuicPacketCreator::AddPaddedSavedFrame(const QuicFrame& frame,
-                                            char* buffer) {
+                                            UniqueStreamBuffer buffer) {
   return AddFrame(frame,
                   /*save_retransmittable_frames=*/true,
-                  /*needs_padding=*/true, buffer);
+                  /*needs_padding=*/true, buffer.Pass());
 }
 
 SerializedPacket QuicPacketCreator::SerializePacket(
@@ -596,7 +597,7 @@
 bool QuicPacketCreator::AddFrame(const QuicFrame& frame,
                                  bool save_retransmittable_frames,
                                  bool needs_padding,
-                                 char* buffer) {
+                                 UniqueStreamBuffer buffer) {
   DVLOG(1) << "Adding frame: " << frame;
   InFecGroup is_in_fec_group = MaybeUpdateLengthsAndStartFec();
 
@@ -615,7 +616,7 @@
           new RetransmittableFrames(encryption_level_));
     }
     queued_frames_.push_back(
-        queued_retransmittable_frames_->AddFrame(frame, buffer));
+        queued_retransmittable_frames_->AddFrame(frame, buffer.Pass()));
   } else {
     queued_frames_.push_back(frame);
   }
diff --git a/net/quic/quic_packet_creator.h b/net/quic/quic_packet_creator.h
index ee6e35c..618e00b 100644
--- a/net/quic/quic_packet_creator.h
+++ b/net/quic/quic_packet_creator.h
@@ -89,7 +89,7 @@
                            QuicStreamOffset offset,
                            bool fin,
                            QuicFrame* frame,
-                           scoped_ptr<char[]>* buffer);
+                           UniqueStreamBuffer* buffer);
 
   // Serializes all frames into a single packet. All frames must fit into a
   // single packet. Also, sets the entropy hash of the serialized packet to a
@@ -151,13 +151,12 @@
   // Returns false if the frame doesn't fit into the current packet.
   bool AddSavedFrame(const QuicFrame& frame);
 
-  // Identical to AddSavedFrame, but takes ownership of the buffer if it returns
-  // true.
-  bool AddSavedFrame(const QuicFrame& frame, char* buffer);
+  // Identical to AddSavedFrame, but takes ownership of the buffer.
+  bool AddSavedFrame(const QuicFrame& frame, UniqueStreamBuffer buffer);
 
-  // Identical to AddSavedFrame, but takes ownership of the buffer if it returns
-  // true, and allows to cause the packet to be padded.
-  bool AddPaddedSavedFrame(const QuicFrame& frame, char* buffer);
+  // Identical to AddSavedFrame, but takes ownership of the buffer, and allows
+  // to cause the packet to be padded.
+  bool AddPaddedSavedFrame(const QuicFrame& frame, UniqueStreamBuffer buffer);
 
   // Serializes all frames which have been added and adds any which should be
   // retransmitted to |retransmittable_frames| if it's not nullptr. All frames
@@ -264,7 +263,7 @@
   bool AddFrame(const QuicFrame& frame,
                 bool save_retransmittable_frames,
                 bool needs_padding,
-                char* buffer);
+                UniqueStreamBuffer buffer);
 
   // Adds a padding frame to the current packet only if the current packet
   // contains a handshake message, and there is sufficient room to fit a
diff --git a/net/quic/quic_packet_creator_test.cc b/net/quic/quic_packet_creator_test.cc
index 962c1b5..c0565ed 100644
--- a/net/quic/quic_packet_creator_test.cc
+++ b/net/quic/quic_packet_creator_test.cc
@@ -491,7 +491,7 @@
 TEST_P(QuicPacketCreatorTest, ReserializeFramesWithPadding) {
   QuicFrame frame;
   QuicIOVector io_vector(MakeIOVector("fake handshake message data"));
-  scoped_ptr<char[]> stream_buffer;
+  UniqueStreamBuffer stream_buffer;
   creator_.CreateStreamFrame(kCryptoStreamId, io_vector, 0u, 0u, false, &frame,
                              &stream_buffer);
   RetransmittableFrames frames(ENCRYPTION_NONE);
@@ -515,7 +515,7 @@
 
     QuicFrame frame;
     QuicIOVector io_vector(MakeIOVector(data));
-    scoped_ptr<char[]> stream_buffer;
+    UniqueStreamBuffer stream_buffer;
     creator_.CreateStreamFrame(kCryptoStreamId, io_vector, 0, kOffset, false,
                                &frame, &stream_buffer);
     RetransmittableFrames frames(ENCRYPTION_NONE);
@@ -623,7 +623,7 @@
   // Add a stream frame to the creator.
   QuicFrame frame;
   QuicIOVector io_vector(MakeIOVector("test"));
-  scoped_ptr<char[]> stream_buffer;
+  UniqueStreamBuffer stream_buffer;
   size_t consumed = creator_.CreateStreamFrame(1u, io_vector, 0u, 0u, false,
                                                &frame, &stream_buffer);
   EXPECT_EQ(4u, consumed);
@@ -654,7 +654,7 @@
 TEST_P(QuicPacketCreatorTest, CreateStreamFrame) {
   QuicFrame frame;
   QuicIOVector io_vector(MakeIOVector("test"));
-  scoped_ptr<char[]> stream_buffer;
+  UniqueStreamBuffer stream_buffer;
   size_t consumed = creator_.CreateStreamFrame(1u, io_vector, 0u, 0u, false,
                                                &frame, &stream_buffer);
   EXPECT_EQ(4u, consumed);
@@ -666,7 +666,7 @@
 TEST_P(QuicPacketCreatorTest, CreateStreamFrameFin) {
   QuicFrame frame;
   QuicIOVector io_vector(MakeIOVector("test"));
-  scoped_ptr<char[]> stream_buffer;
+  UniqueStreamBuffer stream_buffer;
   size_t consumed = creator_.CreateStreamFrame(1u, io_vector, 0u, 10u, true,
                                                &frame, &stream_buffer);
   EXPECT_EQ(4u, consumed);
@@ -678,7 +678,7 @@
 TEST_P(QuicPacketCreatorTest, CreateStreamFrameFinOnly) {
   QuicFrame frame;
   QuicIOVector io_vector(nullptr, 0, 0);
-  scoped_ptr<char[]> stream_buffer;
+  UniqueStreamBuffer stream_buffer;
   size_t consumed = creator_.CreateStreamFrame(1u, io_vector, 0u, 0u, true,
                                                &frame, &stream_buffer);
   EXPECT_EQ(0u, consumed);
@@ -698,7 +698,7 @@
     if (should_have_room) {
       QuicFrame frame;
       QuicIOVector io_vector(MakeIOVector("testdata"));
-      scoped_ptr<char[]> stream_buffer;
+      UniqueStreamBuffer stream_buffer;
       size_t bytes_consumed =
           creator_.CreateStreamFrame(kClientDataStreamId1, io_vector, 0u,
                                      kOffset, false, &frame, &stream_buffer);
@@ -725,7 +725,7 @@
     size_t bytes_free = delta > 0 ? 0 : 0 - delta;
     QuicFrame frame;
     QuicIOVector io_vector(MakeIOVector(data));
-    scoped_ptr<char[]> stream_buffer;
+    UniqueStreamBuffer stream_buffer;
     size_t bytes_consumed =
         creator_.CreateStreamFrame(kClientDataStreamId1, io_vector, 0u, kOffset,
                                    false, &frame, &stream_buffer);
@@ -759,7 +759,7 @@
     size_t bytes_free = delta > 0 ? 0 : 0 - delta;
     QuicFrame frame;
     QuicIOVector io_vector(MakeIOVector(data));
-    scoped_ptr<char[]> stream_buffer;
+    UniqueStreamBuffer stream_buffer;
     size_t bytes_consumed =
         creator_.CreateStreamFrame(kClientDataStreamId1, io_vector, 0u, kOffset,
                                    false, &frame, &stream_buffer);
@@ -794,7 +794,7 @@
 
     QuicFrame frame;
     QuicIOVector io_vector(MakeIOVector(data));
-    scoped_ptr<char[]> stream_buffer;
+    UniqueStreamBuffer stream_buffer;
     size_t bytes_consumed = creator_.CreateStreamFrame(
         kCryptoStreamId, io_vector, 0u, kOffset, false, &frame, &stream_buffer);
     EXPECT_LT(0u, bytes_consumed);
@@ -830,7 +830,7 @@
 
     QuicFrame frame;
     QuicIOVector io_vector(MakeIOVector(data));
-    scoped_ptr<char[]> stream_buffer;
+    UniqueStreamBuffer stream_buffer;
     size_t bytes_consumed =
         creator_.CreateStreamFrame(kClientDataStreamId1, io_vector, 0u, kOffset,
                                    false, &frame, &stream_buffer);
@@ -966,7 +966,7 @@
   QuicFrame frame;
   const string too_long_payload(payload_length * 2, 'a');
   QuicIOVector io_vector(MakeIOVector(too_long_payload));
-  scoped_ptr<char[]> stream_buffer;
+  UniqueStreamBuffer stream_buffer;
   size_t consumed = creator_.CreateStreamFrame(1u, io_vector, 0u, 0u, true,
                                                &frame, &stream_buffer);
   EXPECT_EQ(payload_length, consumed);
@@ -997,7 +997,7 @@
 
   QuicFrame frame;
   QuicIOVector io_vector(MakeIOVector("test"));
-  scoped_ptr<char[]> stream_buffer;
+  UniqueStreamBuffer stream_buffer;
   size_t consumed = creator_.CreateStreamFrame(1u, io_vector, 0u, 0u, false,
                                                &frame, &stream_buffer);
   EXPECT_EQ(4u, consumed);
@@ -1058,7 +1058,7 @@
   // Make sure that an additional stream frame can be added to the packet.
   QuicFrame stream_frame;
   QuicIOVector io_vector(MakeIOVector("test"));
-  scoped_ptr<char[]> stream_buffer;
+  UniqueStreamBuffer stream_buffer;
   size_t consumed = creator_.CreateStreamFrame(2u, io_vector, 0u, 0u, false,
                                                &stream_frame, &stream_buffer);
   EXPECT_EQ(4u, consumed);
@@ -1204,7 +1204,7 @@
   // Add a stream frame to the creator.
   QuicFrame frame;
   QuicIOVector io_vector(MakeIOVector("test"));
-  scoped_ptr<char[]> stream_buffer;
+  UniqueStreamBuffer stream_buffer;
   size_t consumed = creator_.CreateStreamFrame(1u, io_vector, 0u, 0u, false,
                                                &frame, &stream_buffer);
   EXPECT_EQ(4u, consumed);
diff --git a/net/quic/quic_packet_generator.cc b/net/quic/quic_packet_generator.cc
index 1c306c4..eed8ec7d 100644
--- a/net/quic/quic_packet_generator.cc
+++ b/net/quic/quic_packet_generator.cc
@@ -168,7 +168,7 @@
   while (delegate_->ShouldGeneratePacket(
       HAS_RETRANSMITTABLE_DATA, has_handshake ? IS_HANDSHAKE : NOT_HANDSHAKE)) {
     QuicFrame frame;
-    scoped_ptr<char[]> buffer;
+    UniqueStreamBuffer buffer;
     size_t bytes_consumed = packet_creator_.CreateStreamFrame(
         id, iov, total_bytes_consumed, offset + total_bytes_consumed, fin,
         &frame, &buffer);
@@ -179,7 +179,7 @@
       ack_notifiers_.push_back(notifier);
     }
 
-    if (!AddFrame(frame, buffer.get(), has_handshake)) {
+    if (!AddFrame(frame, buffer.Pass(), has_handshake)) {
       LOG(DFATAL) << "Failed to add stream frame.";
       // Inability to add a STREAM frame creates an unrecoverable hole in a
       // the stream, so it's best to close the connection.
@@ -187,8 +187,6 @@
       delete notifier;
       return QuicConsumedData(0, false);
     }
-    // When AddFrame succeeds, it takes ownership of the buffer.
-    ignore_result(buffer.release());
 
     total_bytes_consumed += bytes_consumed;
     fin_consumed = fin && total_bytes_consumed == iov.total_length;
@@ -442,11 +440,11 @@
 }
 
 bool QuicPacketGenerator::AddFrame(const QuicFrame& frame,
-                                   char* buffer,
+                                   UniqueStreamBuffer buffer,
                                    bool needs_padding) {
   bool success = needs_padding
-                     ? packet_creator_.AddPaddedSavedFrame(frame, buffer)
-                     : packet_creator_.AddSavedFrame(frame, buffer);
+                     ? packet_creator_.AddPaddedSavedFrame(frame, buffer.Pass())
+                     : packet_creator_.AddSavedFrame(frame, buffer.Pass());
   if (success && debug_delegate_) {
     debug_delegate_->OnFrameAddedToPacket(frame);
   }
diff --git a/net/quic/quic_packet_generator.h b/net/quic/quic_packet_generator.h
index 923d01e3..f782e3c 100644
--- a/net/quic/quic_packet_generator.h
+++ b/net/quic/quic_packet_generator.h
@@ -258,9 +258,10 @@
   bool CanSendWithNextPendingFrameAddition() const;
   // Add exactly one pending frame, preferring ack frames over control frames.
   bool AddNextPendingFrame();
-  // Adds a frame and takes ownership of the underlying buffer if the addition
-  // was successful.
-  bool AddFrame(const QuicFrame& frame, char* buffer, bool needs_padding);
+  // Adds a frame and takes ownership of the underlying buffer.
+  bool AddFrame(const QuicFrame& frame,
+                UniqueStreamBuffer buffer,
+                bool needs_padding);
 
   void SerializeAndSendPacket();
 
diff --git a/net/quic/quic_protocol.cc b/net/quic/quic_protocol.cc
index 5625d6c..d281358f 100644
--- a/net/quic/quic_protocol.cc
+++ b/net/quic/quic_protocol.cc
@@ -91,6 +91,10 @@
     const QuicPacketPublicHeader& header)
     : public_header(header), nonce_proof(0), rejected_packet_number(0) {}
 
+UniqueStreamBuffer NewStreamBuffer(size_t size) {
+  return UniqueStreamBuffer(new char[size]);
+}
+
 QuicStreamFrame::QuicStreamFrame() : stream_id(0), fin(false), offset(0) {
 }
 
@@ -820,6 +824,8 @@
         DCHECK(false) << "Cannot delete type: " << it->type;
     }
   }
+  // TODO(rtenneti): Delete the for loop once chrome has c++11 library support
+  // for "std::vector<UniqueStreamBuffer> stream_data_;".
   for (const char* buffer : stream_data_) {
     delete[] buffer;
   }
@@ -830,13 +836,13 @@
 }
 
 const QuicFrame& RetransmittableFrames::AddFrame(const QuicFrame& frame,
-                                                 char* buffer) {
+                                                 UniqueStreamBuffer buffer) {
   if (frame.type == STREAM_FRAME &&
       frame.stream_frame->stream_id == kCryptoStreamId) {
     has_crypto_handshake_ = IS_HANDSHAKE;
   }
   if (buffer != nullptr) {
-    stream_data_.push_back(buffer);
+    stream_data_.push_back(buffer.release());
   }
   frames_.push_back(frame);
   return frames_.back();
diff --git a/net/quic/quic_protocol.h b/net/quic/quic_protocol.h
index 800b349..c942b8d 100644
--- a/net/quic/quic_protocol.h
+++ b/net/quic/quic_protocol.h
@@ -19,6 +19,7 @@
 #include "base/basictypes.h"
 #include "base/containers/hash_tables.h"
 #include "base/logging.h"
+#include "base/memory/scoped_ptr.h"
 #include "base/strings/string_piece.h"
 #include "net/base/int128.h"
 #include "net/base/iovec.h"
@@ -696,6 +697,11 @@
 // frame.
 struct NET_EXPORT_PRIVATE QuicMtuDiscoveryFrame {};
 
+typedef scoped_ptr<char[]> UniqueStreamBuffer;
+
+// Allocates memory of size |size| for a QUIC stream buffer.
+UniqueStreamBuffer NewStreamBuffer(size_t size);
+
 struct NET_EXPORT_PRIVATE QuicStreamFrame {
   QuicStreamFrame();
   QuicStreamFrame(const QuicStreamFrame& frame);
@@ -1108,7 +1114,7 @@
   // Takes ownership of the frame inside |frame|.
   const QuicFrame& AddFrame(const QuicFrame& frame);
   // Takes ownership of the frame inside |frame| and |buffer|.
-  const QuicFrame& AddFrame(const QuicFrame& frame, char* buffer);
+  const QuicFrame& AddFrame(const QuicFrame& frame, UniqueStreamBuffer buffer);
   // Removes all stream frames associated with |stream_id|.
   void RemoveFramesForStream(QuicStreamId stream_id);
 
@@ -1132,6 +1138,10 @@
   IsHandshake has_crypto_handshake_;
   bool needs_padding_;
   // Data referenced by the StringPiece of a QuicStreamFrame.
+  //
+  // TODO(rtenneti): Change const char* to UniqueStreamBuffer once chrome has
+  // c++11 library support.
+  // std::vector<UniqueStreamBuffer> stream_data_;
   std::vector<const char*> stream_data_;
 
   DISALLOW_COPY_AND_ASSIGN(RetransmittableFrames);
diff --git a/net/socket/ssl_client_socket_pool_unittest.cc b/net/socket/ssl_client_socket_pool_unittest.cc
index 48d6670..9bbe659 100644
--- a/net/socket/ssl_client_socket_pool_unittest.cc
+++ b/net/socket/ssl_client_socket_pool_unittest.cc
@@ -185,7 +185,7 @@
   const scoped_refptr<SSLConfigService> ssl_config_service_;
   const scoped_ptr<HttpAuthHandlerFactory> http_auth_handler_factory_;
   HttpServerPropertiesImpl http_server_properties_;
-  const scoped_refptr<HttpNetworkSession> session_;
+  const scoped_ptr<HttpNetworkSession> session_;
 
   scoped_refptr<TransportSocketParams> direct_transport_socket_params_;
   MockTransportClientSocketPool transport_socket_pool_;
@@ -828,7 +828,7 @@
 
   CreatePool(true /* tcp pool */, false, false);
   base::WeakPtr<SpdySession> spdy_session =
-      CreateSecureSpdySession(session_, test_hosts[0].key, BoundNetLog());
+      CreateSecureSpdySession(session_.get(), test_hosts[0].key, BoundNetLog());
 
   EXPECT_TRUE(
       HasSpdySession(session_->spdy_session_pool(), test_hosts[0].key));
@@ -885,7 +885,7 @@
 
   CreatePool(true /* tcp pool */, false, false);
   base::WeakPtr<SpdySession> spdy_session =
-      CreateSecureSpdySession(session_, test_hosts[0].key, BoundNetLog());
+      CreateSecureSpdySession(session_.get(), test_hosts[0].key, BoundNetLog());
 
   EXPECT_TRUE(
       HasSpdySession(session_->spdy_session_pool(), test_hosts[0].key));
diff --git a/net/spdy/spdy_alt_svc_wire_format.cc b/net/spdy/spdy_alt_svc_wire_format.cc
index ad414ff..fba2dc5 100644
--- a/net/spdy/spdy_alt_svc_wire_format.cc
+++ b/net/spdy/spdy_alt_svc_wire_format.cc
@@ -42,13 +42,13 @@
     uint16 port,
     uint16 version,
     uint32 max_age,
-    double p)
+    double probability)
     : protocol_id(protocol_id),
       host(host),
       port(port),
       version(version),
       max_age(max_age),
-      p(p) {}
+      probability(probability) {}
 
 // static
 bool SpdyAltSvcWireFormat::ParseHeaderFieldValue(
@@ -107,7 +107,7 @@
     // Parse parameters.
     uint16 version = 0;
     uint32 max_age = 86400;
-    double p = 1.0;
+    double probability = 1.0;
     StringPiece::const_iterator parameters_end = std::find(c, value.end(), ',');
     while (c != parameters_end) {
       SkipWhiteSpace(&c, parameters_end);
@@ -147,13 +147,13 @@
           return false;
         }
       } else if (parameter_name.compare("p") == 0) {
-        if (!ParseProbability(parameter_value_begin, c, &p)) {
+        if (!ParseProbability(parameter_value_begin, c, &probability)) {
           return false;
         }
       }
     }
-    altsvc_vector->push_back(
-        AlternativeService(protocol_id, host, port, version, max_age, p));
+    altsvc_vector->push_back(AlternativeService(protocol_id, host, port,
+                                                version, max_age, probability));
     for (; c != value.end() && (*c == ' ' || *c == '\t' || *c == ','); ++c) {
     }
   }
@@ -219,8 +219,8 @@
     if (altsvc.max_age != 86400) {
       base::StringAppendF(&value, "; ma=%d", altsvc.max_age);
     }
-    if (altsvc.p != 1.0) {
-      base::StringAppendF(&value, "; p=%.2f", altsvc.p);
+    if (altsvc.probability != 1.0) {
+      base::StringAppendF(&value, "; p=%.2f", altsvc.probability);
     }
   }
   return value;
@@ -315,7 +315,7 @@
 // static
 bool SpdyAltSvcWireFormat::ParseProbability(StringPiece::const_iterator c,
                                             StringPiece::const_iterator end,
-                                            double* p) {
+                                            double* probability) {
   // "" is invalid.
   if (c == end) {
     return false;
@@ -325,10 +325,10 @@
     return false;
   }
   if (*c == '1') {
-    *p = 1.0;
+    *probability = 1.0;
     ++c;
   } else {
-    *p = 0.0;
+    *probability = 0.0;
     if (*c == '0') {
       ++c;
     }
@@ -343,10 +343,10 @@
   ++c;
   double place_value = 0.1;
   for (; c != end && isdigit(*c); ++c) {
-    *p += place_value * (*c - '0');
+    *probability += place_value * (*c - '0');
     place_value *= 0.1;
   }
-  return (c == end && *p <= 1.0);
+  return (c == end && *probability <= 1.0);
 }
 
 }  // namespace net
diff --git a/net/spdy/spdy_alt_svc_wire_format.h b/net/spdy/spdy_alt_svc_wire_format.h
index 8b8a0b1..dfd72fd9 100644
--- a/net/spdy/spdy_alt_svc_wire_format.h
+++ b/net/spdy/spdy_alt_svc_wire_format.h
@@ -36,7 +36,7 @@
     // Default is one day.
     uint32 max_age = 86400;
     // Default is always use.
-    double p = 1.0;
+    double probability = 1.0;
 
     AlternativeService();
     AlternativeService(const std::string& protocol_id,
@@ -44,12 +44,12 @@
                        uint16 port,
                        uint16 version,
                        uint32 max_age,
-                       double p);
+                       double probability);
 
     bool operator==(const AlternativeService& other) const {
       return protocol_id == other.protocol_id && host == other.host &&
              port == other.port && version == other.version &&
-             max_age == other.max_age && p == other.p;
+             max_age == other.max_age && probability == other.probability;
     }
   };
   // An empty vector means alternative services should be cleared for given
@@ -81,7 +81,7 @@
                                      uint32* value);
   static bool ParseProbability(StringPiece::const_iterator c,
                                StringPiece::const_iterator end,
-                               double* p);
+                               double* probability);
 };
 
 }  // namespace net
diff --git a/net/spdy/spdy_alt_svc_wire_format_test.cc b/net/spdy/spdy_alt_svc_wire_format_test.cc
index b53db3b..76567e46 100644
--- a/net/spdy/spdy_alt_svc_wire_format_test.cc
+++ b/net/spdy/spdy_alt_svc_wire_format_test.cc
@@ -44,8 +44,8 @@
   }
   static bool ParseProbability(StringPiece::const_iterator c,
                                StringPiece::const_iterator end,
-                               double* p) {
-    return SpdyAltSvcWireFormat::ParseProbability(c, end, p);
+                               double* probability) {
+    return SpdyAltSvcWireFormat::ParseProbability(c, end, probability);
   }
 };
 
@@ -87,11 +87,11 @@
     header_field_value->append("; J=s");
   }
   if (i & 1 << 5) {
-    expected_altsvc->p = 0.33;
+    expected_altsvc->probability = 0.33;
     header_field_value->append("; P=.33");
   }
   if (i & 1 << 6) {
-    expected_altsvc->p = 0.0;
+    expected_altsvc->probability = 0.0;
     expected_altsvc->version = 24;
     header_field_value->append("; p=0;v=24");
   }
@@ -100,7 +100,7 @@
     header_field_value->append("; Ma=999999999");
   }
   if (i & 1 << 8) {
-    expected_altsvc->p = 0.0;
+    expected_altsvc->probability = 0.0;
     header_field_value->append("; P=0.");
   }
   if (i & 1 << 9) {
@@ -140,7 +140,7 @@
     expected_header_field_value->append("; ma=1111");
   }
   if (i & 1 << 3) {
-    altsvc->p = 0.33;
+    altsvc->probability = 0.33;
     expected_header_field_value->append("; p=0.33");
   }
 }
@@ -156,7 +156,7 @@
   EXPECT_EQ(0u, altsvc.port);
   EXPECT_EQ(0u, altsvc.version);
   EXPECT_EQ(86400u, altsvc.max_age);
-  EXPECT_DOUBLE_EQ(1.0, altsvc.p);
+  EXPECT_DOUBLE_EQ(1.0, altsvc.probability);
 }
 
 TEST(SpdyAltSvcWireFormatTest, ParseInvalidEmptyHeaderFieldValue) {
@@ -188,7 +188,7 @@
     EXPECT_EQ(expected_altsvc.port, altsvc_vector[0].port);
     EXPECT_EQ(expected_altsvc.version, altsvc_vector[0].version);
     EXPECT_EQ(expected_altsvc.max_age, altsvc_vector[0].max_age);
-    EXPECT_DOUBLE_EQ(expected_altsvc.p, altsvc_vector[0].p);
+    EXPECT_DOUBLE_EQ(expected_altsvc.probability, altsvc_vector[0].probability);
   }
 }
 
@@ -219,7 +219,8 @@
       EXPECT_EQ(expected_altsvc_vector[j].port, altsvc_vector[j].port);
       EXPECT_EQ(expected_altsvc_vector[j].version, altsvc_vector[j].version);
       EXPECT_EQ(expected_altsvc_vector[j].max_age, altsvc_vector[j].max_age);
-      EXPECT_DOUBLE_EQ(expected_altsvc_vector[j].p, altsvc_vector[j].p);
+      EXPECT_DOUBLE_EQ(expected_altsvc_vector[j].probability,
+                       altsvc_vector[j].probability);
     }
   }
 }
diff --git a/net/spdy/spdy_http_stream_unittest.cc b/net/spdy/spdy_http_stream_unittest.cc
index 69ad12c8..fc2989a 100644
--- a/net/spdy/spdy_http_stream_unittest.cc
+++ b/net/spdy/spdy_http_stream_unittest.cc
@@ -90,7 +90,8 @@
         new SequencedSocketData(reads, reads_count, writes, writes_count));
     session_deps_.socket_factory->AddSocketDataProvider(sequenced_data_.get());
     http_session_ = SpdySessionDependencies::SpdyCreateSession(&session_deps_);
-    session_ = CreateInsecureSpdySession(http_session_, key, BoundNetLog());
+    session_ =
+        CreateInsecureSpdySession(http_session_.get(), key, BoundNetLog());
   }
 
   void TestSendCredentials(
@@ -102,7 +103,7 @@
   TestNetLog net_log_;
   SpdySessionDependencies session_deps_;
   scoped_ptr<SequencedSocketData> sequenced_data_;
-  scoped_refptr<HttpNetworkSession> http_session_;
+  scoped_ptr<HttpNetworkSession> http_session_;
   base::WeakPtr<SpdySession> session_;
 
  private:
diff --git a/net/spdy/spdy_network_transaction_unittest.cc b/net/spdy/spdy_network_transaction_unittest.cc
index fa6294a..f54a89e 100644
--- a/net/spdy/spdy_network_transaction_unittest.cc
+++ b/net/spdy/spdy_network_transaction_unittest.cc
@@ -371,16 +371,14 @@
       }
     }
 
-    void SetSession(const scoped_refptr<HttpNetworkSession>& session) {
-      session_ = session;
+    void SetSession(scoped_ptr<HttpNetworkSession> session) {
+      session_ = session.Pass();
     }
     HttpNetworkTransaction* trans() { return trans_.get(); }
     void ResetTrans() { trans_.reset(); }
     TransactionHelperResult& output() { return output_; }
     const HttpRequestInfo& request() const { return request_; }
-    const scoped_refptr<HttpNetworkSession>& session() const {
-      return session_;
-    }
+    HttpNetworkSession* session() const { return session_.get(); }
     scoped_ptr<SpdySessionDependencies>& session_deps() {
       return session_deps_;
     }
@@ -398,7 +396,7 @@
     HttpRequestInfo request_;
     RequestPriority priority_;
     scoped_ptr<SpdySessionDependencies> session_deps_;
-    scoped_refptr<HttpNetworkSession> session_;
+    scoped_ptr<HttpNetworkSession> session_;
     TransactionHelperResult output_;
     scoped_ptr<SocketDataProvider> first_transaction_;
     SSLVector ssl_vector_;
@@ -587,7 +585,7 @@
     SpdySessionKey key(host_port_pair, ProxyServer::Direct(),
                        PRIVACY_MODE_DISABLED);
     BoundNetLog log;
-    const scoped_refptr<HttpNetworkSession>& session = helper.session();
+    HttpNetworkSession* session = helper.session();
     base::WeakPtr<SpdySession> spdy_session =
         session->spdy_session_pool()->FindAvailableSession(key, log);
     ASSERT_TRUE(spdy_session != NULL);
@@ -615,7 +613,7 @@
 
     // Request the pushed path.
     scoped_ptr<HttpNetworkTransaction> trans2(
-        new HttpNetworkTransaction(DEFAULT_PRIORITY, helper.session().get()));
+        new HttpNetworkTransaction(DEFAULT_PRIORITY, helper.session()));
     rv = trans2->Start(
         &CreateGetPushRequest(), callback.callback(), BoundNetLog());
     EXPECT_EQ(ERR_IO_PENDING, rv);
@@ -654,12 +652,11 @@
     helper->ResetTrans();
   }
 
-  static void StartTransactionCallback(
-      const scoped_refptr<HttpNetworkSession>& session,
-      GURL url,
-      int result) {
+  static void StartTransactionCallback(HttpNetworkSession* session,
+                                       GURL url,
+                                       int result) {
     scoped_ptr<HttpNetworkTransaction> trans(
-        new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get()));
+        new HttpNetworkTransaction(DEFAULT_PRIORITY, session));
     TestCompletionCallback callback;
     HttpRequestInfo request;
     request.method = "GET";
@@ -724,7 +721,7 @@
 TEST_P(SpdyNetworkTransactionTest, Constructor) {
   scoped_ptr<SpdySessionDependencies> session_deps(
       CreateSpdySessionDependencies(GetParam()));
-  scoped_refptr<HttpNetworkSession> session(
+  scoped_ptr<HttpNetworkSession> session(
       SpdySessionDependencies::SpdyCreateSession(session_deps.get()));
   scoped_ptr<HttpTransaction> trans(
       new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get()));
@@ -892,11 +889,11 @@
   helper.AddData(&data_placeholder);
   helper.AddData(&data_placeholder);
   scoped_ptr<HttpNetworkTransaction> trans1(
-      new HttpNetworkTransaction(DEFAULT_PRIORITY, helper.session().get()));
+      new HttpNetworkTransaction(DEFAULT_PRIORITY, helper.session()));
   scoped_ptr<HttpNetworkTransaction> trans2(
-      new HttpNetworkTransaction(DEFAULT_PRIORITY, helper.session().get()));
+      new HttpNetworkTransaction(DEFAULT_PRIORITY, helper.session()));
   scoped_ptr<HttpNetworkTransaction> trans3(
-      new HttpNetworkTransaction(DEFAULT_PRIORITY, helper.session().get()));
+      new HttpNetworkTransaction(DEFAULT_PRIORITY, helper.session()));
 
   TestCompletionCallback callback1;
   TestCompletionCallback callback2;
@@ -977,9 +974,9 @@
   // on will negotiate SPDY and will be used for all requests.
   helper.AddData(&data_placeholder);
   scoped_ptr<HttpNetworkTransaction> trans1(
-      new HttpNetworkTransaction(DEFAULT_PRIORITY, helper.session().get()));
+      new HttpNetworkTransaction(DEFAULT_PRIORITY, helper.session()));
   scoped_ptr<HttpNetworkTransaction> trans2(
-      new HttpNetworkTransaction(DEFAULT_PRIORITY, helper.session().get()));
+      new HttpNetworkTransaction(DEFAULT_PRIORITY, helper.session()));
 
   TestCompletionCallback callback1;
   TestCompletionCallback callback2;
@@ -1065,9 +1062,9 @@
   helper.AddData(&data_placeholder);
 
   scoped_ptr<HttpNetworkTransaction> trans1(
-      new HttpNetworkTransaction(DEFAULT_PRIORITY, helper.session().get()));
+      new HttpNetworkTransaction(DEFAULT_PRIORITY, helper.session()));
   scoped_ptr<HttpNetworkTransaction> trans2(
-      new HttpNetworkTransaction(DEFAULT_PRIORITY, helper.session().get()));
+      new HttpNetworkTransaction(DEFAULT_PRIORITY, helper.session()));
 
   TestCompletionCallback callback1;
   TestCompletionCallback callback2;
@@ -1182,11 +1179,11 @@
     helper.RunPreTestSetup();
     helper.AddData(&data);
     scoped_ptr<HttpNetworkTransaction> trans1(
-        new HttpNetworkTransaction(DEFAULT_PRIORITY, helper.session().get()));
+        new HttpNetworkTransaction(DEFAULT_PRIORITY, helper.session()));
     scoped_ptr<HttpNetworkTransaction> trans2(
-        new HttpNetworkTransaction(DEFAULT_PRIORITY, helper.session().get()));
+        new HttpNetworkTransaction(DEFAULT_PRIORITY, helper.session()));
     scoped_ptr<HttpNetworkTransaction> trans3(
-        new HttpNetworkTransaction(DEFAULT_PRIORITY, helper.session().get()));
+        new HttpNetworkTransaction(DEFAULT_PRIORITY, helper.session()));
 
     TestCompletionCallback callback1;
     TestCompletionCallback callback2;
@@ -1317,13 +1314,13 @@
   helper.AddData(&data);
 
   scoped_ptr<HttpNetworkTransaction> trans1(
-      new HttpNetworkTransaction(DEFAULT_PRIORITY, helper.session().get()));
+      new HttpNetworkTransaction(DEFAULT_PRIORITY, helper.session()));
   scoped_ptr<HttpNetworkTransaction> trans2(
-      new HttpNetworkTransaction(DEFAULT_PRIORITY, helper.session().get()));
+      new HttpNetworkTransaction(DEFAULT_PRIORITY, helper.session()));
   scoped_ptr<HttpNetworkTransaction> trans3(
-      new HttpNetworkTransaction(DEFAULT_PRIORITY, helper.session().get()));
+      new HttpNetworkTransaction(DEFAULT_PRIORITY, helper.session()));
   scoped_ptr<HttpNetworkTransaction> trans4(
-      new HttpNetworkTransaction(HIGHEST, helper.session().get()));
+      new HttpNetworkTransaction(HIGHEST, helper.session()));
 
   TestCompletionCallback callback1;
   TestCompletionCallback callback2;
@@ -1446,11 +1443,11 @@
   helper.RunPreTestSetup();
   helper.AddData(&data);
   scoped_ptr<HttpNetworkTransaction> trans1(
-      new HttpNetworkTransaction(DEFAULT_PRIORITY, helper.session().get()));
+      new HttpNetworkTransaction(DEFAULT_PRIORITY, helper.session()));
   scoped_ptr<HttpNetworkTransaction> trans2(
-      new HttpNetworkTransaction(DEFAULT_PRIORITY, helper.session().get()));
+      new HttpNetworkTransaction(DEFAULT_PRIORITY, helper.session()));
   scoped_ptr<HttpNetworkTransaction> trans3(
-      new HttpNetworkTransaction(DEFAULT_PRIORITY, helper.session().get()));
+      new HttpNetworkTransaction(DEFAULT_PRIORITY, helper.session()));
 
   TestCompletionCallback callback1;
   TestCompletionCallback callback2;
@@ -1577,10 +1574,10 @@
   // there needs to be three sets of SSL connection data.
   helper.AddData(&data_placeholder);
   helper.AddData(&data_placeholder);
-  HttpNetworkTransaction trans1(DEFAULT_PRIORITY, helper.session().get());
-  HttpNetworkTransaction trans2(DEFAULT_PRIORITY, helper.session().get());
+  HttpNetworkTransaction trans1(DEFAULT_PRIORITY, helper.session());
+  HttpNetworkTransaction trans2(DEFAULT_PRIORITY, helper.session());
   HttpNetworkTransaction* trans3(
-      new HttpNetworkTransaction(DEFAULT_PRIORITY, helper.session().get()));
+      new HttpNetworkTransaction(DEFAULT_PRIORITY, helper.session()));
 
   TestCompletionCallback callback1;
   TestCompletionCallback callback2;
@@ -4552,8 +4549,8 @@
                                      BoundNetLog(), GetParam(), NULL);
   helper.session_deps() = CreateSpdySessionDependencies(
       GetParam(), ProxyService::CreateFixedFromPacResult("PROXY myproxy:70"));
-  helper.SetSession(make_scoped_refptr(
-      SpdySessionDependencies::SpdyCreateSession(helper.session_deps().get())));
+  helper.SetSession(
+      SpdySessionDependencies::SpdyCreateSession(helper.session_deps().get()));
   helper.RunPreTestSetup();
   HttpNetworkTransaction* trans = helper.trans();
 
@@ -4617,8 +4614,8 @@
   helper.session_deps() = CreateSpdySessionDependencies(
       GetParam(),
       ProxyService::CreateFixedFromPacResult("DIRECT; PROXY myproxy:70"));
-  helper.SetSession(make_scoped_refptr(
-      SpdySessionDependencies::SpdyCreateSession(helper.session_deps().get())));
+  helper.SetSession(
+      SpdySessionDependencies::SpdyCreateSession(helper.session_deps().get()));
 
   SpdySessionPool* spdy_session_pool = helper.session()->spdy_session_pool();
   helper.RunPreTestSetup();
@@ -4703,16 +4700,16 @@
   scoped_ptr<SpdySessionDependencies> ssd_proxy(
       CreateSpdySessionDependencies(GetParam()));
   // Ensure that this transaction uses the same SpdySessionPool.
-  scoped_refptr<HttpNetworkSession> session_proxy(
+  scoped_ptr<HttpNetworkSession> session_proxy(
       SpdySessionDependencies::SpdyCreateSession(ssd_proxy.get()));
   NormalSpdyTransactionHelper helper_proxy(request_proxy, DEFAULT_PRIORITY,
                                            BoundNetLog(), GetParam(), NULL);
-  HttpNetworkSessionPeer session_peer(session_proxy);
+  HttpNetworkSessionPeer session_peer(session_proxy.get());
   scoped_ptr<ProxyService> proxy_service(
       ProxyService::CreateFixedFromPacResult("PROXY myproxy:70"));
   session_peer.SetProxyService(proxy_service.get());
   helper_proxy.session_deps().swap(ssd_proxy);
-  helper_proxy.SetSession(session_proxy);
+  helper_proxy.SetSession(session_proxy.Pass());
   helper_proxy.RunPreTestSetup();
   helper_proxy.AddData(data_proxy.get());
 
@@ -4787,7 +4784,7 @@
 
     for (int i = 0; i < 2; ++i) {
       scoped_ptr<HttpNetworkTransaction> trans(
-          new HttpNetworkTransaction(DEFAULT_PRIORITY, helper.session().get()));
+          new HttpNetworkTransaction(DEFAULT_PRIORITY, helper.session()));
 
       TestCompletionCallback callback;
       int rv = trans->Start(
@@ -5103,7 +5100,7 @@
   // Request the pushed path.  At this point, we've received the push, but the
   // headers are not yet complete.
   scoped_ptr<HttpNetworkTransaction> trans2(
-      new HttpNetworkTransaction(DEFAULT_PRIORITY, helper.session().get()));
+      new HttpNetworkTransaction(DEFAULT_PRIORITY, helper.session()));
   rv = trans2->Start(
       &CreateGetPushRequest(), callback.callback(), BoundNetLog());
   EXPECT_EQ(ERR_IO_PENDING, rv);
@@ -5241,7 +5238,7 @@
   // Request the pushed path.  At this point, we've received the push, but the
   // headers are not yet complete.
   scoped_ptr<HttpNetworkTransaction> trans2(
-      new HttpNetworkTransaction(DEFAULT_PRIORITY, helper.session().get()));
+      new HttpNetworkTransaction(DEFAULT_PRIORITY, helper.session()));
   rv = trans2->Start(
       &CreateGetPushRequest(), callback.callback(), BoundNetLog());
   EXPECT_EQ(ERR_IO_PENDING, rv);
@@ -5357,7 +5354,7 @@
   // Request the pushed path.  At this point, we've received the push, but the
   // headers are not yet complete.
   scoped_ptr<HttpNetworkTransaction> trans2(
-      new HttpNetworkTransaction(DEFAULT_PRIORITY, helper.session().get()));
+      new HttpNetworkTransaction(DEFAULT_PRIORITY, helper.session()));
   rv = trans2->Start(
       &CreateGetPushRequest(), callback.callback(), BoundNetLog());
   EXPECT_EQ(ERR_IO_PENDING, rv);
@@ -5695,7 +5692,7 @@
   HttpRequestInfo info2 = CreateGetRequest();
   TestCompletionCallback callback2;
   scoped_ptr<HttpNetworkTransaction> trans2(
-      new HttpNetworkTransaction(MEDIUM, helper.session().get()));
+      new HttpNetworkTransaction(MEDIUM, helper.session()));
   rv = trans2->Start(&info2, callback2.callback(), BoundNetLog());
   EXPECT_EQ(ERR_IO_PENDING, rv);
   base::RunLoop().RunUntilIdle();
@@ -5703,7 +5700,7 @@
   HttpRequestInfo info3 = CreateGetRequest();
   TestCompletionCallback callback3;
   scoped_ptr<HttpNetworkTransaction> trans3(
-      new HttpNetworkTransaction(HIGHEST, helper.session().get()));
+      new HttpNetworkTransaction(HIGHEST, helper.session()));
   rv = trans3->Start(&info3, callback3.callback(), BoundNetLog());
   EXPECT_EQ(ERR_IO_PENDING, rv);
   base::RunLoop().RunUntilIdle();
diff --git a/net/spdy/spdy_proxy_client_socket_unittest.cc b/net/spdy/spdy_proxy_client_socket_unittest.cc
index de9cb0d..0a2ae8e 100644
--- a/net/spdy/spdy_proxy_client_socket_unittest.cc
+++ b/net/spdy/spdy_proxy_client_socket_unittest.cc
@@ -123,7 +123,7 @@
   BoundTestNetLog net_log_;
 
  private:
-  scoped_refptr<HttpNetworkSession> session_;
+  scoped_ptr<HttpNetworkSession> session_;
   scoped_refptr<IOBuffer> read_buf_;
   SpdySessionDependencies session_deps_;
   MockConnect connect_data_;
@@ -147,7 +147,6 @@
 
 SpdyProxyClientSocketTest::SpdyProxyClientSocketTest()
     : spdy_util_(GetParam()),
-      session_(NULL),
       read_buf_(NULL),
       session_deps_(GetParam()),
       connect_data_(SYNCHRONOUS, OK),
@@ -189,9 +188,8 @@
       &session_deps_);
 
   // Creates the SPDY session and stream.
-  spdy_session_ =
-      CreateInsecureSpdySession(
-          session_, endpoint_spdy_session_key_, BoundNetLog());
+  spdy_session_ = CreateInsecureSpdySession(
+      session_.get(), endpoint_spdy_session_key_, BoundNetLog());
   base::WeakPtr<SpdyStream> spdy_stream(
       CreateStreamSynchronously(
           SPDY_BIDIRECTIONAL_STREAM, spdy_session_, url_, LOWEST,
diff --git a/net/spdy/spdy_session_pool_unittest.cc b/net/spdy/spdy_session_pool_unittest.cc
index fccfadd..86b3b4a 100644
--- a/net/spdy/spdy_session_pool_unittest.cc
+++ b/net/spdy/spdy_session_pool_unittest.cc
@@ -44,7 +44,7 @@
   void RunIPPoolingTest(SpdyPoolCloseSessionsType close_sessions_type);
 
   SpdySessionDependencies session_deps_;
-  scoped_refptr<HttpNetworkSession> http_session_;
+  scoped_ptr<HttpNetworkSession> http_session_;
   SpdySessionPool* spdy_session_pool_;
 };
 
@@ -115,7 +115,7 @@
 
   // Setup the first session to the first host.
   base::WeakPtr<SpdySession> session =
-      CreateInsecureSpdySession(http_session_, test_key, BoundNetLog());
+      CreateInsecureSpdySession(http_session_.get(), test_key, BoundNetLog());
 
   // Flush the SpdySession::OnReadComplete() task.
   base::MessageLoop::current()->RunUntilIdle();
@@ -160,7 +160,7 @@
   SpdySessionKey key1(test_host_port_pair1, ProxyServer::Direct(),
                       PRIVACY_MODE_DISABLED);
   base::WeakPtr<SpdySession> session1 =
-      CreateInsecureSpdySession(http_session_, key1, BoundNetLog());
+      CreateInsecureSpdySession(http_session_.get(), key1, BoundNetLog());
   GURL url1(kTestHost1);
   base::WeakPtr<SpdyStream> spdy_stream1 =
       CreateStreamSynchronously(SPDY_BIDIRECTIONAL_STREAM,
@@ -174,7 +174,7 @@
   SpdySessionKey key2(test_host_port_pair2, ProxyServer::Direct(),
                       PRIVACY_MODE_DISABLED);
   base::WeakPtr<SpdySession> session2 =
-      CreateInsecureSpdySession(http_session_, key2, BoundNetLog());
+      CreateInsecureSpdySession(http_session_.get(), key2, BoundNetLog());
   GURL url2(kTestHost2);
   base::WeakPtr<SpdyStream> spdy_stream2 =
       CreateStreamSynchronously(SPDY_BIDIRECTIONAL_STREAM,
@@ -188,7 +188,7 @@
   SpdySessionKey key3(test_host_port_pair3, ProxyServer::Direct(),
                       PRIVACY_MODE_DISABLED);
   base::WeakPtr<SpdySession> session3 =
-      CreateInsecureSpdySession(http_session_, key3, BoundNetLog());
+      CreateInsecureSpdySession(http_session_.get(), key3, BoundNetLog());
   GURL url3(kTestHost3);
   base::WeakPtr<SpdyStream> spdy_stream3 =
       CreateStreamSynchronously(SPDY_BIDIRECTIONAL_STREAM,
@@ -286,7 +286,7 @@
 
   // Setup the first session to the first host.
   base::WeakPtr<SpdySession> session =
-      CreateInsecureSpdySession(http_session_, test_key, BoundNetLog());
+      CreateInsecureSpdySession(http_session_.get(), test_key, BoundNetLog());
 
   // Flush the SpdySession::OnReadComplete() task.
   base::MessageLoop::current()->RunUntilIdle();
@@ -375,9 +375,8 @@
   CreateNetworkSession();
 
   // Setup the first session to the first host.
-  base::WeakPtr<SpdySession> session =
-      CreateInsecureSpdySession(
-          http_session_, test_hosts[0].key, BoundNetLog());
+  base::WeakPtr<SpdySession> session = CreateInsecureSpdySession(
+      http_session_.get(), test_hosts[0].key, BoundNetLog());
 
   // Flush the SpdySession::OnReadComplete() task.
   base::MessageLoop::current()->RunUntilIdle();
@@ -399,9 +398,8 @@
 
   // Create a new session to host 2.
   session_deps_.socket_factory->AddSocketDataProvider(&data);
-  base::WeakPtr<SpdySession> session2 =
-      CreateInsecureSpdySession(
-          http_session_, test_hosts[2].key, BoundNetLog());
+  base::WeakPtr<SpdySession> session2 = CreateInsecureSpdySession(
+      http_session_.get(), test_hosts[2].key, BoundNetLog());
 
   // Verify that we have sessions for everything.
   EXPECT_TRUE(HasSpdySession(spdy_session_pool_, test_hosts[0].key));
@@ -538,7 +536,7 @@
   SpdySessionKey keyA(
       test_host_port_pairA, ProxyServer::Direct(), PRIVACY_MODE_DISABLED);
   base::WeakPtr<SpdySession> sessionA =
-      CreateInsecureSpdySession(http_session_, keyA, BoundNetLog());
+      CreateInsecureSpdySession(http_session_.get(), keyA, BoundNetLog());
 
   GURL urlA(kTestHostA);
   base::WeakPtr<SpdyStream> spdy_streamA = CreateStreamSynchronously(
@@ -564,7 +562,7 @@
   SpdySessionKey keyB(
       test_host_port_pairB, ProxyServer::Direct(), PRIVACY_MODE_DISABLED);
   base::WeakPtr<SpdySession> sessionB =
-      CreateInsecureSpdySession(http_session_, keyB, BoundNetLog());
+      CreateInsecureSpdySession(http_session_.get(), keyB, BoundNetLog());
   EXPECT_TRUE(sessionB->IsAvailable());
 
   GURL urlB(kTestHostB);
@@ -580,7 +578,7 @@
   SpdySessionKey keyC(
       test_host_port_pairC, ProxyServer::Direct(), PRIVACY_MODE_DISABLED);
   base::WeakPtr<SpdySession> sessionC =
-      CreateInsecureSpdySession(http_session_, keyC, BoundNetLog());
+      CreateInsecureSpdySession(http_session_.get(), keyC, BoundNetLog());
 
   sessionC->CloseSessionOnError(ERR_SPDY_PROTOCOL_ERROR, "Error!");
   EXPECT_TRUE(sessionC->IsDraining());
diff --git a/net/spdy/spdy_session_unittest.cc b/net/spdy/spdy_session_unittest.cc
index 23b9dacf..34f92101 100644
--- a/net/spdy/spdy_session_unittest.cc
+++ b/net/spdy/spdy_session_unittest.cc
@@ -135,8 +135,8 @@
 
   void CreateInsecureSpdySession() {
     DCHECK(!session_);
-    session_ =
-        ::net::CreateInsecureSpdySession(http_session_, key_, log_.bound());
+    session_ = ::net::CreateInsecureSpdySession(http_session_.get(), key_,
+                                                log_.bound());
   }
 
   void StallSessionSend() {
@@ -174,7 +174,7 @@
 
   SpdyTestUtil spdy_util_;
   SpdySessionDependencies session_deps_;
-  scoped_refptr<HttpNetworkSession> http_session_;
+  scoped_ptr<HttpNetworkSession> http_session_;
   base::WeakPtr<SpdySession> session_;
   SpdySessionPool* spdy_session_pool_;
   GURL test_url_;
@@ -314,7 +314,7 @@
   CreateNetworkSession();
 
   session_ = TryCreateInsecureSpdySessionExpectingFailure(
-      http_session_, key_, ERR_CONNECTION_CLOSED, BoundNetLog());
+      http_session_.get(), key_, ERR_CONNECTION_CLOSED, BoundNetLog());
   base::RunLoop().RunUntilIdle();
 
   EXPECT_FALSE(session_);
@@ -2210,7 +2210,7 @@
 
   CreateNetworkSession();
 
-  session_ = CreateSecureSpdySession(http_session_, key_, BoundNetLog());
+  session_ = CreateSecureSpdySession(http_session_.get(), key_, BoundNetLog());
 
   EXPECT_TRUE(session_->VerifyDomainAuthentication("www.example.org"));
   EXPECT_TRUE(session_->VerifyDomainAuthentication("mail.example.org"));
@@ -2240,7 +2240,7 @@
 
   CreateNetworkSession();
 
-  session_ = CreateSecureSpdySession(http_session_, key_, BoundNetLog());
+  session_ = CreateSecureSpdySession(http_session_.get(), key_, BoundNetLog());
 
   EXPECT_TRUE(session_->VerifyDomainAuthentication("www.example.org"));
   EXPECT_TRUE(session_->VerifyDomainAuthentication("mail.example.org"));
@@ -3050,8 +3050,8 @@
   // Create an idle SPDY session.
   SpdySessionKey key1(HostPortPair("1.com", 80), ProxyServer::Direct(),
                       PRIVACY_MODE_DISABLED);
-  base::WeakPtr<SpdySession> session1 =
-      ::net::CreateInsecureSpdySession(http_session_, key1, BoundNetLog());
+  base::WeakPtr<SpdySession> session1 = ::net::CreateInsecureSpdySession(
+      http_session_.get(), key1, BoundNetLog());
   EXPECT_FALSE(pool->IsStalled());
 
   // Set up an alias for the idle SPDY session, increasing its ref count to 2.
diff --git a/net/spdy/spdy_stream_unittest.cc b/net/spdy/spdy_stream_unittest.cc
index 044be4bd..e4fd077 100644
--- a/net/spdy/spdy_stream_unittest.cc
+++ b/net/spdy/spdy_stream_unittest.cc
@@ -55,7 +55,7 @@
   base::WeakPtr<SpdySession> CreateDefaultSpdySession() {
     SpdySessionKey key(HostPortPair("www.example.org", 80),
                        ProxyServer::Direct(), PRIVACY_MODE_DISABLED);
-    return CreateInsecureSpdySession(session_, key, BoundNetLog());
+    return CreateInsecureSpdySession(session_.get(), key, BoundNetLog());
   }
 
   void TearDown() override { base::MessageLoop::current()->RunUntilIdle(); }
@@ -99,7 +99,7 @@
 
   SpdyTestUtil spdy_util_;
   SpdySessionDependencies session_deps_;
-  scoped_refptr<HttpNetworkSession> session_;
+  scoped_ptr<HttpNetworkSession> session_;
 
  private:
   // Used by Add{Read,Write}() above.
diff --git a/net/spdy/spdy_test_util_common.cc b/net/spdy/spdy_test_util_common.cc
index 34352e4..9fbbdbf 100644
--- a/net/spdy/spdy_test_util_common.cc
+++ b/net/spdy/spdy_test_util_common.cc
@@ -417,26 +417,27 @@
 SpdySessionDependencies::~SpdySessionDependencies() {}
 
 // static
-HttpNetworkSession* SpdySessionDependencies::SpdyCreateSession(
+scoped_ptr<HttpNetworkSession> SpdySessionDependencies::SpdyCreateSession(
     SpdySessionDependencies* session_deps) {
   HttpNetworkSession::Params params = CreateSessionParams(session_deps);
   params.client_socket_factory = session_deps->socket_factory.get();
-  HttpNetworkSession* http_session = new HttpNetworkSession(params);
+  scoped_ptr<HttpNetworkSession> http_session(new HttpNetworkSession(params));
   SpdySessionPoolPeer pool_peer(http_session->spdy_session_pool());
   pool_peer.SetEnableSendingInitialData(false);
-  return http_session;
+  return http_session.Pass();
 }
 
 // static
-HttpNetworkSession* SpdySessionDependencies::SpdyCreateSessionDeterministic(
+scoped_ptr<HttpNetworkSession>
+SpdySessionDependencies::SpdyCreateSessionDeterministic(
     SpdySessionDependencies* session_deps) {
   HttpNetworkSession::Params params = CreateSessionParams(session_deps);
   params.client_socket_factory =
       session_deps->deterministic_socket_factory.get();
-  HttpNetworkSession* http_session = new HttpNetworkSession(params);
+  scoped_ptr<HttpNetworkSession> http_session(new HttpNetworkSession(params));
   SpdySessionPoolPeer pool_peer(http_session->spdy_session_pool());
   pool_peer.SetEnableSendingInitialData(false);
-  return http_session;
+  return http_session.Pass();
 }
 
 // static
@@ -501,12 +502,14 @@
   params.enable_spdy_ping_based_connection_checking = false;
   params.spdy_default_protocol = protocol;
   params.http_server_properties = http_server_properties();
-  scoped_refptr<HttpNetworkSession> network_session(
-      new HttpNetworkSession(params));
-  SpdySessionPoolPeer pool_peer(network_session->spdy_session_pool());
+  storage_.set_http_network_session(
+      make_scoped_ptr(new HttpNetworkSession(params)));
+  SpdySessionPoolPeer pool_peer(
+      storage_.http_network_session()->spdy_session_pool());
   pool_peer.SetEnableSendingInitialData(false);
-  storage_.set_http_transaction_factory(make_scoped_ptr(new HttpCache(
-      network_session.get(), HttpCache::DefaultBackend::InMemory(0))));
+  storage_.set_http_transaction_factory(make_scoped_ptr(
+      new HttpCache(storage_.http_network_session(),
+                    HttpCache::DefaultBackend::InMemory(0), false)));
 }
 
 SpdyURLRequestContext::~SpdyURLRequestContext() {
@@ -520,7 +523,7 @@
 namespace {
 
 base::WeakPtr<SpdySession> CreateSpdySessionHelper(
-    const scoped_refptr<HttpNetworkSession>& http_session,
+    HttpNetworkSession* http_session,
     const SpdySessionKey& key,
     const BoundNetLog& net_log,
     Error expected_status,
@@ -581,7 +584,7 @@
 }  // namespace
 
 base::WeakPtr<SpdySession> CreateInsecureSpdySession(
-    const scoped_refptr<HttpNetworkSession>& http_session,
+    HttpNetworkSession* http_session,
     const SpdySessionKey& key,
     const BoundNetLog& net_log) {
   return CreateSpdySessionHelper(http_session, key, net_log,
@@ -589,7 +592,7 @@
 }
 
 base::WeakPtr<SpdySession> TryCreateInsecureSpdySessionExpectingFailure(
-    const scoped_refptr<HttpNetworkSession>& http_session,
+    HttpNetworkSession* http_session,
     const SpdySessionKey& key,
     Error expected_error,
     const BoundNetLog& net_log) {
@@ -599,7 +602,7 @@
 }
 
 base::WeakPtr<SpdySession> CreateSecureSpdySession(
-    const scoped_refptr<HttpNetworkSession>& http_session,
+    HttpNetworkSession* http_session,
     const SpdySessionKey& key,
     const BoundNetLog& net_log) {
   return CreateSpdySessionHelper(http_session, key, net_log,
diff --git a/net/spdy/spdy_test_util_common.h b/net/spdy/spdy_test_util_common.h
index 68bdfdf..7a3d272c 100644
--- a/net/spdy/spdy_test_util_common.h
+++ b/net/spdy/spdy_test_util_common.h
@@ -194,9 +194,9 @@
 
   ~SpdySessionDependencies();
 
-  static HttpNetworkSession* SpdyCreateSession(
+  static scoped_ptr<HttpNetworkSession> SpdyCreateSession(
       SpdySessionDependencies* session_deps);
-  static HttpNetworkSession* SpdyCreateSessionDeterministic(
+  static scoped_ptr<HttpNetworkSession> SpdyCreateSessionDeterministic(
       SpdySessionDependencies* session_deps);
   static HttpNetworkSession::Params CreateSessionParams(
       SpdySessionDependencies* session_deps);
@@ -244,7 +244,7 @@
 // session pool in |http_session|. A SPDY session for |key| must not
 // already exist.
 base::WeakPtr<SpdySession> CreateInsecureSpdySession(
-    const scoped_refptr<HttpNetworkSession>& http_session,
+    HttpNetworkSession* http_session,
     const SpdySessionKey& key,
     const BoundNetLog& net_log);
 
@@ -253,14 +253,14 @@
 // not already exist. The session will be created but close in the
 // next event loop iteration.
 base::WeakPtr<SpdySession> TryCreateInsecureSpdySessionExpectingFailure(
-    const scoped_refptr<HttpNetworkSession>& http_session,
+    HttpNetworkSession* http_session,
     const SpdySessionKey& key,
     Error expected_error,
     const BoundNetLog& net_log);
 
 // Like CreateInsecureSpdySession(), but uses TLS.
 base::WeakPtr<SpdySession> CreateSecureSpdySession(
-    const scoped_refptr<HttpNetworkSession>& http_session,
+    HttpNetworkSession* http_session,
     const SpdySessionKey& key,
     const BoundNetLog& net_log);
 
diff --git a/net/url_request/url_fetcher_core.cc b/net/url_request/url_fetcher_core.cc
index 1ecf9e54..1dafe84 100644
--- a/net/url_request/url_fetcher_core.cc
+++ b/net/url_request/url_fetcher_core.cc
@@ -7,12 +7,14 @@
 #include <stdint.h>
 
 #include "base/bind.h"
+#include "base/debug/dump_without_crashing.h"
 #include "base/logging.h"
 #include "base/metrics/histogram_macros.h"
 #include "base/profiler/scoped_tracker.h"
 #include "base/sequenced_task_runner.h"
 #include "base/single_thread_task_runner.h"
 #include "base/stl_util.h"
+#include "base/strings/string_util.h"
 #include "base/thread_task_runner_handle.h"
 #include "base/tracked_objects.h"
 #include "net/base/elements_upload_data_stream.h"
@@ -735,6 +737,22 @@
 }
 
 void URLFetcherCore::DidFinishWriting(int result) {
+  // Record a stack trace if saved more than 1 MB to an in-memory string.
+  // TODO(mmenke):  Remove once a hard limit on the URLFetcherStringWriter's
+  // buffer size has been implemented.  See https://crbug.com/535601.
+  URLFetcherStringWriter* string_writer =
+      response_writer_ ? response_writer_->AsStringWriter() : nullptr;
+  if (string_writer && string_writer->data().size() > 1024 * 1024) {
+    char url_buf[128];
+    base::strlcpy(url_buf, original_url_.spec().c_str(), arraysize(url_buf));
+    size_t response_size = string_writer->data().size();
+    base::debug::StackTrace stack_trace = stack_trace_;
+    base::debug::Alias(url_buf);
+    base::debug::Alias(&response_size);
+    base::debug::Alias(&stack_trace);
+    base::debug::DumpWithoutCrashing();
+  }
+
   if (result != OK) {
     CancelRequestAndInformDelegate(result);
     return;
diff --git a/net/url_request/url_request_context_builder.cc b/net/url_request/url_request_context_builder.cc
index e2c77e9..76d85c0f 100644
--- a/net/url_request/url_request_context_builder.cc
+++ b/net/url_request/url_request_context_builder.cc
@@ -386,9 +386,12 @@
   network_session_params.quic_connection_options =
       http_network_session_params_.quic_connection_options;
 
+  storage->set_http_network_session(
+      make_scoped_ptr(new HttpNetworkSession(network_session_params)));
+
   scoped_ptr<HttpTransactionFactory> http_transaction_factory;
   if (http_cache_enabled_) {
-    HttpCache::BackendFactory* http_cache_backend = NULL;
+    HttpCache::BackendFactory* http_cache_backend;
     if (http_cache_params_.type == HttpCacheParams::DISK) {
       http_cache_backend = new HttpCache::DefaultBackend(
           DISK_CACHE, CACHE_BACKEND_DEFAULT, http_cache_params_.path,
@@ -398,13 +401,11 @@
           HttpCache::DefaultBackend::InMemory(http_cache_params_.max_size);
     }
 
-    http_transaction_factory.reset(
-        new HttpCache(network_session_params, http_cache_backend));
+    http_transaction_factory.reset(new HttpCache(
+        storage->http_network_session(), http_cache_backend, true));
   } else {
-    scoped_refptr<HttpNetworkSession> network_session(
-        new HttpNetworkSession(network_session_params));
-
-    http_transaction_factory.reset(new HttpNetworkLayer(network_session.get()));
+    http_transaction_factory.reset(
+        new HttpNetworkLayer(storage->http_network_session()));
   }
   storage->set_http_transaction_factory(http_transaction_factory.Pass());
 
diff --git a/net/url_request/url_request_context_storage.cc b/net/url_request/url_request_context_storage.cc
index 451fa96..e4294b2 100644
--- a/net/url_request/url_request_context_storage.cc
+++ b/net/url_request/url_request_context_storage.cc
@@ -96,6 +96,11 @@
   transport_security_state_ = transport_security_state.Pass();
 }
 
+void URLRequestContextStorage::set_http_network_session(
+    scoped_ptr<HttpNetworkSession> http_network_session) {
+  http_network_session_ = http_network_session.Pass();
+}
+
 void URLRequestContextStorage::set_http_transaction_factory(
     scoped_ptr<HttpTransactionFactory> http_transaction_factory) {
   context_->set_http_transaction_factory(http_transaction_factory.get());
diff --git a/net/url_request/url_request_context_storage.h b/net/url_request/url_request_context_storage.h
index 8e2bf0ea..77c2807a 100644
--- a/net/url_request/url_request_context_storage.h
+++ b/net/url_request/url_request_context_storage.h
@@ -18,6 +18,7 @@
 class FtpTransactionFactory;
 class HostResolver;
 class HttpAuthHandlerFactory;
+class HttpNetworkSession;
 class HttpServerProperties;
 class HttpTransactionFactory;
 class HttpUserAgentSettings;
@@ -59,6 +60,8 @@
   void set_cookie_store(CookieStore* cookie_store);
   void set_transport_security_state(
       scoped_ptr<TransportSecurityState> transport_security_state);
+  void set_http_network_session(
+      scoped_ptr<HttpNetworkSession> http_network_session);
   void set_http_transaction_factory(
       scoped_ptr<HttpTransactionFactory> http_transaction_factory);
   void set_job_factory(scoped_ptr<URLRequestJobFactory> job_factory);
@@ -70,6 +73,12 @@
       scoped_ptr<HttpUserAgentSettings> http_user_agent_settings);
   void set_sdch_manager(scoped_ptr<SdchManager> sdch_manager);
 
+  // Everything else can be access through the URLRequestContext, but this
+  // cannot.  Having an accessor for it makes usage a little cleaner.
+  HttpNetworkSession* http_network_session() const {
+    return http_network_session_.get();
+  }
+
  private:
   // We use a raw pointer to prevent reference cycles, since
   // URLRequestContextStorage can often be contained within a URLRequestContext
@@ -92,6 +101,10 @@
   scoped_refptr<CookieStore> cookie_store_;
   scoped_ptr<TransportSecurityState> transport_security_state_;
 
+  // Not actually pointed at by the URLRequestContext, but may be used (but not
+  // owned) by the HttpTransactionFactory.
+  scoped_ptr<HttpNetworkSession> http_network_session_;
+
   scoped_ptr<HttpTransactionFactory> http_transaction_factory_;
   scoped_ptr<URLRequestJobFactory> job_factory_;
   scoped_ptr<URLRequestThrottlerManager> throttler_manager_;
diff --git a/net/url_request/url_request_test_util.cc b/net/url_request/url_request_test_util.cc
index 91c35426..0c240b8 100644
--- a/net/url_request/url_request_test_util.cc
+++ b/net/url_request/url_request_test_util.cc
@@ -108,10 +108,11 @@
     params.network_delegate = network_delegate();
     params.http_server_properties = http_server_properties();
     params.net_log = net_log();
-    context_storage_.set_http_transaction_factory(
-        make_scoped_ptr(new HttpCache(new HttpNetworkSession(params),
-                                      HttpCache::DefaultBackend::InMemory(0)))
-            .Pass());
+    context_storage_.set_http_network_session(
+        make_scoped_ptr(new HttpNetworkSession(params)));
+    context_storage_.set_http_transaction_factory(make_scoped_ptr(
+        new HttpCache(context_storage_.http_network_session(),
+                      HttpCache::DefaultBackend::InMemory(0), false)));
   }
   // In-memory cookie store.
   if (!cookie_store())
diff --git a/net/url_request/url_request_unittest.cc b/net/url_request/url_request_unittest.cc
index 645173e..f91a283 100644
--- a/net/url_request/url_request_unittest.cc
+++ b/net/url_request/url_request_unittest.cc
@@ -7090,12 +7090,13 @@
       default_context_.http_auth_handler_factory();
   params.network_delegate = &default_network_delegate_;
   params.http_server_properties = default_context_.http_server_properties();
+  HttpNetworkSession network_session(params);
   scoped_ptr<HttpNetworkLayer> network_layer(
-      new HttpNetworkLayer(new HttpNetworkSession(params)));
+      new HttpNetworkLayer(&network_session));
   network_layer->OnSuspend();
 
   HttpCache http_cache(network_layer.release(), default_context_.net_log(),
-                       HttpCache::DefaultBackend::InMemory(0));
+                       HttpCache::DefaultBackend::InMemory(0), true);
 
   TestURLRequestContext context(true);
   context.set_http_transaction_factory(&http_cache);
@@ -7127,7 +7128,8 @@
       default_context_.http_auth_handler_factory();
   params.network_delegate = &default_network_delegate_;
   params.http_server_properties = default_context_.http_server_properties();
-  HttpNetworkLayer network_layer(new HttpNetworkSession(params));
+  HttpNetworkSession network_session(params);
+  HttpNetworkLayer network_layer(&network_session);
   network_layer.OnSuspend();
 
   TestURLRequestContext context(true);
@@ -8158,9 +8160,9 @@
   params.http_server_properties = default_context_.http_server_properties();
   params.ssl_session_cache_shard = "alternate";
 
+  HttpNetworkSession network_session(params);
   scoped_ptr<HttpCache> cache(new HttpCache(
-      new HttpNetworkSession(params),
-      HttpCache::DefaultBackend::InMemory(0)));
+      &network_session, HttpCache::DefaultBackend::InMemory(0), false));
 
   default_context_.set_http_transaction_factory(cache.get());
 
diff --git a/net/url_request/view_cache_helper_unittest.cc b/net/url_request/view_cache_helper_unittest.cc
index 284482ac..e10b203 100644
--- a/net/url_request/view_cache_helper_unittest.cc
+++ b/net/url_request/view_cache_helper_unittest.cc
@@ -31,8 +31,10 @@
 };
 
 TestURLRequestContext::TestURLRequestContext()
-    : cache_(new MockNetworkLayer(), NULL,
-             HttpCache::DefaultBackend::InMemory(0)) {
+    : cache_(new MockNetworkLayer(),
+             nullptr,
+             HttpCache::DefaultBackend::InMemory(0),
+             true) {
   set_http_transaction_factory(&cache_);
 }
 
diff --git a/net/websockets/websocket_basic_stream.cc b/net/websockets/websocket_basic_stream.cc
index 54f3cbf..c4599f5 100644
--- a/net/websockets/websocket_basic_stream.cc
+++ b/net/websockets/websocket_basic_stream.cc
@@ -4,6 +4,7 @@
 
 #include "net/websockets/websocket_basic_stream.h"
 
+#include <stdint.h>
 #include <algorithm>
 #include <limits>
 #include <string>
@@ -24,9 +25,9 @@
 
 namespace {
 
-// This uses type uint64 to match the definition of
+// This uses type uint64_t to match the definition of
 // WebSocketFrameHeader::payload_length in websocket_frame.h.
-const uint64 kMaxControlFramePayload = 125;
+const uint64_t kMaxControlFramePayload = 125;
 
 // The number of bytes to attempt to read at a time.
 // TODO(ricea): See if there is a better number or algorithm to fulfill our
@@ -47,17 +48,17 @@
 // masked bit of the frames on.
 int CalculateSerializedSizeAndTurnOnMaskBit(
     ScopedVector<WebSocketFrame>* frames) {
-  const uint64 kMaximumTotalSize = std::numeric_limits<int>::max();
+  const uint64_t kMaximumTotalSize = std::numeric_limits<int>::max();
 
-  uint64 total_size = 0;
+  uint64_t total_size = 0;
   for (WebSocketFrameIterator it = frames->begin(); it != frames->end(); ++it) {
     WebSocketFrame* frame = *it;
     // Force the masked bit on.
     frame->header.masked = true;
     // We enforce flow control so the renderer should never be able to force us
     // to cache anywhere near 2GB of frames.
-    uint64 frame_size = frame->header.payload_length +
-        GetWebSocketFrameHeaderSize(frame->header);
+    uint64_t frame_size = frame->header.payload_length +
+                          GetWebSocketFrameHeaderSize(frame->header);
     CHECK_LE(frame_size, kMaximumTotalSize - total_size)
         << "Aborting to prevent overflow";
     total_size += frame_size;
@@ -157,7 +158,8 @@
     dest += result;
     remaining_size -= result;
 
-    CHECK_LE(frame->header.payload_length, static_cast<uint64>(remaining_size));
+    CHECK_LE(frame->header.payload_length,
+             static_cast<uint64_t>(remaining_size));
     const int frame_size = static_cast<int>(frame->header.payload_length);
     if (frame_size > 0) {
       const char* const frame_data = frame->data->data();
@@ -349,10 +351,10 @@
   // header. A check for exact equality can only be used when the whole frame
   // arrives in one chunk.
   DCHECK_GE(current_frame_header_->payload_length,
-            base::checked_cast<uint64>(chunk_size));
+            base::checked_cast<uint64_t>(chunk_size));
   DCHECK(!is_first_chunk || !is_final_chunk ||
          current_frame_header_->payload_length ==
-             base::checked_cast<uint64>(chunk_size));
+             base::checked_cast<uint64_t>(chunk_size));
 
   // Convert the chunk to a complete frame.
   *frame = CreateFrame(is_final_chunk, data_buffer);
diff --git a/net/websockets/websocket_basic_stream_test.cc b/net/websockets/websocket_basic_stream_test.cc
index 9426f59..6917c2a 100644
--- a/net/websockets/websocket_basic_stream_test.cc
+++ b/net/websockets/websocket_basic_stream_test.cc
@@ -795,7 +795,7 @@
   // This should be equal to the definition of kReadBufferSize in
   // websocket_basic_stream.cc.
   const int kReadBufferSize = 32 * 1024;
-  const uint64 kPayloadSize = 1 << 20;
+  const uint64_t kPayloadSize = 1 << 20;
   const size_t kWireSize = kPayloadSize + kLargeFrameHeaderSize;
   const size_t kExpectedFrameCount =
       (kWireSize + kReadBufferSize - 1) / kReadBufferSize;
diff --git a/net/websockets/websocket_channel.cc b/net/websockets/websocket_channel.cc
index 0237ca10..cd7b3fd9 100644
--- a/net/websockets/websocket_channel.cc
+++ b/net/websockets/websocket_channel.cc
@@ -70,7 +70,7 @@
 // used for close codes received from a renderer that we are intending to send
 // out over the network. See ParseClose() for the restrictions on incoming close
 // codes. The |code| parameter is type int for convenience of implementation;
-// the real type is uint16. Code 1005 is treated specially; it cannot be set
+// the real type is uint16_t. Code 1005 is treated specially; it cannot be set
 // explicitly by Javascript but the renderer uses it to indicate we should send
 // a Close frame with no payload.
 bool IsStrictlyValidCloseStatusCode(int code) {
@@ -147,7 +147,7 @@
   // The total size of the payload data in |frames_|. This will be used to
   // measure the throughput of the link.
   // TODO(ricea): Measure the throughput of the link.
-  uint64 total_bytes_;
+  uint64_t total_bytes_;
 };
 
 void WebSocketChannel::SendBuffer::AddFrame(scoped_ptr<WebSocketFrame> frame) {
@@ -275,8 +275,8 @@
     bool final,
     WebSocketFrameHeader::OpCode opcode,
     const scoped_refptr<IOBuffer>& data,
-    uint64 offset,
-    uint64 size)
+    uint64_t offset,
+    uint64_t size)
     : final_(final),
       opcode_(opcode),
       data_(data),
@@ -290,7 +290,7 @@
   opcode_ = WebSocketFrameHeader::kOpCodeContinuation;
 }
 
-void WebSocketChannel::PendingReceivedFrame::DidConsume(uint64 bytes) {
+void WebSocketChannel::PendingReceivedFrame::DidConsume(uint64_t bytes) {
   DCHECK_LE(offset_, size_);
   DCHECK_LE(bytes, size_ - offset_);
   offset_ += bytes;
@@ -424,7 +424,7 @@
   // |this| may have been deleted.
 }
 
-void WebSocketChannel::SendFlowControl(int64 quota) {
+void WebSocketChannel::SendFlowControl(int64_t quota) {
   DCHECK(state_ == CONNECTING || state_ == CONNECTED || state_ == SEND_CLOSED ||
          state_ == CLOSE_WAIT);
   // TODO(ricea): Kill the renderer if it tries to send us a negative quota
@@ -436,9 +436,9 @@
   }
   while (!pending_received_frames_.empty() && quota > 0) {
     PendingReceivedFrame& front = pending_received_frames_.front();
-    const uint64 data_size = front.size() - front.offset();
-    const uint64 bytes_to_send =
-        std::min(base::checked_cast<uint64>(quota), data_size);
+    const uint64_t data_size = front.size() - front.offset();
+    const uint64_t bytes_to_send =
+        std::min(base::checked_cast<uint64_t>(quota), data_size);
     const bool final = front.final() && data_size == bytes_to_send;
     const char* data =
         front.data().get() ? front.data()->data() + front.offset() : NULL;
@@ -470,7 +470,7 @@
   // |this| may have been deleted.
 }
 
-void WebSocketChannel::StartClosingHandshake(uint16 code,
+void WebSocketChannel::StartClosingHandshake(uint16_t code,
                                              const std::string& reason) {
   if (InClosingState()) {
     // When the associated renderer process is killed while the channel is in
@@ -768,7 +768,7 @@
       stream_->Close();
       SetState(CLOSED);
 
-      uint16 code = kWebSocketErrorAbnormalClosure;
+      uint16_t code = kWebSocketErrorAbnormalClosure;
       std::string reason = "";
       bool was_clean = false;
       if (has_received_close_frame_) {
@@ -815,7 +815,7 @@
     const WebSocketFrameHeader::OpCode opcode,
     bool final,
     const scoped_refptr<IOBuffer>& data_buffer,
-    uint64 size) {
+    uint64_t size) {
   DCHECK_NE(RECV_CLOSED, state_)
       << "HandleFrame() does not support being called re-entrantly from within "
          "SendClose()";
@@ -852,7 +852,7 @@
       // the renderer, then the renderer should not receive an
       // OnClosingHandshake or OnDropChannel IPC until the queued message has
       // been completedly transmitted.
-      uint16 code = kWebSocketNormalClosure;
+      uint16_t code = kWebSocketNormalClosure;
       std::string reason;
       std::string message;
       if (!ParseClose(data_buffer, size, &code, &reason, &message)) {
@@ -925,7 +925,7 @@
     WebSocketFrameHeader::OpCode opcode,
     bool final,
     const scoped_refptr<IOBuffer>& data_buffer,
-    uint64 size) {
+    uint64_t size) {
   if (state_ != CONNECTED) {
     DVLOG(3) << "Ignored data packet received in state " << state_;
     return CHANNEL_ALIVE;
@@ -1001,7 +1001,7 @@
     bool fin,
     WebSocketFrameHeader::OpCode op_code,
     const scoped_refptr<IOBuffer>& buffer,
-    uint64 size) {
+    uint64_t size) {
   DCHECK(state_ == CONNECTED || state_ == RECV_CLOSED);
   DCHECK(stream_);
 
@@ -1029,7 +1029,7 @@
 }
 
 ChannelState WebSocketChannel::FailChannel(const std::string& message,
-                                           uint16 code,
+                                           uint16_t code,
                                            const std::string& reason) {
   DCHECK_NE(FRESHLY_CONSTRUCTED, state_);
   DCHECK_NE(CONNECTING, state_);
@@ -1051,12 +1051,12 @@
   return result;
 }
 
-ChannelState WebSocketChannel::SendClose(uint16 code,
+ChannelState WebSocketChannel::SendClose(uint16_t code,
                                          const std::string& reason) {
   DCHECK(state_ == CONNECTED || state_ == RECV_CLOSED);
   DCHECK_LE(reason.size(), kMaximumCloseReasonLength);
   scoped_refptr<IOBuffer> body;
-  uint64 size = 0;
+  uint64_t size = 0;
   if (code == kWebSocketErrorNoStatusReceived) {
     // Special case: translate kWebSocketErrorNoStatusReceived into a Close
     // frame with no payload.
@@ -1080,8 +1080,8 @@
 }
 
 bool WebSocketChannel::ParseClose(const scoped_refptr<IOBuffer>& buffer,
-                                  uint64 size,
-                                  uint16* code,
+                                  uint64_t size,
+                                  uint16_t* code,
                                   std::string* reason,
                                   std::string* message) {
   reason->clear();
@@ -1101,7 +1101,7 @@
   }
 
   const char* data = buffer->data();
-  uint16 unchecked_code = 0;
+  uint16_t unchecked_code = 0;
   base::ReadBigEndian(data, &unchecked_code);
   static_assert(sizeof(unchecked_code) == kWebSocketCloseCodeLength,
                 "they should both be two bytes");
@@ -1133,7 +1133,7 @@
 }
 
 ChannelState WebSocketChannel::DoDropChannel(bool was_clean,
-                                             uint16 code,
+                                             uint16_t code,
                                              const std::string& reason) {
   if (CHANNEL_DELETED ==
       notification_sender_->SendImmediately(event_interface_.get()))
diff --git a/net/websockets/websocket_channel.h b/net/websockets/websocket_channel.h
index bc58574..9904358 100644
--- a/net/websockets/websocket_channel.h
+++ b/net/websockets/websocket_channel.h
@@ -5,6 +5,7 @@
 #ifndef NET_WEBSOCKETS_WEBSOCKET_CHANNEL_H_
 #define NET_WEBSOCKETS_WEBSOCKET_CHANNEL_H_
 
+#include <stdint.h>
 #include <queue>
 #include <string>
 #include <vector>
@@ -84,7 +85,7 @@
   // Sends |quota| units of flow control to the remote side. If the underlying
   // transport has a concept of |quota|, then it permits the remote server to
   // send up to |quota| units of data.
-  void SendFlowControl(int64 quota);
+  void SendFlowControl(int64_t quota);
 
   // Starts the closing handshake for a client-initiated shutdown of the
   // connection. There is no API to close the connection without a closing
@@ -95,7 +96,7 @@
   // This does *not* trigger the event OnClosingHandshake(). The caller should
   // assume that the closing handshake has started and perform the equivalent
   // processing to OnClosingHandshake() if necessary.
-  void StartClosingHandshake(uint16 code, const std::string& reason);
+  void StartClosingHandshake(uint16_t code, const std::string& reason);
 
   // Starts the connection process, using a specified creator callback rather
   // than the default. This is exposed for testing.
@@ -135,8 +136,8 @@
     PendingReceivedFrame(bool final,
                          WebSocketFrameHeader::OpCode opcode,
                          const scoped_refptr<IOBuffer>& data,
-                         uint64 offset,
-                         uint64 size);
+                         uint64_t offset,
+                         uint64_t size);
     ~PendingReceivedFrame();
 
     bool final() const { return final_; }
@@ -144,10 +145,10 @@
     // ResetOpcode() to Continuation.
     void ResetOpcode();
     const scoped_refptr<IOBuffer>& data() const { return data_; }
-    uint64 offset() const { return offset_; }
-    uint64 size() const { return size_; }
+    uint64_t offset() const { return offset_; }
+    uint64_t size() const { return size_; }
     // Increase |offset_| by |bytes|.
-    void DidConsume(uint64 bytes);
+    void DidConsume(uint64_t bytes);
 
     // This object needs to be copyable and assignable, since it will be placed
     // in a std::queue. The compiler-generated copy constructor and assignment
@@ -159,9 +160,9 @@
     scoped_refptr<IOBuffer> data_;
     // Where to start reading from data_. Everything prior to offset_ has
     // already been sent to the browser.
-    uint64 offset_;
+    uint64_t offset_;
     // The size of data_.
-    uint64 size_;
+    uint64_t size_;
   };
 
   // Methods which return a value of type ChannelState may delete |this|. If the
@@ -260,11 +261,10 @@
 
   // Handles a single frame depending on the current state. It's used by the
   // HandleFrame() method.
-  ChannelState HandleFrameByState(
-      const WebSocketFrameHeader::OpCode opcode,
-      bool final,
-      const scoped_refptr<IOBuffer>& data_buffer,
-      uint64 size) WARN_UNUSED_RESULT;
+  ChannelState HandleFrameByState(const WebSocketFrameHeader::OpCode opcode,
+                                  bool final,
+                                  const scoped_refptr<IOBuffer>& data_buffer,
+                                  uint64_t size) WARN_UNUSED_RESULT;
 
   // Forward a received data frame to the renderer, if connected. If
   // |expecting_continuation| is not equal to |expecting_to_read_continuation_|,
@@ -272,7 +272,7 @@
   ChannelState HandleDataFrame(WebSocketFrameHeader::OpCode opcode,
                                bool final,
                                const scoped_refptr<IOBuffer>& data_buffer,
-                               uint64 size) WARN_UNUSED_RESULT;
+                               uint64_t size) WARN_UNUSED_RESULT;
 
   // Low-level method to send a single frame. Used for both data and control
   // frames. Either sends the frame immediately or buffers it to be scheduled
@@ -282,7 +282,7 @@
   ChannelState SendFrameFromIOBuffer(bool fin,
                                      WebSocketFrameHeader::OpCode op_code,
                                      const scoped_refptr<IOBuffer>& buffer,
-                                     uint64 size) WARN_UNUSED_RESULT;
+                                     uint64_t size) WARN_UNUSED_RESULT;
 
   // Performs the "Fail the WebSocket Connection" operation as defined in
   // RFC6455. A NotifyFailure message is sent to the renderer with |message|.
@@ -294,14 +294,14 @@
   // returns CHANNEL_DELETED. It is not valid to access any member variables or
   // methods after calling FailChannel().
   ChannelState FailChannel(const std::string& message,
-                           uint16 code,
+                           uint16_t code,
                            const std::string& reason) WARN_UNUSED_RESULT;
 
   // Sends a Close frame to Start the WebSocket Closing Handshake, or to respond
   // to a Close frame from the server. As a special case, setting |code| to
   // kWebSocketErrorNoStatusReceived will create a Close frame with no payload;
   // this is symmetric with the behaviour of ParseClose.
-  ChannelState SendClose(uint16 code,
+  ChannelState SendClose(uint16_t code,
                          const std::string& reason) WARN_UNUSED_RESULT;
 
   // Parses a Close frame payload. If no status code is supplied, then |code| is
@@ -311,8 +311,8 @@
   // then false is returned and |message| is set to an appropriate console
   // message.
   bool ParseClose(const scoped_refptr<IOBuffer>& buffer,
-                  uint64 size,
-                  uint16* code,
+                  uint64_t size,
+                  uint16_t* code,
                   std::string* reason,
                   std::string* message);
 
@@ -322,7 +322,7 @@
   //
   // Always returns CHANNEL_DELETED.
   ChannelState DoDropChannel(bool was_clean,
-                             uint16 code,
+                             uint16_t code,
                              const std::string& reason);
 
   // Called if the closing handshake times out. Closes the connection and
@@ -373,7 +373,7 @@
   int current_send_quota_;
   // The remaining amount of quota that the renderer will allow us to send on
   // this logical channel (quota units).
-  uint64 current_receive_quota_;
+  uint64_t current_receive_quota_;
 
   // Timer for the closing handshake.
   base::OneShotTimer close_timer_;
@@ -389,7 +389,7 @@
   // arrives until the connection is closed and they are passed to
   // OnDropChannel().
   bool has_received_close_frame_;
-  uint16 received_close_code_;
+  uint16_t received_close_code_;
   std::string received_close_reason_;
 
   // The current state of the channel. Mainly used for sanity checking, but also
diff --git a/net/websockets/websocket_channel_test.cc b/net/websockets/websocket_channel_test.cc
index 3c8a7f1..acbbb8a 100644
--- a/net/websockets/websocket_channel_test.cc
+++ b/net/websockets/websocket_channel_test.cc
@@ -136,7 +136,7 @@
 const int kVeryTinyTimeoutMillis = 1;
 
 // Enough quota to pass any test.
-const int64 kPlentyOfQuota = INT_MAX;
+const int64_t kPlentyOfQuota = INT_MAX;
 
 typedef WebSocketEventInterface::ChannelState ChannelState;
 const ChannelState CHANNEL_ALIVE = WebSocketEventInterface::CHANNEL_ALIVE;
@@ -158,11 +158,11 @@
                ChannelState(bool,
                             WebSocketMessageType,
                             const std::vector<char>&));  // NOLINT
-  MOCK_METHOD1(OnFlowControl, ChannelState(int64));  // NOLINT
+  MOCK_METHOD1(OnFlowControl, ChannelState(int64_t));             // NOLINT
   MOCK_METHOD0(OnClosingHandshake, ChannelState(void));  // NOLINT
   MOCK_METHOD1(OnFailChannel, ChannelState(const std::string&));  // NOLINT
   MOCK_METHOD3(OnDropChannel,
-               ChannelState(bool, uint16, const std::string&));  // NOLINT
+               ChannelState(bool, uint16_t, const std::string&));  // NOLINT
 
   // We can't use GMock with scoped_ptr.
   ChannelState OnStartOpeningHandshake(
@@ -204,13 +204,13 @@
                            const std::vector<char>& data) override {
     return CHANNEL_ALIVE;
   }
-  ChannelState OnFlowControl(int64 quota) override { return CHANNEL_ALIVE; }
+  ChannelState OnFlowControl(int64_t quota) override { return CHANNEL_ALIVE; }
   ChannelState OnClosingHandshake() override { return CHANNEL_ALIVE; }
   ChannelState OnFailChannel(const std::string& message) override {
     return CHANNEL_DELETED;
   }
   ChannelState OnDropChannel(bool was_clean,
-                             uint16 code,
+                             uint16_t code,
                              const std::string& reason) override {
     return CHANNEL_DELETED;
   }
@@ -856,7 +856,7 @@
     return fixture_->DeleteIfDeleting(EVENT_ON_DATA_FRAME);
   }
 
-  ChannelState OnFlowControl(int64 quota) override {
+  ChannelState OnFlowControl(int64_t quota) override {
     return fixture_->DeleteIfDeleting(EVENT_ON_FLOW_CONTROL);
   }
 
@@ -869,7 +869,7 @@
   }
 
   ChannelState OnDropChannel(bool was_clean,
-                             uint16 code,
+                             uint16_t code,
                              const std::string& reason) override {
     return fixture_->DeleteIfDeleting(EVENT_ON_DROP_CHANNEL);
   }
@@ -967,7 +967,7 @@
  protected:
   // Tests using this fixture should use CreateChannelAndConnectWithQuota()
   // instead of CreateChannelAndConnectSuccessfully().
-  void CreateChannelAndConnectWithQuota(int64 quota) {
+  void CreateChannelAndConnectWithQuota(int64_t quota) {
     CreateChannelAndConnect();
     channel_->SendFlowControl(quota);
     connect_data_.creator.connect_delegate->OnSuccess(stream_.Pass());
diff --git a/net/websockets/websocket_deflate_stream.cc b/net/websockets/websocket_deflate_stream.cc
index cf169035..47d2a5b 100644
--- a/net/websockets/websocket_deflate_stream.cc
+++ b/net/websockets/websocket_deflate_stream.cc
@@ -4,6 +4,7 @@
 
 #include "net/websockets/websocket_deflate_stream.h"
 
+#include <stdint.h>
 #include <algorithm>
 #include <string>
 
@@ -242,7 +243,7 @@
     return ERR_WS_PROTOCOL_ERROR;
   }
 
-  uint64 original_payload_length = 0;
+  uint64_t original_payload_length = 0;
   for (size_t i = 0; i < frames->size(); ++i) {
     WebSocketFrame* frame = (*frames)[i];
     // Asserts checking that frames represent one whole data message.
@@ -254,7 +255,7 @@
     original_payload_length += frame->header.payload_length;
   }
   if (original_payload_length <=
-      static_cast<uint64>(compressed_payload->size())) {
+      static_cast<uint64_t>(compressed_payload->size())) {
     // Compression is not effective. Use the original frames.
     for (size_t i = 0; i < frames->size(); ++i) {
       WebSocketFrame* frame = (*frames)[i];
diff --git a/net/websockets/websocket_end_to_end_test.cc b/net/websockets/websocket_end_to_end_test.cc
index 0dfa60cc..fef28095 100644
--- a/net/websockets/websocket_end_to_end_test.cc
+++ b/net/websockets/websocket_end_to_end_test.cc
@@ -8,6 +8,7 @@
 // inefficient. However, it makes these tests a good fit for scenarios which
 // require special server configurations.
 
+#include <stdint.h>
 #include <string>
 
 #include "base/bind.h"
@@ -68,12 +69,12 @@
                            WebSocketMessageType type,
                            const std::vector<char>& data) override;
 
-  ChannelState OnFlowControl(int64 quota) override;
+  ChannelState OnFlowControl(int64_t quota) override;
 
   ChannelState OnClosingHandshake() override;
 
   ChannelState OnDropChannel(bool was_clean,
-                             uint16 code,
+                             uint16_t code,
                              const std::string& reason) override;
 
   ChannelState OnFailChannel(const std::string& message) override;
@@ -141,7 +142,7 @@
   return CHANNEL_ALIVE;
 }
 
-ChannelState ConnectTestingEventInterface::OnFlowControl(int64 quota) {
+ChannelState ConnectTestingEventInterface::OnFlowControl(int64_t quota) {
   return CHANNEL_ALIVE;
 }
 
@@ -151,7 +152,7 @@
 
 ChannelState ConnectTestingEventInterface::OnDropChannel(
     bool was_clean,
-    uint16 code,
+    uint16_t code,
     const std::string& reason) {
   return CHANNEL_DELETED;
 }
diff --git a/net/websockets/websocket_event_interface.h b/net/websockets/websocket_event_interface.h
index 0859254..4d2b486 100644
--- a/net/websockets/websocket_event_interface.h
+++ b/net/websockets/websocket_event_interface.h
@@ -5,6 +5,7 @@
 #ifndef NET_WEBSOCKETS_WEBSOCKET_EVENT_INTERFACE_H_
 #define NET_WEBSOCKETS_WEBSOCKET_EVENT_INTERFACE_H_
 
+#include <stdint.h>
 #include <string>
 #include <vector>
 
@@ -52,7 +53,7 @@
   // Called to provide more send quota for this channel to the renderer
   // process. Currently the quota units are always bytes of message body
   // data. In future it might depend on the type of multiplexing in use.
-  virtual ChannelState OnFlowControl(int64 quota) WARN_UNUSED_RESULT = 0;
+  virtual ChannelState OnFlowControl(int64_t quota) WARN_UNUSED_RESULT = 0;
 
   // Called when the remote server has Started the WebSocket Closing
   // Handshake. The client should not attempt to send any more messages after
@@ -76,7 +77,7 @@
   // This method returns a ChannelState for consistency, but all implementations
   // must delete the Channel and return CHANNEL_DELETED.
   virtual ChannelState OnDropChannel(bool was_clean,
-                                     uint16 code,
+                                     uint16_t code,
                                      const std::string& reason)
       WARN_UNUSED_RESULT = 0;
 
diff --git a/net/websockets/websocket_frame.cc b/net/websockets/websocket_frame.cc
index a702207e5..94d1389 100644
--- a/net/websockets/websocket_frame.cc
+++ b/net/websockets/websocket_frame.cc
@@ -5,11 +5,8 @@
 #include "net/websockets/websocket_frame.h"
 
 #include <stddef.h>
-#include <stdint.h>
-
 #include <algorithm>
 
-#include "base/basictypes.h"
 #include "base/big_endian.h"
 #include "base/logging.h"
 #include "base/rand_util.h"
@@ -35,15 +32,15 @@
 #endif  // defined(COMPILER_GCC) && defined(ARCH_CPU_X86_FAMILY) &&
         // !defined(OS_NACL)
 
-const uint8 kFinalBit = 0x80;
-const uint8 kReserved1Bit = 0x40;
-const uint8 kReserved2Bit = 0x20;
-const uint8 kReserved3Bit = 0x10;
-const uint8 kOpCodeMask = 0xF;
-const uint8 kMaskBit = 0x80;
-const uint64 kMaxPayloadLengthWithoutExtendedLengthField = 125;
-const uint64 kPayloadLengthWithTwoByteExtendedLengthField = 126;
-const uint64 kPayloadLengthWithEightByteExtendedLengthField = 127;
+const uint8_t kFinalBit = 0x80;
+const uint8_t kReserved1Bit = 0x40;
+const uint8_t kReserved2Bit = 0x20;
+const uint8_t kReserved3Bit = 0x10;
+const uint8_t kOpCodeMask = 0xF;
+const uint8_t kMaskBit = 0x80;
+const uint64_t kMaxPayloadLengthWithoutExtendedLengthField = 125;
+const uint64_t kPayloadLengthWithTwoByteExtendedLengthField = 126;
+const uint64_t kPayloadLengthWithEightByteExtendedLengthField = 127;
 
 inline void MaskWebSocketFramePayloadByBytes(
     const WebSocketMaskingKey& masking_key,
@@ -87,9 +84,9 @@
 int GetWebSocketFrameHeaderSize(const WebSocketFrameHeader& header) {
   int extended_length_size = 0;
   if (header.payload_length > kMaxPayloadLengthWithoutExtendedLengthField &&
-      header.payload_length <= kuint16max) {
+      header.payload_length <= UINT16_MAX) {
     extended_length_size = 2;
-  } else if (header.payload_length > kuint16max) {
+  } else if (header.payload_length > UINT16_MAX) {
     extended_length_size = 8;
   }
 
@@ -103,9 +100,9 @@
                               int buffer_size) {
   DCHECK((header.opcode & kOpCodeMask) == header.opcode)
       << "header.opcode must fit to kOpCodeMask.";
-  DCHECK(header.payload_length <= static_cast<uint64>(kint64max))
+  DCHECK(header.payload_length <= static_cast<uint64_t>(INT64_MAX))
       << "WebSocket specification doesn't allow a frame longer than "
-      << "kint64max (0x7FFFFFFFFFFFFFFF) bytes.";
+      << "INT64_MAX (0x7FFFFFFFFFFFFFFF) bytes.";
   DCHECK_GE(buffer_size, 0);
 
   // WebSocket frame format is as follows:
@@ -124,7 +121,7 @@
 
   int buffer_index = 0;
 
-  uint8 first_byte = 0u;
+  uint8_t first_byte = 0u;
   first_byte |= header.final ? kFinalBit : 0u;
   first_byte |= header.reserved1 ? kReserved1Bit : 0u;
   first_byte |= header.reserved2 ? kReserved2Bit : 0u;
@@ -133,11 +130,11 @@
   buffer[buffer_index++] = first_byte;
 
   int extended_length_size = 0;
-  uint8 second_byte = 0u;
+  uint8_t second_byte = 0u;
   second_byte |= header.masked ? kMaskBit : 0u;
   if (header.payload_length <= kMaxPayloadLengthWithoutExtendedLengthField) {
     second_byte |= header.payload_length;
-  } else if (header.payload_length <= kuint16max) {
+  } else if (header.payload_length <= UINT16_MAX) {
     second_byte |= kPayloadLengthWithTwoByteExtendedLengthField;
     extended_length_size = 2;
   } else {
@@ -148,7 +145,7 @@
 
   // Writes "extended payload length" field.
   if (extended_length_size == 2) {
-    uint16 payload_length_16 = static_cast<uint16>(header.payload_length);
+    uint16_t payload_length_16 = static_cast<uint16_t>(header.payload_length);
     base::WriteBigEndian(buffer + buffer_index, payload_length_16);
     buffer_index += sizeof(payload_length_16);
   } else if (extended_length_size == 8) {
@@ -181,7 +178,7 @@
 }
 
 void MaskWebSocketFramePayload(const WebSocketMaskingKey& masking_key,
-                               uint64 frame_offset,
+                               uint64_t frame_offset,
                                char* const data,
                                int data_size) {
   static const size_t kMaskingKeyLength =
diff --git a/net/websockets/websocket_frame.h b/net/websockets/websocket_frame.h
index c9d8b976..e3ceec5 100644
--- a/net/websockets/websocket_frame.h
+++ b/net/websockets/websocket_frame.h
@@ -5,6 +5,7 @@
 #ifndef NET_WEBSOCKETS_WEBSOCKET_FRAME_H_
 #define NET_WEBSOCKETS_WEBSOCKET_FRAME_H_
 
+#include <stdint.h>
 #include <vector>
 
 #include "base/basictypes.h"
@@ -83,7 +84,7 @@
   bool reserved3;
   OpCode opcode;
   bool masked;
-  uint64 payload_length;
+  uint64_t payload_length;
 
  private:
   DISALLOW_COPY_AND_ASSIGN(WebSocketFrameHeader);
@@ -186,7 +187,7 @@
 // used for unmasking a WebSocket frame.
 NET_EXPORT void MaskWebSocketFramePayload(
     const WebSocketMaskingKey& masking_key,
-    uint64 frame_offset,
+    uint64_t frame_offset,
     char* data,
     int data_size);
 
diff --git a/net/websockets/websocket_frame_parser.cc b/net/websockets/websocket_frame_parser.cc
index 40d7e8a..c36c467 100644
--- a/net/websockets/websocket_frame_parser.cc
+++ b/net/websockets/websocket_frame_parser.cc
@@ -7,7 +7,6 @@
 #include <algorithm>
 #include <limits>
 
-#include "base/basictypes.h"
 #include "base/big_endian.h"
 #include "base/logging.h"
 #include "base/memory/ref_counted.h"
@@ -18,18 +17,18 @@
 
 namespace {
 
-const uint8 kFinalBit = 0x80;
-const uint8 kReserved1Bit = 0x40;
-const uint8 kReserved2Bit = 0x20;
-const uint8 kReserved3Bit = 0x10;
-const uint8 kOpCodeMask = 0xF;
-const uint8 kMaskBit = 0x80;
-const uint8 kPayloadLengthMask = 0x7F;
-const uint64 kMaxPayloadLengthWithoutExtendedLengthField = 125;
-const uint64 kPayloadLengthWithTwoByteExtendedLengthField = 126;
-const uint64 kPayloadLengthWithEightByteExtendedLengthField = 127;
+const uint8_t kFinalBit = 0x80;
+const uint8_t kReserved1Bit = 0x40;
+const uint8_t kReserved2Bit = 0x20;
+const uint8_t kReserved3Bit = 0x10;
+const uint8_t kOpCodeMask = 0xF;
+const uint8_t kMaskBit = 0x80;
+const uint8_t kPayloadLengthMask = 0x7F;
+const uint64_t kMaxPayloadLengthWithoutExtendedLengthField = 125;
+const uint64_t kPayloadLengthWithTwoByteExtendedLengthField = 126;
+const uint64_t kPayloadLengthWithEightByteExtendedLengthField = 127;
 
-}  // Unnamed namespace.
+}  // namespace.
 
 namespace net {
 
@@ -109,8 +108,8 @@
   if (end - current < 2)
     return;
 
-  uint8 first_byte = *current++;
-  uint8 second_byte = *current++;
+  uint8_t first_byte = *current++;
+  uint8_t second_byte = *current++;
 
   bool final = (first_byte & kFinalBit) != 0;
   bool reserved1 = (first_byte & kReserved1Bit) != 0;
@@ -119,11 +118,11 @@
   OpCode opcode = first_byte & kOpCodeMask;
 
   bool masked = (second_byte & kMaskBit) != 0;
-  uint64 payload_length = second_byte & kPayloadLengthMask;
+  uint64_t payload_length = second_byte & kPayloadLengthMask;
   if (payload_length == kPayloadLengthWithTwoByteExtendedLengthField) {
     if (end - current < 2)
       return;
-    uint16 payload_length_16;
+    uint16_t payload_length_16;
     base::ReadBigEndian(current, &payload_length_16);
     current += 2;
     payload_length = payload_length_16;
@@ -134,10 +133,10 @@
       return;
     base::ReadBigEndian(current, &payload_length);
     current += 8;
-    if (payload_length <= kuint16max ||
-        payload_length > static_cast<uint64>(kint64max)) {
+    if (payload_length <= UINT16_MAX ||
+        payload_length > static_cast<uint64_t>(INT64_MAX)) {
       websocket_error_ = kWebSocketErrorProtocolError;
-    } else if (payload_length > static_cast<uint64>(kint32max)) {
+    } else if (payload_length > static_cast<uint64_t>(INT32_MAX)) {
       websocket_error_ = kWebSocketErrorMessageTooBig;
     }
   }
@@ -173,9 +172,9 @@
     bool first_chunk) {
   // The cast here is safe because |payload_length| is already checked to be
   // less than std::numeric_limits<int>::max() when the header is parsed.
-  int next_size = static_cast<int>(std::min(
-      static_cast<uint64>(buffer_.size() - current_read_pos_),
-      current_frame_header_->payload_length - frame_offset_));
+  int next_size = static_cast<int>(
+      std::min(static_cast<uint64_t>(buffer_.size() - current_read_pos_),
+               current_frame_header_->payload_length - frame_offset_));
 
   scoped_ptr<WebSocketFrameChunk> frame_chunk(new WebSocketFrameChunk);
   if (first_chunk) {
diff --git a/net/websockets/websocket_frame_parser.h b/net/websockets/websocket_frame_parser.h
index 52e6f85..194370f4 100644
--- a/net/websockets/websocket_frame_parser.h
+++ b/net/websockets/websocket_frame_parser.h
@@ -5,6 +5,7 @@
 #ifndef NET_WEBSOCKETS_WEBSOCKET_FRAME_PARSER_H_
 #define NET_WEBSOCKETS_WEBSOCKET_FRAME_PARSER_H_
 
+#include <stdint.h>
 #include <vector>
 
 #include "base/basictypes.h"
@@ -75,7 +76,7 @@
   WebSocketMaskingKey masking_key_;
 
   // Amount of payload data read so far for the current frame.
-  uint64 frame_offset_;
+  uint64_t frame_offset_;
 
   WebSocketError websocket_error_;
 
diff --git a/net/websockets/websocket_frame_parser_test.cc b/net/websockets/websocket_frame_parser_test.cc
index 868d651..a208eb5 100644
--- a/net/websockets/websocket_frame_parser_test.cc
+++ b/net/websockets/websocket_frame_parser_test.cc
@@ -19,18 +19,18 @@
 namespace {
 
 const char kHello[] = "Hello, world!";
-const uint64 kHelloLength = arraysize(kHello) - 1;
+const uint64_t kHelloLength = arraysize(kHello) - 1;
 const char kHelloFrame[] = "\x81\x0DHello, world!";
-const uint64 kHelloFrameLength = arraysize(kHelloFrame) - 1;
+const uint64_t kHelloFrameLength = arraysize(kHelloFrame) - 1;
 const char kMaskedHelloFrame[] =
     "\x81\x8D\xDE\xAD\xBE\xEF"
     "\x96\xC8\xD2\x83\xB1\x81\x9E\x98\xB1\xDF\xD2\x8B\xFF";
-const uint64 kMaskedHelloFrameLength = arraysize(kMaskedHelloFrame) - 1;
+const uint64_t kMaskedHelloFrameLength = arraysize(kMaskedHelloFrame) - 1;
 
 struct FrameHeaderTestCase {
   const char* frame_header;
   size_t frame_header_length;
-  uint64 frame_length;
+  uint64_t frame_length;
   WebSocketError error_code;
 };
 
@@ -150,7 +150,7 @@
       continue;
     EXPECT_TRUE(frame->final_chunk);
     ASSERT_EQ(kInputs[i].expected_payload_length,
-              static_cast<uint64>(frame->data->size()));
+              static_cast<uint64_t>(frame->data->size()));
     EXPECT_TRUE(std::equal(
         kInputs[i].expected_payload,
         kInputs[i].expected_payload + kInputs[i].expected_payload_length,
@@ -228,7 +228,7 @@
     if (expected2.size() == 0) {
       EXPECT_EQ(NULL, frame2->data.get());
     } else {
-      ASSERT_EQ(expected2.size(), static_cast<uint64>(frame2->data->size()));
+      ASSERT_EQ(expected2.size(), static_cast<uint64_t>(frame2->data->size()));
       EXPECT_TRUE(
           std::equal(expected2.begin(), expected2.end(), frame2->data->data()));
     }
@@ -265,7 +265,7 @@
     if (expected1.size() == 0) {
       EXPECT_EQ(NULL, frame1->data.get());
     } else {
-      ASSERT_EQ(expected1.size(), static_cast<uint64>(frame1->data->size()));
+      ASSERT_EQ(expected1.size(), static_cast<uint64_t>(frame1->data->size()));
       EXPECT_TRUE(
           std::equal(expected1.begin(), expected1.end(), frame1->data->data()));
     }
@@ -295,7 +295,7 @@
     if (expected2.size() == 0) {
       EXPECT_EQ(NULL, frame2->data.get());
     } else {
-      ASSERT_EQ(expected2.size(), static_cast<uint64>(frame2->data->size()));
+      ASSERT_EQ(expected2.size(), static_cast<uint64_t>(frame2->data->size()));
       EXPECT_TRUE(
           std::equal(expected2.begin(), expected2.end(), frame2->data->data()));
     }
@@ -308,12 +308,12 @@
   for (int i = 0; i < kNumFrameHeaderTests; ++i) {
     const char* frame_header = kFrameHeaderTests[i].frame_header;
     size_t frame_header_length = kFrameHeaderTests[i].frame_header_length;
-    uint64 frame_length = kFrameHeaderTests[i].frame_length;
+    uint64_t frame_length = kFrameHeaderTests[i].frame_length;
 
     std::vector<char> input(frame_header, frame_header + frame_header_length);
     // Limit the payload size not to flood the console on failure.
-    static const uint64 kMaxPayloadSize = 200;
-    uint64 input_payload_size = std::min(frame_length, kMaxPayloadSize);
+    static const uint64_t kMaxPayloadSize = 200;
+    uint64_t input_payload_size = std::min(frame_length, kMaxPayloadSize);
     input.insert(input.end(), input_payload_size, 'a');
 
     WebSocketFrameParser parser;
@@ -343,7 +343,7 @@
       EXPECT_EQ(NULL, frame->data.get());
     } else {
       ASSERT_EQ(expected_payload.size(),
-                static_cast<uint64>(frame->data->size()));
+                static_cast<uint64_t>(frame->data->size()));
       EXPECT_TRUE(std::equal(expected_payload.begin(),
                              expected_payload.end(),
                              frame->data->data()));
@@ -366,7 +366,7 @@
   for (int i = 0; i < kNumFrameHeaderTests; ++i) {
     const char* frame_header = kFrameHeaderTests[i].frame_header;
     size_t frame_header_length = kFrameHeaderTests[i].frame_header_length;
-    uint64 frame_length = kFrameHeaderTests[i].frame_length;
+    uint64_t frame_length = kFrameHeaderTests[i].frame_length;
 
     WebSocketFrameParser parser;
 
diff --git a/net/websockets/websocket_frame_test.cc b/net/websockets/websocket_frame_test.cc
index ac35d903..6d1fc25 100644
--- a/net/websockets/websocket_frame_test.cc
+++ b/net/websockets/websocket_frame_test.cc
@@ -21,7 +21,7 @@
   struct TestCase {
     const char* frame_header;
     size_t frame_header_length;
-    uint64 frame_length;
+    uint64_t frame_length;
   };
   static const TestCase kTests[] = {
     { "\x81\x00", 2, UINT64_C(0) },
@@ -59,7 +59,7 @@
   struct TestCase {
     const char* frame_header;
     size_t frame_header_length;
-    uint64 frame_length;
+    uint64_t frame_length;
   };
   static const TestCase kTests[] = {
     { "\x81\x80\xDE\xAD\xBE\xEF", 6, UINT64_C(0) },
@@ -179,7 +179,7 @@
 
 TEST(WebSocketFrameHeaderTest, InsufficientBufferSize) {
   struct TestCase {
-    uint64 payload_length;
+    uint64_t payload_length;
     bool masked;
     size_t expected_header_size;
   };
@@ -218,7 +218,7 @@
 TEST(WebSocketFrameTest, MaskPayload) {
   struct TestCase {
     const char* masking_key;
-    uint64 frame_offset;
+    uint64_t frame_offset;
     const char* input;
     const char* output;
     size_t data_length;
diff --git a/net/websockets/websocket_test_util.cc b/net/websockets/websocket_test_util.cc
index fd5421a..fc494e6 100644
--- a/net/websockets/websocket_test_util.cc
+++ b/net/websockets/websocket_test_util.cc
@@ -18,20 +18,20 @@
 namespace net {
 
 namespace {
-const uint64 kA =
-    (static_cast<uint64>(0x5851f42d) << 32) + static_cast<uint64>(0x4c957f2d);
-const uint64 kC = 12345;
-const uint64 kM = static_cast<uint64>(1) << 48;
+const uint64_t kA = (static_cast<uint64_t>(0x5851f42d) << 32) +
+                    static_cast<uint64_t>(0x4c957f2d);
+const uint64_t kC = 12345;
+const uint64_t kM = static_cast<uint64_t>(1) << 48;
 
 }  // namespace
 
-LinearCongruentialGenerator::LinearCongruentialGenerator(uint32 seed)
+LinearCongruentialGenerator::LinearCongruentialGenerator(uint32_t seed)
     : current_(seed) {}
 
-uint32 LinearCongruentialGenerator::Generate() {
-  uint64 result = current_;
+uint32_t LinearCongruentialGenerator::Generate() {
+  uint64_t result = current_;
   current_ = (current_ * kA + kC) % kM;
-  return static_cast<uint32>(result >> 16);
+  return static_cast<uint32_t>(result >> 16);
 }
 
 std::string WebSocketStandardRequest(const std::string& path,
diff --git a/net/websockets/websocket_test_util.h b/net/websockets/websocket_test_util.h
index f620f18..c2fe1f96 100644
--- a/net/websockets/websocket_test_util.h
+++ b/net/websockets/websocket_test_util.h
@@ -5,6 +5,7 @@
 #ifndef NET_WEBSOCKETS_WEBSOCKET_TEST_UTIL_H_
 #define NET_WEBSOCKETS_WEBSOCKET_TEST_UTIL_H_
 
+#include <stdint.h>
 #include <string>
 
 #include "base/basictypes.h"
@@ -33,11 +34,11 @@
 
 class LinearCongruentialGenerator {
  public:
-  explicit LinearCongruentialGenerator(uint32 seed);
-  uint32 Generate();
+  explicit LinearCongruentialGenerator(uint32_t seed);
+  uint32_t Generate();
 
  private:
-  uint64 current_;
+  uint64_t current_;
 };
 
 // Generates a standard WebSocket handshake request. The challenge key used is
diff --git a/pdf/pdfium/pdfium_engine.cc b/pdf/pdfium/pdfium_engine.cc
index 369aa20..67be88d 100644
--- a/pdf/pdfium/pdfium_engine.cc
+++ b/pdf/pdfium/pdfium_engine.cc
@@ -544,7 +544,9 @@
 // child VarDictionaries (representing the child bookmarks).
 // If NULL is passed in as the bookmark then we traverse from the "root".
 // Note that the "root" bookmark contains no useful information.
-pp::VarDictionary TraverseBookmarks(FPDF_DOCUMENT doc, FPDF_BOOKMARK bookmark) {
+pp::VarDictionary TraverseBookmarks(FPDF_DOCUMENT doc,
+                                    FPDF_BOOKMARK bookmark,
+                                    unsigned int depth) {
   pp::VarDictionary dict;
   base::string16 title;
   unsigned long buffer_size = FPDFBookmark_GetTitle(bookmark, NULL, 0);
@@ -564,12 +566,19 @@
   }
 
   pp::VarArray children;
-  int child_index = 0;
-  for (FPDF_BOOKMARK child_bookmark = FPDFBookmark_GetFirstChild(doc, bookmark);
-      child_bookmark != NULL;
-      child_bookmark = FPDFBookmark_GetNextSibling(doc, child_bookmark)) {
-    children.Set(child_index, TraverseBookmarks(doc, child_bookmark));
-    child_index++;
+
+  // Don't trust PDFium to handle circular bookmarks.
+  const unsigned int kMaxDepth = 128;
+  if (depth < kMaxDepth) {
+    int child_index = 0;
+    for (FPDF_BOOKMARK child_bookmark =
+             FPDFBookmark_GetFirstChild(doc, bookmark);
+         child_bookmark != NULL;
+         child_bookmark = FPDFBookmark_GetNextSibling(doc, child_bookmark)) {
+      children.Set(child_index,
+                   TraverseBookmarks(doc, child_bookmark, depth + 1));
+      child_index++;
+    }
   }
   dict.Set(pp::Var("children"), children);
   return dict;
@@ -2433,7 +2442,7 @@
 }
 
 pp::VarArray PDFiumEngine::GetBookmarks() {
-  pp::VarDictionary dict = TraverseBookmarks(doc_, NULL);
+  pp::VarDictionary dict = TraverseBookmarks(doc_, NULL, 0);
   // The root bookmark contains no useful information.
   return pp::VarArray(dict.Get(pp::Var("children")));
 }
diff --git a/ppapi/proxy/audio_input_resource.cc b/ppapi/proxy/audio_input_resource.cc
index 4a24255..f17dd0a 100644
--- a/ppapi/proxy/audio_input_resource.cc
+++ b/ppapi/proxy/audio_input_resource.cc
@@ -253,6 +253,10 @@
       base::checked_cast<uint32_t>(shared_memory_size_ -
                                    sizeof(media::AudioInputBufferParameters));
 
+  // This is a constantly increasing counter that is used to verify on the
+  // browser side that buffers are in sync.
+  uint32 buffer_index = 0;
+
   while (true) {
     int pending_data = 0;
     size_t bytes_read = socket_->Receive(&pending_data, sizeof(pending_data));
@@ -269,6 +273,14 @@
                               kBitsPerAudioInputSample / 8,
                               client_buffer_.get());
 
+    // Inform other side that we have read the data from the shared memory.
+    ++buffer_index;
+    size_t bytes_sent = socket_->Send(&buffer_index, sizeof(buffer_index));
+    if (bytes_sent != sizeof(buffer_index)) {
+      DCHECK_EQ(bytes_sent, 0U);
+      break;
+    }
+
     // While closing the stream, we may receive buffers whose size is different
     // from |data_buffer_size|.
     CHECK_LE(buffer->params.size, audio_bus_size_bytes);
diff --git a/remoting/client/normalizing_input_filter_cros.cc b/remoting/client/normalizing_input_filter_cros.cc
index 0b97652..8cb2229 100644
--- a/remoting/client/normalizing_input_filter_cros.cc
+++ b/remoting/client/normalizing_input_filter_cros.cc
@@ -17,11 +17,6 @@
          code == static_cast<uint32_t>(ui::DomCode::OS_RIGHT);
 }
 
-// Returns true for the left-hand Alt key.
-static bool IsLeftAltKey(uint32_t code) {
-  return code == static_cast<uint32_t>(ui::DomCode::ALT_LEFT);
-}
-
 // Returns true for codes generated by EventRewriter::RewriteFunctionKeys().
 static bool IsRewrittenFunctionKey(uint32_t code) {
   return code >= static_cast<uint32_t>(ui::DomCode::F1) &&
@@ -96,6 +91,7 @@
       deferred_key_is_rewriting_(false),
       modifying_key_(0),
       left_alt_is_pressed_(false),
+      right_alt_is_pressed_(false),
       previous_mouse_x_(-1),
       previous_mouse_y_(-1) {
 }
@@ -177,10 +173,17 @@
       SwitchRewritingKeyToModifying();
   }
 
-  if (IsLeftAltKey(event.usb_keycode()))
+  ui::DomCode dom_code = static_cast<ui::DomCode>(event.usb_keycode());
+  if (dom_code == ui::DomCode::ALT_LEFT) {
     left_alt_is_pressed_ = true;
+  } else if (dom_code == ui::DomCode::ALT_RIGHT) {
+    right_alt_is_pressed_ = true;
+  }
 
-  InputFilter::InjectKeyEvent(event);
+  protocol::KeyEvent updated_event = event;
+  UndoAltKeyMapping(&updated_event);
+
+  InputFilter::InjectKeyEvent(updated_event);
 }
 
 void NormalizingInputFilterCros::ProcessKeyUp(const protocol::KeyEvent& event) {
@@ -199,10 +202,17 @@
   if (modifying_key_ == event.usb_keycode())
     modifying_key_ = 0;
 
-  if (IsLeftAltKey(event.usb_keycode()))
+  ui::DomCode dom_code = static_cast<ui::DomCode>(event.usb_keycode());
+  if (dom_code == ui::DomCode::ALT_LEFT) {
     left_alt_is_pressed_ = false;
+  } else if (dom_code == ui::DomCode::ALT_RIGHT) {
+    right_alt_is_pressed_ = false;
+  }
 
-  InputFilter::InjectKeyEvent(event);
+  protocol::KeyEvent updated_event = event;
+  UndoAltKeyMapping(&updated_event);
+
+  InputFilter::InjectKeyEvent(updated_event);
 }
 
 void NormalizingInputFilterCros::SwitchRewritingKeyToModifying() {
@@ -212,4 +222,24 @@
   deferred_keydown_event_ = protocol::KeyEvent();
 }
 
+void NormalizingInputFilterCros::UndoAltKeyMapping(protocol::KeyEvent* event) {
+  if (!left_alt_is_pressed_ && !right_alt_is_pressed_) {
+    return;
+  }
+
+  // If the keycode is one for which the Alt and Search keyboard shortcuts are
+  // the same, map it back to the original key.
+  switch (event->usb_keycode()) {
+    case static_cast<uint32_t>(ui::DomCode::PAGE_DOWN):
+      event->set_usb_keycode(static_cast<uint32_t>(ui::DomCode::ARROW_DOWN));
+      break;
+    case static_cast<uint32_t>(ui::DomCode::PAGE_UP):
+      event->set_usb_keycode(static_cast<uint32_t>(ui::DomCode::ARROW_UP));
+      break;
+    case static_cast<uint32_t>(ui::DomCode::DEL):
+      event->set_usb_keycode(static_cast<uint32_t>(ui::DomCode::BACKSPACE));
+      break;
+  }
+}
+
 }  // namespace remoting
diff --git a/remoting/client/normalizing_input_filter_cros.h b/remoting/client/normalizing_input_filter_cros.h
index e20eb59..0dfa805 100644
--- a/remoting/client/normalizing_input_filter_cros.h
+++ b/remoting/client/normalizing_input_filter_cros.h
@@ -36,6 +36,7 @@
   void ProcessKeyUp(const protocol::KeyEvent& event);
 
   void SwitchRewritingKeyToModifying();
+  void UndoAltKeyMapping(protocol::KeyEvent* event);
 
   // Holds the keydown event for the most recent OSKey to have been pressed,
   // while it is Rewriting, or we are not yet sure whether it is Normal,
@@ -50,8 +51,9 @@
   // Stores the code of the OSKey while it is pressed for use as a Modifier.
   uint32 modifying_key_;
 
-  // True if the left Alt key is pressed.
+  // True if the left or right Alt keys are pressed, respectively.
   bool left_alt_is_pressed_;
+  bool right_alt_is_pressed_;
 
   // Previous mouse coordinates.
   int previous_mouse_x_;
diff --git a/remoting/client/normalizing_input_filter_cros_unittest.cc b/remoting/client/normalizing_input_filter_cros_unittest.cc
index 44ded5a..be89a27e 100644
--- a/remoting/client/normalizing_input_filter_cros_unittest.cc
+++ b/remoting/client/normalizing_input_filter_cros_unittest.cc
@@ -16,6 +16,7 @@
 using remoting::protocol::KeyEvent;
 using remoting::protocol::MockInputStub;
 using remoting::protocol::MouseEvent;
+using remoting::protocol::test::EqualsKeyEvent;
 using remoting::protocol::test::EqualsKeyEventWithNumLock;
 using remoting::protocol::test::EqualsMouseButtonEvent;
 using remoting::protocol::test::EqualsMouseMoveEvent;
@@ -285,4 +286,66 @@
   processor->InjectKeyEvent(MakeKeyEvent(ui::DomCode::ALT_RIGHT, false));
 }
 
+// Test that the Alt-key remapping for Up and Down is not applied.
+TEST(NormalizingInputFilterCrosTest, UndoAltPlusArrowRemapping) {
+  MockInputStub stub;
+  scoped_ptr<protocol::InputFilter> processor(
+      new NormalizingInputFilterCros(&stub));
+
+  {
+    InSequence s;
+
+    EXPECT_CALL(stub, InjectKeyEvent(EqualsKeyEvent(
+        ui::DomCode::ALT_LEFT, true)));
+    EXPECT_CALL(stub, InjectKeyEvent(EqualsKeyEvent(
+        ui::DomCode::ARROW_UP, true)));
+    EXPECT_CALL(stub, InjectKeyEvent(EqualsKeyEvent(
+        ui::DomCode::ARROW_UP, false)));
+    EXPECT_CALL(stub, InjectKeyEvent(EqualsKeyEvent(
+        ui::DomCode::ARROW_DOWN, true)));
+    EXPECT_CALL(stub, InjectKeyEvent(EqualsKeyEvent(
+        ui::DomCode::ARROW_DOWN, false)));
+    EXPECT_CALL(stub, InjectKeyEvent(EqualsKeyEvent(
+        ui::DomCode::BACKSPACE, true)));
+    EXPECT_CALL(stub, InjectKeyEvent(EqualsKeyEvent(
+        ui::DomCode::BACKSPACE, false)));
+    EXPECT_CALL(stub, InjectKeyEvent(EqualsKeyEvent(
+        ui::DomCode::ALT_LEFT, false)));
+
+    EXPECT_CALL(stub, InjectKeyEvent(EqualsKeyEvent(
+        ui::DomCode::ALT_RIGHT, true)));
+    EXPECT_CALL(stub, InjectKeyEvent(EqualsKeyEvent(
+        ui::DomCode::ARROW_UP, true)));
+    EXPECT_CALL(stub, InjectKeyEvent(EqualsKeyEvent(
+        ui::DomCode::ARROW_UP, false)));
+    EXPECT_CALL(stub, InjectKeyEvent(EqualsKeyEvent(
+        ui::DomCode::ARROW_DOWN, true)));
+    EXPECT_CALL(stub, InjectKeyEvent(EqualsKeyEvent(
+        ui::DomCode::ARROW_DOWN, false)));
+    EXPECT_CALL(stub, InjectKeyEvent(EqualsKeyEvent(
+        ui::DomCode::BACKSPACE, true)));
+    EXPECT_CALL(stub, InjectKeyEvent(EqualsKeyEvent(
+        ui::DomCode::BACKSPACE, false)));
+    EXPECT_CALL(stub, InjectKeyEvent(EqualsKeyEvent(
+        ui::DomCode::ALT_RIGHT, false)));
+  }
+
+  // Hold the left Alt key while pressing & releasing the PgUp, PgDown and
+  // Delete keys. This simulates the mapping that ChromeOS applies if the Up,
+  // Down and Backspace keys are pressed, respectively, while the Alt key is
+  // held.
+  processor->InjectKeyEvent(MakeKeyEvent(ui::DomCode::ALT_LEFT, true));
+  PressAndReleaseKey(processor.get(), ui::DomCode::PAGE_UP);
+  PressAndReleaseKey(processor.get(), ui::DomCode::PAGE_DOWN);
+  PressAndReleaseKey(processor.get(), ui::DomCode::DEL);
+  processor->InjectKeyEvent(MakeKeyEvent(ui::DomCode::ALT_LEFT, false));
+
+  // Repeat the test for the right Alt key.
+  processor->InjectKeyEvent(MakeKeyEvent(ui::DomCode::ALT_RIGHT, true));
+  PressAndReleaseKey(processor.get(), ui::DomCode::PAGE_UP);
+  PressAndReleaseKey(processor.get(), ui::DomCode::PAGE_DOWN);
+  PressAndReleaseKey(processor.get(), ui::DomCode::DEL);
+  processor->InjectKeyEvent(MakeKeyEvent(ui::DomCode::ALT_RIGHT, false));
+}
+
 }  // namespace remoting
diff --git a/remoting/client/plugin/BUILD.gn b/remoting/client/plugin/BUILD.gn
index 0c69ef0..9f3d8ceb 100644
--- a/remoting/client/plugin/BUILD.gn
+++ b/remoting/client/plugin/BUILD.gn
@@ -7,6 +7,10 @@
 
 import("//remoting/remoting_srcs.gni")
 
+config("enable_linker_optimization") {
+  ldflags = [ "-Wl,-O1" ]
+}
+
 executable("remoting_client_plugin_newlib") {
   sources =
       rebase_path(remoting_srcs_gypi_values.remoting_client_plugin_sources,
@@ -15,6 +19,12 @@
 
   configs += [ "//build/config/compiler:wexit_time_destructors" ]
 
+  if (is_debug) {
+    # Always enable link-time optimization in debug builds to workaround
+    # crbug.com/538243 .
+    configs += [ ":enable_linker_optimization" ]
+  }
+
   deps = [
     "//net",
     "//ppapi/cpp",
diff --git a/remoting/client/plugin/pepper_video_renderer_3d.cc b/remoting/client/plugin/pepper_video_renderer_3d.cc
index 4d518b6..9e05d77 100644
--- a/remoting/client/plugin/pepper_video_renderer_3d.cc
+++ b/remoting/client/plugin/pepper_video_renderer_3d.cc
@@ -20,9 +20,15 @@
 
 namespace remoting {
 
-// The implementation here requires this minimum number of pictures from the
-// video decoder interface to work.
-const uint32_t kMinimumPictureCount = 3;
+// The implementation here requires that the decoder allocates at least 3
+// pictures. PPB_VideoDecode didn't support this parameter prior to
+// 1.1, so we have to pass 0 for backwards compatibility with older versions of
+// the browser. Currently all API implementations allocate more than 3 buffers
+// by default.
+//
+// TODO(sergeyu): Change this to 3 once PPB_VideoDecode v1.1 is enabled on
+// stable channel.
+const uint32_t kMinimumPictureCount = 0;  // 3
 
 class PepperVideoRenderer3D::PendingPacket {
  public:
@@ -160,12 +166,9 @@
       NOTREACHED();
   }
 
-  bool supports_video_decoder_1_1 =
-      pp::Module::Get()->GetBrowserInterface(
-          PPB_VIDEODECODER_INTERFACE_1_1) != NULL;
   int32_t result = video_decoder_.Initialize(
       graphics_, video_profile, PP_HARDWAREACCELERATION_WITHFALLBACK,
-      supports_video_decoder_1_1 ? kMinimumPictureCount : 0,
+      kMinimumPictureCount,
       callback_factory_.NewCallback(&PepperVideoRenderer3D::OnInitialized));
   CHECK_EQ(result, PP_OK_COMPLETIONPENDING)
       << "video_decoder_.Initialize() returned " << result;
diff --git a/sandbox/win/src/broker_services.cc b/sandbox/win/src/broker_services.cc
index 9579daa0..fbebc830 100644
--- a/sandbox/win/src/broker_services.cc
+++ b/sandbox/win/src/broker_services.cc
@@ -113,18 +113,6 @@
 
 namespace sandbox {
 
-// TODO(rvargas): Replace this structure with a std::pair of ScopedHandles.
-struct BrokerServicesBase::TokenPair {
-  TokenPair(base::win::ScopedHandle initial_token,
-         base::win::ScopedHandle lockdown_token)
-      : initial(initial_token.Pass()),
-        lockdown(lockdown_token.Pass()) {
-  }
-
-  base::win::ScopedHandle initial;
-  base::win::ScopedHandle lockdown;
-};
-
 BrokerServicesBase::BrokerServicesBase() : thread_pool_(NULL) {
 }
 
@@ -326,9 +314,11 @@
   // with the soon to be created target process.
   base::win::ScopedHandle initial_token;
   base::win::ScopedHandle lockdown_token;
+  base::win::ScopedHandle lowbox_token;
   ResultCode result = SBOX_ALL_OK;
 
-  result = policy_base->MakeTokens(&initial_token, &lockdown_token);
+  result =
+      policy_base->MakeTokens(&initial_token, &lockdown_token, &lowbox_token);
   if (SBOX_ALL_OK != result)
     return result;
 
@@ -445,13 +435,11 @@
   // Create the TargetProces object and spawn the target suspended. Note that
   // Brokerservices does not own the target object. It is owned by the Policy.
   base::win::ScopedProcessInformation process_info;
-  TargetProcess* target = new TargetProcess(initial_token.Pass(),
-                                            lockdown_token.Pass(),
-                                            job.Get(),
-                                            thread_pool_);
+  TargetProcess* target =
+      new TargetProcess(initial_token.Pass(), lockdown_token.Pass(),
+                        lowbox_token.Pass(), job.Get(), thread_pool_);
 
   DWORD win_result = target->Create(exe_path, command_line, inherit_handles,
-                                    policy_base->GetLowBoxSid() ? true : false,
                                     startup_info, &process_info);
 
   // Restore the previous handle protection values.
diff --git a/sandbox/win/src/broker_services.h b/sandbox/win/src/broker_services.h
index 5fd6ca4..b16d5fcc 100644
--- a/sandbox/win/src/broker_services.h
+++ b/sandbox/win/src/broker_services.h
@@ -64,10 +64,8 @@
   bool IsActiveTarget(DWORD process_id);
 
  private:
-  struct TokenPair;
   typedef std::list<JobTracker*> JobTrackerList;
   typedef std::map<DWORD, PeerTracker*> PeerTrackerMap;
-  typedef std::map<uint32_t, TokenPair*> TokenCacheMap;
 
   // The routine that the worker thread executes. It is in charge of
   // notifications and cleanup-related tasks.
diff --git a/sandbox/win/src/sandbox_policy_base.cc b/sandbox/win/src/sandbox_policy_base.cc
index 9c3bf0c..17f52c5 100644
--- a/sandbox/win/src/sandbox_policy_base.cc
+++ b/sandbox/win/src/sandbox_policy_base.cc
@@ -542,7 +542,8 @@
 }
 
 ResultCode PolicyBase::MakeTokens(base::win::ScopedHandle* initial,
-                                  base::win::ScopedHandle* lockdown) {
+                                  base::win::ScopedHandle* lockdown,
+                                  base::win::ScopedHandle* lowbox) {
   if (appcontainer_list_.get() && appcontainer_list_->HasAppContainer() &&
       lowbox_sid_) {
     return SBOX_ERROR_BAD_PARAMS;
@@ -613,7 +614,7 @@
       return SBOX_ERROR_GENERIC;
 
     DCHECK(token_lowbox);
-    lockdown->Set(token_lowbox);
+    lowbox->Set(token_lowbox);
   }
 
   // Create the 'better' token. We use this token as the one that the main
diff --git a/sandbox/win/src/sandbox_policy_base.h b/sandbox/win/src/sandbox_policy_base.h
index 19686ee..a461bd71 100644
--- a/sandbox/win/src/sandbox_policy_base.h
+++ b/sandbox/win/src/sandbox_policy_base.h
@@ -82,9 +82,11 @@
   ResultCode MakeJobObject(base::win::ScopedHandle* job);
 
   // Creates the two tokens with the levels specified in a previous call to
-  // SetTokenLevel().
+  // SetTokenLevel(). Also creates a lowbox token if specified based on the
+  // lowbox SID.
   ResultCode MakeTokens(base::win::ScopedHandle* initial,
-                        base::win::ScopedHandle* lockdown);
+                        base::win::ScopedHandle* lockdown,
+                        base::win::ScopedHandle* lowbox);
 
   const AppContainerAttributes* GetAppContainer() const;
 
diff --git a/sandbox/win/src/target_process.cc b/sandbox/win/src/target_process.cc
index 416713f..69dce20 100644
--- a/sandbox/win/src/target_process.cc
+++ b/sandbox/win/src/target_process.cc
@@ -65,19 +65,20 @@
   return base;
 }
 
-
 TargetProcess::TargetProcess(base::win::ScopedHandle initial_token,
                              base::win::ScopedHandle lockdown_token,
-                             HANDLE job, ThreadProvider* thread_pool)
-  // This object owns everything initialized here except thread_pool and
-  // the job_ handle. The Job handle is closed by BrokerServices and results
-  // eventually in a call to our dtor.
+                             base::win::ScopedHandle lowbox_token,
+                             HANDLE job,
+                             ThreadProvider* thread_pool)
+    // This object owns everything initialized here except thread_pool and
+    // the job_ handle. The Job handle is closed by BrokerServices and results
+    // eventually in a call to our dtor.
     : lockdown_token_(lockdown_token.Pass()),
       initial_token_(initial_token.Pass()),
+      lowbox_token_(lowbox_token.Pass()),
       job_(job),
       thread_pool_(thread_pool),
-      base_address_(NULL) {
-}
+      base_address_(NULL) {}
 
 TargetProcess::~TargetProcess() {
   DWORD exit_code = 0;
@@ -116,12 +117,11 @@
 DWORD TargetProcess::Create(const wchar_t* exe_path,
                             const wchar_t* command_line,
                             bool inherit_handles,
-                            bool set_lockdown_token_after_create,
                             const base::win::StartupInformation& startup_info,
                             base::win::ScopedProcessInformation* target_info) {
-  if (set_lockdown_token_after_create &&
+  if (lowbox_token_.IsValid() &&
       base::win::GetVersion() < base::win::VERSION_WIN8) {
-    // We don't allow set_lockdown_token_after_create below Windows 8.
+    // We don't allow lowbox_token below Windows 8.
     return ERROR_INVALID_PARAMETER;
   }
 
@@ -143,38 +143,16 @@
     flags |= CREATE_BREAKAWAY_FROM_JOB;
   }
 
-  base::win::ScopedHandle scoped_lockdown_token(lockdown_token_.Take());
   PROCESS_INFORMATION temp_process_info = {};
-  if (set_lockdown_token_after_create) {
-    // First create process with a default token and then replace it later,
-    // after setting primary thread token. This is required for setting
-    // an AppContainer token along with an impersonation token.
-    if (!::CreateProcess(exe_path,
-                         cmd_line.get(),
-                         NULL,   // No security attribute.
-                         NULL,   // No thread attribute.
-                         inherit_handles,
-                         flags,
-                         NULL,   // Use the environment of the caller.
-                         NULL,   // Use current directory of the caller.
-                         startup_info.startup_info(),
-                         &temp_process_info)) {
-      return ::GetLastError();
-    }
-  } else {
-    if (!::CreateProcessAsUserW(scoped_lockdown_token.Get(),
-                                exe_path,
-                                cmd_line.get(),
-                                NULL,   // No security attribute.
-                                NULL,   // No thread attribute.
-                                inherit_handles,
-                                flags,
-                                NULL,   // Use the environment of the caller.
-                                NULL,   // Use current directory of the caller.
-                                startup_info.startup_info(),
-                                &temp_process_info)) {
-      return ::GetLastError();
-    }
+  if (!::CreateProcessAsUserW(lockdown_token_.Get(), exe_path, cmd_line.get(),
+                              NULL,  // No security attribute.
+                              NULL,  // No thread attribute.
+                              inherit_handles, flags,
+                              NULL,  // Use the environment of the caller.
+                              NULL,  // Use current directory of the caller.
+                              startup_info.startup_info(),
+                              &temp_process_info)) {
+    return ::GetLastError();
   }
   base::win::ScopedProcessInformation process_info(temp_process_info);
 
@@ -204,26 +182,6 @@
     initial_token_.Close();
   }
 
-  if (set_lockdown_token_after_create) {
-    PROCESS_ACCESS_TOKEN process_access_token;
-    process_access_token.thread = process_info.thread_handle();
-    process_access_token.token = scoped_lockdown_token.Get();
-
-    NtSetInformationProcess SetInformationProcess = NULL;
-    ResolveNTFunctionPtr("NtSetInformationProcess", &SetInformationProcess);
-
-    NTSTATUS status = SetInformationProcess(
-        process_info.process_handle(),
-        static_cast<PROCESS_INFORMATION_CLASS>(NtProcessInformationAccessToken),
-        &process_access_token,
-        sizeof(process_access_token));
-    if (!NT_SUCCESS(status)) {
-      win_result = ::GetLastError();
-      ::TerminateProcess(process_info.process_handle(), 0);  // exit code
-      return win_result;
-    }
-  }
-
   CONTEXT context;
   context.ContextFlags = CONTEXT_ALL;
   if (!::GetThreadContext(process_info.thread_handle(), &context)) {
@@ -248,6 +206,25 @@
     return win_result;
   }
 
+  if (lowbox_token_.IsValid()) {
+    PROCESS_ACCESS_TOKEN process_access_token;
+    process_access_token.thread = process_info.thread_handle();
+    process_access_token.token = lowbox_token_.Get();
+
+    NtSetInformationProcess SetInformationProcess = NULL;
+    ResolveNTFunctionPtr("NtSetInformationProcess", &SetInformationProcess);
+
+    NTSTATUS status = SetInformationProcess(
+        process_info.process_handle(),
+        static_cast<PROCESS_INFORMATION_CLASS>(NtProcessInformationAccessToken),
+        &process_access_token, sizeof(process_access_token));
+    if (!NT_SUCCESS(status)) {
+      win_result = ERROR_INVALID_TOKEN;
+      ::TerminateProcess(process_info.process_handle(), 0);  // exit code
+      return win_result;
+    }
+  }
+
   base_address_ = GetBaseAddress(exe_path, entry_point);
   sandbox_process_info_.Set(process_info.Take());
   return win_result;
@@ -374,9 +351,9 @@
 }
 
 TargetProcess* MakeTestTargetProcess(HANDLE process, HMODULE base_address) {
-  TargetProcess* target = new TargetProcess(base::win::ScopedHandle(),
-                                            base::win::ScopedHandle(),
-                                            NULL, NULL);
+  TargetProcess* target =
+      new TargetProcess(base::win::ScopedHandle(), base::win::ScopedHandle(),
+                        base::win::ScopedHandle(), NULL, NULL);
   PROCESS_INFORMATION process_info = {};
   process_info.hProcess = process;
   target->sandbox_process_info_.Set(process_info);
diff --git a/sandbox/win/src/target_process.h b/sandbox/win/src/target_process.h
index e0200db..59e6aea 100644
--- a/sandbox/win/src/target_process.h
+++ b/sandbox/win/src/target_process.h
@@ -32,10 +32,13 @@
 // class are owned by the Policy used to create them.
 class TargetProcess {
  public:
-  // The constructor takes ownership of |initial_token| and |lockdown_token|.
+  // The constructor takes ownership of |initial_token|, |lockdown_token|
+  // and |lowbox_token|.
   TargetProcess(base::win::ScopedHandle initial_token,
                 base::win::ScopedHandle lockdown_token,
-                HANDLE job, ThreadProvider* thread_pool);
+                base::win::ScopedHandle lowbox_token,
+                HANDLE job,
+                ThreadProvider* thread_pool);
   ~TargetProcess();
 
   // TODO(cpu): Currently there does not seem to be a reason to implement
@@ -46,12 +49,9 @@
   void Release() {}
 
   // Creates the new target process. The process is created suspended.
-  // When |set_lockdown_token_after_create| is set, the lockdown token
-  // is replaced after the process is created
   DWORD Create(const wchar_t* exe_path,
                const wchar_t* command_line,
                bool inherit_handles,
-               bool set_lockdown_token_after_create,
                const base::win::StartupInformation& startup_info,
                base::win::ScopedProcessInformation* target_info);
 
@@ -106,6 +106,9 @@
   // The token given to the initial thread so that the target process can
   // start. It has more powers than the lockdown_token.
   base::win::ScopedHandle initial_token_;
+  // The lowbox token associated with the process. This token is set after the
+  // process creation.
+  base::win::ScopedHandle lowbox_token_;
   // Kernel handle to the shared memory used by the IPC server.
   base::win::ScopedHandle shared_section_;
   // Job object containing the target process.
diff --git a/skia/config/SkUserConfig.h b/skia/config/SkUserConfig.h
index f15c9a5..161ca82 100644
--- a/skia/config/SkUserConfig.h
+++ b/skia/config/SkUserConfig.h
@@ -225,10 +225,6 @@
 #ifndef    SK_SAVE_LAYER_BOUNDS_ARE_FILTERED
 #   define SK_SAVE_LAYER_BOUNDS_ARE_FILTERED
 #endif
-
-#ifndef    SK_SUPPORT_LEGACY_GRADIENT_DITHERING
-#   define SK_SUPPORT_LEGACY_GRADIENT_DITHERING
-#endif
 ///////////////////////// Imported from BUILD.gn and skia_common.gypi
 
 /* In some places Skia can use static initializers for global initialization,
diff --git a/skia/ext/bitmap_platform_device_cairo.cc b/skia/ext/bitmap_platform_device_cairo.cc
index 246984a..9378733 100644
--- a/skia/ext/bitmap_platform_device_cairo.cc
+++ b/skia/ext/bitmap_platform_device_cairo.cc
@@ -200,26 +200,4 @@
   return CreateCanvas(dev, failureType);
 }
 
-// Port of PlatformBitmap to linux
-PlatformBitmap::~PlatformBitmap() {
-  cairo_destroy(surface_);
-}
-
-bool PlatformBitmap::Allocate(int width, int height, bool is_opaque) {
-  // The SkBitmap allocates and owns the bitmap memory; PlatformBitmap owns the
-  // cairo drawing context tied to the bitmap. The SkBitmap's pixelRef can
-  // outlive the PlatformBitmap if additional copies are made.
-  int stride = cairo_format_stride_for_width(CAIRO_FORMAT_ARGB32, width);
-
-  cairo_surface_t* surf = cairo_image_surface_create(
-      CAIRO_FORMAT_ARGB32,
-      width,
-      height);
-  if (cairo_surface_status(surf) != CAIRO_STATUS_SUCCESS) {
-    cairo_surface_destroy(surf);
-    return false;
-  }
-  return InstallCairoSurfacePixels(&bitmap_, surf, is_opaque);
-}
-
 }  // namespace skia
diff --git a/skia/ext/bitmap_platform_device_mac.cc b/skia/ext/bitmap_platform_device_mac.cc
index 087cf39..cc4f3ef 100644
--- a/skia/ext/bitmap_platform_device_mac.cc
+++ b/skia/ext/bitmap_platform_device_mac.cc
@@ -298,26 +298,4 @@
   return CreateCanvas(dev, failureType);
 }
 
-// Port of PlatformBitmap to mac
-
-PlatformBitmap::~PlatformBitmap() {
-  if (surface_)
-    CGContextRelease(surface_);
-}
-
-bool PlatformBitmap::Allocate(int width, int height, bool is_opaque) {
-  if (RasterDeviceTooBigToAllocate(width, height))
-    return false;
-    
-  if (!bitmap_.tryAllocN32Pixels(width, height, is_opaque))
-    return false;
-
-  if (!is_opaque)
-    bitmap_.eraseColor(0);
-
-  surface_ = CGContextForData(bitmap_.getPixels(), bitmap_.width(),
-                              bitmap_.height());
-  return true;
-}
-
 }  // namespace skia
diff --git a/skia/ext/bitmap_platform_device_skia.cc b/skia/ext/bitmap_platform_device_skia.cc
index 04fc950f..f3c97eb9 100644
--- a/skia/ext/bitmap_platform_device_skia.cc
+++ b/skia/ext/bitmap_platform_device_skia.cc
@@ -64,17 +64,4 @@
   return CreateCanvas(dev, failureType);
 }
 
-// Port of PlatformBitmap to android
-PlatformBitmap::~PlatformBitmap() {
-  // Nothing to do.
-}
-
-bool PlatformBitmap::Allocate(int width, int height, bool is_opaque) {
-  if (!bitmap_.tryAllocN32Pixels(width, height, is_opaque))
-    return false;
-
-  surface_ = bitmap_.getPixels();
-  return true;
-}
-
 }  // namespace skia
diff --git a/skia/ext/bitmap_platform_device_win.cc b/skia/ext/bitmap_platform_device_win.cc
index 5712df3..9cd3d70 100644
--- a/skia/ext/bitmap_platform_device_win.cc
+++ b/skia/ext/bitmap_platform_device_win.cc
@@ -317,35 +317,4 @@
   return CreateCanvas(dev, failureType);
 }
 
-// Port of PlatformBitmap to win
-
-PlatformBitmap::~PlatformBitmap() {
-  if (surface_) {
-    if (platform_extra_)
-      SelectObject(surface_, reinterpret_cast<HGDIOBJ>(platform_extra_));
-    DeleteDC(surface_);
-  }
-}
-
-bool PlatformBitmap::Allocate(int width, int height, bool is_opaque) {
-  void* data;
-  HBITMAP hbitmap = CreateHBitmap(width, height, is_opaque, 0, &data);
-  if (!hbitmap)
-    return false;
-
-  surface_ = CreateCompatibleDC(NULL);
-  InitializeDC(surface_);
-  // When the memory DC is created, its display surface is exactly one
-  // monochrome pixel wide and one monochrome pixel high. Save this object
-  // off, we'll restore it just before deleting the memory DC.
-  HGDIOBJ stock_bitmap = SelectObject(surface_, hbitmap);
-  platform_extra_ = reinterpret_cast<intptr_t>(stock_bitmap);
-
-  if (!InstallHBitmapPixels(&bitmap_, width, height, is_opaque, data, hbitmap))
-    return false;
-  bitmap_.lockPixels();
-
-  return true;
-}
-
 }  // namespace skia
diff --git a/skia/ext/bitmap_platform_device_win.h b/skia/ext/bitmap_platform_device_win.h
index 8acfd42..9cbe2ba2 100644
--- a/skia/ext/bitmap_platform_device_win.h
+++ b/skia/ext/bitmap_platform_device_win.h
@@ -18,12 +18,6 @@
 // format that Skia supports and can then use this to draw ClearType into, etc.
 // This pixel data is provided to the bitmap that the device contains so that it
 // can be shared.
-//
-// The GDI bitmap created for drawing is actually owned by a
-// PlatformBitmapPixelRef, and stored in an SkBitmap via the normal skia
-// SkPixelRef refcounting mechanism. In this way, the GDI bitmap can outlive
-// the device created to draw into it. So it is safe to call accessBitmap() on
-// the device, and retain the returned SkBitmap.
 class SK_API BitmapPlatformDevice : public SkBitmapDevice, public PlatformDevice {
  public:
   // Factory function. is_opaque should be set if the caller knows the bitmap
diff --git a/skia/ext/platform_canvas.cc b/skia/ext/platform_canvas.cc
index 9235967..778ee094 100644
--- a/skia/ext/platform_canvas.cc
+++ b/skia/ext/platform_canvas.cc
@@ -58,6 +58,4 @@
   return new SkCanvas(device.get());
 }
 
-PlatformBitmap::PlatformBitmap() : surface_(0), platform_extra_(0) {}
-
 }  // namespace skia
diff --git a/skia/ext/platform_canvas.h b/skia/ext/platform_canvas.h
index 75458b5..79c10fd 100644
--- a/skia/ext/platform_canvas.h
+++ b/skia/ext/platform_canvas.h
@@ -154,34 +154,6 @@
   ScopedPlatformPaint& operator=(const ScopedPlatformPaint&);
 };
 
-// PlatformBitmap holds a PlatformSurface that can also be used as an SkBitmap.
-class SK_API PlatformBitmap {
- public:
-  PlatformBitmap();
-  ~PlatformBitmap();
-
-  // Returns true if the bitmap was able to allocate its surface.
-  bool Allocate(int width, int height, bool is_opaque);
-
-  // Returns the platform surface, or 0 if Allocate() did not return true.
-  PlatformSurface GetSurface() { return surface_; }
-
-  // Return the skia bitmap, which will be empty if Allocate() did not
-  // return true.
-  //
-  // The resulting SkBitmap holds a refcount on the underlying platform surface,
-  // so the surface will remain allocated so long as the SkBitmap or its copies
-  // stay around.
-  const SkBitmap& GetBitmap() { return bitmap_; }
-
- private:
-  SkBitmap bitmap_;
-  PlatformSurface surface_;  // initialized to 0
-  intptr_t platform_extra_;  // platform specific, initialized to 0
-
-  DISALLOW_COPY_AND_ASSIGN(PlatformBitmap);
-};
-
 }  // namespace skia
 
 #endif  // SKIA_EXT_PLATFORM_CANVAS_H_
diff --git a/skia/ext/platform_canvas_unittest.cc b/skia/ext/platform_canvas_unittest.cc
index 22a20a1..cb2862f 100644
--- a/skia/ext/platform_canvas_unittest.cc
+++ b/skia/ext/platform_canvas_unittest.cc
@@ -397,65 +397,4 @@
 
 #endif  // #if !defined(USE_AURA)
 
-TEST(PlatformBitmapTest, PlatformBitmap) {
-  const int kWidth = 400;
-  const int kHeight = 300;
-  scoped_ptr<PlatformBitmap> platform_bitmap(new PlatformBitmap);
-
-  EXPECT_TRUE(0 == platform_bitmap->GetSurface());
-  EXPECT_TRUE(platform_bitmap->GetBitmap().empty());
-  EXPECT_TRUE(platform_bitmap->GetBitmap().isNull());
-
-  EXPECT_TRUE(platform_bitmap->Allocate(kWidth, kHeight, /*is_opaque=*/false));
-
-  EXPECT_TRUE(0 != platform_bitmap->GetSurface());
-  EXPECT_FALSE(platform_bitmap->GetBitmap().empty());
-  EXPECT_FALSE(platform_bitmap->GetBitmap().isNull());
-  EXPECT_EQ(kWidth, platform_bitmap->GetBitmap().width());
-  EXPECT_EQ(kHeight, platform_bitmap->GetBitmap().height());
-  EXPECT_LE(static_cast<size_t>(platform_bitmap->GetBitmap().width()*4),
-            platform_bitmap->GetBitmap().rowBytes());
-  EXPECT_EQ(kN32_SkColorType,  // Same for all platforms.
-            platform_bitmap->GetBitmap().colorType());
-  EXPECT_TRUE(platform_bitmap->GetBitmap().lockPixelsAreWritable());
-#if defined(SK_DEBUG)
-  EXPECT_TRUE(platform_bitmap->GetBitmap().pixelRef()->isLocked());
-#endif
-  EXPECT_TRUE(platform_bitmap->GetBitmap().pixelRef()->unique());
-
-  *(platform_bitmap->GetBitmap().getAddr32(10, 20)) = 0xDEED1020;
-  *(platform_bitmap->GetBitmap().getAddr32(20, 30)) = 0xDEED2030;
-
-  SkBitmap sk_bitmap = platform_bitmap->GetBitmap();
-  sk_bitmap.lockPixels();
-
-  EXPECT_FALSE(platform_bitmap->GetBitmap().pixelRef()->unique());
-  EXPECT_FALSE(sk_bitmap.pixelRef()->unique());
-
-  EXPECT_EQ(0xDEED1020, *sk_bitmap.getAddr32(10, 20));
-  EXPECT_EQ(0xDEED2030, *sk_bitmap.getAddr32(20, 30));
-
-  *(platform_bitmap->GetBitmap().getAddr32(30, 40)) = 0xDEED3040;
-
-  // The SkBitmaps derived from a PlatformBitmap must be capable of outliving
-  // the PlatformBitmap.
-  platform_bitmap.reset();
-
-  EXPECT_TRUE(sk_bitmap.pixelRef()->unique());
-
-  EXPECT_EQ(0xDEED1020, *sk_bitmap.getAddr32(10, 20));
-  EXPECT_EQ(0xDEED2030, *sk_bitmap.getAddr32(20, 30));
-  EXPECT_EQ(0xDEED3040, *sk_bitmap.getAddr32(30, 40));
-  sk_bitmap.unlockPixels();
-
-  EXPECT_EQ(NULL, sk_bitmap.getPixels());
-
-  sk_bitmap.lockPixels();
-  EXPECT_EQ(0xDEED1020, *sk_bitmap.getAddr32(10, 20));
-  EXPECT_EQ(0xDEED2030, *sk_bitmap.getAddr32(20, 30));
-  EXPECT_EQ(0xDEED3040, *sk_bitmap.getAddr32(30, 40));
-  sk_bitmap.unlockPixels();
-}
-
-
 }  // namespace skia
diff --git a/storage/browser/fileapi/file_system_backend.h b/storage/browser/fileapi/file_system_backend.h
index 58333b3d..ad3a8f3 100644
--- a/storage/browser/fileapi/file_system_backend.h
+++ b/storage/browser/fileapi/file_system_backend.h
@@ -40,7 +40,7 @@
 // Maximum numer of bytes to be read by FileStreamReader classes. Used in
 // FileSystemBackend::CreateFileStreamReader(), when it's not known how many
 // bytes will be fetched in total.
-const int64 kMaximumLength = std::numeric_limits<int64>::max();
+const int64 kMaximumLength = INT64_MAX;
 
 // An interface for defining a file system backend.
 //
diff --git a/storage/browser/quota/client_usage_tracker.cc b/storage/browser/quota/client_usage_tracker.cc
index 968b351..0b11bd1 100644
--- a/storage/browser/quota/client_usage_tracker.cc
+++ b/storage/browser/quota/client_usage_tracker.cc
@@ -173,6 +173,15 @@
   }
 }
 
+void ClientUsageTracker::GetCachedOriginsUsage(
+    std::map<GURL, int64>* origin_usage) const {
+  DCHECK(origin_usage);
+  for (const auto& host_and_usage_map : cached_usage_by_host_) {
+    for (const auto& origin_and_usage : host_and_usage_map.second)
+      (*origin_usage)[origin_and_usage.first] += origin_and_usage.second;
+  }
+}
+
 void ClientUsageTracker::GetCachedOrigins(std::set<GURL>* origins) const {
   DCHECK(origins);
   for (const auto& host_and_usage_map : cached_usage_by_host_) {
diff --git a/storage/browser/quota/client_usage_tracker.h b/storage/browser/quota/client_usage_tracker.h
index 1c07dc8..0505fae 100644
--- a/storage/browser/quota/client_usage_tracker.h
+++ b/storage/browser/quota/client_usage_tracker.h
@@ -51,9 +51,8 @@
   void GetHostUsage(const std::string& host, const UsageCallback& callback);
   void UpdateUsageCache(const GURL& origin, int64 delta);
   void GetCachedHostsUsage(std::map<std::string, int64>* host_usage) const;
+  void GetCachedOriginsUsage(std::map<GURL, int64>* origin_usage) const;
   void GetCachedOrigins(std::set<GURL>* origins) const;
-  int64 GetCachedOriginsUsage(const std::set<GURL>& origins,
-                              std::vector<GURL>* origins_not_in_cache);
   bool IsUsageCacheEnabledForOrigin(const GURL& origin) const;
   void SetUsageCacheEnabled(const GURL& origin, bool enabled);
 
diff --git a/storage/browser/quota/quota_manager.cc b/storage/browser/quota/quota_manager.cc
index 674b1ec..c2ccb26 100644
--- a/storage/browser/quota/quota_manager.cc
+++ b/storage/browser/quota/quota_manager.cc
@@ -836,14 +836,14 @@
       eviction_disabled_(false),
       io_thread_(io_thread),
       db_thread_(db_thread),
+      is_getting_eviction_origin_(false),
       temporary_quota_initialized_(false),
       temporary_quota_override_(-1),
       desired_available_space_(-1),
       special_storage_policy_(special_storage_policy),
       get_disk_space_fn_(&CallSystemGetAmountOfFreeDiskSpace),
       storage_monitor_(new StorageMonitor(this)),
-      weak_factory_(this) {
-}
+      weak_factory_(this) {}
 
 void QuotaManager::GetUsageInfo(const GetUsageInfoCallback& callback) {
   LazyInitialize();
@@ -954,6 +954,11 @@
   GetUsageTracker(type)->SetUsageCacheEnabled(client_id, origin, enabled);
 }
 
+void QuotaManager::SetTemporaryStorageEvictionPolicy(
+    scoped_ptr<QuotaEvictionPolicy> policy) {
+  temporary_storage_eviction_policy_ = policy.Pass();
+}
+
 void QuotaManager::DeleteOriginData(
     const GURL& origin, StorageType type, int quota_client_mask,
     const StatusCallback& callback) {
@@ -1318,7 +1323,7 @@
     const GURL& origin, StorageType type,
     base::Time accessed_time) {
   LazyInitialize();
-  if (type == kStorageTypeTemporary && !lru_origin_callback_.is_null()) {
+  if (type == kStorageTypeTemporary && is_getting_eviction_origin_) {
     // Record the accessed origins while GetLRUOrigin task is runing
     // to filter out them from eviction.
     access_notified_origins_.insert(origin);
@@ -1472,8 +1477,38 @@
 }
 
 void QuotaManager::GetEvictionOrigin(StorageType type,
+                                     int64 global_quota,
                                      const GetOriginCallback& callback) {
-  GetLRUOrigin(type, callback);
+  LazyInitialize();
+  // This must not be called while there's an in-flight task.
+  DCHECK(!is_getting_eviction_origin_);
+  is_getting_eviction_origin_ = true;
+
+  GetOriginCallback did_get_origin_callback =
+      base::Bind(&QuotaManager::DidGetEvictionOrigin,
+                 weak_factory_.GetWeakPtr(), callback);
+
+  if (type == kStorageTypeTemporary && temporary_storage_eviction_policy_) {
+    std::map<GURL, int64> usage_map;
+    // The cached origins are populated by the prior call to
+    // GetUsageAndQuotaForEviction().
+    GetUsageTracker(kStorageTypeTemporary)->GetCachedOriginsUsage(&usage_map);
+
+    temporary_storage_eviction_policy_->GetEvictionOrigin(
+        special_storage_policy_, usage_map, global_quota,
+        did_get_origin_callback);
+    return;
+  }
+
+  // TODO(calamity): convert LRU origin retrieval into a QuotaEvictionPolicy.
+  GetLRUOrigin(type, did_get_origin_callback);
+}
+
+void QuotaManager::DidGetEvictionOrigin(const GetOriginCallback& callback,
+                                        const GURL& origin) {
+  callback.Run(origin);
+
+  is_getting_eviction_origin_ = false;
 }
 
 void QuotaManager::EvictOriginData(const GURL& origin,
@@ -1520,6 +1555,7 @@
     return;
   }
 
+  // TODO(calamity): make all QuotaEvictionPolicies aware of these exceptions.
   std::set<GURL>* exceptions = new std::set<GURL>;
   for (std::map<GURL, int>::const_iterator p = origins_in_use_.begin();
        p != origins_in_use_.end();
diff --git a/storage/browser/quota/quota_manager.h b/storage/browser/quota/quota_manager.h
index 3e053887..0e4884b 100644
--- a/storage/browser/quota/quota_manager.h
+++ b/storage/browser/quota/quota_manager.h
@@ -28,6 +28,8 @@
 #include "storage/browser/quota/storage_observer.h"
 #include "storage/browser/storage_browser_export.h"
 
+class SiteEngagementEvictionPolicyWithQuotaManagerTest;
+
 namespace base {
 class FilePath;
 class SequencedTaskRunner;
@@ -70,10 +72,12 @@
 };
 
 // TODO(calamity): Use this in the temporary storage eviction path.
-// An interface for deciding which origin's temporary storage should be evicted
-// when the quota is exceeded.
+// An interface for deciding which origin's storage should be evicted when the
+// quota is exceeded.
 class STORAGE_EXPORT QuotaEvictionPolicy {
  public:
+  virtual ~QuotaEvictionPolicy() {}
+
   // Returns the next origin to evict.  It might return an empty GURL when there
   // are no evictable origins.
   virtual void GetEvictionOrigin(
@@ -94,6 +98,7 @@
   // Returns next origin to evict.  It might return an empty GURL when there are
   // no evictable origins.
   virtual void GetEvictionOrigin(StorageType type,
+                                 int64 global_quota,
                                  const GetOriginCallback& callback) = 0;
 
   virtual void EvictOriginData(
@@ -194,6 +199,10 @@
                             StorageType type,
                             bool enabled);
 
+  // Set the eviction policy to use when choosing an origin to evict.
+  void SetTemporaryStorageEvictionPolicy(
+      scoped_ptr<QuotaEvictionPolicy> policy);
+
   // DeleteOriginData and DeleteHostData (surprisingly enough) delete data of a
   // particular StorageType associated with either a specific origin or set of
   // origins. Each method additionally requires a |quota_client_mask| which
@@ -286,6 +295,7 @@
   friend class QuotaManagerProxy;
   friend class QuotaTemporaryStorageEvictor;
   friend struct QuotaManagerDeleter;
+  friend class ::SiteEngagementEvictionPolicyWithQuotaManagerTest;
 
   class GetUsageInfoTask;
 
@@ -373,8 +383,12 @@
   void DidGetPersistentGlobalUsageForHistogram(int64 usage,
                                                int64 unlimited_usage);
 
+  void DidGetEvictionOrigin(const GetOriginCallback& callback,
+                            const GURL& origin);
+
   // QuotaEvictionHandler.
   void GetEvictionOrigin(StorageType type,
+                         int64 global_quota,
                          const GetOriginCallback& callback) override;
   void EvictOriginData(const GURL& origin,
                        StorageType type,
@@ -435,6 +449,8 @@
 
   scoped_ptr<QuotaTemporaryStorageEvictor> temporary_storage_evictor_;
   EvictionContext eviction_context_;
+  scoped_ptr<QuotaEvictionPolicy> temporary_storage_eviction_policy_;
+  bool is_getting_eviction_origin_;
 
   ClosureQueue db_initialization_callbacks_;
   AvailableSpaceCallbackQueue available_space_callbacks_;
diff --git a/storage/browser/quota/quota_temporary_storage_evictor.cc b/storage/browser/quota/quota_temporary_storage_evictor.cc
index adcff0d..30f17b8 100644
--- a/storage/browser/quota/quota_temporary_storage_evictor.cc
+++ b/storage/browser/quota/quota_temporary_storage_evictor.cc
@@ -196,7 +196,7 @@
     // TODO(michaeln): if the reason for eviction is low physical disk space,
     // make 'unlimited' origins subject to eviction too.
     quota_eviction_handler_->GetEvictionOrigin(
-        kStorageTypeTemporary,
+        kStorageTypeTemporary, qau.quota,
         base::Bind(&QuotaTemporaryStorageEvictor::OnGotEvictionOrigin,
                    weak_factory_.GetWeakPtr()));
   } else {
diff --git a/storage/browser/quota/usage_tracker.cc b/storage/browser/quota/usage_tracker.cc
index 528725d7..de9fbeb 100644
--- a/storage/browser/quota/usage_tracker.cc
+++ b/storage/browser/quota/usage_tracker.cc
@@ -144,6 +144,14 @@
     client_id_and_tracker.second->GetCachedHostsUsage(host_usage);
 }
 
+void UsageTracker::GetCachedOriginsUsage(
+    std::map<GURL, int64>* origin_usage) const {
+  DCHECK(origin_usage);
+  origin_usage->clear();
+  for (const auto& client_id_and_tracker : client_tracker_map_)
+    client_id_and_tracker.second->GetCachedOriginsUsage(origin_usage);
+}
+
 void UsageTracker::GetCachedOrigins(std::set<GURL>* origins) const {
   DCHECK(origins);
   origins->clear();
diff --git a/storage/browser/quota/usage_tracker.h b/storage/browser/quota/usage_tracker.h
index 224faf8..ed54fcc2 100644
--- a/storage/browser/quota/usage_tracker.h
+++ b/storage/browser/quota/usage_tracker.h
@@ -45,6 +45,7 @@
   void UpdateUsageCache(QuotaClient::ID client_id,
                         const GURL& origin,
                         int64 delta);
+  void GetCachedOriginsUsage(std::map<GURL, int64>* origin_usage) const;
   void GetCachedHostsUsage(std::map<std::string, int64>* host_usage) const;
   void GetCachedOrigins(std::set<GURL>* origins) const;
   bool IsWorking() const {
diff --git a/sync/BUILD.gn b/sync/BUILD.gn
index 9fdc65f..9b675ad 100644
--- a/sync/BUILD.gn
+++ b/sync/BUILD.gn
@@ -25,6 +25,10 @@
     "api/attachments/attachment_store.h",
     "api/attachments/attachment_store_backend.cc",
     "api/attachments/attachment_store_backend.h",
+    "api/model_type_change_processor.cc",
+    "api/model_type_change_processor.h",
+    "api/model_type_service.cc",
+    "api/model_type_service.h",
     "api/model_type_store.cc",
     "api/model_type_store.h",
     "api/string_ordinal.h",
@@ -687,10 +691,6 @@
     "$root_out_dir/pyproto/google/",
   ]
 
-  if (is_android) {
-    data += [ "$root_out_dir/locales/en-US.pak" ]
-  }
-
   deps = [
     ":test_support_sync_core",
     ":test_support_sync_internal_api",
diff --git a/sync/api/model_type_change_processor.cc b/sync/api/model_type_change_processor.cc
new file mode 100644
index 0000000..4e74065d
--- /dev/null
+++ b/sync/api/model_type_change_processor.cc
@@ -0,0 +1,13 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "sync/api/model_type_change_processor.h"
+
+namespace syncer_v2 {
+
+ModelTypeChangeProcessor::ModelTypeChangeProcessor() {}
+
+ModelTypeChangeProcessor::~ModelTypeChangeProcessor() {}
+
+}  // namespace syncer_v2
diff --git a/sync/api/model_type_change_processor.h b/sync/api/model_type_change_processor.h
new file mode 100644
index 0000000..85f8d161
--- /dev/null
+++ b/sync/api/model_type_change_processor.h
@@ -0,0 +1,22 @@
+// 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 SYNC_API_MODEL_TYPE_CHANGE_PROCESSOR_H_
+#define SYNC_API_MODEL_TYPE_CHANGE_PROCESSOR_H_
+
+#include "sync/base/sync_export.h"
+
+namespace syncer_v2 {
+
+// Interface used by the ModelTypeService to inform sync of local
+// changes.
+class SYNC_EXPORT ModelTypeChangeProcessor {
+ public:
+  ModelTypeChangeProcessor();
+  virtual ~ModelTypeChangeProcessor();
+};
+
+}  // namespace syncer_v2
+
+#endif  // SYNC_API_MODEL_TYPE_CHANGE_PROCESSOR_H_
diff --git a/sync/api/model_type_service.cc b/sync/api/model_type_service.cc
new file mode 100644
index 0000000..61ea860
--- /dev/null
+++ b/sync/api/model_type_service.cc
@@ -0,0 +1,13 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "sync/api/model_type_service.h"
+
+namespace syncer_v2 {
+
+ModelTypeService::ModelTypeService() {}
+
+ModelTypeService::~ModelTypeService() {}
+
+}  // namespace syncer_v2
diff --git a/sync/api/model_type_service.h b/sync/api/model_type_service.h
new file mode 100644
index 0000000..d01dc8718
--- /dev/null
+++ b/sync/api/model_type_service.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 SYNC_API_MODEL_TYPE_SERVICE_H_
+#define SYNC_API_MODEL_TYPE_SERVICE_H_
+
+#include "sync/base/sync_export.h"
+
+namespace syncer_v2 {
+
+// Interface implemented by model types to receive updates from sync via the
+// SharedModelTypeProcessor. Provides a way for sync to update the data and
+// metadata for entities, as well as the model type state.
+class SYNC_EXPORT ModelTypeService {
+ public:
+  ModelTypeService();
+  virtual ~ModelTypeService();
+};
+
+}  // namespace syncer_v2
+
+#endif  // SYNC_API_MODEL_TYPE_SERVICE_H_
diff --git a/sync/engine/apply_control_data_updates.cc b/sync/engine/apply_control_data_updates.cc
index 3e167b1..49825b83 100644
--- a/sync/engine/apply_control_data_updates.cc
+++ b/sync/engine/apply_control_data_updates.cc
@@ -32,13 +32,25 @@
   ModelTypeSet control_types = ControlTypes();
   for (ModelTypeSet::Iterator iter = control_types.First(); iter.Good();
        iter.Inc()) {
-    syncable::MutableEntry entry(&trans, syncable::GET_TYPE_ROOT, iter.Get());
+    ModelType type = iter.Get();
+    syncable::MutableEntry entry(&trans, syncable::GET_TYPE_ROOT, type);
     if (!entry.good())
       continue;
-    if (!entry.GetIsUnappliedUpdate())
-      continue;
 
-    ModelType type = entry.GetServerModelType();
+    if (!entry.GetIsUnappliedUpdate()) {
+      // If this is a type with client generated root, the root node has been
+      // created locally and might never be updated by the server. In that case
+      // it has to be marked as having the initial download completed (which is
+      // done by changing the root's base version to a value other than
+      // CHANGES_VERSION). This does nothing if the root's base version is
+      // already other than CHANGES_VERSION.
+      if (IsTypeWithClientGeneratedRoot(type)) {
+        dir->MarkInitialSyncEndedForType(&trans, type);
+      }
+      continue;
+    }
+
+    DCHECK_EQ(type, entry.GetServerModelType());
     if (type == NIGORI) {
       // Nigori node applications never fail.
       ApplyNigoriUpdate(&trans,
diff --git a/sync/engine/apply_control_data_updates_unittest.cc b/sync/engine/apply_control_data_updates_unittest.cc
index 7ed6bd4..c01e5a71 100644
--- a/sync/engine/apply_control_data_updates_unittest.cc
+++ b/sync/engine/apply_control_data_updates_unittest.cc
@@ -914,4 +914,67 @@
           experiments().keystore_encryption().enabled());
 }
 
+// Check that applying a EXPERIMENTS update marks the datatype as downloaded.
+TEST_F(ApplyControlDataUpdatesTest, ExperimentsApplyMarksDownloadCompleted) {
+  EXPECT_FALSE(directory()->InitialSyncEndedForType(EXPERIMENTS));
+
+  // Create root node for EXPERIMENTS datatype
+  {
+    syncable::WriteTransaction trans(FROM_HERE, UNITTEST, directory());
+    syncable::ModelNeutralMutableEntry entry(
+        &trans, syncable::CREATE_NEW_TYPE_ROOT, EXPERIMENTS);
+    ASSERT_TRUE(entry.good());
+    entry.PutServerIsDir(true);
+    entry.PutUniqueServerTag(ModelTypeToRootTag(EXPERIMENTS));
+  }
+
+  // Initial sync isn't marked as ended for EXPERIMENTS even though the
+  // root folder exists.
+  EXPECT_FALSE(directory()->InitialSyncEndedForType(EXPERIMENTS));
+
+  std::string experiment_id = "experiment";
+  sync_pb::EntitySpecifics specifics;
+  specifics.mutable_experiments()->mutable_keystore_encryption()->set_enabled(
+      true);
+  entry_factory_->CreateUnappliedNewItem(experiment_id, specifics, false);
+
+  ApplyControlDataUpdates(directory());
+
+  // After applying the updates EXPERIMENTS should be marked as having its
+  // initial sync completed.
+  EXPECT_TRUE(directory()->InitialSyncEndedForType(EXPERIMENTS));
+  // Verify that there is no side effect on another control type.
+  EXPECT_FALSE(directory()->InitialSyncEndedForType(NIGORI));
+}
+
+// Check that applying a NIGORI update marks the datatype as downloaded.
+TEST_F(ApplyControlDataUpdatesTest, NigoriApplyMarksDownloadCompleted) {
+  EXPECT_FALSE(directory()->InitialSyncEndedForType(NIGORI));
+
+  Cryptographer* cryptographer;
+
+  {
+    syncable::ReadTransaction trans(FROM_HERE, directory());
+    cryptographer = directory()->GetCryptographer(&trans);
+  }
+
+  KeyParams params = {"localhost", "dummy", "foobar"};
+  cryptographer->AddKey(params);
+  sync_pb::EntitySpecifics specifics;
+  sync_pb::NigoriSpecifics* nigori = specifics.mutable_nigori();
+  cryptographer->GetKeys(nigori->mutable_encryption_keybag());
+  nigori->set_encrypt_everything(true);
+
+  entry_factory_->CreateUnappliedNewItem(ModelTypeToRootTag(NIGORI), specifics,
+                                         true);
+
+  ApplyControlDataUpdates(directory());
+
+  // After applying the updates NIGORI should be marked as having its
+  // initial sync completed.
+  EXPECT_TRUE(directory()->InitialSyncEndedForType(NIGORI));
+  // Verify that there is no side effect on another control type.
+  EXPECT_FALSE(directory()->InitialSyncEndedForType(EXPERIMENTS));
+}
+
 }  // namespace syncer
diff --git a/sync/engine/directory_update_handler.cc b/sync/engine/directory_update_handler.cc
index 5b2bac85..8adc6dd 100644
--- a/sync/engine/directory_update_handler.cc
+++ b/sync/engine/directory_update_handler.cc
@@ -10,6 +10,7 @@
 #include "sync/sessions/directory_type_debug_info_emitter.h"
 #include "sync/syncable/directory.h"
 #include "sync/syncable/model_neutral_mutable_entry.h"
+#include "sync/syncable/syncable_changes_version.h"
 #include "sync/syncable/syncable_model_neutral_write_transaction.h"
 #include "sync/syncable/syncable_write_transaction.h"
 #include "sync/util/data_type_histogram.h"
@@ -109,34 +110,34 @@
 }
 
 void DirectoryUpdateHandler::ApplyUpdates(sessions::StatusController* status) {
-  if (!IsApplyUpdatesRequired()) {
-    return;
+  if (IsApplyUpdatesRequired()) {
+    // This will invoke handlers that belong to the model and its thread, so we
+    // switch to the appropriate thread before we start this work.
+    WorkCallback c =
+        base::Bind(&DirectoryUpdateHandler::ApplyUpdatesImpl,
+                   // We wait until the callback is executed.  We can safely use
+                   // Unretained.
+                   base::Unretained(this), base::Unretained(status));
+    worker_->DoWorkAndWaitUntilDone(c);
+
+    debug_info_emitter_->EmitUpdateCountersUpdate();
+    debug_info_emitter_->EmitStatusCountersUpdate();
   }
 
-  // This will invoke handlers that belong to the model and its thread, so we
-  // switch to the appropriate thread before we start this work.
-  WorkCallback c = base::Bind(
-      &DirectoryUpdateHandler::ApplyUpdatesImpl,
-      // We wait until the callback is executed.  We can safely use Unretained.
-      base::Unretained(this),
-      base::Unretained(status));
-  worker_->DoWorkAndWaitUntilDone(c);
-
-  debug_info_emitter_->EmitUpdateCountersUpdate();
-  debug_info_emitter_->EmitStatusCountersUpdate();
+  PostApplyUpdates();
 }
 
 void DirectoryUpdateHandler::PassiveApplyUpdates(
     sessions::StatusController* status) {
-  if (!IsApplyUpdatesRequired()) {
-    return;
+  if (IsApplyUpdatesRequired()) {
+    // Just do the work here instead of deferring to another thread.
+    ApplyUpdatesImpl(status);
+
+    debug_info_emitter_->EmitUpdateCountersUpdate();
+    debug_info_emitter_->EmitStatusCountersUpdate();
   }
 
-  // Just do the work here instead of deferring to another thread.
-  ApplyUpdatesImpl(status);
-
-  debug_info_emitter_->EmitUpdateCountersUpdate();
-  debug_info_emitter_->EmitStatusCountersUpdate();
+  PostApplyUpdates();
 }
 
 SyncerError DirectoryUpdateHandler::ApplyUpdatesImpl(
@@ -218,6 +219,20 @@
   return SYNCER_OK;
 }
 
+void DirectoryUpdateHandler::PostApplyUpdates() {
+  // If this is a type with client generated root, the root node has been
+  // created locally and didn't go through ApplyUpdatesImpl.
+  // Mark it as having the initial download completed so that the type
+  // reports as properly initialized (which is done by changing the root's
+  // base version to a value other than CHANGES_VERSION).
+  // This does nothing if the root's base version is already other than
+  // CHANGES_VERSION.
+  if (IsTypeWithClientGeneratedRoot(type_)) {
+    syncable::ModelNeutralWriteTransaction trans(FROM_HERE, SYNCER, dir_);
+    dir_->MarkInitialSyncEndedForType(&trans, type_);
+  }
+}
+
 bool DirectoryUpdateHandler::IsApplyUpdatesRequired() {
   if (IsControlType(type_)) {
     return false;  // We don't process control types here.
diff --git a/sync/engine/directory_update_handler.h b/sync/engine/directory_update_handler.h
index 246d412..df94f341 100644
--- a/sync/engine/directory_update_handler.h
+++ b/sync/engine/directory_update_handler.h
@@ -68,6 +68,11 @@
   // Sometimes there is nothing to do, so we can return without doing anything.
   bool IsApplyUpdatesRequired();
 
+  // Called at the end of ApplyUpdates and PassiveApplyUpdates and performs
+  // steps common to both (even when IsApplyUpdatesRequired has returned
+  // false).
+  void PostApplyUpdates();
+
   // Processes the given SyncEntities and stores their data in the directory.
   // Their types must match this update handler's type.
   void UpdateSyncEntities(
diff --git a/sync/engine/directory_update_handler_unittest.cc b/sync/engine/directory_update_handler_unittest.cc
index 9579e93..2a25f16 100644
--- a/sync/engine/directory_update_handler_unittest.cc
+++ b/sync/engine/directory_update_handler_unittest.cc
@@ -86,9 +86,7 @@
   }
 
   bool TypeRootExists(ModelType model_type) {
-    syncable::ReadTransaction trans(FROM_HERE, dir());
-    syncable::Entry e(&trans, syncable::GET_TYPE_ROOT, model_type);
-    return e.good() && !e.GetIsDel();
+    return dir()->InitialSyncEndedForType(model_type);
   }
 
  protected:
diff --git a/sync/engine/syncer_unittest.cc b/sync/engine/syncer_unittest.cc
index c630fe4..90d9e14 100644
--- a/sync/engine/syncer_unittest.cc
+++ b/sync/engine/syncer_unittest.cc
@@ -4336,6 +4336,8 @@
     tag2_metahandle = tag2.GetMetahandle();
 
     // Preferences type root should have been created by the updates above.
+    ASSERT_TRUE(directory()->InitialSyncEndedForType(&trans, PREFERENCES));
+
     Entry pref_root(&trans, GET_TYPE_ROOT, PREFERENCES);
     ASSERT_TRUE(pref_root.good());
 
@@ -4378,6 +4380,8 @@
     EXPECT_EQ(tag2_metahandle, tag2.GetMetahandle());
 
     // Preferences type root should have been created by the updates above.
+    ASSERT_TRUE(directory()->InitialSyncEndedForType(&trans, PREFERENCES));
+
     Entry pref_root(&trans, GET_TYPE_ROOT, PREFERENCES);
     ASSERT_TRUE(pref_root.good());
 
@@ -4460,6 +4464,8 @@
     EXPECT_EQ("tag c", tag_c.GetUniqueClientTag());
 
     // Preferences type root should have been created by the updates above.
+    ASSERT_TRUE(directory()->InitialSyncEndedForType(&trans, PREFERENCES));
+
     Entry pref_root(&trans, GET_TYPE_ROOT, PREFERENCES);
     ASSERT_TRUE(pref_root.good());
 
@@ -4483,6 +4489,9 @@
     // Preferences type root should have been created by the update above.
     // We need it in order to get its ID.
     syncable::ReadTransaction trans(FROM_HERE, directory());
+
+    ASSERT_TRUE(directory()->InitialSyncEndedForType(&trans, PREFERENCES));
+
     Entry pref_root(&trans, GET_TYPE_ROOT, PREFERENCES);
     ASSERT_TRUE(pref_root.good());
     pref_root_id = pref_root.GetId();
@@ -4675,17 +4684,18 @@
   syncable::Id node2 = ids_.NewServerId();
 
   // Construct the first GetUpdates response.
-  mock_server_->AddUpdateDirectory(node1, ids_.root(), "one", 1, 10,
-                                   foreign_cache_guid(), "-2");
+  mock_server_->AddUpdatePref(node1.GetServerId(), "", "one", 1, 10);
   mock_server_->SetChangesRemaining(1);
   mock_server_->NextUpdateBatch();
 
   // Construct the second GetUpdates response.
-  mock_server_->AddUpdateDirectory(node2, ids_.root(), "two", 1, 20,
-                                   foreign_cache_guid(), "-2");
+  mock_server_->AddUpdatePref(node2.GetServerId(), "", "two", 2, 20);
 
   SyncShareConfigure();
 
+  // The type should now be marked as having the initial sync completed.
+  EXPECT_TRUE(directory()->InitialSyncEndedForType(PREFERENCES));
+
   syncable::ReadTransaction trans(FROM_HERE, directory());
   // Both nodes should be downloaded and applied.
 
@@ -4710,17 +4720,18 @@
   mock_server_->FailNthPostBufferToPathCall(2);
 
   // Construct the first GetUpdates response.
-  mock_server_->AddUpdateDirectory(node1, ids_.root(), "one", 1, 10,
-                                   foreign_cache_guid(), "-1");
+  mock_server_->AddUpdatePref(node1.GetServerId(), "", "one", 1, 10);
   mock_server_->SetChangesRemaining(1);
   mock_server_->NextUpdateBatch();
 
-  // Consutrct the second GetUpdates response.
-  mock_server_->AddUpdateDirectory(node2, ids_.root(), "two", 1, 20,
-                                   foreign_cache_guid(), "-2");
+  // Construct the second GetUpdates response.
+  mock_server_->AddUpdatePref(node2.GetServerId(), "", "two", 2, 20);
 
   SyncShareConfigure();
 
+  // The type shouldn't be marked as having the initial sync completed.
+  EXPECT_FALSE(directory()->InitialSyncEndedForType(PREFERENCES));
+
   syncable::ReadTransaction trans(FROM_HERE, directory());
 
   // The first node was downloaded, but not applied.
@@ -4767,6 +4778,27 @@
   }
 }
 
+// Trigger an update that contains a progress marker only and verify that
+// the type's permanent folder is created and the type is marked as having
+// initial sync complete.
+TEST_F(SyncerTest, ProgressMarkerOnlyUpdateCreatesRootFolder) {
+  EXPECT_FALSE(directory()->InitialSyncEndedForType(PREFERENCES));
+  sync_pb::DataTypeProgressMarker* marker =
+      mock_server_->AddUpdateProgressMarker();
+  marker->set_data_type_id(GetSpecificsFieldNumberFromModelType(PREFERENCES));
+  marker->set_token("foobar");
+
+  SyncShareNudge();
+
+  {
+    syncable::ReadTransaction trans(FROM_HERE, directory());
+    syncable::Entry root(&trans, syncable::GET_TYPE_ROOT, PREFERENCES);
+    EXPECT_TRUE(root.good());
+  }
+
+  EXPECT_TRUE(directory()->InitialSyncEndedForType(PREFERENCES));
+}
+
 // Tests specifically related to bookmark (and therefore no client tags) sync
 // logic. Entities without client tags have custom logic in parts of the code,
 // and hence are not covered by e.g. the Undeletion tests below.
diff --git a/sync/internal_api/public/shared_model_type_processor.h b/sync/internal_api/public/shared_model_type_processor.h
index d8a7e2b7..86638a1 100644
--- a/sync/internal_api/public/shared_model_type_processor.h
+++ b/sync/internal_api/public/shared_model_type_processor.h
@@ -9,6 +9,7 @@
 #include "base/memory/scoped_ptr.h"
 #include "base/memory/weak_ptr.h"
 #include "base/threading/non_thread_safe.h"
+#include "sync/api/model_type_change_processor.h"
 #include "sync/base/sync_export.h"
 #include "sync/internal_api/public/base/model_type.h"
 #include "sync/internal_api/public/model_type_processor.h"
@@ -23,8 +24,10 @@
 
 // A sync component embedded on the synced type's thread that helps to handle
 // communication between sync and model type threads.
-class SYNC_EXPORT_PRIVATE SharedModelTypeProcessor : public ModelTypeProcessor,
-                                                     base::NonThreadSafe {
+class SYNC_EXPORT_PRIVATE SharedModelTypeProcessor
+    : public ModelTypeProcessor,
+      public ModelTypeChangeProcessor,
+      base::NonThreadSafe {
  public:
   SharedModelTypeProcessor(syncer::ModelType type,
                            base::WeakPtr<ModelTypeStore> store);
diff --git a/sync/sync.gyp b/sync/sync.gyp
index 4ad6b36..1a1a089 100644
--- a/sync/sync.gyp
+++ b/sync/sync.gyp
@@ -76,6 +76,10 @@
         'api/attachments/attachment_store.h',
         'api/attachments/attachment_store_backend.cc',
         'api/attachments/attachment_store_backend.h',
+        'api/model_type_change_processor.cc',
+        'api/model_type_change_processor.h',
+        'api/model_type_service.cc',
+        'api/model_type_service.h',
         'api/model_type_store.cc',
         'api/model_type_store.h',
         'api/string_ordinal.h',
diff --git a/sync/sync_unit_tests.isolate b/sync/sync_unit_tests.isolate
index c28ebd5..8b64e4c 100644
--- a/sync/sync_unit_tests.isolate
+++ b/sync/sync_unit_tests.isolate
@@ -3,13 +3,6 @@
 # found in the LICENSE file.
 {
   'conditions': [
-    ['OS=="android"', {
-      'variables': {
-        'files': [
-          '<(PRODUCT_DIR)/locales/en-US.pak',
-        ],
-      },
-    }],
     ['OS=="linux" or OS=="mac" or OS=="win"', {
       'variables': {
         'command': [
diff --git a/sync/syncable/directory.cc b/sync/syncable/directory.cc
index 3b735e9e..33cb6d4b 100644
--- a/sync/syncable/directory.cc
+++ b/sync/syncable/directory.cc
@@ -19,6 +19,7 @@
 #include "sync/syncable/entry.h"
 #include "sync/syncable/entry_kernel.h"
 #include "sync/syncable/in_memory_directory_backing_store.h"
+#include "sync/syncable/model_neutral_mutable_entry.h"
 #include "sync/syncable/on_disk_directory_backing_store.h"
 #include "sync/syncable/scoped_kernel_lock.h"
 #include "sync/syncable/scoped_parent_child_index_updater.h"
@@ -985,9 +986,29 @@
 
 bool Directory::InitialSyncEndedForType(
     BaseTransaction* trans, ModelType type) {
-  // True iff the type's root node has been created.
-  syncable::Entry entry(trans, syncable::GET_TYPE_ROOT, type);
-  return entry.good();
+  // True iff the type's root node has been created and changes
+  // for the type have been applied at least once.
+  Entry root(trans, GET_TYPE_ROOT, type);
+  return root.good() && root.GetBaseVersion() != CHANGES_VERSION;
+}
+
+void Directory::MarkInitialSyncEndedForType(BaseWriteTransaction* trans,
+                                            ModelType type) {
+  // If the root folder is downloaded for the server, the root's base version
+  // get updated automatically at the end of update cycle when the update gets
+  // applied. However if this is a type with client generated root, the root
+  // node gets created locally and never goes through the update cycle. In that
+  // case its base version has to be explictly changed from CHANGES_VERSION
+  // at the end of the initial update cycle to mark the type as downloaded.
+  // See Directory::InitialSyncEndedForType
+  DCHECK(IsTypeWithClientGeneratedRoot(type));
+  ModelNeutralMutableEntry root(trans, GET_TYPE_ROOT, type);
+
+  // Some tests don't bother creating type root. Need to check if the root
+  // exists before clearing its base version.
+  if (root.good() && root.GetBaseVersion() == CHANGES_VERSION) {
+    root.PutBaseVersion(0);
+  }
 }
 
 string Directory::store_birthday() const {
diff --git a/sync/syncable/directory.h b/sync/syncable/directory.h
index d71fcf8a..7402697 100644
--- a/sync/syncable/directory.h
+++ b/sync/syncable/directory.h
@@ -300,8 +300,16 @@
                           ModelType type,
                           const sync_pb::DataTypeContext& context);
 
+  // Returns types for which the initial sync has ended.
   ModelTypeSet InitialSyncEndedTypes();
+
+  // Returns true if the initial sync for |type| has completed.
   bool InitialSyncEndedForType(ModelType type);
+  bool InitialSyncEndedForType(BaseTransaction* trans, ModelType type);
+
+  // Marks the |type| as having its intial sync complete.
+  // This applies only to types with implicitly created root folders.
+  void MarkInitialSyncEndedForType(BaseWriteTransaction* trans, ModelType type);
 
   // (Account) Store birthday is opaque to the client, so we keep it in the
   // format it is in the proto buffer in case we switch to a binary birthday
@@ -620,9 +628,6 @@
   // detected.
   void OnCatastrophicError();
 
-  // Returns true if the initial sync for |type| has completed.
-  bool InitialSyncEndedForType(BaseTransaction* trans, ModelType type);
-
   // Stops sending events to the delegate and the transaction
   // observer.
   void Close();
diff --git a/sync/syncable/directory_unittest.cc b/sync/syncable/directory_unittest.cc
index 198e53499..a9d8058 100644
--- a/sync/syncable/directory_unittest.cc
+++ b/sync/syncable/directory_unittest.cc
@@ -2110,6 +2110,28 @@
                                            item.GetBaseServerSpecifics()));
 }
 
+// Tests checking and marking a type as having its initial sync completed.
+TEST_F(SyncableDirectoryTest, InitialSyncEndedForType) {
+  // Not completed if there is no root node.
+  EXPECT_FALSE(dir()->InitialSyncEndedForType(PREFERENCES));
+
+  WriteTransaction trans(FROM_HERE, UNITTEST, dir().get());
+  // Create the root node.
+  ModelNeutralMutableEntry entry(&trans, syncable::CREATE_NEW_TYPE_ROOT,
+                                 PREFERENCES);
+  DCHECK(entry.good());
+
+  entry.PutServerIsDir(true);
+  entry.PutUniqueServerTag(ModelTypeToRootTag(PREFERENCES));
+
+  // Should still be marked as incomplete.
+  EXPECT_FALSE(dir()->InitialSyncEndedForType(&trans, PREFERENCES));
+
+  // Mark as complete and verify.
+  dir()->MarkInitialSyncEndedForType(&trans, PREFERENCES);
+  EXPECT_TRUE(dir()->InitialSyncEndedForType(&trans, PREFERENCES));
+}
+
 }  // namespace syncable
 
 }  // namespace syncer
diff --git a/sync/test/engine/mock_connection_manager.cc b/sync/test/engine/mock_connection_manager.cc
index cb07db4..42e3ec7 100644
--- a/sync/test/engine/mock_connection_manager.cc
+++ b/sync/test/engine/mock_connection_manager.cc
@@ -499,11 +499,15 @@
   ApplyToken();
 }
 
+sync_pb::DataTypeProgressMarker*
+MockConnectionManager::AddUpdateProgressMarker() {
+  return GetUpdateResponse()->add_new_progress_marker();
+}
+
 void MockConnectionManager::ApplyToken() {
   if (!update_queue_.empty()) {
     GetUpdateResponse()->clear_new_progress_marker();
-    sync_pb::DataTypeProgressMarker* new_marker =
-        GetUpdateResponse()->add_new_progress_marker();
+    sync_pb::DataTypeProgressMarker* new_marker = AddUpdateProgressMarker();
     new_marker->set_data_type_id(-1);  // Invalid -- clients shouldn't see.
     new_marker->set_token(next_token_);
   }
diff --git a/sync/test/engine/mock_connection_manager.h b/sync/test/engine/mock_connection_manager.h
index c09cf87..8bcc5c2d 100644
--- a/sync/test/engine/mock_connection_manager.h
+++ b/sync/test/engine/mock_connection_manager.h
@@ -269,6 +269,9 @@
   // Locate the most recent update message for purpose of alteration.
   sync_pb::SyncEntity* GetMutableLastUpdate();
 
+  // Adds a new progress marker to the last update.
+  sync_pb::DataTypeProgressMarker* AddUpdateProgressMarker();
+
  private:
   sync_pb::SyncEntity* AddUpdateFull(syncable::Id id,
                                      syncable::Id parentid,
diff --git a/testing/buildbot/chromium.fyi.json b/testing/buildbot/chromium.fyi.json
index 0bc50f2..2426299 100644
--- a/testing/buildbot/chromium.fyi.json
+++ b/testing/buildbot/chromium.fyi.json
@@ -12,7 +12,7 @@
       {
         "args": [
           "--enable-browser-side-navigation",
-          "--gtest_filter=-ActivityLogApiTest.TriggerEvent:AllUrlsApiTest.WhitelistedExtension:AppBannerDataFetcherBrowserTest.CancelBannerDirect:AppBannerDataFetcherBrowserTest.CancelBannerIndirect:AppBannerDataFetcherBrowserTest.NoManifest:AppBannerDataFetcherBrowserTest.PromptBanner:AppBannerDataFetcherBrowserTest.PromptBannerInHandler:AppBannerDataFetcherBrowserTest.WebAppBannerCreatedDirect:AppBannerDataFetcherBrowserTest.WebAppBannerCreatedDirectLargerTotal:AppBannerDataFetcherBrowserTest.WebAppBannerCreatedDirectMultiple:AppBannerDataFetcherBrowserTest.WebAppBannerCreatedDirectMultipleLargerTotal:AppBannerDataFetcherBrowserTest.WebAppBannerCreatedDirectMultipleSmallerTotal:AppBannerDataFetcherBrowserTest.WebAppBannerCreatedDirectSingle:AppBannerDataFetcherBrowserTest.WebAppBannerCreatedDirectSmallerTotal:AppBannerDataFetcherBrowserTest.WebAppBannerCreatedIndirect:AppBannerDataFetcherBrowserTest.WebAppBannerCreatedIndirectLargerTotal:AppBannerDataFetcherBrowserTest.WebAppBannerCreatedIndirectMultiple:AppBannerDataFetcherBrowserTest.WebAppBannerCreatedIndirectMultipleLargerTotal:AppBannerDataFetcherBrowserTest.WebAppBannerCreatedIndirectSingle:AppBannerDataFetcherBrowserTest.WebAppBannerCreatedIndirectSmallerTotal:AppBannerDataFetcherBrowserTest.WebAppBannerCreatedVarious:AppBannerDataFetcherBrowserTest.WebAppBannerInIFrame:AppBannerDataFetcherBrowserTest.WebAppBannerNoTypeInManifest:AppBannerDataFetcherBrowserTest.WebAppBannerNoTypeInManifestCapsExtension:AppListServiceImplBrowserTest.DeletingProfileUpdatesViewDelegate:AppWindowAPITest.TestCreate:AutofillTest.AggregatesMinValidProfile:AutofillTest.AggregatesMinValidProfileDifferentJS:AutofillTest.AppendCountryCodeForAggregatedPhones:AutofillTest.CCInfoNotStoredWhenAutocompleteOff:AutofillTest.InvalidCreditCardNumberIsNotAggregated:AutofillTest.ProfileSavedWithValidCountryPhone:AutofillTest.ProfilesNotAggregatedWithInvalidEmail:AutofillTest.ProfilesNotAggregatedWithNoAddress:AutofillTest.ProfilesNotAggregatedWithSubmitHandler:AutofillTest.ProfileWithEmailInOtherFieldNotSaved:AutofillTest.UsePlusSignForInternationalNumber:AutofillTest.WhitespacesAndSeparatorCharsStrippedForValidCCNums:BrowserActionsBarBrowserTest.DragBrowserActions:BrowserActionsBarBrowserTest.MultipleWindows:BrowserActionsBarBrowserTest.Visibility:BrowserCloseManagerWithDownloadsBrowserTest/BrowserCloseManagerWithDownloadsBrowserTest.TestWithDangerousUrlDownload/0:BrowserCloseManagerWithDownloadsBrowserTest/BrowserCloseManagerWithDownloadsBrowserTest.TestWithDangerousUrlDownload/1:BrowserCloseManagerWithDownloadsBrowserTest/BrowserCloseManagerWithDownloadsBrowserTest.TestWithDownloads/0:BrowserCloseManagerWithDownloadsBrowserTest/BrowserCloseManagerWithDownloadsBrowserTest.TestWithDownloads/1:BrowserCloseManagerWithDownloadsBrowserTest/BrowserCloseManagerWithDownloadsBrowserTest.TestWithDownloadsFromDifferentProfiles/0:BrowserCloseManagerWithDownloadsBrowserTest/BrowserCloseManagerWithDownloadsBrowserTest.TestWithDownloadsFromDifferentProfiles/1:BrowserCloseManagerWithDownloadsBrowserTest/BrowserCloseManagerWithDownloadsBrowserTest.TestWithOffTheRecordDownloads/0:BrowserCloseManagerWithDownloadsBrowserTest/BrowserCloseManagerWithDownloadsBrowserTest.TestWithOffTheRecordDownloads/1:BrowserNavigatorTest.NavigateFromNTPToOptionsInSameTab:BrowserTest.BeforeUnloadVsBeforeReload:BrowserTest.ClearPendingOnFailUnlessNTP:BrowserTest.InterstitialCancelsGuestViewDialogs:BrowserTest.NoStopDuringTransferUntilCommit:BrowserTest.SecurityStyleChangedObserver:BrowserTest.SecurityStyleChangedObserverGoBack:BrowserTest.ShouldShowLocationBar:BrowserViewTest.DevToolsUpdatesBrowserWindow:BrowsingDataRemoverBrowserTest.Download:CaptivePortalBrowserTest.InterstitialTimerCertErrorAfterSlowLoad:CaptivePortalBrowserTest.InterstitialTimerNavigateAwayWhileLoading:CaptivePortalBrowserTest.InterstitialTimerNavigateWhileLoading_EndWithCaptivePortalInterstitial:CaptivePortalBrowserTest.InterstitialTimerNavigateWhileLoading_EndWithSSLInterstitial:CaptivePortalBrowserTest.InterstitialTimerReloadWhileLoading:CaptivePortalBrowserTest.InterstitialTimerStopNavigationWhileLoading:CaptivePortalBrowserTest.ShowCaptivePortalInterstitialOnCertError:CaptivePortalBrowserTest.SSLCertErrorLogin:CertVerifierBrowserTest.MockCertVerifierSmokeTest:ChromeMainTest.SecondLaunchFromIncognitoWithNormalUrl:ChromeRenderProcessHostTest.DevToolsOnSelfInOwnProcess:ChromeRenderProcessHostTest.DevToolsOnSelfInOwnProcessPPT:ChromeRenderViewTest.BackToTranslatablePage:ChromeResourceDispatcherHostDelegateBrowserTest.PolicyHeaderForRedirect:ChromeSitePerProcessTest.OriginReplicationAllowsAccessToStorage:ChromeSitePerProcessTest.PluginWithRemoteTopFrame:ClearBrowserDataBrowserTest.CommitButtonDisabledWhenNoDataTypesSelected:ClearBrowserDataBrowserTest.CommitButtonDisabledWhileDeletionInProgress:CommonNameMismatchBrowserTest.CheckWWWSubdomainMismatchInverse:CommonNameMismatchBrowserTest.InterstitialNavigateAwayWhileLoading:CommonNameMismatchBrowserTest.InterstitialReloadNavigationWhileLoading:CommonNameMismatchBrowserTest.InterstitialStopNavigationWhileLoading:CommonNameMismatchBrowserTest.ShouldShowWWWSubdomainMismatchInterstitial:ContentSettingBubbleModelMixedScriptTest.Iframe:ContentSettingsExceptionsAreaBrowserTest.OpenIncognitoWindow:ContentSettingsTest.RedirectCrossOrigin:ContentSettingsTest.RedirectLoopCookies:ContinueWhereILeftOffTest.Post:ContinueWhereILeftOffTest.PostBrowserClose:ContinueWhereILeftOffTest.PostCloseAllBrowsers:CrashRecoveryBrowserTest.DoubleReloadWithError:CrashRecoveryBrowserTest.LoadInNewTab:DevToolsBeforeUnloadTest.TestDockedDevToolsClose:DevToolsBeforeUnloadTest.TestDockedDevToolsInspectedBrowserClose:DevToolsBeforeUnloadTest.TestDockedDevToolsInspectedTabClose:DevToolsBeforeUnloadTest.TestUndockedDevToolsApplicationClose:DevToolsBeforeUnloadTest.TestUndockedDevToolsClose:DevToolsBeforeUnloadTest.TestUndockedDevToolsInspectedBrowserClose:DevToolsBeforeUnloadTest.TestUndockedDevToolsInspectedTabClose:DevToolsBeforeUnloadTest.TestWorkerWindowClosing:DevToolsExperimentalExtensionTest.TestDevToolsExperimentalExtensionAPI:DevToolsExtensionTest.TestContentScriptIsPresent:DevToolsExtensionTest.TestDevToolsExtensionAPI:DevToolsExtensionTest.TestDevToolsExtensionMessaging:DevToolsPixelOutputTests.TestScreenshotRecording:DevToolsSanityTest.TestConsoleOnNavigateBack:DevToolsSanityTest.TestDeviceEmulation:DevToolsSanityTest.TestDevToolsExternalNavigation:DevToolsSanityTest.TestNetworkRawHeadersText:DevToolsSanityTest.TestNetworkSize:DevToolsSanityTest.TestNetworkSyncSize:DevToolsSanityTest.TestNetworkTiming:DevToolsSanityTest.TestNoScriptDuplicatesOnPanelSwitch:DevToolsSanityTest.TestPageWithNoJavaScript:DevToolsSanityTest.TestPauseWhenLoadingDevTools:DevToolsSanityTest.TestPauseWhenScriptIsRunning:DevToolsSanityTest.TestScriptsTabIsPopulatedOnInspectedPageRefresh:DevToolsSanityTest.TestSettings:DevToolsSanityTest.TestShowScriptsTab:DevToolsSanityTest.TestToolboxLoadedUndocked:DevToolsSanityTest.TestToolboxNotLoadedDocked:DevToolsTagTest.DevToolsTaskIsProvided:DevToolsTagTest.TagsManagerRecordsATag:DomDistillerTabUtilsBrowserTest.TestDistillIntoWebContents:DomDistillerTabUtilsBrowserTest.TestSwapWebContents:DomDistillerViewerSourceBrowserTest.EarlyTemplateLoad:DomDistillerViewerSourceBrowserTest.EmptyURLShouldNotCrash:DomDistillerViewerSourceBrowserTest.InvalidURLShouldNotCrash:DomDistillerViewerSourceBrowserTest.MultiPageArticle:DomDistillerViewerSourceBrowserTest.NoWebUIBindingsArticleExists:DomDistillerViewerSourceBrowserTest.NoWebUIBindingsArticleNotFound:DomDistillerViewerSourceBrowserTest.NoWebUIBindingsDisplayCSS:DomDistillerViewerSourceBrowserTest.NoWebUIBindingsViewUrl:DomDistillerViewerSourceBrowserTest.PrefChange:DomDistillerViewerSourceBrowserTest.TestBadUrlErrorPage:DownloadExtensionTest.DownloadExtensionTest_FileIcon_Active:DownloadExtensionTest.DownloadExtensionTest_OnDeterminingFilename_InterruptedResume:DownloadExtensionTest.DownloadExtensionTest_Open:DownloadExtensionTest.DownloadExtensionTest_PauseResumeCancelErase:DownloadExtensionTest.DownloadExtensionTest_SearchEmptyQuery:DownloadExtensionTest.DownloadExtensionTest_SearchId:DownloadExtensionTest.DownloadExtensionTest_SearchIdAndFilename:DownloadExtensionTest.DownloadExtensionTest_SearchLimit:DownloadExtensionTest.DownloadExtensionTest_SearchPauseResumeCancelGetFileIconIncognito:DownloadExtensionTest.DownloadExtensionTest_SearchState:DownloadTest.AutoOpen:DownloadTest.BrowserCloseAfterDownload:DownloadTest.ChromeURLAfterDownload:DownloadTest.CloseNewTab1:DownloadTest.CloseNewTab2:DownloadTest.CloseNewTab3:DownloadTest.ContentDisposition:DownloadTest.CrxDenyInstall:DownloadTest.CrxInstallAcceptPermissions:DownloadTest.CrxInstallDenysPermissions:DownloadTest.CrxInvalid:DownloadTest.CrxLargeTheme:DownloadTest.DontCloseNewTab2:DownloadTest.DontCloseNewTab3:DownloadTest.DownloadErrorReadonlyFolder:DownloadTest.DownloadErrorsFile:DownloadTest.DownloadErrorsServer:DownloadTest.DownloadHistoryCheck:DownloadTest.DownloadHistoryDangerCheck:DownloadTest.DownloadMimeType:DownloadTest.DownloadMimeTypeSelect:DownloadTest.DownloadTest_CrazyFilenames:DownloadTest.DownloadTest_GZipWithNoContent:DownloadTest.DownloadTest_IncognitoRegular:DownloadTest.DownloadTest_PauseResumeCancel:DownloadTest.DownloadTest_PercentComplete:DownloadTest.DownloadTest_Remove:DownloadTest.DownloadTest_Renaming:DownloadTest.IncognitoDownload:DownloadTest.KnownSize:DownloadTest.LoadURLExternallyReferrerPolicy:DownloadTest.Resumption_Automatic:DownloadTest.Resumption_MultipleAttempts:DownloadTest.Resumption_NoPrompt:DownloadTest.Resumption_WithPrompt:DownloadTest.Resumption_WithPromptAlways:DownloadTest.SavePageNonHTMLViaPost:DownloadTest.TestMultipleDownloadsBubble:DownloadTest.UnknownSize:DownloadTestWithShelf.AutoOpen:DownloadTestWithShelf.CloseShelfOnDownloadsTab:DownloadTestWithShelf.CrxDenyInstall:DownloadTestWithShelf.DownloadAndWait:DownloadTestWithShelf.IncognitoDownload:DownloadTestWithShelf.NewWindow:DownloadTestWithShelf.PerWindowShelf:DownloadTestWithShelf.PRE_DownloadTest_History:ErrorPageAutoReloadTest.AutoReload:ErrorPageAutoReloadTest.ManualReloadNotSuppressed:ErrorPageTest.DNSError_DoClickLink:ErrorPageTest.DNSError_DoReload:ErrorPageTest.DNSError_DoSearch:ErrorPageTest.StaleCacheStatus:ExtensionApiNewTabTest.Tabs:ExtensionApiTest.CookiesEventsSpanning:ExtensionApiTest.Events:ExtensionApiTest.Incognito:ExtensionApiTest.JavaScriptURLPermissions:ExtensionApiTest.JavasScriptEncodedURL:ExtensionApiTest.TabsOnUpdated:ExtensionBrowserTest.WindowOpenExtension:ExtensionOverrideTest.OverrideNewTabIncognito:ExtensionPreferenceApiTest.OnChangeSplit:ExtensionResourceRequestPolicyTest.LinkToWebAccessibleResources:ExtensionResourceRequestPolicyTest.WebAccessibleResources:ExtensionTabsTest.DefaultToIncognitoWhenItIsForcedAndNoArgs:ExtensionTabsTest.ExecuteScriptOnDevTools:ExtensionTabsTest.FilteredEvents:ExtensionTabsTest.GetAllWindows:ExtensionTabsTest.GetAllWindowsAllTypes:ExtensionTabsTest.GetWindow:ExtensionTabsTest.NoTabsEventOnDevTools:ExtensionTabsTest.QueryAllTabsWithDevTools:ExtensionTabsTest.UpdateDevToolsWindow:ExtensionURLRewriteBrowserTest.NewTabPageURL:ExtensionWebRequestApiTest.WebRequestBlocking:ExtensionWebRequestApiTest.WebRequestComplex:ExtensionWebRequestApiTest.WebRequestDeclarative1:ExtensionWebRequestApiTest.WebRequestDeclarative2:ExtensionWebRequestApiTest.WebRequestNewTab:ExtensionWebRequestApiTest.WebRequestSimple:ExtensionWindowLastFocusedTest.NoDevtoolsAndAppWindows:ExtensionWindowLastFocusedTest.NoTabIdForDevToolsAndAppWindows:FindInPageControllerTest.SearchWithinSpecialURL:FirstRunMasterPrefsImportNothing.ImportNothingAndShowNewTabPage:HistoryBrowserTest.DownloadNoHistory:HostedAppTest.ShouldUseWebAppFrame:InlineLoginUISafeIframeBrowserTest.ConfirmationRequiredForNonsecureSignin:IsolatedAppTest.CookieIsolation:LoadTimingBrowserTest.Basic:LoadTimingBrowserTest.EverythingAtOnce:LoadTimingBrowserTest.Integration:LoadTimingBrowserTest.Preconnect:LoadTimingBrowserTest.PreconnectProxySsl:LoadTimingBrowserTest.ReuseSocket:LoadTimingBrowserTest.Ssl:LoginPromptBrowserTest.AllowCrossdomainPromptForSubframes:LoginPromptBrowserTest.CancelRedundantAuths:LoginPromptBrowserTest.NoLoginPromptForFavicon:LoginPromptBrowserTest.ShouldReplaceExistingInterstitialWhenNavigated:LoginPromptBrowserTest.ShowCorrectUrlForCrossOriginMainFrameRedirects:LoginPromptBrowserTest.ShowCorrectUrlForCrossOriginMainFrameRequests:LoginPromptBrowserTest.SupplyRedundantAuths:LoginPromptBrowserTest.SupplyRedundantAuthsMultiProfile:LoginPromptBrowserTest.TestBasicAuth:LoginPromptBrowserTest.TestCancelAuth:LoginPromptBrowserTest.TestDigestAuth:LoginPromptBrowserTest.TestTwoAuths:MaterialPDFExtensionTest.Basic:MaterialPDFExtensionTest.BasicPlugin:MaterialPDFExtensionTest.Bookmark:MaterialPDFExtensionTest.Elements:MaterialPDFExtensionTest.Navigator:MaterialPDFExtensionTest.PageChange:MaterialPDFExtensionTest.ParamsParser:MaterialPDFExtensionTest.Title:MaterialPDFExtensionTest.ToolbarManager:MaterialPDFExtensionTest.Viewport:MaterialPDFExtensionTest.WhitespaceTitle:MaterialPDFExtensionTest.ZoomManager:MediaGalleriesPlatformAppBrowserTest.MediaGalleriesRead:MediaGalleriesPlatformAppBrowserTest.Scan:MediaGalleriesPlatformAppBrowserTest.ToURL:MediaRouterUIBrowserTest.OpenDialogWithMediaRouterAction:MimeHandlerViewTest.Abort:MimeHandlerViewTest.Basic:MimeHandlerViewTest.DataUrl:MimeHandlerViewTest.Iframe:MimeHandlerViewTest.NonAsciiHeaders:NetInternalsTest.netInternalsPrerenderViewFail:NewTabUIBrowserTest.ShowIncognito:OmniboxApiTest.OnInputEntered:OptionsUIBrowserTest.LoadOptionsByURL:OptionsWebUIExtendedTest.OverlayBackToChild:OptionsWebUIExtendedTest.OverlayBackToUnrelated:OptionsWebUIExtendedTest.OverlayTabNavigation:PasswordManagerBrowserTestBase.CrossSiteIframeNotFillTest:PasswordManagerBrowserTestBase.NoLastLoadGoodLastLoad:PasswordManagerBrowserTestBase.NoPromptIfLinkClicked:PasswordManagerBrowserTestBase.PromptAfterSubmitWithSubFrameNavigation:PasswordManagerBrowserTestBase.SameOriginIframeAutoFillTest:PDFExtensionTest.Basic:PDFExtensionTest.BasicPlugin:PDFExtensionTest.Bookmark:PDFExtensionTest.DisablePlugin:PDFExtensionTest.EnsureSameOriginRepliesAllowed:PDFExtensionTest.Navigator:PDFExtensionTest.PageChange:PDFExtensionTest.ParamsParser:PDFExtensionTest.Title:PDFExtensionTest.Viewport:PDFExtensionTest.WhitespaceTitle:PDFExtensionTest.ZoomManager:PDFTestFiles/PDFExtensionTest.Load/0:PDFTestFiles/PDFExtensionTest.Load/1:PDFTestFiles/PDFExtensionTest.Load/5:PDFTestFiles/PDFExtensionTest.Load/8:PlatformAppBrowserTest.ActiveAppsAreRecorded:PlatformAppBrowserTest.AppWindowRestoreState:PlatformAppUrlRedirectorBrowserTest.BlankClickInAppIntercepted:PlatformAppUrlRedirectorBrowserTest.BlankClickInTabIntercepted:PlatformAppUrlRedirectorBrowserTest.ClickInTabIntercepted:PlatformAppUrlRedirectorBrowserTest.EntryInOmnibarIntercepted:PlatformAppUrlRedirectorBrowserTest.PrerenderedClickInTabIntercepted:PlatformAppUrlRedirectorBrowserTest.WebviewNavigationNotIntercepted:PlatformAppUrlRedirectorBrowserTest.WindowOpenInAppIntercepted:PlatformAppUrlRedirectorBrowserTest.WindowOpenInTabIntercepted:PolicyTest.DownloadDirectory:PolicyTest.ExtensionInstallSources:PolicyTest.FullscreenAllowedApp:PolicyTest.HomepageLocation:PolicyTest.SafeBrowsingExtendedReportingOptInAllowed:PolicyTest.SSLErrorOverridingAllowed:PolicyTest.SSLErrorOverridingDisallowed:PolicyUITest.ExtensionLoadAndSendPolicy:PrefsFunctionalTest.TestDownloadDirPref:PrerenderBrowserTest.PrerenderCancelMainFrameRedirectUnsupportedScheme:PrerenderBrowserTest.PrerenderClientRedirectFromFragment:PrerenderBrowserTest.PrerenderClientRedirectNavigateToFirst:PrerenderBrowserTest.PrerenderClientRedirectNavigateToSecond:PrerenderBrowserTest.PrerenderClientRedirectNavigateToSecondViaClick:PrerenderBrowserTest.PrerenderClientRedirectToFragment:PrerenderBrowserTest.PrerenderCrossProcessServerRedirect:PrerenderBrowserTest.PrerenderCrossProcessServerRedirectNoHang:PrerenderBrowserTest.PrerenderCrx:PrerenderBrowserTest.PrerenderDownloadClientRedirect:PrerenderBrowserTest.PrerenderDownloadIframe:PrerenderBrowserTest.PrerenderDownloadLocation:PrerenderBrowserTest.PrerenderHttpAuthentication:PrerenderBrowserTest.PrerenderLocationReplaceGWSHistograms:PrerenderBrowserTest.PrerenderLocationReplaceNavigateToFirst:PrerenderBrowserTest.PrerenderLocationReplaceNavigateToSecond:PrerenderBrowserTest.PrerenderPageWithRedirectedFragment:PrerenderBrowserTest.PrerenderSSLClientCertIframe:PrerenderBrowserTest.PrerenderSSLClientCertTopLevel:PrerenderBrowserTest.PrerenderSSLErrorTopLevel:PrerenderBrowserTestWithExtensions.StreamsTest:ProfileManagerBrowserTest.EphemeralProfile:ProxyBrowserTest.BasicAuthWSConnect:PushMessagingBackgroundModeDisabledBrowserTest.BackgroundModeDisabledWithCommandLine:PushMessagingBackgroundModeEnabledBrowserTest.BackgroundModeEnabledWithCommandLine:PushMessagingBrowserTest.AutomaticUnsubscriptionFollowsContentSettingRules:PushMessagingBrowserTest.BackgroundModeDisabledByDefault:PushMessagingBrowserTest.DenyNotificationsPermissionUnsubscribes:PushMessagingBrowserTest.DenyPushPermissionUnsubscribes:PushMessagingBrowserTest.EncryptionKeyUniqueness:PushMessagingBrowserTest.GlobalResetNotificationsPermissionUnsubscribes:PushMessagingBrowserTest.GlobalResetPushPermissionUnsubscribes:PushMessagingBrowserTest.GrantAlreadyGrantedPermissionDoesNotUnsubscribe:PushMessagingBrowserTest.LocalResetNotificationsPermissionUnsubscribes:PushMessagingBrowserTest.LocalResetPushPermissionUnsubscribes:PushMessagingBrowserTest.PermissionStateSaysDenied:PushMessagingBrowserTest.PermissionStateSaysGranted:PushMessagingBrowserTest.PermissionStateSaysPrompt:PushMessagingBrowserTest.PushEventEnforcesUserVisibleNotification:PushMessagingBrowserTest.PushEventEnforcesUserVisibleNotificationAfterQueue:PushMessagingBrowserTest.PushEventNoServiceWorker:PushMessagingBrowserTest.PushEventNotificationWithoutEventWaitUntil:PushMessagingBrowserTest.PushEventSuccess:PushMessagingBrowserTest.ResetPushPermissionAfterClearingSiteData:PushMessagingBrowserTest.SubscribeFailureNoManifest:PushMessagingBrowserTest.SubscribeFailureNotificationsBlocked:PushMessagingBrowserTest.SubscribePersisted:PushMessagingBrowserTest.SubscribeSuccessNotificationsGranted:PushMessagingBrowserTest.SubscribeSuccessNotificationsPrompt:PushMessagingBrowserTest.UnsubscribeSuccess:PushMessagingBrowserTestEmptySubscriptionOptions.RegisterFailureEmptyPushSubscriptionOptions:PushMessagingIncognitoBrowserTest.IncognitoGetSubscriptionDoesNotHang:RedirectTest.ClientEmptyReferer:RedirectTest.ClientServerServer:RedirectTest.Server:ReferrerPolicyTest.HttpLeftClickRedirectDefaultFlag:ReferrerPolicyTest.HttpLeftClickRedirectToHTTPOriginWhenCrossOrigin:ReferrerPolicyTest.HttpsMiddleClickOrigin:ReferrerPolicyTest.HttpsMiddleClickRedirect:ReferrerPolicyTest.MiddleClickOrigin:ReferrerPolicyTest.MiddleClickRedirect:RepostFormWarningTest.TestDoubleReload:RepostFormWarningTest.TestLoginAfterRepost:RestartTest.Post:SearchProviderTest.TestIsSearchProviderInstalled:SecurityStateModelLoadingTest.NavigationStateChanges:SecurityStateModelTest.AddedTab:SecurityStateModelTest.BrokenHTTPS:SecurityStateModelTest.HttpsPage:SecurityStateModelTest.MixedContent:SecurityStateModelTest.MixedContentWithBrokenSHA1:SecurityStateModelTest.SHA1Broken:ServiceWorkerTest.BackgroundPageIsWokenIfAsleep:ServiceWorkerTest.BackgroundPagePostsMessageToServiceWorker:ServiceWorkerTest.FetchArbitraryPaths:ServiceWorkerTest.GetBackgroundClientFailsWithNoBackgroundPage:ServiceWorkerTest.LoadingBackgroundPageBypassesServiceWorker:ServiceWorkerTest.RegisterSucceedsOnTrunk:ServiceWorkerTest.ServiceWorkerPostsMessageToBackgroundClient:ServiceWorkerTest.ServiceWorkerSuspensionOnExtensionUnload:SSLUITest.BadCertFollowedByGoodCert:SSLUITest.InterstitialNotAffectedByHideShow:SSLUITest.SSLStatusMatchesonClockInterstitialAndAfterProceed:SSLUITest.SSLStatusMatchesOnInterstitialAndAfterProceed:SSLUITest.TestBadFrameNavigation:SSLUITest.TestBadHTTPSDownload:SSLUITest.TestBrokenHTTPSMetricsReporting_DontProceed:SSLUITest.TestBrokenHTTPSMetricsReporting_Proceed:SSLUITest.TestBrokenHTTPSWithInsecureContent:SSLUITest.TestGoodFrameNavigation:SSLUITest.TestHTTPSErrorCausedByClock:SSLUITest.TestHTTPSErrorWithNoNavEntry:SSLUITest.TestHTTPSExpiredCertAndGoBackViaButton:SSLUITest.TestHTTPSExpiredCertAndGoBackViaMenu:SSLUITest.TestHTTPSExpiredCertAndGoForward:SSLUITest.TestInterstitialJavaScriptGoesBack:SSLUITest.TestRedirectBadToGoodHTTPS:SSLUITest.TestRefNavigation:SSLUITest.TestUnsafeContentsInWorkerWithUserException:SSLUITest.TestUnsafeContentsWithUserException:SSLUITest.TestWSSInvalidCertAndGoForward:SSLUITestIgnoreLocalhostCertErrors.TestNoInterstitialOnLocalhost:SSLUITestWithClientCert.TestWSSClientCert:SSLUITestWithExtendedReporting.TestBrokenHTTPSGoBackReporting:SSLUITestWithExtendedReporting.TestBrokenHTTPSGoBackShowYesCheckNoParamYesReportNo:SSLUITestWithExtendedReporting.TestBrokenHTTPSInIncognitoReportNo:SSLUITestWithExtendedReporting.TestBrokenHTTPSNoReportingWhenDisallowed:SSLUITestWithExtendedReporting.TestBrokenHTTPSProceedReporting:SSLUITestWithExtendedReporting.TestBrokenHTTPSProceedReportingWithNoOptIn:StreamsPrivateApiTest.Abort:StreamsPrivateApiTest.FileURL:StreamsPrivateApiTest.Headers:StreamsPrivateApiTest.Navigate:StreamsPrivateApiTest.NavigateCrossSite:StreamsPrivateApiTest.NavigateToAnAttachment:SupervisedUserBlockModeTest.HistoryVisitRecorded:SupervisedUserBlockModeTest.OpenBlockedURLInNewTab:SupervisedUserBlockModeTest.SendAccessRequestOnBlockedURL:SupervisedUserBlockModeTest.Unblock:SupervisedUserResourceThrottleTest.NoNavigationObserverBlock:SyncFileSystemTest.AuthorizationTest:TaskManagerBrowserTest.DevToolsNewDockedWindow:TaskManagerBrowserTest.DevToolsNewUndockedWindow:TaskManagerBrowserTest.DevToolsOldDockedWindow:TaskManagerBrowserTest.DevToolsOldUnockedWindow:UnloadTest.CrossSiteInfiniteBeforeUnloadAsync:WebNavigationApiTest.CrossProcess:WebNavigationApiTest.CrossProcessAbort:WebNavigationApiTest.CrossProcessFragment:WebNavigationApiTest.CrossProcessHistory:WebNavigationApiTest.Failures:WebNavigationApiTest.IFrame:WebNavigationApiTest.OpenTab:WebNavigationApiTest.RequestOpenTab:WebNavigationApiTest.ServerRedirect:WebNavigationApiTest.ServerRedirectSingleProcess:WebSocketBrowserTest.ReuseMainPageBasicAuthCredentialsForWebSocket:WebstoreInlineInstallerTest.ShouldBlockInlineInstallFromPopupWindow:WebUIWebViewBrowserTest.DisplayNone:WebViewPluginTest.TestLoadPluginInternalResource:WebViewTest.InterstitialTeardown:WebViewTest.InterstitialTeardownOnBrowserShutdown:WebViewTest.NestedGuestContainerBounds:WebViewTest.Shim_TestDeclarativeWebRequestAPI:WebViewTest.Shim_TestDeclarativeWebRequestAPISendMessage:WebViewTest.Shim_TestInlineScriptFromAccessibleResources:WebViewTest.Shim_TestLoadAbortChromeExtensionURLWrongPartition:WebViewTest.Shim_TestLoadStartLoadRedirect:WebViewTest.Shim_TestNavigationToExternalProtocol:WebViewTest.Shim_TestNestedSubframes:WebViewTest.Shim_TestWebRequestAPIErrorOccurred:WebViewTest.Shim_TestWebRequestAPIGoogleProperty:WebViewTest.Shim_TestWebRequestAPIWithHeaders:WorkerDevToolsSanityTest.InspectSharedWorker"
+          "--gtest_filter=-ActivityLogApiTest.TriggerEvent:AdbClientSocketTest.TestFlushWithData:AdbClientSocketTest.TestFlushWithoutSize:AdbClientSocketTest.TestFlushWithSize:AllUrlsApiTest.WhitelistedExtension:AppBannerDataFetcherBrowserTest.CancelBannerDirect:AppBannerDataFetcherBrowserTest.CancelBannerIndirect:AppBannerDataFetcherBrowserTest.NoManifest:AppBannerDataFetcherBrowserTest.PromptBanner:AppBannerDataFetcherBrowserTest.PromptBannerInHandler:AppBannerDataFetcherBrowserTest.WebAppBannerCreatedDirect:AppBannerDataFetcherBrowserTest.WebAppBannerCreatedDirectLargerTotal:AppBannerDataFetcherBrowserTest.WebAppBannerCreatedDirectMultiple:AppBannerDataFetcherBrowserTest.WebAppBannerCreatedDirectMultipleLargerTotal:AppBannerDataFetcherBrowserTest.WebAppBannerCreatedDirectMultipleSmallerTotal:AppBannerDataFetcherBrowserTest.WebAppBannerCreatedDirectSingle:AppBannerDataFetcherBrowserTest.WebAppBannerCreatedDirectSmallerTotal:AppBannerDataFetcherBrowserTest.WebAppBannerCreatedIndirect:AppBannerDataFetcherBrowserTest.WebAppBannerCreatedIndirectLargerTotal:AppBannerDataFetcherBrowserTest.WebAppBannerCreatedIndirectMultiple:AppBannerDataFetcherBrowserTest.WebAppBannerCreatedIndirectMultipleLargerTotal:AppBannerDataFetcherBrowserTest.WebAppBannerCreatedIndirectSingle:AppBannerDataFetcherBrowserTest.WebAppBannerCreatedIndirectSmallerTotal:AppBannerDataFetcherBrowserTest.WebAppBannerCreatedVarious:AppBannerDataFetcherBrowserTest.WebAppBannerInIFrame:AppBannerDataFetcherBrowserTest.WebAppBannerNoTypeInManifest:AppBannerDataFetcherBrowserTest.WebAppBannerNoTypeInManifestCapsExtension:AppListServiceImplBrowserTest.DeletingProfileUpdatesViewDelegate:AppWindowAPITest.TestCreate:AutofillTest.AggregatesMinValidProfile:AutofillTest.AggregatesMinValidProfileDifferentJS:AutofillTest.AppendCountryCodeForAggregatedPhones:AutofillTest.CCInfoNotStoredWhenAutocompleteOff:AutofillTest.InvalidCreditCardNumberIsNotAggregated:AutofillTest.ProfileSavedWithValidCountryPhone:AutofillTest.ProfilesNotAggregatedWithInvalidEmail:AutofillTest.ProfilesNotAggregatedWithNoAddress:AutofillTest.ProfilesNotAggregatedWithSubmitHandler:AutofillTest.ProfileWithEmailInOtherFieldNotSaved:AutofillTest.UsePlusSignForInternationalNumber:AutofillTest.WhitespacesAndSeparatorCharsStrippedForValidCCNums:BrowserCloseManagerWithDownloadsBrowserTest/BrowserCloseManagerWithDownloadsBrowserTest.TestWithDangerousUrlDownload/0:BrowserCloseManagerWithDownloadsBrowserTest/BrowserCloseManagerWithDownloadsBrowserTest.TestWithDangerousUrlDownload/1:BrowserCloseManagerWithDownloadsBrowserTest/BrowserCloseManagerWithDownloadsBrowserTest.TestWithDownloads/0:BrowserCloseManagerWithDownloadsBrowserTest/BrowserCloseManagerWithDownloadsBrowserTest.TestWithDownloads/1:BrowserCloseManagerWithDownloadsBrowserTest/BrowserCloseManagerWithDownloadsBrowserTest.TestWithDownloadsFromDifferentProfiles/0:BrowserCloseManagerWithDownloadsBrowserTest/BrowserCloseManagerWithDownloadsBrowserTest.TestWithDownloadsFromDifferentProfiles/1:BrowserCloseManagerWithDownloadsBrowserTest/BrowserCloseManagerWithDownloadsBrowserTest.TestWithOffTheRecordDownloads/0:BrowserCloseManagerWithDownloadsBrowserTest/BrowserCloseManagerWithDownloadsBrowserTest.TestWithOffTheRecordDownloads/1:BrowserNavigatorTest.NavigateFromNTPToOptionsInSameTab:BrowserTest.BeforeUnloadVsBeforeReload:BrowserTest.ClearPendingOnFailUnlessNTP:BrowserTest.InterstitialCancelsGuestViewDialogs:BrowserTest.NoStopDuringTransferUntilCommit:BrowserTest.SecurityStyleChangedObserver:BrowserTest.SecurityStyleChangedObserverGoBack:BrowserTest.ShouldShowLocationBar:BrowserViewTest.DevToolsUpdatesBrowserWindow:BrowsingDataRemoverBrowserTest.Download:CaptivePortalBrowserTest.InterstitialTimerCertErrorAfterSlowLoad:CaptivePortalBrowserTest.InterstitialTimerNavigateAwayWhileLoading:CaptivePortalBrowserTest.InterstitialTimerNavigateWhileLoading_EndWithCaptivePortalInterstitial:CaptivePortalBrowserTest.InterstitialTimerNavigateWhileLoading_EndWithSSLInterstitial:CaptivePortalBrowserTest.InterstitialTimerReloadWhileLoading:CaptivePortalBrowserTest.InterstitialTimerStopNavigationWhileLoading:CaptivePortalBrowserTest.ShowCaptivePortalInterstitialOnCertError:CaptivePortalBrowserTest.SSLCertErrorLogin:CertVerifierBrowserTest.MockCertVerifierSmokeTest:ChromeMainTest.SecondLaunchFromIncognitoWithNormalUrl:ChromeRenderProcessHostTest.DevToolsOnSelfInOwnProcess:ChromeRenderProcessHostTest.DevToolsOnSelfInOwnProcessPPT:ChromeRenderViewTest.BackToTranslatablePage:ChromeResourceDispatcherHostDelegateBrowserTest.PolicyHeaderForRedirect:ChromeSitePerProcessTest.OriginReplicationAllowsAccessToStorage:ChromeSitePerProcessTest.PluginWithRemoteTopFrame:ClearBrowserDataBrowserTest.CommitButtonDisabledWhenNoDataTypesSelected:ClearBrowserDataBrowserTest.CommitButtonDisabledWhileDeletionInProgress:CommonNameMismatchBrowserTest.CheckWWWSubdomainMismatchInverse:CommonNameMismatchBrowserTest.InterstitialNavigateAwayWhileLoading:CommonNameMismatchBrowserTest.InterstitialReloadNavigationWhileLoading:CommonNameMismatchBrowserTest.InterstitialStopNavigationWhileLoading:CommonNameMismatchBrowserTest.ShouldShowWWWSubdomainMismatchInterstitial:ContentSettingBubbleModelMixedScriptTest.Iframe:ContentSettingsExceptionsAreaBrowserTest.OpenIncognitoWindow:ContentSettingsTest.RedirectCrossOrigin:ContentSettingsTest.RedirectLoopCookies:ContinueWhereILeftOffTest.Post:ContinueWhereILeftOffTest.PostBrowserClose:ContinueWhereILeftOffTest.PostCloseAllBrowsers:CrashRecoveryBrowserTest.DoubleReloadWithError:CrashRecoveryBrowserTest.LoadInNewTab:DeveloperPrivateApiTest.InspectAppWindowView:DevToolsBeforeUnloadTest.TestDockedDevToolsClose:DevToolsBeforeUnloadTest.TestDockedDevToolsInspectedBrowserClose:DevToolsBeforeUnloadTest.TestDockedDevToolsInspectedTabClose:DevToolsBeforeUnloadTest.TestUndockedDevToolsApplicationClose:DevToolsBeforeUnloadTest.TestUndockedDevToolsClose:DevToolsBeforeUnloadTest.TestUndockedDevToolsInspectedBrowserClose:DevToolsBeforeUnloadTest.TestUndockedDevToolsInspectedTabClose:DevToolsBeforeUnloadTest.TestWorkerWindowClosing:DevToolsExperimentalExtensionTest.TestDevToolsExperimentalExtensionAPI:DevToolsExtensionTest.TestContentScriptIsPresent:DevToolsExtensionTest.TestDevToolsExtensionAPI:DevToolsExtensionTest.TestDevToolsExtensionMessaging:DevToolsPixelOutputTests.TestScreenshotRecording:DevToolsReattachAfterCrashTest.TestReattachAfterCrashOnNetwork:DevToolsReattachAfterCrashTest.TestReattachAfterCrashOnTimeline:DevToolsSanityTest.TestConsoleOnNavigateBack:DevToolsSanityTest.TestDeviceEmulation:DevToolsSanityTest.TestDevToolsExternalNavigation:DevToolsSanityTest.TestNetworkRawHeadersText:DevToolsSanityTest.TestNetworkSize:DevToolsSanityTest.TestNetworkSyncSize:DevToolsSanityTest.TestNetworkTiming:DevToolsSanityTest.TestNoScriptDuplicatesOnPanelSwitch:DevToolsSanityTest.TestPageWithNoJavaScript:DevToolsSanityTest.TestPauseWhenLoadingDevTools:DevToolsSanityTest.TestPauseWhenScriptIsRunning:DevToolsSanityTest.TestScriptsTabIsPopulatedOnInspectedPageRefresh:DevToolsSanityTest.TestSettings:DevToolsSanityTest.TestShowScriptsTab:DevToolsSanityTest.TestToolboxLoadedUndocked:DevToolsSanityTest.TestToolboxNotLoadedDocked:DevToolsTagTest.DevToolsTaskIsProvided:DevToolsTagTest.TagsManagerRecordsATag:DomDistillerTabUtilsBrowserTest.TestDistillIntoWebContents:DomDistillerTabUtilsBrowserTest.TestSwapWebContents:DomDistillerViewerSourceBrowserTest.DistillerJavaScriptExposed:DomDistillerViewerSourceBrowserTest.DistillerJavaScriptNotInMainWorld:DomDistillerViewerSourceBrowserTest.EarlyTemplateLoad:DomDistillerViewerSourceBrowserTest.EmptyURLShouldNotCrash:DomDistillerViewerSourceBrowserTest.InvalidURLShouldNotCrash:DomDistillerViewerSourceBrowserTest.MultiPageArticle:DomDistillerViewerSourceBrowserTest.NoWebUIBindingsArticleExists:DomDistillerViewerSourceBrowserTest.NoWebUIBindingsArticleNotFound:DomDistillerViewerSourceBrowserTest.NoWebUIBindingsDisplayCSS:DomDistillerViewerSourceBrowserTest.NoWebUIBindingsViewUrl:DomDistillerViewerSourceBrowserTest.PrefChange:DomDistillerViewerSourceBrowserTest.PrefChangeError:DomDistillerViewerSourceBrowserTest.PrefPersist:DomDistillerViewerSourceBrowserTest.TestBadUrlErrorPage:DownloadExtensionTest.DownloadExtensionTest_FileIcon_Active:DownloadExtensionTest.DownloadExtensionTest_OnDeterminingFilename_InterruptedResume:DownloadExtensionTest.DownloadExtensionTest_Open:DownloadExtensionTest.DownloadExtensionTest_PauseResumeCancelErase:DownloadExtensionTest.DownloadExtensionTest_SearchEmptyQuery:DownloadExtensionTest.DownloadExtensionTest_SearchId:DownloadExtensionTest.DownloadExtensionTest_SearchIdAndFilename:DownloadExtensionTest.DownloadExtensionTest_SearchLimit:DownloadExtensionTest.DownloadExtensionTest_SearchPauseResumeCancelGetFileIconIncognito:DownloadExtensionTest.DownloadExtensionTest_SearchState:DownloadTest.AutoOpen:DownloadTest.BrowserCloseAfterDownload:DownloadTest.ChromeURLAfterDownload:DownloadTest.CloseNewTab1:DownloadTest.CloseNewTab2:DownloadTest.CloseNewTab3:DownloadTest.ContentDisposition:DownloadTest.CrxDenyInstall:DownloadTest.CrxInstallAcceptPermissions:DownloadTest.CrxInstallDenysPermissions:DownloadTest.CrxInvalid:DownloadTest.CrxLargeTheme:DownloadTest.DontCloseNewTab2:DownloadTest.DontCloseNewTab3:DownloadTest.DownloadErrorReadonlyFolder:DownloadTest.DownloadErrorsFile:DownloadTest.DownloadErrorsServer:DownloadTest.DownloadHistoryCheck:DownloadTest.DownloadHistoryDangerCheck:DownloadTest.DownloadMimeType:DownloadTest.DownloadMimeTypeSelect:DownloadTest.DownloadTest_CrazyFilenames:DownloadTest.DownloadTest_GZipWithNoContent:DownloadTest.DownloadTest_IncognitoRegular:DownloadTest.DownloadTest_PauseResumeCancel:DownloadTest.DownloadTest_PercentComplete:DownloadTest.DownloadTest_Remove:DownloadTest.DownloadTest_Renaming:DownloadTest.FeedbackService:DownloadTest.IncognitoDownload:DownloadTest.KnownSize:DownloadTest.LoadURLExternallyReferrerPolicy:DownloadTest.Resumption_Automatic:DownloadTest.Resumption_MultipleAttempts:DownloadTest.Resumption_NoPrompt:DownloadTest.Resumption_WithPrompt:DownloadTest.Resumption_WithPromptAlways:DownloadTest.SavePageNonHTMLViaPost:DownloadTest.TestMultipleDownloadsBubble:DownloadTest.UnknownSize:DownloadTestWithShelf.AutoOpen:DownloadTestWithShelf.CloseShelfOnDownloadsTab:DownloadTestWithShelf.CrxDenyInstall:DownloadTestWithShelf.DownloadAndWait:DownloadTestWithShelf.IncognitoDownload:DownloadTestWithShelf.NewWindow:DownloadTestWithShelf.PerWindowShelf:DownloadTestWithShelf.PRE_DownloadTest_History:ErrorPageAutoReloadTest.AutoReload:ErrorPageAutoReloadTest.ManualReloadNotSuppressed:ErrorPageTest.DNSError_DoClickLink:ErrorPageTest.DNSError_DoReload:ErrorPageTest.DNSError_DoSearch:ErrorPageTest.StaleCacheStatus:ExtensionApiNewTabTest.Tabs:ExtensionApiTest.CookiesEventsSpanning:ExtensionApiTest.Events:ExtensionApiTest.Incognito:ExtensionApiTest.JavaScriptURLPermissions:ExtensionApiTest.JavasScriptEncodedURL:ExtensionApiTest.TabsOnUpdated:ExtensionBrowserTest.WindowOpenExtension:ExtensionLoadingTest.KeepAliveWithDevToolsOpenOnReload:ExtensionOverrideTest.OverrideNewTabIncognito:ExtensionPreferenceApiTest.OnChangeSplit:ExtensionResourceRequestPolicyTest.LinkToWebAccessibleResources:ExtensionResourceRequestPolicyTest.WebAccessibleResources:ExtensionTabsTest.DefaultToIncognitoWhenItIsForcedAndNoArgs:ExtensionTabsTest.ExecuteScriptOnDevTools:ExtensionTabsTest.FilteredEvents:ExtensionTabsTest.GetAllWindows:ExtensionTabsTest.GetAllWindowsAllTypes:ExtensionTabsTest.GetWindow:ExtensionTabsTest.NoTabsEventOnDevTools:ExtensionTabsTest.QueryAllTabsWithDevTools:ExtensionTabsTest.UpdateDevToolsWindow:ExtensionURLRewriteBrowserTest.NewTabPageURL:ExtensionWebRequestApiTest.WebRequestBlocking:ExtensionWebRequestApiTest.WebRequestComplex:ExtensionWebRequestApiTest.WebRequestDeclarative1:ExtensionWebRequestApiTest.WebRequestDeclarative2:ExtensionWebRequestApiTest.WebRequestNewTab:ExtensionWebRequestApiTest.WebRequestSimple:ExtensionWindowLastFocusedTest.NoDevtoolsAndAppWindows:ExtensionWindowLastFocusedTest.NoTabIdForDevToolsAndAppWindows:FindInPageControllerTest.BigString:FindInPageControllerTest.SearchWithinSpecialURL:FindInPageControllerTest.SelectChangesOrdinal_Issue20883:FirstRunMasterPrefsImportNothing.ImportNothingAndShowNewTabPage:HistoryApiTest.Delete:HistoryApiTest.DeleteProhibited:HistoryApiTest.SearchAfterAdd:HistoryBrowserTest.DownloadNoHistory:HostedAppTest.ShouldUseWebAppFrame:InlineLoginUISafeIframeBrowserTest.ConfirmationRequiredForNonsecureSignin:InspectUITest.AndroidTargets:IsolatedAppTest.CookieIsolation:LoadTimingBrowserTest.Basic:LoadTimingBrowserTest.EverythingAtOnce:LoadTimingBrowserTest.Integration:LoadTimingBrowserTest.Preconnect:LoadTimingBrowserTest.PreconnectProxySsl:LoadTimingBrowserTest.ReuseSocket:LoadTimingBrowserTest.Ssl:LoginPromptBrowserTest.AllowCrossdomainPromptForSubframes:LoginPromptBrowserTest.CancelRedundantAuths:LoginPromptBrowserTest.NoLoginPromptForFavicon:LoginPromptBrowserTest.ShouldReplaceExistingInterstitialWhenNavigated:LoginPromptBrowserTest.ShowCorrectUrlForCrossOriginMainFrameRedirects:LoginPromptBrowserTest.ShowCorrectUrlForCrossOriginMainFrameRequests:LoginPromptBrowserTest.SupplyRedundantAuths:LoginPromptBrowserTest.SupplyRedundantAuthsMultiProfile:LoginPromptBrowserTest.TestBasicAuth:LoginPromptBrowserTest.TestCancelAuth:LoginPromptBrowserTest.TestDigestAuth:LoginPromptBrowserTest.TestTwoAuths:LogWebUIUrlTest.TestHistoryFrame:LogWebUIUrlTest.TestUberPage:MaterialPDFExtensionTest.Basic:MaterialPDFExtensionTest.BasicPlugin:MaterialPDFExtensionTest.Bookmark:MaterialPDFExtensionTest.Elements:MaterialPDFExtensionTest.Navigator:MaterialPDFExtensionTest.PageChange:MaterialPDFExtensionTest.ParamsParser:MaterialPDFExtensionTest.Title:MaterialPDFExtensionTest.ToolbarManager:MaterialPDFExtensionTest.Viewport:MaterialPDFExtensionTest.WhitespaceTitle:MaterialPDFExtensionTest.ZoomManager:MaybeSetMetadata/SafeBrowsingServiceMetadataTest.MalwareIFrame/0:MaybeSetMetadata/SafeBrowsingServiceMetadataTest.MalwareIFrame/1:MaybeSetMetadata/SafeBrowsingServiceMetadataTest.MalwareIFrame/2:MaybeSetMetadata/SafeBrowsingServiceMetadataTest.MalwareMainFrame/0:MaybeSetMetadata/SafeBrowsingServiceMetadataTest.MalwareMainFrame/1:MaybeSetMetadata/SafeBrowsingServiceMetadataTest.MalwareMainFrame/2:MediaGalleriesPlatformAppBrowserTest.MediaGalleriesRead:MediaGalleriesPlatformAppBrowserTest.Scan:MediaGalleriesPlatformAppBrowserTest.ToURL:MediaRouterUIBrowserTest.OpenDialogWithMediaRouterAction:MimeHandlerViewTest.Abort:MimeHandlerViewTest.Basic:MimeHandlerViewTest.DataUrl:MimeHandlerViewTest.Iframe:MimeHandlerViewTest.NonAsciiHeaders:NetInternalsTest.netInternalsPrerenderViewFail:NewTabUIBrowserTest.ShowIncognito:OmniboxApiTest.OnInputEntered:OptionsUIBrowserTest.LoadOptionsByURL:OptionsWebUIExtendedTest.OverlayBackToChild:OptionsWebUIExtendedTest.OverlayBackToUnrelated:OptionsWebUIExtendedTest.OverlayTabNavigation:PasswordManagerBrowserTestBase.BasicAuthSeparateRealms:PasswordManagerBrowserTestBase.CrossSiteIframeNotFillTest:PasswordManagerBrowserTestBase.NoLastLoadGoodLastLoad:PasswordManagerBrowserTestBase.NoPromptIfLinkClicked:PasswordManagerBrowserTestBase.PromptAfterSubmitWithSubFrameNavigation:PasswordManagerBrowserTestBase.SameOriginIframeAutoFillTest:PDFExtensionTest.Basic:PDFExtensionTest.BasicPlugin:PDFExtensionTest.Bookmark:PDFExtensionTest.DisablePlugin:PDFExtensionTest.EnsureSameOriginRepliesAllowed:PDFExtensionTest.LinkPermissions:PDFExtensionTest.Navigator:PDFExtensionTest.PageChange:PDFExtensionTest.ParamsParser:PDFExtensionTest.Title:PDFExtensionTest.Viewport:PDFExtensionTest.WhitespaceTitle:PDFExtensionTest.ZoomManager:PDFTestFiles/PDFExtensionTest.Load/0:PDFTestFiles/PDFExtensionTest.Load/1:PDFTestFiles/PDFExtensionTest.Load/5:PDFTestFiles/PDFExtensionTest.Load/8:PhishingClassifierTest.TestClassification:PhishingDOMFeatureExtractorTest.LinkFeatures:PlatformAppBrowserTest.ActiveAppsAreRecorded:PlatformAppBrowserTest.AppWindowRestoreState:PlatformAppDevToolsBrowserTest.ReOpenedWithID:PlatformAppDevToolsBrowserTest.ReOpenedWithURL:PlatformAppUrlRedirectorBrowserTest.PrerenderedClickInTabIntercepted:PolicyTest.DownloadDirectory:PolicyTest.ExtensionInstallSources:PolicyTest.FullscreenAllowedApp:PolicyTest.HomepageLocation:PolicyTest.SafeBrowsingExtendedReportingOptInAllowed:PolicyTest.SSLErrorOverridingAllowed:PolicyTest.SSLErrorOverridingDisallowed:PolicyUITest.ExtensionLoadAndSendPolicy:PrefsFunctionalTest.TestDownloadDirPref:PrerenderBrowserTest.PrerenderCancelMainFrameRedirectUnsupportedScheme:PrerenderBrowserTest.PrerenderClientRedirectFromFragment:PrerenderBrowserTest.PrerenderClientRedirectNavigateToFirst:PrerenderBrowserTest.PrerenderClientRedirectNavigateToSecond:PrerenderBrowserTest.PrerenderClientRedirectNavigateToSecondViaClick:PrerenderBrowserTest.PrerenderClientRedirectToFragment:PrerenderBrowserTest.PrerenderCrossProcessServerRedirect:PrerenderBrowserTest.PrerenderCrossProcessServerRedirectNoHang:PrerenderBrowserTest.PrerenderCrx:PrerenderBrowserTest.PrerenderDownloadClientRedirect:PrerenderBrowserTest.PrerenderDownloadIframe:PrerenderBrowserTest.PrerenderDownloadLocation:PrerenderBrowserTest.PrerenderHttpAuthentication:PrerenderBrowserTest.PrerenderLocationReplaceGWSHistograms:PrerenderBrowserTest.PrerenderLocationReplaceNavigateToFirst:PrerenderBrowserTest.PrerenderLocationReplaceNavigateToSecond:PrerenderBrowserTest.PrerenderPageWithRedirectedFragment:PrerenderBrowserTest.PrerenderSafeBrowsingClientRedirect:PrerenderBrowserTest.PrerenderSafeBrowsingIframe:PrerenderBrowserTest.PrerenderSafeBrowsingServerRedirect:PrerenderBrowserTest.PrerenderSafeBrowsingTopLevel:PrerenderBrowserTest.PrerenderSSLClientCertIframe:PrerenderBrowserTest.PrerenderSSLClientCertTopLevel:PrerenderBrowserTest.PrerenderSSLErrorTopLevel:PrerenderBrowserTestWithExtensions.StreamsTest:ProfileManagerBrowserTest.DeletePasswords:ProfileManagerBrowserTest.EphemeralProfile:ProxyBrowserTest.BasicAuthWSConnect:PushMessagingBackgroundModeDisabledBrowserTest.BackgroundModeDisabledWithCommandLine:PushMessagingBackgroundModeEnabledBrowserTest.BackgroundModeEnabledWithCommandLine:PushMessagingBrowserTest.AutomaticUnsubscriptionFollowsContentSettingRules:PushMessagingBrowserTest.BackgroundModeDisabledByDefault:PushMessagingBrowserTest.DenyNotificationsPermissionUnsubscribes:PushMessagingBrowserTest.DenyPushPermissionUnsubscribes:PushMessagingBrowserTest.EncryptionKeyUniqueness:PushMessagingBrowserTest.GlobalResetNotificationsPermissionUnsubscribes:PushMessagingBrowserTest.GlobalResetPushPermissionUnsubscribes:PushMessagingBrowserTest.GrantAlreadyGrantedPermissionDoesNotUnsubscribe:PushMessagingBrowserTest.LocalResetNotificationsPermissionUnsubscribes:PushMessagingBrowserTest.LocalResetPushPermissionUnsubscribes:PushMessagingBrowserTest.PermissionStateSaysDenied:PushMessagingBrowserTest.PermissionStateSaysGranted:PushMessagingBrowserTest.PermissionStateSaysPrompt:PushMessagingBrowserTest.PushEventEnforcesUserVisibleNotification:PushMessagingBrowserTest.PushEventEnforcesUserVisibleNotificationAfterQueue:PushMessagingBrowserTest.PushEventNoServiceWorker:PushMessagingBrowserTest.PushEventNotificationWithoutEventWaitUntil:PushMessagingBrowserTest.PushEventSuccess:PushMessagingBrowserTest.ResetPushPermissionAfterClearingSiteData:PushMessagingBrowserTest.SubscribeFailureNoManifest:PushMessagingBrowserTest.SubscribeFailureNotificationsBlocked:PushMessagingBrowserTest.SubscribePersisted:PushMessagingBrowserTest.SubscribeSuccessNotificationsGranted:PushMessagingBrowserTest.SubscribeSuccessNotificationsPrompt:PushMessagingBrowserTest.UnsubscribeSuccess:PushMessagingBrowserTestEmptySubscriptionOptions.RegisterFailureEmptyPushSubscriptionOptions:PushMessagingIncognitoBrowserTest.IncognitoGetSubscriptionDoesNotHang:RedirectTest.ClientEmptyReferer:RedirectTest.ClientServerServer:RedirectTest.Server:ReferrerPolicyTest.HttpLeftClickRedirectToHTTPOriginWhenCrossOrigin:ReferrerPolicyTest.HttpsMiddleClickOrigin:ReferrerPolicyTest.HttpsMiddleClickRedirect:ReferrerPolicyTest.MiddleClickOrigin:ReferrerPolicyTest.MiddleClickRedirect:RepostFormWarningTest.TestDoubleReload:RepostFormWarningTest.TestLoginAfterRepost:RestartTest.Post:SafeBrowsingBlockingPageBrowserTestWithThreatType/SafeBrowsingBlockingPageBrowserTest.DontProceed/0:SafeBrowsingBlockingPageBrowserTestWithThreatType/SafeBrowsingBlockingPageBrowserTest.DontProceed/1:SafeBrowsingBlockingPageBrowserTestWithThreatType/SafeBrowsingBlockingPageBrowserTest.DontProceed/2:SafeBrowsingBlockingPageBrowserTestWithThreatType/SafeBrowsingBlockingPageBrowserTest.Histograms_DontProceed/0:SafeBrowsingBlockingPageBrowserTestWithThreatType/SafeBrowsingBlockingPageBrowserTest.Histograms_DontProceed/1:SafeBrowsingBlockingPageBrowserTestWithThreatType/SafeBrowsingBlockingPageBrowserTest.Histograms_DontProceed/2:SafeBrowsingBlockingPageBrowserTestWithThreatType/SafeBrowsingBlockingPageBrowserTest.Histograms_Proceed/0:SafeBrowsingBlockingPageBrowserTestWithThreatType/SafeBrowsingBlockingPageBrowserTest.Histograms_Proceed/1:SafeBrowsingBlockingPageBrowserTestWithThreatType/SafeBrowsingBlockingPageBrowserTest.Histograms_Proceed/2:SafeBrowsingBlockingPageBrowserTestWithThreatType/SafeBrowsingBlockingPageBrowserTest.IframeDontProceed/0:SafeBrowsingBlockingPageBrowserTestWithThreatType/SafeBrowsingBlockingPageBrowserTest.IframeDontProceed/1:SafeBrowsingBlockingPageBrowserTestWithThreatType/SafeBrowsingBlockingPageBrowserTest.IframeDontProceed/2:SafeBrowsingBlockingPageBrowserTestWithThreatType/SafeBrowsingBlockingPageBrowserTest.IframeOptInAndReportMalwareDetails/0:SafeBrowsingBlockingPageBrowserTestWithThreatType/SafeBrowsingBlockingPageBrowserTest.IframeOptInAndReportMalwareDetails/1:SafeBrowsingBlockingPageBrowserTestWithThreatType/SafeBrowsingBlockingPageBrowserTest.IframeOptInAndReportMalwareDetails/2:SafeBrowsingBlockingPageBrowserTestWithThreatType/SafeBrowsingBlockingPageBrowserTest.IframeProceed/0:SafeBrowsingBlockingPageBrowserTestWithThreatType/SafeBrowsingBlockingPageBrowserTest.IframeProceed/1:SafeBrowsingBlockingPageBrowserTestWithThreatType/SafeBrowsingBlockingPageBrowserTest.IframeProceed/2:SafeBrowsingBlockingPageBrowserTestWithThreatType/SafeBrowsingBlockingPageBrowserTest.LearnMore/0:SafeBrowsingBlockingPageBrowserTestWithThreatType/SafeBrowsingBlockingPageBrowserTest.LearnMore/1:SafeBrowsingBlockingPageBrowserTestWithThreatType/SafeBrowsingBlockingPageBrowserTest.LearnMore/2:SafeBrowsingBlockingPageBrowserTestWithThreatType/SafeBrowsingBlockingPageBrowserTest.Proceed/0:SafeBrowsingBlockingPageBrowserTestWithThreatType/SafeBrowsingBlockingPageBrowserTest.Proceed/1:SafeBrowsingBlockingPageBrowserTestWithThreatType/SafeBrowsingBlockingPageBrowserTest.Proceed/2:SafeBrowsingBlockingPageBrowserTestWithThreatType/SafeBrowsingBlockingPageBrowserTest.ProceedDisabled/0:SafeBrowsingBlockingPageBrowserTestWithThreatType/SafeBrowsingBlockingPageBrowserTest.ProceedDisabled/1:SafeBrowsingBlockingPageBrowserTestWithThreatType/SafeBrowsingBlockingPageBrowserTest.ProceedDisabled/2:SafeBrowsingBlockingPageBrowserTestWithThreatType/SafeBrowsingBlockingPageBrowserTest.RedirectCanceled/0:SafeBrowsingBlockingPageBrowserTestWithThreatType/SafeBrowsingBlockingPageBrowserTest.RedirectCanceled/1:SafeBrowsingBlockingPageBrowserTestWithThreatType/SafeBrowsingBlockingPageBrowserTest.RedirectCanceled/2:SafeBrowsingBlockingPageBrowserTestWithThreatType/SafeBrowsingBlockingPageBrowserTest.ReportingDisabled/0:SafeBrowsingBlockingPageBrowserTestWithThreatType/SafeBrowsingBlockingPageBrowserTest.ReportingDisabled/1:SafeBrowsingBlockingPageBrowserTestWithThreatType/SafeBrowsingBlockingPageBrowserTest.ReportingDisabled/2:SafeBrowsingBlockingPageBrowserTestWithThreatType/SafeBrowsingBlockingPageBrowserTest.ReportingDisabledByPolicy/0:SafeBrowsingBlockingPageBrowserTestWithThreatType/SafeBrowsingBlockingPageBrowserTest.ReportingDisabledByPolicy/1:SafeBrowsingBlockingPageBrowserTestWithThreatType/SafeBrowsingBlockingPageBrowserTest.ReportingDisabledByPolicy/2:SafeBrowsingBlockingPageBrowserTestWithThreatType/SafeBrowsingBlockingPageBrowserTest.WhitelistIframeRevisit/0:SafeBrowsingBlockingPageBrowserTestWithThreatType/SafeBrowsingBlockingPageBrowserTest.WhitelistIframeRevisit/1:SafeBrowsingBlockingPageBrowserTestWithThreatType/SafeBrowsingBlockingPageBrowserTest.WhitelistIframeRevisit/2:SafeBrowsingBlockingPageBrowserTestWithThreatType/SafeBrowsingBlockingPageBrowserTest.WhitelistRevisit/0:SafeBrowsingBlockingPageBrowserTestWithThreatType/SafeBrowsingBlockingPageBrowserTest.WhitelistRevisit/1:SafeBrowsingBlockingPageBrowserTestWithThreatType/SafeBrowsingBlockingPageBrowserTest.WhitelistRevisit/2:SafeBrowsingBlockingPageBrowserTestWithThreatType/SafeBrowsingBlockingPageBrowserTest.WhitelistUnsaved/0:SafeBrowsingBlockingPageBrowserTestWithThreatType/SafeBrowsingBlockingPageBrowserTest.WhitelistUnsaved/1:SafeBrowsingBlockingPageBrowserTestWithThreatType/SafeBrowsingBlockingPageBrowserTest.WhitelistUnsaved/2:SafeBrowsingServiceTest.Prefetch:SearchProviderTest.TestIsSearchProviderInstalled:SecurityStateModelLoadingTest.NavigationStateChanges:SecurityStateModelTest.AddedTab:SecurityStateModelTest.BrokenHTTPS:SecurityStateModelTest.HttpsPage:SecurityStateModelTest.MixedContent:SecurityStateModelTest.MixedContentWithBrokenSHA1:SecurityStateModelTest.SHA1Broken:ServiceWorkerTest.BackgroundPageIsWokenIfAsleep:ServiceWorkerTest.BackgroundPagePostsMessageToServiceWorker:ServiceWorkerTest.FetchArbitraryPaths:ServiceWorkerTest.GetBackgroundClientFailsWithNoBackgroundPage:ServiceWorkerTest.LoadingBackgroundPageBypassesServiceWorker:ServiceWorkerTest.RegisterSucceedsOnTrunk:ServiceWorkerTest.ServiceWorkerPostsMessageToBackgroundClient:ServiceWorkerTest.ServiceWorkerSuspensionOnExtensionUnload:SSLUITest.BadCertFollowedByGoodCert:SSLUITest.InterstitialNotAffectedByHideShow:SSLUITest.SSLStatusMatchesonClockInterstitialAndAfterProceed:SSLUITest.SSLStatusMatchesOnInterstitialAndAfterProceed:SSLUITest.TestBadFrameNavigation:SSLUITest.TestBadHTTPSDownload:SSLUITest.TestBrokenHTTPSMetricsReporting_DontProceed:SSLUITest.TestBrokenHTTPSMetricsReporting_Proceed:SSLUITest.TestBrokenHTTPSWithInsecureContent:SSLUITest.TestGoodFrameNavigation:SSLUITest.TestHTTPSErrorCausedByClock:SSLUITest.TestHTTPSErrorWithNoNavEntry:SSLUITest.TestHTTPSExpiredCertAndGoBackViaButton:SSLUITest.TestHTTPSExpiredCertAndGoBackViaMenu:SSLUITest.TestHTTPSExpiredCertAndGoForward:SSLUITest.TestInterstitialJavaScriptGoesBack:SSLUITest.TestRedirectBadToGoodHTTPS:SSLUITest.TestRefNavigation:SSLUITest.TestUnsafeContentsInWorkerWithUserException:SSLUITest.TestUnsafeContentsWithUserException:SSLUITest.TestWSSInvalidCertAndGoForward:SSLUITestIgnoreLocalhostCertErrors.TestNoInterstitialOnLocalhost:SSLUITestWithClientCert.TestWSSClientCert:SSLUITestWithExtendedReporting.TestBadClockReportingWithNoOptIn:SSLUITestWithExtendedReporting.TestBadClockReportingWithOptIn:SSLUITestWithExtendedReporting.TestBrokenHTTPSGoBackReporting:SSLUITestWithExtendedReporting.TestBrokenHTTPSGoBackShowYesCheckNoParamYesReportNo:SSLUITestWithExtendedReporting.TestBrokenHTTPSInIncognitoReportNo:SSLUITestWithExtendedReporting.TestBrokenHTTPSNoReportingWhenDisallowed:SSLUITestWithExtendedReporting.TestBrokenHTTPSProceedReporting:SSLUITestWithExtendedReporting.TestBrokenHTTPSProceedReportingWithNoOptIn:StreamsPrivateApiTest.Abort:StreamsPrivateApiTest.FileURL:StreamsPrivateApiTest.Headers:StreamsPrivateApiTest.Navigate:StreamsPrivateApiTest.NavigateCrossSite:StreamsPrivateApiTest.NavigateToAnAttachment:SupervisedUserBlockModeTest.HistoryVisitRecorded:SupervisedUserBlockModeTest.OpenBlockedURLInNewTab:SupervisedUserBlockModeTest.SendAccessRequestOnBlockedURL:SupervisedUserBlockModeTest.Unblock:SupervisedUserResourceThrottleTest.NoNavigationObserverBlock:SyncFileSystemTest.AuthorizationTest:TaskManagerBrowserTest.DevToolsNewDockedWindow:TaskManagerBrowserTest.DevToolsNewUndockedWindow:TaskManagerBrowserTest.DevToolsOldDockedWindow:TaskManagerBrowserTest.DevToolsOldUnockedWindow:TemplateURLScraperTest.ScrapeWithOnSubmit:UnloadTest.CrossSiteInfiniteBeforeUnloadAsync:WebNavigationApiTest.CrossProcess:WebNavigationApiTest.CrossProcessAbort:WebNavigationApiTest.CrossProcessFragment:WebNavigationApiTest.CrossProcessHistory:WebNavigationApiTest.Failures:WebNavigationApiTest.History:WebNavigationApiTest.IFrame:WebNavigationApiTest.OpenTab:WebNavigationApiTest.RequestOpenTab:WebNavigationApiTest.ServerRedirect:WebNavigationApiTest.ServerRedirectSingleProcess:WebSocketBrowserTest.ReuseMainPageBasicAuthCredentialsForWebSocket:WebUIWebViewBrowserTest.DisplayNone:WebViewPluginTest.TestLoadPluginInternalResource:WebViewTest.InterstitialTeardown:WebViewTest.InterstitialTeardownOnBrowserShutdown:WebViewTest.NestedGuestContainerBounds:WebViewTest.Shim_TestDeclarativeWebRequestAPI:WebViewTest.Shim_TestDeclarativeWebRequestAPISendMessage:WebViewTest.Shim_TestInlineScriptFromAccessibleResources:WebViewTest.Shim_TestLoadAbortChromeExtensionURLWrongPartition:WebViewTest.Shim_TestLoadStartLoadRedirect:WebViewTest.Shim_TestMailtoLink:WebViewTest.Shim_TestNavigationToExternalProtocol:WebViewTest.Shim_TestNestedSubframes:WebViewTest.Shim_TestWebRequestAPIErrorOccurred:WebViewTest.Shim_TestWebRequestAPIGoogleProperty:WebViewTest.Shim_TestWebRequestAPIWithHeaders:WorkerDevToolsSanityTest.InspectSharedWorker"
         ],
         "swarming": {
           "can_use_on_swarming_builders": true
@@ -22,7 +22,7 @@
       {
         "args": [
           "--enable-browser-side-navigation",
-          "--gtest_filter=-BackgroundSyncBrowserTest.CallDoneAfterSyncFails:BackgroundSyncBrowserTest.CallDoneAfterSyncSuceeds:BackgroundSyncBrowserTest.CallDoneAfterSyncUnregistered:BackgroundSyncBrowserTest.CallDoneBeforeSyncFails:BackgroundSyncBrowserTest.CallDoneBeforeSyncSucceeds:BackgroundSyncBrowserTest.GetRegistrations:BackgroundSyncBrowserTest.Incognito:BackgroundSyncBrowserTest.OneShotDelaysForNetwork:BackgroundSyncBrowserTest.OneShotFires:BackgroundSyncBrowserTest.Unregister:BackgroundSyncBrowserTest.UnregisterMidSync:BackgroundSyncBrowserTest.UnregisterTwice:BackgroundSyncBrowserTest.WaitUntil:BackgroundSyncBrowserTest.WaitUntilReject:CrossSiteRedirectorBrowserTest.VerifyCrossSiteRedirectURL:CrossSiteTransferTest.NoLeakOnCrossSiteCancel:CrossSiteTransferTest.ReplaceEntryCrossProcessThenTransfer:CrossSiteTransferTest.ReplaceEntryCrossProcessTwice:CrossSiteTransferTest.ReplaceEntryInProcessThenTranfers:DevToolsProtocolTest.NavigationPreservesMessages:NavigationControllerBrowserTest.CorrectLengthWithCurrentItemReplacement:NavigationControllerBrowserTest.FrameNavigationEntry_SubframeBackForward:NavigationControllerBrowserTest.NavigationTypeClassification_ClientSideRedirect:NavigationControllerBrowserTest.NavigationTypeClassification_ExistingPage:NavigationControllerBrowserTest.NavigationTypeClassification_NewAndAutoSubframe:NavigationControllerBrowserTest.NavigationTypeClassification_NewPage:NavigationControllerBrowserTest.PreventSpoofFromSubframeAndReplace:NavigationControllerBrowserTest.ReloadOriginalRequest:NavigationControllerBrowserTest.StopCausesFailureDespiteJavaScriptURL:RendererAccessibilityTest.AccessibilityMessagesQueueWhileSwappedOut:RenderViewImplTest.GetCompositionCharacterBoundsTest:RenderViewImplTest.OnNavigationHttpPost:RenderViewImplTest.ReloadWhileSwappedOut:RenderViewImplTest.TestBackForward:ServiceWorkerBrowserTest.CrossSiteTransfer:ServiceWorkerBrowserTest.ImportsBustMemcache:ServiceWorkerBrowserTest.Reload:ServiceWorkerBrowserTest.ResponseFromHTTPServiceWorkerIsNotMarkedAsSecure:ServiceWorkerBrowserTest.ResponseFromHTTPSServiceWorkerIsMarkedAsSecure:SessionHistoryTest.CrossFrameFormBackForward:SessionHistoryTest.FrameBackForward:SessionHistoryTest.FrameFormBackForward:SessionHistoryTest.LocationChangeInSubframe:SitePerProcessBrowserTest.NewRenderFrameProxyPreservesOpener:SitePerProcessBrowserTest.OpenPopupWithRemoteParent:WebContentsImplBrowserTest.ClearNonVisiblePendingOnFail:WebContentsViewAuraTest.OverscrollScreenshot:WebUIMojoTest.EndToEndPing"
+          "--gtest_filter=-BackgroundSyncBrowserTest.CallDoneAfterSyncFails:BackgroundSyncBrowserTest.CallDoneAfterSyncSuceeds:BackgroundSyncBrowserTest.CallDoneAfterSyncUnregistered:BackgroundSyncBrowserTest.CallDoneBeforeSyncFails:BackgroundSyncBrowserTest.CallDoneBeforeSyncSucceeds:BackgroundSyncBrowserTest.GetRegistrations:BackgroundSyncBrowserTest.Incognito:BackgroundSyncBrowserTest.OneShotDelaysForNetwork:BackgroundSyncBrowserTest.OneShotFires:BackgroundSyncBrowserTest.Unregister:BackgroundSyncBrowserTest.UnregisterMidSync:BackgroundSyncBrowserTest.UnregisterTwice:BackgroundSyncBrowserTest.WaitUntil:BackgroundSyncBrowserTest.WaitUntilReject:CrossSiteRedirectorBrowserTest.VerifyCrossSiteRedirectURL:CrossSiteTransferTest.NoLeakOnCrossSiteCancel:CrossSiteTransferTest.ReplaceEntryCrossProcessThenTransfer:CrossSiteTransferTest.ReplaceEntryCrossProcessTwice:CrossSiteTransferTest.ReplaceEntryInProcessThenTranfers:DevToolsProtocolTest.NavigationPreservesMessages:NavigationControllerBrowserTest.CorrectLengthWithCurrentItemReplacement:NavigationControllerBrowserTest.FrameNavigationEntry_SubframeBackForward:NavigationControllerBrowserTest.NavigationTypeClassification_ClientSideRedirect:NavigationControllerBrowserTest.NavigationTypeClassification_EmptyGURL:NavigationControllerBrowserTest.NavigationTypeClassification_ExistingPage:NavigationControllerBrowserTest.NavigationTypeClassification_NewAndAutoSubframe:NavigationControllerBrowserTest.NavigationTypeClassification_NewPage:NavigationControllerBrowserTest.PreventSpoofFromSubframeAndReplace:NavigationControllerBrowserTest.ReloadOriginalRequest:NavigationControllerBrowserTest.StopCausesFailureDespiteJavaScriptURL:RendererAccessibilityTest.AccessibilityMessagesQueueWhileSwappedOut:RenderViewImplTest.DecideNavigationPolicy:RenderViewImplTest.GetCompositionCharacterBoundsTest:RenderViewImplTest.OnNavigationHttpPost:RenderViewImplTest.ReloadWhileSwappedOut:RenderViewImplTest.TestBackForward:ServiceWorkerBrowserTest.CrossSiteTransfer:ServiceWorkerBrowserTest.ImportsBustMemcache:ServiceWorkerBrowserTest.Reload:ServiceWorkerBrowserTest.ResponseFromHTTPServiceWorkerIsNotMarkedAsSecure:ServiceWorkerBrowserTest.ResponseFromHTTPSServiceWorkerIsMarkedAsSecure:SessionHistoryTest.CrossFrameFormBackForward:SessionHistoryTest.FrameBackForward:SessionHistoryTest.FrameFormBackForward:SessionHistoryTest.LocationChangeInSubframe:SitePerProcessBrowserTest.NewRenderFrameProxyPreservesOpener:SitePerProcessBrowserTest.OpenPopupWithRemoteParent:SitePerProcessBrowserTest.RenderViewHostPendingDeletionIsNotReused:WebContentsImplBrowserTest.ClearNonVisiblePendingOnFail:WebContentsViewAuraTest.OverscrollScreenshot:WebContentsViewAuraTest.WebContentsViewReparent:WebUIMojoTest.EndToEndPing"
         ],
         "swarming": {
           "can_use_on_swarming_builders": true
@@ -42,7 +42,7 @@
       {
         "args": [
           "--enable-browser-side-navigation",
-          "--gtest_filter=-ActiveScriptControllerUnitTest.ActiveScriptsUseActiveTabPermissions:ActiveScriptControllerUnitTest.PendingInjectionsRemovedAtNavigation:ActiveScriptControllerUnitTest.RequestPermissionAndExecute:ActiveScriptControllerUnitTest.TestAlwaysRun:ActiveTabTest.GrantToSinglePage:ActiveTabTest.NavigateInPage:AppInfoDialogViewsTest.ViewInStore:BookmarkInstantExtendedTest.DetachedBookmarkBarOnNTP:BookmarkTest.DetachedBookmarkBarOnNTP:BrowserBookmarkBarTest.StateOnActiveTabChanged:BrowserCommandsTest.BackForwardInNewTab:BrowserCommandsTest.BookmarkCurrentPage:BrowserCommandsTest.DuplicateTab:BrowserCommandsTest.OnDefaultZoomLevelChanged:BrowserCommandsTest.OnMaxZoomIn:BrowserCommandsTest.OnMaxZoomOut:BrowserCommandsTest.OnZoomChangedForActiveTab:BrowserCommandsTest.OnZoomLevelChanged:BrowserCommandsTest.OnZoomReset:BrowserCommandsTest.ViewSource:BrowserInstantControllerTest.DefaultSearchProviderChanged:BrowserInstantControllerTest.GoogleBaseURLUpdated:BrowserListTest.TabContentsIteratorVerifyBrowser:BrowserListTest.TabContentsIteratorVerifyCount:BrowserProcessPowerTest.IncognitoDoesntRecordPowerUsage:BrowserProcessPowerTest.MultipleProfilesRecordSeparately:BrowserProcessPowerTest.MultipleSites:BrowserProcessPowerTest.OneSite:BrowserViewTest.BrowserViewLayout:CaptivePortalTabHelperTest.AbortCrossProcess:CaptivePortalTabHelperTest.AbortTimeoutCrossProcess:CaptivePortalTabHelperTest.HttpsAbort:CaptivePortalTabHelperTest.HttpsAbortTimeout:CaptivePortalTabHelperTest.HttpsAbortTimeoutForCrossProcess:CaptivePortalTabHelperTest.HttpsSuccess:CaptivePortalTabHelperTest.HttpsTimeout:CaptivePortalTabHelperTest.HttpTimeout:CaptivePortalTabHelperTest.UnexpectedCommit:CaptivePortalTabHelperTest.UnexpectedProvisionalLoad:ChromeContentBrowserClientWindowTest.OpenURL:ChromeLauncherControllerTest.AppPanels:ChromeLauncherControllerTest.BrowserMenuGeneration:ChromeLauncherControllerTest.GmailMatching:ChromeLauncherControllerTest.GmailOfflineMatching:ChromeLauncherControllerTest.PersistLauncherItemPositions:ChromeLauncherControllerTest.PersistPinned:ChromeLauncherControllerTest.V1AppMenuDeletionExecution:ChromeLauncherControllerTest.V1AppMenuExecution:ChromeLauncherControllerTest.V1AppMenuGeneration:DeclarativeContentIsBookmarkedConditionTrackerTest.AddAndRemoveBookmark:DeclarativeContentIsBookmarkedConditionTrackerTest.BookmarkedAtStartOfTracking:DeclarativeContentIsBookmarkedConditionTrackerTest.ExtensiveChanges:DeclarativeContentIsBookmarkedConditionTrackerTest.Navigation:DeclarativeContentPageUrlConditionTrackerTest.AddAndRemovePredicates:DeclarativeContentPageUrlConditionTrackerTest.NotifyWebContentsNavigation:DeclarativeContentPageUrlConditionTrackerTest.TrackWebContents:DownloadRequestLimiterTest.DownloadRequestLimiter_ResetOnReload:InstantNTPURLRewriteTest.UberURLHandler_InstantExtendedNewTabPage:InstantSearchPrerendererTest.CancelPendingPrerenderRequest:InstantSearchPrerendererTest.CancelPrerenderRequest_EmptySearchQueryCommitted:InstantSearchPrerendererTest.CancelPrerenderRequest_UnsupportedDispositions:InstantSearchPrerendererTest.CancelPrerenderRequestOnTabChangeEvent:InstantSearchPrerendererTest.CanCommitQuery:InstantSearchPrerendererTest.CommitQuery:InstantSearchPrerendererTest.DoNotPrefetchSearchResults:InstantSearchPrerendererTest.PrefetchSearchResults:InstantSearchPrerendererTest.PrerenderingAllowed:InstantSearchPrerendererTest.PrerenderRequestCancelled:InstantSearchPrerendererTest.UsePrerenderedPage_SearchQueryMistmatch:InstantSearchPrerendererTest.UsePrerenderPage:MediaRouterActionUnitTest.IconPressedState:MediaRouterDialogControllerImplTest.CloseDialogFromDialogController:MediaRouterDialogControllerImplTest.CloseDialogFromWebUI:MediaRouterDialogControllerImplTest.CloseInitiator:MediaRouterDialogControllerImplTest.MultipleMediaRouterDialogs:MediaRouterDialogControllerImplTest.ShowMediaRouterDialog:MediaRouterWebUIMessageHandlerTest.OnCreateRouteResponseReceived:MediaRouterWebUIMessageHandlerTest.UpdateIssue:MediaRouterWebUIMessageHandlerTest.UpdateRoutes:MediaRouterWebUIMessageHandlerTest.UpdateSinks:OneClickSigninSyncObserverTest.NoSyncService_RedirectsImmediately:OneClickSigninSyncObserverTest.OnSyncStateChanged_SyncConfiguredSuccessfully:PinnedTabCodecTest.NoPinnedTabs:PinnedTabCodecTest.PinnedAndNonPinned:PinnedTabServiceTest.Popup:PopupToolbarModelTest.ShouldDisplayURL:PrintPreviewDialogControllerUnitTest.ClearInitiatorDetails:PrintPreviewDialogControllerUnitTest.GetOrCreatePreviewDialog:PrintPreviewDialogControllerUnitTest.MultiplePreviewDialogs:PrintPreviewUIUnitTest.GetCurrentPrintPreviewStatus:PrintPreviewUIUnitTest.PrintPreviewData:PrintPreviewUIUnitTest.PrintPreviewDraftPages:RecentTabsSubMenuModelTest.RecentlyClosedTabsAndWindowsFromLastSession:RecentTabsSubMenuModelTest.RecentlyClosedTabsFromCurrentSession:ReuseInstantSearchBasePageTest.CanCommitQuery:ReuseInstantSearchBasePageTest.CanCommitQuery_InstantSearchBasePageLoadInProgress:SearchDelegateTest.SearchModel:SearchIPCRouterPolicyTest.AppropriateMessagesSentToIncognitoPages:SearchIPCRouterPolicyTest.DoNotProcessChromeIdentityCheck:SearchIPCRouterPolicyTest.DoNotProcessFocusOmnibox:SearchIPCRouterPolicyTest.DoNotProcessHistorySyncCheck:SearchIPCRouterPolicyTest.DoNotProcessLogEvent:SearchIPCRouterPolicyTest.DoNotProcessMessagesForInactiveTab:SearchIPCRouterPolicyTest.DoNotProcessMessagesForIncognitoPage:SearchIPCRouterPolicyTest.DoNotProcessNavigateToURL:SearchIPCRouterPolicyTest.DoNotProcessPasteIntoOmniboxMsg:SearchIPCRouterPolicyTest.DoNotSendMostVisitedItems:SearchIPCRouterPolicyTest.DoNotSendSetMessagesForIncognitoPage:SearchIPCRouterPolicyTest.DoNotSendSetPromoInformation:SearchIPCRouterPolicyTest.DoNotSendThemeBackgroundInfo:SearchIPCRouterPolicyTest.ProcessChromeIdentityCheck:SearchIPCRouterPolicyTest.ProcessDeleteMostVisitedItem:SearchIPCRouterPolicyTest.ProcessFocusOmnibox:SearchIPCRouterPolicyTest.ProcessHistorySyncCheck:SearchIPCRouterPolicyTest.ProcessLogEvent:SearchIPCRouterPolicyTest.ProcessNavigateToURL:SearchIPCRouterPolicyTest.ProcessPasteIntoOmniboxMsg:SearchIPCRouterPolicyTest.ProcessUndoAllMostVisitedDeletions:SearchIPCRouterPolicyTest.ProcessUndoMostVisitedDeletion:SearchIPCRouterPolicyTest.ProcessVoiceSearchSupportMsg:SearchIPCRouterPolicyTest.SendMostVisitedItems:SearchIPCRouterPolicyTest.SendSetDisplayInstantResults:SearchIPCRouterPolicyTest.SendSetOmniboxStartMargin:SearchIPCRouterPolicyTest.SendSetPromoInformation:SearchIPCRouterPolicyTest.SendSetSuggestionToPrefetch:SearchIPCRouterPolicyTest.SendThemeBackgroundInfo:SearchIPCRouterPolicyTest.SendToggleVoiceSearch:SearchIPCRouterPolicyTest.SubmitQuery:SearchIPCRouterTest.DoNotSendMostVisitedItemsMsg:SearchIPCRouterTest.DoNotSendOmniboxFocusChange:SearchIPCRouterTest.DoNotSendSetDisplayInstantResultsMsg:SearchIPCRouterTest.DoNotSendSetInputInProgress:SearchIPCRouterTest.DoNotSendSetOmniboxStartMargin:SearchIPCRouterTest.DoNotSendSetPromoInformationMsg:SearchIPCRouterTest.DoNotSendSetSuggestionToPrefetch:SearchIPCRouterTest.DoNotSendSubmitMsg:SearchIPCRouterTest.DoNotSendThemeBackgroundInfoMsg:SearchIPCRouterTest.DoNotSendToggleVoiceSearch:SearchIPCRouterTest.HandleTabChangedEvents:SearchIPCRouterTest.IgnoreChromeIdentityCheckMsg:SearchIPCRouterTest.IgnoreDeleteMostVisitedItemMsg:SearchIPCRouterTest.IgnoreFocusOmniboxMsg:SearchIPCRouterTest.IgnoreHistorySyncCheckMsg:SearchIPCRouterTest.IgnoreLogEventMsg:SearchIPCRouterTest.IgnoreMessageIfThePageIsNotActive:SearchIPCRouterTest.IgnoreMessagesFromNonInstantRenderers:SearchIPCRouterTest.IgnoreNavigateToURLMsg:SearchIPCRouterTest.IgnorePasteAndOpenDropdownMsg:SearchIPCRouterTest.IgnoreUndoAllMostVisitedDeletionsMsg:SearchIPCRouterTest.IgnoreUndoMostVisitedDeletionMsg:SearchIPCRouterTest.IgnoreVoiceSearchSupportMsg:SearchIPCRouterTest.ProcessChromeIdentityCheckMsg:SearchIPCRouterTest.ProcessDeleteMostVisitedItemMsg:SearchIPCRouterTest.ProcessFocusOmniboxMsg:SearchIPCRouterTest.ProcessHistorySyncCheckMsg:SearchIPCRouterTest.ProcessLogEventMsg:SearchIPCRouterTest.ProcessLogMostVisitedImpressionMsg:SearchIPCRouterTest.ProcessLogMostVisitedNavigationMsg:SearchIPCRouterTest.ProcessNavigateToURLMsg:SearchIPCRouterTest.ProcessPasteAndOpenDropdownMsg:SearchIPCRouterTest.ProcessUndoAllMostVisitedDeletionsMsg:SearchIPCRouterTest.ProcessUndoMostVisitedDeletionMsg:SearchIPCRouterTest.ProcessVoiceSearchSupportMsg:SearchIPCRouterTest.SendMostVisitedItemsMsg:SearchIPCRouterTest.SendOmniboxFocusChange:SearchIPCRouterTest.SendSetDisplayInstantResultsMsg_DisableInstantOnResultsPage:SearchIPCRouterTest.SendSetDisplayInstantResultsMsg_EnableInstantOnResultsPage:SearchIPCRouterTest.SendSetDisplayInstantResultsMsg_EnableInstantOutsideSearchResultsPage:SearchIPCRouterTest.SendSetInputInProgress:SearchIPCRouterTest.SendSetOmniboxStartMargin:SearchIPCRouterTest.SendSetPromoInformationMsg:SearchIPCRouterTest.SendSetSuggestionToPrefetch:SearchIPCRouterTest.SendSubmitMsg:SearchIPCRouterTest.SendThemeBackgroundInfoMsg:SearchIPCRouterTest.SendToggleVoiceSearch:SearchIPCRouterTest.SpuriousMessageTypesIgnored:SearchTabHelperPrerenderTest.OnOmniboxFocusPrerenderInstantURL:SearchTabHelperPrerenderTest.OnTabActivatedNoPrerenderIfOmniboxBlurred:SearchTabHelperPrerenderTest.OnTabActivatedPrerenderInstantURL:SearchTest.InstantCacheableNTPNavigationEntry:SearchTest.InstantCacheableNTPNavigationEntryNewProfile:SearchTest.InstantNTPCustomNavigationEntry:SearchTest.InstantNTPExtendedEnabled:SearchTest.ProcessIsolation:SearchTest.ProcessIsolation_RendererInitiated:SessionCrashedInfoBarDelegateUnitTest.DetachingTabWithCrashedInfoBar:SessionsSyncManagerTest.AssociateWindowsDontReloadTabs:SessionsSyncManagerTest.CheckPrerenderedWebContentsSwap:SessionsSyncManagerTest.MergeLocalSessionExistingTabs:SessionsSyncManagerTest.MergeWithLocalAndForeignTabs:SessionsSyncManagerTest.OnLocalTabModified:SessionsSyncManagerTest.ProcessRemoteDeleteOfLocalSession:SessionsSyncManagerTest.SwappedOutOnRestore:SessionsSyncManagerTest.UpdatesAfterMixedMerge:SiteEngagementServiceTest.ScoreIncrementsOnPageRequest:TabMenuModelTest.Basics:TestUsePrerenderPage.DoNotUsePrerenderPage:TestUsePrerenderPage.ExtractSearchTermsAndUsePrerenderPage:TestUsePrerenderPage.SetEmbeddedSearchRequestParams:ToolbarActionsBarRedesignUnitTest.ExtensionActionWantsToRunAppearance:ToolbarActionsBarUnitTest.ExtensionActionNormalAppearance:ToolbarModelTest.GoogleBaseURL:ToolbarModelTest.SearchTermsWhileLoading:ToolbarModelTest.ShouldDisplayURL_QueryExtraction"
+          "--gtest_filter=-AppInfoDialogViewsTest.ViewInStore:BookmarkInstantExtendedTest.DetachedBookmarkBarOnNTP:BookmarkTest.DetachedBookmarkBarOnCustomNTP:BookmarkTest.DetachedBookmarkBarOnNTP:BrowserBookmarkBarTest.StateOnActiveTabChanged:BrowserCommandsTest.BackForwardInNewTab:BrowserCommandsTest.BookmarkCurrentPage:BrowserCommandsTest.DuplicateTab:BrowserCommandsTest.OnDefaultZoomLevelChanged:BrowserCommandsTest.OnMaxZoomIn:BrowserCommandsTest.OnMaxZoomOut:BrowserCommandsTest.OnZoomChangedForActiveTab:BrowserCommandsTest.OnZoomLevelChanged:BrowserCommandsTest.OnZoomReset:BrowserCommandsTest.ViewSource:BrowserInstantControllerTest.DefaultSearchProviderChanged:BrowserInstantControllerTest.GoogleBaseURLUpdated:BrowserListTest.TabContentsIteratorVerifyBrowser:BrowserListTest.TabContentsIteratorVerifyCount:BrowserProcessPowerTest.IncognitoDoesntRecordPowerUsage:BrowserProcessPowerTest.MultipleProfilesRecordSeparately:BrowserProcessPowerTest.MultipleSites:BrowserProcessPowerTest.OneSite:BrowserViewTest.BrowserViewLayout:ChromeContentBrowserClientWindowTest.OpenURL:ChromeLauncherControllerTest.AppPanels:ChromeLauncherControllerTest.BrowserMenuGeneration:ChromeLauncherControllerTest.GmailMatching:ChromeLauncherControllerTest.GmailOfflineMatching:ChromeLauncherControllerTest.PersistLauncherItemPositions:ChromeLauncherControllerTest.PersistPinned:ChromeLauncherControllerTest.V1AppMenuDeletionExecution:ChromeLauncherControllerTest.V1AppMenuExecution:ChromeLauncherControllerTest.V1AppMenuGeneration:DeclarativeContentIsBookmarkedConditionTrackerTest.AddAndRemoveBookmark:DeclarativeContentIsBookmarkedConditionTrackerTest.BookmarkedAtStartOfTracking:DeclarativeContentIsBookmarkedConditionTrackerTest.ExtensiveChanges:DeclarativeContentIsBookmarkedConditionTrackerTest.Navigation:DeclarativeContentPageUrlConditionTrackerTest.AddAndRemovePredicates:DeclarativeContentPageUrlConditionTrackerTest.NotifyWebContentsNavigation:DeclarativeContentPageUrlConditionTrackerTest.TrackWebContents:InstantNTPURLRewriteTest.UberURLHandler_InstantExtendedNewTabPage:InstantSearchPrerendererTest.CancelPendingPrerenderRequest:InstantSearchPrerendererTest.CancelPrerenderRequest_EmptySearchQueryCommitted:InstantSearchPrerendererTest.CancelPrerenderRequest_UnsupportedDispositions:InstantSearchPrerendererTest.CancelPrerenderRequestOnTabChangeEvent:InstantSearchPrerendererTest.CanCommitQuery:InstantSearchPrerendererTest.CommitQuery:InstantSearchPrerendererTest.DoNotPrefetchSearchResults:InstantSearchPrerendererTest.PrefetchSearchResults:InstantSearchPrerendererTest.PrerenderingAllowed:InstantSearchPrerendererTest.PrerenderRequestCancelled:InstantSearchPrerendererTest.UsePrerenderedPage_SearchQueryMistmatch:InstantSearchPrerendererTest.UsePrerenderPage:MediaRouterActionUnitTest.IconPressedState:MediaRouterDialogControllerImplTest.CloseDialogFromDialogController:MediaRouterDialogControllerImplTest.CloseDialogFromWebUI:MediaRouterDialogControllerImplTest.CloseInitiator:MediaRouterDialogControllerImplTest.MultipleMediaRouterDialogs:MediaRouterDialogControllerImplTest.ShowMediaRouterDialog:MediaRouterWebUIMessageHandlerTest.OnCreateRouteResponseReceived:MediaRouterWebUIMessageHandlerTest.UpdateIssue:MediaRouterWebUIMessageHandlerTest.UpdateRoutes:MediaRouterWebUIMessageHandlerTest.UpdateSinks:PinnedTabCodecTest.NoPinnedTabs:PinnedTabCodecTest.PinnedAndNonPinned:PinnedTabServiceTest.Popup:PopupToolbarModelTest.ShouldDisplayURL:PrintPreviewDialogControllerUnitTest.ClearInitiatorDetails:PrintPreviewDialogControllerUnitTest.GetOrCreatePreviewDialog:PrintPreviewDialogControllerUnitTest.MultiplePreviewDialogs:PrintPreviewUIUnitTest.GetCurrentPrintPreviewStatus:PrintPreviewUIUnitTest.PrintPreviewData:PrintPreviewUIUnitTest.PrintPreviewDraftPages:RecentTabsSubMenuModelTest.RecentlyClosedTabsAndWindowsFromLastSession:RecentTabsSubMenuModelTest.RecentlyClosedTabsFromCurrentSession:ReuseInstantSearchBasePageTest.CanCommitQuery:ReuseInstantSearchBasePageTest.CanCommitQuery_InstantSearchBasePageLoadInProgress:SearchDelegateTest.SearchModel:SearchIPCRouterPolicyTest.AppropriateMessagesSentToIncognitoPages:SearchIPCRouterPolicyTest.DoNotProcessChromeIdentityCheck:SearchIPCRouterPolicyTest.DoNotProcessFocusOmnibox:SearchIPCRouterPolicyTest.DoNotProcessHistorySyncCheck:SearchIPCRouterPolicyTest.DoNotProcessLogEvent:SearchIPCRouterPolicyTest.DoNotProcessMessagesForInactiveTab:SearchIPCRouterPolicyTest.DoNotProcessMessagesForIncognitoPage:SearchIPCRouterPolicyTest.DoNotProcessNavigateToURL:SearchIPCRouterPolicyTest.DoNotProcessPasteIntoOmniboxMsg:SearchIPCRouterPolicyTest.DoNotSendMostVisitedItems:SearchIPCRouterPolicyTest.DoNotSendSetMessagesForIncognitoPage:SearchIPCRouterPolicyTest.DoNotSendSetPromoInformation:SearchIPCRouterPolicyTest.DoNotSendThemeBackgroundInfo:SearchIPCRouterPolicyTest.ProcessChromeIdentityCheck:SearchIPCRouterPolicyTest.ProcessDeleteMostVisitedItem:SearchIPCRouterPolicyTest.ProcessFocusOmnibox:SearchIPCRouterPolicyTest.ProcessHistorySyncCheck:SearchIPCRouterPolicyTest.ProcessLogEvent:SearchIPCRouterPolicyTest.ProcessNavigateToURL:SearchIPCRouterPolicyTest.ProcessPasteIntoOmniboxMsg:SearchIPCRouterPolicyTest.ProcessUndoAllMostVisitedDeletions:SearchIPCRouterPolicyTest.ProcessUndoMostVisitedDeletion:SearchIPCRouterPolicyTest.ProcessVoiceSearchSupportMsg:SearchIPCRouterPolicyTest.SendMostVisitedItems:SearchIPCRouterPolicyTest.SendSetDisplayInstantResults:SearchIPCRouterPolicyTest.SendSetOmniboxStartMargin:SearchIPCRouterPolicyTest.SendSetPromoInformation:SearchIPCRouterPolicyTest.SendSetSuggestionToPrefetch:SearchIPCRouterPolicyTest.SendThemeBackgroundInfo:SearchIPCRouterPolicyTest.SendToggleVoiceSearch:SearchIPCRouterPolicyTest.SubmitQuery:SearchIPCRouterTest.DoNotSendMostVisitedItemsMsg:SearchIPCRouterTest.DoNotSendOmniboxFocusChange:SearchIPCRouterTest.DoNotSendSetDisplayInstantResultsMsg:SearchIPCRouterTest.DoNotSendSetInputInProgress:SearchIPCRouterTest.DoNotSendSetOmniboxStartMargin:SearchIPCRouterTest.DoNotSendSetPromoInformationMsg:SearchIPCRouterTest.DoNotSendSetSuggestionToPrefetch:SearchIPCRouterTest.DoNotSendSubmitMsg:SearchIPCRouterTest.DoNotSendThemeBackgroundInfoMsg:SearchIPCRouterTest.DoNotSendToggleVoiceSearch:SearchIPCRouterTest.HandleTabChangedEvents:SearchIPCRouterTest.IgnoreChromeIdentityCheckMsg:SearchIPCRouterTest.IgnoreDeleteMostVisitedItemMsg:SearchIPCRouterTest.IgnoreFocusOmniboxMsg:SearchIPCRouterTest.IgnoreHistorySyncCheckMsg:SearchIPCRouterTest.IgnoreLogEventMsg:SearchIPCRouterTest.IgnoreMessageIfThePageIsNotActive:SearchIPCRouterTest.IgnoreMessagesFromNonInstantRenderers:SearchIPCRouterTest.IgnoreNavigateToURLMsg:SearchIPCRouterTest.IgnorePasteAndOpenDropdownMsg:SearchIPCRouterTest.IgnoreUndoAllMostVisitedDeletionsMsg:SearchIPCRouterTest.IgnoreUndoMostVisitedDeletionMsg:SearchIPCRouterTest.IgnoreVoiceSearchSupportMsg:SearchIPCRouterTest.ProcessChromeIdentityCheckMsg:SearchIPCRouterTest.ProcessDeleteMostVisitedItemMsg:SearchIPCRouterTest.ProcessFocusOmniboxMsg:SearchIPCRouterTest.ProcessHistorySyncCheckMsg:SearchIPCRouterTest.ProcessLogEventMsg:SearchIPCRouterTest.ProcessLogMostVisitedImpressionMsg:SearchIPCRouterTest.ProcessLogMostVisitedNavigationMsg:SearchIPCRouterTest.ProcessNavigateToURLMsg:SearchIPCRouterTest.ProcessPasteAndOpenDropdownMsg:SearchIPCRouterTest.ProcessUndoAllMostVisitedDeletionsMsg:SearchIPCRouterTest.ProcessUndoMostVisitedDeletionMsg:SearchIPCRouterTest.ProcessVoiceSearchSupportMsg:SearchIPCRouterTest.SendMostVisitedItemsMsg:SearchIPCRouterTest.SendOmniboxFocusChange:SearchIPCRouterTest.SendSetDisplayInstantResultsMsg_DisableInstantOnResultsPage:SearchIPCRouterTest.SendSetDisplayInstantResultsMsg_EnableInstantOnResultsPage:SearchIPCRouterTest.SendSetDisplayInstantResultsMsg_EnableInstantOutsideSearchResultsPage:SearchIPCRouterTest.SendSetInputInProgress:SearchIPCRouterTest.SendSetOmniboxStartMargin:SearchIPCRouterTest.SendSetPromoInformationMsg:SearchIPCRouterTest.SendSetSuggestionToPrefetch:SearchIPCRouterTest.SendSubmitMsg:SearchIPCRouterTest.SendThemeBackgroundInfoMsg:SearchIPCRouterTest.SendToggleVoiceSearch:SearchIPCRouterTest.SpuriousMessageTypesIgnored:SearchTabHelperPrerenderTest.OnOmniboxFocusPrerenderInstantURL:SearchTabHelperPrerenderTest.OnTabActivatedNoPrerenderIfOmniboxBlurred:SearchTabHelperPrerenderTest.OnTabActivatedPrerenderInstantURL:SearchTest.InstantCacheableNTPNavigationEntry:SearchTest.InstantCacheableNTPNavigationEntryNewProfile:SearchTest.InstantNTPCustomNavigationEntry:SearchTest.InstantNTPExtendedEnabled:SearchTest.ProcessIsolation:SearchTest.ProcessIsolation_RendererInitiated:SessionCrashedInfoBarDelegateUnitTest.DetachingTabWithCrashedInfoBar:SessionsSyncManagerTest.AssociateWindowsDontReloadTabs:SessionsSyncManagerTest.CheckPrerenderedWebContentsSwap:SessionsSyncManagerTest.MergeLocalSessionExistingTabs:SessionsSyncManagerTest.MergeWithLocalAndForeignTabs:SessionsSyncManagerTest.OnLocalTabModified:SessionsSyncManagerTest.ProcessRemoteDeleteOfLocalSession:SessionsSyncManagerTest.SwappedOutOnRestore:SessionsSyncManagerTest.UpdatesAfterMixedMerge:SiteEngagementServiceTest.NavigationAccumulation:SiteEngagementServiceTest.ScoreIncrementsOnPageRequest:TabMenuModelTest.Basics:TestUsePrerenderPage.DoNotUsePrerenderPage:TestUsePrerenderPage.ExtractSearchTermsAndUsePrerenderPage:TestUsePrerenderPage.SetEmbeddedSearchRequestParams:ToolbarActionsBarRedesignUnitTest.ExtensionActionWantsToRunAppearance:ToolbarActionsBarUnitTest.ExtensionActionNormalAppearance:ToolbarModelTest.GoogleBaseURL:ToolbarModelTest.SearchTermsWhileLoading:ToolbarModelTest.ShouldDisplayURL_QueryExtraction"
         ],
         "swarming": {
           "can_use_on_swarming_builders": true
@@ -499,16 +499,18 @@
         "test": "url_unittests"
       }
     ],
+    "isolated_scripts": [
+      {
+        "isolate_name": "telemetry_gpu_unittests",
+        "name": "telemetry_gpu_unittests"
+      }
+    ],
     "scripts": [
       {
         "name": "telemetry_unittests",
         "script": "telemetry_unittests.py"
       },
       {
-        "name": "telemetry_gpu_unittests",
-        "script": "telemetry_gpu_unittests.py"
-      },
-      {
         "name": "telemetry_perf_unittests",
         "script": "telemetry_perf_unittests.py"
       },
@@ -1249,16 +1251,18 @@
         "test": "wtf_unittests"
       }
     ],
+    "isolated_scripts": [
+      {
+        "isolate_name": "telemetry_gpu_unittests",
+        "name": "telemetry_gpu_unittests"
+      }
+    ],
     "scripts": [
       {
         "name": "telemetry_unittests",
         "script": "telemetry_unittests.py"
       },
       {
-        "name": "telemetry_gpu_unittests",
-        "script": "telemetry_gpu_unittests.py"
-      },
-      {
         "name": "telemetry_perf_unittests",
         "script": "telemetry_perf_unittests.py"
       },
@@ -1455,16 +1459,18 @@
         "test": "wtf_unittests"
       }
     ],
+    "isolated_scripts": [
+      {
+        "isolate_name": "telemetry_gpu_unittests",
+        "name": "telemetry_gpu_unittests"
+      }
+    ],
     "scripts": [
       {
         "name": "telemetry_unittests",
         "script": "telemetry_unittests.py"
       },
       {
-        "name": "telemetry_gpu_unittests",
-        "script": "telemetry_gpu_unittests.py"
-      },
-      {
         "name": "telemetry_perf_unittests",
         "script": "telemetry_perf_unittests.py"
       },
@@ -4518,16 +4524,18 @@
         "test": "wm_unittests"
       }
     ],
+    "isolated_scripts": [
+      {
+        "isolate_name": "telemetry_gpu_unittests",
+        "name": "telemetry_gpu_unittests"
+      }
+    ],
     "scripts": [
       {
         "name": "telemetry_unittests",
         "script": "telemetry_unittests.py"
       },
       {
-        "name": "telemetry_gpu_unittests",
-        "script": "telemetry_gpu_unittests.py"
-      },
-      {
         "name": "telemetry_perf_unittests",
         "script": "telemetry_perf_unittests.py"
       },
@@ -4708,16 +4716,18 @@
         "test": "wm_unittests"
       }
     ],
+    "isolated_scripts": [
+      {
+        "isolate_name": "telemetry_gpu_unittests",
+        "name": "telemetry_gpu_unittests"
+      }
+    ],
     "scripts": [
       {
         "name": "telemetry_unittests",
         "script": "telemetry_unittests.py"
       },
       {
-        "name": "telemetry_gpu_unittests",
-        "script": "telemetry_gpu_unittests.py"
-      },
-      {
         "name": "telemetry_perf_unittests",
         "script": "telemetry_perf_unittests.py"
       },
@@ -5003,16 +5013,18 @@
         "test": "wm_unittests"
       }
     ],
+    "isolated_scripts": [
+      {
+        "isolate_name": "telemetry_gpu_unittests",
+        "name": "telemetry_gpu_unittests"
+      }
+    ],
     "scripts": [
       {
         "name": "telemetry_unittests",
         "script": "telemetry_unittests.py"
       },
       {
-        "name": "telemetry_gpu_unittests",
-        "script": "telemetry_gpu_unittests.py"
-      },
-      {
         "name": "telemetry_perf_unittests",
         "script": "telemetry_perf_unittests.py"
       },
@@ -5181,16 +5193,18 @@
         "test": "wm_unittests"
       }
     ],
+    "isolated_scripts": [
+      {
+        "isolate_name": "telemetry_gpu_unittests",
+        "name": "telemetry_gpu_unittests"
+      }
+    ],
     "scripts": [
       {
         "name": "telemetry_unittests",
         "script": "telemetry_unittests.py"
       },
       {
-        "name": "telemetry_gpu_unittests",
-        "script": "telemetry_gpu_unittests.py"
-      },
-      {
         "name": "telemetry_perf_unittests",
         "script": "telemetry_perf_unittests.py"
       },
diff --git a/testing/buildbot/chromium.linux.json b/testing/buildbot/chromium.linux.json
index 8635c878..2953904 100644
--- a/testing/buildbot/chromium.linux.json
+++ b/testing/buildbot/chromium.linux.json
@@ -9,6 +9,9 @@
     ],
     "gtest_tests": [
       {
+        "test": "blimp_net_tests"
+      },
+      {
         "test": "html_viewer_unittests"
       },
       {
@@ -690,6 +693,12 @@
       },
       {
         "swarming": {
+          "can_use_on_swarming_builders": true
+        },
+        "test": "blimp_net_tests"
+      },
+      {
+        "swarming": {
           "can_use_on_swarming_builders": true,
           "shards": 5
         },
diff --git a/testing/buildbot/chromium.mac.json b/testing/buildbot/chromium.mac.json
index fdb5174..93ae878b 100644
--- a/testing/buildbot/chromium.mac.json
+++ b/testing/buildbot/chromium.mac.json
@@ -307,16 +307,18 @@
         "test": "url_unittests"
       }
     ],
+    "isolated_scripts": [
+      {
+        "isolate_name": "telemetry_gpu_unittests",
+        "name": "telemetry_gpu_unittests"
+      }
+    ],
     "scripts": [
       {
         "name": "telemetry_unittests",
         "script": "telemetry_unittests.py"
       },
       {
-        "name": "telemetry_gpu_unittests",
-        "script": "telemetry_gpu_unittests.py"
-      },
-      {
         "name": "telemetry_perf_unittests",
         "script": "telemetry_perf_unittests.py"
       },
@@ -588,16 +590,18 @@
         "test": "url_unittests"
       }
     ],
+    "isolated_scripts": [
+      {
+        "isolate_name": "telemetry_gpu_unittests",
+        "name": "telemetry_gpu_unittests"
+      }
+    ],
     "scripts": [
       {
         "name": "telemetry_unittests",
         "script": "telemetry_unittests.py"
       },
       {
-        "name": "telemetry_gpu_unittests",
-        "script": "telemetry_gpu_unittests.py"
-      },
-      {
         "name": "telemetry_perf_unittests",
         "script": "telemetry_perf_unittests.py"
       },
@@ -869,16 +873,18 @@
         "test": "url_unittests"
       }
     ],
+    "isolated_scripts": [
+      {
+        "isolate_name": "telemetry_gpu_unittests",
+        "name": "telemetry_gpu_unittests"
+      }
+    ],
     "scripts": [
       {
         "name": "telemetry_unittests",
         "script": "telemetry_unittests.py"
       },
       {
-        "name": "telemetry_gpu_unittests",
-        "script": "telemetry_gpu_unittests.py"
-      },
-      {
         "name": "telemetry_perf_unittests",
         "script": "telemetry_perf_unittests.py"
       },
@@ -1150,16 +1156,18 @@
         "test": "url_unittests"
       }
     ],
+    "isolated_scripts": [
+      {
+        "isolate_name": "telemetry_gpu_unittests",
+        "name": "telemetry_gpu_unittests"
+      }
+    ],
     "scripts": [
       {
         "name": "telemetry_unittests",
         "script": "telemetry_unittests.py"
       },
       {
-        "name": "telemetry_gpu_unittests",
-        "script": "telemetry_gpu_unittests.py"
-      },
-      {
         "name": "telemetry_perf_unittests",
         "script": "telemetry_perf_unittests.py"
       },
@@ -1432,16 +1440,18 @@
         "test": "url_unittests"
       }
     ],
+    "isolated_scripts": [
+      {
+        "isolate_name": "telemetry_gpu_unittests",
+        "name": "telemetry_gpu_unittests"
+      }
+    ],
     "scripts": [
       {
         "name": "telemetry_unittests",
         "script": "telemetry_unittests.py"
       },
       {
-        "name": "telemetry_gpu_unittests",
-        "script": "telemetry_gpu_unittests.py"
-      },
-      {
         "name": "telemetry_perf_unittests",
         "script": "telemetry_perf_unittests.py"
       },
diff --git a/testing/buildbot/chromium.win.json b/testing/buildbot/chromium.win.json
index e75ed1b..68f26e5 100644
--- a/testing/buildbot/chromium.win.json
+++ b/testing/buildbot/chromium.win.json
@@ -680,16 +680,18 @@
         "test": "wm_unittests"
       }
     ],
+    "isolated_scripts": [
+      {
+        "isolate_name": "telemetry_gpu_unittests",
+        "name": "telemetry_gpu_unittests"
+      }
+    ],
     "scripts": [
       {
         "name": "telemetry_unittests",
         "script": "telemetry_unittests.py"
       },
       {
-        "name": "telemetry_gpu_unittests",
-        "script": "telemetry_gpu_unittests.py"
-      },
-      {
         "name": "telemetry_perf_unittests",
         "script": "telemetry_perf_unittests.py"
       },
@@ -1113,16 +1115,18 @@
         "test": "wm_unittests"
       }
     ],
+    "isolated_scripts": [
+      {
+        "isolate_name": "telemetry_gpu_unittests",
+        "name": "telemetry_gpu_unittests"
+      }
+    ],
     "scripts": [
       {
         "name": "telemetry_unittests",
         "script": "telemetry_unittests.py"
       },
       {
-        "name": "telemetry_gpu_unittests",
-        "script": "telemetry_gpu_unittests.py"
-      },
-      {
         "name": "telemetry_perf_unittests",
         "script": "telemetry_perf_unittests.py"
       },
@@ -1451,16 +1455,18 @@
         "test": "wm_unittests"
       }
     ],
+    "isolated_scripts": [
+      {
+        "isolate_name": "telemetry_gpu_unittests",
+        "name": "telemetry_gpu_unittests"
+      }
+    ],
     "scripts": [
       {
         "name": "telemetry_unittests",
         "script": "telemetry_unittests.py"
       },
       {
-        "name": "telemetry_gpu_unittests",
-        "script": "telemetry_gpu_unittests.py"
-      },
-      {
         "name": "telemetry_perf_unittests",
         "script": "telemetry_perf_unittests.py"
       }
@@ -1977,16 +1983,18 @@
         "test": "wm_unittests"
       }
     ],
+    "isolated_scripts": [
+      {
+        "isolate_name": "telemetry_gpu_unittests",
+        "name": "telemetry_gpu_unittests"
+      }
+    ],
     "scripts": [
       {
         "name": "telemetry_unittests",
         "script": "telemetry_unittests.py"
       },
       {
-        "name": "telemetry_gpu_unittests",
-        "script": "telemetry_gpu_unittests.py"
-      },
-      {
         "name": "telemetry_perf_unittests",
         "script": "telemetry_perf_unittests.py"
       },
diff --git a/testing/buildbot/gn_isolate_map.pyl b/testing/buildbot/gn_isolate_map.pyl
index 224e300..f8b9f39 100644
--- a/testing/buildbot/gn_isolate_map.pyl
+++ b/testing/buildbot/gn_isolate_map.pyl
@@ -68,6 +68,10 @@
     "label": "//base:base_unittests",
     "type": "console_test_launcher",
   },
+  "blimp_net_tests": {
+    "label": "//blimp/net:blimp_net_tests",
+    "type": "console_test_launcher",
+  },
   "blink_heap_unittests": {
     "label": "//third_party/WebKit/public:blink_heap_unittests",
     "type": "unknown",
diff --git a/testing/variations/fieldtrial_testing_config_win.json b/testing/variations/fieldtrial_testing_config_win.json
index 23f9f91..68e2fa6 100644
--- a/testing/variations/fieldtrial_testing_config_win.json
+++ b/testing/variations/fieldtrial_testing_config_win.json
@@ -1,4 +1,9 @@
 {
+    "AsyncSetAsDefault": [
+        {
+            "group_name": "Enabled"
+        }
+    ],
     "AutofillClassifier": [
         {
             "group_name": "Enabled"
diff --git a/third_party/WebKit/LayoutTests/TestExpectations b/third_party/WebKit/LayoutTests/TestExpectations
index 4e0f509..12993c58 100644
--- a/third_party/WebKit/LayoutTests/TestExpectations
+++ b/third_party/WebKit/LayoutTests/TestExpectations
@@ -44,6 +44,23 @@
 crbug.com/538697 [ Win7 Debug ] virtual/threaded/printing/webgl-oversized-printing.html [ Crash ]
 crbug.com/538697 [ Win7 Debug ] printing/webgl-oversized-printing.html [ Crash ]
 
+crbug.com/404597 fast/text/basic/015.html [ NeedsRebaseline ]
+crbug.com/404597 fast/text/font-variant-ligatures.html [ NeedsRebaseline ]
+crbug.com/404597 fast/text/font-weight-600.html [ NeedsRebaseline ]
+crbug.com/404597 [ Win Linux Android Lion Mavericks MountainLion Retina SnowLeopard ] fast/text/justify-ideograph-simple.html [ NeedsRebaseline ]
+crbug.com/404597 fast/text/whitespace/002.html [ NeedsRebaseline ]
+crbug.com/404597 fast/text-autosizing/tables/css-table-lots-of-text-many-cells.html [ NeedsRebaseline ]
+crbug.com/404597 fast/text-autosizing/tables/fixed-table-lots-of-text-many-cells.html [ NeedsRebaseline ]
+crbug.com/404597 fast/text-autosizing/tables/lots-of-text-many-cells.html [ NeedsRebaseline ]
+crbug.com/404597 fast/text-autosizing/tables/narrow-percentage-width.html [ NeedsRebaseline ]
+crbug.com/404597 fast/text-autosizing/tables/narrow-specified-width.html [ NeedsRebaseline ]
+
+# Ref-tests that fail due to character based shaping/fallback.
+crbug.com/404597 fast/text/international/inline-plaintext-is-isolated.html [ ImageOnlyFailure ]
+crbug.com/404597 fast/text/international/bdi-dir-default-to-auto.html [ ImageOnlyFailure ]
+
+crbug.com/542643 fast/text/zero-font-size-2.html [ Pass Crash ]
+
 crbug.com/539226 [ Win7 ] http/tests/xmlhttprequest/open-in-body-onload-sync-to-invalid-cross-origin-response-handling.html [ Timeout ]
 crbug.com/539226 [ Win7 ] http/tests/xmlhttprequest/open-in-body-onload-sync-to-invalid-redirect-response-handling.html [ Timeout ]
 crbug.com/539226 [ Win7 ] http/tests/xmlhttprequest/open-in-body-onload-sync-to-invalid-preflight-handling.html [ Timeout ]
@@ -59,11 +76,8 @@
 crbug.com/492664 [ Mac ] imported/csswg-test/css-writing-modes-3/bidi-isolate-002.html [ ImageOnlyFailure ]
 crbug.com/492664 [ Win ] imported/csswg-test/css-writing-modes-3/bidi-override-005.html [ ImageOnlyFailure ]
 crbug.com/492664 [ Win ] imported/csswg-test/css-writing-modes-3/bidi-plaintext-001.html [ ImageOnlyFailure ]
-crbug.com/492664 imported/csswg-test/css-writing-modes-3/text-combine-upright-value-all-001.html [ ImageOnlyFailure ]
-crbug.com/492664 imported/csswg-test/css-writing-modes-3/text-combine-upright-value-all-002.html [ ImageOnlyFailure ]
-crbug.com/492664 imported/csswg-test/css-writing-modes-3/text-combine-upright-value-all-003.html [ ImageOnlyFailure ]
 crbug.com/492664 imported/csswg-test/css-transitions-2/transitioncancel-001.html [ Failure ]
-crbug.com/418091 [ SnowLeopard Debug ] fast/text/aat-morx.html [ Failure ]
+crbug.com/418091 [ SnowLeopard ] fast/text/aat-morx.html [ Failure ]
 crbug.com/463358 [ Mac Linux Debug ] svg/hixie/perf/005.xml [ ImageOnlyFailure ]
 crbug.com/463358 [ Mac Linux Debug ] svg/hixie/perf/006.xml [ ImageOnlyFailure ]
 crbug.com/463358 [ Linux Lion Mavericks MountainLion Retina SnowLeopard Debug ] svg/transforms/text-with-pattern-inside-transformed-html.xhtml [ ImageOnlyFailure ]
@@ -142,6 +156,8 @@
 crbug.com/410974 fast/scroll-behavior/scroll-customization/scrollstate-distribute-to-scroll-chain-descendant.html [ Pass Failure ]
 crbug.com/410974 fast/scroll-behavior/scroll-customization/touch-scroll-customization.html [ Pass Failure ]
 
+crbug.com/537277 fast/inline/vertical-align-with-fallback-fonts.html [ NeedsRebaseline ]
+
 crbug.com/410974 virtual/threaded/fast/scroll-behavior/scroll-customization/scrollstate-basic.html [ Pass Failure ]
 crbug.com/410974 virtual/threaded/fast/scroll-behavior/scroll-customization/scrollstate-consume-deltas.html [ Pass Failure ]
 crbug.com/410974 virtual/threaded/fast/scroll-behavior/scroll-customization/scrollstate-consume-deltas-throw.html [ Pass Failure ]
@@ -234,6 +250,8 @@
 
 crbug.com/461179 virtual/spv2/paint/invalidation/invalidate-when-receiving-paint-layer.html [ ImageOnlyFailure ]
 
+crbug.com/542541 [ Debug ] fast/events/click-count.html [ Pass Failure ]
+
 # TODO(ojan): These tests aren't flaky. See crbug.com/517144.
 # Release trybots run asserts, but the main waterfall ones don't. So, even
 # though this is a non-flaky assert failure, we need to mark it [ Pass Crash ].
@@ -325,6 +343,12 @@
 
 crbug.com/248938 [ Win Debug ] virtual/threaded/animations/transition-and-animation-2.html [ Timeout ]
 
+crbug.com/542763 fast/forms/basic-selects.html [ NeedsRebaseline ]
+crbug.com/542763 fast/forms/checkbox/checkbox-appearance-basic.html [ NeedsRebaseline ]
+crbug.com/542763 fast/forms/color/input-appearance-color.html [ NeedsRebaseline ]
+crbug.com/542763 fast/forms/radio/radio-appearance-basic.html [ NeedsRebaseline ]
+crbug.com/542763 fast/forms/select/menulist-appearance-basic.html [ NeedsRebaseline ]
+
 crbug.com/487281 [ SnowLeopard Lion MountainLion Retina Mavericks ] fast/forms/menulist-narrow-width.html [ ImageOnlyFailure ]
 
 crbug.com/441840 [ Mac XP ] cssom/ahem-ex-units.html [ Failure ]
@@ -430,6 +454,8 @@
 crbug.com/517836 imported/web-platform-tests/screen-orientation/onchange-event-subframe.html [ Failure Timeout ]
 crbug.com/517836 imported/web-platform-tests/screen-orientation/onchange-event.html [ Failure Timeout ]
 
+crbug.com/517840 imported/web-platform-tests/webrtc/rtcpeerconnection/rtcpeerconnection-idl.html [ Failure Timeout ]
+
 # Will work after we have grapheme-cluser based font selection
 crbug.com/454405 inspector-protocol/layout-fonts/unicode-range-combining-chars-fallback.html [ Failure ]
 
@@ -591,6 +617,13 @@
 crbug.com/492664 imported/csswg-test/css-writing-modes-3/clip-rect-vrl-008.xht [ ImageOnlyFailure ]
 crbug.com/492664 imported/csswg-test/css-writing-modes-3/line-box-direction-009.xht [ ImageOnlyFailure ]
 
+# These tests pass but images do not match because tests are stricter than the spec.
+crbug.com/492664 imported/csswg-test/css-writing-modes-3/text-combine-upright-value-all-001.html [ ImageOnlyFailure ]
+crbug.com/492664 imported/csswg-test/css-writing-modes-3/text-combine-upright-value-all-002.html [ ImageOnlyFailure ]
+crbug.com/492664 imported/csswg-test/css-writing-modes-3/text-combine-upright-value-all-003.html [ ImageOnlyFailure ]
+
+crbug.com/543008 [ XP ] imported/csswg-test/css-writing-modes-3/vertical-alignment-vrl-026.xht [ ImageOnlyFailure ]
+
 # These CSS Writing Modes Level 3 tests pass but causes 1px diff on images, notified to the submitter.
 crbug.com/492664 [ Mac ] imported/csswg-test/css-writing-modes-3/block-flow-direction-001.xht [ ImageOnlyFailure ]
 crbug.com/492664 [ Mac ] imported/csswg-test/css-writing-modes-3/block-flow-direction-002.xht [ ImageOnlyFailure ]
@@ -642,7 +675,6 @@
 crbug.com/492664 [ Mac ] imported/csswg-test/css-writing-modes-3/text-baseline-007.xht [ ImageOnlyFailure ]
 crbug.com/539425 [ XP ] imported/csswg-test/css-writing-modes-3/vertical-alignment-vrl-022.xht [ ImageOnlyFailure ]
 crbug.com/539425 [ XP ] imported/csswg-test/css-writing-modes-3/vertical-alignment-vrl-024.xht [ ImageOnlyFailure ]
-crbug.com/492664 imported/csswg-test/css-writing-modes-3/vertical-alignment-vrl-026.xht [ ImageOnlyFailure ]
 
 crbug.com/498845 [ Win ] fast/multicol/vertical-rl/float-content-break.html [ ImageOnlyFailure ]
 
@@ -659,8 +691,6 @@
 
 crbug.com/467635 fast/dom/HTMLImageElement/image-sizes-meta-viewport.html [ Skip ]
 
-crbug.com/517898 [ SnowLeopard Debug ] fast/text/international/bidi-neutral-run.html [ Crash ]
-
 # crbug.com/396823 [ Mac ] fast/multicol/multicol-with-child-renderLayer-for-input.html [ ImageOnlyFailure ]
 
 crbug.com/484370 [ Win Debug ] svg/custom/gradient-userSpaceOnUse-with-percentage.svg [ ImageOnlyFailure ]
@@ -849,9 +879,9 @@
 crbug.com/498021 [ Linux ] fast/forms/month/month-appearance-l10n.html [ ImageOnlyFailure ]
 crbug.com/498021 [ Linux ] fast/text/ellipsis-stroked.html [ ImageOnlyFailure ]
 crbug.com/498021 [ Linux ] fast/text/emphasis-complex.html [ ImageOnlyFailure ]
-crbug.com/498021 [ Linux ] fast/text/international/danda-space.html [ ImageOnlyFailure ]
+crbug.com/498021 [ Linux ] fast/text/international/danda-space.html [ Failure ImageOnlyFailure ]
 crbug.com/498021 [ Linux ] fast/text/international/hindi-whitespace.html [ ImageOnlyFailure ]
-crbug.com/498021 [ Linux ] fast/text/international/thai-line-breaks.html [ ImageOnlyFailure ]
+crbug.com/498021 [ Linux ] fast/text/international/thai-line-breaks.html [ Failure ImageOnlyFailure ]
 crbug.com/498021 [ Linux ] fast/text/selection-multiple-runs.html [ ImageOnlyFailure ]
 crbug.com/498021 [ Linux ] svg/W3C-SVG-1.1/paths-data-03-f.svg [ ImageOnlyFailure ]
 crbug.com/498021 [ Linux ] svg/W3C-SVG-1.1/text-align-08-b.svg [ ImageOnlyFailure ]
@@ -887,15 +917,15 @@
 
 crbug.com/478109 [ SnowLeopard ] fast/text/bidi-embedding-pop-and-push-same-2.html [ Failure ]
 
-crbug.com/521124 [ Win7 Release ] fast/text/international/vertical-text-glyph-test.html [ Pass ImageOnlyFailure ]
-crbug.com/521124 [ Win7 Release ] fast/text/international/text-combine-image-test.html [ Pass ImageOnlyFailure ]
+crbug.com/521124 [ Win7 ] fast/text/international/vertical-text-glyph-test.html [ Pass ImageOnlyFailure ]
+crbug.com/521124 [ Win7 ] fast/text/international/text-combine-image-test.html [ Pass ImageOnlyFailure ]
 crbug.com/521124 [ Win7 Release ] fast/css/font-weight-1.html [ Pass ImageOnlyFailure ]
 crbug.com/521124 [ Win7 Release ] fast/text/justify-ideograph-vertical.html [ Pass ImageOnlyFailure ]
 crbug.com/521124 [ Win7 Release ] fast/writing-mode/english-lr-text.html [ Pass ImageOnlyFailure ]
-crbug.com/521124 [ Win7 Release ] fast/text/orientation-sideways.html [ Pass ImageOnlyFailure ]
+crbug.com/521124 [ Win7 ] fast/text/orientation-sideways.html [ Pass ImageOnlyFailure ]
 
 crbug.com/419769 [ Debug SnowLeopard ] fast/forms/time-multiple-fields/time-multiple-fields-localization.html [ Crash ]
-crbug.com/419769 [ Debug SnowLeopard ] fast/text/unicode-fallback-font.html [ Crash ]
+crbug.com/419769 [ SnowLeopard ] fast/text/unicode-fallback-font.html [ Crash ]
 
 # Re-check these after the re-baseline for crbug.com/512991
 #crbug.com/485332 [ XP ] virtual/gpu/fast/canvas/canvas-bg-zoom.html [ Failure ]
@@ -922,9 +952,9 @@
 crbug.com/474798 virtual/spv2/paint/invalidation/spv2/justify-self-change-keeping-geometry-as-text.html [ Failure ]
 
 # Temporarily disabled after chromium change
-crbug.com/492511 [ Mac ] fast/text/atsui-negative-spacing-features.html [ ImageOnlyFailure ]
-crbug.com/492511 [ Mac ] fast/text/atsui-spacing-features.html [ ImageOnlyFailure ]
-crbug.com/492511 [ Mac ] fast/text/international/arabic-justify.html [ ImageOnlyFailure ]
+crbug.com/492511 [ Mac ] fast/text/atsui-negative-spacing-features.html [ Failure ImageOnlyFailure ]
+crbug.com/492511 [ Mac ] fast/text/atsui-spacing-features.html [ Failure ImageOnlyFailure ]
+crbug.com/492511 [ Mac ] fast/text/international/arabic-justify.html [ Failure ImageOnlyFailure ]
 
 # Ref tests that fail due to differences in inline box structure, even though they contain the same text.
 # This happens because inline box layout uses fixed-point measurements, which can cause rounding differences.
@@ -1110,6 +1140,7 @@
 crbug.com/532469 http/tests/security/cross-frame-access-custom.html [ NeedsManualRebaseline ]
 
 # Win10 specific failures that still need triaging.
+crbug.com/521730 [ Win10 ] fast/text/shaping/same-script-different-lang.html [ ImageOnlyFailure Timeout ]
 crbug.com/521730 [ Win10 ] fast/dom/Window/property-access-on-cached-properties-after-frame-navigated.html [ Failure ]
 crbug.com/521730 [ Win10 ] fast/dom/Window/property-access-on-cached-properties-after-frame-removed-and-gced.html [ Failure ]
 crbug.com/521730 [ Win10 ] fast/dom/Window/property-access-on-cached-properties-after-frame-removed.html [ Failure ]
@@ -1140,31 +1171,31 @@
 crbug.com/521730 [ Win10 ] fast/forms/datetimelocal/datetimelocal-appearance-l10n.html [ ImageOnlyFailure Timeout ImageOnlyFailure Timeout ]
 crbug.com/521730 [ Win10 ] fast/forms/month/month-appearance-basic.html [ ImageOnlyFailure ImageOnlyFailure Timeout ImageOnlyFailure ]
 crbug.com/521730 [ Win10 ] fast/forms/select/popup-menu-appearance-styled.html [ ImageOnlyFailure Timeout ImageOnlyFailure Timeout ]
-crbug.com/521730 [ Win10 ] fast/text-autosizing/hackernews-comments.html [ ImageOnlyFailure ImageOnlyFailure Timeout ImageOnlyFailure ]
-crbug.com/521730 [ Win10 ] fast/text-autosizing/list-item-above-dbcat.html [ ImageOnlyFailure Timeout Timeout Timeout ]
+crbug.com/521730 [ Win10 ] fast/text-autosizing/hackernews-comments.html [ Failure Timeout ImageOnlyFailure ]
+crbug.com/521730 [ Win10 ] fast/text-autosizing/list-item-above-dbcat.html [ Failure Timeout Timeout Timeout ]
 crbug.com/521730 [ Win10 ] fast/text-autosizing/supercluster-multiple-layout.html [ ImageOnlyFailure Timeout ImageOnlyFailure ImageOnlyFailure ]
-crbug.com/521730 [ Win10 ] fast/text-autosizing/tables/fixed-table-single-cell-lots-of-text.html [ ImageOnlyFailure ImageOnlyFailure Timeout ImageOnlyFailure ]
-crbug.com/521730 [ Win10 ] fast/text-autosizing/tables/nested-tables.html [ ImageOnlyFailure Timeout Timeout Timeout ]
-crbug.com/521730 [ Win10 ] fast/text-autosizing/tables/single-percent-width-cell-lots-of-text.html [ ImageOnlyFailure Timeout ImageOnlyFailure ImageOnlyFailure ]
-crbug.com/521730 [ Win10 ] fast/text-autosizing/tables/table-cell-inflation.html [ ImageOnlyFailure Timeout ImageOnlyFailure Timeout ]
-crbug.com/521730 [ Win10 ] fast/text-autosizing/tables/table-for-layout.html [ ImageOnlyFailure ImageOnlyFailure Timeout ImageOnlyFailure ]
-crbug.com/521730 [ Win10 ] fast/text-autosizing/tables/table-with-inline-block.html [ ImageOnlyFailure ImageOnlyFailure Timeout ImageOnlyFailure ]
-crbug.com/521730 [ Win10 ] fast/text-autosizing/tables/wide-percentage-width.html [ ImageOnlyFailure ImageOnlyFailure ImageOnlyFailure Timeout ]
-crbug.com/521730 [ Win10 ] fast/text-autosizing/tables/wide-specified-width.html [ ImageOnlyFailure ImageOnlyFailure ImageOnlyFailure Timeout ]
-crbug.com/521730 [ Win10 ] fast/text/atsui-kerning-and-ligatures.html [ ImageOnlyFailure Timeout Timeout ImageOnlyFailure ]
-crbug.com/521730 [ Win10 ] fast/text/atsui-multiple-renderers.html [ ImageOnlyFailure ImageOnlyFailure ImageOnlyFailure Timeout ]
-crbug.com/521730 [ Win10 ] fast/text/atsui-spacing-features.html [ ImageOnlyFailure Timeout ImageOnlyFailure ImageOnlyFailure ]
+crbug.com/521730 [ Win10 ] fast/text-autosizing/tables/fixed-table-single-cell-lots-of-text.html [ Failure Timeout ImageOnlyFailure ]
+crbug.com/521730 [ Win10 ] fast/text-autosizing/tables/nested-tables.html [ Failure Timeout ]
+crbug.com/521730 [ Win10 ] fast/text-autosizing/tables/single-percent-width-cell-lots-of-text.html [ Failure Timeout ImageOnlyFailure ImageOnlyFailure ]
+crbug.com/521730 [ Win10 ] fast/text-autosizing/tables/table-cell-inflation.html [ Failure Timeout ImageOnlyFailure Timeout ]
+crbug.com/521730 [ Win10 ] fast/text-autosizing/tables/table-for-layout.html [ Failure Timeout ImageOnlyFailure ]
+crbug.com/521730 [ Win10 ] fast/text-autosizing/tables/table-with-inline-block.html [ Failure Timeout ]
+crbug.com/521730 [ Win10 ] fast/text-autosizing/tables/wide-percentage-width.html [ Failure ImageOnlyFailure ImageOnlyFailure Timeout ]
+crbug.com/521730 [ Win10 ] fast/text-autosizing/tables/wide-specified-width.html [ Failure Timeout ]
+crbug.com/521730 [ Win10 ] virtual/threaded/inspector/tracing/timeline-event-dispatch.html [ Failure ]
+crbug.com/521730 [ Win10 ] fast/text/atsui-kerning-and-ligatures.html [ Failure Timeout Timeout ImageOnlyFailure ]
+crbug.com/521730 [ Win10 ] fast/text/atsui-multiple-renderers.html [ Failure Timeout ]
+crbug.com/521730 [ Win10 ] fast/text/atsui-spacing-features.html [ Failure Timeout ImageOnlyFailure ]
 crbug.com/521730 [ Win10 ] fast/text/basic/009.html [ ImageOnlyFailure ImageOnlyFailure Timeout ImageOnlyFailure ]
-crbug.com/521730 [ Win10 ] fast/text/basic/generic-family-changes.html [ ImageOnlyFailure ImageOnlyFailure Timeout ImageOnlyFailure ]
-crbug.com/521730 [ Win10 ] fast/text/capitalize-boundaries.html [ ImageOnlyFailure Timeout ImageOnlyFailure ImageOnlyFailure ]
-crbug.com/521730 [ Win10 ] fast/text/drawBidiText.html [ ImageOnlyFailure ImageOnlyFailure Timeout ImageOnlyFailure ]
-crbug.com/521730 [ Win10 ] fast/text/emoji-web-font.html [ ImageOnlyFailure ImageOnlyFailure Timeout ImageOnlyFailure ]
+crbug.com/521730 [ Win10 ] fast/text/basic/generic-family-changes.html [ Failure Timeout ImageOnlyFailure ]
+crbug.com/521730 [ Win10 ] fast/text/capitalize-boundaries.html [ Failure Timeout ]
+crbug.com/521730 [ Win10 ] fast/text/drawBidiText.html [ Failure Timeout ImageOnlyFailure ]
+crbug.com/521730 [ Win10 ] fast/text/emoji-web-font.html [ Failure Timeout ImageOnlyFailure ]
 crbug.com/521730 [ Win10 ] fast/text/firstline/001.html [ ImageOnlyFailure ImageOnlyFailure Timeout Timeout ]
-crbug.com/521730 [ Win10 ] fast/text/firstline/002.html [ ImageOnlyFailure ImageOnlyFailure Timeout ImageOnlyFailure ]
+crbug.com/521730 [ Win10 ] fast/text/firstline/002.html [ Failure Timeout ImageOnlyFailure ]
 crbug.com/521730 [ Win10 ] fast/text/firstline/003.html [ ImageOnlyFailure ImageOnlyFailure Timeout Timeout ]
-crbug.com/521730 [ Win10 ] fast/text/font-stretch.html [ ImageOnlyFailure ImageOnlyFailure Timeout ImageOnlyFailure ]
-crbug.com/521730 [ Win10 ] fast/text/font-weight-600.html [ ImageOnlyFailure ImageOnlyFailure ImageOnlyFailure Timeout ]
-crbug.com/521730 [ Win10 ] fast/text/format-control.html [ ImageOnlyFailure Timeout Timeout ImageOnlyFailure ]
+crbug.com/521730 [ Win10 ] fast/text/font-stretch.html [ Timeout Failure ]
+crbug.com/521730 [ Win10 ] fast/text/format-control.html [ Failure Timeout ]
 crbug.com/521730 [ Win10 ] fast/text/international/alef-connected.html [ ImageOnlyFailure Timeout ImageOnlyFailure ImageOnlyFailure ]
 crbug.com/521730 [ Win10 ] fast/text/international/bidi-linebreak-001.html [ ImageOnlyFailure ImageOnlyFailure Timeout ImageOnlyFailure ]
 crbug.com/521730 [ Win10 ] fast/text/international/bidi-linebreak-003.html [ ImageOnlyFailure ImageOnlyFailure Timeout ImageOnlyFailure ]
@@ -1172,15 +1203,14 @@
 crbug.com/521730 [ Win10 ] fast/text/international/inline-block-with-mixed-direction-words.html [ ImageOnlyFailure Timeout ImageOnlyFailure ImageOnlyFailure ]
 crbug.com/521730 [ Win10 ] fast/text/international/kana-voiced-sound-marks.html [ ImageOnlyFailure ImageOnlyFailure Timeout ImageOnlyFailure ]
 crbug.com/521730 [ Win10 ] fast/text/international/mixed-directionality-selection.html [ ImageOnlyFailure ImageOnlyFailure Timeout ImageOnlyFailure ]
-crbug.com/521730 [ Win10 ] fast/text/international/plane2.html [ ImageOnlyFailure ImageOnlyFailure Timeout ImageOnlyFailure ]
-crbug.com/521730 [ Win10 ] fast/text/letter-spacing-negative-opacity.html [ ImageOnlyFailure ImageOnlyFailure Timeout ImageOnlyFailure ]
+crbug.com/521730 [ Win10 ] fast/text/international/plane2.html [ Failure ImageOnlyFailure Timeout ImageOnlyFailure ]
+crbug.com/521730 [ Win10 ] fast/text/letter-spacing-negative-opacity.html [ Failure ImageOnlyFailure Timeout ImageOnlyFailure ]
 crbug.com/521730 [ Win10 ] fast/text/line-breaks-after-white-space.html [ ImageOnlyFailure ImageOnlyFailure ImageOnlyFailure Timeout ]
 crbug.com/521730 [ Win10 ] fast/text/line-breaks.html [ ImageOnlyFailure Timeout ImageOnlyFailure ImageOnlyFailure ]
-crbug.com/521730 [ Win10 ] fast/text/shadow-no-blur.html [ ImageOnlyFailure Timeout ImageOnlyFailure ImageOnlyFailure ]
-crbug.com/521730 [ Win10 ] fast/text/shaping/same-script-different-lang.html [ ImageOnlyFailure ImageOnlyFailure Timeout Timeout ]
-crbug.com/521730 [ Win10 ] fast/text/stroking-decorations.html [ ImageOnlyFailure ImageOnlyFailure ImageOnlyFailure Timeout ]
+crbug.com/521730 [ Win10 ] fast/text/shadow-no-blur.html [ Failure Timeout ImageOnlyFailure ImageOnlyFailure ]
+crbug.com/521730 [ Win10 ] fast/text/stroking-decorations.html [ Failure ImageOnlyFailure Timeout ]
 crbug.com/521730 [ Win10 ] fast/text/trailing-white-space-2.html [ ImageOnlyFailure ImageOnlyFailure ImageOnlyFailure Timeout ]
-crbug.com/521730 [ Win10 ] fast/text/whitespace/nbsp-mode-and-linewraps.html [ ImageOnlyFailure ImageOnlyFailure Timeout ImageOnlyFailure ]
+crbug.com/521730 [ Win10 ] fast/text/whitespace/nbsp-mode-and-linewraps.html [ Failure Timeout ImageOnlyFailure ]
 crbug.com/521730 [ Win10 ] fast/writing-mode/table-vertical-child-width.html [ ImageOnlyFailure Timeout ImageOnlyFailure ImageOnlyFailure ]
 crbug.com/521730 [ Win10 ] fast/writing-mode/vertical-font-fallback.html [ ImageOnlyFailure ImageOnlyFailure Timeout Timeout ]
 crbug.com/521730 [ Win10 ] svg/W3C-I18N/text-dirLTR-ubNone.svg [ ImageOnlyFailure ImageOnlyFailure Timeout ImageOnlyFailure ]
@@ -1330,39 +1360,39 @@
 crbug.com/521764 [ Win10 ] fast/ruby/nested-ruby.html [ Failure Timeout ]
 crbug.com/521764 [ Win10 ] fast/text-autosizing/cluster-inline-block-or-table.html [ Pass Timeout ]
 crbug.com/521764 [ Win10 ] fast/text-autosizing/cluster-inline-grid-flex-box.html [ Pass Timeout ]
-crbug.com/521764 [ Win10 ] fast/text-autosizing/display-type-change.html [ ImageOnlyFailure Timeout ]
+crbug.com/521764 [ Win10 ] fast/text-autosizing/display-type-change.html [ Failure Timeout ]
 crbug.com/521764 [ Win10 ] fast/text-autosizing/pseudo-scale-factor.html [ Pass Timeout ]
-crbug.com/521764 [ Win10 ] fast/text-autosizing/tables/css-table-single-cell-lots-of-text.html [ ImageOnlyFailure Timeout ]
-crbug.com/521764 [ Win10 ] fast/text-autosizing/tables/nested-table-wrapping.html [ ImageOnlyFailure Timeout ]
-crbug.com/521764 [ Win10 ] fast/text-autosizing/tables/single-cell-lots-of-text.html [ ImageOnlyFailure Timeout ]
-crbug.com/521764 [ Win10 ] fast/text/atsui-negative-spacing-features.html [ ImageOnlyFailure Timeout ]
-crbug.com/521764 [ Win10 ] fast/text/basic/011.html [ ImageOnlyFailure Timeout ]
-crbug.com/521764 [ Win10 ] fast/text/basic/013.html [ ImageOnlyFailure Timeout ]
-crbug.com/521764 [ Win10 ] fast/text/basic/generic-family-reset.html [ ImageOnlyFailure Timeout ]
+crbug.com/521764 [ Win10 ] fast/text-autosizing/tables/css-table-single-cell-lots-of-text.html [ Failure Timeout ]
+crbug.com/521764 [ Win10 ] fast/text-autosizing/tables/nested-table-wrapping.html [ Failure Timeout ]
+crbug.com/521764 [ Win10 ] fast/text-autosizing/tables/single-cell-lots-of-text.html [ Failure Timeout ]
+crbug.com/521764 [ Win10 ] fast/text/atsui-negative-spacing-features.html [ Failure Timeout ]
+crbug.com/521764 [ Win10 ] fast/text/basic/011.html [ Failure Timeout ]
+crbug.com/521764 [ Win10 ] fast/text/basic/013.html [ Failure Timeout ]
+crbug.com/521764 [ Win10 ] fast/text/basic/generic-family-reset.html [ Failure Timeout ]
 crbug.com/521764 [ Win10 ] fast/text/cg-fallback-bolding.html [ Failure Timeout ]
 crbug.com/521764 [ Win10 ] fast/text/cg-vs-atsui.html [ ImageOnlyFailure Timeout ]
 crbug.com/521764 [ Win10 ] fast/text/decorations-with-text-combine.html [ Failure Timeout ]
 crbug.com/521764 [ Win10 ] fast/text/emoticons.html [ Failure Timeout ]
 crbug.com/521764 [ Win10 ] fast/text/emphasis-ellipsis-complextext.html [ ImageOnlyFailure Timeout ]
 crbug.com/521764 [ Win10 ] fast/text/font-ascent-mac.html [ ImageOnlyFailure Timeout ]
-crbug.com/521764 [ Win10 ] fast/text/font-stretch-variant.html [ ImageOnlyFailure Timeout ]
+crbug.com/521764 [ Win10 ] fast/text/font-stretch-variant.html [ Failure Timeout ]
 crbug.com/521764 [ Win10 ] fast/text/font-weight.html [ Failure Timeout ]
 crbug.com/521764 [ Win10 ] fast/text/international/002.html [ Failure Timeout ]
 crbug.com/521764 [ Win10 ] fast/text/international/bidi-linebreak-002.html [ ImageOnlyFailure Timeout ]
 crbug.com/521764 [ Win10 ] fast/text/international/danda-space.html [ Failure Timeout ]
-crbug.com/521764 [ Win10 ] fast/text/international/hebrew-vowels.html [ ImageOnlyFailure Timeout ]
+crbug.com/521764 [ Win10 ] fast/text/international/hebrew-vowels.html [ Failure Timeout ]
 crbug.com/521764 [ Win10 ] fast/text/international/khmer-selection.html [ Failure Timeout ]
-crbug.com/521764 [ Win10 ] fast/text/international/lang-glyph-cache-separation.html [ ImageOnlyFailure Timeout ]
-crbug.com/521764 [ Win10 ] fast/text/international/pop-up-button-text-alignment-and-direction.html [ ImageOnlyFailure Timeout ]
-crbug.com/521764 [ Win10 ] fast/text/international/rtl-white-space-pre-wrap.html [ ImageOnlyFailure Timeout ]
+crbug.com/521764 [ Win10 ] fast/text/international/lang-glyph-cache-separation.html [ Failure Timeout ]
+crbug.com/521764 [ Win10 ] fast/text/international/pop-up-button-text-alignment-and-direction.html [ Failure Timeout ]
+crbug.com/521764 [ Win10 ] fast/text/international/rtl-white-space-pre-wrap.html [ Failure Timeout ]
 crbug.com/521764 [ Win10 ] fast/text/international/text-spliced-font.html [ Failure Timeout ]
 crbug.com/521764 [ Win10 ] fast/text/international/wrap-CJK-001.html [ Failure Timeout ]
-crbug.com/521764 [ Win10 ] fast/text/midword-break-hang.html [ ImageOnlyFailure Timeout ]
+crbug.com/521764 [ Win10 ] fast/text/midword-break-hang.html [ Failure Timeout ]
 crbug.com/521764 [ Win10 ] fast/text/selection-multiple-runs.html [ Failure Timeout ]
-crbug.com/521764 [ Win10 ] fast/text/stroking.html [ ImageOnlyFailure Timeout ]
-crbug.com/521764 [ Win10 ] fast/text/sub-pixel/text-scaling-pixel.html [ ImageOnlyFailure Timeout ]
+crbug.com/521764 [ Win10 ] fast/text/stroking.html [ Failure Timeout ]
+crbug.com/521764 [ Win10 ] fast/text/sub-pixel/text-scaling-pixel.html [ Failure Timeout ]
 crbug.com/521764 [ Win10 ] fast/text/trailing-white-space.html [ ImageOnlyFailure Timeout ]
-crbug.com/521764 [ Win10 ] fast/text/wide-zero-width-space.html [ ImageOnlyFailure Timeout ]
+crbug.com/521764 [ Win10 ] fast/text/wide-zero-width-space.html [ Failure Timeout ]
 crbug.com/521764 [ Win10 ] fast/tokenizer/001.html [ Pass Timeout ]
 crbug.com/521764 [ Win10 ] fast/writing-mode/fallback-orientation.html [ ImageOnlyFailure Timeout ]
 crbug.com/521764 [ Win10 ] fast/writing-mode/japanese-lr-text.html [ Failure Timeout ]
@@ -1592,4 +1622,35 @@
 crbug.com/521730 [ XP ] svg/batik/text/verticalText.svg [ NeedsRebaseline ]
 crbug.com/541357 [ XP ] svg/batik/text/verticalTextOnPath.svg [ NeedsRebaseline ]
 
+crbug.com/522389 [ Linux Mac Win ] fast/block/float/overhanging-tall-block.html  [ NeedsRebaseline ]
+crbug.com/522389 [ Linux Mac Win ] fast/css/vertical-text-overflow-ellipsis-text-align-center.html  [ NeedsRebaseline ]
+crbug.com/522389 [ Mac Win ] fast/css/vertical-text-overflow-ellipsis-text-align-justify.html  [ NeedsRebaseline ]
+crbug.com/522389 [ Mac Win ] fast/css/vertical-text-overflow-ellipsis-text-align-left.html  [ NeedsRebaseline ]
+crbug.com/522389 [ Mac Win ] fast/css/vertical-text-overflow-ellipsis-text-align-right.html  [ NeedsRebaseline ]
+crbug.com/522389 [ Mac ] fast/forms/HTMLOptionElement_label05.html  [ NeedsRebaseline ]
+crbug.com/522389 [ Mac ] fast/forms/form-element-geometry.html  [ NeedsRebaseline ]
+crbug.com/522389 [ Mac ] fast/forms/listbox-bidi-align.html  [ NeedsRebaseline ]
+crbug.com/522389 [ Mac ] fast/forms/listbox-scrollbar-incremental-load.html  [ NeedsRebaseline ]
+crbug.com/522389 [ Mac ] fast/forms/listbox-width-change.html  [ NeedsRebaseline ]
+crbug.com/522389 [ Mac ] fast/forms/option-strip-whitespace.html  [ NeedsRebaseline ]
+crbug.com/522389 [ Mac ] fast/forms/select-block-background.html  [ NeedsRebaseline ]
+crbug.com/522389 [ Mac ] fast/forms/select-change-popup-to-listbox.html  [ NeedsRebaseline ]
+crbug.com/522389 [ Mac ] fast/forms/select-initial-position.html  [ NeedsRebaseline ]
+crbug.com/522389 [ Mac ] fast/forms/select-listbox-multiple-no-focusring.html  [ NeedsRebaseline ]
+crbug.com/522389 [ Linux Mac Win ] fast/forms/select/listbox-appearance-basic.html  [ NeedsRebaseline ]
+crbug.com/522389 [ Mac ] fast/forms/select/optgroup-rendering.html  [ NeedsRebaseline ]
+crbug.com/522389 [ Linux Mac Win ] fast/overflow/007.html  [ NeedsRebaseline ]
+crbug.com/522389 [ Mac ] fast/replaced/replaced-breaking.html  [ NeedsRebaseline ]
+crbug.com/522389 [ Mac ] fast/spatial-navigation/snav-multiple-select-focusring.html  [ NeedsRebaseline ]
+crbug.com/522389 [ Linux Mac Win ] media/video-zoom-controls.html  [ NeedsRebaseline ]
+crbug.com/522389 [ Linux Mac Win ] media/video-zoom.html  [ NeedsRebaseline ]
+crbug.com/522389 [ Win ] fast/overflow/overflow-rtl.html  [ NeedsRebaseline ]
+crbug.com/522389 [ Win ] fast/forms/text/text-font-height-mismatch.html  [ NeedsRebaseline ]
+crbug.com/522389 [ SnowLeopard Lion MountainLion Retina Mavericks ] fast/forms/hidden-listbox.html [ NeedsRebaseline ]
+crbug.com/522389 [ SnowLeopard Lion MountainLion Retina Mavericks Win ] fast/text/updateNewFont.html [ NeedsRebaseline ]
+crbug.com/522389 [ SnowLeopard Lion MountainLion Retina Mavericks ] fast/text/drawBidiText.html [ NeedsRebaseline ]
+crbug.com/522389 [ Linux Mac Win ] compositing/overflow/nested-render-surfaces-with-rotation.html [ NeedsRebaseline ]
+crbug.com/522389 [ Linux Mac Win ] fast/overflow/overflow-update-transform.html [ NeedsRebaseline ]
+crbug.com/522389 [ Linux Mac Win ] virtual/prefer_compositing_to_lcd_text/compositing/overflow/nested-render-surfaces-with-rotation.html [ NeedsRebaseline ]
+
 crbug.com/541601 svg/overflow/overflow-on-outermost-svg-element-in-xhtml-defaults.xhtml [ ImageOnlyFailure ]
diff --git a/third_party/WebKit/LayoutTests/accessibility/selection-change-notification-input-expected.txt b/third_party/WebKit/LayoutTests/accessibility/selection-change-notification-input-expected.txt
index 3c928cc9..562b7f0 100644
--- a/third_party/WebKit/LayoutTests/accessibility/selection-change-notification-input-expected.txt
+++ b/third_party/WebKit/LayoutTests/accessibility/selection-change-notification-input-expected.txt
@@ -5,6 +5,7 @@
 
 
 Got SelectedTextChanged notification on input element.
+Got DocumentSelectionChanged notification on root element.
 PASS successfullyParsed is true
 
 TEST COMPLETE
diff --git a/third_party/WebKit/LayoutTests/accessibility/selection-change-notification-input.html b/third_party/WebKit/LayoutTests/accessibility/selection-change-notification-input.html
index d37ec0596..c356df6 100644
--- a/third_party/WebKit/LayoutTests/accessibility/selection-change-notification-input.html
+++ b/third_party/WebKit/LayoutTests/accessibility/selection-change-notification-input.html
@@ -17,19 +17,37 @@
     // events only fire on elements that already exist.
     accessibilityController.accessibleElementById('dummy');
 
-    var element = document.getElementById('input');
-    var axElement = accessibilityController.accessibleElementById('input');
-    element.focus();
+    var inputElement = document.getElementById('input');
+    var axRootElement = accessibilityController.rootElement;
+    var axInputElement = accessibilityController.accessibleElementById('input');
+    inputElement.focus();
 
-    axElement.addNotificationListener(function(notification) {
+    var gotDocumentSelectionChanged = false;
+    var gotSelectedTextChanged = false;
+    function succeedIfDone() {
+        if (gotDocumentSelectionChanged && gotSelectedTextChanged)
+            finishJSTest();
+    }
+
+    axRootElement.addNotificationListener(function(notification) {
+        if (notification == 'DocumentSelectionChanged') {
+            debug('Got DocumentSelectionChanged notification on root element.');
+            gotDocumentSelectionChanged = true;
+            axRootElement.removeNotificationListener();
+            succeedIfDone();
+        }
+    });
+        
+    axInputElement.addNotificationListener(function(notification) {
         if (notification == 'SelectedTextChanged') {
             debug('Got SelectedTextChanged notification on input element.');
-            axElement.removeNotificationListener();
-            finishJSTest();
+            gotSelectedTextChanged = true;
+            axInputElement.removeNotificationListener();
+            succeedIfDone();
         }
     });
 
-    element.setSelectionRange(0, 1);
+    inputElement.setSelectionRange(0, 1);
 }
 
 if (window.testRunner && window.accessibilityController) {
diff --git a/third_party/WebKit/LayoutTests/animations/keyword-composition-crash.html b/third_party/WebKit/LayoutTests/animations/keyword-composition-crash.html
new file mode 100644
index 0000000..2611fdb
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/animations/keyword-composition-crash.html
@@ -0,0 +1,10 @@
+<script src="../resources/testharness.js"></script>
+<script src="../resources/testharnessreport.js"></script>
+<div id="target"></div>
+<script>
+test(() => {
+  target.animate({position: 'absolute'}, {fill: 'forwards'});
+  target.animate({position: 'static', composite: 'add'}, {fill: 'forwards'});
+  getComputedStyle(target).position;
+}, "Don't crash when compositing keyword animations.");
+</script>
diff --git a/third_party/WebKit/LayoutTests/fast/css/all-shorthand-first-letter-expected.html b/third_party/WebKit/LayoutTests/fast/css/all-shorthand-first-letter-expected.html
index 3167989..503d507 100644
--- a/third_party/WebKit/LayoutTests/fast/css/all-shorthand-first-letter-expected.html
+++ b/third_party/WebKit/LayoutTests/fast/css/all-shorthand-first-letter-expected.html
@@ -1,6 +1,6 @@
 <!DOCTYPE html>
 <style>
-    #elm { overflow:scroll; max-width:4em; padding-left:3em; opacity:0.6; background:yellow; }
+    #elm { font-family:monospace; overflow:scroll; max-width:4em; padding-left:3em; opacity:0.6; background:yellow; }
 </style>
 <p>Test that an all:inherit declaration in a ::first-letter rule inherits what should be inherited,
     while invalid properties for ::first-letter aren't.</p>
diff --git a/third_party/WebKit/LayoutTests/fast/css/all-shorthand-first-letter.html b/third_party/WebKit/LayoutTests/fast/css/all-shorthand-first-letter.html
index 6e25a09..7247ad6 100644
--- a/third_party/WebKit/LayoutTests/fast/css/all-shorthand-first-letter.html
+++ b/third_party/WebKit/LayoutTests/fast/css/all-shorthand-first-letter.html
@@ -1,7 +1,7 @@
 <!DOCTYPE html>
 <style>
     /* Some invalid properties for ::first-letter */
-    #elm { overflow:scroll; max-width:4em; opacity:0.6; background:yellow; }
+    #elm { font-family:monospace; overflow:scroll; max-width:4em; opacity:0.6; background:yellow; }
 
     /* Some valid properties for ::first-letter */
     #elm { margin-right:10px; padding-left:3em; }
diff --git a/third_party/WebKit/LayoutTests/fast/css/css-properties-position-relative-as-parent-fixed-expected.html b/third_party/WebKit/LayoutTests/fast/css/css-properties-position-relative-as-parent-fixed-expected.html
index 44fac96b..3d97c78 100644
--- a/third_party/WebKit/LayoutTests/fast/css/css-properties-position-relative-as-parent-fixed-expected.html
+++ b/third_party/WebKit/LayoutTests/fast/css/css-properties-position-relative-as-parent-fixed-expected.html
@@ -6,6 +6,10 @@
             margin: 0;
         }
 
+        div {
+            font-family: monospace;
+        }
+
         .container {
             position: relative;
             left: 150px;
diff --git a/third_party/WebKit/LayoutTests/fast/css/css-properties-position-relative-as-parent-fixed.html b/third_party/WebKit/LayoutTests/fast/css/css-properties-position-relative-as-parent-fixed.html
index ae7238a9..28443be 100644
--- a/third_party/WebKit/LayoutTests/fast/css/css-properties-position-relative-as-parent-fixed.html
+++ b/third_party/WebKit/LayoutTests/fast/css/css-properties-position-relative-as-parent-fixed.html
@@ -6,6 +6,10 @@
             margin: 0;
         }
 
+        div {
+            font-family: monospace;
+        }
+
         .container {
             position: relative;
             left: 150px;
diff --git a/third_party/WebKit/LayoutTests/fast/css/invalidation/fullscreen-expected.txt b/third_party/WebKit/LayoutTests/fast/css/invalidation/fullscreen-expected.txt
index 74d38aa..c203db5 100644
--- a/third_party/WebKit/LayoutTests/fast/css/invalidation/fullscreen-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/css/invalidation/fullscreen-expected.txt
@@ -4,7 +4,7 @@
 
 
 PASS getComputedStyle(full).backgroundColor is red
-PASS internals.updateStyleAndReturnAffectedElementCount() is 1
+PASS internals.updateStyleAndReturnAffectedElementCount() is 2
 PASS getComputedStyle(full).backgroundColor is green
 PASS getComputedStyle(ancestor).backgroundColor is red
 PASS internals.updateStyleAndReturnAffectedElementCount() is 1
diff --git a/third_party/WebKit/LayoutTests/fast/css/invalidation/fullscreen.html b/third_party/WebKit/LayoutTests/fast/css/invalidation/fullscreen.html
index c8bb4c89..77f0e2d 100644
--- a/third_party/WebKit/LayoutTests/fast/css/invalidation/fullscreen.html
+++ b/third_party/WebKit/LayoutTests/fast/css/invalidation/fullscreen.html
@@ -34,7 +34,7 @@
     testRoot.offsetTop; // force recalc
     testRoot.className = "t1";
     if (window.internals)
-        shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "1");
+        shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "2");
     shouldBe("getComputedStyle(full).backgroundColor", "green");
 
     shouldBe("getComputedStyle(ancestor).backgroundColor", "red");
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
new file mode 100644
index 0000000..be9286d0
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/dom/shadow/disconnected-distribution-cycle-expected.txt
@@ -0,0 +1,10 @@
+Distributions from disconnected subtrees should be cleared when inserted again to avoid cycles.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS content.getDistributedNodes().length is 0
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/third_party/WebKit/LayoutTests/fast/dom/shadow/disconnected-distribution-cycle.html b/third_party/WebKit/LayoutTests/fast/dom/shadow/disconnected-distribution-cycle.html
new file mode 100644
index 0000000..81b0b3a
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/dom/shadow/disconnected-distribution-cycle.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+
+<script src="../../../resources/js-test.js"></script>
+
+<div id="b"></div>
+
+<script>
+    description("Distributions from disconnected subtrees should be cleared when inserted again to avoid cycles.");
+
+    var a = document.createElement("div");
+    var b = document.getElementById("b");
+
+    // Put "a" it into a disconnected element with a shadow root with an insertion point.
+    var host = document.createElement("div");
+    var content = host.createShadowRoot().appendChild(document.createElement("content"));
+    host.appendChild(a);
+
+    // Cause a distribution of "a" into the disconnected host.
+    a.getDestinationInsertionPoints();
+
+    // Distribute "a" into a host in the page.
+    b.createShadowRoot().appendChild(document.createElement("content"));
+    b.appendChild(a);
+
+    // Cause an attach of all elements in the page.
+    getComputedStyle(document.body).color;
+
+    // Insert the disconnected host as a child of "a".
+    a.appendChild(host);
+
+    // Go through distribution again... CRASH!
+    shouldBe("content.getDistributedNodes().length", "0");
+</script>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/shadow/paint-input-range-crash.html b/third_party/WebKit/LayoutTests/fast/dom/shadow/paint-input-range-crash.html
new file mode 100644
index 0000000..94a99dfec
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/dom/shadow/paint-input-range-crash.html
@@ -0,0 +1,10 @@
+<!DOCTYPE html>
+<script src="../../../resources/testharness.js"></script>
+<script src="../../../resources/testharnessreport.js"></script>
+<input type=range list=foo><datalist id=foo></datalist>
+<script>
+test(function() {
+    var input = document.querySelector('input');
+    input.createShadowRoot().innerHTML = 'a';
+}, "Reproduction case for crbug.com/542614 (createShadowRoot on input with datalist)");
+</script>
diff --git a/third_party/WebKit/LayoutTests/fast/inline/vertical-align-with-fallback-fonts.html b/third_party/WebKit/LayoutTests/fast/inline/vertical-align-with-fallback-fonts.html
new file mode 100644
index 0000000..47fb973
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/inline/vertical-align-with-fallback-fonts.html
@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<style>
+@font-face {
+    font-family:T;
+    src:local('Times New Roman');
+    unicode-range:U+41;
+}
+div {
+    font:50px/1 T, sans-serif;
+}
+.top {
+    font-size:50%;
+    vertical-align:top;
+    border:solid 1px black;
+}
+</style>
+<p>Test pass if all lines have superscripts enclosed in a box.
+<div>A<span class="top">A</span></div>
+<div>A<span class="top">B</span></div>
+<div>A<span class="top">&#x3042;</span></div>
diff --git a/third_party/WebKit/LayoutTests/fast/media/mq-display-mode-expected.txt b/third_party/WebKit/LayoutTests/fast/media/mq-display-mode-expected.txt
index 4098d9b..29a8634 100644
--- a/third_party/WebKit/LayoutTests/fast/media/mq-display-mode-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/media/mq-display-mode-expected.txt
@@ -1,27 +1,39 @@
 Test the (display-mode: ...) media features.
 
 ------------- with 'browser' display mode -------------
-Query "(display-mode)": false
+Query "(display-mode)": true
 Query "(display-mode: browser)": true
 Query "(display-mode: minimal-ui)": false
 Query "(display-mode: standalone)": false
 Query "(display-mode: fullscreen)": false
+Query "(display-mode: fine)": false
+Query "(display-mode: 1)": false
+Query "(display-mode: 3%)": false
 ------------- with 'minimal-ui' display mode -------------
-Query "(display-mode)": false
+Query "(display-mode)": true
 Query "(display-mode: browser)": false
 Query "(display-mode: minimal-ui)": true
 Query "(display-mode: standalone)": false
 Query "(display-mode: fullscreen)": false
+Query "(display-mode: fine)": false
+Query "(display-mode: 1)": false
+Query "(display-mode: 3%)": false
 ------------- with 'standalone' display mode -------------
-Query "(display-mode)": false
+Query "(display-mode)": true
 Query "(display-mode: browser)": false
 Query "(display-mode: minimal-ui)": false
 Query "(display-mode: standalone)": true
 Query "(display-mode: fullscreen)": false
+Query "(display-mode: fine)": false
+Query "(display-mode: 1)": false
+Query "(display-mode: 3%)": false
 ------------- with 'fullscreen' display mode -------------
-Query "(display-mode)": false
+Query "(display-mode)": true
 Query "(display-mode: browser)": false
 Query "(display-mode: minimal-ui)": false
 Query "(display-mode: standalone)": false
 Query "(display-mode: fullscreen)": true
+Query "(display-mode: fine)": false
+Query "(display-mode: 1)": false
+Query "(display-mode: 3%)": false
 
diff --git a/third_party/WebKit/LayoutTests/fast/media/mq-display-mode-fullscreen-expected.txt b/third_party/WebKit/LayoutTests/fast/media/mq-display-mode-fullscreen-expected.txt
index 208dabe2..f3eda26 100644
--- a/third_party/WebKit/LayoutTests/fast/media/mq-display-mode-fullscreen-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/media/mq-display-mode-fullscreen-expected.txt
@@ -1,19 +1,19 @@
 Test the (display-mode: ...) media features while the browser window entering/leaving fullscreen mode.
 
 ------------- before entering fullscreen -------------
-Query "(display-mode)": false
+Query "(display-mode)": true
 Query "(display-mode: browser)": true
 Query "(display-mode: minimal-ui)": false
 Query "(display-mode: standalone)": false
 Query "(display-mode: fullscreen)": false
 ------------- entered fullscreen -------------
-Query "(display-mode)": false
+Query "(display-mode)": true
 Query "(display-mode: browser)": false
 Query "(display-mode: minimal-ui)": false
 Query "(display-mode: standalone)": false
 Query "(display-mode: fullscreen)": true
 ------------- left fullscreen -------------
-Query "(display-mode)": false
+Query "(display-mode)": true
 Query "(display-mode: browser)": true
 Query "(display-mode: minimal-ui)": false
 Query "(display-mode: standalone)": false
diff --git a/third_party/WebKit/LayoutTests/fast/media/mq-display-mode.html b/third_party/WebKit/LayoutTests/fast/media/mq-display-mode.html
index b64d6af..7dd293f7 100644
--- a/third_party/WebKit/LayoutTests/fast/media/mq-display-mode.html
+++ b/third_party/WebKit/LayoutTests/fast/media/mq-display-mode.html
@@ -20,6 +20,9 @@
             "(display-mode: minimal-ui)",
             "(display-mode: standalone)",
             "(display-mode: fullscreen)",
+            "(display-mode: fine)", // Unexpected values.
+            "(display-mode: 1)",
+            "(display-mode: 3%)",
             ];
         for (var index=0; index < queries.length; index++) {
             log("Query &quot;" + queries[index] + "&quot: " +
diff --git a/third_party/WebKit/LayoutTests/fast/text/font-kerning-expected.txt b/third_party/WebKit/LayoutTests/fast/text/font-kerning-expected.txt
index 67297a3..34106041 100644
--- a/third_party/WebKit/LayoutTests/fast/text/font-kerning-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/text/font-kerning-expected.txt
@@ -8,8 +8,8 @@
           LayoutText {#text} at (0,0) size 193x41
             text run at (0,0) width 193: "AVAVAVAV"
         LayoutBlockFlow {DIV} at (0,42) size 784x42
-          LayoutText {#text} at (0,0) size 193x41
-            text run at (0,0) width 193: "AVAVAVAV"
+          LayoutText {#text} at (0,0) size 174x41
+            text run at (0,0) width 174: "AVAVAVAV"
         LayoutBlockFlow {DIV} at (0,84) size 784x42
           LayoutText {#text} at (0,0) size 174x41
             text run at (0,0) width 174: "AVAVAVAV"
diff --git a/third_party/WebKit/LayoutTests/fast/text/font-ligature-letter-spacing-expected.txt b/third_party/WebKit/LayoutTests/fast/text/font-ligature-letter-spacing-expected.txt
index d75f9fe2..6e72572 100644
--- a/third_party/WebKit/LayoutTests/fast/text/font-ligature-letter-spacing-expected.txt
+++ b/third_party/WebKit/LayoutTests/fast/text/font-ligature-letter-spacing-expected.txt
@@ -2,7 +2,7 @@
 CACACACA
 CACACACA
 This is a testharness.js-based test.
-PASS Ligature expected not to be applied due to letter spacing. 
-PASS Ligature expected not to be applied due to letter spacing. 
+FAIL Ligature expected not to be applied due to letter spacing. assert_equals: Ligature not applied due to letter spacing. expected 282.96875 but got 138.359375
+FAIL Ligature expected not to be applied due to letter spacing. assert_equals: Ligature not applied due to letter spacing. expected 282.96875 but got 138.359375
 Harness: the test ran to completion.
 
diff --git a/third_party/WebKit/LayoutTests/fast/text/shaping/same-script-different-lang.html b/third_party/WebKit/LayoutTests/fast/text/shaping/same-script-different-lang.html
index 49203b3..15b41d6 100644
--- a/third_party/WebKit/LayoutTests/fast/text/shaping/same-script-different-lang.html
+++ b/third_party/WebKit/LayoutTests/fast/text/shaping/same-script-different-lang.html
@@ -12,7 +12,8 @@
 </head>
 <body>
     <h3>The glyph for JHA should look different for Nepali and Hindi, depending on the lang attribute.</h3>
-    <p lang="hi" style="font-family: NotoX">Hindi:JHA &#x091D; </p><br>
-    <p lang="ne" style="font-family: NotoX">Nepali:JHA &#x091D; </p><br>
+    <p lang="hi" style="font-family: NotoX">Hindi:JHA &#x091D; </p>
+    <p lang="ne" style="font-family: NotoX">Nepali:JHA &#x091D; </p>
+    <p lang="hi" style="font-family: NotoX">Nepali:JHA <span lang="ne">&#x091D;</span> - "ne" in "hi" should look the same as above.
 </body>
 </html>
diff --git a/third_party/WebKit/LayoutTests/fast/text/soft-hyphen-min-preferred-width-expected.html b/third_party/WebKit/LayoutTests/fast/text/soft-hyphen-min-preferred-width-expected.html
index 634987e..a7ed82d 100644
--- a/third_party/WebKit/LayoutTests/fast/text/soft-hyphen-min-preferred-width-expected.html
+++ b/third_party/WebKit/LayoutTests/fast/text/soft-hyphen-min-preferred-width-expected.html
@@ -2,6 +2,7 @@
     div {
         outline: dashed thin lightblue;
          -webkit-hyphenate-character: "-";
+         font-family: monospace;
     }
 </style>
 <p>
diff --git a/third_party/WebKit/LayoutTests/fast/text/soft-hyphen-min-preferred-width.html b/third_party/WebKit/LayoutTests/fast/text/soft-hyphen-min-preferred-width.html
index e24eced..b78af7f1 100644
--- a/third_party/WebKit/LayoutTests/fast/text/soft-hyphen-min-preferred-width.html
+++ b/third_party/WebKit/LayoutTests/fast/text/soft-hyphen-min-preferred-width.html
@@ -2,6 +2,7 @@
     div {
         outline: dashed thin lightblue;
          -webkit-hyphenate-character: "-";
+         font-family: monospace;
     }
 </style>
 <p>
diff --git a/third_party/WebKit/LayoutTests/fullscreen/enter-exit-full-screen-hover.html b/third_party/WebKit/LayoutTests/fullscreen/enter-exit-full-screen-hover.html
index 1aa60aab..be3e258 100644
--- a/third_party/WebKit/LayoutTests/fullscreen/enter-exit-full-screen-hover.html
+++ b/third_party/WebKit/LayoutTests/fullscreen/enter-exit-full-screen-hover.html
@@ -1,4 +1,11 @@
 <!DOCTYPE html>
+<style>
+/* Offset body by 50px so that buttons clearly change position when they enter/exit fullscreen. */
+body {
+    position: relative;
+    left: 50px;
+}
+</style>
 <script src="../resources/js-test.js"></script>
 <script src="full-screen-test.js"></script>
 <script src="../fast/events/touch/resources/touch-hover-active-tests.js"></script>
@@ -43,7 +50,8 @@
 
 
     // Move mouse over to the "Go fullscreen" button and click
-    eventSender.mouseMoveTo(enterButtonCenter.x, enterButtonCenter.y);
+    // We move by 50px in the x-direction to account for the relative position.
+    eventSender.mouseMoveTo(enterButtonCenter.x + 50, enterButtonCenter.y);
     eventSender.mouseDown();
     eventSender.mouseUp();
 }
diff --git a/third_party/WebKit/LayoutTests/fullscreen/full-screen-iframe-zIndex-expected.html b/third_party/WebKit/LayoutTests/fullscreen/full-screen-iframe-zIndex-expected.html
index 0e76edd6..07a59a1 100644
--- a/third_party/WebKit/LayoutTests/fullscreen/full-screen-iframe-zIndex-expected.html
+++ b/third_party/WebKit/LayoutTests/fullscreen/full-screen-iframe-zIndex-expected.html
@@ -1 +1,2 @@
 <!DOCTYPE html>
+<html style="width: 100%; height: 100%;">
diff --git a/third_party/WebKit/LayoutTests/fullscreen/full-screen-is-in-top-layer-expected.html b/third_party/WebKit/LayoutTests/fullscreen/full-screen-is-in-top-layer-expected.html
new file mode 100644
index 0000000..99abd2c
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fullscreen/full-screen-is-in-top-layer-expected.html
@@ -0,0 +1,9 @@
+<!DOCTYPE html>
+<style>
+body {
+    background-color: green;
+    margin: 0px;
+}
+</style>
+
+<div>Test that fullscreen elements are in the top layer. The test passes if you see a green backdrop behind this box when fullscreen.</div>
diff --git a/third_party/WebKit/LayoutTests/fullscreen/full-screen-is-in-top-layer.html b/third_party/WebKit/LayoutTests/fullscreen/full-screen-is-in-top-layer.html
new file mode 100644
index 0000000..d3f279a
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fullscreen/full-screen-is-in-top-layer.html
@@ -0,0 +1,37 @@
+<!doctype html>
+<style>
+div {
+    top: 100px;
+    bottom: 100px;
+    left: 100px;
+    right: 100px;
+    height: auto;
+    width: auto;
+}
+::backdrop {
+    background: green;
+}
+</style>
+
+<div id='element'>Test that fullscreen elements are in the top layer. The test passes if you see a green backdrop behind this box when fullscreen.</div>
+
+<button id='button'>Go fullscreen</button>
+
+<script>
+var element = document.getElementById('element');
+document.getElementById('button').addEventListener('click', function() {
+    element.webkitRequestFullscreen();
+});
+
+if (window.testRunner) {
+    testRunner.waitUntilDone();
+    document.addEventListener('webkitfullscreenchange', function() {
+        testRunner.notifyDone();
+    });
+
+    var button = document.getElementById('button');
+    eventSender.mouseMoveTo(button.offsetLeft + button.offsetWidth / 2, button.offsetTop + button.offsetHeight / 2);
+    eventSender.mouseDown();
+    eventSender.mouseUp();
+}
+</script>
diff --git a/third_party/WebKit/LayoutTests/fullscreen/full-screen-render-inline-expected.html b/third_party/WebKit/LayoutTests/fullscreen/full-screen-render-inline-expected.html
index 6bbb44a..90371ed 100644
--- a/third_party/WebKit/LayoutTests/fullscreen/full-screen-render-inline-expected.html
+++ b/third_party/WebKit/LayoutTests/fullscreen/full-screen-render-inline-expected.html
@@ -1,3 +1,2 @@
 <!DOCTYPE html>
-<!-- FIXME: the <br> is needed until http://crbug.com/246077 is fixed -->
-<div>a<br><span>b<div>c</div>d</span>e</div>
+<div>a<span>b<div>c</div>d</span>e</div>
diff --git a/third_party/WebKit/LayoutTests/fullscreen/full-screen-stacking-context-expected.html b/third_party/WebKit/LayoutTests/fullscreen/full-screen-stacking-context-expected.html
index 98a5e31..203a33d 100644
--- a/third_party/WebKit/LayoutTests/fullscreen/full-screen-stacking-context-expected.html
+++ b/third_party/WebKit/LayoutTests/fullscreen/full-screen-stacking-context-expected.html
@@ -1,12 +1,20 @@
 <!DOCTYPE html>
-<video></video>
 <script>
-    var runPixelTests = true;
+var runPixelTests = true;
+
+function init() {
+  waitForEventAndEnd(document, 'webkitfullscreenchange');
+  runWithKeyDown(function() {
+    document.getElementById('video').webkitRequestFullScreen();
+  });
+}
 </script>
 <script src="full-screen-test.js"></script>
-<script>
-    document.onwebkitfullscreenchange = endTest;
-    runWithKeyDown(function() {
-        document.querySelector("video").webkitRequestFullScreen();
-    });
-</script>
+<style>
+#video {
+  background-color: black;
+}
+</style>
+<body onload="init()">
+  <video id='video'></video>
+</body>
diff --git a/third_party/WebKit/LayoutTests/fullscreen/full-screen-stacking-context.html b/third_party/WebKit/LayoutTests/fullscreen/full-screen-stacking-context.html
index 34f58dfe..d2523513 100644
--- a/third_party/WebKit/LayoutTests/fullscreen/full-screen-stacking-context.html
+++ b/third_party/WebKit/LayoutTests/fullscreen/full-screen-stacking-context.html
@@ -1,57 +1,52 @@
 <!DOCTYPE html>
-<html>
-    <head>
-        <script>
-            var runPixelTests = true;
-            
-            function init() {
-                waitForEventAndEnd(document, 'webkitfullscreenchange');
-                runWithKeyDown(goFullScreen);
-            }
-            
-            function goFullScreen() {
-                document.getElementById('video').webkitRequestFullScreen();
-            }
-        </script>
-        <script src="full-screen-test.js"></script>
-        <style>
-            #one {
-                width: 100px;
-                height: 100px;
-                position: relative;
-                top: 50px;
-                left: 50px;
-                z-index: 1;
-                background-color: red;
-            }
-            #one, #two {
-                opacity: 0.5;
-                transform: rotate(180);
-                -webkit-mask: -webkit-linear-gradient(left, alpha 0%, white 100%);
-                -webkit-filter: contrast(100%);
-                clip:rect(0px,100px,100px,0px);
-                -webkit-box-reflect: below;
-                -webkit-transform-style: preserve-3d;
-                -webkit-perspective: 300;
-            }
-            #zero {
-                position: relative;
-                z-index: 0;
-            }
-            #video {
-                width: 200px;
-                height: 200px;
-                background-color: black;
-            }
-        </style>
-    </head>
-    <body onload="init()">
-        <div>This tests that a full screen element in a lower stacking context blocks a sibling in a higher stacking context.  
-             After entering full screen mode, only a black box should be visible.
-             Click <button onclick="goFullScreen()">go full screen</button> to run the test.</div>
-        <div id="one"></div>
-        <div id="zero">
-            <video id="video"></video>
-        </div>
-    </body>
-</html>
+<script>
+var runPixelTests = true;
+
+function init() {
+  waitForEventAndEnd(document, 'webkitfullscreenchange');
+  runWithKeyDown(goFullScreen);
+}
+
+function goFullScreen() {
+  document.getElementById('video').webkitRequestFullScreen();
+}
+</script>
+<script src="full-screen-test.js"></script>
+<style>
+#one {
+    width: 100px;
+    height: 100px;
+    position: relative;
+    top: 50px;
+    left: 50px;
+    z-index: 1;
+    background-color: red;
+    opacity: 0.5;
+    transform: rotate(180);
+    -webkit-mask: -webkit-linear-gradient(left, alpha 0%, white 100%);
+    -webkit-filter: contrast(100%);
+    clip:rect(0px,100px,100px,0px);
+    -webkit-box-reflect: below;
+    -webkit-transform-style: preserve-3d;
+    -webkit-perspective: 300;
+}
+#zero {
+    position: relative;
+    z-index: 0;
+}
+#video {
+    width: 200px;
+    height: 200px;
+    background-color: black;
+}
+</style>
+
+<body onload="init()">
+  <div>This tests that a full screen element in a lower stacking context blocks a sibling in a higher stacking context.  
+       After entering full screen mode, only a black box should be visible.
+       Click <button onclick="goFullScreen()">go full screen</button> to run the test.</div>
+  <div id="one"></div>
+  <div id="zero">
+      <video id="video"></video>
+  </div>
+</body>
diff --git a/third_party/WebKit/LayoutTests/fullscreen/full-screen-video-has-backdrop-expected.html b/third_party/WebKit/LayoutTests/fullscreen/full-screen-video-has-backdrop-expected.html
new file mode 100644
index 0000000..3c3110d4
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fullscreen/full-screen-video-has-backdrop-expected.html
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<style>
+body {
+    background-color: green;
+    margin: 0;
+}
+#wrapper {
+  display: flex;
+  justify-content: center;
+}
+</style>
+
+<div id='wrapper'>
+  <object width='100' height='100' type="application/x-shockwave-flash" data="../plugins/resources/simple_blank.swf"></object>
+</div>
diff --git a/third_party/WebKit/LayoutTests/fullscreen/full-screen-video-has-backdrop.html b/third_party/WebKit/LayoutTests/fullscreen/full-screen-video-has-backdrop.html
new file mode 100644
index 0000000..f08958c
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fullscreen/full-screen-video-has-backdrop.html
@@ -0,0 +1,44 @@
+<!doctype html>
+<style>
+#wrapper {
+  display: flex;
+  justify-content: center;
+}
+
+::backdrop {
+    background: green;
+}
+</style>
+
+<script>
+function goFullscreen() {
+  document.getElementById('wrapper').webkitRequestFullscreen();
+}
+</script>
+
+<p>Test that fullscreen object elements get a ::backdrop. You should see a green background when the object element is fullscreen.</p>
+
+<div id='wrapper'>
+  <object type="application/x-shockwave-flash" data="../plugins/resources/simple_blank.swf" width="100" height="100" id='object'></object>
+</div>
+
+<button id='button' onclick='goFullscreen()'>Go fullscreen</button>
+
+<script>
+if (window.testRunner) {
+    testRunner.waitUntilDone();
+    document.addEventListener('webkitfullscreenchange', function() {
+        testRunner.notifyDone();
+    });
+
+    function thunk() {
+        document.removeEventListener("keypress", thunk);
+        goFullscreen();
+    }
+    document.addEventListener("keypress", thunk);
+    if (window.eventSender)
+        eventSender.keyDown(" ", []);
+
+        testRunner.notifyDone();
+}
+</script>
diff --git a/third_party/WebKit/LayoutTests/fullscreen/full-screen-zIndex-expected.html b/third_party/WebKit/LayoutTests/fullscreen/full-screen-zIndex-expected.html
index 37c105b4..2c46ef4 100644
--- a/third_party/WebKit/LayoutTests/fullscreen/full-screen-zIndex-expected.html
+++ b/third_party/WebKit/LayoutTests/fullscreen/full-screen-zIndex-expected.html
@@ -6,15 +6,14 @@
                 background-color: black;
             }
             div {
-                width: 200px;
-                height: 100px;
+                width: 100%;
+                height: 100%;
                 border: 4px solid darkgreen;
                 background-color: green;
                 position: absolute;
-                left: 50%;
-                top: 50%;
-                margin-left: -104px;
-                margin-top: -54px;
+                box-sizing: border-box;
+                top: 0px;
+                left: 0px;
             }
         </style>
     </head>
diff --git a/third_party/WebKit/LayoutTests/fullscreen/parent-flow-inline-with-block-child-expected.html b/third_party/WebKit/LayoutTests/fullscreen/parent-flow-inline-with-block-child-expected.html
index 15618456..4545d28 100644
--- a/third_party/WebKit/LayoutTests/fullscreen/parent-flow-inline-with-block-child-expected.html
+++ b/third_party/WebKit/LayoutTests/fullscreen/parent-flow-inline-with-block-child-expected.html
@@ -1,3 +1,3 @@
 <!DOCTYPE html>
-<div>1</div>
-<div>2</div>
+<span>1</span>
+<span>2</span>
diff --git a/third_party/WebKit/LayoutTests/fullscreen/resources/empty.html b/third_party/WebKit/LayoutTests/fullscreen/resources/empty.html
index c8b7661..ddbee31 100644
--- a/third_party/WebKit/LayoutTests/fullscreen/resources/empty.html
+++ b/third_party/WebKit/LayoutTests/fullscreen/resources/empty.html
@@ -1 +1,7 @@
-<body></body>
+<style>
+html::backdrop {
+  background-color: white;
+}
+</style>
+
+<body style="background-color: white"></body>
diff --git a/third_party/WebKit/LayoutTests/fullscreen/video-webkit-transform-expected.html b/third_party/WebKit/LayoutTests/fullscreen/video-webkit-transform-expected.html
index 01c7633..92dcfe0 100644
--- a/third_party/WebKit/LayoutTests/fullscreen/video-webkit-transform-expected.html
+++ b/third_party/WebKit/LayoutTests/fullscreen/video-webkit-transform-expected.html
@@ -1,4 +1,5 @@
 <!DOCTYPE html>
+<p>Test that fullscreen video should not be affected by webkit-transform.</p>
 <video id="video" allowfullscreen></video>
 <script>
     if (window.internals)
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/inspector-test.js b/third_party/WebKit/LayoutTests/http/tests/inspector/inspector-test.js
index 073beba..707e8b005 100644
--- a/third_party/WebKit/LayoutTests/http/tests/inspector/inspector-test.js
+++ b/third_party/WebKit/LayoutTests/http/tests/inspector/inspector-test.js
@@ -904,7 +904,6 @@
         InspectorTest.powerProfiler = target.powerProfiler;
         InspectorTest.cpuProfilerModel = target.cpuProfilerModel;
         InspectorTest.heapProfilerModel = target.heapProfilerModel;
-        InspectorTest.layerTreeModel = target.layerTreeModel;
         InspectorTest.animationModel = target.animationModel;
         InspectorTest.serviceWorkerCacheModel = target.serviceWorkerCacheModel;
         InspectorTest.serviceWorkerManager = target.serviceWorkerManager;
@@ -1024,6 +1023,7 @@
 
         // 2. Show initial panel based on test path.
         var initialPanelByFolder = {
+            "animation": "elements",
             "audits": "audits",
             "console": "console",
             "elements": "elements",
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/layers-test.js b/third_party/WebKit/LayoutTests/http/tests/inspector/layers-test.js
index 8f5c3fa..8792490 100644
--- a/third_party/WebKit/LayoutTests/http/tests/inspector/layers-test.js
+++ b/third_party/WebKit/LayoutTests/http/tests/inspector/layers-test.js
@@ -1,6 +1,11 @@
 function initialize_LayerTreeTests()
 {
-    InspectorTest.layerTreeModel = WebInspector.targetManager.mainTarget().layerTreeModel;
+    InspectorTest.layerTreeModel = function()
+    {
+        if (!InspectorTest._layerTreeModel)
+            InspectorTest._layerTreeModel = WebInspector.LayerTreeModel.fromTarget(InspectorTest.mainTarget);
+        return InspectorTest._layerTreeModel;
+    }
 
     InspectorTest.labelForLayer = function(layer)
     {
@@ -20,7 +25,7 @@
         if (!prefix)
             prefix = "";
         if (!root) {
-            root = InspectorTest.layerTreeModel.layerTree().contentRoot();
+            root = InspectorTest.layerTreeModel().layerTree().contentRoot();
             if (!root) {
                 InspectorTest.addResult("No layer root, perhaps not in the composited mode! ");
                 InspectorTest.completeTest();
@@ -47,11 +52,11 @@
     {
         function eventHandler()
         {
-            InspectorTest.layerTreeModel.removeEventListener(WebInspector.LayerTreeModel.Events.LayerTreeChanged, eventHandler);
+            InspectorTest.layerTreeModel().removeEventListener(WebInspector.LayerTreeModel.Events.LayerTreeChanged, eventHandler);
             callback();
         }
         InspectorTest.evaluateInPage(expression, function() {
-            InspectorTest.layerTreeModel.addEventListener(WebInspector.LayerTreeModel.Events.LayerTreeChanged, eventHandler);
+            InspectorTest.layerTreeModel().addEventListener(WebInspector.LayerTreeModel.Events.LayerTreeChanged, eventHandler);
         });
     }
 
@@ -68,7 +73,7 @@
             result = layer;
             return true;
         }
-        InspectorTest.layerTreeModel.layerTree().forEachLayer(testLayer);
+        InspectorTest.layerTreeModel().layerTree().forEachLayer(testLayer);
         if (!result)
             InspectorTest.addResult("ERROR: No layer for " + nodeIdAttribute);
         return result;
@@ -76,11 +81,11 @@
 
     InspectorTest.requestLayers = function(callback)
     {
-        InspectorTest.layerTreeModel.addEventListener(WebInspector.LayerTreeModel.Events.LayerTreeChanged, onLayerTreeChanged);
-        InspectorTest.layerTreeModel.enable();
+        InspectorTest.layerTreeModel().addEventListener(WebInspector.LayerTreeModel.Events.LayerTreeChanged, onLayerTreeChanged);
+        InspectorTest.layerTreeModel().enable();
         function onLayerTreeChanged()
         {
-            InspectorTest.layerTreeModel.removeEventListener(WebInspector.LayerTreeModel.Events.LayerTreeChanged, onLayerTreeChanged);
+            InspectorTest.layerTreeModel().removeEventListener(WebInspector.LayerTreeModel.Events.LayerTreeChanged, onLayerTreeChanged);
             callback();
         }
     }
@@ -94,7 +99,7 @@
         }
 
         InspectorTest.addResult("Model elements dump");
-        InspectorTest.layerTreeModel.layerTree().forEachLayer(dumpScrollRectsForLayer.bind(this));
+        InspectorTest.layerTreeModel().layerTree().forEachLayer(dumpScrollRectsForLayer.bind(this));
     }
 
     InspectorTest.dispatchMouseEvent = function(eventType, button, element, offsetX, offsetY)
diff --git a/third_party/WebKit/LayoutTests/http/tests/serviceworker/iso-latin1-header.html b/third_party/WebKit/LayoutTests/http/tests/serviceworker/iso-latin1-header.html
new file mode 100644
index 0000000..e56e68c
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/http/tests/serviceworker/iso-latin1-header.html
@@ -0,0 +1,31 @@
+<!DOCTYPE html>
+<title>Service Worker: respondWith with header value containing a non ascii string</title>
+<script src="../resources/testharness.js"></script>
+<script src="../resources/testharnessreport.js"></script>
+<script src="../resources/get-host-info.js"></script>
+<script src="resources/test-helpers.js?pipe=sub"></script>
+<script>
+async_test(function(t) {
+    var SCOPE = 'resources/iso-latin1-header-iframe.html';
+    var SCRIPT = 'resources/iso-latin1-header-worker.js';
+    var host_info = get_host_info();
+    service_worker_unregister_and_register(t, SCRIPT, SCOPE)
+      .then(function(registration) {
+          return wait_for_state(t, registration.installing, 'activated');
+        })
+      .then(function() { return with_iframe(SCOPE); })
+      .then(function(frame) {
+          var channel = new MessageChannel();
+          channel.port1.onmessage = t.step_func(function(e) {
+              assert_equals(e.data.results, 'finish');
+              frame.remove();
+              service_worker_unregister_and_done(t, SCOPE);
+            });
+          frame.contentWindow.postMessage({},
+                                          host_info['HTTP_ORIGIN'],
+                                          [channel.port2]);
+        })
+      .catch(unreached_rejection(t));
+  }, 'Verify the response of FetchEvent using XMLHttpRequest');
+
+</script>
diff --git a/third_party/WebKit/LayoutTests/http/tests/serviceworker/resources/iso-latin1-header-iframe.html b/third_party/WebKit/LayoutTests/http/tests/serviceworker/resources/iso-latin1-header-iframe.html
new file mode 100644
index 0000000..56f26c4
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/http/tests/serviceworker/resources/iso-latin1-header-iframe.html
@@ -0,0 +1,27 @@
+<script src="../../resources/testharness.js"></script>
+<script src="test-helpers.js?pipe=sub"></script>
+<script>
+
+function xhr_send(method, data) {
+  return new Promise(function(resolve, reject) {
+      var xhr = new XMLHttpRequest();
+      xhr.onload = function() {
+        resolve();
+      };
+      xhr.onerror = function() {
+        reject('XHR must fail.');
+      };
+      xhr.responseType = 'text';
+      xhr.open(method, './dummy?test', true);
+      xhr.send(data);
+    });
+}
+
+
+window.addEventListener('message', function(evt) {
+    var port = evt.ports[0];
+    xhr_send('POST', 'test string')
+      .then(function() { port.postMessage({results: 'finish'}); })
+      .catch(function(e) { port.postMessage({results: 'failure:' + e}); });
+  });
+</script>
diff --git a/third_party/WebKit/LayoutTests/http/tests/serviceworker/resources/iso-latin1-header-worker.js b/third_party/WebKit/LayoutTests/http/tests/serviceworker/resources/iso-latin1-header-worker.js
new file mode 100644
index 0000000..3ab5c7e
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/http/tests/serviceworker/resources/iso-latin1-header-worker.js
@@ -0,0 +1,12 @@
+self.addEventListener('fetch', function(event) {
+    var url = event.request.url;
+    if (url.indexOf('dummy?test') == -1) {
+      return;
+    }
+
+    event.respondWith(new Promise(function(resolve) {
+        var headers = new Headers;
+        headers.append('TEST', 'ßÀ¿'); // header value holds the Latin1 (ISO8859-1) string.
+        resolve(new Response('hello world', {'headers': headers}));
+      }));
+  });
diff --git a/third_party/WebKit/LayoutTests/http/tests/serviceworker/resources/windowclient-navigate-worker.js b/third_party/WebKit/LayoutTests/http/tests/serviceworker/resources/windowclient-navigate-worker.js
new file mode 100644
index 0000000..b155d62
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/http/tests/serviceworker/resources/windowclient-navigate-worker.js
@@ -0,0 +1,26 @@
+var port = null;
+
+self.onmessage = function(e) {
+  port = e.data.port;
+  port.onmessage = on_message;
+  port.postMessage('ready');
+};
+
+function on_message(e) {
+  var url = e.data;
+  var client;
+
+  self.clients.matchAll({ includeUncontrolled : true }).then(function(cs) {
+        cs.forEach(function(c) { c.frameType == 'nested' && (client = c); });
+        return client.navigate(url);
+      })
+    .then(function(c) {
+        if (!c)
+          port.postMessage(c);
+        else
+          port.postMessage(c.url);
+      })
+    .catch(function(e) {
+        port.postMessage(e.name);
+      });
+}
diff --git a/third_party/WebKit/LayoutTests/http/tests/serviceworker/windowclient-navigate.html b/third_party/WebKit/LayoutTests/http/tests/serviceworker/windowclient-navigate.html
new file mode 100644
index 0000000..ba7e3fb3
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/http/tests/serviceworker/windowclient-navigate.html
@@ -0,0 +1,79 @@
+<!DOCTYPE html>
+<title>Service Worker: WindowClient.navigate() tests</title>
+<script src="../resources/testharness.js"></script>
+<script src="../resources/testharnessreport.js"></script>
+<script src="../resources/get-host-info.js"></script>
+<script src="resources/test-helpers.js"></script>
+<script>
+
+var scope = 'resources/blank.html?windowclient-navigate';
+var client_frame;
+var worker;
+var test;
+
+var current_index = 0;
+var test_list = [
+  { url : 'blank.html' },
+  { url : 'blank.html', init : 'uncontrolled/blank.html' },
+  { url : get_host_info()['HTTP_REMOTE_ORIGIN'] +
+      '/serviceworker/resources/blank.html' },
+  { url : 'http://[example].com' },
+  { url : 'view-source://example.com' },
+  { url : 'file:///' },
+  { url : 'about:blank' },
+  { url : 'about:crash' }
+];
+
+var expected = [
+  location.origin + '/serviceworker/resources/blank.html',
+  // TODO(zino): Should TypeError instead of UnknownError.
+  // Please see: http://crbug.com/540503
+  'UnknownError',
+  null,
+  'TypeError',
+  // TODO(zino): Should TypeError instead of UnknownError.
+  // Please see: http://crbug.com/540503
+  'UnknownError',
+  'SecurityError',
+  'TypeError',
+  'TypeError'
+];
+
+var actual = [];
+
+async_test(function(t) {
+  test = t;
+  return service_worker_unregister_and_register(
+      test, 'resources/windowclient-navigate-worker.js', scope)
+    .then(function(registration) {
+        worker = registration.installing;
+        return wait_for_state(test, worker, 'activated');
+      })
+    .then(function() {
+        var channel = new MessageChannel();
+        channel.port1.onmessage = test.step_func(function(e) {
+            on_message(e, channel.port1);
+          });
+        worker.postMessage({ port : channel.port2 }, [channel.port2]);
+      })
+    .catch(unreached_rejection(t));
+}, 'WindowClient.navigate() test');
+
+function on_message(e, port) {
+  var message = e.data;
+
+  message == 'ready' || actual.push(message);
+  if (expected.length == actual.length) {
+    assert_array_equals(actual, expected);
+    service_worker_unregister_and_done(test, scope);
+  } else {
+    client_frame && client_frame.remove();
+    var init_url = test_list[current_index].init || scope;
+    with_iframe(init_url).then(function(f) {
+        client_frame = f;
+        port.postMessage(test_list[current_index++].url);
+      });
+  }
+}
+
+</script>
diff --git a/third_party/WebKit/LayoutTests/imported/csswg-test/css-writing-modes-3/unicode-bidi-parsing-001.html b/third_party/WebKit/LayoutTests/imported/csswg-test/css-writing-modes-3/unicode-bidi-parsing-001.html
new file mode 100644
index 0000000..a0871d3
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/imported/csswg-test/css-writing-modes-3/unicode-bidi-parsing-001.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<title>CSS Writing Modes: parsing unicode-bidi: normal, embed, bidi-override</title>
+<link rel="author" title="Koji Ishii" href="kojiishi@gmail.com">
+<link rel="help" href="https://drafts.csswg.org/css2/visuren.html#direction">
+<link rel="help" href="https://drafts.csswg.org/css-writing-modes-3/#unicode-bidi">
+<meta name="assert" content="This test asserts the parser and getComputedStyle works correctly for the unicode-bidi: normal, embed, bidi-override.">
+<meta name="flags" content="dom">
+<script src="../../../resources/testharness.js"></script>
+<script src="../../../resources/testharnessreport.js"></script>
+
+<div title="Initial value of unicode-bidi"
+  data-expected="normal"></div>
+
+<div style="unicode-bidi: embed; unicode-bidi: normal"
+  data-expected="normal"></div>
+<div style="unicode-bidi: embed"
+  data-expected="embed"></div>
+<div style="unicode-bidi: bidi-override"
+  data-expected="bidi-override"></div>
+
+<div style="unicode-bidi: embed">
+  <div title="unicode-bidi should not inherit"
+    data-expected="normal"></div>
+</div>
+
+<script>
+Array.prototype.forEach.call(document.querySelectorAll("[data-expected]"), function (element) {
+  test(function () {
+    var actual = getComputedStyle(element).unicodeBidi;
+    assert_equals(actual, element.dataset.expected);
+  }, element.title || element.getAttribute("style"));
+});
+</script>
diff --git a/third_party/WebKit/LayoutTests/imported/csswg-test/css-writing-modes-3/vertical-alignment-vrl-022-expected.xht b/third_party/WebKit/LayoutTests/imported/csswg-test/css-writing-modes-3/vertical-alignment-vrl-022-expected.xht
index 0ad842f..0614377 100644
--- a/third_party/WebKit/LayoutTests/imported/csswg-test/css-writing-modes-3/vertical-alignment-vrl-022-expected.xht
+++ b/third_party/WebKit/LayoutTests/imported/csswg-test/css-writing-modes-3/vertical-alignment-vrl-022-expected.xht
@@ -7,12 +7,12 @@
   <style type="text/css"><![CDATA[
     img
     {
-      padding-left: 60px;
+      padding-left: 100px;
       vertical-align: top;
     }
     img + br + img
     {
-      padding-left: 108px; /* 60 px (padding-left) + 48 px (the position of small blue box)*/
+      padding-left: 180px; /* 100 px (padding-left) + 80 px (the position of small blue box)*/
     }
   ]]></style>
 
@@ -23,7 +23,7 @@
 <p>Test passes if the <strong>right edge</strong> of an irregular polygon is straight and unbroken.</p>
 
 <div>
-  <img class="blue" src="support/swatch-blue.png" width="60" height="60" alt="Image download support must be enabled" /><br/><img class="blue" src="support/swatch-blue.png" width="12" height="12" alt="Image download support must be enabled" />
+  <img class="blue" src="support/swatch-blue.png" width="100" height="100" alt="Image download support must be enabled" /><br/><img class="blue" src="support/swatch-blue.png" width="20" height="20" alt="Image download support must be enabled" />
 </div>
 
 </body>
diff --git a/third_party/WebKit/LayoutTests/imported/csswg-test/css-writing-modes-3/vertical-alignment-vrl-022.xht b/third_party/WebKit/LayoutTests/imported/csswg-test/css-writing-modes-3/vertical-alignment-vrl-022.xht
index 663080d4..209625b 100644
--- a/third_party/WebKit/LayoutTests/imported/csswg-test/css-writing-modes-3/vertical-alignment-vrl-022.xht
+++ b/third_party/WebKit/LayoutTests/imported/csswg-test/css-writing-modes-3/vertical-alignment-vrl-022.xht
@@ -12,7 +12,7 @@
     div#rl-upright
     {
       writing-mode: vertical-rl;
-      font: 60px/3 Ahem; /* computes to 60px/180px */
+      font: 100px/3 Ahem; /* computes to 100px/300px */
       color: blue;
       text-orientation: upright;
     }
diff --git a/third_party/WebKit/LayoutTests/imported/csswg-test/css-writing-modes-3/vertical-alignment-vrl-024-expected.xht b/third_party/WebKit/LayoutTests/imported/csswg-test/css-writing-modes-3/vertical-alignment-vrl-024-expected.xht
index 0ad842f..0614377 100644
--- a/third_party/WebKit/LayoutTests/imported/csswg-test/css-writing-modes-3/vertical-alignment-vrl-024-expected.xht
+++ b/third_party/WebKit/LayoutTests/imported/csswg-test/css-writing-modes-3/vertical-alignment-vrl-024-expected.xht
@@ -7,12 +7,12 @@
   <style type="text/css"><![CDATA[
     img
     {
-      padding-left: 60px;
+      padding-left: 100px;
       vertical-align: top;
     }
     img + br + img
     {
-      padding-left: 108px; /* 60 px (padding-left) + 48 px (the position of small blue box)*/
+      padding-left: 180px; /* 100 px (padding-left) + 80 px (the position of small blue box)*/
     }
   ]]></style>
 
@@ -23,7 +23,7 @@
 <p>Test passes if the <strong>right edge</strong> of an irregular polygon is straight and unbroken.</p>
 
 <div>
-  <img class="blue" src="support/swatch-blue.png" width="60" height="60" alt="Image download support must be enabled" /><br/><img class="blue" src="support/swatch-blue.png" width="12" height="12" alt="Image download support must be enabled" />
+  <img class="blue" src="support/swatch-blue.png" width="100" height="100" alt="Image download support must be enabled" /><br/><img class="blue" src="support/swatch-blue.png" width="20" height="20" alt="Image download support must be enabled" />
 </div>
 
 </body>
diff --git a/third_party/WebKit/LayoutTests/imported/csswg-test/css-writing-modes-3/vertical-alignment-vrl-024.xht b/third_party/WebKit/LayoutTests/imported/csswg-test/css-writing-modes-3/vertical-alignment-vrl-024.xht
index 837bf709..e89abb8 100644
--- a/third_party/WebKit/LayoutTests/imported/csswg-test/css-writing-modes-3/vertical-alignment-vrl-024.xht
+++ b/third_party/WebKit/LayoutTests/imported/csswg-test/css-writing-modes-3/vertical-alignment-vrl-024.xht
@@ -12,7 +12,7 @@
     div#rl-mixed
     {
       writing-mode: vertical-rl;
-      font: 60px/3 Ahem; /* computes to 60px/180px */
+      font: 100px/3 Ahem; /* computes to 100px/300px */
       color: blue;
       text-orientation: mixed;
     }
diff --git a/third_party/WebKit/LayoutTests/imported/csswg-test/css-writing-modes-3/vertical-alignment-vrl-026-expected.xht b/third_party/WebKit/LayoutTests/imported/csswg-test/css-writing-modes-3/vertical-alignment-vrl-026-expected.xht
index 25186de..448be28b 100644
--- a/third_party/WebKit/LayoutTests/imported/csswg-test/css-writing-modes-3/vertical-alignment-vrl-026-expected.xht
+++ b/third_party/WebKit/LayoutTests/imported/csswg-test/css-writing-modes-3/vertical-alignment-vrl-026-expected.xht
@@ -7,12 +7,12 @@
   <style type="text/css"><![CDATA[
     img
     {
-      padding-left: 60px;
+      padding-left: 100px;
       vertical-align: top;
     }
     img + br + img
     {
-      padding-left: 72px; /* 60 px (padding-left) + 12 px (the position of small blue box)*/
+      padding-left: 120px; /* 60 px (padding-left) + 12 px (the position of small blue box)*/
     }
   ]]></style>
 
@@ -23,7 +23,7 @@
 <p>Test passes if the <strong>right edge</strong> of an irregular polygon is straight and unbroken.</p>
 
 <div>
-  <img class="blue" src="support/swatch-blue.png" width="60" height="60" alt="Image download support must be enabled" /><br/><img class="blue" src="support/swatch-blue.png" width="48" height="48" alt="Image download support must be enabled" />
+  <img class="blue" src="support/swatch-blue.png" width="100" height="100" alt="Image download support must be enabled" /><br/><img class="blue" src="support/swatch-blue.png" width="80" height="80" alt="Image download support must be enabled" />
 </div>
 
 </body>
diff --git a/third_party/WebKit/LayoutTests/imported/csswg-test/css-writing-modes-3/vertical-alignment-vrl-026.xht b/third_party/WebKit/LayoutTests/imported/csswg-test/css-writing-modes-3/vertical-alignment-vrl-026.xht
index 43717ec..963e2074 100644
--- a/third_party/WebKit/LayoutTests/imported/csswg-test/css-writing-modes-3/vertical-alignment-vrl-026.xht
+++ b/third_party/WebKit/LayoutTests/imported/csswg-test/css-writing-modes-3/vertical-alignment-vrl-026.xht
@@ -12,7 +12,7 @@
     div#rl-sideways
     {
       writing-mode: vertical-rl;
-      font: 60px/3 Ahem; /* computes to 60px/180px */
+      font: 100px/3 Ahem; /* computes to 100px/300px */
       color: blue;
       text-orientation: sideways;
     }
diff --git a/third_party/WebKit/LayoutTests/imported/web-platform-tests/html/dom/documents/dom-tree-accessors/document.getElementsByName/document.getElementsByName-newelements.html b/third_party/WebKit/LayoutTests/imported/web-platform-tests/html/dom/documents/dom-tree-accessors/document.getElementsByName/document.getElementsByName-newelements.html
index a316bd0..42f7b0bd 100644
--- a/third_party/WebKit/LayoutTests/imported/web-platform-tests/html/dom/documents/dom-tree-accessors/document.getElementsByName/document.getElementsByName-newelements.html
+++ b/third_party/WebKit/LayoutTests/imported/web-platform-tests/html/dom/documents/dom-tree-accessors/document.getElementsByName/document.getElementsByName-newelements.html
@@ -36,87 +36,13 @@
 <source name="source">
 </div>
 <script>
-test(function() {
-  assert_equals(document.getElementsByName("section").length, 1);
-  assert_equals(document.getElementsByName("section")[0],
-                document.getElementsByTagName("section")[0]);
-  assert_equals(document.getElementsByName("article").length, 1);
-  assert_equals(document.getElementsByName("article")[0],
-                document.getElementsByTagName("article")[0]);
-  assert_equals(document.getElementsByName("aside").length, 1);
-  assert_equals(document.getElementsByName("aside")[0],
-                document.getElementsByTagName("aside")[0]);
-  assert_equals(document.getElementsByName("hgroup").length, 1);
-  assert_equals(document.getElementsByName("hgroup")[0],
-                document.getElementsByTagName("hgroup")[0]);
-  assert_equals(document.getElementsByName("header").length, 1);
-  assert_equals(document.getElementsByName("header")[0],
-                document.getElementsByTagName("header")[0]);
-  assert_equals(document.getElementsByName("footer").length, 1);
-  assert_equals(document.getElementsByName("footer")[0],
-                document.getElementsByTagName("footer")[0]);
-  assert_equals(document.getElementsByName("nav").length, 1);
-  assert_equals(document.getElementsByName("nav")[0],
-                document.getElementsByTagName("nav")[0]);
-  assert_equals(document.getElementsByName("dialog").length, 1);
-  assert_equals(document.getElementsByName("dialog")[0],
-                document.getElementsByTagName("dialog")[0]);
-  assert_equals(document.getElementsByName("figure").length, 1);
-  assert_equals(document.getElementsByName("figure")[0],
-                document.getElementsByTagName("figure")[0]);
-  assert_equals(document.getElementsByName("audio").length, 1);
-  assert_equals(document.getElementsByName("audio")[0],
-                document.getElementsByTagName("audio")[0]);
-  assert_equals(document.getElementsByName("video").length, 1);
-  assert_equals(document.getElementsByName("video")[0],
-                document.getElementsByTagName("video")[0]);
-  assert_equals(document.getElementsByName("embed").length, 1);
-  assert_equals(document.getElementsByName("embed")[0],
-                document.getElementsByTagName("embed")[0]);
-  assert_equals(document.getElementsByName("mark").length, 1);
-  assert_equals(document.getElementsByName("mark")[0],
-                document.getElementsByTagName("mark")[0]);
-  assert_equals(document.getElementsByName("meter").length, 1);
-  assert_equals(document.getElementsByName("meter")[0],
-                document.getElementsByTagName("meter")[0]);
-  assert_equals(document.getElementsByName("progress").length, 1);
-  assert_equals(document.getElementsByName("progress")[0],
-                document.getElementsByTagName("progress")[0]);
-  assert_equals(document.getElementsByName("time").length, 1);
-  assert_equals(document.getElementsByName("time")[0],
-                document.getElementsByTagName("time")[0]);
-  assert_equals(document.getElementsByName("canvas").length, 1);
-  assert_equals(document.getElementsByName("canvas")[0],
-                document.getElementsByTagName("canvas")[0]);
-  assert_equals(document.getElementsByName("command").length, 1);
-  assert_equals(document.getElementsByName("command")[0],
-                document.getElementsByTagName("command")[0]);
-  assert_equals(document.getElementsByName("menu").length, 1);
-  assert_equals(document.getElementsByName("menu")[0],
-                document.getElementsByTagName("menu")[0]);
-  assert_equals(document.getElementsByName("details").length, 1);
-  assert_equals(document.getElementsByName("details")[0],
-                document.getElementsByTagName("details")[0]);
-  assert_equals(document.getElementsByName("datalist").length, 1);
-  assert_equals(document.getElementsByName("datalist")[0],
-                document.getElementsByTagName("datalist")[0]);
-  assert_equals(document.getElementsByName("keygen").length, 1);
-  assert_equals(document.getElementsByName("keygen")[0],
-                document.getElementsByTagName("keygen")[0]);
-  assert_equals(document.getElementsByName("output").length, 1);
-  assert_equals(document.getElementsByName("output")[0],
-                document.getElementsByTagName("output")[0]);
-  assert_equals(document.getElementsByName("ruby").length, 1);
-  assert_equals(document.getElementsByName("ruby")[0],
-                document.getElementsByTagName("ruby")[0]);
-  assert_equals(document.getElementsByName("rt").length, 1);
-  assert_equals(document.getElementsByName("rt")[0],
-                document.getElementsByTagName("rt")[0]);
-  assert_equals(document.getElementsByName("rp").length, 1);
-  assert_equals(document.getElementsByName("rp")[0],
-                document.getElementsByTagName("rp")[0]);
-  assert_equals(document.getElementsByName("source").length, 1);
-  assert_equals(document.getElementsByName("source")[0],
-                document.getElementsByTagName("source")[0]);
-});
+var testDiv = document.getElementById("test");
+for (var i = 0; i < testDiv.children.length; i++) {
+  var name = testDiv.children[i].getAttribute("name");
+  test(function() {
+    assert_equals(document.getElementsByName(name).length, 1);
+    assert_equals(document.getElementsByName(name)[0],
+                  document.getElementsByTagName(name)[0]);
+  }, 'getElementsByName("' + name + '")');
+}
 </script>
diff --git a/third_party/WebKit/LayoutTests/imported/web-platform-tests/html/dom/documents/dom-tree-accessors/document.title-03.html b/third_party/WebKit/LayoutTests/imported/web-platform-tests/html/dom/documents/dom-tree-accessors/document.title-03.html
index e9156b75..a3c32b3f 100644
--- a/third_party/WebKit/LayoutTests/imported/web-platform-tests/html/dom/documents/dom-tree-accessors/document.title-03.html
+++ b/third_party/WebKit/LayoutTests/imported/web-platform-tests/html/dom/documents/dom-tree-accessors/document.title-03.html
@@ -7,38 +7,26 @@
 <script src="../../../../../../resources/testharnessreport.js"></script>
 <div id="log"></div>
 <script>
+function test_title(set, expected) {
+  test(function() {
+      document.title = set;
+      assert_equals(document.title, expected);
+  }, "document.title after setting to " + format_value(set));
+}
+
 test(function() {
   // Single space characters must be normalized. (WHATWG r4353)
   assert_equals(document.title, "document.title and space normalization");
+}, "document.title initial value");
 
-  document.title = "one space";
-  assert_equals(document.title, "one space");
-
-  document.title = "two  spaces";
-  assert_equals(document.title, "two spaces");
-
-  document.title = "one\ttab";
-  assert_equals(document.title, "one tab");
-
-  document.title = "two\t\ttabs";
-  assert_equals(document.title, "two tabs");
-
-  document.title = "one\nnewline";
-  assert_equals(document.title, "one newline");
-
-  document.title = "two\n\nnewlines";
-  assert_equals(document.title, "two newlines");
-
-  document.title = "one\fform feed";
-  assert_equals(document.title, "one form feed");
-
-  document.title = "two\f\fform feeds";
-  assert_equals(document.title, "two form feeds");
-
-  document.title = "one\rcarriage return";
-  assert_equals(document.title, "one carriage return");
-
-  document.title = "two\r\rcarriage returns";
-  assert_equals(document.title, "two carriage returns");
-});
+test_title("one space", "one space");
+test_title("two  spaces", "two spaces");
+test_title("one\ttab", "one tab");
+test_title("two\t\ttabs", "two tabs");
+test_title("one\nnewline", "one newline");
+test_title("two\n\nnewlines", "two newlines");
+test_title("one\fform feed", "one form feed");
+test_title("two\f\fform feeds", "two form feeds");
+test_title("one\rcarriage return", "one carriage return");
+test_title("two\r\rcarriage returns", "two carriage returns");
 </script>
diff --git a/third_party/WebKit/LayoutTests/imported/web-platform-tests/html/dom/documents/dom-tree-accessors/document.title-09.html b/third_party/WebKit/LayoutTests/imported/web-platform-tests/html/dom/documents/dom-tree-accessors/document.title-09.html
index d3588bf4..1fafab8 100644
--- a/third_party/WebKit/LayoutTests/imported/web-platform-tests/html/dom/documents/dom-tree-accessors/document.title-09.html
+++ b/third_party/WebKit/LayoutTests/imported/web-platform-tests/html/dom/documents/dom-tree-accessors/document.title-09.html
@@ -7,7 +7,7 @@
 var SVG_NAMESPACE = "http://www.w3.org/2000/svg";
 
 function newSVGDocument() {
-  return document.implementation.createDocument(SVG_NAMESPACE, "svg");
+  return document.implementation.createDocument(SVG_NAMESPACE, "svg", null);
 }
 
 test(function() {
diff --git a/third_party/WebKit/LayoutTests/imported/web-platform-tests/html/infrastructure/common-dom-interfaces/collections/htmlallcollection-expected.txt b/third_party/WebKit/LayoutTests/imported/web-platform-tests/html/infrastructure/common-dom-interfaces/collections/htmlallcollection-expected.txt
deleted file mode 100644
index 9991535c..0000000
--- a/third_party/WebKit/LayoutTests/imported/web-platform-tests/html/infrastructure/common-dom-interfaces/collections/htmlallcollection-expected.txt
+++ /dev/null
@@ -1,11 +0,0 @@
-This is a testharness.js-based test.
-PASS Test for HTMLAllCollection size 
-PASS Test lookup by index using () 
-PASS Test lookup by index using [] 
-FAIL Test for multiple occurence 3 <script> found document.all.tags is not a function
-PASS Test lookup IMG by name 
-PASS Test lookup IMG by namedItem  
-PASS Test lookup IMG in collection using () 
-PASS Test lookup IMG in collection using [] 
-Harness: the test ran to completion.
-
diff --git a/third_party/WebKit/LayoutTests/imported/web-platform-tests/html/infrastructure/common-dom-interfaces/collections/htmlallcollection.html b/third_party/WebKit/LayoutTests/imported/web-platform-tests/html/infrastructure/common-dom-interfaces/collections/htmlallcollection.html
index 70f02a8..f48e297 100644
--- a/third_party/WebKit/LayoutTests/imported/web-platform-tests/html/infrastructure/common-dom-interfaces/collections/htmlallcollection.html
+++ b/third_party/WebKit/LayoutTests/imported/web-platform-tests/html/infrastructure/common-dom-interfaces/collections/htmlallcollection.html
@@ -9,7 +9,7 @@
 <script src="../../../../../../resources/testharness.js"></script>
 <script src="../../../../../../resources/testharnessreport.js"></script>
 </head>
-<body>
+<body id="tags">
 <img src="../../../../images/green.png" name="picture">
 <script>
 test(function(){ assert_equals(document.all.length,12)}, "Test for HTMLAllCollection size");
@@ -18,8 +18,6 @@
 
 test(function(){ assert_equals(document.all[0].tagName,"HTML")}, "Test lookup by index using []");
 
-test(function(){ assert_equals(document.all.tags("script").length,3)}, "Test for multiple occurence 3 <script> found");
-
 test(function(){ assert_equals(document.all.item("picture").nodeName,"IMG")}, "Test lookup IMG by name");
 
 test(function(){ assert_equals(document.all.namedItem("picture").nodeName,"IMG")}, "Test lookup IMG by namedItem ");
@@ -27,7 +25,11 @@
 test(function(){ assert_equals(document.all("picture").nodeName,"IMG")}, "Test lookup IMG in collection using ()");
 
 test(function(){ assert_equals(document.all["picture"].nodeName,"IMG")}, "Test lookup IMG in collection using []");
+
+test(function(){ assert_equals(document.all.picture.nodeName,"IMG")}, "Test lookup IMG in collection using .");
+
+test(function(){ assert_equals(document.all.tags.id,"tags")}, "Test lookup tags in collection using .");
 </script>
 <div id="log"></div>
 </body>
-</html>
\ No newline at end of file
+</html>
diff --git a/third_party/WebKit/LayoutTests/imported/web-platform-tests/html/infrastructure/common-dom-interfaces/collections/htmlformcontrolscollection-expected.txt b/third_party/WebKit/LayoutTests/imported/web-platform-tests/html/infrastructure/common-dom-interfaces/collections/htmlformcontrolscollection-expected.txt
deleted file mode 100644
index 6a2ad8f..0000000
--- a/third_party/WebKit/LayoutTests/imported/web-platform-tests/html/infrastructure/common-dom-interfaces/collections/htmlformcontrolscollection-expected.txt
+++ /dev/null
@@ -1,18 +0,0 @@
-This is a testharness.js-based test.
-PASS The length attribute must return the number of elements in the form 
-PASS HTMLFormControlsCollection.item(index) must return the indexed item 
-PASS HTMLFormControlsCollection[index] must return the indexed item 
-FAIL HTMLFormControlsCollection(name) must return the named item coll1 is not a function
-PASS HTMLFormControlsCollection[name] must return the named item 
-PASS HTMLFormControlsCollection.namedItem(name) must return the named item 
-PASS The namedItem(name) must return an Element 
-PASS The namedItem(name) must return RadioNodeList 
-PASS The namedItem(name) must return null if the name is empty 
-PASS The namedItem(name) must return null if there is no matched element 
-PASS Controls can be indexed by id or name attribute 
-PASS The namedItem(name) must return the items with id or name attribute 
-PASS The HTMLFormControlsCollection interface is used for collections of listed elements in form element 
-PASS The HTMLFormControlsCollection interface is used for collections of listed elements in fieldset element 
-FAIL The controls in the form element must be sorted in tree order assert_array_equals: property 1, expected Element node <input type="checkbox" id="cb"></input> but got Element node <button id="btn"></button>
-Harness: the test ran to completion.
-
diff --git a/third_party/WebKit/LayoutTests/imported/web-platform-tests/html/infrastructure/common-dom-interfaces/collections/htmlformcontrolscollection.html b/third_party/WebKit/LayoutTests/imported/web-platform-tests/html/infrastructure/common-dom-interfaces/collections/htmlformcontrolscollection.html
index 39cdcc4..878a4124 100644
--- a/third_party/WebKit/LayoutTests/imported/web-platform-tests/html/infrastructure/common-dom-interfaces/collections/htmlformcontrolscollection.html
+++ b/third_party/WebKit/LayoutTests/imported/web-platform-tests/html/infrastructure/common-dom-interfaces/collections/htmlformcontrolscollection.html
@@ -18,8 +18,12 @@
         <input type="checkbox" name="cb">
       </td>
     </tr>
-    <button id="btn"></button>
-    <button name="btn"></button>
+    <tr>
+      <td>
+        <button id="btn"></button>
+        <button name="btn"></button>
+      </td>
+    </tr>
   </table>
 </form>
 
@@ -50,8 +54,8 @@
 
 //getter - name
 test(function () {
-  assert_equals(coll1("r1"), rdo, "HTMLFormControlsCollection(name) should return the 'input' element in radio status.");
-}, "HTMLFormControlsCollection(name) must return the named item");
+  assert_throws(TypeError(), function() { coll1("r1") });
+}, "HTMLFormControlsCollection is not callable");
 
 test(function () {
   assert_equals(coll1["r1"], rdo, "HTMLFormControlsCollection[name] should return the 'input' element in radio status.");
diff --git a/third_party/WebKit/LayoutTests/imported/web-platform-tests/html/rendering/non-replaced-elements/flow-content-0/div-align-ref-expected.html b/third_party/WebKit/LayoutTests/imported/web-platform-tests/html/rendering/non-replaced-elements/flow-content-0/div-align-ref-expected.html
new file mode 100644
index 0000000..f662a68
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/imported/web-platform-tests/html/rendering/non-replaced-elements/flow-content-0/div-align-ref-expected.html
@@ -0,0 +1,77 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset=utf-8>
+<link rel="match" href="div-align-ref.html">
+<style>
+.test { width: 50px; background-color: yellow; }
+.center { text-align: center; }
+.center .test { margin: 0 auto; }
+.left { text-align: left; }
+.left .test { margin-right: auto; }
+.right { text-align: right; }
+.right .test { margin-left: auto; }
+.rtl { direction: rtl; }
+.ltr { direction: ltr; }
+.left .margin { margin-left: 1em; }
+.right .margin { margin-right: 1em; }
+</style>
+</head>
+<body>
+<!--  Centered tests  -->
+<div class=center>
+<div class=test>t א</div>
+<div class="test rtl">t א</div>
+<div class="test margin">t א</div>
+</div>
+
+<div class=center>
+<div class="test left">t א</div>
+<div class="test right">t א</div>
+</div>
+
+<div class=left>
+<div class=center>
+<div class=test>t א</div>
+</div>
+</div>
+
+<!--  Left-aligned tests  -->
+<div class=left>
+<div class=test>t א</div>
+<div class="test rtl">t א</div>
+<div class="test margin">t א</div>
+</div>
+
+<div class="left rtl">
+<div class=test>t א</div>
+<div class="test ltr">t א</div>
+<div class="test margin">t א</div>
+</div>
+
+<div class=left>
+<div class="test center">t א</div>
+<div class="test right">t א</div>
+</div>
+
+<!--  Right-aligned tests  -->
+<div class=right>
+<div class=test>t א</div>
+<div class="test rtl">t א</div>
+<div class="test margin">t א</div>
+</div>
+
+<div class="right rtl">
+<div class=test>t א</div>
+<div class="test ltr">t א</div>
+<div class="test margin">t א</div>
+</div>
+
+<div class=right>
+<div class="test left">t א</div>
+<div class="test center">t א</div>
+</div>
+
+</body>
+</html>
+
diff --git a/third_party/WebKit/LayoutTests/imported/web-platform-tests/html/rendering/non-replaced-elements/flow-content-0/div-align-ref.html b/third_party/WebKit/LayoutTests/imported/web-platform-tests/html/rendering/non-replaced-elements/flow-content-0/div-align-ref.html
new file mode 100644
index 0000000..f662a68
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/imported/web-platform-tests/html/rendering/non-replaced-elements/flow-content-0/div-align-ref.html
@@ -0,0 +1,77 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta charset=utf-8>
+<link rel="match" href="div-align-ref.html">
+<style>
+.test { width: 50px; background-color: yellow; }
+.center { text-align: center; }
+.center .test { margin: 0 auto; }
+.left { text-align: left; }
+.left .test { margin-right: auto; }
+.right { text-align: right; }
+.right .test { margin-left: auto; }
+.rtl { direction: rtl; }
+.ltr { direction: ltr; }
+.left .margin { margin-left: 1em; }
+.right .margin { margin-right: 1em; }
+</style>
+</head>
+<body>
+<!--  Centered tests  -->
+<div class=center>
+<div class=test>t א</div>
+<div class="test rtl">t א</div>
+<div class="test margin">t א</div>
+</div>
+
+<div class=center>
+<div class="test left">t א</div>
+<div class="test right">t א</div>
+</div>
+
+<div class=left>
+<div class=center>
+<div class=test>t א</div>
+</div>
+</div>
+
+<!--  Left-aligned tests  -->
+<div class=left>
+<div class=test>t א</div>
+<div class="test rtl">t א</div>
+<div class="test margin">t א</div>
+</div>
+
+<div class="left rtl">
+<div class=test>t א</div>
+<div class="test ltr">t א</div>
+<div class="test margin">t א</div>
+</div>
+
+<div class=left>
+<div class="test center">t א</div>
+<div class="test right">t א</div>
+</div>
+
+<!--  Right-aligned tests  -->
+<div class=right>
+<div class=test>t א</div>
+<div class="test rtl">t א</div>
+<div class="test margin">t א</div>
+</div>
+
+<div class="right rtl">
+<div class=test>t א</div>
+<div class="test ltr">t א</div>
+<div class="test margin">t א</div>
+</div>
+
+<div class=right>
+<div class="test left">t א</div>
+<div class="test center">t א</div>
+</div>
+
+</body>
+</html>
+
diff --git a/third_party/WebKit/LayoutTests/imported/web-platform-tests/html/semantics/forms/the-option-element/option-text-recurse.html b/third_party/WebKit/LayoutTests/imported/web-platform-tests/html/semantics/forms/the-option-element/option-text-recurse.html
index 0f34b096..91052f7d 100644
--- a/third_party/WebKit/LayoutTests/imported/web-platform-tests/html/semantics/forms/the-option-element/option-text-recurse.html
+++ b/third_party/WebKit/LayoutTests/imported/web-platform-tests/html/semantics/forms/the-option-element/option-text-recurse.html
@@ -74,4 +74,19 @@
   option.appendChild(document.createTextNode("text"));
   assert_equals(option.text, "text");
 }, "option.text should work if the option is in a MathML script element");
+
+test(function() {
+  var option = document.createElement("option");
+  option.appendChild(document.createTextNode("te"));
+  option.appendChild(document.createComment("comment"));
+  option.appendChild(document.createTextNode("xt"));
+  assert_equals(option.text, "text");
+}, "option.text should ignore comment children");
+test(function() {
+  var option = document.createElement("option");
+  option.appendChild(document.createTextNode("te"));
+  option.appendChild(document.createProcessingInstruction("target", "data"));
+  option.appendChild(document.createTextNode("xt"));
+  assert_equals(option.text, "text");
+}, "option.text should ignore PI children");
 </script>
diff --git a/third_party/WebKit/LayoutTests/imported/web-platform-tests/html/semantics/tabular-data/the-tbody-element/deleteRow-expected.txt b/third_party/WebKit/LayoutTests/imported/web-platform-tests/html/semantics/tabular-data/the-tbody-element/deleteRow-expected.txt
new file mode 100644
index 0000000..89e17977
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/imported/web-platform-tests/html/semantics/tabular-data/the-tbody-element/deleteRow-expected.txt
@@ -0,0 +1,8 @@
+This is a testharness.js-based test.
+PASS HTMLTableSectionElement deleteRow(0) 
+PASS HTMLTableSectionElement deleteRow(-1) 
+PASS HTMLTableSectionElement deleteRow(rows.length) 
+PASS HTMLTableSectionElement deleteRow(-2) 
+FAIL HTMLTableSectionElement deleteRow(-1) with no rows Failed to execute 'deleteRow' on 'HTMLTableSectionElement': The provided index (-1 is outside the range [-1, 0].
+Harness: the test ran to completion.
+
diff --git a/third_party/WebKit/LayoutTests/imported/web-platform-tests/html/semantics/tabular-data/the-tbody-element/deleteRow.html b/third_party/WebKit/LayoutTests/imported/web-platform-tests/html/semantics/tabular-data/the-tbody-element/deleteRow.html
index 74862ef8..c9603ff 100644
--- a/third_party/WebKit/LayoutTests/imported/web-platform-tests/html/semantics/tabular-data/the-tbody-element/deleteRow.html
+++ b/third_party/WebKit/LayoutTests/imported/web-platform-tests/html/semantics/tabular-data/the-tbody-element/deleteRow.html
@@ -43,4 +43,12 @@
   });
 }, "HTMLTableSectionElement deleteRow(-2)");
 
+test(function () {
+  assert_equals(tbody.rows.length, 1);
+  tbody.deleteRow(-1);
+  assert_equals(tbody.rows.length, 0);
+  tbody.deleteRow(-1);
+  assert_equals(tbody.rows.length, 0);
+}, "HTMLTableSectionElement deleteRow(-1) with no rows");
+
 </script>
diff --git a/third_party/WebKit/LayoutTests/imported/web-platform-tests/html/semantics/tabular-data/the-tbody-element/insertRow.html b/third_party/WebKit/LayoutTests/imported/web-platform-tests/html/semantics/tabular-data/the-tbody-element/insertRow.html
index fe8142a..19e23c24 100644
--- a/third_party/WebKit/LayoutTests/imported/web-platform-tests/html/semantics/tabular-data/the-tbody-element/insertRow.html
+++ b/third_party/WebKit/LayoutTests/imported/web-platform-tests/html/semantics/tabular-data/the-tbody-element/insertRow.html
@@ -36,6 +36,12 @@
 }, "HTMLTableSectionElement insertRow()");
 
 test(function () {
+  var trEle = tbody.insertRow(tbody.rows.length);
+  assert_equals(tbody.rows[tbody.rows.length - 1], trEle);
+  assert_equals(tbody.rows.length, 5);
+}, "HTMLTableSectionElement insertRow(rows.length)");
+
+test(function () {
   assert_throws("IndexSizeError", function () {
     tbody.insertRow(-2);
   });
diff --git a/third_party/WebKit/LayoutTests/imported/web-platform-tests/webrtc/datachannel-emptystring-expected.txt b/third_party/WebKit/LayoutTests/imported/web-platform-tests/webrtc/datachannel-emptystring-expected.txt
index 6c3c88c..895440d9 100644
--- a/third_party/WebKit/LayoutTests/imported/web-platform-tests/webrtc/datachannel-emptystring-expected.txt
+++ b/third_party/WebKit/LayoutTests/imported/web-platform-tests/webrtc/datachannel-emptystring-expected.txt
@@ -1,4 +1,4 @@
 This is a testharness.js-based test.
-FAIL Can send empty strings across a WebRTC data channel. Failed to execute 'createOffer' on 'RTCPeerConnection': 1 argument required, but only 0 present.
+FAIL Can send empty strings across a WebRTC data channel. RTCPeerConnection is not defined
 Harness: the test ran to completion.
 
diff --git a/third_party/WebKit/LayoutTests/imported/web-platform-tests/webrtc/datachannel-emptystring.html b/third_party/WebKit/LayoutTests/imported/web-platform-tests/webrtc/datachannel-emptystring.html
index 8bded3e..e7b2fc7 100644
--- a/third_party/WebKit/LayoutTests/imported/web-platform-tests/webrtc/datachannel-emptystring.html
+++ b/third_party/WebKit/LayoutTests/imported/web-platform-tests/webrtc/datachannel-emptystring.html
@@ -17,11 +17,6 @@
   <!--  These files are in place when executing on W3C.  -->
   <script src="../../../resources/testharness.js"></script>
   <script src="../../../resources/testharnessreport.js"></script>
-  <script src="../../../resources/vendor-prefix.js"
-          data-prefixed-objects=
-              '[{"ancestors":["window"], "name":"RTCPeerConnection"}]'
-    >
-  </script>
   <script type="text/javascript">
   var test = async_test('Can send empty strings across a WebRTC data channel.');
 
diff --git a/third_party/WebKit/LayoutTests/imported/web-platform-tests/webrtc/no-media-call-expected.txt b/third_party/WebKit/LayoutTests/imported/web-platform-tests/webrtc/no-media-call-expected.txt
index 5563808..a7dfd8d 100644
--- a/third_party/WebKit/LayoutTests/imported/web-platform-tests/webrtc/no-media-call-expected.txt
+++ b/third_party/WebKit/LayoutTests/imported/web-platform-tests/webrtc/no-media-call-expected.txt
@@ -1,4 +1,4 @@
 This is a testharness.js-based test.
-FAIL Can set up a basic WebRTC call with no data. assert_unreached: WebRTC called error callback for createOffer Reached unreachable code
+FAIL Can set up a basic WebRTC call with no data. RTCPeerConnection is not defined
 Harness: the test ran to completion.
 
diff --git a/third_party/WebKit/LayoutTests/imported/web-platform-tests/webrtc/no-media-call.html b/third_party/WebKit/LayoutTests/imported/web-platform-tests/webrtc/no-media-call.html
index 236b7a8..f38a457d 100644
--- a/third_party/WebKit/LayoutTests/imported/web-platform-tests/webrtc/no-media-call.html
+++ b/third_party/WebKit/LayoutTests/imported/web-platform-tests/webrtc/no-media-call.html
@@ -17,12 +17,6 @@
   <!--  These files are in place when executing on W3C.  -->
   <script src="../../../resources/testharness.js"></script>
   <script src="../../../resources/testharnessreport.js"></script>
-  <script src="../../../resources/vendor-prefix.js"
-          data-prefixed-objects=
-              '[{"ancestors":["window"], "name":"RTCPeerConnection"},
-                {"ancestors":["window"], "name":"RTCSessionDescription"}]'
-    >
-  </script>
   <script type="text/javascript">
   var test = async_test('Can set up a basic WebRTC call with no data.');
 
diff --git a/third_party/WebKit/LayoutTests/imported/web-platform-tests/webrtc/promises-call-expected.txt b/third_party/WebKit/LayoutTests/imported/web-platform-tests/webrtc/promises-call-expected.txt
index 1547489..7f7f0a6 100644
--- a/third_party/WebKit/LayoutTests/imported/web-platform-tests/webrtc/promises-call-expected.txt
+++ b/third_party/WebKit/LayoutTests/imported/web-platform-tests/webrtc/promises-call-expected.txt
@@ -1,4 +1,4 @@
 This is a testharness.js-based test.
-FAIL Can set up a basic WebRTC call with only data using promises. Failed to execute 'createOffer' on 'RTCPeerConnection': 1 argument required, but only 0 present.
+FAIL Can set up a basic WebRTC call with only data using promises. RTCPeerConnection is not defined
 Harness: the test ran to completion.
 
diff --git a/third_party/WebKit/LayoutTests/imported/web-platform-tests/webrtc/promises-call.html b/third_party/WebKit/LayoutTests/imported/web-platform-tests/webrtc/promises-call.html
index 24c83f9..32b9508 100644
--- a/third_party/WebKit/LayoutTests/imported/web-platform-tests/webrtc/promises-call.html
+++ b/third_party/WebKit/LayoutTests/imported/web-platform-tests/webrtc/promises-call.html
@@ -17,11 +17,6 @@
   <!--  These files are in place when executing on W3C.  -->
   <script src="../../../resources/testharness.js"></script>
   <script src="../../../resources/testharnessreport.js"></script>
-  <script src="../../../resources/vendor-prefix.js"
-          data-prefixed-objects=
-              '[{"ancestors":["window"], "name":"RTCPeerConnection"}]'
-    >
-  </script>
   <script type="text/javascript">
   var test = async_test('Can set up a basic WebRTC call with only data using promises.');
 
diff --git a/third_party/WebKit/LayoutTests/imported/web-platform-tests/webrtc/rtcpeerconnection/rtcpeerconnection-idl-expected.txt b/third_party/WebKit/LayoutTests/imported/web-platform-tests/webrtc/rtcpeerconnection/rtcpeerconnection-idl-expected.txt
index 65c8b4d..803213b 100644
--- a/third_party/WebKit/LayoutTests/imported/web-platform-tests/webrtc/rtcpeerconnection/rtcpeerconnection-idl-expected.txt
+++ b/third_party/WebKit/LayoutTests/imported/web-platform-tests/webrtc/rtcpeerconnection/rtcpeerconnection-idl-expected.txt
@@ -1,105 +1,5 @@
+CONSOLE ERROR: line 101: Uncaught ReferenceError: RTCPeerConnection is not defined
 This is a testharness.js-based test.
-FAIL RTCPeerConnection interface: existence and properties of interface object assert_false: self's property "RTCPeerConnection" is enumerable expected false got true
-PASS RTCPeerConnection interface object length 
-FAIL RTCPeerConnection interface: existence and properties of interface prototype object Cannot read property 'has_extended_attribute' of undefined
-PASS RTCPeerConnection interface: existence and properties of interface prototype object's "constructor" property 
-FAIL RTCPeerConnection interface: operation createOffer(RTCOfferOptions) assert_equals: property has wrong .length expected 0 but got 1
-FAIL RTCPeerConnection interface: operation createAnswer() assert_equals: property has wrong .length expected 0 but got 1
-PASS RTCPeerConnection interface: operation setLocalDescription(RTCSessionDescription) 
-PASS RTCPeerConnection interface: attribute localDescription 
-PASS RTCPeerConnection interface: operation setRemoteDescription(RTCSessionDescription) 
-PASS RTCPeerConnection interface: attribute remoteDescription 
-PASS RTCPeerConnection interface: attribute signalingState 
-FAIL RTCPeerConnection interface: operation updateIce(RTCConfiguration) assert_equals: property has wrong .length expected 1 but got 0
-PASS RTCPeerConnection interface: operation addIceCandidate(RTCIceCandidate) 
-PASS RTCPeerConnection interface: attribute iceGatheringState 
-PASS RTCPeerConnection interface: attribute iceConnectionState 
-FAIL RTCPeerConnection interface: attribute canTrickleIceCandidates assert_true: The prototype object must have a property "canTrickleIceCandidates" expected true got false
-FAIL RTCPeerConnection interface: operation getConfiguration() assert_own_property: interface prototype object missing non-static operation expected property "getConfiguration" missing
-PASS RTCPeerConnection interface: operation close() 
-PASS RTCPeerConnection interface: attribute onnegotiationneeded 
-PASS RTCPeerConnection interface: attribute onicecandidate 
-PASS RTCPeerConnection interface: attribute onsignalingstatechange 
-PASS RTCPeerConnection interface: attribute oniceconnectionstatechange 
-FAIL RTCPeerConnection interface: attribute onicegatheringstatechange assert_true: The prototype object must have a property "onicegatheringstatechange" expected true got false
-FAIL RTCPeerConnection interface: operation createOffer(RTCSessionDescriptionCallback,RTCPeerConnectionErrorCallback,RTCOfferOptions) assert_equals: property has wrong .length expected 0 but got 1
-PASS RTCPeerConnection interface: operation setLocalDescription(RTCSessionDescription,VoidFunction,RTCPeerConnectionErrorCallback) 
-FAIL RTCPeerConnection interface: operation createAnswer(RTCSessionDescriptionCallback,RTCPeerConnectionErrorCallback) assert_equals: property has wrong .length expected 0 but got 1
-PASS RTCPeerConnection interface: operation setRemoteDescription(RTCSessionDescription,VoidFunction,RTCPeerConnectionErrorCallback) 
-PASS RTCPeerConnection interface: operation addIceCandidate(RTCIceCandidate,VoidFunction,RTCPeerConnectionErrorCallback) 
-FAIL RTCPeerConnection interface: operation getSenders() assert_own_property: interface prototype object missing non-static operation expected property "getSenders" missing
-FAIL RTCPeerConnection interface: operation getReceivers() assert_own_property: interface prototype object missing non-static operation expected property "getReceivers" missing
-FAIL RTCPeerConnection interface: operation addTrack(MediaStreamTrack,MediaStream) assert_own_property: interface prototype object missing non-static operation expected property "addTrack" missing
-FAIL RTCPeerConnection interface: operation removeTrack(RTCRtpSender) assert_own_property: interface prototype object missing non-static operation expected property "removeTrack" missing
-FAIL RTCPeerConnection interface: attribute ontrack assert_true: The prototype object must have a property "ontrack" expected true got false
-PASS RTCPeerConnection interface: operation createDataChannel(DOMString,RTCDataChannelInit) 
-PASS RTCPeerConnection interface: attribute ondatachannel 
-PASS RTCPeerConnection interface: operation createDTMFSender(MediaStreamTrack) 
-FAIL RTCPeerConnection interface: operation getStats(MediaStreamTrack,RTCStatsCallback,RTCPeerConnectionErrorCallback) assert_equals: property has wrong .length expected 3 but got 1
-FAIL RTCPeerConnection interface: operation setIdentityProvider(DOMString,DOMString,DOMString) assert_own_property: interface prototype object missing non-static operation expected property "setIdentityProvider" missing
-FAIL RTCPeerConnection interface: operation getIdentityAssertion() assert_own_property: interface prototype object missing non-static operation expected property "getIdentityAssertion" missing
-FAIL RTCPeerConnection interface: attribute peerIdentity assert_true: The prototype object must have a property "peerIdentity" expected true got false
-FAIL RTCPeerConnection interface: attribute onidentityresult assert_true: The prototype object must have a property "onidentityresult" expected true got false
-FAIL RTCPeerConnection interface: attribute onpeeridentity assert_true: The prototype object must have a property "onpeeridentity" expected true got false
-FAIL RTCPeerConnection interface: attribute onidpassertionerror assert_true: The prototype object must have a property "onidpassertionerror" expected true got false
-FAIL RTCPeerConnection interface: attribute onidpvalidationerror assert_true: The prototype object must have a property "onidpvalidationerror" expected true got false
-PASS RTCPeerConnection must be primary interface of pc 
-FAIL Stringification of pc Cannot read property 'has_stringifier' of undefined
-PASS RTCPeerConnection interface: pc must inherit property "createOffer" with the proper type (0) 
-PASS RTCPeerConnection interface: calling createOffer(RTCOfferOptions) on pc with too few arguments must throw TypeError 
-PASS RTCPeerConnection interface: pc must inherit property "createAnswer" with the proper type (1) 
-PASS RTCPeerConnection interface: pc must inherit property "setLocalDescription" with the proper type (2) 
-PASS RTCPeerConnection interface: calling setLocalDescription(RTCSessionDescription) on pc with too few arguments must throw TypeError 
-PASS RTCPeerConnection interface: pc must inherit property "localDescription" with the proper type (3) 
-PASS RTCPeerConnection interface: pc must inherit property "setRemoteDescription" with the proper type (4) 
-PASS RTCPeerConnection interface: calling setRemoteDescription(RTCSessionDescription) on pc with too few arguments must throw TypeError 
-PASS RTCPeerConnection interface: pc must inherit property "remoteDescription" with the proper type (5) 
-FAIL RTCPeerConnection interface: pc must inherit property "signalingState" with the proper type (6) Unrecognized type RTCSignalingState
-PASS RTCPeerConnection interface: pc must inherit property "updateIce" with the proper type (7) 
-FAIL RTCPeerConnection interface: calling updateIce(RTCConfiguration) on pc with too few arguments must throw TypeError assert_throws: Called with 0 arguments function "function () { [native code] }" did not throw
-PASS RTCPeerConnection interface: pc must inherit property "addIceCandidate" with the proper type (8) 
-PASS RTCPeerConnection interface: calling addIceCandidate(RTCIceCandidate) on pc with too few arguments must throw TypeError 
-FAIL RTCPeerConnection interface: pc must inherit property "iceGatheringState" with the proper type (9) Unrecognized type RTCIceGatheringState
-FAIL RTCPeerConnection interface: pc must inherit property "iceConnectionState" with the proper type (10) Unrecognized type RTCIceConnectionState
-FAIL RTCPeerConnection interface: pc must inherit property "canTrickleIceCandidates" with the proper type (11) assert_inherits: property "canTrickleIceCandidates" not found in prototype chain
-FAIL RTCPeerConnection interface: pc must inherit property "getConfiguration" with the proper type (12) assert_inherits: property "getConfiguration" not found in prototype chain
-PASS RTCPeerConnection interface: pc must inherit property "close" with the proper type (13) 
-FAIL RTCPeerConnection interface: pc must inherit property "onnegotiationneeded" with the proper type (14) Unrecognized type EventHandler
-FAIL RTCPeerConnection interface: pc must inherit property "onicecandidate" with the proper type (15) Unrecognized type EventHandler
-FAIL RTCPeerConnection interface: pc must inherit property "onsignalingstatechange" with the proper type (16) Unrecognized type EventHandler
-FAIL RTCPeerConnection interface: pc must inherit property "oniceconnectionstatechange" with the proper type (17) Unrecognized type EventHandler
-FAIL RTCPeerConnection interface: pc must inherit property "onicegatheringstatechange" with the proper type (18) assert_inherits: property "onicegatheringstatechange" not found in prototype chain
-PASS RTCPeerConnection interface: pc must inherit property "createOffer" with the proper type (19) 
-PASS RTCPeerConnection interface: calling createOffer(RTCSessionDescriptionCallback,RTCPeerConnectionErrorCallback,RTCOfferOptions) on pc with too few arguments must throw TypeError 
-PASS RTCPeerConnection interface: pc must inherit property "setLocalDescription" with the proper type (20) 
-PASS RTCPeerConnection interface: calling setLocalDescription(RTCSessionDescription,VoidFunction,RTCPeerConnectionErrorCallback) on pc with too few arguments must throw TypeError 
-PASS RTCPeerConnection interface: pc must inherit property "createAnswer" with the proper type (21) 
-PASS RTCPeerConnection interface: calling createAnswer(RTCSessionDescriptionCallback,RTCPeerConnectionErrorCallback) on pc with too few arguments must throw TypeError 
-PASS RTCPeerConnection interface: pc must inherit property "setRemoteDescription" with the proper type (22) 
-PASS RTCPeerConnection interface: calling setRemoteDescription(RTCSessionDescription,VoidFunction,RTCPeerConnectionErrorCallback) on pc with too few arguments must throw TypeError 
-PASS RTCPeerConnection interface: pc must inherit property "addIceCandidate" with the proper type (23) 
-PASS RTCPeerConnection interface: calling addIceCandidate(RTCIceCandidate,VoidFunction,RTCPeerConnectionErrorCallback) on pc with too few arguments must throw TypeError 
-FAIL RTCPeerConnection interface: pc must inherit property "getSenders" with the proper type (24) assert_inherits: property "getSenders" not found in prototype chain
-FAIL RTCPeerConnection interface: pc must inherit property "getReceivers" with the proper type (25) assert_inherits: property "getReceivers" not found in prototype chain
-FAIL RTCPeerConnection interface: pc must inherit property "addTrack" with the proper type (26) assert_inherits: property "addTrack" not found in prototype chain
-FAIL RTCPeerConnection interface: calling addTrack(MediaStreamTrack,MediaStream) on pc with too few arguments must throw TypeError assert_inherits: property "addTrack" not found in prototype chain
-FAIL RTCPeerConnection interface: pc must inherit property "removeTrack" with the proper type (27) assert_inherits: property "removeTrack" not found in prototype chain
-FAIL RTCPeerConnection interface: calling removeTrack(RTCRtpSender) on pc with too few arguments must throw TypeError assert_inherits: property "removeTrack" not found in prototype chain
-FAIL RTCPeerConnection interface: pc must inherit property "ontrack" with the proper type (28) assert_inherits: property "ontrack" not found in prototype chain
-PASS RTCPeerConnection interface: pc must inherit property "createDataChannel" with the proper type (29) 
-PASS RTCPeerConnection interface: calling createDataChannel(DOMString,RTCDataChannelInit) on pc with too few arguments must throw TypeError 
-FAIL RTCPeerConnection interface: pc must inherit property "ondatachannel" with the proper type (30) Unrecognized type EventHandler
-PASS RTCPeerConnection interface: pc must inherit property "createDTMFSender" with the proper type (31) 
-PASS RTCPeerConnection interface: calling createDTMFSender(MediaStreamTrack) on pc with too few arguments must throw TypeError 
-PASS RTCPeerConnection interface: pc must inherit property "getStats" with the proper type (32) 
-PASS RTCPeerConnection interface: calling getStats(MediaStreamTrack,RTCStatsCallback,RTCPeerConnectionErrorCallback) on pc with too few arguments must throw TypeError 
-FAIL RTCPeerConnection interface: pc must inherit property "setIdentityProvider" with the proper type (33) assert_inherits: property "setIdentityProvider" not found in prototype chain
-FAIL RTCPeerConnection interface: calling setIdentityProvider(DOMString,DOMString,DOMString) on pc with too few arguments must throw TypeError assert_inherits: property "setIdentityProvider" not found in prototype chain
-FAIL RTCPeerConnection interface: pc must inherit property "getIdentityAssertion" with the proper type (34) assert_inherits: property "getIdentityAssertion" not found in prototype chain
-FAIL RTCPeerConnection interface: pc must inherit property "peerIdentity" with the proper type (35) assert_inherits: property "peerIdentity" not found in prototype chain
-FAIL RTCPeerConnection interface: pc must inherit property "onidentityresult" with the proper type (36) assert_inherits: property "onidentityresult" not found in prototype chain
-FAIL RTCPeerConnection interface: pc must inherit property "onpeeridentity" with the proper type (37) assert_inherits: property "onpeeridentity" not found in prototype chain
-FAIL RTCPeerConnection interface: pc must inherit property "onidpassertionerror" with the proper type (38) assert_inherits: property "onidpassertionerror" not found in prototype chain
-FAIL RTCPeerConnection interface: pc must inherit property "onidpvalidationerror" with the proper type (39) assert_inherits: property "onidpvalidationerror" not found in prototype chain
+Harness Error. harness_status.status = 1 , harness_status.message = Uncaught ReferenceError: RTCPeerConnection is not defined
 Harness: the test ran to completion.
 
diff --git a/third_party/WebKit/LayoutTests/imported/web-platform-tests/webrtc/rtcpeerconnection/rtcpeerconnection-idl.html b/third_party/WebKit/LayoutTests/imported/web-platform-tests/webrtc/rtcpeerconnection/rtcpeerconnection-idl.html
index 201baec..fc45cd3 100644
--- a/third_party/WebKit/LayoutTests/imported/web-platform-tests/webrtc/rtcpeerconnection/rtcpeerconnection-idl.html
+++ b/third_party/WebKit/LayoutTests/imported/web-platform-tests/webrtc/rtcpeerconnection/rtcpeerconnection-idl.html
@@ -14,32 +14,33 @@
 <div id='log'></div>
 <script src=../../../../resources/testharness.js></script>
 <script src=../../../../resources/testharnessreport.js></script>
-<script src="../../../../resources/vendor-prefix.js"
-          data-prefixed-objects=
-              '[{"ancestors":["window"], "name":"RTCPeerConnection"},
-                {"ancestors":["window"], "name":"RTCSessionDescription"},
-                {"ancestors":["window"], "name":"RTCIceCandidate"}]'>
-</script>
 <script src=../../../../resources/WebIDLParser.js></script>
 <script src=../../../../resources/idlharness.js></script>
 
-<!--  The IDL is copied from the 06 March 2015 editors' draft.  -->
+<!--  The IDL is copied from the 22 September 2015 editors' draft.  -->
 <script type="text/plain">
-[ Constructor (RTCConfiguration configuration)]
+interface EventTarget {
+    // Only a dummy definition is needed here.
+};
+[ Constructor (optional RTCConfiguration configuration)]
 interface RTCPeerConnection : EventTarget  {
     Promise<RTCSessionDescription> createOffer (optional RTCOfferOptions options);
-    Promise<RTCSessionDescription> createAnswer ();
+    Promise<RTCSessionDescription> createAnswer (optional RTCAnswerOptions options);
     Promise<void>                  setLocalDescription (RTCSessionDescription description);
     readonly    attribute RTCSessionDescription? localDescription;
+    readonly    attribute RTCSessionDescription? currentLocalDescription;
+    readonly    attribute RTCSessionDescription? pendingLocalDescription;
     Promise<void>                  setRemoteDescription (RTCSessionDescription description);
     readonly    attribute RTCSessionDescription? remoteDescription;
-    readonly    attribute RTCSignalingState      signalingState;
-    void                           updateIce (RTCConfiguration configuration);
+    readonly    attribute RTCSessionDescription? currentRemoteDescription;
+    readonly    attribute RTCSessionDescription? pendingRemoteDescription;
     Promise<void>                  addIceCandidate (RTCIceCandidate candidate);
+    readonly    attribute RTCSignalingState      signalingState;
     readonly    attribute RTCIceGatheringState   iceGatheringState;
     readonly    attribute RTCIceConnectionState  iceConnectionState;
     readonly    attribute boolean?               canTrickleIceCandidates;
     RTCConfiguration               getConfiguration ();
+    void                           setConfiguration (RTCConfiguration configuration);
     void                           close ();
                 attribute EventHandler           onnegotiationneeded;
                 attribute EventHandler           onicecandidate;
@@ -54,6 +55,11 @@
     void createAnswer (RTCSessionDescriptionCallback successCallback, RTCPeerConnectionErrorCallback failureCallback);
     void setRemoteDescription (RTCSessionDescription description, VoidFunction successCallback, RTCPeerConnectionErrorCallback failureCallback);
     void addIceCandidate (RTCIceCandidate candidate, VoidFunction successCallback, RTCPeerConnectionErrorCallback failureCallback);
+    void getStats (MediaStreamTrack? selector, RTCStatsCallback successCallback, RTCPeerConnectionErrorCallback failureCallback);
+};
+
+partial interface RTCPeerConnection {
+    static Promise<RTCCertificate> generateCertificate (AlgorithmIdentifier keygenAlgorithm);
 };
 
 partial interface RTCPeerConnection {
@@ -70,21 +76,18 @@
 };
 
 partial interface RTCPeerConnection {
-    RTCDTMFSender createDTMFSender (MediaStreamTrack track);
+    readonly    attribute RTCDTMFSender? dtmf;
 };
 
 partial interface RTCPeerConnection {
-    void getStats (MediaStreamTrack? selector, RTCStatsCallback successCallback, RTCPeerConnectionErrorCallback failureCallback);
+    Promise<RTCStatsReport> getStats (optional MediaStreamTrack? selector);
 };
 
 partial interface RTCPeerConnection {
-    void setIdentityProvider (DOMString provider, optional DOMString protocol, optional DOMString username);
-    void getIdentityAssertion ();
-    readonly    attribute RTCIdentityAssertion? peerIdentity;
-                attribute EventHandler          onidentityresult;
-                attribute EventHandler          onpeeridentity;
-                attribute EventHandler          onidpassertionerror;
-                attribute EventHandler          onidpvalidationerror;
+    void               setIdentityProvider (DOMString provider, optional DOMString protocol, optional DOMString usernameHint);
+    Promise<DOMString> getIdentityAssertion ();
+    readonly    attribute Promise<RTCIdentityAssertion> peerIdentity;
+    readonly    attribute DOMString?                    idpLoginUrl;
 };
 
 </script>
diff --git a/third_party/WebKit/LayoutTests/imported/web-platform-tests/webrtc/simplecall-expected.txt b/third_party/WebKit/LayoutTests/imported/web-platform-tests/webrtc/simplecall-expected.txt
index 372526ba..1eaa70b 100644
--- a/third_party/WebKit/LayoutTests/imported/web-platform-tests/webrtc/simplecall-expected.txt
+++ b/third_party/WebKit/LayoutTests/imported/web-platform-tests/webrtc/simplecall-expected.txt
@@ -1,4 +1,5 @@
+CONSOLE ERROR: line 38: Uncaught ReferenceError: RTCPeerConnection is not defined
 This is a testharness.js-based test.
-FAIL Can set up a basic WebRTC call. assert_unreached: WebRTC called error callback for createOffer Reached unreachable code
+Harness Error. harness_status.status = 1 , harness_status.message = Uncaught ReferenceError: RTCPeerConnection is not defined
 Harness: the test ran to completion.
 
diff --git a/third_party/WebKit/LayoutTests/imported/web-platform-tests/webrtc/simplecall.html b/third_party/WebKit/LayoutTests/imported/web-platform-tests/webrtc/simplecall.html
index 71dcb68..24cc23c 100644
--- a/third_party/WebKit/LayoutTests/imported/web-platform-tests/webrtc/simplecall.html
+++ b/third_party/WebKit/LayoutTests/imported/web-platform-tests/webrtc/simplecall.html
@@ -24,10 +24,7 @@
   <script src="../../../resources/testharnessreport.js"></script>
   <script src="../../../resources/vendor-prefix.js"
           data-prefixed-objects=
-              '[{"ancestors":["navigator"], "name":"getUserMedia"},
-                {"ancestors":["window"], "name":"RTCPeerConnection"},
-                {"ancestors":["window"], "name":"RTCSessionDescription"},
-                {"ancestors":["window"], "name":"RTCIceCandidate"}]'
+              '[{"ancestors":["navigator"], "name":"getUserMedia"}]'
           data-prefixed-prototypes=
                '[{"ancestors":["HTMLMediaElement"],"name":"srcObject"}]'>
   </script>
diff --git a/third_party/WebKit/LayoutTests/imported/web-platform-tests/webstorage/idlharness.html b/third_party/WebKit/LayoutTests/imported/web-platform-tests/webstorage/idlharness.html
index 488b4b6..eb0c767f 100644
--- a/third_party/WebKit/LayoutTests/imported/web-platform-tests/webstorage/idlharness.html
+++ b/third_party/WebKit/LayoutTests/imported/web-platform-tests/webstorage/idlharness.html
@@ -31,7 +31,7 @@
   readonly attribute unsigned long length;
   DOMString? key(unsigned long index);
   getter DOMString? getItem(DOMString key);
-  setter creator void setItem(DOMString key, DOMString value);
+  setter void setItem(DOMString key, DOMString value);
   deleter void removeItem(DOMString key);
   void clear();
 };
diff --git a/third_party/WebKit/LayoutTests/imported/web-platform-tests/webstorage/storage_supported_property_names.html b/third_party/WebKit/LayoutTests/imported/web-platform-tests/webstorage/storage_supported_property_names.html
new file mode 100644
index 0000000..2bacd29
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/imported/web-platform-tests/webstorage/storage_supported_property_names.html
@@ -0,0 +1,23 @@
+<!DOCTYPE HTML>
+<meta charset=utf-8>
+<title>Storage Test: Supported property names</title>
+<script src="../../../resources/testharness.js"></script>
+<script src="../../../resources/testharnessreport.js"></script>
+<div id="log"></div>
+<script>
+    ["localStorage", "sessionStorage"].forEach(function(name) {
+        test(function() {
+            var storage = window[name];
+            storage.clear();
+
+            storage["name"] = "user1";
+            assert_array_equals(Object.getOwnPropertyNames(storage), ['name']);
+        }, "Object.getOwnPropertyNames on " + name + " Storage");
+
+        test(function() {
+            var storage = window[name];
+            storage.clear();
+            assert_array_equals(Object.getOwnPropertyNames(storage), []);
+        }, "Object.getOwnPropertyNames on " + name + " storage with empty collection");
+    });
+</script>
diff --git a/third_party/WebKit/LayoutTests/inspector/animation/animation-group-matching-expected.txt b/third_party/WebKit/LayoutTests/inspector/animation/animation-group-matching-expected.txt
new file mode 100644
index 0000000..e7876492e
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/inspector/animation/animation-group-matching-expected.txt
@@ -0,0 +1,21 @@
+Tests the matching of groups in AnimationModel.
+
+Animation group triggered
+First animation of type: CSSTransition
+Matches first group: true
+Animation group triggered
+First animation of type: CSSTransition
+Matches first group: true
+Animation group triggered
+First animation of type: CSSTransition
+Matches first group: true
+Animation group triggered
+First animation of type: CSSTransition
+Matches first group: true
+Animation group triggered
+First animation of type: CSSTransition
+Matches first group: true
+Animation group triggered
+First animation of type: CSSAnimation
+Matches first group: false
+
diff --git a/third_party/WebKit/LayoutTests/inspector/animation/animation-group-matching.html b/third_party/WebKit/LayoutTests/inspector/animation/animation-group-matching.html
new file mode 100644
index 0000000..af0420e
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/inspector/animation/animation-group-matching.html
@@ -0,0 +1,82 @@
+<html>
+<head>
+<style type="text/css">
+#node {
+    transition: height 150ms;
+}
+
+#node.css-anim {
+    animation: anim 300ms ease-in-out;
+}
+
+@keyframes anim {
+    from {
+        width: 100px;
+    }
+    to {
+        width: 200px;
+    }
+}
+</style>
+<script src="../../http/tests/inspector/inspector-test.js"></script>
+<script src="../../http/tests/inspector/elements-test.js"></script>
+<script>
+function startCSSTransition()
+{
+    node.style.height = Math.random() * 100 + "px";
+}
+
+function startCSSAnimation()
+{
+    node.classList.add("css-anim");
+}
+
+var initialize_Animations = function()
+{
+    InspectorTest.preloadModule("animation");
+}
+
+function test()
+{
+    var firstGroup;
+    var i = 0;
+    startTransition();
+
+    function startTransition()
+    {
+        var model = WebInspector.AnimationModel.fromTarget(InspectorTest.mainTarget);
+        model.ensureEnabled();
+        model.addEventListener(WebInspector.AnimationModel.Events.AnimationGroupStarted, groupStarted);
+        InspectorTest.evaluateInPage("startCSSTransition()");
+    }
+
+    function groupStarted(event)
+    {
+        InspectorTest.addResult("Animation group triggered");
+        InspectorTest.addResult("First animation of type: " + event.data.animations()[0].type());
+        var group = event.data;
+        if (!firstGroup)
+            firstGroup = group;
+        InspectorTest.addResult("Matches first group: " + firstGroup._matches(group));
+        i++;
+        if (i < 5)
+            InspectorTest.evaluateInPage("startCSSTransition()");
+        else if (i < 6)
+            InspectorTest.evaluateInPage("startCSSAnimation()");
+        else
+            InspectorTest.completeTest();
+    }
+}
+
+</script>
+</head>
+
+<body onload="runTest()">
+<p>
+Tests the matching of groups in AnimationModel.
+</p>
+
+<div id="node" style="background-color: red; height: 100px"></div>
+
+</body>
+</html>
diff --git a/third_party/WebKit/LayoutTests/inspector/layers/layer-compositing-reasons.html b/third_party/WebKit/LayoutTests/inspector/layers/layer-compositing-reasons.html
index f20521d..dbfa53a 100644
--- a/third_party/WebKit/LayoutTests/inspector/layers/layer-compositing-reasons.html
+++ b/third_party/WebKit/LayoutTests/inspector/layers/layer-compositing-reasons.html
@@ -45,7 +45,7 @@
 
     function onGotLayers()
     {
-        dumpCompositingReasons(InspectorTest.layerTreeModel.layerTree().contentRoot());
+        dumpCompositingReasons(InspectorTest.layerTreeModel().layerTree().contentRoot());
         for (var i = 0; i < idsToTest.length - 1; ++i)
             dumpCompositingReasons(InspectorTest.findLayerByNodeIdAttribute(idsToTest[i]));
         dumpCompositingReasons(InspectorTest.findLayerByNodeIdAttribute(idsToTest[idsToTest.length - 1]), InspectorTest.completeTest.bind(InspectorTest));
diff --git a/third_party/WebKit/LayoutTests/inspector/layers/layer-tree-model.html b/third_party/WebKit/LayoutTests/inspector/layers/layer-tree-model.html
index 63711cf..77ca0e9 100644
--- a/third_party/WebKit/LayoutTests/inspector/layers/layer-tree-model.html
+++ b/third_party/WebKit/LayoutTests/inspector/layers/layer-tree-model.html
@@ -38,7 +38,7 @@
     function step1()
     {
         // Assure layer objects are not re-created during updates.
-        InspectorTest.layerTreeModel.layerTree().forEachLayer(addDepthMarker);
+        InspectorTest.layerTreeModel().layerTree().forEachLayer(addDepthMarker);
         InspectorTest.addResult("Initial layer tree");
         InspectorTest.dumpLayerTree();
         InspectorTest.evaluateAndRunWhenTreeChanges("requestAnimationFrame(updateTree)", step2);
diff --git a/third_party/WebKit/LayoutTests/inspector/layers/layers-3d-view-hit-testing.html b/third_party/WebKit/LayoutTests/inspector/layers/layers-3d-view-hit-testing.html
index e171805..b8adb9a7 100644
--- a/third_party/WebKit/LayoutTests/inspector/layers/layers-3d-view-hit-testing.html
+++ b/third_party/WebKit/LayoutTests/inspector/layers/layers-3d-view-hit-testing.html
@@ -16,7 +16,7 @@
     {
         layerA = InspectorTest.findLayerByNodeIdAttribute("a");
         layerB = InspectorTest.findLayerByNodeIdAttribute("b");
-        contentRoot = InspectorTest.layerTreeModel.layerTree().contentRoot();
+        contentRoot = InspectorTest.layerTreeModel().layerTree().contentRoot();
         layers = [{layer: layerA, name: "layer a"}, {layer: layerB, name: "layer b"}, {layer: contentRoot, name: "content root"}];
     }
 
diff --git a/third_party/WebKit/LayoutTests/inspector/layers/no-overlay-layers.html b/third_party/WebKit/LayoutTests/inspector/layers/no-overlay-layers.html
index 4680677..0a82d716 100644
--- a/third_party/WebKit/LayoutTests/inspector/layers/no-overlay-layers.html
+++ b/third_party/WebKit/LayoutTests/inspector/layers/no-overlay-layers.html
@@ -24,7 +24,7 @@
     function step1()
     {
         // Assure layer objects are not re-created during updates.
-        InspectorTest.layerTreeModel.layerTree().forEachLayer(function(layer) { layersBeforeHighlight.push(layer.id()); });
+        InspectorTest.layerTreeModel().layerTree().forEachLayer(function(layer) { layersBeforeHighlight.push(layer.id()); });
         InspectorTest.DOMAgent.highlightRect(0, 0, 200, 200, {r:255, g:0, b:0});
         InspectorTest.evaluateAndRunWhenTreeChanges("requestAnimationFrame(updateGeometry)", step2);
     }
@@ -32,7 +32,7 @@
     function step2()
     {
         var layersAfterHighlight = [];
-        InspectorTest.layerTreeModel.layerTree().forEachLayer(function(layer) { layersAfterHighlight.push(layer.id()); });
+        InspectorTest.layerTreeModel().layerTree().forEachLayer(function(layer) { layersAfterHighlight.push(layer.id()); });
         layersBeforeHighlight.sort();
         layersAfterHighlight.sort();
         InspectorTest.assertEquals(JSON.stringify(layersBeforeHighlight), JSON.stringify(layersAfterHighlight));
diff --git a/third_party/WebKit/LayoutTests/inspector/tracing/layer-tree.html b/third_party/WebKit/LayoutTests/inspector/tracing/layer-tree.html
index 6dcfc14..79e32b3 100644
--- a/third_party/WebKit/LayoutTests/inspector/tracing/layer-tree.html
+++ b/third_party/WebKit/LayoutTests/inspector/tracing/layer-tree.html
@@ -34,7 +34,7 @@
 
     function layerTreeResolved(layerTree)
     {
-        InspectorTest.layerTreeModel.setLayerTree(layerTree);
+        InspectorTest.layerTreeModel().setLayerTree(layerTree);
         InspectorTest.dumpLayerTree();
         InspectorTest.completeTest();
     }
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text-autosizing/display-type-change-expected.png b/third_party/WebKit/LayoutTests/platform/android/fast/text-autosizing/display-type-change-expected.png
new file mode 100644
index 0000000..b2babf3
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text-autosizing/display-type-change-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text-autosizing/list-item-above-dbcat-expected.png b/third_party/WebKit/LayoutTests/platform/android/fast/text-autosizing/list-item-above-dbcat-expected.png
new file mode 100644
index 0000000..a400477
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text-autosizing/list-item-above-dbcat-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text-autosizing/list-item-above-dbcat-expected.txt b/third_party/WebKit/LayoutTests/platform/android/fast/text-autosizing/list-item-above-dbcat-expected.txt
new file mode 100644
index 0000000..a3a182e
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text-autosizing/list-item-above-dbcat-expected.txt
@@ -0,0 +1,24 @@
+layer at (0,0) size 800x600
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x593
+  LayoutBlockFlow {HTML} at (0,0) size 800x593
+    LayoutBlockFlow {BODY} at (0,0) size 800x336
+      LayoutBlockFlow {DIV} at (0,0) size 800x336
+        LayoutText {#text} at (0,1) size 790x334
+          text run at (0,1) width 790: "This test verifies that FastTextAutosizer considers"
+          text run at (0,49) width 702: "a list item (LI) to be \"text\" for the purpose of"
+          text run at (0,97) width 769: "determining the deepest block containing all text"
+          text run at (0,145) width 761: "(DBCAT). If this were not the case, the cluster's"
+          text run at (0,193) width 755: "DBCAT would be the DIV inside the LI, which"
+          text run at (0,241) width 752: "hasn't entered layout yet when the list marker is"
+          text run at (0,289) width 661: "autosized (causing the autosizer to crash)."
+      LayoutBlockFlow (floating) {UL} at (0,352) size 800x225
+        LayoutListItem {LI} at (40,0) size 760x225
+          LayoutBlockFlow {DIV} at (0,0) size 760x225
+            LayoutListMarker (anonymous) at (-30,1) size 13x43: bullet
+            LayoutText {#text} at (0,1) size 748x223
+              text run at (0,1) width 739: "List item list item list item list item list item list"
+              text run at (0,46) width 748: "item list item list item list item list item list item"
+              text run at (0,91) width 728: "list item list item list item list item list item list"
+              text run at (0,136) width 748: "item list item list item list item list item list item"
+              text run at (0,181) width 126: "list item"
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text-autosizing/tables/css-table-single-cell-lots-of-text-expected.png b/third_party/WebKit/LayoutTests/platform/android/fast/text-autosizing/tables/css-table-single-cell-lots-of-text-expected.png
new file mode 100644
index 0000000..9b43d1e
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text-autosizing/tables/css-table-single-cell-lots-of-text-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text-autosizing/tables/css-table-single-cell-lots-of-text-expected.txt b/third_party/WebKit/LayoutTests/platform/android/fast/text-autosizing/tables/css-table-single-cell-lots-of-text-expected.txt
new file mode 100644
index 0000000..9ec1efd7
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text-autosizing/tables/css-table-single-cell-lots-of-text-expected.txt
@@ -0,0 +1,46 @@
+layer at (0,0) size 800x600
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x567
+  LayoutBlockFlow {HTML} at (0,0) size 800x567
+    LayoutBlockFlow {BODY} at (0,0) size 800x566
+      LayoutBlockFlow {DIV} at (0,0) size 600x36
+        LayoutText {#text} at (0,0) size 291x15
+          text run at (0,0) width 291: "Table autosizing tests - css-table-single-cell-lots-of-text.html"
+        LayoutBR {BR} at (291,0) size 0x15
+        LayoutText {#text} at (0,16) size 568x15
+          text run at (0,16) width 568: "This test passes if there is a one cell with lots of text that's autosized, and five single-word cells that are not autosized."
+      LayoutTable {DIV} at (1,37) size 798x529
+        LayoutTableSection (anonymous) at (0,0) size 798x529
+          LayoutTableRow {DIV} at (0,0) size 798x37
+            LayoutTableCell {DIV} at (0,15) size 25x18 [bgcolor=#F0FFF0] [border: (1px dotted #006400)] [r=0 c=0 rs=1 cs=1]
+              LayoutText {#text} at (1,1) size 23x15
+                text run at (1,1) width 23: "hello"
+            LayoutTableCell {DIV} at (25,0) size 748x37 [bgcolor=#F0FFF0] [border: (1px dotted #006400)] [r=0 c=1 rs=1 cs=1]
+              LayoutText {#text} at (1,1) size 57x34
+                text run at (1,1) width 57: "hello"
+            LayoutTableCell {DIV} at (773,15) size 25x18 [bgcolor=#F0FFF0] [border: (1px dotted #006400)] [r=0 c=2 rs=1 cs=1]
+              LayoutText {#text} at (1,1) size 23x15
+                text run at (1,1) width 23: "hello"
+          LayoutTableRow {DIV} at (0,37) size 798x492
+            LayoutTableCell {DIV} at (0,52) size 25x18 [bgcolor=#F0FFF0] [border: (1px dotted #006400)] [r=1 c=0 rs=1 cs=1]
+              LayoutText {#text} at (1,1) size 23x15
+                text run at (1,1) width 23: "hello"
+            LayoutTableCell {DIV} at (25,37) size 748x492 [bgcolor=#F0FFF0] [border: (1px dotted #006400)] [r=1 c=1 rs=1 cs=1]
+              LayoutText {#text} at (1,1) size 707x489
+                text run at (1,1) width 707: "hello hello hello hello hello hello hello hello hello hello hello"
+                text run at (1,36) width 707: "hello hello hello hello hello hello hello hello hello hello hello"
+                text run at (1,71) width 707: "hello hello hello hello hello hello hello hello hello hello hello"
+                text run at (1,106) width 707: "hello hello hello hello hello hello hello hello hello hello hello"
+                text run at (1,141) width 707: "hello hello hello hello hello hello hello hello hello hello hello"
+                text run at (1,176) width 707: "hello hello hello hello hello hello hello hello hello hello hello"
+                text run at (1,211) width 707: "hello hello hello hello hello hello hello hello hello hello hello"
+                text run at (1,246) width 707: "hello hello hello hello hello hello hello hello hello hello hello"
+                text run at (1,281) width 707: "hello hello hello hello hello hello hello hello hello hello hello"
+                text run at (1,316) width 707: "hello hello hello hello hello hello hello hello hello hello hello"
+                text run at (1,351) width 707: "hello hello hello hello hello hello hello hello hello hello hello"
+                text run at (1,386) width 707: "hello hello hello hello hello hello hello hello hello hello hello"
+                text run at (1,421) width 707: "hello hello hello hello hello hello hello hello hello hello hello"
+                text run at (1,456) width 577: "hello hello hello hello hello hello hello hello hello"
+            LayoutTableCell {DIV} at (773,52) size 25x18 [bgcolor=#F0FFF0] [border: (1px dotted #006400)] [r=1 c=2 rs=1 cs=1]
+              LayoutText {#text} at (1,1) size 23x15
+                text run at (1,1) width 23: "hello"
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text-autosizing/tables/fixed-table-single-cell-lots-of-text-expected.png b/third_party/WebKit/LayoutTests/platform/android/fast/text-autosizing/tables/fixed-table-single-cell-lots-of-text-expected.png
new file mode 100644
index 0000000..69f28aa
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text-autosizing/tables/fixed-table-single-cell-lots-of-text-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text-autosizing/tables/fixed-table-single-cell-lots-of-text-expected.txt b/third_party/WebKit/LayoutTests/platform/android/fast/text-autosizing/tables/fixed-table-single-cell-lots-of-text-expected.txt
new file mode 100644
index 0000000..b624076
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text-autosizing/tables/fixed-table-single-cell-lots-of-text-expected.txt
@@ -0,0 +1,46 @@
+layer at (0,0) size 800x600
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x570
+  LayoutBlockFlow {HTML} at (0,0) size 800x570
+    LayoutBlockFlow {BODY} at (0,0) size 800x569
+      LayoutBlockFlow {DIV} at (0,0) size 600x36
+        LayoutText {#text} at (0,0) size 299x15
+          text run at (0,0) width 299: "Table autosizing tests - fixed-table-single-cell-lots-of-text.html"
+        LayoutBR {BR} at (299,0) size 0x15
+        LayoutText {#text} at (0,16) size 568x15
+          text run at (0,16) width 568: "This test passes if there is a one cell with lots of text that's autosized, and five single-word cells that are not autosized."
+      LayoutTable {TABLE} at (1,37) size 798x532 [border: none]
+        LayoutTableSection {TBODY} at (0,0) size 797x531
+          LayoutTableRow {TR} at (0,0) size 797x38
+            LayoutTableCell {TD} at (0,9) size 26x19 [bgcolor=#F0FFF0] [border: (1px dotted #006400)] [r=0 c=0 rs=1 cs=1]
+              LayoutText {#text} at (2,2) size 23x15
+                text run at (2,2) width 23: "hello"
+            LayoutTableCell {TD} at (26,0) size 745x38 [bgcolor=#F0FFF0] [border: (1px dotted #006400)] [r=0 c=1 rs=1 cs=1]
+              LayoutText {#text} at (2,2) size 57x34
+                text run at (2,2) width 57: "hello"
+            LayoutTableCell {TD} at (771,9) size 26x19 [bgcolor=#F0FFF0] [border: (1px dotted #006400)] [r=0 c=2 rs=1 cs=1]
+              LayoutText {#text} at (2,2) size 23x15
+                text run at (2,2) width 23: "hello"
+          LayoutTableRow {TR} at (0,38) size 797x493
+            LayoutTableCell {TD} at (0,275) size 26x19 [bgcolor=#F0FFF0] [border: (1px dotted #006400)] [r=1 c=0 rs=1 cs=1]
+              LayoutText {#text} at (2,2) size 23x15
+                text run at (2,2) width 23: "hello"
+            LayoutTableCell {TD} at (26,38) size 745x493 [bgcolor=#F0FFF0] [border: (1px dotted #006400)] [r=1 c=1 rs=1 cs=1]
+              LayoutText {#text} at (2,2) size 707x489
+                text run at (2,2) width 707: "hello hello hello hello hello hello hello hello hello hello hello"
+                text run at (2,37) width 707: "hello hello hello hello hello hello hello hello hello hello hello"
+                text run at (2,72) width 707: "hello hello hello hello hello hello hello hello hello hello hello"
+                text run at (2,107) width 707: "hello hello hello hello hello hello hello hello hello hello hello"
+                text run at (2,142) width 707: "hello hello hello hello hello hello hello hello hello hello hello"
+                text run at (2,177) width 707: "hello hello hello hello hello hello hello hello hello hello hello"
+                text run at (2,212) width 707: "hello hello hello hello hello hello hello hello hello hello hello"
+                text run at (2,247) width 707: "hello hello hello hello hello hello hello hello hello hello hello"
+                text run at (2,282) width 707: "hello hello hello hello hello hello hello hello hello hello hello"
+                text run at (2,317) width 707: "hello hello hello hello hello hello hello hello hello hello hello"
+                text run at (2,352) width 707: "hello hello hello hello hello hello hello hello hello hello hello"
+                text run at (2,387) width 707: "hello hello hello hello hello hello hello hello hello hello hello"
+                text run at (2,422) width 707: "hello hello hello hello hello hello hello hello hello hello hello"
+                text run at (2,457) width 577: "hello hello hello hello hello hello hello hello hello"
+            LayoutTableCell {TD} at (771,275) size 26x19 [bgcolor=#F0FFF0] [border: (1px dotted #006400)] [r=1 c=2 rs=1 cs=1]
+              LayoutText {#text} at (2,2) size 23x15
+                text run at (2,2) width 23: "hello"
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text-autosizing/tables/nested-table-wrapping-expected.png b/third_party/WebKit/LayoutTests/platform/android/fast/text-autosizing/tables/nested-table-wrapping-expected.png
new file mode 100644
index 0000000..6ac8e592
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text-autosizing/tables/nested-table-wrapping-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text-autosizing/tables/nested-table-wrapping-expected.txt b/third_party/WebKit/LayoutTests/platform/android/fast/text-autosizing/tables/nested-table-wrapping-expected.txt
new file mode 100644
index 0000000..04a4c41
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text-autosizing/tables/nested-table-wrapping-expected.txt
@@ -0,0 +1,29 @@
+layer at (0,0) size 800x600
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x274
+  LayoutBlockFlow {HTML} at (0,0) size 800x274
+    LayoutBlockFlow {BODY} at (0,0) size 800x273
+      LayoutBlockFlow {DIV} at (0,0) size 600x36
+        LayoutText {#text} at (0,0) size 248x15
+          text run at (0,0) width 248: "Table autosizing tests - nested-table-wrapping.html"
+        LayoutBR {BR} at (248,0) size 0x15
+        LayoutText {#text} at (0,16) size 396x15
+          text run at (0,16) width 396: "This test passes if \"the table cell should tightly wrap this text\" is tightly wrapped."
+      LayoutTable {TABLE} at (1,37) size 798x236 [border: none]
+        LayoutTableSection {TBODY} at (0,0) size 797x235
+          LayoutTableRow {TR} at (0,0) size 797x235
+            LayoutTableCell {TD} at (0,0) size 797x235 [bgcolor=#F0FFF0] [border: (1px dotted #006400)] [r=0 c=0 rs=1 cs=1]
+              LayoutBlockFlow (anonymous) at (2,2) size 794x210
+                LayoutText {#text} at (0,0) size 769x209
+                  text run at (0,0) width 769: "Autosize Autosize Autosize Autosize Autosize Autosize Autosize"
+                  text run at (0,35) width 769: "Autosize Autosize Autosize Autosize Autosize Autosize Autosize"
+                  text run at (0,70) width 769: "Autosize Autosize Autosize Autosize Autosize Autosize Autosize"
+                  text run at (0,105) width 769: "Autosize Autosize Autosize Autosize Autosize Autosize Autosize"
+                  text run at (0,140) width 769: "Autosize Autosize Autosize Autosize Autosize Autosize Autosize"
+                  text run at (0,175) width 436: "Autosize Autosize Autosize Autosize"
+              LayoutTable {TABLE} at (3,213) size 204x20 [border: none]
+                LayoutTableSection {TBODY} at (0,0) size 203x19
+                  LayoutTableRow {TR} at (0,0) size 203x19
+                    LayoutTableCell {TD} at (0,0) size 203x19 [bgcolor=#F0FFF0] [border: (1px dotted #006400)] [r=0 c=0 rs=1 cs=1]
+                      LayoutText {#text} at (2,2) size 200x15
+                        text run at (2,2) width 200: "the table cell should tightly wrap this text"
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text-autosizing/tables/single-cell-lots-of-text-expected.png b/third_party/WebKit/LayoutTests/platform/android/fast/text-autosizing/tables/single-cell-lots-of-text-expected.png
new file mode 100644
index 0000000..1e975de
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text-autosizing/tables/single-cell-lots-of-text-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text-autosizing/tables/single-cell-lots-of-text-expected.txt b/third_party/WebKit/LayoutTests/platform/android/fast/text-autosizing/tables/single-cell-lots-of-text-expected.txt
new file mode 100644
index 0000000..284a910e
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text-autosizing/tables/single-cell-lots-of-text-expected.txt
@@ -0,0 +1,46 @@
+layer at (0,0) size 800x600
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x570
+  LayoutBlockFlow {HTML} at (0,0) size 800x570
+    LayoutBlockFlow {BODY} at (0,0) size 800x569
+      LayoutBlockFlow {DIV} at (0,0) size 600x36
+        LayoutText {#text} at (0,0) size 245x15
+          text run at (0,0) width 245: "Table autosizing tests - single-cell-lots-of-text.html"
+        LayoutBR {BR} at (245,0) size 0x15
+        LayoutText {#text} at (0,16) size 568x15
+          text run at (0,16) width 568: "This test passes if there is a one cell with lots of text that's autosized, and five single-word cells that are not autosized."
+      LayoutTable {TABLE} at (1,37) size 798x532 [border: none]
+        LayoutTableSection {TBODY} at (0,0) size 797x531
+          LayoutTableRow {TR} at (0,0) size 797x38
+            LayoutTableCell {TD} at (0,9) size 26x19 [bgcolor=#F0FFF0] [border: (1px dotted #006400)] [r=0 c=0 rs=1 cs=1]
+              LayoutText {#text} at (2,2) size 23x15
+                text run at (2,2) width 23: "hello"
+            LayoutTableCell {TD} at (26,0) size 745x38 [bgcolor=#F0FFF0] [border: (1px dotted #006400)] [r=0 c=1 rs=1 cs=1]
+              LayoutText {#text} at (2,2) size 57x34
+                text run at (2,2) width 57: "hello"
+            LayoutTableCell {TD} at (771,9) size 26x19 [bgcolor=#F0FFF0] [border: (1px dotted #006400)] [r=0 c=2 rs=1 cs=1]
+              LayoutText {#text} at (2,2) size 23x15
+                text run at (2,2) width 23: "hello"
+          LayoutTableRow {TR} at (0,38) size 797x493
+            LayoutTableCell {TD} at (0,275) size 26x19 [bgcolor=#F0FFF0] [border: (1px dotted #006400)] [r=1 c=0 rs=1 cs=1]
+              LayoutText {#text} at (2,2) size 23x15
+                text run at (2,2) width 23: "hello"
+            LayoutTableCell {TD} at (26,38) size 745x493 [bgcolor=#F0FFF0] [border: (1px dotted #006400)] [r=1 c=1 rs=1 cs=1]
+              LayoutText {#text} at (2,2) size 707x489
+                text run at (2,2) width 707: "hello hello hello hello hello hello hello hello hello hello hello"
+                text run at (2,37) width 707: "hello hello hello hello hello hello hello hello hello hello hello"
+                text run at (2,72) width 707: "hello hello hello hello hello hello hello hello hello hello hello"
+                text run at (2,107) width 707: "hello hello hello hello hello hello hello hello hello hello hello"
+                text run at (2,142) width 707: "hello hello hello hello hello hello hello hello hello hello hello"
+                text run at (2,177) width 707: "hello hello hello hello hello hello hello hello hello hello hello"
+                text run at (2,212) width 707: "hello hello hello hello hello hello hello hello hello hello hello"
+                text run at (2,247) width 707: "hello hello hello hello hello hello hello hello hello hello hello"
+                text run at (2,282) width 707: "hello hello hello hello hello hello hello hello hello hello hello"
+                text run at (2,317) width 707: "hello hello hello hello hello hello hello hello hello hello hello"
+                text run at (2,352) width 707: "hello hello hello hello hello hello hello hello hello hello hello"
+                text run at (2,387) width 707: "hello hello hello hello hello hello hello hello hello hello hello"
+                text run at (2,422) width 707: "hello hello hello hello hello hello hello hello hello hello hello"
+                text run at (2,457) width 577: "hello hello hello hello hello hello hello hello hello"
+            LayoutTableCell {TD} at (771,275) size 26x19 [bgcolor=#F0FFF0] [border: (1px dotted #006400)] [r=1 c=2 rs=1 cs=1]
+              LayoutText {#text} at (2,2) size 23x15
+                text run at (2,2) width 23: "hello"
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text-autosizing/tables/single-percent-width-cell-lots-of-text-expected.png b/third_party/WebKit/LayoutTests/platform/android/fast/text-autosizing/tables/single-percent-width-cell-lots-of-text-expected.png
new file mode 100644
index 0000000..2f4e13c
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text-autosizing/tables/single-percent-width-cell-lots-of-text-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text-autosizing/tables/table-cell-inflation-expected.png b/third_party/WebKit/LayoutTests/platform/android/fast/text-autosizing/tables/table-cell-inflation-expected.png
new file mode 100644
index 0000000..c7e28c35
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text-autosizing/tables/table-cell-inflation-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text-autosizing/tables/table-cell-inflation-expected.txt b/third_party/WebKit/LayoutTests/platform/android/fast/text-autosizing/tables/table-cell-inflation-expected.txt
new file mode 100644
index 0000000..e869e51
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text-autosizing/tables/table-cell-inflation-expected.txt
@@ -0,0 +1,29 @@
+layer at (0,0) size 800x600
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x240
+  LayoutBlockFlow {HTML} at (0,0) size 800x240
+    LayoutBlockFlow {BODY} at (0,0) size 500x239
+      LayoutBlockFlow {DIV} at (0,0) size 600x36
+        LayoutText {#text} at (0,0) size 227x15
+          text run at (0,0) width 227: "Table autosizing tests - table-cell-inflation.html"
+        LayoutBR {BR} at (227,0) size 0x15
+        LayoutText {#text} at (0,16) size 361x15
+          text run at (0,16) width 361: "This test passes if there are no numbers overflowing outside this green box."
+      LayoutTable {TABLE} at (1,37) size 693x202 [border: none]
+        LayoutTableSection {TBODY} at (0,0) size 692x201
+          LayoutTableRow {TR} at (0,0) size 692x201
+            LayoutTableCell {TD} at (0,0) size 692x201 [bgcolor=#F0FFF0] [border: (1px dotted #006400)] [r=0 c=0 rs=1 cs=1]
+              LayoutText {#text} at (2,2) size 439x21
+                text run at (2,2) width 439: "The pi approximation below should not overrun this block."
+              LayoutBR {BR} at (441,2) size 0x21
+              LayoutText {#text} at (2,24) size 689x21
+                text run at (2,24) width 689: "3.141592653589793238462643383279502884197169399375105820974944592307816406286"
+              LayoutBR {BR} at (691,24) size 0x21
+              LayoutText {#text} at (2,46) size 675x153
+                text run at (2,46) width 675: "hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello"
+                text run at (2,68) width 675: "hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello"
+                text run at (2,90) width 675: "hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello"
+                text run at (2,112) width 675: "hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello"
+                text run at (2,134) width 675: "hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello"
+                text run at (2,156) width 675: "hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello"
+                text run at (2,178) width 235: "hello hello hello hello hello hello"
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text-autosizing/tables/table-for-layout-expected.png b/third_party/WebKit/LayoutTests/platform/android/fast/text-autosizing/tables/table-for-layout-expected.png
new file mode 100644
index 0000000..bc9713a4
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text-autosizing/tables/table-for-layout-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text-autosizing/tables/table-for-layout-expected.txt b/third_party/WebKit/LayoutTests/platform/android/fast/text-autosizing/tables/table-for-layout-expected.txt
new file mode 100644
index 0000000..2c1cd86
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text-autosizing/tables/table-for-layout-expected.txt
@@ -0,0 +1,55 @@
+layer at (0,0) size 800x600
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x411
+  LayoutBlockFlow {HTML} at (0,0) size 800x411
+    LayoutBlockFlow {BODY} at (0,0) size 800x410
+      LayoutBlockFlow {DIV} at (0,0) size 600x36
+        LayoutText {#text} at (0,0) size 216x15
+          text run at (0,0) width 216: "Table autosizing tests - table-for-layout.html"
+        LayoutBR {BR} at (216,0) size 0x15
+        LayoutText {#text} at (0,16) size 256x15
+          text run at (0,16) width 256: "This test passes if the main content area is autosized."
+      LayoutTable {TABLE} at (1,37) size 798x373 [border: none]
+        LayoutTableSection {TBODY} at (0,0) size 797x372
+          LayoutTableRow {TR} at (0,0) size 797x19
+            LayoutTableCell {TD} at (0,0) size 797x19 [bgcolor=#F0FFF0] [border: (1px dotted #006400)] [r=0 c=0 rs=1 cs=2]
+              LayoutText {#text} at (2,2) size 23x15
+                text run at (2,2) width 23: "Title"
+          LayoutTableRow {TR} at (0,19) size 797x353
+            LayoutTableCell {TD} at (0,130) size 52x131 [bgcolor=#F0FFF0] [border: (1px dotted #006400)] [r=1 c=0 rs=1 cs=1]
+              LayoutText {#text} at (2,2) size 23x15
+                text run at (2,2) width 23: "hello"
+              LayoutBR {BR} at (25,2) size 0x15
+              LayoutText {#text} at (2,18) size 49x15
+                text run at (2,18) width 49: "navigation"
+              LayoutBR {BR} at (51,18) size 0x15
+              LayoutText {#text} at (2,34) size 49x15
+                text run at (2,34) width 49: "navigation"
+              LayoutBR {BR} at (51,34) size 0x15
+              LayoutText {#text} at (2,50) size 49x15
+                text run at (2,50) width 49: "navigation"
+              LayoutBR {BR} at (51,50) size 0x15
+              LayoutText {#text} at (2,66) size 49x15
+                text run at (2,66) width 49: "navigation"
+              LayoutBR {BR} at (51,66) size 0x15
+              LayoutText {#text} at (2,82) size 49x15
+                text run at (2,82) width 49: "navigation"
+              LayoutBR {BR} at (51,82) size 0x15
+              LayoutText {#text} at (2,98) size 49x15
+                text run at (2,98) width 49: "navigation"
+              LayoutBR {BR} at (51,98) size 0x15
+              LayoutText {#text} at (2,114) size 49x15
+                text run at (2,114) width 49: "navigation"
+              LayoutBR {BR} at (51,114) size 0x15
+            LayoutTableCell {TD} at (52,19) size 745x353 [bgcolor=#F0FFF0] [border: (1px dotted #006400)] [r=1 c=1 rs=1 cs=1]
+              LayoutText {#text} at (2,2) size 707x349
+                text run at (2,2) width 707: "hello hello hello hello hello hello hello hello hello hello hello"
+                text run at (2,37) width 707: "hello hello hello hello hello hello hello hello hello hello hello"
+                text run at (2,72) width 707: "hello hello hello hello hello hello hello hello hello hello hello"
+                text run at (2,107) width 707: "hello hello hello hello hello hello hello hello hello hello hello"
+                text run at (2,142) width 707: "hello hello hello hello hello hello hello hello hello hello hello"
+                text run at (2,177) width 707: "hello hello hello hello hello hello hello hello hello hello hello"
+                text run at (2,212) width 707: "hello hello hello hello hello hello hello hello hello hello hello"
+                text run at (2,247) width 707: "hello hello hello hello hello hello hello hello hello hello hello"
+                text run at (2,282) width 707: "hello hello hello hello hello hello hello hello hello hello hello"
+                text run at (2,317) width 317: "hello hello hello hello hello"
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text-autosizing/tables/table-with-inline-block-expected.png b/third_party/WebKit/LayoutTests/platform/android/fast/text-autosizing/tables/table-with-inline-block-expected.png
new file mode 100644
index 0000000..f750516
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text-autosizing/tables/table-with-inline-block-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text-autosizing/tables/wide-percentage-width-expected.png b/third_party/WebKit/LayoutTests/platform/android/fast/text-autosizing/tables/wide-percentage-width-expected.png
new file mode 100644
index 0000000..ea5f2b5
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text-autosizing/tables/wide-percentage-width-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text-autosizing/tables/wide-percentage-width-expected.txt b/third_party/WebKit/LayoutTests/platform/android/fast/text-autosizing/tables/wide-percentage-width-expected.txt
new file mode 100644
index 0000000..f98402bd
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text-autosizing/tables/wide-percentage-width-expected.txt
@@ -0,0 +1,37 @@
+layer at (0,0) size 800x600
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x177
+  LayoutBlockFlow {HTML} at (0,0) size 800x177
+    LayoutBlockFlow {BODY} at (0,0) size 800x176
+      LayoutBlockFlow {DIV} at (0,0) size 600x36
+        LayoutText {#text} at (0,0) size 250x15
+          text run at (0,0) width 250: "Table autosizing tests - wide-percentage-width.html"
+        LayoutBR {BR} at (250,0) size 0x15
+        LayoutText {#text} at (0,16) size 472x15
+          text run at (0,16) width 472: "This test passes if the cell with lots of text is autosized and none of the other 5 cells are autosized."
+      LayoutTable {TABLE} at (1,37) size 500x139 [border: none]
+        LayoutTableSection {TBODY} at (0,0) size 499x138
+          LayoutTableRow {TR} at (0,0) size 499x25
+            LayoutTableCell {TD} at (0,3) size 26x19 [bgcolor=#F0FFF0] [border: (1px dotted #006400)] [r=0 c=0 rs=1 cs=1]
+              LayoutText {#text} at (2,2) size 23x15
+                text run at (2,2) width 23: "hello"
+            LayoutTableCell {TD} at (26,0) size 447x25 [bgcolor=#F0FFF0] [border: (1px dotted #006400)] [r=0 c=1 rs=1 cs=1]
+              LayoutText {#text} at (2,2) size 35x21
+                text run at (2,2) width 35: "hello"
+            LayoutTableCell {TD} at (473,3) size 26x19 [bgcolor=#F0FFF0] [border: (1px dotted #006400)] [r=0 c=2 rs=1 cs=1]
+              LayoutText {#text} at (2,2) size 23x15
+                text run at (2,2) width 23: "hello"
+          LayoutTableRow {TR} at (0,25) size 499x113
+            LayoutTableCell {TD} at (0,72) size 26x19 [bgcolor=#F0FFF0] [border: (1px dotted #006400)] [r=1 c=0 rs=1 cs=1]
+              LayoutText {#text} at (2,2) size 23x15
+                text run at (2,2) width 23: "hello"
+            LayoutTableCell {TD} at (26,25) size 447x113 [bgcolor=#F0FFF0] [border: (1px dotted #006400)] [r=1 c=1 rs=1 cs=1]
+              LayoutText {#text} at (2,2) size 435x109
+                text run at (2,2) width 435: "hello hello hello hello hello hello hello hello hello hello hello"
+                text run at (2,24) width 435: "hello hello hello hello hello hello hello hello hello hello hello"
+                text run at (2,46) width 435: "hello hello hello hello hello hello hello hello hello hello hello"
+                text run at (2,68) width 435: "hello hello hello hello hello hello hello hello hello hello hello"
+                text run at (2,90) width 315: "hello hello hello hello hello hello hello hello"
+            LayoutTableCell {TD} at (473,72) size 26x19 [bgcolor=#F0FFF0] [border: (1px dotted #006400)] [r=1 c=2 rs=1 cs=1]
+              LayoutText {#text} at (2,2) size 23x15
+                text run at (2,2) width 23: "hello"
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text-autosizing/tables/wide-specified-width-expected.png b/third_party/WebKit/LayoutTests/platform/android/fast/text-autosizing/tables/wide-specified-width-expected.png
new file mode 100644
index 0000000..2c18fbd
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text-autosizing/tables/wide-specified-width-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text-autosizing/tables/wide-specified-width-expected.txt b/third_party/WebKit/LayoutTests/platform/android/fast/text-autosizing/tables/wide-specified-width-expected.txt
new file mode 100644
index 0000000..58c91db
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text-autosizing/tables/wide-specified-width-expected.txt
@@ -0,0 +1,37 @@
+layer at (0,0) size 800x600
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x177
+  LayoutBlockFlow {HTML} at (0,0) size 800x177
+    LayoutBlockFlow {BODY} at (0,0) size 800x176
+      LayoutBlockFlow {DIV} at (0,0) size 600x36
+        LayoutText {#text} at (0,0) size 242x15
+          text run at (0,0) width 242: "Table autosizing tests - wide-specified-width.html"
+        LayoutBR {BR} at (242,0) size 0x15
+        LayoutText {#text} at (0,16) size 472x15
+          text run at (0,16) width 472: "This test passes if the cell with lots of text is autosized and none of the other 5 cells are autosized."
+      LayoutTable {TABLE} at (1,37) size 500x139 [border: none]
+        LayoutTableSection {TBODY} at (0,0) size 499x138
+          LayoutTableRow {TR} at (0,0) size 499x25
+            LayoutTableCell {TD} at (0,3) size 26x19 [bgcolor=#F0FFF0] [border: (1px dotted #006400)] [r=0 c=0 rs=1 cs=1]
+              LayoutText {#text} at (2,2) size 23x15
+                text run at (2,2) width 23: "hello"
+            LayoutTableCell {TD} at (26,0) size 447x25 [bgcolor=#F0FFF0] [border: (1px dotted #006400)] [r=0 c=1 rs=1 cs=1]
+              LayoutText {#text} at (2,2) size 35x21
+                text run at (2,2) width 35: "hello"
+            LayoutTableCell {TD} at (473,3) size 26x19 [bgcolor=#F0FFF0] [border: (1px dotted #006400)] [r=0 c=2 rs=1 cs=1]
+              LayoutText {#text} at (2,2) size 23x15
+                text run at (2,2) width 23: "hello"
+          LayoutTableRow {TR} at (0,25) size 499x113
+            LayoutTableCell {TD} at (0,72) size 26x19 [bgcolor=#F0FFF0] [border: (1px dotted #006400)] [r=1 c=0 rs=1 cs=1]
+              LayoutText {#text} at (2,2) size 23x15
+                text run at (2,2) width 23: "hello"
+            LayoutTableCell {TD} at (26,25) size 447x113 [bgcolor=#F0FFF0] [border: (1px dotted #006400)] [r=1 c=1 rs=1 cs=1]
+              LayoutText {#text} at (2,2) size 435x109
+                text run at (2,2) width 435: "hello hello hello hello hello hello hello hello hello hello hello"
+                text run at (2,24) width 435: "hello hello hello hello hello hello hello hello hello hello hello"
+                text run at (2,46) width 435: "hello hello hello hello hello hello hello hello hello hello hello"
+                text run at (2,68) width 435: "hello hello hello hello hello hello hello hello hello hello hello"
+                text run at (2,90) width 315: "hello hello hello hello hello hello hello hello"
+            LayoutTableCell {TD} at (473,72) size 26x19 [bgcolor=#F0FFF0] [border: (1px dotted #006400)] [r=1 c=2 rs=1 cs=1]
+              LayoutText {#text} at (2,2) size 23x15
+                text run at (2,2) width 23: "hello"
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text/atsui-negative-spacing-features-expected.txt b/third_party/WebKit/LayoutTests/platform/android/fast/text/atsui-negative-spacing-features-expected.txt
new file mode 100644
index 0000000..85475d55
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text/atsui-negative-spacing-features-expected.txt
@@ -0,0 +1,51 @@
+layer at (0,0) size 800x600
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x260
+  LayoutBlockFlow {HTML} at (0,0) size 800x260
+    LayoutBlockFlow {BODY} at (8,16) size 784x236
+      LayoutBlockFlow {P} at (0,0) size 784x20
+        LayoutText {#text} at (0,0) size 349x19
+          text run at (0,0) width 349: "Test for negative spacing values in complex text rendering."
+      LayoutBlockFlow (anonymous) at (0,36) size 784x20
+        LayoutText {#text} at (0,0) size 483x19
+          text run at (0,0) width 483: "Each green box should be identical to the blue box it follows, except for accents."
+      LayoutBlockFlow {HR} at (0,64) size 784x2 [border: (1px inset #EEEEEE)]
+      LayoutTable {TABLE} at (0,74) size 414x162
+        LayoutTableSection {TBODY} at (0,0) size 414x162
+          LayoutTableRow {TR} at (0,2) size 414x22
+            LayoutTableCell {TD} at (2,2) size 204x22 [r=0 c=0 rs=1 cs=1]
+              LayoutText {#text} at (59,1) size 86x19
+                text run at (59,1) width 86: "Word spacing"
+            LayoutTableCell {TD} at (208,2) size 204x22 [r=0 c=1 rs=1 cs=1]
+              LayoutText {#text} at (59,1) size 86x19
+                text run at (59,1) width 86: "Letter spacing"
+          LayoutTableRow {TR} at (0,26) size 414x134
+            LayoutTableCell {TD} at (2,26) size 204x134 [r=1 c=0 rs=1 cs=1]
+              LayoutBlockFlow {DIV} at (1,1) size 202x132
+                LayoutBlockFlow {DIV} at (0,0) size 202x38 [border: (1px solid #0000FF)]
+                  LayoutText {#text} at (26,0) size 175x37
+                    text run at (26,0) width 175 RTL: "\x{5D9}\x{5B0}\x{5D4}\x{5B4}\x{5D9}, \x{5D0}\x{5B8}\x{5D7}\x{5B4}\x{5D9}, \x{5DC}\x{5B0}\x{5DA}\x{5B8} \x{5E1}\x{5B5}\x{5E4}\x{5B6}\x{5E8} \x{5E9}\x{5C1}\x{5B0}\x{5DC}\x{5B7}\x{5D7}\x{5B0}\x{5EA}\x{5BC}\x{5B4}\x{5D9}\x{5D5} \x{5D5}\x{5BC}\x{5DE}\x{5B4}\x{5DE}\x{5B0}\x{5DB}\x{5BC}\x{5B6}\x{5E8}\x{5B6}\x{5EA}"
+                    text run at (101,18) width 100 RTL: "\x{5E6}\x{5B0}\x{5DE}\x{5B4}\x{5D9}\x{5EA}\x{5D5}\x{5BC}\x{5EA} \x{5DC}\x{5B8}\x{5DA}\x{5B0} \x{5DE}\x{5B0}\x{5DB}\x{5B7}\x{5E8}\x{5B0}\x{5EA}\x{5BC}\x{5B4}\x{5D9}\x{5D5}."
+                LayoutBlockFlow {DIV} at (0,43) size 202x42 [border: (1px solid #0000FF)]
+                  LayoutText {#text} at (1,1) size 161x39
+                    text run at (1,1) width 161: "Lore\x{300}m ipsum dolor sit ame\x{300}t,"
+                    text run at (1,21) width 160: "consectetuer adipiscing e\x{300}lit."
+                LayoutBlockFlow {DIV} at (0,90) size 202x42 [border: (1px solid #008000)]
+                  LayoutText {#text} at (1,1) size 161x39
+                    text run at (1,1) width 161: "Lorem ipsum dolor sit amet,"
+                    text run at (1,21) width 160: "consectetuer adipiscing elit."
+            LayoutTableCell {TD} at (208,26) size 204x134 [r=1 c=1 rs=1 cs=1]
+              LayoutBlockFlow {DIV} at (1,1) size 202x132
+                LayoutBlockFlow {DIV} at (0,0) size 202x38 [border: (1px solid #0000FF)]
+                  LayoutText {#text} at (10,0) size 191x37
+                    text run at (10,0) width 33 RTL: "\x{5E6}\x{5B0}\x{5DE}\x{5B4}\x{5D9}\x{5EA}\x{5D5}\x{5BC}\x{5EA}"
+                    text run at (43,0) width 158 RTL: "\x{5D9}\x{5B0}\x{5D4}\x{5B4}\x{5D9}, \x{5D0}\x{5B8}\x{5D7}\x{5B4}\x{5D9}, \x{5DC}\x{5B0}\x{5DA}\x{5B8} \x{5E1}\x{5B5}\x{5E4}\x{5B6}\x{5E8} \x{5E9}\x{5C1}\x{5B0}\x{5DC}\x{5B7}\x{5D7}\x{5B0}\x{5EA}\x{5BC}\x{5B4}\x{5D9}\x{5D5} \x{5D5}\x{5BC}\x{5DE}\x{5B4}\x{5DE}\x{5B0}\x{5DB}\x{5BC}\x{5B6}\x{5E8}\x{5B6}\x{5EA} "
+                    text run at (150,18) width 51 RTL: "\x{5DC}\x{5B8}\x{5DA}\x{5B0} \x{5DE}\x{5B0}\x{5DB}\x{5B7}\x{5E8}\x{5B0}\x{5EA}\x{5BC}\x{5B4}\x{5D9}\x{5D5}."
+                LayoutBlockFlow {DIV} at (0,43) size 202x42 [border: (1px solid #0000FF)]
+                  LayoutText {#text} at (1,1) size 142x39
+                    text run at (1,1) width 142: "Lore\x{300}m ipsum dolor sit ame\x{300}t,"
+                    text run at (1,21) width 135: "consectetue\x{300}r adipiscing e\x{300}lit."
+                LayoutBlockFlow {DIV} at (0,90) size 202x42 [border: (1px solid #008000)]
+                  LayoutText {#text} at (1,1) size 142x39
+                    text run at (1,1) width 142: "Lorem ipsum dolor sit amet,"
+                    text run at (1,21) width 135: "consectetuer adipiscing elit."
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text/atsui-partial-selection-expected.png b/third_party/WebKit/LayoutTests/platform/android/fast/text/atsui-partial-selection-expected.png
new file mode 100644
index 0000000..c78e94e
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text/atsui-partial-selection-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text/atsui-partial-selection-expected.txt b/third_party/WebKit/LayoutTests/platform/android/fast/text/atsui-partial-selection-expected.txt
new file mode 100644
index 0000000..615d7cd
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text/atsui-partial-selection-expected.txt
@@ -0,0 +1,32 @@
+layer at (0,0) size 800x600
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  LayoutBlockFlow {HTML} at (0,0) size 800x600
+    LayoutBlockFlow {BODY} at (8,8) size 784x576
+      LayoutBlockFlow {P} at (0,0) size 784x40
+        LayoutText {#text} at (0,0) size 51x19
+          text run at (0,0) width 51: "Test for "
+        LayoutInline {I} at (0,0) size 755x39
+          LayoutInline {A} at (0,0) size 305x19 [color=#0000EE]
+            LayoutText {#text} at (51,0) size 305x19
+              text run at (51,0) width 305: "http://bugs.webkit.org/show_bug.cgi?id=11124"
+          LayoutText {#text} at (356,0) size 755x39
+            text run at (356,0) width 4: " "
+            text run at (360,0) width 395: "REGRESSION (r14297): No drag image for partially-selected"
+            text run at (0,20) width 83: "complex text"
+        LayoutText {#text} at (83,20) size 4x19
+          text run at (83,20) width 4: "."
+      LayoutBlockFlow {P} at (0,56) size 784x20
+        LayoutText {#text} at (0,0) size 134x19
+          text run at (0,0) width 134: "This should look like \x{201C}"
+        LayoutInline {SPAN} at (0,0) size 79x19 [color=#008000]
+          LayoutText {#text} at (134,0) size 79x19
+            text run at (134,0) width 79: "Lore\x{300}m ipsum"
+        LayoutText {#text} at (213,0) size 13x19
+          text run at (213,0) width 13: "\x{201D}: "
+        LayoutInline {SPAN} at (0,0) size 83x19
+          LayoutText {#text} at (226,0) size 83x19
+            text run at (226,0) width 83: " Lore\x{300}m ipsum"
+        LayoutText {#text} at (0,0) size 0x0
+selection start: position 1 of child 0 {#text} of child 3 {SPAN} of child 2 {P} of body
+selection end:   position 13 of child 0 {#text} of child 3 {SPAN} of child 2 {P} of body
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text/atsui-pointtooffset-calls-cg-expected.txt b/third_party/WebKit/LayoutTests/platform/android/fast/text/atsui-pointtooffset-calls-cg-expected.txt
new file mode 100644
index 0000000..5e9ece1
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text/atsui-pointtooffset-calls-cg-expected.txt
@@ -0,0 +1,19 @@
+layer at (0,0) size 800x600
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  LayoutBlockFlow {HTML} at (0,0) size 800x600
+    LayoutBlockFlow {BODY} at (0,0) size 800x600
+      LayoutBlockFlow (anonymous) at (0,0) size 800x20
+        LayoutText {#text} at (0,0) size 53x19
+          text run at (0,0) width 53: "e\x{300}e\x{300}e\x{300}e\x{300}e\x{300}e\x{300}X"
+      LayoutBlockFlow {HR} at (0,28) size 800x2 [border: (1px inset #EEEEEE)]
+      LayoutBlockFlow (anonymous) at (0,38) size 800x40
+        LayoutText {#text} at (0,0) size 197x19
+          text run at (0,0) width 197: "This tests for regressions against "
+        LayoutInline {I} at (0,0) size 777x39
+          LayoutText {#text} at (197,0) size 777x39
+            text run at (197,0) width 580: "http://bugzilla.opendarwin.org/show_bug.cgi?id=5878 pointToOffset always takes the CG"
+            text run at (0,20) width 63: "code path"
+        LayoutText {#text} at (63,20) size 603x19
+          text run at (63,20) width 603: " by clicking the X and verifying that the correct caret position (13) is reported to the editing delegate."
+caret: position 13 of child 2 {#text} of body
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text/atsui-small-caps-punctuation-size-expected.txt b/third_party/WebKit/LayoutTests/platform/android/fast/text/atsui-small-caps-punctuation-size-expected.txt
new file mode 100644
index 0000000..781dad7
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text/atsui-small-caps-punctuation-size-expected.txt
@@ -0,0 +1,33 @@
+layer at (0,0) size 800x600
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  LayoutBlockFlow {HTML} at (0,0) size 800x600
+    LayoutBlockFlow {BODY} at (8,8) size 784x576
+      LayoutBlockFlow {P} at (0,0) size 784x40
+        LayoutText {#text} at (0,0) size 202x19
+          text run at (0,0) width 202: "This tests for a regression against "
+        LayoutInline {I} at (0,0) size 734x39
+          LayoutInline {A} at (0,0) size 350x19 [color=#0000EE]
+            LayoutText {#text} at (202,0) size 350x19
+              text run at (202,0) width 350: "http://bugzilla.opendarwin.org/show_bug.cgi?id=6397"
+          LayoutText {#text} at (552,0) size 734x39
+            text run at (552,0) width 182: " ATSUI small caps use small"
+            text run at (0,20) width 77: "punctuation"
+        LayoutText {#text} at (77,20) size 4x19
+          text run at (77,20) width 4: "."
+      LayoutBlockFlow {P} at (0,56) size 784x20
+        LayoutText {#text} at (0,0) size 344x19
+          text run at (0,0) width 344: "All four question marks below should be \x{201C}big\x{201D}, like this: ?"
+      LayoutBlockFlow {HR} at (0,92) size 784x2 [border: (1px inset #EEEEEE)]
+      LayoutBlockFlow {P} at (0,110) size 784x20
+        LayoutText {#text} at (0,0) size 52x19
+          text run at (0,0) width 52: "ATSUI: "
+        LayoutInline {SPAN} at (0,0) size 39x19
+          LayoutText {#text} at (52,0) size 39x19
+            text run at (52,0) width 39: "A?b?e\x{300}"
+      LayoutBlockFlow {P} at (0,146) size 784x20
+        LayoutText {#text} at (0,0) size 29x19
+          text run at (0,0) width 29: "CG: "
+        LayoutInline {SPAN} at (0,0) size 39x19
+          LayoutText {#text} at (29,0) size 39x19
+            text run at (29,0) width 39: "A?b?e"
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text/atsui-spacing-features-expected.txt b/third_party/WebKit/LayoutTests/platform/android/fast/text/atsui-spacing-features-expected.txt
new file mode 100644
index 0000000..28b97d7
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text/atsui-spacing-features-expected.txt
@@ -0,0 +1,84 @@
+layer at (0,0) size 800x600
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x378
+  LayoutBlockFlow {HTML} at (0,0) size 800x378
+    LayoutBlockFlow {BODY} at (8,16) size 784x354
+      LayoutBlockFlow {P} at (0,0) size 784x40
+        LayoutText {#text} at (0,0) size 167x19
+          text run at (0,0) width 167: "Test for regressions against "
+        LayoutInline {I} at (0,0) size 757x39
+          LayoutInline {A} at (0,0) size 350x19 [color=#0000EE]
+            LayoutText {#text} at (167,0) size 350x19
+              text run at (167,0) width 350: "http://bugzilla.opendarwin.org/show_bug.cgi?id=3922"
+          LayoutText {#text} at (517,0) size 757x39
+            text run at (517,0) width 240: " Variable word/letter spacing and full"
+            text run at (0,20) width 332: "justification not supported for ATSUI-rendered text"
+        LayoutText {#text} at (332,20) size 4x19
+          text run at (332,20) width 4: "."
+      LayoutBlockFlow (anonymous) at (0,56) size 784x20
+        LayoutText {#text} at (0,0) size 483x19
+          text run at (0,0) width 483: "Each green box should be identical to the blue box it follows, except for accents."
+      LayoutBlockFlow {HR} at (0,84) size 784x2 [border: (1px inset #EEEEEE)]
+      LayoutTable {TABLE} at (0,94) size 620x260
+        LayoutTableSection {TBODY} at (0,0) size 620x260
+          LayoutTableRow {TR} at (0,2) size 620x22
+            LayoutTableCell {TD} at (2,2) size 204x22 [r=0 c=0 rs=1 cs=1]
+              LayoutText {#text} at (59,1) size 86x19
+                text run at (59,1) width 86: "Word spacing"
+            LayoutTableCell {TD} at (208,2) size 204x22 [r=0 c=1 rs=1 cs=1]
+              LayoutText {#text} at (59,1) size 86x19
+                text run at (59,1) width 86: "Letter spacing"
+            LayoutTableCell {TD} at (414,2) size 204x22 [r=0 c=2 rs=1 cs=1]
+              LayoutText {#text} at (67,1) size 70x19
+                text run at (67,1) width 70: "Justification"
+          LayoutTableRow {TR} at (0,26) size 620x232
+            LayoutTableCell {TD} at (2,26) size 204x174 [r=1 c=0 rs=1 cs=1]
+              LayoutBlockFlow {DIV} at (1,1) size 202x172
+                LayoutBlockFlow {DIV} at (0,0) size 202x38 [border: (1px solid #0000FF)]
+                  LayoutText {#text} at (23,0) size 181x37
+                    text run at (23,0) width 178 RTL: "\x{5D9}\x{5B0}\x{5D4}\x{5B4}\x{5D9}, \x{5D0}\x{5B8}\x{5D7}\x{5B4}\x{5D9}, \x{5DC}\x{5B0}\x{5DA}\x{5B8} \x{5E1}\x{5B5}\x{5E4}\x{5B6}\x{5E8} \x{5E9}\x{5C1}\x{5B0}\x{5DC}\x{5B7}\x{5D7}\x{5B0}\x{5EA}\x{5BC}\x{5B4}\x{5D9}\x{5D5}"
+                    text run at (20,18) width 124 RTL: "\x{5E6}\x{5B0}\x{5DE}\x{5B4}\x{5D9}\x{5EA}\x{5D5}\x{5BC}\x{5EA} \x{5DC}\x{5B8}\x{5DA}\x{5B0} \x{5DE}\x{5B0}\x{5DB}\x{5B7}\x{5E8}\x{5B0}\x{5EA}\x{5BC}\x{5B4}\x{5D9}\x{5D5}."
+                    text run at (144,18) width 57 RTL: "\x{5D5}\x{5BC}\x{5DE}\x{5B4}\x{5DE}\x{5B0}\x{5DB}\x{5BC}\x{5B6}\x{5E8}\x{5B6}\x{5EA} "
+                LayoutBlockFlow {DIV} at (0,43) size 202x62 [border: (1px solid #0000FF)]
+                  LayoutText {#text} at (1,1) size 196x59
+                    text run at (1,1) width 162: "Lore\x{300}m ipsum dolor sit"
+                    text run at (1,21) width 196: "ame\x{300}t, consectetuer adipiscing"
+                    text run at (1,41) width 21: "e\x{300}lit."
+                LayoutBlockFlow {DIV} at (0,110) size 202x62 [border: (1px solid #008000)]
+                  LayoutText {#text} at (1,1) size 196x59
+                    text run at (1,1) width 162: "Lorem ipsum dolor sit"
+                    text run at (1,21) width 196: "amet, consectetuer adipiscing"
+                    text run at (1,41) width 21: "elit."
+            LayoutTableCell {TD} at (208,26) size 204x232 [r=1 c=1 rs=1 cs=1]
+              LayoutBlockFlow {DIV} at (1,1) size 202x230
+                LayoutBlockFlow {DIV} at (0,0) size 202x56 [border: (1px solid #0000FF)]
+                  LayoutText {#text} at (28,0) size 189x55
+                    text run at (28,0) width 173 RTL: "\x{5D9}\x{5B0}\x{5D4}\x{5B4}\x{5D9}, \x{5D0}\x{5B8}\x{5D7}\x{5B4}\x{5D9}, \x{5DC}\x{5B0}\x{5DA}\x{5B8} \x{5E1}\x{5B5}\x{5E4}\x{5B6}\x{5E8}"
+                    text run at (48,18) width 153 RTL: "\x{5E9}\x{5C1}\x{5B0}\x{5DC}\x{5B7}\x{5D7}\x{5B0}\x{5EA}\x{5BC}\x{5B4}\x{5D9}\x{5D5} \x{5D5}\x{5BC}\x{5DE}\x{5B4}\x{5DE}\x{5B0}\x{5DB}\x{5BC}\x{5B6}\x{5E8}\x{5B6}\x{5EA}"
+                    text run at (12,36) width 189 RTL: "\x{5E6}\x{5B0}\x{5DE}\x{5B4}\x{5D9}\x{5EA}\x{5D5}\x{5BC}\x{5EA} \x{5DC}\x{5B8}\x{5DA}\x{5B0} \x{5DE}\x{5B0}\x{5DB}\x{5B7}\x{5E8}\x{5B0}\x{5EA}\x{5BC}\x{5B4}\x{5D9}\x{5D5}."
+                LayoutBlockFlow {DIV} at (0,61) size 202x82 [border: (1px solid #0000FF)]
+                  LayoutText {#text} at (1,1) size 200x79
+                    text run at (1,1) width 200: "Lore\x{300}m ipsum dolor"
+                    text run at (1,21) width 95: "sit ame\x{300}t,"
+                    text run at (1,41) width 136: "consectetue\x{300}r"
+                    text run at (1,61) width 164: "adipiscing e\x{300}lit."
+                LayoutBlockFlow {DIV} at (0,148) size 202x82 [border: (1px solid #008000)]
+                  LayoutText {#text} at (1,1) size 200x79
+                    text run at (1,1) width 200: "Lorem ipsum dolor"
+                    text run at (1,21) width 95: "sit amet,"
+                    text run at (1,41) width 136: "consectetuer"
+                    text run at (1,61) width 164: "adipiscing elit."
+            LayoutTableCell {TD} at (414,26) size 204x134 [r=1 c=2 rs=1 cs=1]
+              LayoutBlockFlow {DIV} at (1,1) size 202x132
+                LayoutBlockFlow {DIV} at (0,0) size 202x38 [border: (1px solid #0000FF)]
+                  LayoutText {#text} at (1,0) size 200x37
+                    text run at (1,0) width 200 RTL: "\x{5D9}\x{5B0}\x{5D4}\x{5B4}\x{5D9}, \x{5D0}\x{5B8}\x{5D7}\x{5B4}\x{5D9}, \x{5DC}\x{5B0}\x{5DA}\x{5B8} \x{5E1}\x{5B5}\x{5E4}\x{5B6}\x{5E8} \x{5E9}\x{5C1}\x{5B0}\x{5DC}\x{5B7}\x{5D7}\x{5B0}\x{5EA}\x{5BC}\x{5B4}\x{5D9}\x{5D5} \x{5D5}\x{5BC}\x{5DE}\x{5B4}\x{5DE}\x{5B0}\x{5DB}\x{5BC}\x{5B6}\x{5E8}\x{5B6}\x{5EA}"
+                    text run at (97,18) width 104 RTL: "\x{5E6}\x{5B0}\x{5DE}\x{5B4}\x{5D9}\x{5EA}\x{5D5}\x{5BC}\x{5EA} \x{5DC}\x{5B8}\x{5DA}\x{5B0} \x{5DE}\x{5B0}\x{5DB}\x{5B7}\x{5E8}\x{5B0}\x{5EA}\x{5BC}\x{5B4}\x{5D9}\x{5D5}."
+                LayoutBlockFlow {DIV} at (0,43) size 202x42 [border: (1px solid #0000FF)]
+                  LayoutText {#text} at (1,1) size 200x39
+                    text run at (1,1) width 200: "Lore\x{300}m ipsum dolor sit ame\x{300}t,"
+                    text run at (1,21) width 164: "consectetue\x{300}r adipiscing e\x{300}lit."
+                LayoutBlockFlow {DIV} at (0,90) size 202x42 [border: (1px solid #008000)]
+                  LayoutText {#text} at (1,1) size 200x39
+                    text run at (1,1) width 200: "Lorem ipsum dolor sit amet,"
+                    text run at (1,21) width 164: "consectetuer adipiscing elit."
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text/basic/002-expected.png b/third_party/WebKit/LayoutTests/platform/android/fast/text/basic/002-expected.png
new file mode 100644
index 0000000..ec1b848b
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text/basic/002-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text/basic/005-expected.png b/third_party/WebKit/LayoutTests/platform/android/fast/text/basic/005-expected.png
new file mode 100644
index 0000000..f4e55da
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text/basic/005-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text/basic/005-expected.txt b/third_party/WebKit/LayoutTests/platform/android/fast/text/basic/005-expected.txt
new file mode 100644
index 0000000..76a5a20
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text/basic/005-expected.txt
@@ -0,0 +1,8 @@
+layer at (0,0) size 800x600
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  LayoutBlockFlow {HTML} at (0,0) size 800x600
+    LayoutBlockFlow {BODY} at (8,8) size 784x584
+      LayoutBlockFlow (floating) {DIV} at (0,0) size 246x24 [border: (2px solid #008000)]
+        LayoutText {#text} at (2,2) size 242x19
+          text run at (2,2) width 242: "Words should have a negative spacing of 5px."
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text/basic/011-expected.png b/third_party/WebKit/LayoutTests/platform/android/fast/text/basic/011-expected.png
new file mode 100644
index 0000000..f51d73b
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text/basic/011-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text/basic/011-expected.txt b/third_party/WebKit/LayoutTests/platform/android/fast/text/basic/011-expected.txt
new file mode 100644
index 0000000..2b185ff
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text/basic/011-expected.txt
@@ -0,0 +1,27 @@
+layer at (0,0) size 800x600
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x146
+  LayoutBlockFlow {HTML} at (0,0) size 800x146
+    LayoutBlockFlow {BODY} at (8,8) size 784x130
+      LayoutBlockFlow {DIV} at (0,0) size 784x40
+        LayoutText {#text} at (0,0) size 95x19
+          text run at (0,0) width 95: "Select this text. "
+        LayoutInline {FONT} at (0,0) size 758x32
+          LayoutText {#text} at (95,5) size 758x32
+            text run at (95,5) width 84: "I am teeny and tiny. "
+            text run at (179,5) width 296: "I am going to have lots of text but each line should retain the big height. "
+            text run at (475,5) width 283: "If the lines shrink, it means that the root line box's height is not being"
+            text run at (0,25) width 114: "considered and that's wrong."
+        LayoutText {#text} at (0,0) size 0x0
+      LayoutBlockFlow {P} at (0,56) size 784x0
+      LayoutBlockFlow {DIV} at (0,56) size 784x74
+        LayoutInline {FONT} at (0,0) size 764x73
+          LayoutText {#text} at (0,0) size 418x36
+            text run at (0,0) width 418: "This text is absolutely enormous. "
+          LayoutInline {FONT} at (0,0) size 764x49
+            LayoutText {#text} at (418,18) size 764x49
+              text run at (418,18) width 84: "I am teeny and tiny. "
+              text run at (502,18) width 262: "I am going to have lots of text but each line should retain the big"
+              text run at (0,55) width 31: "height. "
+              text run at (31,55) width 408: "If the lines shrink, it means that the span's line box's height is not being considered and that's wrong."
+          LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text/basic/012-expected.png b/third_party/WebKit/LayoutTests/platform/android/fast/text/basic/012-expected.png
new file mode 100644
index 0000000..46c66680
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text/basic/012-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text/basic/013-expected.png b/third_party/WebKit/LayoutTests/platform/android/fast/text/basic/013-expected.png
new file mode 100644
index 0000000..a230165
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text/basic/013-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text/basic/generic-family-changes-expected.png b/third_party/WebKit/LayoutTests/platform/android/fast/text/basic/generic-family-changes-expected.png
new file mode 100644
index 0000000..75f9e8fee
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text/basic/generic-family-changes-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text/basic/generic-family-changes-expected.txt b/third_party/WebKit/LayoutTests/platform/android/fast/text/basic/generic-family-changes-expected.txt
new file mode 100644
index 0000000..b43a1f5
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text/basic/generic-family-changes-expected.txt
@@ -0,0 +1,43 @@
+layer at (0,0) size 800x600
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x317
+  LayoutBlockFlow {HTML} at (0,0) size 800x317
+    LayoutBlockFlow {BODY} at (8,8) size 784x293
+      LayoutBlockFlow (anonymous) at (0,0) size 784x60
+        LayoutText {#text} at (0,0) size 773x59
+          text run at (0,0) width 503: "Tests of WebKit's intepretation of font sizes when no absolute font size is specified. "
+          text run at (503,0) width 255: "Percentages and logical keywords scale to"
+          text run at (0,20) width 136: "reflect the family type. "
+          text run at (136,20) width 637: "Opera 9 matches this behavior as well (except it has a bug with multiple font-family mappings as in the first"
+          text run at (0,40) width 59: "example)."
+      LayoutBlockFlow {PRE} at (0,73) size 784x16
+        LayoutInline {SPAN} at (0,0) size 120x16
+          LayoutText {#text} at (0,0) size 120x16
+            text run at (0,0) width 120: "Should be 13 px"
+      LayoutBlockFlow {PRE} at (0,102) size 784x16
+        LayoutInline {SPAN} at (0,0) size 81x15
+          LayoutText {#text} at (0,0) size 81x15
+            text run at (0,0) width 81: "Should be 13px"
+      LayoutBlockFlow {PRE} at (0,131) size 784x16
+        LayoutInline {SPAN} at (0,0) size 81x15
+          LayoutText {#text} at (0,0) size 81x15
+            text run at (0,0) width 81: "Should be 13px"
+      LayoutBlockFlow {P} at (0,163) size 784x20
+        LayoutInline {SPAN} at (0,0) size 81x15
+          LayoutText {#text} at (0,3) size 81x15
+            text run at (0,3) width 81: "Should be 13px"
+      LayoutBlockFlow {P} at (0,199) size 784x20
+        LayoutInline {TT} at (0,0) size 96x18
+          LayoutInline {SPAN} at (0,0) size 96x19
+            LayoutText {#text} at (0,0) size 96x19
+              text run at (0,0) width 96: "Should be 16px"
+      LayoutBlockFlow {P} at (0,235) size 784x20
+        LayoutInline {TT} at (0,0) size 96x16
+          LayoutInline {SPAN} at (0,0) size 96x19
+            LayoutText {#text} at (0,0) size 96x19
+              text run at (0,0) width 96: "Should be 16px"
+      LayoutBlockFlow {P} at (0,271) size 784x22
+        LayoutInline {TT} at (0,0) size 118x16
+          LayoutInline {SPAN} at (0,0) size 118x21
+            LayoutText {#text} at (0,0) size 118x21
+              text run at (0,0) width 118: "Should be 19px"
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text/basic/generic-family-reset-expected.png b/third_party/WebKit/LayoutTests/platform/android/fast/text/basic/generic-family-reset-expected.png
new file mode 100644
index 0000000..4b75aa76
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text/basic/generic-family-reset-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text/basic/generic-family-reset-expected.txt b/third_party/WebKit/LayoutTests/platform/android/fast/text/basic/generic-family-reset-expected.txt
new file mode 100644
index 0000000..260b3c6d
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text/basic/generic-family-reset-expected.txt
@@ -0,0 +1,90 @@
+layer at (0,0) size 800x600
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  LayoutBlockFlow {HTML} at (0,0) size 800x600
+    LayoutBlockFlow {BODY} at (8,8) size 784x584
+      LayoutBlockFlow {H3} at (0,0) size 784x23
+        LayoutText {#text} at (0,0) size 507x23
+          text run at (0,0) width 507: "tt's, font-family inheriting and font-size: a bug"
+      LayoutTable {TABLE} at (0,41.72) size 784x364
+        LayoutTableSection {TBODY} at (0,0) size 784x364
+          LayoutTableRow {TR} at (0,10) size 784x200
+            LayoutTableCell {TD} at (10,10) size 764x200 [r=0 c=0 rs=1 cs=2]
+              LayoutText {#text} at (1,1) size 352x18
+                text run at (1,1) width 352: "The css in the head of this file is like this:"
+              LayoutBR {BR} at (353,16) size 0x0
+              LayoutBR {BR} at (1,19) size 0x18
+              LayoutText {#text} at (1,37) size 110x18
+                text run at (1,37) width 110: "html, body { "
+              LayoutBR {BR} at (111,52) size 0x0
+              LayoutText {#text} at (1,55) size 207x18
+                text run at (1,55) width 207: "    font-family: Verdana; "
+              LayoutBR {BR} at (208,70) size 0x0
+              LayoutText {#text} at (1,73) size 10x18
+                text run at (1,73) width 10: "}"
+              LayoutBR {BR} at (11,88) size 0x0
+              LayoutText {#text} at (1,91) size 81x18
+                text run at (1,91) width 81: "tt, span {"
+              LayoutBR {BR} at (82,106) size 0x0
+              LayoutText {#text} at (1,109) size 168x18
+                text run at (1,109) width 168: "    font-size: 0.8em;"
+              LayoutBR {BR} at (169,124) size 0x0
+              LayoutText {#text} at (1,127) size 10x18
+                text run at (1,127) width 10: "}"
+              LayoutBR {BR} at (11,142) size 0x0
+              LayoutBR {BR} at (1,145) size 0x18
+              LayoutText {#text} at (1,163) size 761x36
+                text run at (1,163) width 761: "The two columns below show that inheriting the font does not correctly inherit the font-size"
+                text run at (1,181) width 138: "for a <tt> block."
+              LayoutBR {BR} at (139,196) size 0x0
+          LayoutTableRow {TR} at (0,220) size 784x20
+            LayoutTableCell {TH} at (10,220) size 376x20 [r=1 c=0 rs=1 cs=1]
+              LayoutText {#text} at (168,1) size 40x18
+                text run at (168,1) width 40: "<tt>"
+            LayoutTableCell {TH} at (396,220) size 378x20 [r=1 c=1 rs=1 cs=1]
+              LayoutText {#text} at (155,1) size 68x18
+                text run at (155,1) width 68: "<span>"
+          LayoutTableRow {TR} at (0,250) size 784x18
+            LayoutTableCell {TD} at (10,250) size 376x18 [r=2 c=0 rs=1 cs=1]
+              LayoutInline {TT} at (0,0) size 264x16
+                LayoutText {#text} at (1,1) size 264x16
+                  text run at (1,1) width 264: "font-family: Verdana; font-size: 0.8em;"
+              LayoutText {#text} at (0,0) size 0x0
+            LayoutTableCell {TD} at (396,250) size 378x18 [r=2 c=1 rs=1 cs=1]
+              LayoutInline {SPAN} at (0,0) size 264x16
+                LayoutText {#text} at (1,1) size 264x16
+                  text run at (1,1) width 264: "font-family: Verdana; font-size: 0.8em;"
+              LayoutText {#text} at (0,0) size 0x0
+          LayoutTableRow {TR} at (0,278) size 784x18
+            LayoutTableCell {TD} at (10,278) size 376x18 [r=3 c=0 rs=1 cs=1]
+              LayoutInline {TT} at (0,0) size 322x16
+                LayoutText {#text} at (1,1) size 322x16
+                  text run at (1,1) width 322: "font-family: inherit (Verdana); font-size: 0.8em;"
+              LayoutText {#text} at (0,0) size 0x0
+            LayoutTableCell {TD} at (396,278) size 378x18 [r=3 c=1 rs=1 cs=1]
+              LayoutInline {SPAN} at (0,0) size 251x16
+                LayoutText {#text} at (1,1) size 251x16
+                  text run at (1,1) width 251: "font-family: inherit; font-size: 0.8em;"
+              LayoutText {#text} at (0,0) size 0x0
+          LayoutTableRow {TR} at (0,306) size 784x20
+            LayoutTableCell {TD} at (10,306) size 376x20 [r=4 c=0 rs=1 cs=1]
+              LayoutInline {TT} at (0,0) size 327x18
+                LayoutText {#text} at (1,1) size 327x18
+                  text run at (1,1) width 327: "font-family: Verdana; font-size: 1.0em;"
+              LayoutText {#text} at (0,0) size 0x0
+            LayoutTableCell {TD} at (396,306) size 378x20 [r=4 c=1 rs=1 cs=1]
+              LayoutInline {SPAN} at (0,0) size 327x18
+                LayoutText {#text} at (1,1) size 327x18
+                  text run at (1,1) width 327: "font-family: Verdana; font-size: 1.0em;"
+              LayoutText {#text} at (0,0) size 0x0
+          LayoutTableRow {TR} at (0,336) size 784x18
+            LayoutTableCell {TD} at (10,338) size 376x14 [r=5 c=0 rs=1 cs=1]
+              LayoutInline {TT} at (0,0) size 186x12
+                LayoutText {#text} at (1,1) size 186x12
+                  text run at (1,1) width 186: "default font; font-size: 0.8em;"
+              LayoutText {#text} at (0,0) size 0x0
+            LayoutTableCell {TD} at (396,336) size 378x18 [r=5 c=1 rs=1 cs=1]
+              LayoutInline {SPAN} at (0,0) size 312x16
+                LayoutText {#text} at (1,1) size 312x16
+                  text run at (1,1) width 312: "font-family: courier; font-size: 0.8em;"
+              LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text/bidi-embedding-pop-and-push-same-expected.png b/third_party/WebKit/LayoutTests/platform/android/fast/text/bidi-embedding-pop-and-push-same-expected.png
new file mode 100644
index 0000000..9db1a2e
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text/bidi-embedding-pop-and-push-same-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text/bidi-embedding-pop-and-push-same-expected.txt b/third_party/WebKit/LayoutTests/platform/android/fast/text/bidi-embedding-pop-and-push-same-expected.txt
new file mode 100644
index 0000000..9af1479
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text/bidi-embedding-pop-and-push-same-expected.txt
@@ -0,0 +1,143 @@
+layer at (0,0) size 800x600
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  LayoutBlockFlow {HTML} at (0,0) size 800x600
+    LayoutBlockFlow {BODY} at (8,8) size 784x584
+      LayoutBlockFlow {P} at (0,0) size 784x20
+        LayoutText {#text} at (0,0) size 491x19
+          text run at (0,0) width 491: "In each box below, the words or letters should be in the same order on every line."
+      LayoutBlockFlow {DIV} at (8,36) size 768x70 [border: (1px solid #ADD8E6)]
+        LayoutBlockFlow {DIV} at (5,5) size 758x20
+          LayoutText {#text} at (0,0) size 44x19
+            text run at (0,0) width 44: "Lorem "
+          LayoutInline {SPAN} at (0,0) size 71x19
+            LayoutText {#text} at (44,0) size 71x19
+              text run at (44,0) width 71: "ipsum dolor"
+          LayoutText {#text} at (115,0) size 54x19
+            text run at (115,0) width 54: " sit amet."
+        LayoutBlockFlow {DIV} at (5,25) size 758x20
+          LayoutText {#text} at (0,0) size 44x19
+            text run at (0,0) width 44: "Lorem "
+          LayoutInline {SPAN} at (0,0) size 35x19
+            LayoutText {#text} at (44,0) size 35x19
+              text run at (44,0) width 35: "ipsum"
+          LayoutInline {SPAN} at (0,0) size 36x19
+            LayoutText {#text} at (79,0) size 36x19
+              text run at (79,0) width 36: " dolor"
+          LayoutText {#text} at (115,0) size 54x19
+            text run at (115,0) width 54: " sit amet."
+        LayoutBlockFlow {DIV} at (5,45) size 758x20
+          LayoutText {#text} at (0,0) size 44x19
+            text run at (0,0) width 44: "Lorem "
+          LayoutInline {SPAN} at (0,0) size 39x19
+            LayoutText {#text} at (44,0) size 39x19
+              text run at (44,0) width 39: "ipsum "
+          LayoutInline {B} at (0,0) size 91x19
+            LayoutInline {SPAN} at (0,0) size 34x19
+              LayoutText {#text} at (83,0) size 34x19
+                text run at (83,0) width 34: "dolor"
+            LayoutText {#text} at (117,0) size 4x19
+              text run at (117,0) width 4: " "
+            LayoutInline {I} at (0,0) size 16x19
+              LayoutText {#text} at (121,0) size 16x19
+                text run at (121,0) width 16: "sit"
+            LayoutText {#text} at (137,0) size 37x19
+              text run at (137,0) width 37: " amet"
+          LayoutText {#text} at (174,0) size 4x19
+            text run at (174,0) width 4: "."
+      LayoutBlockFlow {DIV} at (8,114) size 768x70 [border: (1px solid #ADD8E6)]
+        LayoutBlockFlow {DIV} at (5,5) size 758x20
+          LayoutText {#text} at (0,0) size 44x19
+            text run at (0,0) width 44: "Lorem "
+          LayoutInline {SPAN} at (0,0) size 53x19
+            LayoutText {#text} at (44,0) size 53x19
+              text run at (44,0) width 18 RTL: " \x{5DB}\x{5DC}"
+              text run at (62,0) width 7: "if"
+              text run at (69,0) width 28 RTL: "\x{5D9}\x{5D5}\x{5EA}\x{5E8} "
+          LayoutText {#text} at (97,0) size 54x19
+            text run at (97,0) width 54: " sit amet."
+        LayoutBlockFlow {DIV} at (5,25) size 758x20
+          LayoutText {#text} at (0,0) size 44x19
+            text run at (0,0) width 44: "Lorem "
+          LayoutInline {SPAN} at (0,0) size 28x19
+            LayoutText {#text} at (69,0) size 28x19
+              text run at (69,0) width 28 RTL: "\x{5D9}\x{5D5}\x{5EA}\x{5E8} "
+          LayoutInline {SPAN} at (0,0) size 25x19
+            LayoutText {#text} at (44,0) size 25x19
+              text run at (44,0) width 18 RTL: " \x{5DB}\x{5DC}"
+              text run at (62,0) width 7: "if"
+          LayoutText {#text} at (97,0) size 54x19
+            text run at (97,0) width 54: " sit amet."
+        LayoutBlockFlow {DIV} at (5,45) size 758x20
+          LayoutText {#text} at (0,0) size 44x19
+            text run at (0,0) width 44: "Lorem "
+          LayoutInline {SPAN} at (0,0) size 28x19
+            LayoutText {#text} at (71,0) size 28x19
+              text run at (71,0) width 28 RTL: "\x{5D9}\x{5D5}\x{5EA}\x{5E8} "
+          LayoutInline {B} at (0,0) size 112x19
+            LayoutInline {SPAN} at (0,0) size 27x19
+              LayoutText {#text} at (44,0) size 27x19
+                text run at (44,0) width 18 RTL: " \x{5DB}\x{5DC}"
+                text run at (62,0) width 9: "if"
+            LayoutText {#text} at (99,0) size 4x19
+              text run at (99,0) width 4: " "
+            LayoutInline {I} at (0,0) size 16x19
+              LayoutText {#text} at (103,0) size 16x19
+                text run at (103,0) width 16: "sit"
+            LayoutText {#text} at (119,0) size 37x19
+              text run at (119,0) width 37: " amet"
+          LayoutText {#text} at (156,0) size 4x19
+            text run at (156,0) width 4: "."
+      LayoutBlockFlow {DIV} at (8,192) size 768x50 [border: (1px solid #ADD8E6)]
+        LayoutBlockFlow {DIV} at (5,5) size 758x20
+          LayoutInline {SPAN} at (0,0) size 19x19
+            LayoutText {#text} at (0,0) size 19x19
+              text run at (0,0) width 19: "a b"
+          LayoutText {#text} at (0,0) size 0x0
+        LayoutBlockFlow {DIV} at (5,25) size 758x20
+          LayoutInline {SPAN} at (0,0) size 7x19
+            LayoutText {#text} at (0,0) size 7x19
+              text run at (0,0) width 7: "a"
+          LayoutInline {SPAN} at (0,0) size 12x19
+            LayoutText {#text} at (7,0) size 12x19
+              text run at (7,0) width 12: " b"
+          LayoutText {#text} at (0,0) size 0x0
+      LayoutBlockFlow {DIV} at (8,250) size 768x70 [border: (1px solid #ADD8E6)]
+        LayoutBlockFlow {DIV} at (5,5) size 758x20
+          LayoutText {#text} at (730,0) size 28x19
+            text run at (730,0) width 28 RTL: "\x{5D0}\x{5D7}\x{5EA} "
+          LayoutInline {SPAN} at (0,0) size 69x19
+            LayoutText {#text} at (661,0) size 69x19
+              text run at (661,0) width 69 RTL: "\x{5E9}\x{5EA}\x{5D9}\x{5D9}\x{5DD} \x{5E9}\x{5DC}\x{5D5}\x{5E9}"
+          LayoutText {#text} at (593,0) size 68x19
+            text run at (593,0) width 68 RTL: " \x{5D0}\x{5E8}\x{5D1}\x{5E2} \x{5D7}\x{5DE}\x{5E9}."
+        LayoutBlockFlow {DIV} at (5,25) size 758x20
+          LayoutText {#text} at (730,0) size 28x19
+            text run at (730,0) width 28 RTL: "\x{5D0}\x{5D7}\x{5EA} "
+          LayoutInline {SPAN} at (0,0) size 34x19
+            LayoutText {#text} at (696,0) size 34x19
+              text run at (696,0) width 34 RTL: "\x{5E9}\x{5EA}\x{5D9}\x{5D9}\x{5DD}"
+          LayoutInline {SPAN} at (0,0) size 35x19
+            LayoutText {#text} at (661,0) size 35x19
+              text run at (661,0) width 35 RTL: " \x{5E9}\x{5DC}\x{5D5}\x{5E9}"
+          LayoutText {#text} at (593,0) size 68x19
+            text run at (593,0) width 68 RTL: " \x{5D0}\x{5E8}\x{5D1}\x{5E2} \x{5D7}\x{5DE}\x{5E9}."
+        LayoutBlockFlow {DIV} at (5,45) size 758x20
+          LayoutText {#text} at (730,0) size 28x19
+            text run at (730,0) width 28 RTL: "\x{5D0}\x{5D7}\x{5EA} "
+          LayoutInline {SPAN} at (0,0) size 38x19
+            LayoutText {#text} at (692,0) size 38x19
+              text run at (692,0) width 38 RTL: "\x{5E9}\x{5EA}\x{5D9}\x{5D9}\x{5DD} "
+          LayoutInline {B} at (0,0) size 101x19
+            LayoutInline {SPAN} at (0,0) size 34x19
+              LayoutText {#text} at (658,0) size 34x19
+                text run at (658,0) width 34 RTL: "\x{5E9}\x{5DC}\x{5D5}\x{5E9}"
+            LayoutText {#text} at (654,0) size 4x19
+              text run at (654,0) width 4 RTL: " "
+            LayoutInline {I} at (0,0) size 31x19
+              LayoutText {#text} at (623,0) size 31x19
+                text run at (623,0) width 31 RTL: "\x{5D0}\x{5E8}\x{5D1}\x{5E2}"
+            LayoutText {#text} at (591,0) size 32x19
+              text run at (591,0) width 32 RTL: " \x{5D7}\x{5DE}\x{5E9}"
+          LayoutText {#text} at (587,0) size 4x19
+            text run at (587,0) width 4 RTL: "."
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text/break-word-expected.png b/third_party/WebKit/LayoutTests/platform/android/fast/text/break-word-expected.png
new file mode 100644
index 0000000..8a337db
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text/break-word-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text/break-word-expected.txt b/third_party/WebKit/LayoutTests/platform/android/fast/text/break-word-expected.txt
new file mode 100644
index 0000000..02111f3
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text/break-word-expected.txt
@@ -0,0 +1,25 @@
+layer at (0,0) size 800x600
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  LayoutBlockFlow {HTML} at (0,0) size 800x600
+    LayoutBlockFlow {BODY} at (8,8) size 784x584
+      LayoutBlockFlow {P} at (0,0) size 784x40
+        LayoutText {#text} at (0,0) size 51x19
+          text run at (0,0) width 51: "Test for "
+        LayoutInline {I} at (0,0) size 747x39
+          LayoutInline {A} at (0,0) size 305x19 [color=#0000EE]
+            LayoutText {#text} at (51,0) size 305x19
+              text run at (51,0) width 305: "http://bugs.webkit.org/show_bug.cgi?id=12726"
+          LayoutText {#text} at (356,0) size 747x39
+            text run at (356,0) width 4: " "
+            text run at (360,0) width 387: "REGRESSION (r12073): Text wraps in the middle of a word"
+            text run at (0,20) width 315: "instead of wrapping at the space before the word"
+        LayoutText {#text} at (315,20) size 4x19
+          text run at (315,20) width 4: "."
+      LayoutBlockFlow {P} at (0,56) size 784x20
+        LayoutText {#text} at (0,0) size 361x19
+          text run at (0,0) width 361: "\x{201C}onelongwrodwithnobreaks\x{201D} should not break in the middle."
+      LayoutBlockFlow {DIV} at (0,92) size 200x28 [bgcolor=#FFFF00]
+        LayoutText {#text} at (0,0) size 165x28
+          text run at (0,0) width 165: "lllllllllllllllllllllllllllllllllllllllllllllllllllllll"
+          text run at (0,14) width 120: "onelongwrodwithnobreaks"
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text/capitalize-preserve-nbsp-expected.png b/third_party/WebKit/LayoutTests/platform/android/fast/text/capitalize-preserve-nbsp-expected.png
new file mode 100644
index 0000000..5d4e1c6
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text/capitalize-preserve-nbsp-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text/capitalize-preserve-nbsp-expected.txt b/third_party/WebKit/LayoutTests/platform/android/fast/text/capitalize-preserve-nbsp-expected.txt
new file mode 100644
index 0000000..cd9c82b
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text/capitalize-preserve-nbsp-expected.txt
@@ -0,0 +1,33 @@
+layer at (0,0) size 800x600
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  LayoutBlockFlow {HTML} at (0,0) size 800x600
+    LayoutBlockFlow {BODY} at (8,8) size 784x576
+      LayoutBlockFlow {P} at (0,0) size 784x40
+        LayoutText {#text} at (0,0) size 51x19
+          text run at (0,0) width 51: "Test for "
+        LayoutInline {I} at (0,0) size 775x39
+          LayoutInline {A} at (0,0) size 305x19 [color=#0000EE]
+            LayoutText {#text} at (51,0) size 305x19
+              text run at (51,0) width 305: "http://bugs.webkit.org/show_bug.cgi?id=11671"
+          LayoutText {#text} at (356,0) size 775x39
+            text run at (356,0) width 4: " "
+            text run at (360,0) width 415: "REGRESSION (r13702): text-transform: capitalize changes non-"
+            text run at (0,20) width 166: "breaking spaces to spaces"
+        LayoutText {#text} at (166,20) size 4x19
+          text run at (166,20) width 4: "."
+      LayoutBlockFlow {P} at (0,56) size 784x20
+        LayoutText {#text} at (0,0) size 268x19
+          text run at (0,0) width 268: "The next three lines should all look the same."
+      LayoutBlockFlow {P} at (0,92) size 784x20
+        LayoutText {#text} at (0,0) size 97x19
+          text run at (0,0) width 97: "Lorem     Ipsum"
+      LayoutBlockFlow {P} at (0,128) size 784x20
+        LayoutText {#text} at (0,0) size 60x19
+          text run at (0,0) width 60: "Lorem     "
+        LayoutInline {SPAN} at (0,0) size 37x19
+          LayoutText {#text} at (60,0) size 37x19
+            text run at (60,0) width 37: "Ipsum"
+      LayoutBlockFlow {P} at (0,164) size 784x20
+        LayoutText {#text} at (0,0) size 97x19
+          text run at (0,0) width 97: "Lorem     Ipsum"
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text/caps-lock-indicator-disabled-expected.png b/third_party/WebKit/LayoutTests/platform/android/fast/text/caps-lock-indicator-disabled-expected.png
new file mode 100644
index 0000000..c71df245
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text/caps-lock-indicator-disabled-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text/caps-lock-indicator-disabled-expected.txt b/third_party/WebKit/LayoutTests/platform/android/fast/text/caps-lock-indicator-disabled-expected.txt
new file mode 100644
index 0000000..9639315
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text/caps-lock-indicator-disabled-expected.txt
@@ -0,0 +1,14 @@
+layer at (0,0) size 800x600
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x58
+  LayoutBlockFlow {HTML} at (0,0) size 800x58
+    LayoutBlockFlow {BODY} at (8,8) size 784x42
+      LayoutText {#text} at (0,0) size 550x19
+        text run at (0,0) width 550: "Test passes if password field does not include caps lock icon on right edge on any platform."
+      LayoutBR {BR} at (550,0) size 0x19
+      LayoutTextControl {INPUT} at (0,20) size 154x22 [bgcolor=#FFFFFF] [border: (2px inset #EEEEEE)]
+      LayoutText {#text} at (0,0) size 0x0
+      LayoutText {#text} at (0,0) size 0x0
+layer at (10,31) size 150x16
+  LayoutBlockFlow {DIV} at (2,3) size 150x16
+caret: position 0 of child 0 {DIV} of {#document-fragment} of child 3 {INPUT} of body
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text/caps-lock-indicator-enabled-expected.png b/third_party/WebKit/LayoutTests/platform/android/fast/text/caps-lock-indicator-enabled-expected.png
new file mode 100644
index 0000000..b90f990
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text/caps-lock-indicator-enabled-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text/caps-lock-indicator-enabled-expected.txt b/third_party/WebKit/LayoutTests/platform/android/fast/text/caps-lock-indicator-enabled-expected.txt
new file mode 100644
index 0000000..b5c14c71
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text/caps-lock-indicator-enabled-expected.txt
@@ -0,0 +1,14 @@
+layer at (0,0) size 800x600
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x58
+  LayoutBlockFlow {HTML} at (0,0) size 800x58
+    LayoutBlockFlow {BODY} at (8,8) size 784x42
+      LayoutText {#text} at (0,0) size 542x19
+        text run at (0,0) width 542: "Test passes if password field includes caps lock icon on right edge on Mac platforms only."
+      LayoutBR {BR} at (542,0) size 0x19
+      LayoutTextControl {INPUT} at (0,20) size 154x22 [bgcolor=#FFFFFF] [border: (2px inset #EEEEEE)]
+      LayoutText {#text} at (0,0) size 0x0
+      LayoutText {#text} at (0,0) size 0x0
+layer at (10,31) size 150x16
+  LayoutBlockFlow {DIV} at (2,3) size 150x16
+caret: position 0 of child 0 {DIV} of {#document-fragment} of child 3 {INPUT} of body
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text/chromium-linux-fontconfig-renderstyle-expected.png b/third_party/WebKit/LayoutTests/platform/android/fast/text/chromium-linux-fontconfig-renderstyle-expected.png
index 5667ed4..a73afca 100644
--- a/third_party/WebKit/LayoutTests/platform/android/fast/text/chromium-linux-fontconfig-renderstyle-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text/chromium-linux-fontconfig-renderstyle-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text/chromium-linux-fontconfig-renderstyle-expected.txt b/third_party/WebKit/LayoutTests/platform/android/fast/text/chromium-linux-fontconfig-renderstyle-expected.txt
index 0a0cb085..493ce1e 100644
--- a/third_party/WebKit/LayoutTests/platform/android/fast/text/chromium-linux-fontconfig-renderstyle-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text/chromium-linux-fontconfig-renderstyle-expected.txt
@@ -32,8 +32,8 @@
             LayoutListMarker (anonymous) at (-21,0) size 16x19: "2"
             LayoutText {#text} at (0,0) size 665x39
               text run at (0,0) width 315: "The following text should be slightly-hinted Georgia. "
-              text run at (315,0) width 57: "The dots "
-              text run at (372,0) width 293: "should be equally spaced, and letters in the word"
+              text run at (314,0) width 58: "The dots "
+              text run at (371,0) width 294: "should be equally spaced, and letters in the word"
               text run at (0,20) width 84: "\"government\" "
               text run at (84,20) width 392: "should be naturally spaced (without an ugly space before the \"e\")."
           LayoutBlockFlow {P} at (0,56) size 744x19
@@ -42,20 +42,20 @@
         LayoutListItem {LI} at (40,162) size 744x75
           LayoutBlockFlow {P} at (0,0) size 744x40
             LayoutListMarker (anonymous) at (-21,0) size 16x19: "3"
-            LayoutText {#text} at (0,0) size 738x39
-              text run at (0,0) width 377: "The following text should be unhinted Verdana. The fontconfig "
-              text run at (377,0) width 361: "configuration for this is contradictory, setting both full-hinting"
+            LayoutText {#text} at (0,0) size 736x39
+              text run at (0,0) width 376: "The following text should be unhinted Verdana. The fontconfig "
+              text run at (375,0) width 361: "configuration for this is contradictory, setting both full-hinting"
               text run at (0,20) width 245: "and no-hinting. The latter should win out."
           LayoutBlockFlow {P} at (0,56) size 744x19
             LayoutText {#text} at (0,0) size 540x18
               text run at (0,0) width 380: "Here is Tigger doing what tiggers do best \x{2026} operating "
-              text run at (380,0) width 160: "hydraulic exoskeletons."
+              text run at (379,0) width 161: "hydraulic exoskeletons."
         LayoutListItem {LI} at (40,253) size 744x56
           LayoutBlockFlow {P} at (0,0) size 744x20
             LayoutListMarker (anonymous) at (-21,0) size 16x19: "4"
             LayoutText {#text} at (0,0) size 595x19
               text run at (0,0) width 374: "The following text should show a difference caused by forcing "
-              text run at (374,0) width 221: "autohinting. Note: the effect is subtle."
+              text run at (373,0) width 222: "autohinting. Note: the effect is subtle."
           LayoutBlockFlow {P} at (0,36) size 744x20
             LayoutInline {SPAN} at (0,0) size 51x13
               LayoutText {#text} at (0,5) size 51x13
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text/complex-text-rtl-selection-repaint-expected.txt b/third_party/WebKit/LayoutTests/platform/android/fast/text/complex-text-rtl-selection-repaint-expected.txt
new file mode 100644
index 0000000..2b316b3
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text/complex-text-rtl-selection-repaint-expected.txt
@@ -0,0 +1,15 @@
+layer at (0,0) size 800x600
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x80
+  LayoutBlockFlow {HTML} at (0,0) size 800x80
+    LayoutBlockFlow {BODY} at (8,8) size 784x56
+      LayoutBlockFlow (anonymous) at (0,0) size 784x20
+        LayoutInline {BDO} at (0,0) size 75x19
+          LayoutText {#text} at (0,0) size 75x19
+            text run at (0,0) width 75 RTL override: "m\x{300}uspimeroL"
+        LayoutText {#text} at (0,0) size 0x0
+      LayoutBlockFlow {P} at (0,36) size 784x20
+        LayoutText {#text} at (0,0) size 382x19
+          text run at (0,0) width 382: "Tests that rtl selections are repainted correctly for complex text."
+selection start: position 2 of child 0 {#text} of child 3 {BDO} of body
+selection end:   position 6 of child 0 {#text} of child 3 {BDO} of body
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text/delete-hard-break-character-expected.txt b/third_party/WebKit/LayoutTests/platform/android/fast/text/delete-hard-break-character-expected.txt
new file mode 100644
index 0000000..5bd4d438c
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text/delete-hard-break-character-expected.txt
@@ -0,0 +1,23 @@
+layer at (0,0) size 800x600
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  LayoutBlockFlow {HTML} at (0,0) size 800x600
+    LayoutBlockFlow {BODY} at (8,8) size 784x584
+      LayoutBlockFlow {P} at (0,0) size 784x40
+        LayoutText {#text} at (0,0) size 51x19
+          text run at (0,0) width 51: "Test for "
+        LayoutInline {I} at (0,0) size 670x39
+          LayoutInline {A} at (0,0) size 305x19 [color=#0000EE]
+            LayoutText {#text} at (51,0) size 305x19
+              text run at (51,0) width 305: "http://bugs.webkit.org/show_bug.cgi?id=10144"
+          LayoutText {#text} at (356,0) size 670x39
+            text run at (356,0) width 4: " "
+            text run at (360,0) width 310: "REGRESSION: Reproducible assertion failure in"
+            text run at (0,20) width 292: "DeleteSelectionCommand::fixupWhitespace()"
+        LayoutText {#text} at (292,20) size 4x19
+          text run at (292,20) width 4: "."
+      LayoutBlockFlow {DIV} at (0,56) size 784x100
+        LayoutText {#text} at (0,0) size 0x19
+          text run at (0,0) width 0: " "
+        LayoutBR {BR} at (0,20) size 0x19
+caret: position 0 of child 1 {BR} of child 3 {DIV} of body
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text/fake-italic-expected.png b/third_party/WebKit/LayoutTests/platform/android/fast/text/fake-italic-expected.png
new file mode 100644
index 0000000..aa9eb3d2
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text/fake-italic-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text/fake-italic-expected.txt b/third_party/WebKit/LayoutTests/platform/android/fast/text/fake-italic-expected.txt
new file mode 100644
index 0000000..d69502e
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text/fake-italic-expected.txt
@@ -0,0 +1,13 @@
+layer at (0,0) size 800x600
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  LayoutBlockFlow {HTML} at (0,0) size 800x600
+    LayoutBlockFlow {BODY} at (8,8) size 784x576
+      LayoutBlockFlow {P} at (0,0) size 784x60
+        LayoutText {#text} at (0,0) size 772x59
+          text run at (0,0) width 772: "This layout test is designed to test that our fake italic mode is working correctly. The Ahem font, used below, does not include an"
+          text run at (0,20) width 760: "italic variant. Thus, when we ask for italic Ahem, we should skew the glyphs ourselves, resulting in a series of italic black boxes"
+          text run at (0,40) width 41: "below."
+      LayoutBlockFlow {P} at (0,76) size 784x16
+        LayoutText {#text} at (0,0) size 112x16
+          text run at (0,0) width 112: "A A A A"
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text/firstline/002-expected.png b/third_party/WebKit/LayoutTests/platform/android/fast/text/firstline/002-expected.png
new file mode 100644
index 0000000..edf2cae3d
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text/firstline/002-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text/font-initial-expected.png b/third_party/WebKit/LayoutTests/platform/android/fast/text/font-initial-expected.png
new file mode 100644
index 0000000..e2aaa7a
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text/font-initial-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text/font-initial-expected.txt b/third_party/WebKit/LayoutTests/platform/android/fast/text/font-initial-expected.txt
new file mode 100644
index 0000000..c3f28515
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text/font-initial-expected.txt
@@ -0,0 +1,22 @@
+layer at (0,0) size 800x600
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  LayoutBlockFlow {HTML} at (0,0) size 800x600
+    LayoutBlockFlow {BODY} at (8,8) size 784x584
+      LayoutBlockFlow {P} at (0,0) size 784x20
+        LayoutText {#text} at (0,0) size 51x19
+          text run at (0,0) width 51: "Test for "
+        LayoutInline {I} at (0,0) size 628x19
+          LayoutInline {A} at (0,0) size 305x19 [color=#0000EE]
+            LayoutText {#text} at (51,0) size 305x19
+              text run at (51,0) width 305: "http://bugs.webkit.org/show_bug.cgi?id=12039"
+          LayoutText {#text} at (356,0) size 323x19
+            text run at (356,0) width 4: " "
+            text run at (360,0) width 319: "Assertion failure in WebCore::Font::primaryFont"
+        LayoutText {#text} at (679,0) size 4x19
+          text run at (679,0) width 4: "."
+      LayoutBlockFlow (anonymous) at (0,36) size 784x20
+        LayoutInline {SPAN} at (0,0) size 38x19
+          LayoutText {#text} at (0,0) size 38x19
+            text run at (0,0) width 38: "PASS"
+        LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text/font-kerning-expected.png b/third_party/WebKit/LayoutTests/platform/android/fast/text/font-kerning-expected.png
new file mode 100644
index 0000000..5573e83d
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text/font-kerning-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text/font-kerning-expected.txt b/third_party/WebKit/LayoutTests/platform/android/fast/text/font-kerning-expected.txt
new file mode 100644
index 0000000..0bf02cd
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text/font-kerning-expected.txt
@@ -0,0 +1,25 @@
+layer at (0,0) size 800x600
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  LayoutBlockFlow {HTML} at (0,0) size 800x600
+    LayoutBlockFlow {BODY} at (8,8) size 784x584
+      LayoutBlockFlow {DIV} at (0,0) size 784x123
+        LayoutBlockFlow {DIV} at (0,0) size 784x41
+          LayoutText {#text} at (0,0) size 200x41
+            text run at (0,0) width 200: "AVAVAVAV"
+        LayoutBlockFlow {DIV} at (0,41) size 784x41
+          LayoutText {#text} at (0,0) size 200x41
+            text run at (0,0) width 200: "AVAVAVAV"
+        LayoutBlockFlow {DIV} at (0,82) size 784x41
+          LayoutText {#text} at (0,0) size 184x41
+            text run at (0,0) width 184: "AVAVAVAV"
+      LayoutBlockFlow {DIV} at (0,123) size 784x123
+        LayoutBlockFlow {DIV} at (0,0) size 784x41
+          LayoutText {#text} at (0,0) size 200x41
+            text run at (0,0) width 200: "AVAVAVAV"
+        LayoutBlockFlow {DIV} at (0,41) size 784x41
+          LayoutText {#text} at (0,0) size 184x41
+            text run at (0,0) width 184: "AVAVAVAV"
+        LayoutBlockFlow {DIV} at (0,82) size 784x41
+          LayoutText {#text} at (0,0) size 184x41
+            text run at (0,0) width 184: "AVAVAVAV"
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text/font-ligature-letter-spacing-expected.txt b/third_party/WebKit/LayoutTests/platform/android/fast/text/font-ligature-letter-spacing-expected.txt
new file mode 100644
index 0000000..d75f9fe2
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text/font-ligature-letter-spacing-expected.txt
@@ -0,0 +1,8 @@
+CACACACA
+CACACACA
+CACACACA
+This is a testharness.js-based test.
+PASS Ligature expected not to be applied due to letter spacing. 
+PASS Ligature expected not to be applied due to letter spacing. 
+Harness: the test ran to completion.
+
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text/font-smallcaps-layout-expected.png b/third_party/WebKit/LayoutTests/platform/android/fast/text/font-smallcaps-layout-expected.png
new file mode 100644
index 0000000..f494282
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text/font-smallcaps-layout-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text/font-smallcaps-layout-expected.txt b/third_party/WebKit/LayoutTests/platform/android/fast/text/font-smallcaps-layout-expected.txt
new file mode 100644
index 0000000..3f8e506
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text/font-smallcaps-layout-expected.txt
@@ -0,0 +1,22 @@
+layer at (0,0) size 800x600
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x40
+  LayoutBlockFlow {HTML} at (0,0) size 800x40
+    LayoutBlockFlow {BODY} at (0,0) size 800x40
+      LayoutText {#text} at (0,0) size 782x39
+        text run at (0,0) width 782: "Testing for incorrect text overflow when using small caps in the complex test path. There should be no red characters visible on the"
+        text run at (0,20) width 95: "green rectangle."
+      LayoutText {#text} at (0,0) size 0x0
+layer at (-500,40) size 1000x366 backgroundClip at (0,0) size 800x600 clip at (0,0) size 800x600
+  LayoutBlockFlow (positioned) {DIV} at (-500,40) size 1000x366 [bgcolor=#90EE90]
+    LayoutBlockFlow {P} at (0,30) size 500x306 [color=#FF0000] [bgcolor=#FFB6C1]
+      LayoutText {#text} at (0,0) size 500x306
+        text run at (0,0) width 376: "Lorem ipsum dolor sit amet,"
+        text run at (0,34) width 445: "consectetuer adipiscing elit, sed"
+        text run at (0,68) width 378: "diam nonummy nibh euismod"
+        text run at (0,102) width 487: "tincidunt ut laoreet dolore magna"
+        text run at (0,136) width 491: "aliquam erat volutpat. Ut wisi enim"
+        text run at (0,170) width 500: "ad minim veniam, quis nostrud exerci"
+        text run at (0,204) width 380: "tation ullamcorper suscipit"
+        text run at (0,238) width 395: "lobortis nisl ut aliquip ex ea"
+        text run at (0,272) width 279: "commodo consequat."
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text/font-stretch-expected.png b/third_party/WebKit/LayoutTests/platform/android/fast/text/font-stretch-expected.png
new file mode 100644
index 0000000..7e454a4
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text/font-stretch-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text/font-stretch-expected.txt b/third_party/WebKit/LayoutTests/platform/android/fast/text/font-stretch-expected.txt
new file mode 100644
index 0000000..ee4bf51
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text/font-stretch-expected.txt
@@ -0,0 +1,127 @@
+layer at (0,0) size 800x600
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x416
+  LayoutBlockFlow {HTML} at (0,0) size 800x416
+    LayoutBlockFlow {BODY} at (8,8) size 784x400
+      LayoutBlockFlow {H1} at (0,0) size 784x24
+        LayoutText {#text} at (0,0) size 249x23
+          text run at (0,0) width 249: "Tests support for font-stretch"
+      LayoutBlockFlow {P} at (0,26) size 784x17
+        LayoutText {#text} at (0,0) size 233x16
+          text run at (0,0) width 233: "Tests that CSS font-stretch is supported."
+      LayoutBlockFlow {SECTION} at (0,51) size 784x175
+        LayoutBlockFlow {H2} at (0,0) size 784x20
+          LayoutText {#text} at (0,0) size 62x19
+            text run at (0,0) width 62: "Segoe UI"
+        LayoutBlockFlow {P} at (0,22) size 784x17
+          LayoutBlockFlow {SPAN} at (0,0) size 210x17
+            LayoutText {#text} at (0,0) size 164x16
+              text run at (0,0) width 164: "font-stretch: ultra-condensed"
+          LayoutText {#text} at (210,0) size 354x16
+            text run at (210,0) width 354: " - Just poets wax boldly as kings and queens march over fuzz."
+        LayoutBlockFlow {P} at (0,39) size 784x17
+          LayoutBlockFlow {SPAN} at (0,0) size 210x17
+            LayoutText {#text} at (0,0) size 167x16
+              text run at (0,0) width 167: "font-stretch: extra-condensed"
+          LayoutText {#text} at (210,0) size 354x16
+            text run at (210,0) width 354: " - Just poets wax boldly as kings and queens march over fuzz."
+        LayoutBlockFlow {P} at (0,56) size 784x17
+          LayoutBlockFlow {SPAN} at (0,0) size 210x17
+            LayoutText {#text} at (0,0) size 134x16
+              text run at (0,0) width 134: "font-stretch: condensed"
+          LayoutText {#text} at (210,0) size 354x16
+            text run at (210,0) width 354: " - Just poets wax boldly as kings and queens march over fuzz."
+        LayoutBlockFlow {P} at (0,73) size 784x17
+          LayoutBlockFlow {SPAN} at (0,0) size 210x17
+            LayoutText {#text} at (0,0) size 165x16
+              text run at (0,0) width 165: "font-stretch: semi-condensed"
+          LayoutText {#text} at (210,0) size 354x16
+            text run at (210,0) width 354: " - Just poets wax boldly as kings and queens march over fuzz."
+        LayoutBlockFlow {P} at (0,90) size 784x17
+          LayoutBlockFlow {SPAN} at (0,0) size 210x17
+            LayoutText {#text} at (0,0) size 113x16
+              text run at (0,0) width 113: "font-stretch: normal"
+          LayoutText {#text} at (210,0) size 354x16
+            text run at (210,0) width 354: " - Just poets wax boldly as kings and queens march over fuzz."
+        LayoutBlockFlow {P} at (0,107) size 784x17
+          LayoutBlockFlow {SPAN} at (0,0) size 210x17
+            LayoutText {#text} at (0,0) size 158x16
+              text run at (0,0) width 158: "font-stretch: semi-expanded"
+          LayoutText {#text} at (210,0) size 354x16
+            text run at (210,0) width 354: " - Just poets wax boldly as kings and queens march over fuzz."
+        LayoutBlockFlow {P} at (0,124) size 784x17
+          LayoutBlockFlow {SPAN} at (0,0) size 210x17
+            LayoutText {#text} at (0,0) size 127x16
+              text run at (0,0) width 127: "font-stretch: expanded"
+          LayoutText {#text} at (210,0) size 354x16
+            text run at (210,0) width 354: " - Just poets wax boldly as kings and queens march over fuzz."
+        LayoutBlockFlow {P} at (0,141) size 784x17
+          LayoutBlockFlow {SPAN} at (0,0) size 210x17
+            LayoutText {#text} at (0,0) size 160x16
+              text run at (0,0) width 160: "font-stretch: extra-expanded"
+          LayoutText {#text} at (210,0) size 354x16
+            text run at (210,0) width 354: " - Just poets wax boldly as kings and queens march over fuzz."
+        LayoutBlockFlow {P} at (0,158) size 784x17
+          LayoutBlockFlow {SPAN} at (0,0) size 210x17
+            LayoutText {#text} at (0,0) size 157x16
+              text run at (0,0) width 157: "font-stretch: ultra-expanded"
+          LayoutText {#text} at (210,0) size 354x16
+            text run at (210,0) width 354: " - Just poets wax boldly as kings and queens march over fuzz."
+      LayoutBlockFlow {SECTION} at (0,234) size 784x166
+        LayoutBlockFlow {H2} at (0,0) size 784x20
+          LayoutText {#text} at (0,0) size 34x19
+            text run at (0,0) width 34: "Arial"
+        LayoutBlockFlow {P} at (0,22) size 784x16
+          LayoutBlockFlow {SPAN} at (0,0) size 240x16
+            LayoutText {#text} at (0,0) size 183x16
+              text run at (0,0) width 183: "font-stretch: ultra-condensed"
+          LayoutText {#text} at (240,0) size 387x16
+            text run at (240,0) width 387: " - Just poets wax boldly as kings and queens march over fuzz."
+        LayoutBlockFlow {P} at (0,38) size 784x16
+          LayoutBlockFlow {SPAN} at (0,0) size 240x16
+            LayoutText {#text} at (0,0) size 186x16
+              text run at (0,0) width 186: "font-stretch: extra-condensed"
+          LayoutText {#text} at (240,0) size 387x16
+            text run at (240,0) width 387: " - Just poets wax boldly as kings and queens march over fuzz."
+        LayoutBlockFlow {P} at (0,54) size 784x16
+          LayoutBlockFlow {SPAN} at (0,0) size 240x16
+            LayoutText {#text} at (0,0) size 150x16
+              text run at (0,0) width 150: "font-stretch: condensed"
+          LayoutText {#text} at (240,0) size 387x16
+            text run at (240,0) width 387: " - Just poets wax boldly as kings and queens march over fuzz."
+        LayoutBlockFlow {P} at (0,70) size 784x16
+          LayoutBlockFlow {SPAN} at (0,0) size 240x16
+            LayoutText {#text} at (0,0) size 184x16
+              text run at (0,0) width 184: "font-stretch: semi-condensed"
+          LayoutText {#text} at (240,0) size 387x16
+            text run at (240,0) width 387: " - Just poets wax boldly as kings and queens march over fuzz."
+        LayoutBlockFlow {P} at (0,86) size 784x16
+          LayoutBlockFlow {SPAN} at (0,0) size 240x16
+            LayoutText {#text} at (0,0) size 123x16
+              text run at (0,0) width 123: "font-stretch: normal"
+          LayoutText {#text} at (240,0) size 387x16
+            text run at (240,0) width 387: " - Just poets wax boldly as kings and queens march over fuzz."
+        LayoutBlockFlow {P} at (0,102) size 784x16
+          LayoutBlockFlow {SPAN} at (0,0) size 240x16
+            LayoutText {#text} at (0,0) size 176x16
+              text run at (0,0) width 176: "font-stretch: semi-expanded"
+          LayoutText {#text} at (240,0) size 387x16
+            text run at (240,0) width 387: " - Just poets wax boldly as kings and queens march over fuzz."
+        LayoutBlockFlow {P} at (0,118) size 784x16
+          LayoutBlockFlow {SPAN} at (0,0) size 240x16
+            LayoutText {#text} at (0,0) size 142x16
+              text run at (0,0) width 142: "font-stretch: expanded"
+          LayoutText {#text} at (240,0) size 387x16
+            text run at (240,0) width 387: " - Just poets wax boldly as kings and queens march over fuzz."
+        LayoutBlockFlow {P} at (0,134) size 784x16
+          LayoutBlockFlow {SPAN} at (0,0) size 240x16
+            LayoutText {#text} at (0,0) size 178x16
+              text run at (0,0) width 178: "font-stretch: extra-expanded"
+          LayoutText {#text} at (240,0) size 387x16
+            text run at (240,0) width 387: " - Just poets wax boldly as kings and queens march over fuzz."
+        LayoutBlockFlow {P} at (0,150) size 784x16
+          LayoutBlockFlow {SPAN} at (0,0) size 240x16
+            LayoutText {#text} at (0,0) size 175x16
+              text run at (0,0) width 175: "font-stretch: ultra-expanded"
+          LayoutText {#text} at (240,0) size 387x16
+            text run at (240,0) width 387: " - Just poets wax boldly as kings and queens march over fuzz."
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text/font-stretch-variant-expected.png b/third_party/WebKit/LayoutTests/platform/android/fast/text/font-stretch-variant-expected.png
new file mode 100644
index 0000000..9c8c52f
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text/font-stretch-variant-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text/font-weight-expected.png b/third_party/WebKit/LayoutTests/platform/android/fast/text/font-weight-expected.png
new file mode 100644
index 0000000..469aeac
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text/font-weight-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text/font-weight-expected.txt b/third_party/WebKit/LayoutTests/platform/android/fast/text/font-weight-expected.txt
new file mode 100644
index 0000000..fe67c087
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text/font-weight-expected.txt
@@ -0,0 +1,73 @@
+layer at (0,0) size 800x600
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x420
+  LayoutBlockFlow {HTML} at (0,0) size 800x420
+    LayoutBlockFlow {BODY} at (8,8) size 784x404
+      LayoutBlockFlow {H1} at (0,0) size 784x24
+        LayoutText {#text} at (0,0) size 246x23
+          text run at (0,0) width 246: "Tests support for font-weight"
+      LayoutBlockFlow {P} at (0,26) size 784x17
+        LayoutText {#text} at (0,0) size 350x16
+          text run at (0,0) width 350: "Tests that CSS font-weight with numeric values is supported."
+      LayoutBlockFlow {SECTION} at (0,51) size 784x179
+        LayoutBlockFlow {H2} at (0,0) size 784x20
+          LayoutText {#text} at (0,0) size 62x19
+            text run at (0,0) width 62: "Segoe UI"
+        LayoutBlockFlow {P} at (0,22) size 784x17
+          LayoutText {#text} at (0,0) size 338x16
+            text run at (0,0) width 338: "font-weight: 100 - Fix problem quickly with galvanized jets."
+        LayoutBlockFlow {P} at (0,39) size 784x17
+          LayoutText {#text} at (0,0) size 338x16
+            text run at (0,0) width 338: "font-weight: 200 - Fix problem quickly with galvanized jets."
+        LayoutBlockFlow {P} at (0,56) size 784x17
+          LayoutText {#text} at (0,0) size 338x16
+            text run at (0,0) width 338: "font-weight: 300 - Fix problem quickly with galvanized jets."
+        LayoutBlockFlow {P} at (0,73) size 784x17
+          LayoutText {#text} at (0,0) size 338x16
+            text run at (0,0) width 338: "font-weight: 400 - Fix problem quickly with galvanized jets."
+        LayoutBlockFlow {P} at (0,90) size 784x17
+          LayoutText {#text} at (0,0) size 338x16
+            text run at (0,0) width 338: "font-weight: 500 - Fix problem quickly with galvanized jets."
+        LayoutBlockFlow {P} at (0,107) size 784x18
+          LayoutText {#text} at (0,0) size 363x17
+            text run at (0,0) width 363: "font-weight: 600 - Fix problem quickly with galvanized jets."
+        LayoutBlockFlow {P} at (0,125) size 784x18
+          LayoutText {#text} at (0,0) size 363x17
+            text run at (0,0) width 363: "font-weight: 700 - Fix problem quickly with galvanized jets."
+        LayoutBlockFlow {P} at (0,143) size 784x18
+          LayoutText {#text} at (0,0) size 363x17
+            text run at (0,0) width 363: "font-weight: 800 - Fix problem quickly with galvanized jets."
+        LayoutBlockFlow {P} at (0,161) size 784x18
+          LayoutText {#text} at (0,0) size 363x17
+            text run at (0,0) width 363: "font-weight: 900 - Fix problem quickly with galvanized jets."
+      LayoutBlockFlow {SECTION} at (0,238) size 784x166
+        LayoutBlockFlow {H2} at (0,0) size 784x20
+          LayoutText {#text} at (0,0) size 34x19
+            text run at (0,0) width 34: "Arial"
+        LayoutBlockFlow {P} at (0,22) size 784x16
+          LayoutText {#text} at (0,0) size 363x16
+            text run at (0,0) width 363: "font-weight: 100 - Fix problem quickly with galvanized jets."
+        LayoutBlockFlow {P} at (0,38) size 784x16
+          LayoutText {#text} at (0,0) size 363x16
+            text run at (0,0) width 363: "font-weight: 200 - Fix problem quickly with galvanized jets."
+        LayoutBlockFlow {P} at (0,54) size 784x16
+          LayoutText {#text} at (0,0) size 363x16
+            text run at (0,0) width 363: "font-weight: 300 - Fix problem quickly with galvanized jets."
+        LayoutBlockFlow {P} at (0,70) size 784x16
+          LayoutText {#text} at (0,0) size 363x16
+            text run at (0,0) width 363: "font-weight: 400 - Fix problem quickly with galvanized jets."
+        LayoutBlockFlow {P} at (0,86) size 784x16
+          LayoutText {#text} at (0,0) size 363x16
+            text run at (0,0) width 363: "font-weight: 500 - Fix problem quickly with galvanized jets."
+        LayoutBlockFlow {P} at (0,102) size 784x16
+          LayoutText {#text} at (0,0) size 408x16
+            text run at (0,0) width 408: "font-weight: 600 - Fix problem quickly with galvanized jets."
+        LayoutBlockFlow {P} at (0,118) size 784x16
+          LayoutText {#text} at (0,0) size 408x16
+            text run at (0,0) width 408: "font-weight: 700 - Fix problem quickly with galvanized jets."
+        LayoutBlockFlow {P} at (0,134) size 784x16
+          LayoutText {#text} at (0,0) size 408x16
+            text run at (0,0) width 408: "font-weight: 800 - Fix problem quickly with galvanized jets."
+        LayoutBlockFlow {P} at (0,150) size 784x16
+          LayoutText {#text} at (0,0) size 408x16
+            text run at (0,0) width 408: "font-weight: 900 - Fix problem quickly with galvanized jets."
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text/format-control-expected.png b/third_party/WebKit/LayoutTests/platform/android/fast/text/format-control-expected.png
new file mode 100644
index 0000000..f7bcda64
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text/format-control-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text/format-control-expected.txt b/third_party/WebKit/LayoutTests/platform/android/fast/text/format-control-expected.txt
new file mode 100644
index 0000000..9fa4242
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text/format-control-expected.txt
@@ -0,0 +1,28 @@
+layer at (0,0) size 800x600
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  LayoutBlockFlow {HTML} at (0,0) size 800x600
+    LayoutBlockFlow {BODY} at (8,8) size 784x552
+      LayoutBlockFlow (anonymous) at (0,0) size 784x20
+        LayoutText {#text} at (0,0) size 457x19
+          text run at (0,0) width 457: "This tests the ZWJ and ZWNJ format control characters on basic Latin text."
+      LayoutBlockFlow {DIV} at (0,60) size 784x224
+        LayoutBlockFlow {P} at (0,0) size 784x48
+          LayoutText {#text} at (0,1) size 276x46
+            text run at (0,1) width 276: "fi fl ff ffi ffl fl f   i"
+        LayoutBlockFlow {P} at (0,88) size 784x48
+          LayoutText {#text} at (0,1) size 276x46
+            text run at (0,1) width 276: "f\x{200C}i f\x{200C}l f\x{200C}f f\x{200C}f\x{200C}i f\x{200C}f\x{200C}l f\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}l f\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C} \x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C} \x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C} \x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}i"
+        LayoutBlockFlow {P} at (0,176) size 784x48
+          LayoutText {#text} at (0,1) size 276x46
+            text run at (0,1) width 276: "f\x{200D}i f\x{200D}l f\x{200D}f f\x{200D}f\x{200D}i f\x{200D}f\x{200D}l f\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}l f\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D} \x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D} \x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D} \x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}i"
+      LayoutBlockFlow {DIV} at (0,324) size 784x224
+        LayoutBlockFlow {P} at (0,0) size 784x48
+          LayoutText {#text} at (0,1) size 276x46
+            text run at (0,1) width 276: "fi fl ff ffi ffl fl f   i"
+        LayoutBlockFlow {P} at (0,88) size 784x48
+          LayoutText {#text} at (0,1) size 276x46
+            text run at (0,1) width 276: "f\x{200C}i f\x{200C}l f\x{200C}f f\x{200C}f\x{200C}i f\x{200C}f\x{200C}l f\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}l f\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C} \x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C} \x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C} \x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}i"
+        LayoutBlockFlow {P} at (0,176) size 784x48
+          LayoutText {#text} at (0,1) size 276x46
+            text run at (0,1) width 276: "f\x{200D}i f\x{200D}l f\x{200D}f f\x{200D}f\x{200D}i f\x{200D}f\x{200D}l f\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}l f\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D} \x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D} \x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D} \x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}i"
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text/in-rendered-text-rtl-expected.txt b/third_party/WebKit/LayoutTests/platform/android/fast/text/in-rendered-text-rtl-expected.txt
new file mode 100644
index 0000000..83d3171
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text/in-rendered-text-rtl-expected.txt
@@ -0,0 +1,28 @@
+layer at (0,0) size 800x600
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  LayoutBlockFlow {HTML} at (0,0) size 800x600
+    LayoutBlockFlow {BODY} at (8,8) size 784x584
+      LayoutBlockFlow {P} at (0,0) size 784x40
+        LayoutText {#text} at (0,0) size 51x19
+          text run at (0,0) width 51: "Test for "
+        LayoutInline {I} at (0,0) size 758x39
+          LayoutInline {A} at (0,0) size 350x19 [color=#0000EE]
+            LayoutText {#text} at (51,0) size 350x19
+              text run at (51,0) width 350: "http://bugzilla.opendarwin.org/show_bug.cgi?id=7433"
+          LayoutText {#text} at (401,0) size 758x39
+            text run at (401,0) width 357: " REGRESSION (r12789): Second RTL text run on a line"
+            text run at (0,20) width 118: "cannot be selected"
+        LayoutText {#text} at (118,20) size 4x19
+          text run at (118,20) width 4: "."
+      LayoutBlockFlow {P} at (0,56) size 784x20
+        LayoutText {#text} at (0,0) size 615x19
+          text run at (0,0) width 615: "The rightmost two words in the Hebrew text should be selectable by dragging or double-clicking them."
+      LayoutBlockFlow {HR} at (0,92) size 784x2 [border: (1px inset #EEEEEE)]
+      LayoutBlockFlow (anonymous) at (0,102) size 784x20
+        LayoutInline {SPAN} at (0,0) size 116x19
+          LayoutText {#text} at (0,0) size 116x19
+            text run at (0,0) width 50 RTL: "\x{5E9}\x{5EA}\x{5D4} \x{5DE}\x{5D9}\x{5E5}"
+            text run at (50,0) width 66 RTL: "\x{5D0}\x{5DB}\x{5DC}\x{5EA} \x{5E4}\x{5DC}\x{5E4}\x{5DC} "
+        LayoutText {#text} at (0,0) size 0x0
+caret: position 3 of child 0 {#text} of child 7 {SPAN} of body
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text/international/bidi-AN-after-empty-run-expected.png b/third_party/WebKit/LayoutTests/platform/android/fast/text/international/bidi-AN-after-empty-run-expected.png
new file mode 100644
index 0000000..3f464f6
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text/international/bidi-AN-after-empty-run-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text/international/bidi-AN-after-empty-run-expected.txt b/third_party/WebKit/LayoutTests/platform/android/fast/text/international/bidi-AN-after-empty-run-expected.txt
new file mode 100644
index 0000000..6e8b4e0
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text/international/bidi-AN-after-empty-run-expected.txt
@@ -0,0 +1,30 @@
+layer at (0,0) size 800x600
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  LayoutBlockFlow {HTML} at (0,0) size 800x600
+    LayoutBlockFlow {BODY} at (8,8) size 784x584
+      LayoutBlockFlow {P} at (0,0) size 784x20
+        LayoutText {#text} at (0,0) size 51x19
+          text run at (0,0) width 51: "Test for "
+        LayoutInline {I} at (0,0) size 394x19
+          LayoutInline {A} at (0,0) size 154x19 [color=#0000EE]
+            LayoutText {#text} at (51,0) size 154x19
+              text run at (51,0) width 154: "rdar://problem/6020930"
+          LayoutText {#text} at (205,0) size 240x19
+            text run at (205,0) width 240: " Bidi Problem When Resizing Window"
+        LayoutText {#text} at (445,0) size 4x19
+          text run at (445,0) width 4: "."
+      LayoutBlockFlow {P} at (0,36) size 784x20
+        LayoutText {#text} at (0,0) size 306x19
+          text run at (0,0) width 306: "The boxes below should be identical to each other."
+      LayoutBlockFlow {DIV} at (0,72) size 90x50 [border: (1px solid #0000FF)]
+        LayoutText {#text} at (5,5) size 59x39
+          text run at (5,5) width 55 RTL: "\x{627}\x{644}\x{645}\x{627}\x{626}\x{629} \x{645}\x{644}\x{64A}\x{627}\x{631}"
+          text run at (60,5) width 4: " "
+          text run at (5,25) width 18 RTL: " \x{645}\x{646}"
+          text run at (23,25) width 40: "12345"
+      LayoutBlockFlow {DIV} at (0,122) size 90x50 [border: (1px solid #0000FF)]
+        LayoutText {#text} at (5,5) size 58x39
+          text run at (5,5) width 55 RTL: "\x{627}\x{644}\x{645}\x{627}\x{626}\x{629} \x{645}\x{644}\x{64A}\x{627}\x{631}"
+          text run at (5,25) width 18 RTL: " \x{645}\x{646}"
+          text run at (23,25) width 40: "12345"
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text/international/bidi-LDB-2-CSS-expected.txt b/third_party/WebKit/LayoutTests/platform/android/fast/text/international/bidi-LDB-2-CSS-expected.txt
new file mode 100644
index 0000000..4839b37d
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text/international/bidi-LDB-2-CSS-expected.txt
@@ -0,0 +1,596 @@
+layer at (0,0) size 800x600
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x570
+  LayoutBlockFlow {HTML} at (0,0) size 800x569.88
+    LayoutBlockFlow {BODY} at (8,21.44) size 784x532.44
+      LayoutBlockFlow {H1} at (0,0) size 784x37
+        LayoutText {#text} at (0,0) size 425x36
+          text run at (0,0) width 425: "Bidirectional Text Test 2 - CSS"
+      LayoutBlockFlow {P} at (0,58.44) size 784x20
+        LayoutText {#text} at (0,0) size 126x19
+          text run at (0,0) width 126: "This test is based on "
+        LayoutInline {A} at (0,0) size 115x19 [color=#0000EE]
+          LayoutText {#text} at (126,0) size 115x19
+            text run at (126,0) width 115: "CSS2 section 9.10"
+        LayoutText {#text} at (241,0) size 30x19
+          text run at (241,0) width 30: " and "
+        LayoutInline {A} at (0,0) size 61x19 [color=#0000EE]
+          LayoutText {#text} at (271,0) size 61x19
+            text run at (271,0) width 61: "Chapter 3"
+        LayoutText {#text} at (332,0) size 42x19
+          text run at (332,0) width 42: " of the "
+        LayoutInline {A} at (0,0) size 110x19 [color=#0000EE]
+          LayoutText {#text} at (374,0) size 110x19
+            text run at (374,0) width 110: "Unicode Standard"
+        LayoutText {#text} at (484,0) size 4x19
+          text run at (484,0) width 4: "."
+      LayoutBlockFlow {P} at (0,94.44) size 784x20
+        LayoutText {#text} at (0,0) size 66x19
+          text run at (0,0) width 66: "See also a "
+        LayoutInline {A} at (0,0) size 218x19 [color=#0000EE]
+          LayoutText {#text} at (66,0) size 218x19
+            text run at (66,0) width 218: "test for the same concepts in HTML"
+        LayoutText {#text} at (284,0) size 41x19
+          text run at (284,0) width 41: " and a "
+        LayoutInline {A} at (0,0) size 416x19 [color=#0000EE]
+          LayoutText {#text} at (325,0) size 416x19
+            text run at (325,0) width 416: "test for the same concepts using Unicode directional formatting codes"
+        LayoutText {#text} at (741,0) size 4x19
+          text run at (741,0) width 4: "."
+      LayoutBlockFlow {P} at (0,130.44) size 784x20
+        LayoutText {#text} at (0,0) size 267x19
+          text run at (0,0) width 267: "In each box, all the lines should be the same."
+      LayoutBlockFlow (anonymous) at (0,166.44) size 784x248
+        LayoutBlockFlow {DIV} at (3,3) size 96x188 [border: (1px solid #008000)]
+          LayoutBlockFlow {P} at (4,4) size 88x20
+            LayoutText {#text} at (0,0) size 88x19
+              text run at (0,0) width 88: "ABCDEFGHI"
+          LayoutBlockFlow {P} at (4,24) size 88x20
+            LayoutText {#text} at (0,0) size 88x19
+              text run at (0,0) width 88: "ABCDEFGHI"
+          LayoutBlockFlow {P} at (4,44) size 88x20
+            LayoutText {#text} at (0,0) size 32x19
+              text run at (0,0) width 32: "ABC"
+            LayoutInline {SPAN} at (0,0) size 29x19
+              LayoutText {#text} at (32,0) size 29x19
+                text run at (32,0) width 29: "DEF"
+            LayoutText {#text} at (61,0) size 27x19
+              text run at (61,0) width 27: "GHI"
+          LayoutBlockFlow {P} at (4,64) size 88x20
+            LayoutText {#text} at (0,0) size 88x19
+              text run at (0,0) width 88 RTL override: "IHGFEDCBA"
+          LayoutBlockFlow {P} at (4,84) size 88x20
+            LayoutText {#text} at (61,0) size 27x19
+              text run at (61,0) width 27 RTL override: "IHG"
+            LayoutInline {SPAN} at (0,0) size 29x19
+              LayoutText {#text} at (32,0) size 29x19
+                text run at (32,0) width 29 RTL override: "FED"
+            LayoutText {#text} at (0,0) size 32x19
+              text run at (0,0) width 32 RTL override: "CBA"
+          LayoutBlockFlow {P} at (4,104) size 88x20
+            LayoutText {#text} at (61,0) size 27x19
+              text run at (61,0) width 27 RTL override: "IHG"
+            LayoutInline {SPAN} at (0,0) size 29x19
+              LayoutText {#text} at (32,0) size 29x19
+                text run at (32,0) width 29: "DEF"
+            LayoutText {#text} at (0,0) size 32x19
+              text run at (0,0) width 32 RTL override: "CBA"
+          LayoutBlockFlow {P} at (4,124) size 88x20
+            LayoutText {#text} at (61,0) size 27x19
+              text run at (61,0) width 27 RTL override: "IHG"
+            LayoutInline {SPAN} at (0,0) size 29x19
+              LayoutText {#text} at (32,0) size 29x19
+                text run at (32,0) width 29 RTL override: "FED"
+            LayoutText {#text} at (0,0) size 32x19
+              text run at (0,0) width 32 RTL override: "CBA"
+          LayoutBlockFlow {P} at (4,144) size 88x20
+            LayoutText {#text} at (61,0) size 27x19
+              text run at (61,0) width 27 RTL override: "IHG"
+            LayoutInline {SPAN} at (0,0) size 29x19
+              LayoutText {#text} at (32,0) size 29x19
+                text run at (32,0) width 29 RTL override: "FED"
+            LayoutText {#text} at (0,0) size 32x19
+              text run at (0,0) width 32 RTL override: "CBA"
+          LayoutBlockFlow {P} at (4,164) size 88x20
+            LayoutText {#text} at (61,0) size 27x19
+              text run at (61,0) width 27 RTL override: "IHG"
+            LayoutInline {SPAN} at (0,0) size 29x19
+              LayoutText {#text} at (32,0) size 29x19
+                text run at (32,0) width 29 LTR override: "DEF"
+            LayoutText {#text} at (0,0) size 32x19
+              text run at (0,0) width 32 RTL override: "CBA"
+        LayoutText {#text} at (102,85) size 4x19
+          text run at (102,85) width 4: " "
+        LayoutBlockFlow {DIV} at (109,53) size 28x88 [border: (1px solid #008000)]
+          LayoutTable {TABLE} at (4,4) size 20x20
+            LayoutTableSection {TBODY} at (0,0) size 20x20
+              LayoutTableRow {TR} at (0,0) size 20x20
+                LayoutTableCell {TD} at (0,0) size 5x20 [r=0 c=0 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 5x19
+                    text run at (0,0) width 5 RTL: "\x{5D2}"
+                LayoutTableCell {TD} at (5,0) size 7x20 [r=0 c=1 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 7x19
+                    text run at (0,0) width 7 RTL: "\x{5D1}"
+                LayoutTableCell {TD} at (12,0) size 8x20 [r=0 c=2 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 8x19
+                    text run at (0,0) width 8 RTL: "\x{5D0}"
+          LayoutBlockFlow {P} at (4,24) size 20x20
+            LayoutText {#text} at (0,0) size 20x19
+              text run at (0,0) width 20 RTL: "\x{5D0}\x{5D1}\x{5D2}"
+          LayoutBlockFlow {P} at (4,44) size 20x20
+            LayoutText {#text} at (0,0) size 20x19
+              text run at (0,0) width 20 RTL: "\x{5D0}\x{5D1}\x{5D2}"
+          LayoutBlockFlow {P} at (4,64) size 20x20
+            LayoutText {#text} at (0,0) size 20x19
+              text run at (0,0) width 20 LTR override: "\x{5D2}\x{5D1}\x{5D0}"
+        LayoutText {#text} at (140,85) size 4x19
+          text run at (140,85) width 4: " "
+        LayoutBlockFlow {DIV} at (147,63) size 87x68 [border: (1px solid #008000)]
+          LayoutTable {TABLE} at (4,4) size 79x20
+            LayoutTableSection {TBODY} at (0,0) size 79x20
+              LayoutTableRow {TR} at (0,0) size 79x20
+                LayoutTableCell {TD} at (0,0) size 5x20 [r=0 c=0 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 5x19
+                    text run at (0,0) width 5 RTL: "\x{5D2}"
+                LayoutTableCell {TD} at (5,0) size 7x20 [r=0 c=1 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 7x19
+                    text run at (0,0) width 7 RTL: "\x{5D1}"
+                LayoutTableCell {TD} at (12,0) size 8x20 [r=0 c=2 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 8x19
+                    text run at (0,0) width 8 RTL: "\x{5D0}"
+                LayoutTableCell {TD} at (20,0) size 4x20 [r=0 c=3 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 4x19
+                    text run at (0,0) width 4: " "
+                LayoutTableCell {TD} at (24,0) size 11x20 [r=0 c=4 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 11x19
+                    text run at (0,0) width 11: "A"
+                LayoutTableCell {TD} at (35,0) size 10x20 [r=0 c=5 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 10x19
+                    text run at (0,0) width 10: "B"
+                LayoutTableCell {TD} at (45,0) size 11x20 [r=0 c=6 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 11x19
+                    text run at (0,0) width 11: "C"
+                LayoutTableCell {TD} at (56,0) size 4x20 [r=0 c=7 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 4x19
+                    text run at (0,0) width 4: " "
+                LayoutTableCell {TD} at (60,0) size 4x20 [r=0 c=8 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 4x19
+                    text run at (0,0) width 4 RTL: "\x{5D5}"
+                LayoutTableCell {TD} at (64,0) size 8x20 [r=0 c=9 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 8x19
+                    text run at (0,0) width 8 RTL: "\x{5D4}"
+                LayoutTableCell {TD} at (72,0) size 7x20 [r=0 c=10 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 7x19
+                    text run at (0,0) width 7 RTL: "\x{5D3}"
+          LayoutBlockFlow {P} at (4,24) size 79x20
+            LayoutText {#text} at (0,0) size 79x19
+              text run at (0,0) width 20 RTL: "\x{5D0}\x{5D1}\x{5D2}"
+              text run at (20,0) width 40: " ABC "
+              text run at (60,0) width 19 RTL: "\x{5D3}\x{5D4}\x{5D5}"
+          LayoutBlockFlow {P} at (4,44) size 79x20
+            LayoutText {#text} at (0,0) size 79x19
+              text run at (0,0) width 24 RTL: " \x{5D0}\x{5D1}\x{5D2}"
+              text run at (24,0) width 32: "ABC"
+              text run at (56,0) width 23 RTL: "\x{5D3}\x{5D4}\x{5D5} "
+        LayoutText {#text} at (237,85) size 4x19
+          text run at (237,85) width 4: " "
+        LayoutBlockFlow {DIV} at (244,3) size 145x188 [border: (1px solid #008000)]
+          LayoutTable {TABLE} at (4,4) size 137x20
+            LayoutTableSection {TBODY} at (0,0) size 137x20
+              LayoutTableRow {TR} at (0,0) size 137x20
+                LayoutTableCell {TD} at (0,0) size 5x20 [r=0 c=0 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 5x19
+                    text run at (0,0) width 5 RTL: "\x{5D2}"
+                LayoutTableCell {TD} at (5,0) size 7x20 [r=0 c=1 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 7x19
+                    text run at (0,0) width 7 RTL: "\x{5D1}"
+                LayoutTableCell {TD} at (12,0) size 8x20 [r=0 c=2 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 8x19
+                    text run at (0,0) width 8 RTL: "\x{5D0}"
+                LayoutTableCell {TD} at (20,0) size 4x20 [r=0 c=3 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 4x19
+                    text run at (0,0) width 4: " "
+                LayoutTableCell {TD} at (24,0) size 11x20 [r=0 c=4 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 11x19
+                    text run at (0,0) width 11: "A"
+                LayoutTableCell {TD} at (35,0) size 10x20 [r=0 c=5 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 10x19
+                    text run at (0,0) width 10: "B"
+                LayoutTableCell {TD} at (45,0) size 11x20 [r=0 c=6 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 11x19
+                    text run at (0,0) width 11: "C"
+                LayoutTableCell {TD} at (56,0) size 4x20 [r=0 c=7 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 4x19
+                    text run at (0,0) width 4: " "
+                LayoutTableCell {TD} at (60,0) size 4x20 [r=0 c=8 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 4x19
+                    text run at (0,0) width 4 RTL: "\x{5D5}"
+                LayoutTableCell {TD} at (64,0) size 8x20 [r=0 c=9 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 8x19
+                    text run at (0,0) width 8 RTL: "\x{5D4}"
+                LayoutTableCell {TD} at (72,0) size 7x20 [r=0 c=10 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 7x19
+                    text run at (0,0) width 7 RTL: "\x{5D3}"
+                LayoutTableCell {TD} at (79,0) size 4x20 [r=0 c=11 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 4x19
+                    text run at (0,0) width 4: " "
+                LayoutTableCell {TD} at (83,0) size 11x20 [r=0 c=12 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 11x19
+                    text run at (0,0) width 11: "D"
+                LayoutTableCell {TD} at (94,0) size 9x20 [r=0 c=13 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 9x19
+                    text run at (0,0) width 9: "E"
+                LayoutTableCell {TD} at (103,0) size 9x20 [r=0 c=14 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 9x19
+                    text run at (0,0) width 9: "F"
+                LayoutTableCell {TD} at (112,0) size 4x20 [r=0 c=15 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 4x19
+                    text run at (0,0) width 4: " "
+                LayoutTableCell {TD} at (116,0) size 8x20 [r=0 c=16 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 8x19
+                    text run at (0,0) width 8 RTL: "\x{5D8}"
+                LayoutTableCell {TD} at (124,0) size 8x20 [r=0 c=17 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 8x19
+                    text run at (0,0) width 8 RTL: "\x{5D7}"
+                LayoutTableCell {TD} at (132,0) size 5x20 [r=0 c=18 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 5x19
+                    text run at (0,0) width 5 RTL: "\x{5D6}"
+          LayoutBlockFlow {P} at (4,24) size 137x20
+            LayoutText {#text} at (0,0) size 137x19
+              text run at (0,0) width 20 RTL: "\x{5D0}\x{5D1}\x{5D2}"
+              text run at (20,0) width 40: " ABC "
+              text run at (60,0) width 19 RTL: "\x{5D3}\x{5D4}\x{5D5}"
+              text run at (79,0) width 37: " DEF "
+              text run at (116,0) width 21 RTL: "\x{5D6}\x{5D7}\x{5D8}"
+          LayoutBlockFlow {P} at (4,44) size 137x20
+            LayoutText {#text} at (0,0) size 24x19
+              text run at (0,0) width 20 RTL: "\x{5D0}\x{5D1}\x{5D2}"
+              text run at (20,0) width 4: " "
+            LayoutInline {SPAN} at (0,0) size 55x19
+              LayoutText {#text} at (24,0) size 55x19
+                text run at (24,0) width 36: "ABC "
+                text run at (60,0) width 19 RTL: "\x{5D3}\x{5D4}\x{5D5}"
+            LayoutText {#text} at (79,0) size 58x19
+              text run at (79,0) width 37: " DEF "
+              text run at (116,0) width 21 RTL: "\x{5D6}\x{5D7}\x{5D8}"
+          LayoutBlockFlow {P} at (4,64) size 137x20
+            LayoutText {#text} at (0,0) size 24x19
+              text run at (0,0) width 20 RTL: "\x{5D0}\x{5D1}\x{5D2}"
+              text run at (20,0) width 4: " "
+            LayoutInline {SPAN} at (0,0) size 88x19
+              LayoutText {#text} at (24,0) size 88x19
+                text run at (24,0) width 36: "ABC "
+                text run at (60,0) width 19 RTL: "\x{5D3}\x{5D4}\x{5D5}"
+                text run at (79,0) width 33: " DEF"
+            LayoutText {#text} at (112,0) size 25x19
+              text run at (112,0) width 4: " "
+              text run at (116,0) width 21 RTL: "\x{5D6}\x{5D7}\x{5D8}"
+          LayoutBlockFlow {P} at (4,84) size 137x20
+            LayoutText {#text} at (112,0) size 25x19
+              text run at (112,0) width 25 RTL: "\x{5D6}\x{5D7}\x{5D8} "
+            LayoutInline {SPAN} at (0,0) size 88x19
+              LayoutText {#text} at (24,0) size 88x19
+                text run at (24,0) width 32: "ABC"
+                text run at (56,0) width 27 RTL: " \x{5D3}\x{5D4}\x{5D5} "
+                text run at (83,0) width 29: "DEF"
+            LayoutText {#text} at (0,0) size 24x19
+              text run at (0,0) width 24 RTL: " \x{5D0}\x{5D1}\x{5D2}"
+          LayoutBlockFlow {P} at (4,104) size 137x20
+            LayoutText {#text} at (56,0) size 23x19
+              text run at (56,0) width 23 RTL: "\x{5D3}\x{5D4}\x{5D5} "
+            LayoutInline {SPAN} at (0,0) size 56x19
+              LayoutText {#text} at (0,0) size 56x19
+                text run at (0,0) width 24 RTL: " \x{5D0}\x{5D1}\x{5D2}"
+                text run at (24,0) width 32: "ABC"
+            LayoutText {#text} at (79,0) size 58x19
+              text run at (79,0) width 37: " DEF "
+              text run at (116,0) width 21 RTL: "\x{5D6}\x{5D7}\x{5D8}"
+          LayoutBlockFlow {P} at (4,124) size 137x20
+            LayoutText {#text} at (56,0) size 23x19
+              text run at (56,0) width 23 RTL: "\x{5D3}\x{5D4}\x{5D5} "
+            LayoutInline {SPAN} at (0,0) size 56x19
+              LayoutText {#text} at (0,0) size 56x19
+                text run at (0,0) width 56 RTL override: "CBA \x{5D0}\x{5D1}\x{5D2}"
+            LayoutText {#text} at (79,0) size 58x19
+              text run at (79,0) width 37: " DEF "
+              text run at (116,0) width 21 RTL: "\x{5D6}\x{5D7}\x{5D8}"
+          LayoutBlockFlow {P} at (4,144) size 137x20
+            LayoutText {#text} at (0,0) size 24x19
+              text run at (0,0) width 20 RTL: "\x{5D0}\x{5D1}\x{5D2}"
+              text run at (20,0) width 4: " "
+            LayoutInline {SPAN} at (0,0) size 55x19
+              LayoutText {#text} at (24,0) size 55x19
+                text run at (24,0) width 55 LTR override: "ABC \x{5D5}\x{5D4}\x{5D3}"
+            LayoutText {#text} at (79,0) size 58x19
+              text run at (79,0) width 37: " DEF "
+              text run at (116,0) width 21 RTL: "\x{5D6}\x{5D7}\x{5D8}"
+          LayoutBlockFlow {P} at (4,164) size 137x20
+            LayoutText {#text} at (112,0) size 25x19
+              text run at (112,0) width 25 RTL: "\x{5D6}\x{5D7}\x{5D8} "
+            LayoutInline {SPAN} at (0,0) size 55x19
+              LayoutText {#text} at (24,0) size 55x19
+                text run at (24,0) width 55 LTR override: "ABC \x{5D5}\x{5D4}\x{5D3}"
+            LayoutText {#text} at (0,0) size 112x19
+              text run at (0,0) width 24 RTL: " \x{5D0}\x{5D1}\x{5D2}"
+              text run at (79,0) width 33: " DEF"
+        LayoutText {#text} at (392,85) size 4x19
+          text run at (392,85) width 4: " "
+        LayoutBlockFlow {DIV} at (399,73) size 176x48 [border: (1px solid #008000)]
+          LayoutTable {TABLE} at (4,4) size 168x20
+            LayoutTableSection {TBODY} at (0,0) size 168x20
+              LayoutTableRow {TR} at (0,0) size 168x20
+                LayoutTableCell {TD} at (0,0) size 5x20 [r=0 c=0 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 5x19
+                    text run at (0,0) width 5 RTL: "\x{5D2}"
+                LayoutTableCell {TD} at (5,0) size 7x20 [r=0 c=1 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 7x19
+                    text run at (0,0) width 7 RTL: "\x{5D1}"
+                LayoutTableCell {TD} at (12,0) size 8x20 [r=0 c=2 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 8x19
+                    text run at (0,0) width 8 RTL: "\x{5D0}"
+                LayoutTableCell {TD} at (20,0) size 4x20 [r=0 c=3 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 4x19
+                    text run at (0,0) width 4: " "
+                LayoutTableCell {TD} at (24,0) size 11x20 [r=0 c=4 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 11x19
+                    text run at (0,0) width 11: "A"
+                LayoutTableCell {TD} at (35,0) size 10x20 [r=0 c=5 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 10x19
+                    text run at (0,0) width 10: "B"
+                LayoutTableCell {TD} at (45,0) size 11x20 [r=0 c=6 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 11x19
+                    text run at (0,0) width 11: "C"
+                LayoutTableCell {TD} at (56,0) size 4x20 [r=0 c=7 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 4x19
+                    text run at (0,0) width 4: " "
+                LayoutTableCell {TD} at (60,0) size 4x20 [r=0 c=8 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 4x19
+                    text run at (0,0) width 4 RTL: "\x{5D5}"
+                LayoutTableCell {TD} at (64,0) size 8x20 [r=0 c=9 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 8x19
+                    text run at (0,0) width 8 RTL: "\x{5D4}"
+                LayoutTableCell {TD} at (72,0) size 7x20 [r=0 c=10 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 7x19
+                    text run at (0,0) width 7 RTL: "\x{5D3}"
+                LayoutTableCell {TD} at (79,0) size 4x20 [r=0 c=11 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 4x19
+                    text run at (0,0) width 4: " "
+                LayoutTableCell {TD} at (83,0) size 11x20 [r=0 c=12 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 11x19
+                    text run at (0,0) width 11: "D"
+                LayoutTableCell {TD} at (94,0) size 9x20 [r=0 c=13 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 9x19
+                    text run at (0,0) width 9: "E"
+                LayoutTableCell {TD} at (103,0) size 9x20 [r=0 c=14 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 9x19
+                    text run at (0,0) width 9: "F"
+                LayoutTableCell {TD} at (112,0) size 4x20 [r=0 c=15 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 4x19
+                    text run at (0,0) width 4: " "
+                LayoutTableCell {TD} at (116,0) size 11x20 [r=0 c=16 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 11x19
+                    text run at (0,0) width 11: "G"
+                LayoutTableCell {TD} at (127,0) size 11x20 [r=0 c=17 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 11x19
+                    text run at (0,0) width 11: "H"
+                LayoutTableCell {TD} at (138,0) size 5x20 [r=0 c=18 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 5x19
+                    text run at (0,0) width 5: "I"
+                LayoutTableCell {TD} at (143,0) size 4x20 [r=0 c=19 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 4x19
+                    text run at (0,0) width 4: " "
+                LayoutTableCell {TD} at (147,0) size 8x20 [r=0 c=20 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 8x19
+                    text run at (0,0) width 8 RTL: "\x{5D8}"
+                LayoutTableCell {TD} at (155,0) size 8x20 [r=0 c=21 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 8x19
+                    text run at (0,0) width 8 RTL: "\x{5D7}"
+                LayoutTableCell {TD} at (163,0) size 5x20 [r=0 c=22 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 5x19
+                    text run at (0,0) width 5 RTL: "\x{5D6}"
+          LayoutBlockFlow {P} at (4,24) size 168x20
+            LayoutText {#text} at (0,0) size 168x19
+              text run at (0,0) width 20 RTL: "\x{5D0}\x{5D1}\x{5D2}"
+              text run at (20,0) width 40: " ABC "
+              text run at (60,0) width 19 RTL: "\x{5D3}\x{5D4}\x{5D5}"
+              text run at (79,0) width 68: " DEF GHI "
+              text run at (147,0) width 21 RTL: "\x{5D6}\x{5D7}\x{5D8}"
+        LayoutText {#text} at (578,85) size 4x19
+          text run at (578,85) width 4: " "
+        LayoutBR {BR} at (0,0) size 0x0
+        LayoutBlockFlow {DIV} at (3,197) size 176x48 [border: (1px solid #008000)]
+          LayoutTable {TABLE} at (4,4) size 168x20
+            LayoutTableSection {TBODY} at (0,0) size 168x20
+              LayoutTableRow {TR} at (0,0) size 168x20
+                LayoutTableCell {TD} at (0,0) size 9x20 [r=0 c=0 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 9x19
+                    text run at (0,0) width 9: "F"
+                LayoutTableCell {TD} at (9,0) size 9x20 [r=0 c=1 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 9x19
+                    text run at (0,0) width 9: "E"
+                LayoutTableCell {TD} at (18,0) size 11x20 [r=0 c=2 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 11x19
+                    text run at (0,0) width 11: "D"
+                LayoutTableCell {TD} at (29,0) size 4x20 [r=0 c=3 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 4x19
+                    text run at (0,0) width 4: " "
+                LayoutTableCell {TD} at (33,0) size 4x20 [r=0 c=4 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 4x19
+                    text run at (0,0) width 4 RTL: "\x{5D5}"
+                LayoutTableCell {TD} at (37,0) size 8x20 [r=0 c=5 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 8x19
+                    text run at (0,0) width 8 RTL: "\x{5D4}"
+                LayoutTableCell {TD} at (45,0) size 7x20 [r=0 c=6 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 7x19
+                    text run at (0,0) width 7 RTL: "\x{5D3}"
+                LayoutTableCell {TD} at (52,0) size 4x20 [r=0 c=7 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 4x19
+                    text run at (0,0) width 4: " "
+                LayoutTableCell {TD} at (56,0) size 11x20 [r=0 c=8 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 11x19
+                    text run at (0,0) width 11: "C"
+                LayoutTableCell {TD} at (67,0) size 10x20 [r=0 c=9 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 10x19
+                    text run at (0,0) width 10: "B"
+                LayoutTableCell {TD} at (77,0) size 11x20 [r=0 c=10 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 11x19
+                    text run at (0,0) width 11: "A"
+                LayoutTableCell {TD} at (88,0) size 4x20 [r=0 c=11 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 4x19
+                    text run at (0,0) width 4: " "
+                LayoutTableCell {TD} at (92,0) size 5x20 [r=0 c=12 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 5x19
+                    text run at (0,0) width 5 RTL: "\x{5D2}"
+                LayoutTableCell {TD} at (97,0) size 7x20 [r=0 c=13 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 7x19
+                    text run at (0,0) width 7 RTL: "\x{5D1}"
+                LayoutTableCell {TD} at (104,0) size 8x20 [r=0 c=14 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 8x19
+                    text run at (0,0) width 8 RTL: "\x{5D0}"
+                LayoutTableCell {TD} at (112,0) size 4x20 [r=0 c=15 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 4x19
+                    text run at (0,0) width 4: " "
+                LayoutTableCell {TD} at (116,0) size 11x20 [r=0 c=16 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 11x19
+                    text run at (0,0) width 11: "G"
+                LayoutTableCell {TD} at (127,0) size 11x20 [r=0 c=17 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 11x19
+                    text run at (0,0) width 11: "H"
+                LayoutTableCell {TD} at (138,0) size 5x20 [r=0 c=18 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 5x19
+                    text run at (0,0) width 5: "I"
+                LayoutTableCell {TD} at (143,0) size 4x20 [r=0 c=19 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 4x19
+                    text run at (0,0) width 4: " "
+                LayoutTableCell {TD} at (147,0) size 8x20 [r=0 c=20 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 8x19
+                    text run at (0,0) width 8 RTL: "\x{5D8}"
+                LayoutTableCell {TD} at (155,0) size 8x20 [r=0 c=21 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 8x19
+                    text run at (0,0) width 8 RTL: "\x{5D7}"
+                LayoutTableCell {TD} at (163,0) size 5x20 [r=0 c=22 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 5x19
+                    text run at (0,0) width 5 RTL: "\x{5D6}"
+          LayoutBlockFlow {P} at (4,24) size 168x20
+            LayoutText {#text} at (88,0) size 24x19
+              text run at (88,0) width 24 RTL: "\x{5D0}\x{5D1}\x{5D2} "
+            LayoutInline {SPAN} at (0,0) size 88x19
+              LayoutText {#text} at (0,0) size 88x19
+                text run at (0,0) width 88 RTL override: "ABC \x{5D3}\x{5D4}\x{5D5} DEF"
+            LayoutText {#text} at (112,0) size 56x19
+              text run at (112,0) width 35: " GHI "
+              text run at (147,0) width 21 RTL: "\x{5D6}\x{5D7}\x{5D8}"
+        LayoutText {#text} at (182,209) size 4x19
+          text run at (182,209) width 4: " "
+        LayoutBlockFlow {DIV} at (189,197) size 176x48 [border: (1px solid #008000)]
+          LayoutTable {TABLE} at (4,4) size 168x20
+            LayoutTableSection {TBODY} at (0,0) size 168x20
+              LayoutTableRow {TR} at (0,0) size 168x20
+                LayoutTableCell {TD} at (0,0) size 5x20 [r=0 c=0 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 5x19
+                    text run at (0,0) width 5 RTL: "\x{5D2}"
+                LayoutTableCell {TD} at (5,0) size 7x20 [r=0 c=1 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 7x19
+                    text run at (0,0) width 7 RTL: "\x{5D1}"
+                LayoutTableCell {TD} at (12,0) size 8x20 [r=0 c=2 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 8x19
+                    text run at (0,0) width 8 RTL: "\x{5D0}"
+                LayoutTableCell {TD} at (20,0) size 4x20 [r=0 c=3 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 4x19
+                    text run at (0,0) width 4: " "
+                LayoutTableCell {TD} at (24,0) size 11x20 [r=0 c=4 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 11x19
+                    text run at (0,0) width 11: "A"
+                LayoutTableCell {TD} at (35,0) size 10x20 [r=0 c=5 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 10x19
+                    text run at (0,0) width 10: "B"
+                LayoutTableCell {TD} at (45,0) size 11x20 [r=0 c=6 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 11x19
+                    text run at (0,0) width 11: "C"
+                LayoutTableCell {TD} at (56,0) size 4x20 [r=0 c=7 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 4x19
+                    text run at (0,0) width 4: " "
+                LayoutTableCell {TD} at (60,0) size 9x20 [r=0 c=8 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 9x19
+                    text run at (0,0) width 9: "F"
+                LayoutTableCell {TD} at (69,0) size 9x20 [r=0 c=9 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 9x19
+                    text run at (0,0) width 9: "E"
+                LayoutTableCell {TD} at (78,0) size 11x20 [r=0 c=10 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 11x19
+                    text run at (0,0) width 11: "D"
+                LayoutTableCell {TD} at (89,0) size 4x20 [r=0 c=11 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 4x19
+                    text run at (0,0) width 4: " "
+                LayoutTableCell {TD} at (93,0) size 4x20 [r=0 c=12 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 4x19
+                    text run at (0,0) width 4 RTL: "\x{5D5}"
+                LayoutTableCell {TD} at (97,0) size 8x20 [r=0 c=13 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 8x19
+                    text run at (0,0) width 8 RTL: "\x{5D4}"
+                LayoutTableCell {TD} at (105,0) size 7x20 [r=0 c=14 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 7x19
+                    text run at (0,0) width 7 RTL: "\x{5D3}"
+                LayoutTableCell {TD} at (112,0) size 4x20 [r=0 c=15 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 4x19
+                    text run at (0,0) width 4: " "
+                LayoutTableCell {TD} at (116,0) size 11x20 [r=0 c=16 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 11x19
+                    text run at (0,0) width 11: "G"
+                LayoutTableCell {TD} at (127,0) size 11x20 [r=0 c=17 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 11x19
+                    text run at (0,0) width 11: "H"
+                LayoutTableCell {TD} at (138,0) size 5x20 [r=0 c=18 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 5x19
+                    text run at (0,0) width 5: "I"
+                LayoutTableCell {TD} at (143,0) size 4x20 [r=0 c=19 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 4x19
+                    text run at (0,0) width 4: " "
+                LayoutTableCell {TD} at (147,0) size 8x20 [r=0 c=20 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 8x19
+                    text run at (0,0) width 8 RTL: "\x{5D8}"
+                LayoutTableCell {TD} at (155,0) size 8x20 [r=0 c=21 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 8x19
+                    text run at (0,0) width 8 RTL: "\x{5D7}"
+                LayoutTableCell {TD} at (163,0) size 5x20 [r=0 c=22 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 5x19
+                    text run at (0,0) width 5 RTL: "\x{5D6}"
+          LayoutBlockFlow {P} at (4,24) size 168x20
+            LayoutText {#text} at (0,0) size 60x19
+              text run at (0,0) width 20 RTL: "\x{5D0}\x{5D1}\x{5D2}"
+              text run at (20,0) width 40: " ABC "
+            LayoutInline {SPAN} at (0,0) size 52x19
+              LayoutText {#text} at (60,0) size 52x19
+                text run at (60,0) width 52 RTL override: "\x{5D3}\x{5D4}\x{5D5} DEF"
+            LayoutText {#text} at (112,0) size 56x19
+              text run at (112,0) width 35: " GHI "
+              text run at (147,0) width 21 RTL: "\x{5D6}\x{5D7}\x{5D8}"
+        LayoutText {#text} at (0,0) size 0x0
+      LayoutBlockFlow {HR} at (0,422.44) size 784x2 [border: (1px inset #EEEEEE)]
+      LayoutBlockFlow {P} at (0,440.44) size 784x20
+        LayoutText {#text} at (0,0) size 57x19
+          text run at (0,0) width 57: "(Back to "
+        LayoutInline {A} at (0,0) size 149x19 [color=#0000EE]
+          LayoutText {#text} at (57,0) size 149x19
+            text run at (57,0) width 149: "CSS Testing Information"
+        LayoutText {#text} at (206,0) size 8x19
+          text run at (206,0) width 8: ", "
+        LayoutInline {A} at (0,0) size 77x19 [color=#0000EE]
+          LayoutText {#text} at (214,0) size 77x19
+            text run at (214,0) width 77: "David Baron"
+        LayoutText {#text} at (291,0) size 5x19
+          text run at (291,0) width 5: ")"
+      LayoutBlockFlow {P} at (0,476.44) size 784x20
+        LayoutInline {A} at (0,0) size 30x19 [color=#0000EE]
+          LayoutText {#text} at (0,0) size 30x19
+            text run at (0,0) width 30: "LDB"
+        LayoutText {#text} at (30,0) size 8x19
+          text run at (30,0) width 8: ", "
+        LayoutInline {A} at (0,0) size 125x19 [color=#0000EE]
+          LayoutText {#text} at (38,0) size 125x19
+            text run at (38,0) width 125: "dbaron@dbaron.org"
+        LayoutText {#text} at (163,0) size 84x19
+          text run at (163,0) width 84: ", 2001-06-05"
+      LayoutBlockFlow {P} at (0,512.44) size 784x20
+        LayoutText {#text} at (0,0) size 289x19
+          text run at (0,0) width 289: "Modified and used with the author\x{2019}s permission."
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text/international/bidi-LDB-2-HTML-expected.txt b/third_party/WebKit/LayoutTests/platform/android/fast/text/international/bidi-LDB-2-HTML-expected.txt
new file mode 100644
index 0000000..7ef008a
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text/international/bidi-LDB-2-HTML-expected.txt
@@ -0,0 +1,584 @@
+layer at (0,0) size 800x600
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x534
+  LayoutBlockFlow {HTML} at (0,0) size 800x533.88
+    LayoutBlockFlow {BODY} at (8,21.44) size 784x496.44
+      LayoutBlockFlow {H1} at (0,0) size 784x37
+        LayoutText {#text} at (0,0) size 464x36
+          text run at (0,0) width 464: "Bidirectional Text Test 2 - HTML"
+      LayoutBlockFlow {P} at (0,58.44) size 784x20
+        LayoutText {#text} at (0,0) size 126x19
+          text run at (0,0) width 126: "This test is based on "
+        LayoutInline {A} at (0,0) size 115x19 [color=#0000EE]
+          LayoutText {#text} at (126,0) size 115x19
+            text run at (126,0) width 115: "CSS2 section 9.10"
+        LayoutText {#text} at (241,0) size 30x19
+          text run at (241,0) width 30: " and "
+        LayoutInline {A} at (0,0) size 61x19 [color=#0000EE]
+          LayoutText {#text} at (271,0) size 61x19
+            text run at (271,0) width 61: "Chapter 3"
+        LayoutText {#text} at (332,0) size 42x19
+          text run at (332,0) width 42: " of the "
+        LayoutInline {A} at (0,0) size 110x19 [color=#0000EE]
+          LayoutText {#text} at (374,0) size 110x19
+            text run at (374,0) width 110: "Unicode Standard"
+        LayoutText {#text} at (484,0) size 4x19
+          text run at (484,0) width 4: "."
+      LayoutBlockFlow {PRE} at (0,94.44) size 784x0
+      LayoutBlockFlow {P} at (0,94.44) size 784x20
+        LayoutText {#text} at (0,0) size 267x19
+          text run at (0,0) width 267: "In each box, all the lines should be the same."
+      LayoutBlockFlow (anonymous) at (0,130.44) size 784x248
+        LayoutBlockFlow {DIV} at (3,3) size 96x188 [border: (1px solid #008000)]
+          LayoutBlockFlow {P} at (4,4) size 88x20
+            LayoutText {#text} at (0,0) size 88x19
+              text run at (0,0) width 88: "ABCDEFGHI"
+          LayoutBlockFlow {P} at (4,24) size 88x20
+            LayoutText {#text} at (0,0) size 88x19
+              text run at (0,0) width 88: "ABCDEFGHI"
+          LayoutBlockFlow {P} at (4,44) size 88x20
+            LayoutText {#text} at (0,0) size 32x19
+              text run at (0,0) width 32: "ABC"
+            LayoutInline {SPAN} at (0,0) size 29x19
+              LayoutText {#text} at (32,0) size 29x19
+                text run at (32,0) width 29: "DEF"
+            LayoutText {#text} at (61,0) size 27x19
+              text run at (61,0) width 27: "GHI"
+          LayoutBlockFlow {P} at (4,64) size 88x20
+            LayoutText {#text} at (0,0) size 88x19
+              text run at (0,0) width 88 RTL override: "IHGFEDCBA"
+          LayoutBlockFlow {P} at (4,84) size 88x20
+            LayoutText {#text} at (61,0) size 27x19
+              text run at (61,0) width 27 RTL override: "IHG"
+            LayoutInline {SPAN} at (0,0) size 29x19
+              LayoutText {#text} at (32,0) size 29x19
+                text run at (32,0) width 29 RTL override: "FED"
+            LayoutText {#text} at (0,0) size 32x19
+              text run at (0,0) width 32 RTL override: "CBA"
+          LayoutBlockFlow {P} at (4,104) size 88x20
+            LayoutText {#text} at (61,0) size 27x19
+              text run at (61,0) width 27 RTL override: "IHG"
+            LayoutInline {SPAN} at (0,0) size 29x19
+              LayoutText {#text} at (32,0) size 29x19
+                text run at (32,0) width 29: "DEF"
+            LayoutText {#text} at (0,0) size 32x19
+              text run at (0,0) width 32 RTL override: "CBA"
+          LayoutBlockFlow {P} at (4,124) size 88x20
+            LayoutText {#text} at (61,0) size 27x19
+              text run at (61,0) width 27 RTL override: "IHG"
+            LayoutInline {BDO} at (0,0) size 29x19
+              LayoutText {#text} at (32,0) size 29x19
+                text run at (32,0) width 29 RTL override: "FED"
+            LayoutText {#text} at (0,0) size 32x19
+              text run at (0,0) width 32 RTL override: "CBA"
+          LayoutBlockFlow {P} at (4,144) size 88x20
+            LayoutText {#text} at (61,0) size 27x19
+              text run at (61,0) width 27 RTL override: "IHG"
+            LayoutInline {SPAN} at (0,0) size 29x19
+              LayoutText {#text} at (32,0) size 29x19
+                text run at (32,0) width 29 RTL override: "FED"
+            LayoutText {#text} at (0,0) size 32x19
+              text run at (0,0) width 32 RTL override: "CBA"
+          LayoutBlockFlow {P} at (4,164) size 88x20
+            LayoutText {#text} at (61,0) size 27x19
+              text run at (61,0) width 27 RTL override: "IHG"
+            LayoutInline {BDO} at (0,0) size 29x19
+              LayoutText {#text} at (32,0) size 29x19
+                text run at (32,0) width 29 LTR override: "DEF"
+            LayoutText {#text} at (0,0) size 32x19
+              text run at (0,0) width 32 RTL override: "CBA"
+        LayoutText {#text} at (102,85) size 4x19
+          text run at (102,85) width 4: " "
+        LayoutBlockFlow {DIV} at (109,53) size 28x88 [border: (1px solid #008000)]
+          LayoutTable {TABLE} at (4,4) size 20x20
+            LayoutTableSection {TBODY} at (0,0) size 20x20
+              LayoutTableRow {TR} at (0,0) size 20x20
+                LayoutTableCell {TD} at (0,0) size 5x20 [r=0 c=0 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 5x19
+                    text run at (0,0) width 5 RTL: "\x{5D2}"
+                LayoutTableCell {TD} at (5,0) size 7x20 [r=0 c=1 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 7x19
+                    text run at (0,0) width 7 RTL: "\x{5D1}"
+                LayoutTableCell {TD} at (12,0) size 8x20 [r=0 c=2 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 8x19
+                    text run at (0,0) width 8 RTL: "\x{5D0}"
+          LayoutBlockFlow {P} at (4,24) size 20x20
+            LayoutText {#text} at (0,0) size 20x19
+              text run at (0,0) width 20 RTL: "\x{5D0}\x{5D1}\x{5D2}"
+          LayoutBlockFlow {P} at (4,44) size 20x20
+            LayoutText {#text} at (0,0) size 20x19
+              text run at (0,0) width 20 RTL: "\x{5D0}\x{5D1}\x{5D2}"
+          LayoutBlockFlow {P} at (4,64) size 20x20
+            LayoutText {#text} at (0,0) size 20x19
+              text run at (0,0) width 20 LTR override: "\x{5D2}\x{5D1}\x{5D0}"
+        LayoutText {#text} at (140,85) size 4x19
+          text run at (140,85) width 4: " "
+        LayoutBlockFlow {DIV} at (147,63) size 87x68 [border: (1px solid #008000)]
+          LayoutTable {TABLE} at (4,4) size 79x20
+            LayoutTableSection {TBODY} at (0,0) size 79x20
+              LayoutTableRow {TR} at (0,0) size 79x20
+                LayoutTableCell {TD} at (0,0) size 5x20 [r=0 c=0 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 5x19
+                    text run at (0,0) width 5 RTL: "\x{5D2}"
+                LayoutTableCell {TD} at (5,0) size 7x20 [r=0 c=1 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 7x19
+                    text run at (0,0) width 7 RTL: "\x{5D1}"
+                LayoutTableCell {TD} at (12,0) size 8x20 [r=0 c=2 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 8x19
+                    text run at (0,0) width 8 RTL: "\x{5D0}"
+                LayoutTableCell {TD} at (20,0) size 4x20 [r=0 c=3 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 4x19
+                    text run at (0,0) width 4: " "
+                LayoutTableCell {TD} at (24,0) size 11x20 [r=0 c=4 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 11x19
+                    text run at (0,0) width 11: "A"
+                LayoutTableCell {TD} at (35,0) size 10x20 [r=0 c=5 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 10x19
+                    text run at (0,0) width 10: "B"
+                LayoutTableCell {TD} at (45,0) size 11x20 [r=0 c=6 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 11x19
+                    text run at (0,0) width 11: "C"
+                LayoutTableCell {TD} at (56,0) size 4x20 [r=0 c=7 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 4x19
+                    text run at (0,0) width 4: " "
+                LayoutTableCell {TD} at (60,0) size 4x20 [r=0 c=8 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 4x19
+                    text run at (0,0) width 4 RTL: "\x{5D5}"
+                LayoutTableCell {TD} at (64,0) size 8x20 [r=0 c=9 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 8x19
+                    text run at (0,0) width 8 RTL: "\x{5D4}"
+                LayoutTableCell {TD} at (72,0) size 7x20 [r=0 c=10 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 7x19
+                    text run at (0,0) width 7 RTL: "\x{5D3}"
+          LayoutBlockFlow {P} at (4,24) size 79x20
+            LayoutText {#text} at (0,0) size 79x19
+              text run at (0,0) width 20 RTL: "\x{5D0}\x{5D1}\x{5D2}"
+              text run at (20,0) width 40: " ABC "
+              text run at (60,0) width 19 RTL: "\x{5D3}\x{5D4}\x{5D5}"
+          LayoutBlockFlow {P} at (4,44) size 79x20
+            LayoutText {#text} at (0,0) size 79x19
+              text run at (0,0) width 24 RTL: " \x{5D0}\x{5D1}\x{5D2}"
+              text run at (24,0) width 32: "ABC"
+              text run at (56,0) width 23 RTL: "\x{5D3}\x{5D4}\x{5D5} "
+        LayoutText {#text} at (237,85) size 4x19
+          text run at (237,85) width 4: " "
+        LayoutBlockFlow {DIV} at (244,3) size 145x188 [border: (1px solid #008000)]
+          LayoutTable {TABLE} at (4,4) size 137x20
+            LayoutTableSection {TBODY} at (0,0) size 137x20
+              LayoutTableRow {TR} at (0,0) size 137x20
+                LayoutTableCell {TD} at (0,0) size 5x20 [r=0 c=0 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 5x19
+                    text run at (0,0) width 5 RTL: "\x{5D2}"
+                LayoutTableCell {TD} at (5,0) size 7x20 [r=0 c=1 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 7x19
+                    text run at (0,0) width 7 RTL: "\x{5D1}"
+                LayoutTableCell {TD} at (12,0) size 8x20 [r=0 c=2 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 8x19
+                    text run at (0,0) width 8 RTL: "\x{5D0}"
+                LayoutTableCell {TD} at (20,0) size 4x20 [r=0 c=3 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 4x19
+                    text run at (0,0) width 4: " "
+                LayoutTableCell {TD} at (24,0) size 11x20 [r=0 c=4 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 11x19
+                    text run at (0,0) width 11: "A"
+                LayoutTableCell {TD} at (35,0) size 10x20 [r=0 c=5 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 10x19
+                    text run at (0,0) width 10: "B"
+                LayoutTableCell {TD} at (45,0) size 11x20 [r=0 c=6 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 11x19
+                    text run at (0,0) width 11: "C"
+                LayoutTableCell {TD} at (56,0) size 4x20 [r=0 c=7 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 4x19
+                    text run at (0,0) width 4: " "
+                LayoutTableCell {TD} at (60,0) size 4x20 [r=0 c=8 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 4x19
+                    text run at (0,0) width 4 RTL: "\x{5D5}"
+                LayoutTableCell {TD} at (64,0) size 8x20 [r=0 c=9 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 8x19
+                    text run at (0,0) width 8 RTL: "\x{5D4}"
+                LayoutTableCell {TD} at (72,0) size 7x20 [r=0 c=10 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 7x19
+                    text run at (0,0) width 7 RTL: "\x{5D3}"
+                LayoutTableCell {TD} at (79,0) size 4x20 [r=0 c=11 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 4x19
+                    text run at (0,0) width 4: " "
+                LayoutTableCell {TD} at (83,0) size 11x20 [r=0 c=12 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 11x19
+                    text run at (0,0) width 11: "D"
+                LayoutTableCell {TD} at (94,0) size 9x20 [r=0 c=13 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 9x19
+                    text run at (0,0) width 9: "E"
+                LayoutTableCell {TD} at (103,0) size 9x20 [r=0 c=14 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 9x19
+                    text run at (0,0) width 9: "F"
+                LayoutTableCell {TD} at (112,0) size 4x20 [r=0 c=15 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 4x19
+                    text run at (0,0) width 4: " "
+                LayoutTableCell {TD} at (116,0) size 8x20 [r=0 c=16 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 8x19
+                    text run at (0,0) width 8 RTL: "\x{5D8}"
+                LayoutTableCell {TD} at (124,0) size 8x20 [r=0 c=17 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 8x19
+                    text run at (0,0) width 8 RTL: "\x{5D7}"
+                LayoutTableCell {TD} at (132,0) size 5x20 [r=0 c=18 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 5x19
+                    text run at (0,0) width 5 RTL: "\x{5D6}"
+          LayoutBlockFlow {P} at (4,24) size 137x20
+            LayoutText {#text} at (0,0) size 137x19
+              text run at (0,0) width 20 RTL: "\x{5D0}\x{5D1}\x{5D2}"
+              text run at (20,0) width 40: " ABC "
+              text run at (60,0) width 19 RTL: "\x{5D3}\x{5D4}\x{5D5}"
+              text run at (79,0) width 37: " DEF "
+              text run at (116,0) width 21 RTL: "\x{5D6}\x{5D7}\x{5D8}"
+          LayoutBlockFlow {P} at (4,44) size 137x20
+            LayoutText {#text} at (0,0) size 24x19
+              text run at (0,0) width 20 RTL: "\x{5D0}\x{5D1}\x{5D2}"
+              text run at (20,0) width 4: " "
+            LayoutInline {SPAN} at (0,0) size 55x19
+              LayoutText {#text} at (24,0) size 55x19
+                text run at (24,0) width 36: "ABC "
+                text run at (60,0) width 19 RTL: "\x{5D3}\x{5D4}\x{5D5}"
+            LayoutText {#text} at (79,0) size 58x19
+              text run at (79,0) width 37: " DEF "
+              text run at (116,0) width 21 RTL: "\x{5D6}\x{5D7}\x{5D8}"
+          LayoutBlockFlow {P} at (4,64) size 137x20
+            LayoutText {#text} at (0,0) size 24x19
+              text run at (0,0) width 20 RTL: "\x{5D0}\x{5D1}\x{5D2}"
+              text run at (20,0) width 4: " "
+            LayoutInline {SPAN} at (0,0) size 88x19
+              LayoutText {#text} at (24,0) size 88x19
+                text run at (24,0) width 36: "ABC "
+                text run at (60,0) width 19 RTL: "\x{5D3}\x{5D4}\x{5D5}"
+                text run at (79,0) width 33: " DEF"
+            LayoutText {#text} at (112,0) size 25x19
+              text run at (112,0) width 4: " "
+              text run at (116,0) width 21 RTL: "\x{5D6}\x{5D7}\x{5D8}"
+          LayoutBlockFlow {P} at (4,84) size 137x20
+            LayoutText {#text} at (112,0) size 25x19
+              text run at (112,0) width 25 RTL: "\x{5D6}\x{5D7}\x{5D8} "
+            LayoutInline {SPAN} at (0,0) size 88x19
+              LayoutText {#text} at (24,0) size 88x19
+                text run at (24,0) width 32: "ABC"
+                text run at (56,0) width 27 RTL: " \x{5D3}\x{5D4}\x{5D5} "
+                text run at (83,0) width 29: "DEF"
+            LayoutText {#text} at (0,0) size 24x19
+              text run at (0,0) width 24 RTL: " \x{5D0}\x{5D1}\x{5D2}"
+          LayoutBlockFlow {P} at (4,104) size 137x20
+            LayoutText {#text} at (56,0) size 23x19
+              text run at (56,0) width 23 RTL: "\x{5D3}\x{5D4}\x{5D5} "
+            LayoutInline {SPAN} at (0,0) size 56x19
+              LayoutText {#text} at (0,0) size 56x19
+                text run at (0,0) width 24 RTL: " \x{5D0}\x{5D1}\x{5D2}"
+                text run at (24,0) width 32: "ABC"
+            LayoutText {#text} at (79,0) size 58x19
+              text run at (79,0) width 37: " DEF "
+              text run at (116,0) width 21 RTL: "\x{5D6}\x{5D7}\x{5D8}"
+          LayoutBlockFlow {P} at (4,124) size 137x20
+            LayoutText {#text} at (56,0) size 23x19
+              text run at (56,0) width 23 RTL: "\x{5D3}\x{5D4}\x{5D5} "
+            LayoutInline {BDO} at (0,0) size 56x19
+              LayoutText {#text} at (0,0) size 56x19
+                text run at (0,0) width 56 RTL override: "CBA \x{5D0}\x{5D1}\x{5D2}"
+            LayoutText {#text} at (79,0) size 58x19
+              text run at (79,0) width 37: " DEF "
+              text run at (116,0) width 21 RTL: "\x{5D6}\x{5D7}\x{5D8}"
+          LayoutBlockFlow {P} at (4,144) size 137x20
+            LayoutText {#text} at (0,0) size 24x19
+              text run at (0,0) width 20 RTL: "\x{5D0}\x{5D1}\x{5D2}"
+              text run at (20,0) width 4: " "
+            LayoutInline {BDO} at (0,0) size 55x19
+              LayoutText {#text} at (24,0) size 55x19
+                text run at (24,0) width 55 LTR override: "ABC \x{5D5}\x{5D4}\x{5D3}"
+            LayoutText {#text} at (79,0) size 58x19
+              text run at (79,0) width 37: " DEF "
+              text run at (116,0) width 21 RTL: "\x{5D6}\x{5D7}\x{5D8}"
+          LayoutBlockFlow {P} at (4,164) size 137x20
+            LayoutText {#text} at (112,0) size 25x19
+              text run at (112,0) width 25 RTL: "\x{5D6}\x{5D7}\x{5D8} "
+            LayoutInline {BDO} at (0,0) size 55x19
+              LayoutText {#text} at (24,0) size 55x19
+                text run at (24,0) width 55 LTR override: "ABC \x{5D5}\x{5D4}\x{5D3}"
+            LayoutText {#text} at (0,0) size 112x19
+              text run at (0,0) width 24 RTL: " \x{5D0}\x{5D1}\x{5D2}"
+              text run at (79,0) width 33: " DEF"
+        LayoutText {#text} at (392,85) size 4x19
+          text run at (392,85) width 4: " "
+        LayoutBlockFlow {DIV} at (399,73) size 176x48 [border: (1px solid #008000)]
+          LayoutTable {TABLE} at (4,4) size 168x20
+            LayoutTableSection {TBODY} at (0,0) size 168x20
+              LayoutTableRow {TR} at (0,0) size 168x20
+                LayoutTableCell {TD} at (0,0) size 5x20 [r=0 c=0 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 5x19
+                    text run at (0,0) width 5 RTL: "\x{5D2}"
+                LayoutTableCell {TD} at (5,0) size 7x20 [r=0 c=1 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 7x19
+                    text run at (0,0) width 7 RTL: "\x{5D1}"
+                LayoutTableCell {TD} at (12,0) size 8x20 [r=0 c=2 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 8x19
+                    text run at (0,0) width 8 RTL: "\x{5D0}"
+                LayoutTableCell {TD} at (20,0) size 4x20 [r=0 c=3 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 4x19
+                    text run at (0,0) width 4: " "
+                LayoutTableCell {TD} at (24,0) size 11x20 [r=0 c=4 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 11x19
+                    text run at (0,0) width 11: "A"
+                LayoutTableCell {TD} at (35,0) size 10x20 [r=0 c=5 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 10x19
+                    text run at (0,0) width 10: "B"
+                LayoutTableCell {TD} at (45,0) size 11x20 [r=0 c=6 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 11x19
+                    text run at (0,0) width 11: "C"
+                LayoutTableCell {TD} at (56,0) size 4x20 [r=0 c=7 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 4x19
+                    text run at (0,0) width 4: " "
+                LayoutTableCell {TD} at (60,0) size 4x20 [r=0 c=8 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 4x19
+                    text run at (0,0) width 4 RTL: "\x{5D5}"
+                LayoutTableCell {TD} at (64,0) size 8x20 [r=0 c=9 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 8x19
+                    text run at (0,0) width 8 RTL: "\x{5D4}"
+                LayoutTableCell {TD} at (72,0) size 7x20 [r=0 c=10 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 7x19
+                    text run at (0,0) width 7 RTL: "\x{5D3}"
+                LayoutTableCell {TD} at (79,0) size 4x20 [r=0 c=11 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 4x19
+                    text run at (0,0) width 4: " "
+                LayoutTableCell {TD} at (83,0) size 11x20 [r=0 c=12 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 11x19
+                    text run at (0,0) width 11: "D"
+                LayoutTableCell {TD} at (94,0) size 9x20 [r=0 c=13 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 9x19
+                    text run at (0,0) width 9: "E"
+                LayoutTableCell {TD} at (103,0) size 9x20 [r=0 c=14 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 9x19
+                    text run at (0,0) width 9: "F"
+                LayoutTableCell {TD} at (112,0) size 4x20 [r=0 c=15 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 4x19
+                    text run at (0,0) width 4: " "
+                LayoutTableCell {TD} at (116,0) size 11x20 [r=0 c=16 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 11x19
+                    text run at (0,0) width 11: "G"
+                LayoutTableCell {TD} at (127,0) size 11x20 [r=0 c=17 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 11x19
+                    text run at (0,0) width 11: "H"
+                LayoutTableCell {TD} at (138,0) size 5x20 [r=0 c=18 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 5x19
+                    text run at (0,0) width 5: "I"
+                LayoutTableCell {TD} at (143,0) size 4x20 [r=0 c=19 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 4x19
+                    text run at (0,0) width 4: " "
+                LayoutTableCell {TD} at (147,0) size 8x20 [r=0 c=20 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 8x19
+                    text run at (0,0) width 8 RTL: "\x{5D8}"
+                LayoutTableCell {TD} at (155,0) size 8x20 [r=0 c=21 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 8x19
+                    text run at (0,0) width 8 RTL: "\x{5D7}"
+                LayoutTableCell {TD} at (163,0) size 5x20 [r=0 c=22 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 5x19
+                    text run at (0,0) width 5 RTL: "\x{5D6}"
+          LayoutBlockFlow {P} at (4,24) size 168x20
+            LayoutText {#text} at (0,0) size 168x19
+              text run at (0,0) width 20 RTL: "\x{5D0}\x{5D1}\x{5D2}"
+              text run at (20,0) width 40: " ABC "
+              text run at (60,0) width 19 RTL: "\x{5D3}\x{5D4}\x{5D5}"
+              text run at (79,0) width 68: " DEF GHI "
+              text run at (147,0) width 21 RTL: "\x{5D6}\x{5D7}\x{5D8}"
+        LayoutText {#text} at (578,85) size 4x19
+          text run at (578,85) width 4: " "
+        LayoutBR {BR} at (582,85) size 0x19
+        LayoutBlockFlow {DIV} at (3,197) size 176x48 [border: (1px solid #008000)]
+          LayoutTable {TABLE} at (4,4) size 168x20
+            LayoutTableSection {TBODY} at (0,0) size 168x20
+              LayoutTableRow {TR} at (0,0) size 168x20
+                LayoutTableCell {TD} at (0,0) size 9x20 [r=0 c=0 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 9x19
+                    text run at (0,0) width 9: "F"
+                LayoutTableCell {TD} at (9,0) size 9x20 [r=0 c=1 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 9x19
+                    text run at (0,0) width 9: "E"
+                LayoutTableCell {TD} at (18,0) size 11x20 [r=0 c=2 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 11x19
+                    text run at (0,0) width 11: "D"
+                LayoutTableCell {TD} at (29,0) size 4x20 [r=0 c=3 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 4x19
+                    text run at (0,0) width 4: " "
+                LayoutTableCell {TD} at (33,0) size 4x20 [r=0 c=4 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 4x19
+                    text run at (0,0) width 4 RTL: "\x{5D5}"
+                LayoutTableCell {TD} at (37,0) size 8x20 [r=0 c=5 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 8x19
+                    text run at (0,0) width 8 RTL: "\x{5D4}"
+                LayoutTableCell {TD} at (45,0) size 7x20 [r=0 c=6 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 7x19
+                    text run at (0,0) width 7 RTL: "\x{5D3}"
+                LayoutTableCell {TD} at (52,0) size 4x20 [r=0 c=7 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 4x19
+                    text run at (0,0) width 4: " "
+                LayoutTableCell {TD} at (56,0) size 11x20 [r=0 c=8 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 11x19
+                    text run at (0,0) width 11: "C"
+                LayoutTableCell {TD} at (67,0) size 10x20 [r=0 c=9 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 10x19
+                    text run at (0,0) width 10: "B"
+                LayoutTableCell {TD} at (77,0) size 11x20 [r=0 c=10 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 11x19
+                    text run at (0,0) width 11: "A"
+                LayoutTableCell {TD} at (88,0) size 4x20 [r=0 c=11 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 4x19
+                    text run at (0,0) width 4: " "
+                LayoutTableCell {TD} at (92,0) size 5x20 [r=0 c=12 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 5x19
+                    text run at (0,0) width 5 RTL: "\x{5D2}"
+                LayoutTableCell {TD} at (97,0) size 7x20 [r=0 c=13 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 7x19
+                    text run at (0,0) width 7 RTL: "\x{5D1}"
+                LayoutTableCell {TD} at (104,0) size 8x20 [r=0 c=14 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 8x19
+                    text run at (0,0) width 8 RTL: "\x{5D0}"
+                LayoutTableCell {TD} at (112,0) size 4x20 [r=0 c=15 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 4x19
+                    text run at (0,0) width 4: " "
+                LayoutTableCell {TD} at (116,0) size 11x20 [r=0 c=16 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 11x19
+                    text run at (0,0) width 11: "G"
+                LayoutTableCell {TD} at (127,0) size 11x20 [r=0 c=17 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 11x19
+                    text run at (0,0) width 11: "H"
+                LayoutTableCell {TD} at (138,0) size 5x20 [r=0 c=18 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 5x19
+                    text run at (0,0) width 5: "I"
+                LayoutTableCell {TD} at (143,0) size 4x20 [r=0 c=19 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 4x19
+                    text run at (0,0) width 4: " "
+                LayoutTableCell {TD} at (147,0) size 8x20 [r=0 c=20 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 8x19
+                    text run at (0,0) width 8 RTL: "\x{5D8}"
+                LayoutTableCell {TD} at (155,0) size 8x20 [r=0 c=21 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 8x19
+                    text run at (0,0) width 8 RTL: "\x{5D7}"
+                LayoutTableCell {TD} at (163,0) size 5x20 [r=0 c=22 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 5x19
+                    text run at (0,0) width 5 RTL: "\x{5D6}"
+          LayoutBlockFlow {P} at (4,24) size 168x20
+            LayoutText {#text} at (88,0) size 24x19
+              text run at (88,0) width 24 RTL: "\x{5D0}\x{5D1}\x{5D2} "
+            LayoutInline {BDO} at (0,0) size 88x19
+              LayoutText {#text} at (0,0) size 88x19
+                text run at (0,0) width 88 RTL override: "ABC \x{5D3}\x{5D4}\x{5D5} DEF"
+            LayoutText {#text} at (112,0) size 56x19
+              text run at (112,0) width 35: " GHI "
+              text run at (147,0) width 21 RTL: "\x{5D6}\x{5D7}\x{5D8}"
+        LayoutText {#text} at (182,209) size 4x19
+          text run at (182,209) width 4: " "
+        LayoutBlockFlow {DIV} at (189,197) size 176x48 [border: (1px solid #008000)]
+          LayoutTable {TABLE} at (4,4) size 168x20
+            LayoutTableSection {TBODY} at (0,0) size 168x20
+              LayoutTableRow {TR} at (0,0) size 168x20
+                LayoutTableCell {TD} at (0,0) size 5x20 [r=0 c=0 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 5x19
+                    text run at (0,0) width 5 RTL: "\x{5D2}"
+                LayoutTableCell {TD} at (5,0) size 7x20 [r=0 c=1 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 7x19
+                    text run at (0,0) width 7 RTL: "\x{5D1}"
+                LayoutTableCell {TD} at (12,0) size 8x20 [r=0 c=2 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 8x19
+                    text run at (0,0) width 8 RTL: "\x{5D0}"
+                LayoutTableCell {TD} at (20,0) size 4x20 [r=0 c=3 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 4x19
+                    text run at (0,0) width 4: " "
+                LayoutTableCell {TD} at (24,0) size 11x20 [r=0 c=4 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 11x19
+                    text run at (0,0) width 11: "A"
+                LayoutTableCell {TD} at (35,0) size 10x20 [r=0 c=5 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 10x19
+                    text run at (0,0) width 10: "B"
+                LayoutTableCell {TD} at (45,0) size 11x20 [r=0 c=6 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 11x19
+                    text run at (0,0) width 11: "C"
+                LayoutTableCell {TD} at (56,0) size 4x20 [r=0 c=7 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 4x19
+                    text run at (0,0) width 4: " "
+                LayoutTableCell {TD} at (60,0) size 9x20 [r=0 c=8 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 9x19
+                    text run at (0,0) width 9: "F"
+                LayoutTableCell {TD} at (69,0) size 9x20 [r=0 c=9 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 9x19
+                    text run at (0,0) width 9: "E"
+                LayoutTableCell {TD} at (78,0) size 11x20 [r=0 c=10 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 11x19
+                    text run at (0,0) width 11: "D"
+                LayoutTableCell {TD} at (89,0) size 4x20 [r=0 c=11 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 4x19
+                    text run at (0,0) width 4: " "
+                LayoutTableCell {TD} at (93,0) size 4x20 [r=0 c=12 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 4x19
+                    text run at (0,0) width 4 RTL: "\x{5D5}"
+                LayoutTableCell {TD} at (97,0) size 8x20 [r=0 c=13 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 8x19
+                    text run at (0,0) width 8 RTL: "\x{5D4}"
+                LayoutTableCell {TD} at (105,0) size 7x20 [r=0 c=14 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 7x19
+                    text run at (0,0) width 7 RTL: "\x{5D3}"
+                LayoutTableCell {TD} at (112,0) size 4x20 [r=0 c=15 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 4x19
+                    text run at (0,0) width 4: " "
+                LayoutTableCell {TD} at (116,0) size 11x20 [r=0 c=16 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 11x19
+                    text run at (0,0) width 11: "G"
+                LayoutTableCell {TD} at (127,0) size 11x20 [r=0 c=17 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 11x19
+                    text run at (0,0) width 11: "H"
+                LayoutTableCell {TD} at (138,0) size 5x20 [r=0 c=18 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 5x19
+                    text run at (0,0) width 5: "I"
+                LayoutTableCell {TD} at (143,0) size 4x20 [r=0 c=19 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 4x19
+                    text run at (0,0) width 4: " "
+                LayoutTableCell {TD} at (147,0) size 8x20 [r=0 c=20 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 8x19
+                    text run at (0,0) width 8 RTL: "\x{5D8}"
+                LayoutTableCell {TD} at (155,0) size 8x20 [r=0 c=21 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 8x19
+                    text run at (0,0) width 8 RTL: "\x{5D7}"
+                LayoutTableCell {TD} at (163,0) size 5x20 [r=0 c=22 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 5x19
+                    text run at (0,0) width 5 RTL: "\x{5D6}"
+          LayoutBlockFlow {P} at (4,24) size 168x20
+            LayoutText {#text} at (0,0) size 60x19
+              text run at (0,0) width 20 RTL: "\x{5D0}\x{5D1}\x{5D2}"
+              text run at (20,0) width 40: " ABC "
+            LayoutInline {BDO} at (0,0) size 52x19
+              LayoutText {#text} at (60,0) size 52x19
+                text run at (60,0) width 52 RTL override: "\x{5D3}\x{5D4}\x{5D5} DEF"
+            LayoutText {#text} at (112,0) size 56x19
+              text run at (112,0) width 35: " GHI "
+              text run at (147,0) width 21 RTL: "\x{5D6}\x{5D7}\x{5D8}"
+        LayoutText {#text} at (0,0) size 0x0
+      LayoutBlockFlow {HR} at (0,386.44) size 784x2 [border: (1px inset #EEEEEE)]
+      LayoutBlockFlow {P} at (0,404.44) size 784x20
+        LayoutText {#text} at (0,0) size 57x19
+          text run at (0,0) width 57: "(Back to "
+        LayoutInline {A} at (0,0) size 149x19 [color=#0000EE]
+          LayoutText {#text} at (57,0) size 149x19
+            text run at (57,0) width 149: "CSS Testing Information"
+        LayoutText {#text} at (206,0) size 8x19
+          text run at (206,0) width 8: ", "
+        LayoutInline {A} at (0,0) size 77x19 [color=#0000EE]
+          LayoutText {#text} at (214,0) size 77x19
+            text run at (214,0) width 77: "David Baron"
+        LayoutText {#text} at (291,0) size 5x19
+          text run at (291,0) width 5: ")"
+      LayoutBlockFlow {P} at (0,440.44) size 784x20
+        LayoutInline {A} at (0,0) size 30x19 [color=#0000EE]
+          LayoutText {#text} at (0,0) size 30x19
+            text run at (0,0) width 30: "LDB"
+        LayoutText {#text} at (30,0) size 8x19
+          text run at (30,0) width 8: ", "
+        LayoutInline {A} at (0,0) size 125x19 [color=#0000EE]
+          LayoutText {#text} at (38,0) size 125x19
+            text run at (38,0) width 125: "dbaron@dbaron.org"
+        LayoutText {#text} at (163,0) size 84x19
+          text run at (163,0) width 84: ", 2001-06-05"
+      LayoutBlockFlow {P} at (0,476.44) size 784x20
+        LayoutText {#text} at (0,0) size 289x19
+          text run at (0,0) width 289: "Modified and used with the author\x{2019}s permission."
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text/international/bidi-explicit-embedding-expected.png b/third_party/WebKit/LayoutTests/platform/android/fast/text/international/bidi-explicit-embedding-expected.png
new file mode 100644
index 0000000..7c9c63118
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text/international/bidi-explicit-embedding-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text/international/bidi-explicit-embedding-expected.txt b/third_party/WebKit/LayoutTests/platform/android/fast/text/international/bidi-explicit-embedding-expected.txt
new file mode 100644
index 0000000..30ac439
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text/international/bidi-explicit-embedding-expected.txt
@@ -0,0 +1,120 @@
+layer at (0,0) size 800x600
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x524
+  LayoutBlockFlow {HTML} at (0,0) size 800x524
+    LayoutBlockFlow {BODY} at (8,16) size 784x492
+      LayoutBlockFlow {P} at (0,0) size 784x60
+        LayoutText {#text} at (0,0) size 773x59
+          text run at (0,0) width 773: "In each line, reading from left to right, the bracket should appear before the parenthesis. The bracket should be a left bracket and"
+          text run at (0,20) width 763: "the parenthesis should be a right parenthesis. In each line, Roman characters and digits should be in increasing order from left to"
+          text run at (0,40) width 30: "right."
+      LayoutBlockFlow {P} at (0,76) size 784x20
+        LayoutText {#text} at (0,0) size 47x19
+          text run at (0,0) width 20 RTL: "\x{5D0}\x{5D1}\x{5D2}"
+          text run at (20,0) width 27: " def "
+        LayoutInline {SPAN} at (0,0) size 31x19
+          LayoutText {#text} at (47,0) size 31x19
+            text run at (47,0) width 31 RTL: "(\x{5D6}\x{5D7}\x{5D8}]"
+        LayoutText {#text} at (78,0) size 19x19
+          text run at (78,0) width 19: " jkl"
+      LayoutBlockFlow {P} at (0,112) size 784x20
+        LayoutText {#text} at (0,0) size 47x19
+          text run at (0,0) width 20 RTL: "\x{5D0}\x{5D1}\x{5D2}"
+          text run at (20,0) width 27: " def "
+        LayoutInline {SPAN} at (0,0) size 27x19
+          LayoutText {#text} at (47,0) size 27x19
+            text run at (47,0) width 5 RTL: "]"
+            text run at (52,0) width 17: "ghi"
+            text run at (69,0) width 5 RTL: "("
+        LayoutText {#text} at (74,0) size 19x19
+          text run at (74,0) width 19: " jkl"
+      LayoutBlockFlow {P} at (0,148) size 784x20
+        LayoutText {#text} at (0,0) size 26x19
+          text run at (0,0) width 26: "abc "
+        LayoutInline {SPAN} at (0,0) size 46x19
+          LayoutText {#text} at (26,0) size 46x19
+            text run at (26,0) width 5 RTL: "]"
+            text run at (31,0) width 16: "23"
+            text run at (47,0) width 4 RTL: " "
+            text run at (51,0) width 16: "45"
+            text run at (67,0) width 5 RTL: "("
+        LayoutText {#text} at (72,0) size 22x19
+          text run at (72,0) width 22: " fgh"
+      LayoutBlockFlow {P} at (0,184) size 784x20
+        LayoutText {#text} at (0,0) size 94x19
+          text run at (0,0) width 26: "abc "
+          text run at (26,0) width 5 RTL: "]"
+          text run at (31,0) width 16: "23"
+          text run at (47,0) width 4 RTL: " "
+          text run at (51,0) width 16: "45"
+          text run at (67,0) width 5 RTL: "\x{202B}("
+          text run at (72,0) width 22: "\x{202C} fgh"
+      LayoutBlockFlow {P} at (0,220) size 784x20
+        LayoutText {#text} at (0,0) size 84x19
+          text run at (0,0) width 26: "abc "
+          text run at (26,0) width 5 RTL: "]"
+          text run at (31,0) width 30: "de fg"
+          text run at (61,0) width 5 RTL: "\x{202B}("
+          text run at (66,0) width 18: "\x{202C} hij"
+      LayoutBlockFlow {P} at (0,256) size 784x20
+        LayoutText {#text} at (0,0) size 8x19
+          text run at (0,0) width 8: "1"
+        LayoutInline {SPAN} at (0,0) size 44x19
+          LayoutText {#text} at (8,0) size 44x19
+            text run at (8,0) width 5 RTL: "]"
+            text run at (13,0) width 34: "ab cd"
+            text run at (47,0) width 5 RTL: "("
+        LayoutText {#text} at (0,0) size 0x0
+      LayoutBlockFlow {P} at (0,292) size 784x20
+        LayoutText {#text} at (0,0) size 8x19
+          text run at (0,0) width 8: "1"
+        LayoutInline {SPAN} at (0,0) size 41x19
+          LayoutText {#text} at (8,0) size 41x19
+            text run at (8,0) width 21 RTL: " \x{5D2}\x{5D3}]"
+            text run at (29,0) width 15: "ab"
+            text run at (44,0) width 5 RTL: "("
+        LayoutText {#text} at (0,0) size 0x0
+      LayoutBlockFlow {P} at (0,328) size 784x20
+        LayoutText {#text} at (0,0) size 8x19
+          text run at (0,0) width 8: "1"
+        LayoutInline {SPAN} at (0,0) size 18x19
+          LayoutText {#text} at (8,0) size 18x19
+            text run at (8,0) width 5 RTL: "]"
+            text run at (13,0) width 8: "2"
+            text run at (21,0) width 5 RTL: "\x{202B}("
+            text run at (26,0) width 0: "\x{202C}"
+        LayoutText {#text} at (0,0) size 0x0
+      LayoutBlockFlow {P} at (0,364) size 784x20
+        LayoutText {#text} at (0,0) size 8x19
+          text run at (0,0) width 8: "1"
+        LayoutInline {SPAN} at (0,0) size 17x19
+          LayoutText {#text} at (8,0) size 17x19
+            text run at (8,0) width 5 RTL: "]"
+            text run at (13,0) width 7: "a"
+            text run at (20,0) width 5 RTL: "\x{202B}("
+            text run at (25,0) width 0: "\x{202C}"
+        LayoutText {#text} at (0,0) size 0x0
+      LayoutBlockFlow {P} at (0,400) size 784x20
+        LayoutText {#text} at (0,0) size 49x19
+          text run at (0,0) width 8: "1"
+          text run at (8,0) width 21 RTL: " \x{5D2}\x{5D3}]"
+          text run at (29,0) width 15: "ab"
+          text run at (44,0) width 5 RTL: "\x{202B}("
+          text run at (49,0) width 0: "\x{202C}"
+      LayoutBlockFlow {P} at (0,436) size 784x20
+        LayoutInline {SPAN} at (0,0) size 79x19
+          LayoutText {#text} at (0,0) size 79x19
+            text run at (0,0) width 5 RTL: "]"
+            text run at (5,0) width 22: "abc"
+            text run at (27,0) width 28 RTL: " \x{5D0}\x{5D1}\x{5D2} "
+            text run at (55,0) width 19: "def"
+            text run at (74,0) width 5 RTL: "("
+        LayoutText {#text} at (0,0) size 0x0
+      LayoutBlockFlow {P} at (0,472) size 784x20
+        LayoutText {#text} at (0,0) size 79x19
+          text run at (0,0) width 5 RTL: "]"
+          text run at (5,0) width 22: "abc"
+          text run at (27,0) width 28 RTL: " \x{5D0}\x{5D1}\x{5D2} "
+          text run at (55,0) width 19: "def"
+          text run at (74,0) width 5 RTL: "\x{202B}("
+          text run at (79,0) width 0: "\x{202C}"
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text/international/bidi-ignored-for-first-child-inline-expected.txt b/third_party/WebKit/LayoutTests/platform/android/fast/text/international/bidi-ignored-for-first-child-inline-expected.txt
new file mode 100644
index 0000000..8a70c28
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text/international/bidi-ignored-for-first-child-inline-expected.txt
@@ -0,0 +1,113 @@
+layer at (0,0) size 800x600
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  LayoutBlockFlow {HTML} at (0,0) size 800x600
+    LayoutBlockFlow {BODY} at (8,8) size 784x576
+      LayoutBlockFlow {P} at (0,0) size 784x40
+        LayoutText {#text} at (0,0) size 99x19
+          text run at (0,0) width 99: "This is a test for "
+        LayoutInline {I} at (0,0) size 762x39
+          LayoutText {#text} at (99,0) size 762x39
+            text run at (99,0) width 663: "http://bugzilla.opendarwin.org/show_bug.cgi?id=5980 Bidi properties of an inline container whose first"
+            text run at (0,20) width 247: "child is an inline container are ignored"
+        LayoutText {#text} at (247,20) size 4x19
+          text run at (247,20) width 4: "."
+      LayoutBlockFlow {HR} at (0,56) size 784x2 [border: (1px inset #EEEEEE)]
+      LayoutBlockFlow {P} at (0,74) size 784x20
+        LayoutText {#text} at (0,0) size 292x19
+          text run at (0,0) width 292: "The following lines should read \x{201C}ABCDEFGHI\x{201D}:"
+      LayoutBlockFlow {P} at (0,110) size 784x20
+        LayoutText {#text} at (0,0) size 32x19
+          text run at (0,0) width 32: "ABC"
+        LayoutInline {SPAN} at (0,0) size 29x19
+          LayoutText {#text} at (32,0) size 29x19
+            text run at (32,0) width 29 RTL override: "FED"
+        LayoutText {#text} at (61,0) size 27x19
+          text run at (61,0) width 27: "GHI"
+      LayoutBlockFlow {P} at (0,146) size 784x20
+        LayoutText {#text} at (0,0) size 32x19
+          text run at (0,0) width 32: "ABC"
+        LayoutInline {SPAN} at (0,0) size 29x19
+          LayoutInline {SPAN} at (0,0) size 29x19
+            LayoutText {#text} at (32,0) size 29x19
+              text run at (32,0) width 29 RTL override: "FED"
+        LayoutText {#text} at (61,0) size 27x19
+          text run at (61,0) width 27: "GHI"
+      LayoutBlockFlow {P} at (0,182) size 784x20
+        LayoutText {#text} at (0,0) size 32x19
+          text run at (0,0) width 32: "ABC"
+        LayoutInline {SPAN} at (0,0) size 29x19
+          LayoutText {#text} at (52,0) size 9x19
+            text run at (52,0) width 9 RTL override: "F"
+          LayoutInline {SPAN} at (0,0) size 20x19
+            LayoutText {#text} at (32,0) size 20x19
+              text run at (32,0) width 20 RTL override: "ED"
+        LayoutText {#text} at (61,0) size 27x19
+          text run at (61,0) width 27: "GHI"
+      LayoutBlockFlow {P} at (0,218) size 784x20
+        LayoutText {#text} at (0,0) size 32x19
+          text run at (0,0) width 32: "ABC"
+        LayoutInline {SPAN} at (0,0) size 29x19
+          LayoutText {#text} at (52,0) size 9x19
+            text run at (52,0) width 9 RTL override: "F"
+          LayoutInline {SPAN} at (0,0) size 9x19
+            LayoutText {#text} at (43,0) size 9x19
+              text run at (43,0) width 9 RTL override: "E"
+          LayoutText {#text} at (32,0) size 11x19
+            text run at (32,0) width 11 RTL override: "D"
+        LayoutText {#text} at (61,0) size 27x19
+          text run at (61,0) width 27: "GHI"
+      LayoutBlockFlow {P} at (0,254) size 784x20
+        LayoutText {#text} at (0,0) size 32x19
+          text run at (0,0) width 32: "ABC"
+        LayoutInline {SPAN} at (0,0) size 29x19
+          LayoutInline {SPAN} at (0,0) size 18x19
+            LayoutText {#text} at (43,0) size 18x19
+              text run at (43,0) width 18 RTL override: "FE"
+          LayoutText {#text} at (32,0) size 11x19
+            text run at (32,0) width 11 RTL override: "D"
+        LayoutText {#text} at (61,0) size 27x19
+          text run at (61,0) width 27: "GHI"
+      LayoutBlockFlow {P} at (0,290) size 784x20
+        LayoutInline {SPAN} at (0,0) size 88x19
+          LayoutText {#text} at (0,0) size 88x19
+            text run at (0,0) width 88 RTL override: "IHGFEDCBA"
+        LayoutText {#text} at (0,0) size 0x0
+      LayoutBlockFlow {P} at (0,326) size 784x20
+        LayoutInline {SPAN} at (0,0) size 88x19
+          LayoutText {#text} at (0,0) size 88x19
+            text run at (0,0) width 88 RTL override: "IHGFEDCBA"
+        LayoutText {#text} at (0,0) size 0x0
+      LayoutBlockFlow {HR} at (0,362) size 784x2 [border: (1px inset #EEEEEE)]
+      LayoutBlockFlow (anonymous) at (0,372) size 784x20
+        LayoutText {#text} at (0,0) size 229x19
+          text run at (0,0) width 229: "The following lines should be identical:"
+      LayoutBlockFlow {P} at (0,408) size 784x20
+        LayoutText {#text} at (0,0) size 49x19
+          text run at (0,0) width 19 RTL: "\x{5D3}\x{5D4}\x{5D5}"
+          text run at (19,0) width 10: "(["
+          text run at (29,0) width 20 RTL: "\x{202C}\x{5D0}\x{5D1}\x{5D2}"
+          text run at (49,0) width 0: "\x{202A}"
+      LayoutBlockFlow {P} at (0,444) size 784x20
+        LayoutText {#text} at (0,0) size 29x19
+          text run at (0,0) width 19 RTL: "\x{5D3}\x{5D4}\x{5D5}"
+          text run at (19,0) width 10: "(["
+        LayoutInline {SPAN} at (0,0) size 0x19
+        LayoutText {#text} at (29,0) size 20x19
+          text run at (29,0) width 20 RTL: "\x{5D0}\x{5D1}\x{5D2}"
+      LayoutBlockFlow {P} at (0,480) size 784x20
+        LayoutText {#text} at (0,0) size 29x19
+          text run at (0,0) width 19 RTL: "\x{5D3}\x{5D4}\x{5D5}"
+          text run at (19,0) width 10: "(["
+        LayoutInline {SPAN} at (0,0) size 0x19
+          LayoutInline {SPAN} at (0,0) size 0x19
+        LayoutText {#text} at (29,0) size 20x19
+          text run at (29,0) width 20 RTL: "\x{5D0}\x{5D1}\x{5D2}"
+      LayoutBlockFlow {P} at (0,516) size 784x20
+        LayoutText {#text} at (0,0) size 29x19
+          text run at (0,0) width 19 RTL: "\x{5D3}\x{5D4}\x{5D5}"
+          text run at (19,0) width 10: "(["
+        LayoutInline {SPAN} at (0,0) size 20x19
+          LayoutInline {SPAN} at (0,0) size 0x19
+        LayoutText {#text} at (29,0) size 20x19
+          text run at (29,0) width 20 RTL: "\x{5D0}\x{5D1}\x{5D2}"
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text/international/bidi-innertext-expected.txt b/third_party/WebKit/LayoutTests/platform/android/fast/text/international/bidi-innertext-expected.txt
new file mode 100644
index 0000000..26076ed
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text/international/bidi-innertext-expected.txt
@@ -0,0 +1,86 @@
+layer at (0,0) size 800x600
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  LayoutBlockFlow {HTML} at (0,0) size 800x600
+    LayoutBlockFlow {BODY} at (8,8) size 784x576
+      LayoutBlockFlow (anonymous) at (0,0) size 784x40
+        LayoutText {#text} at (0,0) size 723x39
+          text run at (0,0) width 442: "The following tests text iteration over RTL text embedded with LTR text. "
+          text run at (442,0) width 281: "TextIterators are used for find, spellcheck, and"
+          text run at (0,20) width 60: ".innerText"
+      LayoutBlockFlow {HR} at (0,48) size 784x2 [border: (1px inset #EEEEEE)]
+      LayoutBlockFlow (anonymous) at (0,58) size 784x20
+        LayoutText {#text} at (0,0) size 129x19
+          text run at (0,0) width 129: "Embedded Numbers:"
+      LayoutBlockFlow {DIV} at (0,78) size 784x20 [color=#0000FF]
+        LayoutText {#text} at (0,0) size 104x19
+          text run at (0,0) width 52: "Testing ("
+          text run at (52,0) width 12 RTL: "\x{5DF}\x{5DE}"
+          text run at (64,0) width 8: "3"
+          text run at (72,0) width 27 RTL: "\x{5D7}\x{5D5}\x{5D3}\x{5D0}"
+          text run at (99,0) width 5: ")"
+      LayoutBlockFlow (anonymous) at (0,98) size 784x20
+        LayoutText {#text} at (0,0) size 101x19
+          text run at (0,0) width 101: "Embedded LTR:"
+      LayoutBlockFlow {DIV} at (0,118) size 784x20 [color=#0000FF]
+        LayoutText {#text} at (0,0) size 124x19
+          text run at (0,0) width 52: "Testing ("
+          text run at (52,0) width 27 RTL: "\x{5D7}\x{5D5}\x{5D3}\x{5D0}"
+          text run at (79,0) width 28: "hello"
+          text run at (107,0) width 12 RTL: "\x{5DF}\x{5DE}"
+          text run at (119,0) width 5: ")"
+      LayoutBlockFlow (anonymous) at (0,138) size 784x20
+        LayoutText {#text} at (0,0) size 184x19
+          text run at (0,0) width 184: "Embedded Numbers and LTR"
+      LayoutBlockFlow {DIV} at (0,158) size 784x20 [color=#0000FF]
+        LayoutText {#text} at (0,0) size 123x19
+          text run at (0,0) width 52: "Testing ("
+          text run at (52,0) width 24 RTL: "\x{5E7}\x{5E7}\x{5E8}"
+          text run at (76,0) width 8: "3"
+          text run at (84,0) width 27 RTL: "\x{5D9}\x{5E7}\x{5DD}\x{5DC}"
+          text run at (111,0) width 12: "h)"
+      LayoutBlockFlow (anonymous) at (0,178) size 784x20
+        LayoutText {#text} at (0,0) size 207x19
+          text run at (0,0) width 207: "Embedded Numbers with spacing:"
+      LayoutBlockFlow {DIV} at (0,198) size 784x20 [color=#0000FF]
+        LayoutText {#text} at (0,0) size 229x19
+          text run at (0,0) width 52: "Testing ("
+          text run at (52,0) width 31 RTL: " \x{5D7}\x{5D5}\x{5D3}\x{5D0}"
+          text run at (83,0) width 24: "300"
+          text run at (107,0) width 43 RTL: "\x{5D7}\x{5D5}\x{5D3}\x{5D0}\x{5DF}\x{5DE} "
+          text run at (150,0) width 40: "34023"
+          text run at (190,0) width 34 RTL: "\x{5D9}\x{5E7}\x{5DA}\x{5DA}\x{5DD}"
+          text run at (224,0) width 5: ")"
+      LayoutBlockFlow (anonymous) at (0,218) size 784x20
+        LayoutText {#text} at (0,0) size 64x19
+          text run at (0,0) width 64: "Plain LTR:"
+      LayoutBlockFlow {DIV} at (0,238) size 784x20 [color=#0000FF]
+        LayoutText {#text} at (0,0) size 85x19
+          text run at (0,0) width 85: "Testing (hello)"
+      LayoutBlockFlow (anonymous) at (0,258) size 784x20
+        LayoutText {#text} at (0,0) size 179x19
+          text run at (0,0) width 179: "Embedded LTR with spacing:"
+      LayoutBlockFlow {DIV} at (0,278) size 784x20 [color=#0000FF]
+        LayoutText {#text} at (0,0) size 162x19
+          text run at (0,0) width 52: "Testing ("
+          text run at (52,0) width 53 RTL: "\x{5D7}\x{5D5}\x{5D3}\x{5D9}\x{5E7}\x{5DA}\x{5DA}\x{5DD}"
+          text run at (105,0) width 36: " hello "
+          text run at (141,0) width 16 RTL: "\x{5DF}\x{5DE}\x{5D9}"
+          text run at (157,0) width 5: ")"
+      LayoutBlockFlow (anonymous) at (0,298) size 784x20
+        LayoutText {#text} at (0,0) size 156x19
+          text run at (0,0) width 156: "Mixed but not embedded:"
+      LayoutBlockFlow {DIV} at (0,318) size 784x20 [color=#0000FF]
+        LayoutText {#text} at (0,0) size 116x19
+          text run at (0,0) width 80: "Testing (hello"
+          text run at (80,0) width 31 RTL: "\x{5D7}\x{5D5}\x{5D3}\x{5DF}\x{5DE}"
+          text run at (111,0) width 5: ")"
+      LayoutBlockFlow (anonymous) at (0,338) size 784x20
+        LayoutText {#text} at (0,0) size 156x19
+          text run at (0,0) width 156: "Mixed but not embedded:"
+      LayoutBlockFlow {DIV} at (0,358) size 784x20 [color=#0000FF]
+        LayoutText {#text} at (0,0) size 116x19
+          text run at (0,0) width 52: "Testing ("
+          text run at (52,0) width 31 RTL: "\x{5D7}\x{5D5}\x{5D3}\x{5DF}\x{5DE}"
+          text run at (83,0) width 33: "hello)"
+      LayoutBlockFlow {OL} at (0,394) size 784x0
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text/international/bidi-neutral-directionality-paragraph-start-expected.png b/third_party/WebKit/LayoutTests/platform/android/fast/text/international/bidi-neutral-directionality-paragraph-start-expected.png
new file mode 100644
index 0000000..0542851
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text/international/bidi-neutral-directionality-paragraph-start-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text/international/bidi-neutral-directionality-paragraph-start-expected.txt b/third_party/WebKit/LayoutTests/platform/android/fast/text/international/bidi-neutral-directionality-paragraph-start-expected.txt
new file mode 100644
index 0000000..4c4cd61
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text/international/bidi-neutral-directionality-paragraph-start-expected.txt
@@ -0,0 +1,35 @@
+layer at (0,0) size 800x600
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  LayoutBlockFlow {HTML} at (0,0) size 800x600
+    LayoutBlockFlow {BODY} at (8,8) size 784x576
+      LayoutBlockFlow {P} at (0,0) size 784x20
+        LayoutText {#text} at (0,0) size 535x19
+          text run at (0,0) width 535: "Mitz Pettel contributed this fix to KDE, and now we're rolling it in. Here's his explanation:"
+      LayoutBlockFlow {P} at (0,36) size 784x80
+        LayoutText {#text} at (0,0) size 777x79
+          text run at (0,0) width 777: "The directionality of a neutral character at the beginning of a paragraph (or after a hard line break) is decided incorrectly if the first"
+          text run at (0,20) width 758: "non-neutral character in the paragraph has directionality opposite to the paragraph directionality. For example, if the paragraph"
+          text run at (0,40) width 777: "direction is LTR, the first character on the paragraph is a question mark and the next one is a Hebrew character, then the question"
+          text run at (0,60) width 511: "mark will is considered right-to-left and appears to the right of the Hebrew character."
+      LayoutBlockFlow {P} at (0,132) size 784x40
+        LayoutText {#text} at (0,0) size 480x19
+          text run at (0,0) width 480: "The rule to follow is 3.3.4.N2 in the Unicode Standard's Bidirectional Algorithm"
+        LayoutInline {A} at (0,0) size 378x19 [color=#0000EE]
+          LayoutText {#text} at (0,20) size 378x19
+            text run at (0,20) width 378: "http://www.unicode.org/reports/tr9/#Resolving_Neutral_Types"
+        LayoutText {#text} at (378,20) size 4x19
+          text run at (378,20) width 4: "."
+      LayoutBlockFlow {P} at (0,188) size 784x20
+        LayoutText {#text} at (0,0) size 644x19
+          text run at (0,0) width 644: "If the test is successful, the question marks should be on the far left and far right of the next two paragraphs."
+      LayoutBlockFlow {P} at (0,224) size 784x20
+        LayoutText {#text} at (0,0) size 63x19
+          text run at (0,0) width 11: "? "
+          text run at (11,0) width 24 RTL: "\x{FEB2} \x{FEED}"
+          text run at (35,0) width 28: "hello"
+      LayoutBlockFlow {P} at (0,260) size 784x20
+        LayoutText {#text} at (717,0) size 67x19
+          text run at (717,0) width 28 RTL: " \x{FEB2} \x{FEED}"
+          text run at (745,0) width 28: "hello"
+          text run at (773,0) width 11 RTL: "? "
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text/international/bidi-override-expected.png b/third_party/WebKit/LayoutTests/platform/android/fast/text/international/bidi-override-expected.png
new file mode 100644
index 0000000..19ed5a1
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text/international/bidi-override-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text/international/bidi-override-expected.txt b/third_party/WebKit/LayoutTests/platform/android/fast/text/international/bidi-override-expected.txt
new file mode 100644
index 0000000..ee7e24b
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text/international/bidi-override-expected.txt
@@ -0,0 +1,157 @@
+layer at (0,0) size 800x600
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x356
+  LayoutBlockFlow {HTML} at (0,0) size 800x356
+    LayoutBlockFlow {BODY} at (8,16) size 784x332
+      LayoutBlockFlow {P} at (0,0) size 784x20
+        LayoutText {#text} at (0,0) size 296x19
+          text run at (0,0) width 296: "All rows should be identical to the reference row."
+      LayoutTable {TABLE} at (0,36) size 506x117 [border: none]
+        LayoutTableSection {TBODY} at (0,0) size 505x116
+          LayoutTableRow {TR} at (0,0) size 505x29
+            LayoutTableCell {TD} at (0,0) size 93x29 [border: (1px solid #008000)] [r=0 c=0 rs=1 cs=1]
+              LayoutText {#text} at (28,5) size 61x19
+                text run at (28,5) width 61: "Reference"
+            LayoutTableCell {TD} at (93,0) size 206x29 [border: (1px solid #008000)] [r=0 c=1 rs=1 cs=1]
+              LayoutText {#text} at (5,5) size 197x19
+                text run at (5,5) width 41: "abcdef"
+                text run at (46,5) width 20 RTL: "\x{5D0}\x{5D1}\x{5D2}"
+                text run at (66,5) width 36: "ghijkl "
+                text run at (102,5) width 39 RTL: "\x{5D6}\x{5D7}\x{5D8}\x{5D9}\x{5DB}\x{5DC}"
+                text run at (141,5) width 22: "abc"
+                text run at (163,5) width 39 RTL: "\x{5D0}\x{5D1}\x{5D2}\x{5D3}\x{5D4}\x{5D5}"
+            LayoutTableCell {TD} at (299,0) size 206x29 [border: (1px solid #008000)] [r=0 c=2 rs=1 cs=1]
+              LayoutText {#text} at (5,5) size 197x19
+                text run at (5,5) width 39 RTL: "\x{5D6}\x{5D7}\x{5D8}\x{5D9}\x{5DB}\x{5DC}"
+                text run at (44,5) width 22: "abc"
+                text run at (66,5) width 39 RTL: "\x{5D0}\x{5D1}\x{5D2}\x{5D3}\x{5D4}\x{5D5}"
+                text run at (105,5) width 4 RTL: " "
+                text run at (109,5) width 41: "abcdef"
+                text run at (150,5) width 20 RTL: "\x{5D0}\x{5D1}\x{5D2}"
+                text run at (170,5) width 32: "ghijkl"
+          LayoutTableRow {TR} at (0,29) size 505x29
+            LayoutTableCell {TD} at (0,29) size 93x29 [border: (1px solid #008000)] [r=1 c=0 rs=1 cs=1]
+              LayoutText {#text} at (9,5) size 80x19
+                text run at (9,5) width 80: "CSS, siblings"
+            LayoutTableCell {TD} at (93,29) size 206x29 [border: (1px solid #008000)] [r=1 c=1 rs=1 cs=1]
+              LayoutText {#text} at (5,5) size 22x19
+                text run at (5,5) width 22: "abc"
+              LayoutInline {SPAN} at (0,0) size 56x19
+                LayoutText {#text} at (27,5) size 56x19
+                  text run at (27,5) width 56 RTL override: "ihg\x{5D0}\x{5D1}\x{5D2}fed"
+              LayoutText {#text} at (83,5) size 119x19
+                text run at (83,5) width 19: "jkl "
+                text run at (182,5) width 20 RTL: "\x{5D0}\x{5D1}\x{5D2}"
+              LayoutInline {SPAN} at (0,0) size 62x19
+                LayoutText {#text} at (120,5) size 62x19
+                  text run at (120,5) width 62 LTR override: "\x{5D8}\x{5D7}\x{5D6}abc\x{5D5}\x{5D4}\x{5D3}"
+              LayoutText {#text} at (102,5) size 18x19
+                text run at (102,5) width 18 RTL: "\x{5D9}\x{5DB}\x{5DC}"
+            LayoutTableCell {TD} at (299,29) size 206x29 [border: (1px solid #008000)] [r=1 c=2 rs=1 cs=1]
+              LayoutText {#text} at (109,5) size 22x19
+                text run at (109,5) width 22: "abc"
+              LayoutInline {SPAN} at (0,0) size 56x19
+                LayoutText {#text} at (131,5) size 56x19
+                  text run at (131,5) width 56 RTL override: "ihg\x{5D0}\x{5D1}\x{5D2}fed"
+              LayoutText {#text} at (85,5) size 117x19
+                text run at (85,5) width 24 RTL: " \x{5D0}\x{5D1}\x{5D2}"
+                text run at (187,5) width 15: "jkl"
+              LayoutInline {SPAN} at (0,0) size 62x19
+                LayoutText {#text} at (23,5) size 62x19
+                  text run at (23,5) width 62 LTR override: "\x{5D8}\x{5D7}\x{5D6}abc\x{5D5}\x{5D4}\x{5D3}"
+              LayoutText {#text} at (5,5) size 18x19
+                text run at (5,5) width 18 RTL: "\x{5D9}\x{5DB}\x{5DC}"
+          LayoutTableRow {TR} at (0,58) size 505x29
+            LayoutTableCell {TD} at (0,58) size 93x29 [border: (1px solid #008000)] [r=2 c=0 rs=1 cs=1]
+              LayoutText {#text} at (5,5) size 84x19
+                text run at (5,5) width 84: "CSS, children"
+            LayoutTableCell {TD} at (93,58) size 206x29 [border: (1px solid #008000)] [r=2 c=1 rs=1 cs=1]
+              LayoutInline {SPAN} at (0,0) size 93x19
+                LayoutText {#text} at (5,5) size 22x19
+                  text run at (5,5) width 22: "abc"
+                LayoutInline {SPAN} at (0,0) size 56x19
+                  LayoutText {#text} at (27,5) size 56x19
+                    text run at (27,5) width 56 RTL override: "ihg\x{5D0}\x{5D1}\x{5D2}fed"
+                LayoutText {#text} at (83,5) size 15x19
+                  text run at (83,5) width 15: "jkl"
+              LayoutText {#text} at (98,5) size 4x19
+                text run at (98,5) width 4: " "
+              LayoutInline {SPAN} at (0,0) size 100x19
+                LayoutText {#text} at (182,5) size 20x19
+                  text run at (182,5) width 20 RTL: "\x{5D0}\x{5D1}\x{5D2}"
+                LayoutInline {SPAN} at (0,0) size 62x19
+                  LayoutText {#text} at (120,5) size 62x19
+                    text run at (120,5) width 62 LTR override: "\x{5D8}\x{5D7}\x{5D6}abc\x{5D5}\x{5D4}\x{5D3}"
+                LayoutText {#text} at (102,5) size 18x19
+                  text run at (102,5) width 18 RTL: "\x{5D9}\x{5DB}\x{5DC}"
+            LayoutTableCell {TD} at (299,58) size 206x29 [border: (1px solid #008000)] [r=2 c=2 rs=1 cs=1]
+              LayoutInline {SPAN} at (0,0) size 93x19
+                LayoutText {#text} at (109,5) size 22x19
+                  text run at (109,5) width 22: "abc"
+                LayoutInline {SPAN} at (0,0) size 56x19
+                  LayoutText {#text} at (131,5) size 56x19
+                    text run at (131,5) width 56 RTL override: "ihg\x{5D0}\x{5D1}\x{5D2}fed"
+                LayoutText {#text} at (187,5) size 15x19
+                  text run at (187,5) width 15: "jkl"
+              LayoutText {#text} at (105,5) size 4x19
+                text run at (105,5) width 4 RTL: " "
+              LayoutInline {SPAN} at (0,0) size 100x19
+                LayoutText {#text} at (85,5) size 20x19
+                  text run at (85,5) width 20 RTL: "\x{5D0}\x{5D1}\x{5D2}"
+                LayoutInline {SPAN} at (0,0) size 62x19
+                  LayoutText {#text} at (23,5) size 62x19
+                    text run at (23,5) width 62 LTR override: "\x{5D8}\x{5D7}\x{5D6}abc\x{5D5}\x{5D4}\x{5D3}"
+                LayoutText {#text} at (5,5) size 18x19
+                  text run at (5,5) width 18 RTL: "\x{5D9}\x{5DB}\x{5DC}"
+          LayoutTableRow {TR} at (0,87) size 505x29
+            LayoutTableCell {TD} at (0,87) size 93x29 [border: (1px solid #008000)] [r=3 c=0 rs=1 cs=1]
+              LayoutText {#text} at (38,5) size 51x19
+                text run at (38,5) width 51: "Unicode"
+            LayoutTableCell {TD} at (93,87) size 206x29 [border: (1px solid #008000)] [r=3 c=1 rs=1 cs=1]
+              LayoutText {#text} at (5,5) size 197x19
+                text run at (5,5) width 22: "abc"
+                text run at (27,5) width 56 RTL override: "\x{202E}ihg\x{5D0}\x{5D1}\x{5D2}fed"
+                text run at (83,5) width 19: "\x{202C}jkl "
+                text run at (102,5) width 18 RTL: "\x{202C}\x{5D9}\x{5DB}\x{5DC}"
+                text run at (120,5) width 62 LTR override: "\x{202D}\x{5D8}\x{5D7}\x{5D6}abc\x{5D5}\x{5D4}\x{5D3}"
+                text run at (182,5) width 20 RTL: "\x{5D0}\x{5D1}\x{5D2}"
+            LayoutTableCell {TD} at (299,87) size 206x29 [border: (1px solid #008000)] [r=3 c=2 rs=1 cs=1]
+              LayoutText {#text} at (5,5) size 197x19
+                text run at (5,5) width 18 RTL: "\x{202C}\x{5D9}\x{5DB}\x{5DC}"
+                text run at (23,5) width 62 LTR override: "\x{202D}\x{5D8}\x{5D7}\x{5D6}abc\x{5D5}\x{5D4}\x{5D3}"
+                text run at (85,5) width 20 RTL: "\x{5D0}\x{5D1}\x{5D2}"
+                text run at (105,5) width 4 RTL: " "
+                text run at (109,5) width 22: "abc"
+                text run at (131,5) width 56 RTL override: "\x{202E}ihg\x{5D0}\x{5D1}\x{5D2}fed"
+                text run at (187,5) width 15: "\x{202C}jkl"
+      LayoutBlockFlow {P} at (0,169) size 784x20
+        LayoutText {#text} at (0,0) size 367x19
+          text run at (0,0) width 367: "The CSS column should be identical to the reference column."
+      LayoutTable {TABLE} at (0,205) size 219x127 [border: none]
+        LayoutTableSection {TBODY} at (0,0) size 218x126
+          LayoutTableRow {TR} at (0,0) size 218x29
+            LayoutTableCell {TD} at (0,0) size 109x29 [border: (1px solid #008000)] [r=0 c=0 rs=1 cs=1]
+              LayoutText {#text} at (24,5) size 62x19
+                text run at (24,5) width 62: "Reference"
+            LayoutTableCell {TD} at (109,0) size 109x29 [border: (1px solid #008000)] [r=0 c=1 rs=1 cs=1]
+              LayoutText {#text} at (40,5) size 30x19
+                text run at (40,5) width 30: "CSS"
+          LayoutTableRow {TR} at (0,29) size 218x97
+            LayoutTableCell {TD} at (0,29) size 109x97 [border: (1px solid #008000)] [r=1 c=0 rs=1 cs=1]
+              LayoutBlockFlow {P} at (5,21) size 100x20
+                LayoutText {#text} at (3,0) size 94x19
+                  text run at (3,0) width 42: "abcdef"
+                  text run at (44,0) width 21 RTL: "\x{5D0}\x{5D1}\x{5D2}"
+                  text run at (64,0) width 33: "ghijkl"
+              LayoutBlockFlow {P} at (5,57) size 100x20
+                LayoutText {#text} at (0,0) size 100x19
+                  text run at (0,0) width 39 RTL: "\x{5D6}\x{5D7}\x{5D8}\x{5D9}\x{5DB}\x{5DC}"
+                  text run at (39,0) width 22: "abc"
+                  text run at (61,0) width 39 RTL: "\x{5D0}\x{5D1}\x{5D2}\x{5D3}\x{5D4}\x{5D5}"
+            LayoutTableCell {TD} at (109,29) size 109x97 [border: (1px solid #008000)] [r=1 c=1 rs=1 cs=1]
+              LayoutBlockFlow {P} at (5,21) size 100x20
+                LayoutText {#text} at (3,0) size 94x19
+                  text run at (3,0) width 94 RTL override: "lkjihg\x{5D0}\x{5D1}\x{5D2}fedcba"
+              LayoutBlockFlow {P} at (5,57) size 100x20
+                LayoutText {#text} at (0,0) size 100x19
+                  text run at (0,0) width 100 LTR override: "\x{5DC}\x{5DB}\x{5D9}\x{5D8}\x{5D7}\x{5D6}abc\x{5D5}\x{5D4}\x{5D3}\x{5D2}\x{5D1}\x{5D0}"
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text/international/bidi-word-spacing-rtl-expected.png b/third_party/WebKit/LayoutTests/platform/android/fast/text/international/bidi-word-spacing-rtl-expected.png
new file mode 100644
index 0000000..a58a42f
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text/international/bidi-word-spacing-rtl-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text/international/bidi-word-spacing-rtl-expected.txt b/third_party/WebKit/LayoutTests/platform/android/fast/text/international/bidi-word-spacing-rtl-expected.txt
new file mode 100644
index 0000000..504236d
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text/international/bidi-word-spacing-rtl-expected.txt
@@ -0,0 +1,50 @@
+layer at (0,0) size 800x600
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x370
+  LayoutBlockFlow {HTML} at (0,0) size 800x370
+    LayoutBlockFlow {BODY} at (8,10) size 784x350
+      LayoutBlockFlow {DIV} at (300,0) size 184x50 [border: (1px solid #000000)]
+        LayoutText {#text} at (172,2) size 11x46
+          text run at (172,2) width 11 RTL: "!"
+        LayoutInline {SPAN} at (0,0) size 47x46
+          LayoutText {#text} at (25,2) size 47x46
+            text run at (25,2) width 47 RTL: " @"
+        LayoutText {#text} at (0,0) size 0x0
+      LayoutBlockFlow {DIV} at (300,60) size 184x50 [border: (1px solid #000000)]
+        LayoutText {#text} at (172,2) size 11x46
+          text run at (172,2) width 11 RTL: "!"
+        LayoutInline {SPAN} at (0,0) size 110x46
+          LayoutText {#text} at (162,2) size 10x46
+            text run at (162,2) width 10 RTL: " "
+        LayoutText {#text} at (25,2) size 37x46
+          text run at (25,2) width 37 RTL: "@"
+      LayoutBlockFlow {DIV} at (300,120) size 184x50 [border: (1px solid #000000)]
+        LayoutInline {SPAN} at (0,0) size 121x46
+          LayoutText {#text} at (62,2) size 121x46
+            text run at (62,2) width 121 RTL: "! "
+        LayoutText {#text} at (25,2) size 37x46
+          text run at (25,2) width 37 RTL: "@"
+      LayoutBlockFlow {DIV} at (300,180) size 184x50 [border: (1px solid #000000)]
+        LayoutText {#text} at (172,2) size 11x46
+          text run at (172,2) width 11 RTL: "!"
+        LayoutInline {SPAN} at (0,0) size 110x46
+          LayoutText {#text} at (162,2) size 10x46
+            text run at (162,2) width 10 RTL: " "
+        LayoutText {#text} at (15,2) size 47x46
+          text run at (15,2) width 47 RTL: "@ \x{200F}"
+      LayoutBlockFlow {DIV} at (300,240) size 184x50 [border: (1px solid #000000)]
+        LayoutText {#text} at (172,2) size 11x46
+          text run at (172,2) width 11 RTL: "!"
+        LayoutInline {SPAN} at (0,0) size 110x46
+          LayoutText {#text} at (162,2) size 10x46
+            text run at (162,2) width 10 RTL: " "
+        LayoutText {#text} at (25,2) size 37x46
+          text run at (25,2) width 37 RTL: "@"
+      LayoutBlockFlow {DIV} at (300,300) size 184x50 [border: (1px solid #000000)]
+        LayoutText {#text} at (25,2) size 37x46
+          text run at (25,2) width 37: "@"
+        LayoutInline {SPAN} at (0,0) size 110x46
+          LayoutText {#text} at (162,2) size 10x46
+            text run at (162,2) width 10: " "
+        LayoutText {#text} at (172,2) size 11x46
+          text run at (172,2) width 11: "!"
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text/international/khmer-selection-expected.txt b/third_party/WebKit/LayoutTests/platform/android/fast/text/international/khmer-selection-expected.txt
new file mode 100644
index 0000000..b75c2452
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text/international/khmer-selection-expected.txt
@@ -0,0 +1,48 @@
+layer at (0,0) size 800x600
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x128
+  LayoutBlockFlow {HTML} at (0,0) size 800x128
+    LayoutBlockFlow {BODY} at (8,16) size 784x96
+      LayoutBlockFlow {P} at (0,0) size 784x20
+        LayoutInline {NOBR} at (0,0) size 228x19
+          LayoutInline {B} at (0,0) size 36x19
+            LayoutText {#text} at (0,0) size 36x19
+              text run at (0,0) width 36: "\x{179C}\x{17C9}\x{17C2}\x{1794}"
+          LayoutText {#text} at (36,0) size 4x19
+            text run at (36,0) width 4: " "
+          LayoutInline {A} at (0,0) size 60x19 [color=#0000EE]
+            LayoutText {#text} at (40,0) size 60x19
+              text run at (40,0) width 60: "\x{179A}\x{17BC}\x{1794}\x{1797}\x{17B6}\x{1796}"
+          LayoutText {#text} at (100,0) size 4x19
+            text run at (100,0) width 4: " "
+          LayoutInline {A} at (0,0) size 36x19 [color=#0000EE]
+            LayoutText {#text} at (104,0) size 36x19
+              text run at (104,0) width 36: "\x{1780}\x{17D2}\x{179A}\x{17BB}\x{1798}"
+          LayoutText {#text} at (140,0) size 4x19
+            text run at (140,0) width 4: " "
+          LayoutInline {A} at (0,0) size 84x19 [color=#0000EE]
+            LayoutText {#text} at (144,0) size 84x19
+              text run at (144,0) width 84: "\x{1790}\x{178F}\x{17AF}\x{1780}\x{179F}\x{17B6}\x{179A}"
+        LayoutText {#text} at (0,0) size 0x0
+      LayoutBlockFlow {P} at (0,36) size 784x60
+        LayoutText {#text} at (0,0) size 501x19
+          text run at (0,0) width 501: "Some Harfbuzz shapers will output cluster logs which suggest that some glyphs had "
+        LayoutInline {I} at (0,0) size 16x19
+          LayoutText {#text} at (501,0) size 16x19
+            text run at (501,0) width 16: "no"
+        LayoutText {#text} at (517,0) size 776x39
+          text run at (517,0) width 259: " contributing code points. This test contains"
+          text run at (0,20) width 113: "such text and uses "
+        LayoutInline {TT} at (0,0) size 88x16
+          LayoutText {#text} at (113,23) size 88x16
+            text run at (113,23) width 88: "eventSender"
+        LayoutText {#text} at (201,20) size 427x19
+          text run at (201,20) width 427: " to select the text. You should see some of the above text selected and "
+        LayoutInline {TT} at (0,0) size 80x16
+          LayoutText {#text} at (628,23) size 80x16
+            text run at (628,23) width 80: "test_shell"
+        LayoutText {#text} at (708,20) size 765x39
+          text run at (708,20) width 57: " shouldn't"
+          text run at (0,40) width 183: "trigger any assertions or crash."
+selection start: position 0 of child 0 {#text} of child 0 {B} of child 1 {NOBR} of child 1 {P} of body
+selection end:   position 7 of child 0 {#text} of child 6 {A} of child 1 {NOBR} of child 1 {P} of body
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text/international/lang-glyph-cache-separation-expected.png b/third_party/WebKit/LayoutTests/platform/android/fast/text/international/lang-glyph-cache-separation-expected.png
new file mode 100644
index 0000000..0141c0a
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text/international/lang-glyph-cache-separation-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text/international/lang-glyph-cache-separation-expected.txt b/third_party/WebKit/LayoutTests/platform/android/fast/text/international/lang-glyph-cache-separation-expected.txt
new file mode 100644
index 0000000..989047a
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text/international/lang-glyph-cache-separation-expected.txt
@@ -0,0 +1,61 @@
+layer at (0,0) size 800x600
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x371
+  LayoutBlockFlow {HTML} at (0,0) size 800x371
+    LayoutBlockFlow {BODY} at (8,8) size 784x355
+      LayoutBlockFlow (anonymous) at (0,0) size 784x60
+        LayoutText {#text} at (0,0) size 312x19
+          text run at (0,0) width 312: "Tests if glyph caches of different languages interfere."
+        LayoutBR {BR} at (312,0) size 0x19
+        LayoutText {#text} at (0,20) size 781x39
+          text run at (0,20) width 781: "On systems that the locales have different font preferences, the following divs should be displayed in corresponding preferred fonts"
+          text run at (0,40) width 75: "respectively."
+        LayoutBR {BR} at (75,40) size 0x19
+      LayoutBlockFlow {DIV} at (0,60) size 784x100
+        LayoutBlockFlow (anonymous) at (0,0) size 784x20
+          LayoutText {#text} at (0,0) size 114x19
+            text run at (0,0) width 114: "Default font-family:"
+        LayoutBlockFlow {DIV} at (0,20) size 784x20
+          LayoutText {#text} at (0,0) size 166x19
+            text run at (0,0) width 166: "Simplified Chinese: \x{8AA4}\x{904E}\x{9AA8}"
+        LayoutBlockFlow {DIV} at (0,40) size 784x20
+          LayoutText {#text} at (0,0) size 171x19
+            text run at (0,0) width 171: "Traditional Chinese: \x{8AA4}\x{904E}\x{9AA8}"
+        LayoutBlockFlow {DIV} at (0,60) size 784x20
+          LayoutText {#text} at (0,0) size 110x19
+            text run at (0,0) width 110: "Japanese: \x{8AA4}\x{904E}\x{9AA8}"
+        LayoutBlockFlow {DIV} at (0,80) size 784x20
+          LayoutText {#text} at (0,0) size 101x19
+            text run at (0,0) width 101: "Korean: \x{8AA4}\x{904E}\x{9AA8}"
+      LayoutBlockFlow {DIV} at (0,160) size 784x95
+        LayoutBlockFlow (anonymous) at (0,0) size 784x19
+          LayoutText {#text} at (0,0) size 215x18
+            text run at (0,0) width 215: "Generic font-family (sans-serif):"
+        LayoutBlockFlow {DIV} at (0,19) size 784x19
+          LayoutText {#text} at (0,0) size 188x18
+            text run at (0,0) width 188: "Simplified Chinese: \x{8AA4}\x{904E}\x{9AA8}"
+        LayoutBlockFlow {DIV} at (0,38) size 784x19
+          LayoutText {#text} at (0,0) size 191x18
+            text run at (0,0) width 191: "Traditional Chinese: \x{8AA4}\x{904E}\x{9AA8}"
+        LayoutBlockFlow {DIV} at (0,57) size 784x19
+          LayoutText {#text} at (0,0) size 125x18
+            text run at (0,0) width 125: "Japanese: \x{8AA4}\x{904E}\x{9AA8}"
+        LayoutBlockFlow {DIV} at (0,76) size 784x19
+          LayoutText {#text} at (0,0) size 107x18
+            text run at (0,0) width 107: "Korean: \x{8AA4}\x{904E}\x{9AA8}"
+      LayoutBlockFlow {DIV} at (0,255) size 784x100
+        LayoutBlockFlow (anonymous) at (0,0) size 784x20
+          LayoutText {#text} at (0,0) size 278x19
+            text run at (0,0) width 278: "Non-generic font-family (Times New Roman):"
+        LayoutBlockFlow {DIV} at (0,20) size 784x20
+          LayoutText {#text} at (0,0) size 166x19
+            text run at (0,0) width 166: "Simplified Chinese: \x{8AA4}\x{904E}\x{9AA8}"
+        LayoutBlockFlow {DIV} at (0,40) size 784x20
+          LayoutText {#text} at (0,0) size 171x19
+            text run at (0,0) width 171: "Traditional Chinese: \x{8AA4}\x{904E}\x{9AA8}"
+        LayoutBlockFlow {DIV} at (0,60) size 784x20
+          LayoutText {#text} at (0,0) size 110x19
+            text run at (0,0) width 110: "Japanese: \x{8AA4}\x{904E}\x{9AA8}"
+        LayoutBlockFlow {DIV} at (0,80) size 784x20
+          LayoutText {#text} at (0,0) size 101x19
+            text run at (0,0) width 101: "Korean: \x{8AA4}\x{904E}\x{9AA8}"
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text/international/plane2-expected.png b/third_party/WebKit/LayoutTests/platform/android/fast/text/international/plane2-expected.png
new file mode 100644
index 0000000..99db2dc
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text/international/plane2-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text/international/plane2-expected.txt b/third_party/WebKit/LayoutTests/platform/android/fast/text/international/plane2-expected.txt
new file mode 100644
index 0000000..a8e8bbcc
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text/international/plane2-expected.txt
@@ -0,0 +1,22 @@
+layer at (0,0) size 800x600
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  LayoutBlockFlow {HTML} at (0,0) size 800x600
+    LayoutBlockFlow {BODY} at (8,8) size 784x584
+      LayoutBlockFlow {P} at (0,0) size 784x60
+        LayoutText {#text} at (0,0) size 51x19
+          text run at (0,0) width 51: "Test for "
+        LayoutInline {A} at (0,0) size 66x19 [color=#0000EE]
+          LayoutText {#text} at (51,0) size 66x19
+            text run at (51,0) width 66: "bug 35605"
+        LayoutText {#text} at (117,0) size 778x59
+          text run at (117,0) width 641: ": Two lines below have one character from CJK Ideograph, one from CJK Ext A (both in BMP) and three"
+          text run at (0,20) width 778: "characters from CJK Ext B (plane 2). The last group of characters are covered by Japanese fonts on Mac as well as two Chinese"
+          text run at (0,40) width 234: "fonts for Ext B shipped with Windows."
+      LayoutBlockFlow {DIV} at (0,76) size 784x74
+        LayoutBlockFlow {DIV} at (0,0) size 784x37
+          LayoutText {#text} at (0,0) size 148x36
+            text run at (0,0) width 148: "\x{4E00} \x{3400} \x{D867}\x{DE8A}\x{D867}\x{DE49}\x{D867}\x{DEDB}"
+        LayoutBlockFlow {DIV} at (0,37) size 784x37
+          LayoutText {#text} at (0,0) size 148x36
+            text run at (0,0) width 148: "\x{4E00} \x{3400} \x{D867}\x{DE8A}\x{D867}\x{DE49}\x{D867}\x{DEDB}"
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text/international/pop-up-button-text-alignment-and-direction-expected.png b/third_party/WebKit/LayoutTests/platform/android/fast/text/international/pop-up-button-text-alignment-and-direction-expected.png
new file mode 100644
index 0000000..43dd34b
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text/international/pop-up-button-text-alignment-and-direction-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text/international/rtl-caret-expected.txt b/third_party/WebKit/LayoutTests/platform/android/fast/text/international/rtl-caret-expected.txt
new file mode 100644
index 0000000..c7a6b5c
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text/international/rtl-caret-expected.txt
@@ -0,0 +1,26 @@
+layer at (0,0) size 800x600
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  LayoutBlockFlow {HTML} at (0,0) size 800x600
+    LayoutBlockFlow {BODY} at (8,8) size 784x584
+      LayoutBlockFlow {P} at (0,0) size 784x40
+        LayoutText {#text} at (0,0) size 164x19
+          text run at (0,0) width 164: "This is a regression test for "
+        LayoutInline {I} at (0,0) size 771x39
+          LayoutInline {A} at (0,0) size 350x19 [color=#0000EE]
+            LayoutText {#text} at (164,0) size 350x19
+              text run at (164,0) width 350: "http://bugzilla.opendarwin.org/show_bug.cgi?id=8866"
+          LayoutText {#text} at (514,0) size 771x39
+            text run at (514,0) width 4: " "
+            text run at (518,0) width 253: "REGRESSION: Incorrect caret position"
+            text run at (0,20) width 72: "in RTL text"
+        LayoutText {#text} at (72,20) size 4x19
+          text run at (72,20) width 4: "."
+      LayoutBlockFlow {P} at (0,56) size 784x20
+        LayoutText {#text} at (0,0) size 330x19
+          text run at (0,0) width 330: "The caret should be in the middle of the Hebrew word."
+      LayoutBlockFlow {HR} at (0,92) size 784x2 [border: (1px inset #EEEEEE)]
+      LayoutBlockFlow {DIV} at (0,102) size 784x20
+        LayoutText {#text} at (0,0) size 48x19
+          text run at (0,0) width 48 RTL: "\x{5D0}\x{5D5}\x{5DB}\x{5DE}\x{5E0}\x{5D9}\x{5D5}\x{5EA}"
+caret: position 5 of child 0 {#text} of child 7 {DIV} of body
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text/international/rtl-white-space-pre-wrap-expected.txt b/third_party/WebKit/LayoutTests/platform/android/fast/text/international/rtl-white-space-pre-wrap-expected.txt
new file mode 100644
index 0000000..d458889
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text/international/rtl-white-space-pre-wrap-expected.txt
@@ -0,0 +1,38 @@
+layer at (0,0) size 800x600
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  LayoutBlockFlow {HTML} at (0,0) size 800x600
+    LayoutBlockFlow {BODY} at (8,8) size 784x584
+      LayoutBlockFlow {P} at (0,0) size 784x40
+        LayoutText {#text} at (0,0) size 99x19
+          text run at (0,0) width 99: "This is a test for "
+        LayoutInline {I} at (0,0) size 748x39
+          LayoutInline {A} at (0,0) size 350x19 [color=#0000EE]
+            LayoutText {#text} at (99,0) size 350x19
+              text run at (99,0) width 350: "http://bugzilla.opendarwin.org/show_bug.cgi?id=9670"
+          LayoutText {#text} at (449,0) size 748x39
+            text run at (449,0) width 4: " "
+            text run at (453,0) width 295: "http://bugzilla.opendarwin.org/show_bug.cgi?"
+            text run at (0,20) width 55: "id=9670"
+        LayoutText {#text} at (55,20) size 4x19
+          text run at (55,20) width 4: "."
+      LayoutBlockFlow {P} at (0,56) size 784x20
+        LayoutText {#text} at (0,0) size 510x19
+          text run at (0,0) width 510: "All text should be aligned with the right edge of its container and should not overflow."
+      LayoutBlockFlow {HR} at (0,92) size 784x2 [border: (1px inset #EEEEEE)]
+      LayoutBlockFlow {DIV} at (0,102) size 191x28 [bgcolor=#FFFF00]
+        LayoutText {#text} at (1,0) size 190x27
+          text run at (1,0) width 190 RTL: "\x{5D0}\x{5DB}\x{5DC}\x{5EA} \x{5E4}\x{5DC}\x{5E4}\x{5DC}? \x{5E9}\x{5EA}\x{5D4} \x{5DE}\x{5D9}\x{5E5}!"
+      LayoutBlockFlow (anonymous) at (0,130) size 784x85
+        LayoutBR {BR} at (0,0) size 0x19
+        LayoutText {#text} at (199,65) size 4x19
+          text run at (199,65) width 4: " "
+        LayoutBR {BR} at (0,0) size 0x0
+      LayoutBlockFlow {DIV} at (0,215) size 191x28 [bgcolor=#FFFF00]
+        LayoutText {#text} at (1,0) size 190x27
+          text run at (1,0) width 190 RTL: "\x{5D0}\x{5DB}\x{5DC}\x{5EA} \x{5E4}\x{5DC}\x{5E4}\x{5DC}? \x{5E9}\x{5EA}\x{5D4} \x{5DE}\x{5D9}\x{5E5}!"
+layer at (8,158) size 199x60 clip at (9,159) size 197x58
+  LayoutTextControl {TEXTAREA} at (0,20) size 199x60 [bgcolor=#FFFFFF] [border: (1px solid #A9A9A9)]
+    LayoutBlockFlow {DIV} at (3,3) size 195x28
+      LayoutText {#text} at (5,0) size 190x27
+        text run at (5,0) width 190 RTL: "\x{5D0}\x{5DB}\x{5DC}\x{5EA} \x{5E4}\x{5DC}\x{5E4}\x{5DC}? \x{5E9}\x{5EA}\x{5D4} \x{5DE}\x{5D9}\x{5E5}!"
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text/international/unicode-bidi-plaintext-expected.png b/third_party/WebKit/LayoutTests/platform/android/fast/text/international/unicode-bidi-plaintext-expected.png
new file mode 100644
index 0000000..0a81290
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text/international/unicode-bidi-plaintext-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text/international/unicode-bidi-plaintext-expected.txt b/third_party/WebKit/LayoutTests/platform/android/fast/text/international/unicode-bidi-plaintext-expected.txt
new file mode 100644
index 0000000..d0a80cf
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text/international/unicode-bidi-plaintext-expected.txt
@@ -0,0 +1,40 @@
+layer at (0,0) size 800x600
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x214
+  LayoutBlockFlow {HTML} at (0,0) size 800x214
+    LayoutBlockFlow {BODY} at (8,8) size 784x193
+      LayoutBlockFlow {DIV} at (0,0) size 784x20
+        LayoutText {#text} at (0,0) size 483x19
+          text run at (0,0) width 483: "This tests proper handling of unicode-bidi: plaintext. You should not see any red."
+      LayoutBlockFlow {DIV} at (0,20) size 784x80
+        LayoutText {#text} at (0,0) size 41x19
+          text run at (0,0) width 41: "!hello. "
+        LayoutBR {BR} at (41,0) size 0x19
+        LayoutText {#text} at (742,20) size 42x19
+          text run at (742,20) width 42 RTL: "!\x{5E9}\x{5DC}\x{5D5}\x{5DD}. "
+        LayoutBR {BR} at (742,20) size 0x19
+        LayoutText {#text} at (0,40) size 60x19
+          text run at (0,40) width 36: "hello, "
+          text run at (36,40) width 15 RTL: "\x{5DC}\x{5D5}\x{5D9}"
+          text run at (51,40) width 9: "! "
+        LayoutBR {BR} at (60,40) size 0x19
+        LayoutText {#text} at (693,60) size 91x19
+          text run at (693,60) width 5 RTL: "!"
+          text run at (698,60) width 49: "WebKit"
+          text run at (747,60) width 37 RTL: "\x{5E9}\x{5DC}\x{5D5}\x{5DD}, "
+      LayoutBlockFlow {PRE} at (0,113) size 784x80
+        LayoutText {#text} at (0,0) size 784x80
+          text run at (0,0) width 8: "a"
+          text run at (8,0) width 0: " "
+          text run at (0,16) width 8: "("
+          text run at (8,16) width 0: " "
+          text run at (680,32) width 0 RTL: " "
+          text run at (680,32) width 8 RTL: "!"
+          text run at (688,32) width 48: "WebKit"
+          text run at (736,32) width 48 RTL: "\x{5E9}\x{5DC}\x{5D5}\x{5DD}, "
+          text run at (0,48) width 56: "hello, "
+          text run at (56,48) width 24 RTL: "\x{5DC}\x{5D5}\x{5D9}"
+          text run at (80,48) width 8: "!"
+          text run at (88,48) width 0: " "
+          text run at (0,64) width 8: ")"
+          text run at (8,64) width 0: " "
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text/international/unicode-bidi-plaintext-in-textarea-expected.txt b/third_party/WebKit/LayoutTests/platform/android/fast/text/international/unicode-bidi-plaintext-in-textarea-expected.txt
new file mode 100644
index 0000000..0114557e
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text/international/unicode-bidi-plaintext-in-textarea-expected.txt
@@ -0,0 +1,54 @@
+layer at (0,0) size 800x600
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x336
+  LayoutBlockFlow {HTML} at (0,0) size 800x336
+    LayoutBlockFlow {BODY} at (8,8) size 784x320
+      LayoutBlockFlow {DIV} at (0,0) size 784x320
+        LayoutBlockFlow (anonymous) at (0,0) size 784x20
+          LayoutText {#text} at (0,0) size 750x19
+            text run at (0,0) width 750: "In all four cases below, the exclamation mark should be on the left side of the first line and on the right side of the second line."
+        LayoutBlockFlow {DIV} at (0,20) size 784x300
+          LayoutBR {BR} at (421,55) size 0x19
+          LayoutBR {BR} at (421,130) size 0x19
+          LayoutBR {BR} at (421,205) size 0x19
+          LayoutText {#text} at (0,0) size 0x0
+layer at (8,28) size 421x70 clip at (9,29) size 419x68
+  LayoutTextControl {TEXTAREA} at (0,0) size 421x70 [bgcolor=#FFFFFF] [border: (1px solid #A9A9A9)]
+    LayoutBlockFlow {DIV} at (3,3) size 415x48
+      LayoutText {#text} at (375,0) size 40x16
+        text run at (375,0) width 40 RTL: "\x{5E9}\x{5DC}\x{5D5}\x{5DD}!"
+      LayoutBR {BR} at (375,0) size 0x16
+      LayoutText {#text} at (0,16) size 48x16
+        text run at (0,16) width 48: "hello!"
+      LayoutBR {BR} at (48,16) size 0x16
+      LayoutBR {BR} at (0,32) size 0x16
+layer at (8,103) size 421x70 clip at (9,104) size 419x68
+  LayoutTextControl {TEXTAREA} at (0,75) size 421x70 [bgcolor=#FFFFFF] [border: (1px solid #A9A9A9)]
+    LayoutBlockFlow {DIV} at (3,3) size 415x48
+      LayoutText {#text} at (375,0) size 40x16
+        text run at (375,0) width 40 RTL: "\x{5E9}\x{5DC}\x{5D5}\x{5DD}!"
+      LayoutBR {BR} at (375,0) size 0x16
+      LayoutText {#text} at (0,16) size 48x16
+        text run at (0,16) width 48: "hello!"
+      LayoutBR {BR} at (48,16) size 0x16
+      LayoutBR {BR} at (0,32) size 0x16
+layer at (8,178) size 421x70 clip at (9,179) size 419x68
+  LayoutTextControl {TEXTAREA} at (0,150) size 421x70 [bgcolor=#FFFFFF] [border: (1px solid #A9A9A9)]
+    LayoutBlockFlow {DIV} at (3,3) size 415x48
+      LayoutText {#text} at (375,0) size 40x16
+        text run at (375,0) width 40 RTL: "\x{5E9}\x{5DC}\x{5D5}\x{5DD}!"
+      LayoutBR {BR} at (375,0) size 0x16
+      LayoutText {#text} at (0,16) size 48x16
+        text run at (0,16) width 48: "hello!"
+      LayoutBR {BR} at (48,16) size 0x16
+      LayoutBR {BR} at (0,32) size 0x16
+layer at (8,253) size 421x70 clip at (9,254) size 419x68
+  LayoutTextControl {TEXTAREA} at (0,225) size 421x70 [bgcolor=#FFFFFF] [border: (1px solid #A9A9A9)]
+    LayoutBlockFlow {DIV} at (3,3) size 415x48
+      LayoutText {#text} at (375,0) size 40x16
+        text run at (375,0) width 40 RTL: "\x{5E9}\x{5DC}\x{5D5}\x{5DD}!"
+      LayoutBR {BR} at (375,0) size 0x16
+      LayoutText {#text} at (0,16) size 48x16
+        text run at (0,16) width 48: "hello!"
+      LayoutBR {BR} at (48,16) size 0x16
+      LayoutBR {BR} at (0,32) size 0x16
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text/international/wrap-CJK-001-expected.png b/third_party/WebKit/LayoutTests/platform/android/fast/text/international/wrap-CJK-001-expected.png
new file mode 100644
index 0000000..22d60c6b
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text/international/wrap-CJK-001-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text/justified-selection-at-edge-expected.txt b/third_party/WebKit/LayoutTests/platform/android/fast/text/justified-selection-at-edge-expected.txt
new file mode 100644
index 0000000..1215751
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text/justified-selection-at-edge-expected.txt
@@ -0,0 +1,28 @@
+layer at (0,0) size 800x600
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  LayoutBlockFlow {HTML} at (0,0) size 800x600
+    LayoutBlockFlow {BODY} at (8,8) size 784x576
+      LayoutBlockFlow {P} at (0,0) size 784x20
+        LayoutText {#text} at (0,0) size 370x19
+          text run at (0,0) width 370: "Test for bug 13234, layout of selected justified text is broken."
+      LayoutBlockFlow {P} at (0,36) size 784x20
+        LayoutText {#text} at (0,0) size 238x19
+          text run at (0,0) width 238: "The two blue boxes should be identical."
+      LayoutBlockFlow {DIV} at (0,72) size 256x46 [border: (3px solid #0000FF)]
+        LayoutText {#text} at (3,3) size 128x19
+          text run at (3,3) width 128: "Lorem ipsum dolor si"
+        LayoutInline {SPAN} at (0,0) size 41x19 [color=#008000] [bgcolor=#FFFF00]
+          LayoutText {#text} at (131,3) size 41x19
+            text run at (131,3) width 41: "t amet,"
+        LayoutText {#text} at (172,3) size 250x39
+          text run at (172,3) width 81: " consectetuer"
+          text run at (3,23) width 84: "adipiscing elit."
+      LayoutBlockFlow (anonymous) at (0,118) size 784x20
+        LayoutBR {BR} at (0,0) size 0x19
+      LayoutBlockFlow {P} at (0,154) size 256x46 [border: (3px solid #0000FF)]
+        LayoutText {#text} at (3,3) size 250x39
+          text run at (3,3) width 250: "Lorem ipsum dolor sit amet, consectetuer"
+          text run at (3,23) width 84: "adipiscing elit."
+selection start: position 20 of child 0 {#text} of child 8 {P} of body
+selection end:   position 27 of child 0 {#text} of child 8 {P} of body
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text/justified-selection-expected.txt b/third_party/WebKit/LayoutTests/platform/android/fast/text/justified-selection-expected.txt
new file mode 100644
index 0000000..9300936f
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text/justified-selection-expected.txt
@@ -0,0 +1,33 @@
+layer at (0,0) size 800x600
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  LayoutBlockFlow {HTML} at (0,0) size 800x600
+    LayoutBlockFlow {BODY} at (8,8) size 784x584
+      LayoutBlockFlow {P} at (0,0) size 784x20
+        LayoutText {#text} at (0,0) size 101x19
+          text run at (0,0) width 101: "Test for revision "
+        LayoutInline {A} at (0,0) size 48x19 [color=#0000EE]
+          LayoutText {#text} at (101,0) size 48x19
+            text run at (101,0) width 48: "#20574"
+        LayoutText {#text} at (149,0) size 4x19
+          text run at (149,0) width 4: "."
+      LayoutBlockFlow {P} at (0,36) size 784x20
+        LayoutText {#text} at (0,0) size 238x19
+          text run at (0,0) width 238: "The two blue boxes should be identical."
+      LayoutBlockFlow {DIV} at (0,72) size 106x46 [border: (3px solid #0000FF)]
+        LayoutText {#text} at (3,3) size 9x19
+          text run at (3,3) width 9: "L"
+        LayoutInline {SPAN} at (0,0) size 41x19 [color=#008000] [bgcolor=#FFFF00]
+          LayoutText {#text} at (12,3) size 41x19
+            text run at (12,3) width 41: "o r"
+        LayoutText {#text} at (53,3) size 100x39
+          text run at (53,3) width 50: "e mi"
+          text run at (3,23) width 64: "psumdolor"
+      LayoutBlockFlow (anonymous) at (0,118) size 784x20
+        LayoutBR {BR} at (0,0) size 0x19
+      LayoutBlockFlow {DIV} at (0,138) size 106x46 [border: (3px solid #0000FF)]
+        LayoutText {#text} at (3,3) size 100x39
+          text run at (3,3) width 100: "Lo re mi"
+          text run at (3,23) width 64: "psumdolor"
+selection start: position 1 of child 0 {#text} of child 8 {DIV} of body
+selection end:   position 4 of child 0 {#text} of child 8 {DIV} of body
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text/letter-spacing-negative-opacity-expected.png b/third_party/WebKit/LayoutTests/platform/android/fast/text/letter-spacing-negative-opacity-expected.png
new file mode 100644
index 0000000..224beb27
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text/letter-spacing-negative-opacity-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text/letter-spacing-negative-opacity-expected.txt b/third_party/WebKit/LayoutTests/platform/android/fast/text/letter-spacing-negative-opacity-expected.txt
new file mode 100644
index 0000000..8fbda63
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text/letter-spacing-negative-opacity-expected.txt
@@ -0,0 +1,9 @@
+layer at (0,0) size 800x600
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  LayoutBlockFlow {HTML} at (0,0) size 800x600
+    LayoutBlockFlow {BODY} at (8,8) size 784x584
+layer at (8,8) size 272x167 transparent
+  LayoutBlockFlow (positioned) {DIV} at (8,8) size 272x167 [border: (1px solid #FF0000)]
+    LayoutText {#text} at (1,4) size 270x159
+      text run at (1,4) width 270: "Testing the bug"
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text/line-initial-and-final-swashes-expected.png b/third_party/WebKit/LayoutTests/platform/android/fast/text/line-initial-and-final-swashes-expected.png
new file mode 100644
index 0000000..66611878
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text/line-initial-and-final-swashes-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text/line-initial-and-final-swashes-expected.txt b/third_party/WebKit/LayoutTests/platform/android/fast/text/line-initial-and-final-swashes-expected.txt
new file mode 100644
index 0000000..44f5b44
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text/line-initial-and-final-swashes-expected.txt
@@ -0,0 +1,22 @@
+layer at (0,0) size 800x600
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  LayoutBlockFlow {HTML} at (0,0) size 800x600
+    LayoutBlockFlow {BODY} at (8,8) size 784x584
+      LayoutBlockFlow {P} at (0,0) size 784x20
+        LayoutText {#text} at (0,0) size 616x19
+          text run at (0,0) width 616: "The black text should be identical to, and overlap, the red text, so there should be no red pixels below."
+      LayoutBlockFlow {DIV} at (0,36) size 784x196
+        LayoutBlockFlow {DIV} at (0,0) size 784x170 [color=#FF0000]
+          LayoutText {#text} at (0,3) size 272x164
+            text run at (0,3) width 272: "v a\x{300} e"
+        LayoutBlockFlow {DIV} at (0,26) size 784x170
+          LayoutText {#text} at (0,3) size 272x164
+            text run at (0,3) width 272: "v \x{E0} e"
+      LayoutBlockFlow {DIV} at (0,232) size 784x190
+        LayoutBlockFlow {DIV} at (0,0) size 784x167 [color=#FF0000]
+          LayoutText {#text} at (0,3) size 272x161
+            text run at (0,3) width 272: "v a\x{300} e"
+        LayoutBlockFlow {DIV} at (0,23) size 784x167
+          LayoutText {#text} at (0,3) size 272x161
+            text run at (0,3) width 272: "v \x{E0} e"
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text/midword-break-after-breakable-char-expected.png b/third_party/WebKit/LayoutTests/platform/android/fast/text/midword-break-after-breakable-char-expected.png
new file mode 100644
index 0000000..995d988
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text/midword-break-after-breakable-char-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text/midword-break-after-breakable-char-expected.txt b/third_party/WebKit/LayoutTests/platform/android/fast/text/midword-break-after-breakable-char-expected.txt
new file mode 100644
index 0000000..b9c0b52
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text/midword-break-after-breakable-char-expected.txt
@@ -0,0 +1,63 @@
+layer at (0,0) size 800x600
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  LayoutBlockFlow {HTML} at (0,0) size 800x600
+    LayoutBlockFlow {BODY} at (8,8) size 784x576
+      LayoutBlockFlow {P} at (0,0) size 784x40
+        LayoutText {#text} at (0,0) size 51x19
+          text run at (0,0) width 51: "Test for "
+        LayoutInline {I} at (0,0) size 734x39
+          LayoutInline {A} at (0,0) size 305x19 [color=#0000EE]
+            LayoutText {#text} at (51,0) size 305x19
+              text run at (51,0) width 305: "http://bugs.webkit.org/show_bug.cgi?id=13156"
+          LayoutText {#text} at (356,0) size 734x39
+            text run at (356,0) width 4: " "
+            text run at (360,0) width 374: "REGRESSION (r19621): Pasting breakable content where"
+            text run at (0,20) width 502: "wrapped line is too long to fit in a textarea fails to draw a horizontal scrollbar"
+        LayoutText {#text} at (502,20) size 4x19
+          text run at (502,20) width 4: "."
+      LayoutBlockFlow {P} at (0,56) size 784x40
+        LayoutText {#text} at (0,0) size 774x39
+          text run at (0,0) width 774: "This tests that a line break will occur in the middle of the first word on a line if it\x{2019}s too long to fit on the line. The behavior is tested"
+          text run at (0,20) width 559: "after breakable characters (question mark and hyphen), after a space and after a soft hyphen."
+      LayoutBlockFlow {P} at (0,112) size 784x20
+        LayoutText {#text} at (0,0) size 244x19
+          text run at (0,0) width 244: "The following blocks should be identical."
+      LayoutBlockFlow (floating) {DIV} at (4,152) size 300x180 [bgcolor=#FFFFE0]
+        LayoutText {#text} at (0,0) size 300x179
+          text run at (0,0) width 176: "Curabiturpretium,quamquiss?"
+          text run at (0,20) width 300: "empermalesuada,estliberofeugiatlibero,velfringillao"
+          text run at (0,40) width 103: "rcinibhsedneque-"
+          text run at (0,60) width 295: "Quisqueeunullanonnisimolestieaccumsan.Etiamtell"
+          text run at (0,80) width 165: "usurna,laoreetac,laoreetnon"
+          text run at (0,100) width 294: "suscipitsed,sapien.Phasellusvehicula,sematposuer"
+          text run at (0,120) width 193: "evehicula,auguenibhmolestienisl\x{AD}" + hyphen string "-"
+          text run at (0,140) width 298: "necullamcorperlacusantevulputatepede.Nasceturri"
+          text run at (0,160) width 69: "diculusmus."
+      LayoutBlockFlow (floating) {DIV} at (312,152) size 300x180 [bgcolor=#FFFFE0]
+        LayoutText {#text} at (0,0) size 176x19
+          text run at (0,0) width 176: "Curabiturpretium,quamquiss?"
+        LayoutBR {BR} at (176,15) size 0x0
+        LayoutText {#text} at (0,20) size 279x19
+          text run at (0,20) width 279: "empermalesuada,estliberofeugiatlibero,velfringi"
+        LayoutBR {BR} at (279,35) size 0x0
+        LayoutText {#text} at (0,40) size 124x19
+          text run at (0,40) width 124: "llaorcinibhsedneque-"
+        LayoutBR {BR} at (124,55) size 0x0
+        LayoutText {#text} at (0,60) size 278x19
+          text run at (0,60) width 278: "Quisqueeunullanonnisimolestieaccumsan.Etiam"
+        LayoutBR {BR} at (278,75) size 0x0
+        LayoutText {#text} at (0,80) size 182x19
+          text run at (0,80) width 182: "tellusurna,laoreetac,laoreetnon"
+        LayoutBR {BR} at (182,95) size 0x0
+        LayoutText {#text} at (0,100) size 282x19
+          text run at (0,100) width 282: "suscipitsed,sapien.Phasellusvehicula,sematposu"
+        LayoutBR {BR} at (282,115) size 0x0
+        LayoutText {#text} at (0,120) size 205x19
+          text run at (0,120) width 205: "erevehicula,auguenibhmolestienisl-"
+        LayoutBR {BR} at (205,135) size 0x0
+        LayoutText {#text} at (0,140) size 285x19
+          text run at (0,140) width 285: "necullamcorperlacusantevulputatepede.Nascetu"
+        LayoutBR {BR} at (285,155) size 0x0
+        LayoutText {#text} at (0,160) size 82x19
+          text run at (0,160) width 82: "rridiculusmus."
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text/monospace-width-cache-expected.png b/third_party/WebKit/LayoutTests/platform/android/fast/text/monospace-width-cache-expected.png
new file mode 100644
index 0000000..87572eb
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text/monospace-width-cache-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text/monospace-width-cache-expected.txt b/third_party/WebKit/LayoutTests/platform/android/fast/text/monospace-width-cache-expected.txt
new file mode 100644
index 0000000..612d89c8
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text/monospace-width-cache-expected.txt
@@ -0,0 +1,26 @@
+layer at (0,0) size 800x600
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  LayoutBlockFlow {HTML} at (0,0) size 800x600
+    LayoutBlockFlow {BODY} at (8,8) size 784x576
+      LayoutBlockFlow {P} at (0,0) size 784x40
+        LayoutText {#text} at (0,0) size 306x19
+          text run at (0,0) width 306: "Test for monospace width cache bug mentioned in "
+        LayoutInline {A} at (0,0) size 66x19 [color=#0000EE]
+          LayoutText {#text} at (306,0) size 66x19
+            text run at (306,0) width 66: "bug 11197"
+        LayoutText {#text} at (372,0) size 4x19
+          text run at (372,0) width 4: " "
+        LayoutInline {I} at (0,0) size 777x39
+          LayoutText {#text} at (376,0) size 777x39
+            text run at (376,0) width 401: "REGRESSION: Specifying a counter for a CODE tag's content"
+            text run at (0,20) width 303: "style property on before or after causes a crash"
+        LayoutText {#text} at (303,20) size 4x19
+          text run at (303,20) width 4: "."
+      LayoutBlockFlow {P} at (0,56) size 784x20
+        LayoutText {#text} at (0,0) size 347x19
+          text run at (0,0) width 347: "The blue line and the black line should be the same length."
+      LayoutBlockFlow {P} at (0,92) size 784x18
+        LayoutInline {SPAN} at (0,0) size 120x19 [border: none (1px solid #0000FF) none]
+          LayoutText {#text} at (0,0) size 120x18
+            text run at (0,0) width 120: "\x{2500}\x{2500}\x{2500}\x{2500}\x{2500}\x{2500}\x{2500}\x{2500}\x{2500}\x{2500}\x{2500}\x{2500}"
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text/reset-emptyRun-expected.png b/third_party/WebKit/LayoutTests/platform/android/fast/text/reset-emptyRun-expected.png
new file mode 100644
index 0000000..6248d38
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text/reset-emptyRun-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text/reset-emptyRun-expected.txt b/third_party/WebKit/LayoutTests/platform/android/fast/text/reset-emptyRun-expected.txt
new file mode 100644
index 0000000..c03120b9
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text/reset-emptyRun-expected.txt
@@ -0,0 +1,41 @@
+layer at (0,0) size 800x600
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  LayoutBlockFlow {HTML} at (0,0) size 800x600
+    LayoutBlockFlow {BODY} at (8,8) size 784x584
+      LayoutBlockFlow {P} at (0,0) size 784x20
+        LayoutText {#text} at (0,0) size 51x19
+          text run at (0,0) width 51: "Test for "
+        LayoutInline {I} at (0,0) size 716x19
+          LayoutInline {A} at (0,0) size 305x19 [color=#0000EE]
+            LayoutText {#text} at (51,0) size 305x19
+              text run at (51,0) width 305: "http://bugs.webkit.org/show_bug.cgi?id=14758"
+          LayoutText {#text} at (356,0) size 411x19
+            text run at (356,0) width 4: " "
+            text run at (360,0) width 407: "REGRESSION: Repeated text after line break on facebook.com"
+        LayoutText {#text} at (767,0) size 4x19
+          text run at (767,0) width 4: "."
+      LayoutBlockFlow {P} at (0,36) size 784x20
+        LayoutText {#text} at (0,0) size 221x19
+          text run at (0,0) width 221: "These two boxes should be identical:"
+      LayoutBlockFlow {DIV} at (0,72) size 76x66 [border: (3px solid #000000)]
+        LayoutBlockFlow (anonymous) at (3,3) size 70x40
+          LayoutText {#text} at (0,0) size 40x19
+            text run at (0,0) width 40: "Lorem"
+          LayoutInline {SPAN} at (0,0) size 35x19
+            LayoutText {#text} at (0,20) size 35x19
+              text run at (0,20) width 35: "ipsum"
+          LayoutText {#text} at (0,0) size 0x0
+        LayoutBlockFlow {DIV} at (3,43) size 70x20
+          LayoutText {#text} at (0,0) size 32x19
+            text run at (0,0) width 32: "dolor"
+      LayoutBlockFlow (anonymous) at (0,138) size 784x20
+        LayoutBR {BR} at (0,0) size 0x19
+      LayoutBlockFlow {DIV} at (0,158) size 76x66 [border: (3px solid #000000)]
+        LayoutBlockFlow (anonymous) at (3,3) size 70x40
+          LayoutText {#text} at (0,0) size 40x39
+            text run at (0,0) width 40: "Lorem"
+            text run at (0,20) width 35: "ipsum"
+        LayoutBlockFlow {DIV} at (3,43) size 70x20
+          LayoutText {#text} at (0,0) size 32x19
+            text run at (0,0) width 32: "dolor"
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text/selection-hard-linebreak-expected.txt b/third_party/WebKit/LayoutTests/platform/android/fast/text/selection-hard-linebreak-expected.txt
new file mode 100644
index 0000000..bf7e2331
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text/selection-hard-linebreak-expected.txt
@@ -0,0 +1,170 @@
+layer at (0,0) size 800x600
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  LayoutBlockFlow {HTML} at (0,0) size 800x600
+    LayoutBlockFlow {BODY} at (8,8) size 784x584
+      LayoutBlockFlow {P} at (0,0) size 784x40
+        LayoutText {#text} at (0,0) size 51x19
+          text run at (0,0) width 51: "Test for "
+        LayoutInline {I} at (0,0) size 777x39
+          LayoutInline {A} at (0,0) size 305x19 [color=#0000EE]
+            LayoutText {#text} at (51,0) size 305x19
+              text run at (51,0) width 305: "http://bugs.webkit.org/show_bug.cgi?id=13153"
+          LayoutText {#text} at (356,0) size 777x39
+            text run at (356,0) width 4: " "
+            text run at (360,0) width 417: "REGRESSION: Visual highlighting of pre-populated blank line in"
+            text run at (0,20) width 117: "textarea is broken"
+        LayoutText {#text} at (117,20) size 4x19
+          text run at (117,20) width 4: "."
+      LayoutBlockFlow {P} at (0,56) size 784x20
+        LayoutText {#text} at (0,0) size 310x19
+          text run at (0,0) width 310: "Testing the highlighting of and near hard line breaks."
+      LayoutBlockFlow (anonymous) at (0,92) size 784x80
+        LayoutText {#text} at (0,0) size 0x0
+      LayoutBlockFlow {P} at (0,188) size 784x20
+        LayoutText {#text} at (0,0) size 291x19
+          text run at (0,0) width 291: "Testing the highlighting of text split across boxes."
+      LayoutBlockFlow (anonymous) at (0,224) size 784x80
+        LayoutText {#text} at (0,0) size 0x0
+layer at (12,104) size 62x72
+  LayoutIFrame {IFRAME} at (4,4) size 62x72 [border: (1px solid #0000FF)]
+    layer at (0,0) size 60x70
+      LayoutView at (0,0) size 60x70
+    layer at (0,0) size 60x70
+      LayoutBlockFlow {HTML} at (0,0) size 60x70
+        LayoutBlockFlow {BODY} at (8,8) size 44x54
+          LayoutBlockFlow {PRE} at (0,0) size 44x48
+            LayoutText {#text} at (0,0) size 24x48
+              text run at (0,0) width 24: "foo"
+              text run at (24,0) width 0: " "
+              text run at (0,16) width 0: " "
+              text run at (0,32) width 24: "bar"
+layer at (82,104) size 62x72
+  LayoutIFrame {IFRAME} at (74,4) size 62x72 [border: (1px solid #0000FF)]
+    layer at (0,0) size 60x70
+      LayoutView at (0,0) size 60x70
+    layer at (0,0) size 60x70
+      LayoutBlockFlow {HTML} at (0,0) size 60x70
+        LayoutBlockFlow {BODY} at (8,8) size 44x54
+          LayoutBlockFlow {PRE} at (0,0) size 44x48
+            LayoutText {#text} at (0,0) size 24x48
+              text run at (0,0) width 24: "foo"
+              text run at (24,0) width 0: " "
+              text run at (0,16) width 0: " "
+              text run at (0,32) width 24: "bar"
+layer at (152,104) size 62x72
+  LayoutIFrame {IFRAME} at (144,4) size 62x72 [border: (1px solid #0000FF)]
+    layer at (0,0) size 60x70
+      LayoutView at (0,0) size 60x70
+    layer at (0,0) size 60x70
+      LayoutBlockFlow {HTML} at (0,0) size 60x70
+        LayoutBlockFlow {BODY} at (8,8) size 44x54
+          LayoutBlockFlow {PRE} at (0,0) size 44x48
+            LayoutText {#text} at (0,0) size 24x48
+              text run at (0,0) width 24: "foo"
+              text run at (24,0) width 0: " "
+              text run at (0,16) width 0: " "
+              text run at (0,32) width 24: "bar"
+layer at (222,104) size 62x72
+  LayoutIFrame {IFRAME} at (214,4) size 62x72 [border: (1px solid #0000FF)]
+    layer at (0,0) size 60x70
+      LayoutView at (0,0) size 60x70
+    layer at (0,0) size 60x70
+      LayoutBlockFlow {HTML} at (0,0) size 60x70
+        LayoutBlockFlow {BODY} at (8,8) size 44x54
+          LayoutBlockFlow {PRE} at (0,0) size 44x48
+            LayoutText {#text} at (0,0) size 24x48
+              text run at (0,0) width 24: "foo"
+              text run at (24,0) width 0: " "
+              text run at (0,16) width 0: " "
+              text run at (0,32) width 24: "bar"
+layer at (292,104) size 62x72
+  LayoutIFrame {IFRAME} at (284,4) size 62x72 [border: (1px solid #0000FF)]
+    layer at (0,0) size 60x70
+      LayoutView at (0,0) size 60x70
+    layer at (0,0) size 60x70
+      LayoutBlockFlow {HTML} at (0,0) size 60x70
+        LayoutBlockFlow {BODY} at (8,8) size 44x54
+          LayoutBlockFlow {PRE} at (0,0) size 44x48
+            LayoutText {#text} at (0,0) size 24x48
+              text run at (0,0) width 24: "foo"
+              text run at (24,0) width 0: " "
+              text run at (0,16) width 0: " "
+              text run at (0,32) width 24: "bar"
+layer at (362,104) size 62x72
+  LayoutIFrame {IFRAME} at (354,4) size 62x72 [border: (1px solid #0000FF)]
+    layer at (0,0) size 60x70
+      LayoutView at (0,0) size 60x70
+    layer at (0,0) size 60x70
+      LayoutBlockFlow {HTML} at (0,0) size 60x70
+        LayoutBlockFlow {BODY} at (8,8) size 44x54
+          LayoutBlockFlow {PRE} at (0,0) size 44x48
+            LayoutText {#text} at (0,0) size 24x48
+              text run at (0,0) width 24: "foo"
+              text run at (24,0) width 0: " "
+              text run at (0,16) width 0: " "
+              text run at (0,32) width 24: "bar"
+layer at (432,104) size 62x72
+  LayoutIFrame {IFRAME} at (424,4) size 62x72 [border: (1px solid #0000FF)]
+    layer at (0,0) size 60x70
+      LayoutView at (0,0) size 60x70
+    layer at (0,0) size 60x70
+      LayoutBlockFlow {HTML} at (0,0) size 60x70
+        LayoutBlockFlow {BODY} at (8,8) size 44x54
+          LayoutBlockFlow {PRE} at (0,0) size 44x48
+            LayoutText {#text} at (0,0) size 24x48
+              text run at (0,0) width 24: "foo"
+              text run at (24,0) width 0: " "
+              text run at (0,16) width 0: " "
+              text run at (0,32) width 24: "bar"
+layer at (502,104) size 62x72
+  LayoutIFrame {IFRAME} at (494,4) size 62x72 [border: (1px solid #0000FF)]
+    layer at (0,0) size 60x70
+      LayoutView at (0,0) size 60x70
+    layer at (0,0) size 60x70
+      LayoutBlockFlow {HTML} at (0,0) size 60x70
+        LayoutBlockFlow {BODY} at (8,8) size 44x54
+          LayoutBlockFlow {PRE} at (0,0) size 44x48
+            LayoutText {#text} at (0,0) size 24x48
+              text run at (0,0) width 24: "foo"
+              text run at (24,0) width 0: " "
+              text run at (0,16) width 0: " "
+              text run at (0,32) width 24: "bar"
+layer at (572,104) size 62x72
+  LayoutIFrame {IFRAME} at (564,4) size 62x72 [border: (1px solid #0000FF)]
+    layer at (0,0) size 60x70
+      LayoutView at (0,0) size 60x70
+    layer at (0,0) size 60x70
+      LayoutBlockFlow {HTML} at (0,0) size 60x70
+        LayoutBlockFlow {BODY} at (8,8) size 44x54
+          LayoutBlockFlow {PRE} at (0,0) size 44x48
+            LayoutText {#text} at (0,0) size 24x48
+              text run at (0,0) width 24: "foo"
+              text run at (24,0) width 0: " "
+              text run at (0,16) width 0: " "
+              text run at (0,32) width 24: "bar"
+layer at (642,104) size 62x72
+  LayoutIFrame {IFRAME} at (634,4) size 62x72 [border: (1px solid #0000FF)]
+    layer at (0,0) size 60x70
+      LayoutView at (0,0) size 60x70
+    layer at (0,0) size 60x70
+      LayoutBlockFlow {HTML} at (0,0) size 60x70
+        LayoutBlockFlow {BODY} at (8,8) size 44x54
+          LayoutBlockFlow {PRE} at (0,0) size 44x48
+            LayoutText {#text} at (0,0) size 24x48
+              text run at (0,0) width 24: "foo"
+              text run at (24,0) width 0: " "
+              text run at (0,16) width 0: " "
+              text run at (0,32) width 24: "bar"
+layer at (12,236) size 130x72
+  LayoutIFrame {IFRAME} at (4,4) size 130x72 [border: (1px solid #0000FF)]
+    layer at (0,0) size 128x70
+      LayoutView at (0,0) size 128x70
+    layer at (0,0) size 128x70
+      LayoutBlockFlow {HTML} at (0,0) size 128x70
+        LayoutBlockFlow {BODY} at (8,8) size 112x54
+          LayoutBlockFlow {DIV} at (0,0) size 112x40
+            LayoutText {#text} at (0,0) size 79x39
+              text run at (0,0) width 44: "Lorem "
+              text run at (44,0) width 35: "ipsum"
+              text run at (0,20) width 32: "dolor"
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text/shadow-no-blur-expected.png b/third_party/WebKit/LayoutTests/platform/android/fast/text/shadow-no-blur-expected.png
new file mode 100644
index 0000000..5af387d8
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text/shadow-no-blur-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text/shadow-no-blur-expected.txt b/third_party/WebKit/LayoutTests/platform/android/fast/text/shadow-no-blur-expected.txt
new file mode 100644
index 0000000..d2bb086
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text/shadow-no-blur-expected.txt
@@ -0,0 +1,21 @@
+layer at (0,0) size 800x600
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  LayoutBlockFlow {HTML} at (0,0) size 800x600
+    LayoutBlockFlow {BODY} at (8,8) size 784x584
+      LayoutBlockFlow {DIV} at (0,0) size 784x285 [color=#0000007F]
+        LayoutBlockFlow {DIV} at (0,0) size 784x57
+          LayoutText {#text} at (0,1) size 244x55
+            text run at (0,1) width 244: "Text shadow"
+        LayoutBlockFlow {DIV} at (0,57) size 784x57
+          LayoutText {#text} at (0,1) size 244x55
+            text run at (0,1) width 244: "Text shadow"
+        LayoutBlockFlow {DIV} at (0,114) size 784x57
+          LayoutText {#text} at (0,1) size 244x55
+            text run at (0,1) width 244: "Text shadow"
+        LayoutBlockFlow {DIV} at (0,171) size 784x57
+          LayoutText {#text} at (0,1) size 244x55
+            text run at (0,1) width 244: "Text shadow"
+        LayoutBlockFlow {DIV} at (0,228) size 784x57
+          LayoutText {#text} at (0,1) size 244x55
+            text run at (0,1) width 244: "Text shadow"
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text/shadow-translucent-fill-expected.png b/third_party/WebKit/LayoutTests/platform/android/fast/text/shadow-translucent-fill-expected.png
new file mode 100644
index 0000000..7e08d883
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text/shadow-translucent-fill-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text/shadow-translucent-fill-expected.txt b/third_party/WebKit/LayoutTests/platform/android/fast/text/shadow-translucent-fill-expected.txt
new file mode 100644
index 0000000..f7e81f49
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text/shadow-translucent-fill-expected.txt
@@ -0,0 +1,54 @@
+layer at (0,0) size 800x600
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  LayoutBlockFlow {HTML} at (0,0) size 800x600
+    LayoutBlockFlow {BODY} at (8,8) size 784x576
+      LayoutBlockFlow {P} at (0,0) size 784x20
+        LayoutText {#text} at (0,0) size 568x19
+          text run at (0,0) width 452: "Test that the intensity of text-shadow does not depend on the transparency "
+          text run at (452,0) width 116: "of the text fill color."
+      LayoutBlockFlow {DIV} at (0,36) size 784x72
+        LayoutText {#text} at (0,0) size 48x24
+          text run at (0,0) width 48: "A "
+        LayoutInline {SPAN} at (0,0) size 24x24 [color=#00000000]
+          LayoutText {#text} at (48,0) size 24x24
+            text run at (48,0) width 24: "A"
+        LayoutText {#text} at (72,0) size 24x24
+          text run at (72,0) width 24: " "
+        LayoutInline {SPAN} at (0,0) size 24x24 [color=#00000019]
+          LayoutText {#text} at (96,0) size 24x24
+            text run at (96,0) width 24: "A"
+        LayoutText {#text} at (0,0) size 0x0
+      LayoutBlockFlow {P} at (0,124) size 784x20
+        LayoutText {#text} at (0,0) size 381x19
+          text run at (0,0) width 381: "There should be three identical green squares on the line above."
+      LayoutBlockFlow {DIV} at (0,160) size 784x72
+        LayoutText {#text} at (0,0) size 48x24
+          text run at (0,0) width 48: "A "
+        LayoutInline {SPAN} at (0,0) size 24x24 [color=#00000000]
+          LayoutText {#text} at (48,0) size 24x24
+            text run at (48,0) width 24: "A"
+        LayoutText {#text} at (72,0) size 24x24
+          text run at (72,0) width 24: " "
+        LayoutInline {SPAN} at (0,0) size 24x24 [color=#00000019]
+          LayoutText {#text} at (96,0) size 24x24
+            text run at (96,0) width 24: "A"
+        LayoutText {#text} at (0,0) size 0x0
+      LayoutBlockFlow {P} at (0,248) size 784x20
+        LayoutText {#text} at (0,0) size 450x19
+          text run at (0,0) width 450: "There should be three identical soft-edged green squares on the line above."
+      LayoutBlockFlow {DIV} at (0,284) size 784x72 [textStrokeColor=#0000FF] [textStrokeWidth=5.00]
+        LayoutText {#text} at (0,0) size 48x24
+          text run at (0,0) width 48: "A "
+        LayoutInline {SPAN} at (0,0) size 24x24 [color=#00000000]
+          LayoutText {#text} at (48,0) size 24x24
+            text run at (48,0) width 24: "A"
+        LayoutText {#text} at (72,0) size 24x24
+          text run at (72,0) width 24: " "
+        LayoutInline {SPAN} at (0,0) size 24x24 [color=#00000019]
+          LayoutText {#text} at (96,0) size 24x24
+            text run at (96,0) width 24: "A"
+        LayoutText {#text} at (0,0) size 0x0
+      LayoutBlockFlow {P} at (0,372) size 784x20
+        LayoutText {#text} at (0,0) size 381x19
+          text run at (0,0) width 381: "There should be three identical green squares on the line above."
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text/shaping/shaping-selection-rect-expected.txt b/third_party/WebKit/LayoutTests/platform/android/fast/text/shaping/shaping-selection-rect-expected.txt
new file mode 100644
index 0000000..331e3bfe
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text/shaping/shaping-selection-rect-expected.txt
@@ -0,0 +1,26 @@
+layer at (0,0) size 800x600
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  LayoutBlockFlow {HTML} at (0,0) size 800x600
+    LayoutBlockFlow {BODY} at (8,8) size 784x584
+      LayoutBlockFlow {P} at (0,0) size 784x20
+        LayoutText {#text} at (0,0) size 615x19
+          text run at (0,0) width 615: "The selection should cover the all of the below text. There should be no blank between either C and F."
+      LayoutBlockFlow {DIV} at (0,36) size 784x20
+        LayoutText {#text} at (0,0) size 32x19
+          text run at (0,0) width 32: "ABC"
+        LayoutInline {SPAN} at (0,0) size 29x19
+          LayoutText {#text} at (32,0) size 29x19
+            text run at (32,0) width 29 RTL override: "DEF"
+        LayoutText {#text} at (61,0) size 27x19
+          text run at (61,0) width 27: "GHI"
+      LayoutBlockFlow {DIV} at (0,56) size 784x20
+        LayoutText {#text} at (0,0) size 32x19
+          text run at (0,0) width 32: "ABC"
+        LayoutInline {SPAN} at (0,0) size 29x19
+          LayoutText {#text} at (32,0) size 29x19
+            text run at (32,0) width 29 RTL override: "DEF"
+        LayoutText {#text} at (61,0) size 27x19
+          text run at (61,0) width 27: "GHI"
+selection start: position 1 of child 0 {#text} of child 2 {DIV} of body
+selection end:   position 3 of child 2 {#text} of child 4 {DIV} of body
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text/should-use-atsui-expected.txt b/third_party/WebKit/LayoutTests/platform/android/fast/text/should-use-atsui-expected.txt
new file mode 100644
index 0000000..95abf48
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text/should-use-atsui-expected.txt
@@ -0,0 +1,25 @@
+layer at (0,0) size 800x600
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  LayoutBlockFlow {HTML} at (0,0) size 800x600
+    LayoutBlockFlow {BODY} at (8,8) size 784x584
+      LayoutBlockFlow {P} at (0,0) size 784x40
+        LayoutText {#text} at (0,0) size 51x19
+          text run at (0,0) width 51: "Test for "
+        LayoutInline {I} at (0,0) size 743x39
+          LayoutText {#text} at (51,0) size 743x39
+            text run at (51,0) width 692: "http://bugzilla.opendarwin.org/show_bug.cgi?id=6132 Incorrect selection highlighting for ATSUI text when"
+            text run at (0,20) width 180: "selected range is \"CG-safe\""
+        LayoutText {#text} at (180,20) size 4x19
+          text run at (180,20) width 4: "."
+      LayoutBlockFlow {P} at (0,56) size 784x20
+        LayoutText {#text} at (0,0) size 664x19
+          text run at (0,0) width 664: "The word \x{201C}dolor\x{201D} below should be highlighted in its entirety. The highlight should not extend beyond that word."
+      LayoutBlockFlow {HR} at (0,92) size 784x2 [border: (1px inset #EEEEEE)]
+      LayoutBlockFlow (anonymous) at (0,102) size 784x20
+        LayoutInline {SPAN} at (0,0) size 165x19
+          LayoutText {#text} at (0,0) size 165x19
+            text run at (0,0) width 165: "Lo\x{308}re\x{300}m ipsum dolor sit amet"
+        LayoutText {#text} at (0,0) size 0x0
+selection start: position 14 of child 0 {#text} of child 7 {SPAN} of body
+selection end:   position 19 of child 0 {#text} of child 7 {SPAN} of body
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text/small-caps-turkish-expected.png b/third_party/WebKit/LayoutTests/platform/android/fast/text/small-caps-turkish-expected.png
new file mode 100644
index 0000000..13b48ccc
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text/small-caps-turkish-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text/small-caps-turkish-expected.txt b/third_party/WebKit/LayoutTests/platform/android/fast/text/small-caps-turkish-expected.txt
new file mode 100644
index 0000000..97f164a
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text/small-caps-turkish-expected.txt
@@ -0,0 +1,93 @@
+layer at (0,0) size 800x600
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x412
+  LayoutBlockFlow {HTML} at (0,0) size 800x412
+    LayoutBlockFlow {BODY} at (8,16) size 784x380
+      LayoutBlockFlow {P} at (0,0) size 784x20
+        LayoutText {#text} at (0,0) size 60x19
+          text run at (0,0) width 60: "locale=tr: "
+        LayoutInline {SPAN} at (0,0) size 42x19
+          LayoutText {#text} at (60,0) size 42x19
+            text run at (60,0) width 42: "Isi\x{130} \x{130}s\x{131}I"
+        LayoutText {#text} at (102,0) size 7x19
+          text run at (102,0) width 7: " :"
+      LayoutBlockFlow {P} at (0,36) size 784x20
+        LayoutText {#text} at (0,0) size 87x19
+          text run at (0,0) width 87: "locale=tr_TR: "
+        LayoutInline {SPAN} at (0,0) size 42x19
+          LayoutText {#text} at (87,0) size 42x19
+            text run at (87,0) width 42: "Isi\x{130} \x{130}s\x{131}I"
+        LayoutText {#text} at (129,0) size 7x19
+          text run at (129,0) width 7: " :"
+      LayoutBlockFlow {P} at (0,72) size 784x20
+        LayoutText {#text} at (0,0) size 85x19
+          text run at (0,0) width 85: "locale=tr-TR: "
+        LayoutInline {SPAN} at (0,0) size 42x19
+          LayoutText {#text} at (85,0) size 42x19
+            text run at (85,0) width 42: "Isi\x{130} \x{130}s\x{131}I"
+        LayoutText {#text} at (127,0) size 7x19
+          text run at (127,0) width 7: " :"
+      LayoutBlockFlow {P} at (0,108) size 784x20
+        LayoutText {#text} at (0,0) size 124x19
+          text run at (0,0) width 124: "locale=tr@foo=bar: "
+        LayoutInline {SPAN} at (0,0) size 42x19
+          LayoutText {#text} at (124,0) size 42x19
+            text run at (124,0) width 42: "Isi\x{130} \x{130}s\x{131}I"
+        LayoutText {#text} at (166,0) size 7x19
+          text run at (166,0) width 7: " :"
+      LayoutBlockFlow {P} at (0,144) size 784x20
+        LayoutText {#text} at (0,0) size 64x19
+          text run at (0,0) width 64: "locale=az: "
+        LayoutInline {SPAN} at (0,0) size 42x19
+          LayoutText {#text} at (64,0) size 42x19
+            text run at (64,0) width 42: "Isi\x{130} \x{130}s\x{131}I"
+        LayoutText {#text} at (106,0) size 7x19
+          text run at (106,0) width 7: " :"
+      LayoutBlockFlow {P} at (0,180) size 784x20
+        LayoutText {#text} at (0,0) size 92x19
+          text run at (0,0) width 92: "locale=az_AZ: "
+        LayoutInline {SPAN} at (0,0) size 42x19
+          LayoutText {#text} at (92,0) size 42x19
+            text run at (92,0) width 42: "Isi\x{130} \x{130}s\x{131}I"
+        LayoutText {#text} at (134,0) size 7x19
+          text run at (134,0) width 7: " :"
+      LayoutBlockFlow {P} at (0,216) size 784x20
+        LayoutText {#text} at (0,0) size 90x19
+          text run at (0,0) width 90: "locale=az-AZ: "
+        LayoutInline {SPAN} at (0,0) size 42x19
+          LayoutText {#text} at (90,0) size 42x19
+            text run at (90,0) width 42: "Isi\x{130} \x{130}s\x{131}I"
+        LayoutText {#text} at (132,0) size 7x19
+          text run at (132,0) width 7: " :"
+      LayoutBlockFlow {P} at (0,252) size 784x20
+        LayoutText {#text} at (0,0) size 128x19
+          text run at (0,0) width 128: "locale=az@foo=bar: "
+        LayoutInline {SPAN} at (0,0) size 42x19
+          LayoutText {#text} at (128,0) size 42x19
+            text run at (128,0) width 42: "Isi\x{130} \x{130}s\x{131}I"
+        LayoutText {#text} at (170,0) size 7x19
+          text run at (170,0) width 7: " :"
+      LayoutBlockFlow {P} at (0,288) size 784x20
+        LayoutText {#text} at (0,0) size 86x19
+          text run at (0,0) width 86: "locale=tr-US: "
+        LayoutInline {SPAN} at (0,0) size 42x19
+          LayoutText {#text} at (86,0) size 42x19
+            text run at (86,0) width 42: "Isi\x{130} \x{130}s\x{131}I"
+        LayoutText {#text} at (128,0) size 7x19
+          text run at (128,0) width 7: " :"
+      LayoutBlockFlow {P} at (0,324) size 784x20
+        LayoutText {#text} at (0,0) size 70x19
+          text run at (0,0) width 70: "locale=TR: "
+        LayoutInline {SPAN} at (0,0) size 42x19
+          LayoutText {#text} at (70,0) size 42x19
+            text run at (70,0) width 42: "Isi\x{130} \x{130}s\x{131}I"
+        LayoutText {#text} at (112,0) size 7x19
+          text run at (112,0) width 7: " :"
+      LayoutBlockFlow {P} at (0,360) size 784x20
+        LayoutText {#text} at (0,0) size 65x19
+          text run at (0,0) width 65: "locale=en: "
+        LayoutInline {SPAN} at (0,0) size 42x19
+          LayoutText {#text} at (65,0) size 42x19
+            text run at (65,0) width 42: "Isi\x{130} \x{130}s\x{131}I"
+        LayoutText {#text} at (107,0) size 7x19
+          text run at (107,0) width 7: " :"
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text/soft-hyphen-3-expected.png b/third_party/WebKit/LayoutTests/platform/android/fast/text/soft-hyphen-3-expected.png
new file mode 100644
index 0000000..aed6f3f
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text/soft-hyphen-3-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/fast/text/soft-hyphen-3-expected.txt b/third_party/WebKit/LayoutTests/platform/android/fast/text/soft-hyphen-3-expected.txt
similarity index 100%
rename from third_party/WebKit/LayoutTests/fast/text/soft-hyphen-3-expected.txt
rename to third_party/WebKit/LayoutTests/platform/android/fast/text/soft-hyphen-3-expected.txt
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text/softHyphen-expected.png b/third_party/WebKit/LayoutTests/platform/android/fast/text/softHyphen-expected.png
new file mode 100644
index 0000000..aab16f7
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text/softHyphen-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text/stroking-decorations-expected.txt b/third_party/WebKit/LayoutTests/platform/android/fast/text/stroking-decorations-expected.txt
new file mode 100644
index 0000000..8ada237
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text/stroking-decorations-expected.txt
@@ -0,0 +1,17 @@
+layer at (0,0) size 800x600
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  LayoutBlockFlow {HTML} at (0,0) size 800x600
+    LayoutBlockFlow {BODY} at (8,8) size 784x584
+      LayoutBlockFlow {DIV} at (0,0) size 784x152 [textFillColor=#800080] [textStrokeWidth=2.00]
+        LayoutText {#text} at (0,1) size 755x149
+          text run at (0,1) width 612: "Purple\x{300} fill, black stroke,"
+          text run at (0,77) width 755: "complex text, black underline"
+      LayoutBlockFlow {DIV} at (0,152) size 784x152 [textStrokeColor=#FFA500] [textStrokeWidth=1.33]
+        LayoutText {#text} at (0,1) size 633x149
+          text run at (0,1) width 633: "Orange stroke, black fill,"
+          text run at (0,77) width 412: "orange overline."
+      LayoutBlockFlow {DIV} at (0,304) size 784x152 [textFillColor=#0000FF] [textStrokeWidth=1.33]
+        LayoutText {#text} at (0,1) size 593x149
+          text run at (0,1) width 593: "No stroke, blue fill, red"
+          text run at (0,77) width 592: "shadow, blue underline"
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text/stroking-expected.txt b/third_party/WebKit/LayoutTests/platform/android/fast/text/stroking-expected.txt
new file mode 100644
index 0000000..edb953e
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text/stroking-expected.txt
@@ -0,0 +1,16 @@
+layer at (0,0) size 800x600
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  LayoutBlockFlow {HTML} at (0,0) size 800x600
+    LayoutBlockFlow {BODY} at (8,8) size 784x584
+      LayoutBlockFlow {DIV} at (0,0) size 784x152 [textFillColor=#800080] [textStrokeWidth=2.00]
+        LayoutText {#text} at (0,1) size 612x149
+          text run at (0,1) width 612: "Purple\x{300} fill, black stroke,"
+          text run at (0,77) width 330: "complex text"
+      LayoutBlockFlow {DIV} at (0,152) size 784x76 [textStrokeColor=#FFA500] [textStrokeWidth=1.33]
+        LayoutText {#text} at (0,1) size 633x73
+          text run at (0,1) width 633: "Orange stroke, black fill."
+      LayoutBlockFlow {DIV} at (0,228) size 784x152 [textStrokeColor=#0000FF] [textStrokeWidth=1.33]
+        LayoutText {#text} at (0,1) size 589x149
+          text run at (0,1) width 589: "Blue stroke, no fill, red"
+          text run at (0,77) width 211: "shadow."
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text/text-letter-spacing-expected.png b/third_party/WebKit/LayoutTests/platform/android/fast/text/text-letter-spacing-expected.png
new file mode 100644
index 0000000..08f3ddd
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text/text-letter-spacing-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text/text-shadow-no-default-color-expected.png b/third_party/WebKit/LayoutTests/platform/android/fast/text/text-shadow-no-default-color-expected.png
new file mode 100644
index 0000000..7c6dd8a2
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text/text-shadow-no-default-color-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text/text-shadow-no-default-color-expected.txt b/third_party/WebKit/LayoutTests/platform/android/fast/text/text-shadow-no-default-color-expected.txt
new file mode 100644
index 0000000..5492d64
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text/text-shadow-no-default-color-expected.txt
@@ -0,0 +1,11 @@
+layer at (0,0) size 800x600
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  LayoutBlockFlow {HTML} at (0,0) size 800x600
+    LayoutBlockFlow {BODY} at (8,8) size 784x567
+      LayoutBlockFlow {P} at (0,0) size 784x20
+        LayoutText {#text} at (0,0) size 344x19
+          text run at (0,0) width 344: "Test passes if there are two green rectangles on the page."
+      LayoutBlockFlow {DIV} at (25,45) size 734x30 [color=#008000]
+        LayoutText {#text} at (0,0) size 300x30
+          text run at (0,0) width 300: "FillerText"
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text/wbr-expected.png b/third_party/WebKit/LayoutTests/platform/android/fast/text/wbr-expected.png
new file mode 100644
index 0000000..6dc2e6d
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text/wbr-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text/wbr-styled-expected.png b/third_party/WebKit/LayoutTests/platform/android/fast/text/wbr-styled-expected.png
new file mode 100644
index 0000000..7bcdfec
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text/wbr-styled-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text/wbr-styled-expected.txt b/third_party/WebKit/LayoutTests/platform/android/fast/text/wbr-styled-expected.txt
new file mode 100644
index 0000000..c0842ed
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text/wbr-styled-expected.txt
@@ -0,0 +1,35 @@
+layer at (0,0) size 800x600
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  LayoutBlockFlow {HTML} at (0,0) size 800x600
+    LayoutBlockFlow {BODY} at (8,8) size 784x576
+      LayoutBlockFlow {P} at (0,0) size 784x20
+        LayoutText {#text} at (0,0) size 86x19
+          text run at (0,0) width 86: "This tests that "
+        LayoutInline {TT} at (0,0) size 24x16
+          LayoutText {#text} at (86,3) size 24x16
+            text run at (86,3) width 24: "WBR"
+        LayoutText {#text} at (110,0) size 286x19
+          text run at (110,0) width 286: " elements cannot be styled and that setting their "
+        LayoutInline {TT} at (0,0) size 64x16
+          LayoutText {#text} at (396,3) size 64x16
+            text run at (396,3) width 64: "position"
+        LayoutText {#text} at (460,0) size 20x19
+          text run at (460,0) width 20: " to "
+        LayoutInline {TT} at (0,0) size 64x16
+          LayoutText {#text} at (480,3) size 64x16
+            text run at (480,3) width 64: "absolute"
+        LayoutText {#text} at (544,0) size 149x19
+          text run at (544,0) width 149: " does not crash WebKit."
+      LayoutBlockFlow {P} at (0,36) size 784x20
+        LayoutText {#text} at (0,0) size 120x19
+          text run at (0,0) width 120: "There should be no "
+        LayoutWordBreak {WBR} at (0,0) size 0x0
+        LayoutText {#text} at (120,0) size 91x19
+          text run at (120,0) width 91: "red on this line."
+      LayoutBlockFlow {P} at (0,72) size 784x20
+        LayoutText {#text} at (0,0) size 119x19
+          text run at (0,0) width 119: "No crashing, please"
+        LayoutWordBreak {WBR} at (0,0) size 0x0
+        LayoutText {#text} at (119,0) size 4x19
+          text run at (119,0) width 4: "."
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text/webfont-synthetic-bold-expected.png b/third_party/WebKit/LayoutTests/platform/android/fast/text/webfont-synthetic-bold-expected.png
new file mode 100644
index 0000000..e9ba2b2
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text/webfont-synthetic-bold-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text/webfont-synthetic-bold-expected.txt b/third_party/WebKit/LayoutTests/platform/android/fast/text/webfont-synthetic-bold-expected.txt
new file mode 100644
index 0000000..3a25e10
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text/webfont-synthetic-bold-expected.txt
@@ -0,0 +1,19 @@
+layer at (0,0) size 800x600
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  LayoutBlockFlow {HTML} at (0,0) size 800x600
+    LayoutBlockFlow {BODY} at (8,8) size 784x576
+      LayoutBlockFlow {SECTION} at (0,0) size 784x96.91
+        LayoutBlockFlow {H1} at (0,0) size 784x33
+          LayoutText {#text} at (0,0) size 261x33
+            text run at (0,0) width 261: "Webfont Synthetic Bold"
+        LayoutBlockFlow {P} at (0,52.91) size 784x44
+          LayoutText {#text} at (0,0) size 32x22
+            text run at (0,0) width 32: "The "
+          LayoutInline {B} at (0,0) size 154x22
+            LayoutText {#text} at (32,0) size 154x22
+              text run at (32,0) width 154: "bold part of this text"
+          LayoutText {#text} at (186,0) size 753x44
+            text run at (186,0) width 272: " as well as the header above should "
+            text run at (458,0) width 295: "not be rendered nice and crisp without"
+            text run at (0,22) width 146: "being overly blurry."
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text/whitespace/003-expected.png b/third_party/WebKit/LayoutTests/platform/android/fast/text/whitespace/003-expected.png
new file mode 100644
index 0000000..affd143
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text/whitespace/003-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text/whitespace/003-expected.txt b/third_party/WebKit/LayoutTests/platform/android/fast/text/whitespace/003-expected.txt
new file mode 100644
index 0000000..e6a0bf6
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text/whitespace/003-expected.txt
@@ -0,0 +1,87 @@
+layer at (0,0) size 800x600
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x214
+  LayoutBlockFlow {HTML} at (0,0) size 800x214
+    LayoutBlockFlow {BODY} at (8,8) size 784x198
+      LayoutBlockFlow (anonymous) at (0,0) size 784x20
+        LayoutInline {DIV} at (0,0) size 528x16 [color=#FFFFFF] [bgcolor=#FF0000]
+          LayoutText {#text} at (0,2) size 528x16
+            text run at (0,2) width 528: "Ahem_font_required_for_this_test."
+        LayoutText {#text} at (0,0) size 0x0
+      LayoutBlockFlow {P} at (0,36) size 784x20
+        LayoutText {#text} at (0,0) size 608x19
+          text run at (0,0) width 608: "There should be three columns below, dark green, light green, and dark green, with no red anywhere."
+      LayoutTable {TABLE} at (0,72) size 66x126 [border: (3px solid #000000)]
+        LayoutTableSection {TBODY} at (3,3) size 60x120
+          LayoutTableRow {TR} at (0,0) size 60x120
+            LayoutTableCell {TD} at (0,0) size 60x120 [color=#FF0000] [bgcolor=#FF0000] [r=0 c=0 rs=1 cs=1]
+              LayoutBlockFlow {DIV} at (0,0) size 60x0
+              LayoutBlockFlow {DIV} at (0,0) size 60x0
+                LayoutBlockFlow {DIV} at (0,0) size 60x0
+              LayoutBlockFlow {DIV} at (0,0) size 60x0
+                LayoutBlockFlow {DIV} at (0,0) size 60x0
+              LayoutBlockFlow {DIV} at (0,0) size 60x0
+                LayoutBlockFlow {DIV} at (0,0) size 60x0
+              LayoutBlockFlow {DIV} at (0,0) size 60x0
+                LayoutBlockFlow {DIV} at (0,0) size 60x0
+              LayoutBlockFlow {DIV} at (0,0) size 60x0
+                LayoutBlockFlow {DIV} at (0,0) size 60x0
+              LayoutBlockFlow {DIV} at (0,0) size 60x0
+                LayoutBlockFlow {DIV} at (0,0) size 60x0
+              LayoutBlockFlow {DIV} at (0,0) size 60x0
+                LayoutBlockFlow {DIV} at (0,0) size 60x0
+              LayoutBlockFlow {DIV} at (0,0) size 60x20 [color=#008000] [bgcolor=#00FF00]
+                LayoutInline {SPAN} at (0,0) size 20x20
+                  LayoutText {#text} at (0,0) size 20x20
+                    text run at (0,0) width 20: "X"
+                LayoutText {#text} at (20,0) size 20x20
+                  text run at (20,0) width 20: " "
+                LayoutInline {SPAN} at (0,0) size 20x20
+                  LayoutText {#text} at (40,0) size 20x20
+                    text run at (40,0) width 20: "X"
+              LayoutBlockFlow {DIV} at (0,20) size 60x20 [color=#008000] [bgcolor=#00FF00]
+                LayoutInline {SPAN} at (0,0) size 20x20
+                  LayoutText {#text} at (0,0) size 20x20
+                    text run at (0,0) width 20: "X"
+                LayoutText {#text} at (20,0) size 20x20
+                  text run at (20,0) width 20: " "
+                LayoutInline {SPAN} at (0,0) size 20x20
+                  LayoutText {#text} at (40,0) size 20x20
+                    text run at (40,0) width 20: "X"
+              LayoutBlockFlow {DIV} at (0,40) size 60x20 [color=#008000] [bgcolor=#00FF00]
+                LayoutInline {SPAN} at (0,0) size 20x20
+                  LayoutText {#text} at (0,0) size 20x20
+                    text run at (0,0) width 20: "X"
+                LayoutText {#text} at (20,0) size 20x20
+                  text run at (20,0) width 20: " "
+                LayoutInline {SPAN} at (0,0) size 20x20
+                  LayoutText {#text} at (40,0) size 20x20
+                    text run at (40,0) width 20: "X"
+                LayoutText {#text} at (0,0) size 0x0
+              LayoutBlockFlow {DIV} at (0,60) size 60x20 [color=#008000] [bgcolor=#00FF00]
+                LayoutBlockFlow {DIV} at (0,0) size 60x0
+                LayoutBlockFlow (anonymous) at (0,0) size 60x20
+                  LayoutInline {SPAN} at (0,0) size 20x20
+                    LayoutText {#text} at (0,0) size 20x20
+                      text run at (0,0) width 20: "X"
+                  LayoutText {#text} at (20,0) size 20x20
+                    text run at (20,0) width 20: " "
+                  LayoutInline {SPAN} at (0,0) size 20x20
+                    LayoutText {#text} at (40,0) size 20x20
+                      text run at (40,0) width 20: "X"
+                  LayoutText {#text} at (0,0) size 0x0
+              LayoutBlockFlow {DIV} at (0,80) size 60x20 [color=#008000] [bgcolor=#00FF00]
+                LayoutBlockFlow (anonymous) at (0,0) size 60x20
+                  LayoutInline {SPAN} at (0,0) size 20x20
+                    LayoutText {#text} at (0,0) size 20x20
+                      text run at (0,0) width 20: "X"
+                  LayoutText {#text} at (20,0) size 20x20
+                    text run at (20,0) width 20: " "
+                  LayoutInline {SPAN} at (0,0) size 20x20
+                    LayoutText {#text} at (40,0) size 20x20
+                      text run at (40,0) width 20: "X"
+                  LayoutText {#text} at (0,0) size 0x0
+                LayoutBlockFlow {DIV} at (0,20) size 60x0
+              LayoutBlockFlow {DIV} at (0,100) size 60x20 [color=#008000] [bgcolor=#00FF00]
+                LayoutText {#text} at (0,0) size 60x20
+                  text run at (0,0) width 60: "X X"
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text/whitespace/004-expected.png b/third_party/WebKit/LayoutTests/platform/android/fast/text/whitespace/004-expected.png
new file mode 100644
index 0000000..eaa4acd
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text/whitespace/004-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text/whitespace/004-expected.txt b/third_party/WebKit/LayoutTests/platform/android/fast/text/whitespace/004-expected.txt
new file mode 100644
index 0000000..3c8c46b
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text/whitespace/004-expected.txt
@@ -0,0 +1,47 @@
+layer at (0,0) size 800x600
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x192
+  LayoutBlockFlow {HTML} at (0,0) size 800x192
+    LayoutBlockFlow {BODY} at (8,8) size 784x176
+      LayoutBlockFlow (anonymous) at (0,0) size 784x20
+        LayoutInline {DIV} at (0,0) size 528x16 [color=#FFFFFF] [bgcolor=#FF0000]
+          LayoutText {#text} at (0,2) size 528x16
+            text run at (0,2) width 528: "Ahem_font_required_for_this_test."
+        LayoutText {#text} at (0,0) size 0x0
+      LayoutBlockFlow {P} at (0,36) size 784x20
+        LayoutText {#text} at (0,0) size 421x19
+          text run at (0,0) width 421: "There should be no red below, only a green square bordered in green."
+      LayoutTable {TABLE} at (0,72) size 104x104
+        LayoutTableSection {TBODY} at (0,0) size 104x104
+          LayoutTableRow {TR} at (0,2) size 104x100
+            LayoutTableCell {TD} at (2,2) size 100x100 [color=#800000] [bgcolor=#FF0000] [r=0 c=0 rs=1 cs=1]
+              LayoutBlockFlow {DIV} at (0,0) size 100x20 [color=#008000]
+                LayoutText {#text} at (0,0) size 100x20
+                  text run at (0,0) width 100: "XXXXX"
+              LayoutBlockFlow {DIV} at (0,20) size 100x20 [color=#008000]
+                LayoutText {#text} at (0,0) size 20x20
+                  text run at (0,0) width 20: "X"
+                LayoutInline {SPAN} at (0,0) size 60x20 [bgcolor=#00FF00]
+                  LayoutText {#text} at (20,0) size 60x20
+                    text run at (20,0) width 60: "   "
+                LayoutText {#text} at (80,0) size 20x20
+                  text run at (80,0) width 20: "X"
+              LayoutBlockFlow {DIV} at (0,40) size 100x20 [color=#008000]
+                LayoutText {#text} at (0,0) size 20x20
+                  text run at (0,0) width 20: "X"
+                LayoutInline {SPAN} at (0,0) size 60x20 [bgcolor=#00FF00]
+                  LayoutText {#text} at (20,0) size 60x20
+                    text run at (20,0) width 60: "\x{200B} \x{200B} \x{200B} \x{200B}"
+                LayoutText {#text} at (80,0) size 20x20
+                  text run at (80,0) width 20: "X"
+              LayoutBlockFlow {DIV} at (0,60) size 100x20 [color=#008000]
+                LayoutText {#text} at (0,0) size 20x20
+                  text run at (0,0) width 20: "X"
+                LayoutInline {SPAN} at (0,0) size 60x20 [bgcolor=#00FF00]
+                  LayoutText {#text} at (20,0) size 60x20
+                    text run at (20,0) width 60: " \x{200B} \x{200B} "
+                LayoutText {#text} at (80,0) size 20x20
+                  text run at (80,0) width 20: "X"
+              LayoutBlockFlow {DIV} at (0,80) size 100x20 [color=#008000]
+                LayoutText {#text} at (0,0) size 100x20
+                  text run at (0,0) width 100: "XXXXX"
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text/whitespace/005-expected.png b/third_party/WebKit/LayoutTests/platform/android/fast/text/whitespace/005-expected.png
new file mode 100644
index 0000000..eaa4acd
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text/whitespace/005-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text/whitespace/005-expected.txt b/third_party/WebKit/LayoutTests/platform/android/fast/text/whitespace/005-expected.txt
new file mode 100644
index 0000000..d1c599dc
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text/whitespace/005-expected.txt
@@ -0,0 +1,35 @@
+layer at (0,0) size 800x600
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x192
+  LayoutBlockFlow {HTML} at (0,0) size 800x192
+    LayoutBlockFlow {BODY} at (8,8) size 784x176
+      LayoutBlockFlow (anonymous) at (0,0) size 784x20
+        LayoutInline {DIV} at (0,0) size 528x16 [color=#FFFFFF] [bgcolor=#FF0000]
+          LayoutText {#text} at (0,2) size 528x16
+            text run at (0,2) width 528: "Ahem_font_required_for_this_test."
+        LayoutText {#text} at (0,0) size 0x0
+      LayoutBlockFlow {P} at (0,36) size 784x20
+        LayoutText {#text} at (0,0) size 421x19
+          text run at (0,0) width 421: "There should be no red below, only a green square bordered in green."
+      LayoutTable {TABLE} at (0,72) size 104x104
+        LayoutTableSection {TBODY} at (0,0) size 104x104
+          LayoutTableRow {TR} at (0,2) size 104x100
+            LayoutTableCell {TD} at (2,2) size 100x100 [color=#800000] [bgcolor=#FF0000] [r=0 c=0 rs=1 cs=1]
+              LayoutBlockFlow {DIV} at (0,0) size 100x20 [color=#008000]
+                LayoutText {#text} at (0,0) size 100x20
+                  text run at (0,0) width 100: "XXXXX"
+              LayoutBlockFlow {DIV} at (0,20) size 100x20 [color=#008000]
+                LayoutInline {SPAN} at (0,0) size 100x20 [bgcolor=#00FF00]
+                  LayoutText {#text} at (0,0) size 100x20
+                    text run at (0,0) width 100: "X   X"
+              LayoutBlockFlow {DIV} at (0,40) size 100x20 [color=#008000]
+                LayoutInline {SPAN} at (0,0) size 100x20 [bgcolor=#00FF00]
+                  LayoutText {#text} at (0,0) size 100x20
+                    text run at (0,0) width 100: "X\x{200B} \x{200B} \x{200B} \x{200B}X"
+              LayoutBlockFlow {DIV} at (0,60) size 100x20 [color=#008000]
+                LayoutInline {SPAN} at (0,0) size 100x20 [bgcolor=#00FF00]
+                  LayoutText {#text} at (0,0) size 100x20
+                    text run at (0,0) width 100: "X \x{200B} \x{200B} X"
+              LayoutBlockFlow {DIV} at (0,80) size 100x20 [color=#008000]
+                LayoutText {#text} at (0,0) size 100x20
+                  text run at (0,0) width 100: "XXXXX"
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text/whitespace/006-expected.png b/third_party/WebKit/LayoutTests/platform/android/fast/text/whitespace/006-expected.png
new file mode 100644
index 0000000..0147614
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text/whitespace/006-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text/whitespace/006-expected.txt b/third_party/WebKit/LayoutTests/platform/android/fast/text/whitespace/006-expected.txt
new file mode 100644
index 0000000..0e387b11
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text/whitespace/006-expected.txt
@@ -0,0 +1,107 @@
+layer at (0,0) size 800x600
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x204
+  LayoutBlockFlow {HTML} at (0,0) size 800x204
+    LayoutBlockFlow {BODY} at (8,8) size 784x176
+      LayoutBlockFlow (anonymous) at (0,0) size 784x20
+        LayoutInline {DIV} at (0,0) size 528x16 [color=#FFFFFF] [bgcolor=#FF0000]
+          LayoutText {#text} at (16,2) size 528x16
+            text run at (16,2) width 528: "Ahem_font_required_for_this_test."
+        LayoutText {#text} at (0,0) size 0x0
+      LayoutBlockFlow {P} at (0,36) size 784x20
+        LayoutText {#text} at (0,0) size 471x19
+          text run at (0,0) width 471: "There should be no red below, only three identical striped green and lime bars."
+      LayoutBlockFlow {DIV} at (20,76) size 744x20
+        LayoutInline {SPAN} at (0,0) size 220x20 [color=#800000] [bgcolor=#FF0000]
+          LayoutText {#text} at (0,0) size 0x0
+          LayoutInline {SPAN} at (0,0) size 220x20 [color=#008000] [bgcolor=#00FF00]
+            LayoutText {#text} at (0,0) size 40x20
+              text run at (0,0) width 40: "X "
+            LayoutInline {SPAN} at (0,0) size 0x0 [color=#800000] [bgcolor=#FF0000]
+              LayoutInline {SPAN} at (0,0) size 0x0
+                LayoutText {#text} at (0,0) size 0x0
+                LayoutInline {SPAN} at (0,0) size 0x0
+                  LayoutText {#text} at (0,0) size 0x0
+              LayoutText {#text} at (0,0) size 0x0
+            LayoutText {#text} at (40,0) size 40x20
+              text run at (40,0) width 40: "X "
+            LayoutInline {SPAN} at (0,0) size 0x0 [color=#800000] [bgcolor=#FF0000]
+              LayoutText {#text} at (0,0) size 0x0
+            LayoutText {#text} at (80,0) size 20x20
+              text run at (80,0) width 20: "X"
+            LayoutInline {SPAN} at (0,0) size 20x20 [color=#800000] [bgcolor=#FF0000]
+              LayoutInline {SPAN} at (0,0) size 20x20
+                LayoutInline {SPAN} at (0,0) size 20x20 [color=#008000] [bgcolor=#00FF00]
+                  LayoutText {#text} at (100,0) size 20x20
+                    text run at (100,0) width 20: " "
+                LayoutInline {SPAN} at (0,0) size 0x0
+                  LayoutText {#text} at (0,0) size 0x0
+              LayoutText {#text} at (0,0) size 0x0
+            LayoutText {#text} at (120,0) size 40x20
+              text run at (120,0) width 40: "X "
+            LayoutInline {SPAN} at (0,0) size 0x0 [color=#800000] [bgcolor=#FF0000]
+              LayoutText {#text} at (0,0) size 0x0
+            LayoutText {#text} at (0,0) size 0x0
+            LayoutInline {SPAN} at (0,0) size 60x20
+              LayoutText {#text} at (160,0) size 20x20
+                text run at (160,0) width 20: "X"
+              LayoutInline {SPAN} at (0,0) size 20x20
+                LayoutText {#text} at (180,0) size 20x20
+                  text run at (180,0) width 20: " "
+                LayoutInline {SPAN} at (0,0) size 0x0 [color=#800000] [bgcolor=#FF0000]
+                  LayoutText {#text} at (0,0) size 0x0
+              LayoutInline {SPAN} at (0,0) size 0x0 [color=#800000] [bgcolor=#FF0000]
+                LayoutText {#text} at (0,0) size 0x0
+              LayoutText {#text} at (200,0) size 20x20
+                text run at (200,0) width 20: "X"
+              LayoutInline {SPAN} at (0,0) size 0x20 [color=#800000] [bgcolor=#FF0000]
+                LayoutText {#text} at (0,0) size 0x0
+      LayoutBlockFlow {DIV} at (20,116) size 744x20
+        LayoutInline {SPAN} at (0,0) size 220x20 [color=#800000] [bgcolor=#FF0000]
+          LayoutText {#text} at (0,0) size 0x0
+          LayoutInline {SPAN} at (0,0) size 220x20 [color=#008000] [bgcolor=#00FF00]
+            LayoutText {#text} at (0,0) size 40x20
+              text run at (0,0) width 40: "X "
+            LayoutInline {SPAN} at (0,0) size 0x0 [color=#800000] [bgcolor=#FF0000]
+              LayoutInline {SPAN} at (0,0) size 0x0
+                LayoutText {#text} at (0,0) size 0x0
+                LayoutInline {SPAN} at (0,0) size 0x0
+                  LayoutText {#text} at (0,0) size 0x0
+              LayoutText {#text} at (0,0) size 0x0
+            LayoutText {#text} at (40,0) size 40x20
+              text run at (40,0) width 40: "X "
+            LayoutInline {SPAN} at (0,0) size 0x0 [color=#800000] [bgcolor=#FF0000]
+              LayoutText {#text} at (0,0) size 0x0
+            LayoutText {#text} at (80,0) size 20x20
+              text run at (80,0) width 20: "X"
+            LayoutInline {SPAN} at (0,0) size 20x20 [color=#800000] [bgcolor=#FF0000]
+              LayoutInline {SPAN} at (0,0) size 20x20
+                LayoutInline {SPAN} at (0,0) size 20x20 [color=#008000] [bgcolor=#00FF00]
+                  LayoutText {#text} at (100,0) size 20x20
+                    text run at (100,0) width 20: " "
+                LayoutInline {SPAN} at (0,0) size 0x0
+                  LayoutText {#text} at (0,0) size 0x0
+              LayoutText {#text} at (0,0) size 0x0
+            LayoutText {#text} at (120,0) size 40x20
+              text run at (120,0) width 40: "X "
+            LayoutInline {SPAN} at (0,0) size 0x0 [color=#800000] [bgcolor=#FF0000]
+              LayoutText {#text} at (0,0) size 0x0
+            LayoutText {#text} at (0,0) size 0x0
+            LayoutInline {SPAN} at (0,0) size 60x20
+              LayoutText {#text} at (160,0) size 20x20
+                text run at (160,0) width 20: "X"
+              LayoutInline {SPAN} at (0,0) size 20x20
+                LayoutText {#text} at (180,0) size 20x20
+                  text run at (180,0) width 20: " "
+                LayoutInline {SPAN} at (0,0) size 0x0 [color=#800000] [bgcolor=#FF0000]
+                  LayoutText {#text} at (0,0) size 0x0
+              LayoutInline {SPAN} at (0,0) size 0x0 [color=#800000] [bgcolor=#FF0000]
+                LayoutText {#text} at (0,0) size 0x0
+              LayoutText {#text} at (200,0) size 20x20
+                text run at (200,0) width 20: "X"
+              LayoutInline {SPAN} at (0,0) size 0x20 [color=#800000] [bgcolor=#FF0000]
+                LayoutText {#text} at (0,0) size 0x0
+      LayoutBlockFlow {DIV} at (20,156) size 744x20
+        LayoutInline {SPAN} at (0,0) size 220x20 [color=#008000] [bgcolor=#00FF00]
+          LayoutText {#text} at (0,0) size 220x20
+            text run at (0,0) width 220: "X X X X X X"
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text/whitespace/007-expected.png b/third_party/WebKit/LayoutTests/platform/android/fast/text/whitespace/007-expected.png
new file mode 100644
index 0000000..ed1e221
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text/whitespace/007-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text/whitespace/007-expected.txt b/third_party/WebKit/LayoutTests/platform/android/fast/text/whitespace/007-expected.txt
new file mode 100644
index 0000000..e1ac76e
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text/whitespace/007-expected.txt
@@ -0,0 +1,48 @@
+layer at (0,0) size 800x600
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x164
+  LayoutBlockFlow {HTML} at (0,0) size 800x164
+    LayoutBlockFlow {BODY} at (8,8) size 784x136
+      LayoutBlockFlow (anonymous) at (0,0) size 784x20
+        LayoutInline {DIV} at (0,0) size 528x16 [color=#FFFFFF] [bgcolor=#FF0000]
+          LayoutText {#text} at (16,2) size 528x16
+            text run at (16,2) width 528: "Ahem_font_required_for_this_test."
+        LayoutText {#text} at (0,0) size 0x0
+      LayoutBlockFlow {P} at (0,36) size 784x20
+        LayoutText {#text} at (0,0) size 464x19
+          text run at (0,0) width 464: "There should be no red below, only two identical striped green and lime bars."
+      LayoutBlockFlow {DIV} at (20,76) size 744x20
+        LayoutInline {SPAN} at (0,0) size 220x20 [color=#800000] [bgcolor=#FF0000]
+          LayoutText {#text} at (0,0) size 0x0
+          LayoutInline {SPAN} at (0,0) size 40x20 [color=#008000] [bgcolor=#00FF00]
+            LayoutText {#text} at (0,0) size 40x20
+              text run at (0,0) width 40: "X "
+          LayoutText {#text} at (0,0) size 0x0
+          LayoutInline {SPAN} at (0,0) size 0x0
+            LayoutText {#text} at (0,0) size 0x0
+          LayoutText {#text} at (0,0) size 0x0
+          LayoutInline {SPAN} at (0,0) size 40x20 [color=#008000] [bgcolor=#00FF00]
+            LayoutText {#text} at (40,0) size 40x20
+              text run at (40,0) width 40: "X "
+          LayoutText {#text} at (0,0) size 0x0
+          LayoutInline {SPAN} at (0,0) size 40x20 [color=#008000] [bgcolor=#00FF00]
+            LayoutText {#text} at (80,0) size 40x20
+              text run at (80,0) width 40: "X "
+          LayoutText {#text} at (0,0) size 0x0
+          LayoutInline {SPAN} at (0,0) size 40x20 [color=#008000] [bgcolor=#00FF00]
+            LayoutText {#text} at (120,0) size 40x20
+              text run at (120,0) width 40: "X "
+          LayoutText {#text} at (0,0) size 0x0
+          LayoutInline {SPAN} at (0,0) size 20x20 [color=#008000] [bgcolor=#00FF00]
+            LayoutText {#text} at (160,0) size 20x20
+              text run at (160,0) width 20: "X"
+          LayoutInline {SPAN} at (0,0) size 40x20 [color=#008000] [bgcolor=#00FF00]
+            LayoutText {#text} at (180,0) size 40x20
+              text run at (180,0) width 40: " X"
+            LayoutInline {SPAN} at (0,0) size 0x20 [color=#800000] [bgcolor=#FF0000]
+              LayoutText {#text} at (0,0) size 0x0
+          LayoutText {#text} at (0,0) size 0x0
+      LayoutBlockFlow {DIV} at (20,116) size 744x20
+        LayoutInline {SPAN} at (0,0) size 220x20 [color=#008000] [bgcolor=#00FF00]
+          LayoutText {#text} at (0,0) size 220x20
+            text run at (0,0) width 220: "X X X X X X"
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text/whitespace/008-expected.png b/third_party/WebKit/LayoutTests/platform/android/fast/text/whitespace/008-expected.png
new file mode 100644
index 0000000..55b6746c
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text/whitespace/008-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text/whitespace/008-expected.txt b/third_party/WebKit/LayoutTests/platform/android/fast/text/whitespace/008-expected.txt
new file mode 100644
index 0000000..7a557cf3
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text/whitespace/008-expected.txt
@@ -0,0 +1,17 @@
+layer at (0,0) size 800x600
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x144
+  LayoutBlockFlow {HTML} at (0,0) size 800x144
+    LayoutBlockFlow {BODY} at (8,8) size 784x116
+      LayoutBlockFlow (anonymous) at (0,0) size 784x20
+        LayoutInline {DIV} at (0,0) size 528x16 [color=#FFFFFF] [bgcolor=#FF0000]
+          LayoutText {#text} at (16,2) size 528x16
+            text run at (16,2) width 528: "Ahem_font_required_for_this_test."
+        LayoutText {#text} at (0,0) size 0x0
+      LayoutBlockFlow {P} at (0,36) size 784x20
+        LayoutText {#text} at (0,0) size 275x19
+          text run at (0,0) width 275: "There should be a green block below, no red."
+      LayoutBlockFlow {DIV} at (20,76) size 80x40 [color=#008000] [bgcolor=#FF0000]
+        LayoutText {#text} at (0,0) size 80x40
+          text run at (0,0) width 80: "xxxx"
+          text run at (0,20) width 80: "xxxx"
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text/whitespace/009-expected.png b/third_party/WebKit/LayoutTests/platform/android/fast/text/whitespace/009-expected.png
new file mode 100644
index 0000000..ec31c8b
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text/whitespace/009-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text/whitespace/009-expected.txt b/third_party/WebKit/LayoutTests/platform/android/fast/text/whitespace/009-expected.txt
new file mode 100644
index 0000000..5ed455e
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text/whitespace/009-expected.txt
@@ -0,0 +1,18 @@
+layer at (0,0) size 800x600
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x108
+  LayoutBlockFlow {HTML} at (0,0) size 800x108
+    LayoutBlockFlow {BODY} at (8,8) size 784x92
+      LayoutBlockFlow (anonymous) at (0,0) size 784x20
+        LayoutInline {DIV} at (0,0) size 528x16 [color=#FFFFFF] [bgcolor=#FF0000]
+          LayoutText {#text} at (0,2) size 528x16
+            text run at (0,2) width 528: "Ahem_font_required_for_this_test."
+        LayoutText {#text} at (0,0) size 0x0
+      LayoutBlockFlow {P} at (0,36) size 784x20
+        LayoutText {#text} at (0,0) size 427x19
+          text run at (0,0) width 427: "There should be no red below, only a lime line with a green square in it."
+      LayoutBlockFlow {DIV} at (0,72) size 784x20
+        LayoutBlockFlow {DIV} at (0,0) size 200x20 [bgcolor=#FF0000]
+          LayoutBlockFlow {DIV} at (0,0) size 140x20 [color=#00FF00] [bgcolor=#008000]
+            LayoutText {#text} at (0,0) size 200x20
+              text run at (0,0) width 200: "xxx xxxxxx"
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text/whitespace/010-expected.png b/third_party/WebKit/LayoutTests/platform/android/fast/text/whitespace/010-expected.png
new file mode 100644
index 0000000..eaa4acd
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text/whitespace/010-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text/whitespace/010-expected.txt b/third_party/WebKit/LayoutTests/platform/android/fast/text/whitespace/010-expected.txt
new file mode 100644
index 0000000..3c8c46b
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text/whitespace/010-expected.txt
@@ -0,0 +1,47 @@
+layer at (0,0) size 800x600
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x192
+  LayoutBlockFlow {HTML} at (0,0) size 800x192
+    LayoutBlockFlow {BODY} at (8,8) size 784x176
+      LayoutBlockFlow (anonymous) at (0,0) size 784x20
+        LayoutInline {DIV} at (0,0) size 528x16 [color=#FFFFFF] [bgcolor=#FF0000]
+          LayoutText {#text} at (0,2) size 528x16
+            text run at (0,2) width 528: "Ahem_font_required_for_this_test."
+        LayoutText {#text} at (0,0) size 0x0
+      LayoutBlockFlow {P} at (0,36) size 784x20
+        LayoutText {#text} at (0,0) size 421x19
+          text run at (0,0) width 421: "There should be no red below, only a green square bordered in green."
+      LayoutTable {TABLE} at (0,72) size 104x104
+        LayoutTableSection {TBODY} at (0,0) size 104x104
+          LayoutTableRow {TR} at (0,2) size 104x100
+            LayoutTableCell {TD} at (2,2) size 100x100 [color=#800000] [bgcolor=#FF0000] [r=0 c=0 rs=1 cs=1]
+              LayoutBlockFlow {DIV} at (0,0) size 100x20 [color=#008000]
+                LayoutText {#text} at (0,0) size 100x20
+                  text run at (0,0) width 100: "XXXXX"
+              LayoutBlockFlow {DIV} at (0,20) size 100x20 [color=#008000]
+                LayoutText {#text} at (0,0) size 20x20
+                  text run at (0,0) width 20: "X"
+                LayoutInline {SPAN} at (0,0) size 60x20 [bgcolor=#00FF00]
+                  LayoutText {#text} at (20,0) size 60x20
+                    text run at (20,0) width 60: "   "
+                LayoutText {#text} at (80,0) size 20x20
+                  text run at (80,0) width 20: "X"
+              LayoutBlockFlow {DIV} at (0,40) size 100x20 [color=#008000]
+                LayoutText {#text} at (0,0) size 20x20
+                  text run at (0,0) width 20: "X"
+                LayoutInline {SPAN} at (0,0) size 60x20 [bgcolor=#00FF00]
+                  LayoutText {#text} at (20,0) size 60x20
+                    text run at (20,0) width 60: "\x{200B} \x{200B} \x{200B} \x{200B}"
+                LayoutText {#text} at (80,0) size 20x20
+                  text run at (80,0) width 20: "X"
+              LayoutBlockFlow {DIV} at (0,60) size 100x20 [color=#008000]
+                LayoutText {#text} at (0,0) size 20x20
+                  text run at (0,0) width 20: "X"
+                LayoutInline {SPAN} at (0,0) size 60x20 [bgcolor=#00FF00]
+                  LayoutText {#text} at (20,0) size 60x20
+                    text run at (20,0) width 60: " \x{200B} \x{200B} "
+                LayoutText {#text} at (80,0) size 20x20
+                  text run at (80,0) width 20: "X"
+              LayoutBlockFlow {DIV} at (0,80) size 100x20 [color=#008000]
+                LayoutText {#text} at (0,0) size 100x20
+                  text run at (0,0) width 100: "XXXXX"
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text/whitespace/011-expected.png b/third_party/WebKit/LayoutTests/platform/android/fast/text/whitespace/011-expected.png
new file mode 100644
index 0000000..eaa4acd
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text/whitespace/011-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text/whitespace/011-expected.txt b/third_party/WebKit/LayoutTests/platform/android/fast/text/whitespace/011-expected.txt
new file mode 100644
index 0000000..d1c599dc
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text/whitespace/011-expected.txt
@@ -0,0 +1,35 @@
+layer at (0,0) size 800x600
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x192
+  LayoutBlockFlow {HTML} at (0,0) size 800x192
+    LayoutBlockFlow {BODY} at (8,8) size 784x176
+      LayoutBlockFlow (anonymous) at (0,0) size 784x20
+        LayoutInline {DIV} at (0,0) size 528x16 [color=#FFFFFF] [bgcolor=#FF0000]
+          LayoutText {#text} at (0,2) size 528x16
+            text run at (0,2) width 528: "Ahem_font_required_for_this_test."
+        LayoutText {#text} at (0,0) size 0x0
+      LayoutBlockFlow {P} at (0,36) size 784x20
+        LayoutText {#text} at (0,0) size 421x19
+          text run at (0,0) width 421: "There should be no red below, only a green square bordered in green."
+      LayoutTable {TABLE} at (0,72) size 104x104
+        LayoutTableSection {TBODY} at (0,0) size 104x104
+          LayoutTableRow {TR} at (0,2) size 104x100
+            LayoutTableCell {TD} at (2,2) size 100x100 [color=#800000] [bgcolor=#FF0000] [r=0 c=0 rs=1 cs=1]
+              LayoutBlockFlow {DIV} at (0,0) size 100x20 [color=#008000]
+                LayoutText {#text} at (0,0) size 100x20
+                  text run at (0,0) width 100: "XXXXX"
+              LayoutBlockFlow {DIV} at (0,20) size 100x20 [color=#008000]
+                LayoutInline {SPAN} at (0,0) size 100x20 [bgcolor=#00FF00]
+                  LayoutText {#text} at (0,0) size 100x20
+                    text run at (0,0) width 100: "X   X"
+              LayoutBlockFlow {DIV} at (0,40) size 100x20 [color=#008000]
+                LayoutInline {SPAN} at (0,0) size 100x20 [bgcolor=#00FF00]
+                  LayoutText {#text} at (0,0) size 100x20
+                    text run at (0,0) width 100: "X\x{200B} \x{200B} \x{200B} \x{200B}X"
+              LayoutBlockFlow {DIV} at (0,60) size 100x20 [color=#008000]
+                LayoutInline {SPAN} at (0,0) size 100x20 [bgcolor=#00FF00]
+                  LayoutText {#text} at (0,0) size 100x20
+                    text run at (0,0) width 100: "X \x{200B} \x{200B} X"
+              LayoutBlockFlow {DIV} at (0,80) size 100x20 [color=#008000]
+                LayoutText {#text} at (0,0) size 100x20
+                  text run at (0,0) width 100: "XXXXX"
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text/whitespace/015-expected.png b/third_party/WebKit/LayoutTests/platform/android/fast/text/whitespace/015-expected.png
new file mode 100644
index 0000000..eaa4acd
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text/whitespace/015-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text/whitespace/015-expected.txt b/third_party/WebKit/LayoutTests/platform/android/fast/text/whitespace/015-expected.txt
new file mode 100644
index 0000000..3c8c46b
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text/whitespace/015-expected.txt
@@ -0,0 +1,47 @@
+layer at (0,0) size 800x600
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x192
+  LayoutBlockFlow {HTML} at (0,0) size 800x192
+    LayoutBlockFlow {BODY} at (8,8) size 784x176
+      LayoutBlockFlow (anonymous) at (0,0) size 784x20
+        LayoutInline {DIV} at (0,0) size 528x16 [color=#FFFFFF] [bgcolor=#FF0000]
+          LayoutText {#text} at (0,2) size 528x16
+            text run at (0,2) width 528: "Ahem_font_required_for_this_test."
+        LayoutText {#text} at (0,0) size 0x0
+      LayoutBlockFlow {P} at (0,36) size 784x20
+        LayoutText {#text} at (0,0) size 421x19
+          text run at (0,0) width 421: "There should be no red below, only a green square bordered in green."
+      LayoutTable {TABLE} at (0,72) size 104x104
+        LayoutTableSection {TBODY} at (0,0) size 104x104
+          LayoutTableRow {TR} at (0,2) size 104x100
+            LayoutTableCell {TD} at (2,2) size 100x100 [color=#800000] [bgcolor=#FF0000] [r=0 c=0 rs=1 cs=1]
+              LayoutBlockFlow {DIV} at (0,0) size 100x20 [color=#008000]
+                LayoutText {#text} at (0,0) size 100x20
+                  text run at (0,0) width 100: "XXXXX"
+              LayoutBlockFlow {DIV} at (0,20) size 100x20 [color=#008000]
+                LayoutText {#text} at (0,0) size 20x20
+                  text run at (0,0) width 20: "X"
+                LayoutInline {SPAN} at (0,0) size 60x20 [bgcolor=#00FF00]
+                  LayoutText {#text} at (20,0) size 60x20
+                    text run at (20,0) width 60: "   "
+                LayoutText {#text} at (80,0) size 20x20
+                  text run at (80,0) width 20: "X"
+              LayoutBlockFlow {DIV} at (0,40) size 100x20 [color=#008000]
+                LayoutText {#text} at (0,0) size 20x20
+                  text run at (0,0) width 20: "X"
+                LayoutInline {SPAN} at (0,0) size 60x20 [bgcolor=#00FF00]
+                  LayoutText {#text} at (20,0) size 60x20
+                    text run at (20,0) width 60: "\x{200B} \x{200B} \x{200B} \x{200B}"
+                LayoutText {#text} at (80,0) size 20x20
+                  text run at (80,0) width 20: "X"
+              LayoutBlockFlow {DIV} at (0,60) size 100x20 [color=#008000]
+                LayoutText {#text} at (0,0) size 20x20
+                  text run at (0,0) width 20: "X"
+                LayoutInline {SPAN} at (0,0) size 60x20 [bgcolor=#00FF00]
+                  LayoutText {#text} at (20,0) size 60x20
+                    text run at (20,0) width 60: " \x{200B} \x{200B} "
+                LayoutText {#text} at (80,0) size 20x20
+                  text run at (80,0) width 20: "X"
+              LayoutBlockFlow {DIV} at (0,80) size 100x20 [color=#008000]
+                LayoutText {#text} at (0,0) size 100x20
+                  text run at (0,0) width 100: "XXXXX"
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text/whitespace/016-expected.png b/third_party/WebKit/LayoutTests/platform/android/fast/text/whitespace/016-expected.png
new file mode 100644
index 0000000..eaa4acd
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text/whitespace/016-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text/whitespace/016-expected.txt b/third_party/WebKit/LayoutTests/platform/android/fast/text/whitespace/016-expected.txt
new file mode 100644
index 0000000..d1c599dc
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text/whitespace/016-expected.txt
@@ -0,0 +1,35 @@
+layer at (0,0) size 800x600
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x192
+  LayoutBlockFlow {HTML} at (0,0) size 800x192
+    LayoutBlockFlow {BODY} at (8,8) size 784x176
+      LayoutBlockFlow (anonymous) at (0,0) size 784x20
+        LayoutInline {DIV} at (0,0) size 528x16 [color=#FFFFFF] [bgcolor=#FF0000]
+          LayoutText {#text} at (0,2) size 528x16
+            text run at (0,2) width 528: "Ahem_font_required_for_this_test."
+        LayoutText {#text} at (0,0) size 0x0
+      LayoutBlockFlow {P} at (0,36) size 784x20
+        LayoutText {#text} at (0,0) size 421x19
+          text run at (0,0) width 421: "There should be no red below, only a green square bordered in green."
+      LayoutTable {TABLE} at (0,72) size 104x104
+        LayoutTableSection {TBODY} at (0,0) size 104x104
+          LayoutTableRow {TR} at (0,2) size 104x100
+            LayoutTableCell {TD} at (2,2) size 100x100 [color=#800000] [bgcolor=#FF0000] [r=0 c=0 rs=1 cs=1]
+              LayoutBlockFlow {DIV} at (0,0) size 100x20 [color=#008000]
+                LayoutText {#text} at (0,0) size 100x20
+                  text run at (0,0) width 100: "XXXXX"
+              LayoutBlockFlow {DIV} at (0,20) size 100x20 [color=#008000]
+                LayoutInline {SPAN} at (0,0) size 100x20 [bgcolor=#00FF00]
+                  LayoutText {#text} at (0,0) size 100x20
+                    text run at (0,0) width 100: "X   X"
+              LayoutBlockFlow {DIV} at (0,40) size 100x20 [color=#008000]
+                LayoutInline {SPAN} at (0,0) size 100x20 [bgcolor=#00FF00]
+                  LayoutText {#text} at (0,0) size 100x20
+                    text run at (0,0) width 100: "X\x{200B} \x{200B} \x{200B} \x{200B}X"
+              LayoutBlockFlow {DIV} at (0,60) size 100x20 [color=#008000]
+                LayoutInline {SPAN} at (0,0) size 100x20 [bgcolor=#00FF00]
+                  LayoutText {#text} at (0,0) size 100x20
+                    text run at (0,0) width 100: "X \x{200B} \x{200B} X"
+              LayoutBlockFlow {DIV} at (0,80) size 100x20 [color=#008000]
+                LayoutText {#text} at (0,0) size 100x20
+                  text run at (0,0) width 100: "XXXXX"
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text/whitespace/018-expected.png b/third_party/WebKit/LayoutTests/platform/android/fast/text/whitespace/018-expected.png
new file mode 100644
index 0000000..0a7cf57
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text/whitespace/018-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text/whitespace/018-expected.txt b/third_party/WebKit/LayoutTests/platform/android/fast/text/whitespace/018-expected.txt
new file mode 100644
index 0000000..d938de7
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text/whitespace/018-expected.txt
@@ -0,0 +1,107 @@
+layer at (0,0) size 800x600
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x216
+  LayoutBlockFlow {HTML} at (0,0) size 800x216
+    LayoutBlockFlow {BODY} at (8,8) size 784x200
+      LayoutBlockFlow (anonymous) at (0,0) size 784x20
+        LayoutInline {DIV} at (0,0) size 528x16 [color=#FFFFFF] [bgcolor=#FF0000]
+          LayoutText {#text} at (0,2) size 528x16
+            text run at (0,2) width 528: "Ahem_font_required_for_this_test."
+        LayoutText {#text} at (0,0) size 0x0
+      LayoutBlockFlow {P} at (0,36) size 784x20
+        LayoutText {#text} at (0,0) size 562x19
+          text run at (0,0) width 562: "There should be a pretty green and lime pattern and the word \"PASS\" in lime on white below."
+      LayoutBlockFlow {DIV} at (0,72) size 304x128 [color=#00FF00] [bgcolor=#008000]
+        LayoutText {#text} at (0,0) size 304x32
+          text run at (0,0) width 0: " "
+          text run at (0,16) width 304: "1234567890123456789"
+        LayoutInline {SPAN} at (0,0) size 304x32
+          LayoutText {#text} at (0,32) size 32x16
+            text run at (0,32) width 32: "x "
+          LayoutInline {SPAN} at (0,0) size 112x16
+            LayoutText {#text} at (32,32) size 32x16
+              text run at (32,32) width 32: "x "
+            LayoutInline {SPAN} at (0,0) size 0x0
+            LayoutText {#text} at (64,32) size 16x16
+              text run at (64,32) width 16: "x"
+            LayoutInline {SPAN} at (0,0) size 16x16
+              LayoutText {#text} at (80,32) size 16x16
+                text run at (80,32) width 16: " "
+            LayoutText {#text} at (96,32) size 48x16
+              text run at (96,32) width 48: "x x"
+          LayoutText {#text} at (144,32) size 48x16
+            text run at (144,32) width 48: " x "
+          LayoutInline {SPAN} at (0,0) size 64x16
+            LayoutText {#text} at (192,32) size 64x16
+              text run at (192,32) width 64: "x x "
+          LayoutText {#text} at (256,32) size 32x16
+            text run at (256,32) width 32: "x "
+          LayoutInline {SPAN} at (0,0) size 16x16
+            LayoutText {#text} at (288,32) size 16x16
+              text run at (288,32) width 16: "x"
+          LayoutText {#text} at (0,48) size 64x16
+            text run at (0,48) width 64: "1234"
+        LayoutText {#text} at (64,48) size 448x16
+          text run at (64,48) width 448: "567890123456789 xxxx xxxx xx"
+        LayoutInline {SPAN} at (0,0) size 112x16
+          LayoutText {#text} at (512,48) size 16x16
+            text run at (512,48) width 16: "x"
+          LayoutInline {SPAN} at (0,0) size 96x16
+            LayoutText {#text} at (528,48) size 96x16
+              text run at (528,48) width 96: "x xxxx"
+          LayoutText {#text} at (0,0) size 0x0
+        LayoutText {#text} at (0,64) size 16x16
+          text run at (0,64) width 16: "x"
+        LayoutInline {SPAN} at (0,0) size 112x16
+          LayoutText {#text} at (16,64) size 16x16
+            text run at (16,64) width 16: " "
+          LayoutInline {SPAN} at (0,0) size 16x16
+            LayoutText {#text} at (32,64) size 16x16
+              text run at (32,64) width 16: " "
+          LayoutText {#text} at (48,64) size 16x16
+            text run at (48,64) width 16: " "
+          LayoutInline {SPAN} at (0,0) size 16x16
+            LayoutText {#text} at (64,64) size 16x16
+              text run at (64,64) width 16: " "
+          LayoutText {#text} at (80,64) size 16x16
+            text run at (80,64) width 16: " "
+          LayoutInline {SPAN} at (0,0) size 16x16
+            LayoutText {#text} at (96,64) size 16x16
+              text run at (96,64) width 16: " "
+          LayoutText {#text} at (112,64) size 16x16
+            text run at (112,64) width 16: " "
+          LayoutInline {SPAN} at (0,0) size 0x0
+            LayoutText {#text} at (0,0) size 0x0
+          LayoutText {#text} at (0,0) size 0x0
+        LayoutText {#text} at (128,64) size 32x16
+          text run at (128,64) width 32: "  "
+        LayoutInline {SPAN} at (0,0) size 16x16
+          LayoutText {#text} at (160,64) size 16x16
+            text run at (160,64) width 16: " "
+        LayoutInline {SPAN} at (0,0) size 16x16
+          LayoutText {#text} at (176,64) size 16x16
+            text run at (176,64) width 16: " "
+        LayoutText {#text} at (192,64) size 48x16
+          text run at (192,64) width 48: "   "
+        LayoutInline {SPAN} at (0,0) size 16x16
+          LayoutText {#text} at (240,64) size 16x16
+            text run at (240,64) width 16: " "
+        LayoutInline {SPAN} at (0,0) size 0x0
+          LayoutText {#text} at (0,0) size 0x0
+        LayoutText {#text} at (256,64) size 384x16
+          text run at (256,64) width 384: "  x x  x x  x x    x    "
+          text run at (640,64) width 0: " "
+        LayoutInline {SPAN} at (0,0) size 640x16
+          LayoutText {#text} at (0,80) size 640x16
+            text run at (0,80) width 640: "x x x x x x x x x x xxxx xxxx xxxx xxxx "
+        LayoutText {#text} at (640,80) size 640x32
+          text run at (640,80) width 0: " "
+          text run at (0,96) width 624: "x                 x x    x  x    x    x"
+        LayoutInline {SPAN} at (0,0) size 640x16
+          LayoutText {#text} at (0,112) size 304x16
+            text run at (0,112) width 304: "xxxxxxxxxxxxxxxxxxx"
+          LayoutInline {SPAN} at (0,0) size 336x16
+            LayoutText {#text} at (304,112) size 336x16
+              text run at (304,112) width 336: " x    x  x xxxx xxxx "
+        LayoutText {#text} at (640,112) size 0x16
+          text run at (640,112) width 0: " "
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text/whitespace/021-expected.png b/third_party/WebKit/LayoutTests/platform/android/fast/text/whitespace/021-expected.png
new file mode 100644
index 0000000..9bde548
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text/whitespace/021-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text/whitespace/024-expected.png b/third_party/WebKit/LayoutTests/platform/android/fast/text/whitespace/024-expected.png
new file mode 100644
index 0000000..6faa2814
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text/whitespace/024-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text/whitespace/027-expected.txt b/third_party/WebKit/LayoutTests/platform/android/fast/text/whitespace/027-expected.txt
new file mode 100644
index 0000000..c9feeb7
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text/whitespace/027-expected.txt
@@ -0,0 +1,56 @@
+layer at (0,0) size 800x600
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  LayoutBlockFlow {HTML} at (0,0) size 800x600
+    LayoutBlockFlow {BODY} at (8,8) size 784x584
+      LayoutTable {TABLE} at (0,0) size 784x230
+        LayoutTableSection {TBODY} at (0,0) size 784x230
+          LayoutTableRow {TR} at (0,2) size 784x226
+            LayoutTableCell {TD} at (2,2) size 80x226 [r=0 c=0 rs=1 cs=1]
+              LayoutBlockFlow (floating) {DIV} at (1,1) size 78x224 [border: (2px solid #FF0000)]
+                LayoutText {#text} at (2,2) size 74x219
+                  text run at (2,2) width 51: "Here-is-"
+                  text run at (2,22) width 66: "some-info-"
+                  text run at (2,42) width 58: "from-the-"
+                  text run at (2,62) width 70: "complaints-"
+                  text run at (2,82) width 74: "department-"
+                  text run at (2,102) width 66: "some-info-"
+                  text run at (2,122) width 58: "from-the-"
+                  text run at (2,142) width 70: "complaints-"
+                  text run at (2,162) width 74: "department-"
+                  text run at (2,182) width 66: "some-info-"
+                  text run at (2,202) width 52: "from-the"
+            LayoutTableCell {TD} at (84,114) size 698x2 [r=0 c=1 rs=1 cs=1]
+      LayoutTable {TABLE} at (0,230) size 784x230
+        LayoutTableSection {TBODY} at (0,0) size 784x230
+          LayoutTableRow {TR} at (0,2) size 784x226
+            LayoutTableCell {TD} at (2,2) size 74x226 [r=0 c=0 rs=1 cs=1]
+              LayoutBlockFlow (floating) {DIV} at (1,1) size 72x224 [border: (2px solid #FF0000)]
+                LayoutText {#text} at (2,2) size 68x219
+                  text run at (2,2) width 43: "Here is"
+                  text run at (2,22) width 58: "some info"
+                  text run at (2,42) width 50: "from the"
+                  text run at (2,62) width 64: "complaints"
+                  text run at (2,82) width 68: "department"
+                  text run at (2,102) width 60: "some-info"
+                  text run at (2,122) width 50: "from the"
+                  text run at (2,142) width 64: "complaints"
+                  text run at (2,162) width 68: "department"
+                  text run at (2,182) width 58: "some info"
+                  text run at (2,202) width 50: "from the"
+            LayoutTableCell {TD} at (78,114) size 704x2 [r=0 c=1 rs=1 cs=1]
+      LayoutTable {TABLE} at (0,460) size 784x72 [border: (2px outset #808080)]
+        LayoutTableSection {TBODY} at (2,2) size 780x68
+          LayoutTableRow {TR} at (0,2) size 780x64
+            LayoutTableCell {TD} at (2,2) size 541x64 [border: (1px inset #808080)] [r=0 c=0 rs=1 cs=1]
+              LayoutText {#text} at (2,2) size 125x19
+                text run at (2,2) width 125: "This is a test to see if"
+              LayoutInline {SPAN} at (0,0) size 537x59
+                LayoutText {#text} at (127,2) size 537x59
+                  text run at (127,2) width 97: "this is computed"
+                  text run at (224,2) width 0: " "
+                  text run at (2,22) width 537: "correctly.  In particular, we have a really long line here that could throw off the min-width."
+                  text run at (539,22) width 0: " "
+                  text run at (2,42) width 29: "Is it?"
+              LayoutText {#text} at (0,0) size 0x0
+            LayoutTableCell {TD} at (545,32) size 233x4 [border: (1px inset #808080)] [r=0 c=1 rs=1 cs=1]
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text/whitespace/nbsp-mode-and-linewraps-expected.png b/third_party/WebKit/LayoutTests/platform/android/fast/text/whitespace/nbsp-mode-and-linewraps-expected.png
new file mode 100644
index 0000000..4e922064
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text/whitespace/nbsp-mode-and-linewraps-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text/whitespace/pre-break-word-expected.png b/third_party/WebKit/LayoutTests/platform/android/fast/text/whitespace/pre-break-word-expected.png
new file mode 100644
index 0000000..c03db83
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text/whitespace/pre-break-word-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text/whitespace/pre-break-word-expected.txt b/third_party/WebKit/LayoutTests/platform/android/fast/text/whitespace/pre-break-word-expected.txt
new file mode 100644
index 0000000..20ebb274
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text/whitespace/pre-break-word-expected.txt
@@ -0,0 +1,13 @@
+layer at (0,0) size 800x600
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  LayoutBlockFlow {HTML} at (0,0) size 800x600
+    LayoutBlockFlow {BODY} at (8,8) size 784x584
+      LayoutBlockFlow {DIV} at (0,0) size 154x124 [border: (2px solid #FF0000)]
+        LayoutText {#text} at (2,2) size 150x119
+          text run at (2,2) width 148: "Even though this div is w"
+          text run at (2,22) width 145: "hite-space pre, the text i"
+          text run at (2,42) width 148: "nside should still wrap to"
+          text run at (2,62) width 149: " multiple lines because of"
+          text run at (2,82) width 150: " the word-wrap:break-w"
+          text run at (2,102) width 114: "ord CSS property."
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text/whitespace/pre-wrap-last-char-expected.png b/third_party/WebKit/LayoutTests/platform/android/fast/text/whitespace/pre-wrap-last-char-expected.png
new file mode 100644
index 0000000..d6b1b69
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text/whitespace/pre-wrap-last-char-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text/whitespace/pre-wrap-last-char-expected.txt b/third_party/WebKit/LayoutTests/platform/android/fast/text/whitespace/pre-wrap-last-char-expected.txt
new file mode 100644
index 0000000..8fbeeb2d
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text/whitespace/pre-wrap-last-char-expected.txt
@@ -0,0 +1,24 @@
+layer at (0,0) size 800x600
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  LayoutBlockFlow {HTML} at (0,0) size 800x600
+    LayoutBlockFlow {BODY} at (8,8) size 784x584
+      LayoutBlockFlow {P} at (0,0) size 784x40
+        LayoutText {#text} at (0,0) size 51x19
+          text run at (0,0) width 51: "Test for "
+        LayoutInline {I} at (0,0) size 759x39
+          LayoutInline {A} at (0,0) size 305x19 [color=#0000EE]
+            LayoutText {#text} at (51,0) size 305x19
+              text run at (51,0) width 305: "http://bugs.webkit.org/show_bug.cgi?id=13072"
+          LayoutText {#text} at (356,0) size 759x39
+            text run at (356,0) width 4: " "
+            text run at (360,0) width 399: "REGRESSION (r15617): white-space: pre-wrap breaks off the"
+            text run at (0,20) width 189: "last character of a wide word"
+        LayoutText {#text} at (189,20) size 4x19
+          text run at (189,20) width 4: "."
+      LayoutBlockFlow {P} at (0,56) size 784x20
+        LayoutText {#text} at (0,0) size 210x19
+          text run at (0,0) width 210: "The following line should not wrap."
+      LayoutBlockFlow {DIV} at (0,92) size 150x20 [bgcolor=#D3D3D3]
+        LayoutText {#text} at (0,0) size 175x19
+          text run at (0,0) width 175: "abcdefghijklmnopqrstuvwxyz"
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text/whitespace/pre-wrap-line-test-expected.png b/third_party/WebKit/LayoutTests/platform/android/fast/text/whitespace/pre-wrap-line-test-expected.png
new file mode 100644
index 0000000..7268aa2
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text/whitespace/pre-wrap-line-test-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text/whitespace/pre-wrap-line-test-expected.txt b/third_party/WebKit/LayoutTests/platform/android/fast/text/whitespace/pre-wrap-line-test-expected.txt
new file mode 100644
index 0000000..3cc8f343
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text/whitespace/pre-wrap-line-test-expected.txt
@@ -0,0 +1,17 @@
+layer at (0,0) size 800x600
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  LayoutBlockFlow {HTML} at (0,0) size 800x600
+    LayoutBlockFlow {BODY} at (8,8) size 784x584
+      LayoutTable {TABLE} at (0,0) size 784x66
+        LayoutTableSection {TBODY} at (0,0) size 784x66
+          LayoutTableRow {TR} at (0,2) size 784x62
+            LayoutTableCell {TD} at (2,2) size 780x62 [r=0 c=0 rs=1 cs=1]
+              LayoutBlockFlow {DIV} at (1,1) size 778x60
+                LayoutText {#text} at (0,0) size 771x59
+                  text run at (0,0) width 748: "Three cheers    for OldVet and the letter he wrote to Senator Dodd (see above Comment).  We all need to be proactive and"
+                  text run at (748,0) width 4: " "
+                  text run at (0,20) width 767: "contact our senators and representatives to let them know our strong feelings on this subject.  I would lose what little faith I have"
+                  text run at (767,20) width 4: " "
+                  text run at (0,40) width 362: "left in our government if they engineered a tax payer bailout. "
+                  text run at (362,40) width 0: " "
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text/whitespace/pre-wrap-overflow-selection-expected.txt b/third_party/WebKit/LayoutTests/platform/android/fast/text/whitespace/pre-wrap-overflow-selection-expected.txt
new file mode 100644
index 0000000..185bffa0
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text/whitespace/pre-wrap-overflow-selection-expected.txt
@@ -0,0 +1,49 @@
+layer at (0,0) size 800x600
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  LayoutBlockFlow {HTML} at (0,0) size 800x600
+    LayoutBlockFlow {BODY} at (8,8) size 784x579
+      LayoutBlockFlow {P} at (0,0) size 784x40
+        LayoutText {#text} at (0,0) size 242x19
+          text run at (0,0) width 242: "This test checks for a regression against "
+        LayoutInline {I} at (0,0) size 725x39
+          LayoutInline {A} at (0,0) size 350x19 [color=#0000EE]
+            LayoutText {#text} at (242,0) size 350x19
+              text run at (242,0) width 350: "http://bugzilla.opendarwin.org/show_bug.cgi?id=5619"
+          LayoutText {#text} at (592,0) size 725x39
+            text run at (592,0) width 133: " CSS2: pre-wrap has"
+            text run at (0,20) width 180: "overflow/selection problems"
+        LayoutText {#text} at (180,20) size 4x19
+          text run at (180,20) width 4: "."
+      LayoutBlockFlow {P} at (0,56) size 784x20
+        LayoutText {#text} at (0,0) size 656x19
+          text run at (0,0) width 656: "Both boxes should not have scroll bars. The selection should not spill out of the blue box to the right of \x{201C}text\x{201D}."
+      LayoutBlockFlow {HR} at (0,92) size 784x2 [border: (1px inset #EEEEEE)]
+      LayoutBlockFlow {HR} at (0,208) size 784x2 [border: (1px inset #EEEEEE)]
+      LayoutBlockFlow {PRE} at (0,223) size 108x88 [border: (4px solid #0000FF)]
+        LayoutText {#text} at (4,4) size 100x80
+          text run at (4,4) width 88: "This   text"
+          text run at (92,4) width 12: "     "
+          text run at (4,20) width 72: "will wrap"
+          text run at (76,20) width 0: " "
+          text run at (4,36) width 72: "and   fit"
+          text run at (76,36) width 24: "   "
+          text run at (4,52) width 80: "within the"
+          text run at (84,52) width 0: " "
+          text run at (4,68) width 32: "box."
+          text run at (36,68) width 0: " "
+layer at (8,115) size 108x88 clip at (12,119) size 100x80
+  LayoutBlockFlow {PRE} at (0,107) size 108x88 [border: (4px solid #A52A2A)]
+    LayoutText {#text} at (4,4) size 100x80
+      text run at (4,4) width 88: "This   text"
+      text run at (92,4) width 12: "     "
+      text run at (4,20) width 72: "will wrap"
+      text run at (76,20) width 0: " "
+      text run at (4,36) width 72: "and   fit"
+      text run at (76,36) width 24: "   "
+      text run at (4,52) width 80: "within the"
+      text run at (84,52) width 0: " "
+      text run at (4,68) width 32: "box."
+      text run at (36,68) width 0: " "
+selection start: position 7 of child 0 {#text} of child 7 {PRE} of body
+selection end:   position 15 of child 0 {#text} of child 11 {PRE} of body
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text/wide-zero-width-space-expected.png b/third_party/WebKit/LayoutTests/platform/android/fast/text/wide-zero-width-space-expected.png
new file mode 100644
index 0000000..8ab5278
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text/wide-zero-width-space-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text/wide-zero-width-space-expected.txt b/third_party/WebKit/LayoutTests/platform/android/fast/text/wide-zero-width-space-expected.txt
new file mode 100644
index 0000000..79c5d37
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text/wide-zero-width-space-expected.txt
@@ -0,0 +1,29 @@
+layer at (0,0) size 800x600
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  LayoutBlockFlow {HTML} at (0,0) size 800x600
+    LayoutBlockFlow {BODY} at (8,8) size 784x584
+      LayoutBlockFlow {P} at (0,0) size 784x20
+        LayoutText {#text} at (0,0) size 51x19
+          text run at (0,0) width 51: "Test for "
+        LayoutInline {I} at (0,0) size 608x19
+          LayoutInline {A} at (0,0) size 305x19 [color=#0000EE]
+            LayoutText {#text} at (51,0) size 305x19
+              text run at (51,0) width 305: "http://bugs.webkit.org/show_bug.cgi?id=13178"
+          LayoutText {#text} at (356,0) size 303x19
+            text run at (356,0) width 4: " "
+            text run at (360,0) width 299: "Helvetica zero-width space has non-zero width"
+        LayoutText {#text} at (659,0) size 4x19
+          text run at (659,0) width 4: "."
+      LayoutBlockFlow {P} at (0,36) size 784x20
+        LayoutText {#text} at (0,0) size 247x19
+          text run at (0,0) width 247: "The following lines should all be identical."
+      LayoutBlockFlow {DIV} at (0,72) size 784x42
+        LayoutText {#text} at (0,0) size 384x41
+          text run at (0,0) width 384: "Lor\x{E9}m\x{200B}ipsum\x{200E}dolor\x{1F}sit"
+      LayoutBlockFlow {DIV} at (0,114) size 784x42
+        LayoutText {#text} at (0,0) size 384x41
+          text run at (0,0) width 384: "Lore\x{301}m\x{200B}ipsum\x{200E}dolor\x{1F}sit"
+      LayoutBlockFlow {DIV} at (0,156) size 784x42
+        LayoutText {#text} at (0,0) size 384x41
+          text run at (0,0) width 384: "Lor\x{E9}mipsumdolorsit"
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text/word-break-run-rounding-expected.png b/third_party/WebKit/LayoutTests/platform/android/fast/text/word-break-run-rounding-expected.png
new file mode 100644
index 0000000..bac1932
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text/word-break-run-rounding-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text/word-break-run-rounding-expected.txt b/third_party/WebKit/LayoutTests/platform/android/fast/text/word-break-run-rounding-expected.txt
new file mode 100644
index 0000000..1b68da2
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text/word-break-run-rounding-expected.txt
@@ -0,0 +1,38 @@
+layer at (0,0) size 800x600
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  LayoutBlockFlow {HTML} at (0,0) size 800x600
+    LayoutBlockFlow {BODY} at (8,8) size 784x584
+      LayoutBlockFlow {P} at (0,0) size 784x20
+        LayoutText {#text} at (0,0) size 57x19
+          text run at (0,0) width 57: "Tests for "
+        LayoutInline {I} at (0,0) size 714x19
+          LayoutInline {A} at (0,0) size 305x19 [color=#0000EE]
+            LayoutText {#text} at (57,0) size 305x19
+              text run at (57,0) width 305: "http://bugs.webkit.org/show_bug.cgi?id=13438"
+          LayoutText {#text} at (362,0) size 409x19
+            text run at (362,0) width 4: " "
+            text run at (366,0) width 405: "Run rounding makes word-break:break-all/word not functional"
+        LayoutText {#text} at (771,0) size 4x19
+          text run at (771,0) width 4: "."
+      LayoutBlockFlow {P} at (0,36) size 784x20
+        LayoutText {#text} at (0,0) size 288x19
+          text run at (0,0) width 288: "Test that the preferred (maximum) width is right:"
+      LayoutBlockFlow (anonymous) at (0,72) size 784x26
+        LayoutBlockFlow (floating) {DIV} at (0,0) size 557x26 [border: (3px solid #000000)]
+          LayoutText {#text} at (3,3) size 551x19
+            text run at (3,3) width 551: "The black border should fit tightly around this one line of text with no space after the period."
+        LayoutBR {BR} at (557,0) size 0x19
+      LayoutBlockFlow {P} at (0,114) size 784x20
+        LayoutText {#text} at (0,0) size 367x19
+          text run at (0,0) width 367: "Test that text does not wrap too early due to rounding errors:"
+      LayoutBlockFlow {DIV} at (0,150) size 431x26 [border: (3px solid #000000)]
+        LayoutText {#text} at (3,3) size 315x19
+          text run at (3,3) width 315: "This text fits nicely on a single line of the given width."
+      LayoutBlockFlow {P} at (0,192) size 784x20
+        LayoutText {#text} at (0,0) size 221x19
+          text run at (0,0) width 221: "Test that text does not wrap too late:"
+      LayoutBlockFlow {DIV} at (0,228) size 597x26 [border: (3px solid #000000)]
+        LayoutText {#text} at (3,3) size 576x19
+          text run at (3,3) width 371: "J u s t a b u n c h o f l e t t e r s h e r e , n o t h i n g t o s e e . "
+          text run at (374,3) width 205: "Thisisonebigwordwhichisverylong."
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text/word-break-soft-hyphen-expected.png b/third_party/WebKit/LayoutTests/platform/android/fast/text/word-break-soft-hyphen-expected.png
new file mode 100644
index 0000000..5349c074
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text/word-break-soft-hyphen-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text/word-break-soft-hyphen-expected.txt b/third_party/WebKit/LayoutTests/platform/android/fast/text/word-break-soft-hyphen-expected.txt
new file mode 100644
index 0000000..09ca350
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text/word-break-soft-hyphen-expected.txt
@@ -0,0 +1,25 @@
+layer at (0,0) size 800x600
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  LayoutBlockFlow {HTML} at (0,0) size 800x600
+    LayoutBlockFlow {BODY} at (8,8) size 784x576
+      LayoutBlockFlow {P} at (0,0) size 784x40
+        LayoutText {#text} at (0,0) size 51x19
+          text run at (0,0) width 51: "Test for "
+        LayoutInline {I} at (0,0) size 755x39
+          LayoutInline {A} at (0,0) size 305x19 [color=#0000EE]
+            LayoutText {#text} at (51,0) size 305x19
+              text run at (51,0) width 305: "http://bugs.webkit.org/show_bug.cgi?id=15367"
+          LayoutText {#text} at (356,0) size 755x39
+            text run at (356,0) width 4: " "
+            text run at (360,0) width 395: "Assertion failure inspecting a document including soft hyphen"
+            text run at (0,20) width 76: "code (0xad)"
+        LayoutText {#text} at (76,20) size 4x19
+          text run at (76,20) width 4: "."
+      LayoutBlockFlow {P} at (0,56) size 784x20
+        LayoutText {#text} at (0,0) size 459x19
+          text run at (0,0) width 459: "The following text should not wrap and the border should fit tightly around it."
+layer at (8,100) size 109x26
+  LayoutBlockFlow (positioned) {DIV} at (8,100) size 109x26 [border: (3px solid #000000)]
+    LayoutText {#text} at (3,3) size 103x19
+      text run at (3,3) width 103: "Two soft\x{AD}hyp\x{AD}hens"
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text/word-space-expected.png b/third_party/WebKit/LayoutTests/platform/android/fast/text/word-space-expected.png
new file mode 100644
index 0000000..c972f64
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text/word-space-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text/word-space-expected.txt b/third_party/WebKit/LayoutTests/platform/android/fast/text/word-space-expected.txt
new file mode 100644
index 0000000..9fd0690
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text/word-space-expected.txt
@@ -0,0 +1,60 @@
+layer at (0,0) size 800x600
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  LayoutBlockFlow {HTML} at (0,0) size 800x600
+    LayoutBlockFlow {BODY} at (8,8) size 784x576
+      LayoutBlockFlow {P} at (0,0) size 784x40
+        LayoutText {#text} at (0,0) size 51x19
+          text run at (0,0) width 51: "Test for "
+        LayoutInline {I} at (0,0) size 765x39
+          LayoutInline {A} at (0,0) size 305x19 [color=#0000EE]
+            LayoutText {#text} at (51,0) size 305x19
+              text run at (51,0) width 305: "http://bugs.webkit.org/show_bug.cgi?id=15259"
+          LayoutText {#text} at (356,0) size 765x39
+            text run at (356,0) width 4: " "
+            text run at (360,0) width 405: "REGRESSION:Text overflows if a empty <td> is followed by a"
+            text run at (0,20) width 138: "<td align=\"center\">"
+        LayoutText {#text} at (138,20) size 4x19
+          text run at (138,20) width 4: "."
+      LayoutBlockFlow {P} at (0,56) size 784x20
+        LayoutText {#text} at (0,0) size 246x19
+          text run at (0,0) width 246: "The next 7 lines should all look the same."
+      LayoutBlockFlow (floating) {DIV} at (0,92) size 81x26 [border: (3px solid #000000)]
+        LayoutText {#text} at (3,3) size 75x19
+          text run at (3,3) width 75: "A B"
+      LayoutBlockFlow (floating) {DIV} at (0,118) size 81x26 [border: (3px solid #000000)]
+        LayoutText {#text} at (3,3) size 75x19
+          text run at (3,3) width 75: "A B"
+      LayoutBlockFlow (floating) {DIV} at (0,144) size 81x26 [border: (3px solid #000000)]
+        LayoutInline {SPAN} at (0,0) size 11x19
+          LayoutText {#text} at (3,3) size 11x19
+            text run at (3,3) width 11: "A"
+        LayoutText {#text} at (64,3) size 14x19
+          text run at (64,3) width 14: " B"
+      LayoutBlockFlow (floating) {DIV} at (0,170) size 81x26 [border: (3px solid #000000)]
+        LayoutInline {SPAN} at (0,0) size 11x19
+          LayoutText {#text} at (3,3) size 11x19
+            text run at (3,3) width 11: "A"
+        LayoutText {#text} at (64,3) size 14x19
+          text run at (64,3) width 14: " B"
+      LayoutBlockFlow (floating) {DIV} at (0,196) size 81x26 [border: (3px solid #000000)]
+        LayoutInline {SPAN} at (0,0) size 11x19
+          LayoutText {#text} at (3,3) size 11x19
+            text run at (3,3) width 11: "A"
+        LayoutText {#text} at (64,3) size 14x19
+          text run at (64,3) width 14: " B"
+      LayoutBlockFlow (floating) {DIV} at (0,222) size 81x26 [border: (3px solid #000000)]
+        LayoutInline {SPAN} at (0,0) size 11x19
+          LayoutText {#text} at (3,3) size 11x19
+            text run at (3,3) width 11: "A"
+        LayoutText {#text} at (64,3) size 4x19
+          text run at (64,3) width 4: " "
+        LayoutInline {SPAN} at (0,0) size 10x19
+          LayoutText {#text} at (68,3) size 10x19
+            text run at (68,3) width 10: "B"
+      LayoutBlockFlow (floating) {DIV} at (0,248) size 81x26 [border: (3px solid #000000)]
+        LayoutInline {SPAN} at (0,0) size 11x19
+          LayoutText {#text} at (3,3) size 11x19
+            text run at (3,3) width 11: "A"
+        LayoutText {#text} at (64,3) size 14x19
+          text run at (64,3) width 14: " B"
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text/zero-font-size-expected.png b/third_party/WebKit/LayoutTests/platform/android/fast/text/zero-font-size-expected.png
new file mode 100644
index 0000000..b42ea42
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text/zero-font-size-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/android/fast/text/zero-font-size-expected.txt b/third_party/WebKit/LayoutTests/platform/android/fast/text/zero-font-size-expected.txt
new file mode 100644
index 0000000..9e1f7abe
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/android/fast/text/zero-font-size-expected.txt
@@ -0,0 +1,15 @@
+layer at (0,0) size 800x600
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  LayoutBlockFlow {HTML} at (0,0) size 800x600
+    LayoutBlockFlow {BODY} at (8,8) size 784x584
+      LayoutBlockFlow {P} at (0,0) size 784x40
+        LayoutText {#text} at (0,0) size 727x39
+          text run at (0,0) width 727: "Test that text with 0px font size is not displayed, even if a non-zero minimum font size setting is specified. On success, this"
+          text run at (0,20) width 319: "paragraph should be the only text visible on the page."
+      LayoutBlockFlow {DIV} at (0,56) size 784x0 [color=#FF0000]
+        LayoutText {#text} at (0,0) size 0x0
+          text run at (0,0) width 0: "FAIL"
+      LayoutBlockFlow {DIV} at (0,56) size 784x0 [color=#FF0000]
+        LayoutText {#text} at (0,0) size 0x0
+          text run at (0,0) width 0: "FAIL"
diff --git a/third_party/WebKit/LayoutTests/platform/linux-precise/fast/text/international/complex-joining-using-gpos-expected.png b/third_party/WebKit/LayoutTests/platform/linux-precise/fast/text/international/complex-joining-using-gpos-expected.png
index a089d96..fa8f298 100644
--- a/third_party/WebKit/LayoutTests/platform/linux-precise/fast/text/international/complex-joining-using-gpos-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux-precise/fast/text/international/complex-joining-using-gpos-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux-precise/fast/text/shaping/same-script-different-lang-expected.png b/third_party/WebKit/LayoutTests/platform/linux-precise/fast/text/shaping/same-script-different-lang-expected.png
index 60853db..594066d0 100644
--- a/third_party/WebKit/LayoutTests/platform/linux-precise/fast/text/shaping/same-script-different-lang-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux-precise/fast/text/shaping/same-script-different-lang-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux-precise/fast/text/shaping/same-script-different-lang-expected.txt b/third_party/WebKit/LayoutTests/platform/linux-precise/fast/text/shaping/same-script-different-lang-expected.txt
index d280513..341ae19 100644
--- a/third_party/WebKit/LayoutTests/platform/linux-precise/fast/text/shaping/same-script-different-lang-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux-precise/fast/text/shaping/same-script-different-lang-expected.txt
@@ -1,18 +1,22 @@
 layer at (0,0) size 800x600
   LayoutView at (0,0) size 800x600
-layer at (0,0) size 800x212
-  LayoutBlockFlow {HTML} at (0,0) size 800x212.44
-    LayoutBlockFlow {BODY} at (8,18.72) size 784x185.72
+layer at (0,0) size 800x192
+  LayoutBlockFlow {HTML} at (0,0) size 800x192.44
+    LayoutBlockFlow {BODY} at (8,18.72) size 784x157.72
       LayoutBlockFlow {H3} at (0,0) size 784x23
         LayoutText {#text} at (0,0) size 764x22
           text run at (0,0) width 764: "The glyph for JHA should look different for Nepali and Hindi, depending on the lang attribute."
       LayoutBlockFlow {P} at (0,41.72) size 784x28
         LayoutText {#text} at (0,4) size 87x21
           text run at (0,4) width 87: "Hindi:JHA \x{91D}"
-      LayoutBlockFlow (anonymous) at (0,85.72) size 784x20
-        LayoutBR {BR} at (0,0) size 0x19
-      LayoutBlockFlow {P} at (0,121.72) size 784x28
+      LayoutBlockFlow {P} at (0,85.72) size 784x28
         LayoutText {#text} at (0,4) size 99x21
           text run at (0,4) width 99: "Nepali:JHA \x{91D}"
-      LayoutBlockFlow (anonymous) at (0,165.72) size 784x20
-        LayoutBR {BR} at (0,0) size 0x19
+      LayoutBlockFlow {P} at (0,129.72) size 784x28
+        LayoutText {#text} at (0,4) size 84x21
+          text run at (0,4) width 84: "Nepali:JHA "
+        LayoutInline {SPAN} at (0,0) size 15x21
+          LayoutText {#text} at (84,4) size 15x21
+            text run at (84,4) width 15: "\x{91D}"
+        LayoutText {#text} at (99,4) size 328x21
+          text run at (99,4) width 328: " - \"ne\" in \"hi\" should look the same as above."
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text-autosizing/display-type-change-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text-autosizing/display-type-change-expected.png
index b2babf3..0cef01a9 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text-autosizing/display-type-change-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text-autosizing/display-type-change-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text-autosizing/display-type-change-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/text-autosizing/display-type-change-expected.txt
index d0e2da1..796d2cf1 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text-autosizing/display-type-change-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text-autosizing/display-type-change-expected.txt
@@ -11,7 +11,7 @@
             text run at (0,58) width 94: "changes"
             text run at (0,88) width 99: "properly"
             text run at (0,118) width 156: "invalidate the"
-            text run at (0,148) width 164: "text autosizer."
+            text run at (0,148) width 163: "text autosizer."
             text run at (0,178) width 182: "This test passes"
             text run at (0,208) width 189: "if this text is not"
             text run at (0,238) width 197: "overlapping with"
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text-autosizing/hackernews-comments-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text-autosizing/hackernews-comments-expected.png
index 75ae3a7..2110d41 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text-autosizing/hackernews-comments-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text-autosizing/hackernews-comments-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text-autosizing/hackernews-comments-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/text-autosizing/hackernews-comments-expected.txt
index 3ffe8460..22d8df8c 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text-autosizing/hackernews-comments-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text-autosizing/hackernews-comments-expected.txt
@@ -60,12 +60,12 @@
                             text run at (1,1) width 69: "999 points"
                         LayoutText {#text} at (70,1) size 26x16
                           text run at (70,1) width 26: " by "
-                        LayoutInline {A} at (0,0) size 21x16 [color=#0000EE]
-                          LayoutText {#text} at (96,1) size 21x16
-                            text run at (96,1) width 21: "pdr"
-                        LayoutText {#text} at (117,1) size 188x16
-                          text run at (117,1) width 88: " 4 hours ago "
-                          text run at (205,1) width 100: "| 74 comments"
+                        LayoutInline {A} at (0,0) size 22x16 [color=#0000EE]
+                          LayoutText {#text} at (95,1) size 22x16
+                            text run at (95,1) width 22: "pdr"
+                        LayoutText {#text} at (116,1) size 189x16
+                          text run at (116,1) width 89: " 4 hours ago "
+                          text run at (204,1) width 101: "| 74 comments"
                     LayoutTableRow {TR} at (0,42) size 402x10
                     LayoutTableRow {TR} at (0,54) size 402x2
                       LayoutTableCell {TD} at (2,54) size 52x2 [r=3 c=0 rs=1 cs=1]
@@ -94,11 +94,11 @@
                                   LayoutText {#text} at (0,0) size 0x0
                                 LayoutBlockFlow (anonymous) at (1,25) size 583x320
                                   LayoutBR {BR} at (0,0) size 0x32
-                                  LayoutInline {SPAN} at (0,0) size 562x288
+                                  LayoutInline {SPAN} at (0,0) size 560x288
                                     LayoutText {#text} at (0,0) size 0x0
-                                    LayoutInline {FONT} at (0,0) size 562x288
-                                      LayoutText {#text} at (0,32) size 562x288
-                                        text run at (0,32) width 562: "Contrary to popular belief, blah blah blah"
+                                    LayoutInline {FONT} at (0,0) size 560x288
+                                      LayoutText {#text} at (0,32) size 560x288
+                                        text run at (0,32) width 560: "Contrary to popular belief, blah blah blah"
                                         text run at (0,64) width 526: "blah blah blah blah blah blah blah blah"
                                         text run at (0,96) width 526: "blah blah blah blah blah blah blah blah"
                                         text run at (0,128) width 526: "blah blah blah blah blah blah blah blah"
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text-autosizing/list-item-above-dbcat-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text-autosizing/list-item-above-dbcat-expected.png
index a400477..e47e0bf6 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text-autosizing/list-item-above-dbcat-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text-autosizing/list-item-above-dbcat-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text-autosizing/list-item-above-dbcat-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/text-autosizing/list-item-above-dbcat-expected.txt
index a3a182e..71f5873 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text-autosizing/list-item-above-dbcat-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text-autosizing/list-item-above-dbcat-expected.txt
@@ -4,12 +4,12 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x593
     LayoutBlockFlow {BODY} at (0,0) size 800x336
       LayoutBlockFlow {DIV} at (0,0) size 800x336
-        LayoutText {#text} at (0,1) size 790x334
-          text run at (0,1) width 790: "This test verifies that FastTextAutosizer considers"
+        LayoutText {#text} at (0,1) size 788x334
+          text run at (0,1) width 788: "This test verifies that FastTextAutosizer considers"
           text run at (0,49) width 702: "a list item (LI) to be \"text\" for the purpose of"
           text run at (0,97) width 769: "determining the deepest block containing all text"
-          text run at (0,145) width 761: "(DBCAT). If this were not the case, the cluster's"
-          text run at (0,193) width 755: "DBCAT would be the DIV inside the LI, which"
+          text run at (0,145) width 757: "(DBCAT). If this were not the case, the cluster's"
+          text run at (0,193) width 751: "DBCAT would be the DIV inside the LI, which"
           text run at (0,241) width 752: "hasn't entered layout yet when the list marker is"
           text run at (0,289) width 661: "autosized (causing the autosizer to crash)."
       LayoutBlockFlow (floating) {UL} at (0,352) size 800x225
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text-autosizing/tables/css-table-single-cell-lots-of-text-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text-autosizing/tables/css-table-single-cell-lots-of-text-expected.png
index 9b43d1e..57ef42c3 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text-autosizing/tables/css-table-single-cell-lots-of-text-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text-autosizing/tables/css-table-single-cell-lots-of-text-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text-autosizing/tables/css-table-single-cell-lots-of-text-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/text-autosizing/tables/css-table-single-cell-lots-of-text-expected.txt
index 9ec1efd7..595c754 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text-autosizing/tables/css-table-single-cell-lots-of-text-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text-autosizing/tables/css-table-single-cell-lots-of-text-expected.txt
@@ -6,7 +6,7 @@
       LayoutBlockFlow {DIV} at (0,0) size 600x36
         LayoutText {#text} at (0,0) size 291x15
           text run at (0,0) width 291: "Table autosizing tests - css-table-single-cell-lots-of-text.html"
-        LayoutBR {BR} at (291,0) size 0x15
+        LayoutBR {BR} at (290,0) size 1x15
         LayoutText {#text} at (0,16) size 568x15
           text run at (0,16) width 568: "This test passes if there is a one cell with lots of text that's autosized, and five single-word cells that are not autosized."
       LayoutTable {DIV} at (1,37) size 798x529
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text-autosizing/tables/fixed-table-single-cell-lots-of-text-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text-autosizing/tables/fixed-table-single-cell-lots-of-text-expected.png
index 69f28aa..a2657036 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text-autosizing/tables/fixed-table-single-cell-lots-of-text-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text-autosizing/tables/fixed-table-single-cell-lots-of-text-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text-autosizing/tables/fixed-table-single-cell-lots-of-text-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/text-autosizing/tables/fixed-table-single-cell-lots-of-text-expected.txt
index b624076..c0aaef2 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text-autosizing/tables/fixed-table-single-cell-lots-of-text-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text-autosizing/tables/fixed-table-single-cell-lots-of-text-expected.txt
@@ -6,7 +6,7 @@
       LayoutBlockFlow {DIV} at (0,0) size 600x36
         LayoutText {#text} at (0,0) size 299x15
           text run at (0,0) width 299: "Table autosizing tests - fixed-table-single-cell-lots-of-text.html"
-        LayoutBR {BR} at (299,0) size 0x15
+        LayoutBR {BR} at (298,0) size 1x15
         LayoutText {#text} at (0,16) size 568x15
           text run at (0,16) width 568: "This test passes if there is a one cell with lots of text that's autosized, and five single-word cells that are not autosized."
       LayoutTable {TABLE} at (1,37) size 798x532 [border: none]
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text-autosizing/tables/nested-table-wrapping-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text-autosizing/tables/nested-table-wrapping-expected.png
index 6ac8e592..8b6cda6c 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text-autosizing/tables/nested-table-wrapping-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text-autosizing/tables/nested-table-wrapping-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text-autosizing/tables/nested-table-wrapping-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/text-autosizing/tables/nested-table-wrapping-expected.txt
index 04a4c41..55f4721 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text-autosizing/tables/nested-table-wrapping-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text-autosizing/tables/nested-table-wrapping-expected.txt
@@ -6,7 +6,7 @@
       LayoutBlockFlow {DIV} at (0,0) size 600x36
         LayoutText {#text} at (0,0) size 248x15
           text run at (0,0) width 248: "Table autosizing tests - nested-table-wrapping.html"
-        LayoutBR {BR} at (248,0) size 0x15
+        LayoutBR {BR} at (247,0) size 1x15
         LayoutText {#text} at (0,16) size 396x15
           text run at (0,16) width 396: "This test passes if \"the table cell should tightly wrap this text\" is tightly wrapped."
       LayoutTable {TABLE} at (1,37) size 798x236 [border: none]
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text-autosizing/tables/nested-tables-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text-autosizing/tables/nested-tables-expected.png
index 979dd9d3..d161257 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text-autosizing/tables/nested-tables-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text-autosizing/tables/nested-tables-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text-autosizing/tables/nested-tables-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/text-autosizing/tables/nested-tables-expected.txt
index e6f32d3a..65868e4 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text-autosizing/tables/nested-tables-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text-autosizing/tables/nested-tables-expected.txt
@@ -6,7 +6,7 @@
       LayoutBlockFlow {DIV} at (0,0) size 600x36
         LayoutText {#text} at (0,0) size 203x15
           text run at (0,0) width 203: "Table autosizing tests - nested-tables.html"
-        LayoutBR {BR} at (203,0) size 0x15
+        LayoutBR {BR} at (202,0) size 1x15
         LayoutText {#text} at (0,16) size 370x15
           text run at (0,16) width 370: "This test passes if \"This text should not overlap itself\" doesn't overlap itself."
       LayoutTable {TABLE} at (1,37) size 798x287 [border: none]
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text-autosizing/tables/single-cell-lots-of-text-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text-autosizing/tables/single-cell-lots-of-text-expected.png
index 1e975de..049bda9 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text-autosizing/tables/single-cell-lots-of-text-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text-autosizing/tables/single-cell-lots-of-text-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text-autosizing/tables/single-cell-lots-of-text-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/text-autosizing/tables/single-cell-lots-of-text-expected.txt
index 284a910e..3a54c65 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text-autosizing/tables/single-cell-lots-of-text-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text-autosizing/tables/single-cell-lots-of-text-expected.txt
@@ -6,7 +6,7 @@
       LayoutBlockFlow {DIV} at (0,0) size 600x36
         LayoutText {#text} at (0,0) size 245x15
           text run at (0,0) width 245: "Table autosizing tests - single-cell-lots-of-text.html"
-        LayoutBR {BR} at (245,0) size 0x15
+        LayoutBR {BR} at (244,0) size 1x15
         LayoutText {#text} at (0,16) size 568x15
           text run at (0,16) width 568: "This test passes if there is a one cell with lots of text that's autosized, and five single-word cells that are not autosized."
       LayoutTable {TABLE} at (1,37) size 798x532 [border: none]
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text-autosizing/tables/single-percent-width-cell-lots-of-text-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text-autosizing/tables/single-percent-width-cell-lots-of-text-expected.png
index 2f4e13c..5a1929a 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text-autosizing/tables/single-percent-width-cell-lots-of-text-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text-autosizing/tables/single-percent-width-cell-lots-of-text-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text-autosizing/tables/single-percent-width-cell-lots-of-text-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/text-autosizing/tables/single-percent-width-cell-lots-of-text-expected.txt
index 9d32c60..e809ff57 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text-autosizing/tables/single-percent-width-cell-lots-of-text-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text-autosizing/tables/single-percent-width-cell-lots-of-text-expected.txt
@@ -6,7 +6,7 @@
       LayoutBlockFlow {DIV} at (0,0) size 600x36
         LayoutText {#text} at (0,0) size 317x15
           text run at (0,0) width 317: "Table autosizing tests - single-percent-width-cell-lots-of-text.html"
-        LayoutBR {BR} at (317,0) size 0x15
+        LayoutBR {BR} at (316,0) size 1x15
         LayoutText {#text} at (0,16) size 509x15
           text run at (0,16) width 509: "This test passes if there is a one cell with lots of text that's autosized, and five cells that are not autosized."
       LayoutTable {TABLE} at (1,37) size 798x1808 [border: none]
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text-autosizing/tables/table-cell-inflation-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text-autosizing/tables/table-cell-inflation-expected.png
index c7e28c35..bf7fa36a 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text-autosizing/tables/table-cell-inflation-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text-autosizing/tables/table-cell-inflation-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text-autosizing/tables/table-cell-inflation-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/text-autosizing/tables/table-cell-inflation-expected.txt
index e869e51..92b8c603 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text-autosizing/tables/table-cell-inflation-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text-autosizing/tables/table-cell-inflation-expected.txt
@@ -6,7 +6,7 @@
       LayoutBlockFlow {DIV} at (0,0) size 600x36
         LayoutText {#text} at (0,0) size 227x15
           text run at (0,0) width 227: "Table autosizing tests - table-cell-inflation.html"
-        LayoutBR {BR} at (227,0) size 0x15
+        LayoutBR {BR} at (226,0) size 1x15
         LayoutText {#text} at (0,16) size 361x15
           text run at (0,16) width 361: "This test passes if there are no numbers overflowing outside this green box."
       LayoutTable {TABLE} at (1,37) size 693x202 [border: none]
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text-autosizing/tables/table-for-layout-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text-autosizing/tables/table-for-layout-expected.png
index bc9713a4..d66ee97 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text-autosizing/tables/table-for-layout-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text-autosizing/tables/table-for-layout-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text-autosizing/tables/table-for-layout-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/text-autosizing/tables/table-for-layout-expected.txt
index 2c1cd86..0c684c10 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text-autosizing/tables/table-for-layout-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text-autosizing/tables/table-for-layout-expected.txt
@@ -4,9 +4,9 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x411
     LayoutBlockFlow {BODY} at (0,0) size 800x410
       LayoutBlockFlow {DIV} at (0,0) size 600x36
-        LayoutText {#text} at (0,0) size 216x15
-          text run at (0,0) width 216: "Table autosizing tests - table-for-layout.html"
-        LayoutBR {BR} at (216,0) size 0x15
+        LayoutText {#text} at (0,0) size 215x15
+          text run at (0,0) width 215: "Table autosizing tests - table-for-layout.html"
+        LayoutBR {BR} at (214,0) size 1x15
         LayoutText {#text} at (0,16) size 256x15
           text run at (0,16) width 256: "This test passes if the main content area is autosized."
       LayoutTable {TABLE} at (1,37) size 798x373 [border: none]
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text-autosizing/tables/table-with-inline-block-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text-autosizing/tables/table-with-inline-block-expected.png
index f750516..e015e98 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text-autosizing/tables/table-with-inline-block-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text-autosizing/tables/table-with-inline-block-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text-autosizing/tables/table-with-inline-block-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/text-autosizing/tables/table-with-inline-block-expected.txt
index 858538f85..9f577a5 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text-autosizing/tables/table-with-inline-block-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text-autosizing/tables/table-with-inline-block-expected.txt
@@ -4,9 +4,9 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x1211
     LayoutBlockFlow {BODY} at (0,0) size 800x1210
       LayoutBlockFlow {DIV} at (0,0) size 600x48
-        LayoutText {#text} at (0,0) size 306x19
-          text run at (0,0) width 306: "Table autosizing tests - table-with-inline-block.html"
-        LayoutBR {BR} at (306,0) size 0x19
+        LayoutText {#text} at (0,0) size 305x19
+          text run at (0,0) width 305: "Table autosizing tests - table-with-inline-block.html"
+        LayoutBR {BR} at (304,0) size 1x19
         LayoutText {#text} at (0,20) size 358x19
           text run at (0,20) width 358: "This test passes if there is not extra space in the pink boxes."
       LayoutTable {TABLE} at (1,49) size 798x292 [border: none]
@@ -31,10 +31,10 @@
               LayoutText {#text} at (2,3) size 140x46
                 text run at (2,3) width 140: "Autosize"
               LayoutBR {BR} at (142,3) size 0x46
-              LayoutBlockFlow {B} at (2,72) size 91x20 [bgcolor=#FFC0CB]
+              LayoutBlockFlow {B} at (2,72) size 90.72x20 [bgcolor=#FFC0CB]
                 LayoutText {#text} at (0,0) size 91x19
                   text run at (0,0) width 91: "Wrapped text"
-              LayoutBR {BR} at (93,51) size 0x46
+              LayoutBR {BR} at (92,51) size 1x46
               LayoutText {#text} at (2,99) size 140x46
                 text run at (2,99) width 140: "Autosize"
               LayoutBR {BR} at (142,99) size 0x46
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text-autosizing/tables/wide-percentage-width-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text-autosizing/tables/wide-percentage-width-expected.png
index ea5f2b5..7519f4f 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text-autosizing/tables/wide-percentage-width-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text-autosizing/tables/wide-percentage-width-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text-autosizing/tables/wide-percentage-width-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/text-autosizing/tables/wide-percentage-width-expected.txt
index f98402bd..47daab7 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text-autosizing/tables/wide-percentage-width-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text-autosizing/tables/wide-percentage-width-expected.txt
@@ -6,7 +6,7 @@
       LayoutBlockFlow {DIV} at (0,0) size 600x36
         LayoutText {#text} at (0,0) size 250x15
           text run at (0,0) width 250: "Table autosizing tests - wide-percentage-width.html"
-        LayoutBR {BR} at (250,0) size 0x15
+        LayoutBR {BR} at (249,0) size 1x15
         LayoutText {#text} at (0,16) size 472x15
           text run at (0,16) width 472: "This test passes if the cell with lots of text is autosized and none of the other 5 cells are autosized."
       LayoutTable {TABLE} at (1,37) size 500x139 [border: none]
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text-autosizing/tables/wide-specified-width-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text-autosizing/tables/wide-specified-width-expected.png
index 2c18fbd..8a2fc1f 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text-autosizing/tables/wide-specified-width-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text-autosizing/tables/wide-specified-width-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text-autosizing/tables/wide-specified-width-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/text-autosizing/tables/wide-specified-width-expected.txt
index 58c91db..aa9c9a9 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text-autosizing/tables/wide-specified-width-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text-autosizing/tables/wide-specified-width-expected.txt
@@ -6,7 +6,7 @@
       LayoutBlockFlow {DIV} at (0,0) size 600x36
         LayoutText {#text} at (0,0) size 242x15
           text run at (0,0) width 242: "Table autosizing tests - wide-specified-width.html"
-        LayoutBR {BR} at (242,0) size 0x15
+        LayoutBR {BR} at (241,0) size 1x15
         LayoutText {#text} at (0,16) size 472x15
           text run at (0,16) width 472: "This test passes if the cell with lots of text is autosized and none of the other 5 cells are autosized."
       LayoutTable {TABLE} at (1,37) size 500x139 [border: none]
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/atsui-kerning-and-ligatures-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text/atsui-kerning-and-ligatures-expected.png
index b031ad2..50718a0 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/atsui-kerning-and-ligatures-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/atsui-kerning-and-ligatures-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/atsui-kerning-and-ligatures-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/text/atsui-kerning-and-ligatures-expected.txt
index 2fd86fda..3f9a4a4 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/atsui-kerning-and-ligatures-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/atsui-kerning-and-ligatures-expected.txt
@@ -4,17 +4,17 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x600
     LayoutBlockFlow {BODY} at (8,8) size 784x584
       LayoutBlockFlow {P} at (0,0) size 784x40
-        LayoutText {#text} at (0,0) size 51x19
-          text run at (0,0) width 51: "Test for "
-        LayoutInline {I} at (0,0) size 753x39
-          LayoutText {#text} at (51,0) size 753x39
-            text run at (51,0) width 702: "http://bugzilla.opendarwin.org/show_bug.cgi?id=6137 Disable kerning and some ligatures in the ATSUI code"
+        LayoutText {#text} at (0,0) size 50x19
+          text run at (0,0) width 50: "Test for "
+        LayoutInline {I} at (0,0) size 751x39
+          LayoutText {#text} at (49,0) size 751x39
+            text run at (49,0) width 702: "http://bugzilla.opendarwin.org/show_bug.cgi?id=6137 Disable kerning and some ligatures in the ATSUI code"
             text run at (0,20) width 29: "path"
         LayoutText {#text} at (29,20) size 4x19
           text run at (29,20) width 4: "."
       LayoutBlockFlow {P} at (0,56) size 784x20
-        LayoutText {#text} at (0,0) size 664x19
-          text run at (0,0) width 664: "The word \x{201C}dolor\x{201D} below should be highlighted in its entirety. The highlight should not extend beyond that word."
+        LayoutText {#text} at (0,0) size 663x19
+          text run at (0,0) width 663: "The word \x{201C}dolor\x{201D} below should be highlighted in its entirety. The highlight should not extend beyond that word."
       LayoutBlockFlow {DIV} at (0,92) size 784x42
         LayoutBlockFlow {HR} at (0,0) size 784x2 [border: (1px inset #EEEEEE)]
         LayoutBlockFlow (anonymous) at (0,14) size 784x28
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/atsui-multiple-renderers-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text/atsui-multiple-renderers-expected.png
index 24d53ee1..27c594b0 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/atsui-multiple-renderers-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/atsui-multiple-renderers-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/atsui-multiple-renderers-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/text/atsui-multiple-renderers-expected.txt
index f172848..c8ef1fa 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/atsui-multiple-renderers-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/atsui-multiple-renderers-expected.txt
@@ -6,12 +6,12 @@
       LayoutBlockFlow {P} at (0,0) size 784x40
         LayoutText {#text} at (0,0) size 99x19
           text run at (0,0) width 99: "This is a test for "
-        LayoutInline {I} at (0,0) size 756x39
-          LayoutText {#text} at (99,0) size 756x39
-            text run at (99,0) width 657: "http://bugzilla.opendarwin.org/show_bug.cgi?id=6139 ATSUI code path should implement small caps,"
+        LayoutInline {I} at (0,0) size 755x39
+          LayoutText {#text} at (99,0) size 755x39
+            text run at (99,0) width 656: "http://bugzilla.opendarwin.org/show_bug.cgi?id=6139 ATSUI code path should implement small caps,"
             text run at (0,20) width 412: "synthetic bold and oblique and correct metrics for fallback fonts"
-        LayoutText {#text} at (412,20) size 4x19
-          text run at (412,20) width 4: "."
+        LayoutText {#text} at (411,20) size 5x19
+          text run at (411,20) width 5: "."
       LayoutBlockFlow {HR} at (0,56) size 784x2 [border: (1px inset #EEEEEE)]
       LayoutBlockFlow {P} at (0,74) size 784x20
         LayoutText {#text} at (0,0) size 571x19
@@ -44,9 +44,9 @@
             LayoutTableCell {TD} at (114,26) size 114x27 [border: (1px solid #008000)] [r=1 c=1 rs=1 cs=1]
               LayoutText {#text} at (2,2) size 61x23
                 text run at (2,2) width 61: "Lorem "
-              LayoutInline {SPAN} at (0,0) size 48x23
-                LayoutText {#text} at (63,2) size 48x23
-                  text run at (63,2) width 48: "ipsum"
+              LayoutInline {SPAN} at (0,0) size 49x23
+                LayoutText {#text} at (62,2) size 49x23
+                  text run at (62,2) width 49: "ipsum"
               LayoutText {#text} at (0,0) size 0x0
           LayoutTableRow {TR} at (0,53) size 228x26
             LayoutTableCell {TD} at (0,53) size 114x26 [border: (1px solid #008000)] [r=2 c=0 rs=1 cs=1]
@@ -59,9 +59,9 @@
             LayoutTableCell {TD} at (114,53) size 114x26 [border: (1px solid #008000)] [r=2 c=1 rs=1 cs=1]
               LayoutText {#text} at (2,2) size 57x22
                 text run at (2,2) width 57: "Lorem "
-              LayoutInline {SPAN} at (0,0) size 48x22
-                LayoutText {#text} at (59,2) size 48x22
-                  text run at (59,2) width 48: "ipsum"
+              LayoutInline {SPAN} at (0,0) size 49x22
+                LayoutText {#text} at (58,2) size 49x22
+                  text run at (58,2) width 49: "ipsum"
               LayoutText {#text} at (0,0) size 0x0
           LayoutTableRow {TR} at (0,79) size 228x27
             LayoutTableCell {TD} at (0,79) size 114x27 [border: (1px solid #008000)] [r=3 c=0 rs=1 cs=1]
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/atsui-negative-spacing-features-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text/atsui-negative-spacing-features-expected.png
index d5fff22..089876c 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/atsui-negative-spacing-features-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/atsui-negative-spacing-features-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/atsui-negative-spacing-features-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/text/atsui-negative-spacing-features-expected.txt
index 85475d55..c58c8b3 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/atsui-negative-spacing-features-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/atsui-negative-spacing-features-expected.txt
@@ -4,8 +4,8 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x260
     LayoutBlockFlow {BODY} at (8,16) size 784x236
       LayoutBlockFlow {P} at (0,0) size 784x20
-        LayoutText {#text} at (0,0) size 349x19
-          text run at (0,0) width 349: "Test for negative spacing values in complex text rendering."
+        LayoutText {#text} at (0,0) size 348x19
+          text run at (0,0) width 348: "Test for negative spacing values in complex text rendering."
       LayoutBlockFlow (anonymous) at (0,36) size 784x20
         LayoutText {#text} at (0,0) size 483x19
           text run at (0,0) width 483: "Each green box should be identical to the blue box it follows, except for accents."
@@ -14,8 +14,8 @@
         LayoutTableSection {TBODY} at (0,0) size 414x162
           LayoutTableRow {TR} at (0,2) size 414x22
             LayoutTableCell {TD} at (2,2) size 204x22 [r=0 c=0 rs=1 cs=1]
-              LayoutText {#text} at (59,1) size 86x19
-                text run at (59,1) width 86: "Word spacing"
+              LayoutText {#text} at (60,1) size 84x19
+                text run at (60,1) width 84: "Word spacing"
             LayoutTableCell {TD} at (208,2) size 204x22 [r=0 c=1 rs=1 cs=1]
               LayoutText {#text} at (59,1) size 86x19
                 text run at (59,1) width 86: "Letter spacing"
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/atsui-partial-selection-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text/atsui-partial-selection-expected.png
index c78e94e..6b0c476 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/atsui-partial-selection-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/atsui-partial-selection-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/atsui-partial-selection-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/text/atsui-partial-selection-expected.txt
index 615d7cd..d5ee6cc51 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/atsui-partial-selection-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/atsui-partial-selection-expected.txt
@@ -4,15 +4,15 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x600
     LayoutBlockFlow {BODY} at (8,8) size 784x576
       LayoutBlockFlow {P} at (0,0) size 784x40
-        LayoutText {#text} at (0,0) size 51x19
-          text run at (0,0) width 51: "Test for "
-        LayoutInline {I} at (0,0) size 755x39
-          LayoutInline {A} at (0,0) size 305x19 [color=#0000EE]
-            LayoutText {#text} at (51,0) size 305x19
-              text run at (51,0) width 305: "http://bugs.webkit.org/show_bug.cgi?id=11124"
-          LayoutText {#text} at (356,0) size 755x39
-            text run at (356,0) width 4: " "
-            text run at (360,0) width 395: "REGRESSION (r14297): No drag image for partially-selected"
+        LayoutText {#text} at (0,0) size 50x19
+          text run at (0,0) width 50: "Test for "
+        LayoutInline {I} at (0,0) size 751x39
+          LayoutInline {A} at (0,0) size 303x19 [color=#0000EE]
+            LayoutText {#text} at (49,0) size 303x19
+              text run at (49,0) width 303: "http://bugs.webkit.org/show_bug.cgi?id=11124"
+          LayoutText {#text} at (351,0) size 751x39
+            text run at (351,0) width 5: " "
+            text run at (355,0) width 396: "REGRESSION (r14297): No drag image for partially-selected"
             text run at (0,20) width 83: "complex text"
         LayoutText {#text} at (83,20) size 4x19
           text run at (83,20) width 4: "."
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/atsui-pointtooffset-calls-cg-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text/atsui-pointtooffset-calls-cg-expected.png
index 863e963ae1..f9ab49f 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/atsui-pointtooffset-calls-cg-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/atsui-pointtooffset-calls-cg-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/atsui-pointtooffset-calls-cg-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/text/atsui-pointtooffset-calls-cg-expected.txt
index 5e9ece1..41360714 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/atsui-pointtooffset-calls-cg-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/atsui-pointtooffset-calls-cg-expected.txt
@@ -10,9 +10,9 @@
       LayoutBlockFlow (anonymous) at (0,38) size 800x40
         LayoutText {#text} at (0,0) size 197x19
           text run at (0,0) width 197: "This tests for regressions against "
-        LayoutInline {I} at (0,0) size 777x39
-          LayoutText {#text} at (197,0) size 777x39
-            text run at (197,0) width 580: "http://bugzilla.opendarwin.org/show_bug.cgi?id=5878 pointToOffset always takes the CG"
+        LayoutInline {I} at (0,0) size 775x39
+          LayoutText {#text} at (197,0) size 775x39
+            text run at (197,0) width 578: "http://bugzilla.opendarwin.org/show_bug.cgi?id=5878 pointToOffset always takes the CG"
             text run at (0,20) width 63: "code path"
         LayoutText {#text} at (63,20) size 603x19
           text run at (63,20) width 603: " by clicking the X and verifying that the correct caret position (13) is reported to the editing delegate."
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/atsui-small-caps-punctuation-size-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text/atsui-small-caps-punctuation-size-expected.png
index ab3c501..3f8582d9 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/atsui-small-caps-punctuation-size-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/atsui-small-caps-punctuation-size-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/atsui-small-caps-punctuation-size-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/text/atsui-small-caps-punctuation-size-expected.txt
index 781dad7..c860cd6 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/atsui-small-caps-punctuation-size-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/atsui-small-caps-punctuation-size-expected.txt
@@ -6,12 +6,12 @@
       LayoutBlockFlow {P} at (0,0) size 784x40
         LayoutText {#text} at (0,0) size 202x19
           text run at (0,0) width 202: "This tests for a regression against "
-        LayoutInline {I} at (0,0) size 734x39
+        LayoutInline {I} at (0,0) size 733x39
           LayoutInline {A} at (0,0) size 350x19 [color=#0000EE]
             LayoutText {#text} at (202,0) size 350x19
               text run at (202,0) width 350: "http://bugzilla.opendarwin.org/show_bug.cgi?id=6397"
-          LayoutText {#text} at (552,0) size 734x39
-            text run at (552,0) width 182: " ATSUI small caps use small"
+          LayoutText {#text} at (551,0) size 733x39
+            text run at (551,0) width 182: " ATSUI small caps use small"
             text run at (0,20) width 77: "punctuation"
         LayoutText {#text} at (77,20) size 4x19
           text run at (77,20) width 4: "."
@@ -20,11 +20,11 @@
           text run at (0,0) width 344: "All four question marks below should be \x{201C}big\x{201D}, like this: ?"
       LayoutBlockFlow {HR} at (0,92) size 784x2 [border: (1px inset #EEEEEE)]
       LayoutBlockFlow {P} at (0,110) size 784x20
-        LayoutText {#text} at (0,0) size 52x19
-          text run at (0,0) width 52: "ATSUI: "
-        LayoutInline {SPAN} at (0,0) size 39x19
-          LayoutText {#text} at (52,0) size 39x19
-            text run at (52,0) width 39: "A?b?e\x{300}"
+        LayoutText {#text} at (0,0) size 51x19
+          text run at (0,0) width 51: "ATSUI: "
+        LayoutInline {SPAN} at (0,0) size 40x19
+          LayoutText {#text} at (50,0) size 40x19
+            text run at (50,0) width 40: "A?b?e\x{300}"
       LayoutBlockFlow {P} at (0,146) size 784x20
         LayoutText {#text} at (0,0) size 29x19
           text run at (0,0) width 29: "CG: "
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/atsui-spacing-features-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text/atsui-spacing-features-expected.png
index e9ddd47..080e11d 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/atsui-spacing-features-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/atsui-spacing-features-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/atsui-spacing-features-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/text/atsui-spacing-features-expected.txt
index 28b97d7..2412a87 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/atsui-spacing-features-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/atsui-spacing-features-expected.txt
@@ -4,17 +4,17 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x378
     LayoutBlockFlow {BODY} at (8,16) size 784x354
       LayoutBlockFlow {P} at (0,0) size 784x40
-        LayoutText {#text} at (0,0) size 167x19
-          text run at (0,0) width 167: "Test for regressions against "
-        LayoutInline {I} at (0,0) size 757x39
-          LayoutInline {A} at (0,0) size 350x19 [color=#0000EE]
-            LayoutText {#text} at (167,0) size 350x19
-              text run at (167,0) width 350: "http://bugzilla.opendarwin.org/show_bug.cgi?id=3922"
-          LayoutText {#text} at (517,0) size 757x39
-            text run at (517,0) width 240: " Variable word/letter spacing and full"
-            text run at (0,20) width 332: "justification not supported for ATSUI-rendered text"
-        LayoutText {#text} at (332,20) size 4x19
-          text run at (332,20) width 4: "."
+        LayoutText {#text} at (0,0) size 166x19
+          text run at (0,0) width 166: "Test for regressions against "
+        LayoutInline {I} at (0,0) size 753x39
+          LayoutInline {A} at (0,0) size 351x19 [color=#0000EE]
+            LayoutText {#text} at (165,0) size 351x19
+              text run at (165,0) width 351: "http://bugzilla.opendarwin.org/show_bug.cgi?id=3922"
+          LayoutText {#text} at (515,0) size 753x39
+            text run at (515,0) width 238: " Variable word/letter spacing and full"
+            text run at (0,20) width 331: "justification not supported for ATSUI-rendered text"
+        LayoutText {#text} at (330,20) size 5x19
+          text run at (330,20) width 5: "."
       LayoutBlockFlow (anonymous) at (0,56) size 784x20
         LayoutText {#text} at (0,0) size 483x19
           text run at (0,0) width 483: "Each green box should be identical to the blue box it follows, except for accents."
@@ -23,8 +23,8 @@
         LayoutTableSection {TBODY} at (0,0) size 620x260
           LayoutTableRow {TR} at (0,2) size 620x22
             LayoutTableCell {TD} at (2,2) size 204x22 [r=0 c=0 rs=1 cs=1]
-              LayoutText {#text} at (59,1) size 86x19
-                text run at (59,1) width 86: "Word spacing"
+              LayoutText {#text} at (60,1) size 84x19
+                text run at (60,1) width 84: "Word spacing"
             LayoutTableCell {TD} at (208,2) size 204x22 [r=0 c=1 rs=1 cs=1]
               LayoutText {#text} at (59,1) size 86x19
                 text run at (59,1) width 86: "Letter spacing"
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/basic/002-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text/basic/002-expected.png
index ec1b848b..bc91b26 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/basic/002-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/basic/002-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/basic/005-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text/basic/005-expected.png
index f4e55da..5f639bd 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/basic/005-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/basic/005-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/basic/005-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/text/basic/005-expected.txt
index 76a5a20..5faa6feb 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/basic/005-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/basic/005-expected.txt
@@ -3,6 +3,6 @@
 layer at (0,0) size 800x600
   LayoutBlockFlow {HTML} at (0,0) size 800x600
     LayoutBlockFlow {BODY} at (8,8) size 784x584
-      LayoutBlockFlow (floating) {DIV} at (0,0) size 246x24 [border: (2px solid #008000)]
-        LayoutText {#text} at (2,2) size 242x19
-          text run at (2,2) width 242: "Words should have a negative spacing of 5px."
+      LayoutBlockFlow (floating) {DIV} at (0,0) size 244.72x24 [border: (2px solid #008000)]
+        LayoutText {#text} at (2,2) size 241x19
+          text run at (2,2) width 241: "Words should have a negative spacing of 5px."
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/basic/011-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text/basic/011-expected.png
index f51d73b..56eca805 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/basic/011-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/basic/011-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/basic/011-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/text/basic/011-expected.txt
index 2b185ff..787ce242 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/basic/011-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/basic/011-expected.txt
@@ -9,8 +9,8 @@
         LayoutInline {FONT} at (0,0) size 758x32
           LayoutText {#text} at (95,5) size 758x32
             text run at (95,5) width 84: "I am teeny and tiny. "
-            text run at (179,5) width 296: "I am going to have lots of text but each line should retain the big height. "
-            text run at (475,5) width 283: "If the lines shrink, it means that the root line box's height is not being"
+            text run at (178,5) width 297: "I am going to have lots of text but each line should retain the big height. "
+            text run at (474,5) width 284: "If the lines shrink, it means that the root line box's height is not being"
             text run at (0,25) width 114: "considered and that's wrong."
         LayoutText {#text} at (0,0) size 0x0
       LayoutBlockFlow {P} at (0,56) size 784x0
@@ -21,7 +21,7 @@
           LayoutInline {FONT} at (0,0) size 764x49
             LayoutText {#text} at (418,18) size 764x49
               text run at (418,18) width 84: "I am teeny and tiny. "
-              text run at (502,18) width 262: "I am going to have lots of text but each line should retain the big"
+              text run at (501,18) width 263: "I am going to have lots of text but each line should retain the big"
               text run at (0,55) width 31: "height. "
               text run at (31,55) width 408: "If the lines shrink, it means that the span's line box's height is not being considered and that's wrong."
           LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/basic/012-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text/basic/012-expected.png
index 46c66680..dc929cc 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/basic/012-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/basic/012-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/basic/013-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text/basic/013-expected.png
index a230165..306d4d7 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/basic/013-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/basic/013-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/basic/013-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/text/basic/013-expected.txt
index eb5ad32a..9bd6150 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/basic/013-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/basic/013-expected.txt
@@ -37,34 +37,34 @@
           text run at (0,20) width 263: "inherited. This was discovered in Safari 1.0."
       LayoutBlockFlow {DIV} at (0,114.44) size 784x128
         LayoutBlockFlow {P} at (0,0) size 784x20
-          LayoutText {#text} at (0,0) size 127x19
-            text run at (0,0) width 127: "Text inside "
+          LayoutText {#text} at (0,0) size 126x19
+            text run at (0,0) width 126: "Text inside "
           LayoutInline {B} at (0,0) size 48x19
-            LayoutText {#text} at (126,0) size 48x19
-              text run at (126,0) width 48: "bold"
-          LayoutText {#text} at (173,0) size 98x19
-            text run at (173,0) width 98: " element."
+            LayoutText {#text} at (125,0) size 48x19
+              text run at (125,0) width 48: "bold"
+          LayoutText {#text} at (172,0) size 98x19
+            text run at (172,0) width 98: " element."
         LayoutBlockFlow {P} at (0,36) size 784x20
-          LayoutText {#text} at (0,0) size 127x19
-            text run at (0,0) width 127: "Text inside "
-          LayoutInline {STRONG} at (0,0) size 72x19
-            LayoutText {#text} at (126,0) size 72x19
-              text run at (126,0) width 72: "strong"
-          LayoutText {#text} at (197,0) size 98x19
-            text run at (197,0) width 98: " element."
+          LayoutText {#text} at (0,0) size 126x19
+            text run at (0,0) width 126: "Text inside "
+          LayoutInline {STRONG} at (0,0) size 71x19
+            LayoutText {#text} at (125,0) size 71x19
+              text run at (125,0) width 71: "strong"
+          LayoutText {#text} at (195,0) size 99x19
+            text run at (195,0) width 99: " element."
         LayoutBlockFlow {P} at (0,72) size 784x20
-          LayoutText {#text} at (0,0) size 127x19
-            text run at (0,0) width 127: "Text inside "
+          LayoutText {#text} at (0,0) size 126x19
+            text run at (0,0) width 126: "Text inside "
           LayoutInline {I} at (0,0) size 62x19
-            LayoutText {#text} at (126,0) size 62x19
-              text run at (126,0) width 62: "italic"
-          LayoutText {#text} at (187,0) size 98x19
-            text run at (187,0) width 98: " element."
+            LayoutText {#text} at (125,0) size 62x19
+              text run at (125,0) width 62: "italic"
+          LayoutText {#text} at (186,0) size 98x19
+            text run at (186,0) width 98: " element."
         LayoutBlockFlow {P} at (0,108) size 784x20
-          LayoutText {#text} at (0,0) size 127x19
-            text run at (0,0) width 127: "Text inside "
+          LayoutText {#text} at (0,0) size 126x19
+            text run at (0,0) width 126: "Text inside "
           LayoutInline {EM} at (0,0) size 98x19
-            LayoutText {#text} at (126,0) size 98x19
-              text run at (126,0) width 98: "emphasis"
-          LayoutText {#text} at (223,0) size 99x19
-            text run at (223,0) width 99: " element."
+            LayoutText {#text} at (125,0) size 98x19
+              text run at (125,0) width 98: "emphasis"
+          LayoutText {#text} at (222,0) size 99x19
+            text run at (222,0) width 99: " element."
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/basic/generic-family-changes-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text/basic/generic-family-changes-expected.png
index 75f9e8fee..5a0fc735 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/basic/generic-family-changes-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/basic/generic-family-changes-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/basic/generic-family-changes-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/text/basic/generic-family-changes-expected.txt
index b43a1f5..f3615077 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/basic/generic-family-changes-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/basic/generic-family-changes-expected.txt
@@ -5,8 +5,8 @@
     LayoutBlockFlow {BODY} at (8,8) size 784x293
       LayoutBlockFlow (anonymous) at (0,0) size 784x60
         LayoutText {#text} at (0,0) size 773x59
-          text run at (0,0) width 503: "Tests of WebKit's intepretation of font sizes when no absolute font size is specified. "
-          text run at (503,0) width 255: "Percentages and logical keywords scale to"
+          text run at (0,0) width 501: "Tests of WebKit's intepretation of font sizes when no absolute font size is specified. "
+          text run at (500,0) width 256: "Percentages and logical keywords scale to"
           text run at (0,20) width 136: "reflect the family type. "
           text run at (136,20) width 637: "Opera 9 matches this behavior as well (except it has a bug with multiple font-family mappings as in the first"
           text run at (0,40) width 59: "example)."
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/basic/generic-family-reset-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text/basic/generic-family-reset-expected.png
index 4b75aa76..4f5ca7d 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/basic/generic-family-reset-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/basic/generic-family-reset-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/basic/generic-family-reset-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/text/basic/generic-family-reset-expected.txt
index 260b3c6d..9247ac35 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/basic/generic-family-reset-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/basic/generic-family-reset-expected.txt
@@ -12,14 +12,14 @@
             LayoutTableCell {TD} at (10,10) size 764x200 [r=0 c=0 rs=1 cs=2]
               LayoutText {#text} at (1,1) size 352x18
                 text run at (1,1) width 352: "The css in the head of this file is like this:"
-              LayoutBR {BR} at (353,16) size 0x0
+              LayoutBR {BR} at (352,16) size 1x0
               LayoutBR {BR} at (1,19) size 0x18
               LayoutText {#text} at (1,37) size 110x18
                 text run at (1,37) width 110: "html, body { "
               LayoutBR {BR} at (111,52) size 0x0
-              LayoutText {#text} at (1,55) size 207x18
-                text run at (1,55) width 207: "    font-family: Verdana; "
-              LayoutBR {BR} at (208,70) size 0x0
+              LayoutText {#text} at (1,55) size 206x18
+                text run at (1,55) width 206: "    font-family: Verdana; "
+              LayoutBR {BR} at (206,70) size 1x0
               LayoutText {#text} at (1,73) size 10x18
                 text run at (1,73) width 10: "}"
               LayoutBR {BR} at (11,88) size 0x0
@@ -28,7 +28,7 @@
               LayoutBR {BR} at (82,106) size 0x0
               LayoutText {#text} at (1,109) size 168x18
                 text run at (1,109) width 168: "    font-size: 0.8em;"
-              LayoutBR {BR} at (169,124) size 0x0
+              LayoutBR {BR} at (168,124) size 1x0
               LayoutText {#text} at (1,127) size 10x18
                 text run at (1,127) width 10: "}"
               LayoutBR {BR} at (11,142) size 0x0
@@ -46,20 +46,20 @@
                 text run at (155,1) width 68: "<span>"
           LayoutTableRow {TR} at (0,250) size 784x18
             LayoutTableCell {TD} at (10,250) size 376x18 [r=2 c=0 rs=1 cs=1]
-              LayoutInline {TT} at (0,0) size 264x16
-                LayoutText {#text} at (1,1) size 264x16
-                  text run at (1,1) width 264: "font-family: Verdana; font-size: 0.8em;"
+              LayoutInline {TT} at (0,0) size 263x16
+                LayoutText {#text} at (1,1) size 263x16
+                  text run at (1,1) width 263: "font-family: Verdana; font-size: 0.8em;"
               LayoutText {#text} at (0,0) size 0x0
             LayoutTableCell {TD} at (396,250) size 378x18 [r=2 c=1 rs=1 cs=1]
-              LayoutInline {SPAN} at (0,0) size 264x16
-                LayoutText {#text} at (1,1) size 264x16
-                  text run at (1,1) width 264: "font-family: Verdana; font-size: 0.8em;"
+              LayoutInline {SPAN} at (0,0) size 263x16
+                LayoutText {#text} at (1,1) size 263x16
+                  text run at (1,1) width 263: "font-family: Verdana; font-size: 0.8em;"
               LayoutText {#text} at (0,0) size 0x0
           LayoutTableRow {TR} at (0,278) size 784x18
             LayoutTableCell {TD} at (10,278) size 376x18 [r=3 c=0 rs=1 cs=1]
-              LayoutInline {TT} at (0,0) size 322x16
-                LayoutText {#text} at (1,1) size 322x16
-                  text run at (1,1) width 322: "font-family: inherit (Verdana); font-size: 0.8em;"
+              LayoutInline {TT} at (0,0) size 321x16
+                LayoutText {#text} at (1,1) size 321x16
+                  text run at (1,1) width 321: "font-family: inherit (Verdana); font-size: 0.8em;"
               LayoutText {#text} at (0,0) size 0x0
             LayoutTableCell {TD} at (396,278) size 378x18 [r=3 c=1 rs=1 cs=1]
               LayoutInline {SPAN} at (0,0) size 251x16
@@ -68,14 +68,14 @@
               LayoutText {#text} at (0,0) size 0x0
           LayoutTableRow {TR} at (0,306) size 784x20
             LayoutTableCell {TD} at (10,306) size 376x20 [r=4 c=0 rs=1 cs=1]
-              LayoutInline {TT} at (0,0) size 327x18
-                LayoutText {#text} at (1,1) size 327x18
-                  text run at (1,1) width 327: "font-family: Verdana; font-size: 1.0em;"
+              LayoutInline {TT} at (0,0) size 326x18
+                LayoutText {#text} at (1,1) size 326x18
+                  text run at (1,1) width 326: "font-family: Verdana; font-size: 1.0em;"
               LayoutText {#text} at (0,0) size 0x0
             LayoutTableCell {TD} at (396,306) size 378x20 [r=4 c=1 rs=1 cs=1]
-              LayoutInline {SPAN} at (0,0) size 327x18
-                LayoutText {#text} at (1,1) size 327x18
-                  text run at (1,1) width 327: "font-family: Verdana; font-size: 1.0em;"
+              LayoutInline {SPAN} at (0,0) size 326x18
+                LayoutText {#text} at (1,1) size 326x18
+                  text run at (1,1) width 326: "font-family: Verdana; font-size: 1.0em;"
               LayoutText {#text} at (0,0) size 0x0
           LayoutTableRow {TR} at (0,336) size 784x18
             LayoutTableCell {TD} at (10,338) size 376x14 [r=5 c=0 rs=1 cs=1]
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/bidi-embedding-pop-and-push-same-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text/bidi-embedding-pop-and-push-same-expected.png
index 9db1a2e..df3e978b 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/bidi-embedding-pop-and-push-same-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/bidi-embedding-pop-and-push-same-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/bidi-embedding-pop-and-push-same-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/text/bidi-embedding-pop-and-push-same-expected.txt
index 9af1479..102c237 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/bidi-embedding-pop-and-push-same-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/bidi-embedding-pop-and-push-same-expected.txt
@@ -4,8 +4,8 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x600
     LayoutBlockFlow {BODY} at (8,8) size 784x584
       LayoutBlockFlow {P} at (0,0) size 784x20
-        LayoutText {#text} at (0,0) size 491x19
-          text run at (0,0) width 491: "In each box below, the words or letters should be in the same order on every line."
+        LayoutText {#text} at (0,0) size 490x19
+          text run at (0,0) width 490: "In each box below, the words or letters should be in the same order on every line."
       LayoutBlockFlow {DIV} at (8,36) size 768x70 [border: (1px solid #ADD8E6)]
         LayoutBlockFlow {DIV} at (5,5) size 758x20
           LayoutText {#text} at (0,0) size 44x19
@@ -36,15 +36,15 @@
             LayoutInline {SPAN} at (0,0) size 34x19
               LayoutText {#text} at (83,0) size 34x19
                 text run at (83,0) width 34: "dolor"
-            LayoutText {#text} at (117,0) size 4x19
-              text run at (117,0) width 4: " "
-            LayoutInline {I} at (0,0) size 16x19
-              LayoutText {#text} at (121,0) size 16x19
-                text run at (121,0) width 16: "sit"
-            LayoutText {#text} at (137,0) size 37x19
-              text run at (137,0) width 37: " amet"
-          LayoutText {#text} at (174,0) size 4x19
-            text run at (174,0) width 4: "."
+            LayoutText {#text} at (116,0) size 5x19
+              text run at (116,0) width 5: " "
+            LayoutInline {I} at (0,0) size 17x19
+              LayoutText {#text} at (120,0) size 17x19
+                text run at (120,0) width 17: "sit"
+            LayoutText {#text} at (136,0) size 38x19
+              text run at (136,0) width 38: " amet"
+          LayoutText {#text} at (173,0) size 5x19
+            text run at (173,0) width 5: "."
       LayoutBlockFlow {DIV} at (8,114) size 768x70 [border: (1px solid #ADD8E6)]
         LayoutBlockFlow {DIV} at (5,5) size 758x20
           LayoutText {#text} at (0,0) size 44x19
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/bidi-img-alt-text-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text/bidi-img-alt-text-expected.png
index 77413490..58c5007 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/bidi-img-alt-text-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/bidi-img-alt-text-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/bidi-img-alt-text-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/text/bidi-img-alt-text-expected.txt
index a66ea8a..d815678 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/bidi-img-alt-text-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/bidi-img-alt-text-expected.txt
@@ -17,8 +17,8 @@
           text run at (302,408) width 4: " "
         LayoutText {#text} at (0,0) size 0x0
       LayoutBlockFlow {P} at (0,444) size 784x20
-        LayoutText {#text} at (0,0) size 338x19
-          text run at (0,0) width 338: "Tests that image alt text takes directionality into account."
+        LayoutText {#text} at (0,0) size 337x19
+          text run at (0,0) width 337: "Tests that image alt text takes directionality into account."
 layer at (8,8) size 302x102 clip at (9,9) size 300x100 scrollHeight 134
   LayoutBlockFlow (relative positioned) {SECTION} at (0,0) size 302x102 [border: (1px solid #FF0000)]
     LayoutBlockFlow {H2} at (1,20.91) size 300x27
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/break-word-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text/break-word-expected.png
index 8a337db..60ce314 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/break-word-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/break-word-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/break-word-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/text/break-word-expected.txt
index 02111f3..ca32867 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/break-word-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/break-word-expected.txt
@@ -4,18 +4,18 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x600
     LayoutBlockFlow {BODY} at (8,8) size 784x584
       LayoutBlockFlow {P} at (0,0) size 784x40
-        LayoutText {#text} at (0,0) size 51x19
-          text run at (0,0) width 51: "Test for "
-        LayoutInline {I} at (0,0) size 747x39
-          LayoutInline {A} at (0,0) size 305x19 [color=#0000EE]
-            LayoutText {#text} at (51,0) size 305x19
-              text run at (51,0) width 305: "http://bugs.webkit.org/show_bug.cgi?id=12726"
-          LayoutText {#text} at (356,0) size 747x39
-            text run at (356,0) width 4: " "
-            text run at (360,0) width 387: "REGRESSION (r12073): Text wraps in the middle of a word"
-            text run at (0,20) width 315: "instead of wrapping at the space before the word"
-        LayoutText {#text} at (315,20) size 4x19
-          text run at (315,20) width 4: "."
+        LayoutText {#text} at (0,0) size 50x19
+          text run at (0,0) width 50: "Test for "
+        LayoutInline {I} at (0,0) size 744x39
+          LayoutInline {A} at (0,0) size 306x19 [color=#0000EE]
+            LayoutText {#text} at (49,0) size 306x19
+              text run at (49,0) width 306: "http://bugs.webkit.org/show_bug.cgi?id=12726"
+          LayoutText {#text} at (354,0) size 744x39
+            text run at (354,0) width 5: " "
+            text run at (358,0) width 386: "REGRESSION (r12073): Text wraps in the middle of a word"
+            text run at (0,20) width 314: "instead of wrapping at the space before the word"
+        LayoutText {#text} at (313,20) size 5x19
+          text run at (313,20) width 5: "."
       LayoutBlockFlow {P} at (0,56) size 784x20
         LayoutText {#text} at (0,0) size 361x19
           text run at (0,0) width 361: "\x{201C}onelongwrodwithnobreaks\x{201D} should not break in the middle."
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/capitalize-boundaries-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text/capitalize-boundaries-expected.png
index 6f54e1f..53c8bec 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/capitalize-boundaries-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/capitalize-boundaries-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/capitalize-boundaries-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/text/capitalize-boundaries-expected.txt
index adad744d..eea60853 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/capitalize-boundaries-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/capitalize-boundaries-expected.txt
@@ -10,13 +10,13 @@
           LayoutText {#text} at (334,0) size 46x19
             text run at (334,0) width 46: "Bugzilla"
         LayoutText {#text} at (380,0) size 767x79
-          text run at (380,0) width 379: ". Currently, the \"Browser rendering\" results are not expected to"
+          text run at (380,0) width 378: ". Currently, the \"Browser rendering\" results are not expected to"
           text run at (0,20) width 634: "match the \"Correct output sample\" results. In fact, I do not entirely agree with all of the given test cases in "
           text run at (634,20) width 79: "terms of their"
           text run at (0,40) width 767: "expected results, nor do I think that the browser should yet be expected to match all of the cases in the different languages, but I"
           text run at (0,60) width 22: "am "
-          text run at (22,60) width 273: "(at least temporarily) adding the test anyway. "
-        LayoutBR {BR} at (295,75) size 0x0
+          text run at (22,60) width 272: "(at least temporarily) adding the test anyway. "
+        LayoutBR {BR} at (293,75) size 1x0
         LayoutBR {BR} at (0,80) size 0x19
       LayoutTable {TABLE} at (0,100) size 769x411
         LayoutBlockFlow {CAPTION} at (0,0) size 769x20
@@ -73,8 +73,8 @@
               LayoutInline {SPAN} at (0,0) size 39x19
                 LayoutText {#text} at (183,52) size 39x19
                   text run at (183,52) width 39: "burger"
-              LayoutText {#text} at (222,52) size 112x19
-                text run at (222,52) width 112: " [house] ~six -big-"
+              LayoutText {#text} at (221,52) size 113x19
+                text run at (221,52) width 113: " [house] ~six -big-"
           LayoutTableRow {TR} at (0,206) size 769x24
             LayoutTableCell {TH} at (2,206) size 53x24 [bgcolor=#F8F8F8] [border: (1px solid #EEEEEE)] [r=4 c=0 rs=1 cs=1]
               LayoutText {#text} at (19,2) size 15x19
@@ -162,10 +162,10 @@
             LayoutTableCell {TD} at (57,130) size 710x74 [border: (1px solid #EEEEEE)] [r=3 c=1 rs=1 cs=1]
               LayoutText {#text} at (2,8) size 449x19
                 text run at (2,8) width 449: "'Cept Nut'in Safari\x{2019}s \x{2018}Sure\x{2019} Na\x{EF}ve R\x{E9}sum\x{E9}\x{2014}H\x{E1}\x{10D}ek Full\x{2010}time One-to-One"
-              LayoutBR {BR} at (451,23) size 0x0
-              LayoutText {#text} at (2,32) size 314x19
-                text run at (2,32) width 314: "\"Newcastle-upon-Tyne\" Washington\x{2011}on\x{2011}the\x{2011}Brazos"
-              LayoutBR {BR} at (316,47) size 0x0
+              LayoutBR {BR} at (450,23) size 1x0
+              LayoutText {#text} at (2,32) size 312x19
+                text run at (2,32) width 312: "\"Newcastle-upon-Tyne\" Washington\x{2011}on\x{2011}the\x{2011}Brazos"
+              LayoutBR {BR} at (313,47) size 1x0
               LayoutText {#text} at (2,52) size 349x19
                 text run at (2,52) width 349: "Earthquake Earthworm Cheeseburger [House] ~Six -Big-"
           LayoutTableRow {TR} at (0,206) size 769x24
@@ -182,9 +182,9 @@
             LayoutTableCell {TD} at (57,232) size 710x27 [border: (1px solid #EEEEEE)] [r=5 c=1 rs=1 cs=1]
               LayoutText {#text} at (2,5) size 213x19
                 text run at (2,5) width 213: "Quelqu'un l\x{2019}Amour t'Appelles\x{2011}Tu 3"
-              LayoutInline {SUP} at (0,0) size 21x15
-                LayoutText {#text} at (215,2) size 21x15
-                  text run at (215,2) width 21: "eme"
+              LayoutInline {SUP} at (0,0) size 22x15
+                LayoutText {#text} at (214,2) size 22x15
+                  text run at (214,2) width 22: "eme"
           LayoutTableRow {TR} at (0,261) size 769x24
             LayoutTableCell {TH} at (2,261) size 53x24 [bgcolor=#F8F8F8] [border: (1px solid #EEEEEE)] [r=6 c=0 rs=1 cs=1]
               LayoutText {#text} at (18,2) size 17x19
@@ -256,9 +256,9 @@
               LayoutText {#text} at (2,8) size 457x19
                 text run at (2,8) width 457: "'Cept Nut'in Safari\x{2019}s \x{2018}Sure\x{2019} Nai\x{308}ve R\x{E9}sum\x{E9}\x{2014}H\x{E1}c\x{30C}ek Full\x{2010}Time One-To-One"
               LayoutBR {BR} at (458,23) size 1x0
-              LayoutText {#text} at (2,32) size 327x19
-                text run at (2,32) width 327: "\"Newcastle\x{2011}Upon\x{2011}Tyne\" Washington\x{2011}On\x{2011}The\x{2011}Brazos"
-              LayoutBR {BR} at (329,47) size 0x0
+              LayoutText {#text} at (2,32) size 325x19
+                text run at (2,32) width 325: "\"Newcastle\x{2011}Upon\x{2011}Tyne\" Washington\x{2011}On\x{2011}The\x{2011}Brazos"
+              LayoutBR {BR} at (326,47) size 1x0
               LayoutInline {SPAN} at (0,0) size 32x19
                 LayoutText {#text} at (2,52) size 32x19
                   text run at (2,52) width 32: "Earth"
@@ -275,8 +275,8 @@
               LayoutInline {SPAN} at (0,0) size 39x19
                 LayoutText {#text} at (191,52) size 39x19
                   text run at (191,52) width 39: "burger"
-              LayoutText {#text} at (230,52) size 121x19
-                text run at (230,52) width 121: " [House] ~Six -Big-"
+              LayoutText {#text} at (229,52) size 122x19
+                text run at (229,52) width 122: " [House] ~Six -Big-"
           LayoutTableRow {TR} at (0,206) size 769x24
             LayoutTableCell {TH} at (2,206) size 53x24 [bgcolor=#F8F8F8] [border: (1px solid #EEEEEE)] [r=4 c=0 rs=1 cs=1]
               LayoutText {#text} at (19,2) size 15x19
@@ -289,11 +289,11 @@
               LayoutText {#text} at (21,2) size 11x19
                 text run at (21,2) width 11: "fr"
             LayoutTableCell {TD} at (57,232) size 710x27 [border: (1px solid #EEEEEE)] [r=5 c=1 rs=1 cs=1]
-              LayoutText {#text} at (2,5) size 216x19
-                text run at (2,5) width 216: "Quelqu'un L\x{2019}amour T'appelles\x{2011}Tu 3"
-              LayoutInline {SUP} at (0,0) size 21x15
-                LayoutText {#text} at (218,2) size 21x15
-                  text run at (218,2) width 21: "eme"
+              LayoutText {#text} at (2,5) size 214x19
+                text run at (2,5) width 214: "Quelqu'un L\x{2019}amour T'appelles\x{2011}Tu 3"
+              LayoutInline {SUP} at (0,0) size 22x15
+                LayoutText {#text} at (215,2) size 22x15
+                  text run at (215,2) width 22: "eme"
           LayoutTableRow {TR} at (0,261) size 769x24
             LayoutTableCell {TH} at (2,261) size 53x24 [bgcolor=#F8F8F8] [border: (1px solid #EEEEEE)] [r=6 c=0 rs=1 cs=1]
               LayoutText {#text} at (18,2) size 17x19
@@ -327,5 +327,5 @@
               LayoutText {#text} at (18,2) size 17x19
                 text run at (18,2) width 17: "tlh"
             LayoutTableCell {TD} at (57,365) size 710x24 [border: (1px solid #EEEEEE)] [r=10 c=1 rs=1 cs=1]
-              LayoutText {#text} at (2,2) size 192x19
-                text run at (2,2) width 192: "TlhIngan Hol Wa''Uy' Loghqam"
+              LayoutText {#text} at (2,2) size 191x19
+                text run at (2,2) width 191: "TlhIngan Hol Wa''Uy' Loghqam"
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/capitalize-empty-generated-string-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text/capitalize-empty-generated-string-expected.png
index 60a85f5b..9118799 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/capitalize-empty-generated-string-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/capitalize-empty-generated-string-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/capitalize-empty-generated-string-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/text/capitalize-empty-generated-string-expected.txt
index 7275d44..c01e16aa 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/capitalize-empty-generated-string-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/capitalize-empty-generated-string-expected.txt
@@ -10,9 +10,9 @@
           LayoutInline {A} at (0,0) size 350x19 [color=#0000EE]
             LayoutText {#text} at (164,0) size 350x19
               text run at (164,0) width 350: "http://bugzilla.opendarwin.org/show_bug.cgi?id=9432"
-          LayoutText {#text} at (514,0) size 762x39
-            text run at (514,0) width 4: " "
-            text run at (518,0) width 244: "REGRESSION: crash in capitalization"
+          LayoutText {#text} at (513,0) size 762x39
+            text run at (513,0) width 5: " "
+            text run at (517,0) width 245: "REGRESSION: crash in capitalization"
             text run at (0,20) width 279: "code due to empty-string generated content"
         LayoutText {#text} at (279,20) size 4x19
           text run at (279,20) width 4: "."
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/capitalize-preserve-nbsp-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text/capitalize-preserve-nbsp-expected.png
index 5d4e1c6..83afb6f4 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/capitalize-preserve-nbsp-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/capitalize-preserve-nbsp-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/capitalize-preserve-nbsp-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/text/capitalize-preserve-nbsp-expected.txt
index cd9c82b..04c8ebec 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/capitalize-preserve-nbsp-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/capitalize-preserve-nbsp-expected.txt
@@ -4,18 +4,18 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x600
     LayoutBlockFlow {BODY} at (8,8) size 784x576
       LayoutBlockFlow {P} at (0,0) size 784x40
-        LayoutText {#text} at (0,0) size 51x19
-          text run at (0,0) width 51: "Test for "
-        LayoutInline {I} at (0,0) size 775x39
+        LayoutText {#text} at (0,0) size 50x19
+          text run at (0,0) width 50: "Test for "
+        LayoutInline {I} at (0,0) size 773x39
           LayoutInline {A} at (0,0) size 305x19 [color=#0000EE]
-            LayoutText {#text} at (51,0) size 305x19
-              text run at (51,0) width 305: "http://bugs.webkit.org/show_bug.cgi?id=11671"
-          LayoutText {#text} at (356,0) size 775x39
-            text run at (356,0) width 4: " "
-            text run at (360,0) width 415: "REGRESSION (r13702): text-transform: capitalize changes non-"
+            LayoutText {#text} at (49,0) size 305x19
+              text run at (49,0) width 305: "http://bugs.webkit.org/show_bug.cgi?id=11671"
+          LayoutText {#text} at (353,0) size 773x39
+            text run at (353,0) width 5: " "
+            text run at (357,0) width 416: "REGRESSION (r13702): text-transform: capitalize changes non-"
             text run at (0,20) width 166: "breaking spaces to spaces"
-        LayoutText {#text} at (166,20) size 4x19
-          text run at (166,20) width 4: "."
+        LayoutText {#text} at (165,20) size 5x19
+          text run at (165,20) width 5: "."
       LayoutBlockFlow {P} at (0,56) size 784x20
         LayoutText {#text} at (0,0) size 268x19
           text run at (0,0) width 268: "The next three lines should all look the same."
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/caps-lock-indicator-disabled-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text/caps-lock-indicator-disabled-expected.png
index c71df245..570d6f2 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/caps-lock-indicator-disabled-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/caps-lock-indicator-disabled-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/caps-lock-indicator-disabled-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/text/caps-lock-indicator-disabled-expected.txt
index 9639315..0dab1817 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/caps-lock-indicator-disabled-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/caps-lock-indicator-disabled-expected.txt
@@ -3,9 +3,9 @@
 layer at (0,0) size 800x58
   LayoutBlockFlow {HTML} at (0,0) size 800x58
     LayoutBlockFlow {BODY} at (8,8) size 784x42
-      LayoutText {#text} at (0,0) size 550x19
-        text run at (0,0) width 550: "Test passes if password field does not include caps lock icon on right edge on any platform."
-      LayoutBR {BR} at (550,0) size 0x19
+      LayoutText {#text} at (0,0) size 549x19
+        text run at (0,0) width 549: "Test passes if password field does not include caps lock icon on right edge on any platform."
+      LayoutBR {BR} at (548,0) size 1x19
       LayoutTextControl {INPUT} at (0,20) size 154x22 [bgcolor=#FFFFFF] [border: (2px inset #EEEEEE)]
       LayoutText {#text} at (0,0) size 0x0
       LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/caps-lock-indicator-enabled-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text/caps-lock-indicator-enabled-expected.png
index b90f990..32a39e4 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/caps-lock-indicator-enabled-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/caps-lock-indicator-enabled-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/caps-lock-indicator-enabled-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/text/caps-lock-indicator-enabled-expected.txt
index b5c14c71..1c2a3006 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/caps-lock-indicator-enabled-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/caps-lock-indicator-enabled-expected.txt
@@ -3,9 +3,9 @@
 layer at (0,0) size 800x58
   LayoutBlockFlow {HTML} at (0,0) size 800x58
     LayoutBlockFlow {BODY} at (8,8) size 784x42
-      LayoutText {#text} at (0,0) size 542x19
-        text run at (0,0) width 542: "Test passes if password field includes caps lock icon on right edge on Mac platforms only."
-      LayoutBR {BR} at (542,0) size 0x19
+      LayoutText {#text} at (0,0) size 540x19
+        text run at (0,0) width 540: "Test passes if password field includes caps lock icon on right edge on Mac platforms only."
+      LayoutBR {BR} at (539,0) size 1x19
       LayoutTextControl {INPUT} at (0,20) size 154x22 [bgcolor=#FFFFFF] [border: (2px inset #EEEEEE)]
       LayoutText {#text} at (0,0) size 0x0
       LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/chromium-linux-fontconfig-renderstyle-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text/chromium-linux-fontconfig-renderstyle-expected.png
index 8265962..b6cf3427 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/chromium-linux-fontconfig-renderstyle-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/chromium-linux-fontconfig-renderstyle-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/chromium-linux-fontconfig-renderstyle-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/text/chromium-linux-fontconfig-renderstyle-expected.txt
index be86250..59cbe52 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/chromium-linux-fontconfig-renderstyle-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/chromium-linux-fontconfig-renderstyle-expected.txt
@@ -32,8 +32,8 @@
             LayoutListMarker (anonymous) at (-21,0) size 16x19: "2"
             LayoutText {#text} at (0,0) size 665x39
               text run at (0,0) width 315: "The following text should be slightly-hinted Georgia. "
-              text run at (315,0) width 57: "The dots "
-              text run at (372,0) width 293: "should be equally spaced, and letters in the word"
+              text run at (314,0) width 58: "The dots "
+              text run at (371,0) width 294: "should be equally spaced, and letters in the word"
               text run at (0,20) width 84: "\"government\" "
               text run at (84,20) width 392: "should be naturally spaced (without an ugly space before the \"e\")."
           LayoutBlockFlow {P} at (0,56) size 744x19
@@ -42,20 +42,20 @@
         LayoutListItem {LI} at (40,162) size 744x75
           LayoutBlockFlow {P} at (0,0) size 744x40
             LayoutListMarker (anonymous) at (-21,0) size 16x19: "3"
-            LayoutText {#text} at (0,0) size 738x39
-              text run at (0,0) width 377: "The following text should be unhinted Verdana. The fontconfig "
-              text run at (377,0) width 361: "configuration for this is contradictory, setting both full-hinting"
+            LayoutText {#text} at (0,0) size 736x39
+              text run at (0,0) width 376: "The following text should be unhinted Verdana. The fontconfig "
+              text run at (375,0) width 361: "configuration for this is contradictory, setting both full-hinting"
               text run at (0,20) width 245: "and no-hinting. The latter should win out."
           LayoutBlockFlow {P} at (0,56) size 744x19
-            LayoutText {#text} at (0,0) size 632x19
+            LayoutText {#text} at (0,0) size 631x19
               text run at (0,0) width 444: "Here is Tigger doing what tiggers do best \x{2026} operating "
-              text run at (444,0) width 188: "hydraulic exoskeletons."
+              text run at (443,0) width 188: "hydraulic exoskeletons."
         LayoutListItem {LI} at (40,253) size 744x56
           LayoutBlockFlow {P} at (0,0) size 744x20
             LayoutListMarker (anonymous) at (-21,0) size 16x19: "4"
             LayoutText {#text} at (0,0) size 595x19
               text run at (0,0) width 374: "The following text should show a difference caused by forcing "
-              text run at (374,0) width 221: "autohinting. Note: the effect is subtle."
+              text run at (373,0) width 222: "autohinting. Note: the effect is subtle."
           LayoutBlockFlow {P} at (0,36) size 744x20
             LayoutInline {SPAN} at (0,0) size 48x11
               LayoutText {#text} at (0,6) size 48x11
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/complex-text-rtl-selection-repaint-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text/complex-text-rtl-selection-repaint-expected.png
index 96d10a6..08d0755 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/complex-text-rtl-selection-repaint-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/complex-text-rtl-selection-repaint-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/complex-text-rtl-selection-repaint-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/text/complex-text-rtl-selection-repaint-expected.txt
index 2b316b3..1f0e3e0 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/complex-text-rtl-selection-repaint-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/complex-text-rtl-selection-repaint-expected.txt
@@ -9,7 +9,7 @@
             text run at (0,0) width 75 RTL override: "m\x{300}uspimeroL"
         LayoutText {#text} at (0,0) size 0x0
       LayoutBlockFlow {P} at (0,36) size 784x20
-        LayoutText {#text} at (0,0) size 382x19
-          text run at (0,0) width 382: "Tests that rtl selections are repainted correctly for complex text."
+        LayoutText {#text} at (0,0) size 381x19
+          text run at (0,0) width 381: "Tests that rtl selections are repainted correctly for complex text."
 selection start: position 2 of child 0 {#text} of child 3 {BDO} of body
 selection end:   position 6 of child 0 {#text} of child 3 {BDO} of body
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/delete-hard-break-character-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text/delete-hard-break-character-expected.png
index 36701b2..2424a0a 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/delete-hard-break-character-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/delete-hard-break-character-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/delete-hard-break-character-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/text/delete-hard-break-character-expected.txt
index 5bd4d438c..76b381d1 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/delete-hard-break-character-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/delete-hard-break-character-expected.txt
@@ -4,15 +4,15 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x600
     LayoutBlockFlow {BODY} at (8,8) size 784x584
       LayoutBlockFlow {P} at (0,0) size 784x40
-        LayoutText {#text} at (0,0) size 51x19
-          text run at (0,0) width 51: "Test for "
-        LayoutInline {I} at (0,0) size 670x39
-          LayoutInline {A} at (0,0) size 305x19 [color=#0000EE]
-            LayoutText {#text} at (51,0) size 305x19
-              text run at (51,0) width 305: "http://bugs.webkit.org/show_bug.cgi?id=10144"
-          LayoutText {#text} at (356,0) size 670x39
-            text run at (356,0) width 4: " "
-            text run at (360,0) width 310: "REGRESSION: Reproducible assertion failure in"
+        LayoutText {#text} at (0,0) size 50x19
+          text run at (0,0) width 50: "Test for "
+        LayoutInline {I} at (0,0) size 668x39
+          LayoutInline {A} at (0,0) size 306x19 [color=#0000EE]
+            LayoutText {#text} at (49,0) size 306x19
+              text run at (49,0) width 306: "http://bugs.webkit.org/show_bug.cgi?id=10144"
+          LayoutText {#text} at (354,0) size 668x39
+            text run at (354,0) width 5: " "
+            text run at (358,0) width 310: "REGRESSION: Reproducible assertion failure in"
             text run at (0,20) width 292: "DeleteSelectionCommand::fixupWhitespace()"
         LayoutText {#text} at (292,20) size 4x19
           text run at (292,20) width 4: "."
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/drawBidiText-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text/drawBidiText-expected.png
index 615bbdb1..dc3d373 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/drawBidiText-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/drawBidiText-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/drawBidiText-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/text/drawBidiText-expected.txt
index b40d7cb..0c1895f5 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/drawBidiText-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/drawBidiText-expected.txt
@@ -4,51 +4,51 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x600
     LayoutBlockFlow {BODY} at (8,8) size 784x584
       LayoutBlockFlow {P} at (0,0) size 784x20
-        LayoutText {#text} at (0,0) size 264x19
-          text run at (0,0) width 264: "This tests GraphicsContext::drawBidiText()."
-layer at (8,44) size 327x209 clip at (9,45) size 310x207
-  LayoutListBox {SELECT} at (0,36) size 327x209 [bgcolor=#FFFFFF] [border: (1px solid #A9A9A9)]
-    LayoutBlockFlow {OPTION} at (1,1) size 310x23
+        LayoutText {#text} at (0,0) size 263x19
+          text run at (0,0) width 263: "This tests GraphicsContext::drawBidiText()."
+layer at (8,44) size 327x209 clip at (9,45) size 310x207 scrollHeight 231
+  LayoutListBox {SELECT} at (0,36) size 326.69x209 [bgcolor=#FFFFFF] [border: (1px solid #A9A9A9)]
+    LayoutBlockFlow {OPTION} at (1,1) size 309.69x23
       LayoutText {#text} at (2,0) size 199x21
         text run at (2,0) width 40: "First "
         text run at (42,0) width 60 RTL: ") \x{5E8}\x{5D1}\x{5D9}\x{5E2}\x{5D9}\x{5EA}"
         text run at (102,0) width 20: "03"
         text run at (122,0) width 45 RTL: "\x{5E9}\x{5E0}\x{5D9}\x{5D4} ("
         text run at (167,0) width 34: " fifth"
-    LayoutBlockFlow {OPTION} at (1,24) size 310x23
-      LayoutText {#text} at (109,0) size 199x21
-        text run at (109,0) width 29: "fifth"
-        text run at (138,0) width 65 RTL: ") \x{5E8}\x{5D1}\x{5D9}\x{5E2}\x{5D9}\x{5EA} "
-        text run at (203,0) width 20: "03"
-        text run at (223,0) width 50 RTL: " \x{5E9}\x{5E0}\x{5D9}\x{5D4} ("
-        text run at (273,0) width 35: "First"
-    LayoutBlockFlow {OPTION} at (1,47) size 310x23
+    LayoutBlockFlow {OPTION} at (1,24) size 309.69x23
+      LayoutText {#text} at (108,0) size 200x21
+        text run at (108,0) width 30: "fifth"
+        text run at (137,0) width 66 RTL: ") \x{5E8}\x{5D1}\x{5D9}\x{5E2}\x{5D9}\x{5EA} "
+        text run at (202,0) width 21: "03"
+        text run at (222,0) width 51 RTL: " \x{5E9}\x{5E0}\x{5D9}\x{5D4} ("
+        text run at (272,0) width 36: "First"
+    LayoutBlockFlow {OPTION} at (1,47) size 309.69x23
       LayoutText {#text} at (2,0) size 199x21
         text run at (2,0) width 199 LTR override: "First \x{5E9}\x{5E0}\x{5D9}\x{5D4} (03) \x{5E8}\x{5D1}\x{5D9}\x{5E2}\x{5D9}\x{5EA} fifth"
-    LayoutBlockFlow {OPTION} at (1,70) size 310x23
-      LayoutText {#text} at (109,0) size 199x21
-        text run at (109,0) width 199 RTL override: "First \x{5E9}\x{5E0}\x{5D9}\x{5D4} (03) \x{5E8}\x{5D1}\x{5D9}\x{5E2}\x{5D9}\x{5EA} fifth"
-    LayoutBlockFlow {OPTION} at (1,93) size 310x23
+    LayoutBlockFlow {OPTION} at (1,70) size 309.69x23
+      LayoutText {#text} at (108,0) size 200x21
+        text run at (108,0) width 200 RTL override: "First \x{5E9}\x{5E0}\x{5D9}\x{5D4} (03) \x{5E8}\x{5D1}\x{5D9}\x{5E2}\x{5D9}\x{5EA} fifth"
+    LayoutBlockFlow {OPTION} at (1,93) size 309.69x23
       LayoutText {#text} at (2,0) size 100x21
         text run at (2,0) width 100 RTL: "\x{5DE}\x{5E9}\x{5D4}\x{5D5} \x{5E2}\x{5DD} \x{5E0}\x{5B4}\x{5E7}\x{5BC}\x{5D5}\x{5BC}\x{5D3}"
-    LayoutBlockFlow {OPTION} at (1,116) size 310x23
+    LayoutBlockFlow {OPTION} at (1,116) size 309.69x23
       LayoutText {#text} at (2,0) size 70x21
         text run at (2,0) width 70 RTL: "\x{627}\x{644}\x{644}\x{63A}\x{629} \x{627}\x{644}\x{639}\x{631}\x{628}\x{64A}\x{629}"
-    LayoutBlockFlow {OPTION} at (1,139) size 310x23
+    LayoutBlockFlow {OPTION} at (1,139) size 309.69x23
       LayoutText {#text} at (2,0) size 126x21
         text run at (2,0) width 126: "Et volia\x{300}: ATSUI!"
-    LayoutBlockFlow {OPTION} at (1,162) size 310x23
-      LayoutText {#text} at (2,0) size 282x21
-        text run at (2,0) width 90: "Directional "
-        text run at (92,0) width 74 RTL override: "\x{202E}overrides"
-        text run at (166,0) width 118: "\x{202C} are confusing."
-    LayoutBlockFlow {OPTION} at (1,185) size 310x23
-      LayoutText {#text} at (2,0) size 306x21
-        text run at (2,0) width 82: "She said \x{201C}"
-        text run at (84,0) width 67 RTL: " \x{5D1}\x{5DE}\x{5D6}\x{5D5}\x{5D5}\x{5D3}\x{5D4}!"
-        text run at (151,0) width 37: "TNT"
-        text run at (188,0) width 22 RTL: "\x{202B}\x{5D9}\x{5E9} "
-        text run at (210,0) width 98: "\x{202C}\x{201D} and ran off"
+    LayoutBlockFlow {OPTION} at (1,162) size 309.69x35
+      LayoutText {#text} at (2,6) size 282x21
+        text run at (2,6) width 90: "Directional "
+        text run at (92,6) width 74 RTL override: "\x{202E}overrides"
+        text run at (166,6) width 118: "\x{202C} are confusing."
+    LayoutBlockFlow {OPTION} at (1,197) size 309.69x35
+      LayoutText {#text} at (2,6) size 306x21
+        text run at (2,6) width 82: "She said \x{201C}"
+        text run at (84,6) width 67 RTL: " \x{5D1}\x{5DE}\x{5D6}\x{5D5}\x{5D5}\x{5D3}\x{5D4}!"
+        text run at (151,6) width 37: "TNT"
+        text run at (188,6) width 22 RTL: "\x{202B}\x{5D9}\x{5E9} "
+        text run at (210,6) width 98: "\x{202C}\x{201D} and ran off"
 layer at (8,253) size 365x18 clip at (9,254) size 348x16
   LayoutListBox {SELECT} at (0,245) size 365x18 [bgcolor=#FFFFFF] [border: (1px solid #A9A9A9)]
     LayoutBlockFlow {OPTION} at (1,1) size 348x16
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/ellipsis-platform-font-change-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text/ellipsis-platform-font-change-expected.png
index c26ce097..b1b436e 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/ellipsis-platform-font-change-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/ellipsis-platform-font-change-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/emphasis-ellipsis-complextext-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text/emphasis-ellipsis-complextext-expected.png
index c178d1f..e57bc87 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/emphasis-ellipsis-complextext-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/emphasis-ellipsis-complextext-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/emphasis-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text/emphasis-expected.png
index 0aa859e9..68ee7bd 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/emphasis-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/emphasis-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/emphasis-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/text/emphasis-expected.txt
index 2b4bd93d..4329385 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/emphasis-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/emphasis-expected.txt
@@ -18,7 +18,7 @@
         LayoutText {#text} at (112,73) size 330x69
           text run at (112,73) width 12: ", "
           text run at (124,73) width 209: "lobortis eu iaculis vel,"
-          text run at (3,115) width 208: "scelerisque nec dolor."
+          text run at (3,115) width 207: "scelerisque nec dolor."
       LayoutBlockFlow (floating) {DIV} at (390,8) size 366x146 [border: (3px solid #000000)]
         LayoutText {#text} at (3,3) size 270x27
           text run at (3,3) width 270: "Lorem ipsum dolor sit amet,"
@@ -94,7 +94,7 @@
         LayoutText {#text} at (196,126) size 330x55
           text run at (196,126) width 6: " "
           text run at (202,126) width 131: "eu iaculis vel,"
-          text run at (3,154) width 208: "scelerisque nec dolor."
+          text run at (3,154) width 207: "scelerisque nec dolor."
       LayoutBlockFlow (floating) {DIV} at (390,170) size 366x184 [border: (3px solid #000000)]
         LayoutText {#text} at (3,3) size 70x27
           text run at (3,3) width 70: "Lorem "
@@ -154,7 +154,7 @@
         LayoutText {#text} at (196,99) size 330x81
           text run at (196,99) width 6: " "
           text run at (202,99) width 131: "eu iaculis vel,"
-          text run at (3,153) width 208: "scelerisque nec dolor."
+          text run at (3,153) width 207: "scelerisque nec dolor."
       LayoutBlockFlow (floating) {DIV} at (390,370) size 366x198 [border: (3px solid #000000)]
         LayoutText {#text} at (3,13) size 270x27
           text run at (3,13) width 270: "Lorem ipsum dolor sit amet,"
@@ -170,7 +170,7 @@
         LayoutText {#text} at (112,109) size 330x75
           text run at (112,109) width 12: ", "
           text run at (124,109) width 209: "lobortis eu iaculis vel,"
-          text run at (3,157) width 208: "scelerisque nec dolor."
+          text run at (3,157) width 207: "scelerisque nec dolor."
       LayoutBlockFlow (floating) {DIV} at (8,584) size 366x146 [border: (3px solid #000000)]
         LayoutText {#text} at (3,3) size 270x27
           text run at (3,3) width 270: "Lorem ipsum dolor sit amet,"
@@ -186,6 +186,6 @@
         LayoutText {#text} at (112,73) size 330x69
           text run at (112,73) width 12: ", "
           text run at (124,73) width 209: "lobortis eu iaculis vel,"
-          text run at (3,115) width 208: "scelerisque nec dolor."
+          text run at (3,115) width 207: "scelerisque nec dolor."
 selection start: position 10 of child 0 {#text} of child 1 {SPAN} of child 10 {DIV} of body
 selection end:   position 7 of child 0 {#text} of child 3 {SPAN} of child 10 {DIV} of body
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/fake-italic-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text/fake-italic-expected.png
index aa9eb3d2..0790d98 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/fake-italic-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/fake-italic-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/fake-italic-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/text/fake-italic-expected.txt
index d69502e..d6fb75f 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/fake-italic-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/fake-italic-expected.txt
@@ -4,10 +4,10 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x600
     LayoutBlockFlow {BODY} at (8,8) size 784x576
       LayoutBlockFlow {P} at (0,0) size 784x60
-        LayoutText {#text} at (0,0) size 772x59
-          text run at (0,0) width 772: "This layout test is designed to test that our fake italic mode is working correctly. The Ahem font, used below, does not include an"
+        LayoutText {#text} at (0,0) size 770x59
+          text run at (0,0) width 770: "This layout test is designed to test that our fake italic mode is working correctly. The Ahem font, used below, does not include an"
           text run at (0,20) width 760: "italic variant. Thus, when we ask for italic Ahem, we should skew the glyphs ourselves, resulting in a series of italic black boxes"
-          text run at (0,40) width 41: "below."
+          text run at (0,40) width 40: "below."
       LayoutBlockFlow {P} at (0,76) size 784x16
         LayoutText {#text} at (0,0) size 112x16
           text run at (0,0) width 112: "A A A A"
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/fallback-for-custom-font-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text/fallback-for-custom-font-expected.png
index f140f2b..170c6f3 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/fallback-for-custom-font-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/fallback-for-custom-font-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/fallback-for-custom-font-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/text/fallback-for-custom-font-expected.txt
index c23fc28..012a5bd 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/fallback-for-custom-font-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/fallback-for-custom-font-expected.txt
@@ -4,17 +4,17 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x600
     LayoutBlockFlow {BODY} at (8,8) size 784x576
       LayoutBlockFlow {P} at (0,0) size 784x20
-        LayoutText {#text} at (0,0) size 51x19
-          text run at (0,0) width 51: "Test for "
-        LayoutInline {I} at (0,0) size 728x19
-          LayoutInline {A} at (0,0) size 159x19 [color=#0000EE]
-            LayoutText {#text} at (51,0) size 159x19
-              text run at (51,0) width 159: "http://crbug.com/373389"
-          LayoutText {#text} at (210,0) size 569x19
-            text run at (210,0) width 4: " "
-            text run at (214,0) width 565: "When a webfont is missing a glyph, synthesization from the fallback font isn't happening"
-        LayoutText {#text} at (779,0) size 4x19
-          text run at (779,0) width 4: "."
+        LayoutText {#text} at (0,0) size 50x19
+          text run at (0,0) width 50: "Test for "
+        LayoutInline {I} at (0,0) size 729x19
+          LayoutInline {A} at (0,0) size 160x19 [color=#0000EE]
+            LayoutText {#text} at (49,0) size 160x19
+              text run at (49,0) width 160: "http://crbug.com/373389"
+          LayoutText {#text} at (208,0) size 570x19
+            text run at (208,0) width 5: " "
+            text run at (212,0) width 566: "When a webfont is missing a glyph, synthesization from the fallback font isn't happening"
+        LayoutText {#text} at (777,0) size 5x19
+          text run at (777,0) width 5: "."
       LayoutBlockFlow {P} at (0,36) size 784x37
         LayoutText {#text} at (0,14) size 174x19
           text run at (0,14) width 174: "A synthesized oblique bullet: "
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/fallback-traits-fixup-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text/fallback-traits-fixup-expected.png
index 51961ae..445fb57 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/fallback-traits-fixup-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/fallback-traits-fixup-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/fallback-traits-fixup-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/text/fallback-traits-fixup-expected.txt
index 4e52f90..5579f5b 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/fallback-traits-fixup-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/fallback-traits-fixup-expected.txt
@@ -4,17 +4,17 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x600
     LayoutBlockFlow {BODY} at (8,8) size 784x576
       LayoutBlockFlow {P} at (0,0) size 784x20
-        LayoutText {#text} at (0,0) size 51x19
-          text run at (0,0) width 51: "Test for "
-        LayoutInline {I} at (0,0) size 513x19
+        LayoutText {#text} at (0,0) size 50x19
+          text run at (0,0) width 50: "Test for "
+        LayoutInline {I} at (0,0) size 512x19
           LayoutInline {A} at (0,0) size 154x19 [color=#0000EE]
-            LayoutText {#text} at (51,0) size 154x19
-              text run at (51,0) width 154: "rdar://problem/9528843"
-          LayoutText {#text} at (205,0) size 359x19
-            text run at (205,0) width 4: " "
-            text run at (209,0) width 355: "STIX glyphs not rendered on this stackoverflow answer"
-        LayoutText {#text} at (564,0) size 4x19
-          text run at (564,0) width 4: "."
+            LayoutText {#text} at (49,0) size 154x19
+              text run at (49,0) width 154: "rdar://problem/9528843"
+          LayoutText {#text} at (202,0) size 359x19
+            text run at (202,0) width 5: " "
+            text run at (206,0) width 355: "STIX glyphs not rendered on this stackoverflow answer"
+        LayoutText {#text} at (560,0) size 5x19
+          text run at (560,0) width 5: "."
       LayoutBlockFlow {P} at (0,36) size 784x39
         LayoutText {#text} at (0,15) size 91x19
           text run at (0,15) width 91: "A black circle: "
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/firstline/002-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text/firstline/002-expected.png
index edf2cae3d..8d2374d 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/firstline/002-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/firstline/002-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/firstline/002-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/text/firstline/002-expected.txt
index b24841d6..ccb7e060 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/firstline/002-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/firstline/002-expected.txt
@@ -7,5 +7,5 @@
         LayoutInline {<pseudo:first-letter>} at (0,0) size 32x41 [color=#800000]
           LayoutTextFragment (anonymous) at (2,3) size 32x41
             text run at (2,3) width 32: "M"
-        LayoutTextFragment {#text} at (34,20) size 169x19
-          text run at (34,20) width 169: "aroon on the first letter only."
+        LayoutTextFragment {#text} at (34,20) size 168x19
+          text run at (34,20) width 168: "aroon on the first letter only."
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/font-initial-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text/font-initial-expected.png
index e2aaa7a..a188a50 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/font-initial-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/font-initial-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/font-initial-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/text/font-initial-expected.txt
index c3f28515..2f35aa9 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/font-initial-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/font-initial-expected.txt
@@ -4,19 +4,19 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x600
     LayoutBlockFlow {BODY} at (8,8) size 784x584
       LayoutBlockFlow {P} at (0,0) size 784x20
-        LayoutText {#text} at (0,0) size 51x19
-          text run at (0,0) width 51: "Test for "
-        LayoutInline {I} at (0,0) size 628x19
-          LayoutInline {A} at (0,0) size 305x19 [color=#0000EE]
-            LayoutText {#text} at (51,0) size 305x19
-              text run at (51,0) width 305: "http://bugs.webkit.org/show_bug.cgi?id=12039"
-          LayoutText {#text} at (356,0) size 323x19
-            text run at (356,0) width 4: " "
-            text run at (360,0) width 319: "Assertion failure in WebCore::Font::primaryFont"
-        LayoutText {#text} at (679,0) size 4x19
-          text run at (679,0) width 4: "."
+        LayoutText {#text} at (0,0) size 50x19
+          text run at (0,0) width 50: "Test for "
+        LayoutInline {I} at (0,0) size 626x19
+          LayoutInline {A} at (0,0) size 306x19 [color=#0000EE]
+            LayoutText {#text} at (49,0) size 306x19
+              text run at (49,0) width 306: "http://bugs.webkit.org/show_bug.cgi?id=12039"
+          LayoutText {#text} at (354,0) size 321x19
+            text run at (354,0) width 5: " "
+            text run at (358,0) width 317: "Assertion failure in WebCore::Font::primaryFont"
+        LayoutText {#text} at (674,0) size 5x19
+          text run at (674,0) width 5: "."
       LayoutBlockFlow (anonymous) at (0,36) size 784x20
-        LayoutInline {SPAN} at (0,0) size 38x19
-          LayoutText {#text} at (0,0) size 38x19
-            text run at (0,0) width 38: "PASS"
+        LayoutInline {SPAN} at (0,0) size 37x19
+          LayoutText {#text} at (0,0) size 37x19
+            text run at (0,0) width 37: "PASS"
         LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/font-kerning-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text/font-kerning-expected.png
index 5573e83d..441b900 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/font-kerning-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/font-kerning-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/font-kerning-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/text/font-kerning-expected.txt
index 0bf02cd..61c9f6b1 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/font-kerning-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/font-kerning-expected.txt
@@ -8,8 +8,8 @@
           LayoutText {#text} at (0,0) size 200x41
             text run at (0,0) width 200: "AVAVAVAV"
         LayoutBlockFlow {DIV} at (0,41) size 784x41
-          LayoutText {#text} at (0,0) size 200x41
-            text run at (0,0) width 200: "AVAVAVAV"
+          LayoutText {#text} at (0,0) size 184x41
+            text run at (0,0) width 184: "AVAVAVAV"
         LayoutBlockFlow {DIV} at (0,82) size 784x41
           LayoutText {#text} at (0,0) size 184x41
             text run at (0,0) width 184: "AVAVAVAV"
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/font-ligature-letter-spacing-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/text/font-ligature-letter-spacing-expected.txt
new file mode 100644
index 0000000..a8e1fbe9
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/font-ligature-letter-spacing-expected.txt
@@ -0,0 +1,8 @@
+CACACACA
+CACACACA
+CACACACA
+This is a testharness.js-based test.
+FAIL Ligature expected not to be applied due to letter spacing. assert_equals: Ligature not applied due to letter spacing. expected 286.546875 but got 140
+FAIL Ligature expected not to be applied due to letter spacing. assert_equals: Ligature not applied due to letter spacing. expected 286.546875 but got 140
+Harness: the test ran to completion.
+
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/font-smallcaps-layout-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text/font-smallcaps-layout-expected.png
index f494282..f20dcde1 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/font-smallcaps-layout-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/font-smallcaps-layout-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/font-smallcaps-layout-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/text/font-smallcaps-layout-expected.txt
index 3f8e506..c8f18787 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/font-smallcaps-layout-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/font-smallcaps-layout-expected.txt
@@ -3,8 +3,8 @@
 layer at (0,0) size 800x40
   LayoutBlockFlow {HTML} at (0,0) size 800x40
     LayoutBlockFlow {BODY} at (0,0) size 800x40
-      LayoutText {#text} at (0,0) size 782x39
-        text run at (0,0) width 782: "Testing for incorrect text overflow when using small caps in the complex test path. There should be no red characters visible on the"
+      LayoutText {#text} at (0,0) size 781x39
+        text run at (0,0) width 781: "Testing for incorrect text overflow when using small caps in the complex test path. There should be no red characters visible on the"
         text run at (0,20) width 95: "green rectangle."
       LayoutText {#text} at (0,0) size 0x0
 layer at (-500,40) size 1000x366 backgroundClip at (0,0) size 800x600 clip at (0,0) size 800x600
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/font-stretch-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text/font-stretch-expected.png
index 7e454a4..9dad52d3 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/font-stretch-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/font-stretch-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/font-stretch-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/text/font-stretch-expected.txt
index ee4bf51..9275fe6 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/font-stretch-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/font-stretch-expected.txt
@@ -4,8 +4,8 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x416
     LayoutBlockFlow {BODY} at (8,8) size 784x400
       LayoutBlockFlow {H1} at (0,0) size 784x24
-        LayoutText {#text} at (0,0) size 249x23
-          text run at (0,0) width 249: "Tests support for font-stretch"
+        LayoutText {#text} at (0,0) size 247x23
+          text run at (0,0) width 247: "Tests support for font-stretch"
       LayoutBlockFlow {P} at (0,26) size 784x17
         LayoutText {#text} at (0,0) size 233x16
           text run at (0,0) width 233: "Tests that CSS font-stretch is supported."
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/font-stretch-variant-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text/font-stretch-variant-expected.png
index 9c8c52f..ae98d2a7 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/font-stretch-variant-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/font-stretch-variant-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/font-weight-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text/font-weight-expected.png
index 469aeac..8ab730b 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/font-weight-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/font-weight-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/font-weight-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/text/font-weight-expected.txt
index fe67c087..4462118 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/font-weight-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/font-weight-expected.txt
@@ -4,8 +4,8 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x420
     LayoutBlockFlow {BODY} at (8,8) size 784x404
       LayoutBlockFlow {H1} at (0,0) size 784x24
-        LayoutText {#text} at (0,0) size 246x23
-          text run at (0,0) width 246: "Tests support for font-weight"
+        LayoutText {#text} at (0,0) size 245x23
+          text run at (0,0) width 245: "Tests support for font-weight"
       LayoutBlockFlow {P} at (0,26) size 784x17
         LayoutText {#text} at (0,0) size 350x16
           text run at (0,0) width 350: "Tests that CSS font-weight with numeric values is supported."
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/format-control-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text/format-control-expected.png
index f7bcda64..e27b335 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/format-control-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/format-control-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/format-control-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/text/format-control-expected.txt
index 9fa4242..e1abd2b 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/format-control-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/format-control-expected.txt
@@ -1,28 +1,28 @@
-layer at (0,0) size 800x600
+layer at (0,0) size 800x600 clip at (0,0) size 785x600 scrollHeight 704
   LayoutView at (0,0) size 800x600
-layer at (0,0) size 800x600
-  LayoutBlockFlow {HTML} at (0,0) size 800x600
-    LayoutBlockFlow {BODY} at (8,8) size 784x552
-      LayoutBlockFlow (anonymous) at (0,0) size 784x20
+layer at (0,0) size 785x704 backgroundClip at (0,0) size 785x600 clip at (0,0) size 785x600
+  LayoutBlockFlow {HTML} at (0,0) size 785x704
+    LayoutBlockFlow {BODY} at (8,8) size 769x656
+      LayoutBlockFlow (anonymous) at (0,0) size 769x20
         LayoutText {#text} at (0,0) size 457x19
           text run at (0,0) width 457: "This tests the ZWJ and ZWNJ format control characters on basic Latin text."
-      LayoutBlockFlow {DIV} at (0,60) size 784x224
-        LayoutBlockFlow {P} at (0,0) size 784x48
-          LayoutText {#text} at (0,1) size 276x46
-            text run at (0,1) width 276: "fi fl ff ffi ffl fl f   i"
-        LayoutBlockFlow {P} at (0,88) size 784x48
-          LayoutText {#text} at (0,1) size 276x46
-            text run at (0,1) width 276: "f\x{200C}i f\x{200C}l f\x{200C}f f\x{200C}f\x{200C}i f\x{200C}f\x{200C}l f\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}l f\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C} \x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C} \x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C} \x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}i"
-        LayoutBlockFlow {P} at (0,176) size 784x48
-          LayoutText {#text} at (0,1) size 276x46
-            text run at (0,1) width 276: "f\x{200D}i f\x{200D}l f\x{200D}f f\x{200D}f\x{200D}i f\x{200D}f\x{200D}l f\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}l f\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D} \x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D} \x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D} \x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}i"
-      LayoutBlockFlow {DIV} at (0,324) size 784x224
-        LayoutBlockFlow {P} at (0,0) size 784x48
-          LayoutText {#text} at (0,1) size 276x46
-            text run at (0,1) width 276: "fi fl ff ffi ffl fl f   i"
-        LayoutBlockFlow {P} at (0,88) size 784x48
-          LayoutText {#text} at (0,1) size 276x46
-            text run at (0,1) width 276: "f\x{200C}i f\x{200C}l f\x{200C}f f\x{200C}f\x{200C}i f\x{200C}f\x{200C}l f\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}l f\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C} \x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C} \x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C} \x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}i"
-        LayoutBlockFlow {P} at (0,176) size 784x48
-          LayoutText {#text} at (0,1) size 276x46
-            text run at (0,1) width 276: "f\x{200D}i f\x{200D}l f\x{200D}f f\x{200D}f\x{200D}i f\x{200D}f\x{200D}l f\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}l f\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D} \x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D} \x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D} \x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}i"
+      LayoutBlockFlow {DIV} at (0,60) size 769x278
+        LayoutBlockFlow {P} at (0,0) size 769x48
+          LayoutText {#text} at (0,1) size 274x46
+            text run at (0,1) width 274: "fi fl ff ffi ffl fl f   i"
+        LayoutBlockFlow {P} at (0,88) size 769x75
+          LayoutText {#text} at (0,15) size 274x46
+            text run at (0,15) width 274: "f\x{200C}i f\x{200C}l f\x{200C}f f\x{200C}f\x{200C}i f\x{200C}f\x{200C}l f\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}l f\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C} \x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C} \x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C} \x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}i"
+        LayoutBlockFlow {P} at (0,203) size 769x75
+          LayoutText {#text} at (0,15) size 274x46
+            text run at (0,15) width 274: "f\x{200D}i f\x{200D}l f\x{200D}f f\x{200D}f\x{200D}i f\x{200D}f\x{200D}l f\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}l f\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D} \x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D} \x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D} \x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}i"
+      LayoutBlockFlow {DIV} at (0,378) size 769x278
+        LayoutBlockFlow {P} at (0,0) size 769x48
+          LayoutText {#text} at (0,1) size 274x46
+            text run at (0,1) width 274: "fi fl ff ffi ffl fl f   i"
+        LayoutBlockFlow {P} at (0,88) size 769x75
+          LayoutText {#text} at (0,15) size 274x46
+            text run at (0,15) width 274: "f\x{200C}i f\x{200C}l f\x{200C}f f\x{200C}f\x{200C}i f\x{200C}f\x{200C}l f\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}l f\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C} \x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C} \x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C} \x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}i"
+        LayoutBlockFlow {P} at (0,203) size 769x75
+          LayoutText {#text} at (0,15) size 274x46
+            text run at (0,15) width 274: "f\x{200D}i f\x{200D}l f\x{200D}f f\x{200D}f\x{200D}i f\x{200D}f\x{200D}l f\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}l f\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D} \x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D} \x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D} \x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}i"
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/in-rendered-text-rtl-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text/in-rendered-text-rtl-expected.png
index 111869a..89d33ed2 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/in-rendered-text-rtl-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/in-rendered-text-rtl-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/in-rendered-text-rtl-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/text/in-rendered-text-rtl-expected.txt
index 83d3171..bf3d54c 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/in-rendered-text-rtl-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/in-rendered-text-rtl-expected.txt
@@ -4,14 +4,14 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x600
     LayoutBlockFlow {BODY} at (8,8) size 784x584
       LayoutBlockFlow {P} at (0,0) size 784x40
-        LayoutText {#text} at (0,0) size 51x19
-          text run at (0,0) width 51: "Test for "
-        LayoutInline {I} at (0,0) size 758x39
-          LayoutInline {A} at (0,0) size 350x19 [color=#0000EE]
-            LayoutText {#text} at (51,0) size 350x19
-              text run at (51,0) width 350: "http://bugzilla.opendarwin.org/show_bug.cgi?id=7433"
-          LayoutText {#text} at (401,0) size 758x39
-            text run at (401,0) width 357: " REGRESSION (r12789): Second RTL text run on a line"
+        LayoutText {#text} at (0,0) size 50x19
+          text run at (0,0) width 50: "Test for "
+        LayoutInline {I} at (0,0) size 757x39
+          LayoutInline {A} at (0,0) size 351x19 [color=#0000EE]
+            LayoutText {#text} at (49,0) size 351x19
+              text run at (49,0) width 351: "http://bugzilla.opendarwin.org/show_bug.cgi?id=7433"
+          LayoutText {#text} at (399,0) size 757x39
+            text run at (399,0) width 358: " REGRESSION (r12789): Second RTL text run on a line"
             text run at (0,20) width 118: "cannot be selected"
         LayoutText {#text} at (118,20) size 4x19
           text run at (118,20) width 4: "."
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/bidi-AN-after-empty-run-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/bidi-AN-after-empty-run-expected.png
index 3f464f6..e0449bf 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/bidi-AN-after-empty-run-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/bidi-AN-after-empty-run-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/bidi-AN-after-empty-run-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/bidi-AN-after-empty-run-expected.txt
index 6e8b4e0..6bccfa45 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/bidi-AN-after-empty-run-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/bidi-AN-after-empty-run-expected.txt
@@ -4,16 +4,16 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x600
     LayoutBlockFlow {BODY} at (8,8) size 784x584
       LayoutBlockFlow {P} at (0,0) size 784x20
-        LayoutText {#text} at (0,0) size 51x19
-          text run at (0,0) width 51: "Test for "
-        LayoutInline {I} at (0,0) size 394x19
+        LayoutText {#text} at (0,0) size 50x19
+          text run at (0,0) width 50: "Test for "
+        LayoutInline {I} at (0,0) size 393x19
           LayoutInline {A} at (0,0) size 154x19 [color=#0000EE]
-            LayoutText {#text} at (51,0) size 154x19
-              text run at (51,0) width 154: "rdar://problem/6020930"
-          LayoutText {#text} at (205,0) size 240x19
-            text run at (205,0) width 240: " Bidi Problem When Resizing Window"
-        LayoutText {#text} at (445,0) size 4x19
-          text run at (445,0) width 4: "."
+            LayoutText {#text} at (49,0) size 154x19
+              text run at (49,0) width 154: "rdar://problem/6020930"
+          LayoutText {#text} at (202,0) size 240x19
+            text run at (202,0) width 240: " Bidi Problem When Resizing Window"
+        LayoutText {#text} at (441,0) size 5x19
+          text run at (441,0) width 5: "."
       LayoutBlockFlow {P} at (0,36) size 784x20
         LayoutText {#text} at (0,0) size 306x19
           text run at (0,0) width 306: "The boxes below should be identical to each other."
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/bidi-LDB-2-CSS-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/bidi-LDB-2-CSS-expected.png
index fefe36d..cd9321e 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/bidi-LDB-2-CSS-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/bidi-LDB-2-CSS-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/bidi-LDB-2-CSS-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/bidi-LDB-2-CSS-expected.txt
index 4839b37d..cc90acb 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/bidi-LDB-2-CSS-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/bidi-LDB-2-CSS-expected.txt
@@ -4,8 +4,8 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x569.88
     LayoutBlockFlow {BODY} at (8,21.44) size 784x532.44
       LayoutBlockFlow {H1} at (0,0) size 784x37
-        LayoutText {#text} at (0,0) size 425x36
-          text run at (0,0) width 425: "Bidirectional Text Test 2 - CSS"
+        LayoutText {#text} at (0,0) size 419x36
+          text run at (0,0) width 419: "Bidirectional Text Test 2 - CSS"
       LayoutBlockFlow {P} at (0,58.44) size 784x20
         LayoutText {#text} at (0,0) size 126x19
           text run at (0,0) width 126: "This test is based on "
@@ -570,16 +570,16 @@
       LayoutBlockFlow {P} at (0,440.44) size 784x20
         LayoutText {#text} at (0,0) size 57x19
           text run at (0,0) width 57: "(Back to "
-        LayoutInline {A} at (0,0) size 149x19 [color=#0000EE]
-          LayoutText {#text} at (57,0) size 149x19
-            text run at (57,0) width 149: "CSS Testing Information"
-        LayoutText {#text} at (206,0) size 8x19
-          text run at (206,0) width 8: ", "
-        LayoutInline {A} at (0,0) size 77x19 [color=#0000EE]
-          LayoutText {#text} at (214,0) size 77x19
-            text run at (214,0) width 77: "David Baron"
-        LayoutText {#text} at (291,0) size 5x19
-          text run at (291,0) width 5: ")"
+        LayoutInline {A} at (0,0) size 148x19 [color=#0000EE]
+          LayoutText {#text} at (57,0) size 148x19
+            text run at (57,0) width 148: "CSS Testing Information"
+        LayoutText {#text} at (204,0) size 9x19
+          text run at (204,0) width 9: ", "
+        LayoutInline {A} at (0,0) size 78x19 [color=#0000EE]
+          LayoutText {#text} at (212,0) size 78x19
+            text run at (212,0) width 78: "David Baron"
+        LayoutText {#text} at (289,0) size 6x19
+          text run at (289,0) width 6: ")"
       LayoutBlockFlow {P} at (0,476.44) size 784x20
         LayoutInline {A} at (0,0) size 30x19 [color=#0000EE]
           LayoutText {#text} at (0,0) size 30x19
@@ -589,8 +589,8 @@
         LayoutInline {A} at (0,0) size 125x19 [color=#0000EE]
           LayoutText {#text} at (38,0) size 125x19
             text run at (38,0) width 125: "dbaron@dbaron.org"
-        LayoutText {#text} at (163,0) size 84x19
-          text run at (163,0) width 84: ", 2001-06-05"
+        LayoutText {#text} at (162,0) size 85x19
+          text run at (162,0) width 85: ", 2001-06-05"
       LayoutBlockFlow {P} at (0,512.44) size 784x20
         LayoutText {#text} at (0,0) size 289x19
           text run at (0,0) width 289: "Modified and used with the author\x{2019}s permission."
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/bidi-LDB-2-HTML-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/bidi-LDB-2-HTML-expected.png
index 2be77ce..d19f887 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/bidi-LDB-2-HTML-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/bidi-LDB-2-HTML-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/bidi-LDB-2-HTML-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/bidi-LDB-2-HTML-expected.txt
index 7ef008a..353d5ae0 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/bidi-LDB-2-HTML-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/bidi-LDB-2-HTML-expected.txt
@@ -4,8 +4,8 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x533.88
     LayoutBlockFlow {BODY} at (8,21.44) size 784x496.44
       LayoutBlockFlow {H1} at (0,0) size 784x37
-        LayoutText {#text} at (0,0) size 464x36
-          text run at (0,0) width 464: "Bidirectional Text Test 2 - HTML"
+        LayoutText {#text} at (0,0) size 458x36
+          text run at (0,0) width 458: "Bidirectional Text Test 2 - HTML"
       LayoutBlockFlow {P} at (0,58.44) size 784x20
         LayoutText {#text} at (0,0) size 126x19
           text run at (0,0) width 126: "This test is based on "
@@ -558,16 +558,16 @@
       LayoutBlockFlow {P} at (0,404.44) size 784x20
         LayoutText {#text} at (0,0) size 57x19
           text run at (0,0) width 57: "(Back to "
-        LayoutInline {A} at (0,0) size 149x19 [color=#0000EE]
-          LayoutText {#text} at (57,0) size 149x19
-            text run at (57,0) width 149: "CSS Testing Information"
-        LayoutText {#text} at (206,0) size 8x19
-          text run at (206,0) width 8: ", "
-        LayoutInline {A} at (0,0) size 77x19 [color=#0000EE]
-          LayoutText {#text} at (214,0) size 77x19
-            text run at (214,0) width 77: "David Baron"
-        LayoutText {#text} at (291,0) size 5x19
-          text run at (291,0) width 5: ")"
+        LayoutInline {A} at (0,0) size 148x19 [color=#0000EE]
+          LayoutText {#text} at (57,0) size 148x19
+            text run at (57,0) width 148: "CSS Testing Information"
+        LayoutText {#text} at (204,0) size 9x19
+          text run at (204,0) width 9: ", "
+        LayoutInline {A} at (0,0) size 78x19 [color=#0000EE]
+          LayoutText {#text} at (212,0) size 78x19
+            text run at (212,0) width 78: "David Baron"
+        LayoutText {#text} at (289,0) size 6x19
+          text run at (289,0) width 6: ")"
       LayoutBlockFlow {P} at (0,440.44) size 784x20
         LayoutInline {A} at (0,0) size 30x19 [color=#0000EE]
           LayoutText {#text} at (0,0) size 30x19
@@ -577,8 +577,8 @@
         LayoutInline {A} at (0,0) size 125x19 [color=#0000EE]
           LayoutText {#text} at (38,0) size 125x19
             text run at (38,0) width 125: "dbaron@dbaron.org"
-        LayoutText {#text} at (163,0) size 84x19
-          text run at (163,0) width 84: ", 2001-06-05"
+        LayoutText {#text} at (162,0) size 85x19
+          text run at (162,0) width 85: ", 2001-06-05"
       LayoutBlockFlow {P} at (0,476.44) size 784x20
         LayoutText {#text} at (0,0) size 289x19
           text run at (0,0) width 289: "Modified and used with the author\x{2019}s permission."
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/bidi-LDB-2-formatting-characters-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/bidi-LDB-2-formatting-characters-expected.png
index 40f8dbe..46519bb 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/bidi-LDB-2-formatting-characters-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/bidi-LDB-2-formatting-characters-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/bidi-LDB-2-formatting-characters-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/bidi-LDB-2-formatting-characters-expected.txt
index d86b98e6..91b9fdc 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/bidi-LDB-2-formatting-characters-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/bidi-LDB-2-formatting-characters-expected.txt
@@ -1,11 +1,11 @@
-layer at (0,0) size 800x600 scrollHeight 614
+layer at (0,0) size 800x600 scrollHeight 704
   LayoutView at (0,0) size 800x600
-layer at (0,0) size 800x614 backgroundClip at (0,0) size 800x600 clip at (0,0) size 800x600
-  LayoutBlockFlow {HTML} at (0,0) size 800x613.88
-    LayoutBlockFlow {BODY} at (8,21.44) size 784x576.44
+layer at (0,0) size 800x704 backgroundClip at (0,0) size 800x600 clip at (0,0) size 800x600
+  LayoutBlockFlow {HTML} at (0,0) size 800x703.88
+    LayoutBlockFlow {BODY} at (8,21.44) size 784x666.44
       LayoutBlockFlow {H1} at (0,0) size 784x37
-        LayoutText {#text} at (0,0) size 684x36
-          text run at (0,0) width 684: "Bidirectional Text Test 2 - Formatting Characters"
+        LayoutText {#text} at (0,0) size 678x36
+          text run at (0,0) width 678: "Bidirectional Text Test 2 - Formatting Characters"
       LayoutBlockFlow {P} at (0,58.44) size 784x20
         LayoutText {#text} at (0,0) size 126x19
           text run at (0,0) width 126: "This test is based on "
@@ -35,64 +35,64 @@
       LayoutBlockFlow {P} at (0,130.44) size 784x20
         LayoutText {#text} at (0,0) size 267x19
           text run at (0,0) width 267: "In each box, all the lines should be the same."
-      LayoutBlockFlow (anonymous) at (0,166.44) size 784x248
-        LayoutBlockFlow {DIV} at (3,3) size 96x188 [border: (1px solid #008000)]
+      LayoutBlockFlow (anonymous) at (0,166.44) size 784x338
+        LayoutBlockFlow {DIV} at (3,3) size 96x268 [border: (1px solid #008000)]
           LayoutBlockFlow {P} at (4,4) size 88x20
             LayoutText {#text} at (0,0) size 88x19
               text run at (0,0) width 88: "ABCDEFGHI"
-          LayoutBlockFlow {P} at (4,24) size 88x20
-            LayoutText {#text} at (0,0) size 88x19
-              text run at (0,0) width 0 RTL: "\x{202C}"
-              text run at (0,0) width 88: "\x{202B}ABCDEFGHI"
-          LayoutBlockFlow {P} at (4,44) size 88x20
-            LayoutText {#text} at (0,0) size 32x19
-              text run at (0,0) width 32: "\x{202B}ABC"
+          LayoutBlockFlow {P} at (4,24) size 88x30
+            LayoutText {#text} at (0,6) size 88x19
+              text run at (0,6) width 0 RTL: "\x{202C}"
+              text run at (0,6) width 88: "\x{202B}ABCDEFGHI"
+          LayoutBlockFlow {P} at (4,54) size 88x30
+            LayoutText {#text} at (0,6) size 32x19
+              text run at (0,6) width 32: "\x{202B}ABC"
             LayoutInline {SPAN} at (0,0) size 29x19
-              LayoutText {#text} at (32,0) size 29x19
-                text run at (32,0) width 29: "DEF"
-            LayoutText {#text} at (0,0) size 88x19
-              text run at (0,0) width 0 RTL: "\x{202C}"
-              text run at (61,0) width 27: "GHI"
-          LayoutBlockFlow {P} at (4,64) size 88x20
-            LayoutText {#text} at (0,0) size 88x19
-              text run at (0,0) width 0 RTL: "\x{202C}"
-              text run at (0,0) width 88 RTL override: "\x{202E}IHGFEDCBA"
-          LayoutBlockFlow {P} at (4,84) size 88x20
-            LayoutText {#text} at (61,0) size 27x19
-              text run at (61,0) width 27 RTL override: "\x{202E}IHG"
+              LayoutText {#text} at (32,6) size 29x19
+                text run at (32,6) width 29: "DEF"
+            LayoutText {#text} at (0,6) size 88x19
+              text run at (0,6) width 0 RTL: "\x{202C}"
+              text run at (61,6) width 27: "GHI"
+          LayoutBlockFlow {P} at (4,84) size 88x30
+            LayoutText {#text} at (0,6) size 88x19
+              text run at (0,6) width 0 RTL: "\x{202C}"
+              text run at (0,6) width 88 RTL override: "\x{202E}IHGFEDCBA"
+          LayoutBlockFlow {P} at (4,114) size 88x30
+            LayoutText {#text} at (61,6) size 27x19
+              text run at (61,6) width 27 RTL override: "\x{202E}IHG"
             LayoutInline {SPAN} at (0,0) size 29x19
-              LayoutText {#text} at (32,0) size 29x19
-                text run at (32,0) width 29 RTL override: "FED"
-            LayoutText {#text} at (0,0) size 32x19
-              text run at (0,0) width 0 RTL: "\x{202C}"
-              text run at (0,0) width 32 RTL override: "CBA"
-          LayoutBlockFlow {P} at (4,104) size 88x20
-            LayoutText {#text} at (0,0) size 88x19
-              text run at (0,0) width 0 RTL: "\x{202C}"
-              text run at (0,0) width 32 RTL override: "\x{202C}CBA"
-              text run at (32,0) width 29: "\x{202B}DEF"
-              text run at (61,0) width 27 RTL override: "\x{202E}IHG"
-          LayoutBlockFlow {P} at (4,124) size 88x20
-            LayoutText {#text} at (0,0) size 88x19
-              text run at (0,0) width 0 RTL: "\x{202C}"
-              text run at (0,0) width 32 RTL override: "\x{202C}CBA"
-              text run at (32,0) width 29 RTL override: "\x{202E}FED"
-              text run at (61,0) width 27 RTL override: "\x{202E}IHG"
-          LayoutBlockFlow {P} at (4,144) size 88x20
-            LayoutText {#text} at (0,0) size 88x19
-              text run at (0,0) width 0 RTL: "\x{202C}"
-              text run at (0,0) width 32 RTL override: "\x{202C}CBA"
-              text run at (32,0) width 29 RTL override: "\x{202E}FED"
-              text run at (61,0) width 27 RTL override: "\x{202E}IHG"
-          LayoutBlockFlow {P} at (4,164) size 88x20
-            LayoutText {#text} at (0,0) size 88x19
-              text run at (0,0) width 0 RTL: "\x{202C}"
-              text run at (0,0) width 32 RTL override: "\x{202C}CBA"
-              text run at (32,0) width 29 LTR override: "\x{202D}DEF"
-              text run at (61,0) width 27 RTL override: "\x{202E}IHG"
-        LayoutText {#text} at (102,85) size 4x19
-          text run at (102,85) width 4: " "
-        LayoutBlockFlow {DIV} at (109,53) size 28x88 [border: (1px solid #008000)]
+              LayoutText {#text} at (32,6) size 29x19
+                text run at (32,6) width 29 RTL override: "FED"
+            LayoutText {#text} at (0,6) size 32x19
+              text run at (0,6) width 0 RTL: "\x{202C}"
+              text run at (0,6) width 32 RTL override: "CBA"
+          LayoutBlockFlow {P} at (4,144) size 88x30
+            LayoutText {#text} at (0,6) size 88x19
+              text run at (0,6) width 0 RTL: "\x{202C}"
+              text run at (0,6) width 32 RTL override: "\x{202C}CBA"
+              text run at (32,6) width 29: "\x{202B}DEF"
+              text run at (61,6) width 27 RTL override: "\x{202E}IHG"
+          LayoutBlockFlow {P} at (4,174) size 88x30
+            LayoutText {#text} at (0,6) size 88x19
+              text run at (0,6) width 0 RTL: "\x{202C}"
+              text run at (0,6) width 32 RTL override: "\x{202C}CBA"
+              text run at (32,6) width 29 RTL override: "\x{202E}FED"
+              text run at (61,6) width 27 RTL override: "\x{202E}IHG"
+          LayoutBlockFlow {P} at (4,204) size 88x30
+            LayoutText {#text} at (0,6) size 88x19
+              text run at (0,6) width 0 RTL: "\x{202C}"
+              text run at (0,6) width 32 RTL override: "\x{202C}CBA"
+              text run at (32,6) width 29 RTL override: "\x{202E}FED"
+              text run at (61,6) width 27 RTL override: "\x{202E}IHG"
+          LayoutBlockFlow {P} at (4,234) size 88x30
+            LayoutText {#text} at (0,6) size 88x19
+              text run at (0,6) width 0 RTL: "\x{202C}"
+              text run at (0,6) width 32 RTL override: "\x{202C}CBA"
+              text run at (32,6) width 29 LTR override: "\x{202D}DEF"
+              text run at (61,6) width 27 RTL override: "\x{202E}IHG"
+        LayoutText {#text} at (102,125) size 4x19
+          text run at (102,125) width 4: " "
+        LayoutBlockFlow {DIV} at (109,83) size 28x108 [border: (1px solid #008000)]
           LayoutTable {TABLE} at (4,4) size 20x20
             LayoutTableSection {TBODY} at (0,0) size 20x20
               LayoutTableRow {TR} at (0,0) size 20x20
@@ -108,17 +108,17 @@
           LayoutBlockFlow {P} at (4,24) size 20x20
             LayoutText {#text} at (0,0) size 20x19
               text run at (0,0) width 20 RTL: "\x{5D0}\x{5D1}\x{5D2}"
-          LayoutBlockFlow {P} at (4,44) size 20x20
-            LayoutText {#text} at (0,0) size 20x19
-              text run at (0,0) width 20 RTL: "\x{202A}\x{5D0}\x{5D1}\x{5D2}"
-              text run at (20,0) width 0: "\x{202C}"
-          LayoutBlockFlow {P} at (4,64) size 20x20
-            LayoutText {#text} at (0,0) size 20x19
-              text run at (0,0) width 20 LTR override: "\x{202D}\x{5D2}\x{5D1}\x{5D0}"
-              text run at (20,0) width 0: "\x{202C}"
-        LayoutText {#text} at (140,85) size 4x19
-          text run at (140,85) width 4: " "
-        LayoutBlockFlow {DIV} at (147,63) size 87x68 [border: (1px solid #008000)]
+          LayoutBlockFlow {P} at (4,44) size 20x30
+            LayoutText {#text} at (0,6) size 20x19
+              text run at (0,6) width 20 RTL: "\x{202A}\x{5D0}\x{5D1}\x{5D2}"
+              text run at (20,6) width 0: "\x{202C}"
+          LayoutBlockFlow {P} at (4,74) size 20x30
+            LayoutText {#text} at (0,6) size 20x19
+              text run at (0,6) width 20 LTR override: "\x{202D}\x{5D2}\x{5D1}\x{5D0}"
+              text run at (20,6) width 0: "\x{202C}"
+        LayoutText {#text} at (140,125) size 4x19
+          text run at (140,125) width 4: " "
+        LayoutBlockFlow {DIV} at (147,103) size 87x68 [border: (1px solid #008000)]
           LayoutTable {TABLE} at (4,4) size 79x20
             LayoutTableSection {TBODY} at (0,0) size 79x20
               LayoutTableRow {TR} at (0,0) size 79x20
@@ -165,9 +165,9 @@
               text run at (0,0) width 24 RTL: " \x{5D0}\x{5D1}\x{5D2}"
               text run at (24,0) width 32: "ABC"
               text run at (56,0) width 23 RTL: "\x{5D3}\x{5D4}\x{5D5} "
-        LayoutText {#text} at (237,85) size 4x19
-          text run at (237,85) width 4: " "
-        LayoutBlockFlow {DIV} at (244,3) size 145x188 [border: (1px solid #008000)]
+        LayoutText {#text} at (237,125) size 4x19
+          text run at (237,125) width 4: " "
+        LayoutBlockFlow {DIV} at (244,13) size 145x248 [border: (1px solid #008000)]
           LayoutTable {TABLE} at (4,4) size 137x20
             LayoutTableSection {TBODY} at (0,0) size 137x20
               LayoutTableRow {TR} at (0,0) size 137x20
@@ -246,51 +246,51 @@
             LayoutText {#text} at (79,0) size 58x19
               text run at (79,0) width 37: " DEF "
               text run at (116,0) width 21 RTL: "\x{5D6}\x{5D7}\x{5D8}"
-          LayoutBlockFlow {P} at (4,64) size 137x20
-            LayoutText {#text} at (0,0) size 137x19
-              text run at (0,0) width 20 RTL: "\x{5D0}\x{5D1}\x{5D2}"
-              text run at (20,0) width 4: " "
-              text run at (24,0) width 36: "\x{202A}ABC "
-              text run at (60,0) width 19 RTL: "\x{5D3}\x{5D4}\x{5D5}"
-              text run at (79,0) width 33: " DEF"
-              text run at (112,0) width 4: "\x{202C} "
-              text run at (116,0) width 21 RTL: "\x{5D6}\x{5D7}\x{5D8}"
-          LayoutBlockFlow {P} at (4,84) size 137x20
-            LayoutText {#text} at (0,0) size 137x19
-              text run at (0,0) width 24 RTL: "\x{202C} \x{5D0}\x{5D1}\x{5D2}"
-              text run at (24,0) width 32: "ABC"
-              text run at (56,0) width 27 RTL: " \x{5D3}\x{5D4}\x{5D5} "
-              text run at (83,0) width 29: "\x{202B}DEF"
-              text run at (112,0) width 25 RTL: "\x{5D6}\x{5D7}\x{5D8} "
-          LayoutBlockFlow {P} at (4,104) size 137x20
-            LayoutText {#text} at (0,0) size 137x19
-              text run at (0,0) width 24 RTL: " \x{5D0}\x{5D1}\x{5D2}"
-              text run at (24,0) width 32: "\x{202B}ABC"
-              text run at (56,0) width 23 RTL: "\x{5D3}\x{5D4}\x{5D5} "
-              text run at (79,0) width 37: "\x{202C} DEF "
-              text run at (116,0) width 21 RTL: "\x{5D6}\x{5D7}\x{5D8}"
-          LayoutBlockFlow {P} at (4,124) size 137x20
-            LayoutText {#text} at (0,0) size 137x19
-              text run at (0,0) width 56 RTL override: "\x{202E}CBA \x{5D0}\x{5D1}\x{5D2}"
-              text run at (56,0) width 23 RTL: "\x{5D3}\x{5D4}\x{5D5} "
-              text run at (79,0) width 37: "\x{202C} DEF "
-              text run at (116,0) width 21 RTL: "\x{5D6}\x{5D7}\x{5D8}"
-          LayoutBlockFlow {P} at (4,144) size 137x20
-            LayoutText {#text} at (0,0) size 137x19
-              text run at (0,0) width 20 RTL: "\x{5D0}\x{5D1}\x{5D2}"
-              text run at (20,0) width 4: " "
-              text run at (24,0) width 55 LTR override: "\x{202D}ABC \x{5D5}\x{5D4}\x{5D3}"
-              text run at (79,0) width 37: "\x{202C} DEF "
-              text run at (116,0) width 21 RTL: "\x{5D6}\x{5D7}\x{5D8}"
-          LayoutBlockFlow {P} at (4,164) size 137x20
-            LayoutText {#text} at (0,0) size 137x19
-              text run at (0,0) width 24 RTL: " \x{5D0}\x{5D1}\x{5D2}"
-              text run at (24,0) width 55 LTR override: "\x{202D}ABC \x{5D5}\x{5D4}\x{5D3}"
-              text run at (79,0) width 33: "\x{202C} DEF"
-              text run at (112,0) width 25 RTL: "\x{5D6}\x{5D7}\x{5D8} "
-        LayoutText {#text} at (392,85) size 4x19
-          text run at (392,85) width 4: " "
-        LayoutBlockFlow {DIV} at (399,73) size 176x48 [border: (1px solid #008000)]
+          LayoutBlockFlow {P} at (4,64) size 137x30
+            LayoutText {#text} at (0,6) size 137x19
+              text run at (0,6) width 20 RTL: "\x{5D0}\x{5D1}\x{5D2}"
+              text run at (20,6) width 4: " "
+              text run at (24,6) width 36: "\x{202A}ABC "
+              text run at (60,6) width 19 RTL: "\x{5D3}\x{5D4}\x{5D5}"
+              text run at (79,6) width 33: " DEF"
+              text run at (112,6) width 4: "\x{202C} "
+              text run at (116,6) width 21 RTL: "\x{5D6}\x{5D7}\x{5D8}"
+          LayoutBlockFlow {P} at (4,94) size 137x30
+            LayoutText {#text} at (0,6) size 137x19
+              text run at (0,6) width 24 RTL: "\x{202C} \x{5D0}\x{5D1}\x{5D2}"
+              text run at (24,6) width 32: "ABC"
+              text run at (56,6) width 27 RTL: " \x{5D3}\x{5D4}\x{5D5} "
+              text run at (83,6) width 29: "\x{202B}DEF"
+              text run at (112,6) width 25 RTL: "\x{5D6}\x{5D7}\x{5D8} "
+          LayoutBlockFlow {P} at (4,124) size 137x30
+            LayoutText {#text} at (0,6) size 137x19
+              text run at (0,6) width 24 RTL: " \x{5D0}\x{5D1}\x{5D2}"
+              text run at (24,6) width 32: "\x{202B}ABC"
+              text run at (56,6) width 23 RTL: "\x{5D3}\x{5D4}\x{5D5} "
+              text run at (79,6) width 37: "\x{202C} DEF "
+              text run at (116,6) width 21 RTL: "\x{5D6}\x{5D7}\x{5D8}"
+          LayoutBlockFlow {P} at (4,154) size 137x30
+            LayoutText {#text} at (0,6) size 137x19
+              text run at (0,6) width 56 RTL override: "\x{202E}CBA \x{5D0}\x{5D1}\x{5D2}"
+              text run at (56,6) width 23 RTL: "\x{5D3}\x{5D4}\x{5D5} "
+              text run at (79,6) width 37: "\x{202C} DEF "
+              text run at (116,6) width 21 RTL: "\x{5D6}\x{5D7}\x{5D8}"
+          LayoutBlockFlow {P} at (4,184) size 137x30
+            LayoutText {#text} at (0,6) size 137x19
+              text run at (0,6) width 20 RTL: "\x{5D0}\x{5D1}\x{5D2}"
+              text run at (20,6) width 4: " "
+              text run at (24,6) width 55 LTR override: "\x{202D}ABC \x{5D5}\x{5D4}\x{5D3}"
+              text run at (79,6) width 37: "\x{202C} DEF "
+              text run at (116,6) width 21 RTL: "\x{5D6}\x{5D7}\x{5D8}"
+          LayoutBlockFlow {P} at (4,214) size 137x30
+            LayoutText {#text} at (0,6) size 137x19
+              text run at (0,6) width 24 RTL: " \x{5D0}\x{5D1}\x{5D2}"
+              text run at (24,6) width 55 LTR override: "\x{202D}ABC \x{5D5}\x{5D4}\x{5D3}"
+              text run at (79,6) width 33: "\x{202C} DEF"
+              text run at (112,6) width 25 RTL: "\x{5D6}\x{5D7}\x{5D8} "
+        LayoutText {#text} at (392,125) size 4x19
+          text run at (392,125) width 4: " "
+        LayoutBlockFlow {DIV} at (399,113) size 176x48 [border: (1px solid #008000)]
           LayoutTable {TABLE} at (4,4) size 168x20
             LayoutTableSection {TBODY} at (0,0) size 168x20
               LayoutTableRow {TR} at (0,0) size 168x20
@@ -370,10 +370,10 @@
               text run at (60,0) width 19 RTL: "\x{5D3}\x{5D4}\x{5D5}"
               text run at (79,0) width 68: " DEF GHI "
               text run at (147,0) width 21 RTL: "\x{5D6}\x{5D7}\x{5D8}"
-        LayoutText {#text} at (578,85) size 4x19
-          text run at (578,85) width 4: " "
-        LayoutBR {BR} at (582,85) size 0x19
-        LayoutBlockFlow {DIV} at (3,197) size 176x48 [border: (1px solid #008000)]
+        LayoutText {#text} at (578,125) size 4x19
+          text run at (578,125) width 4: " "
+        LayoutBR {BR} at (582,125) size 0x19
+        LayoutBlockFlow {DIV} at (3,277) size 176x58 [border: (1px solid #008000)]
           LayoutTable {TABLE} at (4,4) size 168x20
             LayoutTableSection {TBODY} at (0,0) size 168x20
               LayoutTableRow {TR} at (0,0) size 168x20
@@ -446,15 +446,15 @@
                 LayoutTableCell {TD} at (163,0) size 5x20 [r=0 c=22 rs=1 cs=1]
                   LayoutText {#text} at (0,0) size 5x19
                     text run at (0,0) width 5 RTL: "\x{5D6}"
-          LayoutBlockFlow {P} at (4,24) size 168x20
-            LayoutText {#text} at (0,0) size 168x19
-              text run at (0,0) width 88 RTL override: "\x{202E}ABC \x{5D3}\x{5D4}\x{5D5} DEF"
-              text run at (88,0) width 24 RTL: "\x{5D0}\x{5D1}\x{5D2} "
-              text run at (112,0) width 35: "\x{202C} GHI "
-              text run at (147,0) width 21 RTL: "\x{5D6}\x{5D7}\x{5D8}"
-        LayoutText {#text} at (182,209) size 4x19
-          text run at (182,209) width 4: " "
-        LayoutBlockFlow {DIV} at (189,197) size 176x48 [border: (1px solid #008000)]
+          LayoutBlockFlow {P} at (4,24) size 168x30
+            LayoutText {#text} at (0,6) size 168x19
+              text run at (0,6) width 88 RTL override: "\x{202E}ABC \x{5D3}\x{5D4}\x{5D5} DEF"
+              text run at (88,6) width 24 RTL: "\x{5D0}\x{5D1}\x{5D2} "
+              text run at (112,6) width 35: "\x{202C} GHI "
+              text run at (147,6) width 21 RTL: "\x{5D6}\x{5D7}\x{5D8}"
+        LayoutText {#text} at (182,294) size 4x19
+          text run at (182,294) width 4: " "
+        LayoutBlockFlow {DIV} at (189,277) size 176x58 [border: (1px solid #008000)]
           LayoutTable {TABLE} at (4,4) size 168x20
             LayoutTableSection {TBODY} at (0,0) size 168x20
               LayoutTableRow {TR} at (0,0) size 168x20
@@ -527,33 +527,33 @@
                 LayoutTableCell {TD} at (163,0) size 5x20 [r=0 c=22 rs=1 cs=1]
                   LayoutText {#text} at (0,0) size 5x19
                     text run at (0,0) width 5 RTL: "\x{5D6}"
-          LayoutBlockFlow {P} at (4,24) size 168x20
-            LayoutText {#text} at (0,0) size 168x19
-              text run at (0,0) width 20 RTL: "\x{5D0}\x{5D1}\x{5D2}"
-              text run at (20,0) width 40: " ABC "
-              text run at (60,0) width 52 RTL override: "\x{202E}\x{5D3}\x{5D4}\x{5D5} DEF"
-              text run at (112,0) width 35: "\x{202C} GHI "
-              text run at (147,0) width 21 RTL: "\x{5D6}\x{5D7}\x{5D8}"
+          LayoutBlockFlow {P} at (4,24) size 168x30
+            LayoutText {#text} at (0,6) size 168x19
+              text run at (0,6) width 20 RTL: "\x{5D0}\x{5D1}\x{5D2}"
+              text run at (20,6) width 40: " ABC "
+              text run at (60,6) width 52 RTL override: "\x{202E}\x{5D3}\x{5D4}\x{5D5} DEF"
+              text run at (112,6) width 35: "\x{202C} GHI "
+              text run at (147,6) width 21 RTL: "\x{5D6}\x{5D7}\x{5D8}"
         LayoutText {#text} at (0,0) size 0x0
-      LayoutBlockFlow {P} at (0,430.44) size 784x20
+      LayoutBlockFlow {P} at (0,520.44) size 784x20
         LayoutText {#text} at (0,0) size 355x19
           text run at (0,0) width 38: "Note: "
           text run at (38,0) width 317: "This test does not test RLM or LRM, but it ought to."
-      LayoutBlockFlow {HR} at (0,466.44) size 784x2 [border: (1px inset #EEEEEE)]
-      LayoutBlockFlow {P} at (0,484.44) size 784x20
+      LayoutBlockFlow {HR} at (0,556.44) size 784x2 [border: (1px inset #EEEEEE)]
+      LayoutBlockFlow {P} at (0,574.44) size 784x20
         LayoutText {#text} at (0,0) size 57x19
           text run at (0,0) width 57: "(Back to "
-        LayoutInline {A} at (0,0) size 149x19 [color=#0000EE]
-          LayoutText {#text} at (57,0) size 149x19
-            text run at (57,0) width 149: "CSS Testing Information"
-        LayoutText {#text} at (206,0) size 8x19
-          text run at (206,0) width 8: ", "
-        LayoutInline {A} at (0,0) size 77x19 [color=#0000EE]
-          LayoutText {#text} at (214,0) size 77x19
-            text run at (214,0) width 77: "David Baron"
-        LayoutText {#text} at (291,0) size 5x19
-          text run at (291,0) width 5: ")"
-      LayoutBlockFlow {P} at (0,520.44) size 784x20
+        LayoutInline {A} at (0,0) size 148x19 [color=#0000EE]
+          LayoutText {#text} at (57,0) size 148x19
+            text run at (57,0) width 148: "CSS Testing Information"
+        LayoutText {#text} at (204,0) size 9x19
+          text run at (204,0) width 9: ", "
+        LayoutInline {A} at (0,0) size 78x19 [color=#0000EE]
+          LayoutText {#text} at (212,0) size 78x19
+            text run at (212,0) width 78: "David Baron"
+        LayoutText {#text} at (289,0) size 6x19
+          text run at (289,0) width 6: ")"
+      LayoutBlockFlow {P} at (0,610.44) size 784x20
         LayoutInline {A} at (0,0) size 30x19 [color=#0000EE]
           LayoutText {#text} at (0,0) size 30x19
             text run at (0,0) width 30: "LDB"
@@ -562,8 +562,8 @@
         LayoutInline {A} at (0,0) size 125x19 [color=#0000EE]
           LayoutText {#text} at (38,0) size 125x19
             text run at (38,0) width 125: "dbaron@dbaron.org"
-        LayoutText {#text} at (163,0) size 84x19
-          text run at (163,0) width 84: ", 2001-06-05"
-      LayoutBlockFlow {P} at (0,556.44) size 784x20
+        LayoutText {#text} at (162,0) size 85x19
+          text run at (162,0) width 85: ", 2001-06-05"
+      LayoutBlockFlow {P} at (0,646.44) size 784x20
         LayoutText {#text} at (0,0) size 289x19
           text run at (0,0) width 289: "Modified and used with the author\x{2019}s permission."
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/bidi-european-terminators-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/bidi-european-terminators-expected.png
index ef30d68..a32964d 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/bidi-european-terminators-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/bidi-european-terminators-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/bidi-european-terminators-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/bidi-european-terminators-expected.txt
index bf6aca6..1a3d4b47 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/bidi-european-terminators-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/bidi-european-terminators-expected.txt
@@ -6,9 +6,9 @@
       LayoutBlockFlow {P} at (0,0) size 784x40
         LayoutText {#text} at (0,0) size 81x19
           text run at (0,0) width 81: "This tests for "
-        LayoutInline {I} at (0,0) size 771x39
-          LayoutText {#text} at (81,0) size 771x39
-            text run at (81,0) width 690: "http://bugzilla.opendarwin.org/show_bug.cgi?id=6014 Bidi algorithm: incorrect resolved levels for neutrals"
+        LayoutInline {I} at (0,0) size 770x39
+          LayoutText {#text} at (81,0) size 770x39
+            text run at (81,0) width 689: "http://bugzilla.opendarwin.org/show_bug.cgi?id=6014 Bidi algorithm: incorrect resolved levels for neutrals"
             text run at (0,20) width 156: "between R and ET ON L"
         LayoutText {#text} at (156,20) size 4x19
           text run at (156,20) width 4: "."
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/bidi-explicit-embedding-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/bidi-explicit-embedding-expected.png
index 7c9c63118..de3679f 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/bidi-explicit-embedding-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/bidi-explicit-embedding-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/bidi-explicit-embedding-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/bidi-explicit-embedding-expected.txt
index 30ac439..dd61fde0 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/bidi-explicit-embedding-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/bidi-explicit-embedding-expected.txt
@@ -1,8 +1,8 @@
 layer at (0,0) size 800x600
   LayoutView at (0,0) size 800x600
-layer at (0,0) size 800x524
-  LayoutBlockFlow {HTML} at (0,0) size 800x524
-    LayoutBlockFlow {BODY} at (8,16) size 784x492
+layer at (0,0) size 800x584
+  LayoutBlockFlow {HTML} at (0,0) size 800x584
+    LayoutBlockFlow {BODY} at (8,16) size 784x552
       LayoutBlockFlow {P} at (0,0) size 784x60
         LayoutText {#text} at (0,0) size 773x59
           text run at (0,0) width 773: "In each line, reading from left to right, the bracket should appear before the parenthesis. The bracket should be a left bracket and"
@@ -40,23 +40,23 @@
             text run at (67,0) width 5 RTL: "("
         LayoutText {#text} at (72,0) size 22x19
           text run at (72,0) width 22: " fgh"
-      LayoutBlockFlow {P} at (0,184) size 784x20
-        LayoutText {#text} at (0,0) size 94x19
-          text run at (0,0) width 26: "abc "
-          text run at (26,0) width 5 RTL: "]"
-          text run at (31,0) width 16: "23"
-          text run at (47,0) width 4 RTL: " "
-          text run at (51,0) width 16: "45"
-          text run at (67,0) width 5 RTL: "\x{202B}("
-          text run at (72,0) width 22: "\x{202C} fgh"
-      LayoutBlockFlow {P} at (0,220) size 784x20
-        LayoutText {#text} at (0,0) size 84x19
-          text run at (0,0) width 26: "abc "
-          text run at (26,0) width 5 RTL: "]"
-          text run at (31,0) width 30: "de fg"
-          text run at (61,0) width 5 RTL: "\x{202B}("
-          text run at (66,0) width 18: "\x{202C} hij"
-      LayoutBlockFlow {P} at (0,256) size 784x20
+      LayoutBlockFlow {P} at (0,184) size 784x30
+        LayoutText {#text} at (0,6) size 94x19
+          text run at (0,6) width 26: "abc "
+          text run at (26,6) width 5 RTL: "]"
+          text run at (31,6) width 16: "23"
+          text run at (47,6) width 4 RTL: " "
+          text run at (51,6) width 16: "45"
+          text run at (67,6) width 5 RTL: "\x{202B}("
+          text run at (72,6) width 22: "\x{202C} fgh"
+      LayoutBlockFlow {P} at (0,230) size 784x30
+        LayoutText {#text} at (0,6) size 84x19
+          text run at (0,6) width 26: "abc "
+          text run at (26,6) width 5 RTL: "]"
+          text run at (31,6) width 30: "de fg"
+          text run at (61,6) width 5 RTL: "\x{202B}("
+          text run at (66,6) width 18: "\x{202C} hij"
+      LayoutBlockFlow {P} at (0,276) size 784x20
         LayoutText {#text} at (0,0) size 8x19
           text run at (0,0) width 8: "1"
         LayoutInline {SPAN} at (0,0) size 44x19
@@ -65,7 +65,7 @@
             text run at (13,0) width 34: "ab cd"
             text run at (47,0) width 5 RTL: "("
         LayoutText {#text} at (0,0) size 0x0
-      LayoutBlockFlow {P} at (0,292) size 784x20
+      LayoutBlockFlow {P} at (0,312) size 784x20
         LayoutText {#text} at (0,0) size 8x19
           text run at (0,0) width 8: "1"
         LayoutInline {SPAN} at (0,0) size 41x19
@@ -74,34 +74,34 @@
             text run at (29,0) width 15: "ab"
             text run at (44,0) width 5 RTL: "("
         LayoutText {#text} at (0,0) size 0x0
-      LayoutBlockFlow {P} at (0,328) size 784x20
-        LayoutText {#text} at (0,0) size 8x19
-          text run at (0,0) width 8: "1"
+      LayoutBlockFlow {P} at (0,348) size 784x30
+        LayoutText {#text} at (0,6) size 8x19
+          text run at (0,6) width 8: "1"
         LayoutInline {SPAN} at (0,0) size 18x19
-          LayoutText {#text} at (8,0) size 18x19
-            text run at (8,0) width 5 RTL: "]"
-            text run at (13,0) width 8: "2"
-            text run at (21,0) width 5 RTL: "\x{202B}("
-            text run at (26,0) width 0: "\x{202C}"
+          LayoutText {#text} at (8,6) size 18x19
+            text run at (8,6) width 5 RTL: "]"
+            text run at (13,6) width 8: "2"
+            text run at (21,6) width 5 RTL: "\x{202B}("
+            text run at (26,6) width 0: "\x{202C}"
         LayoutText {#text} at (0,0) size 0x0
-      LayoutBlockFlow {P} at (0,364) size 784x20
-        LayoutText {#text} at (0,0) size 8x19
-          text run at (0,0) width 8: "1"
+      LayoutBlockFlow {P} at (0,394) size 784x30
+        LayoutText {#text} at (0,6) size 8x19
+          text run at (0,6) width 8: "1"
         LayoutInline {SPAN} at (0,0) size 17x19
-          LayoutText {#text} at (8,0) size 17x19
-            text run at (8,0) width 5 RTL: "]"
-            text run at (13,0) width 7: "a"
-            text run at (20,0) width 5 RTL: "\x{202B}("
-            text run at (25,0) width 0: "\x{202C}"
+          LayoutText {#text} at (8,6) size 17x19
+            text run at (8,6) width 5 RTL: "]"
+            text run at (13,6) width 7: "a"
+            text run at (20,6) width 5 RTL: "\x{202B}("
+            text run at (25,6) width 0: "\x{202C}"
         LayoutText {#text} at (0,0) size 0x0
-      LayoutBlockFlow {P} at (0,400) size 784x20
-        LayoutText {#text} at (0,0) size 49x19
-          text run at (0,0) width 8: "1"
-          text run at (8,0) width 21 RTL: " \x{5D2}\x{5D3}]"
-          text run at (29,0) width 15: "ab"
-          text run at (44,0) width 5 RTL: "\x{202B}("
-          text run at (49,0) width 0: "\x{202C}"
-      LayoutBlockFlow {P} at (0,436) size 784x20
+      LayoutBlockFlow {P} at (0,440) size 784x30
+        LayoutText {#text} at (0,6) size 49x19
+          text run at (0,6) width 8: "1"
+          text run at (8,6) width 21 RTL: " \x{5D2}\x{5D3}]"
+          text run at (29,6) width 15: "ab"
+          text run at (44,6) width 5 RTL: "\x{202B}("
+          text run at (49,6) width 0: "\x{202C}"
+      LayoutBlockFlow {P} at (0,486) size 784x20
         LayoutInline {SPAN} at (0,0) size 79x19
           LayoutText {#text} at (0,0) size 79x19
             text run at (0,0) width 5 RTL: "]"
@@ -110,11 +110,11 @@
             text run at (55,0) width 19: "def"
             text run at (74,0) width 5 RTL: "("
         LayoutText {#text} at (0,0) size 0x0
-      LayoutBlockFlow {P} at (0,472) size 784x20
-        LayoutText {#text} at (0,0) size 79x19
-          text run at (0,0) width 5 RTL: "]"
-          text run at (5,0) width 22: "abc"
-          text run at (27,0) width 28 RTL: " \x{5D0}\x{5D1}\x{5D2} "
-          text run at (55,0) width 19: "def"
-          text run at (74,0) width 5 RTL: "\x{202B}("
-          text run at (79,0) width 0: "\x{202C}"
+      LayoutBlockFlow {P} at (0,522) size 784x30
+        LayoutText {#text} at (0,6) size 79x19
+          text run at (0,6) width 5 RTL: "]"
+          text run at (5,6) width 22: "abc"
+          text run at (27,6) width 28 RTL: " \x{5D0}\x{5D1}\x{5D2} "
+          text run at (55,6) width 19: "def"
+          text run at (74,6) width 5 RTL: "\x{202B}("
+          text run at (79,6) width 0: "\x{202C}"
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/bidi-ignored-for-first-child-inline-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/bidi-ignored-for-first-child-inline-expected.png
index e036272a..9a24972 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/bidi-ignored-for-first-child-inline-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/bidi-ignored-for-first-child-inline-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/bidi-ignored-for-first-child-inline-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/bidi-ignored-for-first-child-inline-expected.txt
index 8a70c28..ce3f897 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/bidi-ignored-for-first-child-inline-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/bidi-ignored-for-first-child-inline-expected.txt
@@ -6,12 +6,12 @@
       LayoutBlockFlow {P} at (0,0) size 784x40
         LayoutText {#text} at (0,0) size 99x19
           text run at (0,0) width 99: "This is a test for "
-        LayoutInline {I} at (0,0) size 762x39
-          LayoutText {#text} at (99,0) size 762x39
-            text run at (99,0) width 663: "http://bugzilla.opendarwin.org/show_bug.cgi?id=5980 Bidi properties of an inline container whose first"
-            text run at (0,20) width 247: "child is an inline container are ignored"
-        LayoutText {#text} at (247,20) size 4x19
-          text run at (247,20) width 4: "."
+        LayoutInline {I} at (0,0) size 761x39
+          LayoutText {#text} at (99,0) size 761x39
+            text run at (99,0) width 662: "http://bugzilla.opendarwin.org/show_bug.cgi?id=5980 Bidi properties of an inline container whose first"
+            text run at (0,20) width 246: "child is an inline container are ignored"
+        LayoutText {#text} at (245,20) size 5x19
+          text run at (245,20) width 5: "."
       LayoutBlockFlow {HR} at (0,56) size 784x2 [border: (1px inset #EEEEEE)]
       LayoutBlockFlow {P} at (0,74) size 784x20
         LayoutText {#text} at (0,0) size 292x19
@@ -82,20 +82,20 @@
       LayoutBlockFlow (anonymous) at (0,372) size 784x20
         LayoutText {#text} at (0,0) size 229x19
           text run at (0,0) width 229: "The following lines should be identical:"
-      LayoutBlockFlow {P} at (0,408) size 784x20
-        LayoutText {#text} at (0,0) size 49x19
-          text run at (0,0) width 19 RTL: "\x{5D3}\x{5D4}\x{5D5}"
-          text run at (19,0) width 10: "(["
-          text run at (29,0) width 20 RTL: "\x{202C}\x{5D0}\x{5D1}\x{5D2}"
-          text run at (49,0) width 0: "\x{202A}"
-      LayoutBlockFlow {P} at (0,444) size 784x20
+      LayoutBlockFlow {P} at (0,408) size 784x30
+        LayoutText {#text} at (0,6) size 49x19
+          text run at (0,6) width 19 RTL: "\x{5D3}\x{5D4}\x{5D5}"
+          text run at (19,6) width 10: "(["
+          text run at (29,6) width 20 RTL: "\x{202C}\x{5D0}\x{5D1}\x{5D2}"
+          text run at (49,6) width 0: "\x{202A}"
+      LayoutBlockFlow {P} at (0,454) size 784x20
         LayoutText {#text} at (0,0) size 29x19
           text run at (0,0) width 19 RTL: "\x{5D3}\x{5D4}\x{5D5}"
           text run at (19,0) width 10: "(["
         LayoutInline {SPAN} at (0,0) size 0x19
         LayoutText {#text} at (29,0) size 20x19
           text run at (29,0) width 20 RTL: "\x{5D0}\x{5D1}\x{5D2}"
-      LayoutBlockFlow {P} at (0,480) size 784x20
+      LayoutBlockFlow {P} at (0,490) size 784x20
         LayoutText {#text} at (0,0) size 29x19
           text run at (0,0) width 19 RTL: "\x{5D3}\x{5D4}\x{5D5}"
           text run at (19,0) width 10: "(["
@@ -103,7 +103,7 @@
           LayoutInline {SPAN} at (0,0) size 0x19
         LayoutText {#text} at (29,0) size 20x19
           text run at (29,0) width 20 RTL: "\x{5D0}\x{5D1}\x{5D2}"
-      LayoutBlockFlow {P} at (0,516) size 784x20
+      LayoutBlockFlow {P} at (0,526) size 784x20
         LayoutText {#text} at (0,0) size 29x19
           text run at (0,0) width 19 RTL: "\x{5D3}\x{5D4}\x{5D5}"
           text run at (19,0) width 10: "(["
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/bidi-innertext-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/bidi-innertext-expected.png
index 49c3bd6..086263cc 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/bidi-innertext-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/bidi-innertext-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/bidi-innertext-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/bidi-innertext-expected.txt
index 26076ed..e3c48140 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/bidi-innertext-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/bidi-innertext-expected.txt
@@ -3,84 +3,83 @@
 layer at (0,0) size 800x600
   LayoutBlockFlow {HTML} at (0,0) size 800x600
     LayoutBlockFlow {BODY} at (8,8) size 784x576
-      LayoutBlockFlow (anonymous) at (0,0) size 784x40
-        LayoutText {#text} at (0,0) size 723x39
-          text run at (0,0) width 442: "The following tests text iteration over RTL text embedded with LTR text. "
-          text run at (442,0) width 281: "TextIterators are used for find, spellcheck, and"
-          text run at (0,20) width 60: ".innerText"
-      LayoutBlockFlow {HR} at (0,48) size 784x2 [border: (1px inset #EEEEEE)]
-      LayoutBlockFlow (anonymous) at (0,58) size 784x20
+      LayoutBlockFlow (anonymous) at (0,0) size 784x20
+        LayoutText {#text} at (0,0) size 783x19
+          text run at (0,0) width 440: "The following tests text iteration over RTL text embedded with LTR text. "
+          text run at (439,0) width 344: "TextIterators are used for find, spellcheck, and .innerText"
+      LayoutBlockFlow {HR} at (0,28) size 784x2 [border: (1px inset #EEEEEE)]
+      LayoutBlockFlow (anonymous) at (0,38) size 784x20
         LayoutText {#text} at (0,0) size 129x19
           text run at (0,0) width 129: "Embedded Numbers:"
-      LayoutBlockFlow {DIV} at (0,78) size 784x20 [color=#0000FF]
-        LayoutText {#text} at (0,0) size 104x19
-          text run at (0,0) width 52: "Testing ("
-          text run at (52,0) width 12 RTL: "\x{5DF}\x{5DE}"
-          text run at (64,0) width 8: "3"
-          text run at (72,0) width 27 RTL: "\x{5D7}\x{5D5}\x{5D3}\x{5D0}"
-          text run at (99,0) width 5: ")"
-      LayoutBlockFlow (anonymous) at (0,98) size 784x20
-        LayoutText {#text} at (0,0) size 101x19
-          text run at (0,0) width 101: "Embedded LTR:"
-      LayoutBlockFlow {DIV} at (0,118) size 784x20 [color=#0000FF]
-        LayoutText {#text} at (0,0) size 124x19
-          text run at (0,0) width 52: "Testing ("
-          text run at (52,0) width 27 RTL: "\x{5D7}\x{5D5}\x{5D3}\x{5D0}"
-          text run at (79,0) width 28: "hello"
-          text run at (107,0) width 12 RTL: "\x{5DF}\x{5DE}"
-          text run at (119,0) width 5: ")"
-      LayoutBlockFlow (anonymous) at (0,138) size 784x20
-        LayoutText {#text} at (0,0) size 184x19
-          text run at (0,0) width 184: "Embedded Numbers and LTR"
-      LayoutBlockFlow {DIV} at (0,158) size 784x20 [color=#0000FF]
+      LayoutBlockFlow {DIV} at (0,58) size 784x20 [color=#0000FF]
+        LayoutText {#text} at (0,0) size 103x19
+          text run at (0,0) width 51: "Testing ("
+          text run at (50,0) width 13 RTL: "\x{5DF}\x{5DE}"
+          text run at (62,0) width 9: "3"
+          text run at (70,0) width 28 RTL: "\x{5D7}\x{5D5}\x{5D3}\x{5D0}"
+          text run at (97,0) width 6: ")"
+      LayoutBlockFlow (anonymous) at (0,78) size 784x20
+        LayoutText {#text} at (0,0) size 100x19
+          text run at (0,0) width 100: "Embedded LTR:"
+      LayoutBlockFlow {DIV} at (0,98) size 784x20 [color=#0000FF]
         LayoutText {#text} at (0,0) size 123x19
-          text run at (0,0) width 52: "Testing ("
-          text run at (52,0) width 24 RTL: "\x{5E7}\x{5E7}\x{5E8}"
-          text run at (76,0) width 8: "3"
-          text run at (84,0) width 27 RTL: "\x{5D9}\x{5E7}\x{5DD}\x{5DC}"
-          text run at (111,0) width 12: "h)"
-      LayoutBlockFlow (anonymous) at (0,178) size 784x20
+          text run at (0,0) width 51: "Testing ("
+          text run at (50,0) width 28 RTL: "\x{5D7}\x{5D5}\x{5D3}\x{5D0}"
+          text run at (77,0) width 29: "hello"
+          text run at (105,0) width 13 RTL: "\x{5DF}\x{5DE}"
+          text run at (117,0) width 6: ")"
+      LayoutBlockFlow (anonymous) at (0,118) size 784x20
+        LayoutText {#text} at (0,0) size 183x19
+          text run at (0,0) width 183: "Embedded Numbers and LTR"
+      LayoutBlockFlow {DIV} at (0,138) size 784x20 [color=#0000FF]
+        LayoutText {#text} at (0,0) size 122x19
+          text run at (0,0) width 51: "Testing ("
+          text run at (50,0) width 25 RTL: "\x{5E7}\x{5E7}\x{5E8}"
+          text run at (74,0) width 9: "3"
+          text run at (82,0) width 28 RTL: "\x{5D9}\x{5E7}\x{5DD}\x{5DC}"
+          text run at (109,0) width 13: "h)"
+      LayoutBlockFlow (anonymous) at (0,158) size 784x20
         LayoutText {#text} at (0,0) size 207x19
           text run at (0,0) width 207: "Embedded Numbers with spacing:"
-      LayoutBlockFlow {DIV} at (0,198) size 784x20 [color=#0000FF]
-        LayoutText {#text} at (0,0) size 229x19
-          text run at (0,0) width 52: "Testing ("
-          text run at (52,0) width 31 RTL: " \x{5D7}\x{5D5}\x{5D3}\x{5D0}"
-          text run at (83,0) width 24: "300"
-          text run at (107,0) width 43 RTL: "\x{5D7}\x{5D5}\x{5D3}\x{5D0}\x{5DF}\x{5DE} "
-          text run at (150,0) width 40: "34023"
-          text run at (190,0) width 34 RTL: "\x{5D9}\x{5E7}\x{5DA}\x{5DA}\x{5DD}"
-          text run at (224,0) width 5: ")"
-      LayoutBlockFlow (anonymous) at (0,218) size 784x20
-        LayoutText {#text} at (0,0) size 64x19
-          text run at (0,0) width 64: "Plain LTR:"
-      LayoutBlockFlow {DIV} at (0,238) size 784x20 [color=#0000FF]
-        LayoutText {#text} at (0,0) size 85x19
-          text run at (0,0) width 85: "Testing (hello)"
-      LayoutBlockFlow (anonymous) at (0,258) size 784x20
-        LayoutText {#text} at (0,0) size 179x19
-          text run at (0,0) width 179: "Embedded LTR with spacing:"
-      LayoutBlockFlow {DIV} at (0,278) size 784x20 [color=#0000FF]
-        LayoutText {#text} at (0,0) size 162x19
-          text run at (0,0) width 52: "Testing ("
-          text run at (52,0) width 53 RTL: "\x{5D7}\x{5D5}\x{5D3}\x{5D9}\x{5E7}\x{5DA}\x{5DA}\x{5DD}"
-          text run at (105,0) width 36: " hello "
-          text run at (141,0) width 16 RTL: "\x{5DF}\x{5DE}\x{5D9}"
-          text run at (157,0) width 5: ")"
-      LayoutBlockFlow (anonymous) at (0,298) size 784x20
+      LayoutBlockFlow {DIV} at (0,178) size 784x20 [color=#0000FF]
+        LayoutText {#text} at (0,0) size 228x19
+          text run at (0,0) width 51: "Testing ("
+          text run at (50,0) width 32 RTL: " \x{5D7}\x{5D5}\x{5D3}\x{5D0}"
+          text run at (81,0) width 25: "300"
+          text run at (105,0) width 44 RTL: "\x{5D7}\x{5D5}\x{5D3}\x{5D0}\x{5DF}\x{5DE} "
+          text run at (148,0) width 41: "34023"
+          text run at (188,0) width 35 RTL: "\x{5D9}\x{5E7}\x{5DA}\x{5DA}\x{5DD}"
+          text run at (222,0) width 6: ")"
+      LayoutBlockFlow (anonymous) at (0,198) size 784x20
+        LayoutText {#text} at (0,0) size 63x19
+          text run at (0,0) width 63: "Plain LTR:"
+      LayoutBlockFlow {DIV} at (0,218) size 784x20 [color=#0000FF]
+        LayoutText {#text} at (0,0) size 84x19
+          text run at (0,0) width 84: "Testing (hello)"
+      LayoutBlockFlow (anonymous) at (0,238) size 784x20
+        LayoutText {#text} at (0,0) size 178x19
+          text run at (0,0) width 178: "Embedded LTR with spacing:"
+      LayoutBlockFlow {DIV} at (0,258) size 784x20 [color=#0000FF]
+        LayoutText {#text} at (0,0) size 161x19
+          text run at (0,0) width 51: "Testing ("
+          text run at (50,0) width 54 RTL: "\x{5D7}\x{5D5}\x{5D3}\x{5D9}\x{5E7}\x{5DA}\x{5DA}\x{5DD}"
+          text run at (103,0) width 37: " hello "
+          text run at (139,0) width 17 RTL: "\x{5DF}\x{5DE}\x{5D9}"
+          text run at (155,0) width 6: ")"
+      LayoutBlockFlow (anonymous) at (0,278) size 784x20
         LayoutText {#text} at (0,0) size 156x19
           text run at (0,0) width 156: "Mixed but not embedded:"
-      LayoutBlockFlow {DIV} at (0,318) size 784x20 [color=#0000FF]
-        LayoutText {#text} at (0,0) size 116x19
-          text run at (0,0) width 80: "Testing (hello"
-          text run at (80,0) width 31 RTL: "\x{5D7}\x{5D5}\x{5D3}\x{5DF}\x{5DE}"
-          text run at (111,0) width 5: ")"
-      LayoutBlockFlow (anonymous) at (0,338) size 784x20
+      LayoutBlockFlow {DIV} at (0,298) size 784x20 [color=#0000FF]
+        LayoutText {#text} at (0,0) size 115x19
+          text run at (0,0) width 79: "Testing (hello"
+          text run at (78,0) width 32 RTL: "\x{5D7}\x{5D5}\x{5D3}\x{5DF}\x{5DE}"
+          text run at (109,0) width 6: ")"
+      LayoutBlockFlow (anonymous) at (0,318) size 784x20
         LayoutText {#text} at (0,0) size 156x19
           text run at (0,0) width 156: "Mixed but not embedded:"
-      LayoutBlockFlow {DIV} at (0,358) size 784x20 [color=#0000FF]
-        LayoutText {#text} at (0,0) size 116x19
-          text run at (0,0) width 52: "Testing ("
-          text run at (52,0) width 31 RTL: "\x{5D7}\x{5D5}\x{5D3}\x{5DF}\x{5DE}"
-          text run at (83,0) width 33: "hello)"
-      LayoutBlockFlow {OL} at (0,394) size 784x0
+      LayoutBlockFlow {DIV} at (0,338) size 784x20 [color=#0000FF]
+        LayoutText {#text} at (0,0) size 115x19
+          text run at (0,0) width 51: "Testing ("
+          text run at (50,0) width 32 RTL: "\x{5D7}\x{5D5}\x{5D3}\x{5DF}\x{5DE}"
+          text run at (81,0) width 34: "hello)"
+      LayoutBlockFlow {OL} at (0,374) size 784x0
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/bidi-listbox-atsui-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/bidi-listbox-atsui-expected.png
index 17eab31d..6c8b9bc 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/bidi-listbox-atsui-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/bidi-listbox-atsui-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/bidi-listbox-atsui-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/bidi-listbox-atsui-expected.txt
index ec5767e..6e0614e 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/bidi-listbox-atsui-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/bidi-listbox-atsui-expected.txt
@@ -4,9 +4,9 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x600
     LayoutBlockFlow {BODY} at (8,8) size 784x584
       LayoutBlockFlow {P} at (0,0) size 784x40
-        LayoutText {#text} at (0,0) size 549x19
-          text run at (0,0) width 549: "This tests that bidirectional text is correctly rendered when using ATSUI in list box controls."
-        LayoutBR {BR} at (549,15) size 0x0
+        LayoutText {#text} at (0,0) size 548x19
+          text run at (0,0) width 548: "This tests that bidirectional text is correctly rendered when using ATSUI in list box controls."
+        LayoutBR {BR} at (547,15) size 1x0
         LayoutText {#text} at (0,20) size 543x19
           text run at (0,20) width 543: "The order of the text below each list box should match the order of the select's option text."
       LayoutBlockFlow (anonymous) at (0,56) size 784x56
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/bidi-neutral-directionality-paragraph-start-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/bidi-neutral-directionality-paragraph-start-expected.png
index 0542851..fb2101f 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/bidi-neutral-directionality-paragraph-start-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/bidi-neutral-directionality-paragraph-start-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/bidi-neutral-directionality-paragraph-start-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/bidi-neutral-directionality-paragraph-start-expected.txt
index 4c4cd61..51928fd2 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/bidi-neutral-directionality-paragraph-start-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/bidi-neutral-directionality-paragraph-start-expected.txt
@@ -9,17 +9,17 @@
       LayoutBlockFlow {P} at (0,36) size 784x80
         LayoutText {#text} at (0,0) size 777x79
           text run at (0,0) width 777: "The directionality of a neutral character at the beginning of a paragraph (or after a hard line break) is decided incorrectly if the first"
-          text run at (0,20) width 758: "non-neutral character in the paragraph has directionality opposite to the paragraph directionality. For example, if the paragraph"
-          text run at (0,40) width 777: "direction is LTR, the first character on the paragraph is a question mark and the next one is a Hebrew character, then the question"
+          text run at (0,20) width 757: "non-neutral character in the paragraph has directionality opposite to the paragraph directionality. For example, if the paragraph"
+          text run at (0,40) width 775: "direction is LTR, the first character on the paragraph is a question mark and the next one is a Hebrew character, then the question"
           text run at (0,60) width 511: "mark will is considered right-to-left and appears to the right of the Hebrew character."
       LayoutBlockFlow {P} at (0,132) size 784x40
         LayoutText {#text} at (0,0) size 480x19
           text run at (0,0) width 480: "The rule to follow is 3.3.4.N2 in the Unicode Standard's Bidirectional Algorithm"
-        LayoutInline {A} at (0,0) size 378x19 [color=#0000EE]
-          LayoutText {#text} at (0,20) size 378x19
-            text run at (0,20) width 378: "http://www.unicode.org/reports/tr9/#Resolving_Neutral_Types"
-        LayoutText {#text} at (378,20) size 4x19
-          text run at (378,20) width 4: "."
+        LayoutInline {A} at (0,0) size 376x19 [color=#0000EE]
+          LayoutText {#text} at (0,20) size 376x19
+            text run at (0,20) width 376: "http://www.unicode.org/reports/tr9/#Resolving_Neutral_Types"
+        LayoutText {#text} at (375,20) size 5x19
+          text run at (375,20) width 5: "."
       LayoutBlockFlow {P} at (0,188) size 784x20
         LayoutText {#text} at (0,0) size 644x19
           text run at (0,0) width 644: "If the test is successful, the question marks should be on the far left and far right of the next two paragraphs."
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/bidi-neutral-run-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/bidi-neutral-run-expected.png
index 8d8b74c..25d613a5 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/bidi-neutral-run-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/bidi-neutral-run-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/bidi-neutral-run-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/bidi-neutral-run-expected.txt
index 5765a97..76fd8c4 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/bidi-neutral-run-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/bidi-neutral-run-expected.txt
@@ -1,12 +1,12 @@
-layer at (0,0) size 800x600 clip at (0,0) size 785x600 scrollHeight 6760
+layer at (0,0) size 800x600 clip at (0,0) size 785x600 scrollHeight 7240
   LayoutView at (0,0) size 800x600
-layer at (0,0) size 785x6760 backgroundClip at (0,0) size 785x600 clip at (0,0) size 785x600
-  LayoutBlockFlow {HTML} at (0,0) size 785x6760
-    LayoutBlockFlow {BODY} at (8,8) size 769x6736
+layer at (0,0) size 785x7240 backgroundClip at (0,0) size 785x600 clip at (0,0) size 785x600
+  LayoutBlockFlow {HTML} at (0,0) size 785x7240
+    LayoutBlockFlow {BODY} at (8,8) size 769x7216
       LayoutBlockFlow {P} at (0,0) size 769x20
-        LayoutText {#text} at (0,0) size 285x19
-          text run at (0,0) width 285: "Tests the resolved level of runs of neutral types."
-      LayoutBlockFlow {DIV} at (0,36) size 769x3342
+        LayoutText {#text} at (0,0) size 284x19
+          text run at (0,0) width 284: "Tests the resolved level of runs of neutral types."
+      LayoutBlockFlow {DIV} at (0,36) size 769x3582
         LayoutBlockFlow {P} at (0,0) size 769x20
           LayoutText {#text} at (0,0) size 43x19
             text run at (0,0) width 43: "ab(^cd"
@@ -46,133 +46,133 @@
             text run at (0,0) width 16: "\x{661}\x{662}"
             text run at (16,0) width 14 RTL: "\x{627}\x{628}"
             text run at (30,0) width 28: "(^cd"
-        LayoutBlockFlow {P} at (0,324) size 769x20
-          LayoutText {#text} at (0,0) size 35x19
-            text run at (0,0) width 7: "\x{202A}?"
-            text run at (7,0) width 28: "\x{202C}(^cd"
-        LayoutBlockFlow {P} at (0,360) size 769x20
-          LayoutText {#text} at (0,0) size 35x19
-            text run at (0,0) width 7 RTL: "\x{202B}?"
-            text run at (7,0) width 28: "\x{202C}(^cd"
-        LayoutBlockFlow {P} at (0,396) size 769x20
+        LayoutBlockFlow {P} at (0,324) size 769x30
+          LayoutText {#text} at (0,6) size 35x19
+            text run at (0,6) width 7: "\x{202A}?"
+            text run at (7,6) width 28: "\x{202C}(^cd"
+        LayoutBlockFlow {P} at (0,370) size 769x30
+          LayoutText {#text} at (0,6) size 35x19
+            text run at (0,6) width 7 RTL: "\x{202B}?"
+            text run at (7,6) width 28: "\x{202C}(^cd"
+        LayoutBlockFlow {P} at (0,416) size 769x20
           LayoutText {#text} at (0,0) size 40x19
             text run at (0,0) width 28: "ab(^"
             text run at (28,0) width 12 RTL: "\x{5D2}\x{5D3}"
-        LayoutBlockFlow {P} at (0,432) size 769x20
+        LayoutBlockFlow {P} at (0,452) size 769x20
           LayoutText {#text} at (0,0) size 40x19
             text run at (0,0) width 40 RTL: "\x{5D0}\x{5D1}(^\x{5D2}\x{5D3}"
-        LayoutBlockFlow {P} at (0,468) size 769x20
+        LayoutBlockFlow {P} at (0,488) size 769x20
           LayoutText {#text} at (0,0) size 39x19
             text run at (0,0) width 39 RTL: "\x{627}\x{628}(^\x{5D2}\x{5D3}"
-        LayoutBlockFlow {P} at (0,504) size 769x20
+        LayoutBlockFlow {P} at (0,524) size 769x20
           LayoutText {#text} at (0,0) size 56x19
             text run at (0,0) width 44: "ab12(^"
             text run at (44,0) width 12 RTL: "\x{5D2}\x{5D3}"
-        LayoutBlockFlow {P} at (0,540) size 769x20
+        LayoutBlockFlow {P} at (0,560) size 769x20
           LayoutText {#text} at (0,0) size 56x19
             text run at (0,0) width 25 RTL: "(^\x{5D2}\x{5D3}"
             text run at (25,0) width 16: "12"
             text run at (41,0) width 15 RTL: "\x{5D0}\x{5D1}"
-        LayoutBlockFlow {P} at (0,576) size 769x20
+        LayoutBlockFlow {P} at (0,596) size 769x20
           LayoutText {#text} at (0,0) size 55x19
             text run at (0,0) width 25 RTL: "(^\x{5D2}\x{5D3}"
             text run at (25,0) width 16: "12"
             text run at (41,0) width 14 RTL: "\x{627}\x{628}"
-        LayoutBlockFlow {P} at (0,612) size 769x20
+        LayoutBlockFlow {P} at (0,632) size 769x20
           LayoutText {#text} at (0,0) size 56x19
             text run at (0,0) width 15: "ab"
             text run at (15,0) width 25 RTL: "(^\x{5D2}\x{5D3}"
             text run at (40,0) width 16: "\x{661}\x{662}"
-        LayoutBlockFlow {P} at (0,648) size 769x20
+        LayoutBlockFlow {P} at (0,668) size 769x20
           LayoutText {#text} at (0,0) size 56x19
             text run at (0,0) width 25 RTL: "(^\x{5D2}\x{5D3}"
             text run at (25,0) width 16: "\x{661}\x{662}"
             text run at (41,0) width 15 RTL: "\x{5D0}\x{5D1}"
-        LayoutBlockFlow {P} at (0,684) size 769x20
+        LayoutBlockFlow {P} at (0,704) size 769x20
           LayoutText {#text} at (0,0) size 55x19
             text run at (0,0) width 25 RTL: "(^\x{5D2}\x{5D3}"
             text run at (25,0) width 16: "\x{661}\x{662}"
             text run at (41,0) width 14 RTL: "\x{627}\x{628}"
-        LayoutBlockFlow {P} at (0,720) size 769x20
-          LayoutText {#text} at (0,0) size 32x19
-            text run at (0,0) width 7: "\x{202A}?"
-            text run at (7,0) width 13: "\x{202C}(^"
-            text run at (20,0) width 12 RTL: "\x{5D2}\x{5D3}"
-        LayoutBlockFlow {P} at (0,756) size 769x20
-          LayoutText {#text} at (0,0) size 32x19
-            text run at (0,0) width 25 RTL: "\x{202C}(^\x{5D2}\x{5D3}"
-            text run at (25,0) width 7 RTL: "\x{202B}?"
-        LayoutBlockFlow {P} at (0,792) size 769x20
+        LayoutBlockFlow {P} at (0,740) size 769x30
+          LayoutText {#text} at (0,6) size 32x19
+            text run at (0,6) width 7: "\x{202A}?"
+            text run at (7,6) width 13: "\x{202C}(^"
+            text run at (20,6) width 12 RTL: "\x{5D2}\x{5D3}"
+        LayoutBlockFlow {P} at (0,786) size 769x30
+          LayoutText {#text} at (0,6) size 32x19
+            text run at (0,6) width 25 RTL: "\x{202C}(^\x{5D2}\x{5D3}"
+            text run at (25,6) width 7 RTL: "\x{202B}?"
+        LayoutBlockFlow {P} at (0,832) size 769x20
           LayoutText {#text} at (0,0) size 41x19
             text run at (0,0) width 28: "ab(^"
             text run at (28,0) width 13 RTL: "\x{62C}\x{62F}"
-        LayoutBlockFlow {P} at (0,828) size 769x20
+        LayoutBlockFlow {P} at (0,868) size 769x20
           LayoutText {#text} at (0,0) size 41x19
             text run at (0,0) width 41 RTL: "\x{5D0}\x{5D1}(^\x{62C}\x{62F}"
-        LayoutBlockFlow {P} at (0,864) size 769x20
+        LayoutBlockFlow {P} at (0,904) size 769x20
           LayoutText {#text} at (0,0) size 40x19
             text run at (0,0) width 40 RTL: "\x{627}\x{628}(^\x{62C}\x{62F}"
-        LayoutBlockFlow {P} at (0,900) size 769x20
+        LayoutBlockFlow {P} at (0,940) size 769x20
           LayoutText {#text} at (0,0) size 57x19
             text run at (0,0) width 44: "ab12(^"
             text run at (44,0) width 13 RTL: "\x{62C}\x{62F}"
-        LayoutBlockFlow {P} at (0,936) size 769x20
+        LayoutBlockFlow {P} at (0,976) size 769x20
           LayoutText {#text} at (0,0) size 57x19
             text run at (0,0) width 26 RTL: "(^\x{62C}\x{62F}"
             text run at (26,0) width 16: "12"
             text run at (42,0) width 15 RTL: "\x{5D0}\x{5D1}"
-        LayoutBlockFlow {P} at (0,972) size 769x20
+        LayoutBlockFlow {P} at (0,1012) size 769x20
           LayoutText {#text} at (0,0) size 56x19
             text run at (0,0) width 26 RTL: "(^\x{62C}\x{62F}"
             text run at (26,0) width 16: "12"
             text run at (42,0) width 14 RTL: "\x{627}\x{628}"
-        LayoutBlockFlow {P} at (0,1008) size 769x20
+        LayoutBlockFlow {P} at (0,1048) size 769x20
           LayoutText {#text} at (0,0) size 57x19
             text run at (0,0) width 15: "ab"
             text run at (15,0) width 26 RTL: "(^\x{62C}\x{62F}"
             text run at (41,0) width 16: "\x{661}\x{662}"
-        LayoutBlockFlow {P} at (0,1044) size 769x20
+        LayoutBlockFlow {P} at (0,1084) size 769x20
           LayoutText {#text} at (0,0) size 57x19
             text run at (0,0) width 26 RTL: "(^\x{62C}\x{62F}"
             text run at (26,0) width 16: "\x{661}\x{662}"
             text run at (42,0) width 15 RTL: "\x{5D0}\x{5D1}"
-        LayoutBlockFlow {P} at (0,1080) size 769x20
+        LayoutBlockFlow {P} at (0,1120) size 769x20
           LayoutText {#text} at (0,0) size 56x19
             text run at (0,0) width 26 RTL: "(^\x{62C}\x{62F}"
             text run at (26,0) width 16: "\x{661}\x{662}"
             text run at (42,0) width 14 RTL: "\x{627}\x{628}"
-        LayoutBlockFlow {P} at (0,1116) size 769x30
+        LayoutBlockFlow {P} at (0,1156) size 769x30
           LayoutText {#text} at (0,6) size 33x19
             text run at (0,6) width 7: "\x{202A}?"
             text run at (7,6) width 13: "\x{202C}(^"
             text run at (20,6) width 13 RTL: "\x{62C}\x{62F}"
-        LayoutBlockFlow {P} at (0,1162) size 769x30
+        LayoutBlockFlow {P} at (0,1202) size 769x30
           LayoutText {#text} at (0,6) size 33x19
             text run at (0,6) width 26 RTL: "\x{202C}(^\x{62C}\x{62F}"
             text run at (26,6) width 7 RTL: "\x{202B}?"
-        LayoutBlockFlow {P} at (0,1208) size 769x20
+        LayoutBlockFlow {P} at (0,1248) size 769x20
           LayoutText {#text} at (0,0) size 60x19
             text run at (0,0) width 44: "ab(^34"
             text run at (44,0) width 10 RTL: "\x{5E9}"
             text run at (54,0) width 6: "z"
-        LayoutBlockFlow {P} at (0,1244) size 769x20
+        LayoutBlockFlow {P} at (0,1284) size 769x20
           LayoutText {#text} at (0,0) size 60x19
             text run at (0,0) width 10 RTL: "\x{5E9}"
             text run at (10,0) width 16: "34"
             text run at (26,0) width 28 RTL: "\x{5D0}\x{5D1}(^"
             text run at (54,0) width 6: "z"
-        LayoutBlockFlow {P} at (0,1280) size 769x20
+        LayoutBlockFlow {P} at (0,1320) size 769x20
           LayoutText {#text} at (0,0) size 59x19
             text run at (0,0) width 10 RTL: "\x{5E9}"
             text run at (10,0) width 16: "34"
             text run at (26,0) width 27 RTL: "\x{627}\x{628}(^"
             text run at (53,0) width 6: "z"
-        LayoutBlockFlow {P} at (0,1316) size 769x20
+        LayoutBlockFlow {P} at (0,1356) size 769x20
           LayoutText {#text} at (0,0) size 76x19
             text run at (0,0) width 60: "ab12(^34"
             text run at (60,0) width 10 RTL: "\x{5E9}"
             text run at (70,0) width 6: "z"
-        LayoutBlockFlow {P} at (0,1352) size 769x20
+        LayoutBlockFlow {P} at (0,1392) size 769x20
           LayoutText {#text} at (0,0) size 76x19
             text run at (0,0) width 10 RTL: "\x{5E9}"
             text run at (10,0) width 16: "34"
@@ -180,7 +180,7 @@
             text run at (39,0) width 16: "12"
             text run at (55,0) width 15 RTL: "\x{5D0}\x{5D1}"
             text run at (70,0) width 6: "z"
-        LayoutBlockFlow {P} at (0,1388) size 769x20
+        LayoutBlockFlow {P} at (0,1428) size 769x20
           LayoutText {#text} at (0,0) size 75x19
             text run at (0,0) width 10 RTL: "\x{5E9}"
             text run at (10,0) width 16: "34"
@@ -188,14 +188,14 @@
             text run at (39,0) width 16: "12"
             text run at (55,0) width 14 RTL: "\x{627}\x{628}"
             text run at (69,0) width 6: "z"
-        LayoutBlockFlow {P} at (0,1424) size 769x20
+        LayoutBlockFlow {P} at (0,1464) size 769x20
           LayoutText {#text} at (0,0) size 76x19
             text run at (0,0) width 15: "ab"
             text run at (15,0) width 16: "\x{661}\x{662}"
             text run at (31,0) width 29: "(^34"
             text run at (60,0) width 10 RTL: "\x{5E9}"
             text run at (70,0) width 6: "z"
-        LayoutBlockFlow {P} at (0,1460) size 769x20
+        LayoutBlockFlow {P} at (0,1500) size 769x20
           LayoutText {#text} at (0,0) size 76x19
             text run at (0,0) width 10 RTL: "\x{5E9}"
             text run at (10,0) width 16: "34"
@@ -203,7 +203,7 @@
             text run at (39,0) width 16: "\x{661}\x{662}"
             text run at (55,0) width 15 RTL: "\x{5D0}\x{5D1}"
             text run at (70,0) width 6: "z"
-        LayoutBlockFlow {P} at (0,1496) size 769x20
+        LayoutBlockFlow {P} at (0,1536) size 769x20
           LayoutText {#text} at (0,0) size 75x19
             text run at (0,0) width 10 RTL: "\x{5E9}"
             text run at (10,0) width 16: "34"
@@ -211,44 +211,44 @@
             text run at (39,0) width 16: "\x{661}\x{662}"
             text run at (55,0) width 14 RTL: "\x{627}\x{628}"
             text run at (69,0) width 6: "z"
-        LayoutBlockFlow {P} at (0,1532) size 769x20
-          LayoutText {#text} at (0,0) size 52x19
-            text run at (0,0) width 7: "\x{202A}?"
-            text run at (7,0) width 29: "\x{202C}(^34"
-            text run at (36,0) width 10 RTL: "\x{5E9}"
-            text run at (46,0) width 6: "z"
-        LayoutBlockFlow {P} at (0,1568) size 769x20
-          LayoutText {#text} at (0,0) size 52x19
-            text run at (0,0) width 10 RTL: "\x{5E9}"
-            text run at (10,0) width 16: "34"
-            text run at (26,0) width 13 RTL: "\x{202C}(^"
-            text run at (39,0) width 7 RTL: "\x{202B}?"
-            text run at (46,0) width 6: "z"
-        LayoutBlockFlow {P} at (0,1604) size 769x20
+        LayoutBlockFlow {P} at (0,1572) size 769x30
+          LayoutText {#text} at (0,6) size 52x19
+            text run at (0,6) width 7: "\x{202A}?"
+            text run at (7,6) width 29: "\x{202C}(^34"
+            text run at (36,6) width 10 RTL: "\x{5E9}"
+            text run at (46,6) width 6: "z"
+        LayoutBlockFlow {P} at (0,1618) size 769x30
+          LayoutText {#text} at (0,6) size 52x19
+            text run at (0,6) width 10 RTL: "\x{5E9}"
+            text run at (10,6) width 16: "34"
+            text run at (26,6) width 13 RTL: "\x{202C}(^"
+            text run at (39,6) width 7 RTL: "\x{202B}?"
+            text run at (46,6) width 6: "z"
+        LayoutBlockFlow {P} at (0,1664) size 769x20
           LayoutText {#text} at (0,0) size 60x19
             text run at (0,0) width 28: "ab(^"
             text run at (28,0) width 10 RTL: "\x{5E9}"
             text run at (38,0) width 16: "\x{663}\x{664}"
             text run at (54,0) width 6: "z"
-        LayoutBlockFlow {P} at (0,1640) size 769x20
+        LayoutBlockFlow {P} at (0,1700) size 769x20
           LayoutText {#text} at (0,0) size 60x19
             text run at (0,0) width 10 RTL: "\x{5E9}"
             text run at (10,0) width 16: "\x{663}\x{664}"
             text run at (26,0) width 28 RTL: "\x{5D0}\x{5D1}(^"
             text run at (54,0) width 6: "z"
-        LayoutBlockFlow {P} at (0,1676) size 769x20
+        LayoutBlockFlow {P} at (0,1736) size 769x20
           LayoutText {#text} at (0,0) size 59x19
             text run at (0,0) width 10 RTL: "\x{5E9}"
             text run at (10,0) width 16: "\x{663}\x{664}"
             text run at (26,0) width 27 RTL: "\x{627}\x{628}(^"
             text run at (53,0) width 6: "z"
-        LayoutBlockFlow {P} at (0,1712) size 769x20
+        LayoutBlockFlow {P} at (0,1772) size 769x20
           LayoutText {#text} at (0,0) size 76x19
             text run at (0,0) width 44: "ab12(^"
             text run at (44,0) width 10 RTL: "\x{5E9}"
             text run at (54,0) width 16: "\x{663}\x{664}"
             text run at (70,0) width 6: "z"
-        LayoutBlockFlow {P} at (0,1748) size 769x20
+        LayoutBlockFlow {P} at (0,1808) size 769x20
           LayoutText {#text} at (0,0) size 76x19
             text run at (0,0) width 10 RTL: "\x{5E9}"
             text run at (10,0) width 16: "\x{663}\x{664}"
@@ -256,7 +256,7 @@
             text run at (39,0) width 16: "12"
             text run at (55,0) width 15 RTL: "\x{5D0}\x{5D1}"
             text run at (70,0) width 6: "z"
-        LayoutBlockFlow {P} at (0,1784) size 769x20
+        LayoutBlockFlow {P} at (0,1844) size 769x20
           LayoutText {#text} at (0,0) size 75x19
             text run at (0,0) width 10 RTL: "\x{5E9}"
             text run at (10,0) width 16: "\x{663}\x{664}"
@@ -264,7 +264,7 @@
             text run at (39,0) width 16: "12"
             text run at (55,0) width 14 RTL: "\x{627}\x{628}"
             text run at (69,0) width 6: "z"
-        LayoutBlockFlow {P} at (0,1820) size 769x20
+        LayoutBlockFlow {P} at (0,1880) size 769x20
           LayoutText {#text} at (0,0) size 76x19
             text run at (0,0) width 15: "ab"
             text run at (15,0) width 10 RTL: "\x{5E9}"
@@ -272,7 +272,7 @@
             text run at (41,0) width 13 RTL: "(^"
             text run at (54,0) width 16: "\x{661}\x{662}"
             text run at (70,0) width 6: "z"
-        LayoutBlockFlow {P} at (0,1856) size 769x20
+        LayoutBlockFlow {P} at (0,1916) size 769x20
           LayoutText {#text} at (0,0) size 76x19
             text run at (0,0) width 10 RTL: "\x{5E9}"
             text run at (10,0) width 16: "\x{663}\x{664}"
@@ -280,7 +280,7 @@
             text run at (39,0) width 16: "\x{661}\x{662}"
             text run at (55,0) width 15 RTL: "\x{5D0}\x{5D1}"
             text run at (70,0) width 6: "z"
-        LayoutBlockFlow {P} at (0,1892) size 769x20
+        LayoutBlockFlow {P} at (0,1952) size 769x20
           LayoutText {#text} at (0,0) size 75x19
             text run at (0,0) width 10 RTL: "\x{5E9}"
             text run at (10,0) width 16: "\x{663}\x{664}"
@@ -288,217 +288,217 @@
             text run at (39,0) width 16: "\x{661}\x{662}"
             text run at (55,0) width 14 RTL: "\x{627}\x{628}"
             text run at (69,0) width 6: "z"
-        LayoutBlockFlow {P} at (0,1928) size 769x30
+        LayoutBlockFlow {P} at (0,1988) size 769x30
           LayoutText {#text} at (0,6) size 52x19
             text run at (0,6) width 7: "\x{202A}?"
             text run at (7,6) width 13: "\x{202C}(^"
             text run at (20,6) width 10 RTL: "\x{5E9}"
             text run at (30,6) width 16: "\x{663}\x{664}"
             text run at (46,6) width 6: "z"
-        LayoutBlockFlow {P} at (0,1974) size 769x30
+        LayoutBlockFlow {P} at (0,2034) size 769x30
           LayoutText {#text} at (0,6) size 52x19
             text run at (0,6) width 10 RTL: "\x{5E9}"
             text run at (10,6) width 16: "\x{663}\x{664}"
             text run at (26,6) width 13 RTL: "\x{202C}(^"
             text run at (39,6) width 7 RTL: "\x{202B}?"
             text run at (46,6) width 6: "z"
-        LayoutBlockFlow {P} at (0,2020) size 769x20
-          LayoutText {#text} at (0,0) size 33x19
-            text run at (0,0) width 28: "ab(^"
-            text run at (28,0) width 5: "\x{202A}!"
-            text run at (33,0) width 0: "\x{202C}"
-        LayoutBlockFlow {P} at (0,2056) size 769x20
-          LayoutText {#text} at (0,0) size 33x19
-            text run at (0,0) width 15 RTL: "\x{5D0}\x{5D1}"
-            text run at (15,0) width 13: "(^"
-            text run at (28,0) width 5: "\x{202A}!"
-            text run at (33,0) width 0: "\x{202C}"
-        LayoutBlockFlow {P} at (0,2092) size 769x30
+        LayoutBlockFlow {P} at (0,2080) size 769x30
+          LayoutText {#text} at (0,6) size 33x19
+            text run at (0,6) width 28: "ab(^"
+            text run at (28,6) width 5: "\x{202A}!"
+            text run at (33,6) width 0: "\x{202C}"
+        LayoutBlockFlow {P} at (0,2126) size 769x30
+          LayoutText {#text} at (0,6) size 33x19
+            text run at (0,6) width 15 RTL: "\x{5D0}\x{5D1}"
+            text run at (15,6) width 13: "(^"
+            text run at (28,6) width 5: "\x{202A}!"
+            text run at (33,6) width 0: "\x{202C}"
+        LayoutBlockFlow {P} at (0,2172) size 769x30
           LayoutText {#text} at (0,6) size 32x19
             text run at (0,6) width 14 RTL: "\x{627}\x{628}"
             text run at (14,6) width 13: "(^"
             text run at (27,6) width 5: "\x{202A}!"
             text run at (32,6) width 0: "\x{202C}"
-        LayoutBlockFlow {P} at (0,2138) size 769x20
-          LayoutText {#text} at (0,0) size 49x19
-            text run at (0,0) width 44: "ab12(^"
-            text run at (44,0) width 5: "\x{202A}!"
-            text run at (49,0) width 0: "\x{202C}"
-        LayoutBlockFlow {P} at (0,2174) size 769x20
-          LayoutText {#text} at (0,0) size 49x19
-            text run at (0,0) width 16: "12"
-            text run at (16,0) width 15 RTL: "\x{5D0}\x{5D1}"
-            text run at (31,0) width 13: "(^"
-            text run at (44,0) width 5: "\x{202A}!"
-            text run at (49,0) width 0: "\x{202C}"
-        LayoutBlockFlow {P} at (0,2210) size 769x30
+        LayoutBlockFlow {P} at (0,2218) size 769x30
+          LayoutText {#text} at (0,6) size 49x19
+            text run at (0,6) width 44: "ab12(^"
+            text run at (44,6) width 5: "\x{202A}!"
+            text run at (49,6) width 0: "\x{202C}"
+        LayoutBlockFlow {P} at (0,2264) size 769x30
+          LayoutText {#text} at (0,6) size 49x19
+            text run at (0,6) width 16: "12"
+            text run at (16,6) width 15 RTL: "\x{5D0}\x{5D1}"
+            text run at (31,6) width 13: "(^"
+            text run at (44,6) width 5: "\x{202A}!"
+            text run at (49,6) width 0: "\x{202C}"
+        LayoutBlockFlow {P} at (0,2310) size 769x30
           LayoutText {#text} at (0,6) size 48x19
             text run at (0,6) width 16: "12"
             text run at (16,6) width 14 RTL: "\x{627}\x{628}"
             text run at (30,6) width 13: "(^"
             text run at (43,6) width 5: "\x{202A}!"
             text run at (48,6) width 0: "\x{202C}"
-        LayoutBlockFlow {P} at (0,2256) size 769x30
+        LayoutBlockFlow {P} at (0,2356) size 769x30
           LayoutText {#text} at (0,6) size 49x19
             text run at (0,6) width 15: "ab"
             text run at (15,6) width 16: "\x{661}\x{662}"
             text run at (31,6) width 13: "(^"
             text run at (44,6) width 5: "\x{202A}!"
             text run at (49,6) width 0: "\x{202C}"
-        LayoutBlockFlow {P} at (0,2302) size 769x30
+        LayoutBlockFlow {P} at (0,2402) size 769x30
           LayoutText {#text} at (0,6) size 49x19
             text run at (0,6) width 16: "\x{661}\x{662}"
             text run at (16,6) width 15 RTL: "\x{5D0}\x{5D1}"
             text run at (31,6) width 13: "(^"
             text run at (44,6) width 5: "\x{202A}!"
             text run at (49,6) width 0: "\x{202C}"
-        LayoutBlockFlow {P} at (0,2348) size 769x30
+        LayoutBlockFlow {P} at (0,2448) size 769x30
           LayoutText {#text} at (0,6) size 48x19
             text run at (0,6) width 16: "\x{661}\x{662}"
             text run at (16,6) width 14 RTL: "\x{627}\x{628}"
             text run at (30,6) width 13: "(^"
             text run at (43,6) width 5: "\x{202A}!"
             text run at (48,6) width 0: "\x{202C}"
-        LayoutBlockFlow {P} at (0,2394) size 769x20
-          LayoutText {#text} at (0,0) size 25x19
-            text run at (0,0) width 7: "\x{202A}?"
-            text run at (7,0) width 13: "\x{202C}(^"
-            text run at (20,0) width 5: "\x{202A}!"
-            text run at (25,0) width 0: "\x{202C}"
-        LayoutBlockFlow {P} at (0,2430) size 769x20
-          LayoutText {#text} at (0,0) size 25x19
-            text run at (0,0) width 7 RTL: "\x{202B}?"
-            text run at (7,0) width 13: "\x{202C}(^"
-            text run at (20,0) width 5: "\x{202A}!"
-            text run at (25,0) width 0: "\x{202C}"
-        LayoutBlockFlow {P} at (0,2466) size 769x20
-          LayoutText {#text} at (0,0) size 33x19
-            text run at (0,0) width 28: "ab(^"
-            text run at (28,0) width 5 RTL: "\x{202B}!"
-            text run at (33,0) width 0: "\x{202C}"
-        LayoutBlockFlow {P} at (0,2502) size 769x20
-          LayoutText {#text} at (0,0) size 33x19
-            text run at (0,0) width 5 RTL: "\x{202B}!"
-            text run at (5,0) width 28 RTL: "\x{5D0}\x{5D1}(^"
-            text run at (33,0) width 0: "\x{202C}"
-        LayoutBlockFlow {P} at (0,2538) size 769x30
+        LayoutBlockFlow {P} at (0,2494) size 769x30
+          LayoutText {#text} at (0,6) size 25x19
+            text run at (0,6) width 7: "\x{202A}?"
+            text run at (7,6) width 13: "\x{202C}(^"
+            text run at (20,6) width 5: "\x{202A}!"
+            text run at (25,6) width 0: "\x{202C}"
+        LayoutBlockFlow {P} at (0,2540) size 769x30
+          LayoutText {#text} at (0,6) size 25x19
+            text run at (0,6) width 7 RTL: "\x{202B}?"
+            text run at (7,6) width 13: "\x{202C}(^"
+            text run at (20,6) width 5: "\x{202A}!"
+            text run at (25,6) width 0: "\x{202C}"
+        LayoutBlockFlow {P} at (0,2586) size 769x30
+          LayoutText {#text} at (0,6) size 33x19
+            text run at (0,6) width 28: "ab(^"
+            text run at (28,6) width 5 RTL: "\x{202B}!"
+            text run at (33,6) width 0: "\x{202C}"
+        LayoutBlockFlow {P} at (0,2632) size 769x30
+          LayoutText {#text} at (0,6) size 33x19
+            text run at (0,6) width 5 RTL: "\x{202B}!"
+            text run at (5,6) width 28 RTL: "\x{5D0}\x{5D1}(^"
+            text run at (33,6) width 0: "\x{202C}"
+        LayoutBlockFlow {P} at (0,2678) size 769x30
           LayoutText {#text} at (0,6) size 32x19
             text run at (0,6) width 5 RTL: "\x{202B}!"
             text run at (5,6) width 27 RTL: "\x{627}\x{628}(^"
             text run at (32,6) width 0: "\x{202C}"
-        LayoutBlockFlow {P} at (0,2584) size 769x20
-          LayoutText {#text} at (0,0) size 49x19
-            text run at (0,0) width 44: "ab12(^"
-            text run at (44,0) width 5 RTL: "\x{202B}!"
-            text run at (49,0) width 0: "\x{202C}"
-        LayoutBlockFlow {P} at (0,2620) size 769x20
-          LayoutText {#text} at (0,0) size 49x19
-            text run at (0,0) width 5 RTL: "\x{202B}!"
-            text run at (5,0) width 13 RTL: "(^"
-            text run at (18,0) width 16: "12"
-            text run at (34,0) width 15 RTL: "\x{5D0}\x{5D1}"
-            text run at (49,0) width 0: "\x{202C}"
-        LayoutBlockFlow {P} at (0,2656) size 769x30
+        LayoutBlockFlow {P} at (0,2724) size 769x30
+          LayoutText {#text} at (0,6) size 49x19
+            text run at (0,6) width 44: "ab12(^"
+            text run at (44,6) width 5 RTL: "\x{202B}!"
+            text run at (49,6) width 0: "\x{202C}"
+        LayoutBlockFlow {P} at (0,2770) size 769x30
+          LayoutText {#text} at (0,6) size 49x19
+            text run at (0,6) width 5 RTL: "\x{202B}!"
+            text run at (5,6) width 13 RTL: "(^"
+            text run at (18,6) width 16: "12"
+            text run at (34,6) width 15 RTL: "\x{5D0}\x{5D1}"
+            text run at (49,6) width 0: "\x{202C}"
+        LayoutBlockFlow {P} at (0,2816) size 769x30
           LayoutText {#text} at (0,6) size 48x19
             text run at (0,6) width 5 RTL: "\x{202B}!"
             text run at (5,6) width 13 RTL: "(^"
             text run at (18,6) width 16: "12"
             text run at (34,6) width 14 RTL: "\x{627}\x{628}"
             text run at (48,6) width 0: "\x{202C}"
-        LayoutBlockFlow {P} at (0,2702) size 769x30
+        LayoutBlockFlow {P} at (0,2862) size 769x30
           LayoutText {#text} at (0,6) size 49x19
             text run at (0,6) width 15: "ab"
             text run at (15,6) width 5 RTL: "\x{202B}!"
             text run at (20,6) width 13 RTL: "(^"
             text run at (33,6) width 16: "\x{661}\x{662}"
             text run at (49,6) width 0: "\x{202C}"
-        LayoutBlockFlow {P} at (0,2748) size 769x30
+        LayoutBlockFlow {P} at (0,2908) size 769x30
           LayoutText {#text} at (0,6) size 49x19
             text run at (0,6) width 5 RTL: "\x{202B}!"
             text run at (5,6) width 13 RTL: "(^"
             text run at (18,6) width 16: "\x{661}\x{662}"
             text run at (34,6) width 15 RTL: "\x{5D0}\x{5D1}"
             text run at (49,6) width 0: "\x{202C}"
-        LayoutBlockFlow {P} at (0,2794) size 769x30
+        LayoutBlockFlow {P} at (0,2954) size 769x30
           LayoutText {#text} at (0,6) size 48x19
             text run at (0,6) width 5 RTL: "\x{202B}!"
             text run at (5,6) width 13 RTL: "(^"
             text run at (18,6) width 16: "\x{661}\x{662}"
             text run at (34,6) width 14 RTL: "\x{627}\x{628}"
             text run at (48,6) width 0: "\x{202C}"
-        LayoutBlockFlow {P} at (0,2840) size 769x20
-          LayoutText {#text} at (0,0) size 25x19
-            text run at (0,0) width 7: "\x{202A}?"
-            text run at (7,0) width 13: "\x{202C}(^"
-            text run at (20,0) width 5 RTL: "\x{202B}!"
-            text run at (25,0) width 0: "\x{202C}"
-        LayoutBlockFlow {P} at (0,2876) size 769x20
-          LayoutText {#text} at (0,0) size 25x19
-            text run at (0,0) width 5 RTL: "\x{202B}!"
-            text run at (5,0) width 13 RTL: "\x{202C}(^"
-            text run at (18,0) width 7 RTL: "\x{202B}?"
-            text run at (25,0) width 0: "\x{202C}"
-        LayoutBlockFlow {P} at (0,2912) size 769x20
-          LayoutText {#text} at (0,0) size 28x19
-            text run at (0,0) width 28: "\x{202A}ab(^"
-            text run at (28,0) width 0: "\x{202C}"
-        LayoutBlockFlow {P} at (0,2948) size 769x20
-          LayoutText {#text} at (0,0) size 28x19
-            text run at (0,0) width 15 RTL: "\x{202A}\x{5D0}\x{5D1}"
-            text run at (15,0) width 13: "(^"
-            text run at (28,0) width 0: "\x{202C}"
-        LayoutBlockFlow {P} at (0,2984) size 769x30
+        LayoutBlockFlow {P} at (0,3000) size 769x30
+          LayoutText {#text} at (0,6) size 25x19
+            text run at (0,6) width 7: "\x{202A}?"
+            text run at (7,6) width 13: "\x{202C}(^"
+            text run at (20,6) width 5 RTL: "\x{202B}!"
+            text run at (25,6) width 0: "\x{202C}"
+        LayoutBlockFlow {P} at (0,3046) size 769x30
+          LayoutText {#text} at (0,6) size 25x19
+            text run at (0,6) width 5 RTL: "\x{202B}!"
+            text run at (5,6) width 13 RTL: "\x{202C}(^"
+            text run at (18,6) width 7 RTL: "\x{202B}?"
+            text run at (25,6) width 0: "\x{202C}"
+        LayoutBlockFlow {P} at (0,3092) size 769x30
+          LayoutText {#text} at (0,6) size 28x19
+            text run at (0,6) width 28: "\x{202A}ab(^"
+            text run at (28,6) width 0: "\x{202C}"
+        LayoutBlockFlow {P} at (0,3138) size 769x30
+          LayoutText {#text} at (0,6) size 28x19
+            text run at (0,6) width 15 RTL: "\x{202A}\x{5D0}\x{5D1}"
+            text run at (15,6) width 13: "(^"
+            text run at (28,6) width 0: "\x{202C}"
+        LayoutBlockFlow {P} at (0,3184) size 769x30
           LayoutText {#text} at (0,6) size 27x19
             text run at (0,6) width 14 RTL: "\x{202A}\x{627}\x{628}"
             text run at (14,6) width 13: "(^"
             text run at (27,6) width 0: "\x{202C}"
-        LayoutBlockFlow {P} at (0,3030) size 769x20
-          LayoutText {#text} at (0,0) size 44x19
-            text run at (0,0) width 44: "\x{202A}ab12(^"
-            text run at (44,0) width 0: "\x{202C}"
-        LayoutBlockFlow {P} at (0,3066) size 769x20
-          LayoutText {#text} at (0,0) size 44x19
-            text run at (0,0) width 16: "12"
-            text run at (16,0) width 15 RTL: "\x{202A}\x{5D0}\x{5D1}"
-            text run at (31,0) width 13: "(^"
-            text run at (44,0) width 0: "\x{202C}"
-        LayoutBlockFlow {P} at (0,3102) size 769x30
+        LayoutBlockFlow {P} at (0,3230) size 769x30
+          LayoutText {#text} at (0,6) size 44x19
+            text run at (0,6) width 44: "\x{202A}ab12(^"
+            text run at (44,6) width 0: "\x{202C}"
+        LayoutBlockFlow {P} at (0,3276) size 769x30
+          LayoutText {#text} at (0,6) size 44x19
+            text run at (0,6) width 16: "12"
+            text run at (16,6) width 15 RTL: "\x{202A}\x{5D0}\x{5D1}"
+            text run at (31,6) width 13: "(^"
+            text run at (44,6) width 0: "\x{202C}"
+        LayoutBlockFlow {P} at (0,3322) size 769x30
           LayoutText {#text} at (0,6) size 43x19
             text run at (0,6) width 16: "12"
             text run at (16,6) width 14 RTL: "\x{202A}\x{627}\x{628}"
             text run at (30,6) width 13: "(^"
             text run at (43,6) width 0: "\x{202C}"
-        LayoutBlockFlow {P} at (0,3148) size 769x30
+        LayoutBlockFlow {P} at (0,3368) size 769x30
           LayoutText {#text} at (0,6) size 44x19
             text run at (0,6) width 15: "\x{202A}ab"
             text run at (15,6) width 16: "\x{661}\x{662}"
             text run at (31,6) width 13: "(^"
             text run at (44,6) width 0: "\x{202C}"
-        LayoutBlockFlow {P} at (0,3194) size 769x30
+        LayoutBlockFlow {P} at (0,3414) size 769x30
           LayoutText {#text} at (0,6) size 44x19
             text run at (0,6) width 16: "\x{661}\x{662}"
             text run at (16,6) width 15 RTL: "\x{202A}\x{5D0}\x{5D1}"
             text run at (31,6) width 13: "(^"
             text run at (44,6) width 0: "\x{202C}"
-        LayoutBlockFlow {P} at (0,3240) size 769x30
+        LayoutBlockFlow {P} at (0,3460) size 769x30
           LayoutText {#text} at (0,6) size 43x19
             text run at (0,6) width 16: "\x{661}\x{662}"
             text run at (16,6) width 14 RTL: "\x{202A}\x{627}\x{628}"
             text run at (30,6) width 13: "(^"
             text run at (43,6) width 0: "\x{202C}"
-        LayoutBlockFlow {P} at (0,3286) size 769x20
-          LayoutText {#text} at (0,0) size 20x19
-            text run at (0,0) width 0: "\x{202A}"
-            text run at (0,0) width 7: "\x{202A}?"
-            text run at (7,0) width 13: "\x{202C}(^"
-            text run at (20,0) width 0: "\x{202C}"
-        LayoutBlockFlow {P} at (0,3322) size 769x20
-          LayoutText {#text} at (0,0) size 20x19
-            text run at (0,0) width 0: "\x{202A}"
-            text run at (0,0) width 7 RTL: "\x{202B}?"
-            text run at (7,0) width 13: "\x{202C}(^"
-            text run at (20,0) width 0: "\x{202C}"
-      LayoutBlockFlow {DIV} at (0,3394) size 769x3342
+        LayoutBlockFlow {P} at (0,3506) size 769x30
+          LayoutText {#text} at (0,6) size 20x19
+            text run at (0,6) width 0: "\x{202A}"
+            text run at (0,6) width 7: "\x{202A}?"
+            text run at (7,6) width 13: "\x{202C}(^"
+            text run at (20,6) width 0: "\x{202C}"
+        LayoutBlockFlow {P} at (0,3552) size 769x30
+          LayoutText {#text} at (0,6) size 20x19
+            text run at (0,6) width 0: "\x{202A}"
+            text run at (0,6) width 7 RTL: "\x{202B}?"
+            text run at (7,6) width 13: "\x{202C}(^"
+            text run at (20,6) width 0: "\x{202C}"
+      LayoutBlockFlow {DIV} at (0,3634) size 769x3582
         LayoutBlockFlow {P} at (0,0) size 769x20
           LayoutText {#text} at (0,0) size 43x19
             text run at (0,0) width 43: "ab(^cd"
@@ -542,130 +542,130 @@
             text run at (15,0) width 13 RTL: "(^"
             text run at (28,0) width 16: "\x{661}\x{662}"
             text run at (44,0) width 14 RTL: "\x{627}\x{628}"
-        LayoutBlockFlow {P} at (0,324) size 769x20
-          LayoutText {#text} at (0,0) size 35x19
-            text run at (0,0) width 7: "\x{202A}?"
-            text run at (7,0) width 28: "\x{202C}(^cd"
-        LayoutBlockFlow {P} at (0,360) size 769x20
-          LayoutText {#text} at (0,0) size 35x19
-            text run at (0,0) width 15: "cd"
-            text run at (15,0) width 13 RTL: "\x{202C}(^"
-            text run at (28,0) width 7 RTL: "\x{202B}?"
-        LayoutBlockFlow {P} at (0,396) size 769x20
+        LayoutBlockFlow {P} at (0,324) size 769x30
+          LayoutText {#text} at (0,6) size 35x19
+            text run at (0,6) width 7: "\x{202A}?"
+            text run at (7,6) width 28: "\x{202C}(^cd"
+        LayoutBlockFlow {P} at (0,370) size 769x30
+          LayoutText {#text} at (0,6) size 35x19
+            text run at (0,6) width 15: "cd"
+            text run at (15,6) width 13 RTL: "\x{202C}(^"
+            text run at (28,6) width 7 RTL: "\x{202B}?"
+        LayoutBlockFlow {P} at (0,416) size 769x20
           LayoutText {#text} at (0,0) size 40x19
             text run at (0,0) width 25 RTL: "(^\x{5D2}\x{5D3}"
             text run at (25,0) width 15: "ab"
-        LayoutBlockFlow {P} at (0,432) size 769x20
+        LayoutBlockFlow {P} at (0,452) size 769x20
           LayoutText {#text} at (0,0) size 40x19
             text run at (0,0) width 40 RTL: "\x{5D0}\x{5D1}(^\x{5D2}\x{5D3}"
-        LayoutBlockFlow {P} at (0,468) size 769x20
+        LayoutBlockFlow {P} at (0,488) size 769x20
           LayoutText {#text} at (0,0) size 39x19
             text run at (0,0) width 39 RTL: "\x{627}\x{628}(^\x{5D2}\x{5D3}"
-        LayoutBlockFlow {P} at (0,504) size 769x20
+        LayoutBlockFlow {P} at (0,524) size 769x20
           LayoutText {#text} at (0,0) size 56x19
             text run at (0,0) width 25 RTL: "(^\x{5D2}\x{5D3}"
             text run at (25,0) width 31: "ab12"
-        LayoutBlockFlow {P} at (0,540) size 769x20
+        LayoutBlockFlow {P} at (0,560) size 769x20
           LayoutText {#text} at (0,0) size 56x19
             text run at (0,0) width 25 RTL: "(^\x{5D2}\x{5D3}"
             text run at (25,0) width 16: "12"
             text run at (41,0) width 15 RTL: "\x{5D0}\x{5D1}"
-        LayoutBlockFlow {P} at (0,576) size 769x20
+        LayoutBlockFlow {P} at (0,596) size 769x20
           LayoutText {#text} at (0,0) size 55x19
             text run at (0,0) width 25 RTL: "(^\x{5D2}\x{5D3}"
             text run at (25,0) width 16: "12"
             text run at (41,0) width 14 RTL: "\x{627}\x{628}"
-        LayoutBlockFlow {P} at (0,612) size 769x20
+        LayoutBlockFlow {P} at (0,632) size 769x20
           LayoutText {#text} at (0,0) size 56x19
             text run at (0,0) width 25 RTL: "(^\x{5D2}\x{5D3}"
             text run at (25,0) width 31: "ab\x{661}\x{662}"
-        LayoutBlockFlow {P} at (0,648) size 769x20
+        LayoutBlockFlow {P} at (0,668) size 769x20
           LayoutText {#text} at (0,0) size 56x19
             text run at (0,0) width 25 RTL: "(^\x{5D2}\x{5D3}"
             text run at (25,0) width 16: "\x{661}\x{662}"
             text run at (41,0) width 15 RTL: "\x{5D0}\x{5D1}"
-        LayoutBlockFlow {P} at (0,684) size 769x20
+        LayoutBlockFlow {P} at (0,704) size 769x20
           LayoutText {#text} at (0,0) size 55x19
             text run at (0,0) width 25 RTL: "(^\x{5D2}\x{5D3}"
             text run at (25,0) width 16: "\x{661}\x{662}"
             text run at (41,0) width 14 RTL: "\x{627}\x{628}"
-        LayoutBlockFlow {P} at (0,720) size 769x20
-          LayoutText {#text} at (0,0) size 32x19
-            text run at (0,0) width 25 RTL: "\x{202C}(^\x{5D2}\x{5D3}"
-            text run at (25,0) width 7: "\x{202A}?"
-        LayoutBlockFlow {P} at (0,756) size 769x20
-          LayoutText {#text} at (0,0) size 32x19
-            text run at (0,0) width 25 RTL: "\x{202C}(^\x{5D2}\x{5D3}"
-            text run at (25,0) width 7 RTL: "\x{202B}?"
-        LayoutBlockFlow {P} at (0,792) size 769x20
+        LayoutBlockFlow {P} at (0,740) size 769x30
+          LayoutText {#text} at (0,6) size 32x19
+            text run at (0,6) width 25 RTL: "\x{202C}(^\x{5D2}\x{5D3}"
+            text run at (25,6) width 7: "\x{202A}?"
+        LayoutBlockFlow {P} at (0,786) size 769x30
+          LayoutText {#text} at (0,6) size 32x19
+            text run at (0,6) width 25 RTL: "\x{202C}(^\x{5D2}\x{5D3}"
+            text run at (25,6) width 7 RTL: "\x{202B}?"
+        LayoutBlockFlow {P} at (0,832) size 769x20
           LayoutText {#text} at (0,0) size 41x19
             text run at (0,0) width 26 RTL: "(^\x{62C}\x{62F}"
             text run at (26,0) width 15: "ab"
-        LayoutBlockFlow {P} at (0,828) size 769x20
+        LayoutBlockFlow {P} at (0,868) size 769x20
           LayoutText {#text} at (0,0) size 41x19
             text run at (0,0) width 41 RTL: "\x{5D0}\x{5D1}(^\x{62C}\x{62F}"
-        LayoutBlockFlow {P} at (0,864) size 769x20
+        LayoutBlockFlow {P} at (0,904) size 769x20
           LayoutText {#text} at (0,0) size 40x19
             text run at (0,0) width 40 RTL: "\x{627}\x{628}(^\x{62C}\x{62F}"
-        LayoutBlockFlow {P} at (0,900) size 769x20
+        LayoutBlockFlow {P} at (0,940) size 769x20
           LayoutText {#text} at (0,0) size 57x19
             text run at (0,0) width 26 RTL: "(^\x{62C}\x{62F}"
             text run at (26,0) width 31: "ab12"
-        LayoutBlockFlow {P} at (0,936) size 769x20
+        LayoutBlockFlow {P} at (0,976) size 769x20
           LayoutText {#text} at (0,0) size 57x19
             text run at (0,0) width 26 RTL: "(^\x{62C}\x{62F}"
             text run at (26,0) width 16: "12"
             text run at (42,0) width 15 RTL: "\x{5D0}\x{5D1}"
-        LayoutBlockFlow {P} at (0,972) size 769x20
+        LayoutBlockFlow {P} at (0,1012) size 769x20
           LayoutText {#text} at (0,0) size 56x19
             text run at (0,0) width 26 RTL: "(^\x{62C}\x{62F}"
             text run at (26,0) width 16: "12"
             text run at (42,0) width 14 RTL: "\x{627}\x{628}"
-        LayoutBlockFlow {P} at (0,1008) size 769x20
+        LayoutBlockFlow {P} at (0,1048) size 769x20
           LayoutText {#text} at (0,0) size 57x19
             text run at (0,0) width 26 RTL: "(^\x{62C}\x{62F}"
             text run at (26,0) width 31: "ab\x{661}\x{662}"
-        LayoutBlockFlow {P} at (0,1044) size 769x20
+        LayoutBlockFlow {P} at (0,1084) size 769x20
           LayoutText {#text} at (0,0) size 57x19
             text run at (0,0) width 26 RTL: "(^\x{62C}\x{62F}"
             text run at (26,0) width 16: "\x{661}\x{662}"
             text run at (42,0) width 15 RTL: "\x{5D0}\x{5D1}"
-        LayoutBlockFlow {P} at (0,1080) size 769x20
+        LayoutBlockFlow {P} at (0,1120) size 769x20
           LayoutText {#text} at (0,0) size 56x19
             text run at (0,0) width 26 RTL: "(^\x{62C}\x{62F}"
             text run at (26,0) width 16: "\x{661}\x{662}"
             text run at (42,0) width 14 RTL: "\x{627}\x{628}"
-        LayoutBlockFlow {P} at (0,1116) size 769x30
+        LayoutBlockFlow {P} at (0,1156) size 769x30
           LayoutText {#text} at (0,6) size 33x19
             text run at (0,6) width 26 RTL: "\x{202C}(^\x{62C}\x{62F}"
             text run at (26,6) width 7: "\x{202A}?"
-        LayoutBlockFlow {P} at (0,1162) size 769x30
+        LayoutBlockFlow {P} at (0,1202) size 769x30
           LayoutText {#text} at (0,6) size 33x19
             text run at (0,6) width 26 RTL: "\x{202C}(^\x{62C}\x{62F}"
             text run at (26,6) width 7 RTL: "\x{202B}?"
-        LayoutBlockFlow {P} at (0,1208) size 769x20
+        LayoutBlockFlow {P} at (0,1248) size 769x20
           LayoutText {#text} at (0,0) size 60x19
             text run at (0,0) width 6: "z"
             text run at (6,0) width 10 RTL: "\x{5E9}"
             text run at (16,0) width 44: "ab(^34"
-        LayoutBlockFlow {P} at (0,1244) size 769x20
+        LayoutBlockFlow {P} at (0,1284) size 769x20
           LayoutText {#text} at (0,0) size 60x19
             text run at (0,0) width 6: "z"
             text run at (6,0) width 10 RTL: "\x{5E9}"
             text run at (16,0) width 16: "34"
             text run at (32,0) width 28 RTL: "\x{5D0}\x{5D1}(^"
-        LayoutBlockFlow {P} at (0,1280) size 769x20
+        LayoutBlockFlow {P} at (0,1320) size 769x20
           LayoutText {#text} at (0,0) size 59x19
             text run at (0,0) width 6: "z"
             text run at (6,0) width 10 RTL: "\x{5E9}"
             text run at (16,0) width 16: "34"
             text run at (32,0) width 27 RTL: "\x{627}\x{628}(^"
-        LayoutBlockFlow {P} at (0,1316) size 769x20
+        LayoutBlockFlow {P} at (0,1356) size 769x20
           LayoutText {#text} at (0,0) size 76x19
             text run at (0,0) width 6: "z"
             text run at (6,0) width 10 RTL: "\x{5E9}"
             text run at (16,0) width 60: "ab12(^34"
-        LayoutBlockFlow {P} at (0,1352) size 769x20
+        LayoutBlockFlow {P} at (0,1392) size 769x20
           LayoutText {#text} at (0,0) size 76x19
             text run at (0,0) width 6: "z"
             text run at (6,0) width 10 RTL: "\x{5E9}"
@@ -673,7 +673,7 @@
             text run at (32,0) width 13 RTL: "(^"
             text run at (45,0) width 16: "12"
             text run at (61,0) width 15 RTL: "\x{5D0}\x{5D1}"
-        LayoutBlockFlow {P} at (0,1388) size 769x20
+        LayoutBlockFlow {P} at (0,1428) size 769x20
           LayoutText {#text} at (0,0) size 75x19
             text run at (0,0) width 6: "z"
             text run at (6,0) width 10 RTL: "\x{5E9}"
@@ -681,14 +681,14 @@
             text run at (32,0) width 13 RTL: "(^"
             text run at (45,0) width 16: "12"
             text run at (61,0) width 14 RTL: "\x{627}\x{628}"
-        LayoutBlockFlow {P} at (0,1424) size 769x20
+        LayoutBlockFlow {P} at (0,1464) size 769x20
           LayoutText {#text} at (0,0) size 76x19
             text run at (0,0) width 6: "z"
             text run at (6,0) width 10 RTL: "\x{5E9}"
             text run at (16,0) width 16: "34"
             text run at (32,0) width 13 RTL: "(^"
             text run at (45,0) width 31: "ab\x{661}\x{662}"
-        LayoutBlockFlow {P} at (0,1460) size 769x20
+        LayoutBlockFlow {P} at (0,1500) size 769x20
           LayoutText {#text} at (0,0) size 76x19
             text run at (0,0) width 6: "z"
             text run at (6,0) width 10 RTL: "\x{5E9}"
@@ -696,7 +696,7 @@
             text run at (32,0) width 13 RTL: "(^"
             text run at (45,0) width 16: "\x{661}\x{662}"
             text run at (61,0) width 15 RTL: "\x{5D0}\x{5D1}"
-        LayoutBlockFlow {P} at (0,1496) size 769x20
+        LayoutBlockFlow {P} at (0,1536) size 769x20
           LayoutText {#text} at (0,0) size 75x19
             text run at (0,0) width 6: "z"
             text run at (6,0) width 10 RTL: "\x{5E9}"
@@ -704,46 +704,46 @@
             text run at (32,0) width 13 RTL: "(^"
             text run at (45,0) width 16: "\x{661}\x{662}"
             text run at (61,0) width 14 RTL: "\x{627}\x{628}"
-        LayoutBlockFlow {P} at (0,1532) size 769x20
-          LayoutText {#text} at (0,0) size 52x19
-            text run at (0,0) width 6: "z"
-            text run at (6,0) width 10 RTL: "\x{5E9}"
-            text run at (16,0) width 7: "\x{202A}?"
-            text run at (23,0) width 29: "\x{202C}(^34"
-        LayoutBlockFlow {P} at (0,1568) size 769x20
-          LayoutText {#text} at (0,0) size 52x19
-            text run at (0,0) width 6: "z"
-            text run at (6,0) width 10 RTL: "\x{5E9}"
-            text run at (16,0) width 16: "34"
-            text run at (32,0) width 13 RTL: "\x{202C}(^"
-            text run at (45,0) width 7 RTL: "\x{202B}?"
-        LayoutBlockFlow {P} at (0,1604) size 769x20
+        LayoutBlockFlow {P} at (0,1572) size 769x30
+          LayoutText {#text} at (0,6) size 52x19
+            text run at (0,6) width 6: "z"
+            text run at (6,6) width 10 RTL: "\x{5E9}"
+            text run at (16,6) width 7: "\x{202A}?"
+            text run at (23,6) width 29: "\x{202C}(^34"
+        LayoutBlockFlow {P} at (0,1618) size 769x30
+          LayoutText {#text} at (0,6) size 52x19
+            text run at (0,6) width 6: "z"
+            text run at (6,6) width 10 RTL: "\x{5E9}"
+            text run at (16,6) width 16: "34"
+            text run at (32,6) width 13 RTL: "\x{202C}(^"
+            text run at (45,6) width 7 RTL: "\x{202B}?"
+        LayoutBlockFlow {P} at (0,1664) size 769x20
           LayoutText {#text} at (0,0) size 60x19
             text run at (0,0) width 6: "z"
             text run at (6,0) width 10 RTL: "\x{5E9}"
             text run at (16,0) width 16: "\x{663}\x{664}"
             text run at (32,0) width 13 RTL: "(^"
             text run at (45,0) width 15: "ab"
-        LayoutBlockFlow {P} at (0,1640) size 769x20
+        LayoutBlockFlow {P} at (0,1700) size 769x20
           LayoutText {#text} at (0,0) size 60x19
             text run at (0,0) width 6: "z"
             text run at (6,0) width 10 RTL: "\x{5E9}"
             text run at (16,0) width 16: "\x{663}\x{664}"
             text run at (32,0) width 28 RTL: "\x{5D0}\x{5D1}(^"
-        LayoutBlockFlow {P} at (0,1676) size 769x20
+        LayoutBlockFlow {P} at (0,1736) size 769x20
           LayoutText {#text} at (0,0) size 59x19
             text run at (0,0) width 6: "z"
             text run at (6,0) width 10 RTL: "\x{5E9}"
             text run at (16,0) width 16: "\x{663}\x{664}"
             text run at (32,0) width 27 RTL: "\x{627}\x{628}(^"
-        LayoutBlockFlow {P} at (0,1712) size 769x20
+        LayoutBlockFlow {P} at (0,1772) size 769x20
           LayoutText {#text} at (0,0) size 76x19
             text run at (0,0) width 6: "z"
             text run at (6,0) width 10 RTL: "\x{5E9}"
             text run at (16,0) width 16: "\x{663}\x{664}"
             text run at (32,0) width 13 RTL: "(^"
             text run at (45,0) width 31: "ab12"
-        LayoutBlockFlow {P} at (0,1748) size 769x20
+        LayoutBlockFlow {P} at (0,1808) size 769x20
           LayoutText {#text} at (0,0) size 76x19
             text run at (0,0) width 6: "z"
             text run at (6,0) width 10 RTL: "\x{5E9}"
@@ -751,7 +751,7 @@
             text run at (32,0) width 13 RTL: "(^"
             text run at (45,0) width 16: "12"
             text run at (61,0) width 15 RTL: "\x{5D0}\x{5D1}"
-        LayoutBlockFlow {P} at (0,1784) size 769x20
+        LayoutBlockFlow {P} at (0,1844) size 769x20
           LayoutText {#text} at (0,0) size 75x19
             text run at (0,0) width 6: "z"
             text run at (6,0) width 10 RTL: "\x{5E9}"
@@ -759,14 +759,14 @@
             text run at (32,0) width 13 RTL: "(^"
             text run at (45,0) width 16: "12"
             text run at (61,0) width 14 RTL: "\x{627}\x{628}"
-        LayoutBlockFlow {P} at (0,1820) size 769x20
+        LayoutBlockFlow {P} at (0,1880) size 769x20
           LayoutText {#text} at (0,0) size 76x19
             text run at (0,0) width 6: "z"
             text run at (6,0) width 10 RTL: "\x{5E9}"
             text run at (16,0) width 16: "\x{663}\x{664}"
             text run at (32,0) width 13 RTL: "(^"
             text run at (45,0) width 31: "ab\x{661}\x{662}"
-        LayoutBlockFlow {P} at (0,1856) size 769x20
+        LayoutBlockFlow {P} at (0,1916) size 769x20
           LayoutText {#text} at (0,0) size 76x19
             text run at (0,0) width 6: "z"
             text run at (6,0) width 10 RTL: "\x{5E9}"
@@ -774,7 +774,7 @@
             text run at (32,0) width 13 RTL: "(^"
             text run at (45,0) width 16: "\x{661}\x{662}"
             text run at (61,0) width 15 RTL: "\x{5D0}\x{5D1}"
-        LayoutBlockFlow {P} at (0,1892) size 769x20
+        LayoutBlockFlow {P} at (0,1952) size 769x20
           LayoutText {#text} at (0,0) size 75x19
             text run at (0,0) width 6: "z"
             text run at (6,0) width 10 RTL: "\x{5E9}"
@@ -782,211 +782,211 @@
             text run at (32,0) width 13 RTL: "(^"
             text run at (45,0) width 16: "\x{661}\x{662}"
             text run at (61,0) width 14 RTL: "\x{627}\x{628}"
-        LayoutBlockFlow {P} at (0,1928) size 769x30
+        LayoutBlockFlow {P} at (0,1988) size 769x30
           LayoutText {#text} at (0,6) size 52x19
             text run at (0,6) width 6: "z"
             text run at (6,6) width 10 RTL: "\x{5E9}"
             text run at (16,6) width 16: "\x{663}\x{664}"
             text run at (32,6) width 13 RTL: "\x{202C}(^"
             text run at (45,6) width 7: "\x{202A}?"
-        LayoutBlockFlow {P} at (0,1974) size 769x30
+        LayoutBlockFlow {P} at (0,2034) size 769x30
           LayoutText {#text} at (0,6) size 52x19
             text run at (0,6) width 6: "z"
             text run at (6,6) width 10 RTL: "\x{5E9}"
             text run at (16,6) width 16: "\x{663}\x{664}"
             text run at (32,6) width 13 RTL: "\x{202C}(^"
             text run at (45,6) width 7 RTL: "\x{202B}?"
-        LayoutBlockFlow {P} at (0,2020) size 769x20
-          LayoutText {#text} at (0,0) size 33x19
-            text run at (0,0) width 0 RTL: "\x{202C}"
-            text run at (0,0) width 28: "ab(^"
-            text run at (28,0) width 5: "\x{202A}!"
-        LayoutBlockFlow {P} at (0,2056) size 769x20
-          LayoutText {#text} at (0,0) size 33x19
-            text run at (0,0) width 0 RTL: "\x{202C}"
-            text run at (0,0) width 5: "\x{202A}!"
-            text run at (5,0) width 28 RTL: "\x{5D0}\x{5D1}(^"
-        LayoutBlockFlow {P} at (0,2092) size 769x30
+        LayoutBlockFlow {P} at (0,2080) size 769x30
+          LayoutText {#text} at (0,6) size 33x19
+            text run at (0,6) width 0 RTL: "\x{202C}"
+            text run at (0,6) width 28: "ab(^"
+            text run at (28,6) width 5: "\x{202A}!"
+        LayoutBlockFlow {P} at (0,2126) size 769x30
+          LayoutText {#text} at (0,6) size 33x19
+            text run at (0,6) width 0 RTL: "\x{202C}"
+            text run at (0,6) width 5: "\x{202A}!"
+            text run at (5,6) width 28 RTL: "\x{5D0}\x{5D1}(^"
+        LayoutBlockFlow {P} at (0,2172) size 769x30
           LayoutText {#text} at (0,6) size 32x19
             text run at (0,6) width 0 RTL: "\x{202C}"
             text run at (0,6) width 5: "\x{202A}!"
             text run at (5,6) width 27 RTL: "\x{627}\x{628}(^"
-        LayoutBlockFlow {P} at (0,2138) size 769x20
-          LayoutText {#text} at (0,0) size 49x19
-            text run at (0,0) width 0 RTL: "\x{202C}"
-            text run at (0,0) width 44: "ab12(^"
-            text run at (44,0) width 5: "\x{202A}!"
-        LayoutBlockFlow {P} at (0,2174) size 769x20
-          LayoutText {#text} at (0,0) size 49x19
-            text run at (0,0) width 0 RTL: "\x{202C}"
-            text run at (0,0) width 5: "\x{202A}!"
-            text run at (5,0) width 13 RTL: "(^"
-            text run at (18,0) width 16: "12"
-            text run at (34,0) width 15 RTL: "\x{5D0}\x{5D1}"
-        LayoutBlockFlow {P} at (0,2210) size 769x30
+        LayoutBlockFlow {P} at (0,2218) size 769x30
+          LayoutText {#text} at (0,6) size 49x19
+            text run at (0,6) width 0 RTL: "\x{202C}"
+            text run at (0,6) width 44: "ab12(^"
+            text run at (44,6) width 5: "\x{202A}!"
+        LayoutBlockFlow {P} at (0,2264) size 769x30
+          LayoutText {#text} at (0,6) size 49x19
+            text run at (0,6) width 0 RTL: "\x{202C}"
+            text run at (0,6) width 5: "\x{202A}!"
+            text run at (5,6) width 13 RTL: "(^"
+            text run at (18,6) width 16: "12"
+            text run at (34,6) width 15 RTL: "\x{5D0}\x{5D1}"
+        LayoutBlockFlow {P} at (0,2310) size 769x30
           LayoutText {#text} at (0,6) size 48x19
             text run at (0,6) width 0 RTL: "\x{202C}"
             text run at (0,6) width 5: "\x{202A}!"
             text run at (5,6) width 13 RTL: "(^"
             text run at (18,6) width 16: "12"
             text run at (34,6) width 14 RTL: "\x{627}\x{628}"
-        LayoutBlockFlow {P} at (0,2256) size 769x30
+        LayoutBlockFlow {P} at (0,2356) size 769x30
           LayoutText {#text} at (0,6) size 49x19
             text run at (0,6) width 0 RTL: "\x{202C}"
             text run at (0,6) width 5: "\x{202A}!"
             text run at (5,6) width 13 RTL: "(^"
             text run at (18,6) width 31: "ab\x{661}\x{662}"
-        LayoutBlockFlow {P} at (0,2302) size 769x30
+        LayoutBlockFlow {P} at (0,2402) size 769x30
           LayoutText {#text} at (0,6) size 49x19
             text run at (0,6) width 0 RTL: "\x{202C}"
             text run at (0,6) width 5: "\x{202A}!"
             text run at (5,6) width 13 RTL: "(^"
             text run at (18,6) width 16: "\x{661}\x{662}"
             text run at (34,6) width 15 RTL: "\x{5D0}\x{5D1}"
-        LayoutBlockFlow {P} at (0,2348) size 769x30
+        LayoutBlockFlow {P} at (0,2448) size 769x30
           LayoutText {#text} at (0,6) size 48x19
             text run at (0,6) width 0 RTL: "\x{202C}"
             text run at (0,6) width 5: "\x{202A}!"
             text run at (5,6) width 13 RTL: "(^"
             text run at (18,6) width 16: "\x{661}\x{662}"
             text run at (34,6) width 14 RTL: "\x{627}\x{628}"
-        LayoutBlockFlow {P} at (0,2394) size 769x20
-          LayoutText {#text} at (0,0) size 25x19
-            text run at (0,0) width 0 RTL: "\x{202C}"
-            text run at (0,0) width 7: "\x{202A}?"
-            text run at (7,0) width 13: "\x{202C}(^"
-            text run at (20,0) width 5: "\x{202A}!"
-        LayoutBlockFlow {P} at (0,2430) size 769x20
-          LayoutText {#text} at (0,0) size 25x19
-            text run at (0,0) width 0 RTL: "\x{202C}"
-            text run at (0,0) width 5: "\x{202A}!"
-            text run at (5,0) width 13 RTL: "\x{202C}(^"
-            text run at (18,0) width 7 RTL: "\x{202B}?"
-        LayoutBlockFlow {P} at (0,2466) size 769x20
-          LayoutText {#text} at (0,0) size 33x19
-            text run at (0,0) width 0 RTL: "\x{202C}"
-            text run at (0,0) width 5 RTL: "\x{202B}!"
-            text run at (5,0) width 13 RTL: "(^"
-            text run at (18,0) width 15: "ab"
-        LayoutBlockFlow {P} at (0,2502) size 769x20
-          LayoutText {#text} at (0,0) size 33x19
-            text run at (0,0) width 0 RTL: "\x{202C}"
-            text run at (0,0) width 5 RTL: "\x{202B}!"
-            text run at (5,0) width 28 RTL: "\x{5D0}\x{5D1}(^"
-        LayoutBlockFlow {P} at (0,2538) size 769x30
+        LayoutBlockFlow {P} at (0,2494) size 769x30
+          LayoutText {#text} at (0,6) size 25x19
+            text run at (0,6) width 0 RTL: "\x{202C}"
+            text run at (0,6) width 7: "\x{202A}?"
+            text run at (7,6) width 13: "\x{202C}(^"
+            text run at (20,6) width 5: "\x{202A}!"
+        LayoutBlockFlow {P} at (0,2540) size 769x30
+          LayoutText {#text} at (0,6) size 25x19
+            text run at (0,6) width 0 RTL: "\x{202C}"
+            text run at (0,6) width 5: "\x{202A}!"
+            text run at (5,6) width 13 RTL: "\x{202C}(^"
+            text run at (18,6) width 7 RTL: "\x{202B}?"
+        LayoutBlockFlow {P} at (0,2586) size 769x30
+          LayoutText {#text} at (0,6) size 33x19
+            text run at (0,6) width 0 RTL: "\x{202C}"
+            text run at (0,6) width 5 RTL: "\x{202B}!"
+            text run at (5,6) width 13 RTL: "(^"
+            text run at (18,6) width 15: "ab"
+        LayoutBlockFlow {P} at (0,2632) size 769x30
+          LayoutText {#text} at (0,6) size 33x19
+            text run at (0,6) width 0 RTL: "\x{202C}"
+            text run at (0,6) width 5 RTL: "\x{202B}!"
+            text run at (5,6) width 28 RTL: "\x{5D0}\x{5D1}(^"
+        LayoutBlockFlow {P} at (0,2678) size 769x30
           LayoutText {#text} at (0,6) size 32x19
             text run at (0,6) width 0 RTL: "\x{202C}"
             text run at (0,6) width 5 RTL: "\x{202B}!"
             text run at (5,6) width 27 RTL: "\x{627}\x{628}(^"
-        LayoutBlockFlow {P} at (0,2584) size 769x20
-          LayoutText {#text} at (0,0) size 49x19
-            text run at (0,0) width 0 RTL: "\x{202C}"
-            text run at (0,0) width 5 RTL: "\x{202B}!"
-            text run at (5,0) width 13 RTL: "(^"
-            text run at (18,0) width 31: "ab12"
-        LayoutBlockFlow {P} at (0,2620) size 769x20
-          LayoutText {#text} at (0,0) size 49x19
-            text run at (0,0) width 0 RTL: "\x{202C}"
-            text run at (0,0) width 5 RTL: "\x{202B}!"
-            text run at (5,0) width 13 RTL: "(^"
-            text run at (18,0) width 16: "12"
-            text run at (34,0) width 15 RTL: "\x{5D0}\x{5D1}"
-        LayoutBlockFlow {P} at (0,2656) size 769x30
+        LayoutBlockFlow {P} at (0,2724) size 769x30
+          LayoutText {#text} at (0,6) size 49x19
+            text run at (0,6) width 0 RTL: "\x{202C}"
+            text run at (0,6) width 5 RTL: "\x{202B}!"
+            text run at (5,6) width 13 RTL: "(^"
+            text run at (18,6) width 31: "ab12"
+        LayoutBlockFlow {P} at (0,2770) size 769x30
+          LayoutText {#text} at (0,6) size 49x19
+            text run at (0,6) width 0 RTL: "\x{202C}"
+            text run at (0,6) width 5 RTL: "\x{202B}!"
+            text run at (5,6) width 13 RTL: "(^"
+            text run at (18,6) width 16: "12"
+            text run at (34,6) width 15 RTL: "\x{5D0}\x{5D1}"
+        LayoutBlockFlow {P} at (0,2816) size 769x30
           LayoutText {#text} at (0,6) size 48x19
             text run at (0,6) width 0 RTL: "\x{202C}"
             text run at (0,6) width 5 RTL: "\x{202B}!"
             text run at (5,6) width 13 RTL: "(^"
             text run at (18,6) width 16: "12"
             text run at (34,6) width 14 RTL: "\x{627}\x{628}"
-        LayoutBlockFlow {P} at (0,2702) size 769x30
+        LayoutBlockFlow {P} at (0,2862) size 769x30
           LayoutText {#text} at (0,6) size 49x19
             text run at (0,6) width 0 RTL: "\x{202C}"
             text run at (0,6) width 5 RTL: "\x{202B}!"
             text run at (5,6) width 13 RTL: "(^"
             text run at (18,6) width 31: "ab\x{661}\x{662}"
-        LayoutBlockFlow {P} at (0,2748) size 769x30
+        LayoutBlockFlow {P} at (0,2908) size 769x30
           LayoutText {#text} at (0,6) size 49x19
             text run at (0,6) width 0 RTL: "\x{202C}"
             text run at (0,6) width 5 RTL: "\x{202B}!"
             text run at (5,6) width 13 RTL: "(^"
             text run at (18,6) width 16: "\x{661}\x{662}"
             text run at (34,6) width 15 RTL: "\x{5D0}\x{5D1}"
-        LayoutBlockFlow {P} at (0,2794) size 769x30
+        LayoutBlockFlow {P} at (0,2954) size 769x30
           LayoutText {#text} at (0,6) size 48x19
             text run at (0,6) width 0 RTL: "\x{202C}"
             text run at (0,6) width 5 RTL: "\x{202B}!"
             text run at (5,6) width 13 RTL: "(^"
             text run at (18,6) width 16: "\x{661}\x{662}"
             text run at (34,6) width 14 RTL: "\x{627}\x{628}"
-        LayoutBlockFlow {P} at (0,2840) size 769x20
-          LayoutText {#text} at (0,0) size 25x19
-            text run at (0,0) width 0 RTL: "\x{202C}"
-            text run at (0,0) width 5 RTL: "\x{202B}!"
-            text run at (5,0) width 13 RTL: "\x{202C}(^"
-            text run at (18,0) width 7: "\x{202A}?"
-        LayoutBlockFlow {P} at (0,2876) size 769x20
-          LayoutText {#text} at (0,0) size 25x19
-            text run at (0,0) width 0 RTL: "\x{202C}"
-            text run at (0,0) width 5 RTL: "\x{202B}!"
-            text run at (5,0) width 13 RTL: "\x{202C}(^"
-            text run at (18,0) width 7 RTL: "\x{202B}?"
-        LayoutBlockFlow {P} at (0,2912) size 769x20
-          LayoutText {#text} at (0,0) size 28x19
-            text run at (0,0) width 0 RTL: "\x{202C}"
-            text run at (0,0) width 28: "\x{202A}ab(^"
-        LayoutBlockFlow {P} at (0,2948) size 769x20
-          LayoutText {#text} at (0,0) size 28x19
-            text run at (0,0) width 0 RTL: "\x{202C}"
-            text run at (0,0) width 15 RTL: "\x{202A}\x{5D0}\x{5D1}"
-            text run at (15,0) width 13: "(^"
-        LayoutBlockFlow {P} at (0,2984) size 769x30
+        LayoutBlockFlow {P} at (0,3000) size 769x30
+          LayoutText {#text} at (0,6) size 25x19
+            text run at (0,6) width 0 RTL: "\x{202C}"
+            text run at (0,6) width 5 RTL: "\x{202B}!"
+            text run at (5,6) width 13 RTL: "\x{202C}(^"
+            text run at (18,6) width 7: "\x{202A}?"
+        LayoutBlockFlow {P} at (0,3046) size 769x30
+          LayoutText {#text} at (0,6) size 25x19
+            text run at (0,6) width 0 RTL: "\x{202C}"
+            text run at (0,6) width 5 RTL: "\x{202B}!"
+            text run at (5,6) width 13 RTL: "\x{202C}(^"
+            text run at (18,6) width 7 RTL: "\x{202B}?"
+        LayoutBlockFlow {P} at (0,3092) size 769x30
+          LayoutText {#text} at (0,6) size 28x19
+            text run at (0,6) width 0 RTL: "\x{202C}"
+            text run at (0,6) width 28: "\x{202A}ab(^"
+        LayoutBlockFlow {P} at (0,3138) size 769x30
+          LayoutText {#text} at (0,6) size 28x19
+            text run at (0,6) width 0 RTL: "\x{202C}"
+            text run at (0,6) width 15 RTL: "\x{202A}\x{5D0}\x{5D1}"
+            text run at (15,6) width 13: "(^"
+        LayoutBlockFlow {P} at (0,3184) size 769x30
           LayoutText {#text} at (0,6) size 27x19
             text run at (0,6) width 0 RTL: "\x{202C}"
             text run at (0,6) width 14 RTL: "\x{202A}\x{627}\x{628}"
             text run at (14,6) width 13: "(^"
-        LayoutBlockFlow {P} at (0,3030) size 769x20
-          LayoutText {#text} at (0,0) size 44x19
-            text run at (0,0) width 0 RTL: "\x{202C}"
-            text run at (0,0) width 44: "\x{202A}ab12(^"
-        LayoutBlockFlow {P} at (0,3066) size 769x20
-          LayoutText {#text} at (0,0) size 44x19
-            text run at (0,0) width 0 RTL: "\x{202C}"
-            text run at (0,0) width 16: "12"
-            text run at (16,0) width 15 RTL: "\x{202A}\x{5D0}\x{5D1}"
-            text run at (31,0) width 13: "(^"
-        LayoutBlockFlow {P} at (0,3102) size 769x30
+        LayoutBlockFlow {P} at (0,3230) size 769x30
+          LayoutText {#text} at (0,6) size 44x19
+            text run at (0,6) width 0 RTL: "\x{202C}"
+            text run at (0,6) width 44: "\x{202A}ab12(^"
+        LayoutBlockFlow {P} at (0,3276) size 769x30
+          LayoutText {#text} at (0,6) size 44x19
+            text run at (0,6) width 0 RTL: "\x{202C}"
+            text run at (0,6) width 16: "12"
+            text run at (16,6) width 15 RTL: "\x{202A}\x{5D0}\x{5D1}"
+            text run at (31,6) width 13: "(^"
+        LayoutBlockFlow {P} at (0,3322) size 769x30
           LayoutText {#text} at (0,6) size 43x19
             text run at (0,6) width 0 RTL: "\x{202C}"
             text run at (0,6) width 16: "12"
             text run at (16,6) width 14 RTL: "\x{202A}\x{627}\x{628}"
             text run at (30,6) width 13: "(^"
-        LayoutBlockFlow {P} at (0,3148) size 769x30
+        LayoutBlockFlow {P} at (0,3368) size 769x30
           LayoutText {#text} at (0,6) size 44x19
             text run at (0,6) width 0 RTL: "\x{202C}"
             text run at (0,6) width 15: "\x{202A}ab"
             text run at (15,6) width 16: "\x{661}\x{662}"
             text run at (31,6) width 13: "(^"
-        LayoutBlockFlow {P} at (0,3194) size 769x30
+        LayoutBlockFlow {P} at (0,3414) size 769x30
           LayoutText {#text} at (0,6) size 44x19
             text run at (0,6) width 0 RTL: "\x{202C}"
             text run at (0,6) width 16: "\x{661}\x{662}"
             text run at (16,6) width 15 RTL: "\x{202A}\x{5D0}\x{5D1}"
             text run at (31,6) width 13: "(^"
-        LayoutBlockFlow {P} at (0,3240) size 769x30
+        LayoutBlockFlow {P} at (0,3460) size 769x30
           LayoutText {#text} at (0,6) size 43x19
             text run at (0,6) width 0 RTL: "\x{202C}"
             text run at (0,6) width 16: "\x{661}\x{662}"
             text run at (16,6) width 14 RTL: "\x{202A}\x{627}\x{628}"
             text run at (30,6) width 13: "(^"
-        LayoutBlockFlow {P} at (0,3286) size 769x20
-          LayoutText {#text} at (0,0) size 20x19
-            text run at (0,0) width 0 RTL: "\x{202C}"
-            text run at (0,0) width 0: "\x{202A}"
-            text run at (0,0) width 7: "\x{202A}?"
-            text run at (7,0) width 13: "\x{202C}(^"
-        LayoutBlockFlow {P} at (0,3322) size 769x20
-          LayoutText {#text} at (0,0) size 20x19
-            text run at (0,0) width 0 RTL: "\x{202C}"
-            text run at (0,0) width 0: "\x{202A}"
-            text run at (0,0) width 7 RTL: "\x{202B}?"
-            text run at (7,0) width 13: "\x{202C}(^"
+        LayoutBlockFlow {P} at (0,3506) size 769x30
+          LayoutText {#text} at (0,6) size 20x19
+            text run at (0,6) width 0 RTL: "\x{202C}"
+            text run at (0,6) width 0: "\x{202A}"
+            text run at (0,6) width 7: "\x{202A}?"
+            text run at (7,6) width 13: "\x{202C}(^"
+        LayoutBlockFlow {P} at (0,3552) size 769x30
+          LayoutText {#text} at (0,6) size 20x19
+            text run at (0,6) width 0 RTL: "\x{202C}"
+            text run at (0,6) width 0: "\x{202A}"
+            text run at (0,6) width 7 RTL: "\x{202B}?"
+            text run at (7,6) width 13: "\x{202C}(^"
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/bidi-override-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/bidi-override-expected.png
index 19ed5a1..cd77627 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/bidi-override-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/bidi-override-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/bidi-override-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/bidi-override-expected.txt
index ee7e24b..2439416 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/bidi-override-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/bidi-override-expected.txt
@@ -1,13 +1,13 @@
 layer at (0,0) size 800x600
   LayoutView at (0,0) size 800x600
-layer at (0,0) size 800x356
-  LayoutBlockFlow {HTML} at (0,0) size 800x356
-    LayoutBlockFlow {BODY} at (8,16) size 784x332
+layer at (0,0) size 800x366
+  LayoutBlockFlow {HTML} at (0,0) size 800x366
+    LayoutBlockFlow {BODY} at (8,16) size 784x342
       LayoutBlockFlow {P} at (0,0) size 784x20
-        LayoutText {#text} at (0,0) size 296x19
-          text run at (0,0) width 296: "All rows should be identical to the reference row."
-      LayoutTable {TABLE} at (0,36) size 506x117 [border: none]
-        LayoutTableSection {TBODY} at (0,0) size 505x116
+        LayoutText {#text} at (0,0) size 295x19
+          text run at (0,0) width 295: "All rows should be identical to the reference row."
+      LayoutTable {TABLE} at (0,36) size 506x127 [border: none]
+        LayoutTableSection {TBODY} at (0,0) size 505x126
           LayoutTableRow {TR} at (0,0) size 505x29
             LayoutTableCell {TD} at (0,0) size 93x29 [border: (1px solid #008000)] [r=0 c=0 rs=1 cs=1]
               LayoutText {#text} at (28,5) size 61x19
@@ -103,31 +103,31 @@
                     text run at (23,5) width 62 LTR override: "\x{5D8}\x{5D7}\x{5D6}abc\x{5D5}\x{5D4}\x{5D3}"
                 LayoutText {#text} at (5,5) size 18x19
                   text run at (5,5) width 18 RTL: "\x{5D9}\x{5DB}\x{5DC}"
-          LayoutTableRow {TR} at (0,87) size 505x29
-            LayoutTableCell {TD} at (0,87) size 93x29 [border: (1px solid #008000)] [r=3 c=0 rs=1 cs=1]
+          LayoutTableRow {TR} at (0,87) size 505x39
+            LayoutTableCell {TD} at (0,92) size 93x29 [border: (1px solid #008000)] [r=3 c=0 rs=1 cs=1]
               LayoutText {#text} at (38,5) size 51x19
                 text run at (38,5) width 51: "Unicode"
-            LayoutTableCell {TD} at (93,87) size 206x29 [border: (1px solid #008000)] [r=3 c=1 rs=1 cs=1]
-              LayoutText {#text} at (5,5) size 197x19
-                text run at (5,5) width 22: "abc"
-                text run at (27,5) width 56 RTL override: "\x{202E}ihg\x{5D0}\x{5D1}\x{5D2}fed"
-                text run at (83,5) width 19: "\x{202C}jkl "
-                text run at (102,5) width 18 RTL: "\x{202C}\x{5D9}\x{5DB}\x{5DC}"
-                text run at (120,5) width 62 LTR override: "\x{202D}\x{5D8}\x{5D7}\x{5D6}abc\x{5D5}\x{5D4}\x{5D3}"
-                text run at (182,5) width 20 RTL: "\x{5D0}\x{5D1}\x{5D2}"
-            LayoutTableCell {TD} at (299,87) size 206x29 [border: (1px solid #008000)] [r=3 c=2 rs=1 cs=1]
-              LayoutText {#text} at (5,5) size 197x19
-                text run at (5,5) width 18 RTL: "\x{202C}\x{5D9}\x{5DB}\x{5DC}"
-                text run at (23,5) width 62 LTR override: "\x{202D}\x{5D8}\x{5D7}\x{5D6}abc\x{5D5}\x{5D4}\x{5D3}"
-                text run at (85,5) width 20 RTL: "\x{5D0}\x{5D1}\x{5D2}"
-                text run at (105,5) width 4 RTL: " "
-                text run at (109,5) width 22: "abc"
-                text run at (131,5) width 56 RTL override: "\x{202E}ihg\x{5D0}\x{5D1}\x{5D2}fed"
-                text run at (187,5) width 15: "\x{202C}jkl"
-      LayoutBlockFlow {P} at (0,169) size 784x20
+            LayoutTableCell {TD} at (93,87) size 206x39 [border: (1px solid #008000)] [r=3 c=1 rs=1 cs=1]
+              LayoutText {#text} at (5,11) size 197x19
+                text run at (5,11) width 22: "abc"
+                text run at (27,11) width 56 RTL override: "\x{202E}ihg\x{5D0}\x{5D1}\x{5D2}fed"
+                text run at (83,11) width 19: "\x{202C}jkl "
+                text run at (102,11) width 18 RTL: "\x{202C}\x{5D9}\x{5DB}\x{5DC}"
+                text run at (120,11) width 62 LTR override: "\x{202D}\x{5D8}\x{5D7}\x{5D6}abc\x{5D5}\x{5D4}\x{5D3}"
+                text run at (182,11) width 20 RTL: "\x{5D0}\x{5D1}\x{5D2}"
+            LayoutTableCell {TD} at (299,87) size 206x39 [border: (1px solid #008000)] [r=3 c=2 rs=1 cs=1]
+              LayoutText {#text} at (5,11) size 197x19
+                text run at (5,11) width 18 RTL: "\x{202C}\x{5D9}\x{5DB}\x{5DC}"
+                text run at (23,11) width 62 LTR override: "\x{202D}\x{5D8}\x{5D7}\x{5D6}abc\x{5D5}\x{5D4}\x{5D3}"
+                text run at (85,11) width 20 RTL: "\x{5D0}\x{5D1}\x{5D2}"
+                text run at (105,11) width 4 RTL: " "
+                text run at (109,11) width 22: "abc"
+                text run at (131,11) width 56 RTL override: "\x{202E}ihg\x{5D0}\x{5D1}\x{5D2}fed"
+                text run at (187,11) width 15: "\x{202C}jkl"
+      LayoutBlockFlow {P} at (0,179) size 784x20
         LayoutText {#text} at (0,0) size 367x19
           text run at (0,0) width 367: "The CSS column should be identical to the reference column."
-      LayoutTable {TABLE} at (0,205) size 219x127 [border: none]
+      LayoutTable {TABLE} at (0,215) size 219x127 [border: none]
         LayoutTableSection {TBODY} at (0,0) size 218x126
           LayoutTableRow {TR} at (0,0) size 218x29
             LayoutTableCell {TD} at (0,0) size 109x29 [border: (1px solid #008000)] [r=0 c=0 rs=1 cs=1]
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/bidi-word-spacing-rtl-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/bidi-word-spacing-rtl-expected.png
index a58a42f..a3f8369 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/bidi-word-spacing-rtl-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/bidi-word-spacing-rtl-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/bidi-word-spacing-rtl-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/bidi-word-spacing-rtl-expected.txt
index 504236d..ce274b9 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/bidi-word-spacing-rtl-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/bidi-word-spacing-rtl-expected.txt
@@ -1,8 +1,8 @@
 layer at (0,0) size 800x600
   LayoutView at (0,0) size 800x600
-layer at (0,0) size 800x370
-  LayoutBlockFlow {HTML} at (0,0) size 800x370
-    LayoutBlockFlow {BODY} at (8,10) size 784x350
+layer at (0,0) size 800x397
+  LayoutBlockFlow {HTML} at (0,0) size 800x397
+    LayoutBlockFlow {BODY} at (8,10) size 784x377
       LayoutBlockFlow {DIV} at (300,0) size 184x50 [border: (1px solid #000000)]
         LayoutText {#text} at (172,2) size 11x46
           text run at (172,2) width 11 RTL: "!"
@@ -24,15 +24,15 @@
             text run at (62,2) width 121 RTL: "! "
         LayoutText {#text} at (25,2) size 37x46
           text run at (25,2) width 37 RTL: "@"
-      LayoutBlockFlow {DIV} at (300,180) size 184x50 [border: (1px solid #000000)]
-        LayoutText {#text} at (172,2) size 11x46
-          text run at (172,2) width 11 RTL: "!"
+      LayoutBlockFlow {DIV} at (300,180) size 184x77 [border: (1px solid #000000)]
+        LayoutText {#text} at (172,16) size 11x46
+          text run at (172,16) width 11 RTL: "!"
         LayoutInline {SPAN} at (0,0) size 110x46
-          LayoutText {#text} at (162,2) size 10x46
-            text run at (162,2) width 10 RTL: " "
-        LayoutText {#text} at (15,2) size 47x46
-          text run at (15,2) width 47 RTL: "@ \x{200F}"
-      LayoutBlockFlow {DIV} at (300,240) size 184x50 [border: (1px solid #000000)]
+          LayoutText {#text} at (162,16) size 10x46
+            text run at (162,16) width 10 RTL: " "
+        LayoutText {#text} at (15,16) size 47x46
+          text run at (15,16) width 47 RTL: "@ \x{200F}"
+      LayoutBlockFlow {DIV} at (300,267) size 184x50 [border: (1px solid #000000)]
         LayoutText {#text} at (172,2) size 11x46
           text run at (172,2) width 11 RTL: "!"
         LayoutInline {SPAN} at (0,0) size 110x46
@@ -40,7 +40,7 @@
             text run at (162,2) width 10 RTL: " "
         LayoutText {#text} at (25,2) size 37x46
           text run at (25,2) width 37 RTL: "@"
-      LayoutBlockFlow {DIV} at (300,300) size 184x50 [border: (1px solid #000000)]
+      LayoutBlockFlow {DIV} at (300,327) size 184x50 [border: (1px solid #000000)]
         LayoutText {#text} at (25,2) size 37x46
           text run at (25,2) width 37: "@"
         LayoutInline {SPAN} at (0,0) size 110x46
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/bold-bengali-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/bold-bengali-expected.png
index 2998a06..159dbb8 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/bold-bengali-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/bold-bengali-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/bold-bengali-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/bold-bengali-expected.txt
index 5493027..574fcfb 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/bold-bengali-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/bold-bengali-expected.txt
@@ -4,14 +4,14 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x600
     LayoutBlockFlow {BODY} at (8,8) size 784x576
       LayoutBlockFlow {P} at (0,0) size 784x40
-        LayoutText {#text} at (0,0) size 780x39
-          text run at (0,0) width 328: "This test verifies we can render bold Bengali properly. "
-          text run at (328,0) width 452: "(This is complicated on Linux because it's typically covered by fake-bolded"
+        LayoutText {#text} at (0,0) size 779x39
+          text run at (0,0) width 327: "This test verifies we can render bold Bengali properly. "
+          text run at (326,0) width 453: "(This is complicated on Linux because it's typically covered by fake-bolded"
           text run at (0,20) width 370: "FreeSans even though there's also a FreeSansBold available.)"
       LayoutBlockFlow {P} at (0,56) size 784x20
         LayoutText {#text} at (0,0) size 704x19
           text run at (0,0) width 459: "The test passes if the two words below look similar, but the top one is bold. "
-          text run at (459,0) width 245: "There should be no missing-glyph boxes."
+          text run at (458,0) width 246: "There should be no missing-glyph boxes."
       LayoutBlockFlow {P} at (0,92) size 784x27
         LayoutInline {B} at (0,0) size 35x19
           LayoutText {#text} at (0,5) size 35x19
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/complex-joining-using-gpos-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/complex-joining-using-gpos-expected.png
index ddb81d68..1ce7213 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/complex-joining-using-gpos-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/complex-joining-using-gpos-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/complex-joining-using-gpos-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/complex-joining-using-gpos-expected.txt
index ba526ef..5d62b93 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/complex-joining-using-gpos-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/complex-joining-using-gpos-expected.txt
@@ -4,8 +4,8 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x600
     LayoutBlockFlow {BODY} at (8,8) size 784x584
       LayoutBlockFlow {P} at (0,0) size 784x20
-        LayoutText {#text} at (0,0) size 417x19
-          text run at (0,0) width 417: "This pixel test verifies that we position combining characters properly."
+        LayoutText {#text} at (0,0) size 416x19
+          text run at (0,0) width 416: "This pixel test verifies that we position combining characters properly."
       LayoutBlockFlow {P} at (0,36) size 784x20
         LayoutText {#text} at (0,0) size 679x19
           text run at (0,0) width 679: "The backslash-looking mark should connect into the the character on the center, not be positioned off to the side."
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/hebrew-vowels-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/hebrew-vowels-expected.png
index 39a1ab70..a3708768 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/hebrew-vowels-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/hebrew-vowels-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/khmer-selection-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/khmer-selection-expected.png
index a350bb0..44d5d620 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/khmer-selection-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/khmer-selection-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/khmer-selection-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/khmer-selection-expected.txt
index b75c2452..f2b6cb0 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/khmer-selection-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/khmer-selection-expected.txt
@@ -36,13 +36,13 @@
         LayoutInline {TT} at (0,0) size 88x16
           LayoutText {#text} at (113,23) size 88x16
             text run at (113,23) width 88: "eventSender"
-        LayoutText {#text} at (201,20) size 427x19
-          text run at (201,20) width 427: " to select the text. You should see some of the above text selected and "
-        LayoutInline {TT} at (0,0) size 80x16
-          LayoutText {#text} at (628,23) size 80x16
-            text run at (628,23) width 80: "test_shell"
-        LayoutText {#text} at (708,20) size 765x39
-          text run at (708,20) width 57: " shouldn't"
+        LayoutText {#text} at (201,20) size 426x19
+          text run at (201,20) width 426: " to select the text. You should see some of the above text selected and "
+        LayoutInline {TT} at (0,0) size 81x16
+          LayoutText {#text} at (626,23) size 81x16
+            text run at (626,23) width 81: "test_shell"
+        LayoutText {#text} at (706,20) size 764x39
+          text run at (706,20) width 58: " shouldn't"
           text run at (0,40) width 183: "trigger any assertions or crash."
 selection start: position 0 of child 0 {#text} of child 0 {B} of child 1 {NOBR} of child 1 {P} of body
 selection end:   position 7 of child 0 {#text} of child 6 {A} of child 1 {NOBR} of child 1 {P} of body
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/lang-glyph-cache-separation-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/lang-glyph-cache-separation-expected.png
index 0141c0a..e89ad84 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/lang-glyph-cache-separation-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/lang-glyph-cache-separation-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/lang-glyph-cache-separation-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/lang-glyph-cache-separation-expected.txt
index 989047a..2f4f364 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/lang-glyph-cache-separation-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/lang-glyph-cache-separation-expected.txt
@@ -4,13 +4,13 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x371
     LayoutBlockFlow {BODY} at (8,8) size 784x355
       LayoutBlockFlow (anonymous) at (0,0) size 784x60
-        LayoutText {#text} at (0,0) size 312x19
-          text run at (0,0) width 312: "Tests if glyph caches of different languages interfere."
-        LayoutBR {BR} at (312,0) size 0x19
+        LayoutText {#text} at (0,0) size 311x19
+          text run at (0,0) width 311: "Tests if glyph caches of different languages interfere."
+        LayoutBR {BR} at (310,0) size 1x19
         LayoutText {#text} at (0,20) size 781x39
           text run at (0,20) width 781: "On systems that the locales have different font preferences, the following divs should be displayed in corresponding preferred fonts"
-          text run at (0,40) width 75: "respectively."
-        LayoutBR {BR} at (75,40) size 0x19
+          text run at (0,40) width 74: "respectively."
+        LayoutBR {BR} at (73,40) size 1x19
       LayoutBlockFlow {DIV} at (0,60) size 784x100
         LayoutBlockFlow (anonymous) at (0,0) size 784x20
           LayoutText {#text} at (0,0) size 114x19
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/plane2-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/plane2-expected.png
index 99db2dc..2195b0a6 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/plane2-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/plane2-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/plane2-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/plane2-expected.txt
index a8e8bbcc..5c7a904f 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/plane2-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/plane2-expected.txt
@@ -4,13 +4,13 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x600
     LayoutBlockFlow {BODY} at (8,8) size 784x584
       LayoutBlockFlow {P} at (0,0) size 784x60
-        LayoutText {#text} at (0,0) size 51x19
-          text run at (0,0) width 51: "Test for "
-        LayoutInline {A} at (0,0) size 66x19 [color=#0000EE]
-          LayoutText {#text} at (51,0) size 66x19
-            text run at (51,0) width 66: "bug 35605"
-        LayoutText {#text} at (117,0) size 778x59
-          text run at (117,0) width 641: ": Two lines below have one character from CJK Ideograph, one from CJK Ext A (both in BMP) and three"
+        LayoutText {#text} at (0,0) size 50x19
+          text run at (0,0) width 50: "Test for "
+        LayoutInline {A} at (0,0) size 67x19 [color=#0000EE]
+          LayoutText {#text} at (49,0) size 67x19
+            text run at (49,0) width 67: "bug 35605"
+        LayoutText {#text} at (115,0) size 778x59
+          text run at (115,0) width 641: ": Two lines below have one character from CJK Ideograph, one from CJK Ext A (both in BMP) and three"
           text run at (0,20) width 778: "characters from CJK Ext B (plane 2). The last group of characters are covered by Japanese fonts on Mac as well as two Chinese"
           text run at (0,40) width 234: "fonts for Ext B shipped with Windows."
       LayoutBlockFlow {DIV} at (0,76) size 784x74
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/pop-up-button-text-alignment-and-direction-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/pop-up-button-text-alignment-and-direction-expected.png
index 43dd34b..925a94a 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/pop-up-button-text-alignment-and-direction-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/pop-up-button-text-alignment-and-direction-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/pop-up-button-text-alignment-and-direction-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/pop-up-button-text-alignment-and-direction-expected.txt
index a4b43af..d8a1d419 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/pop-up-button-text-alignment-and-direction-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/pop-up-button-text-alignment-and-direction-expected.txt
@@ -4,9 +4,9 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x532
     LayoutBlockFlow {BODY} at (8,16) size 784x508
       LayoutBlockFlow {P} at (0,0) size 784x20
-        LayoutText {#text} at (0,0) size 660x19
-          text run at (0,0) width 458: "Verify that the alignment and writing direction of each selected item matches "
-          text run at (458,0) width 202: "the one below the pop-up button."
+        LayoutText {#text} at (0,0) size 659x19
+          text run at (0,0) width 457: "Verify that the alignment and writing direction of each selected item matches "
+          text run at (456,0) width 203: "the one below the pop-up button."
       LayoutBlockFlow {DIV} at (0,36) size 784x236
         LayoutMenuList {SELECT} at (0,0) size 500x23 [bgcolor=#C0C0C0] [border: (1px solid #A9A9A9)]
           LayoutBlockFlow (anonymous) at (1,1) size 498x21
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/rtl-caret-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/rtl-caret-expected.png
index d4e0518..9a8c0639 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/rtl-caret-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/rtl-caret-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/rtl-caret-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/rtl-caret-expected.txt
index c7a6b5c..c2329e074 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/rtl-caret-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/rtl-caret-expected.txt
@@ -6,13 +6,13 @@
       LayoutBlockFlow {P} at (0,0) size 784x40
         LayoutText {#text} at (0,0) size 164x19
           text run at (0,0) width 164: "This is a regression test for "
-        LayoutInline {I} at (0,0) size 771x39
+        LayoutInline {I} at (0,0) size 770x39
           LayoutInline {A} at (0,0) size 350x19 [color=#0000EE]
             LayoutText {#text} at (164,0) size 350x19
               text run at (164,0) width 350: "http://bugzilla.opendarwin.org/show_bug.cgi?id=8866"
-          LayoutText {#text} at (514,0) size 771x39
-            text run at (514,0) width 4: " "
-            text run at (518,0) width 253: "REGRESSION: Incorrect caret position"
+          LayoutText {#text} at (513,0) size 770x39
+            text run at (513,0) width 5: " "
+            text run at (517,0) width 253: "REGRESSION: Incorrect caret position"
             text run at (0,20) width 72: "in RTL text"
         LayoutText {#text} at (72,20) size 4x19
           text run at (72,20) width 4: "."
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/rtl-negative-letter-spacing-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/rtl-negative-letter-spacing-expected.png
index e0422ef..54e708ff 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/rtl-negative-letter-spacing-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/rtl-negative-letter-spacing-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/rtl-white-space-pre-wrap-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/rtl-white-space-pre-wrap-expected.png
index cb4af440c..0eaf22a1 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/rtl-white-space-pre-wrap-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/rtl-white-space-pre-wrap-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/rtl-white-space-pre-wrap-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/rtl-white-space-pre-wrap-expected.txt
index d458889..bce7f394 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/rtl-white-space-pre-wrap-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/rtl-white-space-pre-wrap-expected.txt
@@ -6,19 +6,19 @@
       LayoutBlockFlow {P} at (0,0) size 784x40
         LayoutText {#text} at (0,0) size 99x19
           text run at (0,0) width 99: "This is a test for "
-        LayoutInline {I} at (0,0) size 748x39
+        LayoutInline {I} at (0,0) size 747x39
           LayoutInline {A} at (0,0) size 350x19 [color=#0000EE]
             LayoutText {#text} at (99,0) size 350x19
               text run at (99,0) width 350: "http://bugzilla.opendarwin.org/show_bug.cgi?id=9670"
-          LayoutText {#text} at (449,0) size 748x39
-            text run at (449,0) width 4: " "
-            text run at (453,0) width 295: "http://bugzilla.opendarwin.org/show_bug.cgi?"
+          LayoutText {#text} at (448,0) size 747x39
+            text run at (448,0) width 5: " "
+            text run at (452,0) width 295: "http://bugzilla.opendarwin.org/show_bug.cgi?"
             text run at (0,20) width 55: "id=9670"
         LayoutText {#text} at (55,20) size 4x19
           text run at (55,20) width 4: "."
       LayoutBlockFlow {P} at (0,56) size 784x20
-        LayoutText {#text} at (0,0) size 510x19
-          text run at (0,0) width 510: "All text should be aligned with the right edge of its container and should not overflow."
+        LayoutText {#text} at (0,0) size 509x19
+          text run at (0,0) width 509: "All text should be aligned with the right edge of its container and should not overflow."
       LayoutBlockFlow {HR} at (0,92) size 784x2 [border: (1px inset #EEEEEE)]
       LayoutBlockFlow {DIV} at (0,102) size 191x28 [bgcolor=#FFFF00]
         LayoutText {#text} at (1,0) size 190x27
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/text-combine-image-test-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/text-combine-image-test-expected.png
index a1281332..2728b55 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/text-combine-image-test-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/text-combine-image-test-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/thai-baht-space-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/thai-baht-space-expected.png
index 3f6e2c2..eda9add 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/thai-baht-space-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/thai-baht-space-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/thai-baht-space-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/thai-baht-space-expected.txt
index 8502700..619f4538 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/thai-baht-space-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/thai-baht-space-expected.txt
@@ -4,14 +4,14 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x600
     LayoutBlockFlow {BODY} at (8,8) size 784x576
       LayoutBlockFlow (anonymous) at (0,0) size 784x40
-        LayoutText {#text} at (0,0) size 51x19
-          text run at (0,0) width 51: "Test for "
-        LayoutInline {A} at (0,0) size 66x19 [color=#0000EE]
-          LayoutText {#text} at (51,0) size 66x19
-            text run at (51,0) width 66: "bug 25464"
-        LayoutText {#text} at (117,0) size 753x39
-          text run at (117,0) width 636: ". Characters belonging to 'Common' script followed / preceeded by a space should be rendered correctly."
-          text run at (0,20) width 546: "Two lines below have 4 Thai currency signs (U+0E3F) and all of them should be rendered."
+        LayoutText {#text} at (0,0) size 50x19
+          text run at (0,0) width 50: "Test for "
+        LayoutInline {A} at (0,0) size 67x19 [color=#0000EE]
+          LayoutText {#text} at (49,0) size 67x19
+            text run at (49,0) width 67: "bug 25464"
+        LayoutText {#text} at (115,0) size 782x39
+          text run at (115,0) width 667: ". Characters belonging to 'Common' script followed / preceeded by a space should be rendered correctly. Two"
+          text run at (0,20) width 514: "lines below have 4 Thai currency signs (U+0E3F) and all of them should be rendered."
       LayoutBlockFlow {P} at (0,56) size 784x60
         LayoutText {#text} at (0,6) size 290x19
           text run at (0,6) width 290: "abc \x{E25}\x{E07}\x{E17}\x{E38}\x{E19}4000\x{E3F} \x{E23}\x{E31}\x{E1A}\x{E1B}\x{E23}\x{E30}\x{E01}\x{E31}\x{E19}\x{E23}\x{E32}\x{E22}\x{E44}\x{E14}\x{E49} 50000\x{E3F}/M"
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/unicode-bidi-plaintext-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/unicode-bidi-plaintext-expected.png
index 0a81290..4598a81 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/unicode-bidi-plaintext-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/unicode-bidi-plaintext-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/unicode-bidi-plaintext-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/unicode-bidi-plaintext-expected.txt
index d0a80cf..2a57bf09 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/unicode-bidi-plaintext-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/unicode-bidi-plaintext-expected.txt
@@ -4,8 +4,8 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x214
     LayoutBlockFlow {BODY} at (8,8) size 784x193
       LayoutBlockFlow {DIV} at (0,0) size 784x20
-        LayoutText {#text} at (0,0) size 483x19
-          text run at (0,0) width 483: "This tests proper handling of unicode-bidi: plaintext. You should not see any red."
+        LayoutText {#text} at (0,0) size 482x19
+          text run at (0,0) width 482: "This tests proper handling of unicode-bidi: plaintext. You should not see any red."
       LayoutBlockFlow {DIV} at (0,20) size 784x80
         LayoutText {#text} at (0,0) size 41x19
           text run at (0,0) width 41: "!hello. "
@@ -18,9 +18,9 @@
           text run at (36,40) width 15 RTL: "\x{5DC}\x{5D5}\x{5D9}"
           text run at (51,40) width 9: "! "
         LayoutBR {BR} at (60,40) size 0x19
-        LayoutText {#text} at (693,60) size 91x19
-          text run at (693,60) width 5 RTL: "!"
-          text run at (698,60) width 49: "WebKit"
+        LayoutText {#text} at (694,60) size 90x19
+          text run at (694,60) width 6 RTL: "!"
+          text run at (699,60) width 48: "WebKit"
           text run at (747,60) width 37 RTL: "\x{5E9}\x{5DC}\x{5D5}\x{5DD}, "
       LayoutBlockFlow {PRE} at (0,113) size 784x80
         LayoutText {#text} at (0,0) size 784x80
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/unicode-bidi-plaintext-in-textarea-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/unicode-bidi-plaintext-in-textarea-expected.png
index 76948e8..7917b6211 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/unicode-bidi-plaintext-in-textarea-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/unicode-bidi-plaintext-in-textarea-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/unicode-bidi-plaintext-in-textarea-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/unicode-bidi-plaintext-in-textarea-expected.txt
index 0114557e..b80cb7a 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/unicode-bidi-plaintext-in-textarea-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/unicode-bidi-plaintext-in-textarea-expected.txt
@@ -5,8 +5,8 @@
     LayoutBlockFlow {BODY} at (8,8) size 784x320
       LayoutBlockFlow {DIV} at (0,0) size 784x320
         LayoutBlockFlow (anonymous) at (0,0) size 784x20
-          LayoutText {#text} at (0,0) size 750x19
-            text run at (0,0) width 750: "In all four cases below, the exclamation mark should be on the left side of the first line and on the right side of the second line."
+          LayoutText {#text} at (0,0) size 749x19
+            text run at (0,0) width 749: "In all four cases below, the exclamation mark should be on the left side of the first line and on the right side of the second line."
         LayoutBlockFlow {DIV} at (0,20) size 784x300
           LayoutBR {BR} at (421,55) size 0x19
           LayoutBR {BR} at (421,130) size 0x19
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/wrap-CJK-001-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/wrap-CJK-001-expected.png
index 22d60c6b..d11c2908 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/wrap-CJK-001-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/international/wrap-CJK-001-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/justified-selection-at-edge-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text/justified-selection-at-edge-expected.png
index df81ede..8244266 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/justified-selection-at-edge-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/justified-selection-at-edge-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/justified-selection-at-edge-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/text/justified-selection-at-edge-expected.txt
index 1215751..ea9bb497 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/justified-selection-at-edge-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/justified-selection-at-edge-expected.txt
@@ -4,8 +4,8 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x600
     LayoutBlockFlow {BODY} at (8,8) size 784x576
       LayoutBlockFlow {P} at (0,0) size 784x20
-        LayoutText {#text} at (0,0) size 370x19
-          text run at (0,0) width 370: "Test for bug 13234, layout of selected justified text is broken."
+        LayoutText {#text} at (0,0) size 369x19
+          text run at (0,0) width 369: "Test for bug 13234, layout of selected justified text is broken."
       LayoutBlockFlow {P} at (0,36) size 784x20
         LayoutText {#text} at (0,0) size 238x19
           text run at (0,0) width 238: "The two blue boxes should be identical."
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/justified-selection-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text/justified-selection-expected.png
index 6c7e5c7a..36f00a0 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/justified-selection-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/justified-selection-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/justified-selection-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/text/justified-selection-expected.txt
index 9300936f..c6b066a 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/justified-selection-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/justified-selection-expected.txt
@@ -4,13 +4,13 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x600
     LayoutBlockFlow {BODY} at (8,8) size 784x584
       LayoutBlockFlow {P} at (0,0) size 784x20
-        LayoutText {#text} at (0,0) size 101x19
-          text run at (0,0) width 101: "Test for revision "
-        LayoutInline {A} at (0,0) size 48x19 [color=#0000EE]
-          LayoutText {#text} at (101,0) size 48x19
-            text run at (101,0) width 48: "#20574"
-        LayoutText {#text} at (149,0) size 4x19
-          text run at (149,0) width 4: "."
+        LayoutText {#text} at (0,0) size 100x19
+          text run at (0,0) width 100: "Test for revision "
+        LayoutInline {A} at (0,0) size 49x19 [color=#0000EE]
+          LayoutText {#text} at (99,0) size 49x19
+            text run at (99,0) width 49: "#20574"
+        LayoutText {#text} at (147,0) size 5x19
+          text run at (147,0) width 5: "."
       LayoutBlockFlow {P} at (0,36) size 784x20
         LayoutText {#text} at (0,0) size 238x19
           text run at (0,0) width 238: "The two blue boxes should be identical."
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/letter-spacing-negative-opacity-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text/letter-spacing-negative-opacity-expected.png
index 224beb27..f6916a08 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/letter-spacing-negative-opacity-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/letter-spacing-negative-opacity-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/letter-spacing-negative-opacity-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/text/letter-spacing-negative-opacity-expected.txt
index 8fbda63..1561b6a 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/letter-spacing-negative-opacity-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/letter-spacing-negative-opacity-expected.txt
@@ -4,6 +4,6 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x600
     LayoutBlockFlow {BODY} at (8,8) size 784x584
 layer at (8,8) size 272x167 transparent
-  LayoutBlockFlow (positioned) {DIV} at (8,8) size 272x167 [border: (1px solid #FF0000)]
-    LayoutText {#text} at (1,4) size 270x159
-      text run at (1,4) width 270: "Testing the bug"
+  LayoutBlockFlow (positioned) {DIV} at (8,8) size 272.23x167 [border: (1px solid #FF0000)]
+    LayoutText {#text} at (1,4) size 271x159
+      text run at (1,4) width 271: "Testing the bug"
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/line-initial-and-final-swashes-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text/line-initial-and-final-swashes-expected.png
index 66611878..7249b05 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/line-initial-and-final-swashes-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/line-initial-and-final-swashes-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/line-initial-and-final-swashes-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/text/line-initial-and-final-swashes-expected.txt
index 44f5b44..5b3ca78 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/line-initial-and-final-swashes-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/line-initial-and-final-swashes-expected.txt
@@ -4,8 +4,8 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x600
     LayoutBlockFlow {BODY} at (8,8) size 784x584
       LayoutBlockFlow {P} at (0,0) size 784x20
-        LayoutText {#text} at (0,0) size 616x19
-          text run at (0,0) width 616: "The black text should be identical to, and overlap, the red text, so there should be no red pixels below."
+        LayoutText {#text} at (0,0) size 615x19
+          text run at (0,0) width 615: "The black text should be identical to, and overlap, the red text, so there should be no red pixels below."
       LayoutBlockFlow {DIV} at (0,36) size 784x196
         LayoutBlockFlow {DIV} at (0,0) size 784x170 [color=#FF0000]
           LayoutText {#text} at (0,3) size 272x164
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/midword-break-after-breakable-char-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text/midword-break-after-breakable-char-expected.png
index 995d988..b043bb9 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/midword-break-after-breakable-char-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/midword-break-after-breakable-char-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/midword-break-after-breakable-char-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/text/midword-break-after-breakable-char-expected.txt
index b9c0b52..d8cbf3a 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/midword-break-after-breakable-char-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/midword-break-after-breakable-char-expected.txt
@@ -4,18 +4,18 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x600
     LayoutBlockFlow {BODY} at (8,8) size 784x576
       LayoutBlockFlow {P} at (0,0) size 784x40
-        LayoutText {#text} at (0,0) size 51x19
-          text run at (0,0) width 51: "Test for "
-        LayoutInline {I} at (0,0) size 734x39
-          LayoutInline {A} at (0,0) size 305x19 [color=#0000EE]
-            LayoutText {#text} at (51,0) size 305x19
-              text run at (51,0) width 305: "http://bugs.webkit.org/show_bug.cgi?id=13156"
-          LayoutText {#text} at (356,0) size 734x39
-            text run at (356,0) width 4: " "
-            text run at (360,0) width 374: "REGRESSION (r19621): Pasting breakable content where"
-            text run at (0,20) width 502: "wrapped line is too long to fit in a textarea fails to draw a horizontal scrollbar"
-        LayoutText {#text} at (502,20) size 4x19
-          text run at (502,20) width 4: "."
+        LayoutText {#text} at (0,0) size 50x19
+          text run at (0,0) width 50: "Test for "
+        LayoutInline {I} at (0,0) size 732x39
+          LayoutInline {A} at (0,0) size 306x19 [color=#0000EE]
+            LayoutText {#text} at (49,0) size 306x19
+              text run at (49,0) width 306: "http://bugs.webkit.org/show_bug.cgi?id=13156"
+          LayoutText {#text} at (354,0) size 732x39
+            text run at (354,0) width 5: " "
+            text run at (358,0) width 374: "REGRESSION (r19621): Pasting breakable content where"
+            text run at (0,20) width 501: "wrapped line is too long to fit in a textarea fails to draw a horizontal scrollbar"
+        LayoutText {#text} at (500,20) size 5x19
+          text run at (500,20) width 5: "."
       LayoutBlockFlow {P} at (0,56) size 784x40
         LayoutText {#text} at (0,0) size 774x39
           text run at (0,0) width 774: "This tests that a line break will occur in the middle of the first word on a line if it\x{2019}s too long to fit on the line. The behavior is tested"
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/midword-break-before-surrogate-pair-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text/midword-break-before-surrogate-pair-expected.png
index c4a0006..12edd39 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/midword-break-before-surrogate-pair-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/midword-break-before-surrogate-pair-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/midword-break-hang-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text/midword-break-hang-expected.png
index d0a21b8..163ce40 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/midword-break-hang-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/midword-break-hang-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/midword-break-hang-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/text/midword-break-hang-expected.txt
index 8e5a1a0..5f817e2 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/midword-break-hang-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/midword-break-hang-expected.txt
@@ -6,13 +6,13 @@
       LayoutBlockFlow {P} at (0,0) size 784x40
         LayoutText {#text} at (0,0) size 164x19
           text run at (0,0) width 164: "This is a regression test for "
-        LayoutInline {I} at (0,0) size 707x39
+        LayoutInline {I} at (0,0) size 705x39
           LayoutInline {A} at (0,0) size 350x19 [color=#0000EE]
             LayoutText {#text} at (164,0) size 350x19
               text run at (164,0) width 350: "http://bugzilla.opendarwin.org/show_bug.cgi?id=8485"
-          LayoutText {#text} at (514,0) size 707x39
-            text run at (514,0) width 4: " "
-            text run at (518,0) width 189: "iExploder(#11705): Freeze in"
+          LayoutText {#text} at (513,0) size 705x39
+            text run at (513,0) width 5: " "
+            text run at (517,0) width 188: "iExploder(#11705): Freeze in"
             text run at (0,20) width 174: "LayoutBlockFlow::layout()"
         LayoutText {#text} at (174,20) size 4x19
           text run at (174,20) width 4: "."
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/monospace-width-cache-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text/monospace-width-cache-expected.png
index 87572eb..6cc30f7 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/monospace-width-cache-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/monospace-width-cache-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/monospace-width-cache-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/text/monospace-width-cache-expected.txt
index 612d89c8..2e0dc1c 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/monospace-width-cache-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/monospace-width-cache-expected.txt
@@ -4,19 +4,19 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x600
     LayoutBlockFlow {BODY} at (8,8) size 784x576
       LayoutBlockFlow {P} at (0,0) size 784x40
-        LayoutText {#text} at (0,0) size 306x19
-          text run at (0,0) width 306: "Test for monospace width cache bug mentioned in "
+        LayoutText {#text} at (0,0) size 305x19
+          text run at (0,0) width 305: "Test for monospace width cache bug mentioned in "
         LayoutInline {A} at (0,0) size 66x19 [color=#0000EE]
-          LayoutText {#text} at (306,0) size 66x19
-            text run at (306,0) width 66: "bug 11197"
-        LayoutText {#text} at (372,0) size 4x19
-          text run at (372,0) width 4: " "
-        LayoutInline {I} at (0,0) size 777x39
-          LayoutText {#text} at (376,0) size 777x39
-            text run at (376,0) width 401: "REGRESSION: Specifying a counter for a CODE tag's content"
-            text run at (0,20) width 303: "style property on before or after causes a crash"
-        LayoutText {#text} at (303,20) size 4x19
-          text run at (303,20) width 4: "."
+          LayoutText {#text} at (304,0) size 66x19
+            text run at (304,0) width 66: "bug 11197"
+        LayoutText {#text} at (369,0) size 5x19
+          text run at (369,0) width 5: " "
+        LayoutInline {I} at (0,0) size 775x39
+          LayoutText {#text} at (373,0) size 775x39
+            text run at (373,0) width 402: "REGRESSION: Specifying a counter for a CODE tag's content"
+            text run at (0,20) width 302: "style property on before or after causes a crash"
+        LayoutText {#text} at (301,20) size 5x19
+          text run at (301,20) width 5: "."
       LayoutBlockFlow {P} at (0,56) size 784x20
         LayoutText {#text} at (0,0) size 347x19
           text run at (0,0) width 347: "The blue line and the black line should be the same length."
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/reset-emptyRun-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text/reset-emptyRun-expected.png
index 6248d38..c658ead 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/reset-emptyRun-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/reset-emptyRun-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/reset-emptyRun-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/text/reset-emptyRun-expected.txt
index c03120b9..3e9975a 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/reset-emptyRun-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/reset-emptyRun-expected.txt
@@ -4,17 +4,17 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x600
     LayoutBlockFlow {BODY} at (8,8) size 784x584
       LayoutBlockFlow {P} at (0,0) size 784x20
-        LayoutText {#text} at (0,0) size 51x19
-          text run at (0,0) width 51: "Test for "
+        LayoutText {#text} at (0,0) size 50x19
+          text run at (0,0) width 50: "Test for "
         LayoutInline {I} at (0,0) size 716x19
-          LayoutInline {A} at (0,0) size 305x19 [color=#0000EE]
-            LayoutText {#text} at (51,0) size 305x19
-              text run at (51,0) width 305: "http://bugs.webkit.org/show_bug.cgi?id=14758"
-          LayoutText {#text} at (356,0) size 411x19
-            text run at (356,0) width 4: " "
-            text run at (360,0) width 407: "REGRESSION: Repeated text after line break on facebook.com"
-        LayoutText {#text} at (767,0) size 4x19
-          text run at (767,0) width 4: "."
+          LayoutInline {A} at (0,0) size 306x19 [color=#0000EE]
+            LayoutText {#text} at (49,0) size 306x19
+              text run at (49,0) width 306: "http://bugs.webkit.org/show_bug.cgi?id=14758"
+          LayoutText {#text} at (354,0) size 411x19
+            text run at (354,0) width 5: " "
+            text run at (358,0) width 407: "REGRESSION: Repeated text after line break on facebook.com"
+        LayoutText {#text} at (764,0) size 5x19
+          text run at (764,0) width 5: "."
       LayoutBlockFlow {P} at (0,36) size 784x20
         LayoutText {#text} at (0,0) size 221x19
           text run at (0,0) width 221: "These two boxes should be identical:"
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/selection-hard-linebreak-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text/selection-hard-linebreak-expected.png
index 322e778..5521437 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/selection-hard-linebreak-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/selection-hard-linebreak-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/selection-hard-linebreak-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/text/selection-hard-linebreak-expected.txt
index bf7e2331..2b01088 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/selection-hard-linebreak-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/selection-hard-linebreak-expected.txt
@@ -4,26 +4,26 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x600
     LayoutBlockFlow {BODY} at (8,8) size 784x584
       LayoutBlockFlow {P} at (0,0) size 784x40
-        LayoutText {#text} at (0,0) size 51x19
-          text run at (0,0) width 51: "Test for "
-        LayoutInline {I} at (0,0) size 777x39
-          LayoutInline {A} at (0,0) size 305x19 [color=#0000EE]
-            LayoutText {#text} at (51,0) size 305x19
-              text run at (51,0) width 305: "http://bugs.webkit.org/show_bug.cgi?id=13153"
-          LayoutText {#text} at (356,0) size 777x39
-            text run at (356,0) width 4: " "
-            text run at (360,0) width 417: "REGRESSION: Visual highlighting of pre-populated blank line in"
-            text run at (0,20) width 117: "textarea is broken"
-        LayoutText {#text} at (117,20) size 4x19
-          text run at (117,20) width 4: "."
+        LayoutText {#text} at (0,0) size 50x19
+          text run at (0,0) width 50: "Test for "
+        LayoutInline {I} at (0,0) size 774x39
+          LayoutInline {A} at (0,0) size 306x19 [color=#0000EE]
+            LayoutText {#text} at (49,0) size 306x19
+              text run at (49,0) width 306: "http://bugs.webkit.org/show_bug.cgi?id=13153"
+          LayoutText {#text} at (354,0) size 774x39
+            text run at (354,0) width 5: " "
+            text run at (358,0) width 416: "REGRESSION: Visual highlighting of pre-populated blank line in"
+            text run at (0,20) width 116: "textarea is broken"
+        LayoutText {#text} at (115,20) size 5x19
+          text run at (115,20) width 5: "."
       LayoutBlockFlow {P} at (0,56) size 784x20
-        LayoutText {#text} at (0,0) size 310x19
-          text run at (0,0) width 310: "Testing the highlighting of and near hard line breaks."
+        LayoutText {#text} at (0,0) size 309x19
+          text run at (0,0) width 309: "Testing the highlighting of and near hard line breaks."
       LayoutBlockFlow (anonymous) at (0,92) size 784x80
         LayoutText {#text} at (0,0) size 0x0
       LayoutBlockFlow {P} at (0,188) size 784x20
-        LayoutText {#text} at (0,0) size 291x19
-          text run at (0,0) width 291: "Testing the highlighting of text split across boxes."
+        LayoutText {#text} at (0,0) size 290x19
+          text run at (0,0) width 290: "Testing the highlighting of text split across boxes."
       LayoutBlockFlow (anonymous) at (0,224) size 784x80
         LayoutText {#text} at (0,0) size 0x0
 layer at (12,104) size 62x72
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/shadow-no-blur-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text/shadow-no-blur-expected.png
index 5af387d8..ec6947cf8 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/shadow-no-blur-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/shadow-no-blur-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/shadow-no-blur-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/text/shadow-no-blur-expected.txt
index d2bb086..27912d4 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/shadow-no-blur-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/shadow-no-blur-expected.txt
@@ -5,17 +5,17 @@
     LayoutBlockFlow {BODY} at (8,8) size 784x584
       LayoutBlockFlow {DIV} at (0,0) size 784x285 [color=#0000007F]
         LayoutBlockFlow {DIV} at (0,0) size 784x57
-          LayoutText {#text} at (0,1) size 244x55
-            text run at (0,1) width 244: "Text shadow"
+          LayoutText {#text} at (0,1) size 241x55
+            text run at (0,1) width 241: "Text shadow"
         LayoutBlockFlow {DIV} at (0,57) size 784x57
-          LayoutText {#text} at (0,1) size 244x55
-            text run at (0,1) width 244: "Text shadow"
+          LayoutText {#text} at (0,1) size 241x55
+            text run at (0,1) width 241: "Text shadow"
         LayoutBlockFlow {DIV} at (0,114) size 784x57
-          LayoutText {#text} at (0,1) size 244x55
-            text run at (0,1) width 244: "Text shadow"
+          LayoutText {#text} at (0,1) size 241x55
+            text run at (0,1) width 241: "Text shadow"
         LayoutBlockFlow {DIV} at (0,171) size 784x57
-          LayoutText {#text} at (0,1) size 244x55
-            text run at (0,1) width 244: "Text shadow"
+          LayoutText {#text} at (0,1) size 241x55
+            text run at (0,1) width 241: "Text shadow"
         LayoutBlockFlow {DIV} at (0,228) size 784x57
-          LayoutText {#text} at (0,1) size 244x55
-            text run at (0,1) width 244: "Text shadow"
+          LayoutText {#text} at (0,1) size 241x55
+            text run at (0,1) width 241: "Text shadow"
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/shadow-translucent-fill-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text/shadow-translucent-fill-expected.png
index 7e08d883..c557021 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/shadow-translucent-fill-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/shadow-translucent-fill-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/shadow-translucent-fill-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/text/shadow-translucent-fill-expected.txt
index f7e81f49..5b82c83 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/shadow-translucent-fill-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/shadow-translucent-fill-expected.txt
@@ -4,9 +4,9 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x600
     LayoutBlockFlow {BODY} at (8,8) size 784x576
       LayoutBlockFlow {P} at (0,0) size 784x20
-        LayoutText {#text} at (0,0) size 568x19
-          text run at (0,0) width 452: "Test that the intensity of text-shadow does not depend on the transparency "
-          text run at (452,0) width 116: "of the text fill color."
+        LayoutText {#text} at (0,0) size 566x19
+          text run at (0,0) width 451: "Test that the intensity of text-shadow does not depend on the transparency "
+          text run at (450,0) width 116: "of the text fill color."
       LayoutBlockFlow {DIV} at (0,36) size 784x72
         LayoutText {#text} at (0,0) size 48x24
           text run at (0,0) width 48: "A "
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/shaping/same-script-different-lang-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text/shaping/same-script-different-lang-expected.png
index 9a40fc1..2be16c2 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/shaping/same-script-different-lang-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/shaping/same-script-different-lang-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/shaping/same-script-different-lang-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/text/shaping/same-script-different-lang-expected.txt
index 9770044e..f39ec7d 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/shaping/same-script-different-lang-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/shaping/same-script-different-lang-expected.txt
@@ -1,18 +1,22 @@
 layer at (0,0) size 800x600
   LayoutView at (0,0) size 800x600
-layer at (0,0) size 800x212
-  LayoutBlockFlow {HTML} at (0,0) size 800x212.44
-    LayoutBlockFlow {BODY} at (8,18.72) size 784x185.72
+layer at (0,0) size 800x192
+  LayoutBlockFlow {HTML} at (0,0) size 800x192.44
+    LayoutBlockFlow {BODY} at (8,18.72) size 784x157.72
       LayoutBlockFlow {H3} at (0,0) size 784x23
         LayoutText {#text} at (0,0) size 764x22
           text run at (0,0) width 764: "The glyph for JHA should look different for Nepali and Hindi, depending on the lang attribute."
       LayoutBlockFlow {P} at (0,41.72) size 784x28
         LayoutText {#text} at (0,4) size 88x21
           text run at (0,4) width 88: "Hindi:JHA \x{91D}"
-      LayoutBlockFlow (anonymous) at (0,85.72) size 784x20
-        LayoutBR {BR} at (0,0) size 0x19
-      LayoutBlockFlow {P} at (0,121.72) size 784x28
+      LayoutBlockFlow {P} at (0,85.72) size 784x28
         LayoutText {#text} at (0,4) size 100x21
           text run at (0,4) width 100: "Nepali:JHA \x{91D}"
-      LayoutBlockFlow (anonymous) at (0,165.72) size 784x20
-        LayoutBR {BR} at (0,0) size 0x19
+      LayoutBlockFlow {P} at (0,129.72) size 784x28
+        LayoutText {#text} at (0,4) size 85x21
+          text run at (0,4) width 85: "Nepali:JHA "
+        LayoutInline {SPAN} at (0,0) size 15x21
+          LayoutText {#text} at (85,4) size 15x21
+            text run at (85,4) width 15: "\x{91D}"
+        LayoutText {#text} at (100,4) size 329x21
+          text run at (100,4) width 329: " - \"ne\" in \"hi\" should look the same as above."
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/shaping/shaping-selection-rect-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text/shaping/shaping-selection-rect-expected.png
index 3db7ef72..19e17f5 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/shaping/shaping-selection-rect-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/shaping/shaping-selection-rect-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/shaping/shaping-selection-rect-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/text/shaping/shaping-selection-rect-expected.txt
index 331e3bfe..fea3eb9 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/shaping/shaping-selection-rect-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/shaping/shaping-selection-rect-expected.txt
@@ -4,8 +4,8 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x600
     LayoutBlockFlow {BODY} at (8,8) size 784x584
       LayoutBlockFlow {P} at (0,0) size 784x20
-        LayoutText {#text} at (0,0) size 615x19
-          text run at (0,0) width 615: "The selection should cover the all of the below text. There should be no blank between either C and F."
+        LayoutText {#text} at (0,0) size 614x19
+          text run at (0,0) width 614: "The selection should cover the all of the below text. There should be no blank between either C and F."
       LayoutBlockFlow {DIV} at (0,36) size 784x20
         LayoutText {#text} at (0,0) size 32x19
           text run at (0,0) width 32: "ABC"
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/should-use-atsui-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text/should-use-atsui-expected.png
index 350631d..9a46407 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/should-use-atsui-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/should-use-atsui-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/should-use-atsui-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/text/should-use-atsui-expected.txt
index 95abf48..df196b37 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/should-use-atsui-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/should-use-atsui-expected.txt
@@ -4,17 +4,17 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x600
     LayoutBlockFlow {BODY} at (8,8) size 784x584
       LayoutBlockFlow {P} at (0,0) size 784x40
-        LayoutText {#text} at (0,0) size 51x19
-          text run at (0,0) width 51: "Test for "
-        LayoutInline {I} at (0,0) size 743x39
-          LayoutText {#text} at (51,0) size 743x39
-            text run at (51,0) width 692: "http://bugzilla.opendarwin.org/show_bug.cgi?id=6132 Incorrect selection highlighting for ATSUI text when"
+        LayoutText {#text} at (0,0) size 50x19
+          text run at (0,0) width 50: "Test for "
+        LayoutInline {I} at (0,0) size 741x39
+          LayoutText {#text} at (49,0) size 741x39
+            text run at (49,0) width 692: "http://bugzilla.opendarwin.org/show_bug.cgi?id=6132 Incorrect selection highlighting for ATSUI text when"
             text run at (0,20) width 180: "selected range is \"CG-safe\""
         LayoutText {#text} at (180,20) size 4x19
           text run at (180,20) width 4: "."
       LayoutBlockFlow {P} at (0,56) size 784x20
-        LayoutText {#text} at (0,0) size 664x19
-          text run at (0,0) width 664: "The word \x{201C}dolor\x{201D} below should be highlighted in its entirety. The highlight should not extend beyond that word."
+        LayoutText {#text} at (0,0) size 663x19
+          text run at (0,0) width 663: "The word \x{201C}dolor\x{201D} below should be highlighted in its entirety. The highlight should not extend beyond that word."
       LayoutBlockFlow {HR} at (0,92) size 784x2 [border: (1px inset #EEEEEE)]
       LayoutBlockFlow (anonymous) at (0,102) size 784x20
         LayoutInline {SPAN} at (0,0) size 165x19
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/small-caps-turkish-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text/small-caps-turkish-expected.png
index 13b48ccc..9a404c702 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/small-caps-turkish-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/small-caps-turkish-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/small-caps-turkish-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/text/small-caps-turkish-expected.txt
index 97f164a..56fb216 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/small-caps-turkish-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/small-caps-turkish-expected.txt
@@ -22,11 +22,11 @@
       LayoutBlockFlow {P} at (0,72) size 784x20
         LayoutText {#text} at (0,0) size 85x19
           text run at (0,0) width 85: "locale=tr-TR: "
-        LayoutInline {SPAN} at (0,0) size 42x19
-          LayoutText {#text} at (85,0) size 42x19
-            text run at (85,0) width 42: "Isi\x{130} \x{130}s\x{131}I"
-        LayoutText {#text} at (127,0) size 7x19
-          text run at (127,0) width 7: " :"
+        LayoutInline {SPAN} at (0,0) size 43x19
+          LayoutText {#text} at (84,0) size 43x19
+            text run at (84,0) width 43: "Isi\x{130} \x{130}s\x{131}I"
+        LayoutText {#text} at (126,0) size 8x19
+          text run at (126,0) width 8: " :"
       LayoutBlockFlow {P} at (0,108) size 784x20
         LayoutText {#text} at (0,0) size 124x19
           text run at (0,0) width 124: "locale=tr@foo=bar: "
@@ -70,11 +70,11 @@
       LayoutBlockFlow {P} at (0,288) size 784x20
         LayoutText {#text} at (0,0) size 86x19
           text run at (0,0) width 86: "locale=tr-US: "
-        LayoutInline {SPAN} at (0,0) size 42x19
-          LayoutText {#text} at (86,0) size 42x19
-            text run at (86,0) width 42: "Isi\x{130} \x{130}s\x{131}I"
-        LayoutText {#text} at (128,0) size 7x19
-          text run at (128,0) width 7: " :"
+        LayoutInline {SPAN} at (0,0) size 43x19
+          LayoutText {#text} at (85,0) size 43x19
+            text run at (85,0) width 43: "Isi\x{130} \x{130}s\x{131}I"
+        LayoutText {#text} at (127,0) size 8x19
+          text run at (127,0) width 8: " :"
       LayoutBlockFlow {P} at (0,324) size 784x20
         LayoutText {#text} at (0,0) size 70x19
           text run at (0,0) width 70: "locale=TR: "
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/soft-hyphen-3-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text/soft-hyphen-3-expected.png
index aed6f3f..8f09d42 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/soft-hyphen-3-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/soft-hyphen-3-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/soft-hyphen-3-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/text/soft-hyphen-3-expected.txt
new file mode 100644
index 0000000..cb20080
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/soft-hyphen-3-expected.txt
@@ -0,0 +1,13 @@
+layer at (0,0) size 800x600
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  LayoutBlockFlow {HTML} at (0,0) size 800x600
+    LayoutBlockFlow {BODY} at (8,8) size 784x584
+      LayoutBlockFlow {DIV} at (0,0) size 225x72 [color=#FFFFFF]
+        LayoutText {#text} at (0,12) size 100x25
+          text run at (0,12) width 100: "Did \x{AD}"
+        LayoutInline {SPAN} at (0,0) size 75x25 [color=#008000]
+          LayoutText {#text} at (100,12) size 75x25
+            text run at (100,12) width 75: "not"
+        LayoutText {#text} at (0,47) size 100x25
+          text run at (0,47) width 100: "fail"
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/softHyphen-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text/softHyphen-expected.png
index aab16f7..203f498 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/softHyphen-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/softHyphen-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/softHyphen-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/text/softHyphen-expected.txt
index 8febd2f2..9799b8d 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/softHyphen-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/softHyphen-expected.txt
@@ -1,8 +1,8 @@
-layer at (0,0) size 800x600 clip at (0,0) size 785x600 scrollHeight 1050
+layer at (0,0) size 800x600 clip at (0,0) size 785x600 scrollHeight 1080
   LayoutView at (0,0) size 800x600
-layer at (0,0) size 785x1050 backgroundClip at (0,0) size 785x600 clip at (0,0) size 785x600
-  LayoutBlockFlow {HTML} at (0,0) size 785x1050
-    LayoutBlockFlow {BODY} at (8,16) size 769x1018
+layer at (0,0) size 785x1080 backgroundClip at (0,0) size 785x600 clip at (0,0) size 785x600
+  LayoutBlockFlow {HTML} at (0,0) size 785x1080
+    LayoutBlockFlow {BODY} at (8,16) size 769x1048
       LayoutBlockFlow {P} at (0,0) size 769x20
         LayoutText {#text} at (0,0) size 403x19
           text run at (0,0) width 403: "In all of the following, there should not be a hyphen before \x{201C}lorem\x{201D}."
@@ -96,53 +96,53 @@
       LayoutBlockFlow {P} at (0,562) size 769x20
         LayoutText {#text} at (0,0) size 57x19
           text run at (0,0) width 57: "Do\x{AD} \x{AD}lorem"
-      LayoutBlockFlow {P} at (0,598) size 769x20
-        LayoutText {#text} at (0,0) size 57x19
-          text run at (0,0) width 23: "Do "
-          text run at (23,0) width 34: "\x{AD}lorem"
-      LayoutBlockFlow {P} at (0,634) size 769x20
+      LayoutBlockFlow {P} at (0,598) size 769x30
+        LayoutText {#text} at (0,6) size 57x19
+          text run at (0,6) width 23: "Do "
+          text run at (23,6) width 34: "\x{AD}lorem"
+      LayoutBlockFlow {P} at (0,644) size 769x20
         LayoutText {#text} at (0,0) size 57x19
           text run at (0,0) width 23: "Do\x{AD} "
           text run at (23,0) width 34: "lorem"
-      LayoutBlockFlow {P} at (0,670) size 769x20
-        LayoutText {#text} at (0,0) size 61x19
-          text run at (0,0) width 27: "Do \x{AD} "
-          text run at (27,0) width 34: "lorem"
-      LayoutBlockFlow {P} at (0,706) size 769x20
-        LayoutText {#text} at (0,0) size 61x19
-          text run at (0,0) width 23: "Do "
-          text run at (23,0) width 38: "\x{AD} lorem"
-      LayoutBlockFlow {P} at (0,742) size 769x20
+      LayoutBlockFlow {P} at (0,680) size 769x30
+        LayoutText {#text} at (0,6) size 61x19
+          text run at (0,6) width 27: "Do \x{AD} "
+          text run at (27,6) width 34: "lorem"
+      LayoutBlockFlow {P} at (0,726) size 769x30
+        LayoutText {#text} at (0,6) size 61x19
+          text run at (0,6) width 23: "Do "
+          text run at (23,6) width 38: "\x{AD} lorem"
+      LayoutBlockFlow {P} at (0,772) size 769x20
         LayoutText {#text} at (0,0) size 19x19
           text run at (0,0) width 19: "Do"
         LayoutInline {SPAN} at (0,0) size 0x19
         LayoutText {#text} at (19,0) size 73x19
           text run at (19,0) width 73: "\x{AD}lorem ipsum"
-      LayoutBlockFlow {P} at (0,778) size 769x20
+      LayoutBlockFlow {P} at (0,808) size 769x20
         LayoutText {#text} at (0,0) size 92x19
           text run at (0,0) width 92: "Do\x{AD}\x{AD}lorem ipsum"
-      LayoutBlockFlow {P} at (0,814) size 769x20
+      LayoutBlockFlow {P} at (0,844) size 769x20
         LayoutInline {SPAN} at (0,0) size 19x19
           LayoutText {#text} at (0,0) size 19x19
             text run at (0,0) width 19: "Do\x{AD}"
         LayoutText {#text} at (19,0) size 73x19
           text run at (19,0) width 73: "\x{AD}lorem ipsum"
-      LayoutBlockFlow {P} at (0,850) size 769x20
+      LayoutBlockFlow {P} at (0,880) size 769x20
         LayoutText {#text} at (0,0) size 19x19
           text run at (0,0) width 19: "Do\x{AD}"
         LayoutInline {SPAN} at (0,0) size 73x19
           LayoutText {#text} at (19,0) size 73x19
             text run at (19,0) width 73: "\x{AD}lorem ipsum"
-      LayoutBlockFlow {P} at (0,886) size 769x20
+      LayoutBlockFlow {P} at (0,916) size 769x20
         LayoutInline {SPAN} at (0,0) size 19x19
           LayoutText {#text} at (0,0) size 19x19
             text run at (0,0) width 19: "Do\x{AD}\x{AD}"
         LayoutText {#text} at (19,0) size 73x19
           text run at (19,0) width 73: "lorem ipsum"
-      LayoutBlockFlow {P} at (0,922) size 769x20
+      LayoutBlockFlow {P} at (0,952) size 769x20
         LayoutText {#text} at (0,0) size 230x19
           text run at (0,0) width 230: "The following pair should be the same:"
-      LayoutBlockFlow {P} at (0,958) size 769x22
+      LayoutBlockFlow {P} at (0,988) size 769x22
         LayoutText {#text} at (0,1) size 15x19
           text run at (0,1) width 15: "W"
         LayoutBlockFlow {SPAN} at (15,0) size 13x22 [border: (1px solid #FF0000)]
@@ -150,7 +150,7 @@
             text run at (1,1) width 11: "X"
         LayoutText {#text} at (28,1) size 11x19
           text run at (28,1) width 11: "Y"
-      LayoutBlockFlow {P} at (0,996) size 769x22
+      LayoutBlockFlow {P} at (0,1026) size 769x22
         LayoutText {#text} at (0,1) size 15x19
           text run at (0,1) width 15: "W"
         LayoutBlockFlow {SPAN} at (15,0) size 13x22 [border: (1px solid #FF0000)]
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/stroking-decorations-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text/stroking-decorations-expected.png
index 8a592e30..7e4cb50b 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/stroking-decorations-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/stroking-decorations-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/stroking-decorations-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/text/stroking-decorations-expected.txt
index 8ada237..3d2d7bfb 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/stroking-decorations-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/stroking-decorations-expected.txt
@@ -14,4 +14,4 @@
       LayoutBlockFlow {DIV} at (0,304) size 784x152 [textFillColor=#0000FF] [textStrokeWidth=1.33]
         LayoutText {#text} at (0,1) size 593x149
           text run at (0,1) width 593: "No stroke, blue fill, red"
-          text run at (0,77) width 592: "shadow, blue underline"
+          text run at (0,77) width 588: "shadow, blue underline"
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/stroking-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text/stroking-expected.png
index d2c41fbc..dced0ffd 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/stroking-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/stroking-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/stroking-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/text/stroking-expected.txt
index edb953e..07d43cb1 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/stroking-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/stroking-expected.txt
@@ -13,4 +13,4 @@
       LayoutBlockFlow {DIV} at (0,228) size 784x152 [textStrokeColor=#0000FF] [textStrokeWidth=1.33]
         LayoutText {#text} at (0,1) size 589x149
           text run at (0,1) width 589: "Blue stroke, no fill, red"
-          text run at (0,77) width 211: "shadow."
+          text run at (0,77) width 207: "shadow."
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/sub-pixel/text-scaling-pixel-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text/sub-pixel/text-scaling-pixel-expected.png
index 676d7bf17..b368525b 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/sub-pixel/text-scaling-pixel-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/sub-pixel/text-scaling-pixel-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/sub-pixel/text-scaling-pixel-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/text/sub-pixel/text-scaling-pixel-expected.txt
index f3d7047..32d45f4 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/sub-pixel/text-scaling-pixel-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/sub-pixel/text-scaling-pixel-expected.txt
@@ -5,12 +5,12 @@
     LayoutBlockFlow {BODY} at (8,8) size 784x1337
       LayoutBlockFlow {SECTION} at (0,0) size 785.55x1321
         LayoutBlockFlow {H1} at (0,0) size 785.55x27
-          LayoutText {#text} at (0,0) size 283x26
-            text run at (0,0) width 283: "Font Size Scaling Pixel Test"
+          LayoutText {#text} at (0,0) size 281x26
+            text run at (0,0) width 281: "Font Size Scaling Pixel Test"
         LayoutBlockFlow {P} at (0,31) size 785.55x20
-          LayoutText {#text} at (0,0) size 768x19
-            text run at (0,0) width 251: "Size of the text should scale smoothly. "
-            text run at (250,0) width 518: "Reported width should be within 0.02px of that of the highlighted reference row."
+          LayoutText {#text} at (0,0) size 766x19
+            text run at (0,0) width 250: "Size of the text should scale smoothly. "
+            text run at (249,0) width 517: "Reported width should be within 0.02px of that of the highlighted reference row."
         LayoutBlockFlow {DIV} at (0,55) size 785.55x1266
           LayoutBlockFlow {DIV} at (0,0) size 785.55x14 [border: none (1px solid #000000) none]
             LayoutBlockFlow {DIV} at (0,0) size 65x13
@@ -94,8 +94,8 @@
                 text run at (260,0) width 229: "Amazingly few discotheques provide jukeboxes."
           LayoutBlockFlow {DIV} at (0,68) size 785.55x14
             LayoutBlockFlow {DIV} at (0,1) size 65x13
-              LayoutText {#text} at (34,0) size 26x13
-                text run at (34,0) width 26: "11.00"
+              LayoutText {#text} at (35,0) size 25x13
+                text run at (35,0) width 25: "11.00"
             LayoutBlockFlow {DIV} at (65,1) size 65x13
               LayoutText {#text} at (29,0) size 31x13
                 text run at (29,0) width 31: "233.56"
@@ -110,8 +110,8 @@
                 text run at (260,0) width 234: "Amazingly few discotheques provide jukeboxes."
           LayoutBlockFlow {DIV} at (0,82) size 785.55x14
             LayoutBlockFlow {DIV} at (0,1) size 65x13
-              LayoutText {#text} at (34,0) size 26x13
-                text run at (34,0) width 26: "11.25"
+              LayoutText {#text} at (35,0) size 25x13
+                text run at (35,0) width 25: "11.25"
             LayoutBlockFlow {DIV} at (65,1) size 65x13
               LayoutText {#text} at (29,0) size 31x13
                 text run at (29,0) width 31: "238.88"
@@ -126,8 +126,8 @@
                 text run at (260,0) width 239: "Amazingly few discotheques provide jukeboxes."
           LayoutBlockFlow {DIV} at (0,96) size 785.55x15
             LayoutBlockFlow {DIV} at (0,2) size 65x13
-              LayoutText {#text} at (34,0) size 26x13
-                text run at (34,0) width 26: "11.50"
+              LayoutText {#text} at (35,0) size 25x13
+                text run at (35,0) width 25: "11.50"
             LayoutBlockFlow {DIV} at (65,2) size 65x13
               LayoutText {#text} at (29,0) size 31x13
                 text run at (29,0) width 31: "244.19"
@@ -142,8 +142,8 @@
                 text run at (260,0) width 245: "Amazingly few discotheques provide jukeboxes."
           LayoutBlockFlow {DIV} at (0,111) size 785.55x15
             LayoutBlockFlow {DIV} at (0,2) size 65x13
-              LayoutText {#text} at (34,0) size 26x13
-                text run at (34,0) width 26: "11.75"
+              LayoutText {#text} at (35,0) size 25x13
+                text run at (35,0) width 25: "11.75"
             LayoutBlockFlow {DIV} at (65,2) size 65x13
               LayoutText {#text} at (29,0) size 31x13
                 text run at (29,0) width 31: "249.48"
@@ -177,8 +177,8 @@
               LayoutText {#text} at (34,0) size 26x13
                 text run at (34,0) width 26: "12.25"
             LayoutBlockFlow {DIV} at (65,2) size 65x13
-              LayoutText {#text} at (29,0) size 31x13
-                text run at (29,0) width 31: "260.11"
+              LayoutText {#text} at (30,0) size 30x13
+                text run at (30,0) width 30: "260.11"
             LayoutBlockFlow {DIV} at (130,2) size 65x13
               LayoutText {#text} at (29,0) size 31x13
                 text run at (29,0) width 31: "254.80"
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/text-letter-spacing-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text/text-letter-spacing-expected.png
index 08f3ddd..aa5adfc4 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/text-letter-spacing-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/text-letter-spacing-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/text-letter-spacing-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/text/text-letter-spacing-expected.txt
index 1fbdd7b9..2866cdd 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/text-letter-spacing-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/text-letter-spacing-expected.txt
@@ -4,11 +4,11 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x1800
     LayoutBlockFlow {BODY} at (8,16) size 784x1768
       LayoutBlockFlow {P} at (0,0) size 784x80 [bgcolor=#FFFFFF]
-        LayoutText {#text} at (0,0) size 767x79
-          text run at (0,0) width 767: "The following lines test various combinations of letter-spacing (especially negative values) and opacity. All of the lines should say"
+        LayoutText {#text} at (0,0) size 766x79
+          text run at (0,0) width 766: "The following lines test various combinations of letter-spacing (especially negative values) and opacity. All of the lines should say"
           text run at (0,20) width 757: "\"Hello, world\" but the spacing and background shading will vary from test to test. The W3C specs are fairly silent on how user"
           text run at (0,40) width 754: "agents should handle unusual values of letter-spacing, especially negative ones, which are explicitly implementation-dependent."
-          text run at (0,60) width 632: "Different browsers will render these differently, but hopefully the WebKit ports will be consistent, at least."
+          text run at (0,60) width 630: "Different browsers will render these differently, but hopefully the WebKit ports will be consistent, at least."
       LayoutBlockFlow {P} at (0,96) size 784x20 [bgcolor=#FFFFFF]
         LayoutText {#text} at (0,0) size 241x19
           text run at (0,0) width 241: "The first line should be normally spaced."
@@ -24,9 +24,9 @@
           LayoutText {#text} at (160,0) size 171x19
             text run at (160,0) width 171: "Hello, world"
       LayoutBlockFlow {P} at (0,240) size 784x40 [bgcolor=#FFFFFF]
-        LayoutText {#text} at (0,0) size 780x39
-          text run at (0,0) width 765: "The next line tests a large positive letter spacing, and should be *very* spaced out. You may only see an 'H' and a 'w', perhaps "
-          text run at (765,0) width 15: "on"
+        LayoutText {#text} at (0,0) size 779x39
+          text run at (0,0) width 764: "The next line tests a large positive letter spacing, and should be *very* spaced out. You may only see an 'H' and a 'w', perhaps "
+          text run at (763,0) width 16: "on"
           text run at (0,20) width 313: "two different lines, unless you scroll way to the right."
       LayoutBlockFlow {P} at (0,296) size 784x40 [bgcolor=#EEEEEE]
         LayoutInline {SPAN} at (0,0) size 19396x39
@@ -34,8 +34,8 @@
             text run at (160,0) width 19236: "Hello,"
             text run at (0,20) width 16035: "world"
       LayoutBlockFlow {P} at (0,352) size 784x40 [bgcolor=#FFFFFF]
-        LayoutText {#text} at (0,0) size 767x39
-          text run at (0,0) width 767: "The next line tests a very large positive letter spacing, and should also be *very* spaced out. You may only see an 'H' and a 'w',"
+        LayoutText {#text} at (0,0) size 766x39
+          text run at (0,0) width 766: "The next line tests a very large positive letter spacing, and should also be *very* spaced out. You may only see an 'H' and a 'w',"
           text run at (0,20) width 384: "perhaps on two different lines, unless you scroll way to the right."
       LayoutBlockFlow {P} at (0,408) size 784x40 [bgcolor=#EEEEEE]
         LayoutInline {SPAN} at (0,0) size 9600196x39
@@ -64,9 +64,9 @@
           LayoutText {#text} at (160,0) size 0x19
             text run at (160,0) width 0: "Hello, world"
       LayoutBlockFlow {P} at (0,680) size 784x40 [bgcolor=#FFFFFF]
-        LayoutText {#text} at (0,0) size 723x39
-          text run at (0,0) width 671: "The next few lines test the interaction with opacity. The first line should be normally spaced out, slightly opaque, "
-          text run at (671,0) width 52: "and on a"
+        LayoutText {#text} at (0,0) size 722x39
+          text run at (0,0) width 670: "The next few lines test the interaction with opacity. The first line should be normally spaced out, slightly opaque, "
+          text run at (669,0) width 53: "and on a"
           text run at (0,20) width 187: "differently-colored background"
       LayoutBlockFlow {P} at (0,736) size 784x20 [bgcolor=#EEEEEE]
       LayoutBlockFlow {P} at (0,772) size 784x20 [bgcolor=#FFFFFF]
@@ -81,7 +81,7 @@
       LayoutBlockFlow {P} at (0,936) size 784x20 [bgcolor=#FFFFFF]
         LayoutText {#text} at (0,0) size 716x19
           text run at (0,0) width 312: "The next line tests a very large positive line spacing, "
-          text run at (312,0) width 404: "and should be very widely spaced but blank, and on a background."
+          text run at (311,0) width 405: "and should be very widely spaced but blank, and on a background."
       LayoutBlockFlow {P} at (0,972) size 784x40 [bgcolor=#EEEEEE]
       LayoutBlockFlow {P} at (0,1028) size 784x20 [bgcolor=#FFFFFF]
         LayoutText {#text} at (0,0) size 411x19
@@ -123,16 +123,16 @@
       LayoutBlockFlow {P} at (0,1496) size 784x20 [bgcolor=#FFFFFF]
         LayoutText {#text} at (0,0) size 435x19
           text run at (0,0) width 311: "The next line tests a large negative line spacing, and "
-          text run at (311,0) width 124: "should just print a 'd'"
+          text run at (310,0) width 125: "should just print a 'd'"
       LayoutBlockFlow {P} at (0,1532) size 784x20 [bgcolor=#EEEEEE]
         LayoutInline {SPAN} at (0,0) size 0x19
           LayoutText {#text} at (160,0) size 0x19
             text run at (160,0) width 0 RTL override: "Hello, world"
       LayoutBlockFlow {P} at (0,1568) size 784x20 [bgcolor=#FFFFFF]
-        LayoutText {#text} at (0,0) size 774x19
-          text run at (0,0) width 142: "Now, opacity as well - "
-          text run at (142,0) width 374: "The next line should be printed right to left, slightly spaced out "
-          text run at (516,0) width 258: "(wider than normal), and on a background."
+        LayoutText {#text} at (0,0) size 773x19
+          text run at (0,0) width 141: "Now, opacity as well - "
+          text run at (140,0) width 375: "The next line should be printed right to left, slightly spaced out "
+          text run at (514,0) width 259: "(wider than normal), and on a background."
       LayoutBlockFlow {P} at (0,1604) size 784x20 [bgcolor=#EEEEEE]
       LayoutBlockFlow {P} at (0,1640) size 784x20 [bgcolor=#FFFFFF]
         LayoutText {#text} at (0,0) size 411x19
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/text-shadow-no-default-color-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text/text-shadow-no-default-color-expected.png
index 7c6dd8a2..2f9b1548 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/text-shadow-no-default-color-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/text-shadow-no-default-color-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/text-shadow-no-default-color-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/text/text-shadow-no-default-color-expected.txt
index 5492d64..ef0bfc8d 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/text-shadow-no-default-color-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/text-shadow-no-default-color-expected.txt
@@ -4,8 +4,8 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x600
     LayoutBlockFlow {BODY} at (8,8) size 784x567
       LayoutBlockFlow {P} at (0,0) size 784x20
-        LayoutText {#text} at (0,0) size 344x19
-          text run at (0,0) width 344: "Test passes if there are two green rectangles on the page."
+        LayoutText {#text} at (0,0) size 343x19
+          text run at (0,0) width 343: "Test passes if there are two green rectangles on the page."
       LayoutBlockFlow {DIV} at (25,45) size 734x30 [color=#008000]
         LayoutText {#text} at (0,0) size 300x30
           text run at (0,0) width 300: "FillerText"
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/wbr-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text/wbr-expected.png
index 6dc2e6d..e689a15 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/wbr-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/wbr-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/wbr-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/text/wbr-expected.txt
index eaf993e..d606751 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/wbr-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/wbr-expected.txt
@@ -4,8 +4,8 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x846
     LayoutBlockFlow {BODY} at (8,8) size 784x828
       LayoutBlockFlow {P} at (0,0) size 784x20
-        LayoutText {#text} at (0,0) size 167x19
-          text run at (0,0) width 167: "Two words with no spaces."
+        LayoutText {#text} at (0,0) size 166x19
+          text run at (0,0) width 166: "Two words with no spaces."
       LayoutBlockFlow {DIV} at (0,36) size 302x22 [border: (1px solid #0000FF)]
         LayoutText {#text} at (1,1) size 480x19
           text run at (1,1) width 480: "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/wbr-in-pre-crash-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text/wbr-in-pre-crash-expected.png
index b9f2f0b..5b0bfef 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/wbr-in-pre-crash-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/wbr-in-pre-crash-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/wbr-in-pre-crash-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/text/wbr-in-pre-crash-expected.txt
index e029961..853c1c1 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/wbr-in-pre-crash-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/wbr-in-pre-crash-expected.txt
@@ -4,18 +4,18 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x600
     LayoutBlockFlow {BODY} at (8,8) size 784x584
       LayoutBlockFlow {P} at (0,0) size 784x40
-        LayoutText {#text} at (0,0) size 51x19
-          text run at (0,0) width 51: "Test for "
-        LayoutInline {I} at (0,0) size 767x39
-          LayoutInline {A} at (0,0) size 305x19 [color=#0000EE]
-            LayoutText {#text} at (51,0) size 305x19
-              text run at (51,0) width 305: "http://bugs.webkit.org/show_bug.cgi?id=17464"
-          LayoutText {#text} at (356,0) size 767x39
-            text run at (356,0) width 4: " "
-            text run at (360,0) width 407: "REGRESSION: Crash in LayoutBlockFlow::findNextLineBreak"
+        LayoutText {#text} at (0,0) size 50x19
+          text run at (0,0) width 50: "Test for "
+        LayoutInline {I} at (0,0) size 765x39
+          LayoutInline {A} at (0,0) size 306x19 [color=#0000EE]
+            LayoutText {#text} at (49,0) size 306x19
+              text run at (49,0) width 306: "http://bugs.webkit.org/show_bug.cgi?id=17464"
+          LayoutText {#text} at (354,0) size 765x39
+            text run at (354,0) width 5: " "
+            text run at (358,0) width 407: "REGRESSION: Crash in LayoutBlockFlow::findNextLineBreak"
             text run at (0,20) width 251: "reading r30444 commit email in GMail"
-        LayoutText {#text} at (251,20) size 4x19
-          text run at (251,20) width 4: "."
+        LayoutText {#text} at (250,20) size 5x19
+          text run at (250,20) width 5: "."
       LayoutBlockFlow {P} at (0,56) size 784x20
         LayoutText {#text} at (0,0) size 152x19
           text run at (0,0) width 152: "No crash means success."
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/wbr-styled-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text/wbr-styled-expected.png
index 7bcdfec..e43666b 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/wbr-styled-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/wbr-styled-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/wbr-styled-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/text/wbr-styled-expected.txt
index c0842ed..e15ecc9 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/wbr-styled-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/wbr-styled-expected.txt
@@ -19,8 +19,8 @@
         LayoutInline {TT} at (0,0) size 64x16
           LayoutText {#text} at (480,3) size 64x16
             text run at (480,3) width 64: "absolute"
-        LayoutText {#text} at (544,0) size 149x19
-          text run at (544,0) width 149: " does not crash WebKit."
+        LayoutText {#text} at (544,0) size 148x19
+          text run at (544,0) width 148: " does not crash WebKit."
       LayoutBlockFlow {P} at (0,36) size 784x20
         LayoutText {#text} at (0,0) size 120x19
           text run at (0,0) width 120: "There should be no "
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/webfont-synthetic-bold-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text/webfont-synthetic-bold-expected.png
index e9ba2b2..796f40c2 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/webfont-synthetic-bold-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/webfont-synthetic-bold-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/webfont-synthetic-bold-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/text/webfont-synthetic-bold-expected.txt
index 3a25e10..fd6a31d 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/webfont-synthetic-bold-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/webfont-synthetic-bold-expected.txt
@@ -13,7 +13,7 @@
           LayoutInline {B} at (0,0) size 154x22
             LayoutText {#text} at (32,0) size 154x22
               text run at (32,0) width 154: "bold part of this text"
-          LayoutText {#text} at (186,0) size 753x44
-            text run at (186,0) width 272: " as well as the header above should "
-            text run at (458,0) width 295: "not be rendered nice and crisp without"
+          LayoutText {#text} at (185,0) size 752x44
+            text run at (185,0) width 273: " as well as the header above should "
+            text run at (457,0) width 295: "not be rendered nice and crisp without"
             text run at (0,22) width 146: "being overly blurry."
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/003-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/003-expected.png
index affd143..6fbd0af 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/003-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/003-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/003-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/003-expected.txt
index e6a0bf6..ece7651 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/003-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/003-expected.txt
@@ -9,8 +9,8 @@
             text run at (0,2) width 528: "Ahem_font_required_for_this_test."
         LayoutText {#text} at (0,0) size 0x0
       LayoutBlockFlow {P} at (0,36) size 784x20
-        LayoutText {#text} at (0,0) size 608x19
-          text run at (0,0) width 608: "There should be three columns below, dark green, light green, and dark green, with no red anywhere."
+        LayoutText {#text} at (0,0) size 607x19
+          text run at (0,0) width 607: "There should be three columns below, dark green, light green, and dark green, with no red anywhere."
       LayoutTable {TABLE} at (0,72) size 66x126 [border: (3px solid #000000)]
         LayoutTableSection {TBODY} at (3,3) size 60x120
           LayoutTableRow {TR} at (0,0) size 60x120
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/004-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/004-expected.png
index eaa4acd..c253ddf 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/004-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/004-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/004-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/004-expected.txt
index 3c8c46b..257f36c 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/004-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/004-expected.txt
@@ -9,8 +9,8 @@
             text run at (0,2) width 528: "Ahem_font_required_for_this_test."
         LayoutText {#text} at (0,0) size 0x0
       LayoutBlockFlow {P} at (0,36) size 784x20
-        LayoutText {#text} at (0,0) size 421x19
-          text run at (0,0) width 421: "There should be no red below, only a green square bordered in green."
+        LayoutText {#text} at (0,0) size 420x19
+          text run at (0,0) width 420: "There should be no red below, only a green square bordered in green."
       LayoutTable {TABLE} at (0,72) size 104x104
         LayoutTableSection {TBODY} at (0,0) size 104x104
           LayoutTableRow {TR} at (0,2) size 104x100
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/005-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/005-expected.png
index eaa4acd..c253ddf 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/005-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/005-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/005-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/005-expected.txt
index d1c599dc..fba7223 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/005-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/005-expected.txt
@@ -9,8 +9,8 @@
             text run at (0,2) width 528: "Ahem_font_required_for_this_test."
         LayoutText {#text} at (0,0) size 0x0
       LayoutBlockFlow {P} at (0,36) size 784x20
-        LayoutText {#text} at (0,0) size 421x19
-          text run at (0,0) width 421: "There should be no red below, only a green square bordered in green."
+        LayoutText {#text} at (0,0) size 420x19
+          text run at (0,0) width 420: "There should be no red below, only a green square bordered in green."
       LayoutTable {TABLE} at (0,72) size 104x104
         LayoutTableSection {TBODY} at (0,0) size 104x104
           LayoutTableRow {TR} at (0,2) size 104x100
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/006-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/006-expected.png
index 0147614..a68209b 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/006-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/006-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/006-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/006-expected.txt
index 0e387b11..8aa5ead5 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/006-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/006-expected.txt
@@ -9,8 +9,8 @@
             text run at (16,2) width 528: "Ahem_font_required_for_this_test."
         LayoutText {#text} at (0,0) size 0x0
       LayoutBlockFlow {P} at (0,36) size 784x20
-        LayoutText {#text} at (0,0) size 471x19
-          text run at (0,0) width 471: "There should be no red below, only three identical striped green and lime bars."
+        LayoutText {#text} at (0,0) size 470x19
+          text run at (0,0) width 470: "There should be no red below, only three identical striped green and lime bars."
       LayoutBlockFlow {DIV} at (20,76) size 744x20
         LayoutInline {SPAN} at (0,0) size 220x20 [color=#800000] [bgcolor=#FF0000]
           LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/007-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/007-expected.png
index ed1e221..e5adcc9 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/007-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/007-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/007-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/007-expected.txt
index e1ac76e..43ea90d 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/007-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/007-expected.txt
@@ -9,8 +9,8 @@
             text run at (16,2) width 528: "Ahem_font_required_for_this_test."
         LayoutText {#text} at (0,0) size 0x0
       LayoutBlockFlow {P} at (0,36) size 784x20
-        LayoutText {#text} at (0,0) size 464x19
-          text run at (0,0) width 464: "There should be no red below, only two identical striped green and lime bars."
+        LayoutText {#text} at (0,0) size 463x19
+          text run at (0,0) width 463: "There should be no red below, only two identical striped green and lime bars."
       LayoutBlockFlow {DIV} at (20,76) size 744x20
         LayoutInline {SPAN} at (0,0) size 220x20 [color=#800000] [bgcolor=#FF0000]
           LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/008-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/008-expected.png
index 55b6746c..c5f250d 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/008-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/008-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/008-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/008-expected.txt
index 7a557cf3..a11aad03 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/008-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/008-expected.txt
@@ -9,8 +9,8 @@
             text run at (16,2) width 528: "Ahem_font_required_for_this_test."
         LayoutText {#text} at (0,0) size 0x0
       LayoutBlockFlow {P} at (0,36) size 784x20
-        LayoutText {#text} at (0,0) size 275x19
-          text run at (0,0) width 275: "There should be a green block below, no red."
+        LayoutText {#text} at (0,0) size 274x19
+          text run at (0,0) width 274: "There should be a green block below, no red."
       LayoutBlockFlow {DIV} at (20,76) size 80x40 [color=#008000] [bgcolor=#FF0000]
         LayoutText {#text} at (0,0) size 80x40
           text run at (0,0) width 80: "xxxx"
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/009-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/009-expected.png
index ec31c8b..75eb130 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/009-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/009-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/009-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/009-expected.txt
index 5ed455e..24f9923 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/009-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/009-expected.txt
@@ -9,8 +9,8 @@
             text run at (0,2) width 528: "Ahem_font_required_for_this_test."
         LayoutText {#text} at (0,0) size 0x0
       LayoutBlockFlow {P} at (0,36) size 784x20
-        LayoutText {#text} at (0,0) size 427x19
-          text run at (0,0) width 427: "There should be no red below, only a lime line with a green square in it."
+        LayoutText {#text} at (0,0) size 426x19
+          text run at (0,0) width 426: "There should be no red below, only a lime line with a green square in it."
       LayoutBlockFlow {DIV} at (0,72) size 784x20
         LayoutBlockFlow {DIV} at (0,0) size 200x20 [bgcolor=#FF0000]
           LayoutBlockFlow {DIV} at (0,0) size 140x20 [color=#00FF00] [bgcolor=#008000]
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/010-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/010-expected.png
index eaa4acd..c253ddf 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/010-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/010-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/010-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/010-expected.txt
index 3c8c46b..257f36c 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/010-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/010-expected.txt
@@ -9,8 +9,8 @@
             text run at (0,2) width 528: "Ahem_font_required_for_this_test."
         LayoutText {#text} at (0,0) size 0x0
       LayoutBlockFlow {P} at (0,36) size 784x20
-        LayoutText {#text} at (0,0) size 421x19
-          text run at (0,0) width 421: "There should be no red below, only a green square bordered in green."
+        LayoutText {#text} at (0,0) size 420x19
+          text run at (0,0) width 420: "There should be no red below, only a green square bordered in green."
       LayoutTable {TABLE} at (0,72) size 104x104
         LayoutTableSection {TBODY} at (0,0) size 104x104
           LayoutTableRow {TR} at (0,2) size 104x100
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/011-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/011-expected.png
index eaa4acd..c253ddf 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/011-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/011-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/011-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/011-expected.txt
index d1c599dc..fba7223 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/011-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/011-expected.txt
@@ -9,8 +9,8 @@
             text run at (0,2) width 528: "Ahem_font_required_for_this_test."
         LayoutText {#text} at (0,0) size 0x0
       LayoutBlockFlow {P} at (0,36) size 784x20
-        LayoutText {#text} at (0,0) size 421x19
-          text run at (0,0) width 421: "There should be no red below, only a green square bordered in green."
+        LayoutText {#text} at (0,0) size 420x19
+          text run at (0,0) width 420: "There should be no red below, only a green square bordered in green."
       LayoutTable {TABLE} at (0,72) size 104x104
         LayoutTableSection {TBODY} at (0,0) size 104x104
           LayoutTableRow {TR} at (0,2) size 104x100
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/015-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/015-expected.png
index eaa4acd..c253ddf 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/015-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/015-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/015-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/015-expected.txt
index 3c8c46b..257f36c 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/015-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/015-expected.txt
@@ -9,8 +9,8 @@
             text run at (0,2) width 528: "Ahem_font_required_for_this_test."
         LayoutText {#text} at (0,0) size 0x0
       LayoutBlockFlow {P} at (0,36) size 784x20
-        LayoutText {#text} at (0,0) size 421x19
-          text run at (0,0) width 421: "There should be no red below, only a green square bordered in green."
+        LayoutText {#text} at (0,0) size 420x19
+          text run at (0,0) width 420: "There should be no red below, only a green square bordered in green."
       LayoutTable {TABLE} at (0,72) size 104x104
         LayoutTableSection {TBODY} at (0,0) size 104x104
           LayoutTableRow {TR} at (0,2) size 104x100
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/016-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/016-expected.png
index eaa4acd..c253ddf 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/016-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/016-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/016-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/016-expected.txt
index d1c599dc..fba7223 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/016-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/016-expected.txt
@@ -9,8 +9,8 @@
             text run at (0,2) width 528: "Ahem_font_required_for_this_test."
         LayoutText {#text} at (0,0) size 0x0
       LayoutBlockFlow {P} at (0,36) size 784x20
-        LayoutText {#text} at (0,0) size 421x19
-          text run at (0,0) width 421: "There should be no red below, only a green square bordered in green."
+        LayoutText {#text} at (0,0) size 420x19
+          text run at (0,0) width 420: "There should be no red below, only a green square bordered in green."
       LayoutTable {TABLE} at (0,72) size 104x104
         LayoutTableSection {TBODY} at (0,0) size 104x104
           LayoutTableRow {TR} at (0,2) size 104x100
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/018-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/018-expected.png
index 0a7cf57..8896843 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/018-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/018-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/018-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/018-expected.txt
index d938de7..96b03c8 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/018-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/018-expected.txt
@@ -9,8 +9,8 @@
             text run at (0,2) width 528: "Ahem_font_required_for_this_test."
         LayoutText {#text} at (0,0) size 0x0
       LayoutBlockFlow {P} at (0,36) size 784x20
-        LayoutText {#text} at (0,0) size 562x19
-          text run at (0,0) width 562: "There should be a pretty green and lime pattern and the word \"PASS\" in lime on white below."
+        LayoutText {#text} at (0,0) size 560x19
+          text run at (0,0) width 560: "There should be a pretty green and lime pattern and the word \"PASS\" in lime on white below."
       LayoutBlockFlow {DIV} at (0,72) size 304x128 [color=#00FF00] [bgcolor=#008000]
         LayoutText {#text} at (0,0) size 304x32
           text run at (0,0) width 0: " "
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/021-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/021-expected.png
index 9bde548..8a7fe15 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/021-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/021-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/024-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/024-expected.png
index 6faa2814..02e6816 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/024-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/024-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/024-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/024-expected.txt
index 538eb7ee..47e71718 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/024-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/024-expected.txt
@@ -20,8 +20,8 @@
           text run at (245,20) width 423: "uncontained text and a blank line, and there are \"too many\" characters "
           text run at (668,20) width 94: "contained in the"
           text run at (0,40) width 292: "nested element, the PRE width will be too wide. "
-          text run at (292,40) width 418: "In the examples below, the nested element is a SPAN whose content "
-          text run at (710,40) width 31: "is the"
+          text run at (292,40) width 416: "In the examples below, the nested element is a SPAN whose content "
+          text run at (707,40) width 32: "is the"
           text run at (0,60) width 180: "days-of-week line, as follows:"
       LayoutBlockFlow {PRE} at (0,151.44) size 769x16
         LayoutText {#text} at (0,0) size 376x16
@@ -174,6 +174,6 @@
                 text run at (1,1) width 326: "The blank line between '2003' and the nested element "
                 text run at (327,1) width 246: "no longer triggers the width bug, because"
                 text run at (1,21) width 219: "now the '2003' is itself contained by "
-                text run at (220,21) width 281: "a nested element (in this case, another SPAN)."
+                text run at (220,21) width 280: "a nested element (in this case, another SPAN)."
       LayoutBlockFlow (anonymous) at (0,1202.69) size 769x20
         LayoutBR {BR} at (0,0) size 0x19
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/027-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/027-expected.png
index b30b6c0..f6620f1 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/027-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/027-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/027-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/027-expected.txt
index c9feeb7..4e306df 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/027-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/027-expected.txt
@@ -42,15 +42,15 @@
       LayoutTable {TABLE} at (0,460) size 784x72 [border: (2px outset #808080)]
         LayoutTableSection {TBODY} at (2,2) size 780x68
           LayoutTableRow {TR} at (0,2) size 780x64
-            LayoutTableCell {TD} at (2,2) size 541x64 [border: (1px inset #808080)] [r=0 c=0 rs=1 cs=1]
+            LayoutTableCell {TD} at (2,2) size 540x64 [border: (1px inset #808080)] [r=0 c=0 rs=1 cs=1]
               LayoutText {#text} at (2,2) size 125x19
                 text run at (2,2) width 125: "This is a test to see if"
-              LayoutInline {SPAN} at (0,0) size 537x59
-                LayoutText {#text} at (127,2) size 537x59
+              LayoutInline {SPAN} at (0,0) size 536x59
+                LayoutText {#text} at (127,2) size 536x59
                   text run at (127,2) width 97: "this is computed"
                   text run at (224,2) width 0: " "
-                  text run at (2,22) width 537: "correctly.  In particular, we have a really long line here that could throw off the min-width."
-                  text run at (539,22) width 0: " "
+                  text run at (2,22) width 536: "correctly.  In particular, we have a really long line here that could throw off the min-width."
+                  text run at (537,22) width 1: " "
                   text run at (2,42) width 29: "Is it?"
               LayoutText {#text} at (0,0) size 0x0
-            LayoutTableCell {TD} at (545,32) size 233x4 [border: (1px inset #808080)] [r=0 c=1 rs=1 cs=1]
+            LayoutTableCell {TD} at (544,32) size 234x4 [border: (1px inset #808080)] [r=0 c=1 rs=1 cs=1]
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/nbsp-mode-and-linewraps-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/nbsp-mode-and-linewraps-expected.png
index 4e922064..b186682 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/nbsp-mode-and-linewraps-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/nbsp-mode-and-linewraps-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/nbsp-mode-and-linewraps-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/nbsp-mode-and-linewraps-expected.txt
index 95a1dc9..6eae581 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/nbsp-mode-and-linewraps-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/nbsp-mode-and-linewraps-expected.txt
@@ -6,5 +6,5 @@
 layer at (100,8) size 1877x84 backgroundClip at (0,0) size 800x600 clip at (0,0) size 800x600
   LayoutBlockFlow (positioned) {DIV} at (100,8) size 1877x84 [border: (2px solid #FF0000)]
     LayoutText {#text} at (14,14) size 1849x55
-      text run at (14,14) width 1823: "This div is absolutely positioned to the left. All the spaces in this div are replaced with non-breaking spaces, and the nbsp-mode for this div is 'space', so when calculating line breaks, the non-"
+      text run at (14,14) width 1822: "This div is absolutely positioned to the left. All the spaces in this div are replaced with non-breaking spaces, and the nbsp-mode for this div is 'space', so when calculating line breaks, the non-"
       text run at (14,42) width 1849: "breaking spaces should be treated as normal spaces. If this isn't the case, then all the text for this paragraph will be rendered in two lines, and a horizontal scroll bar will appear along the bottom."
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/pre-break-word-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/pre-break-word-expected.png
index c03db83..1573e582 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/pre-break-word-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/pre-break-word-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/pre-break-word-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/pre-break-word-expected.txt
index 20ebb274..f02ed10d 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/pre-break-word-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/pre-break-word-expected.txt
@@ -10,4 +10,4 @@
           text run at (2,42) width 148: "nside should still wrap to"
           text run at (2,62) width 149: " multiple lines because of"
           text run at (2,82) width 150: " the word-wrap:break-w"
-          text run at (2,102) width 114: "ord CSS property."
+          text run at (2,102) width 113: "ord CSS property."
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/pre-wrap-last-char-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/pre-wrap-last-char-expected.png
index d6b1b69..8ec3e6e7 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/pre-wrap-last-char-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/pre-wrap-last-char-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/pre-wrap-last-char-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/pre-wrap-last-char-expected.txt
index 8fbeeb2d..b379dff8 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/pre-wrap-last-char-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/pre-wrap-last-char-expected.txt
@@ -4,18 +4,18 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x600
     LayoutBlockFlow {BODY} at (8,8) size 784x584
       LayoutBlockFlow {P} at (0,0) size 784x40
-        LayoutText {#text} at (0,0) size 51x19
-          text run at (0,0) width 51: "Test for "
-        LayoutInline {I} at (0,0) size 759x39
-          LayoutInline {A} at (0,0) size 305x19 [color=#0000EE]
-            LayoutText {#text} at (51,0) size 305x19
-              text run at (51,0) width 305: "http://bugs.webkit.org/show_bug.cgi?id=13072"
-          LayoutText {#text} at (356,0) size 759x39
-            text run at (356,0) width 4: " "
-            text run at (360,0) width 399: "REGRESSION (r15617): white-space: pre-wrap breaks off the"
-            text run at (0,20) width 189: "last character of a wide word"
-        LayoutText {#text} at (189,20) size 4x19
-          text run at (189,20) width 4: "."
+        LayoutText {#text} at (0,0) size 50x19
+          text run at (0,0) width 50: "Test for "
+        LayoutInline {I} at (0,0) size 784x39
+          LayoutInline {A} at (0,0) size 306x19 [color=#0000EE]
+            LayoutText {#text} at (49,0) size 306x19
+              text run at (49,0) width 306: "http://bugs.webkit.org/show_bug.cgi?id=13072"
+          LayoutText {#text} at (354,0) size 784x39
+            text run at (354,0) width 5: " "
+            text run at (358,0) width 426: "REGRESSION (r15617): white-space: pre-wrap breaks off the last"
+            text run at (0,20) width 162: "character of a wide word"
+        LayoutText {#text} at (161,20) size 5x19
+          text run at (161,20) width 5: "."
       LayoutBlockFlow {P} at (0,56) size 784x20
         LayoutText {#text} at (0,0) size 210x19
           text run at (0,0) width 210: "The following line should not wrap."
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/pre-wrap-line-test-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/pre-wrap-line-test-expected.png
index 7268aa2..eb3ce45 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/pre-wrap-line-test-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/pre-wrap-line-test-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/pre-wrap-line-test-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/pre-wrap-line-test-expected.txt
index 3cc8f343..9638631 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/pre-wrap-line-test-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/pre-wrap-line-test-expected.txt
@@ -9,8 +9,8 @@
             LayoutTableCell {TD} at (2,2) size 780x62 [r=0 c=0 rs=1 cs=1]
               LayoutBlockFlow {DIV} at (1,1) size 778x60
                 LayoutText {#text} at (0,0) size 771x59
-                  text run at (0,0) width 748: "Three cheers    for OldVet and the letter he wrote to Senator Dodd (see above Comment).  We all need to be proactive and"
-                  text run at (748,0) width 4: " "
+                  text run at (0,0) width 745: "Three cheers    for OldVet and the letter he wrote to Senator Dodd (see above Comment).  We all need to be proactive and"
+                  text run at (744,0) width 5: " "
                   text run at (0,20) width 767: "contact our senators and representatives to let them know our strong feelings on this subject.  I would lose what little faith I have"
                   text run at (767,20) width 4: " "
                   text run at (0,40) width 362: "left in our government if they engineered a tax payer bailout. "
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/pre-wrap-overflow-selection-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/pre-wrap-overflow-selection-expected.png
index aa73817..8c43391 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/pre-wrap-overflow-selection-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/pre-wrap-overflow-selection-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/pre-wrap-overflow-selection-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/pre-wrap-overflow-selection-expected.txt
index 185bffa0..a4ddb83 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/pre-wrap-overflow-selection-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/pre-wrap-overflow-selection-expected.txt
@@ -6,15 +6,15 @@
       LayoutBlockFlow {P} at (0,0) size 784x40
         LayoutText {#text} at (0,0) size 242x19
           text run at (0,0) width 242: "This test checks for a regression against "
-        LayoutInline {I} at (0,0) size 725x39
+        LayoutInline {I} at (0,0) size 724x39
           LayoutInline {A} at (0,0) size 350x19 [color=#0000EE]
             LayoutText {#text} at (242,0) size 350x19
               text run at (242,0) width 350: "http://bugzilla.opendarwin.org/show_bug.cgi?id=5619"
-          LayoutText {#text} at (592,0) size 725x39
-            text run at (592,0) width 133: " CSS2: pre-wrap has"
+          LayoutText {#text} at (591,0) size 724x39
+            text run at (591,0) width 133: " CSS2: pre-wrap has"
             text run at (0,20) width 180: "overflow/selection problems"
-        LayoutText {#text} at (180,20) size 4x19
-          text run at (180,20) width 4: "."
+        LayoutText {#text} at (179,20) size 5x19
+          text run at (179,20) width 5: "."
       LayoutBlockFlow {P} at (0,56) size 784x20
         LayoutText {#text} at (0,0) size 656x19
           text run at (0,0) width 656: "Both boxes should not have scroll bars. The selection should not spill out of the blue box to the right of \x{201C}text\x{201D}."
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/pre-wrap-spaces-after-newline-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/pre-wrap-spaces-after-newline-expected.png
index 4cd0988a..32ed48b 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/pre-wrap-spaces-after-newline-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/pre-wrap-spaces-after-newline-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/pre-wrap-spaces-after-newline-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/pre-wrap-spaces-after-newline-expected.txt
index 71bcd90..de650df42 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/pre-wrap-spaces-after-newline-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/whitespace/pre-wrap-spaces-after-newline-expected.txt
@@ -4,15 +4,15 @@
   LayoutBlockFlow {HTML} at (0,0) size 785x822
     LayoutBlockFlow {BODY} at (8,8) size 769x801
       LayoutBlockFlow {P} at (0,0) size 769x40
-        LayoutText {#text} at (0,0) size 51x19
-          text run at (0,0) width 51: "Test for "
-        LayoutInline {I} at (0,0) size 737x39
-          LayoutInline {A} at (0,0) size 350x19 [color=#0000EE]
-            LayoutText {#text} at (51,0) size 350x19
-              text run at (51,0) width 350: "http://bugzilla.opendarwin.org/show_bug.cgi?id=7216"
-          LayoutText {#text} at (401,0) size 737x39
-            text run at (401,0) width 4: " "
-            text run at (405,0) width 332: "white-space: pre-wrap collapses leading whitespace"
+        LayoutText {#text} at (0,0) size 50x19
+          text run at (0,0) width 50: "Test for "
+        LayoutInline {I} at (0,0) size 735x39
+          LayoutInline {A} at (0,0) size 351x19 [color=#0000EE]
+            LayoutText {#text} at (49,0) size 351x19
+              text run at (49,0) width 351: "http://bugzilla.opendarwin.org/show_bug.cgi?id=7216"
+          LayoutText {#text} at (399,0) size 735x39
+            text run at (399,0) width 5: " "
+            text run at (403,0) width 332: "white-space: pre-wrap collapses leading whitespace"
             text run at (0,20) width 125: "following a newline"
         LayoutText {#text} at (125,20) size 4x19
           text run at (125,20) width 4: "."
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/wide-zero-width-space-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text/wide-zero-width-space-expected.png
index 8ab5278..077d2f58 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/wide-zero-width-space-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/wide-zero-width-space-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/wide-zero-width-space-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/text/wide-zero-width-space-expected.txt
index 79c5d37..6b49cc8c 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/wide-zero-width-space-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/wide-zero-width-space-expected.txt
@@ -4,17 +4,17 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x600
     LayoutBlockFlow {BODY} at (8,8) size 784x584
       LayoutBlockFlow {P} at (0,0) size 784x20
-        LayoutText {#text} at (0,0) size 51x19
-          text run at (0,0) width 51: "Test for "
+        LayoutText {#text} at (0,0) size 50x19
+          text run at (0,0) width 50: "Test for "
         LayoutInline {I} at (0,0) size 608x19
-          LayoutInline {A} at (0,0) size 305x19 [color=#0000EE]
-            LayoutText {#text} at (51,0) size 305x19
-              text run at (51,0) width 305: "http://bugs.webkit.org/show_bug.cgi?id=13178"
-          LayoutText {#text} at (356,0) size 303x19
-            text run at (356,0) width 4: " "
-            text run at (360,0) width 299: "Helvetica zero-width space has non-zero width"
-        LayoutText {#text} at (659,0) size 4x19
-          text run at (659,0) width 4: "."
+          LayoutInline {A} at (0,0) size 306x19 [color=#0000EE]
+            LayoutText {#text} at (49,0) size 306x19
+              text run at (49,0) width 306: "http://bugs.webkit.org/show_bug.cgi?id=13178"
+          LayoutText {#text} at (354,0) size 303x19
+            text run at (354,0) width 5: " "
+            text run at (358,0) width 299: "Helvetica zero-width space has non-zero width"
+        LayoutText {#text} at (656,0) size 5x19
+          text run at (656,0) width 5: "."
       LayoutBlockFlow {P} at (0,36) size 784x20
         LayoutText {#text} at (0,0) size 247x19
           text run at (0,0) width 247: "The following lines should all be identical."
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/word-break-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text/word-break-expected.png
index eab22c9..ae73991d 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/word-break-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/word-break-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/word-break-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/text/word-break-expected.txt
index 69cffb79..51d452e 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/word-break-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/word-break-expected.txt
@@ -32,7 +32,7 @@
         LayoutBR {BR} at (0,0) size 0x19
         LayoutText {#text} at (0,20) size 768x39
           text run at (0,20) width 453: "The next two examples test our custom break-word value for word-break. "
-          text run at (453,20) width 304: "We should get the same results as break-all for the"
+          text run at (453,20) width 303: "We should get the same results as break-all for the"
           text run at (0,40) width 768: "first test, but we should break up the word in the second test (since our behavior matches word-wrap: break-word in that case)."
       LayoutTable {TABLE} at (0,282) size 769x110 [border: (1px outset #808080)]
         LayoutTableSection {TBODY} at (1,1) size 767x108
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/word-break-run-rounding-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text/word-break-run-rounding-expected.png
index bac1932..f964af2 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/word-break-run-rounding-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/word-break-run-rounding-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/word-break-run-rounding-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/text/word-break-run-rounding-expected.txt
index 1b68da2..7316cb7 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/word-break-run-rounding-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/word-break-run-rounding-expected.txt
@@ -4,34 +4,34 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x600
     LayoutBlockFlow {BODY} at (8,8) size 784x584
       LayoutBlockFlow {P} at (0,0) size 784x20
-        LayoutText {#text} at (0,0) size 57x19
-          text run at (0,0) width 57: "Tests for "
-        LayoutInline {I} at (0,0) size 714x19
-          LayoutInline {A} at (0,0) size 305x19 [color=#0000EE]
-            LayoutText {#text} at (57,0) size 305x19
-              text run at (57,0) width 305: "http://bugs.webkit.org/show_bug.cgi?id=13438"
-          LayoutText {#text} at (362,0) size 409x19
-            text run at (362,0) width 4: " "
-            text run at (366,0) width 405: "Run rounding makes word-break:break-all/word not functional"
-        LayoutText {#text} at (771,0) size 4x19
-          text run at (771,0) width 4: "."
+        LayoutText {#text} at (0,0) size 56x19
+          text run at (0,0) width 56: "Tests for "
+        LayoutInline {I} at (0,0) size 712x19
+          LayoutInline {A} at (0,0) size 306x19 [color=#0000EE]
+            LayoutText {#text} at (55,0) size 306x19
+              text run at (55,0) width 306: "http://bugs.webkit.org/show_bug.cgi?id=13438"
+          LayoutText {#text} at (360,0) size 407x19
+            text run at (360,0) width 5: " "
+            text run at (364,0) width 403: "Run rounding makes word-break:break-all/word not functional"
+        LayoutText {#text} at (766,0) size 5x19
+          text run at (766,0) width 5: "."
       LayoutBlockFlow {P} at (0,36) size 784x20
-        LayoutText {#text} at (0,0) size 288x19
-          text run at (0,0) width 288: "Test that the preferred (maximum) width is right:"
+        LayoutText {#text} at (0,0) size 287x19
+          text run at (0,0) width 287: "Test that the preferred (maximum) width is right:"
       LayoutBlockFlow (anonymous) at (0,72) size 784x26
         LayoutBlockFlow (floating) {DIV} at (0,0) size 557x26 [border: (3px solid #000000)]
           LayoutText {#text} at (3,3) size 551x19
             text run at (3,3) width 551: "The black border should fit tightly around this one line of text with no space after the period."
         LayoutBR {BR} at (557,0) size 0x19
       LayoutBlockFlow {P} at (0,114) size 784x20
-        LayoutText {#text} at (0,0) size 367x19
-          text run at (0,0) width 367: "Test that text does not wrap too early due to rounding errors:"
+        LayoutText {#text} at (0,0) size 366x19
+          text run at (0,0) width 366: "Test that text does not wrap too early due to rounding errors:"
       LayoutBlockFlow {DIV} at (0,150) size 431x26 [border: (3px solid #000000)]
         LayoutText {#text} at (3,3) size 315x19
           text run at (3,3) width 315: "This text fits nicely on a single line of the given width."
       LayoutBlockFlow {P} at (0,192) size 784x20
-        LayoutText {#text} at (0,0) size 221x19
-          text run at (0,0) width 221: "Test that text does not wrap too late:"
+        LayoutText {#text} at (0,0) size 220x19
+          text run at (0,0) width 220: "Test that text does not wrap too late:"
       LayoutBlockFlow {DIV} at (0,228) size 597x26 [border: (3px solid #000000)]
         LayoutText {#text} at (3,3) size 576x19
           text run at (3,3) width 371: "J u s t a b u n c h o f l e t t e r s h e r e , n o t h i n g t o s e e . "
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/word-break-soft-hyphen-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text/word-break-soft-hyphen-expected.png
index 5349c074..12704ad 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/word-break-soft-hyphen-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/word-break-soft-hyphen-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/word-break-soft-hyphen-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/text/word-break-soft-hyphen-expected.txt
index 09ca350..223cc3b 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/word-break-soft-hyphen-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/word-break-soft-hyphen-expected.txt
@@ -4,15 +4,15 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x600
     LayoutBlockFlow {BODY} at (8,8) size 784x576
       LayoutBlockFlow {P} at (0,0) size 784x40
-        LayoutText {#text} at (0,0) size 51x19
-          text run at (0,0) width 51: "Test for "
-        LayoutInline {I} at (0,0) size 755x39
-          LayoutInline {A} at (0,0) size 305x19 [color=#0000EE]
-            LayoutText {#text} at (51,0) size 305x19
-              text run at (51,0) width 305: "http://bugs.webkit.org/show_bug.cgi?id=15367"
-          LayoutText {#text} at (356,0) size 755x39
-            text run at (356,0) width 4: " "
-            text run at (360,0) width 395: "Assertion failure inspecting a document including soft hyphen"
+        LayoutText {#text} at (0,0) size 50x19
+          text run at (0,0) width 50: "Test for "
+        LayoutInline {I} at (0,0) size 753x39
+          LayoutInline {A} at (0,0) size 306x19 [color=#0000EE]
+            LayoutText {#text} at (49,0) size 306x19
+              text run at (49,0) width 306: "http://bugs.webkit.org/show_bug.cgi?id=15367"
+          LayoutText {#text} at (354,0) size 753x39
+            text run at (354,0) width 5: " "
+            text run at (358,0) width 395: "Assertion failure inspecting a document including soft hyphen"
             text run at (0,20) width 76: "code (0xad)"
         LayoutText {#text} at (76,20) size 4x19
           text run at (76,20) width 4: "."
@@ -21,5 +21,5 @@
           text run at (0,0) width 459: "The following text should not wrap and the border should fit tightly around it."
 layer at (8,100) size 109x26
   LayoutBlockFlow (positioned) {DIV} at (8,100) size 109x26 [border: (3px solid #000000)]
-    LayoutText {#text} at (3,3) size 103x19
-      text run at (3,3) width 103: "Two soft\x{AD}hyp\x{AD}hens"
+    LayoutText {#text} at (3,3) size 102x19
+      text run at (3,3) width 102: "Two soft\x{AD}hyp\x{AD}hens"
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/word-space-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text/word-space-expected.png
index c972f64..570abdc 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/word-space-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/word-space-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/word-space-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/text/word-space-expected.txt
index 9fd0690..f98faed 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/word-space-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/word-space-expected.txt
@@ -4,15 +4,15 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x600
     LayoutBlockFlow {BODY} at (8,8) size 784x576
       LayoutBlockFlow {P} at (0,0) size 784x40
-        LayoutText {#text} at (0,0) size 51x19
-          text run at (0,0) width 51: "Test for "
-        LayoutInline {I} at (0,0) size 765x39
-          LayoutInline {A} at (0,0) size 305x19 [color=#0000EE]
-            LayoutText {#text} at (51,0) size 305x19
-              text run at (51,0) width 305: "http://bugs.webkit.org/show_bug.cgi?id=15259"
-          LayoutText {#text} at (356,0) size 765x39
-            text run at (356,0) width 4: " "
-            text run at (360,0) width 405: "REGRESSION:Text overflows if a empty <td> is followed by a"
+        LayoutText {#text} at (0,0) size 50x19
+          text run at (0,0) width 50: "Test for "
+        LayoutInline {I} at (0,0) size 762x39
+          LayoutInline {A} at (0,0) size 306x19 [color=#0000EE]
+            LayoutText {#text} at (49,0) size 306x19
+              text run at (49,0) width 306: "http://bugs.webkit.org/show_bug.cgi?id=15259"
+          LayoutText {#text} at (354,0) size 762x39
+            text run at (354,0) width 5: " "
+            text run at (358,0) width 404: "REGRESSION:Text overflows if a empty <td> is followed by a"
             text run at (0,20) width 138: "<td align=\"center\">"
         LayoutText {#text} at (138,20) size 4x19
           text run at (138,20) width 4: "."
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/zero-font-size-expected.png b/third_party/WebKit/LayoutTests/platform/linux/fast/text/zero-font-size-expected.png
index b42ea42..d4689cb 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/zero-font-size-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/zero-font-size-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/fast/text/zero-font-size-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/fast/text/zero-font-size-expected.txt
index 9e1f7abe..437f3fa 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/fast/text/zero-font-size-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/fast/text/zero-font-size-expected.txt
@@ -4,8 +4,8 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x600
     LayoutBlockFlow {BODY} at (8,8) size 784x584
       LayoutBlockFlow {P} at (0,0) size 784x40
-        LayoutText {#text} at (0,0) size 727x39
-          text run at (0,0) width 727: "Test that text with 0px font size is not displayed, even if a non-zero minimum font size setting is specified. On success, this"
+        LayoutText {#text} at (0,0) size 726x39
+          text run at (0,0) width 726: "Test that text with 0px font size is not displayed, even if a non-zero minimum font size setting is specified. On success, this"
           text run at (0,20) width 319: "paragraph should be the only text visible on the page."
       LayoutBlockFlow {DIV} at (0,56) size 784x0 [color=#FF0000]
         LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text-autosizing/display-type-change-expected.png b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text-autosizing/display-type-change-expected.png
index 130b788..2612df4 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text-autosizing/display-type-change-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text-autosizing/display-type-change-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text-autosizing/list-item-above-dbcat-expected.png b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text-autosizing/list-item-above-dbcat-expected.png
index 65af806..4eb141f 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text-autosizing/list-item-above-dbcat-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text-autosizing/list-item-above-dbcat-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text-autosizing/tables/css-table-single-cell-lots-of-text-expected.png b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text-autosizing/tables/css-table-single-cell-lots-of-text-expected.png
index 94cd31c..6882312 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text-autosizing/tables/css-table-single-cell-lots-of-text-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text-autosizing/tables/css-table-single-cell-lots-of-text-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text-autosizing/tables/fixed-table-single-cell-lots-of-text-expected.png b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text-autosizing/tables/fixed-table-single-cell-lots-of-text-expected.png
index e5edc530..d35e41b 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text-autosizing/tables/fixed-table-single-cell-lots-of-text-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text-autosizing/tables/fixed-table-single-cell-lots-of-text-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text-autosizing/tables/nested-table-wrapping-expected.png b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text-autosizing/tables/nested-table-wrapping-expected.png
index c2ad072f..f89ad50 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text-autosizing/tables/nested-table-wrapping-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text-autosizing/tables/nested-table-wrapping-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text-autosizing/tables/nested-tables-expected.png b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text-autosizing/tables/nested-tables-expected.png
index 14e4054..1f9ad91 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text-autosizing/tables/nested-tables-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text-autosizing/tables/nested-tables-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text-autosizing/tables/single-cell-lots-of-text-expected.png b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text-autosizing/tables/single-cell-lots-of-text-expected.png
index 8d7c4d2..760a0a18 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text-autosizing/tables/single-cell-lots-of-text-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text-autosizing/tables/single-cell-lots-of-text-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text-autosizing/tables/single-percent-width-cell-lots-of-text-expected.png b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text-autosizing/tables/single-percent-width-cell-lots-of-text-expected.png
index 808378ed..01b4be8 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text-autosizing/tables/single-percent-width-cell-lots-of-text-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text-autosizing/tables/single-percent-width-cell-lots-of-text-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text-autosizing/tables/table-cell-inflation-expected.png b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text-autosizing/tables/table-cell-inflation-expected.png
index 750ef9d..57061b87 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text-autosizing/tables/table-cell-inflation-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text-autosizing/tables/table-cell-inflation-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text-autosizing/tables/table-for-layout-expected.png b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text-autosizing/tables/table-for-layout-expected.png
index 84bccc6d..4b008a8 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text-autosizing/tables/table-for-layout-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text-autosizing/tables/table-for-layout-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text-autosizing/tables/wide-percentage-width-expected.png b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text-autosizing/tables/wide-percentage-width-expected.png
index dd331b6..3f4a86b50 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text-autosizing/tables/wide-percentage-width-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text-autosizing/tables/wide-percentage-width-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text-autosizing/tables/wide-specified-width-expected.png b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text-autosizing/tables/wide-specified-width-expected.png
index 732f243..e5005b4 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text-autosizing/tables/wide-specified-width-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text-autosizing/tables/wide-specified-width-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/aat-morx-expected.png b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/aat-morx-expected.png
index ae87aad..1cfd73a 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/aat-morx-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/aat-morx-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/atsui-kerning-and-ligatures-expected.png b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/atsui-kerning-and-ligatures-expected.png
index 592823a..151b88519 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/atsui-kerning-and-ligatures-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/atsui-kerning-and-ligatures-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/atsui-multiple-renderers-expected.png b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/atsui-multiple-renderers-expected.png
index 4c1dd62..b4ad24b 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/atsui-multiple-renderers-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/atsui-multiple-renderers-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/atsui-partial-selection-expected.png b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/atsui-partial-selection-expected.png
index a960778..36cf392 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/atsui-partial-selection-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/atsui-partial-selection-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/atsui-pointtooffset-calls-cg-expected.png b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/atsui-pointtooffset-calls-cg-expected.png
index a9630b9..a5119bd 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/atsui-pointtooffset-calls-cg-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/atsui-pointtooffset-calls-cg-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/atsui-small-caps-punctuation-size-expected.png b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/atsui-small-caps-punctuation-size-expected.png
index 6091d77..3394a69 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/atsui-small-caps-punctuation-size-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/atsui-small-caps-punctuation-size-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/basic/002-expected.png b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/basic/002-expected.png
index 0731b9b..ecb1e4e 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/basic/002-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/basic/002-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/basic/005-expected.png b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/basic/005-expected.png
index 28967ef..cb39ef77 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/basic/005-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/basic/005-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/basic/011-expected.png b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/basic/011-expected.png
index 069ad7d8..723dc37 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/basic/011-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/basic/011-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/basic/012-expected.png b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/basic/012-expected.png
index f328a32a..d9f5500 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/basic/012-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/basic/012-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/basic/013-expected.png b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/basic/013-expected.png
index c349618..d28e175d 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/basic/013-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/basic/013-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/basic/generic-family-changes-expected.png b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/basic/generic-family-changes-expected.png
index 096bbac..80ef6b4b 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/basic/generic-family-changes-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/basic/generic-family-changes-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/bidi-embedding-pop-and-push-same-expected.png b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/bidi-embedding-pop-and-push-same-expected.png
index 8eb9c3b..a2d59ec 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/bidi-embedding-pop-and-push-same-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/bidi-embedding-pop-and-push-same-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/bidi-img-alt-text-expected.png b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/bidi-img-alt-text-expected.png
index f36cc99..71895e1 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/bidi-img-alt-text-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/bidi-img-alt-text-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/break-word-expected.png b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/break-word-expected.png
index 5147d08c..97cfa837 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/break-word-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/break-word-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/capitalize-boundaries-expected.png b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/capitalize-boundaries-expected.png
index 3605835..09d3d117 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/capitalize-boundaries-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/capitalize-boundaries-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/capitalize-empty-generated-string-expected.png b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/capitalize-empty-generated-string-expected.png
index 383cd23..fc7b0b4 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/capitalize-empty-generated-string-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/capitalize-empty-generated-string-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/capitalize-preserve-nbsp-expected.png b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/capitalize-preserve-nbsp-expected.png
index 3f798fe..62bf316 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/capitalize-preserve-nbsp-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/capitalize-preserve-nbsp-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/caps-lock-indicator-disabled-expected.png b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/caps-lock-indicator-disabled-expected.png
index 961fb753..8456f6e2 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/caps-lock-indicator-disabled-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/caps-lock-indicator-disabled-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/caps-lock-indicator-enabled-expected.png b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/caps-lock-indicator-enabled-expected.png
index 6fba934a..a85be3f 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/caps-lock-indicator-enabled-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/caps-lock-indicator-enabled-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/cg-fallback-bolding-expected.png b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/cg-fallback-bolding-expected.png
index 3604e72..a2226985 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/cg-fallback-bolding-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/cg-fallback-bolding-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/complex-text-rtl-selection-repaint-expected.png b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/complex-text-rtl-selection-repaint-expected.png
index 875df6c..25850c67 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/complex-text-rtl-selection-repaint-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/complex-text-rtl-selection-repaint-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/delete-hard-break-character-expected.png b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/delete-hard-break-character-expected.png
index f32f523..9e57ade9 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/delete-hard-break-character-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/delete-hard-break-character-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/drawBidiText-expected.png b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/drawBidiText-expected.png
index d5884ff2..7a4534b 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/drawBidiText-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/drawBidiText-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/ellipsis-platform-font-change-expected.png b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/ellipsis-platform-font-change-expected.png
index 160489bc..13b7f406 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/ellipsis-platform-font-change-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/ellipsis-platform-font-change-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/emoticons-expected.png b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/emoticons-expected.png
index dd594e0..be688ce 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/emoticons-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/emoticons-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/emoticons-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/emoticons-expected.txt
index 52c27de..f83e73a 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/emoticons-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/emoticons-expected.txt
@@ -7,51 +7,51 @@
         LayoutText {#text} at (0,0) size 303x37
           text run at (0,0) width 303: "Emoticons & Symbols"
       LayoutBlockFlow {PRE} at (0,58.44) size 769x476
-        LayoutText {#text} at (0,4) size 440x472
-          text run at (0,4) width 440: "U+1F60x \x{D83D}\x{DE00} \x{D83D}\x{DE01} \x{D83D}\x{DE02} \x{D83D}\x{DE03} \x{D83D}\x{DE04} \x{D83D}\x{DE05} \x{D83D}\x{DE06} \x{D83D}\x{DE07} \x{D83D}\x{DE08} \x{D83D}\x{DE09} \x{D83D}\x{DE0A} \x{D83D}\x{DE0B} \x{D83D}\x{DE0C} \x{D83D}\x{DE0D} \x{D83D}\x{DE0E} \x{D83D}\x{DE0F}"
-          text run at (439,4) width 1: " "
-          text run at (0,25) width 440: "U+1F61x \x{D83D}\x{DE10} \x{D83D}\x{DE11} \x{D83D}\x{DE12} \x{D83D}\x{DE13} \x{D83D}\x{DE14} \x{D83D}\x{DE15} \x{D83D}\x{DE16} \x{D83D}\x{DE17} \x{D83D}\x{DE18} \x{D83D}\x{DE19} \x{D83D}\x{DE1A} \x{D83D}\x{DE1B} \x{D83D}\x{DE1C} \x{D83D}\x{DE1D} \x{D83D}\x{DE1E} \x{D83D}\x{DE1F}"
-          text run at (439,25) width 1: " "
-          text run at (0,46) width 440: "U+1F62x \x{D83D}\x{DE20} \x{D83D}\x{DE21} \x{D83D}\x{DE22} \x{D83D}\x{DE23} \x{D83D}\x{DE24} \x{D83D}\x{DE25} \x{D83D}\x{DE26} \x{D83D}\x{DE27} \x{D83D}\x{DE28} \x{D83D}\x{DE29} \x{D83D}\x{DE2A} \x{D83D}\x{DE2B} \x{D83D}\x{DE2C} \x{D83D}\x{DE2D} \x{D83D}\x{DE2E} \x{D83D}\x{DE2F}"
-          text run at (439,46) width 1: " "
-          text run at (0,67) width 440: "U+1F63x \x{D83D}\x{DE30} \x{D83D}\x{DE31} \x{D83D}\x{DE32} \x{D83D}\x{DE33} \x{D83D}\x{DE34} \x{D83D}\x{DE35} \x{D83D}\x{DE36} \x{D83D}\x{DE37} \x{D83D}\x{DE38} \x{D83D}\x{DE39} \x{D83D}\x{DE3A} \x{D83D}\x{DE3B} \x{D83D}\x{DE3C} \x{D83D}\x{DE3D} \x{D83D}\x{DE3E} \x{D83D}\x{DE3F}"
-          text run at (439,67) width 1: " "
-          text run at (0,88) width 407: "U+1F64x \x{D83D}\x{DE40} \x{D83D}\x{DE41} \x{D83D}\x{DE42}   \x{D83D}\x{DE45} \x{D83D}\x{DE46} \x{D83D}\x{DE47} \x{D83D}\x{DE48} \x{D83D}\x{DE49} \x{D83D}\x{DE4A} \x{D83D}\x{DE4B} \x{D83D}\x{DE4C} \x{D83D}\x{DE4D} \x{D83D}\x{DE4E} \x{D83D}\x{DE4F}"
-          text run at (406,88) width 1: " "
-          text run at (0,109) width 440: "U+1F30x \x{D83C}\x{DF00} \x{D83C}\x{DF01} \x{D83C}\x{DF02} \x{D83C}\x{DF03} \x{D83C}\x{DF04} \x{D83C}\x{DF05} \x{D83C}\x{DF06} \x{D83C}\x{DF07} \x{D83C}\x{DF08} \x{D83C}\x{DF09} \x{D83C}\x{DF0A} \x{D83C}\x{DF0B} \x{D83C}\x{DF0C} \x{D83C}\x{DF0D} \x{D83C}\x{DF0E} \x{D83C}\x{DF0F}"
-          text run at (439,109) width 1: " "
-          text run at (0,130) width 440: "U+1F31x \x{D83C}\x{DF10} \x{D83C}\x{DF11} \x{D83C}\x{DF12} \x{D83C}\x{DF13} \x{D83C}\x{DF14} \x{D83C}\x{DF15} \x{D83C}\x{DF16} \x{D83C}\x{DF17} \x{D83C}\x{DF18} \x{D83C}\x{DF19} \x{D83C}\x{DF1A} \x{D83C}\x{DF1B} \x{D83C}\x{DF1C} \x{D83C}\x{DF1D} \x{D83C}\x{DF1E} \x{D83C}\x{DF1F}"
-          text run at (439,130) width 1: " "
-          text run at (0,151) width 391: "U+1F32x \x{D83C}\x{DF20} \x{D83C}\x{DF21} \x{D83C}\x{DF22} \x{D83C}\x{DF23} \x{D83C}\x{DF24} \x{D83C}\x{DF25} \x{D83C}\x{DF26} \x{D83C}\x{DF27} \x{D83C}\x{DF28} \x{D83C}\x{DF29} \x{D83C}\x{DF2A} \x{D83C}\x{DF2B} \x{D83C}\x{DF2C}   "
-          text run at (390,151) width 1: " "
-          text run at (0,172) width 440: "U+1F33x \x{D83C}\x{DF30} \x{D83C}\x{DF31} \x{D83C}\x{DF32} \x{D83C}\x{DF33} \x{D83C}\x{DF34} \x{D83C}\x{DF35} \x{D83C}\x{DF36} \x{D83C}\x{DF37} \x{D83C}\x{DF38} \x{D83C}\x{DF39} \x{D83C}\x{DF3A} \x{D83C}\x{DF3B} \x{D83C}\x{DF3C} \x{D83C}\x{DF3D} \x{D83C}\x{DF3E} \x{D83C}\x{DF3F}"
-          text run at (439,172) width 1: " "
-          text run at (0,193) width 440: "U+1F34x \x{D83C}\x{DF40} \x{D83C}\x{DF41} \x{D83C}\x{DF42} \x{D83C}\x{DF43} \x{D83C}\x{DF44} \x{D83C}\x{DF45} \x{D83C}\x{DF46} \x{D83C}\x{DF47} \x{D83C}\x{DF48} \x{D83C}\x{DF49} \x{D83C}\x{DF4A} \x{D83C}\x{DF4B} \x{D83C}\x{DF4C} \x{D83C}\x{DF4D} \x{D83C}\x{DF4E} \x{D83C}\x{DF4F}"
-          text run at (439,193) width 1: " "
-          text run at (0,214) width 440: "U+1F35x \x{D83C}\x{DF50} \x{D83C}\x{DF51} \x{D83C}\x{DF52} \x{D83C}\x{DF53} \x{D83C}\x{DF54} \x{D83C}\x{DF55} \x{D83C}\x{DF56} \x{D83C}\x{DF57} \x{D83C}\x{DF58} \x{D83C}\x{DF59} \x{D83C}\x{DF5A} \x{D83C}\x{DF5B} \x{D83C}\x{DF5C} \x{D83C}\x{DF5D} \x{D83C}\x{DF5E} \x{D83C}\x{DF5F}"
-          text run at (439,214) width 1: " "
-          text run at (0,235) width 440: "U+1F36x \x{D83C}\x{DF60} \x{D83C}\x{DF61} \x{D83C}\x{DF62} \x{D83C}\x{DF63} \x{D83C}\x{DF64} \x{D83C}\x{DF65} \x{D83C}\x{DF66} \x{D83C}\x{DF67} \x{D83C}\x{DF68} \x{D83C}\x{DF69} \x{D83C}\x{DF6A} \x{D83C}\x{DF6B} \x{D83C}\x{DF6C} \x{D83C}\x{DF6D} \x{D83C}\x{DF6E} \x{D83C}\x{DF6F}"
-          text run at (439,235) width 1: " "
-          text run at (0,256) width 407: "U+1F37x \x{D83C}\x{DF70} \x{D83C}\x{DF71} \x{D83C}\x{DF72} \x{D83C}\x{DF73} \x{D83C}\x{DF74} \x{D83C}\x{DF75} \x{D83C}\x{DF76} \x{D83C}\x{DF77} \x{D83C}\x{DF78} \x{D83C}\x{DF79} \x{D83C}\x{DF7A} \x{D83C}\x{DF7B} \x{D83C}\x{DF7C} \x{D83C}\x{DF7D}  "
-          text run at (406,256) width 1: " "
-          text run at (0,277) width 440: "U+1F38x \x{D83C}\x{DF80} \x{D83C}\x{DF81} \x{D83C}\x{DF82} \x{D83C}\x{DF83} \x{D83C}\x{DF84} \x{D83C}\x{DF85} \x{D83C}\x{DF86} \x{D83C}\x{DF87} \x{D83C}\x{DF88} \x{D83C}\x{DF89} \x{D83C}\x{DF8A} \x{D83C}\x{DF8B} \x{D83C}\x{DF8C} \x{D83C}\x{DF8D} \x{D83C}\x{DF8E} \x{D83C}\x{DF8F}"
-          text run at (439,277) width 1: " "
-          text run at (0,298) width 440: "U+1F68x \x{D83D}\x{DE80} \x{D83D}\x{DE81} \x{D83D}\x{DE82} \x{D83D}\x{DE83} \x{D83D}\x{DE84} \x{D83D}\x{DE85} \x{D83D}\x{DE86} \x{D83D}\x{DE87} \x{D83D}\x{DE88} \x{D83D}\x{DE89} \x{D83D}\x{DE8A} \x{D83D}\x{DE8B} \x{D83D}\x{DE8C} \x{D83D}\x{DE8D} \x{D83D}\x{DE8E} \x{D83D}\x{DE8F}"
-          text run at (439,298) width 1: " "
-          text run at (0,319) width 440: "U+1F69x \x{D83D}\x{DE90} \x{D83D}\x{DE91} \x{D83D}\x{DE92} \x{D83D}\x{DE93} \x{D83D}\x{DE94} \x{D83D}\x{DE95} \x{D83D}\x{DE96} \x{D83D}\x{DE97} \x{D83D}\x{DE98} \x{D83D}\x{DE99} \x{D83D}\x{DE9A} \x{D83D}\x{DE9B} \x{D83D}\x{DE9C} \x{D83D}\x{DE9D} \x{D83D}\x{DE9E} \x{D83D}\x{DE9F}"
-          text run at (439,319) width 1: " "
-          text run at (0,340) width 440: "U+1F6Ax \x{D83D}\x{DEA0} \x{D83D}\x{DEA1} \x{D83D}\x{DEA2} \x{D83D}\x{DEA3} \x{D83D}\x{DEA4} \x{D83D}\x{DEA5} \x{D83D}\x{DEA6} \x{D83D}\x{DEA7} \x{D83D}\x{DEA8} \x{D83D}\x{DEA9} \x{D83D}\x{DEAA} \x{D83D}\x{DEAB} \x{D83D}\x{DEAC} \x{D83D}\x{DEAD} \x{D83D}\x{DEAE} \x{D83D}\x{DEAF}"
-          text run at (439,340) width 1: " "
-          text run at (0,361) width 440: "U+1F6Bx \x{D83D}\x{DEB0} \x{D83D}\x{DEB1} \x{D83D}\x{DEB2} \x{D83D}\x{DEB3} \x{D83D}\x{DEB4} \x{D83D}\x{DEB5} \x{D83D}\x{DEB6} \x{D83D}\x{DEB7} \x{D83D}\x{DEB8} \x{D83D}\x{DEB9} \x{D83D}\x{DEBA} \x{D83D}\x{DEBB} \x{D83D}\x{DEBC} \x{D83D}\x{DEBD} \x{D83D}\x{DEBE} \x{D83D}\x{DEBF}"
-          text run at (439,361) width 1: " "
+        LayoutText {#text} at (0,4) size 391x472
+          text run at (0,4) width 388: "U+1F60x \x{D83D}\x{DE00} \x{D83D}\x{DE01} \x{D83D}\x{DE02} \x{D83D}\x{DE03} \x{D83D}\x{DE04} \x{D83D}\x{DE05} \x{D83D}\x{DE06} \x{D83D}\x{DE07} \x{D83D}\x{DE08} \x{D83D}\x{DE09} \x{D83D}\x{DE0A} \x{D83D}\x{DE0B} \x{D83D}\x{DE0C} \x{D83D}\x{DE0D} \x{D83D}\x{DE0E} \x{D83D}\x{DE0F}"
+          text run at (387,4) width 1: " "
+          text run at (0,25) width 388: "U+1F61x \x{D83D}\x{DE10} \x{D83D}\x{DE11} \x{D83D}\x{DE12} \x{D83D}\x{DE13} \x{D83D}\x{DE14} \x{D83D}\x{DE15} \x{D83D}\x{DE16} \x{D83D}\x{DE17} \x{D83D}\x{DE18} \x{D83D}\x{DE19} \x{D83D}\x{DE1A} \x{D83D}\x{DE1B} \x{D83D}\x{DE1C} \x{D83D}\x{DE1D} \x{D83D}\x{DE1E} \x{D83D}\x{DE1F}"
+          text run at (387,25) width 1: " "
+          text run at (0,46) width 388: "U+1F62x \x{D83D}\x{DE20} \x{D83D}\x{DE21} \x{D83D}\x{DE22} \x{D83D}\x{DE23} \x{D83D}\x{DE24} \x{D83D}\x{DE25} \x{D83D}\x{DE26} \x{D83D}\x{DE27} \x{D83D}\x{DE28} \x{D83D}\x{DE29} \x{D83D}\x{DE2A} \x{D83D}\x{DE2B} \x{D83D}\x{DE2C} \x{D83D}\x{DE2D} \x{D83D}\x{DE2E} \x{D83D}\x{DE2F}"
+          text run at (387,46) width 1: " "
+          text run at (0,67) width 388: "U+1F63x \x{D83D}\x{DE30} \x{D83D}\x{DE31} \x{D83D}\x{DE32} \x{D83D}\x{DE33} \x{D83D}\x{DE34} \x{D83D}\x{DE35} \x{D83D}\x{DE36} \x{D83D}\x{DE37} \x{D83D}\x{DE38} \x{D83D}\x{DE39} \x{D83D}\x{DE3A} \x{D83D}\x{DE3B} \x{D83D}\x{DE3C} \x{D83D}\x{DE3D} \x{D83D}\x{DE3E} \x{D83D}\x{DE3F}"
+          text run at (387,67) width 1: " "
+          text run at (0,88) width 368: "U+1F64x \x{D83D}\x{DE40} \x{D83D}\x{DE41} \x{D83D}\x{DE42}   \x{D83D}\x{DE45} \x{D83D}\x{DE46} \x{D83D}\x{DE47} \x{D83D}\x{DE48} \x{D83D}\x{DE49} \x{D83D}\x{DE4A} \x{D83D}\x{DE4B} \x{D83D}\x{DE4C} \x{D83D}\x{DE4D} \x{D83D}\x{DE4E} \x{D83D}\x{DE4F}"
+          text run at (367,88) width 1: " "
+          text run at (0,109) width 388: "U+1F30x \x{D83C}\x{DF00} \x{D83C}\x{DF01} \x{D83C}\x{DF02} \x{D83C}\x{DF03} \x{D83C}\x{DF04} \x{D83C}\x{DF05} \x{D83C}\x{DF06} \x{D83C}\x{DF07} \x{D83C}\x{DF08} \x{D83C}\x{DF09} \x{D83C}\x{DF0A} \x{D83C}\x{DF0B} \x{D83C}\x{DF0C} \x{D83C}\x{DF0D} \x{D83C}\x{DF0E} \x{D83C}\x{DF0F}"
+          text run at (387,109) width 1: " "
+          text run at (0,130) width 388: "U+1F31x \x{D83C}\x{DF10} \x{D83C}\x{DF11} \x{D83C}\x{DF12} \x{D83C}\x{DF13} \x{D83C}\x{DF14} \x{D83C}\x{DF15} \x{D83C}\x{DF16} \x{D83C}\x{DF17} \x{D83C}\x{DF18} \x{D83C}\x{DF19} \x{D83C}\x{DF1A} \x{D83C}\x{DF1B} \x{D83C}\x{DF1C} \x{D83C}\x{DF1D} \x{D83C}\x{DF1E} \x{D83C}\x{DF1F}"
+          text run at (387,130) width 1: " "
+          text run at (0,151) width 388: "U+1F32x \x{D83C}\x{DF20} \x{D83C}\x{DF21} \x{D83C}\x{DF22} \x{D83C}\x{DF23} \x{D83C}\x{DF24} \x{D83C}\x{DF25} \x{D83C}\x{DF26} \x{D83C}\x{DF27} \x{D83C}\x{DF28} \x{D83C}\x{DF29} \x{D83C}\x{DF2A} \x{D83C}\x{DF2B} \x{D83C}\x{DF2C}   "
+          text run at (387,151) width 1: " "
+          text run at (0,172) width 391: "U+1F33x \x{D83C}\x{DF30} \x{D83C}\x{DF31} \x{D83C}\x{DF32} \x{D83C}\x{DF33} \x{D83C}\x{DF34} \x{D83C}\x{DF35} \x{D83C}\x{DF36} \x{D83C}\x{DF37} \x{D83C}\x{DF38} \x{D83C}\x{DF39} \x{D83C}\x{DF3A} \x{D83C}\x{DF3B} \x{D83C}\x{DF3C} \x{D83C}\x{DF3D} \x{D83C}\x{DF3E} \x{D83C}\x{DF3F}"
+          text run at (390,172) width 1: " "
+          text run at (0,193) width 388: "U+1F34x \x{D83C}\x{DF40} \x{D83C}\x{DF41} \x{D83C}\x{DF42} \x{D83C}\x{DF43} \x{D83C}\x{DF44} \x{D83C}\x{DF45} \x{D83C}\x{DF46} \x{D83C}\x{DF47} \x{D83C}\x{DF48} \x{D83C}\x{DF49} \x{D83C}\x{DF4A} \x{D83C}\x{DF4B} \x{D83C}\x{DF4C} \x{D83C}\x{DF4D} \x{D83C}\x{DF4E} \x{D83C}\x{DF4F}"
+          text run at (387,193) width 1: " "
+          text run at (0,214) width 388: "U+1F35x \x{D83C}\x{DF50} \x{D83C}\x{DF51} \x{D83C}\x{DF52} \x{D83C}\x{DF53} \x{D83C}\x{DF54} \x{D83C}\x{DF55} \x{D83C}\x{DF56} \x{D83C}\x{DF57} \x{D83C}\x{DF58} \x{D83C}\x{DF59} \x{D83C}\x{DF5A} \x{D83C}\x{DF5B} \x{D83C}\x{DF5C} \x{D83C}\x{DF5D} \x{D83C}\x{DF5E} \x{D83C}\x{DF5F}"
+          text run at (387,214) width 1: " "
+          text run at (0,235) width 388: "U+1F36x \x{D83C}\x{DF60} \x{D83C}\x{DF61} \x{D83C}\x{DF62} \x{D83C}\x{DF63} \x{D83C}\x{DF64} \x{D83C}\x{DF65} \x{D83C}\x{DF66} \x{D83C}\x{DF67} \x{D83C}\x{DF68} \x{D83C}\x{DF69} \x{D83C}\x{DF6A} \x{D83C}\x{DF6B} \x{D83C}\x{DF6C} \x{D83C}\x{DF6D} \x{D83C}\x{DF6E} \x{D83C}\x{DF6F}"
+          text run at (387,235) width 1: " "
+          text run at (0,256) width 365: "U+1F37x \x{D83C}\x{DF70} \x{D83C}\x{DF71} \x{D83C}\x{DF72} \x{D83C}\x{DF73} \x{D83C}\x{DF74} \x{D83C}\x{DF75} \x{D83C}\x{DF76} \x{D83C}\x{DF77} \x{D83C}\x{DF78} \x{D83C}\x{DF79} \x{D83C}\x{DF7A} \x{D83C}\x{DF7B} \x{D83C}\x{DF7C} \x{D83C}\x{DF7D}  "
+          text run at (364,256) width 1: " "
+          text run at (0,277) width 388: "U+1F38x \x{D83C}\x{DF80} \x{D83C}\x{DF81} \x{D83C}\x{DF82} \x{D83C}\x{DF83} \x{D83C}\x{DF84} \x{D83C}\x{DF85} \x{D83C}\x{DF86} \x{D83C}\x{DF87} \x{D83C}\x{DF88} \x{D83C}\x{DF89} \x{D83C}\x{DF8A} \x{D83C}\x{DF8B} \x{D83C}\x{DF8C} \x{D83C}\x{DF8D} \x{D83C}\x{DF8E} \x{D83C}\x{DF8F}"
+          text run at (387,277) width 1: " "
+          text run at (0,298) width 388: "U+1F68x \x{D83D}\x{DE80} \x{D83D}\x{DE81} \x{D83D}\x{DE82} \x{D83D}\x{DE83} \x{D83D}\x{DE84} \x{D83D}\x{DE85} \x{D83D}\x{DE86} \x{D83D}\x{DE87} \x{D83D}\x{DE88} \x{D83D}\x{DE89} \x{D83D}\x{DE8A} \x{D83D}\x{DE8B} \x{D83D}\x{DE8C} \x{D83D}\x{DE8D} \x{D83D}\x{DE8E} \x{D83D}\x{DE8F}"
+          text run at (387,298) width 1: " "
+          text run at (0,319) width 388: "U+1F69x \x{D83D}\x{DE90} \x{D83D}\x{DE91} \x{D83D}\x{DE92} \x{D83D}\x{DE93} \x{D83D}\x{DE94} \x{D83D}\x{DE95} \x{D83D}\x{DE96} \x{D83D}\x{DE97} \x{D83D}\x{DE98} \x{D83D}\x{DE99} \x{D83D}\x{DE9A} \x{D83D}\x{DE9B} \x{D83D}\x{DE9C} \x{D83D}\x{DE9D} \x{D83D}\x{DE9E} \x{D83D}\x{DE9F}"
+          text run at (387,319) width 1: " "
+          text run at (0,340) width 388: "U+1F6Ax \x{D83D}\x{DEA0} \x{D83D}\x{DEA1} \x{D83D}\x{DEA2} \x{D83D}\x{DEA3} \x{D83D}\x{DEA4} \x{D83D}\x{DEA5} \x{D83D}\x{DEA6} \x{D83D}\x{DEA7} \x{D83D}\x{DEA8} \x{D83D}\x{DEA9} \x{D83D}\x{DEAA} \x{D83D}\x{DEAB} \x{D83D}\x{DEAC} \x{D83D}\x{DEAD} \x{D83D}\x{DEAE} \x{D83D}\x{DEAF}"
+          text run at (387,340) width 1: " "
+          text run at (0,361) width 388: "U+1F6Bx \x{D83D}\x{DEB0} \x{D83D}\x{DEB1} \x{D83D}\x{DEB2} \x{D83D}\x{DEB3} \x{D83D}\x{DEB4} \x{D83D}\x{DEB5} \x{D83D}\x{DEB6} \x{D83D}\x{DEB7} \x{D83D}\x{DEB8} \x{D83D}\x{DEB9} \x{D83D}\x{DEBA} \x{D83D}\x{DEBB} \x{D83D}\x{DEBC} \x{D83D}\x{DEBD} \x{D83D}\x{DEBE} \x{D83D}\x{DEBF}"
+          text run at (387,361) width 1: " "
           text run at (0,380) width 357: "U+260x \x{2600} \x{2601} \x{2602} \x{2603} \x{2604} \x{2605} \x{2606} \x{2607} \x{2608} \x{2609} \x{260A} \x{260B} \x{260C} \x{260D} \x{260E} \x{260F}"
           text run at (356,380) width 1: " "
-          text run at (0,402) width 305: "U+26Dx \x{26D0} \x{26D1} \x{26D2} \x{26D3} \x{26D4} \x{26D5} \x{26D6} \x{26D7} \x{26D8} \x{26D9} \x{26DA} \x{26DB} \x{26DC} \x{26DD} \x{26DE} \x{26DF}"
-          text run at (304,402) width 1: " "
-          text run at (0,423) width 305: "U+26Ex \x{26E0} \x{26E1} \x{26E2} \x{26E3} \x{26E4} \x{26E5} \x{26E6} \x{26E7} \x{26E8} \x{26E9} \x{26EA} \x{26EB} \x{26EC} \x{26ED} \x{26EE} \x{26EF}"
-          text run at (304,423) width 1: " "
-          text run at (0,444) width 339: "U+26Fx \x{26F0} \x{26F1} \x{26F2} \x{26F3} \x{26F4} \x{26F5} \x{26F6} \x{26F7} \x{26F8} \x{26F9} \x{26FA} \x{26FB} \x{26FC} \x{26FD} \x{26FE} \x{26FF}"
-          text run at (338,444) width 1: " "
+          text run at (0,402) width 302: "U+26Dx \x{26D0} \x{26D1} \x{26D2} \x{26D3} \x{26D4} \x{26D5} \x{26D6} \x{26D7} \x{26D8} \x{26D9} \x{26DA} \x{26DB} \x{26DC} \x{26DD} \x{26DE} \x{26DF}"
+          text run at (301,402) width 1: " "
+          text run at (0,423) width 302: "U+26Ex \x{26E0} \x{26E1} \x{26E2} \x{26E3} \x{26E4} \x{26E5} \x{26E6} \x{26E7} \x{26E8} \x{26E9} \x{26EA} \x{26EB} \x{26EC} \x{26ED} \x{26EE} \x{26EF}"
+          text run at (301,423) width 1: " "
+          text run at (0,444) width 323: "U+26Fx \x{26F0} \x{26F1} \x{26F2} \x{26F3} \x{26F4} \x{26F5} \x{26F6} \x{26F7} \x{26F8} \x{26F9} \x{26FA} \x{26FB} \x{26FC} \x{26FD} \x{26FE} \x{26FF}"
+          text run at (322,444) width 1: " "
           text run at (0,461) width 63: "        "
       LayoutBlockFlow {P} at (0,550.44) size 769x18
         LayoutText {#text} at (0,0) size 478x18
diff --git a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/emphasis-ellipsis-complextext-expected.png b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/emphasis-ellipsis-complextext-expected.png
index 8dccba49..bbd3a9a 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/emphasis-ellipsis-complextext-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/emphasis-ellipsis-complextext-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/emphasis-expected.png b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/emphasis-expected.png
index 882e0a260..30fa341b 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/emphasis-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/emphasis-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/fake-italic-expected.png b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/fake-italic-expected.png
index 4846637..6860f36 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/fake-italic-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/fake-italic-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/fallback-for-custom-font-expected.png b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/fallback-for-custom-font-expected.png
index b902c84..af4d978f 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/fallback-for-custom-font-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/fallback-for-custom-font-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/fallback-traits-fixup-expected.png b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/fallback-traits-fixup-expected.png
index 3fdc60d..fc5d724 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/fallback-traits-fixup-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/fallback-traits-fixup-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/fallback-traits-fixup-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/fallback-traits-fixup-expected.txt
index 0451b0e..cfb12bcc 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/fallback-traits-fixup-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/fallback-traits-fixup-expected.txt
@@ -4,17 +4,17 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x600
     LayoutBlockFlow {BODY} at (8,8) size 784x576
       LayoutBlockFlow {P} at (0,0) size 784x18
-        LayoutText {#text} at (0,0) size 55x18
-          text run at (0,0) width 55: "Test for "
-        LayoutInline {I} at (0,0) size 515x18
-          LayoutInline {A} at (0,0) size 157x18 [color=#0000EE]
-            LayoutText {#text} at (54,0) size 157x18
-              text run at (54,0) width 157: "rdar://problem/9528843"
-          LayoutText {#text} at (210,0) size 359x18
-            text run at (210,0) width 5: " "
-            text run at (214,0) width 355: "STIX glyphs not rendered on this stackoverflow answer"
-        LayoutText {#text} at (568,0) size 5x18
-          text run at (568,0) width 5: "."
+        LayoutText {#text} at (0,0) size 54x18
+          text run at (0,0) width 54: "Test for "
+        LayoutInline {I} at (0,0) size 512x18
+          LayoutInline {A} at (0,0) size 156x18 [color=#0000EE]
+            LayoutText {#text} at (53,0) size 156x18
+              text run at (53,0) width 156: "rdar://problem/9528843"
+          LayoutText {#text} at (208,0) size 357x18
+            text run at (208,0) width 5: " "
+            text run at (212,0) width 353: "STIX glyphs not rendered on this stackoverflow answer"
+        LayoutText {#text} at (564,0) size 5x18
+          text run at (564,0) width 5: "."
       LayoutBlockFlow {P} at (0,34) size 784x49
         LayoutText {#text} at (0,20) size 99x18
           text run at (0,20) width 99: "A black circle: "
diff --git a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/firstline/002-expected.png b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/firstline/002-expected.png
index e3d30ff..029beeb 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/firstline/002-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/firstline/002-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/font-initial-expected.png b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/font-initial-expected.png
index 100e8b0c8..09bddd0 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/font-initial-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/font-initial-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/font-kerning-expected.png b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/font-kerning-expected.png
index 9c8bd98..a7917a3 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/font-kerning-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/font-kerning-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/font-smallcaps-layout-expected.png b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/font-smallcaps-layout-expected.png
index 7aa6c530..ff17473 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/font-smallcaps-layout-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/font-smallcaps-layout-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/font-stretch-expected.png b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/font-stretch-expected.png
index 36281e9..150af04 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/font-stretch-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/font-stretch-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/font-stretch-variant-expected.png b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/font-stretch-variant-expected.png
index 6c4e738..15102e6 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/font-stretch-variant-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/font-stretch-variant-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/font-weight-expected.png b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/font-weight-expected.png
index b86d52b..89c6b7f 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/font-weight-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/font-weight-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/font-weight-variant-expected.png b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/font-weight-variant-expected.png
index 0ecc6578..b69cccd8 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/font-weight-variant-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/font-weight-variant-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/format-control-expected.png b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/format-control-expected.png
index d69b63b0c..d14f204c 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/format-control-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/format-control-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/in-rendered-text-rtl-expected.png b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/in-rendered-text-rtl-expected.png
index 7681664..e0504730 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/in-rendered-text-rtl-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/in-rendered-text-rtl-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/international/002-expected.png b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/international/002-expected.png
index 9f29d7cf..98753e1 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/international/002-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/international/002-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/international/bidi-AN-after-empty-run-expected.png b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/international/bidi-AN-after-empty-run-expected.png
index b4f2eb9..a6dc72c 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/international/bidi-AN-after-empty-run-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/international/bidi-AN-after-empty-run-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/international/bidi-LDB-2-CSS-expected.png b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/international/bidi-LDB-2-CSS-expected.png
index 051bf1f1..d2ef54d 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/international/bidi-LDB-2-CSS-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/international/bidi-LDB-2-CSS-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/international/bidi-LDB-2-HTML-expected.png b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/international/bidi-LDB-2-HTML-expected.png
index d25118d..3b1cc23 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/international/bidi-LDB-2-HTML-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/international/bidi-LDB-2-HTML-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/international/bidi-LDB-2-formatting-characters-expected.png b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/international/bidi-LDB-2-formatting-characters-expected.png
index 4a6a6ecb..65b34d9f 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/international/bidi-LDB-2-formatting-characters-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/international/bidi-LDB-2-formatting-characters-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/international/bidi-european-terminators-expected.png b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/international/bidi-european-terminators-expected.png
index 1750a43..198584c 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/international/bidi-european-terminators-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/international/bidi-european-terminators-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/international/bidi-ignored-for-first-child-inline-expected.png b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/international/bidi-ignored-for-first-child-inline-expected.png
index b755bf6..f5fd738 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/international/bidi-ignored-for-first-child-inline-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/international/bidi-ignored-for-first-child-inline-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/international/bidi-innertext-expected.png b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/international/bidi-innertext-expected.png
index 249f1e6..e68646fe6 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/international/bidi-innertext-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/international/bidi-innertext-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/international/bidi-listbox-atsui-expected.png b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/international/bidi-listbox-atsui-expected.png
index de21fedd..2f28c3c 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/international/bidi-listbox-atsui-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/international/bidi-listbox-atsui-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/international/bidi-neutral-directionality-paragraph-start-expected.png b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/international/bidi-neutral-directionality-paragraph-start-expected.png
index bcbf714..ffe7f0f 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/international/bidi-neutral-directionality-paragraph-start-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/international/bidi-neutral-directionality-paragraph-start-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/international/bidi-neutral-run-expected.png b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/international/bidi-neutral-run-expected.png
index c3dec257..ed9f051 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/international/bidi-neutral-run-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/international/bidi-neutral-run-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/international/bidi-override-expected.png b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/international/bidi-override-expected.png
index 6d82a6b..bb0dfde3 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/international/bidi-override-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/international/bidi-override-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/international/bold-bengali-expected.png b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/international/bold-bengali-expected.png
index 93d2e8e..2e3c1c5a 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/international/bold-bengali-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/international/bold-bengali-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/international/complex-character-based-fallback-expected.png b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/international/complex-character-based-fallback-expected.png
index c0fb79f2f..296aed1 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/international/complex-character-based-fallback-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/international/complex-character-based-fallback-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/international/danda-space-expected.png b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/international/danda-space-expected.png
index 085326f..c15cf95 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/international/danda-space-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/international/danda-space-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/international/hebrew-vowels-expected.png b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/international/hebrew-vowels-expected.png
index 6bc95ff..34b91be 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/international/hebrew-vowels-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/international/hebrew-vowels-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/international/khmer-selection-expected.png b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/international/khmer-selection-expected.png
index b63e881..8036146 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/international/khmer-selection-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/international/khmer-selection-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/international/lang-glyph-cache-separation-expected.png b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/international/lang-glyph-cache-separation-expected.png
index 596633d4b..d28e7f0 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/international/lang-glyph-cache-separation-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/international/lang-glyph-cache-separation-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/international/plane2-expected.png b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/international/plane2-expected.png
index ddcf4cc2..9480a53 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/international/plane2-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/international/plane2-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/international/pop-up-button-text-alignment-and-direction-expected.png b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/international/pop-up-button-text-alignment-and-direction-expected.png
index 8c06f50..2d219a71 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/international/pop-up-button-text-alignment-and-direction-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/international/pop-up-button-text-alignment-and-direction-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/international/rtl-caret-expected.png b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/international/rtl-caret-expected.png
index 28327b3..c2b5b4e 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/international/rtl-caret-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/international/rtl-caret-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/international/rtl-negative-letter-spacing-expected.png b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/international/rtl-negative-letter-spacing-expected.png
index 1c216f6..56dfc25 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/international/rtl-negative-letter-spacing-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/international/rtl-negative-letter-spacing-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/international/rtl-white-space-pre-wrap-expected.png b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/international/rtl-white-space-pre-wrap-expected.png
index 836c731..b94bdbee 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/international/rtl-white-space-pre-wrap-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/international/rtl-white-space-pre-wrap-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/international/text-combine-image-test-expected.png b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/international/text-combine-image-test-expected.png
index 53a3eb11..dd7af2cc 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/international/text-combine-image-test-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/international/text-combine-image-test-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/international/text-spliced-font-expected.png b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/international/text-spliced-font-expected.png
index dccdc9f..6d13822 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/international/text-spliced-font-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/international/text-spliced-font-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/international/thai-baht-space-expected.png b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/international/thai-baht-space-expected.png
index da7df3e..e1acdf2 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/international/thai-baht-space-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/international/thai-baht-space-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/international/thai-line-breaks-expected.png b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/international/thai-line-breaks-expected.png
index 04d78b81..299314a6 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/international/thai-line-breaks-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/international/thai-line-breaks-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/international/unicode-bidi-plaintext-expected.png b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/international/unicode-bidi-plaintext-expected.png
index e3b21b2..2f1117ef 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/international/unicode-bidi-plaintext-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/international/unicode-bidi-plaintext-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/international/unicode-bidi-plaintext-in-textarea-expected.png b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/international/unicode-bidi-plaintext-in-textarea-expected.png
index 7da46b7..eaea79a 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/international/unicode-bidi-plaintext-in-textarea-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/international/unicode-bidi-plaintext-in-textarea-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/international/wrap-CJK-001-expected.png b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/international/wrap-CJK-001-expected.png
index 1a4abf97..2707c46 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/international/wrap-CJK-001-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/international/wrap-CJK-001-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/justified-selection-at-edge-expected.png b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/justified-selection-at-edge-expected.png
index a6733dd..516fc91 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/justified-selection-at-edge-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/justified-selection-at-edge-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/justified-selection-expected.png b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/justified-selection-expected.png
index a985afa..3885540 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/justified-selection-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/justified-selection-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/justify-ideograph-complex-expected.png b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/justify-ideograph-complex-expected.png
index 93fe2fb0..9ffd03c 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/justify-ideograph-complex-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/justify-ideograph-complex-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/letter-spacing-negative-opacity-expected.png b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/letter-spacing-negative-opacity-expected.png
index e88edb3..1009b444 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/letter-spacing-negative-opacity-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/letter-spacing-negative-opacity-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/line-initial-and-final-swashes-expected.png b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/line-initial-and-final-swashes-expected.png
index 2e6728b2..1b7e00e3 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/line-initial-and-final-swashes-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/line-initial-and-final-swashes-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/line-initial-and-final-swashes-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/line-initial-and-final-swashes-expected.txt
index f5018ca..7b5e7d4 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/line-initial-and-final-swashes-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/line-initial-and-final-swashes-expected.txt
@@ -4,19 +4,19 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x600
     LayoutBlockFlow {BODY} at (8,8) size 784x584
       LayoutBlockFlow {P} at (0,0) size 784x18
-        LayoutText {#text} at (0,0) size 654x18
-          text run at (0,0) width 654: "The black text should be identical to, and overlap, the red text, so there should be no red pixels below."
+        LayoutText {#text} at (0,0) size 653x18
+          text run at (0,0) width 653: "The black text should be identical to, and overlap, the red text, so there should be no red pixels below."
       LayoutBlockFlow {DIV} at (0,34) size 784x144
         LayoutBlockFlow {DIV} at (0,0) size 784x144 [color=#FF0000]
           LayoutText {#text} at (0,0) size 332x144
             text run at (0,0) width 332: "v a\x{300} e"
         LayoutBlockFlow {DIV} at (0,0) size 784x144
-          LayoutText {#text} at (0,0) size 255x144
-            text run at (0,0) width 255: "v \x{E0} e"
+          LayoutText {#text} at (0,0) size 332x144
+            text run at (0,0) width 332: "v \x{E0} e"
       LayoutBlockFlow {DIV} at (0,178) size 784x144
         LayoutBlockFlow {DIV} at (0,0) size 784x144 [color=#FF0000]
           LayoutText {#text} at (0,0) size 358x144
             text run at (0,0) width 358: "v a\x{300} e"
         LayoutBlockFlow {DIV} at (0,0) size 784x144
-          LayoutText {#text} at (0,0) size 292x144
-            text run at (0,0) width 292: "v \x{E0} e"
+          LayoutText {#text} at (0,0) size 358x144
+            text run at (0,0) width 358: "v \x{E0} e"
diff --git a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/midword-break-after-breakable-char-expected.png b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/midword-break-after-breakable-char-expected.png
index f369169..210591b 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/midword-break-after-breakable-char-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/midword-break-after-breakable-char-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/midword-break-before-surrogate-pair-expected.png b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/midword-break-before-surrogate-pair-expected.png
index 20b2ed2..2f7212eb 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/midword-break-before-surrogate-pair-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/midword-break-before-surrogate-pair-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/midword-break-hang-expected.png b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/midword-break-hang-expected.png
index e3f6b27e..39a5c70 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/midword-break-hang-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/midword-break-hang-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/monospace-width-cache-expected.png b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/monospace-width-cache-expected.png
index f8d6e35..cd5fad8 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/monospace-width-cache-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/monospace-width-cache-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/reset-emptyRun-expected.png b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/reset-emptyRun-expected.png
index 2620f9a1..30c9456 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/reset-emptyRun-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/reset-emptyRun-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/selection-hard-linebreak-expected.png b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/selection-hard-linebreak-expected.png
index b7221325..14d922c8 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/selection-hard-linebreak-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/selection-hard-linebreak-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/shadow-translucent-fill-expected.png b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/shadow-translucent-fill-expected.png
index 3f210eed..f3f28ec 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/shadow-translucent-fill-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/shadow-translucent-fill-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/shaping/same-script-different-lang-expected.png b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/shaping/same-script-different-lang-expected.png
index 81c89e6..8d1011dc 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/shaping/same-script-different-lang-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/shaping/same-script-different-lang-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/shaping/shaping-selection-rect-expected.png b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/shaping/shaping-selection-rect-expected.png
index ef02652..3d22fd92 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/shaping/shaping-selection-rect-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/shaping/shaping-selection-rect-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/should-use-atsui-expected.png b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/should-use-atsui-expected.png
index 227e96b..8a4241c8 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/should-use-atsui-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/should-use-atsui-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/small-caps-turkish-expected.png b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/small-caps-turkish-expected.png
index b217ca9..3456a5a 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/small-caps-turkish-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/small-caps-turkish-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/soft-hyphen-3-expected.png b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/soft-hyphen-3-expected.png
index 498d27ae..ec53297c 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/soft-hyphen-3-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/soft-hyphen-3-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/stroking-decorations-expected.png b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/stroking-decorations-expected.png
index 6fbe0b9..e6c4b9a1 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/stroking-decorations-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/stroking-decorations-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/stroking-expected.png b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/stroking-expected.png
index bcb48c5..ba0be40 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/stroking-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/stroking-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/text-letter-spacing-expected.png b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/text-letter-spacing-expected.png
index 5d95f8d..6b0b405 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/text-letter-spacing-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/text-letter-spacing-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/text-shadow-no-default-color-expected.png b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/text-shadow-no-default-color-expected.png
index c759689..b5957ee 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/text-shadow-no-default-color-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/text-shadow-no-default-color-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/unicode-fallback-font-expected.png b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/unicode-fallback-font-expected.png
index 9860b836..ebbef95 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/unicode-fallback-font-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/unicode-fallback-font-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/unicode-fallback-font-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/unicode-fallback-font-expected.txt
index 72e3858..e654ff3 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/unicode-fallback-font-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/unicode-fallback-font-expected.txt
@@ -1,12 +1,12 @@
-layer at (0,0) size 800x600 clip at (0,0) size 785x600 scrollHeight 1220
+layer at (0,0) size 800x600 clip at (0,0) size 785x600 scrollHeight 1222
   LayoutView at (0,0) size 800x600
-layer at (0,0) size 785x1220 backgroundClip at (0,0) size 785x600 clip at (0,0) size 785x600
-  LayoutBlockFlow {HTML} at (0,0) size 785x1219.88
-    LayoutBlockFlow {BODY} at (8,21.44) size 769x1182.44
+layer at (0,0) size 785x1222 backgroundClip at (0,0) size 785x600 clip at (0,0) size 785x600
+  LayoutBlockFlow {HTML} at (0,0) size 785x1221.88
+    LayoutBlockFlow {BODY} at (8,21.44) size 769x1184.44
       LayoutBlockFlow {H1} at (0,0) size 769x37
         LayoutText {#text} at (0,0) size 236x37
           text run at (0,0) width 236: "Unicode Symbols"
-      LayoutBlockFlow {PRE} at (0,58.44) size 769x1072
+      LayoutBlockFlow {PRE} at (0,58.44) size 769x1074
         LayoutText {#text} at (0,0) size 297x105
           text run at (0,0) width 0: " "
           text run at (0,15) width 297: "U+16Ax \x{16A0} \x{16A1} \x{16A2} \x{16A3} \x{16A4} \x{16A5} \x{16A6} \x{16A7} \x{16A8} \x{16A9} \x{16AA} \x{16AB} \x{16AC} \x{16AD} \x{16AE} \x{16AF}"
@@ -21,7 +21,7 @@
           text run at (296,75) width 1: " "
           text run at (0,90) width 63: "U+16Fx \x{16F0}"
           text run at (62,90) width 1: " "
-        LayoutText {#text} at (0,105) size 297x120
+        LayoutText {#text} at (0,105) size 297x121
           text run at (0,105) width 0: " "
           text run at (0,120) width 258: "U+200x \x{2000} \x{2001} \x{2002} \x{2003} \x{2004} \x{2004} \x{2004} \x{2004} \x{2004} \x{2009} \x{200A} \x{200B} \x{200C} \x{200D} \x{200E} "
           text run at (257,120) width 1 RTL: "\x{200F}"
@@ -41,104 +41,104 @@
           text run at (296,180) width 1: " "
           text run at (0,195) width 297: "U+205x \x{2050} \x{2051} \x{2052} \x{2053} \x{2054} \x{2055} \x{2056} \x{2057} \x{2058} \x{2059} \x{205A} \x{205B} \x{205C} \x{205D} \x{205E} \x{205F}"
           text run at (296,195) width 1: " "
-          text run at (0,210) width 133: "U+206x \x{2060} \x{2061} \x{2062} \x{2063} \x{2064} \x{206A} \x{206B} \x{206C} \x{206D} \x{206E} \x{206F}"
-          text run at (132,210) width 1: " "
-        LayoutText {#text} at (0,225) size 375x324
-          text run at (0,225) width 0: " "
-          text run at (0,242) width 357: "U+260x \x{2600} \x{2601} \x{2602} \x{2603} \x{2604} \x{2605} \x{2606} \x{2607} \x{2608} \x{2609} \x{260A} \x{260B} \x{260C} \x{260D} \x{260E} \x{260F}"
-          text run at (356,242) width 1: " "
-          text run at (0,262) width 349: "U+261x \x{2610} \x{2611} \x{2612} \x{2613} \x{2614} \x{2615} \x{2616} \x{2617} \x{2618} \x{2619} \x{261A} \x{261B} \x{261C} \x{261D} \x{261E} \x{261F}"
-          text run at (348,262) width 1: " "
-          text run at (0,282) width 316: "U+262x \x{2620} \x{2621} \x{2622} \x{2623} \x{2624} \x{2625} \x{2626} \x{2627} \x{2628} \x{2629} \x{262A} \x{262B} \x{262C} \x{262D} \x{262E} \x{262F}"
-          text run at (315,282) width 1: " "
-          text run at (0,300) width 352: "U+263x \x{2630} \x{2631} \x{2632} \x{2633} \x{2634} \x{2635} \x{2636} \x{2637} \x{2638} \x{2639} \x{263A} \x{263B} \x{263C} \x{263D} \x{263E} \x{263F}"
-          text run at (351,300) width 1: " "
-          text run at (0,318) width 340: "U+264x \x{2640} \x{2641} \x{2642} \x{2643} \x{2644} \x{2645} \x{2646} \x{2647} \x{2648} \x{2649} \x{264A} \x{264B} \x{264C} \x{264D} \x{264E} \x{264F}"
-          text run at (339,318) width 1: " "
-          text run at (0,338) width 371: "U+265x \x{2650} \x{2651} \x{2652} \x{2653} \x{2654} \x{2655} \x{2656} \x{2657} \x{2658} \x{2659} \x{265A} \x{265B} \x{265C} \x{265D} \x{265E} \x{265F}"
-          text run at (370,338) width 1: " "
-          text run at (0,356) width 375: "U+266x \x{2660} \x{2661} \x{2662} \x{2663} \x{2664} \x{2665} \x{2666} \x{2667} \x{2668} \x{2669} \x{266A} \x{266B} \x{266C} \x{266D} \x{266E} \x{266F}"
-          text run at (374,356) width 1: " "
-          text run at (0,376) width 359: "U+267x \x{2670} \x{2671} \x{2672} \x{2673} \x{2674} \x{2675} \x{2676} \x{2677} \x{2678} \x{2679} \x{267A} \x{267B} \x{267C} \x{267D} \x{267E} \x{267F}"
-          text run at (358,376) width 1: " "
-          text run at (0,394) width 311: "U+268x \x{2680} \x{2681} \x{2682} \x{2683} \x{2684} \x{2685} \x{2686} \x{2687} \x{2688} \x{2689} \x{268A} \x{268B} \x{268C} \x{268D} \x{268E} \x{268F}"
-          text run at (311,394) width 0: " "
-          text run at (0,410) width 297: "U+269x \x{2690} \x{2691} \x{2692} \x{2693} \x{2694} \x{2695} \x{2696} \x{2697} \x{2698} \x{2699} \x{269A} \x{269B} \x{269C} \x{269D} \x{269E} \x{269F}"
-          text run at (296,410) width 1: " "
-          text run at (0,427) width 342: "U+26Ax \x{26A0} \x{26A1} \x{26A2} \x{26A3} \x{26A4} \x{26A5} \x{26A6} \x{26A7} \x{26A8} \x{26A9} \x{26AA} \x{26AB} \x{26AC} \x{26AD} \x{26AE} \x{26AF}"
-          text run at (341,427) width 1: " "
-          text run at (0,449) width 311: "U+26Bx \x{26B0} \x{26B1} \x{26B2} \x{26B3} \x{26B4} \x{26B5} \x{26B6} \x{26B7} \x{26B8} \x{26B9} \x{26BA} \x{26BB} \x{26BC} \x{26BD} \x{26BE} \x{26BF}"
-          text run at (310,449) width 1: " "
-          text run at (0,471) width 322: "U+26Cx \x{26C0} \x{26C1} \x{26C2} \x{26C3} \x{26C4} \x{26C5} \x{26C6} \x{26C7} \x{26C8} \x{26C9} \x{26CA} \x{26CB} \x{26CC} \x{26CD} \x{26CE} \x{26CF}"
-          text run at (321,471) width 1: " "
-          text run at (0,492) width 305: "U+26Dx \x{26D0} \x{26D1} \x{26D2} \x{26D3} \x{26D4} \x{26D5} \x{26D6} \x{26D7} \x{26D8} \x{26D9} \x{26DA} \x{26DB} \x{26DC} \x{26DD} \x{26DE} \x{26DF}"
-          text run at (304,492) width 1: " "
-          text run at (0,513) width 305: "U+26Ex \x{26E0} \x{26E1} \x{26E2} \x{26E3} \x{26E4} \x{26E5} \x{26E6} \x{26E7} \x{26E8} \x{26E9} \x{26EA} \x{26EB} \x{26EC} \x{26ED} \x{26EE} \x{26EF}"
-          text run at (304,513) width 1: " "
-          text run at (0,534) width 339: "U+26Fx \x{26F0} \x{26F1} \x{26F2} \x{26F3} \x{26F4} \x{26F5} \x{26F6} \x{26F7} \x{26F8} \x{26F9} \x{26FA} \x{26FB} \x{26FC} \x{26FD} \x{26FE} \x{26FF}"
-          text run at (338,534) width 1: " "
-        LayoutText {#text} at (0,551) size 364x229
-          text run at (0,551) width 0: " "
-          text run at (0,570) width 361: "U+270x \x{2700} \x{2701} \x{2702} \x{2703} \x{2704} \x{2705} \x{2706} \x{2707} \x{2708} \x{2709} \x{270A} \x{270B} \x{270C} \x{270D} \x{270E} \x{270F}"
-          text run at (360,570) width 1: " "
-          text run at (0,587) width 326: "U+271x \x{2710} \x{2711} \x{2712} \x{2713} \x{2714} \x{2715} \x{2716} \x{2717} \x{2718} \x{2719} \x{271A} \x{271B} \x{271C} \x{271D} \x{271E} \x{271F}"
-          text run at (325,587) width 1: " "
-          text run at (0,606) width 341: "U+272x \x{2720} \x{2721} \x{2722} \x{2723} \x{2724} \x{2725} \x{2726} \x{2727} \x{2728} \x{2729} \x{272A} \x{272B} \x{272C} \x{272D} \x{272E} \x{272F}"
-          text run at (340,606) width 1: " "
-          text run at (0,623) width 330: "U+273x \x{2730} \x{2731} \x{2732} \x{2733} \x{2734} \x{2735} \x{2736} \x{2737} \x{2738} \x{2739} \x{273A} \x{273B} \x{273C} \x{273D} \x{273E} \x{273F}"
-          text run at (329,623) width 1: " "
-          text run at (0,642) width 343: "U+274x \x{2740} \x{2741} \x{2742} \x{2743} \x{2744} \x{2745} \x{2746} \x{2747} \x{2748} \x{2749} \x{274A} \x{274B} \x{274C} \x{274D} \x{274E} \x{274F}"
-          text run at (342,642) width 1: " "
-          text run at (0,663) width 323: "U+275x \x{2750} \x{2751} \x{2752} \x{2753} \x{2754} \x{2755} \x{2756} \x{2757} \x{2758} \x{2759} \x{275A} \x{275B} \x{275C} \x{275D} \x{275E} \x{275F}"
-          text run at (322,663) width 1: " "
-          text run at (0,680) width 283: "U+276x \x{2760} \x{2761} \x{2762} \x{2763} \x{2764} \x{2765} \x{2766} \x{2767} \x{2768} \x{2769} \x{276A} \x{276B} \x{276C} \x{276D} \x{276E} \x{276F}"
-          text run at (282,680) width 1: " "
-          text run at (0,695) width 300: "U+277x \x{2770} \x{2771} \x{2772} \x{2773} \x{2774} \x{2775} \x{2776} \x{2777} \x{2778} \x{2779} \x{277A} \x{277B} \x{277C} \x{277D} \x{277E} \x{277F}"
-          text run at (299,695) width 1: " "
-          text run at (0,710) width 336: "U+278x \x{2780} \x{2781} \x{2782} \x{2783} \x{2784} \x{2785} \x{2786} \x{2787} \x{2788} \x{2789} \x{278A} \x{278B} \x{278C} \x{278D} \x{278E} \x{278F}"
-          text run at (335,710) width 1: " "
-          text run at (0,729) width 364: "U+279x \x{2790} \x{2791} \x{2792} \x{2793} \x{2794} \x{2795} \x{2796} \x{2797} \x{2798} \x{2799} \x{279A} \x{279B} \x{279C} \x{279D} \x{279E} \x{279F}"
-          text run at (363,729) width 1: " "
-          text run at (0,746) width 346: "U+27Ax \x{27A0} \x{27A1} \x{27A2} \x{27A3} \x{27A4} \x{27A5} \x{27A6} \x{27A7} \x{27A8} \x{27A9} \x{27AA} \x{27AB} \x{27AC} \x{27AD} \x{27AE} \x{27AF}"
-          text run at (345,746) width 1: " "
-          text run at (0,765) width 355: "U+27Bx \x{27B0} \x{27B1} \x{27B2} \x{27B3} \x{27B4} \x{27B5} \x{27B6} \x{27B7} \x{27B8} \x{27B9} \x{27BA} \x{27BB} \x{27BC} \x{27BD} \x{27BE} \x{27BF}"
-          text run at (354,765) width 1: " "
-        LayoutText {#text} at (0,782) size 328x290
-          text run at (0,782) width 0: " "
-          text run at (0,797) width 328: "U+2A0x \x{2A00} \x{2A01} \x{2A02} \x{2A03} \x{2A04} \x{2A05} \x{2A06} \x{2A07} \x{2A08} \x{2A09} \x{2A0A} \x{2A0B} \x{2A0C} \x{2A0D} \x{2A0E} \x{2A0F}"
-          text run at (327,797) width 1: " "
-          text run at (0,815) width 291: "U+2A1x \x{2A10} \x{2A11} \x{2A12} \x{2A13} \x{2A14} \x{2A15} \x{2A16} \x{2A17} \x{2A18} \x{2A19} \x{2A1A} \x{2A1B} \x{2A1C} \x{2A1D} \x{2A1E} \x{2A1F}"
-          text run at (290,815) width 1: " "
-          text run at (0,833) width 293: "U+2A2x \x{2A20} \x{2A21} \x{2A22} \x{2A23} \x{2A24} \x{2A25} \x{2A26} \x{2A27} \x{2A28} \x{2A29} \x{2A2A} \x{2A2B} \x{2A2C} \x{2A2D} \x{2A2E} \x{2A2F}"
-          text run at (292,833) width 1: " "
-          text run at (0,849) width 312: "U+2A3x \x{2A30} \x{2A31} \x{2A32} \x{2A33} \x{2A34} \x{2A35} \x{2A36} \x{2A37} \x{2A38} \x{2A39} \x{2A3A} \x{2A3B} \x{2A3C} \x{2A3D} \x{2A3E} \x{2A3F}"
-          text run at (311,849) width 1: " "
-          text run at (0,865) width 287: "U+2A4x \x{2A40} \x{2A41} \x{2A42} \x{2A43} \x{2A44} \x{2A45} \x{2A46} \x{2A47} \x{2A48} \x{2A49} \x{2A4A} \x{2A4B} \x{2A4C} \x{2A4D} \x{2A4E} \x{2A4F}"
-          text run at (286,865) width 1: " "
-          text run at (0,881) width 311: "U+2A5x \x{2A50} \x{2A51} \x{2A52} \x{2A53} \x{2A54} \x{2A55} \x{2A56} \x{2A57} \x{2A58} \x{2A59} \x{2A5A} \x{2A5B} \x{2A5C} \x{2A5D} \x{2A5E} \x{2A5F}"
-          text run at (310,881) width 1: " "
-          text run at (0,897) width 290: "U+2A6x \x{2A60} \x{2A61} \x{2A62} \x{2A63} \x{2A64} \x{2A65} \x{2A66} \x{2A67} \x{2A68} \x{2A69} \x{2A6A} \x{2A6B} \x{2A6C} \x{2A6D} \x{2A6E} \x{2A6F}"
-          text run at (289,897) width 1: " "
-          text run at (0,913) width 310: "U+2A7x \x{2A70} \x{2A71} \x{2A72} \x{2A73} \x{2A74} \x{2A75} \x{2A76} \x{2A77} \x{2A78} \x{2A79} \x{2A7A} \x{2A7B} \x{2A7C} \x{2A7D} \x{2A7E} \x{2A7F}"
-          text run at (309,913) width 1: " "
-          text run at (0,929) width 286: "U+2A8x \x{2A80} \x{2A81} \x{2A82} \x{2A83} \x{2A84} \x{2A85} \x{2A86} \x{2A87} \x{2A88} \x{2A89} \x{2A8A} \x{2A8B} \x{2A8C} \x{2A8D} \x{2A8E} \x{2A8F}"
-          text run at (285,929) width 1: " "
-          text run at (0,945) width 285: "U+2A9x \x{2A90} \x{2A91} \x{2A92} \x{2A93} \x{2A94} \x{2A95} \x{2A96} \x{2A97} \x{2A98} \x{2A99} \x{2A9A} \x{2A9B} \x{2A9C} \x{2A9D} \x{2A9E} \x{2A9F}"
-          text run at (284,945) width 1: " "
-          text run at (0,961) width 301: "U+2AAx \x{2AA0} \x{2AA1} \x{2AA2} \x{2AA3} \x{2AA4} \x{2AA5} \x{2AA6} \x{2AA7} \x{2AA8} \x{2AA9} \x{2AAA} \x{2AAB} \x{2AAC} \x{2AAD} \x{2AAE} \x{2AAF}"
-          text run at (300,961) width 1: " "
-          text run at (0,977) width 295: "U+2ABx \x{2AB0} \x{2AB1} \x{2AB2} \x{2AB3} \x{2AB4} \x{2AB5} \x{2AB6} \x{2AB7} \x{2AB8} \x{2AB9} \x{2ABA} \x{2ABB} \x{2ABC} \x{2ABD} \x{2ABE} \x{2ABF}"
-          text run at (294,977) width 1: " "
-          text run at (0,993) width 286: "U+2ACx \x{2AC0} \x{2AC1} \x{2AC2} \x{2AC3} \x{2AC4} \x{2AC5} \x{2AC6} \x{2AC7} \x{2AC8} \x{2AC9} \x{2ACA} \x{2ACB} \x{2ACC} \x{2ACD} \x{2ACE} \x{2ACF}"
-          text run at (285,993) width 1: " "
-          text run at (0,1009) width 293: "U+2ADx \x{2AD0} \x{2AD1} \x{2AD2} \x{2AD3} \x{2AD4} \x{2AD5} \x{2AD6} \x{2AD7} \x{2AD8} \x{2AD9} \x{2ADA} \x{2ADB} \x{2ADC} \x{2ADD} \x{2ADE} \x{2ADF}"
-          text run at (292,1009) width 1: " "
-          text run at (0,1025) width 303: "U+2AEx \x{2AE0} \x{2AE1} \x{2AE2} \x{2AE3} \x{2AE4} \x{2AE5} \x{2AE6} \x{2AE7} \x{2AE8} \x{2AE9} \x{2AEA} \x{2AEB} \x{2AEC} \x{2AED} \x{2AEE} \x{2AEF}"
-          text run at (302,1025) width 1: " "
-          text run at (0,1041) width 270: "U+2AFx \x{2AF0} \x{2AF1} \x{2AF2} \x{2AF3} \x{2AF4} \x{2AF5} \x{2AF6} \x{2AF7} \x{2AF8} \x{2AF9} \x{2AFA} \x{2AFB} \x{2AFC} \x{2AFD} \x{2AFE} \x{2AFF}"
-          text run at (269,1041) width 1: " "
-          text run at (0,1057) width 63: "        "
-      LayoutBlockFlow {P} at (0,1146.44) size 769x36
+          text run at (0,211) width 133: "U+206x \x{2060} \x{2061} \x{2062} \x{2063} \x{2064} \x{206A} \x{206B} \x{206C} \x{206D} \x{206E} \x{206F}"
+          text run at (132,211) width 1: " "
+        LayoutText {#text} at (0,227) size 375x324
+          text run at (0,227) width 0: " "
+          text run at (0,244) width 357: "U+260x \x{2600} \x{2601} \x{2602} \x{2603} \x{2604} \x{2605} \x{2606} \x{2607} \x{2608} \x{2609} \x{260A} \x{260B} \x{260C} \x{260D} \x{260E} \x{260F}"
+          text run at (356,244) width 1: " "
+          text run at (0,264) width 349: "U+261x \x{2610} \x{2611} \x{2612} \x{2613} \x{2614} \x{2615} \x{2616} \x{2617} \x{2618} \x{2619} \x{261A} \x{261B} \x{261C} \x{261D} \x{261E} \x{261F}"
+          text run at (348,264) width 1: " "
+          text run at (0,284) width 316: "U+262x \x{2620} \x{2621} \x{2622} \x{2623} \x{2624} \x{2625} \x{2626} \x{2627} \x{2628} \x{2629} \x{262A} \x{262B} \x{262C} \x{262D} \x{262E} \x{262F}"
+          text run at (315,284) width 1: " "
+          text run at (0,302) width 352: "U+263x \x{2630} \x{2631} \x{2632} \x{2633} \x{2634} \x{2635} \x{2636} \x{2637} \x{2638} \x{2639} \x{263A} \x{263B} \x{263C} \x{263D} \x{263E} \x{263F}"
+          text run at (351,302) width 1: " "
+          text run at (0,320) width 340: "U+264x \x{2640} \x{2641} \x{2642} \x{2643} \x{2644} \x{2645} \x{2646} \x{2647} \x{2648} \x{2649} \x{264A} \x{264B} \x{264C} \x{264D} \x{264E} \x{264F}"
+          text run at (339,320) width 1: " "
+          text run at (0,340) width 371: "U+265x \x{2650} \x{2651} \x{2652} \x{2653} \x{2654} \x{2655} \x{2656} \x{2657} \x{2658} \x{2659} \x{265A} \x{265B} \x{265C} \x{265D} \x{265E} \x{265F}"
+          text run at (370,340) width 1: " "
+          text run at (0,358) width 375: "U+266x \x{2660} \x{2661} \x{2662} \x{2663} \x{2664} \x{2665} \x{2666} \x{2667} \x{2668} \x{2669} \x{266A} \x{266B} \x{266C} \x{266D} \x{266E} \x{266F}"
+          text run at (374,358) width 1: " "
+          text run at (0,378) width 359: "U+267x \x{2670} \x{2671} \x{2672} \x{2673} \x{2674} \x{2675} \x{2676} \x{2677} \x{2678} \x{2679} \x{267A} \x{267B} \x{267C} \x{267D} \x{267E} \x{267F}"
+          text run at (358,378) width 1: " "
+          text run at (0,396) width 311: "U+268x \x{2680} \x{2681} \x{2682} \x{2683} \x{2684} \x{2685} \x{2686} \x{2687} \x{2688} \x{2689} \x{268A} \x{268B} \x{268C} \x{268D} \x{268E} \x{268F}"
+          text run at (311,396) width 0: " "
+          text run at (0,412) width 297: "U+269x \x{2690} \x{2691} \x{2692} \x{2693} \x{2694} \x{2695} \x{2696} \x{2697} \x{2698} \x{2699} \x{269A} \x{269B} \x{269C} \x{269D} \x{269E} \x{269F}"
+          text run at (296,412) width 1: " "
+          text run at (0,429) width 342: "U+26Ax \x{26A0} \x{26A1} \x{26A2} \x{26A3} \x{26A4} \x{26A5} \x{26A6} \x{26A7} \x{26A8} \x{26A9} \x{26AA} \x{26AB} \x{26AC} \x{26AD} \x{26AE} \x{26AF}"
+          text run at (341,429) width 1: " "
+          text run at (0,451) width 307: "U+26Bx \x{26B0} \x{26B1} \x{26B2} \x{26B3} \x{26B4} \x{26B5} \x{26B6} \x{26B7} \x{26B8} \x{26B9} \x{26BA} \x{26BB} \x{26BC} \x{26BD} \x{26BE} \x{26BF}"
+          text run at (306,451) width 1: " "
+          text run at (0,473) width 313: "U+26Cx \x{26C0} \x{26C1} \x{26C2} \x{26C3} \x{26C4} \x{26C5} \x{26C6} \x{26C7} \x{26C8} \x{26C9} \x{26CA} \x{26CB} \x{26CC} \x{26CD} \x{26CE} \x{26CF}"
+          text run at (312,473) width 1: " "
+          text run at (0,494) width 302: "U+26Dx \x{26D0} \x{26D1} \x{26D2} \x{26D3} \x{26D4} \x{26D5} \x{26D6} \x{26D7} \x{26D8} \x{26D9} \x{26DA} \x{26DB} \x{26DC} \x{26DD} \x{26DE} \x{26DF}"
+          text run at (301,494) width 1: " "
+          text run at (0,515) width 302: "U+26Ex \x{26E0} \x{26E1} \x{26E2} \x{26E3} \x{26E4} \x{26E5} \x{26E6} \x{26E7} \x{26E8} \x{26E9} \x{26EA} \x{26EB} \x{26EC} \x{26ED} \x{26EE} \x{26EF}"
+          text run at (301,515) width 1: " "
+          text run at (0,536) width 323: "U+26Fx \x{26F0} \x{26F1} \x{26F2} \x{26F3} \x{26F4} \x{26F5} \x{26F6} \x{26F7} \x{26F8} \x{26F9} \x{26FA} \x{26FB} \x{26FC} \x{26FD} \x{26FE} \x{26FF}"
+          text run at (322,536) width 1: " "
+        LayoutText {#text} at (0,553) size 354x229
+          text run at (0,553) width 0: " "
+          text run at (0,572) width 351: "U+270x \x{2700} \x{2701} \x{2702} \x{2703} \x{2704} \x{2705} \x{2706} \x{2707} \x{2708} \x{2709} \x{270A} \x{270B} \x{270C} \x{270D} \x{270E} \x{270F}"
+          text run at (350,572) width 1: " "
+          text run at (0,589) width 326: "U+271x \x{2710} \x{2711} \x{2712} \x{2713} \x{2714} \x{2715} \x{2716} \x{2717} \x{2718} \x{2719} \x{271A} \x{271B} \x{271C} \x{271D} \x{271E} \x{271F}"
+          text run at (325,589) width 1: " "
+          text run at (0,608) width 338: "U+272x \x{2720} \x{2721} \x{2722} \x{2723} \x{2724} \x{2725} \x{2726} \x{2727} \x{2728} \x{2729} \x{272A} \x{272B} \x{272C} \x{272D} \x{272E} \x{272F}"
+          text run at (337,608) width 1: " "
+          text run at (0,625) width 330: "U+273x \x{2730} \x{2731} \x{2732} \x{2733} \x{2734} \x{2735} \x{2736} \x{2737} \x{2738} \x{2739} \x{273A} \x{273B} \x{273C} \x{273D} \x{273E} \x{273F}"
+          text run at (329,625) width 1: " "
+          text run at (0,644) width 337: "U+274x \x{2740} \x{2741} \x{2742} \x{2743} \x{2744} \x{2745} \x{2746} \x{2747} \x{2748} \x{2749} \x{274A} \x{274B} \x{274C} \x{274D} \x{274E} \x{274F}"
+          text run at (336,644) width 1: " "
+          text run at (0,665) width 310: "U+275x \x{2750} \x{2751} \x{2752} \x{2753} \x{2754} \x{2755} \x{2756} \x{2757} \x{2758} \x{2759} \x{275A} \x{275B} \x{275C} \x{275D} \x{275E} \x{275F}"
+          text run at (309,665) width 1: " "
+          text run at (0,682) width 283: "U+276x \x{2760} \x{2761} \x{2762} \x{2763} \x{2764} \x{2765} \x{2766} \x{2767} \x{2768} \x{2769} \x{276A} \x{276B} \x{276C} \x{276D} \x{276E} \x{276F}"
+          text run at (282,682) width 1: " "
+          text run at (0,697) width 300: "U+277x \x{2770} \x{2771} \x{2772} \x{2773} \x{2774} \x{2775} \x{2776} \x{2777} \x{2778} \x{2779} \x{277A} \x{277B} \x{277C} \x{277D} \x{277E} \x{277F}"
+          text run at (299,697) width 1: " "
+          text run at (0,712) width 336: "U+278x \x{2780} \x{2781} \x{2782} \x{2783} \x{2784} \x{2785} \x{2786} \x{2787} \x{2788} \x{2789} \x{278A} \x{278B} \x{278C} \x{278D} \x{278E} \x{278F}"
+          text run at (335,712) width 1: " "
+          text run at (0,731) width 354: "U+279x \x{2790} \x{2791} \x{2792} \x{2793} \x{2794} \x{2795} \x{2796} \x{2797} \x{2798} \x{2799} \x{279A} \x{279B} \x{279C} \x{279D} \x{279E} \x{279F}"
+          text run at (353,731) width 1: " "
+          text run at (0,748) width 346: "U+27Ax \x{27A0} \x{27A1} \x{27A2} \x{27A3} \x{27A4} \x{27A5} \x{27A6} \x{27A7} \x{27A8} \x{27A9} \x{27AA} \x{27AB} \x{27AC} \x{27AD} \x{27AE} \x{27AF}"
+          text run at (345,748) width 1: " "
+          text run at (0,767) width 352: "U+27Bx \x{27B0} \x{27B1} \x{27B2} \x{27B3} \x{27B4} \x{27B5} \x{27B6} \x{27B7} \x{27B8} \x{27B9} \x{27BA} \x{27BB} \x{27BC} \x{27BD} \x{27BE} \x{27BF}"
+          text run at (351,767) width 1: " "
+        LayoutText {#text} at (0,784) size 328x290
+          text run at (0,784) width 0: " "
+          text run at (0,799) width 328: "U+2A0x \x{2A00} \x{2A01} \x{2A02} \x{2A03} \x{2A04} \x{2A05} \x{2A06} \x{2A07} \x{2A08} \x{2A09} \x{2A0A} \x{2A0B} \x{2A0C} \x{2A0D} \x{2A0E} \x{2A0F}"
+          text run at (327,799) width 1: " "
+          text run at (0,817) width 291: "U+2A1x \x{2A10} \x{2A11} \x{2A12} \x{2A13} \x{2A14} \x{2A15} \x{2A16} \x{2A17} \x{2A18} \x{2A19} \x{2A1A} \x{2A1B} \x{2A1C} \x{2A1D} \x{2A1E} \x{2A1F}"
+          text run at (290,817) width 1: " "
+          text run at (0,835) width 293: "U+2A2x \x{2A20} \x{2A21} \x{2A22} \x{2A23} \x{2A24} \x{2A25} \x{2A26} \x{2A27} \x{2A28} \x{2A29} \x{2A2A} \x{2A2B} \x{2A2C} \x{2A2D} \x{2A2E} \x{2A2F}"
+          text run at (292,835) width 1: " "
+          text run at (0,851) width 312: "U+2A3x \x{2A30} \x{2A31} \x{2A32} \x{2A33} \x{2A34} \x{2A35} \x{2A36} \x{2A37} \x{2A38} \x{2A39} \x{2A3A} \x{2A3B} \x{2A3C} \x{2A3D} \x{2A3E} \x{2A3F}"
+          text run at (311,851) width 1: " "
+          text run at (0,867) width 287: "U+2A4x \x{2A40} \x{2A41} \x{2A42} \x{2A43} \x{2A44} \x{2A45} \x{2A46} \x{2A47} \x{2A48} \x{2A49} \x{2A4A} \x{2A4B} \x{2A4C} \x{2A4D} \x{2A4E} \x{2A4F}"
+          text run at (286,867) width 1: " "
+          text run at (0,883) width 311: "U+2A5x \x{2A50} \x{2A51} \x{2A52} \x{2A53} \x{2A54} \x{2A55} \x{2A56} \x{2A57} \x{2A58} \x{2A59} \x{2A5A} \x{2A5B} \x{2A5C} \x{2A5D} \x{2A5E} \x{2A5F}"
+          text run at (310,883) width 1: " "
+          text run at (0,899) width 290: "U+2A6x \x{2A60} \x{2A61} \x{2A62} \x{2A63} \x{2A64} \x{2A65} \x{2A66} \x{2A67} \x{2A68} \x{2A69} \x{2A6A} \x{2A6B} \x{2A6C} \x{2A6D} \x{2A6E} \x{2A6F}"
+          text run at (289,899) width 1: " "
+          text run at (0,915) width 310: "U+2A7x \x{2A70} \x{2A71} \x{2A72} \x{2A73} \x{2A74} \x{2A75} \x{2A76} \x{2A77} \x{2A78} \x{2A79} \x{2A7A} \x{2A7B} \x{2A7C} \x{2A7D} \x{2A7E} \x{2A7F}"
+          text run at (309,915) width 1: " "
+          text run at (0,931) width 286: "U+2A8x \x{2A80} \x{2A81} \x{2A82} \x{2A83} \x{2A84} \x{2A85} \x{2A86} \x{2A87} \x{2A88} \x{2A89} \x{2A8A} \x{2A8B} \x{2A8C} \x{2A8D} \x{2A8E} \x{2A8F}"
+          text run at (285,931) width 1: " "
+          text run at (0,947) width 285: "U+2A9x \x{2A90} \x{2A91} \x{2A92} \x{2A93} \x{2A94} \x{2A95} \x{2A96} \x{2A97} \x{2A98} \x{2A99} \x{2A9A} \x{2A9B} \x{2A9C} \x{2A9D} \x{2A9E} \x{2A9F}"
+          text run at (284,947) width 1: " "
+          text run at (0,963) width 301: "U+2AAx \x{2AA0} \x{2AA1} \x{2AA2} \x{2AA3} \x{2AA4} \x{2AA5} \x{2AA6} \x{2AA7} \x{2AA8} \x{2AA9} \x{2AAA} \x{2AAB} \x{2AAC} \x{2AAD} \x{2AAE} \x{2AAF}"
+          text run at (300,963) width 1: " "
+          text run at (0,979) width 295: "U+2ABx \x{2AB0} \x{2AB1} \x{2AB2} \x{2AB3} \x{2AB4} \x{2AB5} \x{2AB6} \x{2AB7} \x{2AB8} \x{2AB9} \x{2ABA} \x{2ABB} \x{2ABC} \x{2ABD} \x{2ABE} \x{2ABF}"
+          text run at (294,979) width 1: " "
+          text run at (0,995) width 286: "U+2ACx \x{2AC0} \x{2AC1} \x{2AC2} \x{2AC3} \x{2AC4} \x{2AC5} \x{2AC6} \x{2AC7} \x{2AC8} \x{2AC9} \x{2ACA} \x{2ACB} \x{2ACC} \x{2ACD} \x{2ACE} \x{2ACF}"
+          text run at (285,995) width 1: " "
+          text run at (0,1011) width 293: "U+2ADx \x{2AD0} \x{2AD1} \x{2AD2} \x{2AD3} \x{2AD4} \x{2AD5} \x{2AD6} \x{2AD7} \x{2AD8} \x{2AD9} \x{2ADA} \x{2ADB} \x{2ADC} \x{2ADD} \x{2ADE} \x{2ADF}"
+          text run at (292,1011) width 1: " "
+          text run at (0,1027) width 303: "U+2AEx \x{2AE0} \x{2AE1} \x{2AE2} \x{2AE3} \x{2AE4} \x{2AE5} \x{2AE6} \x{2AE7} \x{2AE8} \x{2AE9} \x{2AEA} \x{2AEB} \x{2AEC} \x{2AED} \x{2AEE} \x{2AEF}"
+          text run at (302,1027) width 1: " "
+          text run at (0,1043) width 270: "U+2AFx \x{2AF0} \x{2AF1} \x{2AF2} \x{2AF3} \x{2AF4} \x{2AF5} \x{2AF6} \x{2AF7} \x{2AF8} \x{2AF9} \x{2AFA} \x{2AFB} \x{2AFC} \x{2AFD} \x{2AFE} \x{2AFF}"
+          text run at (269,1043) width 1: " "
+          text run at (0,1059) width 63: "        "
+      LayoutBlockFlow {P} at (0,1148.44) size 769x36
         LayoutText {#text} at (0,0) size 764x36
           text run at (0,0) width 764: "A series of unicode symbols (Runic, General Punctuation, Miscellaneous Symbols, and Mathematical Symbols) should"
           text run at (0,18) width 108: "be shown above."
diff --git a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/vertical-rl-rtl-linebreak-expected.png b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/vertical-rl-rtl-linebreak-expected.png
index fe381a6..d484b53f 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/vertical-rl-rtl-linebreak-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/vertical-rl-rtl-linebreak-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/wbr-expected.png b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/wbr-expected.png
index f8898c2..ee5a57c 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/wbr-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/wbr-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/wbr-in-pre-crash-expected.png b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/wbr-in-pre-crash-expected.png
index d2f00f92..92df84f 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/wbr-in-pre-crash-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/wbr-in-pre-crash-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/wbr-styled-expected.png b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/wbr-styled-expected.png
index 4ba2a38..add58d4 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/wbr-styled-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/wbr-styled-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/whitespace/003-expected.png b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/whitespace/003-expected.png
index cfac73f..dba5f51 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/whitespace/003-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/whitespace/003-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/whitespace/004-expected.png b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/whitespace/004-expected.png
index b0bd2bff..7b53c43 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/whitespace/004-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/whitespace/004-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/whitespace/005-expected.png b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/whitespace/005-expected.png
index b0bd2bff..7b53c43 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/whitespace/005-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/whitespace/005-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/whitespace/006-expected.png b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/whitespace/006-expected.png
index 174ba066..bb411a2a 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/whitespace/006-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/whitespace/006-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/whitespace/007-expected.png b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/whitespace/007-expected.png
index e7ada24..01671a43 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/whitespace/007-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/whitespace/007-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/whitespace/008-expected.png b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/whitespace/008-expected.png
index dc070d7..3ce420d 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/whitespace/008-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/whitespace/008-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/whitespace/009-expected.png b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/whitespace/009-expected.png
index 013cc73..a8857b9 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/whitespace/009-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/whitespace/009-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/whitespace/010-expected.png b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/whitespace/010-expected.png
index b0bd2bff..7b53c43 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/whitespace/010-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/whitespace/010-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/whitespace/011-expected.png b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/whitespace/011-expected.png
index b0bd2bff..7b53c43 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/whitespace/011-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/whitespace/011-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/whitespace/015-expected.png b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/whitespace/015-expected.png
index b0bd2bff..7b53c43 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/whitespace/015-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/whitespace/015-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/whitespace/016-expected.png b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/whitespace/016-expected.png
index b0bd2bff..7b53c43 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/whitespace/016-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/whitespace/016-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/whitespace/018-expected.png b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/whitespace/018-expected.png
index 06222ee..bbc873e0 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/whitespace/018-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/whitespace/018-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/whitespace/020-expected.png b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/whitespace/020-expected.png
index 0bc99f5..c8f0eb2 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/whitespace/020-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/whitespace/020-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/whitespace/021-expected.png b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/whitespace/021-expected.png
index 408e1ec..d4dd6a8 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/whitespace/021-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/whitespace/021-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/whitespace/024-expected.png b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/whitespace/024-expected.png
index 0c673aa9..e6f24cf 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/whitespace/024-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/whitespace/024-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/whitespace/027-expected.png b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/whitespace/027-expected.png
index 477e6d1..6d874fb 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/whitespace/027-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/whitespace/027-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/whitespace/030-expected.png b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/whitespace/030-expected.png
index aec89502..9899163 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/whitespace/030-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/whitespace/030-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/whitespace/pre-break-word-expected.png b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/whitespace/pre-break-word-expected.png
index 9e508c7..49cafa2 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/whitespace/pre-break-word-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/whitespace/pre-break-word-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/whitespace/pre-wrap-last-char-expected.png b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/whitespace/pre-wrap-last-char-expected.png
index 3298f21..8c219a87 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/whitespace/pre-wrap-last-char-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/whitespace/pre-wrap-last-char-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/whitespace/pre-wrap-line-test-expected.png b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/whitespace/pre-wrap-line-test-expected.png
index 7c13f3d..7968ede 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/whitespace/pre-wrap-line-test-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/whitespace/pre-wrap-line-test-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/whitespace/pre-wrap-overflow-selection-expected.png b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/whitespace/pre-wrap-overflow-selection-expected.png
index 84bde01..098f6af6 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/whitespace/pre-wrap-overflow-selection-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/whitespace/pre-wrap-overflow-selection-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/whitespace/pre-wrap-spaces-after-newline-expected.png b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/whitespace/pre-wrap-spaces-after-newline-expected.png
index 68856d81..008db7c 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/whitespace/pre-wrap-spaces-after-newline-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/whitespace/pre-wrap-spaces-after-newline-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/whitespace/span-in-word-space-causes-overflow-expected.png b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/whitespace/span-in-word-space-causes-overflow-expected.png
index 48a984b..245b20a6 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/whitespace/span-in-word-space-causes-overflow-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/whitespace/span-in-word-space-causes-overflow-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/wide-zero-width-space-expected.png b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/wide-zero-width-space-expected.png
index ffdc1b6..41ca2b0 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/wide-zero-width-space-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/wide-zero-width-space-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/word-break-expected.png b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/word-break-expected.png
index 2d7dae27..758a8fd 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/word-break-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/word-break-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/word-break-run-rounding-expected.png b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/word-break-run-rounding-expected.png
index dcb9439..5498481 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/word-break-run-rounding-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/word-break-run-rounding-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/word-break-soft-hyphen-expected.png b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/word-break-soft-hyphen-expected.png
index f0aef5d9d..4bb0015bf 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/word-break-soft-hyphen-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/word-break-soft-hyphen-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/word-space-expected.png b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/word-space-expected.png
index b537e85..7ba052e 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/word-space-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/word-space-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/zero-font-size-expected.png b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/zero-font-size-expected.png
index 4f4b39ea..4541196 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/zero-font-size-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-lion/fast/text/zero-font-size-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/capitalize-boundaries-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/capitalize-boundaries-expected.png
index 1b9ec6db..f97ea28 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/capitalize-boundaries-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/capitalize-boundaries-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/caps-lock-indicator-disabled-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/caps-lock-indicator-disabled-expected.png
index 134191b..21bde54 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/caps-lock-indicator-disabled-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/caps-lock-indicator-disabled-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/caps-lock-indicator-disabled-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/caps-lock-indicator-disabled-expected.txt
index ac670ef..43084d7 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/caps-lock-indicator-disabled-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/caps-lock-indicator-disabled-expected.txt
@@ -3,9 +3,9 @@
 layer at (0,0) size 800x53
   LayoutBlockFlow {HTML} at (0,0) size 800x53
     LayoutBlockFlow {BODY} at (8,8) size 784x37
-      LayoutText {#text} at (0,0) size 587x18
-        text run at (0,0) width 587: "Test passes if password field does not include caps lock icon on right edge on any platform."
-      LayoutBR {BR} at (586,0) size 1x18
+      LayoutText {#text} at (0,0) size 585x18
+        text run at (0,0) width 585: "Test passes if password field does not include caps lock icon on right edge on any platform."
+      LayoutBR {BR} at (584,0) size 1x18
       LayoutTextControl {INPUT} at (0,18) size 123x19 [bgcolor=#FFFFFF] [border: (2px inset #EEEEEE)]
       LayoutText {#text} at (0,0) size 0x0
       LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/caps-lock-indicator-enabled-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/caps-lock-indicator-enabled-expected.png
index 07b9714b..fb5ab79 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/caps-lock-indicator-enabled-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/caps-lock-indicator-enabled-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/caps-lock-indicator-enabled-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/caps-lock-indicator-enabled-expected.txt
index 56041033..4974311 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/caps-lock-indicator-enabled-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/caps-lock-indicator-enabled-expected.txt
@@ -3,9 +3,9 @@
 layer at (0,0) size 800x53
   LayoutBlockFlow {HTML} at (0,0) size 800x53
     LayoutBlockFlow {BODY} at (8,8) size 784x37
-      LayoutText {#text} at (0,0) size 580x18
-        text run at (0,0) width 580: "Test passes if password field includes caps lock icon on right edge on Mac platforms only."
-      LayoutBR {BR} at (579,0) size 1x18
+      LayoutText {#text} at (0,0) size 577x18
+        text run at (0,0) width 577: "Test passes if password field includes caps lock icon on right edge on Mac platforms only."
+      LayoutBR {BR} at (576,0) size 1x18
       LayoutTextControl {INPUT} at (0,18) size 123x19 [bgcolor=#FFFFFF] [border: (2px inset #EEEEEE)]
       LayoutText {#text} at (0,0) size 0x0
       LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/decorations-with-text-combine-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/decorations-with-text-combine-expected.txt
new file mode 100644
index 0000000..07f250f
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/decorations-with-text-combine-expected.txt
@@ -0,0 +1,153 @@
+layer at (0,0) size 800x600
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  LayoutBlockFlow {HTML} at (0,0) size 800x600
+    LayoutBlockFlow {BODY} at (8,8) size 782x584
+      LayoutBlockFlow {DIV} at (0,0) size 82x584
+        LayoutBlockFlow {DIV} at (0,0) size 36x584
+          LayoutText {#text} at (6,0) size 24x72
+            text run at (6,0) width 72: "\x{305D}\x{306E}\x{5973}"
+          LayoutInline {SPAN} at (0,0) size 24x24 [color=#0000FF]
+            LayoutTextCombine {#text} at (6,72) size 24x24
+              text run at (6,72) width 24: "1"
+          LayoutText {#text} at (6,96) size 24x48
+            text run at (6,96) width 48: "\x{304C}\x{306D}"
+          LayoutInline {SPAN} at (0,0) size 24x24 [color=#0000FF]
+            LayoutTextCombine {#text} at (6,144) size 24x24
+              text run at (6,144) width 24: "123"
+          LayoutText {#text} at (6,168) size 24x120
+            text run at (6,168) width 120: "\x{304B}\x{3057}\x{3064}\x{3051}\x{306B}"
+          LayoutInline {SPAN} at (0,0) size 24x24 [color=#0000FF]
+            LayoutTextCombine {#text} at (6,288) size 24x24
+              text run at (6,288) width 24: "12345"
+          LayoutText {#text} at (6,312) size 24x168
+            text run at (6,312) width 168: "\x{6765}\x{3066}\x{304F}\x{308C}\x{308B}\x{307E}\x{3067}"
+        LayoutBlockFlow {DIV} at (46,0) size 36x584
+          LayoutText {#text} at (6,0) size 24x72
+            text run at (6,0) width 72: "\x{305D}\x{306E}\x{5973}"
+          LayoutInline {SPAN} at (0,0) size 24x24 [color=#0000FF]
+            LayoutTextCombine {#text} at (6,72) size 24x24
+              text run at (6,72) width 24: "1"
+          LayoutText {#text} at (6,96) size 24x48
+            text run at (6,96) width 48: "\x{304C}\x{306D}"
+          LayoutInline {SPAN} at (0,0) size 24x24 [color=#0000FF]
+            LayoutTextCombine {#text} at (6,144) size 24x24
+              text run at (6,144) width 24: "123"
+          LayoutText {#text} at (6,168) size 24x120
+            text run at (6,168) width 120: "\x{304B}\x{3057}\x{3064}\x{3051}\x{306B}"
+          LayoutInline {SPAN} at (0,0) size 24x24 [color=#0000FF]
+            LayoutTextCombine {#text} at (6,288) size 24x24
+              text run at (6,288) width 24: "12345"
+          LayoutText {#text} at (6,312) size 24x168
+            text run at (6,312) width 168: "\x{6765}\x{3066}\x{304F}\x{308C}\x{308B}\x{307E}\x{3067}"
+      LayoutBlockFlow {DIV} at (92,0) size 82x584
+        LayoutBlockFlow {DIV} at (0,0) size 36x584
+          LayoutText {#text} at (6,0) size 24x72
+            text run at (6,0) width 72: "\x{305D}\x{306E}\x{5973}"
+          LayoutInline {SPAN} at (0,0) size 24x24 [color=#0000FF]
+            LayoutTextCombine {#text} at (6,72) size 24x24
+              text run at (6,72) width 24: "1"
+          LayoutText {#text} at (6,96) size 24x48
+            text run at (6,96) width 48: "\x{304C}\x{306D}"
+          LayoutInline {SPAN} at (0,0) size 24x24 [color=#0000FF]
+            LayoutTextCombine {#text} at (6,144) size 24x24
+              text run at (6,144) width 24: "123"
+          LayoutText {#text} at (6,168) size 24x120
+            text run at (6,168) width 120: "\x{304B}\x{3057}\x{3064}\x{3051}\x{306B}"
+          LayoutInline {SPAN} at (0,0) size 24x24 [color=#0000FF]
+            LayoutTextCombine {#text} at (6,288) size 24x24
+              text run at (6,288) width 24: "12345"
+          LayoutText {#text} at (6,312) size 24x168
+            text run at (6,312) width 168: "\x{6765}\x{3066}\x{304F}\x{308C}\x{308B}\x{307E}\x{3067}"
+        LayoutBlockFlow {DIV} at (46,0) size 36x584
+          LayoutText {#text} at (6,0) size 24x72
+            text run at (6,0) width 72: "\x{305D}\x{306E}\x{5973}"
+          LayoutInline {SPAN} at (0,0) size 24x24 [color=#0000FF]
+            LayoutTextCombine {#text} at (6,72) size 24x24
+              text run at (6,72) width 24: "1"
+          LayoutText {#text} at (6,96) size 24x48
+            text run at (6,96) width 48: "\x{304C}\x{306D}"
+          LayoutInline {SPAN} at (0,0) size 24x24 [color=#0000FF]
+            LayoutTextCombine {#text} at (6,144) size 24x24
+              text run at (6,144) width 24: "123"
+          LayoutText {#text} at (6,168) size 24x120
+            text run at (6,168) width 120: "\x{304B}\x{3057}\x{3064}\x{3051}\x{306B}"
+          LayoutInline {SPAN} at (0,0) size 24x24 [color=#0000FF]
+            LayoutTextCombine {#text} at (6,288) size 24x24
+              text run at (6,288) width 24: "12345"
+          LayoutText {#text} at (6,312) size 24x168
+            text run at (6,312) width 168: "\x{6765}\x{3066}\x{304F}\x{308C}\x{308B}\x{307E}\x{3067}"
+      LayoutBlockFlow {DIV} at (184,0) size 82x584
+        LayoutBlockFlow {DIV} at (0,0) size 36x584
+          LayoutText {#text} at (6,0) size 24x72
+            text run at (6,0) width 72: "\x{305D}\x{306E}\x{5973}"
+          LayoutInline {SPAN} at (0,0) size 24x24 [color=#0000FF]
+            LayoutTextCombine {#text} at (6,72) size 24x24
+              text run at (6,72) width 24: "1"
+          LayoutText {#text} at (6,96) size 24x48
+            text run at (6,96) width 48: "\x{304C}\x{306D}"
+          LayoutInline {SPAN} at (0,0) size 24x24 [color=#0000FF]
+            LayoutTextCombine {#text} at (6,144) size 24x24
+              text run at (6,144) width 24: "123"
+          LayoutText {#text} at (6,168) size 24x120
+            text run at (6,168) width 120: "\x{304B}\x{3057}\x{3064}\x{3051}\x{306B}"
+          LayoutInline {SPAN} at (0,0) size 24x24 [color=#0000FF]
+            LayoutTextCombine {#text} at (6,288) size 24x24
+              text run at (6,288) width 24: "12345"
+          LayoutText {#text} at (6,312) size 24x168
+            text run at (6,312) width 168: "\x{6765}\x{3066}\x{304F}\x{308C}\x{308B}\x{307E}\x{3067}"
+        LayoutBlockFlow {DIV} at (46,0) size 36x584
+          LayoutText {#text} at (6,0) size 24x72
+            text run at (6,0) width 72: "\x{305D}\x{306E}\x{5973}"
+          LayoutInline {SPAN} at (0,0) size 24x24 [color=#0000FF]
+            LayoutTextCombine {#text} at (6,72) size 24x24
+              text run at (6,72) width 24: "1"
+          LayoutText {#text} at (6,96) size 24x48
+            text run at (6,96) width 48: "\x{304C}\x{306D}"
+          LayoutInline {SPAN} at (0,0) size 24x24 [color=#0000FF]
+            LayoutTextCombine {#text} at (6,144) size 24x24
+              text run at (6,144) width 24: "123"
+          LayoutText {#text} at (6,168) size 24x120
+            text run at (6,168) width 120: "\x{304B}\x{3057}\x{3064}\x{3051}\x{306B}"
+          LayoutInline {SPAN} at (0,0) size 24x24 [color=#0000FF]
+            LayoutTextCombine {#text} at (6,288) size 24x24
+              text run at (6,288) width 24: "12345"
+          LayoutText {#text} at (6,312) size 24x168
+            text run at (6,312) width 168: "\x{6765}\x{3066}\x{304F}\x{308C}\x{308B}\x{307E}\x{3067}"
+      LayoutBlockFlow {DIV} at (276,0) size 94x584
+        LayoutBlockFlow {DIV} at (0,0) size 42x584
+          LayoutText {#text} at (12,0) size 24x72
+            text run at (12,0) width 72: "\x{305D}\x{306E}\x{5973}"
+          LayoutInline {SPAN} at (0,0) size 24x24 [color=#0000FF]
+            LayoutTextCombine {#text} at (12,72) size 24x24
+              text run at (12,72) width 24: "1"
+          LayoutText {#text} at (12,96) size 24x48
+            text run at (12,96) width 48: "\x{304C}\x{306D}"
+          LayoutInline {SPAN} at (0,0) size 24x24 [color=#0000FF]
+            LayoutTextCombine {#text} at (12,144) size 24x24
+              text run at (12,144) width 24: "123"
+          LayoutText {#text} at (12,168) size 24x120
+            text run at (12,168) width 120: "\x{304B}\x{3057}\x{3064}\x{3051}\x{306B}"
+          LayoutInline {SPAN} at (0,0) size 24x24 [color=#0000FF]
+            LayoutTextCombine {#text} at (12,288) size 24x24
+              text run at (12,288) width 24: "12345"
+          LayoutText {#text} at (12,312) size 24x168
+            text run at (12,312) width 168: "\x{6765}\x{3066}\x{304F}\x{308C}\x{308B}\x{307E}\x{3067}"
+        LayoutBlockFlow {DIV} at (52,0) size 42x584
+          LayoutText {#text} at (12,0) size 24x72
+            text run at (12,0) width 72: "\x{305D}\x{306E}\x{5973}"
+          LayoutInline {SPAN} at (0,0) size 24x24 [color=#0000FF]
+            LayoutTextCombine {#text} at (12,72) size 24x24
+              text run at (12,72) width 24: "1"
+          LayoutText {#text} at (12,96) size 24x48
+            text run at (12,96) width 48: "\x{304C}\x{306D}"
+          LayoutInline {SPAN} at (0,0) size 24x24 [color=#0000FF]
+            LayoutTextCombine {#text} at (12,144) size 24x24
+              text run at (12,144) width 24: "123"
+          LayoutText {#text} at (12,168) size 24x120
+            text run at (12,168) width 120: "\x{304B}\x{3057}\x{3064}\x{3051}\x{306B}"
+          LayoutInline {SPAN} at (0,0) size 24x24 [color=#0000FF]
+            LayoutTextCombine {#text} at (12,288) size 24x24
+              text run at (12,288) width 24: "12345"
+          LayoutText {#text} at (12,312) size 24x168
+            text run at (12,312) width 168: "\x{6765}\x{3066}\x{304F}\x{308C}\x{308B}\x{307E}\x{3067}"
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/drawBidiText-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/drawBidiText-expected.png
index 7d2751c..740c8cc 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/drawBidiText-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/drawBidiText-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/drawBidiText-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/drawBidiText-expected.txt
new file mode 100644
index 0000000..5e689c2
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/drawBidiText-expected.txt
@@ -0,0 +1,56 @@
+layer at (0,0) size 800x600
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  LayoutBlockFlow {HTML} at (0,0) size 800x600
+    LayoutBlockFlow {BODY} at (8,8) size 784x584
+      LayoutBlockFlow {P} at (0,0) size 784x18
+        LayoutText {#text} at (0,0) size 285x18
+          text run at (0,0) width 285: "This tests GraphicsContext::drawBidiText()."
+layer at (8,42) size 345x205 clip at (9,43) size 332x203 scrollHeight 210
+  LayoutListBox {SELECT} at (0,34) size 344.80x205.34 [bgcolor=#FFFFFF] [border: (1px solid #999999)]
+    LayoutBlockFlow {OPTION} at (1,1) size 331.80x22.59
+      LayoutText {#text} at (2,0) size 225x21
+        text run at (2,0) width 44: "First "
+        text run at (45,0) width 67 RTL: ") \x{5E8}\x{5D1}\x{5D9}\x{5E2}\x{5D9}\x{5EA}"
+        text run at (111,0) width 24: "03"
+        text run at (134,0) width 51 RTL: "\x{5E9}\x{5E0}\x{5D9}\x{5D4} ("
+        text run at (184,0) width 43: " fifth"
+    LayoutBlockFlow {OPTION} at (1,23.59) size 331.80x22.59
+      LayoutText {#text} at (105,0) size 225x21
+        text run at (105,0) width 37: "fifth"
+        text run at (141,0) width 72 RTL: ") \x{5E8}\x{5D1}\x{5D9}\x{5E2}\x{5D9}\x{5EA} "
+        text run at (212,0) width 24: "03"
+        text run at (235,0) width 57 RTL: " \x{5E9}\x{5E0}\x{5D9}\x{5D4} ("
+        text run at (291,0) width 39: "First"
+    LayoutBlockFlow {OPTION} at (1,46.19) size 331.80x22.59
+      LayoutText {#text} at (2,0) size 225x21
+        text run at (2,0) width 225 LTR override: "First \x{5E9}\x{5E0}\x{5D9}\x{5D4} (03) \x{5E8}\x{5D1}\x{5D9}\x{5E2}\x{5D9}\x{5EA} fifth"
+    LayoutBlockFlow {OPTION} at (1,68.78) size 331.80x22.59
+      LayoutText {#text} at (105,0) size 225x21
+        text run at (105,0) width 225 RTL override: "First \x{5E9}\x{5E0}\x{5D9}\x{5D4} (03) \x{5E8}\x{5D1}\x{5D9}\x{5E2}\x{5D9}\x{5EA} fifth"
+    LayoutBlockFlow {OPTION} at (1,91.38) size 331.80x22.59
+      LayoutText {#text} at (2,0) size 113x21
+        text run at (2,0) width 113 RTL: "\x{5DE}\x{5E9}\x{5D4}\x{5D5} \x{5E2}\x{5DD} \x{5E0}\x{5B4}\x{5E7}\x{5BC}\x{5D5}\x{5BC}\x{5D3}"
+    LayoutBlockFlow {OPTION} at (1,113.97) size 331.80x25
+      LayoutText {#text} at (2,0) size 74x21
+        text run at (2,0) width 74 RTL: "\x{627}\x{644}\x{644}\x{63A}\x{629} \x{627}\x{644}\x{639}\x{631}\x{628}\x{64A}\x{629}"
+    LayoutBlockFlow {OPTION} at (1,138.97) size 331.80x22.59
+      LayoutText {#text} at (2,0) size 132x21
+        text run at (2,0) width 132: "Et volia\x{300}: ATSUI!"
+    LayoutBlockFlow {OPTION} at (1,161.56) size 331.80x25
+      LayoutText {#text} at (2,2) size 312x21
+        text run at (2,2) width 101: "Directional "
+        text run at (102,2) width 82 RTL override: "\x{202E}overrides"
+        text run at (183,2) width 131: "\x{202C} are confusing."
+    LayoutBlockFlow {OPTION} at (1,186.56) size 331.80x25
+      LayoutText {#text} at (2,2) size 328x21
+        text run at (2,2) width 86: "She said \x{201C}"
+        text run at (87,2) width 74 RTL: " \x{5D1}\x{5DE}\x{5D6}\x{5D5}\x{5D5}\x{5D3}\x{5D4}!"
+        text run at (160,2) width 37: "TNT"
+        text run at (196,2) width 25 RTL: "\x{202B}\x{5D9}\x{5E9} "
+        text run at (220,2) width 110: "\x{202C}\x{201D} and ran off"
+layer at (8,247) size 390x18 clip at (9,248) size 377x16
+  LayoutListBox {SELECT} at (0,239.34) size 390.30x18 [bgcolor=#FFFFFF] [border: (1px solid #999999)]
+    LayoutBlockFlow {OPTION} at (1,1) size 377.30x16
+      LayoutText {#text} at (2,0) size 374x15
+        text run at (2,0) width 374: "There are two ways to measure text: my way and the wrong way"
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/emoticons-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/emoticons-expected.png
index dea6dcf..6e8b516f 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/emoticons-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/emoticons-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/emoticons-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/emoticons-expected.txt
new file mode 100644
index 0000000..060707c3
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/emoticons-expected.txt
@@ -0,0 +1,58 @@
+layer at (0,0) size 800x600 clip at (0,0) size 785x600 scrollHeight 607
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 785x607 backgroundClip at (0,0) size 785x600 clip at (0,0) size 785x600
+  LayoutBlockFlow {HTML} at (0,0) size 785x606.88
+    LayoutBlockFlow {BODY} at (8,21.44) size 769x569.44
+      LayoutBlockFlow {H1} at (0,0) size 769x37
+        LayoutText {#text} at (0,0) size 303x37
+          text run at (0,0) width 303: "Emoticons & Symbols"
+      LayoutBlockFlow {PRE} at (0,58.44) size 769x477
+        LayoutText {#text} at (0,4) size 388x473
+          text run at (0,4) width 388: "U+1F60x \x{D83D}\x{DE00} \x{D83D}\x{DE01} \x{D83D}\x{DE02} \x{D83D}\x{DE03} \x{D83D}\x{DE04} \x{D83D}\x{DE05} \x{D83D}\x{DE06} \x{D83D}\x{DE07} \x{D83D}\x{DE08} \x{D83D}\x{DE09} \x{D83D}\x{DE0A} \x{D83D}\x{DE0B} \x{D83D}\x{DE0C} \x{D83D}\x{DE0D} \x{D83D}\x{DE0E} \x{D83D}\x{DE0F}"
+          text run at (387,4) width 1: " "
+          text run at (0,25) width 388: "U+1F61x \x{D83D}\x{DE10} \x{D83D}\x{DE11} \x{D83D}\x{DE12} \x{D83D}\x{DE13} \x{D83D}\x{DE14} \x{D83D}\x{DE15} \x{D83D}\x{DE16} \x{D83D}\x{DE17} \x{D83D}\x{DE18} \x{D83D}\x{DE19} \x{D83D}\x{DE1A} \x{D83D}\x{DE1B} \x{D83D}\x{DE1C} \x{D83D}\x{DE1D} \x{D83D}\x{DE1E} \x{D83D}\x{DE1F}"
+          text run at (387,25) width 1: " "
+          text run at (0,46) width 388: "U+1F62x \x{D83D}\x{DE20} \x{D83D}\x{DE21} \x{D83D}\x{DE22} \x{D83D}\x{DE23} \x{D83D}\x{DE24} \x{D83D}\x{DE25} \x{D83D}\x{DE26} \x{D83D}\x{DE27} \x{D83D}\x{DE28} \x{D83D}\x{DE29} \x{D83D}\x{DE2A} \x{D83D}\x{DE2B} \x{D83D}\x{DE2C} \x{D83D}\x{DE2D} \x{D83D}\x{DE2E} \x{D83D}\x{DE2F}"
+          text run at (387,46) width 1: " "
+          text run at (0,67) width 388: "U+1F63x \x{D83D}\x{DE30} \x{D83D}\x{DE31} \x{D83D}\x{DE32} \x{D83D}\x{DE33} \x{D83D}\x{DE34} \x{D83D}\x{DE35} \x{D83D}\x{DE36} \x{D83D}\x{DE37} \x{D83D}\x{DE38} \x{D83D}\x{DE39} \x{D83D}\x{DE3A} \x{D83D}\x{DE3B} \x{D83D}\x{DE3C} \x{D83D}\x{DE3D} \x{D83D}\x{DE3E} \x{D83D}\x{DE3F}"
+          text run at (387,67) width 1: " "
+          text run at (0,88) width 352: "U+1F64x \x{D83D}\x{DE40} \x{D83D}\x{DE41} \x{D83D}\x{DE42}   \x{D83D}\x{DE45} \x{D83D}\x{DE46} \x{D83D}\x{DE47} \x{D83D}\x{DE48} \x{D83D}\x{DE49} \x{D83D}\x{DE4A} \x{D83D}\x{DE4B} \x{D83D}\x{DE4C} \x{D83D}\x{DE4D} \x{D83D}\x{DE4E} \x{D83D}\x{DE4F}"
+          text run at (351,88) width 1: " "
+          text run at (0,109) width 388: "U+1F30x \x{D83C}\x{DF00} \x{D83C}\x{DF01} \x{D83C}\x{DF02} \x{D83C}\x{DF03} \x{D83C}\x{DF04} \x{D83C}\x{DF05} \x{D83C}\x{DF06} \x{D83C}\x{DF07} \x{D83C}\x{DF08} \x{D83C}\x{DF09} \x{D83C}\x{DF0A} \x{D83C}\x{DF0B} \x{D83C}\x{DF0C} \x{D83C}\x{DF0D} \x{D83C}\x{DF0E} \x{D83C}\x{DF0F}"
+          text run at (387,109) width 1: " "
+          text run at (0,130) width 388: "U+1F31x \x{D83C}\x{DF10} \x{D83C}\x{DF11} \x{D83C}\x{DF12} \x{D83C}\x{DF13} \x{D83C}\x{DF14} \x{D83C}\x{DF15} \x{D83C}\x{DF16} \x{D83C}\x{DF17} \x{D83C}\x{DF18} \x{D83C}\x{DF19} \x{D83C}\x{DF1A} \x{D83C}\x{DF1B} \x{D83C}\x{DF1C} \x{D83C}\x{DF1D} \x{D83C}\x{DF1E} \x{D83C}\x{DF1F}"
+          text run at (387,130) width 1: " "
+          text run at (0,151) width 287: "U+1F32x \x{D83C}\x{DF20} \x{D83C}\x{DF21} \x{D83C}\x{DF22} \x{D83C}\x{DF23} \x{D83C}\x{DF24} \x{D83C}\x{DF25} \x{D83C}\x{DF26} \x{D83C}\x{DF27} \x{D83C}\x{DF28} \x{D83C}\x{DF29} \x{D83C}\x{DF2A} \x{D83C}\x{DF2B} \x{D83C}\x{DF2C}   "
+          text run at (286,151) width 1: " "
+          text run at (0,172) width 383: "U+1F33x \x{D83C}\x{DF30} \x{D83C}\x{DF31} \x{D83C}\x{DF32} \x{D83C}\x{DF33} \x{D83C}\x{DF34} \x{D83C}\x{DF35} \x{D83C}\x{DF36} \x{D83C}\x{DF37} \x{D83C}\x{DF38} \x{D83C}\x{DF39} \x{D83C}\x{DF3A} \x{D83C}\x{DF3B} \x{D83C}\x{DF3C} \x{D83C}\x{DF3D} \x{D83C}\x{DF3E} \x{D83C}\x{DF3F}"
+          text run at (382,172) width 1: " "
+          text run at (0,193) width 388: "U+1F34x \x{D83C}\x{DF40} \x{D83C}\x{DF41} \x{D83C}\x{DF42} \x{D83C}\x{DF43} \x{D83C}\x{DF44} \x{D83C}\x{DF45} \x{D83C}\x{DF46} \x{D83C}\x{DF47} \x{D83C}\x{DF48} \x{D83C}\x{DF49} \x{D83C}\x{DF4A} \x{D83C}\x{DF4B} \x{D83C}\x{DF4C} \x{D83C}\x{DF4D} \x{D83C}\x{DF4E} \x{D83C}\x{DF4F}"
+          text run at (387,193) width 1: " "
+          text run at (0,214) width 388: "U+1F35x \x{D83C}\x{DF50} \x{D83C}\x{DF51} \x{D83C}\x{DF52} \x{D83C}\x{DF53} \x{D83C}\x{DF54} \x{D83C}\x{DF55} \x{D83C}\x{DF56} \x{D83C}\x{DF57} \x{D83C}\x{DF58} \x{D83C}\x{DF59} \x{D83C}\x{DF5A} \x{D83C}\x{DF5B} \x{D83C}\x{DF5C} \x{D83C}\x{DF5D} \x{D83C}\x{DF5E} \x{D83C}\x{DF5F}"
+          text run at (387,214) width 1: " "
+          text run at (0,235) width 388: "U+1F36x \x{D83C}\x{DF60} \x{D83C}\x{DF61} \x{D83C}\x{DF62} \x{D83C}\x{DF63} \x{D83C}\x{DF64} \x{D83C}\x{DF65} \x{D83C}\x{DF66} \x{D83C}\x{DF67} \x{D83C}\x{DF68} \x{D83C}\x{DF69} \x{D83C}\x{DF6A} \x{D83C}\x{DF6B} \x{D83C}\x{DF6C} \x{D83C}\x{DF6D} \x{D83C}\x{DF6E} \x{D83C}\x{DF6F}"
+          text run at (387,235) width 1: " "
+          text run at (0,256) width 357: "U+1F37x \x{D83C}\x{DF70} \x{D83C}\x{DF71} \x{D83C}\x{DF72} \x{D83C}\x{DF73} \x{D83C}\x{DF74} \x{D83C}\x{DF75} \x{D83C}\x{DF76} \x{D83C}\x{DF77} \x{D83C}\x{DF78} \x{D83C}\x{DF79} \x{D83C}\x{DF7A} \x{D83C}\x{DF7B} \x{D83C}\x{DF7C} \x{D83C}\x{DF7D}  "
+          text run at (356,256) width 1: " "
+          text run at (0,277) width 388: "U+1F38x \x{D83C}\x{DF80} \x{D83C}\x{DF81} \x{D83C}\x{DF82} \x{D83C}\x{DF83} \x{D83C}\x{DF84} \x{D83C}\x{DF85} \x{D83C}\x{DF86} \x{D83C}\x{DF87} \x{D83C}\x{DF88} \x{D83C}\x{DF89} \x{D83C}\x{DF8A} \x{D83C}\x{DF8B} \x{D83C}\x{DF8C} \x{D83C}\x{DF8D} \x{D83C}\x{DF8E} \x{D83C}\x{DF8F}"
+          text run at (387,277) width 1: " "
+          text run at (0,298) width 388: "U+1F68x \x{D83D}\x{DE80} \x{D83D}\x{DE81} \x{D83D}\x{DE82} \x{D83D}\x{DE83} \x{D83D}\x{DE84} \x{D83D}\x{DE85} \x{D83D}\x{DE86} \x{D83D}\x{DE87} \x{D83D}\x{DE88} \x{D83D}\x{DE89} \x{D83D}\x{DE8A} \x{D83D}\x{DE8B} \x{D83D}\x{DE8C} \x{D83D}\x{DE8D} \x{D83D}\x{DE8E} \x{D83D}\x{DE8F}"
+          text run at (387,298) width 1: " "
+          text run at (0,319) width 388: "U+1F69x \x{D83D}\x{DE90} \x{D83D}\x{DE91} \x{D83D}\x{DE92} \x{D83D}\x{DE93} \x{D83D}\x{DE94} \x{D83D}\x{DE95} \x{D83D}\x{DE96} \x{D83D}\x{DE97} \x{D83D}\x{DE98} \x{D83D}\x{DE99} \x{D83D}\x{DE9A} \x{D83D}\x{DE9B} \x{D83D}\x{DE9C} \x{D83D}\x{DE9D} \x{D83D}\x{DE9E} \x{D83D}\x{DE9F}"
+          text run at (387,319) width 1: " "
+          text run at (0,340) width 388: "U+1F6Ax \x{D83D}\x{DEA0} \x{D83D}\x{DEA1} \x{D83D}\x{DEA2} \x{D83D}\x{DEA3} \x{D83D}\x{DEA4} \x{D83D}\x{DEA5} \x{D83D}\x{DEA6} \x{D83D}\x{DEA7} \x{D83D}\x{DEA8} \x{D83D}\x{DEA9} \x{D83D}\x{DEAA} \x{D83D}\x{DEAB} \x{D83D}\x{DEAC} \x{D83D}\x{DEAD} \x{D83D}\x{DEAE} \x{D83D}\x{DEAF}"
+          text run at (387,340) width 1: " "
+          text run at (0,361) width 388: "U+1F6Bx \x{D83D}\x{DEB0} \x{D83D}\x{DEB1} \x{D83D}\x{DEB2} \x{D83D}\x{DEB3} \x{D83D}\x{DEB4} \x{D83D}\x{DEB5} \x{D83D}\x{DEB6} \x{D83D}\x{DEB7} \x{D83D}\x{DEB8} \x{D83D}\x{DEB9} \x{D83D}\x{DEBA} \x{D83D}\x{DEBB} \x{D83D}\x{DEBC} \x{D83D}\x{DEBD} \x{D83D}\x{DEBE} \x{D83D}\x{DEBF}"
+          text run at (387,361) width 1: " "
+          text run at (0,380) width 355: "U+260x \x{2600} \x{2601} \x{2602} \x{2603} \x{2604} \x{2605} \x{2606} \x{2607} \x{2608} \x{2609} \x{260A} \x{260B} \x{260C} \x{260D} \x{260E} \x{260F}"
+          text run at (354,380) width 1: " "
+          text run at (0,402) width 302: "U+26Dx \x{26D0} \x{26D1} \x{26D2} \x{26D3} \x{26D4} \x{26D5} \x{26D6} \x{26D7} \x{26D8} \x{26D9} \x{26DA} \x{26DB} \x{26DC} \x{26DD} \x{26DE} \x{26DF}"
+          text run at (301,402) width 1: " "
+          text run at (0,423) width 303: "U+26Ex \x{26E0} \x{26E1} \x{26E2} \x{26E3} \x{26E4} \x{26E5} \x{26E6} \x{26E7} \x{26E8} \x{26E9} \x{26EA} \x{26EB} \x{26EC} \x{26ED} \x{26EE} \x{26EF}"
+          text run at (302,423) width 1: " "
+          text run at (0,445) width 323: "U+26Fx \x{26F0} \x{26F1} \x{26F2} \x{26F3} \x{26F4} \x{26F5} \x{26F6} \x{26F7} \x{26F8} \x{26F9} \x{26FA} \x{26FB} \x{26FC} \x{26FD} \x{26FE} \x{26FF}"
+          text run at (322,445) width 1: " "
+          text run at (0,462) width 63: "        "
+      LayoutBlockFlow {P} at (0,551.44) size 769x18
+        LayoutText {#text} at (0,0) size 478x18
+          text run at (0,0) width 478: "A seriers of emoticons, symbols and pictographs should be shown above1."
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/emphasis-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/emphasis-expected.png
index 0b61a2f..3ecf3f5 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/emphasis-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/emphasis-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/emphasis-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/emphasis-expected.txt
index 3d9c3bf..73047c8 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/emphasis-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/emphasis-expected.txt
@@ -18,7 +18,7 @@
         LayoutText {#text} at (112,73) size 334x70
           text run at (112,73) width 13: ", "
           text run at (124,73) width 213: "lobortis eu iaculis vel,"
-          text run at (3,115) width 209: "scelerisque nec dolor."
+          text run at (3,115) width 208: "scelerisque nec dolor."
       LayoutBlockFlow (floating) {DIV} at (390,8) size 366x146 [border: (3px solid #000000)]
         LayoutText {#text} at (3,3) size 273x28
           text run at (3,3) width 273: "Lorem ipsum dolor sit amet,"
@@ -94,7 +94,7 @@
         LayoutText {#text} at (198,101) size 334x56
           text run at (198,101) width 7: " "
           text run at (204,101) width 133: "eu iaculis vel,"
-          text run at (3,129) width 209: "scelerisque nec dolor."
+          text run at (3,129) width 208: "scelerisque nec dolor."
       LayoutBlockFlow (floating) {DIV} at (390,170) size 366x160 [border: (3px solid #000000)]
         LayoutText {#text} at (3,3) size 70x28
           text run at (3,3) width 70: "Lorem "
@@ -154,7 +154,7 @@
         LayoutText {#text} at (198,89) size 334x68
           text run at (198,89) width 7: " "
           text run at (204,89) width 133: "eu iaculis vel,"
-          text run at (3,129) width 209: "scelerisque nec dolor."
+          text run at (3,129) width 208: "scelerisque nec dolor."
       LayoutBlockFlow (floating) {DIV} at (8,346) size 366x198 [border: (3px solid #000000)]
         LayoutText {#text} at (3,13) size 273x28
           text run at (3,13) width 273: "Lorem ipsum dolor sit amet,"
@@ -170,7 +170,7 @@
         LayoutText {#text} at (112,109) size 334x76
           text run at (112,109) width 13: ", "
           text run at (124,109) width 213: "lobortis eu iaculis vel,"
-          text run at (3,157) width 209: "scelerisque nec dolor."
+          text run at (3,157) width 208: "scelerisque nec dolor."
       LayoutBlockFlow (floating) {DIV} at (390,346) size 366x146 [border: (3px solid #000000)]
         LayoutText {#text} at (3,3) size 273x28
           text run at (3,3) width 273: "Lorem ipsum dolor sit amet,"
@@ -186,6 +186,6 @@
         LayoutText {#text} at (112,73) size 334x70
           text run at (112,73) width 13: ", "
           text run at (124,73) width 213: "lobortis eu iaculis vel,"
-          text run at (3,115) width 209: "scelerisque nec dolor."
+          text run at (3,115) width 208: "scelerisque nec dolor."
 selection start: position 10 of child 0 {#text} of child 1 {SPAN} of child 10 {DIV} of body
 selection end:   position 7 of child 0 {#text} of child 3 {SPAN} of child 10 {DIV} of body
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/fallback-traits-fixup-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/fallback-traits-fixup-expected.png
index 78daf52e..730720d 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/fallback-traits-fixup-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/fallback-traits-fixup-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/font-stretch-variant-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/font-stretch-variant-expected.png
index 4cedd44f..ad3ed75 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/font-stretch-variant-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/font-stretch-variant-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/font-weight-variant-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/font-weight-variant-expected.png
index 1914ea446..8a4de2f 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/font-weight-variant-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/font-weight-variant-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/international/002-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/international/002-expected.png
index 504a7a12..03f6d3e 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/international/002-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/international/002-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/international/002-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/international/002-expected.txt
new file mode 100644
index 0000000..651aab3
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/international/002-expected.txt
@@ -0,0 +1,17 @@
+layer at (0,0) size 800x600
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  LayoutBlockFlow {HTML} at (0,0) size 800x600
+    LayoutBlockFlow {BODY} at (8,8) size 784x584
+      LayoutTable {TABLE} at (0,0) size 280x144
+        LayoutTableSection {TBODY} at (0,0) size 280x144
+          LayoutTableRow {TR} at (0,0) size 280x144
+            LayoutTableCell {TD} at (0,0) size 280x144 [r=0 c=0 rs=1 cs=1]
+              LayoutText {#text} at (0,4) size 274x138
+                text run at (0,4) width 272: "\x{8AB0}\x{3067}\x{3082}\x{3042}\x{306A}\x{305F}\x{306E}\x{30C9}\x{30AD}\x{30E5}\x{30E1}\x{30F3}\x{30C8}\x{3092}\x{30AA}\x{30EA}\x{30B8}"
+                text run at (0,28) width 258: "\x{30CA}\x{30EB}\x{306E}\x{4F53}\x{88C1}\x{3067}\x{958B}\x{304F}\x{3053}\x{3068}\x{304C}\x{3067}\x{304D}\x{307E}\x{3059}\x{3002} "
+                text run at (257,28) width 17: "\x{3042}"
+                text run at (0,52) width 272: "\x{306A}\x{305F}\x{306E}\x{610F}\x{56F3}\x{3057}\x{305F}\x{3068}\x{304A}\x{308A}\x{306B}\x{60C5}\x{5831}\x{3092}\x{4F1D}\x{3048}\x{308B}"
+                text run at (0,76) width 270: "\x{3053}\x{3068}\x{304C}\x{3067}\x{304D}\x{307E}\x{3059}\x{3002}\x{3055}\x{3089}\x{306B}\x{3001}\x{30D6}\x{30E9}\x{30A6}\x{30B6}\x{304B}"
+                text run at (0,100) width 272: "\x{3089}\x{30B3}\x{30E1}\x{30F3}\x{30C8}\x{3084}\x{30DE}\x{30FC}\x{30AF}\x{30A2}\x{30C3}\x{30D7}\x{3092}\x{66F8}\x{304D}\x{8FBC}\x{3093}"
+                text run at (0,124) width 32: "\x{3060}\x{308A}"
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/international/bidi-listbox-atsui-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/international/bidi-listbox-atsui-expected.png
index e86ec30..84eafe3 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/international/bidi-listbox-atsui-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/international/bidi-listbox-atsui-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/international/bidi-listbox-atsui-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/international/bidi-listbox-atsui-expected.txt
index ef0dcf4d..2e29be3b 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/international/bidi-listbox-atsui-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/international/bidi-listbox-atsui-expected.txt
@@ -4,9 +4,9 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x600
     LayoutBlockFlow {BODY} at (8,8) size 784x584
       LayoutBlockFlow {P} at (0,0) size 784x36
-        LayoutText {#text} at (0,0) size 594x18
-          text run at (0,0) width 594: "This tests that bidirectional text is correctly rendered when using ATSUI in list box controls."
-        LayoutBR {BR} at (593,14) size 1x0
+        LayoutText {#text} at (0,0) size 592x18
+          text run at (0,0) width 592: "This tests that bidirectional text is correctly rendered when using ATSUI in list box controls."
+        LayoutBR {BR} at (591,14) size 1x0
         LayoutText {#text} at (0,18) size 578x18
           text run at (0,18) width 578: "The order of the text below each list box should match the order of the select's option text."
       LayoutBlockFlow (anonymous) at (0,52) size 784x48
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/international/bidi-neutral-run-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/international/bidi-neutral-run-expected.png
index 320a1f58..92426bf5 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/international/bidi-neutral-run-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/international/bidi-neutral-run-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/international/bold-bengali-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/international/bold-bengali-expected.png
index bfce46e5..fd6124a 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/international/bold-bengali-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/international/bold-bengali-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/international/bold-bengali-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/international/bold-bengali-expected.txt
new file mode 100644
index 0000000..e5ea808a
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/international/bold-bengali-expected.txt
@@ -0,0 +1,22 @@
+layer at (0,0) size 800x600
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  LayoutBlockFlow {HTML} at (0,0) size 800x600
+    LayoutBlockFlow {BODY} at (8,8) size 784x576
+      LayoutBlockFlow {P} at (0,0) size 784x36
+        LayoutText {#text} at (0,0) size 755x36
+          text run at (0,0) width 351: "This test verifies we can render bold Bengali properly. "
+          text run at (350,0) width 405: "(This is complicated on Linux because it's typically covered by"
+          text run at (0,18) width 473: "fake-bolded FreeSans even though there's also a FreeSansBold available.)"
+      LayoutBlockFlow {P} at (0,52) size 784x18
+        LayoutText {#text} at (0,0) size 751x18
+          text run at (0,0) width 487: "The test passes if the two words below look similar, but the top one is bold. "
+          text run at (486,0) width 265: "There should be no missing-glyph boxes."
+      LayoutBlockFlow {P} at (0,86) size 784x26
+        LayoutInline {B} at (0,0) size 34x18
+          LayoutText {#text} at (0,1) size 34x18
+            text run at (0,1) width 34: "\x{9AC}\x{9BE}\x{982}\x{9B2}\x{9BE}"
+      LayoutBlockFlow {P} at (0,128) size 784x0
+      LayoutBlockFlow {P} at (0,128) size 784x26
+        LayoutText {#text} at (0,1) size 26x18
+          text run at (0,1) width 26: "\x{9AC}\x{9BE}\x{982}\x{9B2}\x{9BE}"
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/international/complex-character-based-fallback-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/international/complex-character-based-fallback-expected.png
index 0c05024..43cc345 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/international/complex-character-based-fallback-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/international/complex-character-based-fallback-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/international/complex-character-based-fallback-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/international/complex-character-based-fallback-expected.txt
new file mode 100644
index 0000000..a82abe79
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/international/complex-character-based-fallback-expected.txt
@@ -0,0 +1,37 @@
+layer at (0,0) size 800x600
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  LayoutBlockFlow {HTML} at (0,0) size 800x600
+    LayoutBlockFlow {BODY} at (8,8) size 784x576
+      LayoutBlockFlow {P} at (0,0) size 784x54
+        LayoutText {#text} at (0,0) size 748x36
+          text run at (0,0) width 748: "This tests that complex text that requires font fallback wraps correctly. The text is Tamil, which is not covered by the"
+          text run at (0,18) width 479: "default font, so fallback occurs. Note that the exclamation point in the end "
+        LayoutInline {I} at (0,0) size 12x18
+          LayoutText {#text} at (478,18) size 12x18
+            text run at (478,18) width 12: "is"
+        LayoutText {#text} at (489,18) size 768x36
+          text run at (489,18) width 279: " covered by the default font and is rendered"
+          text run at (0,36) width 52: "using it."
+      LayoutBlockFlow {P} at (0,70) size 306x146 [border: (3px solid #000000)]
+        LayoutText {#text} at (3,3) size 283x138
+          text run at (3,3) width 159: "\x{B87}\x{BA4}\x{BC1} \x{B89}\x{B99}\x{BCD}\x{B95}\x{BB3}\x{BC8}\x{BAA}\x{BCD} \x{BAA}\x{BCB}\x{BA9}\x{BCD}\x{BB1}"
+          text run at (3,23) width 255: "\x{B86}\x{BB0}\x{BCD}\x{BB5}\x{BAE}\x{BC1}\x{B9F}\x{BC8}\x{BAF}\x{BB5}\x{BB0}\x{BCD}\x{B95}\x{BB3}\x{BBE}\x{BB2}\x{BCD} \x{BA4}\x{BCA}\x{B95}\x{BC1}\x{B95}\x{BCD}\x{B95}\x{BAA}\x{BCD}\x{BAA}\x{B9F}\x{BCD}\x{B9F}\x{BC1}"
+          text run at (3,43) width 266: "\x{B95}\x{B9F}\x{BCD}\x{B9F}\x{BC1}\x{BAA}\x{BCD}\x{BAA}\x{BBE}\x{B9F}\x{BC1}\x{B95}\x{BB3}\x{BCD} \x{B8F}\x{BA4}\x{BC1}\x{BAE}\x{BCD} \x{B87}\x{BA9}\x{BCD}\x{BB1}\x{BBF} \x{B87}\x{BB2}\x{BB5}\x{B9A}\x{BAE}\x{BBE}\x{B95}\x{BAA}\x{BCD}"
+          text run at (3,63) width 283: "\x{BAA}\x{BAF}\x{BA9}\x{BCD}\x{BAA}\x{B9F}\x{BC1}\x{BA4}\x{BCD}\x{BA4}\x{B95}\x{BCD}\x{B95}\x{BC2}\x{B9F}\x{BBF}\x{BAF} \x{B92}\x{BB0}\x{BC1} \x{BAA}\x{BA9}\x{BCD}\x{BAE}\x{BCA}\x{BB4}\x{BBF}\x{B95}\x{BCD} \x{B95}\x{BB2}\x{BC8}\x{B95}\x{BCD}"
+          text run at (3,83) width 264: "\x{B95}\x{BB3}\x{B9E}\x{BCD}\x{B9A}\x{BBF}\x{BAF}\x{BA4}\x{BCD} \x{BA4}\x{BBF}\x{B9F}\x{BCD}\x{B9F}\x{BAE}\x{BBE}\x{B95}\x{BC1}\x{BAE}\x{BCD}. \x{B87}\x{B99}\x{BCD}\x{B95}\x{BC1} \x{BA8}\x{BC0}\x{B99}\x{BCD}\x{B95}\x{BB3}\x{BC1}\x{BAE}\x{BCD}"
+          text run at (3,103) width 251: "\x{B89}\x{B99}\x{BCD}\x{B95}\x{BB3}\x{BC1}\x{B95}\x{BCD}\x{B95}\x{BC1} \x{BB5}\x{BBF}\x{BB0}\x{BC1}\x{BAA}\x{BCD}\x{BAA}\x{BAE}\x{BBE}\x{BA9} \x{BA4}\x{BB2}\x{BC8}\x{BAA}\x{BCD}\x{BAA}\x{BC1}\x{B95}\x{BB3}\x{BBF}\x{BB2}\x{BCD}"
+          text run at (3,123) width 149: "\x{BAA}\x{BC1}\x{BA4}\x{BBF}\x{BA4}\x{BBE}\x{B95}\x{B95}\x{BCD} \x{B95}\x{B9F}\x{BCD}\x{B9F}\x{BC1}\x{BB0}\x{BC8}\x{B95}\x{BB3}\x{BCD}!"
+      LayoutBlockFlow {P} at (0,232) size 784x36
+        LayoutText {#text} at (0,0) size 766x36
+          text run at (0,0) width 766: "This is the same text but specifying a font that covers Tamil. Note that the exclamation point is rendered using the same"
+          text run at (0,18) width 99: "font as the text."
+      LayoutBlockFlow {P} at (0,284) size 306x146 [border: (3px solid #000000)]
+        LayoutText {#text} at (3,3) size 283x138
+          text run at (3,3) width 159: "\x{B87}\x{BA4}\x{BC1} \x{B89}\x{B99}\x{BCD}\x{B95}\x{BB3}\x{BC8}\x{BAA}\x{BCD} \x{BAA}\x{BCB}\x{BA9}\x{BCD}\x{BB1}"
+          text run at (3,23) width 255: "\x{B86}\x{BB0}\x{BCD}\x{BB5}\x{BAE}\x{BC1}\x{B9F}\x{BC8}\x{BAF}\x{BB5}\x{BB0}\x{BCD}\x{B95}\x{BB3}\x{BBE}\x{BB2}\x{BCD} \x{BA4}\x{BCA}\x{B95}\x{BC1}\x{B95}\x{BCD}\x{B95}\x{BAA}\x{BCD}\x{BAA}\x{B9F}\x{BCD}\x{B9F}\x{BC1}"
+          text run at (3,43) width 266: "\x{B95}\x{B9F}\x{BCD}\x{B9F}\x{BC1}\x{BAA}\x{BCD}\x{BAA}\x{BBE}\x{B9F}\x{BC1}\x{B95}\x{BB3}\x{BCD} \x{B8F}\x{BA4}\x{BC1}\x{BAE}\x{BCD} \x{B87}\x{BA9}\x{BCD}\x{BB1}\x{BBF} \x{B87}\x{BB2}\x{BB5}\x{B9A}\x{BAE}\x{BBE}\x{B95}\x{BAA}\x{BCD}"
+          text run at (3,63) width 283: "\x{BAA}\x{BAF}\x{BA9}\x{BCD}\x{BAA}\x{B9F}\x{BC1}\x{BA4}\x{BCD}\x{BA4}\x{B95}\x{BCD}\x{B95}\x{BC2}\x{B9F}\x{BBF}\x{BAF} \x{B92}\x{BB0}\x{BC1} \x{BAA}\x{BA9}\x{BCD}\x{BAE}\x{BCA}\x{BB4}\x{BBF}\x{B95}\x{BCD} \x{B95}\x{BB2}\x{BC8}\x{B95}\x{BCD}"
+          text run at (3,83) width 264: "\x{B95}\x{BB3}\x{B9E}\x{BCD}\x{B9A}\x{BBF}\x{BAF}\x{BA4}\x{BCD} \x{BA4}\x{BBF}\x{B9F}\x{BCD}\x{B9F}\x{BAE}\x{BBE}\x{B95}\x{BC1}\x{BAE}\x{BCD}. \x{B87}\x{B99}\x{BCD}\x{B95}\x{BC1} \x{BA8}\x{BC0}\x{B99}\x{BCD}\x{B95}\x{BB3}\x{BC1}\x{BAE}\x{BCD}"
+          text run at (3,103) width 251: "\x{B89}\x{B99}\x{BCD}\x{B95}\x{BB3}\x{BC1}\x{B95}\x{BCD}\x{B95}\x{BC1} \x{BB5}\x{BBF}\x{BB0}\x{BC1}\x{BAA}\x{BCD}\x{BAA}\x{BAE}\x{BBE}\x{BA9} \x{BA4}\x{BB2}\x{BC8}\x{BAA}\x{BCD}\x{BAA}\x{BC1}\x{B95}\x{BB3}\x{BBF}\x{BB2}\x{BCD}"
+          text run at (3,123) width 149: "\x{BAA}\x{BC1}\x{BA4}\x{BBF}\x{BA4}\x{BBE}\x{B95}\x{B95}\x{BCD} \x{B95}\x{B9F}\x{BCD}\x{B9F}\x{BC1}\x{BB0}\x{BC8}\x{B95}\x{BB3}\x{BCD}!"
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/international/danda-space-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/international/danda-space-expected.png
index ba47bcb..0971c3b 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/international/danda-space-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/international/danda-space-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/international/danda-space-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/international/danda-space-expected.txt
new file mode 100644
index 0000000..b4ef44f
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/international/danda-space-expected.txt
@@ -0,0 +1,16 @@
+layer at (0,0) size 800x600
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  LayoutBlockFlow {HTML} at (0,0) size 800x600
+    LayoutBlockFlow {BODY} at (8,8) size 784x576
+      LayoutBlockFlow {P} at (0,0) size 784x18
+        LayoutText {#text} at (0,0) size 54x18
+          text run at (0,0) width 54: "Test for "
+        LayoutInline {A} at (0,0) size 69x18 [color=#0000EE]
+          LayoutText {#text} at (53,0) size 69x18
+            text run at (53,0) width 69: "bug 25464"
+        LayoutText {#text} at (121,0) size 389x18
+          text run at (121,0) width 389: ": Test for rendering of Danda (U+0964) followed by a space."
+      LayoutBlockFlow {P} at (0,34) size 784x26
+        LayoutText {#text} at (0,1) size 277x18
+          text run at (0,1) width 277: "\x{A39}\x{A41}\x{A70}\x{A26}\x{A40} \x{A39}\x{A48}\x{964} \x{A07}\x{A38} \x{A32}\x{A3F}\x{A2A}\x{A40} \x{A26}\x{A47} \x{A35}\x{A3F}\x{A1A} \x{A69}\x{A6B} (35) \x{A05}\x{A71}\x{A16}\x{A30} \x{A39}\x{A41}\x{A70}\x{A26}\x{A47} \x{A39}\x{A28}\x{964}"
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/international/khmer-selection-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/international/khmer-selection-expected.png
index 3aa3ab08..09744f3 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/international/khmer-selection-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/international/khmer-selection-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/international/khmer-selection-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/international/khmer-selection-expected.txt
new file mode 100644
index 0000000..24242c9e6
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/international/khmer-selection-expected.txt
@@ -0,0 +1,46 @@
+layer at (0,0) size 800x600
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x129
+  LayoutBlockFlow {HTML} at (0,0) size 800x129
+    LayoutBlockFlow {BODY} at (8,16) size 784x97
+      LayoutBlockFlow {P} at (0,0) size 784x27
+        LayoutInline {NOBR} at (0,0) size 137x18
+          LayoutInline {B} at (0,0) size 20x18
+            LayoutText {#text} at (0,2) size 20x18
+              text run at (0,2) width 20: "\x{179C}\x{17C9}\x{17C2}\x{1794}"
+          LayoutText {#text} at (19,2) size 5x18
+            text run at (19,2) width 5: " "
+          LayoutInline {A} at (0,0) size 34x18 [color=#0000EE]
+            LayoutText {#text} at (23,2) size 34x18
+              text run at (23,2) width 34: "\x{179A}\x{17BC}\x{1794}\x{1797}\x{17B6}\x{1796}"
+          LayoutText {#text} at (56,2) size 5x18
+            text run at (56,2) width 5: " "
+          LayoutInline {A} at (0,0) size 21x18 [color=#0000EE]
+            LayoutText {#text} at (60,2) size 21x18
+              text run at (60,2) width 21: "\x{1780}\x{17D2}\x{179A}\x{17BB}\x{1798}"
+          LayoutText {#text} at (80,2) size 5x18
+            text run at (80,2) width 5: " "
+          LayoutInline {A} at (0,0) size 53x18 [color=#0000EE]
+            LayoutText {#text} at (84,2) size 53x18
+              text run at (84,2) width 53: "\x{1790}\x{178F}\x{17AF}\x{1780}\x{179F}\x{17B6}\x{179A}"
+        LayoutText {#text} at (0,0) size 0x0
+      LayoutBlockFlow {P} at (0,43) size 784x54
+        LayoutText {#text} at (0,0) size 542x18
+          text run at (0,0) width 542: "Some Harfbuzz shapers will output cluster logs which suggest that some glyphs had "
+        LayoutInline {I} at (0,0) size 17x18
+          LayoutText {#text} at (541,0) size 17x18
+            text run at (541,0) width 17: "no"
+        LayoutText {#text} at (557,0) size 780x36
+          text run at (557,0) width 223: " contributing code points. This test"
+          text run at (0,18) width 178: "contains such text and uses "
+        LayoutInline {TT} at (0,0) size 87x15
+          LayoutText {#text} at (177,20) size 87x15
+            text run at (177,20) width 87: "eventSender"
+        LayoutText {#text} at (263,18) size 446x18
+          text run at (263,18) width 446: " to select the text. You should see some of the above text selected and"
+        LayoutInline {TT} at (0,0) size 78x15
+          LayoutText {#text} at (0,38) size 78x15
+            text run at (0,38) width 78: "test_shell"
+        LayoutText {#text} at (78,36) size 262x18
+          text run at (78,36) width 262: " shouldn't trigger any assertions or crash."
+caret: position 0 of child 0 {#text} of child 0 {B} of child 1 {NOBR} of child 1 {P} of body
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/international/lang-glyph-cache-separation-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/international/lang-glyph-cache-separation-expected.png
index b39670c9..db95ce4 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/international/lang-glyph-cache-separation-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/international/lang-glyph-cache-separation-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/international/lang-glyph-cache-separation-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/international/lang-glyph-cache-separation-expected.txt
new file mode 100644
index 0000000..21ea9a5
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/international/lang-glyph-cache-separation-expected.txt
@@ -0,0 +1,61 @@
+layer at (0,0) size 800x600
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x412
+  LayoutBlockFlow {HTML} at (0,0) size 800x412
+    LayoutBlockFlow {BODY} at (8,8) size 784x396
+      LayoutBlockFlow (anonymous) at (0,0) size 784x54
+        LayoutText {#text} at (0,0) size 340x18
+          text run at (0,0) width 340: "Tests if glyph caches of different languages interfere."
+        LayoutBR {BR} at (339,0) size 1x18
+        LayoutText {#text} at (0,18) size 743x36
+          text run at (0,18) width 743: "On systems that the locales have different font preferences, the following divs should be displayed in corresponding"
+          text run at (0,36) width 179: "preferred fonts respectively."
+        LayoutBR {BR} at (178,36) size 1x18
+      LayoutBlockFlow {DIV} at (0,54) size 784x114
+        LayoutBlockFlow (anonymous) at (0,0) size 784x18
+          LayoutText {#text} at (0,0) size 130x18
+            text run at (0,0) width 130: "Default font-family:"
+        LayoutBlockFlow {DIV} at (0,18) size 784x24
+          LayoutText {#text} at (0,4) size 179x18
+            text run at (0,4) width 179: "Simplified Chinese: \x{8AA4}\x{904E}\x{9AA8}"
+        LayoutBlockFlow {DIV} at (0,42) size 784x24
+          LayoutText {#text} at (0,4) size 183x18
+            text run at (0,4) width 183: "Traditional Chinese: \x{8AA4}\x{904E}\x{9AA8}"
+        LayoutBlockFlow {DIV} at (0,66) size 784x24
+          LayoutText {#text} at (0,4) size 114x18
+            text run at (0,4) width 114: "Japanese: \x{8AA4}\x{904E}\x{9AA8}"
+        LayoutBlockFlow {DIV} at (0,90) size 784x24
+          LayoutText {#text} at (0,4) size 104x18
+            text run at (0,4) width 104: "Korean: \x{8AA4}\x{904E}\x{9AA8}"
+      LayoutBlockFlow {DIV} at (0,168) size 784x114
+        LayoutBlockFlow (anonymous) at (0,0) size 784x18
+          LayoutText {#text} at (0,0) size 224x18
+            text run at (0,0) width 224: "Generic font-family (sans-serif):"
+        LayoutBlockFlow {DIV} at (0,18) size 784x24
+          LayoutText {#text} at (0,4) size 190x18
+            text run at (0,4) width 190: "Simplified Chinese: \x{8AA4}\x{904E}\x{9AA8}"
+        LayoutBlockFlow {DIV} at (0,42) size 784x24
+          LayoutText {#text} at (0,4) size 195x18
+            text run at (0,4) width 195: "Traditional Chinese: \x{8AA4}\x{904E}\x{9AA8}"
+        LayoutBlockFlow {DIV} at (0,66) size 784x24
+          LayoutText {#text} at (0,4) size 127x18
+            text run at (0,4) width 127: "Japanese: \x{8AA4}\x{904E}\x{9AA8}"
+        LayoutBlockFlow {DIV} at (0,90) size 784x24
+          LayoutText {#text} at (0,4) size 109x18
+            text run at (0,4) width 109: "Korean: \x{8AA4}\x{904E}\x{9AA8}"
+      LayoutBlockFlow {DIV} at (0,282) size 784x114
+        LayoutBlockFlow (anonymous) at (0,0) size 784x18
+          LayoutText {#text} at (0,0) size 300x17
+            text run at (0,0) width 300: "Non-generic font-family (Times New Roman):"
+        LayoutBlockFlow {DIV} at (0,18) size 784x24
+          LayoutText {#text} at (0,4) size 180x17
+            text run at (0,4) width 180: "Simplified Chinese: \x{8AA4}\x{904E}\x{9AA8}"
+        LayoutBlockFlow {DIV} at (0,42) size 784x24
+          LayoutText {#text} at (0,4) size 183x17
+            text run at (0,4) width 183: "Traditional Chinese: \x{8AA4}\x{904E}\x{9AA8}"
+        LayoutBlockFlow {DIV} at (0,66) size 784x24
+          LayoutText {#text} at (0,4) size 114x17
+            text run at (0,4) width 114: "Japanese: \x{8AA4}\x{904E}\x{9AA8}"
+        LayoutBlockFlow {DIV} at (0,90) size 784x24
+          LayoutText {#text} at (0,4) size 104x17
+            text run at (0,4) width 104: "Korean: \x{8AA4}\x{904E}\x{9AA8}"
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/international/plane2-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/international/plane2-expected.png
index eb2c6dfe..47c4a9f 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/international/plane2-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/international/plane2-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/international/pop-up-button-text-alignment-and-direction-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/international/pop-up-button-text-alignment-and-direction-expected.png
index b6bb7119..04ff87f 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/international/pop-up-button-text-alignment-and-direction-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/international/pop-up-button-text-alignment-and-direction-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/international/pop-up-button-text-alignment-and-direction-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/international/pop-up-button-text-alignment-and-direction-expected.txt
index a9c680de..28a3fd5 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/international/pop-up-button-text-alignment-and-direction-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/international/pop-up-button-text-alignment-and-direction-expected.txt
@@ -4,9 +4,9 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x514
     LayoutBlockFlow {BODY} at (8,16) size 784x490
       LayoutBlockFlow {P} at (0,0) size 784x18
-        LayoutText {#text} at (0,0) size 710x18
-          text run at (0,0) width 499: "Verify that the alignment and writing direction of each selected item matches "
-          text run at (498,0) width 212: "the one below the pop-up button."
+        LayoutText {#text} at (0,0) size 709x18
+          text run at (0,0) width 497: "Verify that the alignment and writing direction of each selected item matches "
+          text run at (496,0) width 213: "the one below the pop-up button."
       LayoutBlockFlow {DIV} at (0,34) size 784x228
         LayoutMenuList {SELECT} at (0,0) size 500x21 [bgcolor=#F8F8F8]
           LayoutBlockFlow (anonymous) at (0,0) size 500x21
@@ -28,15 +28,15 @@
             LayoutText (anonymous) at (8,2) size 163x16
               text run at (8,2) width 27: "fifth"
               text run at (34,2) width 52 RTL: ") \x{5E8}\x{5D1}\x{5D9}\x{5E2}\x{5D9}\x{5EA} "
-              text run at (85,2) width 18: "03"
-              text run at (102,2) width 41 RTL: " \x{5E9}\x{5E0}\x{5D9}\x{5D4} ("
+              text run at (85,2) width 17: "03"
+              text run at (101,2) width 42 RTL: " \x{5E9}\x{5E0}\x{5D9}\x{5D4} ("
               text run at (142,2) width 29: "First"
         LayoutBlockFlow {DIV} at (0,78) size 470x36
           LayoutText {#text} at (10,10) size 163x16
             text run at (10,10) width 27: "fifth"
             text run at (36,10) width 52 RTL: ") \x{5E8}\x{5D1}\x{5D9}\x{5E2}\x{5D9}\x{5EA} "
-            text run at (87,10) width 18: "03"
-            text run at (104,10) width 41 RTL: " \x{5E9}\x{5E0}\x{5D9}\x{5D4} ("
+            text run at (87,10) width 17: "03"
+            text run at (103,10) width 42 RTL: " \x{5E9}\x{5E0}\x{5D9}\x{5D4} ("
             text run at (144,10) width 29: "First"
         LayoutMenuList {SELECT} at (0,114) size 500x21 [bgcolor=#F8F8F8]
           LayoutBlockFlow (anonymous) at (0,0) size 500x21
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/international/rtl-negative-letter-spacing-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/international/rtl-negative-letter-spacing-expected.png
index bafa0568..cc7c405 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/international/rtl-negative-letter-spacing-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/international/rtl-negative-letter-spacing-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/international/rtl-negative-letter-spacing-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/international/rtl-negative-letter-spacing-expected.txt
index fdc771a4..426d7ba 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/international/rtl-negative-letter-spacing-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/international/rtl-negative-letter-spacing-expected.txt
@@ -4,8 +4,8 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x60
     LayoutBlockFlow {BODY} at (8,8) size 784x36
       LayoutBlockFlow {P} at (0,18) size 784x18
-        LayoutText {#text} at (0,0) size 467x18
-          text run at (0,0) width 467: "The line above should have the letter 'a' to the right of the pipe character."
+        LayoutText {#text} at (0,0) size 466x18
+          text run at (0,0) width 466: "The line above should have the letter 'a' to the right of the pipe character."
 layer at (792,8) size 0x18
   LayoutBlockFlow (floating) {DIV} at (784,0) size 0x18
     LayoutText {#text} at (0,0) size 0x18
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/international/text-combine-image-test-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/international/text-combine-image-test-expected.png
index 8c732f00..0141b2e6 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/international/text-combine-image-test-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/international/text-combine-image-test-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/international/text-spliced-font-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/international/text-spliced-font-expected.png
index 2402d26..c7aee0cd 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/international/text-spliced-font-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/international/text-spliced-font-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/international/thai-line-breaks-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/international/thai-line-breaks-expected.png
index 41573bd..436a3c86 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/international/thai-line-breaks-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/international/thai-line-breaks-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/international/unicode-bidi-plaintext-in-textarea-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/international/unicode-bidi-plaintext-in-textarea-expected.png
index 35a954e..06dd2a4 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/international/unicode-bidi-plaintext-in-textarea-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/international/unicode-bidi-plaintext-in-textarea-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/international/unicode-bidi-plaintext-in-textarea-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/international/unicode-bidi-plaintext-in-textarea-expected.txt
index eea0f85..5684a924 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/international/unicode-bidi-plaintext-in-textarea-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/international/unicode-bidi-plaintext-in-textarea-expected.txt
@@ -5,8 +5,8 @@
     LayoutBlockFlow {BODY} at (8,8) size 784x284
       LayoutBlockFlow {DIV} at (0,0) size 784x284
         LayoutBlockFlow (anonymous) at (0,0) size 784x36
-          LayoutText {#text} at (0,0) size 779x36
-            text run at (0,0) width 779: "In all four cases below, the exclamation mark should be on the left side of the first line and on the right side of the second"
+          LayoutText {#text} at (0,0) size 777x36
+            text run at (0,0) width 777: "In all four cases below, the exclamation mark should be on the left side of the first line and on the right side of the second"
             text run at (0,18) width 28: "line."
         LayoutBlockFlow {DIV} at (0,36) size 784x248
           LayoutBR {BR} at (371,44) size 0x18
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/international/wrap-CJK-001-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/international/wrap-CJK-001-expected.png
index a44619a4..ca8faa7 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/international/wrap-CJK-001-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/international/wrap-CJK-001-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/international/wrap-CJK-001-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/international/wrap-CJK-001-expected.txt
new file mode 100644
index 0000000..d5963d0
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/international/wrap-CJK-001-expected.txt
@@ -0,0 +1,12 @@
+layer at (0,0) size 800x600
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  LayoutBlockFlow {HTML} at (0,0) size 800x600
+    LayoutBlockFlow {BODY} at (8,8) size 784x580
+      LayoutBlockFlow (anonymous) at (0,0) size 784x14
+        LayoutText {#text} at (0,0) size 354x14
+          text run at (0,0) width 354: "Tests that wrapping does not trim the last character if it is not whitespace."
+      LayoutBlockFlow {P} at (0,26) size 551x42 [border: (3px solid #FF0000)]
+        LayoutText {#text} at (3,6) size 534x32
+          text run at (3,6) width 534: "\x{6700}\x{5927}2GHz\x{306E}Intel Core Duo\x{30D7}\x{30ED}\x{30BB}\x{30C3}\x{30B5}\x{306E}\x{30D1}\x{30EF}\x{30FC}\x{3001}iSight\x{30AB}\x{30E1}\x{30E9}\x{3001}Front Row\x{3001}iLife \x{2019}06\x{3001}13\x{30A4}\x{30F3}\x{30C1}\x{306E}\x{30AF}\x{30EA}"
+          text run at (3,24) width 178: "\x{30A2}\x{30EF}\x{30A4}\x{30C9}\x{30B9}\x{30AF}\x{30EA}\x{30FC}\x{30F3}\x{30C7}\x{30A3}\x{30B9}\x{30D7}\x{30EC}\x{30A4}"
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/softHyphen-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/softHyphen-expected.png
index 3574fb58..47142f74 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/softHyphen-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/softHyphen-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/unicode-fallback-font-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/unicode-fallback-font-expected.png
index a307776..4ebfd85b 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/unicode-fallback-font-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/unicode-fallback-font-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/unicode-fallback-font-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/unicode-fallback-font-expected.txt
new file mode 100644
index 0000000..dab4fc0
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/unicode-fallback-font-expected.txt
@@ -0,0 +1,144 @@
+layer at (0,0) size 800x600 clip at (0,0) size 785x600 scrollHeight 1246
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 785x1246 backgroundClip at (0,0) size 785x600 clip at (0,0) size 785x600
+  LayoutBlockFlow {HTML} at (0,0) size 785x1245.88
+    LayoutBlockFlow {BODY} at (8,21.44) size 769x1208.44
+      LayoutBlockFlow {H1} at (0,0) size 769x37
+        LayoutText {#text} at (0,0) size 236x37
+          text run at (0,0) width 236: "Unicode Symbols"
+      LayoutBlockFlow {PRE} at (0,58.44) size 769x1098
+        LayoutText {#text} at (0,0) size 297x105
+          text run at (0,0) width 0: " "
+          text run at (0,15) width 297: "U+16Ax \x{16A0} \x{16A1} \x{16A2} \x{16A3} \x{16A4} \x{16A5} \x{16A6} \x{16A7} \x{16A8} \x{16A9} \x{16AA} \x{16AB} \x{16AC} \x{16AD} \x{16AE} \x{16AF}"
+          text run at (296,15) width 1: " "
+          text run at (0,30) width 297: "U+16Bx \x{16B0} \x{16B1} \x{16B2} \x{16B3} \x{16B4} \x{16B5} \x{16B6} \x{16B7} \x{16B8} \x{16B9} \x{16BA} \x{16BB} \x{16BC} \x{16BD} \x{16BE} \x{16BF}"
+          text run at (296,30) width 1: " "
+          text run at (0,45) width 297: "U+16Cx \x{16C0} \x{16C1} \x{16C2} \x{16C3} \x{16C4} \x{16C5} \x{16C6} \x{16C7} \x{16C8} \x{16C9} \x{16CA} \x{16CB} \x{16CC} \x{16CD} \x{16CE} \x{16CF}"
+          text run at (296,45) width 1: " "
+          text run at (0,60) width 297: "U+16Dx \x{16D0} \x{16D1} \x{16D2} \x{16D3} \x{16D4} \x{16D5} \x{16D6} \x{16D7} \x{16D8} \x{16D9} \x{16DA} \x{16DB} \x{16DC} \x{16DD} \x{16DE} \x{16DF}"
+          text run at (296,60) width 1: " "
+          text run at (0,75) width 297: "U+16Ex \x{16E0} \x{16E1} \x{16E2} \x{16E3} \x{16E4} \x{16E5} \x{16E6} \x{16E7} \x{16E8} \x{16E9} \x{16EA} \x{16EB} \x{16EC} \x{16ED} \x{16EE} \x{16EF}"
+          text run at (296,75) width 1: " "
+          text run at (0,90) width 63: "U+16Fx \x{16F0}"
+          text run at (62,90) width 1: " "
+        LayoutText {#text} at (0,105) size 297x125
+          text run at (0,105) width 0: " "
+          text run at (0,121) width 258: "U+200x \x{2000} \x{2001} \x{2002} \x{2003} \x{2004} \x{2004} \x{2004} \x{2004} \x{2004} \x{2009} \x{200A} \x{200B} \x{200C} \x{200D} \x{200E} "
+          text run at (257,121) width 1 RTL: "\x{200F}"
+          text run at (257,121) width 1: " "
+          text run at (0,137) width 297: "U+201x \x{2010} \x{2011} \x{2012} \x{2013} \x{2014} \x{2015} \x{2016} \x{2017} \x{2018} \x{2019} \x{201A} \x{201B} \x{201C} \x{201D} \x{201E} \x{201F}"
+          text run at (296,137) width 1: " "
+          text run at (0,153) width 196: "U+202x \x{2020} \x{2021} \x{2022} \x{2023} \x{2024} \x{2025} \x{2026} \x{2027} \x{2028} \x{2029} "
+          text run at (195,153) width 8: "\x{202A} "
+          text run at (202,153) width 9 RTL: "\x{202B} "
+          text run at (210,153) width 9: "\x{202C} "
+          text run at (218,153) width 9 LTR override: "\x{202D} "
+          text run at (226,153) width 1 RTL override: " "
+          text run at (226,153) width 16 RTL override: "\x{202E} \x{202F}"
+          text run at (0,169) width 297: "U+203x \x{2030} \x{2031} \x{2032} \x{2033} \x{2034} \x{2035} \x{2036} \x{2037} \x{2038} \x{2039} \x{203A} \x{203B} \x{203C} \x{203D} \x{203E} \x{203F}"
+          text run at (296,169) width 1: " "
+          text run at (0,184) width 297: "U+204x \x{2040} \x{2041} \x{2042} \x{2043} \x{2044} \x{2045} \x{2046} \x{2047} \x{2048} \x{2049} \x{204A} \x{204B} \x{204C} \x{204D} \x{204E} \x{204F}"
+          text run at (296,184) width 1: " "
+          text run at (0,199) width 297: "U+205x \x{2050} \x{2051} \x{2052} \x{2053} \x{2054} \x{2055} \x{2056} \x{2057} \x{2058} \x{2059} \x{205A} \x{205B} \x{205C} \x{205D} \x{205E} \x{205F}"
+          text run at (296,199) width 1: " "
+          text run at (0,215) width 133: "U+206x \x{2060} \x{2061} \x{2062} \x{2063} \x{2064} \x{206A} \x{206B} \x{206C} \x{206D} \x{206E} \x{206F}"
+          text run at (132,215) width 1: " "
+        LayoutText {#text} at (0,231) size 380x344
+          text run at (0,231) width 0: " "
+          text run at (0,248) width 355: "U+260x \x{2600} \x{2601} \x{2602} \x{2603} \x{2604} \x{2605} \x{2606} \x{2607} \x{2608} \x{2609} \x{260A} \x{260B} \x{260C} \x{260D} \x{260E} \x{260F}"
+          text run at (354,248) width 1: " "
+          text run at (0,270) width 359: "U+261x \x{2610} \x{2611} \x{2612} \x{2613} \x{2614} \x{2615} \x{2616} \x{2617} \x{2618} \x{2619} \x{261A} \x{261B} \x{261C} \x{261D} \x{261E} \x{261F}"
+          text run at (358,270) width 1: " "
+          text run at (0,290) width 314: "U+262x \x{2620} \x{2621} \x{2622} \x{2623} \x{2624} \x{2625} \x{2626} \x{2627} \x{2628} \x{2629} \x{262A} \x{262B} \x{262C} \x{262D} \x{262E} \x{262F}"
+          text run at (313,290) width 1: " "
+          text run at (0,309) width 352: "U+263x \x{2630} \x{2631} \x{2632} \x{2633} \x{2634} \x{2635} \x{2636} \x{2637} \x{2638} \x{2639} \x{263A} \x{263B} \x{263C} \x{263D} \x{263E} \x{263F}"
+          text run at (351,309) width 1: " "
+          text run at (0,330) width 352: "U+264x \x{2640} \x{2641} \x{2642} \x{2643} \x{2644} \x{2645} \x{2646} \x{2647} \x{2648} \x{2649} \x{264A} \x{264B} \x{264C} \x{264D} \x{264E} \x{264F}"
+          text run at (351,330) width 1: " "
+          text run at (0,352) width 380: "U+265x \x{2650} \x{2651} \x{2652} \x{2653} \x{2654} \x{2655} \x{2656} \x{2657} \x{2658} \x{2659} \x{265A} \x{265B} \x{265C} \x{265D} \x{265E} \x{265F}"
+          text run at (379,352) width 1: " "
+          text run at (0,371) width 375: "U+266x \x{2660} \x{2661} \x{2662} \x{2663} \x{2664} \x{2665} \x{2666} \x{2667} \x{2668} \x{2669} \x{266A} \x{266B} \x{266C} \x{266D} \x{266E} \x{266F}"
+          text run at (374,371) width 1: " "
+          text run at (0,393) width 365: "U+267x \x{2670} \x{2671} \x{2672} \x{2673} \x{2674} \x{2675} \x{2676} \x{2677} \x{2678} \x{2679} \x{267A} \x{267B} \x{267C} \x{267D} \x{267E} \x{267F}"
+          text run at (364,393) width 1: " "
+          text run at (0,411) width 311: "U+268x \x{2680} \x{2681} \x{2682} \x{2683} \x{2684} \x{2685} \x{2686} \x{2687} \x{2688} \x{2689} \x{268A} \x{268B} \x{268C} \x{268D} \x{268E} \x{268F}"
+          text run at (311,411) width 0: " "
+          text run at (0,431) width 302: "U+269x \x{2690} \x{2691} \x{2692} \x{2693} \x{2694} \x{2695} \x{2696} \x{2697} \x{2698} \x{2699} \x{269A} \x{269B} \x{269C} \x{269D} \x{269E} \x{269F}"
+          text run at (301,431) width 1: " "
+          text run at (0,452) width 354: "U+26Ax \x{26A0} \x{26A1} \x{26A2} \x{26A3} \x{26A4} \x{26A5} \x{26A6} \x{26A7} \x{26A8} \x{26A9} \x{26AA} \x{26AB} \x{26AC} \x{26AD} \x{26AE} \x{26AF}"
+          text run at (353,452) width 1: " "
+          text run at (0,474) width 307: "U+26Bx \x{26B0} \x{26B1} \x{26B2} \x{26B3} \x{26B4} \x{26B5} \x{26B6} \x{26B7} \x{26B8} \x{26B9} \x{26BA} \x{26BB} \x{26BC} \x{26BD} \x{26BE} \x{26BF}"
+          text run at (306,474) width 1: " "
+          text run at (0,496) width 313: "U+26Cx \x{26C0} \x{26C1} \x{26C2} \x{26C3} \x{26C4} \x{26C5} \x{26C6} \x{26C7} \x{26C8} \x{26C9} \x{26CA} \x{26CB} \x{26CC} \x{26CD} \x{26CE} \x{26CF}"
+          text run at (312,496) width 1: " "
+          text run at (0,517) width 302: "U+26Dx \x{26D0} \x{26D1} \x{26D2} \x{26D3} \x{26D4} \x{26D5} \x{26D6} \x{26D7} \x{26D8} \x{26D9} \x{26DA} \x{26DB} \x{26DC} \x{26DD} \x{26DE} \x{26DF}"
+          text run at (301,517) width 1: " "
+          text run at (0,538) width 303: "U+26Ex \x{26E0} \x{26E1} \x{26E2} \x{26E3} \x{26E4} \x{26E5} \x{26E6} \x{26E7} \x{26E8} \x{26E9} \x{26EA} \x{26EB} \x{26EC} \x{26ED} \x{26EE} \x{26EF}"
+          text run at (302,538) width 1: " "
+          text run at (0,560) width 323: "U+26Fx \x{26F0} \x{26F1} \x{26F2} \x{26F3} \x{26F4} \x{26F5} \x{26F6} \x{26F7} \x{26F8} \x{26F9} \x{26FA} \x{26FB} \x{26FC} \x{26FD} \x{26FE} \x{26FF}"
+          text run at (322,560) width 1: " "
+        LayoutText {#text} at (0,577) size 357x229
+          text run at (0,577) width 0: " "
+          text run at (0,596) width 351: "U+270x \x{2700} \x{2701} \x{2702} \x{2703} \x{2704} \x{2705} \x{2706} \x{2707} \x{2708} \x{2709} \x{270A} \x{270B} \x{270C} \x{270D} \x{270E} \x{270F}"
+          text run at (350,596) width 1: " "
+          text run at (0,613) width 326: "U+271x \x{2710} \x{2711} \x{2712} \x{2713} \x{2714} \x{2715} \x{2716} \x{2717} \x{2718} \x{2719} \x{271A} \x{271B} \x{271C} \x{271D} \x{271E} \x{271F}"
+          text run at (325,613) width 1: " "
+          text run at (0,632) width 338: "U+272x \x{2720} \x{2721} \x{2722} \x{2723} \x{2724} \x{2725} \x{2726} \x{2727} \x{2728} \x{2729} \x{272A} \x{272B} \x{272C} \x{272D} \x{272E} \x{272F}"
+          text run at (337,632) width 1: " "
+          text run at (0,649) width 330: "U+273x \x{2730} \x{2731} \x{2732} \x{2733} \x{2734} \x{2735} \x{2736} \x{2737} \x{2738} \x{2739} \x{273A} \x{273B} \x{273C} \x{273D} \x{273E} \x{273F}"
+          text run at (329,649) width 1: " "
+          text run at (0,668) width 337: "U+274x \x{2740} \x{2741} \x{2742} \x{2743} \x{2744} \x{2745} \x{2746} \x{2747} \x{2748} \x{2749} \x{274A} \x{274B} \x{274C} \x{274D} \x{274E} \x{274F}"
+          text run at (336,668) width 1: " "
+          text run at (0,689) width 310: "U+275x \x{2750} \x{2751} \x{2752} \x{2753} \x{2754} \x{2755} \x{2756} \x{2757} \x{2758} \x{2759} \x{275A} \x{275B} \x{275C} \x{275D} \x{275E} \x{275F}"
+          text run at (309,689) width 1: " "
+          text run at (0,706) width 283: "U+276x \x{2760} \x{2761} \x{2762} \x{2763} \x{2764} \x{2765} \x{2766} \x{2767} \x{2768} \x{2769} \x{276A} \x{276B} \x{276C} \x{276D} \x{276E} \x{276F}"
+          text run at (282,706) width 1: " "
+          text run at (0,721) width 300: "U+277x \x{2770} \x{2771} \x{2772} \x{2773} \x{2774} \x{2775} \x{2776} \x{2777} \x{2778} \x{2779} \x{277A} \x{277B} \x{277C} \x{277D} \x{277E} \x{277F}"
+          text run at (299,721) width 1: " "
+          text run at (0,736) width 336: "U+278x \x{2780} \x{2781} \x{2782} \x{2783} \x{2784} \x{2785} \x{2786} \x{2787} \x{2788} \x{2789} \x{278A} \x{278B} \x{278C} \x{278D} \x{278E} \x{278F}"
+          text run at (335,736) width 1: " "
+          text run at (0,755) width 354: "U+279x \x{2790} \x{2791} \x{2792} \x{2793} \x{2794} \x{2795} \x{2796} \x{2797} \x{2798} \x{2799} \x{279A} \x{279B} \x{279C} \x{279D} \x{279E} \x{279F}"
+          text run at (353,755) width 1: " "
+          text run at (0,772) width 346: "U+27Ax \x{27A0} \x{27A1} \x{27A2} \x{27A3} \x{27A4} \x{27A5} \x{27A6} \x{27A7} \x{27A8} \x{27A9} \x{27AA} \x{27AB} \x{27AC} \x{27AD} \x{27AE} \x{27AF}"
+          text run at (345,772) width 1: " "
+          text run at (0,791) width 357: "U+27Bx \x{27B0} \x{27B1} \x{27B2} \x{27B3} \x{27B4} \x{27B5} \x{27B6} \x{27B7} \x{27B8} \x{27B9} \x{27BA} \x{27BB} \x{27BC} \x{27BD} \x{27BE} \x{27BF}"
+          text run at (356,791) width 1: " "
+        LayoutText {#text} at (0,808) size 328x290
+          text run at (0,808) width 0: " "
+          text run at (0,823) width 328: "U+2A0x \x{2A00} \x{2A01} \x{2A02} \x{2A03} \x{2A04} \x{2A05} \x{2A06} \x{2A07} \x{2A08} \x{2A09} \x{2A0A} \x{2A0B} \x{2A0C} \x{2A0D} \x{2A0E} \x{2A0F}"
+          text run at (327,823) width 1: " "
+          text run at (0,841) width 291: "U+2A1x \x{2A10} \x{2A11} \x{2A12} \x{2A13} \x{2A14} \x{2A15} \x{2A16} \x{2A17} \x{2A18} \x{2A19} \x{2A1A} \x{2A1B} \x{2A1C} \x{2A1D} \x{2A1E} \x{2A1F}"
+          text run at (290,841) width 1: " "
+          text run at (0,859) width 293: "U+2A2x \x{2A20} \x{2A21} \x{2A22} \x{2A23} \x{2A24} \x{2A25} \x{2A26} \x{2A27} \x{2A28} \x{2A29} \x{2A2A} \x{2A2B} \x{2A2C} \x{2A2D} \x{2A2E} \x{2A2F}"
+          text run at (292,859) width 1: " "
+          text run at (0,875) width 312: "U+2A3x \x{2A30} \x{2A31} \x{2A32} \x{2A33} \x{2A34} \x{2A35} \x{2A36} \x{2A37} \x{2A38} \x{2A39} \x{2A3A} \x{2A3B} \x{2A3C} \x{2A3D} \x{2A3E} \x{2A3F}"
+          text run at (311,875) width 1: " "
+          text run at (0,891) width 287: "U+2A4x \x{2A40} \x{2A41} \x{2A42} \x{2A43} \x{2A44} \x{2A45} \x{2A46} \x{2A47} \x{2A48} \x{2A49} \x{2A4A} \x{2A4B} \x{2A4C} \x{2A4D} \x{2A4E} \x{2A4F}"
+          text run at (286,891) width 1: " "
+          text run at (0,907) width 311: "U+2A5x \x{2A50} \x{2A51} \x{2A52} \x{2A53} \x{2A54} \x{2A55} \x{2A56} \x{2A57} \x{2A58} \x{2A59} \x{2A5A} \x{2A5B} \x{2A5C} \x{2A5D} \x{2A5E} \x{2A5F}"
+          text run at (310,907) width 1: " "
+          text run at (0,923) width 290: "U+2A6x \x{2A60} \x{2A61} \x{2A62} \x{2A63} \x{2A64} \x{2A65} \x{2A66} \x{2A67} \x{2A68} \x{2A69} \x{2A6A} \x{2A6B} \x{2A6C} \x{2A6D} \x{2A6E} \x{2A6F}"
+          text run at (289,923) width 1: " "
+          text run at (0,939) width 310: "U+2A7x \x{2A70} \x{2A71} \x{2A72} \x{2A73} \x{2A74} \x{2A75} \x{2A76} \x{2A77} \x{2A78} \x{2A79} \x{2A7A} \x{2A7B} \x{2A7C} \x{2A7D} \x{2A7E} \x{2A7F}"
+          text run at (309,939) width 1: " "
+          text run at (0,955) width 286: "U+2A8x \x{2A80} \x{2A81} \x{2A82} \x{2A83} \x{2A84} \x{2A85} \x{2A86} \x{2A87} \x{2A88} \x{2A89} \x{2A8A} \x{2A8B} \x{2A8C} \x{2A8D} \x{2A8E} \x{2A8F}"
+          text run at (285,955) width 1: " "
+          text run at (0,971) width 285: "U+2A9x \x{2A90} \x{2A91} \x{2A92} \x{2A93} \x{2A94} \x{2A95} \x{2A96} \x{2A97} \x{2A98} \x{2A99} \x{2A9A} \x{2A9B} \x{2A9C} \x{2A9D} \x{2A9E} \x{2A9F}"
+          text run at (284,971) width 1: " "
+          text run at (0,987) width 301: "U+2AAx \x{2AA0} \x{2AA1} \x{2AA2} \x{2AA3} \x{2AA4} \x{2AA5} \x{2AA6} \x{2AA7} \x{2AA8} \x{2AA9} \x{2AAA} \x{2AAB} \x{2AAC} \x{2AAD} \x{2AAE} \x{2AAF}"
+          text run at (300,987) width 1: " "
+          text run at (0,1003) width 295: "U+2ABx \x{2AB0} \x{2AB1} \x{2AB2} \x{2AB3} \x{2AB4} \x{2AB5} \x{2AB6} \x{2AB7} \x{2AB8} \x{2AB9} \x{2ABA} \x{2ABB} \x{2ABC} \x{2ABD} \x{2ABE} \x{2ABF}"
+          text run at (294,1003) width 1: " "
+          text run at (0,1019) width 286: "U+2ACx \x{2AC0} \x{2AC1} \x{2AC2} \x{2AC3} \x{2AC4} \x{2AC5} \x{2AC6} \x{2AC7} \x{2AC8} \x{2AC9} \x{2ACA} \x{2ACB} \x{2ACC} \x{2ACD} \x{2ACE} \x{2ACF}"
+          text run at (285,1019) width 1: " "
+          text run at (0,1035) width 293: "U+2ADx \x{2AD0} \x{2AD1} \x{2AD2} \x{2AD3} \x{2AD4} \x{2AD5} \x{2AD6} \x{2AD7} \x{2AD8} \x{2AD9} \x{2ADA} \x{2ADB} \x{2ADC} \x{2ADD} \x{2ADE} \x{2ADF}"
+          text run at (292,1035) width 1: " "
+          text run at (0,1051) width 303: "U+2AEx \x{2AE0} \x{2AE1} \x{2AE2} \x{2AE3} \x{2AE4} \x{2AE5} \x{2AE6} \x{2AE7} \x{2AE8} \x{2AE9} \x{2AEA} \x{2AEB} \x{2AEC} \x{2AED} \x{2AEE} \x{2AEF}"
+          text run at (302,1051) width 1: " "
+          text run at (0,1067) width 269: "U+2AFx \x{2AF0} \x{2AF1} \x{2AF2} \x{2AF3} \x{2AF4} \x{2AF5} \x{2AF6} \x{2AF7} \x{2AF8} \x{2AF9} \x{2AFA} \x{2AFB} \x{2AFC} \x{2AFD} \x{2AFE} \x{2AFF}"
+          text run at (268,1067) width 1: " "
+          text run at (0,1083) width 63: "        "
+      LayoutBlockFlow {P} at (0,1172.44) size 769x36
+        LayoutText {#text} at (0,0) size 764x36
+          text run at (0,0) width 764: "A series of unicode symbols (Runic, General Punctuation, Miscellaneous Symbols, and Mathematical Symbols) should"
+          text run at (0,18) width 108: "be shown above."
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/whitespace/024-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/whitespace/024-expected.png
index c1d50e3..432b417 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/whitespace/024-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/whitespace/024-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/whitespace/pre-wrap-spaces-after-newline-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/whitespace/pre-wrap-spaces-after-newline-expected.png
index fa352e77e..d7fae83 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/whitespace/pre-wrap-spaces-after-newline-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/whitespace/pre-wrap-spaces-after-newline-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/word-break-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/word-break-expected.png
index 3dbda528..62907a9 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/word-break-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/text/word-break-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/writing-mode/vertical-font-fallback-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/writing-mode/vertical-font-fallback-expected.png
index ab265fc..e6b0618 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/writing-mode/vertical-font-fallback-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-mavericks/fast/writing-mode/vertical-font-fallback-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mountainlion/fast/text/basic/012-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mountainlion/fast/text/basic/012-expected.png
index 9fa695e..cf16368 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-mountainlion/fast/text/basic/012-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-mountainlion/fast/text/basic/012-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mountainlion/fast/text/drawBidiText-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mountainlion/fast/text/drawBidiText-expected.png
new file mode 100644
index 0000000..0b609e6
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/mac-mountainlion/fast/text/drawBidiText-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mountainlion/fast/text/drawBidiText-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-mountainlion/fast/text/drawBidiText-expected.txt
new file mode 100644
index 0000000..1a379db
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/mac-mountainlion/fast/text/drawBidiText-expected.txt
@@ -0,0 +1,56 @@
+layer at (0,0) size 800x600
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  LayoutBlockFlow {HTML} at (0,0) size 800x600
+    LayoutBlockFlow {BODY} at (8,8) size 784x584
+      LayoutBlockFlow {P} at (0,0) size 784x18
+        LayoutText {#text} at (0,0) size 285x18
+          text run at (0,0) width 285: "This tests GraphicsContext::drawBidiText()."
+layer at (8,42) size 345x205 clip at (9,43) size 332x203 scrollHeight 205
+  LayoutListBox {SELECT} at (0,34) size 344.80x205.34 [bgcolor=#FFFFFF] [border: (1px solid #999999)]
+    LayoutBlockFlow {OPTION} at (1,1) size 331.80x22.59
+      LayoutText {#text} at (2,0) size 225x21
+        text run at (2,0) width 44: "First "
+        text run at (45,0) width 67 RTL: ") \x{5E8}\x{5D1}\x{5D9}\x{5E2}\x{5D9}\x{5EA}"
+        text run at (111,0) width 24: "03"
+        text run at (134,0) width 51 RTL: "\x{5E9}\x{5E0}\x{5D9}\x{5D4} ("
+        text run at (184,0) width 43: " fifth"
+    LayoutBlockFlow {OPTION} at (1,23.59) size 331.80x22.59
+      LayoutText {#text} at (105,0) size 225x21
+        text run at (105,0) width 37: "fifth"
+        text run at (141,0) width 72 RTL: ") \x{5E8}\x{5D1}\x{5D9}\x{5E2}\x{5D9}\x{5EA} "
+        text run at (212,0) width 24: "03"
+        text run at (235,0) width 57 RTL: " \x{5E9}\x{5E0}\x{5D9}\x{5D4} ("
+        text run at (291,0) width 39: "First"
+    LayoutBlockFlow {OPTION} at (1,46.19) size 331.80x22.59
+      LayoutText {#text} at (2,0) size 225x21
+        text run at (2,0) width 225 LTR override: "First \x{5E9}\x{5E0}\x{5D9}\x{5D4} (03) \x{5E8}\x{5D1}\x{5D9}\x{5E2}\x{5D9}\x{5EA} fifth"
+    LayoutBlockFlow {OPTION} at (1,68.78) size 331.80x22.59
+      LayoutText {#text} at (105,0) size 225x21
+        text run at (105,0) width 225 RTL override: "First \x{5E9}\x{5E0}\x{5D9}\x{5D4} (03) \x{5E8}\x{5D1}\x{5D9}\x{5E2}\x{5D9}\x{5EA} fifth"
+    LayoutBlockFlow {OPTION} at (1,91.38) size 331.80x22.59
+      LayoutText {#text} at (2,0) size 113x21
+        text run at (2,0) width 113 RTL: "\x{5DE}\x{5E9}\x{5D4}\x{5D5} \x{5E2}\x{5DD} \x{5E0}\x{5B4}\x{5E7}\x{5BC}\x{5D5}\x{5BC}\x{5D3}"
+    LayoutBlockFlow {OPTION} at (1,113.97) size 331.80x25
+      LayoutText {#text} at (2,0) size 74x21
+        text run at (2,0) width 74 RTL: "\x{627}\x{644}\x{644}\x{63A}\x{629} \x{627}\x{644}\x{639}\x{631}\x{628}\x{64A}\x{629}"
+    LayoutBlockFlow {OPTION} at (1,138.97) size 331.80x22.59
+      LayoutText {#text} at (2,0) size 132x21
+        text run at (2,0) width 132: "Et volia\x{300}: ATSUI!"
+    LayoutBlockFlow {OPTION} at (1,161.56) size 331.80x22.59
+      LayoutText {#text} at (2,0) size 312x21
+        text run at (2,0) width 101: "Directional "
+        text run at (102,0) width 82 RTL override: "\x{202E}overrides"
+        text run at (183,0) width 131: "\x{202C} are confusing."
+    LayoutBlockFlow {OPTION} at (1,184.16) size 331.80x22.59
+      LayoutText {#text} at (2,0) size 328x21
+        text run at (2,0) width 86: "She said \x{201C}"
+        text run at (87,0) width 74 RTL: " \x{5D1}\x{5DE}\x{5D6}\x{5D5}\x{5D5}\x{5D3}\x{5D4}!"
+        text run at (160,0) width 37: "TNT"
+        text run at (196,0) width 25 RTL: "\x{202B}\x{5D9}\x{5E9} "
+        text run at (220,0) width 110: "\x{202C}\x{201D} and ran off"
+layer at (8,247) size 390x18 clip at (9,248) size 377x16
+  LayoutListBox {SELECT} at (0,239.34) size 390.30x18 [bgcolor=#FFFFFF] [border: (1px solid #999999)]
+    LayoutBlockFlow {OPTION} at (1,1) size 377.30x16
+      LayoutText {#text} at (2,0) size 374x15
+        text run at (2,0) width 374: "There are two ways to measure text: my way and the wrong way"
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mountainlion/fast/text/emoticons-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mountainlion/fast/text/emoticons-expected.png
index aa094aa..fbfe4e3 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-mountainlion/fast/text/emoticons-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-mountainlion/fast/text/emoticons-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mountainlion/fast/text/fallback-traits-fixup-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mountainlion/fast/text/fallback-traits-fixup-expected.png
index 9ac7080..0de1e61 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-mountainlion/fast/text/fallback-traits-fixup-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-mountainlion/fast/text/fallback-traits-fixup-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mountainlion/fast/text/font-weight-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mountainlion/fast/text/font-weight-expected.png
index 8bd3f0f7..98d2a86c 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-mountainlion/fast/text/font-weight-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-mountainlion/fast/text/font-weight-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mountainlion/fast/text/format-control-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mountainlion/fast/text/format-control-expected.png
new file mode 100644
index 0000000..7fa572b
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/mac-mountainlion/fast/text/format-control-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mountainlion/fast/text/format-control-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-mountainlion/fast/text/format-control-expected.txt
new file mode 100644
index 0000000..42449480
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/mac-mountainlion/fast/text/format-control-expected.txt
@@ -0,0 +1,28 @@
+layer at (0,0) size 800x600
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  LayoutBlockFlow {HTML} at (0,0) size 800x600
+    LayoutBlockFlow {BODY} at (8,8) size 784x552
+      LayoutBlockFlow (anonymous) at (0,0) size 784x18
+        LayoutText {#text} at (0,0) size 485x18
+          text run at (0,0) width 485: "This tests the ZWJ and ZWNJ format control characters on basic Latin text."
+      LayoutBlockFlow {DIV} at (0,58) size 784x218
+        LayoutBlockFlow {P} at (0,0) size 784x46
+          LayoutText {#text} at (0,0) size 279x46
+            text run at (0,0) width 279: "fi fl ff ffi ffl fl f   i"
+        LayoutBlockFlow {P} at (0,86) size 784x46
+          LayoutText {#text} at (0,0) size 290x46
+            text run at (0,0) width 290: "f\x{200C}i f\x{200C}l f\x{200C}f f\x{200C}f\x{200C}i f\x{200C}f\x{200C}l f\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}l f\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C} \x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C} \x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C} \x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}i"
+        LayoutBlockFlow {P} at (0,172) size 784x46
+          LayoutText {#text} at (0,0) size 282x46
+            text run at (0,0) width 282: "f\x{200D}i f\x{200D}l f\x{200D}f f\x{200D}f\x{200D}i f\x{200D}f\x{200D}l f\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}l f\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D} \x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D} \x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D} \x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}i"
+      LayoutBlockFlow {DIV} at (0,316) size 784x221
+        LayoutBlockFlow {P} at (0,0) size 784x47
+          LayoutText {#text} at (0,1) size 288x45
+            text run at (0,1) width 288: "fi fl ff ffi ffl fl f   i"
+        LayoutBlockFlow {P} at (0,87) size 784x47
+          LayoutText {#text} at (0,1) size 288x45
+            text run at (0,1) width 288: "f\x{200C}i f\x{200C}l f\x{200C}f f\x{200C}f\x{200C}i f\x{200C}f\x{200C}l f\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}l f\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C} \x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C} \x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C} \x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}i"
+        LayoutBlockFlow {P} at (0,174) size 784x47
+          LayoutText {#text} at (0,1) size 288x45
+            text run at (0,1) width 288: "f\x{200D}i f\x{200D}l f\x{200D}f f\x{200D}f\x{200D}i f\x{200D}f\x{200D}l f\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}l f\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D} \x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D} \x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D} \x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}i"
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mountainlion/fast/text/international/bidi-LDB-2-CSS-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mountainlion/fast/text/international/bidi-LDB-2-CSS-expected.png
index fc94f9a..4e44463 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-mountainlion/fast/text/international/bidi-LDB-2-CSS-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-mountainlion/fast/text/international/bidi-LDB-2-CSS-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mountainlion/fast/text/international/bidi-LDB-2-HTML-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mountainlion/fast/text/international/bidi-LDB-2-HTML-expected.png
index addf825d..659035e 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-mountainlion/fast/text/international/bidi-LDB-2-HTML-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-mountainlion/fast/text/international/bidi-LDB-2-HTML-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mountainlion/fast/text/international/bidi-LDB-2-formatting-characters-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mountainlion/fast/text/international/bidi-LDB-2-formatting-characters-expected.png
index 3ab3dfef..5f676de5 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-mountainlion/fast/text/international/bidi-LDB-2-formatting-characters-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-mountainlion/fast/text/international/bidi-LDB-2-formatting-characters-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mountainlion/fast/text/international/bidi-LDB-2-formatting-characters-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-mountainlion/fast/text/international/bidi-LDB-2-formatting-characters-expected.txt
new file mode 100644
index 0000000..512d69f
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/mac-mountainlion/fast/text/international/bidi-LDB-2-formatting-characters-expected.txt
@@ -0,0 +1,569 @@
+layer at (0,0) size 800x600
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x589
+  LayoutBlockFlow {HTML} at (0,0) size 800x588.88
+    LayoutBlockFlow {BODY} at (8,21.44) size 784x551.44
+      LayoutBlockFlow {H1} at (0,0) size 784x37
+        LayoutText {#text} at (0,0) size 677x37
+          text run at (0,0) width 677: "Bidirectional Text Test 2 - Formatting Characters"
+      LayoutBlockFlow {P} at (0,58.44) size 784x18
+        LayoutText {#text} at (0,0) size 134x18
+          text run at (0,0) width 134: "This test is based on "
+        LayoutInline {A} at (0,0) size 119x18 [color=#0000EE]
+          LayoutText {#text} at (133,0) size 119x18
+            text run at (133,0) width 119: "CSS2 section 9.10"
+        LayoutText {#text} at (251,0) size 32x18
+          text run at (251,0) width 32: " and "
+        LayoutInline {A} at (0,0) size 64x18 [color=#0000EE]
+          LayoutText {#text} at (282,0) size 64x18
+            text run at (282,0) width 64: "Chapter 3"
+        LayoutText {#text} at (345,0) size 46x18
+          text run at (345,0) width 46: " of the "
+        LayoutInline {A} at (0,0) size 116x18 [color=#0000EE]
+          LayoutText {#text} at (390,0) size 116x18
+            text run at (390,0) width 116: "Unicode Standard"
+        LayoutText {#text} at (505,0) size 5x18
+          text run at (505,0) width 5: "."
+      LayoutBlockFlow {P} at (0,92.44) size 784x18
+        LayoutText {#text} at (0,0) size 64x18
+          text run at (0,0) width 64: "Note that "
+        LayoutInline {A} at (0,0) size 303x18 [color=#0000EE]
+          LayoutText {#text} at (63,0) size 303x18
+            text run at (63,0) width 303: "Unicode in XML and other Markup Languages"
+        LayoutText {#text} at (365,0) size 371x18
+          text run at (365,0) width 371: " suggests that HTML UAs should ignore these characters."
+      LayoutBlockFlow {P} at (0,126.44) size 784x18
+        LayoutText {#text} at (0,0) size 287x18
+          text run at (0,0) width 287: "In each box, all the lines should be the same."
+      LayoutBlockFlow (anonymous) at (0,160.44) size 784x237
+        LayoutBlockFlow {DIV} at (3,7) size 99.58x170 [border: (1px solid #008000)]
+          LayoutBlockFlow {P} at (4,4) size 91.58x18
+            LayoutText {#text} at (0,0) size 92x18
+              text run at (0,0) width 92: "ABCDEFGHI"
+          LayoutBlockFlow {P} at (4,22) size 91.58x18
+            LayoutText {#text} at (0,0) size 92x18
+              text run at (0,0) width 0 RTL: "\x{202C}"
+              text run at (0,0) width 92: "\x{202B}ABCDEFGHI"
+          LayoutBlockFlow {P} at (4,40) size 91.58x18
+            LayoutText {#text} at (0,0) size 33x18
+              text run at (0,0) width 33: "\x{202B}ABC"
+            LayoutInline {SPAN} at (0,0) size 32x18
+              LayoutText {#text} at (32,0) size 32x18
+                text run at (32,0) width 32: "DEF"
+            LayoutText {#text} at (0,0) size 92x18
+              text run at (0,0) width 0 RTL: "\x{202C}"
+              text run at (63,0) width 29: "GHI"
+          LayoutBlockFlow {P} at (4,58) size 91.58x18
+            LayoutText {#text} at (0,0) size 92x18
+              text run at (0,0) width 0 RTL: "\x{202C}"
+              text run at (0,0) width 92 RTL override: "\x{202E}IHGFEDCBA"
+          LayoutBlockFlow {P} at (4,76) size 91.58x18
+            LayoutText {#text} at (63,0) size 29x18
+              text run at (63,0) width 29 RTL override: "\x{202E}IHG"
+            LayoutInline {SPAN} at (0,0) size 32x18
+              LayoutText {#text} at (32,0) size 32x18
+                text run at (32,0) width 32 RTL override: "FED"
+            LayoutText {#text} at (0,0) size 33x18
+              text run at (0,0) width 0 RTL: "\x{202C}"
+              text run at (0,0) width 33 RTL override: "CBA"
+          LayoutBlockFlow {P} at (4,94) size 91.58x18
+            LayoutText {#text} at (0,0) size 92x18
+              text run at (0,0) width 0 RTL: "\x{202C}"
+              text run at (0,0) width 33 RTL override: "\x{202C}CBA"
+              text run at (32,0) width 32: "\x{202B}DEF"
+              text run at (63,0) width 29 RTL override: "\x{202E}IHG"
+          LayoutBlockFlow {P} at (4,112) size 91.58x18
+            LayoutText {#text} at (0,0) size 92x18
+              text run at (0,0) width 0 RTL: "\x{202C}"
+              text run at (0,0) width 33 RTL override: "\x{202C}CBA"
+              text run at (32,0) width 32 RTL override: "\x{202E}FED"
+              text run at (63,0) width 29 RTL override: "\x{202E}IHG"
+          LayoutBlockFlow {P} at (4,130) size 91.58x18
+            LayoutText {#text} at (0,0) size 92x18
+              text run at (0,0) width 0 RTL: "\x{202C}"
+              text run at (0,0) width 33 RTL override: "\x{202C}CBA"
+              text run at (32,0) width 32 RTL override: "\x{202E}FED"
+              text run at (63,0) width 29 RTL override: "\x{202E}IHG"
+          LayoutBlockFlow {P} at (4,148) size 91.58x18
+            LayoutText {#text} at (0,0) size 92x18
+              text run at (0,0) width 0 RTL: "\x{202C}"
+              text run at (0,0) width 33 RTL override: "\x{202C}CBA"
+              text run at (32,0) width 32 LTR override: "\x{202D}DEF"
+              text run at (63,0) width 29 RTL override: "\x{202E}IHG"
+        LayoutText {#text} at (105,82) size 5x18
+          text run at (105,82) width 5: " "
+        LayoutBlockFlow {DIV} at (112.58,50) size 36x84 [border: (1px solid #008000)]
+          LayoutTable {TABLE} at (4,4) size 28x19
+            LayoutTableSection {TBODY} at (0,0) size 28x19
+              LayoutTableRow {TR} at (0,0) size 28x19
+                LayoutTableCell {TD} at (0,0) size 7x19 [r=0 c=0 rs=1 cs=1]
+                  LayoutText {#text} at (0,1) size 7x18
+                    text run at (0,1) width 7 RTL: "\x{5D2}"
+                LayoutTableCell {TD} at (7,0) size 10x19 [r=0 c=1 rs=1 cs=1]
+                  LayoutText {#text} at (0,1) size 9x18
+                    text run at (0,1) width 9 RTL: "\x{5D1}"
+                LayoutTableCell {TD} at (17,0) size 11x19 [r=0 c=2 rs=1 cs=1]
+                  LayoutText {#text} at (0,1) size 11x18
+                    text run at (0,1) width 11 RTL: "\x{5D0}"
+          LayoutBlockFlow {P} at (4,23) size 28x19
+            LayoutText {#text} at (0,1) size 27x18
+              text run at (0,1) width 27 RTL: "\x{5D0}\x{5D1}\x{5D2}"
+          LayoutBlockFlow {P} at (4,42) size 28x19
+            LayoutText {#text} at (0,1) size 27x18
+              text run at (0,1) width 27 RTL: "\x{202A}\x{5D0}\x{5D1}\x{5D2}"
+              text run at (26,1) width 1: "\x{202C}"
+          LayoutBlockFlow {P} at (4,61) size 28x19
+            LayoutText {#text} at (0,1) size 27x18
+              text run at (0,1) width 27 LTR override: "\x{202D}\x{5D2}\x{5D1}\x{5D0}"
+              text run at (26,1) width 1: "\x{202C}"
+        LayoutText {#text} at (151,82) size 5x18
+          text run at (151,82) width 5: " "
+        LayoutBlockFlow {DIV} at (158.58,60) size 105x65 [border: (1px solid #008000)]
+          LayoutTable {TABLE} at (4,4) size 97x19
+            LayoutTableSection {TBODY} at (0,0) size 97x19
+              LayoutTableRow {TR} at (0,0) size 97x19
+                LayoutTableCell {TD} at (0,0) size 7x19 [r=0 c=0 rs=1 cs=1]
+                  LayoutText {#text} at (0,1) size 7x18
+                    text run at (0,1) width 7 RTL: "\x{5D2}"
+                LayoutTableCell {TD} at (7,0) size 10x19 [r=0 c=1 rs=1 cs=1]
+                  LayoutText {#text} at (0,1) size 9x18
+                    text run at (0,1) width 9 RTL: "\x{5D1}"
+                LayoutTableCell {TD} at (17,0) size 11x19 [r=0 c=2 rs=1 cs=1]
+                  LayoutText {#text} at (0,1) size 11x18
+                    text run at (0,1) width 11 RTL: "\x{5D0}"
+                LayoutTableCell {TD} at (28,0) size 4x18 [r=0 c=3 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 4x18
+                    text run at (0,0) width 4: " "
+                LayoutTableCell {TD} at (32,0) size 12x18 [r=0 c=4 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 12x18
+                    text run at (0,0) width 12: "A"
+                LayoutTableCell {TD} at (44,0) size 11x18 [r=0 c=5 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 11x18
+                    text run at (0,0) width 11: "B"
+                LayoutTableCell {TD} at (55,0) size 11x18 [r=0 c=6 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 11x18
+                    text run at (0,0) width 11: "C"
+                LayoutTableCell {TD} at (66,0) size 4x18 [r=0 c=7 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 4x18
+                    text run at (0,0) width 4: " "
+                LayoutTableCell {TD} at (70,0) size 6x19 [r=0 c=8 rs=1 cs=1]
+                  LayoutText {#text} at (0,1) size 6x18
+                    text run at (0,1) width 6 RTL: "\x{5D5}"
+                LayoutTableCell {TD} at (76,0) size 12x19 [r=0 c=9 rs=1 cs=1]
+                  LayoutText {#text} at (0,1) size 12x18
+                    text run at (0,1) width 12 RTL: "\x{5D4}"
+                LayoutTableCell {TD} at (88,0) size 9x19 [r=0 c=10 rs=1 cs=1]
+                  LayoutText {#text} at (0,1) size 9x18
+                    text run at (0,1) width 9 RTL: "\x{5D3}"
+          LayoutBlockFlow {P} at (4,23) size 97x19
+            LayoutText {#text} at (0,1) size 92x18
+              text run at (0,1) width 27 RTL: "\x{5D0}\x{5D1}\x{5D2}"
+              text run at (26,1) width 42: " ABC "
+              text run at (67,1) width 25 RTL: "\x{5D3}\x{5D4}\x{5D5}"
+          LayoutBlockFlow {P} at (4,42) size 97x19
+            LayoutText {#text} at (0,1) size 92x18
+              text run at (0,1) width 31 RTL: " \x{5D0}\x{5D1}\x{5D2}"
+              text run at (30,1) width 34: "ABC"
+              text run at (63,1) width 29 RTL: "\x{5D3}\x{5D4}\x{5D5} "
+        LayoutText {#text} at (266,82) size 5x18
+          text run at (266,82) width 5: " "
+        LayoutBlockFlow {DIV} at (273.58,3) size 173x179 [border: (1px solid #008000)]
+          LayoutTable {TABLE} at (4,4) size 165x19
+            LayoutTableSection {TBODY} at (0,0) size 165x19
+              LayoutTableRow {TR} at (0,0) size 165x19
+                LayoutTableCell {TD} at (0,0) size 7x19 [r=0 c=0 rs=1 cs=1]
+                  LayoutText {#text} at (0,1) size 7x18
+                    text run at (0,1) width 7 RTL: "\x{5D2}"
+                LayoutTableCell {TD} at (7,0) size 10x19 [r=0 c=1 rs=1 cs=1]
+                  LayoutText {#text} at (0,1) size 9x18
+                    text run at (0,1) width 9 RTL: "\x{5D1}"
+                LayoutTableCell {TD} at (17,0) size 11x19 [r=0 c=2 rs=1 cs=1]
+                  LayoutText {#text} at (0,1) size 11x18
+                    text run at (0,1) width 11 RTL: "\x{5D0}"
+                LayoutTableCell {TD} at (28,0) size 4x18 [r=0 c=3 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 4x18
+                    text run at (0,0) width 4: " "
+                LayoutTableCell {TD} at (32,0) size 12x18 [r=0 c=4 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 12x18
+                    text run at (0,0) width 12: "A"
+                LayoutTableCell {TD} at (44,0) size 11x18 [r=0 c=5 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 11x18
+                    text run at (0,0) width 11: "B"
+                LayoutTableCell {TD} at (55,0) size 11x18 [r=0 c=6 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 11x18
+                    text run at (0,0) width 11: "C"
+                LayoutTableCell {TD} at (66,0) size 4x18 [r=0 c=7 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 4x18
+                    text run at (0,0) width 4: " "
+                LayoutTableCell {TD} at (70,0) size 6x19 [r=0 c=8 rs=1 cs=1]
+                  LayoutText {#text} at (0,1) size 6x18
+                    text run at (0,1) width 6 RTL: "\x{5D5}"
+                LayoutTableCell {TD} at (76,0) size 12x19 [r=0 c=9 rs=1 cs=1]
+                  LayoutText {#text} at (0,1) size 12x18
+                    text run at (0,1) width 12 RTL: "\x{5D4}"
+                LayoutTableCell {TD} at (88,0) size 9x19 [r=0 c=10 rs=1 cs=1]
+                  LayoutText {#text} at (0,1) size 9x18
+                    text run at (0,1) width 9 RTL: "\x{5D3}"
+                LayoutTableCell {TD} at (97,0) size 4x18 [r=0 c=11 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 4x18
+                    text run at (0,0) width 4: " "
+                LayoutTableCell {TD} at (101,0) size 12x18 [r=0 c=12 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 12x18
+                    text run at (0,0) width 12: "D"
+                LayoutTableCell {TD} at (113,0) size 10x18 [r=0 c=13 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 10x18
+                    text run at (0,0) width 10: "E"
+                LayoutTableCell {TD} at (123,0) size 9x18 [r=0 c=14 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 9x18
+                    text run at (0,0) width 9: "F"
+                LayoutTableCell {TD} at (132,0) size 4x18 [r=0 c=15 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 4x18
+                    text run at (0,0) width 4: " "
+                LayoutTableCell {TD} at (136,0) size 11x19 [r=0 c=16 rs=1 cs=1]
+                  LayoutText {#text} at (0,1) size 11x18
+                    text run at (0,1) width 11 RTL: "\x{5D8}"
+                LayoutTableCell {TD} at (147,0) size 12x19 [r=0 c=17 rs=1 cs=1]
+                  LayoutText {#text} at (0,1) size 12x18
+                    text run at (0,1) width 12 RTL: "\x{5D7}"
+                LayoutTableCell {TD} at (159,0) size 6x19 [r=0 c=18 rs=1 cs=1]
+                  LayoutText {#text} at (0,1) size 6x18
+                    text run at (0,1) width 6 RTL: "\x{5D6}"
+          LayoutBlockFlow {P} at (4,23) size 165x19
+            LayoutText {#text} at (0,1) size 157x18
+              text run at (0,1) width 27 RTL: "\x{5D0}\x{5D1}\x{5D2}"
+              text run at (26,1) width 42: " ABC "
+              text run at (67,1) width 25 RTL: "\x{5D3}\x{5D4}\x{5D5}"
+              text run at (91,1) width 39: " DEF "
+              text run at (129,1) width 28 RTL: "\x{5D6}\x{5D7}\x{5D8}"
+          LayoutBlockFlow {P} at (4,42) size 165x19
+            LayoutText {#text} at (0,1) size 31x18
+              text run at (0,1) width 27 RTL: "\x{5D0}\x{5D1}\x{5D2}"
+              text run at (26,1) width 5: " "
+            LayoutInline {SPAN} at (0,0) size 62x18
+              LayoutText {#text} at (30,1) size 62x18
+                text run at (30,1) width 38: "ABC "
+                text run at (67,1) width 25 RTL: "\x{5D3}\x{5D4}\x{5D5}"
+            LayoutText {#text} at (91,1) size 66x18
+              text run at (91,1) width 39: " DEF "
+              text run at (129,1) width 28 RTL: "\x{5D6}\x{5D7}\x{5D8}"
+          LayoutBlockFlow {P} at (4,61) size 165x19
+            LayoutText {#text} at (0,1) size 157x18
+              text run at (0,1) width 27 RTL: "\x{5D0}\x{5D1}\x{5D2}"
+              text run at (26,1) width 5: " "
+              text run at (30,1) width 38: "\x{202A}ABC "
+              text run at (67,1) width 25 RTL: "\x{5D3}\x{5D4}\x{5D5}"
+              text run at (91,1) width 35: " DEF"
+              text run at (125,1) width 5: "\x{202C} "
+              text run at (129,1) width 28 RTL: "\x{5D6}\x{5D7}\x{5D8}"
+          LayoutBlockFlow {P} at (4,80) size 165x19
+            LayoutText {#text} at (0,1) size 157x18
+              text run at (0,1) width 31 RTL: "\x{202C} \x{5D0}\x{5D1}\x{5D2}"
+              text run at (30,1) width 34: "ABC"
+              text run at (63,1) width 33 RTL: " \x{5D3}\x{5D4}\x{5D5} "
+              text run at (95,1) width 31: "\x{202B}DEF"
+              text run at (125,1) width 32 RTL: "\x{5D6}\x{5D7}\x{5D8} "
+          LayoutBlockFlow {P} at (4,99) size 165x19
+            LayoutText {#text} at (0,1) size 157x18
+              text run at (0,1) width 31 RTL: " \x{5D0}\x{5D1}\x{5D2}"
+              text run at (30,1) width 34: "\x{202B}ABC"
+              text run at (63,1) width 29 RTL: "\x{5D3}\x{5D4}\x{5D5} "
+              text run at (91,1) width 39: "\x{202C} DEF "
+              text run at (129,1) width 28 RTL: "\x{5D6}\x{5D7}\x{5D8}"
+          LayoutBlockFlow {P} at (4,118) size 165x19
+            LayoutText {#text} at (0,1) size 157x18
+              text run at (0,1) width 64 RTL override: "\x{202E}CBA \x{5D0}\x{5D1}\x{5D2}"
+              text run at (63,1) width 29 RTL: "\x{5D3}\x{5D4}\x{5D5} "
+              text run at (91,1) width 39: "\x{202C} DEF "
+              text run at (129,1) width 28 RTL: "\x{5D6}\x{5D7}\x{5D8}"
+          LayoutBlockFlow {P} at (4,137) size 165x19
+            LayoutText {#text} at (0,1) size 157x18
+              text run at (0,1) width 27 RTL: "\x{5D0}\x{5D1}\x{5D2}"
+              text run at (26,1) width 5: " "
+              text run at (30,1) width 62 LTR override: "\x{202D}ABC \x{5D5}\x{5D4}\x{5D3}"
+              text run at (91,1) width 39: "\x{202C} DEF "
+              text run at (129,1) width 28 RTL: "\x{5D6}\x{5D7}\x{5D8}"
+          LayoutBlockFlow {P} at (4,156) size 165x19
+            LayoutText {#text} at (0,1) size 157x18
+              text run at (0,1) width 31 RTL: " \x{5D0}\x{5D1}\x{5D2}"
+              text run at (30,1) width 62 LTR override: "\x{202D}ABC \x{5D5}\x{5D4}\x{5D3}"
+              text run at (91,1) width 35: "\x{202C} DEF"
+              text run at (125,1) width 32 RTL: "\x{5D6}\x{5D7}\x{5D8} "
+        LayoutText {#text} at (449,82) size 5x18
+          text run at (449,82) width 5: " "
+        LayoutBlockFlow {DIV} at (456.58,69) size 207x46 [border: (1px solid #008000)]
+          LayoutTable {TABLE} at (4,4) size 199x19
+            LayoutTableSection {TBODY} at (0,0) size 199x19
+              LayoutTableRow {TR} at (0,0) size 199x19
+                LayoutTableCell {TD} at (0,0) size 7x19 [r=0 c=0 rs=1 cs=1]
+                  LayoutText {#text} at (0,1) size 7x18
+                    text run at (0,1) width 7 RTL: "\x{5D2}"
+                LayoutTableCell {TD} at (7,0) size 10x19 [r=0 c=1 rs=1 cs=1]
+                  LayoutText {#text} at (0,1) size 9x18
+                    text run at (0,1) width 9 RTL: "\x{5D1}"
+                LayoutTableCell {TD} at (17,0) size 11x19 [r=0 c=2 rs=1 cs=1]
+                  LayoutText {#text} at (0,1) size 11x18
+                    text run at (0,1) width 11 RTL: "\x{5D0}"
+                LayoutTableCell {TD} at (28,0) size 4x18 [r=0 c=3 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 4x18
+                    text run at (0,0) width 4: " "
+                LayoutTableCell {TD} at (32,0) size 12x18 [r=0 c=4 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 12x18
+                    text run at (0,0) width 12: "A"
+                LayoutTableCell {TD} at (44,0) size 11x18 [r=0 c=5 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 11x18
+                    text run at (0,0) width 11: "B"
+                LayoutTableCell {TD} at (55,0) size 11x18 [r=0 c=6 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 11x18
+                    text run at (0,0) width 11: "C"
+                LayoutTableCell {TD} at (66,0) size 4x18 [r=0 c=7 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 4x18
+                    text run at (0,0) width 4: " "
+                LayoutTableCell {TD} at (70,0) size 6x19 [r=0 c=8 rs=1 cs=1]
+                  LayoutText {#text} at (0,1) size 6x18
+                    text run at (0,1) width 6 RTL: "\x{5D5}"
+                LayoutTableCell {TD} at (76,0) size 12x19 [r=0 c=9 rs=1 cs=1]
+                  LayoutText {#text} at (0,1) size 12x18
+                    text run at (0,1) width 12 RTL: "\x{5D4}"
+                LayoutTableCell {TD} at (88,0) size 9x19 [r=0 c=10 rs=1 cs=1]
+                  LayoutText {#text} at (0,1) size 9x18
+                    text run at (0,1) width 9 RTL: "\x{5D3}"
+                LayoutTableCell {TD} at (97,0) size 4x18 [r=0 c=11 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 4x18
+                    text run at (0,0) width 4: " "
+                LayoutTableCell {TD} at (101,0) size 12x18 [r=0 c=12 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 12x18
+                    text run at (0,0) width 12: "D"
+                LayoutTableCell {TD} at (113,0) size 10x18 [r=0 c=13 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 10x18
+                    text run at (0,0) width 10: "E"
+                LayoutTableCell {TD} at (123,0) size 9x18 [r=0 c=14 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 9x18
+                    text run at (0,0) width 9: "F"
+                LayoutTableCell {TD} at (132,0) size 4x18 [r=0 c=15 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 4x18
+                    text run at (0,0) width 4: " "
+                LayoutTableCell {TD} at (136,0) size 12x18 [r=0 c=16 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 12x18
+                    text run at (0,0) width 12: "G"
+                LayoutTableCell {TD} at (148,0) size 12x18 [r=0 c=17 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 12x18
+                    text run at (0,0) width 12: "H"
+                LayoutTableCell {TD} at (160,0) size 6x18 [r=0 c=18 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 6x18
+                    text run at (0,0) width 6: "I"
+                LayoutTableCell {TD} at (166,0) size 4x18 [r=0 c=19 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 4x18
+                    text run at (0,0) width 4: " "
+                LayoutTableCell {TD} at (170,0) size 11x19 [r=0 c=20 rs=1 cs=1]
+                  LayoutText {#text} at (0,1) size 11x18
+                    text run at (0,1) width 11 RTL: "\x{5D8}"
+                LayoutTableCell {TD} at (181,0) size 12x19 [r=0 c=21 rs=1 cs=1]
+                  LayoutText {#text} at (0,1) size 12x18
+                    text run at (0,1) width 12 RTL: "\x{5D7}"
+                LayoutTableCell {TD} at (193,0) size 6x19 [r=0 c=22 rs=1 cs=1]
+                  LayoutText {#text} at (0,1) size 6x18
+                    text run at (0,1) width 6 RTL: "\x{5D6}"
+          LayoutBlockFlow {P} at (4,23) size 199x19
+            LayoutText {#text} at (0,1) size 190x18
+              text run at (0,1) width 27 RTL: "\x{5D0}\x{5D1}\x{5D2}"
+              text run at (26,1) width 42: " ABC "
+              text run at (67,1) width 25 RTL: "\x{5D3}\x{5D4}\x{5D5}"
+              text run at (91,1) width 72: " DEF GHI "
+              text run at (162,1) width 28 RTL: "\x{5D6}\x{5D7}\x{5D8}"
+        LayoutText {#text} at (666,82) size 5x18
+          text run at (666,82) width 5: " "
+        LayoutBR {BR} at (670,82) size 1x18
+        LayoutBlockFlow {DIV} at (3,188) size 207x46 [border: (1px solid #008000)]
+          LayoutTable {TABLE} at (4,4) size 199x19
+            LayoutTableSection {TBODY} at (0,0) size 199x19
+              LayoutTableRow {TR} at (0,0) size 199x19
+                LayoutTableCell {TD} at (0,0) size 9x18 [r=0 c=0 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 9x18
+                    text run at (0,0) width 9: "F"
+                LayoutTableCell {TD} at (9,0) size 10x18 [r=0 c=1 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 10x18
+                    text run at (0,0) width 10: "E"
+                LayoutTableCell {TD} at (19,0) size 12x18 [r=0 c=2 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 12x18
+                    text run at (0,0) width 12: "D"
+                LayoutTableCell {TD} at (31,0) size 4x18 [r=0 c=3 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 4x18
+                    text run at (0,0) width 4: " "
+                LayoutTableCell {TD} at (35,0) size 6x19 [r=0 c=4 rs=1 cs=1]
+                  LayoutText {#text} at (0,1) size 6x18
+                    text run at (0,1) width 6 RTL: "\x{5D5}"
+                LayoutTableCell {TD} at (41,0) size 12x19 [r=0 c=5 rs=1 cs=1]
+                  LayoutText {#text} at (0,1) size 12x18
+                    text run at (0,1) width 12 RTL: "\x{5D4}"
+                LayoutTableCell {TD} at (53,0) size 9x19 [r=0 c=6 rs=1 cs=1]
+                  LayoutText {#text} at (0,1) size 9x18
+                    text run at (0,1) width 9 RTL: "\x{5D3}"
+                LayoutTableCell {TD} at (62,0) size 4x18 [r=0 c=7 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 4x18
+                    text run at (0,0) width 4: " "
+                LayoutTableCell {TD} at (66,0) size 11x18 [r=0 c=8 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 11x18
+                    text run at (0,0) width 11: "C"
+                LayoutTableCell {TD} at (77,0) size 11x18 [r=0 c=9 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 11x18
+                    text run at (0,0) width 11: "B"
+                LayoutTableCell {TD} at (88,0) size 12x18 [r=0 c=10 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 12x18
+                    text run at (0,0) width 12: "A"
+                LayoutTableCell {TD} at (100,0) size 4x18 [r=0 c=11 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 4x18
+                    text run at (0,0) width 4: " "
+                LayoutTableCell {TD} at (104,0) size 7x19 [r=0 c=12 rs=1 cs=1]
+                  LayoutText {#text} at (0,1) size 7x18
+                    text run at (0,1) width 7 RTL: "\x{5D2}"
+                LayoutTableCell {TD} at (111,0) size 10x19 [r=0 c=13 rs=1 cs=1]
+                  LayoutText {#text} at (0,1) size 9x18
+                    text run at (0,1) width 9 RTL: "\x{5D1}"
+                LayoutTableCell {TD} at (121,0) size 11x19 [r=0 c=14 rs=1 cs=1]
+                  LayoutText {#text} at (0,1) size 11x18
+                    text run at (0,1) width 11 RTL: "\x{5D0}"
+                LayoutTableCell {TD} at (132,0) size 4x18 [r=0 c=15 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 4x18
+                    text run at (0,0) width 4: " "
+                LayoutTableCell {TD} at (136,0) size 12x18 [r=0 c=16 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 12x18
+                    text run at (0,0) width 12: "G"
+                LayoutTableCell {TD} at (148,0) size 12x18 [r=0 c=17 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 12x18
+                    text run at (0,0) width 12: "H"
+                LayoutTableCell {TD} at (160,0) size 6x18 [r=0 c=18 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 6x18
+                    text run at (0,0) width 6: "I"
+                LayoutTableCell {TD} at (166,0) size 4x18 [r=0 c=19 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 4x18
+                    text run at (0,0) width 4: " "
+                LayoutTableCell {TD} at (170,0) size 11x19 [r=0 c=20 rs=1 cs=1]
+                  LayoutText {#text} at (0,1) size 11x18
+                    text run at (0,1) width 11 RTL: "\x{5D8}"
+                LayoutTableCell {TD} at (181,0) size 12x19 [r=0 c=21 rs=1 cs=1]
+                  LayoutText {#text} at (0,1) size 12x18
+                    text run at (0,1) width 12 RTL: "\x{5D7}"
+                LayoutTableCell {TD} at (193,0) size 6x19 [r=0 c=22 rs=1 cs=1]
+                  LayoutText {#text} at (0,1) size 6x18
+                    text run at (0,1) width 6 RTL: "\x{5D6}"
+          LayoutBlockFlow {P} at (4,23) size 199x19
+            LayoutText {#text} at (0,1) size 190x18
+              text run at (0,1) width 96 RTL override: "\x{202E}ABC \x{5D3}\x{5D4}\x{5D5} DEF"
+              text run at (95,1) width 31 RTL: "\x{5D0}\x{5D1}\x{5D2} "
+              text run at (125,1) width 38: "\x{202C} GHI "
+              text run at (162,1) width 28 RTL: "\x{5D6}\x{5D7}\x{5D8}"
+        LayoutText {#text} at (213,201) size 4x18
+          text run at (213,201) width 4: " "
+        LayoutBlockFlow {DIV} at (220,188) size 207x46 [border: (1px solid #008000)]
+          LayoutTable {TABLE} at (4,4) size 199x19
+            LayoutTableSection {TBODY} at (0,0) size 199x19
+              LayoutTableRow {TR} at (0,0) size 199x19
+                LayoutTableCell {TD} at (0,0) size 7x19 [r=0 c=0 rs=1 cs=1]
+                  LayoutText {#text} at (0,1) size 7x18
+                    text run at (0,1) width 7 RTL: "\x{5D2}"
+                LayoutTableCell {TD} at (7,0) size 10x19 [r=0 c=1 rs=1 cs=1]
+                  LayoutText {#text} at (0,1) size 9x18
+                    text run at (0,1) width 9 RTL: "\x{5D1}"
+                LayoutTableCell {TD} at (17,0) size 11x19 [r=0 c=2 rs=1 cs=1]
+                  LayoutText {#text} at (0,1) size 11x18
+                    text run at (0,1) width 11 RTL: "\x{5D0}"
+                LayoutTableCell {TD} at (28,0) size 4x18 [r=0 c=3 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 4x18
+                    text run at (0,0) width 4: " "
+                LayoutTableCell {TD} at (32,0) size 12x18 [r=0 c=4 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 12x18
+                    text run at (0,0) width 12: "A"
+                LayoutTableCell {TD} at (44,0) size 11x18 [r=0 c=5 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 11x18
+                    text run at (0,0) width 11: "B"
+                LayoutTableCell {TD} at (55,0) size 11x18 [r=0 c=6 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 11x18
+                    text run at (0,0) width 11: "C"
+                LayoutTableCell {TD} at (66,0) size 4x18 [r=0 c=7 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 4x18
+                    text run at (0,0) width 4: " "
+                LayoutTableCell {TD} at (70,0) size 9x18 [r=0 c=8 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 9x18
+                    text run at (0,0) width 9: "F"
+                LayoutTableCell {TD} at (79,0) size 10x18 [r=0 c=9 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 10x18
+                    text run at (0,0) width 10: "E"
+                LayoutTableCell {TD} at (89,0) size 12x18 [r=0 c=10 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 12x18
+                    text run at (0,0) width 12: "D"
+                LayoutTableCell {TD} at (101,0) size 4x18 [r=0 c=11 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 4x18
+                    text run at (0,0) width 4: " "
+                LayoutTableCell {TD} at (105,0) size 6x19 [r=0 c=12 rs=1 cs=1]
+                  LayoutText {#text} at (0,1) size 6x18
+                    text run at (0,1) width 6 RTL: "\x{5D5}"
+                LayoutTableCell {TD} at (111,0) size 12x19 [r=0 c=13 rs=1 cs=1]
+                  LayoutText {#text} at (0,1) size 12x18
+                    text run at (0,1) width 12 RTL: "\x{5D4}"
+                LayoutTableCell {TD} at (123,0) size 9x19 [r=0 c=14 rs=1 cs=1]
+                  LayoutText {#text} at (0,1) size 9x18
+                    text run at (0,1) width 9 RTL: "\x{5D3}"
+                LayoutTableCell {TD} at (132,0) size 4x18 [r=0 c=15 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 4x18
+                    text run at (0,0) width 4: " "
+                LayoutTableCell {TD} at (136,0) size 12x18 [r=0 c=16 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 12x18
+                    text run at (0,0) width 12: "G"
+                LayoutTableCell {TD} at (148,0) size 12x18 [r=0 c=17 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 12x18
+                    text run at (0,0) width 12: "H"
+                LayoutTableCell {TD} at (160,0) size 6x18 [r=0 c=18 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 6x18
+                    text run at (0,0) width 6: "I"
+                LayoutTableCell {TD} at (166,0) size 4x18 [r=0 c=19 rs=1 cs=1]
+                  LayoutText {#text} at (0,0) size 4x18
+                    text run at (0,0) width 4: " "
+                LayoutTableCell {TD} at (170,0) size 11x19 [r=0 c=20 rs=1 cs=1]
+                  LayoutText {#text} at (0,1) size 11x18
+                    text run at (0,1) width 11 RTL: "\x{5D8}"
+                LayoutTableCell {TD} at (181,0) size 12x19 [r=0 c=21 rs=1 cs=1]
+                  LayoutText {#text} at (0,1) size 12x18
+                    text run at (0,1) width 12 RTL: "\x{5D7}"
+                LayoutTableCell {TD} at (193,0) size 6x19 [r=0 c=22 rs=1 cs=1]
+                  LayoutText {#text} at (0,1) size 6x18
+                    text run at (0,1) width 6 RTL: "\x{5D6}"
+          LayoutBlockFlow {P} at (4,23) size 199x19
+            LayoutText {#text} at (0,1) size 190x18
+              text run at (0,1) width 27 RTL: "\x{5D0}\x{5D1}\x{5D2}"
+              text run at (26,1) width 42: " ABC "
+              text run at (67,1) width 59 RTL override: "\x{202E}\x{5D3}\x{5D4}\x{5D5} DEF"
+              text run at (125,1) width 38: "\x{202C} GHI "
+              text run at (162,1) width 28 RTL: "\x{5D6}\x{5D7}\x{5D8}"
+        LayoutText {#text} at (0,0) size 0x0
+      LayoutBlockFlow {P} at (0,413.44) size 784x18
+        LayoutText {#text} at (0,0) size 376x18
+          text run at (0,0) width 40: "Note: "
+          text run at (39,0) width 337: "This test does not test RLM or LRM, but it ought to."
+      LayoutBlockFlow {HR} at (0,447.44) size 784x2 [border: (1px inset #EEEEEE)]
+      LayoutBlockFlow {P} at (0,465.44) size 784x18
+        LayoutText {#text} at (0,0) size 59x18
+          text run at (0,0) width 59: "(Back to "
+        LayoutInline {A} at (0,0) size 161x18 [color=#0000EE]
+          LayoutText {#text} at (58,0) size 161x18
+            text run at (58,0) width 161: "CSS Testing Information"
+        LayoutText {#text} at (218,0) size 9x18
+          text run at (218,0) width 9: ", "
+        LayoutInline {A} at (0,0) size 83x18 [color=#0000EE]
+          LayoutText {#text} at (226,0) size 83x18
+            text run at (226,0) width 83: "David Baron"
+        LayoutText {#text} at (308,0) size 6x18
+          text run at (308,0) width 6: ")"
+      LayoutBlockFlow {P} at (0,499.44) size 784x18
+        LayoutInline {A} at (0,0) size 32x18 [color=#0000EE]
+          LayoutText {#text} at (0,0) size 32x18
+            text run at (0,0) width 32: "LDB"
+        LayoutText {#text} at (32,0) size 8x18
+          text run at (32,0) width 8: ", "
+        LayoutInline {A} at (0,0) size 129x18 [color=#0000EE]
+          LayoutText {#text} at (40,0) size 129x18
+            text run at (40,0) width 129: "dbaron@dbaron.org"
+        LayoutText {#text} at (168,0) size 84x18
+          text run at (168,0) width 84: ", 2001-06-05"
+      LayoutBlockFlow {P} at (0,533.44) size 784x18
+        LayoutText {#text} at (0,0) size 310x18
+          text run at (0,0) width 310: "Modified and used with the author\x{2019}s permission."
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mountainlion/fast/text/international/bidi-explicit-embedding-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mountainlion/fast/text/international/bidi-explicit-embedding-expected.png
new file mode 100644
index 0000000..12e81100
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/mac-mountainlion/fast/text/international/bidi-explicit-embedding-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/fast/text/international/bidi-explicit-embedding-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-mountainlion/fast/text/international/bidi-explicit-embedding-expected.txt
similarity index 100%
rename from third_party/WebKit/LayoutTests/fast/text/international/bidi-explicit-embedding-expected.txt
rename to third_party/WebKit/LayoutTests/platform/mac-mountainlion/fast/text/international/bidi-explicit-embedding-expected.txt
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mountainlion/fast/text/international/bidi-ignored-for-first-child-inline-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mountainlion/fast/text/international/bidi-ignored-for-first-child-inline-expected.png
index 1fa2172..0e26f06 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-mountainlion/fast/text/international/bidi-ignored-for-first-child-inline-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-mountainlion/fast/text/international/bidi-ignored-for-first-child-inline-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mountainlion/fast/text/international/bidi-innertext-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mountainlion/fast/text/international/bidi-innertext-expected.png
index 510fe25b..0505824 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-mountainlion/fast/text/international/bidi-innertext-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-mountainlion/fast/text/international/bidi-innertext-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mountainlion/fast/text/international/bidi-neutral-directionality-paragraph-start-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mountainlion/fast/text/international/bidi-neutral-directionality-paragraph-start-expected.png
index 53a75873..723ba46 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-mountainlion/fast/text/international/bidi-neutral-directionality-paragraph-start-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-mountainlion/fast/text/international/bidi-neutral-directionality-paragraph-start-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mountainlion/fast/text/international/bidi-neutral-run-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mountainlion/fast/text/international/bidi-neutral-run-expected.png
new file mode 100644
index 0000000..8104660
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/mac-mountainlion/fast/text/international/bidi-neutral-run-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mountainlion/fast/text/international/bidi-neutral-run-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-mountainlion/fast/text/international/bidi-neutral-run-expected.txt
new file mode 100644
index 0000000..8eae006
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/mac-mountainlion/fast/text/international/bidi-neutral-run-expected.txt
@@ -0,0 +1,992 @@
+layer at (0,0) size 800x600 clip at (0,0) size 785x600 scrollHeight 6378
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 785x6378 backgroundClip at (0,0) size 785x600 clip at (0,0) size 785x600
+  LayoutBlockFlow {HTML} at (0,0) size 785x6378
+    LayoutBlockFlow {BODY} at (8,8) size 769x6354
+      LayoutBlockFlow {P} at (0,0) size 769x18
+        LayoutText {#text} at (0,0) size 306x18
+          text run at (0,0) width 306: "Tests the resolved level of runs of neutral types."
+      LayoutBlockFlow {DIV} at (0,34) size 769x3152
+        LayoutBlockFlow {P} at (0,0) size 769x18
+          LayoutText {#text} at (0,0) size 44x18
+            text run at (0,0) width 44: "ab(^cd"
+        LayoutBlockFlow {P} at (0,34) size 769x19
+          LayoutText {#text} at (0,1) size 48x18
+            text run at (0,1) width 20 RTL: "\x{5D0}\x{5D1}"
+            text run at (19,1) width 29: "(^cd"
+        LayoutBlockFlow {P} at (0,69) size 769x21
+          LayoutText {#text} at (0,1) size 43x18
+            text run at (0,1) width 15 RTL: "\x{627}\x{628}"
+            text run at (14,1) width 29: "(^cd"
+        LayoutBlockFlow {P} at (0,106) size 769x18
+          LayoutText {#text} at (0,0) size 60x18
+            text run at (0,0) width 60: "ab12(^cd"
+        LayoutBlockFlow {P} at (0,140) size 769x19
+          LayoutText {#text} at (0,1) size 64x18
+            text run at (0,1) width 16: "12"
+            text run at (16,1) width 20 RTL: "\x{5D0}\x{5D1}"
+            text run at (35,1) width 29: "(^cd"
+        LayoutBlockFlow {P} at (0,175) size 769x21
+          LayoutText {#text} at (0,1) size 59x18
+            text run at (0,1) width 16: "12"
+            text run at (16,1) width 15 RTL: "\x{627}\x{628}"
+            text run at (30,1) width 29: "(^cd"
+        LayoutBlockFlow {P} at (0,212) size 769x21
+          LayoutText {#text} at (0,1) size 60x18
+            text run at (0,1) width 16: "ab"
+            text run at (15,1) width 17: "\x{661}\x{662}"
+            text run at (31,1) width 29: "(^cd"
+        LayoutBlockFlow {P} at (0,249) size 769x21
+          LayoutText {#text} at (0,1) size 65x18
+            text run at (0,1) width 17: "\x{661}\x{662}"
+            text run at (16,1) width 21 RTL: "\x{5D0}\x{5D1}"
+            text run at (36,1) width 29: "(^cd"
+        LayoutBlockFlow {P} at (0,286) size 769x21
+          LayoutText {#text} at (0,1) size 60x18
+            text run at (0,1) width 17: "\x{661}\x{662}"
+            text run at (16,1) width 16 RTL: "\x{627}\x{628}"
+            text run at (31,1) width 29: "(^cd"
+        LayoutBlockFlow {P} at (0,323) size 769x18
+          LayoutText {#text} at (0,0) size 36x18
+            text run at (0,0) width 8: "\x{202A}?"
+            text run at (7,0) width 29: "\x{202C}(^cd"
+        LayoutBlockFlow {P} at (0,357) size 769x18
+          LayoutText {#text} at (0,0) size 36x18
+            text run at (0,0) width 8 RTL: "\x{202B}?"
+            text run at (7,0) width 29: "\x{202C}(^cd"
+        LayoutBlockFlow {P} at (0,391) size 769x19
+          LayoutText {#text} at (0,1) size 43x18
+            text run at (0,1) width 28: "ab(^"
+            text run at (27,1) width 16 RTL: "\x{5D2}\x{5D3}"
+        LayoutBlockFlow {P} at (0,426) size 769x19
+          LayoutText {#text} at (0,1) size 48x18
+            text run at (0,1) width 48 RTL: "\x{5D0}\x{5D1}(^\x{5D2}\x{5D3}"
+        LayoutBlockFlow {P} at (0,461) size 769x21
+          LayoutText {#text} at (0,1) size 43x18
+            text run at (0,1) width 43 RTL: "\x{627}\x{628}(^\x{5D2}\x{5D3}"
+        LayoutBlockFlow {P} at (0,498) size 769x19
+          LayoutText {#text} at (0,1) size 59x18
+            text run at (0,1) width 44: "ab12(^"
+            text run at (43,1) width 16 RTL: "\x{5D2}\x{5D3}"
+        LayoutBlockFlow {P} at (0,533) size 769x19
+          LayoutText {#text} at (0,1) size 64x18
+            text run at (0,1) width 28 RTL: "(^\x{5D2}\x{5D3}"
+            text run at (27,1) width 17: "12"
+            text run at (43,1) width 21 RTL: "\x{5D0}\x{5D1}"
+        LayoutBlockFlow {P} at (0,568) size 769x21
+          LayoutText {#text} at (0,1) size 59x18
+            text run at (0,1) width 28 RTL: "(^\x{5D2}\x{5D3}"
+            text run at (27,1) width 17: "12"
+            text run at (43,1) width 16 RTL: "\x{627}\x{628}"
+        LayoutBlockFlow {P} at (0,605) size 769x21
+          LayoutText {#text} at (0,1) size 60x18
+            text run at (0,1) width 16: "ab"
+            text run at (15,1) width 28 RTL: "(^\x{5D2}\x{5D3}"
+            text run at (42,1) width 18: "\x{661}\x{662}"
+        LayoutBlockFlow {P} at (0,642) size 769x21
+          LayoutText {#text} at (0,1) size 64x18
+            text run at (0,1) width 28 RTL: "(^\x{5D2}\x{5D3}"
+            text run at (27,1) width 18: "\x{661}\x{662}"
+            text run at (44,1) width 20 RTL: "\x{5D0}\x{5D1}"
+        LayoutBlockFlow {P} at (0,679) size 769x21
+          LayoutText {#text} at (0,1) size 60x18
+            text run at (0,1) width 28 RTL: "(^\x{5D2}\x{5D3}"
+            text run at (27,1) width 18: "\x{661}\x{662}"
+            text run at (44,1) width 16 RTL: "\x{627}\x{628}"
+        LayoutBlockFlow {P} at (0,716) size 769x19
+          LayoutText {#text} at (0,1) size 35x18
+            text run at (0,1) width 8: "\x{202A}?"
+            text run at (7,1) width 13: "\x{202C}(^"
+            text run at (19,1) width 16 RTL: "\x{5D2}\x{5D3}"
+        LayoutBlockFlow {P} at (0,751) size 769x19
+          LayoutText {#text} at (0,1) size 35x18
+            text run at (0,1) width 28 RTL: "\x{202C}(^\x{5D2}\x{5D3}"
+            text run at (27,1) width 8 RTL: "\x{202B}?"
+        LayoutBlockFlow {P} at (0,786) size 769x21
+          LayoutText {#text} at (0,1) size 45x18
+            text run at (0,1) width 28: "ab(^"
+            text run at (27,1) width 18 RTL: "\x{62C}\x{62F}"
+        LayoutBlockFlow {P} at (0,823) size 769x21
+          LayoutText {#text} at (0,1) size 49x18
+            text run at (0,1) width 49 RTL: "\x{5D0}\x{5D1}(^\x{62C}\x{62F}"
+        LayoutBlockFlow {P} at (0,860) size 769x21
+          LayoutText {#text} at (0,1) size 45x18
+            text run at (0,1) width 45 RTL: "\x{627}\x{628}(^\x{62C}\x{62F}"
+        LayoutBlockFlow {P} at (0,897) size 769x21
+          LayoutText {#text} at (0,1) size 61x18
+            text run at (0,1) width 44: "ab12(^"
+            text run at (43,1) width 18 RTL: "\x{62C}\x{62F}"
+        LayoutBlockFlow {P} at (0,934) size 769x21
+          LayoutText {#text} at (0,1) size 65x18
+            text run at (0,1) width 30 RTL: "(^\x{62C}\x{62F}"
+            text run at (29,1) width 17: "12"
+            text run at (45,1) width 20 RTL: "\x{5D0}\x{5D1}"
+        LayoutBlockFlow {P} at (0,971) size 769x21
+          LayoutText {#text} at (0,1) size 61x18
+            text run at (0,1) width 30 RTL: "(^\x{62C}\x{62F}"
+            text run at (29,1) width 17: "12"
+            text run at (45,1) width 16 RTL: "\x{627}\x{628}"
+        LayoutBlockFlow {P} at (0,1008) size 769x21
+          LayoutText {#text} at (0,1) size 62x18
+            text run at (0,1) width 16: "ab"
+            text run at (15,1) width 30 RTL: "(^\x{62C}\x{62F}"
+            text run at (44,1) width 18: "\x{661}\x{662}"
+        LayoutBlockFlow {P} at (0,1045) size 769x21
+          LayoutText {#text} at (0,1) size 66x18
+            text run at (0,1) width 30 RTL: "(^\x{62C}\x{62F}"
+            text run at (29,1) width 17: "\x{661}\x{662}"
+            text run at (45,1) width 21 RTL: "\x{5D0}\x{5D1}"
+        LayoutBlockFlow {P} at (0,1082) size 769x21
+          LayoutText {#text} at (0,1) size 61x18
+            text run at (0,1) width 30 RTL: "(^\x{62C}\x{62F}"
+            text run at (29,1) width 17: "\x{661}\x{662}"
+            text run at (45,1) width 16 RTL: "\x{627}\x{628}"
+        LayoutBlockFlow {P} at (0,1119) size 769x21
+          LayoutText {#text} at (0,1) size 37x18
+            text run at (0,1) width 8: "\x{202A}?"
+            text run at (7,1) width 13: "\x{202C}(^"
+            text run at (19,1) width 18 RTL: "\x{62C}\x{62F}"
+        LayoutBlockFlow {P} at (0,1156) size 769x21
+          LayoutText {#text} at (0,1) size 37x18
+            text run at (0,1) width 30 RTL: "\x{202C}(^\x{62C}\x{62F}"
+            text run at (29,1) width 8 RTL: "\x{202B}?"
+        LayoutBlockFlow {P} at (0,1193) size 769x19
+          LayoutText {#text} at (0,1) size 63x18
+            text run at (0,1) width 44: "ab(^34"
+            text run at (43,1) width 13 RTL: "\x{5E9}"
+            text run at (55,1) width 8: "z"
+        LayoutBlockFlow {P} at (0,1228) size 769x19
+          LayoutText {#text} at (0,1) size 67x18
+            text run at (0,1) width 12 RTL: "\x{5E9}"
+            text run at (11,1) width 17: "34"
+            text run at (27,1) width 33 RTL: "\x{5D0}\x{5D1}(^"
+            text run at (59,1) width 8: "z"
+        LayoutBlockFlow {P} at (0,1263) size 769x21
+          LayoutText {#text} at (0,1) size 63x18
+            text run at (0,1) width 12 RTL: "\x{5E9}"
+            text run at (11,1) width 17: "34"
+            text run at (27,1) width 29 RTL: "\x{627}\x{628}(^"
+            text run at (55,1) width 8: "z"
+        LayoutBlockFlow {P} at (0,1300) size 769x19
+          LayoutText {#text} at (0,1) size 79x18
+            text run at (0,1) width 60: "ab12(^34"
+            text run at (59,1) width 13 RTL: "\x{5E9}"
+            text run at (71,1) width 8: "z"
+        LayoutBlockFlow {P} at (0,1335) size 769x19
+          LayoutText {#text} at (0,1) size 83x18
+            text run at (0,1) width 12 RTL: "\x{5E9}"
+            text run at (11,1) width 17: "34"
+            text run at (27,1) width 14 RTL: "(^"
+            text run at (40,1) width 17: "12"
+            text run at (56,1) width 20 RTL: "\x{5D0}\x{5D1}"
+            text run at (75,1) width 8: "z"
+        LayoutBlockFlow {P} at (0,1370) size 769x21
+          LayoutText {#text} at (0,1) size 79x18
+            text run at (0,1) width 12 RTL: "\x{5E9}"
+            text run at (11,1) width 17: "34"
+            text run at (27,1) width 14 RTL: "(^"
+            text run at (40,1) width 17: "12"
+            text run at (56,1) width 16 RTL: "\x{627}\x{628}"
+            text run at (71,1) width 8: "z"
+        LayoutBlockFlow {P} at (0,1407) size 769x21
+          LayoutText {#text} at (0,1) size 80x18
+            text run at (0,1) width 16: "ab"
+            text run at (15,1) width 17: "\x{661}\x{662}"
+            text run at (31,1) width 30: "(^34"
+            text run at (60,1) width 13 RTL: "\x{5E9}"
+            text run at (72,1) width 8: "z"
+        LayoutBlockFlow {P} at (0,1444) size 769x21
+          LayoutText {#text} at (0,1) size 84x18
+            text run at (0,1) width 12 RTL: "\x{5E9}"
+            text run at (11,1) width 17: "34"
+            text run at (27,1) width 14 RTL: "(^"
+            text run at (40,1) width 18: "\x{661}\x{662}"
+            text run at (57,1) width 20 RTL: "\x{5D0}\x{5D1}"
+            text run at (76,1) width 8: "z"
+        LayoutBlockFlow {P} at (0,1481) size 769x21
+          LayoutText {#text} at (0,1) size 80x18
+            text run at (0,1) width 12 RTL: "\x{5E9}"
+            text run at (11,1) width 17: "34"
+            text run at (27,1) width 14 RTL: "(^"
+            text run at (40,1) width 18: "\x{661}\x{662}"
+            text run at (57,1) width 15 RTL: "\x{627}\x{628}"
+            text run at (71,1) width 9: "z"
+        LayoutBlockFlow {P} at (0,1518) size 769x19
+          LayoutText {#text} at (0,1) size 55x18
+            text run at (0,1) width 8: "\x{202A}?"
+            text run at (7,1) width 29: "\x{202C}(^34"
+            text run at (35,1) width 13 RTL: "\x{5E9}"
+            text run at (47,1) width 8: "z"
+        LayoutBlockFlow {P} at (0,1553) size 769x19
+          LayoutText {#text} at (0,1) size 55x18
+            text run at (0,1) width 12 RTL: "\x{5E9}"
+            text run at (11,1) width 17: "34"
+            text run at (27,1) width 14 RTL: "\x{202C}(^"
+            text run at (40,1) width 8 RTL: "\x{202B}?"
+            text run at (47,1) width 8: "z"
+        LayoutBlockFlow {P} at (0,1588) size 769x21
+          LayoutText {#text} at (0,1) size 64x18
+            text run at (0,1) width 28: "ab(^"
+            text run at (27,1) width 13 RTL: "\x{5E9}"
+            text run at (39,1) width 18: "\x{663}\x{664}"
+            text run at (56,1) width 8: "z"
+        LayoutBlockFlow {P} at (0,1625) size 769x21
+          LayoutText {#text} at (0,1) size 68x18
+            text run at (0,1) width 12 RTL: "\x{5E9}"
+            text run at (11,1) width 18: "\x{663}\x{664}"
+            text run at (28,1) width 33 RTL: "\x{5D0}\x{5D1}(^"
+            text run at (60,1) width 8: "z"
+        LayoutBlockFlow {P} at (0,1662) size 769x21
+          LayoutText {#text} at (0,1) size 64x18
+            text run at (0,1) width 12 RTL: "\x{5E9}"
+            text run at (11,1) width 18: "\x{663}\x{664}"
+            text run at (28,1) width 28 RTL: "\x{627}\x{628}(^"
+            text run at (56,1) width 8: "z"
+        LayoutBlockFlow {P} at (0,1699) size 769x21
+          LayoutText {#text} at (0,1) size 80x18
+            text run at (0,1) width 44: "ab12(^"
+            text run at (43,1) width 13 RTL: "\x{5E9}"
+            text run at (55,1) width 18: "\x{663}\x{664}"
+            text run at (72,1) width 8: "z"
+        LayoutBlockFlow {P} at (0,1736) size 769x21
+          LayoutText {#text} at (0,1) size 84x18
+            text run at (0,1) width 12 RTL: "\x{5E9}"
+            text run at (11,1) width 18: "\x{663}\x{664}"
+            text run at (28,1) width 14 RTL: "(^"
+            text run at (41,1) width 17: "12"
+            text run at (57,1) width 20 RTL: "\x{5D0}\x{5D1}"
+            text run at (76,1) width 8: "z"
+        LayoutBlockFlow {P} at (0,1773) size 769x21
+          LayoutText {#text} at (0,1) size 80x18
+            text run at (0,1) width 12 RTL: "\x{5E9}"
+            text run at (11,1) width 18: "\x{663}\x{664}"
+            text run at (28,1) width 14 RTL: "(^"
+            text run at (41,1) width 17: "12"
+            text run at (57,1) width 15 RTL: "\x{627}\x{628}"
+            text run at (71,1) width 9: "z"
+        LayoutBlockFlow {P} at (0,1810) size 769x21
+          LayoutText {#text} at (0,1) size 81x18
+            text run at (0,1) width 16: "ab"
+            text run at (15,1) width 12 RTL: "\x{5E9}"
+            text run at (26,1) width 18: "\x{663}\x{664}"
+            text run at (43,1) width 14 RTL: "(^"
+            text run at (56,1) width 17: "\x{661}\x{662}"
+            text run at (72,1) width 9: "z"
+        LayoutBlockFlow {P} at (0,1847) size 769x21
+          LayoutText {#text} at (0,1) size 85x18
+            text run at (0,1) width 12 RTL: "\x{5E9}"
+            text run at (11,1) width 18: "\x{663}\x{664}"
+            text run at (28,1) width 14 RTL: "(^"
+            text run at (41,1) width 17: "\x{661}\x{662}"
+            text run at (57,1) width 21 RTL: "\x{5D0}\x{5D1}"
+            text run at (77,1) width 8: "z"
+        LayoutBlockFlow {P} at (0,1884) size 769x21
+          LayoutText {#text} at (0,1) size 80x18
+            text run at (0,1) width 12 RTL: "\x{5E9}"
+            text run at (11,1) width 18: "\x{663}\x{664}"
+            text run at (28,1) width 14 RTL: "(^"
+            text run at (41,1) width 17: "\x{661}\x{662}"
+            text run at (57,1) width 16 RTL: "\x{627}\x{628}"
+            text run at (72,1) width 8: "z"
+        LayoutBlockFlow {P} at (0,1921) size 769x21
+          LayoutText {#text} at (0,1) size 56x18
+            text run at (0,1) width 8: "\x{202A}?"
+            text run at (7,1) width 13: "\x{202C}(^"
+            text run at (19,1) width 13 RTL: "\x{5E9}"
+            text run at (31,1) width 18: "\x{663}\x{664}"
+            text run at (48,1) width 8: "z"
+        LayoutBlockFlow {P} at (0,1958) size 769x21
+          LayoutText {#text} at (0,1) size 56x18
+            text run at (0,1) width 12 RTL: "\x{5E9}"
+            text run at (11,1) width 18: "\x{663}\x{664}"
+            text run at (28,1) width 14 RTL: "\x{202C}(^"
+            text run at (41,1) width 8 RTL: "\x{202B}?"
+            text run at (48,1) width 8: "z"
+        LayoutBlockFlow {P} at (0,1995) size 769x18
+          LayoutText {#text} at (0,0) size 34x18
+            text run at (0,0) width 28: "ab(^"
+            text run at (27,0) width 7: "\x{202A}!"
+            text run at (33,0) width 1: "\x{202C}"
+        LayoutBlockFlow {P} at (0,2029) size 769x19
+          LayoutText {#text} at (0,1) size 38x18
+            text run at (0,1) width 20 RTL: "\x{5D0}\x{5D1}"
+            text run at (19,1) width 14: "(^"
+            text run at (32,1) width 6: "\x{202A}!"
+            text run at (37,1) width 1: "\x{202C}"
+        LayoutBlockFlow {P} at (0,2064) size 769x21
+          LayoutText {#text} at (0,1) size 34x18
+            text run at (0,1) width 15 RTL: "\x{627}\x{628}"
+            text run at (14,1) width 14: "(^"
+            text run at (27,1) width 7: "\x{202A}!"
+            text run at (33,1) width 1: "\x{202C}"
+        LayoutBlockFlow {P} at (0,2101) size 769x18
+          LayoutText {#text} at (0,0) size 50x18
+            text run at (0,0) width 44: "ab12(^"
+            text run at (43,0) width 7: "\x{202A}!"
+            text run at (49,0) width 1: "\x{202C}"
+        LayoutBlockFlow {P} at (0,2135) size 769x19
+          LayoutText {#text} at (0,1) size 54x18
+            text run at (0,1) width 16: "12"
+            text run at (16,1) width 20 RTL: "\x{5D0}\x{5D1}"
+            text run at (35,1) width 14: "(^"
+            text run at (48,1) width 6: "\x{202A}!"
+            text run at (53,1) width 1: "\x{202C}"
+        LayoutBlockFlow {P} at (0,2170) size 769x21
+          LayoutText {#text} at (0,1) size 50x18
+            text run at (0,1) width 16: "12"
+            text run at (16,1) width 15 RTL: "\x{627}\x{628}"
+            text run at (30,1) width 14: "(^"
+            text run at (43,1) width 7: "\x{202A}!"
+            text run at (49,1) width 1: "\x{202C}"
+        LayoutBlockFlow {P} at (0,2207) size 769x21
+          LayoutText {#text} at (0,1) size 51x18
+            text run at (0,1) width 16: "ab"
+            text run at (15,1) width 17: "\x{661}\x{662}"
+            text run at (31,1) width 14: "(^"
+            text run at (44,1) width 7: "\x{202A}!"
+            text run at (50,1) width 1: "\x{202C}"
+        LayoutBlockFlow {P} at (0,2244) size 769x21
+          LayoutText {#text} at (0,1) size 55x18
+            text run at (0,1) width 17: "\x{661}\x{662}"
+            text run at (16,1) width 21 RTL: "\x{5D0}\x{5D1}"
+            text run at (36,1) width 13: "(^"
+            text run at (48,1) width 7: "\x{202A}!"
+            text run at (54,1) width 1: "\x{202C}"
+        LayoutBlockFlow {P} at (0,2281) size 769x21
+          LayoutText {#text} at (0,1) size 50x18
+            text run at (0,1) width 17: "\x{661}\x{662}"
+            text run at (16,1) width 16 RTL: "\x{627}\x{628}"
+            text run at (31,1) width 14: "(^"
+            text run at (44,1) width 6: "\x{202A}!"
+            text run at (49,1) width 1: "\x{202C}"
+        LayoutBlockFlow {P} at (0,2318) size 769x18
+          LayoutText {#text} at (0,0) size 26x18
+            text run at (0,0) width 8: "\x{202A}?"
+            text run at (7,0) width 13: "\x{202C}(^"
+            text run at (19,0) width 7: "\x{202A}!"
+            text run at (25,0) width 1: "\x{202C}"
+        LayoutBlockFlow {P} at (0,2352) size 769x18
+          LayoutText {#text} at (0,0) size 26x18
+            text run at (0,0) width 8 RTL: "\x{202B}?"
+            text run at (7,0) width 13: "\x{202C}(^"
+            text run at (19,0) width 7: "\x{202A}!"
+            text run at (25,0) width 1: "\x{202C}"
+        LayoutBlockFlow {P} at (0,2386) size 769x18
+          LayoutText {#text} at (0,0) size 34x18
+            text run at (0,0) width 28: "ab(^"
+            text run at (27,0) width 7 RTL: "\x{202B}!"
+            text run at (33,0) width 1: "\x{202C}"
+        LayoutBlockFlow {P} at (0,2420) size 769x19
+          LayoutText {#text} at (0,1) size 38x18
+            text run at (0,1) width 6 RTL: "\x{202B}!"
+            text run at (5,1) width 33 RTL: "\x{5D0}\x{5D1}(^"
+            text run at (37,1) width 1: "\x{202C}"
+        LayoutBlockFlow {P} at (0,2455) size 769x21
+          LayoutText {#text} at (0,1) size 34x18
+            text run at (0,1) width 6 RTL: "\x{202B}!"
+            text run at (5,1) width 29 RTL: "\x{627}\x{628}(^"
+            text run at (33,1) width 1: "\x{202C}"
+        LayoutBlockFlow {P} at (0,2492) size 769x18
+          LayoutText {#text} at (0,0) size 50x18
+            text run at (0,0) width 44: "ab12(^"
+            text run at (43,0) width 7 RTL: "\x{202B}!"
+            text run at (49,0) width 1: "\x{202C}"
+        LayoutBlockFlow {P} at (0,2526) size 769x19
+          LayoutText {#text} at (0,1) size 54x18
+            text run at (0,1) width 6 RTL: "\x{202B}!"
+            text run at (5,1) width 14 RTL: "(^"
+            text run at (18,1) width 17: "12"
+            text run at (34,1) width 20 RTL: "\x{5D0}\x{5D1}"
+            text run at (53,1) width 1: "\x{202C}"
+        LayoutBlockFlow {P} at (0,2561) size 769x21
+          LayoutText {#text} at (0,1) size 50x18
+            text run at (0,1) width 6 RTL: "\x{202B}!"
+            text run at (5,1) width 14 RTL: "(^"
+            text run at (18,1) width 17: "12"
+            text run at (34,1) width 16 RTL: "\x{627}\x{628}"
+            text run at (49,1) width 1: "\x{202C}"
+        LayoutBlockFlow {P} at (0,2598) size 769x21
+          LayoutText {#text} at (0,1) size 51x18
+            text run at (0,1) width 16: "ab"
+            text run at (15,1) width 6 RTL: "\x{202B}!"
+            text run at (20,1) width 14 RTL: "(^"
+            text run at (33,1) width 18: "\x{661}\x{662}"
+            text run at (50,1) width 1: "\x{202C}"
+        LayoutBlockFlow {P} at (0,2635) size 769x21
+          LayoutText {#text} at (0,1) size 55x18
+            text run at (0,1) width 6 RTL: "\x{202B}!"
+            text run at (5,1) width 14 RTL: "(^"
+            text run at (18,1) width 17: "\x{661}\x{662}"
+            text run at (34,1) width 21 RTL: "\x{5D0}\x{5D1}"
+            text run at (54,1) width 1: "\x{202C}"
+        LayoutBlockFlow {P} at (0,2672) size 769x21
+          LayoutText {#text} at (0,1) size 50x18
+            text run at (0,1) width 6 RTL: "\x{202B}!"
+            text run at (5,1) width 14 RTL: "(^"
+            text run at (18,1) width 17: "\x{661}\x{662}"
+            text run at (34,1) width 16 RTL: "\x{627}\x{628}"
+            text run at (49,1) width 1: "\x{202C}"
+        LayoutBlockFlow {P} at (0,2709) size 769x18
+          LayoutText {#text} at (0,0) size 26x18
+            text run at (0,0) width 8: "\x{202A}?"
+            text run at (7,0) width 13: "\x{202C}(^"
+            text run at (19,0) width 7 RTL: "\x{202B}!"
+            text run at (25,0) width 1: "\x{202C}"
+        LayoutBlockFlow {P} at (0,2743) size 769x18
+          LayoutText {#text} at (0,0) size 26x18
+            text run at (0,0) width 6 RTL: "\x{202B}!"
+            text run at (5,0) width 14 RTL: "\x{202C}(^"
+            text run at (18,0) width 8 RTL: "\x{202B}?"
+            text run at (25,0) width 1: "\x{202C}"
+        LayoutBlockFlow {P} at (0,2777) size 769x18
+          LayoutText {#text} at (0,0) size 28x18
+            text run at (0,0) width 28: "\x{202A}ab(^"
+            text run at (27,0) width 1: "\x{202C}"
+        LayoutBlockFlow {P} at (0,2811) size 769x19
+          LayoutText {#text} at (0,1) size 33x18
+            text run at (0,1) width 20 RTL: "\x{202A}\x{5D0}\x{5D1}"
+            text run at (19,1) width 14: "(^"
+            text run at (32,1) width 1: "\x{202C}"
+        LayoutBlockFlow {P} at (0,2846) size 769x21
+          LayoutText {#text} at (0,1) size 28x18
+            text run at (0,1) width 15 RTL: "\x{202A}\x{627}\x{628}"
+            text run at (14,1) width 14: "(^"
+            text run at (27,1) width 1: "\x{202C}"
+        LayoutBlockFlow {P} at (0,2883) size 769x18
+          LayoutText {#text} at (0,0) size 44x18
+            text run at (0,0) width 44: "\x{202A}ab12(^"
+            text run at (43,0) width 1: "\x{202C}"
+        LayoutBlockFlow {P} at (0,2917) size 769x19
+          LayoutText {#text} at (0,1) size 49x18
+            text run at (0,1) width 16: "12"
+            text run at (16,1) width 20 RTL: "\x{202A}\x{5D0}\x{5D1}"
+            text run at (35,1) width 14: "(^"
+            text run at (48,1) width 1: "\x{202C}"
+        LayoutBlockFlow {P} at (0,2952) size 769x21
+          LayoutText {#text} at (0,1) size 44x18
+            text run at (0,1) width 16: "12"
+            text run at (16,1) width 15 RTL: "\x{202A}\x{627}\x{628}"
+            text run at (30,1) width 14: "(^"
+            text run at (43,1) width 1: "\x{202C}"
+        LayoutBlockFlow {P} at (0,2989) size 769x21
+          LayoutText {#text} at (0,1) size 45x18
+            text run at (0,1) width 16: "\x{202A}ab"
+            text run at (15,1) width 17: "\x{661}\x{662}"
+            text run at (31,1) width 14: "(^"
+            text run at (44,1) width 1: "\x{202C}"
+        LayoutBlockFlow {P} at (0,3026) size 769x21
+          LayoutText {#text} at (0,1) size 49x18
+            text run at (0,1) width 17: "\x{661}\x{662}"
+            text run at (16,1) width 21 RTL: "\x{202A}\x{5D0}\x{5D1}"
+            text run at (36,1) width 13: "(^"
+            text run at (48,1) width 1: "\x{202C}"
+        LayoutBlockFlow {P} at (0,3063) size 769x21
+          LayoutText {#text} at (0,1) size 45x18
+            text run at (0,1) width 17: "\x{661}\x{662}"
+            text run at (16,1) width 16 RTL: "\x{202A}\x{627}\x{628}"
+            text run at (31,1) width 14: "(^"
+            text run at (44,1) width 1: "\x{202C}"
+        LayoutBlockFlow {P} at (0,3100) size 769x18
+          LayoutText {#text} at (0,0) size 20x18
+            text run at (0,0) width 0: "\x{202A}"
+            text run at (0,0) width 8: "\x{202A}?"
+            text run at (7,0) width 13: "\x{202C}(^"
+            text run at (19,0) width 1: "\x{202C}"
+        LayoutBlockFlow {P} at (0,3134) size 769x18
+          LayoutText {#text} at (0,0) size 20x18
+            text run at (0,0) width 0: "\x{202A}"
+            text run at (0,0) width 8 RTL: "\x{202B}?"
+            text run at (7,0) width 13: "\x{202C}(^"
+            text run at (19,0) width 1: "\x{202C}"
+      LayoutBlockFlow {DIV} at (0,3202) size 769x3152
+        LayoutBlockFlow {P} at (0,0) size 769x18
+          LayoutText {#text} at (0,0) size 44x18
+            text run at (0,0) width 44: "ab(^cd"
+        LayoutBlockFlow {P} at (0,34) size 769x19
+          LayoutText {#text} at (0,1) size 48x18
+            text run at (0,1) width 16: "cd"
+            text run at (15,1) width 33 RTL: "\x{5D0}\x{5D1}(^"
+        LayoutBlockFlow {P} at (0,69) size 769x21
+          LayoutText {#text} at (0,1) size 43x18
+            text run at (0,1) width 16: "cd"
+            text run at (15,1) width 28 RTL: "\x{627}\x{628}(^"
+        LayoutBlockFlow {P} at (0,106) size 769x18
+          LayoutText {#text} at (0,0) size 60x18
+            text run at (0,0) width 60: "ab12(^cd"
+        LayoutBlockFlow {P} at (0,140) size 769x19
+          LayoutText {#text} at (0,1) size 64x18
+            text run at (0,1) width 16: "cd"
+            text run at (15,1) width 13 RTL: "(^"
+            text run at (27,1) width 17: "12"
+            text run at (43,1) width 21 RTL: "\x{5D0}\x{5D1}"
+        LayoutBlockFlow {P} at (0,175) size 769x21
+          LayoutText {#text} at (0,1) size 59x18
+            text run at (0,1) width 16: "cd"
+            text run at (15,1) width 13 RTL: "(^"
+            text run at (27,1) width 17: "12"
+            text run at (43,1) width 16 RTL: "\x{627}\x{628}"
+        LayoutBlockFlow {P} at (0,212) size 769x21
+          LayoutText {#text} at (0,1) size 60x18
+            text run at (0,1) width 16: "cd"
+            text run at (15,1) width 13 RTL: "(^"
+            text run at (27,1) width 33: "ab\x{661}\x{662}"
+        LayoutBlockFlow {P} at (0,249) size 769x21
+          LayoutText {#text} at (0,1) size 65x18
+            text run at (0,1) width 16: "cd"
+            text run at (15,1) width 13 RTL: "(^"
+            text run at (27,1) width 18: "\x{661}\x{662}"
+            text run at (44,1) width 21 RTL: "\x{5D0}\x{5D1}"
+        LayoutBlockFlow {P} at (0,286) size 769x21
+          LayoutText {#text} at (0,1) size 60x18
+            text run at (0,1) width 16: "cd"
+            text run at (15,1) width 13 RTL: "(^"
+            text run at (27,1) width 18: "\x{661}\x{662}"
+            text run at (44,1) width 16 RTL: "\x{627}\x{628}"
+        LayoutBlockFlow {P} at (0,323) size 769x18
+          LayoutText {#text} at (0,0) size 36x18
+            text run at (0,0) width 8: "\x{202A}?"
+            text run at (7,0) width 29: "\x{202C}(^cd"
+        LayoutBlockFlow {P} at (0,357) size 769x18
+          LayoutText {#text} at (0,0) size 36x18
+            text run at (0,0) width 16: "cd"
+            text run at (15,0) width 13 RTL: "\x{202C}(^"
+            text run at (27,0) width 9 RTL: "\x{202B}?"
+        LayoutBlockFlow {P} at (0,391) size 769x19
+          LayoutText {#text} at (0,1) size 43x18
+            text run at (0,1) width 28 RTL: "(^\x{5D2}\x{5D3}"
+            text run at (27,1) width 16: "ab"
+        LayoutBlockFlow {P} at (0,426) size 769x19
+          LayoutText {#text} at (0,1) size 48x18
+            text run at (0,1) width 48 RTL: "\x{5D0}\x{5D1}(^\x{5D2}\x{5D3}"
+        LayoutBlockFlow {P} at (0,461) size 769x21
+          LayoutText {#text} at (0,1) size 43x18
+            text run at (0,1) width 43 RTL: "\x{627}\x{628}(^\x{5D2}\x{5D3}"
+        LayoutBlockFlow {P} at (0,498) size 769x19
+          LayoutText {#text} at (0,1) size 59x18
+            text run at (0,1) width 28 RTL: "(^\x{5D2}\x{5D3}"
+            text run at (27,1) width 32: "ab12"
+        LayoutBlockFlow {P} at (0,533) size 769x19
+          LayoutText {#text} at (0,1) size 64x18
+            text run at (0,1) width 28 RTL: "(^\x{5D2}\x{5D3}"
+            text run at (27,1) width 17: "12"
+            text run at (43,1) width 21 RTL: "\x{5D0}\x{5D1}"
+        LayoutBlockFlow {P} at (0,568) size 769x21
+          LayoutText {#text} at (0,1) size 59x18
+            text run at (0,1) width 28 RTL: "(^\x{5D2}\x{5D3}"
+            text run at (27,1) width 17: "12"
+            text run at (43,1) width 16 RTL: "\x{627}\x{628}"
+        LayoutBlockFlow {P} at (0,605) size 769x21
+          LayoutText {#text} at (0,1) size 60x18
+            text run at (0,1) width 28 RTL: "(^\x{5D2}\x{5D3}"
+            text run at (27,1) width 33: "ab\x{661}\x{662}"
+        LayoutBlockFlow {P} at (0,642) size 769x21
+          LayoutText {#text} at (0,1) size 64x18
+            text run at (0,1) width 28 RTL: "(^\x{5D2}\x{5D3}"
+            text run at (27,1) width 18: "\x{661}\x{662}"
+            text run at (44,1) width 20 RTL: "\x{5D0}\x{5D1}"
+        LayoutBlockFlow {P} at (0,679) size 769x21
+          LayoutText {#text} at (0,1) size 60x18
+            text run at (0,1) width 28 RTL: "(^\x{5D2}\x{5D3}"
+            text run at (27,1) width 18: "\x{661}\x{662}"
+            text run at (44,1) width 16 RTL: "\x{627}\x{628}"
+        LayoutBlockFlow {P} at (0,716) size 769x19
+          LayoutText {#text} at (0,1) size 35x18
+            text run at (0,1) width 28 RTL: "\x{202C}(^\x{5D2}\x{5D3}"
+            text run at (27,1) width 8: "\x{202A}?"
+        LayoutBlockFlow {P} at (0,751) size 769x19
+          LayoutText {#text} at (0,1) size 35x18
+            text run at (0,1) width 28 RTL: "\x{202C}(^\x{5D2}\x{5D3}"
+            text run at (27,1) width 8 RTL: "\x{202B}?"
+        LayoutBlockFlow {P} at (0,786) size 769x21
+          LayoutText {#text} at (0,1) size 45x18
+            text run at (0,1) width 30 RTL: "(^\x{62C}\x{62F}"
+            text run at (29,1) width 16: "ab"
+        LayoutBlockFlow {P} at (0,823) size 769x21
+          LayoutText {#text} at (0,1) size 49x18
+            text run at (0,1) width 49 RTL: "\x{5D0}\x{5D1}(^\x{62C}\x{62F}"
+        LayoutBlockFlow {P} at (0,860) size 769x21
+          LayoutText {#text} at (0,1) size 45x18
+            text run at (0,1) width 45 RTL: "\x{627}\x{628}(^\x{62C}\x{62F}"
+        LayoutBlockFlow {P} at (0,897) size 769x21
+          LayoutText {#text} at (0,1) size 61x18
+            text run at (0,1) width 30 RTL: "(^\x{62C}\x{62F}"
+            text run at (29,1) width 32: "ab12"
+        LayoutBlockFlow {P} at (0,934) size 769x21
+          LayoutText {#text} at (0,1) size 65x18
+            text run at (0,1) width 30 RTL: "(^\x{62C}\x{62F}"
+            text run at (29,1) width 17: "12"
+            text run at (45,1) width 20 RTL: "\x{5D0}\x{5D1}"
+        LayoutBlockFlow {P} at (0,971) size 769x21
+          LayoutText {#text} at (0,1) size 61x18
+            text run at (0,1) width 30 RTL: "(^\x{62C}\x{62F}"
+            text run at (29,1) width 17: "12"
+            text run at (45,1) width 16 RTL: "\x{627}\x{628}"
+        LayoutBlockFlow {P} at (0,1008) size 769x21
+          LayoutText {#text} at (0,1) size 62x18
+            text run at (0,1) width 30 RTL: "(^\x{62C}\x{62F}"
+            text run at (29,1) width 33: "ab\x{661}\x{662}"
+        LayoutBlockFlow {P} at (0,1045) size 769x21
+          LayoutText {#text} at (0,1) size 66x18
+            text run at (0,1) width 30 RTL: "(^\x{62C}\x{62F}"
+            text run at (29,1) width 17: "\x{661}\x{662}"
+            text run at (45,1) width 21 RTL: "\x{5D0}\x{5D1}"
+        LayoutBlockFlow {P} at (0,1082) size 769x21
+          LayoutText {#text} at (0,1) size 61x18
+            text run at (0,1) width 30 RTL: "(^\x{62C}\x{62F}"
+            text run at (29,1) width 17: "\x{661}\x{662}"
+            text run at (45,1) width 16 RTL: "\x{627}\x{628}"
+        LayoutBlockFlow {P} at (0,1119) size 769x21
+          LayoutText {#text} at (0,1) size 37x18
+            text run at (0,1) width 30 RTL: "\x{202C}(^\x{62C}\x{62F}"
+            text run at (29,1) width 8: "\x{202A}?"
+        LayoutBlockFlow {P} at (0,1156) size 769x21
+          LayoutText {#text} at (0,1) size 37x18
+            text run at (0,1) width 30 RTL: "\x{202C}(^\x{62C}\x{62F}"
+            text run at (29,1) width 8 RTL: "\x{202B}?"
+        LayoutBlockFlow {P} at (0,1193) size 769x19
+          LayoutText {#text} at (0,1) size 63x18
+            text run at (0,1) width 8: "z"
+            text run at (7,1) width 12 RTL: "\x{5E9}"
+            text run at (18,1) width 45: "ab(^34"
+        LayoutBlockFlow {P} at (0,1228) size 769x19
+          LayoutText {#text} at (0,1) size 67x18
+            text run at (0,1) width 8: "z"
+            text run at (7,1) width 12 RTL: "\x{5E9}"
+            text run at (18,1) width 17: "34"
+            text run at (34,1) width 33 RTL: "\x{5D0}\x{5D1}(^"
+        LayoutBlockFlow {P} at (0,1263) size 769x21
+          LayoutText {#text} at (0,1) size 63x18
+            text run at (0,1) width 8: "z"
+            text run at (7,1) width 12 RTL: "\x{5E9}"
+            text run at (18,1) width 17: "34"
+            text run at (34,1) width 29 RTL: "\x{627}\x{628}(^"
+        LayoutBlockFlow {P} at (0,1300) size 769x19
+          LayoutText {#text} at (0,1) size 79x18
+            text run at (0,1) width 8: "z"
+            text run at (7,1) width 12 RTL: "\x{5E9}"
+            text run at (18,1) width 61: "ab12(^34"
+        LayoutBlockFlow {P} at (0,1335) size 769x19
+          LayoutText {#text} at (0,1) size 83x18
+            text run at (0,1) width 8: "z"
+            text run at (7,1) width 12 RTL: "\x{5E9}"
+            text run at (18,1) width 17: "34"
+            text run at (34,1) width 14 RTL: "(^"
+            text run at (47,1) width 17: "12"
+            text run at (63,1) width 20 RTL: "\x{5D0}\x{5D1}"
+        LayoutBlockFlow {P} at (0,1370) size 769x21
+          LayoutText {#text} at (0,1) size 79x18
+            text run at (0,1) width 8: "z"
+            text run at (7,1) width 12 RTL: "\x{5E9}"
+            text run at (18,1) width 17: "34"
+            text run at (34,1) width 14 RTL: "(^"
+            text run at (47,1) width 17: "12"
+            text run at (63,1) width 16 RTL: "\x{627}\x{628}"
+        LayoutBlockFlow {P} at (0,1407) size 769x21
+          LayoutText {#text} at (0,1) size 80x18
+            text run at (0,1) width 8: "z"
+            text run at (7,1) width 12 RTL: "\x{5E9}"
+            text run at (18,1) width 17: "34"
+            text run at (34,1) width 14 RTL: "(^"
+            text run at (47,1) width 33: "ab\x{661}\x{662}"
+        LayoutBlockFlow {P} at (0,1444) size 769x21
+          LayoutText {#text} at (0,1) size 84x18
+            text run at (0,1) width 8: "z"
+            text run at (7,1) width 12 RTL: "\x{5E9}"
+            text run at (18,1) width 17: "34"
+            text run at (34,1) width 14 RTL: "(^"
+            text run at (47,1) width 18: "\x{661}\x{662}"
+            text run at (64,1) width 20 RTL: "\x{5D0}\x{5D1}"
+        LayoutBlockFlow {P} at (0,1481) size 769x21
+          LayoutText {#text} at (0,1) size 80x18
+            text run at (0,1) width 8: "z"
+            text run at (7,1) width 12 RTL: "\x{5E9}"
+            text run at (18,1) width 17: "34"
+            text run at (34,1) width 14 RTL: "(^"
+            text run at (47,1) width 18: "\x{661}\x{662}"
+            text run at (64,1) width 16 RTL: "\x{627}\x{628}"
+        LayoutBlockFlow {P} at (0,1518) size 769x19
+          LayoutText {#text} at (0,1) size 55x18
+            text run at (0,1) width 8: "z"
+            text run at (7,1) width 12 RTL: "\x{5E9}"
+            text run at (18,1) width 8: "\x{202A}?"
+            text run at (25,1) width 30: "\x{202C}(^34"
+        LayoutBlockFlow {P} at (0,1553) size 769x19
+          LayoutText {#text} at (0,1) size 55x18
+            text run at (0,1) width 8: "z"
+            text run at (7,1) width 12 RTL: "\x{5E9}"
+            text run at (18,1) width 17: "34"
+            text run at (34,1) width 14 RTL: "\x{202C}(^"
+            text run at (47,1) width 8 RTL: "\x{202B}?"
+        LayoutBlockFlow {P} at (0,1588) size 769x21
+          LayoutText {#text} at (0,1) size 64x18
+            text run at (0,1) width 8: "z"
+            text run at (7,1) width 12 RTL: "\x{5E9}"
+            text run at (18,1) width 18: "\x{663}\x{664}"
+            text run at (35,1) width 14 RTL: "(^"
+            text run at (48,1) width 16: "ab"
+        LayoutBlockFlow {P} at (0,1625) size 769x21
+          LayoutText {#text} at (0,1) size 68x18
+            text run at (0,1) width 8: "z"
+            text run at (7,1) width 12 RTL: "\x{5E9}"
+            text run at (18,1) width 18: "\x{663}\x{664}"
+            text run at (35,1) width 33 RTL: "\x{5D0}\x{5D1}(^"
+        LayoutBlockFlow {P} at (0,1662) size 769x21
+          LayoutText {#text} at (0,1) size 64x18
+            text run at (0,1) width 8: "z"
+            text run at (7,1) width 12 RTL: "\x{5E9}"
+            text run at (18,1) width 18: "\x{663}\x{664}"
+            text run at (35,1) width 29 RTL: "\x{627}\x{628}(^"
+        LayoutBlockFlow {P} at (0,1699) size 769x21
+          LayoutText {#text} at (0,1) size 80x18
+            text run at (0,1) width 8: "z"
+            text run at (7,1) width 12 RTL: "\x{5E9}"
+            text run at (18,1) width 18: "\x{663}\x{664}"
+            text run at (35,1) width 14 RTL: "(^"
+            text run at (48,1) width 32: "ab12"
+        LayoutBlockFlow {P} at (0,1736) size 769x21
+          LayoutText {#text} at (0,1) size 84x18
+            text run at (0,1) width 8: "z"
+            text run at (7,1) width 12 RTL: "\x{5E9}"
+            text run at (18,1) width 18: "\x{663}\x{664}"
+            text run at (35,1) width 14 RTL: "(^"
+            text run at (48,1) width 17: "12"
+            text run at (64,1) width 20 RTL: "\x{5D0}\x{5D1}"
+        LayoutBlockFlow {P} at (0,1773) size 769x21
+          LayoutText {#text} at (0,1) size 80x18
+            text run at (0,1) width 8: "z"
+            text run at (7,1) width 12 RTL: "\x{5E9}"
+            text run at (18,1) width 18: "\x{663}\x{664}"
+            text run at (35,1) width 14 RTL: "(^"
+            text run at (48,1) width 17: "12"
+            text run at (64,1) width 16 RTL: "\x{627}\x{628}"
+        LayoutBlockFlow {P} at (0,1810) size 769x21
+          LayoutText {#text} at (0,1) size 81x18
+            text run at (0,1) width 8: "z"
+            text run at (7,1) width 12 RTL: "\x{5E9}"
+            text run at (18,1) width 18: "\x{663}\x{664}"
+            text run at (35,1) width 14 RTL: "(^"
+            text run at (48,1) width 33: "ab\x{661}\x{662}"
+        LayoutBlockFlow {P} at (0,1847) size 769x21
+          LayoutText {#text} at (0,1) size 85x18
+            text run at (0,1) width 8: "z"
+            text run at (7,1) width 12 RTL: "\x{5E9}"
+            text run at (18,1) width 18: "\x{663}\x{664}"
+            text run at (35,1) width 14 RTL: "(^"
+            text run at (48,1) width 17: "\x{661}\x{662}"
+            text run at (64,1) width 21 RTL: "\x{5D0}\x{5D1}"
+        LayoutBlockFlow {P} at (0,1884) size 769x21
+          LayoutText {#text} at (0,1) size 80x18
+            text run at (0,1) width 8: "z"
+            text run at (7,1) width 12 RTL: "\x{5E9}"
+            text run at (18,1) width 18: "\x{663}\x{664}"
+            text run at (35,1) width 14 RTL: "(^"
+            text run at (48,1) width 17: "\x{661}\x{662}"
+            text run at (64,1) width 16 RTL: "\x{627}\x{628}"
+        LayoutBlockFlow {P} at (0,1921) size 769x21
+          LayoutText {#text} at (0,1) size 56x18
+            text run at (0,1) width 8: "z"
+            text run at (7,1) width 12 RTL: "\x{5E9}"
+            text run at (18,1) width 18: "\x{663}\x{664}"
+            text run at (35,1) width 14 RTL: "\x{202C}(^"
+            text run at (48,1) width 8: "\x{202A}?"
+        LayoutBlockFlow {P} at (0,1958) size 769x21
+          LayoutText {#text} at (0,1) size 56x18
+            text run at (0,1) width 8: "z"
+            text run at (7,1) width 12 RTL: "\x{5E9}"
+            text run at (18,1) width 18: "\x{663}\x{664}"
+            text run at (35,1) width 14 RTL: "\x{202C}(^"
+            text run at (48,1) width 8 RTL: "\x{202B}?"
+        LayoutBlockFlow {P} at (0,1995) size 769x18
+          LayoutText {#text} at (0,0) size 34x18
+            text run at (0,0) width 0 RTL: "\x{202C}"
+            text run at (0,0) width 28: "ab(^"
+            text run at (27,0) width 7: "\x{202A}!"
+        LayoutBlockFlow {P} at (0,2029) size 769x19
+          LayoutText {#text} at (0,1) size 38x18
+            text run at (0,1) width 0 RTL: "\x{202C}"
+            text run at (0,1) width 6: "\x{202A}!"
+            text run at (5,1) width 33 RTL: "\x{5D0}\x{5D1}(^"
+        LayoutBlockFlow {P} at (0,2064) size 769x21
+          LayoutText {#text} at (0,1) size 34x18
+            text run at (0,1) width 0 RTL: "\x{202C}"
+            text run at (0,1) width 6: "\x{202A}!"
+            text run at (5,1) width 29 RTL: "\x{627}\x{628}(^"
+        LayoutBlockFlow {P} at (0,2101) size 769x18
+          LayoutText {#text} at (0,0) size 50x18
+            text run at (0,0) width 0 RTL: "\x{202C}"
+            text run at (0,0) width 44: "ab12(^"
+            text run at (43,0) width 7: "\x{202A}!"
+        LayoutBlockFlow {P} at (0,2135) size 769x19
+          LayoutText {#text} at (0,1) size 54x18
+            text run at (0,1) width 0 RTL: "\x{202C}"
+            text run at (0,1) width 6: "\x{202A}!"
+            text run at (5,1) width 14 RTL: "(^"
+            text run at (18,1) width 17: "12"
+            text run at (34,1) width 20 RTL: "\x{5D0}\x{5D1}"
+        LayoutBlockFlow {P} at (0,2170) size 769x21
+          LayoutText {#text} at (0,1) size 50x18
+            text run at (0,1) width 0 RTL: "\x{202C}"
+            text run at (0,1) width 6: "\x{202A}!"
+            text run at (5,1) width 14 RTL: "(^"
+            text run at (18,1) width 17: "12"
+            text run at (34,1) width 16 RTL: "\x{627}\x{628}"
+        LayoutBlockFlow {P} at (0,2207) size 769x21
+          LayoutText {#text} at (0,1) size 51x18
+            text run at (0,1) width 0 RTL: "\x{202C}"
+            text run at (0,1) width 6: "\x{202A}!"
+            text run at (5,1) width 14 RTL: "(^"
+            text run at (18,1) width 33: "ab\x{661}\x{662}"
+        LayoutBlockFlow {P} at (0,2244) size 769x21
+          LayoutText {#text} at (0,1) size 55x18
+            text run at (0,1) width 0 RTL: "\x{202C}"
+            text run at (0,1) width 6: "\x{202A}!"
+            text run at (5,1) width 14 RTL: "(^"
+            text run at (18,1) width 17: "\x{661}\x{662}"
+            text run at (34,1) width 21 RTL: "\x{5D0}\x{5D1}"
+        LayoutBlockFlow {P} at (0,2281) size 769x21
+          LayoutText {#text} at (0,1) size 50x18
+            text run at (0,1) width 0 RTL: "\x{202C}"
+            text run at (0,1) width 6: "\x{202A}!"
+            text run at (5,1) width 14 RTL: "(^"
+            text run at (18,1) width 17: "\x{661}\x{662}"
+            text run at (34,1) width 16 RTL: "\x{627}\x{628}"
+        LayoutBlockFlow {P} at (0,2318) size 769x18
+          LayoutText {#text} at (0,0) size 26x18
+            text run at (0,0) width 0 RTL: "\x{202C}"
+            text run at (0,0) width 8: "\x{202A}?"
+            text run at (7,0) width 13: "\x{202C}(^"
+            text run at (19,0) width 7: "\x{202A}!"
+        LayoutBlockFlow {P} at (0,2352) size 769x18
+          LayoutText {#text} at (0,0) size 26x18
+            text run at (0,0) width 0 RTL: "\x{202C}"
+            text run at (0,0) width 6: "\x{202A}!"
+            text run at (5,0) width 14 RTL: "\x{202C}(^"
+            text run at (18,0) width 8 RTL: "\x{202B}?"
+        LayoutBlockFlow {P} at (0,2386) size 769x18
+          LayoutText {#text} at (0,0) size 34x18
+            text run at (0,0) width 0 RTL: "\x{202C}"
+            text run at (0,0) width 6 RTL: "\x{202B}!"
+            text run at (5,0) width 14 RTL: "(^"
+            text run at (18,0) width 16: "ab"
+        LayoutBlockFlow {P} at (0,2420) size 769x19
+          LayoutText {#text} at (0,1) size 38x18
+            text run at (0,1) width 0 RTL: "\x{202C}"
+            text run at (0,1) width 6 RTL: "\x{202B}!"
+            text run at (5,1) width 33 RTL: "\x{5D0}\x{5D1}(^"
+        LayoutBlockFlow {P} at (0,2455) size 769x21
+          LayoutText {#text} at (0,1) size 34x18
+            text run at (0,1) width 0 RTL: "\x{202C}"
+            text run at (0,1) width 6 RTL: "\x{202B}!"
+            text run at (5,1) width 29 RTL: "\x{627}\x{628}(^"
+        LayoutBlockFlow {P} at (0,2492) size 769x18
+          LayoutText {#text} at (0,0) size 50x18
+            text run at (0,0) width 0 RTL: "\x{202C}"
+            text run at (0,0) width 6 RTL: "\x{202B}!"
+            text run at (5,0) width 14 RTL: "(^"
+            text run at (18,0) width 32: "ab12"
+        LayoutBlockFlow {P} at (0,2526) size 769x19
+          LayoutText {#text} at (0,1) size 54x18
+            text run at (0,1) width 0 RTL: "\x{202C}"
+            text run at (0,1) width 6 RTL: "\x{202B}!"
+            text run at (5,1) width 14 RTL: "(^"
+            text run at (18,1) width 17: "12"
+            text run at (34,1) width 20 RTL: "\x{5D0}\x{5D1}"
+        LayoutBlockFlow {P} at (0,2561) size 769x21
+          LayoutText {#text} at (0,1) size 50x18
+            text run at (0,1) width 0 RTL: "\x{202C}"
+            text run at (0,1) width 6 RTL: "\x{202B}!"
+            text run at (5,1) width 14 RTL: "(^"
+            text run at (18,1) width 17: "12"
+            text run at (34,1) width 16 RTL: "\x{627}\x{628}"
+        LayoutBlockFlow {P} at (0,2598) size 769x21
+          LayoutText {#text} at (0,1) size 51x18
+            text run at (0,1) width 0 RTL: "\x{202C}"
+            text run at (0,1) width 6 RTL: "\x{202B}!"
+            text run at (5,1) width 14 RTL: "(^"
+            text run at (18,1) width 33: "ab\x{661}\x{662}"
+        LayoutBlockFlow {P} at (0,2635) size 769x21
+          LayoutText {#text} at (0,1) size 55x18
+            text run at (0,1) width 0 RTL: "\x{202C}"
+            text run at (0,1) width 6 RTL: "\x{202B}!"
+            text run at (5,1) width 14 RTL: "(^"
+            text run at (18,1) width 17: "\x{661}\x{662}"
+            text run at (34,1) width 21 RTL: "\x{5D0}\x{5D1}"
+        LayoutBlockFlow {P} at (0,2672) size 769x21
+          LayoutText {#text} at (0,1) size 50x18
+            text run at (0,1) width 0 RTL: "\x{202C}"
+            text run at (0,1) width 6 RTL: "\x{202B}!"
+            text run at (5,1) width 14 RTL: "(^"
+            text run at (18,1) width 17: "\x{661}\x{662}"
+            text run at (34,1) width 16 RTL: "\x{627}\x{628}"
+        LayoutBlockFlow {P} at (0,2709) size 769x18
+          LayoutText {#text} at (0,0) size 26x18
+            text run at (0,0) width 0 RTL: "\x{202C}"
+            text run at (0,0) width 6 RTL: "\x{202B}!"
+            text run at (5,0) width 14 RTL: "\x{202C}(^"
+            text run at (18,0) width 8: "\x{202A}?"
+        LayoutBlockFlow {P} at (0,2743) size 769x18
+          LayoutText {#text} at (0,0) size 26x18
+            text run at (0,0) width 0 RTL: "\x{202C}"
+            text run at (0,0) width 6 RTL: "\x{202B}!"
+            text run at (5,0) width 14 RTL: "\x{202C}(^"
+            text run at (18,0) width 8 RTL: "\x{202B}?"
+        LayoutBlockFlow {P} at (0,2777) size 769x18
+          LayoutText {#text} at (0,0) size 28x18
+            text run at (0,0) width 0 RTL: "\x{202C}"
+            text run at (0,0) width 28: "\x{202A}ab(^"
+        LayoutBlockFlow {P} at (0,2811) size 769x19
+          LayoutText {#text} at (0,1) size 33x18
+            text run at (0,1) width 0 RTL: "\x{202C}"
+            text run at (0,1) width 20 RTL: "\x{202A}\x{5D0}\x{5D1}"
+            text run at (19,1) width 14: "(^"
+        LayoutBlockFlow {P} at (0,2846) size 769x21
+          LayoutText {#text} at (0,1) size 28x18
+            text run at (0,1) width 0 RTL: "\x{202C}"
+            text run at (0,1) width 15 RTL: "\x{202A}\x{627}\x{628}"
+            text run at (14,1) width 14: "(^"
+        LayoutBlockFlow {P} at (0,2883) size 769x18
+          LayoutText {#text} at (0,0) size 44x18
+            text run at (0,0) width 0 RTL: "\x{202C}"
+            text run at (0,0) width 44: "\x{202A}ab12(^"
+        LayoutBlockFlow {P} at (0,2917) size 769x19
+          LayoutText {#text} at (0,1) size 49x18
+            text run at (0,1) width 0 RTL: "\x{202C}"
+            text run at (0,1) width 16: "12"
+            text run at (16,1) width 20 RTL: "\x{202A}\x{5D0}\x{5D1}"
+            text run at (35,1) width 14: "(^"
+        LayoutBlockFlow {P} at (0,2952) size 769x21
+          LayoutText {#text} at (0,1) size 44x18
+            text run at (0,1) width 0 RTL: "\x{202C}"
+            text run at (0,1) width 16: "12"
+            text run at (16,1) width 15 RTL: "\x{202A}\x{627}\x{628}"
+            text run at (30,1) width 14: "(^"
+        LayoutBlockFlow {P} at (0,2989) size 769x21
+          LayoutText {#text} at (0,1) size 45x18
+            text run at (0,1) width 0 RTL: "\x{202C}"
+            text run at (0,1) width 16: "\x{202A}ab"
+            text run at (15,1) width 17: "\x{661}\x{662}"
+            text run at (31,1) width 14: "(^"
+        LayoutBlockFlow {P} at (0,3026) size 769x21
+          LayoutText {#text} at (0,1) size 49x18
+            text run at (0,1) width 0 RTL: "\x{202C}"
+            text run at (0,1) width 17: "\x{661}\x{662}"
+            text run at (16,1) width 21 RTL: "\x{202A}\x{5D0}\x{5D1}"
+            text run at (36,1) width 13: "(^"
+        LayoutBlockFlow {P} at (0,3063) size 769x21
+          LayoutText {#text} at (0,1) size 45x18
+            text run at (0,1) width 0 RTL: "\x{202C}"
+            text run at (0,1) width 17: "\x{661}\x{662}"
+            text run at (16,1) width 16 RTL: "\x{202A}\x{627}\x{628}"
+            text run at (31,1) width 14: "(^"
+        LayoutBlockFlow {P} at (0,3100) size 769x18
+          LayoutText {#text} at (0,0) size 20x18
+            text run at (0,0) width 0 RTL: "\x{202C}"
+            text run at (0,0) width 0: "\x{202A}"
+            text run at (0,0) width 8: "\x{202A}?"
+            text run at (7,0) width 13: "\x{202C}(^"
+        LayoutBlockFlow {P} at (0,3134) size 769x18
+          LayoutText {#text} at (0,0) size 20x18
+            text run at (0,0) width 0 RTL: "\x{202C}"
+            text run at (0,0) width 0: "\x{202A}"
+            text run at (0,0) width 8 RTL: "\x{202B}?"
+            text run at (7,0) width 13: "\x{202C}(^"
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mountainlion/fast/text/international/bidi-word-spacing-rtl-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mountainlion/fast/text/international/bidi-word-spacing-rtl-expected.png
new file mode 100644
index 0000000..f226511
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/mac-mountainlion/fast/text/international/bidi-word-spacing-rtl-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mountainlion/fast/text/international/bidi-word-spacing-rtl-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-mountainlion/fast/text/international/bidi-word-spacing-rtl-expected.txt
new file mode 100644
index 0000000..17f0411
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/mac-mountainlion/fast/text/international/bidi-word-spacing-rtl-expected.txt
@@ -0,0 +1,50 @@
+layer at (0,0) size 800x600
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x358
+  LayoutBlockFlow {HTML} at (0,0) size 800x358
+    LayoutBlockFlow {BODY} at (8,10) size 784x338
+      LayoutBlockFlow {DIV} at (300,0) size 184x48 [border: (1px solid #000000)]
+        LayoutText {#text} at (169,1) size 14x46
+          text run at (169,1) width 14 RTL: "!"
+        LayoutInline {SPAN} at (0,0) size 48x46
+          LayoutText {#text} at (22,1) size 48x46
+            text run at (22,1) width 48 RTL: " @"
+        LayoutText {#text} at (0,0) size 0x0
+      LayoutBlockFlow {DIV} at (300,58) size 184x48 [border: (1px solid #000000)]
+        LayoutText {#text} at (169,1) size 14x46
+          text run at (169,1) width 14 RTL: "!"
+        LayoutInline {SPAN} at (0,0) size 111x46
+          LayoutText {#text} at (159,1) size 11x46
+            text run at (159,1) width 11 RTL: " "
+        LayoutText {#text} at (22,1) size 38x46
+          text run at (22,1) width 38 RTL: "@"
+      LayoutBlockFlow {DIV} at (300,116) size 184x48 [border: (1px solid #000000)]
+        LayoutInline {SPAN} at (0,0) size 124x46
+          LayoutText {#text} at (59,1) size 124x46
+            text run at (59,1) width 124 RTL: "! "
+        LayoutText {#text} at (22,1) size 38x46
+          text run at (22,1) width 38 RTL: "@"
+      LayoutBlockFlow {DIV} at (300,174) size 184x48 [border: (1px solid #000000)]
+        LayoutText {#text} at (169,1) size 14x46
+          text run at (169,1) width 14 RTL: "!"
+        LayoutInline {SPAN} at (0,0) size 111x46
+          LayoutText {#text} at (159,1) size 11x46
+            text run at (159,1) width 11 RTL: " "
+        LayoutText {#text} at (12,1) size 48x46
+          text run at (12,1) width 48 RTL: "@ \x{200F}"
+      LayoutBlockFlow {DIV} at (300,232) size 184x48 [border: (1px solid #000000)]
+        LayoutText {#text} at (169,1) size 14x46
+          text run at (169,1) width 14 RTL: "!"
+        LayoutInline {SPAN} at (0,0) size 111x46
+          LayoutText {#text} at (159,1) size 11x46
+            text run at (159,1) width 11 RTL: " "
+        LayoutText {#text} at (22,1) size 38x46
+          text run at (22,1) width 38 RTL: "@"
+      LayoutBlockFlow {DIV} at (300,290) size 184x48 [border: (1px solid #000000)]
+        LayoutText {#text} at (22,1) size 38x46
+          text run at (22,1) width 38: "@"
+        LayoutInline {SPAN} at (0,0) size 111x46
+          LayoutText {#text} at (159,1) size 11x46
+            text run at (159,1) width 11: " "
+        LayoutText {#text} at (169,1) size 14x46
+          text run at (169,1) width 14: "!"
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mountainlion/fast/text/international/plane2-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mountainlion/fast/text/international/plane2-expected.png
index 8cc837b..f05eaef 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-mountainlion/fast/text/international/plane2-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-mountainlion/fast/text/international/plane2-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mountainlion/fast/text/international/thai-baht-space-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mountainlion/fast/text/international/thai-baht-space-expected.png
index 452f61c6..7603056 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-mountainlion/fast/text/international/thai-baht-space-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-mountainlion/fast/text/international/thai-baht-space-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mountainlion/fast/text/international/thai-line-breaks-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mountainlion/fast/text/international/thai-line-breaks-expected.png
index a1cacc9..35cf628 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-mountainlion/fast/text/international/thai-line-breaks-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-mountainlion/fast/text/international/thai-line-breaks-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mountainlion/fast/text/international/thai-line-breaks-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-mountainlion/fast/text/international/thai-line-breaks-expected.txt
index 6ef43dc..017b5e1 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-mountainlion/fast/text/international/thai-line-breaks-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac-mountainlion/fast/text/international/thai-line-breaks-expected.txt
@@ -4,11 +4,11 @@
   LayoutBlockFlow {HTML} at (0,0) size 785x600
     LayoutBlockFlow {BODY} at (8,8) size 769x576
       LayoutBlockFlow {P} at (0,0) size 769x72
-        LayoutText {#text} at (0,0) size 762x72
+        LayoutText {#text} at (0,0) size 761x72
           text run at (0,0) width 743: "The column on the right has explicit spaces. Line breaks should be roughly the same if Thai line breaks are working"
           text run at (0,18) width 760: "well. The original source of this text was ICU, and the test program said \"by it's very nature, Thai word breaking is not"
-          text run at (0,36) width 762: "exact\", so the columns don't match exactly. In a future version we might decide to tweak the right column to match our"
-          text run at (0,54) width 121: "expected behavior."
+          text run at (0,36) width 761: "exact\", so the columns don't match exactly. In a future version we might decide to tweak the right column to match our"
+          text run at (0,54) width 120: "expected behavior."
 layer at (236,96) size 1x27896 backgroundClip at (0,0) size 785x600 clip at (0,0) size 785x600
   LayoutBlockFlow (positioned) {DIV} at (235.50,96) size 1x27896
     LayoutText {#text} at (0,3) size 83x27892
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mountainlion/fast/text/justify-ideograph-complex-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mountainlion/fast/text/justify-ideograph-complex-expected.png
new file mode 100644
index 0000000..4f52bf0
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/mac-mountainlion/fast/text/justify-ideograph-complex-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mountainlion/fast/text/midword-break-before-surrogate-pair-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mountainlion/fast/text/midword-break-before-surrogate-pair-expected.png
index 8518245..4bb0e2ba 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-mountainlion/fast/text/midword-break-before-surrogate-pair-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-mountainlion/fast/text/midword-break-before-surrogate-pair-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mountainlion/fast/text/shaping/same-script-different-lang-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-mountainlion/fast/text/shaping/same-script-different-lang-expected.txt
new file mode 100644
index 0000000..3aef65a8
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/mac-mountainlion/fast/text/shaping/same-script-different-lang-expected.txt
@@ -0,0 +1,22 @@
+layer at (0,0) size 800x600
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x173
+  LayoutBlockFlow {HTML} at (0,0) size 800x173.44
+    LayoutBlockFlow {BODY} at (8,18.72) size 784x138.72
+      LayoutBlockFlow {H3} at (0,0) size 784x22
+        LayoutText {#text} at (0,0) size 759x22
+          text run at (0,0) width 759: "The glyph for JHA should look different for Nepali and Hindi, depending on the lang attribute."
+      LayoutBlockFlow {P} at (0,40.72) size 784x22
+        LayoutText {#text} at (0,1) size 91x21
+          text run at (0,1) width 91: "Hindi:JHA \x{91D}"
+      LayoutBlockFlow {P} at (0,78.72) size 784x22
+        LayoutText {#text} at (0,1) size 102x21
+          text run at (0,1) width 102: "Nepali:JHA \x{91D}"
+      LayoutBlockFlow {P} at (0,116.72) size 784x22
+        LayoutText {#text} at (0,1) size 87x21
+          text run at (0,1) width 87: "Nepali:JHA "
+        LayoutInline {SPAN} at (0,0) size 16x21
+          LayoutText {#text} at (86,1) size 16x21
+            text run at (86,1) width 16: "\x{91D}"
+        LayoutText {#text} at (101,1) size 353x21
+          text run at (101,1) width 353: " - \"ne\" in \"hi\" should look the same as above."
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mountainlion/fast/text/softHyphen-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mountainlion/fast/text/softHyphen-expected.png
new file mode 100644
index 0000000..3574fb58
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/mac-mountainlion/fast/text/softHyphen-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mountainlion/fast/text/softHyphen-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-mountainlion/fast/text/softHyphen-expected.txt
new file mode 100644
index 0000000..e44c6cc
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/mac-mountainlion/fast/text/softHyphen-expected.txt
@@ -0,0 +1,168 @@
+layer at (0,0) size 800x600 clip at (0,0) size 785x600 scrollHeight 992
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 785x992 backgroundClip at (0,0) size 785x600 clip at (0,0) size 785x600
+  LayoutBlockFlow {HTML} at (0,0) size 785x992
+    LayoutBlockFlow {BODY} at (8,16) size 769x960
+      LayoutBlockFlow {P} at (0,0) size 769x18
+        LayoutText {#text} at (0,0) size 438x18
+          text run at (0,0) width 438: "In all of the following, there should not be a hyphen before \x{201C}lorem\x{201D}."
+      LayoutBlockFlow {P} at (0,34) size 769x18
+        LayoutText {#text} at (0,0) size 20x18
+          text run at (0,0) width 20: "Do"
+        LayoutBlockFlow (floating) {SPAN} at (755.44,0) size 13.56x20 [border: (1px solid #FF0000)]
+          LayoutText {#text} at (1,1) size 12x18
+            text run at (1,1) width 12: "X"
+        LayoutText {#text} at (19,0) size 81x18
+          text run at (19,0) width 81: "\x{AD}lorem ipsum"
+      LayoutBlockFlow {P} at (0,68) size 769x18
+        LayoutBlockFlow (floating) {SPAN} at (755.44,0) size 13.56x20 [border: (1px solid #FF0000)]
+          LayoutText {#text} at (1,1) size 12x18
+            text run at (1,1) width 12: "X"
+        LayoutText {#text} at (0,0) size 81x18
+          text run at (0,0) width 81: "lorem ipsum"
+      LayoutBlockFlow {P} at (0,102) size 769x20
+        LayoutText {#text} at (0,1) size 20x18
+          text run at (0,1) width 20: "Do"
+        LayoutText {#text} at (33,1) size 81x18
+          text run at (33,1) width 81: "\x{AD}lorem ipsum"
+      LayoutBlockFlow {P} at (0,138) size 769x18
+        LayoutText {#text} at (0,0) size 20x18
+          text run at (0,0) width 20: "Do"
+        LayoutText {#text} at (19,0) size 81x18
+          text run at (19,0) width 81: "\x{AD}lorem ipsum"
+      LayoutBlockFlow (anonymous) at (0,172) size 769x18
+        LayoutText {#text} at (0,0) size 20x18
+          text run at (0,0) width 20: "Do"
+      LayoutBlockFlow {P} at (0,206) size 769x18
+        LayoutText {#text} at (0,0) size 81x18
+          text run at (0,0) width 81: "lorem ipsum"
+      LayoutBlockFlow {P} at (0,240) size 769x36
+        LayoutText {#text} at (0,0) size 20x18
+          text run at (0,0) width 20: "Do"
+        LayoutBR {BR} at (19,14) size 1x0
+        LayoutText {#text} at (0,18) size 81x18
+          text run at (0,18) width 81: "lorem ipsum"
+      LayoutBlockFlow {P} at (0,292) size 769x18
+        LayoutText {#text} at (0,0) size 20x18
+          text run at (0,0) width 20: "Do"
+        LayoutInline {SPAN} at (0,0) size 38x18
+          LayoutText {#text} at (19,0) size 38x18
+            text run at (19,0) width 38: "\x{AD}lorem"
+        LayoutText {#text} at (56,0) size 44x18
+          text run at (56,0) width 44: " ipsum"
+      LayoutBlockFlow {P} at (0,326) size 769x18
+        LayoutText {#text} at (0,0) size 12x18
+          text run at (0,0) width 12: "D"
+        LayoutInline {SPAN} at (0,0) size 9x18
+          LayoutText {#text} at (11,0) size 9x18
+            text run at (11,0) width 9: "o"
+        LayoutText {#text} at (19,0) size 81x18
+          text run at (19,0) width 81: "\x{AD}lorem ipsum"
+      LayoutBlockFlow {P} at (0,360) size 769x18
+        LayoutText {#text} at (0,0) size 24x18
+          text run at (0,0) width 24: "Do "
+        LayoutInline {SPAN} at (0,0) size 38x18
+          LayoutText {#text} at (23,0) size 38x18
+            text run at (23,0) width 38: "\x{AD}lorem"
+        LayoutText {#text} at (60,0) size 44x18
+          text run at (60,0) width 44: " ipsum"
+      LayoutBlockFlow {P} at (0,394) size 769x18
+        LayoutText {#text} at (0,0) size 12x18
+          text run at (0,0) width 12: "D"
+        LayoutInline {SPAN} at (0,0) size 13x18
+          LayoutText {#text} at (11,0) size 13x18
+            text run at (11,0) width 13: "o "
+        LayoutText {#text} at (23,0) size 81x18
+          text run at (23,0) width 81: "\x{AD}lorem ipsum"
+      LayoutBlockFlow {P} at (0,428) size 769x18
+        LayoutText {#text} at (0,0) size 24x18
+          text run at (0,0) width 24: "Do "
+        LayoutInline {SPAN} at (0,0) size 38x18
+          LayoutText {#text} at (23,0) size 38x18
+            text run at (23,0) width 38: "\x{AD}lorem"
+        LayoutText {#text} at (60,0) size 44x18
+          text run at (60,0) width 44: " ipsum"
+      LayoutBlockFlow {P} at (0,462) size 769x18
+        LayoutText {#text} at (0,0) size 12x18
+          text run at (0,0) width 12: "D"
+        LayoutInline {SPAN} at (0,0) size 13x18
+          LayoutText {#text} at (11,0) size 13x18
+            text run at (11,0) width 13: "o "
+        LayoutText {#text} at (23,0) size 81x18
+          text run at (23,0) width 81: "\x{AD}lorem ipsum"
+      LayoutBlockFlow {P} at (0,496) size 769x18
+        LayoutText {#text} at (0,0) size 65x18
+          text run at (0,0) width 65: "Do \x{AD} lorem"
+      LayoutBlockFlow {P} at (0,530) size 769x18
+        LayoutText {#text} at (0,0) size 61x18
+          text run at (0,0) width 61: "Do\x{AD} \x{AD}lorem"
+      LayoutBlockFlow {P} at (0,564) size 769x18
+        LayoutText {#text} at (0,0) size 61x18
+          text run at (0,0) width 24: "Do "
+          text run at (23,0) width 38: "\x{AD}lorem"
+      LayoutBlockFlow {P} at (0,598) size 769x18
+        LayoutText {#text} at (0,0) size 61x18
+          text run at (0,0) width 24: "Do\x{AD} "
+          text run at (23,0) width 38: "lorem"
+      LayoutBlockFlow {P} at (0,632) size 769x18
+        LayoutText {#text} at (0,0) size 65x18
+          text run at (0,0) width 28: "Do \x{AD} "
+          text run at (27,0) width 38: "lorem"
+      LayoutBlockFlow {P} at (0,666) size 769x18
+        LayoutText {#text} at (0,0) size 65x18
+          text run at (0,0) width 24: "Do "
+          text run at (23,0) width 42: "\x{AD} lorem"
+      LayoutBlockFlow {P} at (0,700) size 769x18
+        LayoutText {#text} at (0,0) size 20x18
+          text run at (0,0) width 20: "Do"
+        LayoutInline {SPAN} at (0,0) size 1x18
+        LayoutText {#text} at (19,0) size 81x18
+          text run at (19,0) width 81: "\x{AD}lorem ipsum"
+      LayoutBlockFlow {P} at (0,734) size 769x18
+        LayoutText {#text} at (0,0) size 100x18
+          text run at (0,0) width 100: "Do\x{AD}\x{AD}lorem ipsum"
+      LayoutBlockFlow {P} at (0,768) size 769x18
+        LayoutInline {SPAN} at (0,0) size 20x18
+          LayoutText {#text} at (0,0) size 20x18
+            text run at (0,0) width 20: "Do\x{AD}"
+        LayoutText {#text} at (19,0) size 81x18
+          text run at (19,0) width 81: "\x{AD}lorem ipsum"
+      LayoutBlockFlow {P} at (0,802) size 769x18
+        LayoutText {#text} at (0,0) size 20x18
+          text run at (0,0) width 20: "Do\x{AD}"
+        LayoutInline {SPAN} at (0,0) size 81x18
+          LayoutText {#text} at (19,0) size 81x18
+            text run at (19,0) width 81: "\x{AD}lorem ipsum"
+      LayoutBlockFlow {P} at (0,836) size 769x18
+        LayoutInline {SPAN} at (0,0) size 20x18
+          LayoutText {#text} at (0,0) size 20x18
+            text run at (0,0) width 20: "Do\x{AD}\x{AD}"
+        LayoutText {#text} at (19,0) size 81x18
+          text run at (19,0) width 81: "lorem ipsum"
+      LayoutBlockFlow {P} at (0,870) size 769x18
+        LayoutText {#text} at (0,0) size 251x18
+          text run at (0,0) width 251: "The following pair should be the same:"
+      LayoutBlockFlow {P} at (0,904) size 769x20
+        LayoutText {#text} at (0,1) size 16x18
+          text run at (0,1) width 16: "W"
+        LayoutBlockFlow {SPAN} at (15.09,0) size 13.56x20 [border: (1px solid #FF0000)]
+          LayoutText {#text} at (1,1) size 12x18
+            text run at (1,1) width 12: "X"
+        LayoutText {#text} at (28,1) size 13x18
+          text run at (28,1) width 13: "Y"
+      LayoutBlockFlow {P} at (0,940) size 769x20
+        LayoutText {#text} at (0,1) size 16x18
+          text run at (0,1) width 16: "W"
+        LayoutBlockFlow {SPAN} at (15.09,0) size 13.56x20 [border: (1px solid #FF0000)]
+          LayoutText {#text} at (1,1) size 12x18
+            text run at (1,1) width 12: "X"
+        LayoutText {#text} at (28,1) size 13x18
+          text run at (28,1) width 13: "Y"
+layer at (28,118) size 13x20
+  LayoutBlockFlow (relative positioned) {SPAN} at (19.55,0) size 13.56x20 [border: (1px solid #FF0000)]
+    LayoutText {#text} at (1,1) size 12x18
+      text run at (1,1) width 12: "X"
+layer at (771,154) size 14x20
+  LayoutBlockFlow (positioned) {SPAN} at (771.44,154) size 13.56x20 [border: (1px solid #FF0000)]
+    LayoutText {#text} at (1,1) size 12x18
+      text run at (1,1) width 12: "X"
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mountainlion/fast/text/unicode-fallback-font-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mountainlion/fast/text/unicode-fallback-font-expected.png
index ba6cf48c..065d2c7 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-mountainlion/fast/text/unicode-fallback-font-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-mountainlion/fast/text/unicode-fallback-font-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mountainlion/fast/text/unicode-fallback-font-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-mountainlion/fast/text/unicode-fallback-font-expected.txt
index 473bb415..5c71769 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-mountainlion/fast/text/unicode-fallback-font-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac-mountainlion/fast/text/unicode-fallback-font-expected.txt
@@ -1,12 +1,12 @@
-layer at (0,0) size 800x600 clip at (0,0) size 785x600 scrollHeight 1240
+layer at (0,0) size 800x600 clip at (0,0) size 785x600 scrollHeight 1242
   LayoutView at (0,0) size 800x600
-layer at (0,0) size 785x1240 backgroundClip at (0,0) size 785x600 clip at (0,0) size 785x600
-  LayoutBlockFlow {HTML} at (0,0) size 785x1239.88
-    LayoutBlockFlow {BODY} at (8,21.44) size 769x1202.44
+layer at (0,0) size 785x1242 backgroundClip at (0,0) size 785x600 clip at (0,0) size 785x600
+  LayoutBlockFlow {HTML} at (0,0) size 785x1241.88
+    LayoutBlockFlow {BODY} at (8,21.44) size 769x1204.44
       LayoutBlockFlow {H1} at (0,0) size 769x37
         LayoutText {#text} at (0,0) size 236x37
           text run at (0,0) width 236: "Unicode Symbols"
-      LayoutBlockFlow {PRE} at (0,58.44) size 769x1092
+      LayoutBlockFlow {PRE} at (0,58.44) size 769x1094
         LayoutText {#text} at (0,0) size 297x105
           text run at (0,0) width 0: " "
           text run at (0,15) width 297: "U+16Ax \x{16A0} \x{16A1} \x{16A2} \x{16A3} \x{16A4} \x{16A5} \x{16A6} \x{16A7} \x{16A8} \x{16A9} \x{16AA} \x{16AB} \x{16AC} \x{16AD} \x{16AE} \x{16AF}"
@@ -21,7 +21,7 @@
           text run at (296,75) width 1: " "
           text run at (0,90) width 63: "U+16Fx \x{16F0}"
           text run at (62,90) width 1: " "
-        LayoutText {#text} at (0,105) size 297x120
+        LayoutText {#text} at (0,105) size 297x121
           text run at (0,105) width 0: " "
           text run at (0,120) width 258: "U+200x \x{2000} \x{2001} \x{2002} \x{2003} \x{2004} \x{2004} \x{2004} \x{2004} \x{2004} \x{2009} \x{200A} \x{200B} \x{200C} \x{200D} \x{200E} "
           text run at (257,120) width 1 RTL: "\x{200F}"
@@ -41,104 +41,104 @@
           text run at (296,180) width 1: " "
           text run at (0,195) width 297: "U+205x \x{2050} \x{2051} \x{2052} \x{2053} \x{2054} \x{2055} \x{2056} \x{2057} \x{2058} \x{2059} \x{205A} \x{205B} \x{205C} \x{205D} \x{205E} \x{205F}"
           text run at (296,195) width 1: " "
-          text run at (0,210) width 133: "U+206x \x{2060} \x{2061} \x{2062} \x{2063} \x{2064} \x{206A} \x{206B} \x{206C} \x{206D} \x{206E} \x{206F}"
-          text run at (132,210) width 1: " "
-        LayoutText {#text} at (0,225) size 393x344
-          text run at (0,225) width 0: " "
-          text run at (0,242) width 355: "U+260x \x{2600} \x{2601} \x{2602} \x{2603} \x{2604} \x{2605} \x{2606} \x{2607} \x{2608} \x{2609} \x{260A} \x{260B} \x{260C} \x{260D} \x{260E} \x{260F}"
-          text run at (354,242) width 1: " "
-          text run at (0,264) width 366: "U+261x \x{2610} \x{2611} \x{2612} \x{2613} \x{2614} \x{2615} \x{2616} \x{2617} \x{2618} \x{2619} \x{261A} \x{261B} \x{261C} \x{261D} \x{261E} \x{261F}"
-          text run at (365,264) width 1: " "
-          text run at (0,284) width 314: "U+262x \x{2620} \x{2621} \x{2622} \x{2623} \x{2624} \x{2625} \x{2626} \x{2627} \x{2628} \x{2629} \x{262A} \x{262B} \x{262C} \x{262D} \x{262E} \x{262F}"
-          text run at (313,284) width 1: " "
-          text run at (0,303) width 352: "U+263x \x{2630} \x{2631} \x{2632} \x{2633} \x{2634} \x{2635} \x{2636} \x{2637} \x{2638} \x{2639} \x{263A} \x{263B} \x{263C} \x{263D} \x{263E} \x{263F}"
-          text run at (351,303) width 1: " "
-          text run at (0,324) width 378: "U+264x \x{2640} \x{2641} \x{2642} \x{2643} \x{2644} \x{2645} \x{2646} \x{2647} \x{2648} \x{2649} \x{264A} \x{264B} \x{264C} \x{264D} \x{264E} \x{264F}"
-          text run at (377,324) width 1: " "
-          text run at (0,346) width 393: "U+265x \x{2650} \x{2651} \x{2652} \x{2653} \x{2654} \x{2655} \x{2656} \x{2657} \x{2658} \x{2659} \x{265A} \x{265B} \x{265C} \x{265D} \x{265E} \x{265F}"
-          text run at (392,346) width 1: " "
-          text run at (0,365) width 375: "U+266x \x{2660} \x{2661} \x{2662} \x{2663} \x{2664} \x{2665} \x{2666} \x{2667} \x{2668} \x{2669} \x{266A} \x{266B} \x{266C} \x{266D} \x{266E} \x{266F}"
-          text run at (374,365) width 1: " "
-          text run at (0,387) width 368: "U+267x \x{2670} \x{2671} \x{2672} \x{2673} \x{2674} \x{2675} \x{2676} \x{2677} \x{2678} \x{2679} \x{267A} \x{267B} \x{267C} \x{267D} \x{267E} \x{267F}"
-          text run at (367,387) width 1: " "
-          text run at (0,405) width 311: "U+268x \x{2680} \x{2681} \x{2682} \x{2683} \x{2684} \x{2685} \x{2686} \x{2687} \x{2688} \x{2689} \x{268A} \x{268B} \x{268C} \x{268D} \x{268E} \x{268F}"
-          text run at (311,405) width 0: " "
-          text run at (0,425) width 306: "U+269x \x{2690} \x{2691} \x{2692} \x{2693} \x{2694} \x{2695} \x{2696} \x{2697} \x{2698} \x{2699} \x{269A} \x{269B} \x{269C} \x{269D} \x{269E} \x{269F}"
-          text run at (305,425) width 1: " "
-          text run at (0,446) width 363: "U+26Ax \x{26A0} \x{26A1} \x{26A2} \x{26A3} \x{26A4} \x{26A5} \x{26A6} \x{26A7} \x{26A8} \x{26A9} \x{26AA} \x{26AB} \x{26AC} \x{26AD} \x{26AE} \x{26AF}"
-          text run at (362,446) width 1: " "
-          text run at (0,468) width 311: "U+26Bx \x{26B0} \x{26B1} \x{26B2} \x{26B3} \x{26B4} \x{26B5} \x{26B6} \x{26B7} \x{26B8} \x{26B9} \x{26BA} \x{26BB} \x{26BC} \x{26BD} \x{26BE} \x{26BF}"
-          text run at (310,468) width 1: " "
-          text run at (0,490) width 322: "U+26Cx \x{26C0} \x{26C1} \x{26C2} \x{26C3} \x{26C4} \x{26C5} \x{26C6} \x{26C7} \x{26C8} \x{26C9} \x{26CA} \x{26CB} \x{26CC} \x{26CD} \x{26CE} \x{26CF}"
-          text run at (321,490) width 1: " "
-          text run at (0,511) width 305: "U+26Dx \x{26D0} \x{26D1} \x{26D2} \x{26D3} \x{26D4} \x{26D5} \x{26D6} \x{26D7} \x{26D8} \x{26D9} \x{26DA} \x{26DB} \x{26DC} \x{26DD} \x{26DE} \x{26DF}"
-          text run at (304,511) width 1: " "
-          text run at (0,532) width 307: "U+26Ex \x{26E0} \x{26E1} \x{26E2} \x{26E3} \x{26E4} \x{26E5} \x{26E6} \x{26E7} \x{26E8} \x{26E9} \x{26EA} \x{26EB} \x{26EC} \x{26ED} \x{26EE} \x{26EF}"
-          text run at (306,532) width 1: " "
-          text run at (0,554) width 339: "U+26Fx \x{26F0} \x{26F1} \x{26F2} \x{26F3} \x{26F4} \x{26F5} \x{26F6} \x{26F7} \x{26F8} \x{26F9} \x{26FA} \x{26FB} \x{26FC} \x{26FD} \x{26FE} \x{26FF}"
-          text run at (338,554) width 1: " "
-        LayoutText {#text} at (0,571) size 364x229
-          text run at (0,571) width 0: " "
-          text run at (0,590) width 361: "U+270x \x{2700} \x{2701} \x{2702} \x{2703} \x{2704} \x{2705} \x{2706} \x{2707} \x{2708} \x{2709} \x{270A} \x{270B} \x{270C} \x{270D} \x{270E} \x{270F}"
-          text run at (360,590) width 1: " "
-          text run at (0,607) width 326: "U+271x \x{2710} \x{2711} \x{2712} \x{2713} \x{2714} \x{2715} \x{2716} \x{2717} \x{2718} \x{2719} \x{271A} \x{271B} \x{271C} \x{271D} \x{271E} \x{271F}"
-          text run at (325,607) width 1: " "
-          text run at (0,626) width 341: "U+272x \x{2720} \x{2721} \x{2722} \x{2723} \x{2724} \x{2725} \x{2726} \x{2727} \x{2728} \x{2729} \x{272A} \x{272B} \x{272C} \x{272D} \x{272E} \x{272F}"
-          text run at (340,626) width 1: " "
-          text run at (0,643) width 330: "U+273x \x{2730} \x{2731} \x{2732} \x{2733} \x{2734} \x{2735} \x{2736} \x{2737} \x{2738} \x{2739} \x{273A} \x{273B} \x{273C} \x{273D} \x{273E} \x{273F}"
-          text run at (329,643) width 1: " "
-          text run at (0,662) width 343: "U+274x \x{2740} \x{2741} \x{2742} \x{2743} \x{2744} \x{2745} \x{2746} \x{2747} \x{2748} \x{2749} \x{274A} \x{274B} \x{274C} \x{274D} \x{274E} \x{274F}"
-          text run at (342,662) width 1: " "
-          text run at (0,683) width 323: "U+275x \x{2750} \x{2751} \x{2752} \x{2753} \x{2754} \x{2755} \x{2756} \x{2757} \x{2758} \x{2759} \x{275A} \x{275B} \x{275C} \x{275D} \x{275E} \x{275F}"
-          text run at (322,683) width 1: " "
-          text run at (0,700) width 283: "U+276x \x{2760} \x{2761} \x{2762} \x{2763} \x{2764} \x{2765} \x{2766} \x{2767} \x{2768} \x{2769} \x{276A} \x{276B} \x{276C} \x{276D} \x{276E} \x{276F}"
-          text run at (282,700) width 1: " "
-          text run at (0,715) width 300: "U+277x \x{2770} \x{2771} \x{2772} \x{2773} \x{2774} \x{2775} \x{2776} \x{2777} \x{2778} \x{2779} \x{277A} \x{277B} \x{277C} \x{277D} \x{277E} \x{277F}"
-          text run at (299,715) width 1: " "
-          text run at (0,730) width 336: "U+278x \x{2780} \x{2781} \x{2782} \x{2783} \x{2784} \x{2785} \x{2786} \x{2787} \x{2788} \x{2789} \x{278A} \x{278B} \x{278C} \x{278D} \x{278E} \x{278F}"
-          text run at (335,730) width 1: " "
-          text run at (0,749) width 364: "U+279x \x{2790} \x{2791} \x{2792} \x{2793} \x{2794} \x{2795} \x{2796} \x{2797} \x{2798} \x{2799} \x{279A} \x{279B} \x{279C} \x{279D} \x{279E} \x{279F}"
-          text run at (363,749) width 1: " "
-          text run at (0,766) width 346: "U+27Ax \x{27A0} \x{27A1} \x{27A2} \x{27A3} \x{27A4} \x{27A5} \x{27A6} \x{27A7} \x{27A8} \x{27A9} \x{27AA} \x{27AB} \x{27AC} \x{27AD} \x{27AE} \x{27AF}"
-          text run at (345,766) width 1: " "
-          text run at (0,785) width 364: "U+27Bx \x{27B0} \x{27B1} \x{27B2} \x{27B3} \x{27B4} \x{27B5} \x{27B6} \x{27B7} \x{27B8} \x{27B9} \x{27BA} \x{27BB} \x{27BC} \x{27BD} \x{27BE} \x{27BF}"
-          text run at (363,785) width 1: " "
-        LayoutText {#text} at (0,802) size 328x290
-          text run at (0,802) width 0: " "
-          text run at (0,817) width 328: "U+2A0x \x{2A00} \x{2A01} \x{2A02} \x{2A03} \x{2A04} \x{2A05} \x{2A06} \x{2A07} \x{2A08} \x{2A09} \x{2A0A} \x{2A0B} \x{2A0C} \x{2A0D} \x{2A0E} \x{2A0F}"
-          text run at (327,817) width 1: " "
-          text run at (0,835) width 291: "U+2A1x \x{2A10} \x{2A11} \x{2A12} \x{2A13} \x{2A14} \x{2A15} \x{2A16} \x{2A17} \x{2A18} \x{2A19} \x{2A1A} \x{2A1B} \x{2A1C} \x{2A1D} \x{2A1E} \x{2A1F}"
-          text run at (290,835) width 1: " "
-          text run at (0,853) width 293: "U+2A2x \x{2A20} \x{2A21} \x{2A22} \x{2A23} \x{2A24} \x{2A25} \x{2A26} \x{2A27} \x{2A28} \x{2A29} \x{2A2A} \x{2A2B} \x{2A2C} \x{2A2D} \x{2A2E} \x{2A2F}"
-          text run at (292,853) width 1: " "
-          text run at (0,869) width 312: "U+2A3x \x{2A30} \x{2A31} \x{2A32} \x{2A33} \x{2A34} \x{2A35} \x{2A36} \x{2A37} \x{2A38} \x{2A39} \x{2A3A} \x{2A3B} \x{2A3C} \x{2A3D} \x{2A3E} \x{2A3F}"
-          text run at (311,869) width 1: " "
-          text run at (0,885) width 287: "U+2A4x \x{2A40} \x{2A41} \x{2A42} \x{2A43} \x{2A44} \x{2A45} \x{2A46} \x{2A47} \x{2A48} \x{2A49} \x{2A4A} \x{2A4B} \x{2A4C} \x{2A4D} \x{2A4E} \x{2A4F}"
-          text run at (286,885) width 1: " "
-          text run at (0,901) width 311: "U+2A5x \x{2A50} \x{2A51} \x{2A52} \x{2A53} \x{2A54} \x{2A55} \x{2A56} \x{2A57} \x{2A58} \x{2A59} \x{2A5A} \x{2A5B} \x{2A5C} \x{2A5D} \x{2A5E} \x{2A5F}"
-          text run at (310,901) width 1: " "
-          text run at (0,917) width 290: "U+2A6x \x{2A60} \x{2A61} \x{2A62} \x{2A63} \x{2A64} \x{2A65} \x{2A66} \x{2A67} \x{2A68} \x{2A69} \x{2A6A} \x{2A6B} \x{2A6C} \x{2A6D} \x{2A6E} \x{2A6F}"
-          text run at (289,917) width 1: " "
-          text run at (0,933) width 310: "U+2A7x \x{2A70} \x{2A71} \x{2A72} \x{2A73} \x{2A74} \x{2A75} \x{2A76} \x{2A77} \x{2A78} \x{2A79} \x{2A7A} \x{2A7B} \x{2A7C} \x{2A7D} \x{2A7E} \x{2A7F}"
-          text run at (309,933) width 1: " "
-          text run at (0,949) width 286: "U+2A8x \x{2A80} \x{2A81} \x{2A82} \x{2A83} \x{2A84} \x{2A85} \x{2A86} \x{2A87} \x{2A88} \x{2A89} \x{2A8A} \x{2A8B} \x{2A8C} \x{2A8D} \x{2A8E} \x{2A8F}"
-          text run at (285,949) width 1: " "
-          text run at (0,965) width 285: "U+2A9x \x{2A90} \x{2A91} \x{2A92} \x{2A93} \x{2A94} \x{2A95} \x{2A96} \x{2A97} \x{2A98} \x{2A99} \x{2A9A} \x{2A9B} \x{2A9C} \x{2A9D} \x{2A9E} \x{2A9F}"
-          text run at (284,965) width 1: " "
-          text run at (0,981) width 301: "U+2AAx \x{2AA0} \x{2AA1} \x{2AA2} \x{2AA3} \x{2AA4} \x{2AA5} \x{2AA6} \x{2AA7} \x{2AA8} \x{2AA9} \x{2AAA} \x{2AAB} \x{2AAC} \x{2AAD} \x{2AAE} \x{2AAF}"
-          text run at (300,981) width 1: " "
-          text run at (0,997) width 295: "U+2ABx \x{2AB0} \x{2AB1} \x{2AB2} \x{2AB3} \x{2AB4} \x{2AB5} \x{2AB6} \x{2AB7} \x{2AB8} \x{2AB9} \x{2ABA} \x{2ABB} \x{2ABC} \x{2ABD} \x{2ABE} \x{2ABF}"
-          text run at (294,997) width 1: " "
-          text run at (0,1013) width 286: "U+2ACx \x{2AC0} \x{2AC1} \x{2AC2} \x{2AC3} \x{2AC4} \x{2AC5} \x{2AC6} \x{2AC7} \x{2AC8} \x{2AC9} \x{2ACA} \x{2ACB} \x{2ACC} \x{2ACD} \x{2ACE} \x{2ACF}"
-          text run at (285,1013) width 1: " "
-          text run at (0,1029) width 293: "U+2ADx \x{2AD0} \x{2AD1} \x{2AD2} \x{2AD3} \x{2AD4} \x{2AD5} \x{2AD6} \x{2AD7} \x{2AD8} \x{2AD9} \x{2ADA} \x{2ADB} \x{2ADC} \x{2ADD} \x{2ADE} \x{2ADF}"
-          text run at (292,1029) width 1: " "
-          text run at (0,1045) width 303: "U+2AEx \x{2AE0} \x{2AE1} \x{2AE2} \x{2AE3} \x{2AE4} \x{2AE5} \x{2AE6} \x{2AE7} \x{2AE8} \x{2AE9} \x{2AEA} \x{2AEB} \x{2AEC} \x{2AED} \x{2AEE} \x{2AEF}"
-          text run at (302,1045) width 1: " "
-          text run at (0,1061) width 270: "U+2AFx \x{2AF0} \x{2AF1} \x{2AF2} \x{2AF3} \x{2AF4} \x{2AF5} \x{2AF6} \x{2AF7} \x{2AF8} \x{2AF9} \x{2AFA} \x{2AFB} \x{2AFC} \x{2AFD} \x{2AFE} \x{2AFF}"
-          text run at (269,1061) width 1: " "
-          text run at (0,1077) width 63: "        "
-      LayoutBlockFlow {P} at (0,1166.44) size 769x36
+          text run at (0,211) width 133: "U+206x \x{2060} \x{2061} \x{2062} \x{2063} \x{2064} \x{206A} \x{206B} \x{206C} \x{206D} \x{206E} \x{206F}"
+          text run at (132,211) width 1: " "
+        LayoutText {#text} at (0,227) size 380x344
+          text run at (0,227) width 0: " "
+          text run at (0,244) width 355: "U+260x \x{2600} \x{2601} \x{2602} \x{2603} \x{2604} \x{2605} \x{2606} \x{2607} \x{2608} \x{2609} \x{260A} \x{260B} \x{260C} \x{260D} \x{260E} \x{260F}"
+          text run at (354,244) width 1: " "
+          text run at (0,266) width 359: "U+261x \x{2610} \x{2611} \x{2612} \x{2613} \x{2614} \x{2615} \x{2616} \x{2617} \x{2618} \x{2619} \x{261A} \x{261B} \x{261C} \x{261D} \x{261E} \x{261F}"
+          text run at (358,266) width 1: " "
+          text run at (0,286) width 314: "U+262x \x{2620} \x{2621} \x{2622} \x{2623} \x{2624} \x{2625} \x{2626} \x{2627} \x{2628} \x{2629} \x{262A} \x{262B} \x{262C} \x{262D} \x{262E} \x{262F}"
+          text run at (313,286) width 1: " "
+          text run at (0,305) width 352: "U+263x \x{2630} \x{2631} \x{2632} \x{2633} \x{2634} \x{2635} \x{2636} \x{2637} \x{2638} \x{2639} \x{263A} \x{263B} \x{263C} \x{263D} \x{263E} \x{263F}"
+          text run at (351,305) width 1: " "
+          text run at (0,326) width 352: "U+264x \x{2640} \x{2641} \x{2642} \x{2643} \x{2644} \x{2645} \x{2646} \x{2647} \x{2648} \x{2649} \x{264A} \x{264B} \x{264C} \x{264D} \x{264E} \x{264F}"
+          text run at (351,326) width 1: " "
+          text run at (0,348) width 380: "U+265x \x{2650} \x{2651} \x{2652} \x{2653} \x{2654} \x{2655} \x{2656} \x{2657} \x{2658} \x{2659} \x{265A} \x{265B} \x{265C} \x{265D} \x{265E} \x{265F}"
+          text run at (379,348) width 1: " "
+          text run at (0,367) width 375: "U+266x \x{2660} \x{2661} \x{2662} \x{2663} \x{2664} \x{2665} \x{2666} \x{2667} \x{2668} \x{2669} \x{266A} \x{266B} \x{266C} \x{266D} \x{266E} \x{266F}"
+          text run at (374,367) width 1: " "
+          text run at (0,389) width 365: "U+267x \x{2670} \x{2671} \x{2672} \x{2673} \x{2674} \x{2675} \x{2676} \x{2677} \x{2678} \x{2679} \x{267A} \x{267B} \x{267C} \x{267D} \x{267E} \x{267F}"
+          text run at (364,389) width 1: " "
+          text run at (0,407) width 311: "U+268x \x{2680} \x{2681} \x{2682} \x{2683} \x{2684} \x{2685} \x{2686} \x{2687} \x{2688} \x{2689} \x{268A} \x{268B} \x{268C} \x{268D} \x{268E} \x{268F}"
+          text run at (311,407) width 0: " "
+          text run at (0,427) width 302: "U+269x \x{2690} \x{2691} \x{2692} \x{2693} \x{2694} \x{2695} \x{2696} \x{2697} \x{2698} \x{2699} \x{269A} \x{269B} \x{269C} \x{269D} \x{269E} \x{269F}"
+          text run at (301,427) width 1: " "
+          text run at (0,448) width 354: "U+26Ax \x{26A0} \x{26A1} \x{26A2} \x{26A3} \x{26A4} \x{26A5} \x{26A6} \x{26A7} \x{26A8} \x{26A9} \x{26AA} \x{26AB} \x{26AC} \x{26AD} \x{26AE} \x{26AF}"
+          text run at (353,448) width 1: " "
+          text run at (0,470) width 307: "U+26Bx \x{26B0} \x{26B1} \x{26B2} \x{26B3} \x{26B4} \x{26B5} \x{26B6} \x{26B7} \x{26B8} \x{26B9} \x{26BA} \x{26BB} \x{26BC} \x{26BD} \x{26BE} \x{26BF}"
+          text run at (306,470) width 1: " "
+          text run at (0,492) width 313: "U+26Cx \x{26C0} \x{26C1} \x{26C2} \x{26C3} \x{26C4} \x{26C5} \x{26C6} \x{26C7} \x{26C8} \x{26C9} \x{26CA} \x{26CB} \x{26CC} \x{26CD} \x{26CE} \x{26CF}"
+          text run at (312,492) width 1: " "
+          text run at (0,513) width 302: "U+26Dx \x{26D0} \x{26D1} \x{26D2} \x{26D3} \x{26D4} \x{26D5} \x{26D6} \x{26D7} \x{26D8} \x{26D9} \x{26DA} \x{26DB} \x{26DC} \x{26DD} \x{26DE} \x{26DF}"
+          text run at (301,513) width 1: " "
+          text run at (0,534) width 303: "U+26Ex \x{26E0} \x{26E1} \x{26E2} \x{26E3} \x{26E4} \x{26E5} \x{26E6} \x{26E7} \x{26E8} \x{26E9} \x{26EA} \x{26EB} \x{26EC} \x{26ED} \x{26EE} \x{26EF}"
+          text run at (302,534) width 1: " "
+          text run at (0,556) width 323: "U+26Fx \x{26F0} \x{26F1} \x{26F2} \x{26F3} \x{26F4} \x{26F5} \x{26F6} \x{26F7} \x{26F8} \x{26F9} \x{26FA} \x{26FB} \x{26FC} \x{26FD} \x{26FE} \x{26FF}"
+          text run at (322,556) width 1: " "
+        LayoutText {#text} at (0,573) size 357x229
+          text run at (0,573) width 0: " "
+          text run at (0,592) width 351: "U+270x \x{2700} \x{2701} \x{2702} \x{2703} \x{2704} \x{2705} \x{2706} \x{2707} \x{2708} \x{2709} \x{270A} \x{270B} \x{270C} \x{270D} \x{270E} \x{270F}"
+          text run at (350,592) width 1: " "
+          text run at (0,609) width 326: "U+271x \x{2710} \x{2711} \x{2712} \x{2713} \x{2714} \x{2715} \x{2716} \x{2717} \x{2718} \x{2719} \x{271A} \x{271B} \x{271C} \x{271D} \x{271E} \x{271F}"
+          text run at (325,609) width 1: " "
+          text run at (0,628) width 338: "U+272x \x{2720} \x{2721} \x{2722} \x{2723} \x{2724} \x{2725} \x{2726} \x{2727} \x{2728} \x{2729} \x{272A} \x{272B} \x{272C} \x{272D} \x{272E} \x{272F}"
+          text run at (337,628) width 1: " "
+          text run at (0,645) width 330: "U+273x \x{2730} \x{2731} \x{2732} \x{2733} \x{2734} \x{2735} \x{2736} \x{2737} \x{2738} \x{2739} \x{273A} \x{273B} \x{273C} \x{273D} \x{273E} \x{273F}"
+          text run at (329,645) width 1: " "
+          text run at (0,664) width 337: "U+274x \x{2740} \x{2741} \x{2742} \x{2743} \x{2744} \x{2745} \x{2746} \x{2747} \x{2748} \x{2749} \x{274A} \x{274B} \x{274C} \x{274D} \x{274E} \x{274F}"
+          text run at (336,664) width 1: " "
+          text run at (0,685) width 310: "U+275x \x{2750} \x{2751} \x{2752} \x{2753} \x{2754} \x{2755} \x{2756} \x{2757} \x{2758} \x{2759} \x{275A} \x{275B} \x{275C} \x{275D} \x{275E} \x{275F}"
+          text run at (309,685) width 1: " "
+          text run at (0,702) width 283: "U+276x \x{2760} \x{2761} \x{2762} \x{2763} \x{2764} \x{2765} \x{2766} \x{2767} \x{2768} \x{2769} \x{276A} \x{276B} \x{276C} \x{276D} \x{276E} \x{276F}"
+          text run at (282,702) width 1: " "
+          text run at (0,717) width 300: "U+277x \x{2770} \x{2771} \x{2772} \x{2773} \x{2774} \x{2775} \x{2776} \x{2777} \x{2778} \x{2779} \x{277A} \x{277B} \x{277C} \x{277D} \x{277E} \x{277F}"
+          text run at (299,717) width 1: " "
+          text run at (0,732) width 336: "U+278x \x{2780} \x{2781} \x{2782} \x{2783} \x{2784} \x{2785} \x{2786} \x{2787} \x{2788} \x{2789} \x{278A} \x{278B} \x{278C} \x{278D} \x{278E} \x{278F}"
+          text run at (335,732) width 1: " "
+          text run at (0,751) width 354: "U+279x \x{2790} \x{2791} \x{2792} \x{2793} \x{2794} \x{2795} \x{2796} \x{2797} \x{2798} \x{2799} \x{279A} \x{279B} \x{279C} \x{279D} \x{279E} \x{279F}"
+          text run at (353,751) width 1: " "
+          text run at (0,768) width 346: "U+27Ax \x{27A0} \x{27A1} \x{27A2} \x{27A3} \x{27A4} \x{27A5} \x{27A6} \x{27A7} \x{27A8} \x{27A9} \x{27AA} \x{27AB} \x{27AC} \x{27AD} \x{27AE} \x{27AF}"
+          text run at (345,768) width 1: " "
+          text run at (0,787) width 357: "U+27Bx \x{27B0} \x{27B1} \x{27B2} \x{27B3} \x{27B4} \x{27B5} \x{27B6} \x{27B7} \x{27B8} \x{27B9} \x{27BA} \x{27BB} \x{27BC} \x{27BD} \x{27BE} \x{27BF}"
+          text run at (356,787) width 1: " "
+        LayoutText {#text} at (0,804) size 328x290
+          text run at (0,804) width 0: " "
+          text run at (0,819) width 328: "U+2A0x \x{2A00} \x{2A01} \x{2A02} \x{2A03} \x{2A04} \x{2A05} \x{2A06} \x{2A07} \x{2A08} \x{2A09} \x{2A0A} \x{2A0B} \x{2A0C} \x{2A0D} \x{2A0E} \x{2A0F}"
+          text run at (327,819) width 1: " "
+          text run at (0,837) width 291: "U+2A1x \x{2A10} \x{2A11} \x{2A12} \x{2A13} \x{2A14} \x{2A15} \x{2A16} \x{2A17} \x{2A18} \x{2A19} \x{2A1A} \x{2A1B} \x{2A1C} \x{2A1D} \x{2A1E} \x{2A1F}"
+          text run at (290,837) width 1: " "
+          text run at (0,855) width 293: "U+2A2x \x{2A20} \x{2A21} \x{2A22} \x{2A23} \x{2A24} \x{2A25} \x{2A26} \x{2A27} \x{2A28} \x{2A29} \x{2A2A} \x{2A2B} \x{2A2C} \x{2A2D} \x{2A2E} \x{2A2F}"
+          text run at (292,855) width 1: " "
+          text run at (0,871) width 312: "U+2A3x \x{2A30} \x{2A31} \x{2A32} \x{2A33} \x{2A34} \x{2A35} \x{2A36} \x{2A37} \x{2A38} \x{2A39} \x{2A3A} \x{2A3B} \x{2A3C} \x{2A3D} \x{2A3E} \x{2A3F}"
+          text run at (311,871) width 1: " "
+          text run at (0,887) width 287: "U+2A4x \x{2A40} \x{2A41} \x{2A42} \x{2A43} \x{2A44} \x{2A45} \x{2A46} \x{2A47} \x{2A48} \x{2A49} \x{2A4A} \x{2A4B} \x{2A4C} \x{2A4D} \x{2A4E} \x{2A4F}"
+          text run at (286,887) width 1: " "
+          text run at (0,903) width 311: "U+2A5x \x{2A50} \x{2A51} \x{2A52} \x{2A53} \x{2A54} \x{2A55} \x{2A56} \x{2A57} \x{2A58} \x{2A59} \x{2A5A} \x{2A5B} \x{2A5C} \x{2A5D} \x{2A5E} \x{2A5F}"
+          text run at (310,903) width 1: " "
+          text run at (0,919) width 290: "U+2A6x \x{2A60} \x{2A61} \x{2A62} \x{2A63} \x{2A64} \x{2A65} \x{2A66} \x{2A67} \x{2A68} \x{2A69} \x{2A6A} \x{2A6B} \x{2A6C} \x{2A6D} \x{2A6E} \x{2A6F}"
+          text run at (289,919) width 1: " "
+          text run at (0,935) width 310: "U+2A7x \x{2A70} \x{2A71} \x{2A72} \x{2A73} \x{2A74} \x{2A75} \x{2A76} \x{2A77} \x{2A78} \x{2A79} \x{2A7A} \x{2A7B} \x{2A7C} \x{2A7D} \x{2A7E} \x{2A7F}"
+          text run at (309,935) width 1: " "
+          text run at (0,951) width 286: "U+2A8x \x{2A80} \x{2A81} \x{2A82} \x{2A83} \x{2A84} \x{2A85} \x{2A86} \x{2A87} \x{2A88} \x{2A89} \x{2A8A} \x{2A8B} \x{2A8C} \x{2A8D} \x{2A8E} \x{2A8F}"
+          text run at (285,951) width 1: " "
+          text run at (0,967) width 285: "U+2A9x \x{2A90} \x{2A91} \x{2A92} \x{2A93} \x{2A94} \x{2A95} \x{2A96} \x{2A97} \x{2A98} \x{2A99} \x{2A9A} \x{2A9B} \x{2A9C} \x{2A9D} \x{2A9E} \x{2A9F}"
+          text run at (284,967) width 1: " "
+          text run at (0,983) width 301: "U+2AAx \x{2AA0} \x{2AA1} \x{2AA2} \x{2AA3} \x{2AA4} \x{2AA5} \x{2AA6} \x{2AA7} \x{2AA8} \x{2AA9} \x{2AAA} \x{2AAB} \x{2AAC} \x{2AAD} \x{2AAE} \x{2AAF}"
+          text run at (300,983) width 1: " "
+          text run at (0,999) width 295: "U+2ABx \x{2AB0} \x{2AB1} \x{2AB2} \x{2AB3} \x{2AB4} \x{2AB5} \x{2AB6} \x{2AB7} \x{2AB8} \x{2AB9} \x{2ABA} \x{2ABB} \x{2ABC} \x{2ABD} \x{2ABE} \x{2ABF}"
+          text run at (294,999) width 1: " "
+          text run at (0,1015) width 286: "U+2ACx \x{2AC0} \x{2AC1} \x{2AC2} \x{2AC3} \x{2AC4} \x{2AC5} \x{2AC6} \x{2AC7} \x{2AC8} \x{2AC9} \x{2ACA} \x{2ACB} \x{2ACC} \x{2ACD} \x{2ACE} \x{2ACF}"
+          text run at (285,1015) width 1: " "
+          text run at (0,1031) width 293: "U+2ADx \x{2AD0} \x{2AD1} \x{2AD2} \x{2AD3} \x{2AD4} \x{2AD5} \x{2AD6} \x{2AD7} \x{2AD8} \x{2AD9} \x{2ADA} \x{2ADB} \x{2ADC} \x{2ADD} \x{2ADE} \x{2ADF}"
+          text run at (292,1031) width 1: " "
+          text run at (0,1047) width 303: "U+2AEx \x{2AE0} \x{2AE1} \x{2AE2} \x{2AE3} \x{2AE4} \x{2AE5} \x{2AE6} \x{2AE7} \x{2AE8} \x{2AE9} \x{2AEA} \x{2AEB} \x{2AEC} \x{2AED} \x{2AEE} \x{2AEF}"
+          text run at (302,1047) width 1: " "
+          text run at (0,1063) width 270: "U+2AFx \x{2AF0} \x{2AF1} \x{2AF2} \x{2AF3} \x{2AF4} \x{2AF5} \x{2AF6} \x{2AF7} \x{2AF8} \x{2AF9} \x{2AFA} \x{2AFB} \x{2AFC} \x{2AFD} \x{2AFE} \x{2AFF}"
+          text run at (269,1063) width 1: " "
+          text run at (0,1079) width 63: "        "
+      LayoutBlockFlow {P} at (0,1168.44) size 769x36
         LayoutText {#text} at (0,0) size 764x36
           text run at (0,0) width 764: "A series of unicode symbols (Runic, General Punctuation, Miscellaneous Symbols, and Mathematical Symbols) should"
           text run at (0,18) width 108: "be shown above."
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mountainlion/fast/text/whitespace/pre-break-word-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mountainlion/fast/text/whitespace/pre-break-word-expected.png
index 336f04f..50f086d4 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-mountainlion/fast/text/whitespace/pre-break-word-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-mountainlion/fast/text/whitespace/pre-break-word-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-retina/fast/text/shaping/same-script-different-lang-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-retina/fast/text/shaping/same-script-different-lang-expected.txt
new file mode 100644
index 0000000..3aef65a8
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/mac-retina/fast/text/shaping/same-script-different-lang-expected.txt
@@ -0,0 +1,22 @@
+layer at (0,0) size 800x600
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x173
+  LayoutBlockFlow {HTML} at (0,0) size 800x173.44
+    LayoutBlockFlow {BODY} at (8,18.72) size 784x138.72
+      LayoutBlockFlow {H3} at (0,0) size 784x22
+        LayoutText {#text} at (0,0) size 759x22
+          text run at (0,0) width 759: "The glyph for JHA should look different for Nepali and Hindi, depending on the lang attribute."
+      LayoutBlockFlow {P} at (0,40.72) size 784x22
+        LayoutText {#text} at (0,1) size 91x21
+          text run at (0,1) width 91: "Hindi:JHA \x{91D}"
+      LayoutBlockFlow {P} at (0,78.72) size 784x22
+        LayoutText {#text} at (0,1) size 102x21
+          text run at (0,1) width 102: "Nepali:JHA \x{91D}"
+      LayoutBlockFlow {P} at (0,116.72) size 784x22
+        LayoutText {#text} at (0,1) size 87x21
+          text run at (0,1) width 87: "Nepali:JHA "
+        LayoutInline {SPAN} at (0,0) size 16x21
+          LayoutText {#text} at (86,1) size 16x21
+            text run at (86,1) width 16: "\x{91D}"
+        LayoutText {#text} at (101,1) size 353x21
+          text run at (101,1) width 353: " - \"ne\" in \"hi\" should look the same as above."
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text-autosizing/tables/css-table-single-cell-lots-of-text-expected.png b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text-autosizing/tables/css-table-single-cell-lots-of-text-expected.png
index b9d0d37..53439b3c 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text-autosizing/tables/css-table-single-cell-lots-of-text-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text-autosizing/tables/css-table-single-cell-lots-of-text-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text-autosizing/tables/fixed-table-single-cell-lots-of-text-expected.png b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text-autosizing/tables/fixed-table-single-cell-lots-of-text-expected.png
index 50ca07b0..a79e7e1 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text-autosizing/tables/fixed-table-single-cell-lots-of-text-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text-autosizing/tables/fixed-table-single-cell-lots-of-text-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text-autosizing/tables/nested-table-wrapping-expected.png b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text-autosizing/tables/nested-table-wrapping-expected.png
index 0eddb7a..a436a25 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text-autosizing/tables/nested-table-wrapping-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text-autosizing/tables/nested-table-wrapping-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text-autosizing/tables/nested-tables-expected.png b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text-autosizing/tables/nested-tables-expected.png
index 33f3d1ee..ed69cb4e 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text-autosizing/tables/nested-tables-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text-autosizing/tables/nested-tables-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text-autosizing/tables/single-cell-lots-of-text-expected.png b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text-autosizing/tables/single-cell-lots-of-text-expected.png
index 3ec5951..4edcb545 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text-autosizing/tables/single-cell-lots-of-text-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text-autosizing/tables/single-cell-lots-of-text-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text-autosizing/tables/single-percent-width-cell-lots-of-text-expected.png b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text-autosizing/tables/single-percent-width-cell-lots-of-text-expected.png
index 3ba4d866..98a6842 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text-autosizing/tables/single-percent-width-cell-lots-of-text-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text-autosizing/tables/single-percent-width-cell-lots-of-text-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text-autosizing/tables/table-cell-inflation-expected.png b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text-autosizing/tables/table-cell-inflation-expected.png
index a7938233..bf1df41 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text-autosizing/tables/table-cell-inflation-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text-autosizing/tables/table-cell-inflation-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text-autosizing/tables/table-for-layout-expected.png b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text-autosizing/tables/table-for-layout-expected.png
index a375e8c7..2d09623 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text-autosizing/tables/table-for-layout-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text-autosizing/tables/table-for-layout-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text-autosizing/tables/wide-percentage-width-expected.png b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text-autosizing/tables/wide-percentage-width-expected.png
index 3c563fd..35ccefd9 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text-autosizing/tables/wide-percentage-width-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text-autosizing/tables/wide-percentage-width-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text-autosizing/tables/wide-specified-width-expected.png b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text-autosizing/tables/wide-specified-width-expected.png
index 562c44a..0e912420 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text-autosizing/tables/wide-specified-width-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text-autosizing/tables/wide-specified-width-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/atsui-kerning-and-ligatures-expected.png b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/atsui-kerning-and-ligatures-expected.png
index 60c14df..5e95e42d 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/atsui-kerning-and-ligatures-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/atsui-kerning-and-ligatures-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/atsui-multiple-renderers-expected.png b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/atsui-multiple-renderers-expected.png
index b80dbfc..86c6c57 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/atsui-multiple-renderers-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/atsui-multiple-renderers-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/atsui-partial-selection-expected.png b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/atsui-partial-selection-expected.png
index 4f5dccf..847b48bc 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/atsui-partial-selection-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/atsui-partial-selection-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/atsui-pointtooffset-calls-cg-expected.png b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/atsui-pointtooffset-calls-cg-expected.png
index a1407da2..1cc2bdc 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/atsui-pointtooffset-calls-cg-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/atsui-pointtooffset-calls-cg-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/atsui-small-caps-punctuation-size-expected.png b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/atsui-small-caps-punctuation-size-expected.png
index d91c413..b1c53ed 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/atsui-small-caps-punctuation-size-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/atsui-small-caps-punctuation-size-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/basic/002-expected.png b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/basic/002-expected.png
index d05dc5b..a8736e8 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/basic/002-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/basic/002-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/basic/005-expected.png b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/basic/005-expected.png
index 63c53e3e..d3d35c7b 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/basic/005-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/basic/005-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/basic/011-expected.png b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/basic/011-expected.png
index 48fb83e..3e2ebd9 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/basic/011-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/basic/011-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/basic/012-expected.png b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/basic/012-expected.png
index 2716f25..3cdb2513 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/basic/012-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/basic/012-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/basic/013-expected.png b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/basic/013-expected.png
index e04b98c..0e769d7 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/basic/013-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/basic/013-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/basic/generic-family-changes-expected.png b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/basic/generic-family-changes-expected.png
index 4258da8f..9a28ac1 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/basic/generic-family-changes-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/basic/generic-family-changes-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/bidi-embedding-pop-and-push-same-expected.png b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/bidi-embedding-pop-and-push-same-expected.png
index 168ab262..98173dbd 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/bidi-embedding-pop-and-push-same-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/bidi-embedding-pop-and-push-same-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/bidi-img-alt-text-expected.png b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/bidi-img-alt-text-expected.png
index 07dffff..be04724 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/bidi-img-alt-text-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/bidi-img-alt-text-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/break-word-expected.png b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/break-word-expected.png
index 6d3b08a..4f8b6a676 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/break-word-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/break-word-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/capitalize-boundaries-expected.png b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/capitalize-boundaries-expected.png
index a5fe501..08ee84d3 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/capitalize-boundaries-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/capitalize-boundaries-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/capitalize-boundaries-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/capitalize-boundaries-expected.txt
index b9fc5602..5690dfe 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/capitalize-boundaries-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/capitalize-boundaries-expected.txt
@@ -10,12 +10,12 @@
           LayoutText {#text} at (351,0) size 56x18
             text run at (351,0) width 56: "Bugzilla"
         LayoutText {#text} at (406,0) size 757x72
-          text run at (406,0) width 328: ". Currently, the \"Browser rendering\" results are not"
+          text run at (406,0) width 327: ". Currently, the \"Browser rendering\" results are not"
           text run at (0,18) width 757: "expected to match the \"Correct output sample\" results. In fact, I do not entirely agree with all of the given test cases in"
           text run at (0,36) width 744: "terms of their expected results, nor do I think that the browser should yet be expected to match all of the cases in the"
           text run at (0,54) width 189: "different languages, but I am "
-          text run at (188,54) width 294: "(at least temporarily) adding the test anyway. "
-        LayoutBR {BR} at (481,68) size 1x0
+          text run at (188,54) width 293: "(at least temporarily) adding the test anyway. "
+        LayoutBR {BR} at (480,68) size 1x0
         LayoutBR {BR} at (0,72) size 0x18
       LayoutTable {TABLE} at (0,90) size 769x364
         LayoutBlockFlow {CAPTION} at (0,0) size 769x18
@@ -27,10 +27,10 @@
               LayoutText {#text} at (2,2) size 48x18
                 text run at (2,2) width 48: "generic"
             LayoutTableCell {TD} at (56,2) size 711x58 [border: (1px solid #EEEEEE)] [r=0 c=1 rs=1 cs=1]
-              LayoutText {#text} at (2,2) size 689x54
-                text run at (2,2) width 689: "lip\x{AD}smackin\x{AD}thirst\x{AD}quenchin\x{AD}acetastin\x{AD}motivatin\x{AD}good\x{AD}buzzin\x{AD}cool\x{AD}talkin\x{AD}high\x{AD}walkin\x{AD}fast\x{AD}livin\x{AD}ever\x{AD}givin\x{AD}cool\x{AD}fizzin\x{AD}lip\x{AD}" + hyphen string "-"
-                text run at (2,20) width 672: "smackin\x{AD}thirst\x{AD}quenchin\x{AD}acetastin\x{AD}motivatin\x{AD}good\x{AD}buzzin\x{AD}cool\x{AD}talkin\x{AD}high\x{AD}walkin\x{AD}fast\x{AD}livin\x{AD}ever\x{AD}givin\x{AD}cool\x{AD}fizzin\x{AD}lip\x{AD}" + hyphen string "-"
-                text run at (2,38) width 650: "smackin\x{AD}thirst\x{AD}quenchin\x{AD}acetastin\x{AD}motivatin\x{AD}good\x{AD}buzzin\x{AD}cool\x{AD}talkin\x{AD}high\x{AD}walkin\x{AD}fast\x{AD}livin\x{AD}ever\x{AD}givin\x{AD}cool\x{AD}fizzin"
+              LayoutText {#text} at (2,2) size 688x54
+                text run at (2,2) width 688: "lip\x{AD}smackin\x{AD}thirst\x{AD}quenchin\x{AD}acetastin\x{AD}motivatin\x{AD}good\x{AD}buzzin\x{AD}cool\x{AD}talkin\x{AD}high\x{AD}walkin\x{AD}fast\x{AD}livin\x{AD}ever\x{AD}givin\x{AD}cool\x{AD}fizzin\x{AD}lip\x{AD}" + hyphen string "-"
+                text run at (2,20) width 671: "smackin\x{AD}thirst\x{AD}quenchin\x{AD}acetastin\x{AD}motivatin\x{AD}good\x{AD}buzzin\x{AD}cool\x{AD}talkin\x{AD}high\x{AD}walkin\x{AD}fast\x{AD}livin\x{AD}ever\x{AD}givin\x{AD}cool\x{AD}fizzin\x{AD}lip\x{AD}" + hyphen string "-"
+                text run at (2,38) width 649: "smackin\x{AD}thirst\x{AD}quenchin\x{AD}acetastin\x{AD}motivatin\x{AD}good\x{AD}buzzin\x{AD}cool\x{AD}talkin\x{AD}high\x{AD}walkin\x{AD}fast\x{AD}livin\x{AD}ever\x{AD}givin\x{AD}cool\x{AD}fizzin"
           LayoutTableRow {TR} at (0,62) size 769x22
             LayoutTableCell {TH} at (2,62) size 52x22 [bgcolor=#F8F8F8] [border: (1px solid #EEEEEE)] [r=1 c=0 rs=1 cs=1]
               LayoutText {#text} at (18,2) size 16x18
@@ -72,8 +72,8 @@
               LayoutInline {SPAN} at (0,0) size 42x18
                 LayoutText {#text} at (192,40) size 42x18
                   text run at (192,40) width 42: "burger"
-              LayoutText {#text} at (233,40) size 120x18
-                text run at (233,40) width 120: " [house] ~six -big-"
+              LayoutText {#text} at (233,40) size 119x18
+                text run at (233,40) width 119: " [house] ~six -big-"
           LayoutTableRow {TR} at (0,173) size 769x22
             LayoutTableCell {TH} at (2,173) size 52x22 [bgcolor=#F8F8F8] [border: (1px solid #EEEEEE)] [r=4 c=0 rs=1 cs=1]
               LayoutText {#text} at (19,2) size 14x18
@@ -136,10 +136,10 @@
               LayoutText {#text} at (2,2) size 48x18
                 text run at (2,2) width 48: "generic"
             LayoutTableCell {TD} at (56,2) size 711x58 [border: (1px solid #EEEEEE)] [r=0 c=1 rs=1 cs=1]
-              LayoutText {#text} at (2,2) size 695x54
-                text run at (2,2) width 695: "Lip\x{AD}smackin\x{AD}thirst\x{AD}quenchin\x{AD}acetastin\x{AD}motivatin\x{AD}good\x{AD}buzzin\x{AD}cool\x{AD}talkin\x{AD}high\x{AD}walkin\x{AD}fast\x{AD}livin\x{AD}ever\x{AD}givin\x{AD}cool\x{AD}fizzin\x{AD}lip\x{AD}" + hyphen string "-"
-                text run at (2,20) width 672: "smackin\x{AD}thirst\x{AD}quenchin\x{AD}acetastin\x{AD}motivatin\x{AD}good\x{AD}buzzin\x{AD}cool\x{AD}talkin\x{AD}high\x{AD}walkin\x{AD}fast\x{AD}livin\x{AD}ever\x{AD}givin\x{AD}cool\x{AD}fizzin\x{AD}lip\x{AD}" + hyphen string "-"
-                text run at (2,38) width 650: "smackin\x{AD}thirst\x{AD}quenchin\x{AD}acetastin\x{AD}motivatin\x{AD}good\x{AD}buzzin\x{AD}cool\x{AD}talkin\x{AD}high\x{AD}walkin\x{AD}fast\x{AD}livin\x{AD}ever\x{AD}givin\x{AD}cool\x{AD}fizzin"
+              LayoutText {#text} at (2,2) size 693x54
+                text run at (2,2) width 693: "Lip\x{AD}smackin\x{AD}thirst\x{AD}quenchin\x{AD}acetastin\x{AD}motivatin\x{AD}good\x{AD}buzzin\x{AD}cool\x{AD}talkin\x{AD}high\x{AD}walkin\x{AD}fast\x{AD}livin\x{AD}ever\x{AD}givin\x{AD}cool\x{AD}fizzin\x{AD}lip\x{AD}" + hyphen string "-"
+                text run at (2,20) width 671: "smackin\x{AD}thirst\x{AD}quenchin\x{AD}acetastin\x{AD}motivatin\x{AD}good\x{AD}buzzin\x{AD}cool\x{AD}talkin\x{AD}high\x{AD}walkin\x{AD}fast\x{AD}livin\x{AD}ever\x{AD}givin\x{AD}cool\x{AD}fizzin\x{AD}lip\x{AD}" + hyphen string "-"
+                text run at (2,38) width 649: "smackin\x{AD}thirst\x{AD}quenchin\x{AD}acetastin\x{AD}motivatin\x{AD}good\x{AD}buzzin\x{AD}cool\x{AD}talkin\x{AD}high\x{AD}walkin\x{AD}fast\x{AD}livin\x{AD}ever\x{AD}givin\x{AD}cool\x{AD}fizzin"
           LayoutTableRow {TR} at (0,62) size 769x22
             LayoutTableCell {TH} at (2,62) size 52x22 [bgcolor=#F8F8F8] [border: (1px solid #EEEEEE)] [r=1 c=0 rs=1 cs=1]
               LayoutText {#text} at (18,2) size 16x18
@@ -159,14 +159,14 @@
               LayoutText {#text} at (18,2) size 16x18
                 text run at (18,2) width 16: "en"
             LayoutTableCell {TD} at (56,111) size 711x60 [border: (1px solid #EEEEEE)] [r=3 c=1 rs=1 cs=1]
-              LayoutText {#text} at (2,3) size 473x18
-                text run at (2,3) width 473: "'Cept Nut'in Safari\x{2019}s \x{2018}Sure\x{2019} Na\x{EF}ve R\x{E9}sum\x{E9}\x{2014}H\x{E1}\x{10D}ek Full\x{2010}time One-to-One"
-              LayoutBR {BR} at (474,17) size 1x0
-              LayoutText {#text} at (2,22) size 333x18
-                text run at (2,22) width 333: "\"Newcastle-upon-Tyne\" Washington\x{2011}on\x{2011}the\x{2011}Brazos"
-              LayoutBR {BR} at (334,36) size 1x0
-              LayoutText {#text} at (2,40) size 369x18
-                text run at (2,40) width 369: "Earthquake Earthworm Cheeseburger [House] ~Six -Big-"
+              LayoutText {#text} at (2,3) size 472x18
+                text run at (2,3) width 472: "'Cept Nut'in Safari\x{2019}s \x{2018}Sure\x{2019} Na\x{EF}ve R\x{E9}sum\x{E9}\x{2014}H\x{E1}\x{10D}ek Full\x{2010}time One-to-One"
+              LayoutBR {BR} at (473,17) size 1x0
+              LayoutText {#text} at (2,22) size 330x18
+                text run at (2,22) width 330: "\"Newcastle-upon-Tyne\" Washington\x{2011}on\x{2011}the\x{2011}Brazos"
+              LayoutBR {BR} at (331,36) size 1x0
+              LayoutText {#text} at (2,40) size 368x18
+                text run at (2,40) width 368: "Earthquake Earthworm Cheeseburger [House] ~Six -Big-"
           LayoutTableRow {TR} at (0,173) size 769x22
             LayoutTableCell {TH} at (2,173) size 52x22 [bgcolor=#F8F8F8] [border: (1px solid #EEEEEE)] [r=4 c=0 rs=1 cs=1]
               LayoutText {#text} at (19,2) size 14x18
@@ -179,11 +179,11 @@
               LayoutText {#text} at (20,2) size 12x18
                 text run at (20,2) width 12: "fr"
             LayoutTableCell {TD} at (56,197) size 711x26 [border: (1px solid #EEEEEE)] [r=5 c=1 rs=1 cs=1]
-              LayoutText {#text} at (2,6) size 229x18
-                text run at (2,6) width 229: "Quelqu'un l\x{2019}Amour t'Appelles\x{2011}Tu 3"
+              LayoutText {#text} at (2,6) size 228x18
+                text run at (2,6) width 228: "Quelqu'un l\x{2019}Amour t'Appelles\x{2011}Tu 3"
               LayoutInline {SUP} at (0,0) size 23x15
-                LayoutText {#text} at (230,2) size 23x15
-                  text run at (230,2) width 23: "eme"
+                LayoutText {#text} at (229,2) size 23x15
+                  text run at (229,2) width 23: "eme"
           LayoutTableRow {TR} at (0,225) size 769x23
             LayoutTableCell {TH} at (2,225) size 52x22 [bgcolor=#F8F8F8] [border: (1px solid #EEEEEE)] [r=6 c=0 rs=1 cs=1]
               LayoutText {#text} at (18,2) size 16x18
@@ -229,10 +229,10 @@
               LayoutText {#text} at (2,2) size 48x18
                 text run at (2,2) width 48: "generic"
             LayoutTableCell {TD} at (56,2) size 711x58 [border: (1px solid #EEEEEE)] [r=0 c=1 rs=1 cs=1]
-              LayoutText {#text} at (2,2) size 695x54
-                text run at (2,2) width 695: "Lip\x{AD}smackin\x{AD}thirst\x{AD}quenchin\x{AD}acetastin\x{AD}motivatin\x{AD}good\x{AD}buzzin\x{AD}cool\x{AD}talkin\x{AD}high\x{AD}walkin\x{AD}fast\x{AD}livin\x{AD}ever\x{AD}givin\x{AD}cool\x{AD}fizzin\x{AD}lip\x{AD}" + hyphen string "-"
-                text run at (2,20) width 672: "smackin\x{AD}thirst\x{AD}quenchin\x{AD}acetastin\x{AD}motivatin\x{AD}good\x{AD}buzzin\x{AD}cool\x{AD}talkin\x{AD}high\x{AD}walkin\x{AD}fast\x{AD}livin\x{AD}ever\x{AD}givin\x{AD}cool\x{AD}fizzin\x{AD}lip\x{AD}" + hyphen string "-"
-                text run at (2,38) width 650: "smackin\x{AD}thirst\x{AD}quenchin\x{AD}acetastin\x{AD}motivatin\x{AD}good\x{AD}buzzin\x{AD}cool\x{AD}talkin\x{AD}high\x{AD}walkin\x{AD}fast\x{AD}livin\x{AD}ever\x{AD}givin\x{AD}cool\x{AD}fizzin"
+              LayoutText {#text} at (2,2) size 693x54
+                text run at (2,2) width 693: "Lip\x{AD}smackin\x{AD}thirst\x{AD}quenchin\x{AD}acetastin\x{AD}motivatin\x{AD}good\x{AD}buzzin\x{AD}cool\x{AD}talkin\x{AD}high\x{AD}walkin\x{AD}fast\x{AD}livin\x{AD}ever\x{AD}givin\x{AD}cool\x{AD}fizzin\x{AD}lip\x{AD}" + hyphen string "-"
+                text run at (2,20) width 671: "smackin\x{AD}thirst\x{AD}quenchin\x{AD}acetastin\x{AD}motivatin\x{AD}good\x{AD}buzzin\x{AD}cool\x{AD}talkin\x{AD}high\x{AD}walkin\x{AD}fast\x{AD}livin\x{AD}ever\x{AD}givin\x{AD}cool\x{AD}fizzin\x{AD}lip\x{AD}" + hyphen string "-"
+                text run at (2,38) width 649: "smackin\x{AD}thirst\x{AD}quenchin\x{AD}acetastin\x{AD}motivatin\x{AD}good\x{AD}buzzin\x{AD}cool\x{AD}talkin\x{AD}high\x{AD}walkin\x{AD}fast\x{AD}livin\x{AD}ever\x{AD}givin\x{AD}cool\x{AD}fizzin"
           LayoutTableRow {TR} at (0,62) size 769x22
             LayoutTableCell {TH} at (2,62) size 52x22 [bgcolor=#F8F8F8] [border: (1px solid #EEEEEE)] [r=1 c=0 rs=1 cs=1]
               LayoutText {#text} at (18,2) size 16x18
@@ -255,9 +255,9 @@
               LayoutText {#text} at (2,3) size 481x18
                 text run at (2,3) width 481: "'Cept Nut'in Safari\x{2019}s \x{2018}Sure\x{2019} Nai\x{308}ve R\x{E9}sum\x{E9}\x{2014}H\x{E1}c\x{30C}ek Full\x{2010}Time One-To-One"
               LayoutBR {BR} at (482,17) size 1x0
-              LayoutText {#text} at (2,22) size 345x18
-                text run at (2,22) width 345: "\"Newcastle\x{2011}Upon\x{2011}Tyne\" Washington\x{2011}On\x{2011}The\x{2011}Brazos"
-              LayoutBR {BR} at (346,36) size 1x0
+              LayoutText {#text} at (2,22) size 342x18
+                text run at (2,22) width 342: "\"Newcastle\x{2011}Upon\x{2011}Tyne\" Washington\x{2011}On\x{2011}The\x{2011}Brazos"
+              LayoutBR {BR} at (343,36) size 1x0
               LayoutInline {SPAN} at (0,0) size 35x18
                 LayoutText {#text} at (2,40) size 35x18
                   text run at (2,40) width 35: "Earth"
@@ -274,8 +274,8 @@
               LayoutInline {SPAN} at (0,0) size 42x18
                 LayoutText {#text} at (201,40) size 42x18
                   text run at (201,40) width 42: "burger"
-              LayoutText {#text} at (242,40) size 129x18
-                text run at (242,40) width 129: " [House] ~Six -Big-"
+              LayoutText {#text} at (242,40) size 128x18
+                text run at (242,40) width 128: " [House] ~Six -Big-"
           LayoutTableRow {TR} at (0,173) size 769x22
             LayoutTableCell {TH} at (2,173) size 52x22 [bgcolor=#F8F8F8] [border: (1px solid #EEEEEE)] [r=4 c=0 rs=1 cs=1]
               LayoutText {#text} at (19,2) size 14x18
@@ -288,18 +288,18 @@
               LayoutText {#text} at (20,2) size 12x18
                 text run at (20,2) width 12: "fr"
             LayoutTableCell {TD} at (56,197) size 711x26 [border: (1px solid #EEEEEE)] [r=5 c=1 rs=1 cs=1]
-              LayoutText {#text} at (2,6) size 231x18
-                text run at (2,6) width 231: "Quelqu'un L\x{2019}amour T'appelles\x{2011}Tu 3"
-              LayoutInline {SUP} at (0,0) size 23x15
-                LayoutText {#text} at (232,2) size 23x15
-                  text run at (232,2) width 23: "eme"
+              LayoutText {#text} at (2,6) size 228x18
+                text run at (2,6) width 228: "Quelqu'un L\x{2019}amour T'appelles\x{2011}Tu 3"
+              LayoutInline {SUP} at (0,0) size 24x15
+                LayoutText {#text} at (229,2) size 24x15
+                  text run at (229,2) width 24: "eme"
           LayoutTableRow {TR} at (0,225) size 769x23
             LayoutTableCell {TH} at (2,225) size 52x22 [bgcolor=#F8F8F8] [border: (1px solid #EEEEEE)] [r=6 c=0 rs=1 cs=1]
               LayoutText {#text} at (18,2) size 16x18
                 text run at (18,2) width 16: "hu"
             LayoutTableCell {TD} at (56,225) size 711x23 [border: (1px solid #EEEEEE)] [r=6 c=1 rs=1 cs=1]
-              LayoutText {#text} at (2,3) size 121x18
-                text run at (2,3) width 121: "11-Ei London\x{2011}Ban"
+              LayoutText {#text} at (2,3) size 120x18
+                text run at (2,3) width 120: "11-Ei London\x{2011}Ban"
           LayoutTableRow {TR} at (0,250) size 769x22
             LayoutTableCell {TH} at (2,250) size 52x22 [bgcolor=#F8F8F8] [border: (1px solid #EEEEEE)] [r=7 c=0 rs=1 cs=1]
               LayoutText {#text} at (19,2) size 14x18
@@ -319,12 +319,12 @@
               LayoutText {#text} at (19,2) size 14x18
                 text run at (19,2) width 14: "ru"
             LayoutTableCell {TD} at (56,298) size 711x22 [border: (1px solid #EEEEEE)] [r=9 c=1 rs=1 cs=1]
-              LayoutText {#text} at (2,2) size 208x18
-                text run at (2,2) width 208: "\x{41D}\x{44C}\x{44E}-\x{419}\x{43E}\x{440}\x{43A} 1990-\x{425} 14-Vii-1789"
+              LayoutText {#text} at (2,2) size 207x18
+                text run at (2,2) width 207: "\x{41D}\x{44C}\x{44E}-\x{419}\x{43E}\x{440}\x{43A} 1990-\x{425} 14-Vii-1789"
           LayoutTableRow {TR} at (0,322) size 769x22
             LayoutTableCell {TH} at (2,322) size 52x22 [bgcolor=#F8F8F8] [border: (1px solid #EEEEEE)] [r=10 c=0 rs=1 cs=1]
               LayoutText {#text} at (17,2) size 18x18
                 text run at (17,2) width 18: "tlh"
             LayoutTableCell {TD} at (56,322) size 711x22 [border: (1px solid #EEEEEE)] [r=10 c=1 rs=1 cs=1]
-              LayoutText {#text} at (2,2) size 207x18
-                text run at (2,2) width 207: "TlhIngan Hol Wa''Uy' Loghqam"
+              LayoutText {#text} at (2,2) size 206x18
+                text run at (2,2) width 206: "TlhIngan Hol Wa''Uy' Loghqam"
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/capitalize-empty-generated-string-expected.png b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/capitalize-empty-generated-string-expected.png
index 5ef3a6c..d130c3f 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/capitalize-empty-generated-string-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/capitalize-empty-generated-string-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/capitalize-preserve-nbsp-expected.png b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/capitalize-preserve-nbsp-expected.png
index b18599e..a63b515 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/capitalize-preserve-nbsp-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/capitalize-preserve-nbsp-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/caps-lock-indicator-disabled-expected.png b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/caps-lock-indicator-disabled-expected.png
index 4bc2246..28205f75 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/caps-lock-indicator-disabled-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/caps-lock-indicator-disabled-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/caps-lock-indicator-enabled-expected.png b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/caps-lock-indicator-enabled-expected.png
index 6a7ef2c..58170296 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/caps-lock-indicator-enabled-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/caps-lock-indicator-enabled-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/cg-fallback-bolding-expected.png b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/cg-fallback-bolding-expected.png
index e765378..c19bf71 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/cg-fallback-bolding-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/cg-fallback-bolding-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/complex-text-rtl-selection-repaint-expected.png b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/complex-text-rtl-selection-repaint-expected.png
index e72d86b..e071f16 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/complex-text-rtl-selection-repaint-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/complex-text-rtl-selection-repaint-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/delete-hard-break-character-expected.png b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/delete-hard-break-character-expected.png
index f4eb4382..ba7dc875 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/delete-hard-break-character-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/delete-hard-break-character-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/drawBidiText-expected.png b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/drawBidiText-expected.png
index 58a7d57..9de3dea 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/drawBidiText-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/drawBidiText-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/emphasis-ellipsis-complextext-expected.png b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/emphasis-ellipsis-complextext-expected.png
index 3ff3f7df..bf03c0c 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/emphasis-ellipsis-complextext-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/emphasis-ellipsis-complextext-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/emphasis-expected.png b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/emphasis-expected.png
index c32a627e..7f7811e 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/emphasis-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/emphasis-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/fake-italic-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/fake-italic-expected.txt
new file mode 100644
index 0000000..979a0ab
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/fake-italic-expected.txt
@@ -0,0 +1,13 @@
+layer at (0,0) size 800x600
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  LayoutBlockFlow {HTML} at (0,0) size 800x600
+    LayoutBlockFlow {BODY} at (8,8) size 784x576
+      LayoutBlockFlow {P} at (0,0) size 784x54
+        LayoutText {#text} at (0,0) size 778x54
+          text run at (0,0) width 759: "This layout test is designed to test that our fake italic mode is working correctly. The Ahem font, used below, does not"
+          text run at (0,18) width 778: "include an italic variant. Thus, when we ask for italic Ahem, we should skew the glyphs ourselves, resulting in a series of"
+          text run at (0,36) width 160: "italic black boxes below."
+      LayoutBlockFlow {P} at (0,70) size 784x16
+        LayoutText {#text} at (0,0) size 112x16
+          text run at (0,0) width 112: "A A A A"
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/fallback-for-custom-font-expected.png b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/fallback-for-custom-font-expected.png
index a7896d42..db35960 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/fallback-for-custom-font-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/fallback-for-custom-font-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/fallback-traits-fixup-expected.png b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/fallback-traits-fixup-expected.png
index a102082..941f48a 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/fallback-traits-fixup-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/fallback-traits-fixup-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/fallback-traits-fixup-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/fallback-traits-fixup-expected.txt
index 6cd805bfb..1f45fd26a 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/fallback-traits-fixup-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/fallback-traits-fixup-expected.txt
@@ -4,17 +4,17 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x600
     LayoutBlockFlow {BODY} at (8,8) size 784x576
       LayoutBlockFlow {P} at (0,0) size 784x18
-        LayoutText {#text} at (0,0) size 55x18
-          text run at (0,0) width 55: "Test for "
-        LayoutInline {I} at (0,0) size 515x18
-          LayoutInline {A} at (0,0) size 157x18 [color=#0000EE]
-            LayoutText {#text} at (54,0) size 157x18
-              text run at (54,0) width 157: "rdar://problem/9528843"
-          LayoutText {#text} at (210,0) size 359x18
-            text run at (210,0) width 5: " "
-            text run at (214,0) width 355: "STIX glyphs not rendered on this stackoverflow answer"
-        LayoutText {#text} at (568,0) size 5x18
-          text run at (568,0) width 5: "."
+        LayoutText {#text} at (0,0) size 54x18
+          text run at (0,0) width 54: "Test for "
+        LayoutInline {I} at (0,0) size 512x18
+          LayoutInline {A} at (0,0) size 156x18 [color=#0000EE]
+            LayoutText {#text} at (53,0) size 156x18
+              text run at (53,0) width 156: "rdar://problem/9528843"
+          LayoutText {#text} at (208,0) size 357x18
+            text run at (208,0) width 5: " "
+            text run at (212,0) width 353: "STIX glyphs not rendered on this stackoverflow answer"
+        LayoutText {#text} at (564,0) size 5x18
+          text run at (564,0) width 5: "."
       LayoutBlockFlow {P} at (0,34) size 784x39
         LayoutText {#text} at (0,15) size 99x18
           text run at (0,15) width 99: "A black circle: "
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/firstline/002-expected.png b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/firstline/002-expected.png
index 65968668..16bd125 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/firstline/002-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/firstline/002-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/font-initial-expected.png b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/font-initial-expected.png
index b2f1849b..c423d3c4 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/font-initial-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/font-initial-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/font-smallcaps-layout-expected.png b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/font-smallcaps-layout-expected.png
index 725ce784..640a05fc 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/font-smallcaps-layout-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/font-smallcaps-layout-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/font-stretch-expected.png b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/font-stretch-expected.png
index 6cf6522..2bbe683 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/font-stretch-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/font-stretch-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/font-stretch-variant-expected.png b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/font-stretch-variant-expected.png
index 479857a..8f7dbfb 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/font-stretch-variant-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/font-stretch-variant-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/font-weight-expected.png b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/font-weight-expected.png
index a6051b3..8fe87dc 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/font-weight-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/font-weight-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/font-weight-variant-expected.png b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/font-weight-variant-expected.png
index 60129c7..e483857 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/font-weight-variant-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/font-weight-variant-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/format-control-expected.png b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/format-control-expected.png
index d71428a..083aa61 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/format-control-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/format-control-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/format-control-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/format-control-expected.txt
new file mode 100644
index 0000000..bc7f4485
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/format-control-expected.txt
@@ -0,0 +1,28 @@
+layer at (0,0) size 800x600
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  LayoutBlockFlow {HTML} at (0,0) size 800x600
+    LayoutBlockFlow {BODY} at (8,8) size 784x552
+      LayoutBlockFlow (anonymous) at (0,0) size 784x18
+        LayoutText {#text} at (0,0) size 485x18
+          text run at (0,0) width 485: "This tests the ZWJ and ZWNJ format control characters on basic Latin text."
+      LayoutBlockFlow {DIV} at (0,58) size 784x218
+        LayoutBlockFlow {P} at (0,0) size 784x46
+          LayoutText {#text} at (0,0) size 279x46
+            text run at (0,0) width 279: "fi fl ff ffi ffl fl f   i"
+        LayoutBlockFlow {P} at (0,86) size 784x46
+          LayoutText {#text} at (0,0) size 290x46
+            text run at (0,0) width 290: "f\x{200C}i f\x{200C}l f\x{200C}f f\x{200C}f\x{200C}i f\x{200C}f\x{200C}l f\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}l f\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C} \x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C} \x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C} \x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}i"
+        LayoutBlockFlow {P} at (0,172) size 784x46
+          LayoutText {#text} at (0,0) size 286x46
+            text run at (0,0) width 286: "f\x{200D}i f\x{200D}l f\x{200D}f f\x{200D}f\x{200D}i f\x{200D}f\x{200D}l f\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}l f\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D} \x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D} \x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D} \x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}i"
+      LayoutBlockFlow {DIV} at (0,316) size 784x221
+        LayoutBlockFlow {P} at (0,0) size 784x47
+          LayoutText {#text} at (0,1) size 288x45
+            text run at (0,1) width 288: "fi fl ff ffi ffl fl f   i"
+        LayoutBlockFlow {P} at (0,87) size 784x47
+          LayoutText {#text} at (0,1) size 288x45
+            text run at (0,1) width 288: "f\x{200C}i f\x{200C}l f\x{200C}f f\x{200C}f\x{200C}i f\x{200C}f\x{200C}l f\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}l f\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C} \x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C} \x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C} \x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}i"
+        LayoutBlockFlow {P} at (0,174) size 784x47
+          LayoutText {#text} at (0,1) size 288x45
+            text run at (0,1) width 288: "f\x{200D}i f\x{200D}l f\x{200D}f f\x{200D}f\x{200D}i f\x{200D}f\x{200D}l f\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}l f\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D} \x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D} \x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D} \x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}i"
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/in-rendered-text-rtl-expected.png b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/in-rendered-text-rtl-expected.png
index b7f9832f..3a8b3c5 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/in-rendered-text-rtl-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/in-rendered-text-rtl-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/international/bidi-AN-after-empty-run-expected.png b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/international/bidi-AN-after-empty-run-expected.png
index 818dd45..14b9294 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/international/bidi-AN-after-empty-run-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/international/bidi-AN-after-empty-run-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/international/bidi-LDB-2-CSS-expected.png b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/international/bidi-LDB-2-CSS-expected.png
index 2c77c338..985c984 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/international/bidi-LDB-2-CSS-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/international/bidi-LDB-2-CSS-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/international/bidi-LDB-2-HTML-expected.png b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/international/bidi-LDB-2-HTML-expected.png
index f5b8eb8d2..23a8ffd 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/international/bidi-LDB-2-HTML-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/international/bidi-LDB-2-HTML-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/international/bidi-LDB-2-formatting-characters-expected.png b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/international/bidi-LDB-2-formatting-characters-expected.png
index c8e7617..c4c9bb7f 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/international/bidi-LDB-2-formatting-characters-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/international/bidi-LDB-2-formatting-characters-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/international/bidi-european-terminators-expected.png b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/international/bidi-european-terminators-expected.png
index cebe401a..331fe77c 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/international/bidi-european-terminators-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/international/bidi-european-terminators-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/international/bidi-ignored-for-first-child-inline-expected.png b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/international/bidi-ignored-for-first-child-inline-expected.png
index bb11381..a63d816 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/international/bidi-ignored-for-first-child-inline-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/international/bidi-ignored-for-first-child-inline-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/international/bidi-innertext-expected.png b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/international/bidi-innertext-expected.png
index 696e33e3..c4b8df1 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/international/bidi-innertext-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/international/bidi-innertext-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/international/bidi-listbox-atsui-expected.png b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/international/bidi-listbox-atsui-expected.png
index 6201198..b9c2303 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/international/bidi-listbox-atsui-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/international/bidi-listbox-atsui-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/international/bidi-neutral-directionality-paragraph-start-expected.png b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/international/bidi-neutral-directionality-paragraph-start-expected.png
index 6a7639c..140e555 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/international/bidi-neutral-directionality-paragraph-start-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/international/bidi-neutral-directionality-paragraph-start-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/international/bidi-neutral-directionality-paragraph-start-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/international/bidi-neutral-directionality-paragraph-start-expected.txt
index 009d717..a7252484 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/international/bidi-neutral-directionality-paragraph-start-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/international/bidi-neutral-directionality-paragraph-start-expected.txt
@@ -4,22 +4,22 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x600
     LayoutBlockFlow {BODY} at (8,8) size 784x576
       LayoutBlockFlow {P} at (0,0) size 784x18
-        LayoutText {#text} at (0,0) size 581x18
-          text run at (0,0) width 581: "Mitz Pettel contributed this fix to KDE, and now we're rolling it in. Here's his explanation:"
+        LayoutText {#text} at (0,0) size 580x18
+          text run at (0,0) width 580: "Mitz Pettel contributed this fix to KDE, and now we're rolling it in. Here's his explanation:"
       LayoutBlockFlow {P} at (0,34) size 784x72
-        LayoutText {#text} at (0,0) size 774x72
+        LayoutText {#text} at (0,0) size 773x72
           text run at (0,0) width 772: "The directionality of a neutral character at the beginning of a paragraph (or after a hard line break) is decided incorrectly"
-          text run at (0,18) width 774: "if the first non-neutral character in the paragraph has directionality opposite to the paragraph directionality. For example,"
-          text run at (0,36) width 754: "if the paragraph direction is LTR, the first character on the paragraph is a question mark and the next one is a Hebrew"
-          text run at (0,54) width 725: "character, then the question mark will is considered right-to-left and appears to the right of the Hebrew character."
+          text run at (0,18) width 773: "if the first non-neutral character in the paragraph has directionality opposite to the paragraph directionality. For example,"
+          text run at (0,36) width 751: "if the paragraph direction is LTR, the first character on the paragraph is a question mark and the next one is a Hebrew"
+          text run at (0,54) width 724: "character, then the question mark will is considered right-to-left and appears to the right of the Hebrew character."
       LayoutBlockFlow {P} at (0,122) size 784x36
         LayoutText {#text} at (0,0) size 517x18
           text run at (0,0) width 517: "The rule to follow is 3.3.4.N2 in the Unicode Standard's Bidirectional Algorithm"
-        LayoutInline {A} at (0,0) size 405x18 [color=#0000EE]
-          LayoutText {#text} at (0,18) size 405x18
-            text run at (0,18) width 405: "http://www.unicode.org/reports/tr9/#Resolving_Neutral_Types"
-        LayoutText {#text} at (404,18) size 5x18
-          text run at (404,18) width 5: "."
+        LayoutInline {A} at (0,0) size 402x18 [color=#0000EE]
+          LayoutText {#text} at (0,18) size 402x18
+            text run at (0,18) width 402: "http://www.unicode.org/reports/tr9/#Resolving_Neutral_Types"
+        LayoutText {#text} at (401,18) size 5x18
+          text run at (401,18) width 5: "."
       LayoutBlockFlow {P} at (0,174) size 784x18
         LayoutText {#text} at (0,0) size 692x18
           text run at (0,0) width 692: "If the test is successful, the question marks should be on the far left and far right of the next two paragraphs."
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/international/bidi-neutral-run-expected.png b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/international/bidi-neutral-run-expected.png
index f8de764..43ad25857 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/international/bidi-neutral-run-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/international/bidi-neutral-run-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/international/bidi-override-expected.png b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/international/bidi-override-expected.png
index 63bc80bbc..85327d00 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/international/bidi-override-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/international/bidi-override-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/international/bold-bengali-expected.png b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/international/bold-bengali-expected.png
index 87f14519..4f60fe4 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/international/bold-bengali-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/international/bold-bengali-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/international/bold-bengali-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/international/bold-bengali-expected.txt
index e3b6431..7c0452b8 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/international/bold-bengali-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/international/bold-bengali-expected.txt
@@ -4,14 +4,14 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x600
     LayoutBlockFlow {BODY} at (8,8) size 784x576
       LayoutBlockFlow {P} at (0,0) size 784x36
-        LayoutText {#text} at (0,0) size 757x36
-          text run at (0,0) width 353: "This test verifies we can render bold Bengali properly. "
-          text run at (352,0) width 405: "(This is complicated on Linux because it's typically covered by"
+        LayoutText {#text} at (0,0) size 755x36
+          text run at (0,0) width 351: "This test verifies we can render bold Bengali properly. "
+          text run at (350,0) width 405: "(This is complicated on Linux because it's typically covered by"
           text run at (0,18) width 473: "fake-bolded FreeSans even though there's also a FreeSansBold available.)"
       LayoutBlockFlow {P} at (0,52) size 784x18
-        LayoutText {#text} at (0,0) size 752x18
-          text run at (0,0) width 488: "The test passes if the two words below look similar, but the top one is bold. "
-          text run at (487,0) width 265: "There should be no missing-glyph boxes."
+        LayoutText {#text} at (0,0) size 751x18
+          text run at (0,0) width 487: "The test passes if the two words below look similar, but the top one is bold. "
+          text run at (486,0) width 265: "There should be no missing-glyph boxes."
       LayoutBlockFlow {P} at (0,86) size 784x18
         LayoutInline {B} at (0,0) size 63x18
           LayoutText {#text} at (0,0) size 63x18
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/international/complex-character-based-fallback-expected.png b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/international/complex-character-based-fallback-expected.png
index fe62b05..8ee21bf 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/international/complex-character-based-fallback-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/international/complex-character-based-fallback-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/international/danda-space-expected.png b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/international/danda-space-expected.png
index 06ee921e..3e43e1f 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/international/danda-space-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/international/danda-space-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/international/hebrew-vowels-expected.png b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/international/hebrew-vowels-expected.png
index eb32420ad2..ffcd775 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/international/hebrew-vowels-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/international/hebrew-vowels-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/international/khmer-selection-expected.png b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/international/khmer-selection-expected.png
index 8b06180b..2bb6d468 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/international/khmer-selection-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/international/khmer-selection-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/international/khmer-selection-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/international/khmer-selection-expected.txt
index d432399..e4e344a 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/international/khmer-selection-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/international/khmer-selection-expected.txt
@@ -36,8 +36,8 @@
         LayoutInline {TT} at (0,0) size 87x15
           LayoutText {#text} at (177,20) size 87x15
             text run at (177,20) width 87: "eventSender"
-        LayoutText {#text} at (263,18) size 447x18
-          text run at (263,18) width 447: " to select the text. You should see some of the above text selected and"
+        LayoutText {#text} at (263,18) size 446x18
+          text run at (263,18) width 446: " to select the text. You should see some of the above text selected and"
         LayoutInline {TT} at (0,0) size 78x15
           LayoutText {#text} at (0,38) size 78x15
             text run at (0,38) width 78: "test_shell"
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/international/lang-glyph-cache-separation-expected.png b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/international/lang-glyph-cache-separation-expected.png
index 6da87f6..6c62c83 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/international/lang-glyph-cache-separation-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/international/lang-glyph-cache-separation-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/international/plane2-expected.png b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/international/plane2-expected.png
index b2eea63f..40763c7 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/international/plane2-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/international/plane2-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/international/pop-up-button-text-alignment-and-direction-expected.png b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/international/pop-up-button-text-alignment-and-direction-expected.png
index 6b8d646..d6083a4 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/international/pop-up-button-text-alignment-and-direction-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/international/pop-up-button-text-alignment-and-direction-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/international/rtl-caret-expected.png b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/international/rtl-caret-expected.png
index afdb2979..7bfb431 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/international/rtl-caret-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/international/rtl-caret-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/international/rtl-negative-letter-spacing-expected.png b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/international/rtl-negative-letter-spacing-expected.png
index cd5909bd..b2e3c4b 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/international/rtl-negative-letter-spacing-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/international/rtl-negative-letter-spacing-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/international/rtl-white-space-pre-wrap-expected.png b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/international/rtl-white-space-pre-wrap-expected.png
index c564f025..f3686b6 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/international/rtl-white-space-pre-wrap-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/international/rtl-white-space-pre-wrap-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/international/text-spliced-font-expected.png b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/international/text-spliced-font-expected.png
index 0c69c276..54d2ce8 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/international/text-spliced-font-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/international/text-spliced-font-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/international/thai-baht-space-expected.png b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/international/thai-baht-space-expected.png
index 8f9ded8d..d609c728 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/international/thai-baht-space-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/international/thai-baht-space-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/international/thai-baht-space-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/international/thai-baht-space-expected.txt
index 519021e..02951e6 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/international/thai-baht-space-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/international/thai-baht-space-expected.txt
@@ -4,14 +4,14 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x600
     LayoutBlockFlow {BODY} at (8,8) size 784x576
       LayoutBlockFlow (anonymous) at (0,0) size 784x36
-        LayoutText {#text} at (0,0) size 55x18
-          text run at (0,0) width 55: "Test for "
+        LayoutText {#text} at (0,0) size 54x18
+          text run at (0,0) width 54: "Test for "
         LayoutInline {A} at (0,0) size 69x18 [color=#0000EE]
-          LayoutText {#text} at (54,0) size 69x18
-            text run at (54,0) width 69: "bug 25464"
-        LayoutText {#text} at (122,0) size 727x36
-          text run at (122,0) width 605: ". Characters belonging to 'Common' script followed / preceeded by a space should be rendered"
-          text run at (0,18) width 648: "correctly. Two lines below have 4 Thai currency signs (U+0E3F) and all of them should be rendered."
+          LayoutText {#text} at (53,0) size 69x18
+            text run at (53,0) width 69: "bug 25464"
+        LayoutText {#text} at (121,0) size 726x36
+          text run at (121,0) width 605: ". Characters belonging to 'Common' script followed / preceeded by a space should be rendered"
+          text run at (0,18) width 646: "correctly. Two lines below have 4 Thai currency signs (U+0E3F) and all of them should be rendered."
       LayoutBlockFlow {P} at (0,52) size 784x44
         LayoutText {#text} at (0,3) size 290x18
           text run at (0,3) width 290: "abc \x{E25}\x{E07}\x{E17}\x{E38}\x{E19}4000\x{E3F} \x{E23}\x{E31}\x{E1A}\x{E1B}\x{E23}\x{E30}\x{E01}\x{E31}\x{E19}\x{E23}\x{E32}\x{E22}\x{E44}\x{E14}\x{E49} 50000\x{E3F}/M"
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/international/thai-line-breaks-expected.png b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/international/thai-line-breaks-expected.png
index c689941..4ebe969 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/international/thai-line-breaks-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/international/thai-line-breaks-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/international/unicode-bidi-plaintext-expected.png b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/international/unicode-bidi-plaintext-expected.png
index f9a3f86..3958293a 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/international/unicode-bidi-plaintext-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/international/unicode-bidi-plaintext-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/international/unicode-bidi-plaintext-in-textarea-expected.png b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/international/unicode-bidi-plaintext-in-textarea-expected.png
index 98f0367..5285ecb 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/international/unicode-bidi-plaintext-in-textarea-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/international/unicode-bidi-plaintext-in-textarea-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/international/wrap-CJK-001-expected.png b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/international/wrap-CJK-001-expected.png
index 5095fff..ba4f54e5 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/international/wrap-CJK-001-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/international/wrap-CJK-001-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/justified-selection-at-edge-expected.png b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/justified-selection-at-edge-expected.png
index 6f693fdf..a58f793 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/justified-selection-at-edge-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/justified-selection-at-edge-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/justified-selection-expected.png b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/justified-selection-expected.png
index edaafa0..f895193 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/justified-selection-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/justified-selection-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/justify-ideograph-complex-expected.png b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/justify-ideograph-complex-expected.png
new file mode 100644
index 0000000..93fe2fb0
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/justify-ideograph-complex-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/line-initial-and-final-swashes-expected.png b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/line-initial-and-final-swashes-expected.png
index 884244d..c31388a0 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/line-initial-and-final-swashes-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/line-initial-and-final-swashes-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/midword-break-after-breakable-char-expected.png b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/midword-break-after-breakable-char-expected.png
index 4fe60b5..3712c01 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/midword-break-after-breakable-char-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/midword-break-after-breakable-char-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/midword-break-before-surrogate-pair-expected.png b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/midword-break-before-surrogate-pair-expected.png
index cc725b6..1394180 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/midword-break-before-surrogate-pair-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/midword-break-before-surrogate-pair-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/midword-break-before-surrogate-pair-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/midword-break-before-surrogate-pair-expected.txt
index 9b5f4529..5e97055 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/midword-break-before-surrogate-pair-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/midword-break-before-surrogate-pair-expected.txt
@@ -4,8 +4,8 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x600
     LayoutBlockFlow {BODY} at (8,8) size 784x584
       LayoutBlockFlow {P} at (0,0) size 784x36
-        LayoutText {#text} at (0,0) size 765x36
-          text run at (0,0) width 765: "The following box should break the sequence of symbols at the 5 character mark and not overflow the blue box. This is"
+        LayoutText {#text} at (0,0) size 764x36
+          text run at (0,0) width 764: "The following box should break the sequence of symbols at the 5 character mark and not overflow the blue box. This is"
           text run at (0,18) width 253: "because U+1D49 is a number category "
           text run at (252,18) width 298: "unicode character, for which break-all applies."
       LayoutBlockFlow {DIV} at (0,52) size 186x104 [border: (3px solid #0000FF)]
@@ -13,9 +13,9 @@
           text run at (3,3) width 173: "\x{D835}\x{DC9E}\x{D835}\x{DC9E}\x{D835}\x{DC9E}\x{D835}\x{DC9E}\x{D835}\x{DC9E}\x{D835}\x{DC9E}\x{D835}\x{DC9E}"
           text run at (3,52) width 74: "\x{D835}\x{DC9E}\x{D835}\x{DC9E}\x{D835}\x{DC9E}"
       LayoutBlockFlow {P} at (0,172) size 784x18
-        LayoutText {#text} at (0,0) size 779x18
+        LayoutText {#text} at (0,0) size 778x18
           text run at (0,0) width 539: "The following box should not break the sequence of symbols since U+1F1EF is not "
-          text run at (538,0) width 241: "a letter or number category character."
+          text run at (538,0) width 240: "a letter or number category character."
       LayoutBlockFlow {DIV} at (0,206) size 186x55 [border: (3px solid #0000FF)]
         LayoutText {#text} at (3,3) size 461x49
           text run at (3,3) width 461: "\x{D83C}\x{DDEF}\x{D83C}\x{DDF5}\x{D83C}\x{DDEF}\x{D83C}\x{DDF5}\x{D83C}\x{DDEF}\x{D83C}\x{DDF5}\x{D83C}\x{DDEF}\x{D83C}\x{DDF5}\x{D83C}\x{DDEF}\x{D83C}\x{DDF5}\x{D83C}\x{DDEF}\x{D83C}\x{DDF5}\x{D83C}\x{DDEF}\x{D83C}\x{DDF5}\x{D83C}\x{DDEF}\x{D83C}\x{DDF5}"
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/midword-break-hang-expected.png b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/midword-break-hang-expected.png
index 60f55962b..8aa20e6 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/midword-break-hang-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/midword-break-hang-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/monospace-width-cache-expected.png b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/monospace-width-cache-expected.png
index 070f5aa..05d5eb1 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/monospace-width-cache-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/monospace-width-cache-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/reset-emptyRun-expected.png b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/reset-emptyRun-expected.png
index ebd84ac..a7a0fc0 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/reset-emptyRun-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/reset-emptyRun-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/selection-hard-linebreak-expected.png b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/selection-hard-linebreak-expected.png
index ae31309d..f3717af 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/selection-hard-linebreak-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/selection-hard-linebreak-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/shadow-translucent-fill-expected.png b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/shadow-translucent-fill-expected.png
index 721828c..c750e984 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/shadow-translucent-fill-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/shadow-translucent-fill-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/shaping/shaping-selection-rect-expected.png b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/shaping/shaping-selection-rect-expected.png
index 742ac811..940f77a4 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/shaping/shaping-selection-rect-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/shaping/shaping-selection-rect-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/should-use-atsui-expected.png b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/should-use-atsui-expected.png
index 26b65db..b130380 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/should-use-atsui-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/should-use-atsui-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/small-caps-turkish-expected.png b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/small-caps-turkish-expected.png
index 0046fea..494f10c9 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/small-caps-turkish-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/small-caps-turkish-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/soft-hyphen-3-expected.png b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/soft-hyphen-3-expected.png
new file mode 100644
index 0000000..498d27ae
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/soft-hyphen-3-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/fast/text/soft-hyphen-3-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/soft-hyphen-3-expected.txt
similarity index 100%
copy from third_party/WebKit/LayoutTests/fast/text/soft-hyphen-3-expected.txt
copy to third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/soft-hyphen-3-expected.txt
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/text-letter-spacing-expected.png b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/text-letter-spacing-expected.png
index 8b657a23..06b2a8f 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/text-letter-spacing-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/text-letter-spacing-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/text-shadow-no-default-color-expected.png b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/text-shadow-no-default-color-expected.png
index 4fc81b8..07082d77 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/text-shadow-no-default-color-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/text-shadow-no-default-color-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/vertical-rl-rtl-linebreak-expected.png b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/vertical-rl-rtl-linebreak-expected.png
index 5b4478e..236d7d12 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/vertical-rl-rtl-linebreak-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/vertical-rl-rtl-linebreak-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/wbr-expected.png b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/wbr-expected.png
index b0d4530c..ef86cf8 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/wbr-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/wbr-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/wbr-in-pre-crash-expected.png b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/wbr-in-pre-crash-expected.png
index ab12cd67..532cb9e811 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/wbr-in-pre-crash-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/wbr-in-pre-crash-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/wbr-styled-expected.png b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/wbr-styled-expected.png
index 8257fc8..8ceccd8 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/wbr-styled-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/wbr-styled-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/whitespace/003-expected.png b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/whitespace/003-expected.png
index 52abcf6..4d623bd 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/whitespace/003-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/whitespace/003-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/whitespace/004-expected.png b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/whitespace/004-expected.png
index 5a97cfd..ce575a7 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/whitespace/004-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/whitespace/004-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/whitespace/005-expected.png b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/whitespace/005-expected.png
index 5a97cfd..ce575a7 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/whitespace/005-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/whitespace/005-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/whitespace/006-expected.png b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/whitespace/006-expected.png
index 957dff6..7756b53 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/whitespace/006-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/whitespace/006-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/whitespace/007-expected.png b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/whitespace/007-expected.png
index b466d662..09fad71 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/whitespace/007-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/whitespace/007-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/whitespace/008-expected.png b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/whitespace/008-expected.png
index b7ff431..95d6a90 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/whitespace/008-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/whitespace/008-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/whitespace/009-expected.png b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/whitespace/009-expected.png
index f95b6aa4..b6fa1e5f 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/whitespace/009-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/whitespace/009-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/whitespace/010-expected.png b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/whitespace/010-expected.png
index 5a97cfd..ce575a7 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/whitespace/010-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/whitespace/010-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/whitespace/011-expected.png b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/whitespace/011-expected.png
index 5a97cfd..ce575a7 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/whitespace/011-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/whitespace/011-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/whitespace/015-expected.png b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/whitespace/015-expected.png
index 5a97cfd..ce575a7 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/whitespace/015-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/whitespace/015-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/whitespace/016-expected.png b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/whitespace/016-expected.png
index 5a97cfd..ce575a7 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/whitespace/016-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/whitespace/016-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/whitespace/018-expected.png b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/whitespace/018-expected.png
index 1d7ac1a..1208e8a9 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/whitespace/018-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/whitespace/018-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/whitespace/020-expected.png b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/whitespace/020-expected.png
index cf7ef4da..6657192 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/whitespace/020-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/whitespace/020-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/whitespace/021-expected.png b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/whitespace/021-expected.png
index 5aab18a..8eb58c3 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/whitespace/021-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/whitespace/021-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/whitespace/024-expected.png b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/whitespace/024-expected.png
index 97ffcee..8b4434f 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/whitespace/024-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/whitespace/024-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/whitespace/027-expected.png b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/whitespace/027-expected.png
index ab5595b..1491bc9 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/whitespace/027-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/whitespace/027-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/whitespace/030-expected.png b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/whitespace/030-expected.png
index 4ca350c..d2d8ed5 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/whitespace/030-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/whitespace/030-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/whitespace/pre-break-word-expected.png b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/whitespace/pre-break-word-expected.png
index e8ead41..6437258 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/whitespace/pre-break-word-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/whitespace/pre-break-word-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/whitespace/pre-wrap-last-char-expected.png b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/whitespace/pre-wrap-last-char-expected.png
index a8617ab..860ff3cf 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/whitespace/pre-wrap-last-char-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/whitespace/pre-wrap-last-char-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/whitespace/pre-wrap-line-test-expected.png b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/whitespace/pre-wrap-line-test-expected.png
index 923c7d3..f422dac6 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/whitespace/pre-wrap-line-test-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/whitespace/pre-wrap-line-test-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/whitespace/pre-wrap-overflow-selection-expected.png b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/whitespace/pre-wrap-overflow-selection-expected.png
index 0679d4a..fbb2d59 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/whitespace/pre-wrap-overflow-selection-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/whitespace/pre-wrap-overflow-selection-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/whitespace/pre-wrap-spaces-after-newline-expected.png b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/whitespace/pre-wrap-spaces-after-newline-expected.png
index 8f8bf3f..734ca65 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/whitespace/pre-wrap-spaces-after-newline-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/whitespace/pre-wrap-spaces-after-newline-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/whitespace/span-in-word-space-causes-overflow-expected.png b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/whitespace/span-in-word-space-causes-overflow-expected.png
index ebe0003..5bf935d 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/whitespace/span-in-word-space-causes-overflow-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/whitespace/span-in-word-space-causes-overflow-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/wide-zero-width-space-expected.png b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/wide-zero-width-space-expected.png
index a3d67b2..ed3186f8 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/wide-zero-width-space-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/wide-zero-width-space-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/word-break-expected.png b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/word-break-expected.png
index 361e5c8..aad9dab 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/word-break-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/word-break-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/word-break-run-rounding-expected.png b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/word-break-run-rounding-expected.png
index 3c034ef0..89bb818 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/word-break-run-rounding-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/word-break-run-rounding-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/word-break-soft-hyphen-expected.png b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/word-break-soft-hyphen-expected.png
index 7ccf53ca..cc4f7e05 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/word-break-soft-hyphen-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/word-break-soft-hyphen-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/word-space-expected.png b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/word-space-expected.png
index 155ddf9..c18fa73 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/word-space-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/word-space-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/zero-font-size-expected.png b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/zero-font-size-expected.png
index e21076ae..1210a311 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/zero-font-size-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-snowleopard/fast/text/zero-font-size-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/css/h1-in-section-elements-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/css/h1-in-section-elements-expected.png
index 67ab376..dcb35ad9 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/css/h1-in-section-elements-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/css/h1-in-section-elements-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text-autosizing/display-type-change-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/text-autosizing/display-type-change-expected.png
index 3b5f645..aab4041 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text-autosizing/display-type-change-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text-autosizing/display-type-change-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text-autosizing/display-type-change-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/text-autosizing/display-type-change-expected.txt
index 0c945e28..dc654a25 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text-autosizing/display-type-change-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text-autosizing/display-type-change-expected.txt
@@ -5,13 +5,13 @@
     LayoutBlockFlow {BODY} at (0,0) size 800x810
       LayoutBlockFlow {SPAN} at (0,0) size 200x810
         LayoutBlockFlow {DIV} at (0,0) size 200x810
-          LayoutText {#text} at (0,-3) size 200x816
-            text run at (0,-3) width 200: "This test verifies"
+          LayoutText {#text} at (0,-3) size 199x816
+            text run at (0,-3) width 199: "This test verifies"
             text run at (0,27) width 140: "that display"
             text run at (0,57) width 97: "changes"
             text run at (0,87) width 102: "properly"
             text run at (0,117) width 163: "invalidate the"
-            text run at (0,147) width 169: "text autosizer."
+            text run at (0,147) width 167: "text autosizer."
             text run at (0,177) width 187: "This test passes"
             text run at (0,207) width 195: "if this text is not"
             text run at (0,237) width 144: "overlapping"
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text-autosizing/list-item-above-dbcat-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/text-autosizing/list-item-above-dbcat-expected.png
index 1aff92e0..ad9bfb6 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text-autosizing/list-item-above-dbcat-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text-autosizing/list-item-above-dbcat-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text-autosizing/list-item-above-dbcat-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/text-autosizing/list-item-above-dbcat-expected.txt
index 14cd408..62e6ceae 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text-autosizing/list-item-above-dbcat-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text-autosizing/list-item-above-dbcat-expected.txt
@@ -1,19 +1,18 @@
-layer at (0,0) size 800x600 scrollHeight 625
+layer at (0,0) size 800x600
   LayoutView at (0,0) size 800x600
-layer at (0,0) size 800x625 backgroundClip at (0,0) size 800x600 clip at (0,0) size 800x600
-  LayoutBlockFlow {HTML} at (0,0) size 800x625
-    LayoutBlockFlow {BODY} at (0,0) size 800x368
-      LayoutBlockFlow {DIV} at (0,0) size 800x368
-        LayoutText {#text} at (0,0) size 784x368
-          text run at (0,0) width 643: "This test verifies that FastTextAutosizer"
-          text run at (0,46) width 701: "considers a list item (LI) to be \"text\" for the"
-          text run at (0,92) width 661: "purpose of determining the deepest block"
-          text run at (0,138) width 784: "containing all text (DBCAT). If this were not the"
-          text run at (0,184) width 721: "case, the cluster's DBCAT would be the DIV"
-          text run at (0,230) width 719: "inside the LI, which hasn't entered layout yet"
-          text run at (0,276) width 730: "when the list marker is autosized (causing the"
-          text run at (0,322) width 304: "autosizer to crash)."
-      LayoutBlockFlow (floating) {UL} at (0,384) size 800x225
+layer at (0,0) size 800x579
+  LayoutBlockFlow {HTML} at (0,0) size 800x579
+    LayoutBlockFlow {BODY} at (0,0) size 800x322
+      LayoutBlockFlow {DIV} at (0,0) size 800x322
+        LayoutText {#text} at (0,0) size 799x322
+          text run at (0,0) width 799: "This test verifies that FastTextAutosizer considers"
+          text run at (0,46) width 720: "a list item (LI) to be \"text\" for the purpose of"
+          text run at (0,92) width 780: "determining the deepest block containing all text"
+          text run at (0,138) width 767: "(DBCAT). If this were not the case, the cluster's"
+          text run at (0,184) width 759: "DBCAT would be the DIV inside the LI, which"
+          text run at (0,230) width 763: "hasn't entered layout yet when the list marker is"
+          text run at (0,276) width 669: "autosized (causing the autosizer to crash)."
+      LayoutBlockFlow (floating) {UL} at (0,338) size 800x225
         LayoutListItem {LI} at (40,0) size 760x225
           LayoutBlockFlow {DIV} at (0,0) size 760x225
             LayoutListMarker (anonymous) at (-31,0) size 14x45: bullet
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text-autosizing/tables/css-table-single-cell-lots-of-text-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/text-autosizing/tables/css-table-single-cell-lots-of-text-expected.png
index bf4d8c3..8c01ad0 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text-autosizing/tables/css-table-single-cell-lots-of-text-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text-autosizing/tables/css-table-single-cell-lots-of-text-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text-autosizing/tables/css-table-single-cell-lots-of-text-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/text-autosizing/tables/css-table-single-cell-lots-of-text-expected.txt
index b52f98a..21c88e6 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text-autosizing/tables/css-table-single-cell-lots-of-text-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text-autosizing/tables/css-table-single-cell-lots-of-text-expected.txt
@@ -4,11 +4,11 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x582
     LayoutBlockFlow {BODY} at (0,0) size 800x581
       LayoutBlockFlow {DIV} at (0,0) size 600x36
-        LayoutText {#text} at (0,0) size 293x14
-          text run at (0,0) width 293: "Table autosizing tests - css-table-single-cell-lots-of-text.html"
-        LayoutBR {BR} at (292,0) size 1x14
-        LayoutText {#text} at (0,14) size 566x14
-          text run at (0,14) width 566: "This test passes if there is a one cell with lots of text that's autosized, and five single-word cells that are not autosized."
+        LayoutText {#text} at (0,0) size 292x14
+          text run at (0,0) width 292: "Table autosizing tests - css-table-single-cell-lots-of-text.html"
+        LayoutBR {BR} at (291,0) size 1x14
+        LayoutText {#text} at (0,14) size 565x14
+          text run at (0,14) width 565: "This test passes if there is a one cell with lots of text that's autosized, and five single-word cells that are not autosized."
       LayoutTable {DIV} at (1,37) size 798x544
         LayoutTableSection (anonymous) at (0,0) size 798x544
           LayoutTableRow {DIV} at (0,0) size 798x38
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text-autosizing/tables/fixed-table-single-cell-lots-of-text-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/text-autosizing/tables/fixed-table-single-cell-lots-of-text-expected.png
index 7123527..285aaa3 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text-autosizing/tables/fixed-table-single-cell-lots-of-text-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text-autosizing/tables/fixed-table-single-cell-lots-of-text-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text-autosizing/tables/fixed-table-single-cell-lots-of-text-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/text-autosizing/tables/fixed-table-single-cell-lots-of-text-expected.txt
index 6993a199..9f34c39 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text-autosizing/tables/fixed-table-single-cell-lots-of-text-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text-autosizing/tables/fixed-table-single-cell-lots-of-text-expected.txt
@@ -4,11 +4,11 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x585
     LayoutBlockFlow {BODY} at (0,0) size 800x584
       LayoutBlockFlow {DIV} at (0,0) size 600x36
-        LayoutText {#text} at (0,0) size 303x14
-          text run at (0,0) width 303: "Table autosizing tests - fixed-table-single-cell-lots-of-text.html"
-        LayoutBR {BR} at (302,0) size 1x14
-        LayoutText {#text} at (0,14) size 566x14
-          text run at (0,14) width 566: "This test passes if there is a one cell with lots of text that's autosized, and five single-word cells that are not autosized."
+        LayoutText {#text} at (0,0) size 301x14
+          text run at (0,0) width 301: "Table autosizing tests - fixed-table-single-cell-lots-of-text.html"
+        LayoutBR {BR} at (300,0) size 1x14
+        LayoutText {#text} at (0,14) size 565x14
+          text run at (0,14) width 565: "This test passes if there is a one cell with lots of text that's autosized, and five single-word cells that are not autosized."
       LayoutTable {TABLE} at (1,37) size 798x547 [border: none]
         LayoutTableSection {TBODY} at (0,0) size 797x546
           LayoutTableRow {TR} at (0,0) size 797x39
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text-autosizing/tables/nested-table-wrapping-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/text-autosizing/tables/nested-table-wrapping-expected.png
index fdd2991c..15a7b16 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text-autosizing/tables/nested-table-wrapping-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text-autosizing/tables/nested-table-wrapping-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text-autosizing/tables/nested-table-wrapping-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/text-autosizing/tables/nested-table-wrapping-expected.txt
index b9bbb40..0103516 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text-autosizing/tables/nested-table-wrapping-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text-autosizing/tables/nested-table-wrapping-expected.txt
@@ -4,9 +4,9 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x260
     LayoutBlockFlow {BODY} at (0,0) size 800x259
       LayoutBlockFlow {DIV} at (0,0) size 600x36
-        LayoutText {#text} at (0,0) size 247x14
-          text run at (0,0) width 247: "Table autosizing tests - nested-table-wrapping.html"
-        LayoutBR {BR} at (246,0) size 1x14
+        LayoutText {#text} at (0,0) size 246x14
+          text run at (0,0) width 246: "Table autosizing tests - nested-table-wrapping.html"
+        LayoutBR {BR} at (245,0) size 1x14
         LayoutText {#text} at (0,14) size 390x14
           text run at (0,14) width 390: "This test passes if \"the table cell should tightly wrap this text\" is tightly wrapped."
       LayoutTable {TABLE} at (1,37) size 798x222 [border: none]
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text-autosizing/tables/nested-tables-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/text-autosizing/tables/nested-tables-expected.png
index ee9c2d5..3ff917f5 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text-autosizing/tables/nested-tables-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text-autosizing/tables/nested-tables-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text-autosizing/tables/nested-tables-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/text-autosizing/tables/nested-tables-expected.txt
index bba314f..05b39a8e 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text-autosizing/tables/nested-tables-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text-autosizing/tables/nested-tables-expected.txt
@@ -4,9 +4,9 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x305
     LayoutBlockFlow {BODY} at (0,0) size 800x304
       LayoutBlockFlow {DIV} at (0,0) size 600x36
-        LayoutText {#text} at (0,0) size 202x14
-          text run at (0,0) width 202: "Table autosizing tests - nested-tables.html"
-        LayoutBR {BR} at (201,0) size 1x14
+        LayoutText {#text} at (0,0) size 201x14
+          text run at (0,0) width 201: "Table autosizing tests - nested-tables.html"
+        LayoutBR {BR} at (200,0) size 1x14
         LayoutText {#text} at (0,14) size 365x14
           text run at (0,14) width 365: "This test passes if \"This text should not overlap itself\" doesn't overlap itself."
       LayoutTable {TABLE} at (1,37) size 798x267 [border: none]
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text-autosizing/tables/single-cell-lots-of-text-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/text-autosizing/tables/single-cell-lots-of-text-expected.png
index 100e2012..761b2d9 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text-autosizing/tables/single-cell-lots-of-text-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text-autosizing/tables/single-cell-lots-of-text-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text-autosizing/tables/single-cell-lots-of-text-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/text-autosizing/tables/single-cell-lots-of-text-expected.txt
index 0a9d458..7773f1a 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text-autosizing/tables/single-cell-lots-of-text-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text-autosizing/tables/single-cell-lots-of-text-expected.txt
@@ -4,11 +4,11 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x585
     LayoutBlockFlow {BODY} at (0,0) size 800x584
       LayoutBlockFlow {DIV} at (0,0) size 600x36
-        LayoutText {#text} at (0,0) size 247x14
-          text run at (0,0) width 247: "Table autosizing tests - single-cell-lots-of-text.html"
-        LayoutBR {BR} at (246,0) size 1x14
-        LayoutText {#text} at (0,14) size 566x14
-          text run at (0,14) width 566: "This test passes if there is a one cell with lots of text that's autosized, and five single-word cells that are not autosized."
+        LayoutText {#text} at (0,0) size 246x14
+          text run at (0,0) width 246: "Table autosizing tests - single-cell-lots-of-text.html"
+        LayoutBR {BR} at (245,0) size 1x14
+        LayoutText {#text} at (0,14) size 565x14
+          text run at (0,14) width 565: "This test passes if there is a one cell with lots of text that's autosized, and five single-word cells that are not autosized."
       LayoutTable {TABLE} at (1,37) size 798x547 [border: none]
         LayoutTableSection {TBODY} at (0,0) size 797x546
           LayoutTableRow {TR} at (0,0) size 797x39
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text-autosizing/tables/single-percent-width-cell-lots-of-text-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/text-autosizing/tables/single-percent-width-cell-lots-of-text-expected.png
index e1eaa42..fbcf57d 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text-autosizing/tables/single-percent-width-cell-lots-of-text-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text-autosizing/tables/single-percent-width-cell-lots-of-text-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text-autosizing/tables/single-percent-width-cell-lots-of-text-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/text-autosizing/tables/single-percent-width-cell-lots-of-text-expected.txt
index c50afce1..461eb9ea 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text-autosizing/tables/single-percent-width-cell-lots-of-text-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text-autosizing/tables/single-percent-width-cell-lots-of-text-expected.txt
@@ -7,8 +7,8 @@
         LayoutText {#text} at (0,0) size 317x14
           text run at (0,0) width 317: "Table autosizing tests - single-percent-width-cell-lots-of-text.html"
         LayoutBR {BR} at (316,0) size 1x14
-        LayoutText {#text} at (0,14) size 506x14
-          text run at (0,14) width 506: "This test passes if there is a one cell with lots of text that's autosized, and five cells that are not autosized."
+        LayoutText {#text} at (0,14) size 505x14
+          text run at (0,14) width 505: "This test passes if there is a one cell with lots of text that's autosized, and five cells that are not autosized."
       LayoutTable {TABLE} at (1,37) size 798x1857 [border: none]
         LayoutTableSection {TBODY} at (0,0) size 797x1856
           LayoutTableRow {TR} at (0,0) size 797x17
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text-autosizing/tables/table-cell-inflation-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/text-autosizing/tables/table-cell-inflation-expected.png
index 6a5fe2b1..5777b30 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text-autosizing/tables/table-cell-inflation-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text-autosizing/tables/table-cell-inflation-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text-autosizing/tables/table-cell-inflation-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/text-autosizing/tables/table-cell-inflation-expected.txt
index d3bd460..e53f31d 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text-autosizing/tables/table-cell-inflation-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text-autosizing/tables/table-cell-inflation-expected.txt
@@ -4,11 +4,11 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x240
     LayoutBlockFlow {BODY} at (0,0) size 500x239
       LayoutBlockFlow {DIV} at (0,0) size 600x36
-        LayoutText {#text} at (0,0) size 229x14
-          text run at (0,0) width 229: "Table autosizing tests - table-cell-inflation.html"
-        LayoutBR {BR} at (228,0) size 1x14
-        LayoutText {#text} at (0,14) size 363x14
-          text run at (0,14) width 363: "This test passes if there are no numbers overflowing outside this green box."
+        LayoutText {#text} at (0,0) size 227x14
+          text run at (0,0) width 227: "Table autosizing tests - table-cell-inflation.html"
+        LayoutBR {BR} at (226,0) size 1x14
+        LayoutText {#text} at (0,14) size 362x14
+          text run at (0,14) width 362: "This test passes if there are no numbers overflowing outside this green box."
       LayoutTable {TABLE} at (1,37) size 722x202 [border: none]
         LayoutTableSection {TBODY} at (0,0) size 721x201
           LayoutTableRow {TR} at (0,0) size 721x201
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text-autosizing/tables/table-for-layout-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/text-autosizing/tables/table-for-layout-expected.png
index 7b2e0b5..2251a2c 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text-autosizing/tables/table-for-layout-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text-autosizing/tables/table-for-layout-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text-autosizing/tables/table-for-layout-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/text-autosizing/tables/table-for-layout-expected.txt
index 616eff3..726e8ee5 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text-autosizing/tables/table-for-layout-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text-autosizing/tables/table-for-layout-expected.txt
@@ -4,9 +4,9 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x419
     LayoutBlockFlow {BODY} at (0,0) size 800x418
       LayoutBlockFlow {DIV} at (0,0) size 600x36
-        LayoutText {#text} at (0,0) size 215x14
-          text run at (0,0) width 215: "Table autosizing tests - table-for-layout.html"
-        LayoutBR {BR} at (214,0) size 1x14
+        LayoutText {#text} at (0,0) size 214x14
+          text run at (0,0) width 214: "Table autosizing tests - table-for-layout.html"
+        LayoutBR {BR} at (213,0) size 1x14
         LayoutText {#text} at (0,14) size 254x14
           text run at (0,14) width 254: "This test passes if the main content area is autosized."
       LayoutTable {TABLE} at (1,37) size 798x381 [border: none]
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text-autosizing/tables/wide-percentage-width-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/text-autosizing/tables/wide-percentage-width-expected.png
index 87e0953..73798e6 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text-autosizing/tables/wide-percentage-width-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text-autosizing/tables/wide-percentage-width-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text-autosizing/tables/wide-percentage-width-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/text-autosizing/tables/wide-percentage-width-expected.txt
index 430ef5a..f6c7e7a 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text-autosizing/tables/wide-percentage-width-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text-autosizing/tables/wide-percentage-width-expected.txt
@@ -4,9 +4,9 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x199
     LayoutBlockFlow {BODY} at (0,0) size 800x198
       LayoutBlockFlow {DIV} at (0,0) size 600x36
-        LayoutText {#text} at (0,0) size 250x14
-          text run at (0,0) width 250: "Table autosizing tests - wide-percentage-width.html"
-        LayoutBR {BR} at (249,0) size 1x14
+        LayoutText {#text} at (0,0) size 249x14
+          text run at (0,0) width 249: "Table autosizing tests - wide-percentage-width.html"
+        LayoutBR {BR} at (248,0) size 1x14
         LayoutText {#text} at (0,14) size 469x14
           text run at (0,14) width 469: "This test passes if the cell with lots of text is autosized and none of the other 5 cells are autosized."
       LayoutTable {TABLE} at (1,37) size 500x161 [border: none]
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text-autosizing/tables/wide-specified-width-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/text-autosizing/tables/wide-specified-width-expected.png
index 1aa66300..6f3afe9 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text-autosizing/tables/wide-specified-width-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text-autosizing/tables/wide-specified-width-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text-autosizing/tables/wide-specified-width-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/text-autosizing/tables/wide-specified-width-expected.txt
index 5ef85df..04a9dfa 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text-autosizing/tables/wide-specified-width-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text-autosizing/tables/wide-specified-width-expected.txt
@@ -4,9 +4,9 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x199
     LayoutBlockFlow {BODY} at (0,0) size 800x198
       LayoutBlockFlow {DIV} at (0,0) size 600x36
-        LayoutText {#text} at (0,0) size 241x14
-          text run at (0,0) width 241: "Table autosizing tests - wide-specified-width.html"
-        LayoutBR {BR} at (240,0) size 1x14
+        LayoutText {#text} at (0,0) size 240x14
+          text run at (0,0) width 240: "Table autosizing tests - wide-specified-width.html"
+        LayoutBR {BR} at (239,0) size 1x14
         LayoutText {#text} at (0,14) size 469x14
           text run at (0,14) width 469: "This test passes if the cell with lots of text is autosized and none of the other 5 cells are autosized."
       LayoutTable {TABLE} at (1,37) size 500x161 [border: none]
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/aat-morx-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/text/aat-morx-expected.png
index 62a2b3f9..bd3ce65 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/aat-morx-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/aat-morx-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/aat-morx-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/text/aat-morx-expected.txt
index 7649a03..d3d1ff2 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/aat-morx-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/aat-morx-expected.txt
@@ -4,9 +4,9 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x600
     LayoutBlockFlow {BODY} at (8,8) size 784x584
       LayoutBlockFlow (anonymous) at (0,0) size 784x36
-        LayoutText {#text} at (0,0) size 764x36
-          text run at (0,0) width 764: "You should see a black and white Chromium logo. This test requires the ChromiumAATTest font to be available in the"
-          text run at (0,18) width 486: "test runner, the test only works on Mac in order to verify AAT font support."
+        LayoutText {#text} at (0,0) size 759x36
+          text run at (0,0) width 759: "You should see a black and white Chromium logo. This test requires the ChromiumAATTest font to be available in the"
+          text run at (0,18) width 483: "test runner, the test only works on Mac in order to verify AAT font support."
       LayoutBlockFlow {DIV} at (0,36) size 784x202
         LayoutText {#text} at (0,11) size 200x179
           text run at (0,11) width 200: "abcd"
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/atsui-kerning-and-ligatures-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/text/atsui-kerning-and-ligatures-expected.png
index 741a08b5..814db939 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/atsui-kerning-and-ligatures-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/atsui-kerning-and-ligatures-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/atsui-kerning-and-ligatures-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/text/atsui-kerning-and-ligatures-expected.txt
index 6198e466..c842d14d 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/atsui-kerning-and-ligatures-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/atsui-kerning-and-ligatures-expected.txt
@@ -4,17 +4,17 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x600
     LayoutBlockFlow {BODY} at (8,8) size 784x584
       LayoutBlockFlow {P} at (0,0) size 784x36
-        LayoutText {#text} at (0,0) size 55x18
-          text run at (0,0) width 55: "Test for "
-        LayoutInline {I} at (0,0) size 762x36
-          LayoutText {#text} at (54,0) size 762x36
-            text run at (54,0) width 708: "http://bugzilla.opendarwin.org/show_bug.cgi?id=6137 Disable kerning and some ligatures in the ATSUI code"
+        LayoutText {#text} at (0,0) size 54x18
+          text run at (0,0) width 54: "Test for "
+        LayoutInline {I} at (0,0) size 759x36
+          LayoutText {#text} at (53,0) size 759x36
+            text run at (53,0) width 706: "http://bugzilla.opendarwin.org/show_bug.cgi?id=6137 Disable kerning and some ligatures in the ATSUI code"
             text run at (0,18) width 29: "path"
         LayoutText {#text} at (28,18) size 5x18
           text run at (28,18) width 5: "."
       LayoutBlockFlow {P} at (0,52) size 784x18
-        LayoutText {#text} at (0,0) size 721x18
-          text run at (0,0) width 721: "The word \x{201C}dolor\x{201D} below should be highlighted in its entirety. The highlight should not extend beyond that word."
+        LayoutText {#text} at (0,0) size 720x18
+          text run at (0,0) width 720: "The word \x{201C}dolor\x{201D} below should be highlighted in its entirety. The highlight should not extend beyond that word."
       LayoutBlockFlow {DIV} at (0,86) size 784x42
         LayoutBlockFlow {HR} at (0,0) size 784x2 [border: (1px inset #EEEEEE)]
         LayoutBlockFlow (anonymous) at (0,14) size 784x28
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/atsui-multiple-renderers-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/text/atsui-multiple-renderers-expected.png
index e65e2a2..79ff18f 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/atsui-multiple-renderers-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/atsui-multiple-renderers-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/atsui-multiple-renderers-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/text/atsui-multiple-renderers-expected.txt
index 4f84af70..a43cb1f 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/atsui-multiple-renderers-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/atsui-multiple-renderers-expected.txt
@@ -6,9 +6,9 @@
       LayoutBlockFlow {P} at (0,0) size 784x36
         LayoutText {#text} at (0,0) size 108x18
           text run at (0,0) width 108: "This is a test for "
-        LayoutInline {I} at (0,0) size 769x36
-          LayoutText {#text} at (107,0) size 769x36
-            text run at (107,0) width 662: "http://bugzilla.opendarwin.org/show_bug.cgi?id=6139 ATSUI code path should implement small caps,"
+        LayoutInline {I} at (0,0) size 767x36
+          LayoutText {#text} at (107,0) size 767x36
+            text run at (107,0) width 660: "http://bugzilla.opendarwin.org/show_bug.cgi?id=6139 ATSUI code path should implement small caps,"
             text run at (0,18) width 412: "synthetic bold and oblique and correct metrics for fallback fonts"
         LayoutText {#text} at (411,18) size 5x18
           text run at (411,18) width 5: "."
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/atsui-partial-selection-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/text/atsui-partial-selection-expected.png
index 87e024fd..1e7ba65 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/atsui-partial-selection-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/atsui-partial-selection-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/atsui-partial-selection-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/text/atsui-partial-selection-expected.txt
index 565df40..288fe9b 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/atsui-partial-selection-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/atsui-partial-selection-expected.txt
@@ -4,15 +4,15 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x600
     LayoutBlockFlow {BODY} at (8,8) size 784x576
       LayoutBlockFlow {P} at (0,0) size 784x36
-        LayoutText {#text} at (0,0) size 55x18
-          text run at (0,0) width 55: "Test for "
-        LayoutInline {I} at (0,0) size 763x36
-          LayoutInline {A} at (0,0) size 306x18 [color=#0000EE]
-            LayoutText {#text} at (54,0) size 306x18
-              text run at (54,0) width 306: "http://bugs.webkit.org/show_bug.cgi?id=11124"
-          LayoutText {#text} at (359,0) size 763x36
-            text run at (359,0) width 5: " "
-            text run at (363,0) width 400: "REGRESSION (r14297): No drag image for partially-selected"
+        LayoutText {#text} at (0,0) size 54x18
+          text run at (0,0) width 54: "Test for "
+        LayoutInline {I} at (0,0) size 759x36
+          LayoutInline {A} at (0,0) size 303x18 [color=#0000EE]
+            LayoutText {#text} at (53,0) size 303x18
+              text run at (53,0) width 303: "http://bugs.webkit.org/show_bug.cgi?id=11124"
+          LayoutText {#text} at (355,0) size 759x36
+            text run at (355,0) width 5: " "
+            text run at (359,0) width 400: "REGRESSION (r14297): No drag image for partially-selected"
             text run at (0,18) width 81: "complex text"
         LayoutText {#text} at (80,18) size 5x18
           text run at (80,18) width 5: "."
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/atsui-pointtooffset-calls-cg-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/text/atsui-pointtooffset-calls-cg-expected.png
index 95d557b..bd89ce00 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/atsui-pointtooffset-calls-cg-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/atsui-pointtooffset-calls-cg-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/atsui-pointtooffset-calls-cg-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/text/atsui-pointtooffset-calls-cg-expected.txt
index 13a3009..b6f969df 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/atsui-pointtooffset-calls-cg-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/atsui-pointtooffset-calls-cg-expected.txt
@@ -10,9 +10,9 @@
       LayoutBlockFlow (anonymous) at (0,36) size 800x36
         LayoutText {#text} at (0,0) size 213x18
           text run at (0,0) width 213: "This tests for regressions against "
-        LayoutInline {I} at (0,0) size 794x36
-          LayoutText {#text} at (212,0) size 794x36
-            text run at (212,0) width 582: "http://bugzilla.opendarwin.org/show_bug.cgi?id=5878 pointToOffset always takes the CG"
+        LayoutInline {I} at (0,0) size 792x36
+          LayoutText {#text} at (212,0) size 792x36
+            text run at (212,0) width 580: "http://bugzilla.opendarwin.org/show_bug.cgi?id=5878 pointToOffset always takes the CG"
             text run at (0,18) width 63: "code path"
         LayoutText {#text} at (62,18) size 648x18
           text run at (62,18) width 648: " by clicking the X and verifying that the correct caret position (13) is reported to the editing delegate."
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/atsui-small-caps-punctuation-size-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/text/atsui-small-caps-punctuation-size-expected.png
index 060b564f..9521f2d 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/atsui-small-caps-punctuation-size-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/atsui-small-caps-punctuation-size-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/atsui-small-caps-punctuation-size-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/text/atsui-small-caps-punctuation-size-expected.txt
index 5bdcc5b..a1e8eea 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/atsui-small-caps-punctuation-size-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/atsui-small-caps-punctuation-size-expected.txt
@@ -6,12 +6,12 @@
       LayoutBlockFlow {P} at (0,0) size 784x36
         LayoutText {#text} at (0,0) size 218x18
           text run at (0,0) width 218: "This tests for a regression against "
-        LayoutInline {I} at (0,0) size 755x36
-          LayoutInline {A} at (0,0) size 355x18 [color=#0000EE]
-            LayoutText {#text} at (217,0) size 355x18
-              text run at (217,0) width 355: "http://bugzilla.opendarwin.org/show_bug.cgi?id=6397"
-          LayoutText {#text} at (571,0) size 755x36
-            text run at (571,0) width 184: " ATSUI small caps use small"
+        LayoutInline {I} at (0,0) size 754x36
+          LayoutInline {A} at (0,0) size 354x18 [color=#0000EE]
+            LayoutText {#text} at (217,0) size 354x18
+              text run at (217,0) width 354: "http://bugzilla.opendarwin.org/show_bug.cgi?id=6397"
+          LayoutText {#text} at (570,0) size 754x36
+            text run at (570,0) width 184: " ATSUI small caps use small"
             text run at (0,18) width 77: "punctuation"
         LayoutText {#text} at (76,18) size 5x18
           text run at (76,18) width 5: "."
@@ -20,11 +20,11 @@
           text run at (0,0) width 375: "All four question marks below should be \x{201C}big\x{201D}, like this: ?"
       LayoutBlockFlow {HR} at (0,86) size 784x2 [border: (1px inset #EEEEEE)]
       LayoutBlockFlow {P} at (0,104) size 784x18
-        LayoutText {#text} at (0,0) size 56x18
-          text run at (0,0) width 56: "ATSUI: "
+        LayoutText {#text} at (0,0) size 54x18
+          text run at (0,0) width 54: "ATSUI: "
         LayoutInline {SPAN} at (0,0) size 41x18
-          LayoutText {#text} at (55,0) size 41x18
-            text run at (55,0) width 41: "A?b?e\x{300}"
+          LayoutText {#text} at (53,0) size 41x18
+            text run at (53,0) width 41: "A?b?e\x{300}"
       LayoutBlockFlow {P} at (0,138) size 784x18
         LayoutText {#text} at (0,0) size 31x18
           text run at (0,0) width 31: "CG: "
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/basic/002-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/text/basic/002-expected.png
index 1876fdd1..6f438620 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/basic/002-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/basic/002-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/basic/002-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/text/basic/002-expected.txt
index 1f4d839..160e48d6 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/basic/002-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/basic/002-expected.txt
@@ -12,7 +12,7 @@
           text run at (0,72) width 74: "constrained"
           text run at (0,90) width 100: "width, this text"
           text run at (0,108) width 100: "should be"
-          text run at (0,126) width 57: "justified."
+          text run at (0,126) width 56: "justified."
       LayoutBlockFlow {P} at (0,160) size 100x144
         LayoutText {#text} at (0,0) size 100x144
           text run at (0,0) width 100: "This paragraph"
@@ -22,4 +22,4 @@
           text run at (0,72) width 74: "constrained"
           text run at (0,90) width 100: "width, this text"
           text run at (0,108) width 100: "should be"
-          text run at (0,126) width 57: "justified."
+          text run at (0,126) width 56: "justified."
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/basic/005-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/text/basic/005-expected.png
index ad5b1af..287dde6 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/basic/005-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/basic/005-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/basic/005-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/text/basic/005-expected.txt
index 0cd7fb2..3128518b 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/basic/005-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/basic/005-expected.txt
@@ -3,6 +3,6 @@
 layer at (0,0) size 800x600
   LayoutBlockFlow {HTML} at (0,0) size 800x600
     LayoutBlockFlow {BODY} at (8,8) size 784x584
-      LayoutBlockFlow (floating) {DIV} at (0,0) size 264.03x22 [border: (2px solid #008000)]
-        LayoutText {#text} at (2,2) size 261x18
-          text run at (2,2) width 261: "Words should have a negative spacing of 5px."
+      LayoutBlockFlow (floating) {DIV} at (0,0) size 262.77x22 [border: (2px solid #008000)]
+        LayoutText {#text} at (2,2) size 259x18
+          text run at (2,2) width 259: "Words should have a negative spacing of 5px."
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/basic/011-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/text/basic/011-expected.png
index 3516fb4..e59b189c 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/basic/011-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/basic/011-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/basic/011-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/text/basic/011-expected.txt
index 472b3b7..ebbdb3a 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/basic/011-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/basic/011-expected.txt
@@ -6,22 +6,22 @@
       LayoutBlockFlow {DIV} at (0,0) size 784x36
         LayoutText {#text} at (0,0) size 103x18
           text run at (0,0) width 103: "Select this text. "
-        LayoutInline {FONT} at (0,0) size 753x31
-          LayoutText {#text} at (102,4) size 753x31
-            text run at (102,4) width 83: "I am teeny and tiny. "
-            text run at (184,4) width 292: "I am going to have lots of text but each line should retain the big height. "
-            text run at (475,4) width 278: "If the lines shrink, it means that the root line box's height is not being"
+        LayoutInline {FONT} at (0,0) size 752x31
+          LayoutText {#text} at (102,4) size 752x31
+            text run at (102,4) width 82: "I am teeny and tiny. "
+            text run at (183,4) width 292: "I am going to have lots of text but each line should retain the big height. "
+            text run at (474,4) width 278: "If the lines shrink, it means that the root line box's height is not being"
             text run at (0,22) width 114: "considered and that's wrong."
         LayoutText {#text} at (0,0) size 0x0
       LayoutBlockFlow {P} at (0,52) size 784x0
       LayoutBlockFlow {DIV} at (0,52) size 784x74
-        LayoutInline {FONT} at (0,0) size 773x74
+        LayoutInline {FONT} at (0,0) size 772x74
           LayoutText {#text} at (0,0) size 432x37
             text run at (0,0) width 432: "This text is absolutely enormous. "
-          LayoutInline {FONT} at (0,0) size 773x50
-            LayoutText {#text} at (431,19) size 773x50
-              text run at (431,19) width 84: "I am teeny and tiny. "
-              text run at (514,19) width 259: "I am going to have lots of text but each line should retain the big"
+          LayoutInline {FONT} at (0,0) size 772x50
+            LayoutText {#text} at (431,19) size 772x50
+              text run at (431,19) width 83: "I am teeny and tiny. "
+              text run at (513,19) width 259: "I am going to have lots of text but each line should retain the big"
               text run at (0,56) width 30: "height. "
               text run at (29,56) width 403: "If the lines shrink, it means that the span's line box's height is not being considered and that's wrong."
           LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/basic/012-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/text/basic/012-expected.png
index 49c1346..20d742a 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/basic/012-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/basic/012-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/basic/012-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/text/basic/012-expected.txt
index 526b5d96..d9ce2ee 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/basic/012-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/basic/012-expected.txt
@@ -10,11 +10,11 @@
         LayoutText {#text} at (0,0) size 781x36
           text run at (0,0) width 654: "Apart from whitespace (tab and linefeed characters), the two lists below (in red) use identical HTML. "
           text run at (653,0) width 128: "Both lists should be"
-          text run at (0,18) width 595: "rendered on a single line. In Safari, however, the first list shows each item on a separate line."
+          text run at (0,18) width 593: "rendered on a single line. In Safari, however, the first list shows each item on a separate line."
       LayoutBlockFlow {P} at (0,99.91) size 784x36
         LayoutText {#text} at (0,0) size 764x36
           text run at (0,0) width 764: "This bug only seems to occur if the bullet character is non-ASCII (has a Unicode value higher than 127). Non-breaking"
-          text run at (0,18) width 286: "spaces (&#160;), however, are an exception."
+          text run at (0,18) width 285: "spaces (&#160;), however, are an exception."
       LayoutBlockFlow (anonymous) at (0,151.91) size 784x72
         LayoutBR {BR} at (0,0) size 0x18
         LayoutInline {FONT} at (0,0) size 338x54 [color=#CC0000]
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/basic/013-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/text/basic/013-expected.png
index ca4cc200..aad040b 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/basic/013-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/basic/013-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/basic/013-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/text/basic/013-expected.txt
index 40ecff5..d53eee4 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/basic/013-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/basic/013-expected.txt
@@ -37,34 +37,34 @@
           text run at (0,18) width 348: "should be inherited. This was discovered in Safari 1.0."
       LayoutBlockFlow {DIV} at (0,110.44) size 784x120
         LayoutBlockFlow {P} at (0,0) size 784x18
-          LayoutText {#text} at (0,0) size 134x18
-            text run at (0,0) width 134: "Text inside "
+          LayoutText {#text} at (0,0) size 133x18
+            text run at (0,0) width 133: "Text inside "
           LayoutInline {B} at (0,0) size 50x18
-            LayoutText {#text} at (133,0) size 50x18
-              text run at (133,0) width 50: "bold"
-          LayoutText {#text} at (182,0) size 103x18
-            text run at (182,0) width 103: " element."
+            LayoutText {#text} at (132,0) size 50x18
+              text run at (132,0) width 50: "bold"
+          LayoutText {#text} at (181,0) size 103x18
+            text run at (181,0) width 103: " element."
         LayoutBlockFlow {P} at (0,34) size 784x18
-          LayoutText {#text} at (0,0) size 134x18
-            text run at (0,0) width 134: "Text inside "
+          LayoutText {#text} at (0,0) size 133x18
+            text run at (0,0) width 133: "Text inside "
           LayoutInline {STRONG} at (0,0) size 73x18
-            LayoutText {#text} at (133,0) size 73x18
-              text run at (133,0) width 73: "strong"
-          LayoutText {#text} at (205,0) size 103x18
-            text run at (205,0) width 103: " element."
+            LayoutText {#text} at (132,0) size 73x18
+              text run at (132,0) width 73: "strong"
+          LayoutText {#text} at (204,0) size 102x18
+            text run at (204,0) width 102: " element."
         LayoutBlockFlow {P} at (0,68) size 784x18
-          LayoutText {#text} at (0,0) size 134x18
-            text run at (0,0) width 134: "Text inside "
+          LayoutText {#text} at (0,0) size 133x18
+            text run at (0,0) width 133: "Text inside "
           LayoutInline {I} at (0,0) size 62x18
-            LayoutText {#text} at (133,0) size 62x18
-              text run at (133,0) width 62: "italic"
-          LayoutText {#text} at (194,0) size 103x18
-            text run at (194,0) width 103: " element."
+            LayoutText {#text} at (132,0) size 62x18
+              text run at (132,0) width 62: "italic"
+          LayoutText {#text} at (193,0) size 103x18
+            text run at (193,0) width 103: " element."
         LayoutBlockFlow {P} at (0,102) size 784x18
-          LayoutText {#text} at (0,0) size 134x18
-            text run at (0,0) width 134: "Text inside "
-          LayoutInline {EM} at (0,0) size 99x18
-            LayoutText {#text} at (133,0) size 99x18
-              text run at (133,0) width 99: "emphasis"
-          LayoutText {#text} at (231,0) size 102x18
-            text run at (231,0) width 102: " element."
+          LayoutText {#text} at (0,0) size 133x18
+            text run at (0,0) width 133: "Text inside "
+          LayoutInline {EM} at (0,0) size 98x18
+            LayoutText {#text} at (132,0) size 98x18
+              text run at (132,0) width 98: "emphasis"
+          LayoutText {#text} at (229,0) size 103x18
+            text run at (229,0) width 103: " element."
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/basic/generic-family-changes-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/text/basic/generic-family-changes-expected.png
index fbd1b2ba..08fc56d9 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/basic/generic-family-changes-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/basic/generic-family-changes-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/basic/generic-family-changes-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/text/basic/generic-family-changes-expected.txt
index 16a214d..6658e2cf 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/basic/generic-family-changes-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/basic/generic-family-changes-expected.txt
@@ -4,12 +4,12 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x302
     LayoutBlockFlow {BODY} at (8,8) size 784x278
       LayoutBlockFlow (anonymous) at (0,0) size 784x54
-        LayoutText {#text} at (0,0) size 759x54
-          text run at (0,0) width 541: "Tests of WebKit's intepretation of font sizes when no absolute font size is specified. "
-          text run at (540,0) width 219: "Percentages and logical keywords"
-          text run at (0,18) width 203: "scale to reflect the family type. "
-          text run at (202,18) width 539: "Opera 9 matches this behavior as well (except it has a bug with multiple font-family"
-          text run at (0,36) width 217: "mappings as in the first example)."
+        LayoutText {#text} at (0,0) size 755x54
+          text run at (0,0) width 538: "Tests of WebKit's intepretation of font sizes when no absolute font size is specified. "
+          text run at (537,0) width 218: "Percentages and logical keywords"
+          text run at (0,18) width 202: "scale to reflect the family type. "
+          text run at (201,18) width 539: "Opera 9 matches this behavior as well (except it has a bug with multiple font-family"
+          text run at (0,36) width 216: "mappings as in the first example)."
       LayoutBlockFlow {PRE} at (0,67) size 784x15
         LayoutInline {SPAN} at (0,0) size 118x15
           LayoutText {#text} at (0,0) size 118x15
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/bidi-embedding-pop-and-push-same-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/text/bidi-embedding-pop-and-push-same-expected.png
index fb050432..0ffff8a5 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/bidi-embedding-pop-and-push-same-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/bidi-embedding-pop-and-push-same-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/bidi-embedding-pop-and-push-same-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/text/bidi-embedding-pop-and-push-same-expected.txt
index 06261728..62054d8b 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/bidi-embedding-pop-and-push-same-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/bidi-embedding-pop-and-push-same-expected.txt
@@ -4,8 +4,8 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x600
     LayoutBlockFlow {BODY} at (8,8) size 784x584
       LayoutBlockFlow {P} at (0,0) size 784x18
-        LayoutText {#text} at (0,0) size 521x18
-          text run at (0,0) width 521: "In each box below, the words or letters should be in the same order on every line."
+        LayoutText {#text} at (0,0) size 520x18
+          text run at (0,0) width 520: "In each box below, the words or letters should be in the same order on every line."
       LayoutBlockFlow {DIV} at (8,34) size 768x64 [border: (1px solid #ADD8E6)]
         LayoutBlockFlow {DIV} at (5,5) size 758x18
           LayoutText {#text} at (0,0) size 47x18
@@ -32,19 +32,19 @@
           LayoutInline {SPAN} at (0,0) size 44x18
             LayoutText {#text} at (46,0) size 44x18
               text run at (46,0) width 44: "ipsum "
-          LayoutInline {B} at (0,0) size 95x18
-            LayoutInline {SPAN} at (0,0) size 38x18
-              LayoutText {#text} at (89,0) size 38x18
-                text run at (89,0) width 38: "dolor"
-            LayoutText {#text} at (126,0) size 5x18
-              text run at (126,0) width 5: " "
-            LayoutInline {I} at (0,0) size 16x18
-              LayoutText {#text} at (130,0) size 16x18
-                text run at (130,0) width 16: "sit"
-            LayoutText {#text} at (145,0) size 39x18
-              text run at (145,0) width 39: " amet"
-          LayoutText {#text} at (183,0) size 5x18
-            text run at (183,0) width 5: "."
+          LayoutInline {B} at (0,0) size 94x18
+            LayoutInline {SPAN} at (0,0) size 37x18
+              LayoutText {#text} at (89,0) size 37x18
+                text run at (89,0) width 37: "dolor"
+            LayoutText {#text} at (125,0) size 5x18
+              text run at (125,0) width 5: " "
+            LayoutInline {I} at (0,0) size 17x18
+              LayoutText {#text} at (129,0) size 17x18
+                text run at (129,0) width 17: "sit"
+            LayoutText {#text} at (145,0) size 38x18
+              text run at (145,0) width 38: " amet"
+          LayoutText {#text} at (182,0) size 5x18
+            text run at (182,0) width 5: "."
       LayoutBlockFlow {DIV} at (8,106) size 768x67 [border: (1px solid #ADD8E6)]
         LayoutBlockFlow {DIV} at (5,5) size 758x19
           LayoutText {#text} at (0,1) size 47x18
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/bidi-img-alt-text-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/text/bidi-img-alt-text-expected.png
index 1ee604a..b18b097f 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/bidi-img-alt-text-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/bidi-img-alt-text-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/bidi-img-alt-text-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/text/bidi-img-alt-text-expected.txt
index b003e519..c6735fae6 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/bidi-img-alt-text-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/bidi-img-alt-text-expected.txt
@@ -17,8 +17,8 @@
           text run at (302,406) width 4: " "
         LayoutText {#text} at (0,0) size 0x0
       LayoutBlockFlow {P} at (0,440) size 784x18
-        LayoutText {#text} at (0,0) size 366x18
-          text run at (0,0) width 366: "Tests that image alt text takes directionality into account."
+        LayoutText {#text} at (0,0) size 365x18
+          text run at (0,0) width 365: "Tests that image alt text takes directionality into account."
 layer at (8,8) size 302x102 clip at (9,9) size 300x100 scrollHeight 134
   LayoutBlockFlow (relative positioned) {SECTION} at (0,0) size 302x102 [border: (1px solid #FF0000)]
     LayoutBlockFlow {H2} at (1,20.91) size 300x28
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/break-word-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/text/break-word-expected.png
index 72ebf52..6612543 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/break-word-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/break-word-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/break-word-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/text/break-word-expected.txt
index 1ba6a22..c01e66c 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/break-word-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/break-word-expected.txt
@@ -4,18 +4,18 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x600
     LayoutBlockFlow {BODY} at (8,8) size 784x584
       LayoutBlockFlow {P} at (0,0) size 784x36
-        LayoutText {#text} at (0,0) size 55x18
-          text run at (0,0) width 55: "Test for "
-        LayoutInline {I} at (0,0) size 752x36
-          LayoutInline {A} at (0,0) size 306x18 [color=#0000EE]
-            LayoutText {#text} at (54,0) size 306x18
-              text run at (54,0) width 306: "http://bugs.webkit.org/show_bug.cgi?id=12726"
-          LayoutText {#text} at (359,0) size 752x36
-            text run at (359,0) width 5: " "
-            text run at (363,0) width 389: "REGRESSION (r12073): Text wraps in the middle of a word"
-            text run at (0,18) width 314: "instead of wrapping at the space before the word"
-        LayoutText {#text} at (313,18) size 5x18
-          text run at (313,18) width 5: "."
+        LayoutText {#text} at (0,0) size 54x18
+          text run at (0,0) width 54: "Test for "
+        LayoutInline {I} at (0,0) size 748x36
+          LayoutInline {A} at (0,0) size 305x18 [color=#0000EE]
+            LayoutText {#text} at (53,0) size 305x18
+              text run at (53,0) width 305: "http://bugs.webkit.org/show_bug.cgi?id=12726"
+          LayoutText {#text} at (357,0) size 748x36
+            text run at (357,0) width 5: " "
+            text run at (361,0) width 387: "REGRESSION (r12073): Text wraps in the middle of a word"
+            text run at (0,18) width 313: "instead of wrapping at the space before the word"
+        LayoutText {#text} at (312,18) size 5x18
+          text run at (312,18) width 5: "."
       LayoutBlockFlow {P} at (0,52) size 784x18
         LayoutText {#text} at (0,0) size 388x18
           text run at (0,0) width 388: "\x{201C}onelongwrodwithnobreaks\x{201D} should not break in the middle."
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/capitalize-boundaries-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/text/capitalize-boundaries-expected.png
index 3c402dd..1d148f11 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/capitalize-boundaries-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/capitalize-boundaries-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/capitalize-boundaries-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/text/capitalize-boundaries-expected.txt
index af2f1272..18116fd 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/capitalize-boundaries-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/capitalize-boundaries-expected.txt
@@ -10,12 +10,12 @@
           LayoutText {#text} at (351,0) size 56x18
             text run at (351,0) width 56: "Bugzilla"
         LayoutText {#text} at (406,0) size 757x72
-          text run at (406,0) width 328: ". Currently, the \"Browser rendering\" results are not"
+          text run at (406,0) width 327: ". Currently, the \"Browser rendering\" results are not"
           text run at (0,18) width 757: "expected to match the \"Correct output sample\" results. In fact, I do not entirely agree with all of the given test cases in"
           text run at (0,36) width 744: "terms of their expected results, nor do I think that the browser should yet be expected to match all of the cases in the"
           text run at (0,54) width 189: "different languages, but I am "
-          text run at (188,54) width 294: "(at least temporarily) adding the test anyway. "
-        LayoutBR {BR} at (481,68) size 1x0
+          text run at (188,54) width 293: "(at least temporarily) adding the test anyway. "
+        LayoutBR {BR} at (480,68) size 1x0
         LayoutBR {BR} at (0,72) size 0x18
       LayoutTable {TABLE} at (0,90) size 769x364
         LayoutBlockFlow {CAPTION} at (0,0) size 769x18
@@ -27,10 +27,10 @@
               LayoutText {#text} at (2,2) size 48x18
                 text run at (2,2) width 48: "generic"
             LayoutTableCell {TD} at (56,2) size 711x58 [border: (1px solid #EEEEEE)] [r=0 c=1 rs=1 cs=1]
-              LayoutText {#text} at (2,2) size 689x54
-                text run at (2,2) width 689: "lip\x{AD}smackin\x{AD}thirst\x{AD}quenchin\x{AD}acetastin\x{AD}motivatin\x{AD}good\x{AD}buzzin\x{AD}cool\x{AD}talkin\x{AD}high\x{AD}walkin\x{AD}fast\x{AD}livin\x{AD}ever\x{AD}givin\x{AD}cool\x{AD}fizzin\x{AD}lip\x{AD}" + hyphen string "-"
-                text run at (2,20) width 672: "smackin\x{AD}thirst\x{AD}quenchin\x{AD}acetastin\x{AD}motivatin\x{AD}good\x{AD}buzzin\x{AD}cool\x{AD}talkin\x{AD}high\x{AD}walkin\x{AD}fast\x{AD}livin\x{AD}ever\x{AD}givin\x{AD}cool\x{AD}fizzin\x{AD}lip\x{AD}" + hyphen string "-"
-                text run at (2,38) width 650: "smackin\x{AD}thirst\x{AD}quenchin\x{AD}acetastin\x{AD}motivatin\x{AD}good\x{AD}buzzin\x{AD}cool\x{AD}talkin\x{AD}high\x{AD}walkin\x{AD}fast\x{AD}livin\x{AD}ever\x{AD}givin\x{AD}cool\x{AD}fizzin"
+              LayoutText {#text} at (2,2) size 688x54
+                text run at (2,2) width 688: "lip\x{AD}smackin\x{AD}thirst\x{AD}quenchin\x{AD}acetastin\x{AD}motivatin\x{AD}good\x{AD}buzzin\x{AD}cool\x{AD}talkin\x{AD}high\x{AD}walkin\x{AD}fast\x{AD}livin\x{AD}ever\x{AD}givin\x{AD}cool\x{AD}fizzin\x{AD}lip\x{AD}" + hyphen string "-"
+                text run at (2,20) width 671: "smackin\x{AD}thirst\x{AD}quenchin\x{AD}acetastin\x{AD}motivatin\x{AD}good\x{AD}buzzin\x{AD}cool\x{AD}talkin\x{AD}high\x{AD}walkin\x{AD}fast\x{AD}livin\x{AD}ever\x{AD}givin\x{AD}cool\x{AD}fizzin\x{AD}lip\x{AD}" + hyphen string "-"
+                text run at (2,38) width 649: "smackin\x{AD}thirst\x{AD}quenchin\x{AD}acetastin\x{AD}motivatin\x{AD}good\x{AD}buzzin\x{AD}cool\x{AD}talkin\x{AD}high\x{AD}walkin\x{AD}fast\x{AD}livin\x{AD}ever\x{AD}givin\x{AD}cool\x{AD}fizzin"
           LayoutTableRow {TR} at (0,62) size 769x22
             LayoutTableCell {TH} at (2,62) size 52x22 [bgcolor=#F8F8F8] [border: (1px solid #EEEEEE)] [r=1 c=0 rs=1 cs=1]
               LayoutText {#text} at (18,2) size 16x18
@@ -72,8 +72,8 @@
               LayoutInline {SPAN} at (0,0) size 42x18
                 LayoutText {#text} at (192,40) size 42x18
                   text run at (192,40) width 42: "burger"
-              LayoutText {#text} at (233,40) size 120x18
-                text run at (233,40) width 120: " [house] ~six -big-"
+              LayoutText {#text} at (233,40) size 119x18
+                text run at (233,40) width 119: " [house] ~six -big-"
           LayoutTableRow {TR} at (0,173) size 769x22
             LayoutTableCell {TH} at (2,173) size 52x22 [bgcolor=#F8F8F8] [border: (1px solid #EEEEEE)] [r=4 c=0 rs=1 cs=1]
               LayoutText {#text} at (19,2) size 14x18
@@ -136,10 +136,10 @@
               LayoutText {#text} at (2,2) size 48x18
                 text run at (2,2) width 48: "generic"
             LayoutTableCell {TD} at (56,2) size 711x58 [border: (1px solid #EEEEEE)] [r=0 c=1 rs=1 cs=1]
-              LayoutText {#text} at (2,2) size 695x54
-                text run at (2,2) width 695: "Lip\x{AD}smackin\x{AD}thirst\x{AD}quenchin\x{AD}acetastin\x{AD}motivatin\x{AD}good\x{AD}buzzin\x{AD}cool\x{AD}talkin\x{AD}high\x{AD}walkin\x{AD}fast\x{AD}livin\x{AD}ever\x{AD}givin\x{AD}cool\x{AD}fizzin\x{AD}lip\x{AD}" + hyphen string "-"
-                text run at (2,20) width 672: "smackin\x{AD}thirst\x{AD}quenchin\x{AD}acetastin\x{AD}motivatin\x{AD}good\x{AD}buzzin\x{AD}cool\x{AD}talkin\x{AD}high\x{AD}walkin\x{AD}fast\x{AD}livin\x{AD}ever\x{AD}givin\x{AD}cool\x{AD}fizzin\x{AD}lip\x{AD}" + hyphen string "-"
-                text run at (2,38) width 650: "smackin\x{AD}thirst\x{AD}quenchin\x{AD}acetastin\x{AD}motivatin\x{AD}good\x{AD}buzzin\x{AD}cool\x{AD}talkin\x{AD}high\x{AD}walkin\x{AD}fast\x{AD}livin\x{AD}ever\x{AD}givin\x{AD}cool\x{AD}fizzin"
+              LayoutText {#text} at (2,2) size 693x54
+                text run at (2,2) width 693: "Lip\x{AD}smackin\x{AD}thirst\x{AD}quenchin\x{AD}acetastin\x{AD}motivatin\x{AD}good\x{AD}buzzin\x{AD}cool\x{AD}talkin\x{AD}high\x{AD}walkin\x{AD}fast\x{AD}livin\x{AD}ever\x{AD}givin\x{AD}cool\x{AD}fizzin\x{AD}lip\x{AD}" + hyphen string "-"
+                text run at (2,20) width 671: "smackin\x{AD}thirst\x{AD}quenchin\x{AD}acetastin\x{AD}motivatin\x{AD}good\x{AD}buzzin\x{AD}cool\x{AD}talkin\x{AD}high\x{AD}walkin\x{AD}fast\x{AD}livin\x{AD}ever\x{AD}givin\x{AD}cool\x{AD}fizzin\x{AD}lip\x{AD}" + hyphen string "-"
+                text run at (2,38) width 649: "smackin\x{AD}thirst\x{AD}quenchin\x{AD}acetastin\x{AD}motivatin\x{AD}good\x{AD}buzzin\x{AD}cool\x{AD}talkin\x{AD}high\x{AD}walkin\x{AD}fast\x{AD}livin\x{AD}ever\x{AD}givin\x{AD}cool\x{AD}fizzin"
           LayoutTableRow {TR} at (0,62) size 769x22
             LayoutTableCell {TH} at (2,62) size 52x22 [bgcolor=#F8F8F8] [border: (1px solid #EEEEEE)] [r=1 c=0 rs=1 cs=1]
               LayoutText {#text} at (18,2) size 16x18
@@ -159,14 +159,14 @@
               LayoutText {#text} at (18,2) size 16x18
                 text run at (18,2) width 16: "en"
             LayoutTableCell {TD} at (56,111) size 711x60 [border: (1px solid #EEEEEE)] [r=3 c=1 rs=1 cs=1]
-              LayoutText {#text} at (2,3) size 477x18
-                text run at (2,3) width 477: "'Cept Nut'in Safari\x{2019}s \x{2018}Sure\x{2019} Na\x{EF}ve R\x{E9}sum\x{E9}\x{2014}H\x{E1}\x{10D}ek Full\x{2010}time One-to-One"
-              LayoutBR {BR} at (478,17) size 1x0
-              LayoutText {#text} at (2,22) size 345x18
-                text run at (2,22) width 345: "\"Newcastle-upon-Tyne\" Washington\x{2011}on\x{2011}the\x{2011}Brazos"
-              LayoutBR {BR} at (346,36) size 1x0
-              LayoutText {#text} at (2,40) size 369x18
-                text run at (2,40) width 369: "Earthquake Earthworm Cheeseburger [House] ~Six -Big-"
+              LayoutText {#text} at (2,3) size 476x18
+                text run at (2,3) width 476: "'Cept Nut'in Safari\x{2019}s \x{2018}Sure\x{2019} Na\x{EF}ve R\x{E9}sum\x{E9}\x{2014}H\x{E1}\x{10D}ek Full\x{2010}time One-to-One"
+              LayoutBR {BR} at (477,17) size 1x0
+              LayoutText {#text} at (2,22) size 342x18
+                text run at (2,22) width 342: "\"Newcastle-upon-Tyne\" Washington\x{2011}on\x{2011}the\x{2011}Brazos"
+              LayoutBR {BR} at (343,36) size 1x0
+              LayoutText {#text} at (2,40) size 368x18
+                text run at (2,40) width 368: "Earthquake Earthworm Cheeseburger [House] ~Six -Big-"
           LayoutTableRow {TR} at (0,173) size 769x22
             LayoutTableCell {TH} at (2,173) size 52x22 [bgcolor=#F8F8F8] [border: (1px solid #EEEEEE)] [r=4 c=0 rs=1 cs=1]
               LayoutText {#text} at (19,2) size 14x18
@@ -179,11 +179,11 @@
               LayoutText {#text} at (20,2) size 12x18
                 text run at (20,2) width 12: "fr"
             LayoutTableCell {TD} at (56,197) size 711x26 [border: (1px solid #EEEEEE)] [r=5 c=1 rs=1 cs=1]
-              LayoutText {#text} at (2,6) size 233x18
-                text run at (2,6) width 233: "Quelqu'un l\x{2019}Amour t'Appelles\x{2011}Tu 3"
+              LayoutText {#text} at (2,6) size 232x18
+                text run at (2,6) width 232: "Quelqu'un l\x{2019}Amour t'Appelles\x{2011}Tu 3"
               LayoutInline {SUP} at (0,0) size 23x15
-                LayoutText {#text} at (234,2) size 23x15
-                  text run at (234,2) width 23: "eme"
+                LayoutText {#text} at (233,2) size 23x15
+                  text run at (233,2) width 23: "eme"
           LayoutTableRow {TR} at (0,225) size 769x23
             LayoutTableCell {TH} at (2,225) size 52x22 [bgcolor=#F8F8F8] [border: (1px solid #EEEEEE)] [r=6 c=0 rs=1 cs=1]
               LayoutText {#text} at (18,2) size 16x18
@@ -229,10 +229,10 @@
               LayoutText {#text} at (2,2) size 48x18
                 text run at (2,2) width 48: "generic"
             LayoutTableCell {TD} at (56,2) size 711x58 [border: (1px solid #EEEEEE)] [r=0 c=1 rs=1 cs=1]
-              LayoutText {#text} at (2,2) size 695x54
-                text run at (2,2) width 695: "Lip\x{AD}smackin\x{AD}thirst\x{AD}quenchin\x{AD}acetastin\x{AD}motivatin\x{AD}good\x{AD}buzzin\x{AD}cool\x{AD}talkin\x{AD}high\x{AD}walkin\x{AD}fast\x{AD}livin\x{AD}ever\x{AD}givin\x{AD}cool\x{AD}fizzin\x{AD}lip\x{AD}" + hyphen string "-"
-                text run at (2,20) width 672: "smackin\x{AD}thirst\x{AD}quenchin\x{AD}acetastin\x{AD}motivatin\x{AD}good\x{AD}buzzin\x{AD}cool\x{AD}talkin\x{AD}high\x{AD}walkin\x{AD}fast\x{AD}livin\x{AD}ever\x{AD}givin\x{AD}cool\x{AD}fizzin\x{AD}lip\x{AD}" + hyphen string "-"
-                text run at (2,38) width 650: "smackin\x{AD}thirst\x{AD}quenchin\x{AD}acetastin\x{AD}motivatin\x{AD}good\x{AD}buzzin\x{AD}cool\x{AD}talkin\x{AD}high\x{AD}walkin\x{AD}fast\x{AD}livin\x{AD}ever\x{AD}givin\x{AD}cool\x{AD}fizzin"
+              LayoutText {#text} at (2,2) size 693x54
+                text run at (2,2) width 693: "Lip\x{AD}smackin\x{AD}thirst\x{AD}quenchin\x{AD}acetastin\x{AD}motivatin\x{AD}good\x{AD}buzzin\x{AD}cool\x{AD}talkin\x{AD}high\x{AD}walkin\x{AD}fast\x{AD}livin\x{AD}ever\x{AD}givin\x{AD}cool\x{AD}fizzin\x{AD}lip\x{AD}" + hyphen string "-"
+                text run at (2,20) width 671: "smackin\x{AD}thirst\x{AD}quenchin\x{AD}acetastin\x{AD}motivatin\x{AD}good\x{AD}buzzin\x{AD}cool\x{AD}talkin\x{AD}high\x{AD}walkin\x{AD}fast\x{AD}livin\x{AD}ever\x{AD}givin\x{AD}cool\x{AD}fizzin\x{AD}lip\x{AD}" + hyphen string "-"
+                text run at (2,38) width 649: "smackin\x{AD}thirst\x{AD}quenchin\x{AD}acetastin\x{AD}motivatin\x{AD}good\x{AD}buzzin\x{AD}cool\x{AD}talkin\x{AD}high\x{AD}walkin\x{AD}fast\x{AD}livin\x{AD}ever\x{AD}givin\x{AD}cool\x{AD}fizzin"
           LayoutTableRow {TR} at (0,62) size 769x22
             LayoutTableCell {TH} at (2,62) size 52x22 [bgcolor=#F8F8F8] [border: (1px solid #EEEEEE)] [r=1 c=0 rs=1 cs=1]
               LayoutText {#text} at (18,2) size 16x18
@@ -255,9 +255,9 @@
               LayoutText {#text} at (2,3) size 485x18
                 text run at (2,3) width 485: "'Cept Nut'in Safari\x{2019}s \x{2018}Sure\x{2019} Nai\x{308}ve R\x{E9}sum\x{E9}\x{2014}H\x{E1}c\x{30C}ek Full\x{2010}Time One-To-One"
               LayoutBR {BR} at (486,17) size 1x0
-              LayoutText {#text} at (2,22) size 365x18
-                text run at (2,22) width 365: "\"Newcastle\x{2011}Upon\x{2011}Tyne\" Washington\x{2011}On\x{2011}The\x{2011}Brazos"
-              LayoutBR {BR} at (366,36) size 1x0
+              LayoutText {#text} at (2,22) size 363x18
+                text run at (2,22) width 363: "\"Newcastle\x{2011}Upon\x{2011}Tyne\" Washington\x{2011}On\x{2011}The\x{2011}Brazos"
+              LayoutBR {BR} at (364,36) size 1x0
               LayoutInline {SPAN} at (0,0) size 35x18
                 LayoutText {#text} at (2,40) size 35x18
                   text run at (2,40) width 35: "Earth"
@@ -274,8 +274,8 @@
               LayoutInline {SPAN} at (0,0) size 42x18
                 LayoutText {#text} at (201,40) size 42x18
                   text run at (201,40) width 42: "burger"
-              LayoutText {#text} at (242,40) size 129x18
-                text run at (242,40) width 129: " [House] ~Six -Big-"
+              LayoutText {#text} at (242,40) size 128x18
+                text run at (242,40) width 128: " [House] ~Six -Big-"
           LayoutTableRow {TR} at (0,173) size 769x22
             LayoutTableCell {TH} at (2,173) size 52x22 [bgcolor=#F8F8F8] [border: (1px solid #EEEEEE)] [r=4 c=0 rs=1 cs=1]
               LayoutText {#text} at (19,2) size 14x18
@@ -288,18 +288,18 @@
               LayoutText {#text} at (20,2) size 12x18
                 text run at (20,2) width 12: "fr"
             LayoutTableCell {TD} at (56,197) size 711x26 [border: (1px solid #EEEEEE)] [r=5 c=1 rs=1 cs=1]
-              LayoutText {#text} at (2,6) size 235x18
-                text run at (2,6) width 235: "Quelqu'un L\x{2019}amour T'appelles\x{2011}Tu 3"
+              LayoutText {#text} at (2,6) size 233x18
+                text run at (2,6) width 233: "Quelqu'un L\x{2019}amour T'appelles\x{2011}Tu 3"
               LayoutInline {SUP} at (0,0) size 23x15
-                LayoutText {#text} at (236,2) size 23x15
-                  text run at (236,2) width 23: "eme"
+                LayoutText {#text} at (234,2) size 23x15
+                  text run at (234,2) width 23: "eme"
           LayoutTableRow {TR} at (0,225) size 769x23
             LayoutTableCell {TH} at (2,225) size 52x22 [bgcolor=#F8F8F8] [border: (1px solid #EEEEEE)] [r=6 c=0 rs=1 cs=1]
               LayoutText {#text} at (18,2) size 16x18
                 text run at (18,2) width 16: "hu"
             LayoutTableCell {TD} at (56,225) size 711x23 [border: (1px solid #EEEEEE)] [r=6 c=1 rs=1 cs=1]
-              LayoutText {#text} at (2,3) size 125x18
-                text run at (2,3) width 125: "11-Ei London\x{2011}Ban"
+              LayoutText {#text} at (2,3) size 124x18
+                text run at (2,3) width 124: "11-Ei London\x{2011}Ban"
           LayoutTableRow {TR} at (0,250) size 769x22
             LayoutTableCell {TH} at (2,250) size 52x22 [bgcolor=#F8F8F8] [border: (1px solid #EEEEEE)] [r=7 c=0 rs=1 cs=1]
               LayoutText {#text} at (19,2) size 14x18
@@ -319,12 +319,12 @@
               LayoutText {#text} at (19,2) size 14x18
                 text run at (19,2) width 14: "ru"
             LayoutTableCell {TD} at (56,298) size 711x22 [border: (1px solid #EEEEEE)] [r=9 c=1 rs=1 cs=1]
-              LayoutText {#text} at (2,2) size 208x18
-                text run at (2,2) width 208: "\x{41D}\x{44C}\x{44E}-\x{419}\x{43E}\x{440}\x{43A} 1990-\x{425} 14-Vii-1789"
+              LayoutText {#text} at (2,2) size 207x18
+                text run at (2,2) width 207: "\x{41D}\x{44C}\x{44E}-\x{419}\x{43E}\x{440}\x{43A} 1990-\x{425} 14-Vii-1789"
           LayoutTableRow {TR} at (0,322) size 769x22
             LayoutTableCell {TH} at (2,322) size 52x22 [bgcolor=#F8F8F8] [border: (1px solid #EEEEEE)] [r=10 c=0 rs=1 cs=1]
               LayoutText {#text} at (17,2) size 18x18
                 text run at (17,2) width 18: "tlh"
             LayoutTableCell {TD} at (56,322) size 711x22 [border: (1px solid #EEEEEE)] [r=10 c=1 rs=1 cs=1]
-              LayoutText {#text} at (2,2) size 207x18
-                text run at (2,2) width 207: "TlhIngan Hol Wa''Uy' Loghqam"
+              LayoutText {#text} at (2,2) size 206x18
+                text run at (2,2) width 206: "TlhIngan Hol Wa''Uy' Loghqam"
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/capitalize-empty-generated-string-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/text/capitalize-empty-generated-string-expected.png
index 1210a7b..193d345 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/capitalize-empty-generated-string-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/capitalize-empty-generated-string-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/capitalize-empty-generated-string-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/text/capitalize-empty-generated-string-expected.txt
index e78268ee..92bd2ba 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/capitalize-empty-generated-string-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/capitalize-empty-generated-string-expected.txt
@@ -7,12 +7,12 @@
         LayoutText {#text} at (0,0) size 177x18
           text run at (0,0) width 177: "This is a regression test for "
         LayoutInline {I} at (0,0) size 782x36
-          LayoutInline {A} at (0,0) size 355x18 [color=#0000EE]
-            LayoutText {#text} at (176,0) size 355x18
-              text run at (176,0) width 355: "http://bugzilla.opendarwin.org/show_bug.cgi?id=9432"
-          LayoutText {#text} at (530,0) size 782x36
-            text run at (530,0) width 5: " "
-            text run at (534,0) width 248: "REGRESSION: crash in capitalization"
+          LayoutInline {A} at (0,0) size 354x18 [color=#0000EE]
+            LayoutText {#text} at (176,0) size 354x18
+              text run at (176,0) width 354: "http://bugzilla.opendarwin.org/show_bug.cgi?id=9432"
+          LayoutText {#text} at (529,0) size 782x36
+            text run at (529,0) width 5: " "
+            text run at (533,0) width 249: "REGRESSION: crash in capitalization"
             text run at (0,18) width 278: "code due to empty-string generated content"
         LayoutText {#text} at (277,18) size 5x18
           text run at (277,18) width 5: "."
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/capitalize-preserve-nbsp-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/text/capitalize-preserve-nbsp-expected.png
index 834fcbf4..28b39a2 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/capitalize-preserve-nbsp-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/capitalize-preserve-nbsp-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/capitalize-preserve-nbsp-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/text/capitalize-preserve-nbsp-expected.txt
index 56f58de..0fdde64 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/capitalize-preserve-nbsp-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/capitalize-preserve-nbsp-expected.txt
@@ -4,15 +4,15 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x600
     LayoutBlockFlow {BODY} at (8,8) size 784x576
       LayoutBlockFlow {P} at (0,0) size 784x36
-        LayoutText {#text} at (0,0) size 55x18
-          text run at (0,0) width 55: "Test for "
-        LayoutInline {I} at (0,0) size 781x36
-          LayoutInline {A} at (0,0) size 306x18 [color=#0000EE]
-            LayoutText {#text} at (54,0) size 306x18
-              text run at (54,0) width 306: "http://bugs.webkit.org/show_bug.cgi?id=11671"
-          LayoutText {#text} at (359,0) size 781x36
-            text run at (359,0) width 5: " "
-            text run at (363,0) width 418: "REGRESSION (r13702): text-transform: capitalize changes non-"
+        LayoutText {#text} at (0,0) size 54x18
+          text run at (0,0) width 54: "Test for "
+        LayoutInline {I} at (0,0) size 779x36
+          LayoutInline {A} at (0,0) size 304x18 [color=#0000EE]
+            LayoutText {#text} at (53,0) size 304x18
+              text run at (53,0) width 304: "http://bugs.webkit.org/show_bug.cgi?id=11671"
+          LayoutText {#text} at (356,0) size 779x36
+            text run at (356,0) width 5: " "
+            text run at (360,0) width 419: "REGRESSION (r13702): text-transform: capitalize changes non-"
             text run at (0,18) width 167: "breaking spaces to spaces"
         LayoutText {#text} at (166,18) size 5x18
           text run at (166,18) width 5: "."
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/caps-lock-indicator-disabled-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/text/caps-lock-indicator-disabled-expected.png
index a741dfb..ba8498b 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/caps-lock-indicator-disabled-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/caps-lock-indicator-disabled-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/caps-lock-indicator-disabled-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/text/caps-lock-indicator-disabled-expected.txt
index 479de68f..319ddcbf 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/caps-lock-indicator-disabled-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/caps-lock-indicator-disabled-expected.txt
@@ -3,9 +3,9 @@
 layer at (0,0) size 800x53
   LayoutBlockFlow {HTML} at (0,0) size 800x53
     LayoutBlockFlow {BODY} at (8,8) size 784x37
-      LayoutText {#text} at (0,0) size 587x18
-        text run at (0,0) width 587: "Test passes if password field does not include caps lock icon on right edge on any platform."
-      LayoutBR {BR} at (586,0) size 1x18
+      LayoutText {#text} at (0,0) size 585x18
+        text run at (0,0) width 585: "Test passes if password field does not include caps lock icon on right edge on any platform."
+      LayoutBR {BR} at (584,0) size 1x18
       LayoutTextControl {INPUT} at (0,18) size 131x19 [bgcolor=#FFFFFF] [border: (2px inset #EEEEEE)]
       LayoutText {#text} at (0,0) size 0x0
       LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/caps-lock-indicator-enabled-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/text/caps-lock-indicator-enabled-expected.png
index 9388798..50430c3 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/caps-lock-indicator-enabled-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/caps-lock-indicator-enabled-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/caps-lock-indicator-enabled-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/text/caps-lock-indicator-enabled-expected.txt
index ce578abe..37cd962 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/caps-lock-indicator-enabled-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/caps-lock-indicator-enabled-expected.txt
@@ -3,9 +3,9 @@
 layer at (0,0) size 800x53
   LayoutBlockFlow {HTML} at (0,0) size 800x53
     LayoutBlockFlow {BODY} at (8,8) size 784x37
-      LayoutText {#text} at (0,0) size 580x18
-        text run at (0,0) width 580: "Test passes if password field includes caps lock icon on right edge on Mac platforms only."
-      LayoutBR {BR} at (579,0) size 1x18
+      LayoutText {#text} at (0,0) size 577x18
+        text run at (0,0) width 577: "Test passes if password field includes caps lock icon on right edge on Mac platforms only."
+      LayoutBR {BR} at (576,0) size 1x18
       LayoutTextControl {INPUT} at (0,18) size 131x19 [bgcolor=#FFFFFF] [border: (2px inset #EEEEEE)]
       LayoutText {#text} at (0,0) size 0x0
       LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/cg-fallback-bolding-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/text/cg-fallback-bolding-expected.png
index 8246253..a8965898 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/cg-fallback-bolding-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/cg-fallback-bolding-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/cg-fallback-bolding-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/text/cg-fallback-bolding-expected.txt
index 42a9058..b289eb6 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/cg-fallback-bolding-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/cg-fallback-bolding-expected.txt
@@ -6,12 +6,12 @@
       LayoutBlockFlow {P} at (0,0) size 784x72
         LayoutText {#text} at (0,0) size 767x72
           text run at (0,0) width 449: "The single Hebrew glyph below should be in the Lucida Grande font. "
-          text run at (448,0) width 318: "It should not be a synthetic bold, because the first"
+          text run at (448,0) width 317: "It should not be a synthetic bold, because the first"
           text run at (0,18) width 308: "font in the list (Ahem) does not have the glyph. "
           text run at (307,18) width 442: "Therefore we fall back to the second font in the list (Lucida Grande),"
           text run at (0,36) width 165: "which does support bold. "
           text run at (164,36) width 603: "This test is making sure we don't make incorrect assumptions based off the fact that we would"
-          text run at (0,54) width 324: "have to synthesize bold for the first font in the list."
+          text run at (0,54) width 323: "have to synthesize bold for the first font in the list."
       LayoutBlockFlow {P} at (0,200) size 784x151
         LayoutText {#text} at (0,22) size 84x128
           text run at (0,22) width 84 RTL: "\x{5D0}"
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/complex-text-rtl-selection-repaint-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/text/complex-text-rtl-selection-repaint-expected.png
index 3af73f6..f6ca8a8d 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/complex-text-rtl-selection-repaint-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/complex-text-rtl-selection-repaint-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/complex-text-rtl-selection-repaint-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/text/complex-text-rtl-selection-repaint-expected.txt
index 7a59560..eff4808 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/complex-text-rtl-selection-repaint-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/complex-text-rtl-selection-repaint-expected.txt
@@ -9,7 +9,7 @@
             text run at (0,0) width 82 RTL override: "m\x{300}uspimeroL"
         LayoutText {#text} at (0,0) size 0x0
       LayoutBlockFlow {P} at (0,34) size 784x18
-        LayoutText {#text} at (0,0) size 409x18
-          text run at (0,0) width 409: "Tests that rtl selections are repainted correctly for complex text."
+        LayoutText {#text} at (0,0) size 408x18
+          text run at (0,0) width 408: "Tests that rtl selections are repainted correctly for complex text."
 selection start: position 2 of child 0 {#text} of child 3 {BDO} of body
 selection end:   position 6 of child 0 {#text} of child 3 {BDO} of body
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/decorations-with-text-combine-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/text/decorations-with-text-combine-expected.png
index 39e8a19c..3bd73e68 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/decorations-with-text-combine-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/decorations-with-text-combine-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/decorations-with-text-combine-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/text/decorations-with-text-combine-expected.txt
index 07f250f..3018263 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/decorations-with-text-combine-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/decorations-with-text-combine-expected.txt
@@ -20,8 +20,8 @@
           LayoutInline {SPAN} at (0,0) size 24x24 [color=#0000FF]
             LayoutTextCombine {#text} at (6,288) size 24x24
               text run at (6,288) width 24: "12345"
-          LayoutText {#text} at (6,312) size 24x168
-            text run at (6,312) width 168: "\x{6765}\x{3066}\x{304F}\x{308C}\x{308B}\x{307E}\x{3067}"
+          LayoutText {#text} at (6,312) size 24x167
+            text run at (6,312) width 167: "\x{6765}\x{3066}\x{304F}\x{308C}\x{308B}\x{307E}\x{3067}"
         LayoutBlockFlow {DIV} at (46,0) size 36x584
           LayoutText {#text} at (6,0) size 24x72
             text run at (6,0) width 72: "\x{305D}\x{306E}\x{5973}"
@@ -38,8 +38,8 @@
           LayoutInline {SPAN} at (0,0) size 24x24 [color=#0000FF]
             LayoutTextCombine {#text} at (6,288) size 24x24
               text run at (6,288) width 24: "12345"
-          LayoutText {#text} at (6,312) size 24x168
-            text run at (6,312) width 168: "\x{6765}\x{3066}\x{304F}\x{308C}\x{308B}\x{307E}\x{3067}"
+          LayoutText {#text} at (6,312) size 24x167
+            text run at (6,312) width 167: "\x{6765}\x{3066}\x{304F}\x{308C}\x{308B}\x{307E}\x{3067}"
       LayoutBlockFlow {DIV} at (92,0) size 82x584
         LayoutBlockFlow {DIV} at (0,0) size 36x584
           LayoutText {#text} at (6,0) size 24x72
@@ -57,8 +57,8 @@
           LayoutInline {SPAN} at (0,0) size 24x24 [color=#0000FF]
             LayoutTextCombine {#text} at (6,288) size 24x24
               text run at (6,288) width 24: "12345"
-          LayoutText {#text} at (6,312) size 24x168
-            text run at (6,312) width 168: "\x{6765}\x{3066}\x{304F}\x{308C}\x{308B}\x{307E}\x{3067}"
+          LayoutText {#text} at (6,312) size 24x167
+            text run at (6,312) width 167: "\x{6765}\x{3066}\x{304F}\x{308C}\x{308B}\x{307E}\x{3067}"
         LayoutBlockFlow {DIV} at (46,0) size 36x584
           LayoutText {#text} at (6,0) size 24x72
             text run at (6,0) width 72: "\x{305D}\x{306E}\x{5973}"
@@ -75,8 +75,8 @@
           LayoutInline {SPAN} at (0,0) size 24x24 [color=#0000FF]
             LayoutTextCombine {#text} at (6,288) size 24x24
               text run at (6,288) width 24: "12345"
-          LayoutText {#text} at (6,312) size 24x168
-            text run at (6,312) width 168: "\x{6765}\x{3066}\x{304F}\x{308C}\x{308B}\x{307E}\x{3067}"
+          LayoutText {#text} at (6,312) size 24x167
+            text run at (6,312) width 167: "\x{6765}\x{3066}\x{304F}\x{308C}\x{308B}\x{307E}\x{3067}"
       LayoutBlockFlow {DIV} at (184,0) size 82x584
         LayoutBlockFlow {DIV} at (0,0) size 36x584
           LayoutText {#text} at (6,0) size 24x72
@@ -94,8 +94,8 @@
           LayoutInline {SPAN} at (0,0) size 24x24 [color=#0000FF]
             LayoutTextCombine {#text} at (6,288) size 24x24
               text run at (6,288) width 24: "12345"
-          LayoutText {#text} at (6,312) size 24x168
-            text run at (6,312) width 168: "\x{6765}\x{3066}\x{304F}\x{308C}\x{308B}\x{307E}\x{3067}"
+          LayoutText {#text} at (6,312) size 24x167
+            text run at (6,312) width 167: "\x{6765}\x{3066}\x{304F}\x{308C}\x{308B}\x{307E}\x{3067}"
         LayoutBlockFlow {DIV} at (46,0) size 36x584
           LayoutText {#text} at (6,0) size 24x72
             text run at (6,0) width 72: "\x{305D}\x{306E}\x{5973}"
@@ -112,8 +112,8 @@
           LayoutInline {SPAN} at (0,0) size 24x24 [color=#0000FF]
             LayoutTextCombine {#text} at (6,288) size 24x24
               text run at (6,288) width 24: "12345"
-          LayoutText {#text} at (6,312) size 24x168
-            text run at (6,312) width 168: "\x{6765}\x{3066}\x{304F}\x{308C}\x{308B}\x{307E}\x{3067}"
+          LayoutText {#text} at (6,312) size 24x167
+            text run at (6,312) width 167: "\x{6765}\x{3066}\x{304F}\x{308C}\x{308B}\x{307E}\x{3067}"
       LayoutBlockFlow {DIV} at (276,0) size 94x584
         LayoutBlockFlow {DIV} at (0,0) size 42x584
           LayoutText {#text} at (12,0) size 24x72
@@ -131,8 +131,8 @@
           LayoutInline {SPAN} at (0,0) size 24x24 [color=#0000FF]
             LayoutTextCombine {#text} at (12,288) size 24x24
               text run at (12,288) width 24: "12345"
-          LayoutText {#text} at (12,312) size 24x168
-            text run at (12,312) width 168: "\x{6765}\x{3066}\x{304F}\x{308C}\x{308B}\x{307E}\x{3067}"
+          LayoutText {#text} at (12,312) size 24x167
+            text run at (12,312) width 167: "\x{6765}\x{3066}\x{304F}\x{308C}\x{308B}\x{307E}\x{3067}"
         LayoutBlockFlow {DIV} at (52,0) size 42x584
           LayoutText {#text} at (12,0) size 24x72
             text run at (12,0) width 72: "\x{305D}\x{306E}\x{5973}"
@@ -149,5 +149,5 @@
           LayoutInline {SPAN} at (0,0) size 24x24 [color=#0000FF]
             LayoutTextCombine {#text} at (12,288) size 24x24
               text run at (12,288) width 24: "12345"
-          LayoutText {#text} at (12,312) size 24x168
-            text run at (12,312) width 168: "\x{6765}\x{3066}\x{304F}\x{308C}\x{308B}\x{307E}\x{3067}"
+          LayoutText {#text} at (12,312) size 24x167
+            text run at (12,312) width 167: "\x{6765}\x{3066}\x{304F}\x{308C}\x{308B}\x{307E}\x{3067}"
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/delete-hard-break-character-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/text/delete-hard-break-character-expected.png
index 5d68d3f..7190d85a 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/delete-hard-break-character-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/delete-hard-break-character-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/delete-hard-break-character-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/text/delete-hard-break-character-expected.txt
index 6d481d2..e771897 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/delete-hard-break-character-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/delete-hard-break-character-expected.txt
@@ -4,18 +4,18 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x600
     LayoutBlockFlow {BODY} at (8,8) size 784x584
       LayoutBlockFlow {P} at (0,0) size 784x36
-        LayoutText {#text} at (0,0) size 55x18
-          text run at (0,0) width 55: "Test for "
-        LayoutInline {I} at (0,0) size 680x36
-          LayoutInline {A} at (0,0) size 306x18 [color=#0000EE]
-            LayoutText {#text} at (54,0) size 306x18
-              text run at (54,0) width 306: "http://bugs.webkit.org/show_bug.cgi?id=10144"
-          LayoutText {#text} at (359,0) size 680x36
-            text run at (359,0) width 5: " "
-            text run at (363,0) width 317: "REGRESSION: Reproducible assertion failure in"
-            text run at (0,18) width 294: "DeleteSelectionCommand::fixupWhitespace()"
-        LayoutText {#text} at (293,18) size 5x18
-          text run at (293,18) width 5: "."
+        LayoutText {#text} at (0,0) size 54x18
+          text run at (0,0) width 54: "Test for "
+        LayoutInline {I} at (0,0) size 677x36
+          LayoutInline {A} at (0,0) size 305x18 [color=#0000EE]
+            LayoutText {#text} at (53,0) size 305x18
+              text run at (53,0) width 305: "http://bugs.webkit.org/show_bug.cgi?id=10144"
+          LayoutText {#text} at (357,0) size 677x36
+            text run at (357,0) width 5: " "
+            text run at (361,0) width 316: "REGRESSION: Reproducible assertion failure in"
+            text run at (0,18) width 293: "DeleteSelectionCommand::fixupWhitespace()"
+        LayoutText {#text} at (292,18) size 5x18
+          text run at (292,18) width 5: "."
       LayoutBlockFlow {DIV} at (0,52) size 784x100
         LayoutText {#text} at (0,0) size 0x18
           text run at (0,0) width 0: " "
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/ellipsis-platform-font-change-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/text/ellipsis-platform-font-change-expected.png
index 869d399..578878a 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/ellipsis-platform-font-change-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/ellipsis-platform-font-change-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/emphasis-ellipsis-complextext-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/text/emphasis-ellipsis-complextext-expected.png
index 9b299be9..027adff8 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/emphasis-ellipsis-complextext-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/emphasis-ellipsis-complextext-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/emphasis-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/text/emphasis-expected.png
index d6e0a52..adf24a5 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/emphasis-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/emphasis-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/emphasis-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/text/emphasis-expected.txt
index 5acf6fc..cd04023e 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/emphasis-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/emphasis-expected.txt
@@ -18,7 +18,7 @@
         LayoutText {#text} at (112,73) size 334x70
           text run at (112,73) width 13: ", "
           text run at (124,73) width 213: "lobortis eu iaculis vel,"
-          text run at (3,115) width 209: "scelerisque nec dolor."
+          text run at (3,115) width 208: "scelerisque nec dolor."
       LayoutBlockFlow (floating) {DIV} at (390,8) size 366x146 [border: (3px solid #000000)]
         LayoutText {#text} at (3,3) size 273x28
           text run at (3,3) width 273: "Lorem ipsum dolor sit amet,"
@@ -94,7 +94,7 @@
         LayoutText {#text} at (198,108) size 334x56
           text run at (198,108) width 7: " "
           text run at (204,108) width 133: "eu iaculis vel,"
-          text run at (3,136) width 209: "scelerisque nec dolor."
+          text run at (3,136) width 208: "scelerisque nec dolor."
       LayoutBlockFlow (floating) {DIV} at (390,170) size 366x167 [border: (3px solid #000000)]
         LayoutText {#text} at (3,3) size 70x28
           text run at (3,3) width 70: "Lorem "
@@ -154,7 +154,7 @@
         LayoutText {#text} at (198,91) size 334x73
           text run at (198,91) width 7: " "
           text run at (204,91) width 133: "eu iaculis vel,"
-          text run at (3,136) width 209: "scelerisque nec dolor."
+          text run at (3,136) width 208: "scelerisque nec dolor."
       LayoutBlockFlow (floating) {DIV} at (8,353) size 366x198 [border: (3px solid #000000)]
         LayoutText {#text} at (3,13) size 273x28
           text run at (3,13) width 273: "Lorem ipsum dolor sit amet,"
@@ -170,7 +170,7 @@
         LayoutText {#text} at (112,109) size 334x76
           text run at (112,109) width 13: ", "
           text run at (124,109) width 213: "lobortis eu iaculis vel,"
-          text run at (3,157) width 209: "scelerisque nec dolor."
+          text run at (3,157) width 208: "scelerisque nec dolor."
       LayoutBlockFlow (floating) {DIV} at (390,353) size 366x146 [border: (3px solid #000000)]
         LayoutText {#text} at (3,3) size 273x28
           text run at (3,3) width 273: "Lorem ipsum dolor sit amet,"
@@ -186,6 +186,6 @@
         LayoutText {#text} at (112,73) size 334x70
           text run at (112,73) width 13: ", "
           text run at (124,73) width 213: "lobortis eu iaculis vel,"
-          text run at (3,115) width 209: "scelerisque nec dolor."
+          text run at (3,115) width 208: "scelerisque nec dolor."
 selection start: position 10 of child 0 {#text} of child 1 {SPAN} of child 10 {DIV} of body
 selection end:   position 7 of child 0 {#text} of child 3 {SPAN} of child 10 {DIV} of body
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/emphasis-vertical-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/text/emphasis-vertical-expected.png
index 6189969..a61ce71c 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/emphasis-vertical-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/emphasis-vertical-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/emphasis-vertical-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/text/emphasis-vertical-expected.txt
index 6d0c6e3..c3745122 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/emphasis-vertical-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/emphasis-vertical-expected.txt
@@ -4,21 +4,21 @@
   LayoutBlockFlow {HTML} at (0,0) size 691x600
     LayoutBlockFlow {BODY} at (8,8) size 0x584
       LayoutBlockFlow (floating) {DIV} at (8,8) size 146x366 [border: (3px solid #000000)]
-        LayoutText {#text} at (12,3) size 18x270
-          text run at (12,3) width 270: "\x{305B}\x{3063}\x{304B}\x{304F}\x{898B}\x{3064}\x{3051}\x{305F}\x{3059}\x{3070}\x{3089}\x{3057}\x{3044}\x{8A18}\x{4E8B}"
-        LayoutInline {SPAN} at (0,0) size 45x360
-          LayoutText {#text} at (12,273) size 45x360
-            text run at (12,273) width 90: "\x{304C}\x{3069}\x{3053}\x{306B}\x{3042}"
+        LayoutText {#text} at (12,3) size 18x269
+          text run at (12,3) width 269: "\x{305B}\x{3063}\x{304B}\x{304F}\x{898B}\x{3064}\x{3051}\x{305F}\x{3059}\x{3070}\x{3089}\x{3057}\x{3044}\x{8A18}\x{4E8B}"
+        LayoutInline {SPAN} at (0,0) size 45x359
+          LayoutText {#text} at (12,271) size 45x359
+            text run at (12,271) width 90: "\x{304C}\x{3069}\x{3053}\x{306B}\x{3042}"
             text run at (39,3) width 144: "\x{3063}\x{305F}\x{304B}\x{5FD8}\x{308C}\x{3066}\x{3057}\x{307E}"
-        LayoutText {#text} at (39,147) size 18x180
-          text run at (39,147) width 180: "\x{3063}\x{305F}\x{7D4C}\x{9A13}\x{306F}\x{3042}\x{308A}\x{307E}\x{3059}\x{304B}"
+        LayoutText {#text} at (39,146) size 18x181
+          text run at (39,146) width 180: "\x{3063}\x{305F}\x{7D4C}\x{9A13}\x{306F}\x{3042}\x{308A}\x{307E}\x{3059}\x{304B}"
         LayoutInline {SPAN} at (0,0) size 45x360
-          LayoutText {#text} at (39,327) size 45x360
-            text run at (39,327) width 36: "\x{306A}\x{3089}"
-            text run at (66,3) width 270: "\x{30BF}\x{30A4}\x{30C8}\x{30EB}\x{3068}\x{30A2}\x{30C9}\x{30EC}\x{30B9}\x{3060}\x{3051}\x{3067}\x{306A}\x{304F}\x{3001}"
-        LayoutText {#text} at (66,273) size 72x360
-          text run at (66,273) width 90: "\x{8A2A}\x{554F}\x{3057}\x{305F}\x{30A6}"
-          text run at (93,3) width 360: "\x{30A7}\x{30D6}\x{30DA}\x{30FC}\x{30B8}\x{306E}\x{30B3}\x{30F3}\x{30C6}\x{30F3}\x{30C4}\x{304B}\x{3089}\x{3082}\x{691C}\x{7D22}\x{3059}\x{308B}\x{3053}\x{3068}"
+          LayoutText {#text} at (39,326) size 45x360
+            text run at (39,326) width 36: "\x{306A}\x{3089}"
+            text run at (66,3) width 269: "\x{30BF}\x{30A4}\x{30C8}\x{30EB}\x{3068}\x{30A2}\x{30C9}\x{30EC}\x{30B9}\x{3060}\x{3051}\x{3067}\x{306A}\x{304F}\x{3001}"
+        LayoutText {#text} at (66,271) size 72x359
+          text run at (66,271) width 90: "\x{8A2A}\x{554F}\x{3057}\x{305F}\x{30A6}"
+          text run at (93,3) width 356: "\x{30A7}\x{30D6}\x{30DA}\x{30FC}\x{30B8}\x{306E}\x{30B3}\x{30F3}\x{30C6}\x{30F3}\x{30C4}\x{304B}\x{3089}\x{3082}\x{691C}\x{7D22}\x{3059}\x{308B}\x{3053}\x{3068}"
           text run at (120,3) width 107: "\x{304C}\x{3067}\x{304D}\x{307E}\x{3059}\x{3002}"
       LayoutBlockFlow (floating) {DIV} at (170,8) size 146x366 [border: (3px solid #000000)]
         LayoutText {#text} at (12,3) size 18x54
@@ -49,12 +49,12 @@
           LayoutText {#text} at (39,327) size 45x360
             text run at (39,327) width 36: "\x{306A}\x{3089}"
             text run at (66,3) width 90: "\x{30BF}\x{30A4}\x{30C8}\x{30EB}\x{3068}"
-        LayoutInline {SPAN} at (0,0) size 18x144
-          LayoutText {#text} at (66,93) size 18x144
-            text run at (66,93) width 144: "\x{30A2}\x{30C9}\x{30EC}\x{30B9}\x{3060}\x{3051}\x{3067}\x{306A}"
-        LayoutInline {SPAN} at (0,0) size 18x126
-          LayoutText {#text} at (66,237) size 18x126
-            text run at (66,237) width 126: "\x{304F}\x{3001}\x{8A2A}\x{554F}\x{3057}\x{305F}\x{30A6}"
+        LayoutInline {SPAN} at (0,0) size 18x145
+          LayoutText {#text} at (66,92) size 18x145
+            text run at (66,92) width 144: "\x{30A2}\x{30C9}\x{30EC}\x{30B9}\x{3060}\x{3051}\x{3067}\x{306A}"
+        LayoutInline {SPAN} at (0,0) size 18x127
+          LayoutText {#text} at (66,236) size 18x127
+            text run at (66,236) width 126: "\x{304F}\x{3001}\x{8A2A}\x{554F}\x{3057}\x{305F}\x{30A6}"
         LayoutInline {SPAN} at (0,0) size 18x162
           LayoutText {#text} at (93,3) size 18x162
             text run at (93,3) width 162: "\x{30A7}\x{30D6}\x{30DA}\x{30FC}\x{30B8}\x{306E}\x{30B3}\x{30F3}\x{30C6}"
@@ -90,12 +90,12 @@
           LayoutText {#text} at (34,327) size 45x360
             text run at (34,327) width 36: "\x{306A}\x{3089}"
             text run at (61,3) width 90: "\x{30BF}\x{30A4}\x{30C8}\x{30EB}\x{3068}"
-        LayoutInline {SPAN} at (0,0) size 18x144
-          LayoutText {#text} at (61,93) size 18x144
-            text run at (61,93) width 144: "\x{30A2}\x{30C9}\x{30EC}\x{30B9}\x{3060}\x{3051}\x{3067}\x{306A}"
-        LayoutInline {SPAN} at (0,0) size 18x126
-          LayoutText {#text} at (61,237) size 18x126
-            text run at (61,237) width 126: "\x{304F}\x{3001}\x{8A2A}\x{554F}\x{3057}\x{305F}\x{30A6}"
+        LayoutInline {SPAN} at (0,0) size 18x145
+          LayoutText {#text} at (61,92) size 18x145
+            text run at (61,92) width 144: "\x{30A2}\x{30C9}\x{30EC}\x{30B9}\x{3060}\x{3051}\x{3067}\x{306A}"
+        LayoutInline {SPAN} at (0,0) size 18x127
+          LayoutText {#text} at (61,236) size 18x127
+            text run at (61,236) width 126: "\x{304F}\x{3001}\x{8A2A}\x{554F}\x{3057}\x{305F}\x{30A6}"
         LayoutInline {SPAN} at (0,0) size 18x162
           LayoutText {#text} at (88,3) size 18x162
             text run at (88,3) width 162: "\x{30A7}\x{30D6}\x{30DA}\x{30FC}\x{30B8}\x{306E}\x{30B3}\x{30F3}\x{30C6}"
@@ -103,19 +103,19 @@
           text run at (88,165) width 198: "\x{30F3}\x{30C4}\x{304B}\x{3089}\x{3082}\x{691C}\x{7D22}\x{3059}\x{308B}\x{3053}\x{3068}"
           text run at (115,3) width 107: "\x{304C}\x{3067}\x{304D}\x{307E}\x{3059}\x{3002}"
       LayoutBlockFlow (floating) {DIV} at (489,8) size 186x366 [border: (3px solid #000000)]
-        LayoutText {#text} at (12,3) size 18x270
-          text run at (12,3) width 270: "\x{305B}\x{3063}\x{304B}\x{304F}\x{898B}\x{3064}\x{3051}\x{305F}\x{3059}\x{3070}\x{3089}\x{3057}\x{3044}\x{8A18}\x{4E8B}"
-        LayoutInline {SPAN} at (0,0) size 54x360
-          LayoutText {#text} at (12,273) size 54x360
-            text run at (12,273) width 90: "\x{304C}\x{3069}\x{3053}\x{306B}\x{3042}"
+        LayoutText {#text} at (12,3) size 18x269
+          text run at (12,3) width 269: "\x{305B}\x{3063}\x{304B}\x{304F}\x{898B}\x{3064}\x{3051}\x{305F}\x{3059}\x{3070}\x{3089}\x{3057}\x{3044}\x{8A18}\x{4E8B}"
+        LayoutInline {SPAN} at (0,0) size 54x359
+          LayoutText {#text} at (12,271) size 54x359
+            text run at (12,271) width 90: "\x{304C}\x{3069}\x{3053}\x{306B}\x{3042}"
             text run at (48,3) width 144: "\x{3063}\x{305F}\x{304B}\x{5FD8}\x{308C}\x{3066}\x{3057}\x{307E}"
-        LayoutText {#text} at (48,147) size 18x180
-          text run at (48,147) width 180: "\x{3063}\x{305F}\x{7D4C}\x{9A13}\x{306F}\x{3042}\x{308A}\x{307E}\x{3059}\x{304B}"
+        LayoutText {#text} at (48,146) size 18x181
+          text run at (48,146) width 180: "\x{3063}\x{305F}\x{7D4C}\x{9A13}\x{306F}\x{3042}\x{308A}\x{307E}\x{3059}\x{304B}"
         LayoutInline {SPAN} at (0,0) size 54x360
-          LayoutText {#text} at (48,327) size 54x360
-            text run at (48,327) width 36: "\x{306A}\x{3089}"
-            text run at (84,3) width 270: "\x{30BF}\x{30A4}\x{30C8}\x{30EB}\x{3068}\x{30A2}\x{30C9}\x{30EC}\x{30B9}\x{3060}\x{3051}\x{3067}\x{306A}\x{304F}\x{3001}"
-        LayoutText {#text} at (84,273) size 90x360
-          text run at (84,273) width 90: "\x{8A2A}\x{554F}\x{3057}\x{305F}\x{30A6}"
-          text run at (120,3) width 360: "\x{30A7}\x{30D6}\x{30DA}\x{30FC}\x{30B8}\x{306E}\x{30B3}\x{30F3}\x{30C6}\x{30F3}\x{30C4}\x{304B}\x{3089}\x{3082}\x{691C}\x{7D22}\x{3059}\x{308B}\x{3053}\x{3068}"
+          LayoutText {#text} at (48,326) size 54x360
+            text run at (48,326) width 36: "\x{306A}\x{3089}"
+            text run at (84,3) width 269: "\x{30BF}\x{30A4}\x{30C8}\x{30EB}\x{3068}\x{30A2}\x{30C9}\x{30EC}\x{30B9}\x{3060}\x{3051}\x{3067}\x{306A}\x{304F}\x{3001}"
+        LayoutText {#text} at (84,271) size 90x359
+          text run at (84,271) width 90: "\x{8A2A}\x{554F}\x{3057}\x{305F}\x{30A6}"
+          text run at (120,3) width 356: "\x{30A7}\x{30D6}\x{30DA}\x{30FC}\x{30B8}\x{306E}\x{30B3}\x{30F3}\x{30C6}\x{30F3}\x{30C4}\x{304B}\x{3089}\x{3082}\x{691C}\x{7D22}\x{3059}\x{308B}\x{3053}\x{3068}"
           text run at (156,3) width 107: "\x{304C}\x{3067}\x{304D}\x{307E}\x{3059}\x{3002}"
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/fake-italic-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/text/fake-italic-expected.png
index 4963cd2..6e886c1 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/fake-italic-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/fake-italic-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/fake-italic-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/text/fake-italic-expected.txt
index 979a0ab..223f651 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/fake-italic-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/fake-italic-expected.txt
@@ -5,9 +5,9 @@
     LayoutBlockFlow {BODY} at (8,8) size 784x576
       LayoutBlockFlow {P} at (0,0) size 784x54
         LayoutText {#text} at (0,0) size 778x54
-          text run at (0,0) width 759: "This layout test is designed to test that our fake italic mode is working correctly. The Ahem font, used below, does not"
+          text run at (0,0) width 756: "This layout test is designed to test that our fake italic mode is working correctly. The Ahem font, used below, does not"
           text run at (0,18) width 778: "include an italic variant. Thus, when we ask for italic Ahem, we should skew the glyphs ourselves, resulting in a series of"
-          text run at (0,36) width 160: "italic black boxes below."
+          text run at (0,36) width 159: "italic black boxes below."
       LayoutBlockFlow {P} at (0,70) size 784x16
         LayoutText {#text} at (0,0) size 112x16
           text run at (0,0) width 112: "A A A A"
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/fallback-for-custom-font-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/text/fallback-for-custom-font-expected.png
index 75ccf08a..22ceb48 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/fallback-for-custom-font-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/fallback-for-custom-font-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/fallback-for-custom-font-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/text/fallback-for-custom-font-expected.txt
index a15c9b9..69b2976 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/fallback-for-custom-font-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/fallback-for-custom-font-expected.txt
@@ -4,15 +4,15 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x600
     LayoutBlockFlow {BODY} at (8,8) size 784x576
       LayoutBlockFlow {P} at (0,0) size 784x36
-        LayoutText {#text} at (0,0) size 55x18
-          text run at (0,0) width 55: "Test for "
-        LayoutInline {I} at (0,0) size 712x36
+        LayoutText {#text} at (0,0) size 54x18
+          text run at (0,0) width 54: "Test for "
+        LayoutInline {I} at (0,0) size 710x36
           LayoutInline {A} at (0,0) size 160x18 [color=#0000EE]
-            LayoutText {#text} at (54,0) size 160x18
-              text run at (54,0) width 160: "http://crbug.com/373389"
-          LayoutText {#text} at (213,0) size 712x36
-            text run at (213,0) width 5: " "
-            text run at (217,0) width 495: "When a webfont is missing a glyph, synthesization from the fallback font isn't"
+            LayoutText {#text} at (53,0) size 160x18
+              text run at (53,0) width 160: "http://crbug.com/373389"
+          LayoutText {#text} at (212,0) size 710x36
+            text run at (212,0) width 5: " "
+            text run at (216,0) width 494: "When a webfont is missing a glyph, synthesization from the fallback font isn't"
             text run at (0,18) width 68: "happening"
         LayoutText {#text} at (67,18) size 5x18
           text run at (67,18) width 5: "."
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/fallback-traits-fixup-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/text/fallback-traits-fixup-expected.png
index f16f0d9b..aadd166 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/fallback-traits-fixup-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/fallback-traits-fixup-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/fallback-traits-fixup-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/text/fallback-traits-fixup-expected.txt
index a1e30a6..3697c5bd 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/fallback-traits-fixup-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/fallback-traits-fixup-expected.txt
@@ -4,17 +4,17 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x600
     LayoutBlockFlow {BODY} at (8,8) size 784x576
       LayoutBlockFlow {P} at (0,0) size 784x18
-        LayoutText {#text} at (0,0) size 55x18
-          text run at (0,0) width 55: "Test for "
-        LayoutInline {I} at (0,0) size 515x18
-          LayoutInline {A} at (0,0) size 157x18 [color=#0000EE]
-            LayoutText {#text} at (54,0) size 157x18
-              text run at (54,0) width 157: "rdar://problem/9528843"
-          LayoutText {#text} at (210,0) size 359x18
-            text run at (210,0) width 5: " "
-            text run at (214,0) width 355: "STIX glyphs not rendered on this stackoverflow answer"
-        LayoutText {#text} at (568,0) size 5x18
-          text run at (568,0) width 5: "."
+        LayoutText {#text} at (0,0) size 54x18
+          text run at (0,0) width 54: "Test for "
+        LayoutInline {I} at (0,0) size 512x18
+          LayoutInline {A} at (0,0) size 156x18 [color=#0000EE]
+            LayoutText {#text} at (53,0) size 156x18
+              text run at (53,0) width 156: "rdar://problem/9528843"
+          LayoutText {#text} at (208,0) size 357x18
+            text run at (208,0) width 5: " "
+            text run at (212,0) width 353: "STIX glyphs not rendered on this stackoverflow answer"
+        LayoutText {#text} at (564,0) size 5x18
+          text run at (564,0) width 5: "."
       LayoutBlockFlow {P} at (0,34) size 784x42
         LayoutText {#text} at (0,18) size 99x18
           text run at (0,18) width 99: "A black circle: "
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/firstline/002-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/text/firstline/002-expected.png
index f784bd4..1d7b1ab 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/firstline/002-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/firstline/002-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/firstline/002-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/text/firstline/002-expected.txt
index dfc68f5..9599c81e 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/firstline/002-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/firstline/002-expected.txt
@@ -7,5 +7,5 @@
         LayoutInline {<pseudo:first-letter>} at (0,0) size 32x41 [color=#800000]
           LayoutTextFragment (anonymous) at (2,2) size 32x41
             text run at (2,2) width 32: "M"
-        LayoutTextFragment {#text} at (34,20) size 184x18
-          text run at (34,20) width 184: "aroon on the first letter only."
+        LayoutTextFragment {#text} at (34,20) size 182x18
+          text run at (34,20) width 182: "aroon on the first letter only."
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/font-initial-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/text/font-initial-expected.png
index 65d6c99..1a77145 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/font-initial-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/font-initial-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/font-initial-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/text/font-initial-expected.txt
index 56cd94f..fbc2f7b 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/font-initial-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/font-initial-expected.txt
@@ -4,19 +4,19 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x600
     LayoutBlockFlow {BODY} at (8,8) size 784x584
       LayoutBlockFlow {P} at (0,0) size 784x18
-        LayoutText {#text} at (0,0) size 55x18
-          text run at (0,0) width 55: "Test for "
-        LayoutInline {I} at (0,0) size 631x18
-          LayoutInline {A} at (0,0) size 306x18 [color=#0000EE]
-            LayoutText {#text} at (54,0) size 306x18
-              text run at (54,0) width 306: "http://bugs.webkit.org/show_bug.cgi?id=12039"
-          LayoutText {#text} at (359,0) size 326x18
-            text run at (359,0) width 5: " "
-            text run at (363,0) width 322: "Assertion failure in WebCore::Font::primaryFont"
-        LayoutText {#text} at (684,0) size 5x18
-          text run at (684,0) width 5: "."
+        LayoutText {#text} at (0,0) size 54x18
+          text run at (0,0) width 54: "Test for "
+        LayoutInline {I} at (0,0) size 628x18
+          LayoutInline {A} at (0,0) size 305x18 [color=#0000EE]
+            LayoutText {#text} at (53,0) size 305x18
+              text run at (53,0) width 305: "http://bugs.webkit.org/show_bug.cgi?id=12039"
+          LayoutText {#text} at (357,0) size 324x18
+            text run at (357,0) width 5: " "
+            text run at (361,0) width 320: "Assertion failure in WebCore::Font::primaryFont"
+        LayoutText {#text} at (680,0) size 5x18
+          text run at (680,0) width 5: "."
       LayoutBlockFlow (anonymous) at (0,34) size 784x18
-        LayoutInline {SPAN} at (0,0) size 39x18
-          LayoutText {#text} at (0,0) size 39x18
-            text run at (0,0) width 39: "PASS"
+        LayoutInline {SPAN} at (0,0) size 37x18
+          LayoutText {#text} at (0,0) size 37x18
+            text run at (0,0) width 37: "PASS"
         LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/font-kerning-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/text/font-kerning-expected.png
index b304865..43869baa 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/font-kerning-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/font-kerning-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/font-smallcaps-layout-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/text/font-smallcaps-layout-expected.png
index f2c7083..ab8fc98 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/font-smallcaps-layout-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/font-smallcaps-layout-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/font-smallcaps-layout-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/text/font-smallcaps-layout-expected.txt
index 2c4daeb..5402fe5 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/font-smallcaps-layout-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/font-smallcaps-layout-expected.txt
@@ -3,8 +3,8 @@
 layer at (0,0) size 800x36
   LayoutBlockFlow {HTML} at (0,0) size 800x36
     LayoutBlockFlow {BODY} at (0,0) size 800x36
-      LayoutText {#text} at (0,0) size 798x36
-        text run at (0,0) width 798: "Testing for incorrect text overflow when using small caps in the complex test path. There should be no red characters visible"
+      LayoutText {#text} at (0,0) size 796x36
+        text run at (0,0) width 796: "Testing for incorrect text overflow when using small caps in the complex test path. There should be no red characters visible"
         text run at (0,18) width 146: "on the green rectangle."
       LayoutText {#text} at (0,0) size 0x0
 layer at (-500,36) size 1000x366 backgroundClip at (0,0) size 800x600 clip at (0,0) size 800x600
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/font-stretch-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/text/font-stretch-expected.png
index 97c4eb7..8673e00 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/font-stretch-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/font-stretch-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/font-stretch-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/text/font-stretch-expected.txt
index 9cdd222..a027571 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/font-stretch-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/font-stretch-expected.txt
@@ -4,11 +4,11 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x411
     LayoutBlockFlow {BODY} at (8,8) size 784x395
       LayoutBlockFlow {H1} at (0,0) size 784x23
-        LayoutText {#text} at (0,0) size 252x23
-          text run at (0,0) width 252: "Tests support for font-stretch"
+        LayoutText {#text} at (0,0) size 250x23
+          text run at (0,0) width 250: "Tests support for font-stretch"
       LayoutBlockFlow {P} at (0,25) size 784x17
-        LayoutText {#text} at (0,0) size 226x17
-          text run at (0,0) width 226: "Tests that CSS font-stretch is supported."
+        LayoutText {#text} at (0,0) size 225x17
+          text run at (0,0) width 225: "Tests that CSS font-stretch is supported."
       LayoutBlockFlow {SECTION} at (0,50) size 784x173
         LayoutBlockFlow {H2} at (0,0) size 784x18
           LayoutText {#text} at (0,0) size 61x18
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/font-stretch-variant-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/text/font-stretch-variant-expected.png
index fea0e38..04bd9de7 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/font-stretch-variant-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/font-stretch-variant-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/font-stretch-variant-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/text/font-stretch-variant-expected.txt
index 46287f4..057dfd1 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/font-stretch-variant-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/font-stretch-variant-expected.txt
@@ -5,8 +5,8 @@
     LayoutBlockFlow {BODY} at (8,19.91) size 769x595.53
       LayoutBlockFlow {SECTION} at (0,0) size 769x135.91
         LayoutBlockFlow {H2} at (0,0) size 769x28
-          LayoutText {#text} at (0,0) size 414x28
-            text run at (0,0) width 414: "font-stretch: condensed vs Arial Narrow"
+          LayoutText {#text} at (0,0) size 413x28
+            text run at (0,0) width 413: "font-stretch: condensed vs Arial Narrow"
         LayoutBlockFlow {DIV} at (0,47.91) size 769x18
           LayoutText {#text} at (0,0) size 447x17
             text run at (0,0) width 447: "Back in June we delivered oxygen equipment of the same size."
@@ -21,8 +21,8 @@
             text run at (0,0) width 331: "The three lines above should have the same weight."
       LayoutBlockFlow {SECTION} at (0,155.81) size 769x209.91
         LayoutBlockFlow {H2} at (0,0) size 769x28
-          LayoutText {#text} at (0,0) size 210x28
-            text run at (0,0) width 210: "Specific width, Arial"
+          LayoutText {#text} at (0,0) size 209x28
+            text run at (0,0) width 209: "Specific width, Arial"
         LayoutBlockFlow {DIV} at (0,47.91) size 769x18
           LayoutText {#text} at (0,0) size 665x17
             text run at (0,0) width 665: "font-stretch: ultra-condensed - Back in June we delivered oxygen equipment of the same size."
@@ -52,8 +52,8 @@
             text run at (0,0) width 652: "font-stretch: ulta-expanded - Back in June we delivered oxygen equipment of the same size."
       LayoutBlockFlow {SECTION} at (0,385.63) size 769x209.91
         LayoutBlockFlow {H2} at (0,0) size 769x28
-          LayoutText {#text} at (0,0) size 296x28
-            text run at (0,0) width 296: "Specific width, Arial Narrow"
+          LayoutText {#text} at (0,0) size 295x28
+            text run at (0,0) width 295: "Specific width, Arial Narrow"
         LayoutBlockFlow {DIV} at (0,47.91) size 769x18
           LayoutText {#text} at (0,0) size 545x18
             text run at (0,0) width 545: "font-stretch: ultra-condensed - Back in June we delivered oxygen equipment of the same size."
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/font-weight-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/text/font-weight-expected.png
index 4d1fba13..d59e8dec 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/font-weight-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/font-weight-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/font-weight-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/text/font-weight-expected.txt
index 3410b88..2b4c1b3 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/font-weight-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/font-weight-expected.txt
@@ -4,11 +4,11 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x411
     LayoutBlockFlow {BODY} at (8,8) size 784x395
       LayoutBlockFlow {H1} at (0,0) size 784x23
-        LayoutText {#text} at (0,0) size 250x23
-          text run at (0,0) width 250: "Tests support for font-weight"
+        LayoutText {#text} at (0,0) size 248x23
+          text run at (0,0) width 248: "Tests support for font-weight"
       LayoutBlockFlow {P} at (0,25) size 784x17
-        LayoutText {#text} at (0,0) size 344x17
-          text run at (0,0) width 344: "Tests that CSS font-weight with numeric values is supported."
+        LayoutText {#text} at (0,0) size 343x17
+          text run at (0,0) width 343: "Tests that CSS font-weight with numeric values is supported."
       LayoutBlockFlow {SECTION} at (0,50) size 784x173
         LayoutBlockFlow {H2} at (0,0) size 784x18
           LayoutText {#text} at (0,0) size 61x18
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/font-weight-variant-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/text/font-weight-variant-expected.png
index 0955875..306b211 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/font-weight-variant-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/font-weight-variant-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/font-weight-variant-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/text/font-weight-variant-expected.txt
index e1834e52..e540b8b 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/font-weight-variant-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/font-weight-variant-expected.txt
@@ -37,8 +37,8 @@
             text run at (0,0) width 331: "The three lines above should have the same weight."
       LayoutBlockFlow {SECTION} at (0,311.63) size 769x209.91
         LayoutBlockFlow {H2} at (0,0) size 769x28
-          LayoutText {#text} at (0,0) size 258x28
-            text run at (0,0) width 258: "Specific weight, Segoe UI"
+          LayoutText {#text} at (0,0) size 256x28
+            text run at (0,0) width 256: "Specific weight, Segoe UI"
         LayoutBlockFlow {DIV} at (0,47.91) size 769x18
           LayoutText {#text} at (0,0) size 523x18
             text run at (0,0) width 523: "font-weight: 100 - Back in June we delivered oxygen equipment of the same size."
@@ -68,8 +68,8 @@
             text run at (0,0) width 547: "font-weight: 900 - Back in June we delivered oxygen equipment of the same size."
       LayoutBlockFlow {SECTION} at (0,541.44) size 769x209.91
         LayoutBlockFlow {H2} at (0,0) size 769x28
-          LayoutText {#text} at (0,0) size 320x28
-            text run at (0,0) width 320: "Specific weight, Segoe UI Light"
+          LayoutText {#text} at (0,0) size 318x28
+            text run at (0,0) width 318: "Specific weight, Segoe UI Light"
         LayoutBlockFlow {DIV} at (0,47.91) size 769x18
           LayoutText {#text} at (0,0) size 523x18
             text run at (0,0) width 523: "font-weight: 100 - Back in June we delivered oxygen equipment of the same size."
@@ -99,8 +99,8 @@
             text run at (0,0) width 547: "font-weight: 900 - Back in June we delivered oxygen equipment of the same size."
       LayoutBlockFlow {SECTION} at (0,771.25) size 769x209.91
         LayoutBlockFlow {H2} at (0,0) size 769x28
-          LayoutText {#text} at (0,0) size 360x28
-            text run at (0,0) width 360: "Specific weight, Segoe UI Semibold"
+          LayoutText {#text} at (0,0) size 358x28
+            text run at (0,0) width 358: "Specific weight, Segoe UI Semibold"
         LayoutBlockFlow {DIV} at (0,47.91) size 769x18
           LayoutText {#text} at (0,0) size 523x18
             text run at (0,0) width 523: "font-weight: 100 - Back in June we delivered oxygen equipment of the same size."
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/format-control-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/text/format-control-expected.png
index b09d2559..2431e42 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/format-control-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/format-control-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/format-control-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/text/format-control-expected.txt
index 7755001..5f6bcf1 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/format-control-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/format-control-expected.txt
@@ -6,23 +6,23 @@
       LayoutBlockFlow (anonymous) at (0,0) size 784x18
         LayoutText {#text} at (0,0) size 485x18
           text run at (0,0) width 485: "This tests the ZWJ and ZWNJ format control characters on basic Latin text."
-      LayoutBlockFlow {DIV} at (0,58) size 784x218
+      LayoutBlockFlow {DIV} at (0,58) size 784x224
         LayoutBlockFlow {P} at (0,0) size 784x46
-          LayoutText {#text} at (0,0) size 290x46
-            text run at (0,0) width 290: "fi fl ff ffi ffl fl f   i"
-        LayoutBlockFlow {P} at (0,86) size 784x46
-          LayoutText {#text} at (0,0) size 290x46
-            text run at (0,0) width 290: "f\x{200C}i f\x{200C}l f\x{200C}f f\x{200C}f\x{200C}i f\x{200C}f\x{200C}l f\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}l f\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C} \x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C} \x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C} \x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}i"
-        LayoutBlockFlow {P} at (0,172) size 784x46
-          LayoutText {#text} at (0,0) size 290x46
-            text run at (0,0) width 290: "f\x{200D}i f\x{200D}l f\x{200D}f f\x{200D}f\x{200D}i f\x{200D}f\x{200D}l f\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}l f\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D} \x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D} \x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D} \x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}i"
-      LayoutBlockFlow {DIV} at (0,316) size 784x221
+          LayoutText {#text} at (0,0) size 279x46
+            text run at (0,0) width 279: "fi fl ff ffi ffl fl f   i"
+        LayoutBlockFlow {P} at (0,86) size 784x49
+          LayoutText {#text} at (0,3) size 290x46
+            text run at (0,3) width 290: "f\x{200C}i f\x{200C}l f\x{200C}f f\x{200C}f\x{200C}i f\x{200C}f\x{200C}l f\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}l f\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C} \x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C} \x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C} \x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}i"
+        LayoutBlockFlow {P} at (0,175) size 784x49
+          LayoutText {#text} at (0,3) size 282x46
+            text run at (0,3) width 282: "f\x{200D}i f\x{200D}l f\x{200D}f f\x{200D}f\x{200D}i f\x{200D}f\x{200D}l f\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}l f\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D} \x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D} \x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D} \x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}i"
+      LayoutBlockFlow {DIV} at (0,322) size 784x221
         LayoutBlockFlow {P} at (0,0) size 784x47
-          LayoutText {#text} at (0,1) size 290x45
-            text run at (0,1) width 290: "fi fl ff ffi ffl fl f   i"
+          LayoutText {#text} at (0,1) size 288x45
+            text run at (0,1) width 288: "fi fl ff ffi ffl fl f   i"
         LayoutBlockFlow {P} at (0,87) size 784x47
-          LayoutText {#text} at (0,1) size 290x45
-            text run at (0,1) width 290: "f\x{200C}i f\x{200C}l f\x{200C}f f\x{200C}f\x{200C}i f\x{200C}f\x{200C}l f\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}l f\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C} \x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C} \x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C} \x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}i"
+          LayoutText {#text} at (0,1) size 288x45
+            text run at (0,1) width 288: "f\x{200C}i f\x{200C}l f\x{200C}f f\x{200C}f\x{200C}i f\x{200C}f\x{200C}l f\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}l f\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C} \x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C} \x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C} \x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}i"
         LayoutBlockFlow {P} at (0,174) size 784x47
-          LayoutText {#text} at (0,1) size 290x45
-            text run at (0,1) width 290: "f\x{200D}i f\x{200D}l f\x{200D}f f\x{200D}f\x{200D}i f\x{200D}f\x{200D}l f\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}l f\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D} \x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D} \x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D} \x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}i"
+          LayoutText {#text} at (0,1) size 288x45
+            text run at (0,1) width 288: "f\x{200D}i f\x{200D}l f\x{200D}f f\x{200D}f\x{200D}i f\x{200D}f\x{200D}l f\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}l f\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D} \x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D} \x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D} \x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}i"
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/in-rendered-text-rtl-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/text/in-rendered-text-rtl-expected.png
index 9d6b110..9264f54 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/in-rendered-text-rtl-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/in-rendered-text-rtl-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/in-rendered-text-rtl-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/text/in-rendered-text-rtl-expected.txt
index 16e8325..efa8368 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/in-rendered-text-rtl-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/in-rendered-text-rtl-expected.txt
@@ -4,14 +4,14 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x600
     LayoutBlockFlow {BODY} at (8,8) size 784x584
       LayoutBlockFlow {P} at (0,0) size 784x36
-        LayoutText {#text} at (0,0) size 55x18
-          text run at (0,0) width 55: "Test for "
-        LayoutInline {I} at (0,0) size 768x36
-          LayoutInline {A} at (0,0) size 354x18 [color=#0000EE]
-            LayoutText {#text} at (54,0) size 354x18
-              text run at (54,0) width 354: "http://bugzilla.opendarwin.org/show_bug.cgi?id=7433"
-          LayoutText {#text} at (407,0) size 768x36
-            text run at (407,0) width 361: " REGRESSION (r12789): Second RTL text run on a line"
+        LayoutText {#text} at (0,0) size 54x18
+          text run at (0,0) width 54: "Test for "
+        LayoutInline {I} at (0,0) size 766x36
+          LayoutInline {A} at (0,0) size 353x18 [color=#0000EE]
+            LayoutText {#text} at (53,0) size 353x18
+              text run at (53,0) width 353: "http://bugzilla.opendarwin.org/show_bug.cgi?id=7433"
+          LayoutText {#text} at (405,0) size 766x36
+            text run at (405,0) width 361: " REGRESSION (r12789): Second RTL text run on a line"
             text run at (0,18) width 119: "cannot be selected"
         LayoutText {#text} at (118,18) size 5x18
           text run at (118,18) width 5: "."
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/bidi-AN-after-empty-run-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/bidi-AN-after-empty-run-expected.png
index 7ea57d2f..475ae9f1 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/bidi-AN-after-empty-run-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/bidi-AN-after-empty-run-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/bidi-AN-after-empty-run-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/bidi-AN-after-empty-run-expected.txt
index b593474..f7707038 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/bidi-AN-after-empty-run-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/bidi-AN-after-empty-run-expected.txt
@@ -4,19 +4,19 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x600
     LayoutBlockFlow {BODY} at (8,8) size 784x584
       LayoutBlockFlow {P} at (0,0) size 784x18
-        LayoutText {#text} at (0,0) size 55x18
-          text run at (0,0) width 55: "Test for "
-        LayoutInline {I} at (0,0) size 402x18
-          LayoutInline {A} at (0,0) size 157x18 [color=#0000EE]
-            LayoutText {#text} at (54,0) size 157x18
-              text run at (54,0) width 157: "rdar://problem/6020930"
-          LayoutText {#text} at (210,0) size 246x18
-            text run at (210,0) width 246: " Bidi Problem When Resizing Window"
-        LayoutText {#text} at (455,0) size 5x18
-          text run at (455,0) width 5: "."
+        LayoutText {#text} at (0,0) size 54x18
+          text run at (0,0) width 54: "Test for "
+        LayoutInline {I} at (0,0) size 399x18
+          LayoutInline {A} at (0,0) size 156x18 [color=#0000EE]
+            LayoutText {#text} at (53,0) size 156x18
+              text run at (53,0) width 156: "rdar://problem/6020930"
+          LayoutText {#text} at (208,0) size 244x18
+            text run at (208,0) width 244: " Bidi Problem When Resizing Window"
+        LayoutText {#text} at (451,0) size 5x18
+          text run at (451,0) width 5: "."
       LayoutBlockFlow {P} at (0,34) size 784x18
-        LayoutText {#text} at (0,0) size 325x18
-          text run at (0,0) width 325: "The boxes below should be identical to each other."
+        LayoutText {#text} at (0,0) size 324x18
+          text run at (0,0) width 324: "The boxes below should be identical to each other."
       LayoutBlockFlow {DIV} at (0,68) size 90x52 [border: (1px solid #0000FF)]
         LayoutText {#text} at (5,6) size 60x39
           text run at (5,6) width 56 RTL: "\x{627}\x{644}\x{645}\x{627}\x{626}\x{629} \x{645}\x{644}\x{64A}\x{627}\x{631}"
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/bidi-LDB-2-CSS-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/bidi-LDB-2-CSS-expected.png
index 6da8802..07628db7 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/bidi-LDB-2-CSS-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/bidi-LDB-2-CSS-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/bidi-LDB-2-CSS-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/bidi-LDB-2-CSS-expected.txt
index 1590acc..746bcf63 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/bidi-LDB-2-CSS-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/bidi-LDB-2-CSS-expected.txt
@@ -4,8 +4,8 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x564.88
     LayoutBlockFlow {BODY} at (8,21.44) size 784x527.44
       LayoutBlockFlow {H1} at (0,0) size 784x37
-        LayoutText {#text} at (0,0) size 424x37
-          text run at (0,0) width 424: "Bidirectional Text Test 2 - CSS"
+        LayoutText {#text} at (0,0) size 418x37
+          text run at (0,0) width 418: "Bidirectional Text Test 2 - CSS"
       LayoutBlockFlow {P} at (0,58.44) size 784x18
         LayoutText {#text} at (0,0) size 134x18
           text run at (0,0) width 134: "This test is based on "
@@ -571,16 +571,16 @@
       LayoutBlockFlow {P} at (0,441.44) size 784x18
         LayoutText {#text} at (0,0) size 59x18
           text run at (0,0) width 59: "(Back to "
-        LayoutInline {A} at (0,0) size 162x18 [color=#0000EE]
-          LayoutText {#text} at (58,0) size 162x18
-            text run at (58,0) width 162: "CSS Testing Information"
-        LayoutText {#text} at (219,0) size 9x18
-          text run at (219,0) width 9: ", "
+        LayoutInline {A} at (0,0) size 161x18 [color=#0000EE]
+          LayoutText {#text} at (58,0) size 161x18
+            text run at (58,0) width 161: "CSS Testing Information"
+        LayoutText {#text} at (218,0) size 9x18
+          text run at (218,0) width 9: ", "
         LayoutInline {A} at (0,0) size 83x18 [color=#0000EE]
-          LayoutText {#text} at (227,0) size 83x18
-            text run at (227,0) width 83: "David Baron"
-        LayoutText {#text} at (309,0) size 7x18
-          text run at (309,0) width 7: ")"
+          LayoutText {#text} at (226,0) size 83x18
+            text run at (226,0) width 83: "David Baron"
+        LayoutText {#text} at (308,0) size 6x18
+          text run at (308,0) width 6: ")"
       LayoutBlockFlow {P} at (0,475.44) size 784x18
         LayoutInline {A} at (0,0) size 32x18 [color=#0000EE]
           LayoutText {#text} at (0,0) size 32x18
@@ -593,5 +593,5 @@
         LayoutText {#text} at (168,0) size 84x18
           text run at (168,0) width 84: ", 2001-06-05"
       LayoutBlockFlow {P} at (0,509.44) size 784x18
-        LayoutText {#text} at (0,0) size 311x18
-          text run at (0,0) width 311: "Modified and used with the author\x{2019}s permission."
+        LayoutText {#text} at (0,0) size 310x18
+          text run at (0,0) width 310: "Modified and used with the author\x{2019}s permission."
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/bidi-LDB-2-HTML-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/bidi-LDB-2-HTML-expected.png
index 98b0821..f6299b5 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/bidi-LDB-2-HTML-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/bidi-LDB-2-HTML-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/bidi-LDB-2-HTML-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/bidi-LDB-2-HTML-expected.txt
index 7d6aa93..cd4524f 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/bidi-LDB-2-HTML-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/bidi-LDB-2-HTML-expected.txt
@@ -4,8 +4,8 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x512.88
     LayoutBlockFlow {BODY} at (8,21.44) size 784x475.44
       LayoutBlockFlow {H1} at (0,0) size 784x37
-        LayoutText {#text} at (0,0) size 464x37
-          text run at (0,0) width 464: "Bidirectional Text Test 2 - HTML"
+        LayoutText {#text} at (0,0) size 457x37
+          text run at (0,0) width 457: "Bidirectional Text Test 2 - HTML"
       LayoutBlockFlow {P} at (0,58.44) size 784x18
         LayoutText {#text} at (0,0) size 134x18
           text run at (0,0) width 134: "This test is based on "
@@ -558,16 +558,16 @@
       LayoutBlockFlow {P} at (0,389.44) size 784x18
         LayoutText {#text} at (0,0) size 59x18
           text run at (0,0) width 59: "(Back to "
-        LayoutInline {A} at (0,0) size 162x18 [color=#0000EE]
-          LayoutText {#text} at (58,0) size 162x18
-            text run at (58,0) width 162: "CSS Testing Information"
-        LayoutText {#text} at (219,0) size 9x18
-          text run at (219,0) width 9: ", "
+        LayoutInline {A} at (0,0) size 161x18 [color=#0000EE]
+          LayoutText {#text} at (58,0) size 161x18
+            text run at (58,0) width 161: "CSS Testing Information"
+        LayoutText {#text} at (218,0) size 9x18
+          text run at (218,0) width 9: ", "
         LayoutInline {A} at (0,0) size 83x18 [color=#0000EE]
-          LayoutText {#text} at (227,0) size 83x18
-            text run at (227,0) width 83: "David Baron"
-        LayoutText {#text} at (309,0) size 7x18
-          text run at (309,0) width 7: ")"
+          LayoutText {#text} at (226,0) size 83x18
+            text run at (226,0) width 83: "David Baron"
+        LayoutText {#text} at (308,0) size 6x18
+          text run at (308,0) width 6: ")"
       LayoutBlockFlow {P} at (0,423.44) size 784x18
         LayoutInline {A} at (0,0) size 32x18 [color=#0000EE]
           LayoutText {#text} at (0,0) size 32x18
@@ -580,5 +580,5 @@
         LayoutText {#text} at (168,0) size 84x18
           text run at (168,0) width 84: ", 2001-06-05"
       LayoutBlockFlow {P} at (0,457.44) size 784x18
-        LayoutText {#text} at (0,0) size 311x18
-          text run at (0,0) width 311: "Modified and used with the author\x{2019}s permission."
+        LayoutText {#text} at (0,0) size 310x18
+          text run at (0,0) width 310: "Modified and used with the author\x{2019}s permission."
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/bidi-LDB-2-formatting-characters-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/bidi-LDB-2-formatting-characters-expected.png
index 6e09af0..a8a9aee 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/bidi-LDB-2-formatting-characters-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/bidi-LDB-2-formatting-characters-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/bidi-LDB-2-formatting-characters-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/bidi-LDB-2-formatting-characters-expected.txt
index 199b6d7..6128f27a5 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/bidi-LDB-2-formatting-characters-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/bidi-LDB-2-formatting-characters-expected.txt
@@ -4,8 +4,8 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x588.88
     LayoutBlockFlow {BODY} at (8,21.44) size 784x551.44
       LayoutBlockFlow {H1} at (0,0) size 784x37
-        LayoutText {#text} at (0,0) size 683x37
-          text run at (0,0) width 683: "Bidirectional Text Test 2 - Formatting Characters"
+        LayoutText {#text} at (0,0) size 677x37
+          text run at (0,0) width 677: "Bidirectional Text Test 2 - Formatting Characters"
       LayoutBlockFlow {P} at (0,58.44) size 784x18
         LayoutText {#text} at (0,0) size 134x18
           text run at (0,0) width 134: "This test is based on "
@@ -36,60 +36,60 @@
         LayoutText {#text} at (0,0) size 287x18
           text run at (0,0) width 287: "In each box, all the lines should be the same."
       LayoutBlockFlow (anonymous) at (0,160.44) size 784x237
-        LayoutBlockFlow {DIV} at (3,7) size 99.58x170 [border: (1px solid #008000)]
+        LayoutBlockFlow {DIV} at (3,3) size 99.58x178 [border: (1px solid #008000)]
           LayoutBlockFlow {P} at (4,4) size 91.58x18
             LayoutText {#text} at (0,0) size 92x18
               text run at (0,0) width 92: "ABCDEFGHI"
-          LayoutBlockFlow {P} at (4,22) size 91.58x18
-            LayoutText {#text} at (0,0) size 92x18
-              text run at (0,0) width 0 RTL: "\x{202C}"
-              text run at (0,0) width 92: "\x{202B}ABCDEFGHI"
-          LayoutBlockFlow {P} at (4,40) size 91.58x18
-            LayoutText {#text} at (0,0) size 33x18
-              text run at (0,0) width 33: "\x{202B}ABC"
+          LayoutBlockFlow {P} at (4,22) size 91.58x19
+            LayoutText {#text} at (0,1) size 92x18
+              text run at (0,1) width 0 RTL: "\x{202C}"
+              text run at (0,1) width 92: "\x{202B}ABCDEFGHI"
+          LayoutBlockFlow {P} at (4,41) size 91.58x19
+            LayoutText {#text} at (0,1) size 33x18
+              text run at (0,1) width 33: "\x{202B}ABC"
             LayoutInline {SPAN} at (0,0) size 32x18
-              LayoutText {#text} at (32,0) size 32x18
-                text run at (32,0) width 32: "DEF"
-            LayoutText {#text} at (0,0) size 92x18
-              text run at (0,0) width 0 RTL: "\x{202C}"
-              text run at (63,0) width 29: "GHI"
-          LayoutBlockFlow {P} at (4,58) size 91.58x18
-            LayoutText {#text} at (0,0) size 92x18
-              text run at (0,0) width 0 RTL: "\x{202C}"
-              text run at (0,0) width 92 RTL override: "\x{202E}IHGFEDCBA"
-          LayoutBlockFlow {P} at (4,76) size 91.58x18
-            LayoutText {#text} at (63,0) size 29x18
-              text run at (63,0) width 29 RTL override: "\x{202E}IHG"
+              LayoutText {#text} at (32,1) size 32x18
+                text run at (32,1) width 32: "DEF"
+            LayoutText {#text} at (0,1) size 92x18
+              text run at (0,1) width 0 RTL: "\x{202C}"
+              text run at (63,1) width 29: "GHI"
+          LayoutBlockFlow {P} at (4,60) size 91.58x19
+            LayoutText {#text} at (0,1) size 92x18
+              text run at (0,1) width 0 RTL: "\x{202C}"
+              text run at (0,1) width 92 RTL override: "\x{202E}IHGFEDCBA"
+          LayoutBlockFlow {P} at (4,79) size 91.58x19
+            LayoutText {#text} at (63,1) size 29x18
+              text run at (63,1) width 29 RTL override: "\x{202E}IHG"
             LayoutInline {SPAN} at (0,0) size 32x18
-              LayoutText {#text} at (32,0) size 32x18
-                text run at (32,0) width 32 RTL override: "FED"
-            LayoutText {#text} at (0,0) size 33x18
-              text run at (0,0) width 0 RTL: "\x{202C}"
-              text run at (0,0) width 33 RTL override: "CBA"
-          LayoutBlockFlow {P} at (4,94) size 91.58x18
-            LayoutText {#text} at (0,0) size 92x18
-              text run at (0,0) width 0 RTL: "\x{202C}"
-              text run at (0,0) width 33 RTL override: "\x{202C}CBA"
-              text run at (32,0) width 32: "\x{202B}DEF"
-              text run at (63,0) width 29 RTL override: "\x{202E}IHG"
-          LayoutBlockFlow {P} at (4,112) size 91.58x18
-            LayoutText {#text} at (0,0) size 92x18
-              text run at (0,0) width 0 RTL: "\x{202C}"
-              text run at (0,0) width 33 RTL override: "\x{202C}CBA"
-              text run at (32,0) width 32 RTL override: "\x{202E}FED"
-              text run at (63,0) width 29 RTL override: "\x{202E}IHG"
-          LayoutBlockFlow {P} at (4,130) size 91.58x18
-            LayoutText {#text} at (0,0) size 92x18
-              text run at (0,0) width 0 RTL: "\x{202C}"
-              text run at (0,0) width 33 RTL override: "\x{202C}CBA"
-              text run at (32,0) width 32 RTL override: "\x{202E}FED"
-              text run at (63,0) width 29 RTL override: "\x{202E}IHG"
-          LayoutBlockFlow {P} at (4,148) size 91.58x18
-            LayoutText {#text} at (0,0) size 92x18
-              text run at (0,0) width 0 RTL: "\x{202C}"
-              text run at (0,0) width 33 RTL override: "\x{202C}CBA"
-              text run at (32,0) width 32 LTR override: "\x{202D}DEF"
-              text run at (63,0) width 29 RTL override: "\x{202E}IHG"
+              LayoutText {#text} at (32,1) size 32x18
+                text run at (32,1) width 32 RTL override: "FED"
+            LayoutText {#text} at (0,1) size 33x18
+              text run at (0,1) width 0 RTL: "\x{202C}"
+              text run at (0,1) width 33 RTL override: "CBA"
+          LayoutBlockFlow {P} at (4,98) size 91.58x19
+            LayoutText {#text} at (0,1) size 92x18
+              text run at (0,1) width 0 RTL: "\x{202C}"
+              text run at (0,1) width 33 RTL override: "\x{202C}CBA"
+              text run at (32,1) width 32: "\x{202B}DEF"
+              text run at (63,1) width 29 RTL override: "\x{202E}IHG"
+          LayoutBlockFlow {P} at (4,117) size 91.58x19
+            LayoutText {#text} at (0,1) size 92x18
+              text run at (0,1) width 0 RTL: "\x{202C}"
+              text run at (0,1) width 33 RTL override: "\x{202C}CBA"
+              text run at (32,1) width 32 RTL override: "\x{202E}FED"
+              text run at (63,1) width 29 RTL override: "\x{202E}IHG"
+          LayoutBlockFlow {P} at (4,136) size 91.58x19
+            LayoutText {#text} at (0,1) size 92x18
+              text run at (0,1) width 0 RTL: "\x{202C}"
+              text run at (0,1) width 33 RTL override: "\x{202C}CBA"
+              text run at (32,1) width 32 RTL override: "\x{202E}FED"
+              text run at (63,1) width 29 RTL override: "\x{202E}IHG"
+          LayoutBlockFlow {P} at (4,155) size 91.58x19
+            LayoutText {#text} at (0,1) size 92x18
+              text run at (0,1) width 0 RTL: "\x{202C}"
+              text run at (0,1) width 33 RTL override: "\x{202C}CBA"
+              text run at (32,1) width 32 LTR override: "\x{202D}DEF"
+              text run at (63,1) width 29 RTL override: "\x{202E}IHG"
         LayoutText {#text} at (105,82) size 5x18
           text run at (105,82) width 5: " "
         LayoutBlockFlow {DIV} at (112.58,50) size 36x84 [border: (1px solid #008000)]
@@ -543,16 +543,16 @@
       LayoutBlockFlow {P} at (0,465.44) size 784x18
         LayoutText {#text} at (0,0) size 59x18
           text run at (0,0) width 59: "(Back to "
-        LayoutInline {A} at (0,0) size 162x18 [color=#0000EE]
-          LayoutText {#text} at (58,0) size 162x18
-            text run at (58,0) width 162: "CSS Testing Information"
-        LayoutText {#text} at (219,0) size 9x18
-          text run at (219,0) width 9: ", "
+        LayoutInline {A} at (0,0) size 161x18 [color=#0000EE]
+          LayoutText {#text} at (58,0) size 161x18
+            text run at (58,0) width 161: "CSS Testing Information"
+        LayoutText {#text} at (218,0) size 9x18
+          text run at (218,0) width 9: ", "
         LayoutInline {A} at (0,0) size 83x18 [color=#0000EE]
-          LayoutText {#text} at (227,0) size 83x18
-            text run at (227,0) width 83: "David Baron"
-        LayoutText {#text} at (309,0) size 7x18
-          text run at (309,0) width 7: ")"
+          LayoutText {#text} at (226,0) size 83x18
+            text run at (226,0) width 83: "David Baron"
+        LayoutText {#text} at (308,0) size 6x18
+          text run at (308,0) width 6: ")"
       LayoutBlockFlow {P} at (0,499.44) size 784x18
         LayoutInline {A} at (0,0) size 32x18 [color=#0000EE]
           LayoutText {#text} at (0,0) size 32x18
@@ -565,5 +565,5 @@
         LayoutText {#text} at (168,0) size 84x18
           text run at (168,0) width 84: ", 2001-06-05"
       LayoutBlockFlow {P} at (0,533.44) size 784x18
-        LayoutText {#text} at (0,0) size 311x18
-          text run at (0,0) width 311: "Modified and used with the author\x{2019}s permission."
+        LayoutText {#text} at (0,0) size 310x18
+          text run at (0,0) width 310: "Modified and used with the author\x{2019}s permission."
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/bidi-european-terminators-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/bidi-european-terminators-expected.png
index 9b6a729..9b166c07 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/bidi-european-terminators-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/bidi-european-terminators-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/bidi-european-terminators-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/bidi-european-terminators-expected.txt
index a53cb80a..224178a 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/bidi-european-terminators-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/bidi-european-terminators-expected.txt
@@ -6,20 +6,20 @@
       LayoutBlockFlow {P} at (0,0) size 784x36
         LayoutText {#text} at (0,0) size 88x18
           text run at (0,0) width 88: "This tests for "
-        LayoutInline {I} at (0,0) size 729x36
-          LayoutText {#text} at (87,0) size 729x36
-            text run at (87,0) width 642: "http://bugzilla.opendarwin.org/show_bug.cgi?id=6014 Bidi algorithm: incorrect resolved levels for"
-            text run at (0,18) width 213: "neutrals between R and ET ON L"
-        LayoutText {#text} at (212,18) size 5x18
-          text run at (212,18) width 5: "."
+        LayoutInline {I} at (0,0) size 783x36
+          LayoutText {#text} at (87,0) size 783x36
+            text run at (87,0) width 696: "http://bugzilla.opendarwin.org/show_bug.cgi?id=6014 Bidi algorithm: incorrect resolved levels for neutrals"
+            text run at (0,18) width 156: "between R and ET ON L"
+        LayoutText {#text} at (155,18) size 5x18
+          text run at (155,18) width 5: "."
       LayoutBlockFlow {P} at (0,52) size 784x37
-        LayoutText {#text} at (0,1) size 773x36
+        LayoutText {#text} at (0,1) size 772x36
           text run at (0,1) width 98: "The characters "
           text run at (97,1) width 12 RTL: "\x{5D0}"
           text run at (108,1) width 32: " and "
           text run at (139,1) width 10 RTL: "\x{5D1}"
-          text run at (148,1) width 625: " are of type R; ^ and @ are of type ON; $ and % are of type ET; a is of type L; 1 is of type EN. In"
-          text run at (0,19) width 477: "each of the following pairs, the two lines should be identical to each other."
+          text run at (148,1) width 624: " are of type R; ^ and @ are of type ON; $ and % are of type ET; a is of type L; 1 is of type EN. In"
+          text run at (0,19) width 476: "each of the following pairs, the two lines should be identical to each other."
       LayoutBlockFlow {HR} at (0,105) size 784x2 [border: (1px inset #EEEEEE)]
       LayoutBlockFlow {P} at (0,123) size 784x19
         LayoutText {#text} at (0,1) size 77x18
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/bidi-explicit-embedding-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/bidi-explicit-embedding-expected.png
index 12e81100..5d926cf8 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/bidi-explicit-embedding-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/bidi-explicit-embedding-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/bidi-explicit-embedding-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/bidi-explicit-embedding-expected.txt
new file mode 100644
index 0000000..8cf8834
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/bidi-explicit-embedding-expected.txt
@@ -0,0 +1,120 @@
+layer at (0,0) size 800x600
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x518
+  LayoutBlockFlow {HTML} at (0,0) size 800x518
+    LayoutBlockFlow {BODY} at (8,16) size 784x486
+      LayoutBlockFlow {P} at (0,0) size 784x54
+        LayoutText {#text} at (0,0) size 743x54
+          text run at (0,0) width 727: "In each line, reading from left to right, the bracket should appear before the parenthesis. The"
+          text run at (0,18) width 743: "bracket should be a left bracket and the parenthesis should be a right parenthesis. In each line,"
+          text run at (0,36) width 596: "Roman characters and digits should be in increasing order from left to right."
+      LayoutBlockFlow {P} at (0,70) size 784x18
+        LayoutText {#text} at (0,0) size 62x18
+          text run at (0,0) width 27 RTL: "\x{5D0}\x{5D1}\x{5D2}"
+          text run at (26,0) width 36: " def "
+        LayoutInline {SPAN} at (0,0) size 38x18
+          LayoutText {#text} at (61,0) size 38x18
+            text run at (61,0) width 38 RTL: "(\x{5D6}\x{5D7}\x{5D8}]"
+        LayoutText {#text} at (98,0) size 25x18
+          text run at (98,0) width 25: " jkl"
+      LayoutBlockFlow {P} at (0,104) size 784x18
+        LayoutText {#text} at (0,0) size 62x18
+          text run at (0,0) width 27 RTL: "\x{5D0}\x{5D1}\x{5D2}"
+          text run at (26,0) width 36: " def "
+        LayoutInline {SPAN} at (0,0) size 36x18
+          LayoutText {#text} at (61,0) size 36x18
+            text run at (61,0) width 6 RTL: "]"
+            text run at (66,0) width 25: "ghi"
+            text run at (90,0) width 7 RTL: "("
+        LayoutText {#text} at (96,0) size 24x18
+          text run at (96,0) width 24: " jkl"
+      LayoutBlockFlow {P} at (0,138) size 784x18
+        LayoutText {#text} at (0,0) size 33x18
+          text run at (0,0) width 33: "abc "
+        LayoutInline {SPAN} at (0,0) size 57x18
+          LayoutText {#text} at (32,0) size 57x18
+            text run at (32,0) width 6 RTL: "]"
+            text run at (37,0) width 21: "23"
+            text run at (57,0) width 6 RTL: " "
+            text run at (62,0) width 21: "45"
+            text run at (82,0) width 7 RTL: "("
+        LayoutText {#text} at (88,0) size 31x18
+          text run at (88,0) width 31: " fgh"
+      LayoutBlockFlow {P} at (0,172) size 784x22
+        LayoutText {#text} at (0,2) size 119x18
+          text run at (0,2) width 33: "abc "
+          text run at (32,2) width 6 RTL: "]"
+          text run at (37,2) width 21: "23"
+          text run at (57,2) width 6 RTL: " "
+          text run at (62,2) width 21: "45"
+          text run at (82,2) width 7 RTL: "\x{202B}("
+          text run at (88,2) width 31: "\x{202C} fgh"
+      LayoutBlockFlow {P} at (0,210) size 784x22
+        LayoutText {#text} at (0,2) size 107x18
+          text run at (0,2) width 33: "abc "
+          text run at (32,2) width 6 RTL: "]"
+          text run at (37,2) width 41: "de fg"
+          text run at (77,2) width 6 RTL: "\x{202B}("
+          text run at (82,2) width 25: "\x{202C} hij"
+      LayoutBlockFlow {P} at (0,248) size 784x18
+        LayoutText {#text} at (0,0) size 11x18
+          text run at (0,0) width 11: "1"
+        LayoutInline {SPAN} at (0,0) size 53x18
+          LayoutText {#text} at (10,0) size 53x18
+            text run at (10,0) width 6 RTL: "]"
+            text run at (15,0) width 43: "ab cd"
+            text run at (57,0) width 6 RTL: "("
+        LayoutText {#text} at (0,0) size 0x0
+      LayoutBlockFlow {P} at (0,282) size 784x18
+        LayoutText {#text} at (0,0) size 11x18
+          text run at (0,0) width 11: "1"
+        LayoutInline {SPAN} at (0,0) size 50x18
+          LayoutText {#text} at (10,0) size 50x18
+            text run at (10,0) width 26 RTL: " \x{5D2}\x{5D3}]"
+            text run at (35,0) width 20: "ab"
+            text run at (54,0) width 6 RTL: "("
+        LayoutText {#text} at (0,0) size 0x0
+      LayoutBlockFlow {P} at (0,316) size 784x22
+        LayoutText {#text} at (0,2) size 11x18
+          text run at (0,2) width 11: "1"
+        LayoutInline {SPAN} at (0,0) size 21x18
+          LayoutText {#text} at (10,2) size 21x18
+            text run at (10,2) width 6 RTL: "]"
+            text run at (15,2) width 11: "2"
+            text run at (25,2) width 6 RTL: "\x{202B}("
+            text run at (30,2) width 1: "\x{202C}"
+        LayoutText {#text} at (0,0) size 0x0
+      LayoutBlockFlow {P} at (0,354) size 784x22
+        LayoutText {#text} at (0,2) size 11x18
+          text run at (0,2) width 11: "1"
+        LayoutInline {SPAN} at (0,0) size 20x18
+          LayoutText {#text} at (10,2) size 20x18
+            text run at (10,2) width 6 RTL: "]"
+            text run at (15,2) width 10: "a"
+            text run at (24,2) width 6 RTL: "\x{202B}("
+            text run at (29,2) width 1: "\x{202C}"
+        LayoutText {#text} at (0,0) size 0x0
+      LayoutBlockFlow {P} at (0,392) size 784x22
+        LayoutText {#text} at (0,2) size 60x18
+          text run at (0,2) width 11: "1"
+          text run at (10,2) width 26 RTL: " \x{5D2}\x{5D3}]"
+          text run at (35,2) width 20: "ab"
+          text run at (54,2) width 6 RTL: "\x{202B}("
+          text run at (59,2) width 1: "\x{202C}"
+      LayoutBlockFlow {P} at (0,430) size 784x18
+        LayoutInline {SPAN} at (0,0) size 99x18
+          LayoutText {#text} at (0,0) size 99x18
+            text run at (0,0) width 6 RTL: "]"
+            text run at (5,0) width 28: "abc"
+            text run at (32,0) width 37 RTL: " \x{5D0}\x{5D1}\x{5D2} "
+            text run at (68,0) width 26: "def"
+            text run at (93,0) width 6 RTL: "("
+        LayoutText {#text} at (0,0) size 0x0
+      LayoutBlockFlow {P} at (0,464) size 784x22
+        LayoutText {#text} at (0,2) size 99x18
+          text run at (0,2) width 6 RTL: "]"
+          text run at (5,2) width 28: "abc"
+          text run at (32,2) width 37 RTL: " \x{5D0}\x{5D1}\x{5D2} "
+          text run at (68,2) width 26: "def"
+          text run at (93,2) width 6 RTL: "\x{202B}("
+          text run at (98,2) width 1: "\x{202C}"
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/bidi-ignored-for-first-child-inline-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/bidi-ignored-for-first-child-inline-expected.png
index 08e612c..349473e 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/bidi-ignored-for-first-child-inline-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/bidi-ignored-for-first-child-inline-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/bidi-ignored-for-first-child-inline-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/bidi-ignored-for-first-child-inline-expected.txt
index 0bb35f8..826626d 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/bidi-ignored-for-first-child-inline-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/bidi-ignored-for-first-child-inline-expected.txt
@@ -6,12 +6,12 @@
       LayoutBlockFlow {P} at (0,0) size 784x36
         LayoutText {#text} at (0,0) size 108x18
           text run at (0,0) width 108: "This is a test for "
-        LayoutInline {I} at (0,0) size 777x36
-          LayoutText {#text} at (107,0) size 777x36
-            text run at (107,0) width 670: "http://bugzilla.opendarwin.org/show_bug.cgi?id=5980 Bidi properties of an inline container whose first"
-            text run at (0,18) width 252: "child is an inline container are ignored"
-        LayoutText {#text} at (251,18) size 5x18
-          text run at (251,18) width 5: "."
+        LayoutInline {I} at (0,0) size 775x36
+          LayoutText {#text} at (107,0) size 775x36
+            text run at (107,0) width 668: "http://bugzilla.opendarwin.org/show_bug.cgi?id=5980 Bidi properties of an inline container whose first"
+            text run at (0,18) width 251: "child is an inline container are ignored"
+        LayoutText {#text} at (250,18) size 5x18
+          text run at (250,18) width 5: "."
       LayoutBlockFlow {HR} at (0,52) size 784x2 [border: (1px inset #EEEEEE)]
       LayoutBlockFlow {P} at (0,70) size 784x18
         LayoutText {#text} at (0,0) size 318x18
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/bidi-innertext-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/bidi-innertext-expected.png
index 49ae60e..b9f741d 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/bidi-innertext-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/bidi-innertext-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/bidi-innertext-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/bidi-innertext-expected.txt
index 1dab62d5..eb8df82 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/bidi-innertext-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/bidi-innertext-expected.txt
@@ -4,83 +4,83 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x600
     LayoutBlockFlow {BODY} at (8,8) size 784x576
       LayoutBlockFlow (anonymous) at (0,0) size 784x36
-        LayoutText {#text} at (0,0) size 775x36
-          text run at (0,0) width 476: "The following tests text iteration over RTL text embedded with LTR text. "
-          text run at (475,0) width 300: "TextIterators are used for find, spellcheck, and"
-          text run at (0,18) width 67: ".innerText"
+        LayoutText {#text} at (0,0) size 771x36
+          text run at (0,0) width 474: "The following tests text iteration over RTL text embedded with LTR text. "
+          text run at (473,0) width 298: "TextIterators are used for find, spellcheck, and"
+          text run at (0,18) width 66: ".innerText"
       LayoutBlockFlow {HR} at (0,44) size 784x2 [border: (1px inset #EEEEEE)]
       LayoutBlockFlow (anonymous) at (0,54) size 784x18
         LayoutText {#text} at (0,0) size 136x18
           text run at (0,0) width 136: "Embedded Numbers:"
       LayoutBlockFlow {DIV} at (0,72) size 784x19 [color=#0000FF]
-        LayoutText {#text} at (0,1) size 122x18
-          text run at (0,1) width 58: "Testing ("
-          text run at (57,1) width 17 RTL: "\x{5DF}\x{5DE}"
-          text run at (73,1) width 9: "3"
-          text run at (81,1) width 36 RTL: "\x{5D7}\x{5D5}\x{5D3}\x{5D0}"
-          text run at (116,1) width 6: ")"
+        LayoutText {#text} at (0,1) size 121x18
+          text run at (0,1) width 57: "Testing ("
+          text run at (56,1) width 17 RTL: "\x{5DF}\x{5DE}"
+          text run at (72,1) width 9: "3"
+          text run at (80,1) width 36 RTL: "\x{5D7}\x{5D5}\x{5D3}\x{5D0}"
+          text run at (115,1) width 6: ")"
       LayoutBlockFlow (anonymous) at (0,91) size 784x18
-        LayoutText {#text} at (0,0) size 108x18
-          text run at (0,0) width 108: "Embedded LTR:"
+        LayoutText {#text} at (0,0) size 106x18
+          text run at (0,0) width 106: "Embedded LTR:"
       LayoutBlockFlow {DIV} at (0,109) size 784x19 [color=#0000FF]
-        LayoutText {#text} at (0,1) size 146x18
-          text run at (0,1) width 58: "Testing ("
-          text run at (57,1) width 36 RTL: "\x{5D7}\x{5D5}\x{5D3}\x{5D0}"
-          text run at (92,1) width 33: "hello"
-          text run at (124,1) width 17 RTL: "\x{5DF}\x{5DE}"
-          text run at (140,1) width 6: ")"
+        LayoutText {#text} at (0,1) size 145x18
+          text run at (0,1) width 57: "Testing ("
+          text run at (56,1) width 36 RTL: "\x{5D7}\x{5D5}\x{5D3}\x{5D0}"
+          text run at (91,1) width 33: "hello"
+          text run at (123,1) width 17 RTL: "\x{5DF}\x{5DE}"
+          text run at (139,1) width 6: ")"
       LayoutBlockFlow (anonymous) at (0,128) size 784x18
-        LayoutText {#text} at (0,0) size 193x18
-          text run at (0,0) width 193: "Embedded Numbers and LTR"
+        LayoutText {#text} at (0,0) size 191x18
+          text run at (0,0) width 191: "Embedded Numbers and LTR"
       LayoutBlockFlow {DIV} at (0,146) size 784x19 [color=#0000FF]
-        LayoutText {#text} at (0,1) size 144x18
-          text run at (0,1) width 58: "Testing ("
-          text run at (57,1) width 30 RTL: "\x{5E7}\x{5E7}\x{5E8}"
-          text run at (86,1) width 9: "3"
-          text run at (94,1) width 37 RTL: "\x{5D9}\x{5E7}\x{5DD}\x{5DC}"
-          text run at (130,1) width 14: "h)"
+        LayoutText {#text} at (0,1) size 143x18
+          text run at (0,1) width 57: "Testing ("
+          text run at (56,1) width 30 RTL: "\x{5E7}\x{5E7}\x{5E8}"
+          text run at (85,1) width 9: "3"
+          text run at (93,1) width 37 RTL: "\x{5D9}\x{5E7}\x{5DD}\x{5DC}"
+          text run at (129,1) width 14: "h)"
       LayoutBlockFlow (anonymous) at (0,165) size 784x18
         LayoutText {#text} at (0,0) size 221x18
           text run at (0,0) width 221: "Embedded Numbers with spacing:"
       LayoutBlockFlow {DIV} at (0,183) size 784x19 [color=#0000FF]
-        LayoutText {#text} at (0,1) size 265x18
-          text run at (0,1) width 58: "Testing ("
-          text run at (57,1) width 40 RTL: " \x{5D7}\x{5D5}\x{5D3}\x{5D0}"
-          text run at (96,1) width 25: "300"
-          text run at (120,1) width 56 RTL: "\x{5D7}\x{5D5}\x{5D3}\x{5D0}\x{5DF}\x{5DE} "
-          text run at (175,1) width 41: "34023"
-          text run at (215,1) width 44 RTL: "\x{5D9}\x{5E7}\x{5DA}\x{5DA}\x{5DD}"
-          text run at (258,1) width 7: ")"
+        LayoutText {#text} at (0,1) size 264x18
+          text run at (0,1) width 57: "Testing ("
+          text run at (56,1) width 40 RTL: " \x{5D7}\x{5D5}\x{5D3}\x{5D0}"
+          text run at (95,1) width 25: "300"
+          text run at (119,1) width 55 RTL: "\x{5D7}\x{5D5}\x{5D3}\x{5D0}\x{5DF}\x{5DE} "
+          text run at (173,1) width 41: "34023"
+          text run at (213,1) width 45 RTL: "\x{5D9}\x{5E7}\x{5DA}\x{5DA}\x{5DD}"
+          text run at (257,1) width 7: ")"
       LayoutBlockFlow (anonymous) at (0,202) size 784x18
-        LayoutText {#text} at (0,0) size 72x18
-          text run at (0,0) width 72: "Plain LTR:"
+        LayoutText {#text} at (0,0) size 71x18
+          text run at (0,0) width 71: "Plain LTR:"
       LayoutBlockFlow {DIV} at (0,220) size 784x18 [color=#0000FF]
-        LayoutText {#text} at (0,0) size 95x18
-          text run at (0,0) width 95: "Testing (hello)"
+        LayoutText {#text} at (0,0) size 94x18
+          text run at (0,0) width 94: "Testing (hello)"
       LayoutBlockFlow (anonymous) at (0,238) size 784x18
-        LayoutText {#text} at (0,0) size 193x18
-          text run at (0,0) width 193: "Embedded LTR with spacing:"
+        LayoutText {#text} at (0,0) size 191x18
+          text run at (0,0) width 191: "Embedded LTR with spacing:"
       LayoutBlockFlow {DIV} at (0,256) size 784x19 [color=#0000FF]
-        LayoutText {#text} at (0,1) size 193x18
-          text run at (0,1) width 58: "Testing ("
-          text run at (57,1) width 69 RTL: "\x{5D7}\x{5D5}\x{5D3}\x{5D9}\x{5E7}\x{5DA}\x{5DA}\x{5DD}"
-          text run at (125,1) width 41: " hello "
-          text run at (165,1) width 22 RTL: "\x{5DF}\x{5DE}\x{5D9}"
-          text run at (186,1) width 7: ")"
+        LayoutText {#text} at (0,1) size 191x18
+          text run at (0,1) width 57: "Testing ("
+          text run at (56,1) width 69 RTL: "\x{5D7}\x{5D5}\x{5D3}\x{5D9}\x{5E7}\x{5DA}\x{5DA}\x{5DD}"
+          text run at (124,1) width 41: " hello "
+          text run at (164,1) width 22 RTL: "\x{5DF}\x{5DE}\x{5D9}"
+          text run at (185,1) width 6: ")"
       LayoutBlockFlow (anonymous) at (0,275) size 784x18
         LayoutText {#text} at (0,0) size 165x18
           text run at (0,0) width 165: "Mixed but not embedded:"
       LayoutBlockFlow {DIV} at (0,293) size 784x19 [color=#0000FF]
-        LayoutText {#text} at (0,1) size 136x18
-          text run at (0,1) width 90: "Testing (hello"
-          text run at (89,1) width 41 RTL: "\x{5D7}\x{5D5}\x{5D3}\x{5DF}\x{5DE}"
-          text run at (129,1) width 7: ")"
+        LayoutText {#text} at (0,1) size 135x18
+          text run at (0,1) width 89: "Testing (hello"
+          text run at (88,1) width 41 RTL: "\x{5D7}\x{5D5}\x{5D3}\x{5DF}\x{5DE}"
+          text run at (128,1) width 7: ")"
       LayoutBlockFlow (anonymous) at (0,312) size 784x18
         LayoutText {#text} at (0,0) size 165x18
           text run at (0,0) width 165: "Mixed but not embedded:"
       LayoutBlockFlow {DIV} at (0,330) size 784x19 [color=#0000FF]
-        LayoutText {#text} at (0,1) size 136x18
-          text run at (0,1) width 58: "Testing ("
-          text run at (57,1) width 41 RTL: "\x{5D7}\x{5D5}\x{5D3}\x{5DF}\x{5DE}"
-          text run at (97,1) width 39: "hello)"
+        LayoutText {#text} at (0,1) size 135x18
+          text run at (0,1) width 57: "Testing ("
+          text run at (56,1) width 41 RTL: "\x{5D7}\x{5D5}\x{5D3}\x{5DF}\x{5DE}"
+          text run at (96,1) width 39: "hello)"
       LayoutBlockFlow {OL} at (0,365) size 784x0
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/bidi-listbox-atsui-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/bidi-listbox-atsui-expected.png
index 4ae343f..ac9c35b5 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/bidi-listbox-atsui-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/bidi-listbox-atsui-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/bidi-listbox-atsui-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/bidi-listbox-atsui-expected.txt
index cdfc55f..85bc5c0 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/bidi-listbox-atsui-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/bidi-listbox-atsui-expected.txt
@@ -4,9 +4,9 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x600
     LayoutBlockFlow {BODY} at (8,8) size 784x584
       LayoutBlockFlow {P} at (0,0) size 784x36
-        LayoutText {#text} at (0,0) size 594x18
-          text run at (0,0) width 594: "This tests that bidirectional text is correctly rendered when using ATSUI in list box controls."
-        LayoutBR {BR} at (593,14) size 1x0
+        LayoutText {#text} at (0,0) size 592x18
+          text run at (0,0) width 592: "This tests that bidirectional text is correctly rendered when using ATSUI in list box controls."
+        LayoutBR {BR} at (591,14) size 1x0
         LayoutText {#text} at (0,18) size 578x18
           text run at (0,18) width 578: "The order of the text below each list box should match the order of the select's option text."
       LayoutBlockFlow (anonymous) at (0,52) size 784x48
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/bidi-neutral-directionality-paragraph-start-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/bidi-neutral-directionality-paragraph-start-expected.png
index 4a0ab384..1807b3a 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/bidi-neutral-directionality-paragraph-start-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/bidi-neutral-directionality-paragraph-start-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/bidi-neutral-directionality-paragraph-start-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/bidi-neutral-directionality-paragraph-start-expected.txt
index cc206b74..3519e0d 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/bidi-neutral-directionality-paragraph-start-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/bidi-neutral-directionality-paragraph-start-expected.txt
@@ -4,22 +4,22 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x600
     LayoutBlockFlow {BODY} at (8,8) size 784x576
       LayoutBlockFlow {P} at (0,0) size 784x18
-        LayoutText {#text} at (0,0) size 581x18
-          text run at (0,0) width 581: "Mitz Pettel contributed this fix to KDE, and now we're rolling it in. Here's his explanation:"
+        LayoutText {#text} at (0,0) size 580x18
+          text run at (0,0) width 580: "Mitz Pettel contributed this fix to KDE, and now we're rolling it in. Here's his explanation:"
       LayoutBlockFlow {P} at (0,34) size 784x72
-        LayoutText {#text} at (0,0) size 774x72
+        LayoutText {#text} at (0,0) size 773x72
           text run at (0,0) width 772: "The directionality of a neutral character at the beginning of a paragraph (or after a hard line break) is decided incorrectly"
-          text run at (0,18) width 774: "if the first non-neutral character in the paragraph has directionality opposite to the paragraph directionality. For example,"
-          text run at (0,36) width 754: "if the paragraph direction is LTR, the first character on the paragraph is a question mark and the next one is a Hebrew"
-          text run at (0,54) width 725: "character, then the question mark will is considered right-to-left and appears to the right of the Hebrew character."
+          text run at (0,18) width 773: "if the first non-neutral character in the paragraph has directionality opposite to the paragraph directionality. For example,"
+          text run at (0,36) width 751: "if the paragraph direction is LTR, the first character on the paragraph is a question mark and the next one is a Hebrew"
+          text run at (0,54) width 724: "character, then the question mark will is considered right-to-left and appears to the right of the Hebrew character."
       LayoutBlockFlow {P} at (0,122) size 784x36
         LayoutText {#text} at (0,0) size 517x18
           text run at (0,0) width 517: "The rule to follow is 3.3.4.N2 in the Unicode Standard's Bidirectional Algorithm"
-        LayoutInline {A} at (0,0) size 405x18 [color=#0000EE]
-          LayoutText {#text} at (0,18) size 405x18
-            text run at (0,18) width 405: "http://www.unicode.org/reports/tr9/#Resolving_Neutral_Types"
-        LayoutText {#text} at (404,18) size 5x18
-          text run at (404,18) width 5: "."
+        LayoutInline {A} at (0,0) size 402x18 [color=#0000EE]
+          LayoutText {#text} at (0,18) size 402x18
+            text run at (0,18) width 402: "http://www.unicode.org/reports/tr9/#Resolving_Neutral_Types"
+        LayoutText {#text} at (401,18) size 5x18
+          text run at (401,18) width 5: "."
       LayoutBlockFlow {P} at (0,174) size 784x18
         LayoutText {#text} at (0,0) size 692x18
           text run at (0,0) width 692: "If the test is successful, the question marks should be on the far left and far right of the next two paragraphs."
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/bidi-neutral-run-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/bidi-neutral-run-expected.png
index 378ad5ad..55d426e 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/bidi-neutral-run-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/bidi-neutral-run-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/bidi-neutral-run-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/bidi-neutral-run-expected.txt
index 4dc96c4d..685498a 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/bidi-neutral-run-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/bidi-neutral-run-expected.txt
@@ -1,12 +1,12 @@
-layer at (0,0) size 800x600 clip at (0,0) size 785x600 scrollHeight 6378
+layer at (0,0) size 800x600 clip at (0,0) size 785x600 scrollHeight 6406
   LayoutView at (0,0) size 800x600
-layer at (0,0) size 785x6378 backgroundClip at (0,0) size 785x600 clip at (0,0) size 785x600
-  LayoutBlockFlow {HTML} at (0,0) size 785x6378
-    LayoutBlockFlow {BODY} at (8,8) size 769x6354
+layer at (0,0) size 785x6406 backgroundClip at (0,0) size 785x600 clip at (0,0) size 785x600
+  LayoutBlockFlow {HTML} at (0,0) size 785x6406
+    LayoutBlockFlow {BODY} at (8,8) size 769x6382
       LayoutBlockFlow {P} at (0,0) size 769x18
-        LayoutText {#text} at (0,0) size 308x18
-          text run at (0,0) width 308: "Tests the resolved level of runs of neutral types."
-      LayoutBlockFlow {DIV} at (0,34) size 769x3152
+        LayoutText {#text} at (0,0) size 306x18
+          text run at (0,0) width 306: "Tests the resolved level of runs of neutral types."
+      LayoutBlockFlow {DIV} at (0,34) size 769x3166
         LayoutBlockFlow {P} at (0,0) size 769x18
           LayoutText {#text} at (0,0) size 44x18
             text run at (0,0) width 44: "ab(^cd"
@@ -46,133 +46,133 @@
             text run at (0,1) width 17: "\x{661}\x{662}"
             text run at (16,1) width 16 RTL: "\x{627}\x{628}"
             text run at (31,1) width 29: "(^cd"
-        LayoutBlockFlow {P} at (0,323) size 769x18
-          LayoutText {#text} at (0,0) size 36x18
-            text run at (0,0) width 8: "\x{202A}?"
-            text run at (7,0) width 29: "\x{202C}(^cd"
-        LayoutBlockFlow {P} at (0,357) size 769x18
-          LayoutText {#text} at (0,0) size 36x18
-            text run at (0,0) width 8 RTL: "\x{202B}?"
-            text run at (7,0) width 29: "\x{202C}(^cd"
-        LayoutBlockFlow {P} at (0,391) size 769x19
+        LayoutBlockFlow {P} at (0,323) size 769x19
+          LayoutText {#text} at (0,1) size 36x18
+            text run at (0,1) width 8: "\x{202A}?"
+            text run at (7,1) width 29: "\x{202C}(^cd"
+        LayoutBlockFlow {P} at (0,358) size 769x19
+          LayoutText {#text} at (0,1) size 36x18
+            text run at (0,1) width 8 RTL: "\x{202B}?"
+            text run at (7,1) width 29: "\x{202C}(^cd"
+        LayoutBlockFlow {P} at (0,393) size 769x19
           LayoutText {#text} at (0,1) size 43x18
             text run at (0,1) width 28: "ab(^"
             text run at (27,1) width 16 RTL: "\x{5D2}\x{5D3}"
-        LayoutBlockFlow {P} at (0,426) size 769x19
+        LayoutBlockFlow {P} at (0,428) size 769x19
           LayoutText {#text} at (0,1) size 48x18
             text run at (0,1) width 48 RTL: "\x{5D0}\x{5D1}(^\x{5D2}\x{5D3}"
-        LayoutBlockFlow {P} at (0,461) size 769x21
+        LayoutBlockFlow {P} at (0,463) size 769x21
           LayoutText {#text} at (0,1) size 43x18
             text run at (0,1) width 43 RTL: "\x{627}\x{628}(^\x{5D2}\x{5D3}"
-        LayoutBlockFlow {P} at (0,498) size 769x19
+        LayoutBlockFlow {P} at (0,500) size 769x19
           LayoutText {#text} at (0,1) size 59x18
             text run at (0,1) width 44: "ab12(^"
             text run at (43,1) width 16 RTL: "\x{5D2}\x{5D3}"
-        LayoutBlockFlow {P} at (0,533) size 769x19
+        LayoutBlockFlow {P} at (0,535) size 769x19
           LayoutText {#text} at (0,1) size 64x18
             text run at (0,1) width 28 RTL: "(^\x{5D2}\x{5D3}"
             text run at (27,1) width 17: "12"
             text run at (43,1) width 21 RTL: "\x{5D0}\x{5D1}"
-        LayoutBlockFlow {P} at (0,568) size 769x21
+        LayoutBlockFlow {P} at (0,570) size 769x21
           LayoutText {#text} at (0,1) size 59x18
             text run at (0,1) width 28 RTL: "(^\x{5D2}\x{5D3}"
             text run at (27,1) width 17: "12"
             text run at (43,1) width 16 RTL: "\x{627}\x{628}"
-        LayoutBlockFlow {P} at (0,605) size 769x21
+        LayoutBlockFlow {P} at (0,607) size 769x21
           LayoutText {#text} at (0,1) size 60x18
             text run at (0,1) width 16: "ab"
             text run at (15,1) width 28 RTL: "(^\x{5D2}\x{5D3}"
             text run at (42,1) width 18: "\x{661}\x{662}"
-        LayoutBlockFlow {P} at (0,642) size 769x21
+        LayoutBlockFlow {P} at (0,644) size 769x21
           LayoutText {#text} at (0,1) size 64x18
             text run at (0,1) width 28 RTL: "(^\x{5D2}\x{5D3}"
             text run at (27,1) width 18: "\x{661}\x{662}"
             text run at (44,1) width 20 RTL: "\x{5D0}\x{5D1}"
-        LayoutBlockFlow {P} at (0,679) size 769x21
+        LayoutBlockFlow {P} at (0,681) size 769x21
           LayoutText {#text} at (0,1) size 60x18
             text run at (0,1) width 28 RTL: "(^\x{5D2}\x{5D3}"
             text run at (27,1) width 18: "\x{661}\x{662}"
             text run at (44,1) width 16 RTL: "\x{627}\x{628}"
-        LayoutBlockFlow {P} at (0,716) size 769x19
+        LayoutBlockFlow {P} at (0,718) size 769x19
           LayoutText {#text} at (0,1) size 35x18
             text run at (0,1) width 8: "\x{202A}?"
             text run at (7,1) width 13: "\x{202C}(^"
             text run at (19,1) width 16 RTL: "\x{5D2}\x{5D3}"
-        LayoutBlockFlow {P} at (0,751) size 769x19
+        LayoutBlockFlow {P} at (0,753) size 769x19
           LayoutText {#text} at (0,1) size 35x18
             text run at (0,1) width 28 RTL: "\x{202C}(^\x{5D2}\x{5D3}"
             text run at (27,1) width 8 RTL: "\x{202B}?"
-        LayoutBlockFlow {P} at (0,786) size 769x21
+        LayoutBlockFlow {P} at (0,788) size 769x21
           LayoutText {#text} at (0,1) size 45x18
             text run at (0,1) width 28: "ab(^"
             text run at (27,1) width 18 RTL: "\x{62C}\x{62F}"
-        LayoutBlockFlow {P} at (0,823) size 769x21
+        LayoutBlockFlow {P} at (0,825) size 769x21
           LayoutText {#text} at (0,1) size 49x18
             text run at (0,1) width 49 RTL: "\x{5D0}\x{5D1}(^\x{62C}\x{62F}"
-        LayoutBlockFlow {P} at (0,860) size 769x21
+        LayoutBlockFlow {P} at (0,862) size 769x21
           LayoutText {#text} at (0,1) size 45x18
             text run at (0,1) width 45 RTL: "\x{627}\x{628}(^\x{62C}\x{62F}"
-        LayoutBlockFlow {P} at (0,897) size 769x21
+        LayoutBlockFlow {P} at (0,899) size 769x21
           LayoutText {#text} at (0,1) size 61x18
             text run at (0,1) width 44: "ab12(^"
             text run at (43,1) width 18 RTL: "\x{62C}\x{62F}"
-        LayoutBlockFlow {P} at (0,934) size 769x21
+        LayoutBlockFlow {P} at (0,936) size 769x21
           LayoutText {#text} at (0,1) size 65x18
             text run at (0,1) width 30 RTL: "(^\x{62C}\x{62F}"
             text run at (29,1) width 17: "12"
             text run at (45,1) width 20 RTL: "\x{5D0}\x{5D1}"
-        LayoutBlockFlow {P} at (0,971) size 769x21
+        LayoutBlockFlow {P} at (0,973) size 769x21
           LayoutText {#text} at (0,1) size 61x18
             text run at (0,1) width 30 RTL: "(^\x{62C}\x{62F}"
             text run at (29,1) width 17: "12"
             text run at (45,1) width 16 RTL: "\x{627}\x{628}"
-        LayoutBlockFlow {P} at (0,1008) size 769x21
+        LayoutBlockFlow {P} at (0,1010) size 769x21
           LayoutText {#text} at (0,1) size 62x18
             text run at (0,1) width 16: "ab"
             text run at (15,1) width 30 RTL: "(^\x{62C}\x{62F}"
             text run at (44,1) width 18: "\x{661}\x{662}"
-        LayoutBlockFlow {P} at (0,1045) size 769x21
+        LayoutBlockFlow {P} at (0,1047) size 769x21
           LayoutText {#text} at (0,1) size 66x18
             text run at (0,1) width 30 RTL: "(^\x{62C}\x{62F}"
             text run at (29,1) width 17: "\x{661}\x{662}"
             text run at (45,1) width 21 RTL: "\x{5D0}\x{5D1}"
-        LayoutBlockFlow {P} at (0,1082) size 769x21
+        LayoutBlockFlow {P} at (0,1084) size 769x21
           LayoutText {#text} at (0,1) size 61x18
             text run at (0,1) width 30 RTL: "(^\x{62C}\x{62F}"
             text run at (29,1) width 17: "\x{661}\x{662}"
             text run at (45,1) width 16 RTL: "\x{627}\x{628}"
-        LayoutBlockFlow {P} at (0,1119) size 769x21
+        LayoutBlockFlow {P} at (0,1121) size 769x21
           LayoutText {#text} at (0,1) size 37x18
             text run at (0,1) width 8: "\x{202A}?"
             text run at (7,1) width 13: "\x{202C}(^"
             text run at (19,1) width 18 RTL: "\x{62C}\x{62F}"
-        LayoutBlockFlow {P} at (0,1156) size 769x21
+        LayoutBlockFlow {P} at (0,1158) size 769x21
           LayoutText {#text} at (0,1) size 37x18
             text run at (0,1) width 30 RTL: "\x{202C}(^\x{62C}\x{62F}"
             text run at (29,1) width 8 RTL: "\x{202B}?"
-        LayoutBlockFlow {P} at (0,1193) size 769x19
+        LayoutBlockFlow {P} at (0,1195) size 769x19
           LayoutText {#text} at (0,1) size 63x18
             text run at (0,1) width 44: "ab(^34"
             text run at (43,1) width 13 RTL: "\x{5E9}"
             text run at (55,1) width 8: "z"
-        LayoutBlockFlow {P} at (0,1228) size 769x19
+        LayoutBlockFlow {P} at (0,1230) size 769x19
           LayoutText {#text} at (0,1) size 67x18
             text run at (0,1) width 12 RTL: "\x{5E9}"
             text run at (11,1) width 17: "34"
             text run at (27,1) width 33 RTL: "\x{5D0}\x{5D1}(^"
             text run at (59,1) width 8: "z"
-        LayoutBlockFlow {P} at (0,1263) size 769x21
+        LayoutBlockFlow {P} at (0,1265) size 769x21
           LayoutText {#text} at (0,1) size 63x18
             text run at (0,1) width 12 RTL: "\x{5E9}"
             text run at (11,1) width 17: "34"
             text run at (27,1) width 29 RTL: "\x{627}\x{628}(^"
             text run at (55,1) width 8: "z"
-        LayoutBlockFlow {P} at (0,1300) size 769x19
+        LayoutBlockFlow {P} at (0,1302) size 769x19
           LayoutText {#text} at (0,1) size 79x18
             text run at (0,1) width 60: "ab12(^34"
             text run at (59,1) width 13 RTL: "\x{5E9}"
             text run at (71,1) width 8: "z"
-        LayoutBlockFlow {P} at (0,1335) size 769x19
+        LayoutBlockFlow {P} at (0,1337) size 769x19
           LayoutText {#text} at (0,1) size 83x18
             text run at (0,1) width 12 RTL: "\x{5E9}"
             text run at (11,1) width 17: "34"
@@ -180,7 +180,7 @@
             text run at (40,1) width 17: "12"
             text run at (56,1) width 20 RTL: "\x{5D0}\x{5D1}"
             text run at (75,1) width 8: "z"
-        LayoutBlockFlow {P} at (0,1370) size 769x21
+        LayoutBlockFlow {P} at (0,1372) size 769x21
           LayoutText {#text} at (0,1) size 79x18
             text run at (0,1) width 12 RTL: "\x{5E9}"
             text run at (11,1) width 17: "34"
@@ -188,14 +188,14 @@
             text run at (40,1) width 17: "12"
             text run at (56,1) width 16 RTL: "\x{627}\x{628}"
             text run at (71,1) width 8: "z"
-        LayoutBlockFlow {P} at (0,1407) size 769x21
+        LayoutBlockFlow {P} at (0,1409) size 769x21
           LayoutText {#text} at (0,1) size 80x18
             text run at (0,1) width 16: "ab"
             text run at (15,1) width 17: "\x{661}\x{662}"
             text run at (31,1) width 30: "(^34"
             text run at (60,1) width 13 RTL: "\x{5E9}"
             text run at (72,1) width 8: "z"
-        LayoutBlockFlow {P} at (0,1444) size 769x21
+        LayoutBlockFlow {P} at (0,1446) size 769x21
           LayoutText {#text} at (0,1) size 84x18
             text run at (0,1) width 12 RTL: "\x{5E9}"
             text run at (11,1) width 17: "34"
@@ -203,7 +203,7 @@
             text run at (40,1) width 18: "\x{661}\x{662}"
             text run at (57,1) width 20 RTL: "\x{5D0}\x{5D1}"
             text run at (76,1) width 8: "z"
-        LayoutBlockFlow {P} at (0,1481) size 769x21
+        LayoutBlockFlow {P} at (0,1483) size 769x21
           LayoutText {#text} at (0,1) size 80x18
             text run at (0,1) width 12 RTL: "\x{5E9}"
             text run at (11,1) width 17: "34"
@@ -211,44 +211,44 @@
             text run at (40,1) width 18: "\x{661}\x{662}"
             text run at (57,1) width 15 RTL: "\x{627}\x{628}"
             text run at (71,1) width 9: "z"
-        LayoutBlockFlow {P} at (0,1518) size 769x19
+        LayoutBlockFlow {P} at (0,1520) size 769x19
           LayoutText {#text} at (0,1) size 55x18
             text run at (0,1) width 8: "\x{202A}?"
             text run at (7,1) width 29: "\x{202C}(^34"
             text run at (35,1) width 13 RTL: "\x{5E9}"
             text run at (47,1) width 8: "z"
-        LayoutBlockFlow {P} at (0,1553) size 769x19
+        LayoutBlockFlow {P} at (0,1555) size 769x19
           LayoutText {#text} at (0,1) size 55x18
             text run at (0,1) width 12 RTL: "\x{5E9}"
             text run at (11,1) width 17: "34"
             text run at (27,1) width 14 RTL: "\x{202C}(^"
             text run at (40,1) width 8 RTL: "\x{202B}?"
             text run at (47,1) width 8: "z"
-        LayoutBlockFlow {P} at (0,1588) size 769x21
+        LayoutBlockFlow {P} at (0,1590) size 769x21
           LayoutText {#text} at (0,1) size 64x18
             text run at (0,1) width 28: "ab(^"
             text run at (27,1) width 13 RTL: "\x{5E9}"
             text run at (39,1) width 18: "\x{663}\x{664}"
             text run at (56,1) width 8: "z"
-        LayoutBlockFlow {P} at (0,1625) size 769x21
+        LayoutBlockFlow {P} at (0,1627) size 769x21
           LayoutText {#text} at (0,1) size 68x18
             text run at (0,1) width 12 RTL: "\x{5E9}"
             text run at (11,1) width 18: "\x{663}\x{664}"
             text run at (28,1) width 33 RTL: "\x{5D0}\x{5D1}(^"
             text run at (60,1) width 8: "z"
-        LayoutBlockFlow {P} at (0,1662) size 769x21
+        LayoutBlockFlow {P} at (0,1664) size 769x21
           LayoutText {#text} at (0,1) size 64x18
             text run at (0,1) width 12 RTL: "\x{5E9}"
             text run at (11,1) width 18: "\x{663}\x{664}"
             text run at (28,1) width 28 RTL: "\x{627}\x{628}(^"
             text run at (56,1) width 8: "z"
-        LayoutBlockFlow {P} at (0,1699) size 769x21
+        LayoutBlockFlow {P} at (0,1701) size 769x21
           LayoutText {#text} at (0,1) size 80x18
             text run at (0,1) width 44: "ab12(^"
             text run at (43,1) width 13 RTL: "\x{5E9}"
             text run at (55,1) width 18: "\x{663}\x{664}"
             text run at (72,1) width 8: "z"
-        LayoutBlockFlow {P} at (0,1736) size 769x21
+        LayoutBlockFlow {P} at (0,1738) size 769x21
           LayoutText {#text} at (0,1) size 84x18
             text run at (0,1) width 12 RTL: "\x{5E9}"
             text run at (11,1) width 18: "\x{663}\x{664}"
@@ -256,7 +256,7 @@
             text run at (41,1) width 17: "12"
             text run at (57,1) width 20 RTL: "\x{5D0}\x{5D1}"
             text run at (76,1) width 8: "z"
-        LayoutBlockFlow {P} at (0,1773) size 769x21
+        LayoutBlockFlow {P} at (0,1775) size 769x21
           LayoutText {#text} at (0,1) size 80x18
             text run at (0,1) width 12 RTL: "\x{5E9}"
             text run at (11,1) width 18: "\x{663}\x{664}"
@@ -264,7 +264,7 @@
             text run at (41,1) width 17: "12"
             text run at (57,1) width 15 RTL: "\x{627}\x{628}"
             text run at (71,1) width 9: "z"
-        LayoutBlockFlow {P} at (0,1810) size 769x21
+        LayoutBlockFlow {P} at (0,1812) size 769x21
           LayoutText {#text} at (0,1) size 81x18
             text run at (0,1) width 16: "ab"
             text run at (15,1) width 12 RTL: "\x{5E9}"
@@ -272,7 +272,7 @@
             text run at (43,1) width 14 RTL: "(^"
             text run at (56,1) width 17: "\x{661}\x{662}"
             text run at (72,1) width 9: "z"
-        LayoutBlockFlow {P} at (0,1847) size 769x21
+        LayoutBlockFlow {P} at (0,1849) size 769x21
           LayoutText {#text} at (0,1) size 85x18
             text run at (0,1) width 12 RTL: "\x{5E9}"
             text run at (11,1) width 18: "\x{663}\x{664}"
@@ -280,7 +280,7 @@
             text run at (41,1) width 17: "\x{661}\x{662}"
             text run at (57,1) width 21 RTL: "\x{5D0}\x{5D1}"
             text run at (77,1) width 8: "z"
-        LayoutBlockFlow {P} at (0,1884) size 769x21
+        LayoutBlockFlow {P} at (0,1886) size 769x21
           LayoutText {#text} at (0,1) size 80x18
             text run at (0,1) width 12 RTL: "\x{5E9}"
             text run at (11,1) width 18: "\x{663}\x{664}"
@@ -288,217 +288,217 @@
             text run at (41,1) width 17: "\x{661}\x{662}"
             text run at (57,1) width 16 RTL: "\x{627}\x{628}"
             text run at (72,1) width 8: "z"
-        LayoutBlockFlow {P} at (0,1921) size 769x21
+        LayoutBlockFlow {P} at (0,1923) size 769x21
           LayoutText {#text} at (0,1) size 56x18
             text run at (0,1) width 8: "\x{202A}?"
             text run at (7,1) width 13: "\x{202C}(^"
             text run at (19,1) width 13 RTL: "\x{5E9}"
             text run at (31,1) width 18: "\x{663}\x{664}"
             text run at (48,1) width 8: "z"
-        LayoutBlockFlow {P} at (0,1958) size 769x21
+        LayoutBlockFlow {P} at (0,1960) size 769x21
           LayoutText {#text} at (0,1) size 56x18
             text run at (0,1) width 12 RTL: "\x{5E9}"
             text run at (11,1) width 18: "\x{663}\x{664}"
             text run at (28,1) width 14 RTL: "\x{202C}(^"
             text run at (41,1) width 8 RTL: "\x{202B}?"
             text run at (48,1) width 8: "z"
-        LayoutBlockFlow {P} at (0,1995) size 769x18
-          LayoutText {#text} at (0,0) size 34x18
-            text run at (0,0) width 28: "ab(^"
-            text run at (27,0) width 7: "\x{202A}!"
-            text run at (33,0) width 1: "\x{202C}"
-        LayoutBlockFlow {P} at (0,2029) size 769x19
+        LayoutBlockFlow {P} at (0,1997) size 769x19
+          LayoutText {#text} at (0,1) size 34x18
+            text run at (0,1) width 28: "ab(^"
+            text run at (27,1) width 7: "\x{202A}!"
+            text run at (33,1) width 1: "\x{202C}"
+        LayoutBlockFlow {P} at (0,2032) size 769x19
           LayoutText {#text} at (0,1) size 38x18
             text run at (0,1) width 20 RTL: "\x{5D0}\x{5D1}"
             text run at (19,1) width 14: "(^"
             text run at (32,1) width 6: "\x{202A}!"
             text run at (37,1) width 1: "\x{202C}"
-        LayoutBlockFlow {P} at (0,2064) size 769x21
+        LayoutBlockFlow {P} at (0,2067) size 769x21
           LayoutText {#text} at (0,1) size 34x18
             text run at (0,1) width 15 RTL: "\x{627}\x{628}"
             text run at (14,1) width 14: "(^"
             text run at (27,1) width 7: "\x{202A}!"
             text run at (33,1) width 1: "\x{202C}"
-        LayoutBlockFlow {P} at (0,2101) size 769x18
-          LayoutText {#text} at (0,0) size 50x18
-            text run at (0,0) width 44: "ab12(^"
-            text run at (43,0) width 7: "\x{202A}!"
-            text run at (49,0) width 1: "\x{202C}"
-        LayoutBlockFlow {P} at (0,2135) size 769x19
+        LayoutBlockFlow {P} at (0,2104) size 769x19
+          LayoutText {#text} at (0,1) size 50x18
+            text run at (0,1) width 44: "ab12(^"
+            text run at (43,1) width 7: "\x{202A}!"
+            text run at (49,1) width 1: "\x{202C}"
+        LayoutBlockFlow {P} at (0,2139) size 769x19
           LayoutText {#text} at (0,1) size 54x18
             text run at (0,1) width 16: "12"
             text run at (16,1) width 20 RTL: "\x{5D0}\x{5D1}"
             text run at (35,1) width 14: "(^"
             text run at (48,1) width 6: "\x{202A}!"
             text run at (53,1) width 1: "\x{202C}"
-        LayoutBlockFlow {P} at (0,2170) size 769x21
+        LayoutBlockFlow {P} at (0,2174) size 769x21
           LayoutText {#text} at (0,1) size 50x18
             text run at (0,1) width 16: "12"
             text run at (16,1) width 15 RTL: "\x{627}\x{628}"
             text run at (30,1) width 14: "(^"
             text run at (43,1) width 7: "\x{202A}!"
             text run at (49,1) width 1: "\x{202C}"
-        LayoutBlockFlow {P} at (0,2207) size 769x21
+        LayoutBlockFlow {P} at (0,2211) size 769x21
           LayoutText {#text} at (0,1) size 51x18
             text run at (0,1) width 16: "ab"
             text run at (15,1) width 17: "\x{661}\x{662}"
             text run at (31,1) width 14: "(^"
             text run at (44,1) width 7: "\x{202A}!"
             text run at (50,1) width 1: "\x{202C}"
-        LayoutBlockFlow {P} at (0,2244) size 769x21
+        LayoutBlockFlow {P} at (0,2248) size 769x21
           LayoutText {#text} at (0,1) size 55x18
             text run at (0,1) width 17: "\x{661}\x{662}"
             text run at (16,1) width 21 RTL: "\x{5D0}\x{5D1}"
             text run at (36,1) width 13: "(^"
             text run at (48,1) width 7: "\x{202A}!"
             text run at (54,1) width 1: "\x{202C}"
-        LayoutBlockFlow {P} at (0,2281) size 769x21
+        LayoutBlockFlow {P} at (0,2285) size 769x21
           LayoutText {#text} at (0,1) size 50x18
             text run at (0,1) width 17: "\x{661}\x{662}"
             text run at (16,1) width 16 RTL: "\x{627}\x{628}"
             text run at (31,1) width 14: "(^"
             text run at (44,1) width 6: "\x{202A}!"
             text run at (49,1) width 1: "\x{202C}"
-        LayoutBlockFlow {P} at (0,2318) size 769x18
-          LayoutText {#text} at (0,0) size 26x18
-            text run at (0,0) width 8: "\x{202A}?"
-            text run at (7,0) width 13: "\x{202C}(^"
-            text run at (19,0) width 7: "\x{202A}!"
-            text run at (25,0) width 1: "\x{202C}"
-        LayoutBlockFlow {P} at (0,2352) size 769x18
-          LayoutText {#text} at (0,0) size 26x18
-            text run at (0,0) width 8 RTL: "\x{202B}?"
-            text run at (7,0) width 13: "\x{202C}(^"
-            text run at (19,0) width 7: "\x{202A}!"
-            text run at (25,0) width 1: "\x{202C}"
-        LayoutBlockFlow {P} at (0,2386) size 769x18
-          LayoutText {#text} at (0,0) size 34x18
-            text run at (0,0) width 28: "ab(^"
-            text run at (27,0) width 7 RTL: "\x{202B}!"
-            text run at (33,0) width 1: "\x{202C}"
-        LayoutBlockFlow {P} at (0,2420) size 769x19
+        LayoutBlockFlow {P} at (0,2322) size 769x19
+          LayoutText {#text} at (0,1) size 26x18
+            text run at (0,1) width 8: "\x{202A}?"
+            text run at (7,1) width 13: "\x{202C}(^"
+            text run at (19,1) width 7: "\x{202A}!"
+            text run at (25,1) width 1: "\x{202C}"
+        LayoutBlockFlow {P} at (0,2357) size 769x19
+          LayoutText {#text} at (0,1) size 26x18
+            text run at (0,1) width 8 RTL: "\x{202B}?"
+            text run at (7,1) width 13: "\x{202C}(^"
+            text run at (19,1) width 7: "\x{202A}!"
+            text run at (25,1) width 1: "\x{202C}"
+        LayoutBlockFlow {P} at (0,2392) size 769x19
+          LayoutText {#text} at (0,1) size 34x18
+            text run at (0,1) width 28: "ab(^"
+            text run at (27,1) width 7 RTL: "\x{202B}!"
+            text run at (33,1) width 1: "\x{202C}"
+        LayoutBlockFlow {P} at (0,2427) size 769x19
           LayoutText {#text} at (0,1) size 38x18
             text run at (0,1) width 6 RTL: "\x{202B}!"
             text run at (5,1) width 33 RTL: "\x{5D0}\x{5D1}(^"
             text run at (37,1) width 1: "\x{202C}"
-        LayoutBlockFlow {P} at (0,2455) size 769x21
+        LayoutBlockFlow {P} at (0,2462) size 769x21
           LayoutText {#text} at (0,1) size 34x18
             text run at (0,1) width 6 RTL: "\x{202B}!"
             text run at (5,1) width 29 RTL: "\x{627}\x{628}(^"
             text run at (33,1) width 1: "\x{202C}"
-        LayoutBlockFlow {P} at (0,2492) size 769x18
-          LayoutText {#text} at (0,0) size 50x18
-            text run at (0,0) width 44: "ab12(^"
-            text run at (43,0) width 7 RTL: "\x{202B}!"
-            text run at (49,0) width 1: "\x{202C}"
-        LayoutBlockFlow {P} at (0,2526) size 769x19
+        LayoutBlockFlow {P} at (0,2499) size 769x19
+          LayoutText {#text} at (0,1) size 50x18
+            text run at (0,1) width 44: "ab12(^"
+            text run at (43,1) width 7 RTL: "\x{202B}!"
+            text run at (49,1) width 1: "\x{202C}"
+        LayoutBlockFlow {P} at (0,2534) size 769x19
           LayoutText {#text} at (0,1) size 54x18
             text run at (0,1) width 6 RTL: "\x{202B}!"
             text run at (5,1) width 14 RTL: "(^"
             text run at (18,1) width 17: "12"
             text run at (34,1) width 20 RTL: "\x{5D0}\x{5D1}"
             text run at (53,1) width 1: "\x{202C}"
-        LayoutBlockFlow {P} at (0,2561) size 769x21
+        LayoutBlockFlow {P} at (0,2569) size 769x21
           LayoutText {#text} at (0,1) size 50x18
             text run at (0,1) width 6 RTL: "\x{202B}!"
             text run at (5,1) width 14 RTL: "(^"
             text run at (18,1) width 17: "12"
             text run at (34,1) width 16 RTL: "\x{627}\x{628}"
             text run at (49,1) width 1: "\x{202C}"
-        LayoutBlockFlow {P} at (0,2598) size 769x21
+        LayoutBlockFlow {P} at (0,2606) size 769x21
           LayoutText {#text} at (0,1) size 51x18
             text run at (0,1) width 16: "ab"
             text run at (15,1) width 6 RTL: "\x{202B}!"
             text run at (20,1) width 14 RTL: "(^"
             text run at (33,1) width 18: "\x{661}\x{662}"
             text run at (50,1) width 1: "\x{202C}"
-        LayoutBlockFlow {P} at (0,2635) size 769x21
+        LayoutBlockFlow {P} at (0,2643) size 769x21
           LayoutText {#text} at (0,1) size 55x18
             text run at (0,1) width 6 RTL: "\x{202B}!"
             text run at (5,1) width 14 RTL: "(^"
             text run at (18,1) width 17: "\x{661}\x{662}"
             text run at (34,1) width 21 RTL: "\x{5D0}\x{5D1}"
             text run at (54,1) width 1: "\x{202C}"
-        LayoutBlockFlow {P} at (0,2672) size 769x21
+        LayoutBlockFlow {P} at (0,2680) size 769x21
           LayoutText {#text} at (0,1) size 50x18
             text run at (0,1) width 6 RTL: "\x{202B}!"
             text run at (5,1) width 14 RTL: "(^"
             text run at (18,1) width 17: "\x{661}\x{662}"
             text run at (34,1) width 16 RTL: "\x{627}\x{628}"
             text run at (49,1) width 1: "\x{202C}"
-        LayoutBlockFlow {P} at (0,2709) size 769x18
-          LayoutText {#text} at (0,0) size 26x18
-            text run at (0,0) width 8: "\x{202A}?"
-            text run at (7,0) width 13: "\x{202C}(^"
-            text run at (19,0) width 7 RTL: "\x{202B}!"
-            text run at (25,0) width 1: "\x{202C}"
-        LayoutBlockFlow {P} at (0,2743) size 769x18
-          LayoutText {#text} at (0,0) size 26x18
-            text run at (0,0) width 6 RTL: "\x{202B}!"
-            text run at (5,0) width 14 RTL: "\x{202C}(^"
-            text run at (18,0) width 8 RTL: "\x{202B}?"
-            text run at (25,0) width 1: "\x{202C}"
-        LayoutBlockFlow {P} at (0,2777) size 769x18
-          LayoutText {#text} at (0,0) size 28x18
-            text run at (0,0) width 28: "\x{202A}ab(^"
-            text run at (27,0) width 1: "\x{202C}"
-        LayoutBlockFlow {P} at (0,2811) size 769x19
+        LayoutBlockFlow {P} at (0,2717) size 769x19
+          LayoutText {#text} at (0,1) size 26x18
+            text run at (0,1) width 8: "\x{202A}?"
+            text run at (7,1) width 13: "\x{202C}(^"
+            text run at (19,1) width 7 RTL: "\x{202B}!"
+            text run at (25,1) width 1: "\x{202C}"
+        LayoutBlockFlow {P} at (0,2752) size 769x19
+          LayoutText {#text} at (0,1) size 26x18
+            text run at (0,1) width 6 RTL: "\x{202B}!"
+            text run at (5,1) width 14 RTL: "\x{202C}(^"
+            text run at (18,1) width 8 RTL: "\x{202B}?"
+            text run at (25,1) width 1: "\x{202C}"
+        LayoutBlockFlow {P} at (0,2787) size 769x19
+          LayoutText {#text} at (0,1) size 28x18
+            text run at (0,1) width 28: "\x{202A}ab(^"
+            text run at (27,1) width 1: "\x{202C}"
+        LayoutBlockFlow {P} at (0,2822) size 769x19
           LayoutText {#text} at (0,1) size 33x18
             text run at (0,1) width 20 RTL: "\x{202A}\x{5D0}\x{5D1}"
             text run at (19,1) width 14: "(^"
             text run at (32,1) width 1: "\x{202C}"
-        LayoutBlockFlow {P} at (0,2846) size 769x21
+        LayoutBlockFlow {P} at (0,2857) size 769x21
           LayoutText {#text} at (0,1) size 28x18
             text run at (0,1) width 15 RTL: "\x{202A}\x{627}\x{628}"
             text run at (14,1) width 14: "(^"
             text run at (27,1) width 1: "\x{202C}"
-        LayoutBlockFlow {P} at (0,2883) size 769x18
-          LayoutText {#text} at (0,0) size 44x18
-            text run at (0,0) width 44: "\x{202A}ab12(^"
-            text run at (43,0) width 1: "\x{202C}"
-        LayoutBlockFlow {P} at (0,2917) size 769x19
+        LayoutBlockFlow {P} at (0,2894) size 769x19
+          LayoutText {#text} at (0,1) size 44x18
+            text run at (0,1) width 44: "\x{202A}ab12(^"
+            text run at (43,1) width 1: "\x{202C}"
+        LayoutBlockFlow {P} at (0,2929) size 769x19
           LayoutText {#text} at (0,1) size 49x18
             text run at (0,1) width 16: "12"
             text run at (16,1) width 20 RTL: "\x{202A}\x{5D0}\x{5D1}"
             text run at (35,1) width 14: "(^"
             text run at (48,1) width 1: "\x{202C}"
-        LayoutBlockFlow {P} at (0,2952) size 769x21
+        LayoutBlockFlow {P} at (0,2964) size 769x21
           LayoutText {#text} at (0,1) size 44x18
             text run at (0,1) width 16: "12"
             text run at (16,1) width 15 RTL: "\x{202A}\x{627}\x{628}"
             text run at (30,1) width 14: "(^"
             text run at (43,1) width 1: "\x{202C}"
-        LayoutBlockFlow {P} at (0,2989) size 769x21
+        LayoutBlockFlow {P} at (0,3001) size 769x21
           LayoutText {#text} at (0,1) size 45x18
             text run at (0,1) width 16: "\x{202A}ab"
             text run at (15,1) width 17: "\x{661}\x{662}"
             text run at (31,1) width 14: "(^"
             text run at (44,1) width 1: "\x{202C}"
-        LayoutBlockFlow {P} at (0,3026) size 769x21
+        LayoutBlockFlow {P} at (0,3038) size 769x21
           LayoutText {#text} at (0,1) size 49x18
             text run at (0,1) width 17: "\x{661}\x{662}"
             text run at (16,1) width 21 RTL: "\x{202A}\x{5D0}\x{5D1}"
             text run at (36,1) width 13: "(^"
             text run at (48,1) width 1: "\x{202C}"
-        LayoutBlockFlow {P} at (0,3063) size 769x21
+        LayoutBlockFlow {P} at (0,3075) size 769x21
           LayoutText {#text} at (0,1) size 45x18
             text run at (0,1) width 17: "\x{661}\x{662}"
             text run at (16,1) width 16 RTL: "\x{202A}\x{627}\x{628}"
             text run at (31,1) width 14: "(^"
             text run at (44,1) width 1: "\x{202C}"
-        LayoutBlockFlow {P} at (0,3100) size 769x18
-          LayoutText {#text} at (0,0) size 20x18
-            text run at (0,0) width 0: "\x{202A}"
-            text run at (0,0) width 8: "\x{202A}?"
-            text run at (7,0) width 13: "\x{202C}(^"
-            text run at (19,0) width 1: "\x{202C}"
-        LayoutBlockFlow {P} at (0,3134) size 769x18
-          LayoutText {#text} at (0,0) size 20x18
-            text run at (0,0) width 0: "\x{202A}"
-            text run at (0,0) width 8 RTL: "\x{202B}?"
-            text run at (7,0) width 13: "\x{202C}(^"
-            text run at (19,0) width 1: "\x{202C}"
-      LayoutBlockFlow {DIV} at (0,3202) size 769x3152
+        LayoutBlockFlow {P} at (0,3112) size 769x19
+          LayoutText {#text} at (0,1) size 20x18
+            text run at (0,1) width 0: "\x{202A}"
+            text run at (0,1) width 8: "\x{202A}?"
+            text run at (7,1) width 13: "\x{202C}(^"
+            text run at (19,1) width 1: "\x{202C}"
+        LayoutBlockFlow {P} at (0,3147) size 769x19
+          LayoutText {#text} at (0,1) size 20x18
+            text run at (0,1) width 0: "\x{202A}"
+            text run at (0,1) width 8 RTL: "\x{202B}?"
+            text run at (7,1) width 13: "\x{202C}(^"
+            text run at (19,1) width 1: "\x{202C}"
+      LayoutBlockFlow {DIV} at (0,3216) size 769x3166
         LayoutBlockFlow {P} at (0,0) size 769x18
           LayoutText {#text} at (0,0) size 44x18
             text run at (0,0) width 44: "ab(^cd"
@@ -542,130 +542,130 @@
             text run at (15,1) width 13 RTL: "(^"
             text run at (27,1) width 18: "\x{661}\x{662}"
             text run at (44,1) width 16 RTL: "\x{627}\x{628}"
-        LayoutBlockFlow {P} at (0,323) size 769x18
-          LayoutText {#text} at (0,0) size 36x18
-            text run at (0,0) width 8: "\x{202A}?"
-            text run at (7,0) width 29: "\x{202C}(^cd"
-        LayoutBlockFlow {P} at (0,357) size 769x18
-          LayoutText {#text} at (0,0) size 36x18
-            text run at (0,0) width 16: "cd"
-            text run at (15,0) width 13 RTL: "\x{202C}(^"
-            text run at (27,0) width 9 RTL: "\x{202B}?"
-        LayoutBlockFlow {P} at (0,391) size 769x19
+        LayoutBlockFlow {P} at (0,323) size 769x19
+          LayoutText {#text} at (0,1) size 36x18
+            text run at (0,1) width 8: "\x{202A}?"
+            text run at (7,1) width 29: "\x{202C}(^cd"
+        LayoutBlockFlow {P} at (0,358) size 769x19
+          LayoutText {#text} at (0,1) size 36x18
+            text run at (0,1) width 16: "cd"
+            text run at (15,1) width 13 RTL: "\x{202C}(^"
+            text run at (27,1) width 9 RTL: "\x{202B}?"
+        LayoutBlockFlow {P} at (0,393) size 769x19
           LayoutText {#text} at (0,1) size 43x18
             text run at (0,1) width 28 RTL: "(^\x{5D2}\x{5D3}"
             text run at (27,1) width 16: "ab"
-        LayoutBlockFlow {P} at (0,426) size 769x19
+        LayoutBlockFlow {P} at (0,428) size 769x19
           LayoutText {#text} at (0,1) size 48x18
             text run at (0,1) width 48 RTL: "\x{5D0}\x{5D1}(^\x{5D2}\x{5D3}"
-        LayoutBlockFlow {P} at (0,461) size 769x21
+        LayoutBlockFlow {P} at (0,463) size 769x21
           LayoutText {#text} at (0,1) size 43x18
             text run at (0,1) width 43 RTL: "\x{627}\x{628}(^\x{5D2}\x{5D3}"
-        LayoutBlockFlow {P} at (0,498) size 769x19
+        LayoutBlockFlow {P} at (0,500) size 769x19
           LayoutText {#text} at (0,1) size 59x18
             text run at (0,1) width 28 RTL: "(^\x{5D2}\x{5D3}"
             text run at (27,1) width 32: "ab12"
-        LayoutBlockFlow {P} at (0,533) size 769x19
+        LayoutBlockFlow {P} at (0,535) size 769x19
           LayoutText {#text} at (0,1) size 64x18
             text run at (0,1) width 28 RTL: "(^\x{5D2}\x{5D3}"
             text run at (27,1) width 17: "12"
             text run at (43,1) width 21 RTL: "\x{5D0}\x{5D1}"
-        LayoutBlockFlow {P} at (0,568) size 769x21
+        LayoutBlockFlow {P} at (0,570) size 769x21
           LayoutText {#text} at (0,1) size 59x18
             text run at (0,1) width 28 RTL: "(^\x{5D2}\x{5D3}"
             text run at (27,1) width 17: "12"
             text run at (43,1) width 16 RTL: "\x{627}\x{628}"
-        LayoutBlockFlow {P} at (0,605) size 769x21
+        LayoutBlockFlow {P} at (0,607) size 769x21
           LayoutText {#text} at (0,1) size 60x18
             text run at (0,1) width 28 RTL: "(^\x{5D2}\x{5D3}"
             text run at (27,1) width 33: "ab\x{661}\x{662}"
-        LayoutBlockFlow {P} at (0,642) size 769x21
+        LayoutBlockFlow {P} at (0,644) size 769x21
           LayoutText {#text} at (0,1) size 64x18
             text run at (0,1) width 28 RTL: "(^\x{5D2}\x{5D3}"
             text run at (27,1) width 18: "\x{661}\x{662}"
             text run at (44,1) width 20 RTL: "\x{5D0}\x{5D1}"
-        LayoutBlockFlow {P} at (0,679) size 769x21
+        LayoutBlockFlow {P} at (0,681) size 769x21
           LayoutText {#text} at (0,1) size 60x18
             text run at (0,1) width 28 RTL: "(^\x{5D2}\x{5D3}"
             text run at (27,1) width 18: "\x{661}\x{662}"
             text run at (44,1) width 16 RTL: "\x{627}\x{628}"
-        LayoutBlockFlow {P} at (0,716) size 769x19
+        LayoutBlockFlow {P} at (0,718) size 769x19
           LayoutText {#text} at (0,1) size 35x18
             text run at (0,1) width 28 RTL: "\x{202C}(^\x{5D2}\x{5D3}"
             text run at (27,1) width 8: "\x{202A}?"
-        LayoutBlockFlow {P} at (0,751) size 769x19
+        LayoutBlockFlow {P} at (0,753) size 769x19
           LayoutText {#text} at (0,1) size 35x18
             text run at (0,1) width 28 RTL: "\x{202C}(^\x{5D2}\x{5D3}"
             text run at (27,1) width 8 RTL: "\x{202B}?"
-        LayoutBlockFlow {P} at (0,786) size 769x21
+        LayoutBlockFlow {P} at (0,788) size 769x21
           LayoutText {#text} at (0,1) size 45x18
             text run at (0,1) width 30 RTL: "(^\x{62C}\x{62F}"
             text run at (29,1) width 16: "ab"
-        LayoutBlockFlow {P} at (0,823) size 769x21
+        LayoutBlockFlow {P} at (0,825) size 769x21
           LayoutText {#text} at (0,1) size 49x18
             text run at (0,1) width 49 RTL: "\x{5D0}\x{5D1}(^\x{62C}\x{62F}"
-        LayoutBlockFlow {P} at (0,860) size 769x21
+        LayoutBlockFlow {P} at (0,862) size 769x21
           LayoutText {#text} at (0,1) size 45x18
             text run at (0,1) width 45 RTL: "\x{627}\x{628}(^\x{62C}\x{62F}"
-        LayoutBlockFlow {P} at (0,897) size 769x21
+        LayoutBlockFlow {P} at (0,899) size 769x21
           LayoutText {#text} at (0,1) size 61x18
             text run at (0,1) width 30 RTL: "(^\x{62C}\x{62F}"
             text run at (29,1) width 32: "ab12"
-        LayoutBlockFlow {P} at (0,934) size 769x21
+        LayoutBlockFlow {P} at (0,936) size 769x21
           LayoutText {#text} at (0,1) size 65x18
             text run at (0,1) width 30 RTL: "(^\x{62C}\x{62F}"
             text run at (29,1) width 17: "12"
             text run at (45,1) width 20 RTL: "\x{5D0}\x{5D1}"
-        LayoutBlockFlow {P} at (0,971) size 769x21
+        LayoutBlockFlow {P} at (0,973) size 769x21
           LayoutText {#text} at (0,1) size 61x18
             text run at (0,1) width 30 RTL: "(^\x{62C}\x{62F}"
             text run at (29,1) width 17: "12"
             text run at (45,1) width 16 RTL: "\x{627}\x{628}"
-        LayoutBlockFlow {P} at (0,1008) size 769x21
+        LayoutBlockFlow {P} at (0,1010) size 769x21
           LayoutText {#text} at (0,1) size 62x18
             text run at (0,1) width 30 RTL: "(^\x{62C}\x{62F}"
             text run at (29,1) width 33: "ab\x{661}\x{662}"
-        LayoutBlockFlow {P} at (0,1045) size 769x21
+        LayoutBlockFlow {P} at (0,1047) size 769x21
           LayoutText {#text} at (0,1) size 66x18
             text run at (0,1) width 30 RTL: "(^\x{62C}\x{62F}"
             text run at (29,1) width 17: "\x{661}\x{662}"
             text run at (45,1) width 21 RTL: "\x{5D0}\x{5D1}"
-        LayoutBlockFlow {P} at (0,1082) size 769x21
+        LayoutBlockFlow {P} at (0,1084) size 769x21
           LayoutText {#text} at (0,1) size 61x18
             text run at (0,1) width 30 RTL: "(^\x{62C}\x{62F}"
             text run at (29,1) width 17: "\x{661}\x{662}"
             text run at (45,1) width 16 RTL: "\x{627}\x{628}"
-        LayoutBlockFlow {P} at (0,1119) size 769x21
+        LayoutBlockFlow {P} at (0,1121) size 769x21
           LayoutText {#text} at (0,1) size 37x18
             text run at (0,1) width 30 RTL: "\x{202C}(^\x{62C}\x{62F}"
             text run at (29,1) width 8: "\x{202A}?"
-        LayoutBlockFlow {P} at (0,1156) size 769x21
+        LayoutBlockFlow {P} at (0,1158) size 769x21
           LayoutText {#text} at (0,1) size 37x18
             text run at (0,1) width 30 RTL: "\x{202C}(^\x{62C}\x{62F}"
             text run at (29,1) width 8 RTL: "\x{202B}?"
-        LayoutBlockFlow {P} at (0,1193) size 769x19
+        LayoutBlockFlow {P} at (0,1195) size 769x19
           LayoutText {#text} at (0,1) size 63x18
             text run at (0,1) width 8: "z"
             text run at (7,1) width 12 RTL: "\x{5E9}"
             text run at (18,1) width 45: "ab(^34"
-        LayoutBlockFlow {P} at (0,1228) size 769x19
+        LayoutBlockFlow {P} at (0,1230) size 769x19
           LayoutText {#text} at (0,1) size 67x18
             text run at (0,1) width 8: "z"
             text run at (7,1) width 12 RTL: "\x{5E9}"
             text run at (18,1) width 17: "34"
             text run at (34,1) width 33 RTL: "\x{5D0}\x{5D1}(^"
-        LayoutBlockFlow {P} at (0,1263) size 769x21
+        LayoutBlockFlow {P} at (0,1265) size 769x21
           LayoutText {#text} at (0,1) size 63x18
             text run at (0,1) width 8: "z"
             text run at (7,1) width 12 RTL: "\x{5E9}"
             text run at (18,1) width 17: "34"
             text run at (34,1) width 29 RTL: "\x{627}\x{628}(^"
-        LayoutBlockFlow {P} at (0,1300) size 769x19
+        LayoutBlockFlow {P} at (0,1302) size 769x19
           LayoutText {#text} at (0,1) size 79x18
             text run at (0,1) width 8: "z"
             text run at (7,1) width 12 RTL: "\x{5E9}"
             text run at (18,1) width 61: "ab12(^34"
-        LayoutBlockFlow {P} at (0,1335) size 769x19
+        LayoutBlockFlow {P} at (0,1337) size 769x19
           LayoutText {#text} at (0,1) size 83x18
             text run at (0,1) width 8: "z"
             text run at (7,1) width 12 RTL: "\x{5E9}"
@@ -673,7 +673,7 @@
             text run at (34,1) width 14 RTL: "(^"
             text run at (47,1) width 17: "12"
             text run at (63,1) width 20 RTL: "\x{5D0}\x{5D1}"
-        LayoutBlockFlow {P} at (0,1370) size 769x21
+        LayoutBlockFlow {P} at (0,1372) size 769x21
           LayoutText {#text} at (0,1) size 79x18
             text run at (0,1) width 8: "z"
             text run at (7,1) width 12 RTL: "\x{5E9}"
@@ -681,14 +681,14 @@
             text run at (34,1) width 14 RTL: "(^"
             text run at (47,1) width 17: "12"
             text run at (63,1) width 16 RTL: "\x{627}\x{628}"
-        LayoutBlockFlow {P} at (0,1407) size 769x21
+        LayoutBlockFlow {P} at (0,1409) size 769x21
           LayoutText {#text} at (0,1) size 80x18
             text run at (0,1) width 8: "z"
             text run at (7,1) width 12 RTL: "\x{5E9}"
             text run at (18,1) width 17: "34"
             text run at (34,1) width 14 RTL: "(^"
             text run at (47,1) width 33: "ab\x{661}\x{662}"
-        LayoutBlockFlow {P} at (0,1444) size 769x21
+        LayoutBlockFlow {P} at (0,1446) size 769x21
           LayoutText {#text} at (0,1) size 84x18
             text run at (0,1) width 8: "z"
             text run at (7,1) width 12 RTL: "\x{5E9}"
@@ -696,7 +696,7 @@
             text run at (34,1) width 14 RTL: "(^"
             text run at (47,1) width 18: "\x{661}\x{662}"
             text run at (64,1) width 20 RTL: "\x{5D0}\x{5D1}"
-        LayoutBlockFlow {P} at (0,1481) size 769x21
+        LayoutBlockFlow {P} at (0,1483) size 769x21
           LayoutText {#text} at (0,1) size 80x18
             text run at (0,1) width 8: "z"
             text run at (7,1) width 12 RTL: "\x{5E9}"
@@ -704,46 +704,46 @@
             text run at (34,1) width 14 RTL: "(^"
             text run at (47,1) width 18: "\x{661}\x{662}"
             text run at (64,1) width 16 RTL: "\x{627}\x{628}"
-        LayoutBlockFlow {P} at (0,1518) size 769x19
+        LayoutBlockFlow {P} at (0,1520) size 769x19
           LayoutText {#text} at (0,1) size 55x18
             text run at (0,1) width 8: "z"
             text run at (7,1) width 12 RTL: "\x{5E9}"
             text run at (18,1) width 8: "\x{202A}?"
             text run at (25,1) width 30: "\x{202C}(^34"
-        LayoutBlockFlow {P} at (0,1553) size 769x19
+        LayoutBlockFlow {P} at (0,1555) size 769x19
           LayoutText {#text} at (0,1) size 55x18
             text run at (0,1) width 8: "z"
             text run at (7,1) width 12 RTL: "\x{5E9}"
             text run at (18,1) width 17: "34"
             text run at (34,1) width 14 RTL: "\x{202C}(^"
             text run at (47,1) width 8 RTL: "\x{202B}?"
-        LayoutBlockFlow {P} at (0,1588) size 769x21
+        LayoutBlockFlow {P} at (0,1590) size 769x21
           LayoutText {#text} at (0,1) size 64x18
             text run at (0,1) width 8: "z"
             text run at (7,1) width 12 RTL: "\x{5E9}"
             text run at (18,1) width 18: "\x{663}\x{664}"
             text run at (35,1) width 14 RTL: "(^"
             text run at (48,1) width 16: "ab"
-        LayoutBlockFlow {P} at (0,1625) size 769x21
+        LayoutBlockFlow {P} at (0,1627) size 769x21
           LayoutText {#text} at (0,1) size 68x18
             text run at (0,1) width 8: "z"
             text run at (7,1) width 12 RTL: "\x{5E9}"
             text run at (18,1) width 18: "\x{663}\x{664}"
             text run at (35,1) width 33 RTL: "\x{5D0}\x{5D1}(^"
-        LayoutBlockFlow {P} at (0,1662) size 769x21
+        LayoutBlockFlow {P} at (0,1664) size 769x21
           LayoutText {#text} at (0,1) size 64x18
             text run at (0,1) width 8: "z"
             text run at (7,1) width 12 RTL: "\x{5E9}"
             text run at (18,1) width 18: "\x{663}\x{664}"
             text run at (35,1) width 29 RTL: "\x{627}\x{628}(^"
-        LayoutBlockFlow {P} at (0,1699) size 769x21
+        LayoutBlockFlow {P} at (0,1701) size 769x21
           LayoutText {#text} at (0,1) size 80x18
             text run at (0,1) width 8: "z"
             text run at (7,1) width 12 RTL: "\x{5E9}"
             text run at (18,1) width 18: "\x{663}\x{664}"
             text run at (35,1) width 14 RTL: "(^"
             text run at (48,1) width 32: "ab12"
-        LayoutBlockFlow {P} at (0,1736) size 769x21
+        LayoutBlockFlow {P} at (0,1738) size 769x21
           LayoutText {#text} at (0,1) size 84x18
             text run at (0,1) width 8: "z"
             text run at (7,1) width 12 RTL: "\x{5E9}"
@@ -751,7 +751,7 @@
             text run at (35,1) width 14 RTL: "(^"
             text run at (48,1) width 17: "12"
             text run at (64,1) width 20 RTL: "\x{5D0}\x{5D1}"
-        LayoutBlockFlow {P} at (0,1773) size 769x21
+        LayoutBlockFlow {P} at (0,1775) size 769x21
           LayoutText {#text} at (0,1) size 80x18
             text run at (0,1) width 8: "z"
             text run at (7,1) width 12 RTL: "\x{5E9}"
@@ -759,14 +759,14 @@
             text run at (35,1) width 14 RTL: "(^"
             text run at (48,1) width 17: "12"
             text run at (64,1) width 16 RTL: "\x{627}\x{628}"
-        LayoutBlockFlow {P} at (0,1810) size 769x21
+        LayoutBlockFlow {P} at (0,1812) size 769x21
           LayoutText {#text} at (0,1) size 81x18
             text run at (0,1) width 8: "z"
             text run at (7,1) width 12 RTL: "\x{5E9}"
             text run at (18,1) width 18: "\x{663}\x{664}"
             text run at (35,1) width 14 RTL: "(^"
             text run at (48,1) width 33: "ab\x{661}\x{662}"
-        LayoutBlockFlow {P} at (0,1847) size 769x21
+        LayoutBlockFlow {P} at (0,1849) size 769x21
           LayoutText {#text} at (0,1) size 85x18
             text run at (0,1) width 8: "z"
             text run at (7,1) width 12 RTL: "\x{5E9}"
@@ -774,7 +774,7 @@
             text run at (35,1) width 14 RTL: "(^"
             text run at (48,1) width 17: "\x{661}\x{662}"
             text run at (64,1) width 21 RTL: "\x{5D0}\x{5D1}"
-        LayoutBlockFlow {P} at (0,1884) size 769x21
+        LayoutBlockFlow {P} at (0,1886) size 769x21
           LayoutText {#text} at (0,1) size 80x18
             text run at (0,1) width 8: "z"
             text run at (7,1) width 12 RTL: "\x{5E9}"
@@ -782,211 +782,211 @@
             text run at (35,1) width 14 RTL: "(^"
             text run at (48,1) width 17: "\x{661}\x{662}"
             text run at (64,1) width 16 RTL: "\x{627}\x{628}"
-        LayoutBlockFlow {P} at (0,1921) size 769x21
+        LayoutBlockFlow {P} at (0,1923) size 769x21
           LayoutText {#text} at (0,1) size 56x18
             text run at (0,1) width 8: "z"
             text run at (7,1) width 12 RTL: "\x{5E9}"
             text run at (18,1) width 18: "\x{663}\x{664}"
             text run at (35,1) width 14 RTL: "\x{202C}(^"
             text run at (48,1) width 8: "\x{202A}?"
-        LayoutBlockFlow {P} at (0,1958) size 769x21
+        LayoutBlockFlow {P} at (0,1960) size 769x21
           LayoutText {#text} at (0,1) size 56x18
             text run at (0,1) width 8: "z"
             text run at (7,1) width 12 RTL: "\x{5E9}"
             text run at (18,1) width 18: "\x{663}\x{664}"
             text run at (35,1) width 14 RTL: "\x{202C}(^"
             text run at (48,1) width 8 RTL: "\x{202B}?"
-        LayoutBlockFlow {P} at (0,1995) size 769x18
-          LayoutText {#text} at (0,0) size 34x18
-            text run at (0,0) width 0 RTL: "\x{202C}"
-            text run at (0,0) width 28: "ab(^"
-            text run at (27,0) width 7: "\x{202A}!"
-        LayoutBlockFlow {P} at (0,2029) size 769x19
+        LayoutBlockFlow {P} at (0,1997) size 769x19
+          LayoutText {#text} at (0,1) size 34x18
+            text run at (0,1) width 0 RTL: "\x{202C}"
+            text run at (0,1) width 28: "ab(^"
+            text run at (27,1) width 7: "\x{202A}!"
+        LayoutBlockFlow {P} at (0,2032) size 769x19
           LayoutText {#text} at (0,1) size 38x18
             text run at (0,1) width 0 RTL: "\x{202C}"
             text run at (0,1) width 6: "\x{202A}!"
             text run at (5,1) width 33 RTL: "\x{5D0}\x{5D1}(^"
-        LayoutBlockFlow {P} at (0,2064) size 769x21
+        LayoutBlockFlow {P} at (0,2067) size 769x21
           LayoutText {#text} at (0,1) size 34x18
             text run at (0,1) width 0 RTL: "\x{202C}"
             text run at (0,1) width 6: "\x{202A}!"
             text run at (5,1) width 29 RTL: "\x{627}\x{628}(^"
-        LayoutBlockFlow {P} at (0,2101) size 769x18
-          LayoutText {#text} at (0,0) size 50x18
-            text run at (0,0) width 0 RTL: "\x{202C}"
-            text run at (0,0) width 44: "ab12(^"
-            text run at (43,0) width 7: "\x{202A}!"
-        LayoutBlockFlow {P} at (0,2135) size 769x19
+        LayoutBlockFlow {P} at (0,2104) size 769x19
+          LayoutText {#text} at (0,1) size 50x18
+            text run at (0,1) width 0 RTL: "\x{202C}"
+            text run at (0,1) width 44: "ab12(^"
+            text run at (43,1) width 7: "\x{202A}!"
+        LayoutBlockFlow {P} at (0,2139) size 769x19
           LayoutText {#text} at (0,1) size 54x18
             text run at (0,1) width 0 RTL: "\x{202C}"
             text run at (0,1) width 6: "\x{202A}!"
             text run at (5,1) width 14 RTL: "(^"
             text run at (18,1) width 17: "12"
             text run at (34,1) width 20 RTL: "\x{5D0}\x{5D1}"
-        LayoutBlockFlow {P} at (0,2170) size 769x21
+        LayoutBlockFlow {P} at (0,2174) size 769x21
           LayoutText {#text} at (0,1) size 50x18
             text run at (0,1) width 0 RTL: "\x{202C}"
             text run at (0,1) width 6: "\x{202A}!"
             text run at (5,1) width 14 RTL: "(^"
             text run at (18,1) width 17: "12"
             text run at (34,1) width 16 RTL: "\x{627}\x{628}"
-        LayoutBlockFlow {P} at (0,2207) size 769x21
+        LayoutBlockFlow {P} at (0,2211) size 769x21
           LayoutText {#text} at (0,1) size 51x18
             text run at (0,1) width 0 RTL: "\x{202C}"
             text run at (0,1) width 6: "\x{202A}!"
             text run at (5,1) width 14 RTL: "(^"
             text run at (18,1) width 33: "ab\x{661}\x{662}"
-        LayoutBlockFlow {P} at (0,2244) size 769x21
+        LayoutBlockFlow {P} at (0,2248) size 769x21
           LayoutText {#text} at (0,1) size 55x18
             text run at (0,1) width 0 RTL: "\x{202C}"
             text run at (0,1) width 6: "\x{202A}!"
             text run at (5,1) width 14 RTL: "(^"
             text run at (18,1) width 17: "\x{661}\x{662}"
             text run at (34,1) width 21 RTL: "\x{5D0}\x{5D1}"
-        LayoutBlockFlow {P} at (0,2281) size 769x21
+        LayoutBlockFlow {P} at (0,2285) size 769x21
           LayoutText {#text} at (0,1) size 50x18
             text run at (0,1) width 0 RTL: "\x{202C}"
             text run at (0,1) width 6: "\x{202A}!"
             text run at (5,1) width 14 RTL: "(^"
             text run at (18,1) width 17: "\x{661}\x{662}"
             text run at (34,1) width 16 RTL: "\x{627}\x{628}"
-        LayoutBlockFlow {P} at (0,2318) size 769x18
-          LayoutText {#text} at (0,0) size 26x18
-            text run at (0,0) width 0 RTL: "\x{202C}"
-            text run at (0,0) width 8: "\x{202A}?"
-            text run at (7,0) width 13: "\x{202C}(^"
-            text run at (19,0) width 7: "\x{202A}!"
-        LayoutBlockFlow {P} at (0,2352) size 769x18
-          LayoutText {#text} at (0,0) size 26x18
-            text run at (0,0) width 0 RTL: "\x{202C}"
-            text run at (0,0) width 6: "\x{202A}!"
-            text run at (5,0) width 14 RTL: "\x{202C}(^"
-            text run at (18,0) width 8 RTL: "\x{202B}?"
-        LayoutBlockFlow {P} at (0,2386) size 769x18
-          LayoutText {#text} at (0,0) size 34x18
-            text run at (0,0) width 0 RTL: "\x{202C}"
-            text run at (0,0) width 6 RTL: "\x{202B}!"
-            text run at (5,0) width 14 RTL: "(^"
-            text run at (18,0) width 16: "ab"
-        LayoutBlockFlow {P} at (0,2420) size 769x19
+        LayoutBlockFlow {P} at (0,2322) size 769x19
+          LayoutText {#text} at (0,1) size 26x18
+            text run at (0,1) width 0 RTL: "\x{202C}"
+            text run at (0,1) width 8: "\x{202A}?"
+            text run at (7,1) width 13: "\x{202C}(^"
+            text run at (19,1) width 7: "\x{202A}!"
+        LayoutBlockFlow {P} at (0,2357) size 769x19
+          LayoutText {#text} at (0,1) size 26x18
+            text run at (0,1) width 0 RTL: "\x{202C}"
+            text run at (0,1) width 6: "\x{202A}!"
+            text run at (5,1) width 14 RTL: "\x{202C}(^"
+            text run at (18,1) width 8 RTL: "\x{202B}?"
+        LayoutBlockFlow {P} at (0,2392) size 769x19
+          LayoutText {#text} at (0,1) size 34x18
+            text run at (0,1) width 0 RTL: "\x{202C}"
+            text run at (0,1) width 6 RTL: "\x{202B}!"
+            text run at (5,1) width 14 RTL: "(^"
+            text run at (18,1) width 16: "ab"
+        LayoutBlockFlow {P} at (0,2427) size 769x19
           LayoutText {#text} at (0,1) size 38x18
             text run at (0,1) width 0 RTL: "\x{202C}"
             text run at (0,1) width 6 RTL: "\x{202B}!"
             text run at (5,1) width 33 RTL: "\x{5D0}\x{5D1}(^"
-        LayoutBlockFlow {P} at (0,2455) size 769x21
+        LayoutBlockFlow {P} at (0,2462) size 769x21
           LayoutText {#text} at (0,1) size 34x18
             text run at (0,1) width 0 RTL: "\x{202C}"
             text run at (0,1) width 6 RTL: "\x{202B}!"
             text run at (5,1) width 29 RTL: "\x{627}\x{628}(^"
-        LayoutBlockFlow {P} at (0,2492) size 769x18
-          LayoutText {#text} at (0,0) size 50x18
-            text run at (0,0) width 0 RTL: "\x{202C}"
-            text run at (0,0) width 6 RTL: "\x{202B}!"
-            text run at (5,0) width 14 RTL: "(^"
-            text run at (18,0) width 32: "ab12"
-        LayoutBlockFlow {P} at (0,2526) size 769x19
+        LayoutBlockFlow {P} at (0,2499) size 769x19
+          LayoutText {#text} at (0,1) size 50x18
+            text run at (0,1) width 0 RTL: "\x{202C}"
+            text run at (0,1) width 6 RTL: "\x{202B}!"
+            text run at (5,1) width 14 RTL: "(^"
+            text run at (18,1) width 32: "ab12"
+        LayoutBlockFlow {P} at (0,2534) size 769x19
           LayoutText {#text} at (0,1) size 54x18
             text run at (0,1) width 0 RTL: "\x{202C}"
             text run at (0,1) width 6 RTL: "\x{202B}!"
             text run at (5,1) width 14 RTL: "(^"
             text run at (18,1) width 17: "12"
             text run at (34,1) width 20 RTL: "\x{5D0}\x{5D1}"
-        LayoutBlockFlow {P} at (0,2561) size 769x21
+        LayoutBlockFlow {P} at (0,2569) size 769x21
           LayoutText {#text} at (0,1) size 50x18
             text run at (0,1) width 0 RTL: "\x{202C}"
             text run at (0,1) width 6 RTL: "\x{202B}!"
             text run at (5,1) width 14 RTL: "(^"
             text run at (18,1) width 17: "12"
             text run at (34,1) width 16 RTL: "\x{627}\x{628}"
-        LayoutBlockFlow {P} at (0,2598) size 769x21
+        LayoutBlockFlow {P} at (0,2606) size 769x21
           LayoutText {#text} at (0,1) size 51x18
             text run at (0,1) width 0 RTL: "\x{202C}"
             text run at (0,1) width 6 RTL: "\x{202B}!"
             text run at (5,1) width 14 RTL: "(^"
             text run at (18,1) width 33: "ab\x{661}\x{662}"
-        LayoutBlockFlow {P} at (0,2635) size 769x21
+        LayoutBlockFlow {P} at (0,2643) size 769x21
           LayoutText {#text} at (0,1) size 55x18
             text run at (0,1) width 0 RTL: "\x{202C}"
             text run at (0,1) width 6 RTL: "\x{202B}!"
             text run at (5,1) width 14 RTL: "(^"
             text run at (18,1) width 17: "\x{661}\x{662}"
             text run at (34,1) width 21 RTL: "\x{5D0}\x{5D1}"
-        LayoutBlockFlow {P} at (0,2672) size 769x21
+        LayoutBlockFlow {P} at (0,2680) size 769x21
           LayoutText {#text} at (0,1) size 50x18
             text run at (0,1) width 0 RTL: "\x{202C}"
             text run at (0,1) width 6 RTL: "\x{202B}!"
             text run at (5,1) width 14 RTL: "(^"
             text run at (18,1) width 17: "\x{661}\x{662}"
             text run at (34,1) width 16 RTL: "\x{627}\x{628}"
-        LayoutBlockFlow {P} at (0,2709) size 769x18
-          LayoutText {#text} at (0,0) size 26x18
-            text run at (0,0) width 0 RTL: "\x{202C}"
-            text run at (0,0) width 6 RTL: "\x{202B}!"
-            text run at (5,0) width 14 RTL: "\x{202C}(^"
-            text run at (18,0) width 8: "\x{202A}?"
-        LayoutBlockFlow {P} at (0,2743) size 769x18
-          LayoutText {#text} at (0,0) size 26x18
-            text run at (0,0) width 0 RTL: "\x{202C}"
-            text run at (0,0) width 6 RTL: "\x{202B}!"
-            text run at (5,0) width 14 RTL: "\x{202C}(^"
-            text run at (18,0) width 8 RTL: "\x{202B}?"
-        LayoutBlockFlow {P} at (0,2777) size 769x18
-          LayoutText {#text} at (0,0) size 28x18
-            text run at (0,0) width 0 RTL: "\x{202C}"
-            text run at (0,0) width 28: "\x{202A}ab(^"
-        LayoutBlockFlow {P} at (0,2811) size 769x19
+        LayoutBlockFlow {P} at (0,2717) size 769x19
+          LayoutText {#text} at (0,1) size 26x18
+            text run at (0,1) width 0 RTL: "\x{202C}"
+            text run at (0,1) width 6 RTL: "\x{202B}!"
+            text run at (5,1) width 14 RTL: "\x{202C}(^"
+            text run at (18,1) width 8: "\x{202A}?"
+        LayoutBlockFlow {P} at (0,2752) size 769x19
+          LayoutText {#text} at (0,1) size 26x18
+            text run at (0,1) width 0 RTL: "\x{202C}"
+            text run at (0,1) width 6 RTL: "\x{202B}!"
+            text run at (5,1) width 14 RTL: "\x{202C}(^"
+            text run at (18,1) width 8 RTL: "\x{202B}?"
+        LayoutBlockFlow {P} at (0,2787) size 769x19
+          LayoutText {#text} at (0,1) size 28x18
+            text run at (0,1) width 0 RTL: "\x{202C}"
+            text run at (0,1) width 28: "\x{202A}ab(^"
+        LayoutBlockFlow {P} at (0,2822) size 769x19
           LayoutText {#text} at (0,1) size 33x18
             text run at (0,1) width 0 RTL: "\x{202C}"
             text run at (0,1) width 20 RTL: "\x{202A}\x{5D0}\x{5D1}"
             text run at (19,1) width 14: "(^"
-        LayoutBlockFlow {P} at (0,2846) size 769x21
+        LayoutBlockFlow {P} at (0,2857) size 769x21
           LayoutText {#text} at (0,1) size 28x18
             text run at (0,1) width 0 RTL: "\x{202C}"
             text run at (0,1) width 15 RTL: "\x{202A}\x{627}\x{628}"
             text run at (14,1) width 14: "(^"
-        LayoutBlockFlow {P} at (0,2883) size 769x18
-          LayoutText {#text} at (0,0) size 44x18
-            text run at (0,0) width 0 RTL: "\x{202C}"
-            text run at (0,0) width 44: "\x{202A}ab12(^"
-        LayoutBlockFlow {P} at (0,2917) size 769x19
+        LayoutBlockFlow {P} at (0,2894) size 769x19
+          LayoutText {#text} at (0,1) size 44x18
+            text run at (0,1) width 0 RTL: "\x{202C}"
+            text run at (0,1) width 44: "\x{202A}ab12(^"
+        LayoutBlockFlow {P} at (0,2929) size 769x19
           LayoutText {#text} at (0,1) size 49x18
             text run at (0,1) width 0 RTL: "\x{202C}"
             text run at (0,1) width 16: "12"
             text run at (16,1) width 20 RTL: "\x{202A}\x{5D0}\x{5D1}"
             text run at (35,1) width 14: "(^"
-        LayoutBlockFlow {P} at (0,2952) size 769x21
+        LayoutBlockFlow {P} at (0,2964) size 769x21
           LayoutText {#text} at (0,1) size 44x18
             text run at (0,1) width 0 RTL: "\x{202C}"
             text run at (0,1) width 16: "12"
             text run at (16,1) width 15 RTL: "\x{202A}\x{627}\x{628}"
             text run at (30,1) width 14: "(^"
-        LayoutBlockFlow {P} at (0,2989) size 769x21
+        LayoutBlockFlow {P} at (0,3001) size 769x21
           LayoutText {#text} at (0,1) size 45x18
             text run at (0,1) width 0 RTL: "\x{202C}"
             text run at (0,1) width 16: "\x{202A}ab"
             text run at (15,1) width 17: "\x{661}\x{662}"
             text run at (31,1) width 14: "(^"
-        LayoutBlockFlow {P} at (0,3026) size 769x21
+        LayoutBlockFlow {P} at (0,3038) size 769x21
           LayoutText {#text} at (0,1) size 49x18
             text run at (0,1) width 0 RTL: "\x{202C}"
             text run at (0,1) width 17: "\x{661}\x{662}"
             text run at (16,1) width 21 RTL: "\x{202A}\x{5D0}\x{5D1}"
             text run at (36,1) width 13: "(^"
-        LayoutBlockFlow {P} at (0,3063) size 769x21
+        LayoutBlockFlow {P} at (0,3075) size 769x21
           LayoutText {#text} at (0,1) size 45x18
             text run at (0,1) width 0 RTL: "\x{202C}"
             text run at (0,1) width 17: "\x{661}\x{662}"
             text run at (16,1) width 16 RTL: "\x{202A}\x{627}\x{628}"
             text run at (31,1) width 14: "(^"
-        LayoutBlockFlow {P} at (0,3100) size 769x18
-          LayoutText {#text} at (0,0) size 20x18
-            text run at (0,0) width 0 RTL: "\x{202C}"
-            text run at (0,0) width 0: "\x{202A}"
-            text run at (0,0) width 8: "\x{202A}?"
-            text run at (7,0) width 13: "\x{202C}(^"
-        LayoutBlockFlow {P} at (0,3134) size 769x18
-          LayoutText {#text} at (0,0) size 20x18
-            text run at (0,0) width 0 RTL: "\x{202C}"
-            text run at (0,0) width 0: "\x{202A}"
-            text run at (0,0) width 8 RTL: "\x{202B}?"
-            text run at (7,0) width 13: "\x{202C}(^"
+        LayoutBlockFlow {P} at (0,3112) size 769x19
+          LayoutText {#text} at (0,1) size 20x18
+            text run at (0,1) width 0 RTL: "\x{202C}"
+            text run at (0,1) width 0: "\x{202A}"
+            text run at (0,1) width 8: "\x{202A}?"
+            text run at (7,1) width 13: "\x{202C}(^"
+        LayoutBlockFlow {P} at (0,3147) size 769x19
+          LayoutText {#text} at (0,1) size 20x18
+            text run at (0,1) width 0 RTL: "\x{202C}"
+            text run at (0,1) width 0: "\x{202A}"
+            text run at (0,1) width 8 RTL: "\x{202B}?"
+            text run at (7,1) width 13: "\x{202C}(^"
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/bidi-override-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/bidi-override-expected.png
index b6956fcf..97a304c 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/bidi-override-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/bidi-override-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/bidi-override-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/bidi-override-expected.txt
index 64c0af39..19cdafd 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/bidi-override-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/bidi-override-expected.txt
@@ -4,8 +4,8 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x344
     LayoutBlockFlow {BODY} at (8,16) size 784x320
       LayoutBlockFlow {P} at (0,0) size 784x18
-        LayoutText {#text} at (0,0) size 317x18
-          text run at (0,0) width 317: "All rows should be identical to the reference row."
+        LayoutText {#text} at (0,0) size 316x18
+          text run at (0,0) width 316: "All rows should be identical to the reference row."
       LayoutTable {TABLE} at (0,34) size 583x113 [border: none]
         LayoutTableSection {TBODY} at (0,0) size 582x112
           LayoutTableRow {TR} at (0,0) size 582x28
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/bidi-word-spacing-rtl-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/bidi-word-spacing-rtl-expected.png
index f226511..ae0b55a 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/bidi-word-spacing-rtl-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/bidi-word-spacing-rtl-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/bidi-word-spacing-rtl-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/bidi-word-spacing-rtl-expected.txt
index 17f0411..1f2e8a5 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/bidi-word-spacing-rtl-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/bidi-word-spacing-rtl-expected.txt
@@ -1,8 +1,8 @@
 layer at (0,0) size 800x600
   LayoutView at (0,0) size 800x600
-layer at (0,0) size 800x358
-  LayoutBlockFlow {HTML} at (0,0) size 800x358
-    LayoutBlockFlow {BODY} at (8,10) size 784x338
+layer at (0,0) size 800x361
+  LayoutBlockFlow {HTML} at (0,0) size 800x361
+    LayoutBlockFlow {BODY} at (8,10) size 784x341
       LayoutBlockFlow {DIV} at (300,0) size 184x48 [border: (1px solid #000000)]
         LayoutText {#text} at (169,1) size 14x46
           text run at (169,1) width 14 RTL: "!"
@@ -24,15 +24,15 @@
             text run at (59,1) width 124 RTL: "! "
         LayoutText {#text} at (22,1) size 38x46
           text run at (22,1) width 38 RTL: "@"
-      LayoutBlockFlow {DIV} at (300,174) size 184x48 [border: (1px solid #000000)]
-        LayoutText {#text} at (169,1) size 14x46
-          text run at (169,1) width 14 RTL: "!"
+      LayoutBlockFlow {DIV} at (300,174) size 184x51 [border: (1px solid #000000)]
+        LayoutText {#text} at (169,4) size 14x46
+          text run at (169,4) width 14 RTL: "!"
         LayoutInline {SPAN} at (0,0) size 111x46
-          LayoutText {#text} at (159,1) size 11x46
-            text run at (159,1) width 11 RTL: " "
-        LayoutText {#text} at (12,1) size 48x46
-          text run at (12,1) width 48 RTL: "@ \x{200F}"
-      LayoutBlockFlow {DIV} at (300,232) size 184x48 [border: (1px solid #000000)]
+          LayoutText {#text} at (159,4) size 11x46
+            text run at (159,4) width 11 RTL: " "
+        LayoutText {#text} at (12,4) size 48x46
+          text run at (12,4) width 48 RTL: "@ \x{200F}"
+      LayoutBlockFlow {DIV} at (300,235) size 184x48 [border: (1px solid #000000)]
         LayoutText {#text} at (169,1) size 14x46
           text run at (169,1) width 14 RTL: "!"
         LayoutInline {SPAN} at (0,0) size 111x46
@@ -40,7 +40,7 @@
             text run at (159,1) width 11 RTL: " "
         LayoutText {#text} at (22,1) size 38x46
           text run at (22,1) width 38 RTL: "@"
-      LayoutBlockFlow {DIV} at (300,290) size 184x48 [border: (1px solid #000000)]
+      LayoutBlockFlow {DIV} at (300,293) size 184x48 [border: (1px solid #000000)]
         LayoutText {#text} at (22,1) size 38x46
           text run at (22,1) width 38: "@"
         LayoutInline {SPAN} at (0,0) size 111x46
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/hebrew-vowels-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/hebrew-vowels-expected.png
index a3a1c82..79f09e6 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/hebrew-vowels-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/hebrew-vowels-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/hebrew-vowels-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/hebrew-vowels-expected.txt
index c24ef11b..6bd153b2 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/hebrew-vowels-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/hebrew-vowels-expected.txt
@@ -8,8 +8,8 @@
           text run at (0,0) width 279: "This test covers Hebrew vowel positioning."
       LayoutBlockFlow {HR} at (0,34) size 784x2 [border: (1px inset #EEEEEE)]
       LayoutBlockFlow {P} at (0,52) size 784x18
-        LayoutText {#text} at (0,0) size 468x18
-          text run at (0,0) width 468: "The vowel (two vertical dots) should be centered beneath the main letter."
+        LayoutText {#text} at (0,0) size 467x18
+          text run at (0,0) width 467: "The vowel (two vertical dots) should be centered beneath the main letter."
       LayoutBlockFlow {DIV} at (0,86) size 784x97
         LayoutText {#text} at (57,5) size 74x92
           text run at (57,5) width 74 RTL: "\x{5E1}\x{5B0} "
@@ -18,8 +18,8 @@
         LayoutText {#text} at (0,0) size 0x0
       LayoutBlockFlow {HR} at (0,191) size 784x2 [border: (1px inset #EEEEEE)]
       LayoutBlockFlow {P} at (0,209) size 784x18
-        LayoutText {#text} at (0,0) size 651x18
-          text run at (0,0) width 651: "The dot should be positioned on the right side of the first letter, and on the left side of the second one."
+        LayoutText {#text} at (0,0) size 650x18
+          text run at (0,0) width 650: "The dot should be positioned on the right side of the first letter, and on the left side of the second one."
       LayoutBlockFlow {DIV} at (0,243) size 784x194
         LayoutText {#text} at (0,5) size 58x92
           text run at (0,5) width 58 RTL: "\x{5E9}\x{5C1}"
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/plane2-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/plane2-expected.png
index 2a42dd05..34793a6 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/plane2-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/plane2-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/plane2-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/plane2-expected.txt
index 75eada1..0ae2911 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/plane2-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/plane2-expected.txt
@@ -4,15 +4,15 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x600
     LayoutBlockFlow {BODY} at (8,8) size 784x584
       LayoutBlockFlow {P} at (0,0) size 784x54
-        LayoutText {#text} at (0,0) size 55x18
-          text run at (0,0) width 55: "Test for "
+        LayoutText {#text} at (0,0) size 54x18
+          text run at (0,0) width 54: "Test for "
         LayoutInline {A} at (0,0) size 69x18 [color=#0000EE]
-          LayoutText {#text} at (54,0) size 69x18
-            text run at (54,0) width 69: "bug 35605"
-        LayoutText {#text} at (122,0) size 771x54
-          text run at (122,0) width 641: ": Two lines below have one character from CJK Ideograph, one from CJK Ext A (both in BMP) and"
+          LayoutText {#text} at (53,0) size 69x18
+            text run at (53,0) width 69: "bug 35605"
+        LayoutText {#text} at (121,0) size 771x54
+          text run at (121,0) width 640: ": Two lines below have one character from CJK Ideograph, one from CJK Ext A (both in BMP) and"
           text run at (0,18) width 771: "three characters from CJK Ext B (plane 2). The last group of characters are covered by Japanese fonts on Mac as well as"
-          text run at (0,36) width 335: "two Chinese fonts for Ext B shipped with Windows."
+          text run at (0,36) width 334: "two Chinese fonts for Ext B shipped with Windows."
       LayoutBlockFlow {DIV} at (0,70) size 784x96
         LayoutBlockFlow {DIV} at (0,0) size 784x48
           LayoutText {#text} at (0,7) size 176x37
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/pop-up-button-text-alignment-and-direction-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/pop-up-button-text-alignment-and-direction-expected.png
index c911633..2d7f82e 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/pop-up-button-text-alignment-and-direction-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/pop-up-button-text-alignment-and-direction-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/pop-up-button-text-alignment-and-direction-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/pop-up-button-text-alignment-and-direction-expected.txt
index d1bb325..a5c77f9 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/pop-up-button-text-alignment-and-direction-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/pop-up-button-text-alignment-and-direction-expected.txt
@@ -4,9 +4,9 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x514
     LayoutBlockFlow {BODY} at (8,16) size 784x490
       LayoutBlockFlow {P} at (0,0) size 784x18
-        LayoutText {#text} at (0,0) size 710x18
-          text run at (0,0) width 499: "Verify that the alignment and writing direction of each selected item matches "
-          text run at (498,0) width 212: "the one below the pop-up button."
+        LayoutText {#text} at (0,0) size 709x18
+          text run at (0,0) width 497: "Verify that the alignment and writing direction of each selected item matches "
+          text run at (496,0) width 213: "the one below the pop-up button."
       LayoutBlockFlow {DIV} at (0,34) size 784x228
         LayoutMenuList {SELECT} at (0,0) size 500x21 [bgcolor=#F8F8F8]
           LayoutBlockFlow (anonymous) at (0,0) size 500x21
@@ -35,8 +35,8 @@
           LayoutText {#text} at (10,10) size 163x16
             text run at (10,10) width 27: "fifth"
             text run at (36,10) width 52 RTL: ") \x{5E8}\x{5D1}\x{5D9}\x{5E2}\x{5D9}\x{5EA} "
-            text run at (87,10) width 18: "03"
-            text run at (104,10) width 41 RTL: " \x{5E9}\x{5E0}\x{5D9}\x{5D4} ("
+            text run at (87,10) width 17: "03"
+            text run at (103,10) width 42 RTL: " \x{5E9}\x{5E0}\x{5D9}\x{5D4} ("
             text run at (144,10) width 29: "First"
         LayoutMenuList {SELECT} at (0,114) size 500x21 [bgcolor=#F8F8F8]
           LayoutBlockFlow (anonymous) at (0,0) size 500x21
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/rtl-caret-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/rtl-caret-expected.png
index 76376b9..cf7ca9f5 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/rtl-caret-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/rtl-caret-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/rtl-caret-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/rtl-caret-expected.txt
index 36816a5a..3fc81d5 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/rtl-caret-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/rtl-caret-expected.txt
@@ -6,13 +6,13 @@
       LayoutBlockFlow {P} at (0,0) size 784x36
         LayoutText {#text} at (0,0) size 177x18
           text run at (0,0) width 177: "This is a regression test for "
-        LayoutInline {I} at (0,0) size 735x36
-          LayoutInline {A} at (0,0) size 355x18 [color=#0000EE]
-            LayoutText {#text} at (176,0) size 355x18
-              text run at (176,0) width 355: "http://bugzilla.opendarwin.org/show_bug.cgi?id=8866"
-          LayoutText {#text} at (530,0) size 735x36
-            text run at (530,0) width 5: " "
-            text run at (534,0) width 201: "REGRESSION: Incorrect caret"
+        LayoutInline {I} at (0,0) size 733x36
+          LayoutInline {A} at (0,0) size 354x18 [color=#0000EE]
+            LayoutText {#text} at (176,0) size 354x18
+              text run at (176,0) width 354: "http://bugzilla.opendarwin.org/show_bug.cgi?id=8866"
+          LayoutText {#text} at (529,0) size 733x36
+            text run at (529,0) width 5: " "
+            text run at (533,0) width 200: "REGRESSION: Incorrect caret"
             text run at (0,18) width 127: "position in RTL text"
         LayoutText {#text} at (126,18) size 5x18
           text run at (126,18) width 5: "."
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/rtl-white-space-pre-wrap-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/rtl-white-space-pre-wrap-expected.png
index ce49c02..9576942 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/rtl-white-space-pre-wrap-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/rtl-white-space-pre-wrap-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/rtl-white-space-pre-wrap-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/rtl-white-space-pre-wrap-expected.txt
index 9c6d210e..40f3577 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/rtl-white-space-pre-wrap-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/rtl-white-space-pre-wrap-expected.txt
@@ -6,19 +6,19 @@
       LayoutBlockFlow {P} at (0,0) size 784x36
         LayoutText {#text} at (0,0) size 108x18
           text run at (0,0) width 108: "This is a test for "
-        LayoutInline {I} at (0,0) size 763x36
-          LayoutInline {A} at (0,0) size 354x18 [color=#0000EE]
-            LayoutText {#text} at (107,0) size 354x18
-              text run at (107,0) width 354: "http://bugzilla.opendarwin.org/show_bug.cgi?id=9670"
-          LayoutText {#text} at (460,0) size 763x36
-            text run at (460,0) width 5: " "
-            text run at (464,0) width 299: "http://bugzilla.opendarwin.org/show_bug.cgi?"
+        LayoutInline {I} at (0,0) size 762x36
+          LayoutInline {A} at (0,0) size 353x18 [color=#0000EE]
+            LayoutText {#text} at (107,0) size 353x18
+              text run at (107,0) width 353: "http://bugzilla.opendarwin.org/show_bug.cgi?id=9670"
+          LayoutText {#text} at (459,0) size 762x36
+            text run at (459,0) width 5: " "
+            text run at (463,0) width 299: "http://bugzilla.opendarwin.org/show_bug.cgi?"
             text run at (0,18) width 56: "id=9670"
         LayoutText {#text} at (55,18) size 5x18
           text run at (55,18) width 5: "."
       LayoutBlockFlow {P} at (0,52) size 784x18
-        LayoutText {#text} at (0,0) size 554x18
-          text run at (0,0) width 554: "All text should be aligned with the right edge of its container and should not overflow."
+        LayoutText {#text} at (0,0) size 552x18
+          text run at (0,0) width 552: "All text should be aligned with the right edge of its container and should not overflow."
       LayoutBlockFlow {HR} at (0,86) size 784x2 [border: (1px inset #EEEEEE)]
       LayoutBlockFlow {DIV} at (0,96) size 191x56 [bgcolor=#FFFF00]
         LayoutText {#text} at (0,0) size 191x56
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/text-combine-image-test-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/text-combine-image-test-expected.png
index ed35ba1..482d35f 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/text-combine-image-test-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/text-combine-image-test-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/text-combine-image-test-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/text-combine-image-test-expected.txt
index ea8d40d2..69add34 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/text-combine-image-test-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/text-combine-image-test-expected.txt
@@ -119,7 +119,7 @@
           LayoutInline {SPAN} at (0,0) size 208x576
             LayoutText {#text} at (16,0) size 208x576
               text run at (16,0) width 320: "\x{305D}\x{306E}\x{5973}\x{304C}\x{306D}\x{304B}\x{3057}\x{3064}\x{3051}\x{306B}\x{6765}\x{3066}\x{304F}\x{308C}\x{308B}\x{307E}\x{3067}\x{3001}\x{308F}\x{305F}"
-              text run at (64,0) width 576: "\x{3057}\x{306F}\x{3051}\x{3063}\x{3057}\x{3066}\x{306D}\x{3069}\x{3053}\x{306B}\x{306F}\x{306F}\x{3044}\x{3089}\x{306A}\x{304B}\x{3063}\x{305F}\x{3002}\x{51AC}\x{306E}\x{3042}\x{3089}\x{3057}\x{304C}\x{3060}\x{3093}\x{3054}\x{306E}\x{3088}\x{3046}\x{306A}\x{96EA}\x{3092}\x{3075}\x{304D}"
+              text run at (64,0) width 575: "\x{3057}\x{306F}\x{3051}\x{3063}\x{3057}\x{3066}\x{306D}\x{3069}\x{3053}\x{306B}\x{306F}\x{306F}\x{3044}\x{3089}\x{306A}\x{304B}\x{3063}\x{305F}\x{3002}\x{51AC}\x{306E}\x{3042}\x{3089}\x{3057}\x{304C}\x{3060}\x{3093}\x{3054}\x{306E}\x{3088}\x{3046}\x{306A}\x{96EA}\x{3092}\x{3075}\x{304D}"
               text run at (112,0) width 576: "\x{3064}\x{3051}\x{3066}\x{7A93}\x{30AC}\x{30E9}\x{30B9}\x{3092}\x{767D}\x{304F}\x{3059}\x{308B}\x{3058}\x{3076}\x{3093}\x{306B}\x{306A}\x{308B}\x{3068}\x{3001}\x{3053}\x{306E}\x{5973}\x{306E}\x{4EBA}\x{306F}\x{4E21}\x{624B}\x{306E}\x{9593}\x{306B}\x{308F}\x{305F}\x{3057}\x{306E}\x{8DB3}"
               text run at (160,0) width 576: "\x{3092}\x{304A}\x{3055}\x{3048}\x{3066}\x{3001}\x{6B4C}\x{3092}\x{6B4C}\x{3044}\x{306A}\x{304C}\x{3089}\x{6696}\x{3081}\x{3066}\x{304F}\x{308C}\x{305F}\x{3002}\x{305D}\x{306E}\x{6B4C}\x{306E}\x{7BC0}\x{3082}\x{6587}\x{53E5}\x{3082}\x{3001}\x{3044}\x{307E}\x{306B}\x{5FD8}\x{308C}\x{305A}"
               text run at (208,0) width 64: "\x{306B}\x{3044}\x{308B}\x{3002}"
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/thai-baht-space-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/thai-baht-space-expected.png
index 6a98be1..b887443 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/thai-baht-space-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/thai-baht-space-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/thai-baht-space-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/thai-baht-space-expected.txt
index 38fb8727..1e89a21b 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/thai-baht-space-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/thai-baht-space-expected.txt
@@ -4,14 +4,14 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x600
     LayoutBlockFlow {BODY} at (8,8) size 784x576
       LayoutBlockFlow (anonymous) at (0,0) size 784x36
-        LayoutText {#text} at (0,0) size 55x18
-          text run at (0,0) width 55: "Test for "
+        LayoutText {#text} at (0,0) size 54x18
+          text run at (0,0) width 54: "Test for "
         LayoutInline {A} at (0,0) size 69x18 [color=#0000EE]
-          LayoutText {#text} at (54,0) size 69x18
-            text run at (54,0) width 69: "bug 25464"
-        LayoutText {#text} at (122,0) size 727x36
-          text run at (122,0) width 605: ". Characters belonging to 'Common' script followed / preceeded by a space should be rendered"
-          text run at (0,18) width 648: "correctly. Two lines below have 4 Thai currency signs (U+0E3F) and all of them should be rendered."
+          LayoutText {#text} at (53,0) size 69x18
+            text run at (53,0) width 69: "bug 25464"
+        LayoutText {#text} at (121,0) size 726x36
+          text run at (121,0) width 605: ". Characters belonging to 'Common' script followed / preceeded by a space should be rendered"
+          text run at (0,18) width 646: "correctly. Two lines below have 4 Thai currency signs (U+0E3F) and all of them should be rendered."
       LayoutBlockFlow {P} at (0,52) size 784x44
         LayoutText {#text} at (0,3) size 286x18
           text run at (0,3) width 286: "abc \x{E25}\x{E07}\x{E17}\x{E38}\x{E19}4000\x{E3F} \x{E23}\x{E31}\x{E1A}\x{E1B}\x{E23}\x{E30}\x{E01}\x{E31}\x{E19}\x{E23}\x{E32}\x{E22}\x{E44}\x{E14}\x{E49} 50000\x{E3F}/M"
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/thai-line-breaks-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/thai-line-breaks-expected.png
index 0866bb0..31e7281 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/thai-line-breaks-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/thai-line-breaks-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/thai-line-breaks-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/thai-line-breaks-expected.txt
index 85c0113..d2ce69a 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/thai-line-breaks-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/thai-line-breaks-expected.txt
@@ -4,11 +4,11 @@
   LayoutBlockFlow {HTML} at (0,0) size 785x600
     LayoutBlockFlow {BODY} at (8,8) size 769x576
       LayoutBlockFlow {P} at (0,0) size 769x72
-        LayoutText {#text} at (0,0) size 762x72
+        LayoutText {#text} at (0,0) size 761x72
           text run at (0,0) width 743: "The column on the right has explicit spaces. Line breaks should be roughly the same if Thai line breaks are working"
           text run at (0,18) width 760: "well. The original source of this text was ICU, and the test program said \"by it's very nature, Thai word breaking is not"
-          text run at (0,36) width 762: "exact\", so the columns don't match exactly. In a future version we might decide to tweak the right column to match our"
-          text run at (0,54) width 121: "expected behavior."
+          text run at (0,36) width 761: "exact\", so the columns don't match exactly. In a future version we might decide to tweak the right column to match our"
+          text run at (0,54) width 120: "expected behavior."
 layer at (236,96) size 1x27896 backgroundClip at (0,0) size 785x600 clip at (0,0) size 785x600
   LayoutBlockFlow (positioned) {DIV} at (235.50,96) size 1x27896
     LayoutText {#text} at (0,3) size 83x27892
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/unicode-bidi-plaintext-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/unicode-bidi-plaintext-expected.png
index 63ec418e..1e27370 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/unicode-bidi-plaintext-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/unicode-bidi-plaintext-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/unicode-bidi-plaintext-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/unicode-bidi-plaintext-expected.txt
index d3d9c86..d323216 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/unicode-bidi-plaintext-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/unicode-bidi-plaintext-expected.txt
@@ -4,8 +4,8 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x204
     LayoutBlockFlow {BODY} at (8,8) size 784x183
       LayoutBlockFlow {DIV} at (0,0) size 784x18
-        LayoutText {#text} at (0,0) size 520x18
-          text run at (0,0) width 520: "This tests proper handling of unicode-bidi: plaintext. You should not see any red."
+        LayoutText {#text} at (0,0) size 519x18
+          text run at (0,0) width 519: "This tests proper handling of unicode-bidi: plaintext. You should not see any red."
       LayoutBlockFlow {DIV} at (0,18) size 784x75
         LayoutText {#text} at (0,0) size 46x18
           text run at (0,0) width 46: "!hello. "
@@ -18,9 +18,9 @@
           text run at (39,38) width 20 RTL: "\x{5DC}\x{5D5}\x{5D9}"
           text run at (58,38) width 11: "! "
         LayoutBR {BR} at (68,38) size 1x18
-        LayoutText {#text} at (683,57) size 101x18
-          text run at (683,57) width 7 RTL: "!"
-          text run at (689,57) width 51: "WebKit"
+        LayoutText {#text} at (684,57) size 100x18
+          text run at (684,57) width 7 RTL: "!"
+          text run at (690,57) width 50: "WebKit"
           text run at (739,57) width 45 RTL: "\x{5E9}\x{5DC}\x{5D5}\x{5DD}, "
       LayoutBlockFlow {PRE} at (0,106) size 784x77
         LayoutText {#text} at (0,0) size 784x77
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/unicode-bidi-plaintext-in-textarea-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/unicode-bidi-plaintext-in-textarea-expected.png
index 94d1cd6..2682cbbc 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/unicode-bidi-plaintext-in-textarea-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/unicode-bidi-plaintext-in-textarea-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/unicode-bidi-plaintext-in-textarea-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/unicode-bidi-plaintext-in-textarea-expected.txt
index 5de61a4..d1804286 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/unicode-bidi-plaintext-in-textarea-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/international/unicode-bidi-plaintext-in-textarea-expected.txt
@@ -5,8 +5,8 @@
     LayoutBlockFlow {BODY} at (8,8) size 784x284
       LayoutBlockFlow {DIV} at (0,0) size 784x284
         LayoutBlockFlow (anonymous) at (0,0) size 784x36
-          LayoutText {#text} at (0,0) size 779x36
-            text run at (0,0) width 779: "In all four cases below, the exclamation mark should be on the left side of the first line and on the right side of the second"
+          LayoutText {#text} at (0,0) size 777x36
+            text run at (0,0) width 777: "In all four cases below, the exclamation mark should be on the left side of the first line and on the right side of the second"
             text run at (0,18) width 28: "line."
         LayoutBlockFlow {DIV} at (0,36) size 784x248
           LayoutBR {BR} at (321,44) size 0x18
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/justified-selection-at-edge-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/text/justified-selection-at-edge-expected.png
index 5febf18..f04f3118 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/justified-selection-at-edge-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/justified-selection-at-edge-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/justified-selection-at-edge-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/text/justified-selection-at-edge-expected.txt
index 9a10220..9c0f7e8 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/justified-selection-at-edge-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/justified-selection-at-edge-expected.txt
@@ -4,8 +4,8 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x600
     LayoutBlockFlow {BODY} at (8,8) size 784x576
       LayoutBlockFlow {P} at (0,0) size 784x18
-        LayoutText {#text} at (0,0) size 395x18
-          text run at (0,0) width 395: "Test for bug 13234, layout of selected justified text is broken."
+        LayoutText {#text} at (0,0) size 393x18
+          text run at (0,0) width 393: "Test for bug 13234, layout of selected justified text is broken."
       LayoutBlockFlow {P} at (0,34) size 784x18
         LayoutText {#text} at (0,0) size 255x18
           text run at (0,0) width 255: "The two blue boxes should be identical."
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/justified-selection-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/text/justified-selection-expected.png
index d3968f8..13041274 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/justified-selection-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/justified-selection-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/justified-selection-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/text/justified-selection-expected.txt
index b6f9936..14a674da 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/justified-selection-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/justified-selection-expected.txt
@@ -4,13 +4,13 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x600
     LayoutBlockFlow {BODY} at (8,8) size 784x584
       LayoutBlockFlow {P} at (0,0) size 784x18
-        LayoutText {#text} at (0,0) size 110x18
-          text run at (0,0) width 110: "Test for revision "
+        LayoutText {#text} at (0,0) size 109x18
+          text run at (0,0) width 109: "Test for revision "
         LayoutInline {A} at (0,0) size 49x18 [color=#0000EE]
-          LayoutText {#text} at (109,0) size 49x18
-            text run at (109,0) width 49: "#20574"
-        LayoutText {#text} at (157,0) size 5x18
-          text run at (157,0) width 5: "."
+          LayoutText {#text} at (108,0) size 49x18
+            text run at (108,0) width 49: "#20574"
+        LayoutText {#text} at (156,0) size 5x18
+          text run at (156,0) width 5: "."
       LayoutBlockFlow {P} at (0,34) size 784x18
         LayoutText {#text} at (0,0) size 255x18
           text run at (0,0) width 255: "The two blue boxes should be identical."
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/letter-spacing-negative-opacity-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/text/letter-spacing-negative-opacity-expected.png
index b5d934a..718536c 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/letter-spacing-negative-opacity-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/letter-spacing-negative-opacity-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/letter-spacing-negative-opacity-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/text/letter-spacing-negative-opacity-expected.txt
index 19fc07d..7808d42 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/letter-spacing-negative-opacity-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/letter-spacing-negative-opacity-expected.txt
@@ -4,6 +4,6 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x600
     LayoutBlockFlow {BODY} at (8,8) size 784x584
 layer at (8,8) size 273x163 transparent
-  LayoutBlockFlow (positioned) {DIV} at (8,8) size 272.97x163 [border: (1px solid #FF0000)]
-    LayoutText {#text} at (1,1) size 271x161
-      text run at (1,1) width 271: "Testing the bug"
+  LayoutBlockFlow (positioned) {DIV} at (8,8) size 273.20x163 [border: (1px solid #FF0000)]
+    LayoutText {#text} at (1,1) size 272x161
+      text run at (1,1) width 272: "Testing the bug"
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/line-initial-and-final-swashes-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/text/line-initial-and-final-swashes-expected.png
index f714aaf8..de2abe4 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/line-initial-and-final-swashes-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/line-initial-and-final-swashes-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/line-initial-and-final-swashes-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/text/line-initial-and-final-swashes-expected.txt
index 2b0e243..c50bb5b0 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/line-initial-and-final-swashes-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/line-initial-and-final-swashes-expected.txt
@@ -4,8 +4,8 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x600
     LayoutBlockFlow {BODY} at (8,8) size 784x584
       LayoutBlockFlow {P} at (0,0) size 784x18
-        LayoutText {#text} at (0,0) size 654x18
-          text run at (0,0) width 654: "The black text should be identical to, and overlap, the red text, so there should be no red pixels below."
+        LayoutText {#text} at (0,0) size 653x18
+          text run at (0,0) width 653: "The black text should be identical to, and overlap, the red text, so there should be no red pixels below."
       LayoutBlockFlow {DIV} at (0,34) size 784x144
         LayoutBlockFlow {DIV} at (0,0) size 784x144 [color=#FF0000]
           LayoutText {#text} at (0,0) size 255x144
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/midword-break-after-breakable-char-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/text/midword-break-after-breakable-char-expected.png
index fae95d0d..0d27bca 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/midword-break-after-breakable-char-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/midword-break-after-breakable-char-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/midword-break-after-breakable-char-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/text/midword-break-after-breakable-char-expected.txt
index 34f603a..50e5d3d 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/midword-break-after-breakable-char-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/midword-break-after-breakable-char-expected.txt
@@ -4,22 +4,22 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x600
     LayoutBlockFlow {BODY} at (8,8) size 784x576
       LayoutBlockFlow {P} at (0,0) size 784x36
-        LayoutText {#text} at (0,0) size 55x18
-          text run at (0,0) width 55: "Test for "
-        LayoutInline {I} at (0,0) size 740x36
-          LayoutInline {A} at (0,0) size 306x18 [color=#0000EE]
-            LayoutText {#text} at (54,0) size 306x18
-              text run at (54,0) width 306: "http://bugs.webkit.org/show_bug.cgi?id=13156"
-          LayoutText {#text} at (359,0) size 740x36
-            text run at (359,0) width 5: " "
-            text run at (363,0) width 377: "REGRESSION (r19621): Pasting breakable content where"
-            text run at (0,18) width 504: "wrapped line is too long to fit in a textarea fails to draw a horizontal scrollbar"
-        LayoutText {#text} at (503,18) size 5x18
-          text run at (503,18) width 5: "."
+        LayoutText {#text} at (0,0) size 54x18
+          text run at (0,0) width 54: "Test for "
+        LayoutInline {I} at (0,0) size 737x36
+          LayoutInline {A} at (0,0) size 305x18 [color=#0000EE]
+            LayoutText {#text} at (53,0) size 305x18
+              text run at (53,0) width 305: "http://bugs.webkit.org/show_bug.cgi?id=13156"
+          LayoutText {#text} at (357,0) size 737x36
+            text run at (357,0) width 5: " "
+            text run at (361,0) width 376: "REGRESSION (r19621): Pasting breakable content where"
+            text run at (0,18) width 502: "wrapped line is too long to fit in a textarea fails to draw a horizontal scrollbar"
+        LayoutText {#text} at (501,18) size 5x18
+          text run at (501,18) width 5: "."
       LayoutBlockFlow {P} at (0,52) size 784x36
-        LayoutText {#text} at (0,0) size 726x36
-          text run at (0,0) width 726: "This tests that a line break will occur in the middle of the first word on a line if it\x{2019}s too long to fit on the line. The"
-          text run at (0,18) width 707: "behavior is tested after breakable characters (question mark and hyphen), after a space and after a soft hyphen."
+        LayoutText {#text} at (0,0) size 783x36
+          text run at (0,0) width 783: "This tests that a line break will occur in the middle of the first word on a line if it\x{2019}s too long to fit on the line. The behavior"
+          text run at (0,18) width 647: "is tested after breakable characters (question mark and hyphen), after a space and after a soft hyphen."
       LayoutBlockFlow {P} at (0,104) size 784x18
         LayoutText {#text} at (0,0) size 266x18
           text run at (0,0) width 266: "The following blocks should be identical."
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/midword-break-before-surrogate-pair-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/text/midword-break-before-surrogate-pair-expected.png
index 269d03f..6f7ed398 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/midword-break-before-surrogate-pair-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/midword-break-before-surrogate-pair-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/midword-break-before-surrogate-pair-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/text/midword-break-before-surrogate-pair-expected.txt
index 5aac7e2..72c5983 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/midword-break-before-surrogate-pair-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/midword-break-before-surrogate-pair-expected.txt
@@ -4,8 +4,8 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x600
     LayoutBlockFlow {BODY} at (8,8) size 784x584
       LayoutBlockFlow {P} at (0,0) size 784x36
-        LayoutText {#text} at (0,0) size 765x36
-          text run at (0,0) width 765: "The following box should break the sequence of symbols at the 5 character mark and not overflow the blue box. This is"
+        LayoutText {#text} at (0,0) size 764x36
+          text run at (0,0) width 764: "The following box should break the sequence of symbols at the 5 character mark and not overflow the blue box. This is"
           text run at (0,18) width 253: "because U+1D49 is a number category "
           text run at (252,18) width 298: "unicode character, for which break-all applies."
       LayoutBlockFlow {DIV} at (0,52) size 186x104 [border: (3px solid #0000FF)]
@@ -13,9 +13,9 @@
           text run at (3,3) width 173: "\x{D835}\x{DC9E}\x{D835}\x{DC9E}\x{D835}\x{DC9E}\x{D835}\x{DC9E}\x{D835}\x{DC9E}\x{D835}\x{DC9E}\x{D835}\x{DC9E}"
           text run at (3,52) width 74: "\x{D835}\x{DC9E}\x{D835}\x{DC9E}\x{D835}\x{DC9E}"
       LayoutBlockFlow {P} at (0,172) size 784x18
-        LayoutText {#text} at (0,0) size 779x18
+        LayoutText {#text} at (0,0) size 778x18
           text run at (0,0) width 539: "The following box should not break the sequence of symbols since U+1F1EF is not "
-          text run at (538,0) width 241: "a letter or number category character."
+          text run at (538,0) width 240: "a letter or number category character."
       LayoutBlockFlow {DIV} at (0,206) size 186x55 [border: (3px solid #0000FF)]
         LayoutText {#text} at (3,3) size 576x49
           text run at (3,3) width 576: "\x{D83C}\x{DDEF}\x{D83C}\x{DDF5}\x{D83C}\x{DDEF}\x{D83C}\x{DDF5}\x{D83C}\x{DDEF}\x{D83C}\x{DDF5}\x{D83C}\x{DDEF}\x{D83C}\x{DDF5}\x{D83C}\x{DDEF}\x{D83C}\x{DDF5}\x{D83C}\x{DDEF}\x{D83C}\x{DDF5}\x{D83C}\x{DDEF}\x{D83C}\x{DDF5}\x{D83C}\x{DDEF}\x{D83C}\x{DDF5}"
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/midword-break-hang-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/text/midword-break-hang-expected.png
index 6b581cf..4b30b825 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/midword-break-hang-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/midword-break-hang-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/midword-break-hang-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/text/midword-break-hang-expected.txt
index 6e1c1075..e7e149d 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/midword-break-hang-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/midword-break-hang-expected.txt
@@ -6,13 +6,13 @@
       LayoutBlockFlow {P} at (0,0) size 784x36
         LayoutText {#text} at (0,0) size 177x18
           text run at (0,0) width 177: "This is a regression test for "
-        LayoutInline {I} at (0,0) size 726x36
-          LayoutInline {A} at (0,0) size 355x18 [color=#0000EE]
-            LayoutText {#text} at (176,0) size 355x18
-              text run at (176,0) width 355: "http://bugzilla.opendarwin.org/show_bug.cgi?id=8485"
-          LayoutText {#text} at (530,0) size 726x36
-            text run at (530,0) width 5: " "
-            text run at (534,0) width 192: "iExploder(#11705): Freeze in"
+        LayoutInline {I} at (0,0) size 724x36
+          LayoutInline {A} at (0,0) size 354x18 [color=#0000EE]
+            LayoutText {#text} at (176,0) size 354x18
+              text run at (176,0) width 354: "http://bugzilla.opendarwin.org/show_bug.cgi?id=8485"
+          LayoutText {#text} at (529,0) size 724x36
+            text run at (529,0) width 5: " "
+            text run at (533,0) width 191: "iExploder(#11705): Freeze in"
             text run at (0,18) width 176: "LayoutBlockFlow::layout()"
         LayoutText {#text} at (175,18) size 5x18
           text run at (175,18) width 5: "."
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/monospace-width-cache-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/text/monospace-width-cache-expected.png
index df96317..ca7bb4b 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/monospace-width-cache-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/monospace-width-cache-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/monospace-width-cache-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/text/monospace-width-cache-expected.txt
index f41708b..e526aeb 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/monospace-width-cache-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/monospace-width-cache-expected.txt
@@ -4,19 +4,19 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x600
     LayoutBlockFlow {BODY} at (8,8) size 784x576
       LayoutBlockFlow {P} at (0,0) size 784x36
-        LayoutText {#text} at (0,0) size 328x18
-          text run at (0,0) width 328: "Test for monospace width cache bug mentioned in "
-        LayoutInline {A} at (0,0) size 69x18 [color=#0000EE]
-          LayoutText {#text} at (327,0) size 69x18
-            text run at (327,0) width 69: "bug 11197"
-        LayoutText {#text} at (395,0) size 5x18
-          text run at (395,0) width 5: " "
-        LayoutInline {I} at (0,0) size 751x36
-          LayoutText {#text} at (399,0) size 751x36
-            text run at (399,0) width 352: "REGRESSION: Specifying a counter for a CODE tag's"
-            text run at (0,18) width 356: "content style property on before or after causes a crash"
-        LayoutText {#text} at (355,18) size 5x18
-          text run at (355,18) width 5: "."
+        LayoutText {#text} at (0,0) size 326x18
+          text run at (0,0) width 326: "Test for monospace width cache bug mentioned in "
+        LayoutInline {A} at (0,0) size 68x18 [color=#0000EE]
+          LayoutText {#text} at (325,0) size 68x18
+            text run at (325,0) width 68: "bug 11197"
+        LayoutText {#text} at (392,0) size 5x18
+          text run at (392,0) width 5: " "
+        LayoutInline {I} at (0,0) size 749x36
+          LayoutText {#text} at (396,0) size 749x36
+            text run at (396,0) width 353: "REGRESSION: Specifying a counter for a CODE tag's"
+            text run at (0,18) width 354: "content style property on before or after causes a crash"
+        LayoutText {#text} at (353,18) size 5x18
+          text run at (353,18) width 5: "."
       LayoutBlockFlow {P} at (0,52) size 784x18
         LayoutText {#text} at (0,0) size 376x18
           text run at (0,0) width 376: "The blue line and the black line should be the same length."
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/reset-emptyRun-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/text/reset-emptyRun-expected.png
index a12a5328..ae5cff8 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/reset-emptyRun-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/reset-emptyRun-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/reset-emptyRun-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/text/reset-emptyRun-expected.txt
index ee9e969..bc81078e 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/reset-emptyRun-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/reset-emptyRun-expected.txt
@@ -4,17 +4,17 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x600
     LayoutBlockFlow {BODY} at (8,8) size 784x584
       LayoutBlockFlow {P} at (0,0) size 784x18
-        LayoutText {#text} at (0,0) size 55x18
-          text run at (0,0) width 55: "Test for "
-        LayoutInline {I} at (0,0) size 715x18
-          LayoutInline {A} at (0,0) size 306x18 [color=#0000EE]
-            LayoutText {#text} at (54,0) size 306x18
-              text run at (54,0) width 306: "http://bugs.webkit.org/show_bug.cgi?id=14758"
-          LayoutText {#text} at (359,0) size 410x18
-            text run at (359,0) width 5: " "
-            text run at (363,0) width 406: "REGRESSION: Repeated text after line break on facebook.com"
-        LayoutText {#text} at (768,0) size 5x18
-          text run at (768,0) width 5: "."
+        LayoutText {#text} at (0,0) size 54x18
+          text run at (0,0) width 54: "Test for "
+        LayoutInline {I} at (0,0) size 714x18
+          LayoutInline {A} at (0,0) size 305x18 [color=#0000EE]
+            LayoutText {#text} at (53,0) size 305x18
+              text run at (53,0) width 305: "http://bugs.webkit.org/show_bug.cgi?id=14758"
+          LayoutText {#text} at (357,0) size 410x18
+            text run at (357,0) width 5: " "
+            text run at (361,0) width 406: "REGRESSION: Repeated text after line break on facebook.com"
+        LayoutText {#text} at (766,0) size 5x18
+          text run at (766,0) width 5: "."
       LayoutBlockFlow {P} at (0,34) size 784x18
         LayoutText {#text} at (0,0) size 237x18
           text run at (0,0) width 237: "These two boxes should be identical:"
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/selection-hard-linebreak-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/text/selection-hard-linebreak-expected.png
index 7223252..b64aa1a 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/selection-hard-linebreak-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/selection-hard-linebreak-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/selection-hard-linebreak-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/text/selection-hard-linebreak-expected.txt
index d438880f..5ac1c010 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/selection-hard-linebreak-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/selection-hard-linebreak-expected.txt
@@ -4,26 +4,26 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x600
     LayoutBlockFlow {BODY} at (8,8) size 784x584
       LayoutBlockFlow {P} at (0,0) size 784x36
-        LayoutText {#text} at (0,0) size 55x18
-          text run at (0,0) width 55: "Test for "
-        LayoutInline {I} at (0,0) size 769x36
-          LayoutInline {A} at (0,0) size 306x18 [color=#0000EE]
-            LayoutText {#text} at (54,0) size 306x18
-              text run at (54,0) width 306: "http://bugs.webkit.org/show_bug.cgi?id=13153"
-          LayoutText {#text} at (359,0) size 769x36
-            text run at (359,0) width 5: " "
-            text run at (363,0) width 406: "REGRESSION: Visual highlighting of pre-populated blank line"
-            text run at (0,18) width 132: "in textarea is broken"
-        LayoutText {#text} at (131,18) size 5x18
-          text run at (131,18) width 5: "."
+        LayoutText {#text} at (0,0) size 54x18
+          text run at (0,0) width 54: "Test for "
+        LayoutInline {I} at (0,0) size 782x36
+          LayoutInline {A} at (0,0) size 305x18 [color=#0000EE]
+            LayoutText {#text} at (53,0) size 305x18
+              text run at (53,0) width 305: "http://bugs.webkit.org/show_bug.cgi?id=13153"
+          LayoutText {#text} at (357,0) size 782x36
+            text run at (357,0) width 5: " "
+            text run at (361,0) width 421: "REGRESSION: Visual highlighting of pre-populated blank line in"
+            text run at (0,18) width 115: "textarea is broken"
+        LayoutText {#text} at (114,18) size 5x18
+          text run at (114,18) width 5: "."
       LayoutBlockFlow {P} at (0,52) size 784x18
-        LayoutText {#text} at (0,0) size 340x18
-          text run at (0,0) width 340: "Testing the highlighting of and near hard line breaks."
+        LayoutText {#text} at (0,0) size 339x18
+          text run at (0,0) width 339: "Testing the highlighting of and near hard line breaks."
       LayoutBlockFlow (anonymous) at (0,86) size 784x80
         LayoutText {#text} at (0,0) size 0x0
       LayoutBlockFlow {P} at (0,182) size 784x18
-        LayoutText {#text} at (0,0) size 320x18
-          text run at (0,0) width 320: "Testing the highlighting of text split across boxes."
+        LayoutText {#text} at (0,0) size 319x18
+          text run at (0,0) width 319: "Testing the highlighting of text split across boxes."
       LayoutBlockFlow (anonymous) at (0,216) size 784x80
         LayoutText {#text} at (0,0) size 0x0
 layer at (12,98) size 62x72
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/shadow-translucent-fill-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/text/shadow-translucent-fill-expected.png
index db88896..e765c7ec 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/shadow-translucent-fill-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/shadow-translucent-fill-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/shadow-translucent-fill-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/text/shadow-translucent-fill-expected.txt
index 4231f8a..70d0c99 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/shadow-translucent-fill-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/shadow-translucent-fill-expected.txt
@@ -4,9 +4,9 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x600
     LayoutBlockFlow {BODY} at (8,8) size 784x576
       LayoutBlockFlow {P} at (0,0) size 784x18
-        LayoutText {#text} at (0,0) size 608x18
-          text run at (0,0) width 479: "Test that the intensity of text-shadow does not depend on the transparency "
-          text run at (478,0) width 130: "of the text fill color."
+        LayoutText {#text} at (0,0) size 605x18
+          text run at (0,0) width 478: "Test that the intensity of text-shadow does not depend on the transparency "
+          text run at (477,0) width 128: "of the text fill color."
       LayoutBlockFlow {DIV} at (0,34) size 784x72
         LayoutText {#text} at (0,0) size 48x24
           text run at (0,0) width 48: "A "
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/shaping/same-script-different-lang-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/text/shaping/same-script-different-lang-expected.png
index 19fa508..38c5fd9c 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/shaping/same-script-different-lang-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/shaping/same-script-different-lang-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/shaping/same-script-different-lang-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/text/shaping/same-script-different-lang-expected.txt
index 1b4b9e44..3aef65a8 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/shaping/same-script-different-lang-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/shaping/same-script-different-lang-expected.txt
@@ -1,18 +1,22 @@
 layer at (0,0) size 800x600
   LayoutView at (0,0) size 800x600
-layer at (0,0) size 800x195
-  LayoutBlockFlow {HTML} at (0,0) size 800x195.44
-    LayoutBlockFlow {BODY} at (8,18.72) size 784x168.72
+layer at (0,0) size 800x173
+  LayoutBlockFlow {HTML} at (0,0) size 800x173.44
+    LayoutBlockFlow {BODY} at (8,18.72) size 784x138.72
       LayoutBlockFlow {H3} at (0,0) size 784x22
         LayoutText {#text} at (0,0) size 759x22
           text run at (0,0) width 759: "The glyph for JHA should look different for Nepali and Hindi, depending on the lang attribute."
       LayoutBlockFlow {P} at (0,40.72) size 784x22
         LayoutText {#text} at (0,1) size 91x21
           text run at (0,1) width 91: "Hindi:JHA \x{91D}"
-      LayoutBlockFlow (anonymous) at (0,78.72) size 784x18
-        LayoutBR {BR} at (0,0) size 0x18
-      LayoutBlockFlow {P} at (0,112.72) size 784x22
+      LayoutBlockFlow {P} at (0,78.72) size 784x22
         LayoutText {#text} at (0,1) size 102x21
           text run at (0,1) width 102: "Nepali:JHA \x{91D}"
-      LayoutBlockFlow (anonymous) at (0,150.72) size 784x18
-        LayoutBR {BR} at (0,0) size 0x18
+      LayoutBlockFlow {P} at (0,116.72) size 784x22
+        LayoutText {#text} at (0,1) size 87x21
+          text run at (0,1) width 87: "Nepali:JHA "
+        LayoutInline {SPAN} at (0,0) size 16x21
+          LayoutText {#text} at (86,1) size 16x21
+            text run at (86,1) width 16: "\x{91D}"
+        LayoutText {#text} at (101,1) size 353x21
+          text run at (101,1) width 353: " - \"ne\" in \"hi\" should look the same as above."
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/shaping/shaping-selection-rect-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/text/shaping/shaping-selection-rect-expected.png
index e2ac9ce..94782f78 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/shaping/shaping-selection-rect-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/shaping/shaping-selection-rect-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/shaping/shaping-selection-rect-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/text/shaping/shaping-selection-rect-expected.txt
index c8849998..9f42b0b8 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/shaping/shaping-selection-rect-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/shaping/shaping-selection-rect-expected.txt
@@ -4,8 +4,8 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x600
     LayoutBlockFlow {BODY} at (8,8) size 784x584
       LayoutBlockFlow {P} at (0,0) size 784x18
-        LayoutText {#text} at (0,0) size 655x18
-          text run at (0,0) width 655: "The selection should cover the all of the below text. There should be no blank between either C and F."
+        LayoutText {#text} at (0,0) size 654x18
+          text run at (0,0) width 654: "The selection should cover the all of the below text. There should be no blank between either C and F."
       LayoutBlockFlow {DIV} at (0,34) size 784x18
         LayoutText {#text} at (0,0) size 33x17
           text run at (0,0) width 33: "ABC"
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/should-use-atsui-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/text/should-use-atsui-expected.png
index c46f41d2..1ffb8db 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/should-use-atsui-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/should-use-atsui-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/should-use-atsui-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/text/should-use-atsui-expected.txt
index de821e9..ef3d383 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/should-use-atsui-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/should-use-atsui-expected.txt
@@ -4,17 +4,17 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x600
     LayoutBlockFlow {BODY} at (8,8) size 784x584
       LayoutBlockFlow {P} at (0,0) size 784x36
-        LayoutText {#text} at (0,0) size 55x18
-          text run at (0,0) width 55: "Test for "
-        LayoutInline {I} at (0,0) size 750x36
-          LayoutText {#text} at (54,0) size 750x36
-            text run at (54,0) width 696: "http://bugzilla.opendarwin.org/show_bug.cgi?id=6132 Incorrect selection highlighting for ATSUI text when"
+        LayoutText {#text} at (0,0) size 54x18
+          text run at (0,0) width 54: "Test for "
+        LayoutInline {I} at (0,0) size 747x36
+          LayoutText {#text} at (53,0) size 747x36
+            text run at (53,0) width 694: "http://bugzilla.opendarwin.org/show_bug.cgi?id=6132 Incorrect selection highlighting for ATSUI text when"
             text run at (0,18) width 179: "selected range is \"CG-safe\""
         LayoutText {#text} at (178,18) size 5x18
           text run at (178,18) width 5: "."
       LayoutBlockFlow {P} at (0,52) size 784x18
-        LayoutText {#text} at (0,0) size 721x18
-          text run at (0,0) width 721: "The word \x{201C}dolor\x{201D} below should be highlighted in its entirety. The highlight should not extend beyond that word."
+        LayoutText {#text} at (0,0) size 720x18
+          text run at (0,0) width 720: "The word \x{201C}dolor\x{201D} below should be highlighted in its entirety. The highlight should not extend beyond that word."
       LayoutBlockFlow {HR} at (0,86) size 784x2 [border: (1px inset #EEEEEE)]
       LayoutBlockFlow (anonymous) at (0,96) size 784x18
         LayoutInline {SPAN} at (0,0) size 178x18
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/small-caps-turkish-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/text/small-caps-turkish-expected.png
index 7ac8ac8d..62e9c9b 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/small-caps-turkish-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/small-caps-turkish-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/small-caps-turkish-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/text/small-caps-turkish-expected.txt
index 102621da..080ae1b7 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/small-caps-turkish-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/small-caps-turkish-expected.txt
@@ -20,13 +20,13 @@
         LayoutText {#text} at (138,0) size 10x18
           text run at (138,0) width 10: " :"
       LayoutBlockFlow {P} at (0,68) size 784x18
-        LayoutText {#text} at (0,0) size 92x18
-          text run at (0,0) width 92: "locale=tr-TR: "
+        LayoutText {#text} at (0,0) size 91x18
+          text run at (0,0) width 91: "locale=tr-TR: "
         LayoutInline {SPAN} at (0,0) size 46x18
-          LayoutText {#text} at (91,0) size 46x18
-            text run at (91,0) width 46: "Isi\x{130} \x{130}s\x{131}I"
-        LayoutText {#text} at (136,0) size 9x18
-          text run at (136,0) width 9: " :"
+          LayoutText {#text} at (90,0) size 46x18
+            text run at (90,0) width 46: "Isi\x{130} \x{130}s\x{131}I"
+        LayoutText {#text} at (135,0) size 10x18
+          text run at (135,0) width 10: " :"
       LayoutBlockFlow {P} at (0,102) size 784x18
         LayoutText {#text} at (0,0) size 131x18
           text run at (0,0) width 131: "locale=tr@foo=bar: "
@@ -68,13 +68,13 @@
         LayoutText {#text} at (180,0) size 9x18
           text run at (180,0) width 9: " :"
       LayoutBlockFlow {P} at (0,272) size 784x18
-        LayoutText {#text} at (0,0) size 92x18
-          text run at (0,0) width 92: "locale=tr-US: "
+        LayoutText {#text} at (0,0) size 91x18
+          text run at (0,0) width 91: "locale=tr-US: "
         LayoutInline {SPAN} at (0,0) size 46x18
-          LayoutText {#text} at (91,0) size 46x18
-            text run at (91,0) width 46: "Isi\x{130} \x{130}s\x{131}I"
-        LayoutText {#text} at (136,0) size 9x18
-          text run at (136,0) width 9: " :"
+          LayoutText {#text} at (90,0) size 46x18
+            text run at (90,0) width 46: "Isi\x{130} \x{130}s\x{131}I"
+        LayoutText {#text} at (135,0) size 10x18
+          text run at (135,0) width 10: " :"
       LayoutBlockFlow {P} at (0,306) size 784x18
         LayoutText {#text} at (0,0) size 77x18
           text run at (0,0) width 77: "locale=TR: "
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/soft-hyphen-3-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/text/soft-hyphen-3-expected.png
index 852674cf..759820c 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/soft-hyphen-3-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/soft-hyphen-3-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/soft-hyphen-3-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/text/soft-hyphen-3-expected.txt
new file mode 100644
index 0000000..56e470a
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/soft-hyphen-3-expected.txt
@@ -0,0 +1,13 @@
+layer at (0,0) size 800x600
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  LayoutBlockFlow {HTML} at (0,0) size 800x600
+    LayoutBlockFlow {BODY} at (8,8) size 784x584
+      LayoutBlockFlow {DIV} at (0,0) size 225x58 [color=#FFFFFF]
+        LayoutText {#text} at (0,6) size 100x25
+          text run at (0,6) width 100: "Did \x{AD}"
+        LayoutInline {SPAN} at (0,0) size 75x25 [color=#008000]
+          LayoutText {#text} at (100,6) size 75x25
+            text run at (100,6) width 75: "not"
+        LayoutText {#text} at (0,33) size 100x25
+          text run at (0,33) width 100: "fail"
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/softHyphen-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/text/softHyphen-expected.png
index a5ced59a..0b1c94d 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/softHyphen-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/softHyphen-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/softHyphen-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/text/softHyphen-expected.txt
index e44c6cc..565e8de 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/softHyphen-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/softHyphen-expected.txt
@@ -1,8 +1,8 @@
-layer at (0,0) size 800x600 clip at (0,0) size 785x600 scrollHeight 992
+layer at (0,0) size 800x600 clip at (0,0) size 785x600 scrollHeight 995
   LayoutView at (0,0) size 800x600
-layer at (0,0) size 785x992 backgroundClip at (0,0) size 785x600 clip at (0,0) size 785x600
-  LayoutBlockFlow {HTML} at (0,0) size 785x992
-    LayoutBlockFlow {BODY} at (8,16) size 769x960
+layer at (0,0) size 785x995 backgroundClip at (0,0) size 785x600 clip at (0,0) size 785x600
+  LayoutBlockFlow {HTML} at (0,0) size 785x995
+    LayoutBlockFlow {BODY} at (8,16) size 769x963
       LayoutBlockFlow {P} at (0,0) size 769x18
         LayoutText {#text} at (0,0) size 438x18
           text run at (0,0) width 438: "In all of the following, there should not be a hyphen before \x{201C}lorem\x{201D}."
@@ -96,53 +96,53 @@
       LayoutBlockFlow {P} at (0,530) size 769x18
         LayoutText {#text} at (0,0) size 61x18
           text run at (0,0) width 61: "Do\x{AD} \x{AD}lorem"
-      LayoutBlockFlow {P} at (0,564) size 769x18
-        LayoutText {#text} at (0,0) size 61x18
-          text run at (0,0) width 24: "Do "
-          text run at (23,0) width 38: "\x{AD}lorem"
-      LayoutBlockFlow {P} at (0,598) size 769x18
+      LayoutBlockFlow {P} at (0,564) size 769x19
+        LayoutText {#text} at (0,1) size 61x18
+          text run at (0,1) width 24: "Do "
+          text run at (23,1) width 38: "\x{AD}lorem"
+      LayoutBlockFlow {P} at (0,599) size 769x18
         LayoutText {#text} at (0,0) size 61x18
           text run at (0,0) width 24: "Do\x{AD} "
           text run at (23,0) width 38: "lorem"
-      LayoutBlockFlow {P} at (0,632) size 769x18
-        LayoutText {#text} at (0,0) size 65x18
-          text run at (0,0) width 28: "Do \x{AD} "
-          text run at (27,0) width 38: "lorem"
-      LayoutBlockFlow {P} at (0,666) size 769x18
-        LayoutText {#text} at (0,0) size 65x18
-          text run at (0,0) width 24: "Do "
-          text run at (23,0) width 42: "\x{AD} lorem"
-      LayoutBlockFlow {P} at (0,700) size 769x18
+      LayoutBlockFlow {P} at (0,633) size 769x19
+        LayoutText {#text} at (0,1) size 65x18
+          text run at (0,1) width 28: "Do \x{AD} "
+          text run at (27,1) width 38: "lorem"
+      LayoutBlockFlow {P} at (0,668) size 769x19
+        LayoutText {#text} at (0,1) size 65x18
+          text run at (0,1) width 24: "Do "
+          text run at (23,1) width 42: "\x{AD} lorem"
+      LayoutBlockFlow {P} at (0,703) size 769x18
         LayoutText {#text} at (0,0) size 20x18
           text run at (0,0) width 20: "Do"
         LayoutInline {SPAN} at (0,0) size 1x18
         LayoutText {#text} at (19,0) size 81x18
           text run at (19,0) width 81: "\x{AD}lorem ipsum"
-      LayoutBlockFlow {P} at (0,734) size 769x18
+      LayoutBlockFlow {P} at (0,737) size 769x18
         LayoutText {#text} at (0,0) size 100x18
           text run at (0,0) width 100: "Do\x{AD}\x{AD}lorem ipsum"
-      LayoutBlockFlow {P} at (0,768) size 769x18
+      LayoutBlockFlow {P} at (0,771) size 769x18
         LayoutInline {SPAN} at (0,0) size 20x18
           LayoutText {#text} at (0,0) size 20x18
             text run at (0,0) width 20: "Do\x{AD}"
         LayoutText {#text} at (19,0) size 81x18
           text run at (19,0) width 81: "\x{AD}lorem ipsum"
-      LayoutBlockFlow {P} at (0,802) size 769x18
+      LayoutBlockFlow {P} at (0,805) size 769x18
         LayoutText {#text} at (0,0) size 20x18
           text run at (0,0) width 20: "Do\x{AD}"
         LayoutInline {SPAN} at (0,0) size 81x18
           LayoutText {#text} at (19,0) size 81x18
             text run at (19,0) width 81: "\x{AD}lorem ipsum"
-      LayoutBlockFlow {P} at (0,836) size 769x18
+      LayoutBlockFlow {P} at (0,839) size 769x18
         LayoutInline {SPAN} at (0,0) size 20x18
           LayoutText {#text} at (0,0) size 20x18
             text run at (0,0) width 20: "Do\x{AD}\x{AD}"
         LayoutText {#text} at (19,0) size 81x18
           text run at (19,0) width 81: "lorem ipsum"
-      LayoutBlockFlow {P} at (0,870) size 769x18
+      LayoutBlockFlow {P} at (0,873) size 769x18
         LayoutText {#text} at (0,0) size 251x18
           text run at (0,0) width 251: "The following pair should be the same:"
-      LayoutBlockFlow {P} at (0,904) size 769x20
+      LayoutBlockFlow {P} at (0,907) size 769x20
         LayoutText {#text} at (0,1) size 16x18
           text run at (0,1) width 16: "W"
         LayoutBlockFlow {SPAN} at (15.09,0) size 13.56x20 [border: (1px solid #FF0000)]
@@ -150,7 +150,7 @@
             text run at (1,1) width 12: "X"
         LayoutText {#text} at (28,1) size 13x18
           text run at (28,1) width 13: "Y"
-      LayoutBlockFlow {P} at (0,940) size 769x20
+      LayoutBlockFlow {P} at (0,943) size 769x20
         LayoutText {#text} at (0,1) size 16x18
           text run at (0,1) width 16: "W"
         LayoutBlockFlow {SPAN} at (15.09,0) size 13.56x20 [border: (1px solid #FF0000)]
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/stroking-decorations-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/text/stroking-decorations-expected.png
index 9b16a2af..382c5db 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/stroking-decorations-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/stroking-decorations-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/stroking-decorations-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/text/stroking-decorations-expected.txt
index ecc27df..0536194 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/stroking-decorations-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/stroking-decorations-expected.txt
@@ -8,10 +8,10 @@
           text run at (0,0) width 614: "Purple\x{300} fill, black stroke,"
           text run at (0,74) width 761: "complex text, black underline"
       LayoutBlockFlow {DIV} at (0,148) size 784x148 [textStrokeColor=#FFA500] [textStrokeWidth=1.33]
-        LayoutText {#text} at (0,0) size 638x148
-          text run at (0,0) width 638: "Orange stroke, black fill,"
+        LayoutText {#text} at (0,0) size 635x148
+          text run at (0,0) width 635: "Orange stroke, black fill,"
           text run at (0,74) width 416: "orange overline."
       LayoutBlockFlow {DIV} at (0,296) size 784x148 [textFillColor=#0000FF] [textStrokeWidth=1.33]
-        LayoutText {#text} at (0,0) size 598x148
-          text run at (0,0) width 598: "No stroke, blue fill, red"
-          text run at (0,74) width 596: "shadow, blue underline"
+        LayoutText {#text} at (0,0) size 594x148
+          text run at (0,0) width 594: "No stroke, blue fill, red"
+          text run at (0,74) width 592: "shadow, blue underline"
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/stroking-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/text/stroking-expected.png
index 1e740c4..8761075 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/stroking-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/stroking-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/stroking-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/text/stroking-expected.txt
index b02e8bf..2d5c55d 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/stroking-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/stroking-expected.txt
@@ -8,9 +8,9 @@
           text run at (0,0) width 614: "Purple\x{300} fill, black stroke,"
           text run at (0,74) width 333: "complex text"
       LayoutBlockFlow {DIV} at (0,148) size 784x74 [textStrokeColor=#FFA500] [textStrokeWidth=1.33]
-        LayoutText {#text} at (0,0) size 638x74
-          text run at (0,0) width 638: "Orange stroke, black fill."
+        LayoutText {#text} at (0,0) size 635x74
+          text run at (0,0) width 635: "Orange stroke, black fill."
       LayoutBlockFlow {DIV} at (0,222) size 784x148 [textStrokeColor=#0000FF] [textStrokeWidth=1.33]
-        LayoutText {#text} at (0,0) size 594x148
-          text run at (0,0) width 594: "Blue stroke, no fill, red"
-          text run at (0,74) width 212: "shadow."
+        LayoutText {#text} at (0,0) size 591x148
+          text run at (0,0) width 591: "Blue stroke, no fill, red"
+          text run at (0,74) width 208: "shadow."
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/text-letter-spacing-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/text/text-letter-spacing-expected.png
index 23d3699..32abea72 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/text-letter-spacing-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/text-letter-spacing-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/text-letter-spacing-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/text/text-letter-spacing-expected.txt
index 8a1a1ad92..bb74d2b5 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/text-letter-spacing-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/text-letter-spacing-expected.txt
@@ -4,15 +4,15 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x1728
     LayoutBlockFlow {BODY} at (8,16) size 784x1696
       LayoutBlockFlow {P} at (0,0) size 784x90 [bgcolor=#FFFFFF]
-        LayoutText {#text} at (0,0) size 765x90
-          text run at (0,0) width 765: "The following lines test various combinations of letter-spacing (especially negative values) and opacity. All of the lines"
+        LayoutText {#text} at (0,0) size 764x90
+          text run at (0,0) width 764: "The following lines test various combinations of letter-spacing (especially negative values) and opacity. All of the lines"
           text run at (0,18) width 764: "should say \"Hello, world\" but the spacing and background shading will vary from test to test. The W3C specs are fairly"
           text run at (0,36) width 761: "silent on how user agents should handle unusual values of letter-spacing, especially negative ones, which are explicitly"
-          text run at (0,54) width 738: "implementation-dependent. Different browsers will render these differently, but hopefully the WebKit ports will be"
+          text run at (0,54) width 736: "implementation-dependent. Different browsers will render these differently, but hopefully the WebKit ports will be"
           text run at (0,72) width 121: "consistent, at least."
       LayoutBlockFlow {P} at (0,106) size 784x18 [bgcolor=#FFFFFF]
-        LayoutText {#text} at (0,0) size 262x18
-          text run at (0,0) width 262: "The first line should be normally spaced."
+        LayoutText {#text} at (0,0) size 261x18
+          text run at (0,0) width 261: "The first line should be normally spaced."
       LayoutBlockFlow {P} at (0,140) size 784x18 [bgcolor=#EEEEEE]
         LayoutInline {SPAN} at (0,0) size 81x18
           LayoutText {#text} at (160,0) size 81x18
@@ -25,8 +25,8 @@
           LayoutText {#text} at (160,0) size 177x18
             text run at (160,0) width 177: "Hello, world"
       LayoutBlockFlow {P} at (0,242) size 784x36 [bgcolor=#FFFFFF]
-        LayoutText {#text} at (0,0) size 754x36
-          text run at (0,0) width 754: "The next line tests a large positive letter spacing, and should be *very* spaced out. You may only see an 'H' and a 'w',"
+        LayoutText {#text} at (0,0) size 752x36
+          text run at (0,0) width 752: "The next line tests a large positive letter spacing, and should be *very* spaced out. You may only see an 'H' and a 'w',"
           text run at (0,18) width 54: "perhaps "
           text run at (53,18) width 363: "on two different lines, unless you scroll way to the right."
       LayoutBlockFlow {P} at (0,294) size 784x36 [bgcolor=#EEEEEE]
@@ -35,8 +35,8 @@
             text run at (160,0) width 19240: "Hello,"
             text run at (0,18) width 16038: "world"
       LayoutBlockFlow {P} at (0,346) size 784x36 [bgcolor=#FFFFFF]
-        LayoutText {#text} at (0,0) size 780x36
-          text run at (0,0) width 780: "The next line tests a very large positive letter spacing, and should also be *very* spaced out. You may only see an 'H' and"
+        LayoutText {#text} at (0,0) size 778x36
+          text run at (0,0) width 778: "The next line tests a very large positive letter spacing, and should also be *very* spaced out. You may only see an 'H' and"
           text run at (0,18) width 37: "a 'w', "
           text run at (36,18) width 416: "perhaps on two different lines, unless you scroll way to the right."
       LayoutBlockFlow {P} at (0,398) size 784x36 [bgcolor=#EEEEEE]
@@ -66,9 +66,9 @@
           LayoutText {#text} at (160,0) size 0x18
             text run at (160,0) width 0: "Hello, world"
       LayoutBlockFlow {P} at (0,654) size 784x36 [bgcolor=#FFFFFF]
-        LayoutText {#text} at (0,0) size 783x36
-          text run at (0,0) width 729: "The next few lines test the interaction with opacity. The first line should be normally spaced out, slightly opaque, "
-          text run at (728,0) width 55: "and on a"
+        LayoutText {#text} at (0,0) size 781x36
+          text run at (0,0) width 727: "The next few lines test the interaction with opacity. The first line should be normally spaced out, slightly opaque, "
+          text run at (726,0) width 55: "and on a"
           text run at (0,18) width 201: "differently-colored background"
       LayoutBlockFlow {P} at (0,706) size 784x18 [bgcolor=#EEEEEE]
       LayoutBlockFlow {P} at (0,740) size 784x18 [bgcolor=#FFFFFF]
@@ -101,8 +101,8 @@
         LayoutText {#text} at (0,0) size 266x18
           text run at (0,0) width 266: "Now we do a few basic right-to-left tests:"
       LayoutBlockFlow {P} at (0,1218) size 784x18 [bgcolor=#FFFFFF]
-        LayoutText {#text} at (0,0) size 262x18
-          text run at (0,0) width 262: "The first line should be normally spaced."
+        LayoutText {#text} at (0,0) size 261x18
+          text run at (0,0) width 261: "The first line should be normally spaced."
       LayoutBlockFlow {P} at (0,1252) size 784x18 [bgcolor=#EEEEEE]
         LayoutInline {SPAN} at (0,0) size 81x18
           LayoutText {#text} at (160,0) size 81x18
@@ -124,17 +124,17 @@
             text run at (160,0) width 0 RTL override: "Hello, world"
       LayoutBlockFlow {P} at (0,1422) size 784x18 [bgcolor=#FFFFFF]
         LayoutText {#text} at (0,0) size 471x18
-          text run at (0,0) width 339: "The next line tests a large negative line spacing, and "
-          text run at (338,0) width 133: "should just print a 'd'"
+          text run at (0,0) width 338: "The next line tests a large negative line spacing, and "
+          text run at (337,0) width 134: "should just print a 'd'"
       LayoutBlockFlow {P} at (0,1456) size 784x18 [bgcolor=#EEEEEE]
         LayoutInline {SPAN} at (0,0) size 0x18
           LayoutText {#text} at (160,0) size 0x18
             text run at (160,0) width 0 RTL override: "Hello, world"
       LayoutBlockFlow {P} at (0,1490) size 784x36 [bgcolor=#FFFFFF]
-        LayoutText {#text} at (0,0) size 747x36
-          text run at (0,0) width 149: "Now, opacity as well - "
-          text run at (148,0) width 408: "The next line should be printed right to left, slightly spaced out "
-          text run at (555,0) width 192: "(wider than normal), and on a"
+        LayoutText {#text} at (0,0) size 745x36
+          text run at (0,0) width 148: "Now, opacity as well - "
+          text run at (147,0) width 408: "The next line should be printed right to left, slightly spaced out "
+          text run at (554,0) width 191: "(wider than normal), and on a"
           text run at (0,18) width 80: "background."
       LayoutBlockFlow {P} at (0,1542) size 784x18 [bgcolor=#EEEEEE]
       LayoutBlockFlow {P} at (0,1576) size 784x18 [bgcolor=#FFFFFF]
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/text-shadow-no-default-color-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/text/text-shadow-no-default-color-expected.png
index b50b28a..0e0991b 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/text-shadow-no-default-color-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/text-shadow-no-default-color-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/text-shadow-no-default-color-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/text/text-shadow-no-default-color-expected.txt
index 8ff0a72..29648277 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/text-shadow-no-default-color-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/text-shadow-no-default-color-expected.txt
@@ -4,8 +4,8 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x600
     LayoutBlockFlow {BODY} at (8,8) size 784x567
       LayoutBlockFlow {P} at (0,0) size 784x18
-        LayoutText {#text} at (0,0) size 364x18
-          text run at (0,0) width 364: "Test passes if there are two green rectangles on the page."
+        LayoutText {#text} at (0,0) size 363x18
+          text run at (0,0) width 363: "Test passes if there are two green rectangles on the page."
       LayoutBlockFlow {DIV} at (25,43) size 734x30 [color=#008000]
         LayoutText {#text} at (0,0) size 300x30
           text run at (0,0) width 300: "FillerText"
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/textIteratorNilRenderer-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/text/textIteratorNilRenderer-expected.png
index 9f6f843..f0575a4 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/textIteratorNilRenderer-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/textIteratorNilRenderer-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/textIteratorNilRenderer-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/text/textIteratorNilRenderer-expected.txt
index 885de10..37ff227e 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/textIteratorNilRenderer-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/textIteratorNilRenderer-expected.txt
@@ -5,22 +5,22 @@
     LayoutBlockFlow {BODY} at (8,8) size 784x584
       LayoutBlockFlow {CENTER} at (0,0) size 784x53
         LayoutBlockFlow {FORM} at (0,0) size 784x19
-          LayoutTable {TABLE} at (65,0) size 654x19
-            LayoutTableSection {TBODY} at (0,0) size 654x19
-              LayoutTableRow {TR} at (0,0) size 654x19
+          LayoutTable {TABLE} at (65.50,0) size 653x19
+            LayoutTableSection {TBODY} at (0,0) size 653x19
+              LayoutTableRow {TR} at (0,0) size 653x19
                 LayoutTableCell {TD} at (0,0) size 150x18 [r=0 c=0 rs=2 cs=1]
                   LayoutText {#text} at (0,0) size 4x18
                     text run at (0,0) width 4: " "
                 LayoutTableCell {TD} at (150,0) size 251x19 [r=0 c=1 rs=1 cs=1]
                   LayoutTextControl {INPUT} at (0,0) size 251x19 [bgcolor=#FFFFFF] [border: (2px inset #EEEEEE)]
                   LayoutText {#text} at (0,0) size 0x0
-                LayoutTableCell {TD} at (401,0) size 93x18 [r=0 c=2 rs=1 cs=1]
-                  LayoutButton {INPUT} at (0,0) size 92.19x18 [bgcolor=#C0C0C0]
-                    LayoutBlockFlow (anonymous) at (8,2) size 76.19x13
-                      LayoutText {#text} at (0,0) size 77x13
-                        text run at (0,0) width 77: "Search Froogle"
+                LayoutTableCell {TD} at (401,0) size 92x18 [r=0 c=2 rs=1 cs=1]
+                  LayoutButton {INPUT} at (0,0) size 91.78x18 [bgcolor=#C0C0C0]
+                    LayoutBlockFlow (anonymous) at (8,2) size 75.78x13
+                      LayoutText {#text} at (0,0) size 76x13
+                        text run at (0,0) width 76: "Search Froogle"
                   LayoutText {#text} at (0,0) size 0x0
-                LayoutTableCell {TD} at (494,0) size 160x18 [r=0 c=3 rs=2 cs=1]
+                LayoutTableCell {TD} at (493,0) size 160x18 [r=0 c=3 rs=2 cs=1]
                   LayoutInline {LABEL} at (0,0) size 116x13
                     LayoutText {#text} at (0,0) size 0x0
                     LayoutBlockFlow {INPUT} at (12.88,3) size 12x12
@@ -29,6 +29,6 @@
                   LayoutText {#text} at (0,0) size 0x0
         LayoutBlockFlow (anonymous) at (0,35) size 784x18
           LayoutBR {BR} at (392,0) size 0x18
-layer at (226,11) size 245x13
+layer at (227,11) size 245x13
   LayoutBlockFlow {DIV} at (3,3) size 245x13
 caret: position 1 of child 0 {#text} of child 1 {TD} of child 0 {TR} of child 1 {TBODY} of child 1 {TABLE} of child 1 {FORM} of child 1 {CENTER} of body
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/vertical-rl-rtl-linebreak-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/text/vertical-rl-rtl-linebreak-expected.png
index f0022f6..8dc2af340 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/vertical-rl-rtl-linebreak-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/vertical-rl-rtl-linebreak-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/wbr-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/text/wbr-expected.png
index c03b7ba..b8571772 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/wbr-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/wbr-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/wbr-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/text/wbr-expected.txt
index fb9b839..b91f301f 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/wbr-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/wbr-expected.txt
@@ -4,8 +4,8 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x788
     LayoutBlockFlow {BODY} at (8,8) size 784x770
       LayoutBlockFlow {P} at (0,0) size 784x18
-        LayoutText {#text} at (0,0) size 175x18
-          text run at (0,0) width 175: "Two words with no spaces."
+        LayoutText {#text} at (0,0) size 174x18
+          text run at (0,0) width 174: "Two words with no spaces."
       LayoutBlockFlow {DIV} at (0,34) size 302x20 [border: (1px solid #0000FF)]
         LayoutText {#text} at (1,1) size 484x18
           text run at (1,1) width 484: "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"
@@ -109,8 +109,8 @@
                   text run at (1,37) width 171: "cccccccccccccccccccccccc"
             LayoutTableCell {TD} at (194,28) size 590x0 [r=0 c=1 rs=1 cs=1]
       LayoutBlockFlow {P} at (0,716) size 784x18
-        LayoutText {#text} at (0,0) size 444x18
-          text run at (0,0) width 444: "Spaces both before and after <wbr> to check for collapsing behavior."
+        LayoutText {#text} at (0,0) size 443x18
+          text run at (0,0) width 443: "Spaces both before and after <wbr> to check for collapsing behavior."
       LayoutBlockFlow {DIV} at (0,750) size 302x20 [border: (1px solid #0000FF)]
         LayoutText {#text} at (1,1) size 26x18
           text run at (1,1) width 26: "aaa "
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/wbr-in-pre-crash-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/text/wbr-in-pre-crash-expected.png
index 54ea878..01acd60 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/wbr-in-pre-crash-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/wbr-in-pre-crash-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/wbr-in-pre-crash-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/text/wbr-in-pre-crash-expected.txt
index eef716e..19606eef 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/wbr-in-pre-crash-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/wbr-in-pre-crash-expected.txt
@@ -4,15 +4,15 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x600
     LayoutBlockFlow {BODY} at (8,8) size 784x584
       LayoutBlockFlow {P} at (0,0) size 784x36
-        LayoutText {#text} at (0,0) size 55x18
-          text run at (0,0) width 55: "Test for "
-        LayoutInline {I} at (0,0) size 773x36
-          LayoutInline {A} at (0,0) size 306x18 [color=#0000EE]
-            LayoutText {#text} at (54,0) size 306x18
-              text run at (54,0) width 306: "http://bugs.webkit.org/show_bug.cgi?id=17464"
-          LayoutText {#text} at (359,0) size 773x36
-            text run at (359,0) width 5: " "
-            text run at (363,0) width 410: "REGRESSION: Crash in LayoutBlockFlow::findNextLineBreak"
+        LayoutText {#text} at (0,0) size 54x18
+          text run at (0,0) width 54: "Test for "
+        LayoutInline {I} at (0,0) size 769x36
+          LayoutInline {A} at (0,0) size 305x18 [color=#0000EE]
+            LayoutText {#text} at (53,0) size 305x18
+              text run at (53,0) width 305: "http://bugs.webkit.org/show_bug.cgi?id=17464"
+          LayoutText {#text} at (357,0) size 769x36
+            text run at (357,0) width 5: " "
+            text run at (361,0) width 408: "REGRESSION: Crash in LayoutBlockFlow::findNextLineBreak"
             text run at (0,18) width 253: "reading r30444 commit email in GMail"
         LayoutText {#text} at (252,18) size 5x18
           text run at (252,18) width 5: "."
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/wbr-styled-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/text/wbr-styled-expected.png
index 478886c..f0433d4 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/wbr-styled-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/wbr-styled-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/wbr-styled-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/text/wbr-styled-expected.txt
index a60c245c..a13fe66 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/wbr-styled-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/wbr-styled-expected.txt
@@ -19,8 +19,8 @@
         LayoutInline {TT} at (0,0) size 63x15
           LayoutText {#text} at (507,2) size 63x15
             text run at (507,2) width 63: "absolute"
-        LayoutText {#text} at (569,0) size 155x18
-          text run at (569,0) width 155: " does not crash WebKit."
+        LayoutText {#text} at (569,0) size 154x18
+          text run at (569,0) width 154: " does not crash WebKit."
       LayoutBlockFlow {P} at (0,34) size 784x18
         LayoutText {#text} at (0,0) size 128x18
           text run at (0,0) width 128: "There should be no "
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/003-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/003-expected.png
index cfdfe0c..3583ac4 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/003-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/003-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/003-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/003-expected.txt
index 0e8008c..930babd 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/003-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/003-expected.txt
@@ -9,8 +9,8 @@
             text run at (0,1) width 528: "Ahem_font_required_for_this_test."
         LayoutText {#text} at (0,0) size 0x0
       LayoutBlockFlow {P} at (0,34) size 784x18
-        LayoutText {#text} at (0,0) size 648x18
-          text run at (0,0) width 648: "There should be three columns below, dark green, light green, and dark green, with no red anywhere."
+        LayoutText {#text} at (0,0) size 647x18
+          text run at (0,0) width 647: "There should be three columns below, dark green, light green, and dark green, with no red anywhere."
       LayoutTable {TABLE} at (0,68) size 66x126 [border: (3px solid #000000)]
         LayoutTableSection {TBODY} at (3,3) size 60x120
           LayoutTableRow {TR} at (0,0) size 60x120
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/004-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/004-expected.png
index cdb936ae..18920fa 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/004-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/004-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/004-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/004-expected.txt
index 22826d1..45410ee 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/004-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/004-expected.txt
@@ -9,8 +9,8 @@
             text run at (0,1) width 528: "Ahem_font_required_for_this_test."
         LayoutText {#text} at (0,0) size 0x0
       LayoutBlockFlow {P} at (0,34) size 784x18
-        LayoutText {#text} at (0,0) size 445x18
-          text run at (0,0) width 445: "There should be no red below, only a green square bordered in green."
+        LayoutText {#text} at (0,0) size 444x18
+          text run at (0,0) width 444: "There should be no red below, only a green square bordered in green."
       LayoutTable {TABLE} at (0,68) size 104x104
         LayoutTableSection {TBODY} at (0,0) size 104x104
           LayoutTableRow {TR} at (0,2) size 104x100
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/005-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/005-expected.png
index e9f6f6c..f6600fa 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/005-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/005-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/005-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/005-expected.txt
index cb19e3b..cece363c 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/005-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/005-expected.txt
@@ -9,8 +9,8 @@
             text run at (0,1) width 528: "Ahem_font_required_for_this_test."
         LayoutText {#text} at (0,0) size 0x0
       LayoutBlockFlow {P} at (0,34) size 784x18
-        LayoutText {#text} at (0,0) size 445x18
-          text run at (0,0) width 445: "There should be no red below, only a green square bordered in green."
+        LayoutText {#text} at (0,0) size 444x18
+          text run at (0,0) width 444: "There should be no red below, only a green square bordered in green."
       LayoutTable {TABLE} at (0,68) size 104x104
         LayoutTableSection {TBODY} at (0,0) size 104x104
           LayoutTableRow {TR} at (0,2) size 104x100
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/006-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/006-expected.png
index 8a58410..9081f91 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/006-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/006-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/006-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/006-expected.txt
index c526b3b..4726628 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/006-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/006-expected.txt
@@ -9,8 +9,8 @@
             text run at (16,1) width 528: "Ahem_font_required_for_this_test."
         LayoutText {#text} at (0,0) size 0x0
       LayoutBlockFlow {P} at (0,34) size 784x18
-        LayoutText {#text} at (0,0) size 504x18
-          text run at (0,0) width 504: "There should be no red below, only three identical striped green and lime bars."
+        LayoutText {#text} at (0,0) size 503x18
+          text run at (0,0) width 503: "There should be no red below, only three identical striped green and lime bars."
       LayoutBlockFlow {DIV} at (20,72) size 744x20
         LayoutInline {SPAN} at (0,0) size 220x20 [color=#800000] [bgcolor=#FF0000]
           LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/007-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/007-expected.png
index f87ea97..750bc76 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/007-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/007-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/007-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/007-expected.txt
index e88ba91..3d71516 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/007-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/007-expected.txt
@@ -9,8 +9,8 @@
             text run at (16,1) width 528: "Ahem_font_required_for_this_test."
         LayoutText {#text} at (0,0) size 0x0
       LayoutBlockFlow {P} at (0,34) size 784x18
-        LayoutText {#text} at (0,0) size 496x18
-          text run at (0,0) width 496: "There should be no red below, only two identical striped green and lime bars."
+        LayoutText {#text} at (0,0) size 495x18
+          text run at (0,0) width 495: "There should be no red below, only two identical striped green and lime bars."
       LayoutBlockFlow {DIV} at (20,72) size 744x20
         LayoutInline {SPAN} at (0,0) size 220x20 [color=#800000] [bgcolor=#FF0000]
           LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/008-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/008-expected.png
index 0194e21..0a6b85a 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/008-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/008-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/008-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/008-expected.txt
index 07a9ca9..401b31f 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/008-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/008-expected.txt
@@ -9,8 +9,8 @@
             text run at (16,1) width 528: "Ahem_font_required_for_this_test."
         LayoutText {#text} at (0,0) size 0x0
       LayoutBlockFlow {P} at (0,34) size 784x18
-        LayoutText {#text} at (0,0) size 289x18
-          text run at (0,0) width 289: "There should be a green block below, no red."
+        LayoutText {#text} at (0,0) size 288x18
+          text run at (0,0) width 288: "There should be a green block below, no red."
       LayoutBlockFlow {DIV} at (20,72) size 80x40 [color=#008000] [bgcolor=#FF0000]
         LayoutText {#text} at (0,0) size 80x40
           text run at (0,0) width 80: "xxxx"
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/009-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/009-expected.png
index e1894f7..9f9721f3c 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/009-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/009-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/009-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/009-expected.txt
index f2a6edab..ccb1a18f 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/009-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/009-expected.txt
@@ -9,8 +9,8 @@
             text run at (0,1) width 528: "Ahem_font_required_for_this_test."
         LayoutText {#text} at (0,0) size 0x0
       LayoutBlockFlow {P} at (0,34) size 784x18
-        LayoutText {#text} at (0,0) size 461x18
-          text run at (0,0) width 461: "There should be no red below, only a lime line with a green square in it."
+        LayoutText {#text} at (0,0) size 460x18
+          text run at (0,0) width 460: "There should be no red below, only a lime line with a green square in it."
       LayoutBlockFlow {DIV} at (0,68) size 784x20
         LayoutBlockFlow {DIV} at (0,0) size 200x20 [bgcolor=#FF0000]
           LayoutBlockFlow {DIV} at (0,0) size 140x20 [color=#00FF00] [bgcolor=#008000]
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/010-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/010-expected.png
index cdb936ae..18920fa 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/010-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/010-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/010-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/010-expected.txt
index 22826d1..45410ee 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/010-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/010-expected.txt
@@ -9,8 +9,8 @@
             text run at (0,1) width 528: "Ahem_font_required_for_this_test."
         LayoutText {#text} at (0,0) size 0x0
       LayoutBlockFlow {P} at (0,34) size 784x18
-        LayoutText {#text} at (0,0) size 445x18
-          text run at (0,0) width 445: "There should be no red below, only a green square bordered in green."
+        LayoutText {#text} at (0,0) size 444x18
+          text run at (0,0) width 444: "There should be no red below, only a green square bordered in green."
       LayoutTable {TABLE} at (0,68) size 104x104
         LayoutTableSection {TBODY} at (0,0) size 104x104
           LayoutTableRow {TR} at (0,2) size 104x100
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/011-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/011-expected.png
index e9f6f6c..f6600fa 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/011-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/011-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/011-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/011-expected.txt
index cb19e3b..cece363c 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/011-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/011-expected.txt
@@ -9,8 +9,8 @@
             text run at (0,1) width 528: "Ahem_font_required_for_this_test."
         LayoutText {#text} at (0,0) size 0x0
       LayoutBlockFlow {P} at (0,34) size 784x18
-        LayoutText {#text} at (0,0) size 445x18
-          text run at (0,0) width 445: "There should be no red below, only a green square bordered in green."
+        LayoutText {#text} at (0,0) size 444x18
+          text run at (0,0) width 444: "There should be no red below, only a green square bordered in green."
       LayoutTable {TABLE} at (0,68) size 104x104
         LayoutTableSection {TBODY} at (0,0) size 104x104
           LayoutTableRow {TR} at (0,2) size 104x100
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/015-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/015-expected.png
index cdb936ae..18920fa 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/015-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/015-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/015-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/015-expected.txt
index 22826d1..45410ee 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/015-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/015-expected.txt
@@ -9,8 +9,8 @@
             text run at (0,1) width 528: "Ahem_font_required_for_this_test."
         LayoutText {#text} at (0,0) size 0x0
       LayoutBlockFlow {P} at (0,34) size 784x18
-        LayoutText {#text} at (0,0) size 445x18
-          text run at (0,0) width 445: "There should be no red below, only a green square bordered in green."
+        LayoutText {#text} at (0,0) size 444x18
+          text run at (0,0) width 444: "There should be no red below, only a green square bordered in green."
       LayoutTable {TABLE} at (0,68) size 104x104
         LayoutTableSection {TBODY} at (0,0) size 104x104
           LayoutTableRow {TR} at (0,2) size 104x100
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/016-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/016-expected.png
index e9f6f6c..f6600fa 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/016-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/016-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/016-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/016-expected.txt
index cb19e3b..cece363c 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/016-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/016-expected.txt
@@ -9,8 +9,8 @@
             text run at (0,1) width 528: "Ahem_font_required_for_this_test."
         LayoutText {#text} at (0,0) size 0x0
       LayoutBlockFlow {P} at (0,34) size 784x18
-        LayoutText {#text} at (0,0) size 445x18
-          text run at (0,0) width 445: "There should be no red below, only a green square bordered in green."
+        LayoutText {#text} at (0,0) size 444x18
+          text run at (0,0) width 444: "There should be no red below, only a green square bordered in green."
       LayoutTable {TABLE} at (0,68) size 104x104
         LayoutTableSection {TBODY} at (0,0) size 104x104
           LayoutTableRow {TR} at (0,2) size 104x100
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/018-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/018-expected.png
index 4bc47d45..605afc2 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/018-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/018-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/018-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/018-expected.txt
index f9694e69..d901f523 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/018-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/018-expected.txt
@@ -9,8 +9,8 @@
             text run at (0,1) width 528: "Ahem_font_required_for_this_test."
         LayoutText {#text} at (0,0) size 0x0
       LayoutBlockFlow {P} at (0,34) size 784x18
-        LayoutText {#text} at (0,0) size 602x18
-          text run at (0,0) width 602: "There should be a pretty green and lime pattern and the word \"PASS\" in lime on white below."
+        LayoutText {#text} at (0,0) size 599x18
+          text run at (0,0) width 599: "There should be a pretty green and lime pattern and the word \"PASS\" in lime on white below."
       LayoutBlockFlow {DIV} at (0,68) size 304x128 [color=#00FF00] [bgcolor=#008000]
         LayoutText {#text} at (0,0) size 304x32
           text run at (0,0) width 0: " "
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/020-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/020-expected.png
index 6e1d053..2b18607 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/020-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/020-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/020-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/020-expected.txt
index ca19b1f..9fc14816 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/020-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/020-expected.txt
@@ -4,7 +4,7 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x600
     LayoutBlockFlow {BODY} at (8,8) size 784x584
       LayoutBlockFlow {DIV} at (0,0) size 204x43 [border: (2px solid #FF0000)]
-        LayoutInline {FONT} at (0,0) size 179x36 [color=#996699]
+        LayoutInline {FONT} at (0,0) size 178x36 [color=#996699]
           LayoutText {#text} at (0,0) size 0x0
           LayoutInline {NOBR} at (0,0) size 152x18
             LayoutText {#text} at (2,2) size 10x18
@@ -15,17 +15,17 @@
             LayoutText {#text} at (133,2) size 21x18
               text run at (133,2) width 21: "     "
           LayoutText {#text} at (0,0) size 0x0
-          LayoutInline {NOBR} at (0,0) size 179x18
+          LayoutInline {NOBR} at (0,0) size 178x18
             LayoutText {#text} at (2,20) size 10x18
               text run at (2,20) width 10: "\x{2022} "
-            LayoutInline {A} at (0,0) size 150x18 [color=#0000EE]
-              LayoutText {#text} at (11,20) size 135x18
-                text run at (11,20) width 135: "1-800-las-flores.com"
+            LayoutInline {A} at (0,0) size 149x18 [color=#0000EE]
+              LayoutText {#text} at (11,20) size 134x18
+                text run at (11,20) width 134: "1-800-las-flores.com"
               LayoutInline {SUB} at (0,0) size 16x15
-                LayoutText {#text} at (145,26) size 16x15
-                  text run at (145,26) width 16: "sm"
-            LayoutText {#text} at (160,20) size 21x18
-              text run at (160,20) width 21: "     "
+                LayoutText {#text} at (144,26) size 16x15
+                  text run at (144,26) width 16: "sm"
+            LayoutText {#text} at (160,20) size 20x18
+              text run at (160,20) width 20: "     "
           LayoutText {#text} at (0,0) size 0x0
       LayoutBlockFlow (anonymous) at (0,43) size 784x0
         LayoutInline {FONT} at (0,0) size 0x0 [color=#996699]
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/021-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/021-expected.png
index d8b06c4..458ed2a 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/021-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/021-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/021-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/021-expected.txt
index 969c6a3..0b7f9b8e 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/021-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/021-expected.txt
@@ -7,12 +7,12 @@
         LayoutTableSection {TBODY} at (0,0) size 450x60
           LayoutTableRow {TR} at (0,2) size 450x56
             LayoutTableCell {TD} at (2,2) size 446x56 [bgcolor=#CCCC44] [r=0 c=0 rs=1 cs=1]
-              LayoutText {#text} at (1,1) size 428x36
-                text run at (1,1) width 428: "This stuff should all be within the table boundaries, and not off the"
+              LayoutText {#text} at (1,1) size 427x36
+                text run at (1,1) width 427: "This stuff should all be within the table boundaries, and not off the"
                 text run at (1,19) width 39: "edge. "
                 text run at (39,19) width 329: "No way should it be off the edge of the damn table."
-              LayoutInline {SPAN} at (0,0) size 206x18
+              LayoutInline {SPAN} at (0,0) size 205x18
                 LayoutImage {IMG} at (1,51) size 50x0
-                LayoutText {#text} at (51,37) size 156x18
-                  text run at (51,37) width 156: "oh, no I fell off the edge"
+                LayoutText {#text} at (51,37) size 155x18
+                  text run at (51,37) width 155: "oh, no I fell off the edge"
               LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/024-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/024-expected.png
index 32c5af4..4174e945 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/024-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/024-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/024-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/024-expected.txt
index 059493c..d5ffc64 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/024-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/024-expected.txt
@@ -19,7 +19,7 @@
           text run at (0,18) width 286: "If a nested container element is preceded by "
           text run at (285,18) width 449: "uncontained text and a blank line, and there are \"too many\" characters"
           text run at (0,36) width 419: "contained in the nested element, the PRE width will be too wide. "
-          text run at (418,36) width 343: "In the examples below, the nested element is a SPAN"
+          text run at (418,36) width 341: "In the examples below, the nested element is a SPAN"
           text run at (0,54) width 96: "whose content "
           text run at (95,54) width 233: "is the days-of-week line, as follows:"
       LayoutBlockFlow {PRE} at (0,143.44) size 769x15
@@ -169,10 +169,10 @@
                   text run at (163,128) width 1: " "
                   text run at (7,143) width 63: "28 29 30"
             LayoutTableCell {TD} at (178,2) size 589x38 [r=0 c=1 rs=1 cs=1]
-              LayoutText {#text} at (1,1) size 586x36
+              LayoutText {#text} at (1,1) size 585x36
                 text run at (1,1) width 346: "The blank line between '2003' and the nested element "
                 text run at (346,1) width 211: "no longer triggers the width bug,"
                 text run at (1,19) width 289: "because now the '2003' is itself contained by "
-                text run at (289,19) width 298: "a nested element (in this case, another SPAN)."
+                text run at (289,19) width 297: "a nested element (in this case, another SPAN)."
       LayoutBlockFlow (anonymous) at (0,1152.69) size 769x18
         LayoutBR {BR} at (0,0) size 0x18
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/027-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/027-expected.png
index e11f2706..182e9c04 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/027-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/027-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/027-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/027-expected.txt
index be9e105..1c25244 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/027-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/027-expected.txt
@@ -42,15 +42,15 @@
       LayoutTable {TABLE} at (0,416) size 784x66 [border: (2px outset #808080)]
         LayoutTableSection {TBODY} at (2,2) size 780x62
           LayoutTableRow {TR} at (0,2) size 780x58
-            LayoutTableCell {TD} at (2,2) size 586x58 [border: (1px inset #808080)] [r=0 c=0 rs=1 cs=1]
+            LayoutTableCell {TD} at (2,2) size 584x58 [border: (1px inset #808080)] [r=0 c=0 rs=1 cs=1]
               LayoutText {#text} at (2,2) size 136x18
                 text run at (2,2) width 136: "This is a test to see if"
-              LayoutInline {SPAN} at (0,0) size 582x54
-                LayoutText {#text} at (137,2) size 582x54
+              LayoutInline {SPAN} at (0,0) size 580x54
+                LayoutText {#text} at (137,2) size 580x54
                   text run at (137,2) width 105: "this is computed"
                   text run at (241,2) width 1: " "
-                  text run at (2,20) width 582: "correctly.  In particular, we have a really long line here that could throw off the min-width."
-                  text run at (583,20) width 1: " "
+                  text run at (2,20) width 580: "correctly.  In particular, we have a really long line here that could throw off the min-width."
+                  text run at (581,20) width 1: " "
                   text run at (2,38) width 32: "Is it?"
               LayoutText {#text} at (0,0) size 0x0
-            LayoutTableCell {TD} at (590,29) size 188x4 [border: (1px inset #808080)] [r=0 c=1 rs=1 cs=1]
+            LayoutTableCell {TD} at (588,29) size 190x4 [border: (1px inset #808080)] [r=0 c=1 rs=1 cs=1]
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/030-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/030-expected.png
index 4a996b4..316d045 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/030-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/030-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/030-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/030-expected.txt
index 39d1c5b..8c5b1af 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/030-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/030-expected.txt
@@ -8,7 +8,7 @@
           text run at (2,2) width 133: "I am on one line."
           text run at (134,2) width 1: " "
       LayoutBlockFlow {DIV} at (0,32) size 784x40 [border: (2px solid #008000)]
-        LayoutText {#text} at (2,2) size 772x36
+        LayoutText {#text} at (2,2) size 771x36
           text run at (2,2) width 0: " "
-          text run at (2,20) width 772: "This div is two lines.  The newline right after the tag opened is significant and is honored by Firefox and Opera (and us)."
-          text run at (773,20) width 1: " "
+          text run at (2,20) width 771: "This div is two lines.  The newline right after the tag opened is significant and is honored by Firefox and Opera (and us)."
+          text run at (772,20) width 1: " "
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/pre-break-word-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/pre-break-word-expected.png
index ea3ad3e1..1918777 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/pre-break-word-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/pre-break-word-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/pre-break-word-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/pre-break-word-expected.txt
index c736df5b..1d28b57 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/pre-break-word-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/pre-break-word-expected.txt
@@ -11,4 +11,4 @@
           text run at (2,56) width 148: "rap to multiple lines be"
           text run at (2,74) width 143: "cause of the word-wra"
           text run at (2,92) width 144: "p:break-word CSS pro"
-          text run at (2,110) width 37: "perty."
+          text run at (2,110) width 36: "perty."
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/pre-wrap-last-char-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/pre-wrap-last-char-expected.png
index a28aa9d..bd6bcb04c 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/pre-wrap-last-char-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/pre-wrap-last-char-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/pre-wrap-last-char-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/pre-wrap-last-char-expected.txt
index 8e59f29..9165d6cc 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/pre-wrap-last-char-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/pre-wrap-last-char-expected.txt
@@ -4,15 +4,15 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x600
     LayoutBlockFlow {BODY} at (8,8) size 784x584
       LayoutBlockFlow {P} at (0,0) size 784x36
-        LayoutText {#text} at (0,0) size 55x18
-          text run at (0,0) width 55: "Test for "
-        LayoutInline {I} at (0,0) size 765x36
-          LayoutInline {A} at (0,0) size 306x18 [color=#0000EE]
-            LayoutText {#text} at (54,0) size 306x18
-              text run at (54,0) width 306: "http://bugs.webkit.org/show_bug.cgi?id=13072"
-          LayoutText {#text} at (359,0) size 765x36
-            text run at (359,0) width 5: " "
-            text run at (363,0) width 402: "REGRESSION (r15617): white-space: pre-wrap breaks off the"
+        LayoutText {#text} at (0,0) size 54x18
+          text run at (0,0) width 54: "Test for "
+        LayoutInline {I} at (0,0) size 762x36
+          LayoutInline {A} at (0,0) size 305x18 [color=#0000EE]
+            LayoutText {#text} at (53,0) size 305x18
+              text run at (53,0) width 305: "http://bugs.webkit.org/show_bug.cgi?id=13072"
+          LayoutText {#text} at (357,0) size 762x36
+            text run at (357,0) width 5: " "
+            text run at (361,0) width 401: "REGRESSION (r15617): white-space: pre-wrap breaks off the"
             text run at (0,18) width 189: "last character of a wide word"
         LayoutText {#text} at (188,18) size 5x18
           text run at (188,18) width 5: "."
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/pre-wrap-line-test-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/pre-wrap-line-test-expected.png
index 3629e3b..3c5b765 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/pre-wrap-line-test-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/pre-wrap-line-test-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/pre-wrap-line-test-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/pre-wrap-line-test-expected.txt
index 20a0bf11..a2db4d8 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/pre-wrap-line-test-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/pre-wrap-line-test-expected.txt
@@ -9,8 +9,8 @@
             LayoutTableCell {TD} at (2,2) size 780x56 [r=0 c=0 rs=1 cs=1]
               LayoutBlockFlow {DIV} at (1,1) size 778x54
                 LayoutText {#text} at (0,0) size 778x54
-                  text run at (0,0) width 756: "Three cheers    for OldVet and the letter he wrote to Senator Dodd (see above Comment).  We all need to be proactive"
-                  text run at (755,0) width 5: " "
+                  text run at (0,0) width 753: "Three cheers    for OldVet and the letter he wrote to Senator Dodd (see above Comment).  We all need to be proactive"
+                  text run at (752,0) width 5: " "
                   text run at (0,18) width 775: "and contact our senators and representatives to let them know our strong feelings on this subject.  I would lose what little"
                   text run at (774,18) width 4: " "
                   text run at (0,36) width 471: "faith I have left in our government if they engineered a tax payer bailout. "
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/pre-wrap-overflow-selection-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/pre-wrap-overflow-selection-expected.png
index 9d41006..89e527817 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/pre-wrap-overflow-selection-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/pre-wrap-overflow-selection-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/pre-wrap-overflow-selection-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/pre-wrap-overflow-selection-expected.txt
index 06d7c1c..09a0e9c 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/pre-wrap-overflow-selection-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/pre-wrap-overflow-selection-expected.txt
@@ -6,15 +6,15 @@
       LayoutBlockFlow {P} at (0,0) size 784x36
         LayoutText {#text} at (0,0) size 260x18
           text run at (0,0) width 260: "This test checks for a regression against "
-        LayoutInline {I} at (0,0) size 747x36
-          LayoutInline {A} at (0,0) size 354x18 [color=#0000EE]
-            LayoutText {#text} at (259,0) size 354x18
-              text run at (259,0) width 354: "http://bugzilla.opendarwin.org/show_bug.cgi?id=5619"
-          LayoutText {#text} at (612,0) size 747x36
-            text run at (612,0) width 135: " CSS2: pre-wrap has"
-            text run at (0,18) width 181: "overflow/selection problems"
-        LayoutText {#text} at (180,18) size 5x18
-          text run at (180,18) width 5: "."
+        LayoutInline {I} at (0,0) size 746x36
+          LayoutInline {A} at (0,0) size 353x18 [color=#0000EE]
+            LayoutText {#text} at (259,0) size 353x18
+              text run at (259,0) width 353: "http://bugzilla.opendarwin.org/show_bug.cgi?id=5619"
+          LayoutText {#text} at (611,0) size 746x36
+            text run at (611,0) width 135: " CSS2: pre-wrap has"
+            text run at (0,18) width 180: "overflow/selection problems"
+        LayoutText {#text} at (179,18) size 5x18
+          text run at (179,18) width 5: "."
       LayoutBlockFlow {P} at (0,52) size 784x18
         LayoutText {#text} at (0,0) size 707x18
           text run at (0,0) width 707: "Both boxes should not have scroll bars. The selection should not spill out of the blue box to the right of \x{201C}text\x{201D}."
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/pre-wrap-spaces-after-newline-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/pre-wrap-spaces-after-newline-expected.png
index 7bde581..86af463 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/pre-wrap-spaces-after-newline-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/pre-wrap-spaces-after-newline-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/pre-wrap-spaces-after-newline-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/pre-wrap-spaces-after-newline-expected.txt
index 42eec3c8..68e9a18 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/pre-wrap-spaces-after-newline-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/pre-wrap-spaces-after-newline-expected.txt
@@ -4,15 +4,15 @@
   LayoutBlockFlow {HTML} at (0,0) size 785x781
     LayoutBlockFlow {BODY} at (8,8) size 769x760
       LayoutBlockFlow {P} at (0,0) size 769x36
-        LayoutText {#text} at (0,0) size 55x18
-          text run at (0,0) width 55: "Test for "
-        LayoutInline {I} at (0,0) size 748x36
-          LayoutInline {A} at (0,0) size 354x18 [color=#0000EE]
-            LayoutText {#text} at (54,0) size 354x18
-              text run at (54,0) width 354: "http://bugzilla.opendarwin.org/show_bug.cgi?id=7216"
-          LayoutText {#text} at (407,0) size 748x36
-            text run at (407,0) width 5: " "
-            text run at (411,0) width 337: "white-space: pre-wrap collapses leading whitespace"
+        LayoutText {#text} at (0,0) size 54x18
+          text run at (0,0) width 54: "Test for "
+        LayoutInline {I} at (0,0) size 746x36
+          LayoutInline {A} at (0,0) size 353x18 [color=#0000EE]
+            LayoutText {#text} at (53,0) size 353x18
+              text run at (53,0) width 353: "http://bugzilla.opendarwin.org/show_bug.cgi?id=7216"
+          LayoutText {#text} at (405,0) size 746x36
+            text run at (405,0) width 5: " "
+            text run at (409,0) width 337: "white-space: pre-wrap collapses leading whitespace"
             text run at (0,18) width 127: "following a newline"
         LayoutText {#text} at (126,18) size 5x18
           text run at (126,18) width 5: "."
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/span-in-word-space-causes-overflow-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/span-in-word-space-causes-overflow-expected.png
index 52e5d360..8ab67e13 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/span-in-word-space-causes-overflow-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/span-in-word-space-causes-overflow-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/span-in-word-space-causes-overflow-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/span-in-word-space-causes-overflow-expected.txt
index 5362c09..51df42ef 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/span-in-word-space-causes-overflow-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/whitespace/span-in-word-space-causes-overflow-expected.txt
@@ -6,8 +6,8 @@
       LayoutBlockFlow {DIV} at (0,0) size 200x36 [bgcolor=#FFFF00]
         LayoutText {#text} at (0,0) size 152x18
           text run at (0,0) width 152: "Overflow should "
-        LayoutInline {SPAN} at (0,0) size 22x18
-          LayoutText {#text} at (151,0) size 22x18
-            text run at (151,0) width 22: "not"
+        LayoutInline {SPAN} at (0,0) size 21x18
+          LayoutText {#text} at (151,0) size 21x18
+            text run at (151,0) width 21: "not"
         LayoutText {#text} at (0,18) size 154x18
           text run at (0,18) width 154: "even be tolerated."
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/wide-zero-width-space-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/text/wide-zero-width-space-expected.png
index 183beab..f0e8e26 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/wide-zero-width-space-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/wide-zero-width-space-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/wide-zero-width-space-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/text/wide-zero-width-space-expected.txt
index a127611..b4001ebd 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/wide-zero-width-space-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/wide-zero-width-space-expected.txt
@@ -4,17 +4,17 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x600
     LayoutBlockFlow {BODY} at (8,8) size 784x584
       LayoutBlockFlow {P} at (0,0) size 784x18
-        LayoutText {#text} at (0,0) size 55x18
-          text run at (0,0) width 55: "Test for "
-        LayoutInline {I} at (0,0) size 611x18
-          LayoutInline {A} at (0,0) size 306x18 [color=#0000EE]
-            LayoutText {#text} at (54,0) size 306x18
-              text run at (54,0) width 306: "http://bugs.webkit.org/show_bug.cgi?id=13178"
-          LayoutText {#text} at (359,0) size 306x18
-            text run at (359,0) width 5: " "
-            text run at (363,0) width 302: "Helvetica zero-width space has non-zero width"
-        LayoutText {#text} at (664,0) size 5x18
-          text run at (664,0) width 5: "."
+        LayoutText {#text} at (0,0) size 54x18
+          text run at (0,0) width 54: "Test for "
+        LayoutInline {I} at (0,0) size 609x18
+          LayoutInline {A} at (0,0) size 305x18 [color=#0000EE]
+            LayoutText {#text} at (53,0) size 305x18
+              text run at (53,0) width 305: "http://bugs.webkit.org/show_bug.cgi?id=13178"
+          LayoutText {#text} at (357,0) size 305x18
+            text run at (357,0) width 5: " "
+            text run at (361,0) width 301: "Helvetica zero-width space has non-zero width"
+        LayoutText {#text} at (661,0) size 5x18
+          text run at (661,0) width 5: "."
       LayoutBlockFlow {P} at (0,34) size 784x18
         LayoutText {#text} at (0,0) size 275x18
           text run at (0,0) width 275: "The following lines should all be identical."
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/word-break-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/text/word-break-expected.png
index 8a99a7b3..c6ae3c0f 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/word-break-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/word-break-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/word-break-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/text/word-break-expected.txt
index 735a31a..8d7fe45 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/word-break-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/word-break-expected.txt
@@ -30,9 +30,9 @@
           text run at (441,5) width 1: " "
       LayoutBlockFlow (anonymous) at (0,209) size 769x72
         LayoutBR {BR} at (0,0) size 0x18
-        LayoutText {#text} at (0,18) size 753x54
+        LayoutText {#text} at (0,18) size 751x54
           text run at (0,18) width 476: "The next two examples test our custom break-word value for word-break. "
-          text run at (475,18) width 278: "We should get the same results as break-all"
+          text run at (475,18) width 276: "We should get the same results as break-all"
           text run at (0,36) width 738: "for the first test, but we should break up the word in the second test (since our behavior matches word-wrap: break-"
           text run at (0,54) width 119: "word in that case)."
       LayoutTable {TABLE} at (0,281) size 769x104 [border: (1px outset #808080)]
@@ -62,8 +62,8 @@
       LayoutBlockFlow (anonymous) at (0,514) size 769x72
         LayoutBR {BR} at (0,0) size 0x18
         LayoutText {#text} at (0,18) size 750x54
-          text run at (0,18) width 641: "This test makes sure floating and positioned elements do the right thing with word-break: break-all. "
-          text run at (640,18) width 92: "The minimum"
+          text run at (0,18) width 640: "This test makes sure floating and positioned elements do the right thing with word-break: break-all. "
+          text run at (639,18) width 92: "The minimum"
           text run at (0,36) width 345: "width should be less than the containing block width. "
           text run at (344,36) width 406: "The breaking should be \"dumb\" and just occur when the end of"
           text run at (0,54) width 88: "the line is hit."
@@ -78,12 +78,12 @@
         LayoutBR {BR} at (0,0) size 0x18
       LayoutBlockFlow (anonymous) at (0,757) size 769x72
         LayoutBR {BR} at (0,0) size 0x18
-        LayoutText {#text} at (0,18) size 749x54
-          text run at (0,18) width 658: "This test makes sure floating and positioned elements do the right thing with word-break: break-word. "
-          text run at (657,18) width 92: "The minimum"
+        LayoutText {#text} at (0,18) size 748x54
+          text run at (0,18) width 657: "This test makes sure floating and positioned elements do the right thing with word-break: break-word. "
+          text run at (656,18) width 92: "The minimum"
           text run at (0,36) width 345: "width should be less than the containing block width. "
           text run at (344,36) width 402: "The breaking should be \"smart\" and be like word-wrap: break-"
-          text run at (0,54) width 581: "word, with words preferring to wrap first before allowing break opportunities within them."
+          text run at (0,54) width 580: "word, with words preferring to wrap first before allowing break opportunities within them."
       LayoutBlockFlow {DIV} at (0,829) size 304x49 [border: (2px solid #000000)]
         LayoutBlockFlow (floating) {DIV} at (2,2) size 300x45
           LayoutText {#text} at (0,0) size 250x45
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/word-break-run-rounding-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/text/word-break-run-rounding-expected.png
index e2c2132..4e6f5acf 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/word-break-run-rounding-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/word-break-run-rounding-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/word-break-run-rounding-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/text/word-break-run-rounding-expected.txt
index 924ac64..f0acfcf 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/word-break-run-rounding-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/word-break-run-rounding-expected.txt
@@ -4,34 +4,34 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x600
     LayoutBlockFlow {BODY} at (8,8) size 784x584
       LayoutBlockFlow {P} at (0,0) size 784x18
-        LayoutText {#text} at (0,0) size 61x18
-          text run at (0,0) width 61: "Tests for "
-        LayoutInline {I} at (0,0) size 716x18
+        LayoutText {#text} at (0,0) size 60x18
+          text run at (0,0) width 60: "Tests for "
+        LayoutInline {I} at (0,0) size 712x18
           LayoutInline {A} at (0,0) size 306x18 [color=#0000EE]
-            LayoutText {#text} at (60,0) size 306x18
-              text run at (60,0) width 306: "http://bugs.webkit.org/show_bug.cgi?id=13438"
-          LayoutText {#text} at (365,0) size 411x18
-            text run at (365,0) width 5: " "
-            text run at (369,0) width 407: "Run rounding makes word-break:break-all/word not functional"
-        LayoutText {#text} at (775,0) size 5x18
-          text run at (775,0) width 5: "."
+            LayoutText {#text} at (59,0) size 306x18
+              text run at (59,0) width 306: "http://bugs.webkit.org/show_bug.cgi?id=13438"
+          LayoutText {#text} at (364,0) size 407x18
+            text run at (364,0) width 5: " "
+            text run at (368,0) width 403: "Run rounding makes word-break:break-all/word not functional"
+        LayoutText {#text} at (770,0) size 5x18
+          text run at (770,0) width 5: "."
       LayoutBlockFlow {P} at (0,34) size 784x18
-        LayoutText {#text} at (0,0) size 316x18
-          text run at (0,0) width 316: "Test that the preferred (maximum) width is right:"
+        LayoutText {#text} at (0,0) size 314x18
+          text run at (0,0) width 314: "Test that the preferred (maximum) width is right:"
       LayoutBlockFlow (anonymous) at (0,68) size 784x24
         LayoutBlockFlow (floating) {DIV} at (0,0) size 732.52x24 [border: (3px solid #000000)]
           LayoutText {#text} at (3,3) size 727x18
             text run at (3,3) width 727: "The black border should fit tightly around this one line of text with no space after the period."
         LayoutBR {BR} at (732,0) size 1x18
       LayoutBlockFlow {P} at (0,108) size 784x18
-        LayoutText {#text} at (0,0) size 389x18
-          text run at (0,0) width 389: "Test that text does not wrap too early due to rounding errors:"
+        LayoutText {#text} at (0,0) size 388x18
+          text run at (0,0) width 388: "Test that text does not wrap too early due to rounding errors:"
       LayoutBlockFlow {DIV} at (0,142) size 431x24 [border: (3px solid #000000)]
         LayoutText {#text} at (3,3) size 422x18
           text run at (3,3) width 422: "This text fits nicely on a single line of the given width."
       LayoutBlockFlow {P} at (0,182) size 784x18
-        LayoutText {#text} at (0,0) size 234x18
-          text run at (0,0) width 234: "Test that text does not wrap too late:"
+        LayoutText {#text} at (0,0) size 233x18
+          text run at (0,0) width 233: "Test that text does not wrap too late:"
       LayoutBlockFlow {DIV} at (0,216) size 597x42 [border: (3px solid #000000)]
         LayoutText {#text} at (3,3) size 584x36
           text run at (3,3) width 485: "J u s t a b u n c h o f l e t t e r s h e r e , n o t h i n g t o s e e . "
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/word-break-soft-hyphen-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/text/word-break-soft-hyphen-expected.png
index 231097b..0469ce0 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/word-break-soft-hyphen-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/word-break-soft-hyphen-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/word-break-soft-hyphen-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/text/word-break-soft-hyphen-expected.txt
index 07e1a78..57296da7 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/word-break-soft-hyphen-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/word-break-soft-hyphen-expected.txt
@@ -4,22 +4,22 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x600
     LayoutBlockFlow {BODY} at (8,8) size 784x576
       LayoutBlockFlow {P} at (0,0) size 784x36
-        LayoutText {#text} at (0,0) size 55x18
-          text run at (0,0) width 55: "Test for "
-        LayoutInline {I} at (0,0) size 761x36
-          LayoutInline {A} at (0,0) size 306x18 [color=#0000EE]
-            LayoutText {#text} at (54,0) size 306x18
-              text run at (54,0) width 306: "http://bugs.webkit.org/show_bug.cgi?id=15367"
-          LayoutText {#text} at (359,0) size 761x36
-            text run at (359,0) width 5: " "
-            text run at (363,0) width 398: "Assertion failure inspecting a document including soft hyphen"
+        LayoutText {#text} at (0,0) size 54x18
+          text run at (0,0) width 54: "Test for "
+        LayoutInline {I} at (0,0) size 759x36
+          LayoutInline {A} at (0,0) size 305x18 [color=#0000EE]
+            LayoutText {#text} at (53,0) size 305x18
+              text run at (53,0) width 305: "http://bugs.webkit.org/show_bug.cgi?id=15367"
+          LayoutText {#text} at (357,0) size 759x36
+            text run at (357,0) width 5: " "
+            text run at (361,0) width 398: "Assertion failure inspecting a document including soft hyphen"
             text run at (0,18) width 76: "code (0xad)"
         LayoutText {#text} at (75,18) size 5x18
           text run at (75,18) width 5: "."
       LayoutBlockFlow {P} at (0,52) size 784x18
-        LayoutText {#text} at (0,0) size 499x18
-          text run at (0,0) width 499: "The following text should not wrap and the border should fit tightly around it."
+        LayoutText {#text} at (0,0) size 498x18
+          text run at (0,0) width 498: "The following text should not wrap and the border should fit tightly around it."
 layer at (8,94) size 117x24
   LayoutBlockFlow (positioned) {DIV} at (8,94) size 116.66x24 [border: (3px solid #000000)]
-    LayoutText {#text} at (3,3) size 111x18
-      text run at (3,3) width 111: "Two soft\x{AD}hyp\x{AD}hens"
+    LayoutText {#text} at (3,3) size 110x18
+      text run at (3,3) width 110: "Two soft\x{AD}hyp\x{AD}hens"
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/word-space-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/text/word-space-expected.png
index a70c1f18..14ec44a3 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/word-space-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/word-space-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/word-space-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/text/word-space-expected.txt
index 2e366802..427264f4 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/word-space-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/word-space-expected.txt
@@ -4,15 +4,15 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x600
     LayoutBlockFlow {BODY} at (8,8) size 784x576
       LayoutBlockFlow {P} at (0,0) size 784x36
-        LayoutText {#text} at (0,0) size 55x18
-          text run at (0,0) width 55: "Test for "
-        LayoutInline {I} at (0,0) size 767x36
-          LayoutInline {A} at (0,0) size 306x18 [color=#0000EE]
-            LayoutText {#text} at (54,0) size 306x18
-              text run at (54,0) width 306: "http://bugs.webkit.org/show_bug.cgi?id=15259"
-          LayoutText {#text} at (359,0) size 767x36
-            text run at (359,0) width 5: " "
-            text run at (363,0) width 404: "REGRESSION:Text overflows if a empty <td> is followed by a"
+        LayoutText {#text} at (0,0) size 54x18
+          text run at (0,0) width 54: "Test for "
+        LayoutInline {I} at (0,0) size 763x36
+          LayoutInline {A} at (0,0) size 305x18 [color=#0000EE]
+            LayoutText {#text} at (53,0) size 305x18
+              text run at (53,0) width 305: "http://bugs.webkit.org/show_bug.cgi?id=15259"
+          LayoutText {#text} at (357,0) size 763x36
+            text run at (357,0) width 5: " "
+            text run at (361,0) width 402: "REGRESSION:Text overflows if a empty <td> is followed by a"
             text run at (0,18) width 136: "<td align=\"center\">"
         LayoutText {#text} at (135,18) size 5x18
           text run at (135,18) width 5: "."
@@ -20,11 +20,11 @@
         LayoutText {#text} at (0,0) size 267x18
           text run at (0,0) width 267: "The next 7 lines should all look the same."
       LayoutBlockFlow (floating) {DIV} at (0,86) size 82.23x24 [border: (3px solid #000000)]
-        LayoutText {#text} at (3,3) size 77x18
-          text run at (3,3) width 77: "A B"
+        LayoutText {#text} at (3,3) size 76x18
+          text run at (3,3) width 76: "A B"
       LayoutBlockFlow (floating) {DIV} at (0,110) size 82.23x24 [border: (3px solid #000000)]
-        LayoutText {#text} at (3,3) size 77x18
-          text run at (3,3) width 77: "A B"
+        LayoutText {#text} at (3,3) size 76x18
+          text run at (3,3) width 76: "A B"
       LayoutBlockFlow (floating) {DIV} at (0,134) size 82.23x24 [border: (3px solid #000000)]
         LayoutInline {SPAN} at (0,0) size 12x18
           LayoutText {#text} at (3,3) size 12x18
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/zero-font-size-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/text/zero-font-size-expected.png
index 0a629d9..520030e 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/zero-font-size-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/zero-font-size-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/text/zero-font-size-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/text/zero-font-size-expected.txt
index 11d8f29..50ba2ec 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/text/zero-font-size-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/text/zero-font-size-expected.txt
@@ -4,8 +4,8 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x600
     LayoutBlockFlow {BODY} at (8,8) size 784x584
       LayoutBlockFlow {P} at (0,0) size 784x36
-        LayoutText {#text} at (0,0) size 763x36
-          text run at (0,0) width 763: "Test that text with 0px font size is not displayed, even if a non-zero minimum font size setting is specified. On success,"
+        LayoutText {#text} at (0,0) size 761x36
+          text run at (0,0) width 761: "Test that text with 0px font size is not displayed, even if a non-zero minimum font size setting is specified. On success,"
           text run at (0,18) width 370: "this paragraph should be the only text visible on the page."
       LayoutBlockFlow {DIV} at (0,52) size 784x0 [color=#FF0000]
         LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/writing-mode/broken-ideograph-small-caps-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/writing-mode/broken-ideograph-small-caps-expected.png
index 4d47284ae..6005f99 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/writing-mode/broken-ideograph-small-caps-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/writing-mode/broken-ideograph-small-caps-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/writing-mode/broken-ideographic-font-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/writing-mode/broken-ideographic-font-expected.png
index 3419f52b..d149c926 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/writing-mode/broken-ideographic-font-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/writing-mode/broken-ideographic-font-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/writing-mode/vertical-font-fallback-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/writing-mode/vertical-font-fallback-expected.png
index f6f591a..f75e157 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/writing-mode/vertical-font-fallback-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/writing-mode/vertical-font-fallback-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/printing/iframe-print-expected.png b/third_party/WebKit/LayoutTests/platform/mac/printing/iframe-print-expected.png
index 7dc4c60..c94a85f0 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/printing/iframe-print-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/printing/iframe-print-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/virtual/threaded/printing/iframe-print-expected.png b/third_party/WebKit/LayoutTests/platform/mac/virtual/threaded/printing/iframe-print-expected.png
index 7dc4c60..c94a85f0 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/virtual/threaded/printing/iframe-print-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/virtual/threaded/printing/iframe-print-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win-xp/fast/text/drawBidiText-expected.png b/third_party/WebKit/LayoutTests/platform/win-xp/fast/text/drawBidiText-expected.png
index f89de8c..4421d57 100644
--- a/third_party/WebKit/LayoutTests/platform/win-xp/fast/text/drawBidiText-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win-xp/fast/text/drawBidiText-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win-xp/fast/text/drawBidiText-expected.txt b/third_party/WebKit/LayoutTests/platform/win-xp/fast/text/drawBidiText-expected.txt
index 7fb684b..478bbbc 100644
--- a/third_party/WebKit/LayoutTests/platform/win-xp/fast/text/drawBidiText-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win-xp/fast/text/drawBidiText-expected.txt
@@ -6,7 +6,7 @@
       LayoutBlockFlow {P} at (0,0) size 784x20
         LayoutText {#text} at (0,0) size 264x19
           text run at (0,0) width 264: "This tests GraphicsContext::drawBidiText()."
-layer at (8,44) size 327x209 clip at (9,45) size 310x207
+layer at (8,44) size 327x209 clip at (9,45) size 310x207 scrollHeight 209
   LayoutListBox {SELECT} at (0,36) size 327x209 [bgcolor=#FFFFFF] [border: (1px solid #A9A9A9)]
     LayoutBlockFlow {OPTION} at (1,1) size 310x23
       LayoutText {#text} at (2,0) size 199x21
@@ -37,18 +37,18 @@
     LayoutBlockFlow {OPTION} at (1,139) size 310x23
       LayoutText {#text} at (2,0) size 127x21
         text run at (2,0) width 127: "Et volia\x{300}: ATSUI!"
-    LayoutBlockFlow {OPTION} at (1,162) size 310x23
-      LayoutText {#text} at (2,0) size 282x21
-        text run at (2,0) width 90: "Directional "
-        text run at (92,0) width 74 RTL override: "\x{202E}overrides"
-        text run at (166,0) width 118: "\x{202C} are confusing."
-    LayoutBlockFlow {OPTION} at (1,185) size 310x23
-      LayoutText {#text} at (2,0) size 306x21
-        text run at (2,0) width 82: "She said \x{201C}"
-        text run at (84,0) width 67 RTL: " \x{5D1}\x{5DE}\x{5D6}\x{5D5}\x{5D5}\x{5D3}\x{5D4}!"
-        text run at (151,0) width 37: "TNT"
-        text run at (188,0) width 22 RTL: "\x{202B}\x{5D9}\x{5E9} "
-        text run at (210,0) width 98: "\x{202C}\x{201D} and ran off"
+    LayoutBlockFlow {OPTION} at (1,162) size 310x24
+      LayoutText {#text} at (2,1) size 282x21
+        text run at (2,1) width 90: "Directional "
+        text run at (92,1) width 74 RTL override: "\x{202E}overrides"
+        text run at (166,1) width 118: "\x{202C} are confusing."
+    LayoutBlockFlow {OPTION} at (1,186) size 310x24
+      LayoutText {#text} at (2,1) size 306x21
+        text run at (2,1) width 82: "She said \x{201C}"
+        text run at (84,1) width 67 RTL: " \x{5D1}\x{5DE}\x{5D6}\x{5D5}\x{5D5}\x{5D3}\x{5D4}!"
+        text run at (151,1) width 37: "TNT"
+        text run at (188,1) width 22 RTL: "\x{202B}\x{5D9}\x{5E9} "
+        text run at (210,1) width 98: "\x{202C}\x{201D} and ran off"
 layer at (8,253) size 365x18 clip at (9,254) size 348x16
   LayoutListBox {SELECT} at (0,245) size 365x18 [bgcolor=#FFFFFF] [border: (1px solid #A9A9A9)]
     LayoutBlockFlow {OPTION} at (1,1) size 348x16
diff --git a/third_party/WebKit/LayoutTests/platform/win-xp/fast/text/ellipsis-platform-font-change-expected.png b/third_party/WebKit/LayoutTests/platform/win-xp/fast/text/ellipsis-platform-font-change-expected.png
index 8419606..db33d32 100644
--- a/third_party/WebKit/LayoutTests/platform/win-xp/fast/text/ellipsis-platform-font-change-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win-xp/fast/text/ellipsis-platform-font-change-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win-xp/fast/text/emphasis-ellipsis-complextext-expected.png b/third_party/WebKit/LayoutTests/platform/win-xp/fast/text/emphasis-ellipsis-complextext-expected.png
index 0d6dd6e..de59b66 100644
--- a/third_party/WebKit/LayoutTests/platform/win-xp/fast/text/emphasis-ellipsis-complextext-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win-xp/fast/text/emphasis-ellipsis-complextext-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win-xp/fast/text/font-ligature-letter-spacing-expected.txt b/third_party/WebKit/LayoutTests/platform/win-xp/fast/text/font-ligature-letter-spacing-expected.txt
new file mode 100644
index 0000000..a8e1fbe9
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/win-xp/fast/text/font-ligature-letter-spacing-expected.txt
@@ -0,0 +1,8 @@
+CACACACA
+CACACACA
+CACACACA
+This is a testharness.js-based test.
+FAIL Ligature expected not to be applied due to letter spacing. assert_equals: Ligature not applied due to letter spacing. expected 286.546875 but got 140
+FAIL Ligature expected not to be applied due to letter spacing. assert_equals: Ligature not applied due to letter spacing. expected 286.546875 but got 140
+Harness: the test ran to completion.
+
diff --git a/third_party/WebKit/LayoutTests/platform/win-xp/fast/text/format-control-expected.png b/third_party/WebKit/LayoutTests/platform/win-xp/fast/text/format-control-expected.png
index 54af407b..e5d712db 100644
--- a/third_party/WebKit/LayoutTests/platform/win-xp/fast/text/format-control-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win-xp/fast/text/format-control-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win-xp/fast/text/format-control-expected.txt b/third_party/WebKit/LayoutTests/platform/win-xp/fast/text/format-control-expected.txt
index 9fa4242..62c4517 100644
--- a/third_party/WebKit/LayoutTests/platform/win-xp/fast/text/format-control-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win-xp/fast/text/format-control-expected.txt
@@ -1,28 +1,28 @@
-layer at (0,0) size 800x600
+layer at (0,0) size 800x600 clip at (0,0) size 785x600 scrollHeight 608
   LayoutView at (0,0) size 800x600
-layer at (0,0) size 800x600
-  LayoutBlockFlow {HTML} at (0,0) size 800x600
-    LayoutBlockFlow {BODY} at (8,8) size 784x552
-      LayoutBlockFlow (anonymous) at (0,0) size 784x20
+layer at (0,0) size 785x608 backgroundClip at (0,0) size 785x600 clip at (0,0) size 785x600
+  LayoutBlockFlow {HTML} at (0,0) size 785x608
+    LayoutBlockFlow {BODY} at (8,8) size 769x560
+      LayoutBlockFlow (anonymous) at (0,0) size 769x20
         LayoutText {#text} at (0,0) size 457x19
           text run at (0,0) width 457: "This tests the ZWJ and ZWNJ format control characters on basic Latin text."
-      LayoutBlockFlow {DIV} at (0,60) size 784x224
-        LayoutBlockFlow {P} at (0,0) size 784x48
+      LayoutBlockFlow {DIV} at (0,60) size 769x230
+        LayoutBlockFlow {P} at (0,0) size 769x48
           LayoutText {#text} at (0,1) size 276x46
             text run at (0,1) width 276: "fi fl ff ffi ffl fl f   i"
-        LayoutBlockFlow {P} at (0,88) size 784x48
-          LayoutText {#text} at (0,1) size 276x46
-            text run at (0,1) width 276: "f\x{200C}i f\x{200C}l f\x{200C}f f\x{200C}f\x{200C}i f\x{200C}f\x{200C}l f\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}l f\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C} \x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C} \x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C} \x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}i"
-        LayoutBlockFlow {P} at (0,176) size 784x48
-          LayoutText {#text} at (0,1) size 276x46
-            text run at (0,1) width 276: "f\x{200D}i f\x{200D}l f\x{200D}f f\x{200D}f\x{200D}i f\x{200D}f\x{200D}l f\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}l f\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D} \x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D} \x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D} \x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}i"
-      LayoutBlockFlow {DIV} at (0,324) size 784x224
-        LayoutBlockFlow {P} at (0,0) size 784x48
+        LayoutBlockFlow {P} at (0,88) size 769x51
+          LayoutText {#text} at (0,4) size 276x46
+            text run at (0,4) width 276: "f\x{200C}i f\x{200C}l f\x{200C}f f\x{200C}f\x{200C}i f\x{200C}f\x{200C}l f\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}l f\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C} \x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C} \x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C} \x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}i"
+        LayoutBlockFlow {P} at (0,179) size 769x51
+          LayoutText {#text} at (0,4) size 276x46
+            text run at (0,4) width 276: "f\x{200D}i f\x{200D}l f\x{200D}f f\x{200D}f\x{200D}i f\x{200D}f\x{200D}l f\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}l f\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D} \x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D} \x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D} \x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}i"
+      LayoutBlockFlow {DIV} at (0,330) size 769x230
+        LayoutBlockFlow {P} at (0,0) size 769x48
           LayoutText {#text} at (0,1) size 276x46
             text run at (0,1) width 276: "fi fl ff ffi ffl fl f   i"
-        LayoutBlockFlow {P} at (0,88) size 784x48
-          LayoutText {#text} at (0,1) size 276x46
-            text run at (0,1) width 276: "f\x{200C}i f\x{200C}l f\x{200C}f f\x{200C}f\x{200C}i f\x{200C}f\x{200C}l f\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}l f\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C} \x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C} \x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C} \x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}i"
-        LayoutBlockFlow {P} at (0,176) size 784x48
-          LayoutText {#text} at (0,1) size 276x46
-            text run at (0,1) width 276: "f\x{200D}i f\x{200D}l f\x{200D}f f\x{200D}f\x{200D}i f\x{200D}f\x{200D}l f\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}l f\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D} \x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D} \x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D} \x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}i"
+        LayoutBlockFlow {P} at (0,88) size 769x51
+          LayoutText {#text} at (0,4) size 276x46
+            text run at (0,4) width 276: "f\x{200C}i f\x{200C}l f\x{200C}f f\x{200C}f\x{200C}i f\x{200C}f\x{200C}l f\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}l f\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C} \x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C} \x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C} \x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}i"
+        LayoutBlockFlow {P} at (0,179) size 769x51
+          LayoutText {#text} at (0,4) size 276x46
+            text run at (0,4) width 276: "f\x{200D}i f\x{200D}l f\x{200D}f f\x{200D}f\x{200D}i f\x{200D}f\x{200D}l f\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}l f\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D} \x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D} \x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D} \x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}i"
diff --git a/third_party/WebKit/LayoutTests/platform/win-xp/fast/text/international/bidi-LDB-2-formatting-characters-expected.png b/third_party/WebKit/LayoutTests/platform/win-xp/fast/text/international/bidi-LDB-2-formatting-characters-expected.png
index 62c734bd..abc5c42 100644
--- a/third_party/WebKit/LayoutTests/platform/win-xp/fast/text/international/bidi-LDB-2-formatting-characters-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win-xp/fast/text/international/bidi-LDB-2-formatting-characters-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win-xp/fast/text/international/bidi-LDB-2-formatting-characters-expected.txt b/third_party/WebKit/LayoutTests/platform/win-xp/fast/text/international/bidi-LDB-2-formatting-characters-expected.txt
index d86b98e6..208512d 100644
--- a/third_party/WebKit/LayoutTests/platform/win-xp/fast/text/international/bidi-LDB-2-formatting-characters-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win-xp/fast/text/international/bidi-LDB-2-formatting-characters-expected.txt
@@ -1,8 +1,8 @@
-layer at (0,0) size 800x600 scrollHeight 614
+layer at (0,0) size 800x600 scrollHeight 632
   LayoutView at (0,0) size 800x600
-layer at (0,0) size 800x614 backgroundClip at (0,0) size 800x600 clip at (0,0) size 800x600
-  LayoutBlockFlow {HTML} at (0,0) size 800x613.88
-    LayoutBlockFlow {BODY} at (8,21.44) size 784x576.44
+layer at (0,0) size 800x632 backgroundClip at (0,0) size 800x600 clip at (0,0) size 800x600
+  LayoutBlockFlow {HTML} at (0,0) size 800x631.88
+    LayoutBlockFlow {BODY} at (8,21.44) size 784x594.44
       LayoutBlockFlow {H1} at (0,0) size 784x37
         LayoutText {#text} at (0,0) size 684x36
           text run at (0,0) width 684: "Bidirectional Text Test 2 - Formatting Characters"
@@ -35,64 +35,64 @@
       LayoutBlockFlow {P} at (0,130.44) size 784x20
         LayoutText {#text} at (0,0) size 267x19
           text run at (0,0) width 267: "In each box, all the lines should be the same."
-      LayoutBlockFlow (anonymous) at (0,166.44) size 784x248
-        LayoutBlockFlow {DIV} at (3,3) size 96x188 [border: (1px solid #008000)]
+      LayoutBlockFlow (anonymous) at (0,166.44) size 784x266
+        LayoutBlockFlow {DIV} at (3,3) size 96x204 [border: (1px solid #008000)]
           LayoutBlockFlow {P} at (4,4) size 88x20
             LayoutText {#text} at (0,0) size 88x19
               text run at (0,0) width 88: "ABCDEFGHI"
-          LayoutBlockFlow {P} at (4,24) size 88x20
-            LayoutText {#text} at (0,0) size 88x19
-              text run at (0,0) width 0 RTL: "\x{202C}"
-              text run at (0,0) width 88: "\x{202B}ABCDEFGHI"
-          LayoutBlockFlow {P} at (4,44) size 88x20
-            LayoutText {#text} at (0,0) size 32x19
-              text run at (0,0) width 32: "\x{202B}ABC"
+          LayoutBlockFlow {P} at (4,24) size 88x22
+            LayoutText {#text} at (0,2) size 88x19
+              text run at (0,2) width 0 RTL: "\x{202C}"
+              text run at (0,2) width 88: "\x{202B}ABCDEFGHI"
+          LayoutBlockFlow {P} at (4,46) size 88x22
+            LayoutText {#text} at (0,2) size 32x19
+              text run at (0,2) width 32: "\x{202B}ABC"
             LayoutInline {SPAN} at (0,0) size 29x19
-              LayoutText {#text} at (32,0) size 29x19
-                text run at (32,0) width 29: "DEF"
-            LayoutText {#text} at (0,0) size 88x19
-              text run at (0,0) width 0 RTL: "\x{202C}"
-              text run at (61,0) width 27: "GHI"
-          LayoutBlockFlow {P} at (4,64) size 88x20
-            LayoutText {#text} at (0,0) size 88x19
-              text run at (0,0) width 0 RTL: "\x{202C}"
-              text run at (0,0) width 88 RTL override: "\x{202E}IHGFEDCBA"
-          LayoutBlockFlow {P} at (4,84) size 88x20
-            LayoutText {#text} at (61,0) size 27x19
-              text run at (61,0) width 27 RTL override: "\x{202E}IHG"
+              LayoutText {#text} at (32,2) size 29x19
+                text run at (32,2) width 29: "DEF"
+            LayoutText {#text} at (0,2) size 88x19
+              text run at (0,2) width 0 RTL: "\x{202C}"
+              text run at (61,2) width 27: "GHI"
+          LayoutBlockFlow {P} at (4,68) size 88x22
+            LayoutText {#text} at (0,2) size 88x19
+              text run at (0,2) width 0 RTL: "\x{202C}"
+              text run at (0,2) width 88 RTL override: "\x{202E}IHGFEDCBA"
+          LayoutBlockFlow {P} at (4,90) size 88x22
+            LayoutText {#text} at (61,2) size 27x19
+              text run at (61,2) width 27 RTL override: "\x{202E}IHG"
             LayoutInline {SPAN} at (0,0) size 29x19
-              LayoutText {#text} at (32,0) size 29x19
-                text run at (32,0) width 29 RTL override: "FED"
-            LayoutText {#text} at (0,0) size 32x19
-              text run at (0,0) width 0 RTL: "\x{202C}"
-              text run at (0,0) width 32 RTL override: "CBA"
-          LayoutBlockFlow {P} at (4,104) size 88x20
-            LayoutText {#text} at (0,0) size 88x19
-              text run at (0,0) width 0 RTL: "\x{202C}"
-              text run at (0,0) width 32 RTL override: "\x{202C}CBA"
-              text run at (32,0) width 29: "\x{202B}DEF"
-              text run at (61,0) width 27 RTL override: "\x{202E}IHG"
-          LayoutBlockFlow {P} at (4,124) size 88x20
-            LayoutText {#text} at (0,0) size 88x19
-              text run at (0,0) width 0 RTL: "\x{202C}"
-              text run at (0,0) width 32 RTL override: "\x{202C}CBA"
-              text run at (32,0) width 29 RTL override: "\x{202E}FED"
-              text run at (61,0) width 27 RTL override: "\x{202E}IHG"
-          LayoutBlockFlow {P} at (4,144) size 88x20
-            LayoutText {#text} at (0,0) size 88x19
-              text run at (0,0) width 0 RTL: "\x{202C}"
-              text run at (0,0) width 32 RTL override: "\x{202C}CBA"
-              text run at (32,0) width 29 RTL override: "\x{202E}FED"
-              text run at (61,0) width 27 RTL override: "\x{202E}IHG"
-          LayoutBlockFlow {P} at (4,164) size 88x20
-            LayoutText {#text} at (0,0) size 88x19
-              text run at (0,0) width 0 RTL: "\x{202C}"
-              text run at (0,0) width 32 RTL override: "\x{202C}CBA"
-              text run at (32,0) width 29 LTR override: "\x{202D}DEF"
-              text run at (61,0) width 27 RTL override: "\x{202E}IHG"
-        LayoutText {#text} at (102,85) size 4x19
-          text run at (102,85) width 4: " "
-        LayoutBlockFlow {DIV} at (109,53) size 28x88 [border: (1px solid #008000)]
+              LayoutText {#text} at (32,2) size 29x19
+                text run at (32,2) width 29 RTL override: "FED"
+            LayoutText {#text} at (0,2) size 32x19
+              text run at (0,2) width 0 RTL: "\x{202C}"
+              text run at (0,2) width 32 RTL override: "CBA"
+          LayoutBlockFlow {P} at (4,112) size 88x22
+            LayoutText {#text} at (0,2) size 88x19
+              text run at (0,2) width 0 RTL: "\x{202C}"
+              text run at (0,2) width 32 RTL override: "\x{202C}CBA"
+              text run at (32,2) width 29: "\x{202B}DEF"
+              text run at (61,2) width 27 RTL override: "\x{202E}IHG"
+          LayoutBlockFlow {P} at (4,134) size 88x22
+            LayoutText {#text} at (0,2) size 88x19
+              text run at (0,2) width 0 RTL: "\x{202C}"
+              text run at (0,2) width 32 RTL override: "\x{202C}CBA"
+              text run at (32,2) width 29 RTL override: "\x{202E}FED"
+              text run at (61,2) width 27 RTL override: "\x{202E}IHG"
+          LayoutBlockFlow {P} at (4,156) size 88x22
+            LayoutText {#text} at (0,2) size 88x19
+              text run at (0,2) width 0 RTL: "\x{202C}"
+              text run at (0,2) width 32 RTL override: "\x{202C}CBA"
+              text run at (32,2) width 29 RTL override: "\x{202E}FED"
+              text run at (61,2) width 27 RTL override: "\x{202E}IHG"
+          LayoutBlockFlow {P} at (4,178) size 88x22
+            LayoutText {#text} at (0,2) size 88x19
+              text run at (0,2) width 0 RTL: "\x{202C}"
+              text run at (0,2) width 32 RTL override: "\x{202C}CBA"
+              text run at (32,2) width 29 LTR override: "\x{202D}DEF"
+              text run at (61,2) width 27 RTL override: "\x{202E}IHG"
+        LayoutText {#text} at (102,93) size 4x19
+          text run at (102,93) width 4: " "
+        LayoutBlockFlow {DIV} at (109,59) size 28x92 [border: (1px solid #008000)]
           LayoutTable {TABLE} at (4,4) size 20x20
             LayoutTableSection {TBODY} at (0,0) size 20x20
               LayoutTableRow {TR} at (0,0) size 20x20
@@ -108,17 +108,17 @@
           LayoutBlockFlow {P} at (4,24) size 20x20
             LayoutText {#text} at (0,0) size 20x19
               text run at (0,0) width 20 RTL: "\x{5D0}\x{5D1}\x{5D2}"
-          LayoutBlockFlow {P} at (4,44) size 20x20
-            LayoutText {#text} at (0,0) size 20x19
-              text run at (0,0) width 20 RTL: "\x{202A}\x{5D0}\x{5D1}\x{5D2}"
-              text run at (20,0) width 0: "\x{202C}"
-          LayoutBlockFlow {P} at (4,64) size 20x20
-            LayoutText {#text} at (0,0) size 20x19
-              text run at (0,0) width 20 LTR override: "\x{202D}\x{5D2}\x{5D1}\x{5D0}"
-              text run at (20,0) width 0: "\x{202C}"
-        LayoutText {#text} at (140,85) size 4x19
-          text run at (140,85) width 4: " "
-        LayoutBlockFlow {DIV} at (147,63) size 87x68 [border: (1px solid #008000)]
+          LayoutBlockFlow {P} at (4,44) size 20x22
+            LayoutText {#text} at (0,2) size 20x19
+              text run at (0,2) width 20 RTL: "\x{202A}\x{5D0}\x{5D1}\x{5D2}"
+              text run at (20,2) width 0: "\x{202C}"
+          LayoutBlockFlow {P} at (4,66) size 20x22
+            LayoutText {#text} at (0,2) size 20x19
+              text run at (0,2) width 20 LTR override: "\x{202D}\x{5D2}\x{5D1}\x{5D0}"
+              text run at (20,2) width 0: "\x{202C}"
+        LayoutText {#text} at (140,93) size 4x19
+          text run at (140,93) width 4: " "
+        LayoutBlockFlow {DIV} at (147,71) size 87x68 [border: (1px solid #008000)]
           LayoutTable {TABLE} at (4,4) size 79x20
             LayoutTableSection {TBODY} at (0,0) size 79x20
               LayoutTableRow {TR} at (0,0) size 79x20
@@ -165,9 +165,9 @@
               text run at (0,0) width 24 RTL: " \x{5D0}\x{5D1}\x{5D2}"
               text run at (24,0) width 32: "ABC"
               text run at (56,0) width 23 RTL: "\x{5D3}\x{5D4}\x{5D5} "
-        LayoutText {#text} at (237,85) size 4x19
-          text run at (237,85) width 4: " "
-        LayoutBlockFlow {DIV} at (244,3) size 145x188 [border: (1px solid #008000)]
+        LayoutText {#text} at (237,93) size 4x19
+          text run at (237,93) width 4: " "
+        LayoutBlockFlow {DIV} at (244,5) size 145x200 [border: (1px solid #008000)]
           LayoutTable {TABLE} at (4,4) size 137x20
             LayoutTableSection {TBODY} at (0,0) size 137x20
               LayoutTableRow {TR} at (0,0) size 137x20
@@ -246,51 +246,51 @@
             LayoutText {#text} at (79,0) size 58x19
               text run at (79,0) width 37: " DEF "
               text run at (116,0) width 21 RTL: "\x{5D6}\x{5D7}\x{5D8}"
-          LayoutBlockFlow {P} at (4,64) size 137x20
-            LayoutText {#text} at (0,0) size 137x19
-              text run at (0,0) width 20 RTL: "\x{5D0}\x{5D1}\x{5D2}"
-              text run at (20,0) width 4: " "
-              text run at (24,0) width 36: "\x{202A}ABC "
-              text run at (60,0) width 19 RTL: "\x{5D3}\x{5D4}\x{5D5}"
-              text run at (79,0) width 33: " DEF"
-              text run at (112,0) width 4: "\x{202C} "
-              text run at (116,0) width 21 RTL: "\x{5D6}\x{5D7}\x{5D8}"
-          LayoutBlockFlow {P} at (4,84) size 137x20
-            LayoutText {#text} at (0,0) size 137x19
-              text run at (0,0) width 24 RTL: "\x{202C} \x{5D0}\x{5D1}\x{5D2}"
-              text run at (24,0) width 32: "ABC"
-              text run at (56,0) width 27 RTL: " \x{5D3}\x{5D4}\x{5D5} "
-              text run at (83,0) width 29: "\x{202B}DEF"
-              text run at (112,0) width 25 RTL: "\x{5D6}\x{5D7}\x{5D8} "
-          LayoutBlockFlow {P} at (4,104) size 137x20
-            LayoutText {#text} at (0,0) size 137x19
-              text run at (0,0) width 24 RTL: " \x{5D0}\x{5D1}\x{5D2}"
-              text run at (24,0) width 32: "\x{202B}ABC"
-              text run at (56,0) width 23 RTL: "\x{5D3}\x{5D4}\x{5D5} "
-              text run at (79,0) width 37: "\x{202C} DEF "
-              text run at (116,0) width 21 RTL: "\x{5D6}\x{5D7}\x{5D8}"
-          LayoutBlockFlow {P} at (4,124) size 137x20
-            LayoutText {#text} at (0,0) size 137x19
-              text run at (0,0) width 56 RTL override: "\x{202E}CBA \x{5D0}\x{5D1}\x{5D2}"
-              text run at (56,0) width 23 RTL: "\x{5D3}\x{5D4}\x{5D5} "
-              text run at (79,0) width 37: "\x{202C} DEF "
-              text run at (116,0) width 21 RTL: "\x{5D6}\x{5D7}\x{5D8}"
-          LayoutBlockFlow {P} at (4,144) size 137x20
-            LayoutText {#text} at (0,0) size 137x19
-              text run at (0,0) width 20 RTL: "\x{5D0}\x{5D1}\x{5D2}"
-              text run at (20,0) width 4: " "
-              text run at (24,0) width 55 LTR override: "\x{202D}ABC \x{5D5}\x{5D4}\x{5D3}"
-              text run at (79,0) width 37: "\x{202C} DEF "
-              text run at (116,0) width 21 RTL: "\x{5D6}\x{5D7}\x{5D8}"
-          LayoutBlockFlow {P} at (4,164) size 137x20
-            LayoutText {#text} at (0,0) size 137x19
-              text run at (0,0) width 24 RTL: " \x{5D0}\x{5D1}\x{5D2}"
-              text run at (24,0) width 55 LTR override: "\x{202D}ABC \x{5D5}\x{5D4}\x{5D3}"
-              text run at (79,0) width 33: "\x{202C} DEF"
-              text run at (112,0) width 25 RTL: "\x{5D6}\x{5D7}\x{5D8} "
-        LayoutText {#text} at (392,85) size 4x19
-          text run at (392,85) width 4: " "
-        LayoutBlockFlow {DIV} at (399,73) size 176x48 [border: (1px solid #008000)]
+          LayoutBlockFlow {P} at (4,64) size 137x22
+            LayoutText {#text} at (0,2) size 137x19
+              text run at (0,2) width 20 RTL: "\x{5D0}\x{5D1}\x{5D2}"
+              text run at (20,2) width 4: " "
+              text run at (24,2) width 36: "\x{202A}ABC "
+              text run at (60,2) width 19 RTL: "\x{5D3}\x{5D4}\x{5D5}"
+              text run at (79,2) width 33: " DEF"
+              text run at (112,2) width 4: "\x{202C} "
+              text run at (116,2) width 21 RTL: "\x{5D6}\x{5D7}\x{5D8}"
+          LayoutBlockFlow {P} at (4,86) size 137x22
+            LayoutText {#text} at (0,2) size 137x19
+              text run at (0,2) width 24 RTL: "\x{202C} \x{5D0}\x{5D1}\x{5D2}"
+              text run at (24,2) width 32: "ABC"
+              text run at (56,2) width 27 RTL: " \x{5D3}\x{5D4}\x{5D5} "
+              text run at (83,2) width 29: "\x{202B}DEF"
+              text run at (112,2) width 25 RTL: "\x{5D6}\x{5D7}\x{5D8} "
+          LayoutBlockFlow {P} at (4,108) size 137x22
+            LayoutText {#text} at (0,2) size 137x19
+              text run at (0,2) width 24 RTL: " \x{5D0}\x{5D1}\x{5D2}"
+              text run at (24,2) width 32: "\x{202B}ABC"
+              text run at (56,2) width 23 RTL: "\x{5D3}\x{5D4}\x{5D5} "
+              text run at (79,2) width 37: "\x{202C} DEF "
+              text run at (116,2) width 21 RTL: "\x{5D6}\x{5D7}\x{5D8}"
+          LayoutBlockFlow {P} at (4,130) size 137x22
+            LayoutText {#text} at (0,2) size 137x19
+              text run at (0,2) width 56 RTL override: "\x{202E}CBA \x{5D0}\x{5D1}\x{5D2}"
+              text run at (56,2) width 23 RTL: "\x{5D3}\x{5D4}\x{5D5} "
+              text run at (79,2) width 37: "\x{202C} DEF "
+              text run at (116,2) width 21 RTL: "\x{5D6}\x{5D7}\x{5D8}"
+          LayoutBlockFlow {P} at (4,152) size 137x22
+            LayoutText {#text} at (0,2) size 137x19
+              text run at (0,2) width 20 RTL: "\x{5D0}\x{5D1}\x{5D2}"
+              text run at (20,2) width 4: " "
+              text run at (24,2) width 55 LTR override: "\x{202D}ABC \x{5D5}\x{5D4}\x{5D3}"
+              text run at (79,2) width 37: "\x{202C} DEF "
+              text run at (116,2) width 21 RTL: "\x{5D6}\x{5D7}\x{5D8}"
+          LayoutBlockFlow {P} at (4,174) size 137x22
+            LayoutText {#text} at (0,2) size 137x19
+              text run at (0,2) width 24 RTL: " \x{5D0}\x{5D1}\x{5D2}"
+              text run at (24,2) width 55 LTR override: "\x{202D}ABC \x{5D5}\x{5D4}\x{5D3}"
+              text run at (79,2) width 33: "\x{202C} DEF"
+              text run at (112,2) width 25 RTL: "\x{5D6}\x{5D7}\x{5D8} "
+        LayoutText {#text} at (392,93) size 4x19
+          text run at (392,93) width 4: " "
+        LayoutBlockFlow {DIV} at (399,81) size 176x48 [border: (1px solid #008000)]
           LayoutTable {TABLE} at (4,4) size 168x20
             LayoutTableSection {TBODY} at (0,0) size 168x20
               LayoutTableRow {TR} at (0,0) size 168x20
@@ -370,10 +370,10 @@
               text run at (60,0) width 19 RTL: "\x{5D3}\x{5D4}\x{5D5}"
               text run at (79,0) width 68: " DEF GHI "
               text run at (147,0) width 21 RTL: "\x{5D6}\x{5D7}\x{5D8}"
-        LayoutText {#text} at (578,85) size 4x19
-          text run at (578,85) width 4: " "
-        LayoutBR {BR} at (582,85) size 0x19
-        LayoutBlockFlow {DIV} at (3,197) size 176x48 [border: (1px solid #008000)]
+        LayoutText {#text} at (578,93) size 4x19
+          text run at (578,93) width 4: " "
+        LayoutBR {BR} at (582,93) size 0x19
+        LayoutBlockFlow {DIV} at (3,213) size 176x50 [border: (1px solid #008000)]
           LayoutTable {TABLE} at (4,4) size 168x20
             LayoutTableSection {TBODY} at (0,0) size 168x20
               LayoutTableRow {TR} at (0,0) size 168x20
@@ -446,15 +446,15 @@
                 LayoutTableCell {TD} at (163,0) size 5x20 [r=0 c=22 rs=1 cs=1]
                   LayoutText {#text} at (0,0) size 5x19
                     text run at (0,0) width 5 RTL: "\x{5D6}"
-          LayoutBlockFlow {P} at (4,24) size 168x20
-            LayoutText {#text} at (0,0) size 168x19
-              text run at (0,0) width 88 RTL override: "\x{202E}ABC \x{5D3}\x{5D4}\x{5D5} DEF"
-              text run at (88,0) width 24 RTL: "\x{5D0}\x{5D1}\x{5D2} "
-              text run at (112,0) width 35: "\x{202C} GHI "
-              text run at (147,0) width 21 RTL: "\x{5D6}\x{5D7}\x{5D8}"
-        LayoutText {#text} at (182,209) size 4x19
-          text run at (182,209) width 4: " "
-        LayoutBlockFlow {DIV} at (189,197) size 176x48 [border: (1px solid #008000)]
+          LayoutBlockFlow {P} at (4,24) size 168x22
+            LayoutText {#text} at (0,2) size 168x19
+              text run at (0,2) width 88 RTL override: "\x{202E}ABC \x{5D3}\x{5D4}\x{5D5} DEF"
+              text run at (88,2) width 24 RTL: "\x{5D0}\x{5D1}\x{5D2} "
+              text run at (112,2) width 35: "\x{202C} GHI "
+              text run at (147,2) width 21 RTL: "\x{5D6}\x{5D7}\x{5D8}"
+        LayoutText {#text} at (182,226) size 4x19
+          text run at (182,226) width 4: " "
+        LayoutBlockFlow {DIV} at (189,213) size 176x50 [border: (1px solid #008000)]
           LayoutTable {TABLE} at (4,4) size 168x20
             LayoutTableSection {TBODY} at (0,0) size 168x20
               LayoutTableRow {TR} at (0,0) size 168x20
@@ -527,20 +527,20 @@
                 LayoutTableCell {TD} at (163,0) size 5x20 [r=0 c=22 rs=1 cs=1]
                   LayoutText {#text} at (0,0) size 5x19
                     text run at (0,0) width 5 RTL: "\x{5D6}"
-          LayoutBlockFlow {P} at (4,24) size 168x20
-            LayoutText {#text} at (0,0) size 168x19
-              text run at (0,0) width 20 RTL: "\x{5D0}\x{5D1}\x{5D2}"
-              text run at (20,0) width 40: " ABC "
-              text run at (60,0) width 52 RTL override: "\x{202E}\x{5D3}\x{5D4}\x{5D5} DEF"
-              text run at (112,0) width 35: "\x{202C} GHI "
-              text run at (147,0) width 21 RTL: "\x{5D6}\x{5D7}\x{5D8}"
+          LayoutBlockFlow {P} at (4,24) size 168x22
+            LayoutText {#text} at (0,2) size 168x19
+              text run at (0,2) width 20 RTL: "\x{5D0}\x{5D1}\x{5D2}"
+              text run at (20,2) width 40: " ABC "
+              text run at (60,2) width 52 RTL override: "\x{202E}\x{5D3}\x{5D4}\x{5D5} DEF"
+              text run at (112,2) width 35: "\x{202C} GHI "
+              text run at (147,2) width 21 RTL: "\x{5D6}\x{5D7}\x{5D8}"
         LayoutText {#text} at (0,0) size 0x0
-      LayoutBlockFlow {P} at (0,430.44) size 784x20
+      LayoutBlockFlow {P} at (0,448.44) size 784x20
         LayoutText {#text} at (0,0) size 355x19
           text run at (0,0) width 38: "Note: "
           text run at (38,0) width 317: "This test does not test RLM or LRM, but it ought to."
-      LayoutBlockFlow {HR} at (0,466.44) size 784x2 [border: (1px inset #EEEEEE)]
-      LayoutBlockFlow {P} at (0,484.44) size 784x20
+      LayoutBlockFlow {HR} at (0,484.44) size 784x2 [border: (1px inset #EEEEEE)]
+      LayoutBlockFlow {P} at (0,502.44) size 784x20
         LayoutText {#text} at (0,0) size 57x19
           text run at (0,0) width 57: "(Back to "
         LayoutInline {A} at (0,0) size 149x19 [color=#0000EE]
@@ -553,7 +553,7 @@
             text run at (214,0) width 77: "David Baron"
         LayoutText {#text} at (291,0) size 5x19
           text run at (291,0) width 5: ")"
-      LayoutBlockFlow {P} at (0,520.44) size 784x20
+      LayoutBlockFlow {P} at (0,538.44) size 784x20
         LayoutInline {A} at (0,0) size 30x19 [color=#0000EE]
           LayoutText {#text} at (0,0) size 30x19
             text run at (0,0) width 30: "LDB"
@@ -564,6 +564,6 @@
             text run at (38,0) width 125: "dbaron@dbaron.org"
         LayoutText {#text} at (163,0) size 84x19
           text run at (163,0) width 84: ", 2001-06-05"
-      LayoutBlockFlow {P} at (0,556.44) size 784x20
+      LayoutBlockFlow {P} at (0,574.44) size 784x20
         LayoutText {#text} at (0,0) size 289x19
           text run at (0,0) width 289: "Modified and used with the author\x{2019}s permission."
diff --git a/third_party/WebKit/LayoutTests/platform/win-xp/fast/text/international/bidi-explicit-embedding-expected.png b/third_party/WebKit/LayoutTests/platform/win-xp/fast/text/international/bidi-explicit-embedding-expected.png
index 83174f2..8162197 100644
--- a/third_party/WebKit/LayoutTests/platform/win-xp/fast/text/international/bidi-explicit-embedding-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win-xp/fast/text/international/bidi-explicit-embedding-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win-xp/fast/text/international/bidi-explicit-embedding-expected.txt b/third_party/WebKit/LayoutTests/platform/win-xp/fast/text/international/bidi-explicit-embedding-expected.txt
index 30ac439..5e6af43 100644
--- a/third_party/WebKit/LayoutTests/platform/win-xp/fast/text/international/bidi-explicit-embedding-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win-xp/fast/text/international/bidi-explicit-embedding-expected.txt
@@ -1,8 +1,8 @@
 layer at (0,0) size 800x600
   LayoutView at (0,0) size 800x600
-layer at (0,0) size 800x524
-  LayoutBlockFlow {HTML} at (0,0) size 800x524
-    LayoutBlockFlow {BODY} at (8,16) size 784x492
+layer at (0,0) size 800x536
+  LayoutBlockFlow {HTML} at (0,0) size 800x536
+    LayoutBlockFlow {BODY} at (8,16) size 784x504
       LayoutBlockFlow {P} at (0,0) size 784x60
         LayoutText {#text} at (0,0) size 773x59
           text run at (0,0) width 773: "In each line, reading from left to right, the bracket should appear before the parenthesis. The bracket should be a left bracket and"
@@ -40,23 +40,23 @@
             text run at (67,0) width 5 RTL: "("
         LayoutText {#text} at (72,0) size 22x19
           text run at (72,0) width 22: " fgh"
-      LayoutBlockFlow {P} at (0,184) size 784x20
-        LayoutText {#text} at (0,0) size 94x19
-          text run at (0,0) width 26: "abc "
-          text run at (26,0) width 5 RTL: "]"
-          text run at (31,0) width 16: "23"
-          text run at (47,0) width 4 RTL: " "
-          text run at (51,0) width 16: "45"
-          text run at (67,0) width 5 RTL: "\x{202B}("
-          text run at (72,0) width 22: "\x{202C} fgh"
-      LayoutBlockFlow {P} at (0,220) size 784x20
-        LayoutText {#text} at (0,0) size 84x19
-          text run at (0,0) width 26: "abc "
-          text run at (26,0) width 5 RTL: "]"
-          text run at (31,0) width 30: "de fg"
-          text run at (61,0) width 5 RTL: "\x{202B}("
-          text run at (66,0) width 18: "\x{202C} hij"
-      LayoutBlockFlow {P} at (0,256) size 784x20
+      LayoutBlockFlow {P} at (0,184) size 784x22
+        LayoutText {#text} at (0,2) size 94x19
+          text run at (0,2) width 26: "abc "
+          text run at (26,2) width 5 RTL: "]"
+          text run at (31,2) width 16: "23"
+          text run at (47,2) width 4 RTL: " "
+          text run at (51,2) width 16: "45"
+          text run at (67,2) width 5 RTL: "\x{202B}("
+          text run at (72,2) width 22: "\x{202C} fgh"
+      LayoutBlockFlow {P} at (0,222) size 784x22
+        LayoutText {#text} at (0,2) size 84x19
+          text run at (0,2) width 26: "abc "
+          text run at (26,2) width 5 RTL: "]"
+          text run at (31,2) width 30: "de fg"
+          text run at (61,2) width 5 RTL: "\x{202B}("
+          text run at (66,2) width 18: "\x{202C} hij"
+      LayoutBlockFlow {P} at (0,260) size 784x20
         LayoutText {#text} at (0,0) size 8x19
           text run at (0,0) width 8: "1"
         LayoutInline {SPAN} at (0,0) size 44x19
@@ -65,7 +65,7 @@
             text run at (13,0) width 34: "ab cd"
             text run at (47,0) width 5 RTL: "("
         LayoutText {#text} at (0,0) size 0x0
-      LayoutBlockFlow {P} at (0,292) size 784x20
+      LayoutBlockFlow {P} at (0,296) size 784x20
         LayoutText {#text} at (0,0) size 8x19
           text run at (0,0) width 8: "1"
         LayoutInline {SPAN} at (0,0) size 41x19
@@ -74,34 +74,34 @@
             text run at (29,0) width 15: "ab"
             text run at (44,0) width 5 RTL: "("
         LayoutText {#text} at (0,0) size 0x0
-      LayoutBlockFlow {P} at (0,328) size 784x20
-        LayoutText {#text} at (0,0) size 8x19
-          text run at (0,0) width 8: "1"
+      LayoutBlockFlow {P} at (0,332) size 784x22
+        LayoutText {#text} at (0,2) size 8x19
+          text run at (0,2) width 8: "1"
         LayoutInline {SPAN} at (0,0) size 18x19
-          LayoutText {#text} at (8,0) size 18x19
-            text run at (8,0) width 5 RTL: "]"
-            text run at (13,0) width 8: "2"
-            text run at (21,0) width 5 RTL: "\x{202B}("
-            text run at (26,0) width 0: "\x{202C}"
+          LayoutText {#text} at (8,2) size 18x19
+            text run at (8,2) width 5 RTL: "]"
+            text run at (13,2) width 8: "2"
+            text run at (21,2) width 5 RTL: "\x{202B}("
+            text run at (26,2) width 0: "\x{202C}"
         LayoutText {#text} at (0,0) size 0x0
-      LayoutBlockFlow {P} at (0,364) size 784x20
-        LayoutText {#text} at (0,0) size 8x19
-          text run at (0,0) width 8: "1"
+      LayoutBlockFlow {P} at (0,370) size 784x22
+        LayoutText {#text} at (0,2) size 8x19
+          text run at (0,2) width 8: "1"
         LayoutInline {SPAN} at (0,0) size 17x19
-          LayoutText {#text} at (8,0) size 17x19
-            text run at (8,0) width 5 RTL: "]"
-            text run at (13,0) width 7: "a"
-            text run at (20,0) width 5 RTL: "\x{202B}("
-            text run at (25,0) width 0: "\x{202C}"
+          LayoutText {#text} at (8,2) size 17x19
+            text run at (8,2) width 5 RTL: "]"
+            text run at (13,2) width 7: "a"
+            text run at (20,2) width 5 RTL: "\x{202B}("
+            text run at (25,2) width 0: "\x{202C}"
         LayoutText {#text} at (0,0) size 0x0
-      LayoutBlockFlow {P} at (0,400) size 784x20
-        LayoutText {#text} at (0,0) size 49x19
-          text run at (0,0) width 8: "1"
-          text run at (8,0) width 21 RTL: " \x{5D2}\x{5D3}]"
-          text run at (29,0) width 15: "ab"
-          text run at (44,0) width 5 RTL: "\x{202B}("
-          text run at (49,0) width 0: "\x{202C}"
-      LayoutBlockFlow {P} at (0,436) size 784x20
+      LayoutBlockFlow {P} at (0,408) size 784x22
+        LayoutText {#text} at (0,2) size 49x19
+          text run at (0,2) width 8: "1"
+          text run at (8,2) width 21 RTL: " \x{5D2}\x{5D3}]"
+          text run at (29,2) width 15: "ab"
+          text run at (44,2) width 5 RTL: "\x{202B}("
+          text run at (49,2) width 0: "\x{202C}"
+      LayoutBlockFlow {P} at (0,446) size 784x20
         LayoutInline {SPAN} at (0,0) size 79x19
           LayoutText {#text} at (0,0) size 79x19
             text run at (0,0) width 5 RTL: "]"
@@ -110,11 +110,11 @@
             text run at (55,0) width 19: "def"
             text run at (74,0) width 5 RTL: "("
         LayoutText {#text} at (0,0) size 0x0
-      LayoutBlockFlow {P} at (0,472) size 784x20
-        LayoutText {#text} at (0,0) size 79x19
-          text run at (0,0) width 5 RTL: "]"
-          text run at (5,0) width 22: "abc"
-          text run at (27,0) width 28 RTL: " \x{5D0}\x{5D1}\x{5D2} "
-          text run at (55,0) width 19: "def"
-          text run at (74,0) width 5 RTL: "\x{202B}("
-          text run at (79,0) width 0: "\x{202C}"
+      LayoutBlockFlow {P} at (0,482) size 784x22
+        LayoutText {#text} at (0,2) size 79x19
+          text run at (0,2) width 5 RTL: "]"
+          text run at (5,2) width 22: "abc"
+          text run at (27,2) width 28 RTL: " \x{5D0}\x{5D1}\x{5D2} "
+          text run at (55,2) width 19: "def"
+          text run at (74,2) width 5 RTL: "\x{202B}("
+          text run at (79,2) width 0: "\x{202C}"
diff --git a/third_party/WebKit/LayoutTests/platform/win-xp/fast/text/international/bidi-ignored-for-first-child-inline-expected.png b/third_party/WebKit/LayoutTests/platform/win-xp/fast/text/international/bidi-ignored-for-first-child-inline-expected.png
index 934c04f..2ff85aa 100644
--- a/third_party/WebKit/LayoutTests/platform/win-xp/fast/text/international/bidi-ignored-for-first-child-inline-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win-xp/fast/text/international/bidi-ignored-for-first-child-inline-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win-xp/fast/text/international/bidi-ignored-for-first-child-inline-expected.txt b/third_party/WebKit/LayoutTests/platform/win-xp/fast/text/international/bidi-ignored-for-first-child-inline-expected.txt
index 8a70c28..2202290 100644
--- a/third_party/WebKit/LayoutTests/platform/win-xp/fast/text/international/bidi-ignored-for-first-child-inline-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win-xp/fast/text/international/bidi-ignored-for-first-child-inline-expected.txt
@@ -82,20 +82,20 @@
       LayoutBlockFlow (anonymous) at (0,372) size 784x20
         LayoutText {#text} at (0,0) size 229x19
           text run at (0,0) width 229: "The following lines should be identical:"
-      LayoutBlockFlow {P} at (0,408) size 784x20
-        LayoutText {#text} at (0,0) size 49x19
-          text run at (0,0) width 19 RTL: "\x{5D3}\x{5D4}\x{5D5}"
-          text run at (19,0) width 10: "(["
-          text run at (29,0) width 20 RTL: "\x{202C}\x{5D0}\x{5D1}\x{5D2}"
-          text run at (49,0) width 0: "\x{202A}"
-      LayoutBlockFlow {P} at (0,444) size 784x20
+      LayoutBlockFlow {P} at (0,408) size 784x22
+        LayoutText {#text} at (0,2) size 49x19
+          text run at (0,2) width 19 RTL: "\x{5D3}\x{5D4}\x{5D5}"
+          text run at (19,2) width 10: "(["
+          text run at (29,2) width 20 RTL: "\x{202C}\x{5D0}\x{5D1}\x{5D2}"
+          text run at (49,2) width 0: "\x{202A}"
+      LayoutBlockFlow {P} at (0,446) size 784x20
         LayoutText {#text} at (0,0) size 29x19
           text run at (0,0) width 19 RTL: "\x{5D3}\x{5D4}\x{5D5}"
           text run at (19,0) width 10: "(["
         LayoutInline {SPAN} at (0,0) size 0x19
         LayoutText {#text} at (29,0) size 20x19
           text run at (29,0) width 20 RTL: "\x{5D0}\x{5D1}\x{5D2}"
-      LayoutBlockFlow {P} at (0,480) size 784x20
+      LayoutBlockFlow {P} at (0,482) size 784x20
         LayoutText {#text} at (0,0) size 29x19
           text run at (0,0) width 19 RTL: "\x{5D3}\x{5D4}\x{5D5}"
           text run at (19,0) width 10: "(["
@@ -103,7 +103,7 @@
           LayoutInline {SPAN} at (0,0) size 0x19
         LayoutText {#text} at (29,0) size 20x19
           text run at (29,0) width 20 RTL: "\x{5D0}\x{5D1}\x{5D2}"
-      LayoutBlockFlow {P} at (0,516) size 784x20
+      LayoutBlockFlow {P} at (0,518) size 784x20
         LayoutText {#text} at (0,0) size 29x19
           text run at (0,0) width 19 RTL: "\x{5D3}\x{5D4}\x{5D5}"
           text run at (19,0) width 10: "(["
diff --git a/third_party/WebKit/LayoutTests/platform/win-xp/fast/text/international/bidi-neutral-run-expected.png b/third_party/WebKit/LayoutTests/platform/win-xp/fast/text/international/bidi-neutral-run-expected.png
index 9ad39df3..dadaf9a2 100644
--- a/third_party/WebKit/LayoutTests/platform/win-xp/fast/text/international/bidi-neutral-run-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win-xp/fast/text/international/bidi-neutral-run-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win-xp/fast/text/international/bidi-neutral-run-expected.txt b/third_party/WebKit/LayoutTests/platform/win-xp/fast/text/international/bidi-neutral-run-expected.txt
index 1f6c0908..1c5b46d 100644
--- a/third_party/WebKit/LayoutTests/platform/win-xp/fast/text/international/bidi-neutral-run-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win-xp/fast/text/international/bidi-neutral-run-expected.txt
@@ -1,12 +1,12 @@
-layer at (0,0) size 800x600 clip at (0,0) size 785x600 scrollHeight 6456
+layer at (0,0) size 800x600 clip at (0,0) size 785x600 scrollHeight 6552
   LayoutView at (0,0) size 800x600
-layer at (0,0) size 785x6456 backgroundClip at (0,0) size 785x600 clip at (0,0) size 785x600
-  LayoutBlockFlow {HTML} at (0,0) size 785x6456
-    LayoutBlockFlow {BODY} at (8,8) size 769x6432
+layer at (0,0) size 785x6552 backgroundClip at (0,0) size 785x600 clip at (0,0) size 785x600
+  LayoutBlockFlow {HTML} at (0,0) size 785x6552
+    LayoutBlockFlow {BODY} at (8,8) size 769x6528
       LayoutBlockFlow {P} at (0,0) size 769x20
         LayoutText {#text} at (0,0) size 285x19
           text run at (0,0) width 285: "Tests the resolved level of runs of neutral types."
-      LayoutBlockFlow {DIV} at (0,36) size 769x3190
+      LayoutBlockFlow {DIV} at (0,36) size 769x3238
         LayoutBlockFlow {P} at (0,0) size 769x20
           LayoutText {#text} at (0,0) size 43x19
             text run at (0,0) width 43: "ab(^cd"
@@ -46,133 +46,133 @@
             text run at (0,0) width 16: "\x{661}\x{662}"
             text run at (16,0) width 14 RTL: "\x{627}\x{628}"
             text run at (30,0) width 28: "(^cd"
-        LayoutBlockFlow {P} at (0,324) size 769x20
-          LayoutText {#text} at (0,0) size 35x19
-            text run at (0,0) width 7: "\x{202A}?"
-            text run at (7,0) width 28: "\x{202C}(^cd"
-        LayoutBlockFlow {P} at (0,360) size 769x20
-          LayoutText {#text} at (0,0) size 35x19
-            text run at (0,0) width 7 RTL: "\x{202B}?"
-            text run at (7,0) width 28: "\x{202C}(^cd"
-        LayoutBlockFlow {P} at (0,396) size 769x20
+        LayoutBlockFlow {P} at (0,324) size 769x22
+          LayoutText {#text} at (0,2) size 35x19
+            text run at (0,2) width 7: "\x{202A}?"
+            text run at (7,2) width 28: "\x{202C}(^cd"
+        LayoutBlockFlow {P} at (0,362) size 769x22
+          LayoutText {#text} at (0,2) size 35x19
+            text run at (0,2) width 7 RTL: "\x{202B}?"
+            text run at (7,2) width 28: "\x{202C}(^cd"
+        LayoutBlockFlow {P} at (0,400) size 769x20
           LayoutText {#text} at (0,0) size 40x19
             text run at (0,0) width 28: "ab(^"
             text run at (28,0) width 12 RTL: "\x{5D2}\x{5D3}"
-        LayoutBlockFlow {P} at (0,432) size 769x20
+        LayoutBlockFlow {P} at (0,436) size 769x20
           LayoutText {#text} at (0,0) size 40x19
             text run at (0,0) width 40 RTL: "\x{5D0}\x{5D1}(^\x{5D2}\x{5D3}"
-        LayoutBlockFlow {P} at (0,468) size 769x20
+        LayoutBlockFlow {P} at (0,472) size 769x20
           LayoutText {#text} at (0,0) size 39x19
             text run at (0,0) width 39 RTL: "\x{627}\x{628}(^\x{5D2}\x{5D3}"
-        LayoutBlockFlow {P} at (0,504) size 769x20
+        LayoutBlockFlow {P} at (0,508) size 769x20
           LayoutText {#text} at (0,0) size 56x19
             text run at (0,0) width 44: "ab12(^"
             text run at (44,0) width 12 RTL: "\x{5D2}\x{5D3}"
-        LayoutBlockFlow {P} at (0,540) size 769x20
+        LayoutBlockFlow {P} at (0,544) size 769x20
           LayoutText {#text} at (0,0) size 56x19
             text run at (0,0) width 25 RTL: "(^\x{5D2}\x{5D3}"
             text run at (25,0) width 16: "12"
             text run at (41,0) width 15 RTL: "\x{5D0}\x{5D1}"
-        LayoutBlockFlow {P} at (0,576) size 769x20
+        LayoutBlockFlow {P} at (0,580) size 769x20
           LayoutText {#text} at (0,0) size 55x19
             text run at (0,0) width 25 RTL: "(^\x{5D2}\x{5D3}"
             text run at (25,0) width 16: "12"
             text run at (41,0) width 14 RTL: "\x{627}\x{628}"
-        LayoutBlockFlow {P} at (0,612) size 769x20
+        LayoutBlockFlow {P} at (0,616) size 769x20
           LayoutText {#text} at (0,0) size 56x19
             text run at (0,0) width 15: "ab"
             text run at (15,0) width 25 RTL: "(^\x{5D2}\x{5D3}"
             text run at (40,0) width 16: "\x{661}\x{662}"
-        LayoutBlockFlow {P} at (0,648) size 769x20
+        LayoutBlockFlow {P} at (0,652) size 769x20
           LayoutText {#text} at (0,0) size 56x19
             text run at (0,0) width 25 RTL: "(^\x{5D2}\x{5D3}"
             text run at (25,0) width 16: "\x{661}\x{662}"
             text run at (41,0) width 15 RTL: "\x{5D0}\x{5D1}"
-        LayoutBlockFlow {P} at (0,684) size 769x20
+        LayoutBlockFlow {P} at (0,688) size 769x20
           LayoutText {#text} at (0,0) size 55x19
             text run at (0,0) width 25 RTL: "(^\x{5D2}\x{5D3}"
             text run at (25,0) width 16: "\x{661}\x{662}"
             text run at (41,0) width 14 RTL: "\x{627}\x{628}"
-        LayoutBlockFlow {P} at (0,720) size 769x20
-          LayoutText {#text} at (0,0) size 32x19
-            text run at (0,0) width 7: "\x{202A}?"
-            text run at (7,0) width 13: "\x{202C}(^"
-            text run at (20,0) width 12 RTL: "\x{5D2}\x{5D3}"
-        LayoutBlockFlow {P} at (0,756) size 769x20
-          LayoutText {#text} at (0,0) size 32x19
-            text run at (0,0) width 25 RTL: "\x{202C}(^\x{5D2}\x{5D3}"
-            text run at (25,0) width 7 RTL: "\x{202B}?"
-        LayoutBlockFlow {P} at (0,792) size 769x20
+        LayoutBlockFlow {P} at (0,724) size 769x22
+          LayoutText {#text} at (0,2) size 32x19
+            text run at (0,2) width 7: "\x{202A}?"
+            text run at (7,2) width 13: "\x{202C}(^"
+            text run at (20,2) width 12 RTL: "\x{5D2}\x{5D3}"
+        LayoutBlockFlow {P} at (0,762) size 769x22
+          LayoutText {#text} at (0,2) size 32x19
+            text run at (0,2) width 25 RTL: "\x{202C}(^\x{5D2}\x{5D3}"
+            text run at (25,2) width 7 RTL: "\x{202B}?"
+        LayoutBlockFlow {P} at (0,800) size 769x20
           LayoutText {#text} at (0,0) size 41x19
             text run at (0,0) width 28: "ab(^"
             text run at (28,0) width 13 RTL: "\x{62C}\x{62F}"
-        LayoutBlockFlow {P} at (0,828) size 769x20
+        LayoutBlockFlow {P} at (0,836) size 769x20
           LayoutText {#text} at (0,0) size 41x19
             text run at (0,0) width 41 RTL: "\x{5D0}\x{5D1}(^\x{62C}\x{62F}"
-        LayoutBlockFlow {P} at (0,864) size 769x20
+        LayoutBlockFlow {P} at (0,872) size 769x20
           LayoutText {#text} at (0,0) size 40x19
             text run at (0,0) width 40 RTL: "\x{627}\x{628}(^\x{62C}\x{62F}"
-        LayoutBlockFlow {P} at (0,900) size 769x20
+        LayoutBlockFlow {P} at (0,908) size 769x20
           LayoutText {#text} at (0,0) size 57x19
             text run at (0,0) width 44: "ab12(^"
             text run at (44,0) width 13 RTL: "\x{62C}\x{62F}"
-        LayoutBlockFlow {P} at (0,936) size 769x20
+        LayoutBlockFlow {P} at (0,944) size 769x20
           LayoutText {#text} at (0,0) size 57x19
             text run at (0,0) width 26 RTL: "(^\x{62C}\x{62F}"
             text run at (26,0) width 16: "12"
             text run at (42,0) width 15 RTL: "\x{5D0}\x{5D1}"
-        LayoutBlockFlow {P} at (0,972) size 769x20
+        LayoutBlockFlow {P} at (0,980) size 769x20
           LayoutText {#text} at (0,0) size 56x19
             text run at (0,0) width 26 RTL: "(^\x{62C}\x{62F}"
             text run at (26,0) width 16: "12"
             text run at (42,0) width 14 RTL: "\x{627}\x{628}"
-        LayoutBlockFlow {P} at (0,1008) size 769x20
+        LayoutBlockFlow {P} at (0,1016) size 769x20
           LayoutText {#text} at (0,0) size 57x19
             text run at (0,0) width 15: "ab"
             text run at (15,0) width 26 RTL: "(^\x{62C}\x{62F}"
             text run at (41,0) width 16: "\x{661}\x{662}"
-        LayoutBlockFlow {P} at (0,1044) size 769x20
+        LayoutBlockFlow {P} at (0,1052) size 769x20
           LayoutText {#text} at (0,0) size 57x19
             text run at (0,0) width 26 RTL: "(^\x{62C}\x{62F}"
             text run at (26,0) width 16: "\x{661}\x{662}"
             text run at (42,0) width 15 RTL: "\x{5D0}\x{5D1}"
-        LayoutBlockFlow {P} at (0,1080) size 769x20
+        LayoutBlockFlow {P} at (0,1088) size 769x20
           LayoutText {#text} at (0,0) size 56x19
             text run at (0,0) width 26 RTL: "(^\x{62C}\x{62F}"
             text run at (26,0) width 16: "\x{661}\x{662}"
             text run at (42,0) width 14 RTL: "\x{627}\x{628}"
-        LayoutBlockFlow {P} at (0,1116) size 769x22
+        LayoutBlockFlow {P} at (0,1124) size 769x22
           LayoutText {#text} at (0,2) size 33x19
             text run at (0,2) width 7: "\x{202A}?"
             text run at (7,2) width 13: "\x{202C}(^"
             text run at (20,2) width 13 RTL: "\x{62C}\x{62F}"
-        LayoutBlockFlow {P} at (0,1154) size 769x22
+        LayoutBlockFlow {P} at (0,1162) size 769x22
           LayoutText {#text} at (0,2) size 33x19
             text run at (0,2) width 26 RTL: "\x{202C}(^\x{62C}\x{62F}"
             text run at (26,2) width 7 RTL: "\x{202B}?"
-        LayoutBlockFlow {P} at (0,1192) size 769x20
+        LayoutBlockFlow {P} at (0,1200) size 769x20
           LayoutText {#text} at (0,0) size 60x19
             text run at (0,0) width 44: "ab(^34"
             text run at (44,0) width 10 RTL: "\x{5E9}"
             text run at (54,0) width 6: "z"
-        LayoutBlockFlow {P} at (0,1228) size 769x20
+        LayoutBlockFlow {P} at (0,1236) size 769x20
           LayoutText {#text} at (0,0) size 60x19
             text run at (0,0) width 10 RTL: "\x{5E9}"
             text run at (10,0) width 16: "34"
             text run at (26,0) width 28 RTL: "\x{5D0}\x{5D1}(^"
             text run at (54,0) width 6: "z"
-        LayoutBlockFlow {P} at (0,1264) size 769x20
+        LayoutBlockFlow {P} at (0,1272) size 769x20
           LayoutText {#text} at (0,0) size 59x19
             text run at (0,0) width 10 RTL: "\x{5E9}"
             text run at (10,0) width 16: "34"
             text run at (26,0) width 27 RTL: "\x{627}\x{628}(^"
             text run at (53,0) width 6: "z"
-        LayoutBlockFlow {P} at (0,1300) size 769x20
+        LayoutBlockFlow {P} at (0,1308) size 769x20
           LayoutText {#text} at (0,0) size 76x19
             text run at (0,0) width 60: "ab12(^34"
             text run at (60,0) width 10 RTL: "\x{5E9}"
             text run at (70,0) width 6: "z"
-        LayoutBlockFlow {P} at (0,1336) size 769x20
+        LayoutBlockFlow {P} at (0,1344) size 769x20
           LayoutText {#text} at (0,0) size 76x19
             text run at (0,0) width 10 RTL: "\x{5E9}"
             text run at (10,0) width 16: "34"
@@ -180,7 +180,7 @@
             text run at (39,0) width 16: "12"
             text run at (55,0) width 15 RTL: "\x{5D0}\x{5D1}"
             text run at (70,0) width 6: "z"
-        LayoutBlockFlow {P} at (0,1372) size 769x20
+        LayoutBlockFlow {P} at (0,1380) size 769x20
           LayoutText {#text} at (0,0) size 75x19
             text run at (0,0) width 10 RTL: "\x{5E9}"
             text run at (10,0) width 16: "34"
@@ -188,14 +188,14 @@
             text run at (39,0) width 16: "12"
             text run at (55,0) width 14 RTL: "\x{627}\x{628}"
             text run at (69,0) width 6: "z"
-        LayoutBlockFlow {P} at (0,1408) size 769x20
+        LayoutBlockFlow {P} at (0,1416) size 769x20
           LayoutText {#text} at (0,0) size 76x19
             text run at (0,0) width 15: "ab"
             text run at (15,0) width 16: "\x{661}\x{662}"
             text run at (31,0) width 29: "(^34"
             text run at (60,0) width 10 RTL: "\x{5E9}"
             text run at (70,0) width 6: "z"
-        LayoutBlockFlow {P} at (0,1444) size 769x20
+        LayoutBlockFlow {P} at (0,1452) size 769x20
           LayoutText {#text} at (0,0) size 76x19
             text run at (0,0) width 10 RTL: "\x{5E9}"
             text run at (10,0) width 16: "34"
@@ -203,7 +203,7 @@
             text run at (39,0) width 16: "\x{661}\x{662}"
             text run at (55,0) width 15 RTL: "\x{5D0}\x{5D1}"
             text run at (70,0) width 6: "z"
-        LayoutBlockFlow {P} at (0,1480) size 769x20
+        LayoutBlockFlow {P} at (0,1488) size 769x20
           LayoutText {#text} at (0,0) size 75x19
             text run at (0,0) width 10 RTL: "\x{5E9}"
             text run at (10,0) width 16: "34"
@@ -211,44 +211,44 @@
             text run at (39,0) width 16: "\x{661}\x{662}"
             text run at (55,0) width 14 RTL: "\x{627}\x{628}"
             text run at (69,0) width 6: "z"
-        LayoutBlockFlow {P} at (0,1516) size 769x20
-          LayoutText {#text} at (0,0) size 52x19
-            text run at (0,0) width 7: "\x{202A}?"
-            text run at (7,0) width 29: "\x{202C}(^34"
-            text run at (36,0) width 10 RTL: "\x{5E9}"
-            text run at (46,0) width 6: "z"
-        LayoutBlockFlow {P} at (0,1552) size 769x20
-          LayoutText {#text} at (0,0) size 52x19
-            text run at (0,0) width 10 RTL: "\x{5E9}"
-            text run at (10,0) width 16: "34"
-            text run at (26,0) width 13 RTL: "\x{202C}(^"
-            text run at (39,0) width 7 RTL: "\x{202B}?"
-            text run at (46,0) width 6: "z"
-        LayoutBlockFlow {P} at (0,1588) size 769x20
+        LayoutBlockFlow {P} at (0,1524) size 769x22
+          LayoutText {#text} at (0,2) size 52x19
+            text run at (0,2) width 7: "\x{202A}?"
+            text run at (7,2) width 29: "\x{202C}(^34"
+            text run at (36,2) width 10 RTL: "\x{5E9}"
+            text run at (46,2) width 6: "z"
+        LayoutBlockFlow {P} at (0,1562) size 769x22
+          LayoutText {#text} at (0,2) size 52x19
+            text run at (0,2) width 10 RTL: "\x{5E9}"
+            text run at (10,2) width 16: "34"
+            text run at (26,2) width 13 RTL: "\x{202C}(^"
+            text run at (39,2) width 7 RTL: "\x{202B}?"
+            text run at (46,2) width 6: "z"
+        LayoutBlockFlow {P} at (0,1600) size 769x20
           LayoutText {#text} at (0,0) size 60x19
             text run at (0,0) width 28: "ab(^"
             text run at (28,0) width 10 RTL: "\x{5E9}"
             text run at (38,0) width 16: "\x{663}\x{664}"
             text run at (54,0) width 6: "z"
-        LayoutBlockFlow {P} at (0,1624) size 769x20
+        LayoutBlockFlow {P} at (0,1636) size 769x20
           LayoutText {#text} at (0,0) size 60x19
             text run at (0,0) width 10 RTL: "\x{5E9}"
             text run at (10,0) width 16: "\x{663}\x{664}"
             text run at (26,0) width 28 RTL: "\x{5D0}\x{5D1}(^"
             text run at (54,0) width 6: "z"
-        LayoutBlockFlow {P} at (0,1660) size 769x20
+        LayoutBlockFlow {P} at (0,1672) size 769x20
           LayoutText {#text} at (0,0) size 59x19
             text run at (0,0) width 10 RTL: "\x{5E9}"
             text run at (10,0) width 16: "\x{663}\x{664}"
             text run at (26,0) width 27 RTL: "\x{627}\x{628}(^"
             text run at (53,0) width 6: "z"
-        LayoutBlockFlow {P} at (0,1696) size 769x20
+        LayoutBlockFlow {P} at (0,1708) size 769x20
           LayoutText {#text} at (0,0) size 76x19
             text run at (0,0) width 44: "ab12(^"
             text run at (44,0) width 10 RTL: "\x{5E9}"
             text run at (54,0) width 16: "\x{663}\x{664}"
             text run at (70,0) width 6: "z"
-        LayoutBlockFlow {P} at (0,1732) size 769x20
+        LayoutBlockFlow {P} at (0,1744) size 769x20
           LayoutText {#text} at (0,0) size 76x19
             text run at (0,0) width 10 RTL: "\x{5E9}"
             text run at (10,0) width 16: "\x{663}\x{664}"
@@ -256,7 +256,7 @@
             text run at (39,0) width 16: "12"
             text run at (55,0) width 15 RTL: "\x{5D0}\x{5D1}"
             text run at (70,0) width 6: "z"
-        LayoutBlockFlow {P} at (0,1768) size 769x20
+        LayoutBlockFlow {P} at (0,1780) size 769x20
           LayoutText {#text} at (0,0) size 75x19
             text run at (0,0) width 10 RTL: "\x{5E9}"
             text run at (10,0) width 16: "\x{663}\x{664}"
@@ -264,7 +264,7 @@
             text run at (39,0) width 16: "12"
             text run at (55,0) width 14 RTL: "\x{627}\x{628}"
             text run at (69,0) width 6: "z"
-        LayoutBlockFlow {P} at (0,1804) size 769x20
+        LayoutBlockFlow {P} at (0,1816) size 769x20
           LayoutText {#text} at (0,0) size 76x19
             text run at (0,0) width 15: "ab"
             text run at (15,0) width 10 RTL: "\x{5E9}"
@@ -272,7 +272,7 @@
             text run at (41,0) width 13 RTL: "(^"
             text run at (54,0) width 16: "\x{661}\x{662}"
             text run at (70,0) width 6: "z"
-        LayoutBlockFlow {P} at (0,1840) size 769x20
+        LayoutBlockFlow {P} at (0,1852) size 769x20
           LayoutText {#text} at (0,0) size 76x19
             text run at (0,0) width 10 RTL: "\x{5E9}"
             text run at (10,0) width 16: "\x{663}\x{664}"
@@ -280,7 +280,7 @@
             text run at (39,0) width 16: "\x{661}\x{662}"
             text run at (55,0) width 15 RTL: "\x{5D0}\x{5D1}"
             text run at (70,0) width 6: "z"
-        LayoutBlockFlow {P} at (0,1876) size 769x20
+        LayoutBlockFlow {P} at (0,1888) size 769x20
           LayoutText {#text} at (0,0) size 75x19
             text run at (0,0) width 10 RTL: "\x{5E9}"
             text run at (10,0) width 16: "\x{663}\x{664}"
@@ -288,217 +288,217 @@
             text run at (39,0) width 16: "\x{661}\x{662}"
             text run at (55,0) width 14 RTL: "\x{627}\x{628}"
             text run at (69,0) width 6: "z"
-        LayoutBlockFlow {P} at (0,1912) size 769x22
+        LayoutBlockFlow {P} at (0,1924) size 769x22
           LayoutText {#text} at (0,2) size 52x19
             text run at (0,2) width 7: "\x{202A}?"
             text run at (7,2) width 13: "\x{202C}(^"
             text run at (20,2) width 10 RTL: "\x{5E9}"
             text run at (30,2) width 16: "\x{663}\x{664}"
             text run at (46,2) width 6: "z"
-        LayoutBlockFlow {P} at (0,1950) size 769x22
+        LayoutBlockFlow {P} at (0,1962) size 769x22
           LayoutText {#text} at (0,2) size 52x19
             text run at (0,2) width 10 RTL: "\x{5E9}"
             text run at (10,2) width 16: "\x{663}\x{664}"
             text run at (26,2) width 13 RTL: "\x{202C}(^"
             text run at (39,2) width 7 RTL: "\x{202B}?"
             text run at (46,2) width 6: "z"
-        LayoutBlockFlow {P} at (0,1988) size 769x20
-          LayoutText {#text} at (0,0) size 33x19
-            text run at (0,0) width 28: "ab(^"
-            text run at (28,0) width 5: "\x{202A}!"
-            text run at (33,0) width 0: "\x{202C}"
-        LayoutBlockFlow {P} at (0,2024) size 769x20
-          LayoutText {#text} at (0,0) size 33x19
-            text run at (0,0) width 15 RTL: "\x{5D0}\x{5D1}"
-            text run at (15,0) width 13: "(^"
-            text run at (28,0) width 5: "\x{202A}!"
-            text run at (33,0) width 0: "\x{202C}"
-        LayoutBlockFlow {P} at (0,2060) size 769x22
+        LayoutBlockFlow {P} at (0,2000) size 769x22
+          LayoutText {#text} at (0,2) size 33x19
+            text run at (0,2) width 28: "ab(^"
+            text run at (28,2) width 5: "\x{202A}!"
+            text run at (33,2) width 0: "\x{202C}"
+        LayoutBlockFlow {P} at (0,2038) size 769x22
+          LayoutText {#text} at (0,2) size 33x19
+            text run at (0,2) width 15 RTL: "\x{5D0}\x{5D1}"
+            text run at (15,2) width 13: "(^"
+            text run at (28,2) width 5: "\x{202A}!"
+            text run at (33,2) width 0: "\x{202C}"
+        LayoutBlockFlow {P} at (0,2076) size 769x22
           LayoutText {#text} at (0,2) size 32x19
             text run at (0,2) width 14 RTL: "\x{627}\x{628}"
             text run at (14,2) width 13: "(^"
             text run at (27,2) width 5: "\x{202A}!"
             text run at (32,2) width 0: "\x{202C}"
-        LayoutBlockFlow {P} at (0,2098) size 769x20
-          LayoutText {#text} at (0,0) size 49x19
-            text run at (0,0) width 44: "ab12(^"
-            text run at (44,0) width 5: "\x{202A}!"
-            text run at (49,0) width 0: "\x{202C}"
-        LayoutBlockFlow {P} at (0,2134) size 769x20
-          LayoutText {#text} at (0,0) size 49x19
-            text run at (0,0) width 16: "12"
-            text run at (16,0) width 15 RTL: "\x{5D0}\x{5D1}"
-            text run at (31,0) width 13: "(^"
-            text run at (44,0) width 5: "\x{202A}!"
-            text run at (49,0) width 0: "\x{202C}"
-        LayoutBlockFlow {P} at (0,2170) size 769x22
+        LayoutBlockFlow {P} at (0,2114) size 769x22
+          LayoutText {#text} at (0,2) size 49x19
+            text run at (0,2) width 44: "ab12(^"
+            text run at (44,2) width 5: "\x{202A}!"
+            text run at (49,2) width 0: "\x{202C}"
+        LayoutBlockFlow {P} at (0,2152) size 769x22
+          LayoutText {#text} at (0,2) size 49x19
+            text run at (0,2) width 16: "12"
+            text run at (16,2) width 15 RTL: "\x{5D0}\x{5D1}"
+            text run at (31,2) width 13: "(^"
+            text run at (44,2) width 5: "\x{202A}!"
+            text run at (49,2) width 0: "\x{202C}"
+        LayoutBlockFlow {P} at (0,2190) size 769x22
           LayoutText {#text} at (0,2) size 48x19
             text run at (0,2) width 16: "12"
             text run at (16,2) width 14 RTL: "\x{627}\x{628}"
             text run at (30,2) width 13: "(^"
             text run at (43,2) width 5: "\x{202A}!"
             text run at (48,2) width 0: "\x{202C}"
-        LayoutBlockFlow {P} at (0,2208) size 769x22
+        LayoutBlockFlow {P} at (0,2228) size 769x22
           LayoutText {#text} at (0,2) size 49x19
             text run at (0,2) width 15: "ab"
             text run at (15,2) width 16: "\x{661}\x{662}"
             text run at (31,2) width 13: "(^"
             text run at (44,2) width 5: "\x{202A}!"
             text run at (49,2) width 0: "\x{202C}"
-        LayoutBlockFlow {P} at (0,2246) size 769x22
+        LayoutBlockFlow {P} at (0,2266) size 769x22
           LayoutText {#text} at (0,2) size 49x19
             text run at (0,2) width 16: "\x{661}\x{662}"
             text run at (16,2) width 15 RTL: "\x{5D0}\x{5D1}"
             text run at (31,2) width 13: "(^"
             text run at (44,2) width 5: "\x{202A}!"
             text run at (49,2) width 0: "\x{202C}"
-        LayoutBlockFlow {P} at (0,2284) size 769x22
+        LayoutBlockFlow {P} at (0,2304) size 769x22
           LayoutText {#text} at (0,2) size 48x19
             text run at (0,2) width 16: "\x{661}\x{662}"
             text run at (16,2) width 14 RTL: "\x{627}\x{628}"
             text run at (30,2) width 13: "(^"
             text run at (43,2) width 5: "\x{202A}!"
             text run at (48,2) width 0: "\x{202C}"
-        LayoutBlockFlow {P} at (0,2322) size 769x20
-          LayoutText {#text} at (0,0) size 25x19
-            text run at (0,0) width 7: "\x{202A}?"
-            text run at (7,0) width 13: "\x{202C}(^"
-            text run at (20,0) width 5: "\x{202A}!"
-            text run at (25,0) width 0: "\x{202C}"
-        LayoutBlockFlow {P} at (0,2358) size 769x20
-          LayoutText {#text} at (0,0) size 25x19
-            text run at (0,0) width 7 RTL: "\x{202B}?"
-            text run at (7,0) width 13: "\x{202C}(^"
-            text run at (20,0) width 5: "\x{202A}!"
-            text run at (25,0) width 0: "\x{202C}"
-        LayoutBlockFlow {P} at (0,2394) size 769x20
-          LayoutText {#text} at (0,0) size 33x19
-            text run at (0,0) width 28: "ab(^"
-            text run at (28,0) width 5 RTL: "\x{202B}!"
-            text run at (33,0) width 0: "\x{202C}"
-        LayoutBlockFlow {P} at (0,2430) size 769x20
-          LayoutText {#text} at (0,0) size 33x19
-            text run at (0,0) width 5 RTL: "\x{202B}!"
-            text run at (5,0) width 28 RTL: "\x{5D0}\x{5D1}(^"
-            text run at (33,0) width 0: "\x{202C}"
-        LayoutBlockFlow {P} at (0,2466) size 769x22
+        LayoutBlockFlow {P} at (0,2342) size 769x22
+          LayoutText {#text} at (0,2) size 25x19
+            text run at (0,2) width 7: "\x{202A}?"
+            text run at (7,2) width 13: "\x{202C}(^"
+            text run at (20,2) width 5: "\x{202A}!"
+            text run at (25,2) width 0: "\x{202C}"
+        LayoutBlockFlow {P} at (0,2380) size 769x22
+          LayoutText {#text} at (0,2) size 25x19
+            text run at (0,2) width 7 RTL: "\x{202B}?"
+            text run at (7,2) width 13: "\x{202C}(^"
+            text run at (20,2) width 5: "\x{202A}!"
+            text run at (25,2) width 0: "\x{202C}"
+        LayoutBlockFlow {P} at (0,2418) size 769x22
+          LayoutText {#text} at (0,2) size 33x19
+            text run at (0,2) width 28: "ab(^"
+            text run at (28,2) width 5 RTL: "\x{202B}!"
+            text run at (33,2) width 0: "\x{202C}"
+        LayoutBlockFlow {P} at (0,2456) size 769x22
+          LayoutText {#text} at (0,2) size 33x19
+            text run at (0,2) width 5 RTL: "\x{202B}!"
+            text run at (5,2) width 28 RTL: "\x{5D0}\x{5D1}(^"
+            text run at (33,2) width 0: "\x{202C}"
+        LayoutBlockFlow {P} at (0,2494) size 769x22
           LayoutText {#text} at (0,2) size 32x19
             text run at (0,2) width 5 RTL: "\x{202B}!"
             text run at (5,2) width 27 RTL: "\x{627}\x{628}(^"
             text run at (32,2) width 0: "\x{202C}"
-        LayoutBlockFlow {P} at (0,2504) size 769x20
-          LayoutText {#text} at (0,0) size 49x19
-            text run at (0,0) width 44: "ab12(^"
-            text run at (44,0) width 5 RTL: "\x{202B}!"
-            text run at (49,0) width 0: "\x{202C}"
-        LayoutBlockFlow {P} at (0,2540) size 769x20
-          LayoutText {#text} at (0,0) size 49x19
-            text run at (0,0) width 5 RTL: "\x{202B}!"
-            text run at (5,0) width 13 RTL: "(^"
-            text run at (18,0) width 16: "12"
-            text run at (34,0) width 15 RTL: "\x{5D0}\x{5D1}"
-            text run at (49,0) width 0: "\x{202C}"
-        LayoutBlockFlow {P} at (0,2576) size 769x22
+        LayoutBlockFlow {P} at (0,2532) size 769x22
+          LayoutText {#text} at (0,2) size 49x19
+            text run at (0,2) width 44: "ab12(^"
+            text run at (44,2) width 5 RTL: "\x{202B}!"
+            text run at (49,2) width 0: "\x{202C}"
+        LayoutBlockFlow {P} at (0,2570) size 769x22
+          LayoutText {#text} at (0,2) size 49x19
+            text run at (0,2) width 5 RTL: "\x{202B}!"
+            text run at (5,2) width 13 RTL: "(^"
+            text run at (18,2) width 16: "12"
+            text run at (34,2) width 15 RTL: "\x{5D0}\x{5D1}"
+            text run at (49,2) width 0: "\x{202C}"
+        LayoutBlockFlow {P} at (0,2608) size 769x22
           LayoutText {#text} at (0,2) size 48x19
             text run at (0,2) width 5 RTL: "\x{202B}!"
             text run at (5,2) width 13 RTL: "(^"
             text run at (18,2) width 16: "12"
             text run at (34,2) width 14 RTL: "\x{627}\x{628}"
             text run at (48,2) width 0: "\x{202C}"
-        LayoutBlockFlow {P} at (0,2614) size 769x22
+        LayoutBlockFlow {P} at (0,2646) size 769x22
           LayoutText {#text} at (0,2) size 49x19
             text run at (0,2) width 15: "ab"
             text run at (15,2) width 5 RTL: "\x{202B}!"
             text run at (20,2) width 13 RTL: "(^"
             text run at (33,2) width 16: "\x{661}\x{662}"
             text run at (49,2) width 0: "\x{202C}"
-        LayoutBlockFlow {P} at (0,2652) size 769x22
+        LayoutBlockFlow {P} at (0,2684) size 769x22
           LayoutText {#text} at (0,2) size 49x19
             text run at (0,2) width 5 RTL: "\x{202B}!"
             text run at (5,2) width 13 RTL: "(^"
             text run at (18,2) width 16: "\x{661}\x{662}"
             text run at (34,2) width 15 RTL: "\x{5D0}\x{5D1}"
             text run at (49,2) width 0: "\x{202C}"
-        LayoutBlockFlow {P} at (0,2690) size 769x22
+        LayoutBlockFlow {P} at (0,2722) size 769x22
           LayoutText {#text} at (0,2) size 48x19
             text run at (0,2) width 5 RTL: "\x{202B}!"
             text run at (5,2) width 13 RTL: "(^"
             text run at (18,2) width 16: "\x{661}\x{662}"
             text run at (34,2) width 14 RTL: "\x{627}\x{628}"
             text run at (48,2) width 0: "\x{202C}"
-        LayoutBlockFlow {P} at (0,2728) size 769x20
-          LayoutText {#text} at (0,0) size 25x19
-            text run at (0,0) width 7: "\x{202A}?"
-            text run at (7,0) width 13: "\x{202C}(^"
-            text run at (20,0) width 5 RTL: "\x{202B}!"
-            text run at (25,0) width 0: "\x{202C}"
-        LayoutBlockFlow {P} at (0,2764) size 769x20
-          LayoutText {#text} at (0,0) size 25x19
-            text run at (0,0) width 5 RTL: "\x{202B}!"
-            text run at (5,0) width 13 RTL: "\x{202C}(^"
-            text run at (18,0) width 7 RTL: "\x{202B}?"
-            text run at (25,0) width 0: "\x{202C}"
-        LayoutBlockFlow {P} at (0,2800) size 769x20
-          LayoutText {#text} at (0,0) size 28x19
-            text run at (0,0) width 28: "\x{202A}ab(^"
-            text run at (28,0) width 0: "\x{202C}"
-        LayoutBlockFlow {P} at (0,2836) size 769x20
-          LayoutText {#text} at (0,0) size 28x19
-            text run at (0,0) width 15 RTL: "\x{202A}\x{5D0}\x{5D1}"
-            text run at (15,0) width 13: "(^"
-            text run at (28,0) width 0: "\x{202C}"
-        LayoutBlockFlow {P} at (0,2872) size 769x22
+        LayoutBlockFlow {P} at (0,2760) size 769x22
+          LayoutText {#text} at (0,2) size 25x19
+            text run at (0,2) width 7: "\x{202A}?"
+            text run at (7,2) width 13: "\x{202C}(^"
+            text run at (20,2) width 5 RTL: "\x{202B}!"
+            text run at (25,2) width 0: "\x{202C}"
+        LayoutBlockFlow {P} at (0,2798) size 769x22
+          LayoutText {#text} at (0,2) size 25x19
+            text run at (0,2) width 5 RTL: "\x{202B}!"
+            text run at (5,2) width 13 RTL: "\x{202C}(^"
+            text run at (18,2) width 7 RTL: "\x{202B}?"
+            text run at (25,2) width 0: "\x{202C}"
+        LayoutBlockFlow {P} at (0,2836) size 769x22
+          LayoutText {#text} at (0,2) size 28x19
+            text run at (0,2) width 28: "\x{202A}ab(^"
+            text run at (28,2) width 0: "\x{202C}"
+        LayoutBlockFlow {P} at (0,2874) size 769x22
+          LayoutText {#text} at (0,2) size 28x19
+            text run at (0,2) width 15 RTL: "\x{202A}\x{5D0}\x{5D1}"
+            text run at (15,2) width 13: "(^"
+            text run at (28,2) width 0: "\x{202C}"
+        LayoutBlockFlow {P} at (0,2912) size 769x22
           LayoutText {#text} at (0,2) size 27x19
             text run at (0,2) width 14 RTL: "\x{202A}\x{627}\x{628}"
             text run at (14,2) width 13: "(^"
             text run at (27,2) width 0: "\x{202C}"
-        LayoutBlockFlow {P} at (0,2910) size 769x20
-          LayoutText {#text} at (0,0) size 44x19
-            text run at (0,0) width 44: "\x{202A}ab12(^"
-            text run at (44,0) width 0: "\x{202C}"
-        LayoutBlockFlow {P} at (0,2946) size 769x20
-          LayoutText {#text} at (0,0) size 44x19
-            text run at (0,0) width 16: "12"
-            text run at (16,0) width 15 RTL: "\x{202A}\x{5D0}\x{5D1}"
-            text run at (31,0) width 13: "(^"
-            text run at (44,0) width 0: "\x{202C}"
-        LayoutBlockFlow {P} at (0,2982) size 769x22
+        LayoutBlockFlow {P} at (0,2950) size 769x22
+          LayoutText {#text} at (0,2) size 44x19
+            text run at (0,2) width 44: "\x{202A}ab12(^"
+            text run at (44,2) width 0: "\x{202C}"
+        LayoutBlockFlow {P} at (0,2988) size 769x22
+          LayoutText {#text} at (0,2) size 44x19
+            text run at (0,2) width 16: "12"
+            text run at (16,2) width 15 RTL: "\x{202A}\x{5D0}\x{5D1}"
+            text run at (31,2) width 13: "(^"
+            text run at (44,2) width 0: "\x{202C}"
+        LayoutBlockFlow {P} at (0,3026) size 769x22
           LayoutText {#text} at (0,2) size 43x19
             text run at (0,2) width 16: "12"
             text run at (16,2) width 14 RTL: "\x{202A}\x{627}\x{628}"
             text run at (30,2) width 13: "(^"
             text run at (43,2) width 0: "\x{202C}"
-        LayoutBlockFlow {P} at (0,3020) size 769x22
+        LayoutBlockFlow {P} at (0,3064) size 769x22
           LayoutText {#text} at (0,2) size 44x19
             text run at (0,2) width 15: "\x{202A}ab"
             text run at (15,2) width 16: "\x{661}\x{662}"
             text run at (31,2) width 13: "(^"
             text run at (44,2) width 0: "\x{202C}"
-        LayoutBlockFlow {P} at (0,3058) size 769x22
+        LayoutBlockFlow {P} at (0,3102) size 769x22
           LayoutText {#text} at (0,2) size 44x19
             text run at (0,2) width 16: "\x{661}\x{662}"
             text run at (16,2) width 15 RTL: "\x{202A}\x{5D0}\x{5D1}"
             text run at (31,2) width 13: "(^"
             text run at (44,2) width 0: "\x{202C}"
-        LayoutBlockFlow {P} at (0,3096) size 769x22
+        LayoutBlockFlow {P} at (0,3140) size 769x22
           LayoutText {#text} at (0,2) size 43x19
             text run at (0,2) width 16: "\x{661}\x{662}"
             text run at (16,2) width 14 RTL: "\x{202A}\x{627}\x{628}"
             text run at (30,2) width 13: "(^"
             text run at (43,2) width 0: "\x{202C}"
-        LayoutBlockFlow {P} at (0,3134) size 769x20
-          LayoutText {#text} at (0,0) size 20x19
-            text run at (0,0) width 0: "\x{202A}"
-            text run at (0,0) width 7: "\x{202A}?"
-            text run at (7,0) width 13: "\x{202C}(^"
-            text run at (20,0) width 0: "\x{202C}"
-        LayoutBlockFlow {P} at (0,3170) size 769x20
-          LayoutText {#text} at (0,0) size 20x19
-            text run at (0,0) width 0: "\x{202A}"
-            text run at (0,0) width 7 RTL: "\x{202B}?"
-            text run at (7,0) width 13: "\x{202C}(^"
-            text run at (20,0) width 0: "\x{202C}"
-      LayoutBlockFlow {DIV} at (0,3242) size 769x3190
+        LayoutBlockFlow {P} at (0,3178) size 769x22
+          LayoutText {#text} at (0,2) size 20x19
+            text run at (0,2) width 0: "\x{202A}"
+            text run at (0,2) width 7: "\x{202A}?"
+            text run at (7,2) width 13: "\x{202C}(^"
+            text run at (20,2) width 0: "\x{202C}"
+        LayoutBlockFlow {P} at (0,3216) size 769x22
+          LayoutText {#text} at (0,2) size 20x19
+            text run at (0,2) width 0: "\x{202A}"
+            text run at (0,2) width 7 RTL: "\x{202B}?"
+            text run at (7,2) width 13: "\x{202C}(^"
+            text run at (20,2) width 0: "\x{202C}"
+      LayoutBlockFlow {DIV} at (0,3290) size 769x3238
         LayoutBlockFlow {P} at (0,0) size 769x20
           LayoutText {#text} at (0,0) size 43x19
             text run at (0,0) width 43: "ab(^cd"
@@ -542,130 +542,130 @@
             text run at (15,0) width 13 RTL: "(^"
             text run at (28,0) width 16: "\x{661}\x{662}"
             text run at (44,0) width 14 RTL: "\x{627}\x{628}"
-        LayoutBlockFlow {P} at (0,324) size 769x20
-          LayoutText {#text} at (0,0) size 35x19
-            text run at (0,0) width 7: "\x{202A}?"
-            text run at (7,0) width 28: "\x{202C}(^cd"
-        LayoutBlockFlow {P} at (0,360) size 769x20
-          LayoutText {#text} at (0,0) size 35x19
-            text run at (0,0) width 15: "cd"
-            text run at (15,0) width 13 RTL: "\x{202C}(^"
-            text run at (28,0) width 7 RTL: "\x{202B}?"
-        LayoutBlockFlow {P} at (0,396) size 769x20
+        LayoutBlockFlow {P} at (0,324) size 769x22
+          LayoutText {#text} at (0,2) size 35x19
+            text run at (0,2) width 7: "\x{202A}?"
+            text run at (7,2) width 28: "\x{202C}(^cd"
+        LayoutBlockFlow {P} at (0,362) size 769x22
+          LayoutText {#text} at (0,2) size 35x19
+            text run at (0,2) width 15: "cd"
+            text run at (15,2) width 13 RTL: "\x{202C}(^"
+            text run at (28,2) width 7 RTL: "\x{202B}?"
+        LayoutBlockFlow {P} at (0,400) size 769x20
           LayoutText {#text} at (0,0) size 40x19
             text run at (0,0) width 25 RTL: "(^\x{5D2}\x{5D3}"
             text run at (25,0) width 15: "ab"
-        LayoutBlockFlow {P} at (0,432) size 769x20
+        LayoutBlockFlow {P} at (0,436) size 769x20
           LayoutText {#text} at (0,0) size 40x19
             text run at (0,0) width 40 RTL: "\x{5D0}\x{5D1}(^\x{5D2}\x{5D3}"
-        LayoutBlockFlow {P} at (0,468) size 769x20
+        LayoutBlockFlow {P} at (0,472) size 769x20
           LayoutText {#text} at (0,0) size 39x19
             text run at (0,0) width 39 RTL: "\x{627}\x{628}(^\x{5D2}\x{5D3}"
-        LayoutBlockFlow {P} at (0,504) size 769x20
+        LayoutBlockFlow {P} at (0,508) size 769x20
           LayoutText {#text} at (0,0) size 56x19
             text run at (0,0) width 25 RTL: "(^\x{5D2}\x{5D3}"
             text run at (25,0) width 31: "ab12"
-        LayoutBlockFlow {P} at (0,540) size 769x20
+        LayoutBlockFlow {P} at (0,544) size 769x20
           LayoutText {#text} at (0,0) size 56x19
             text run at (0,0) width 25 RTL: "(^\x{5D2}\x{5D3}"
             text run at (25,0) width 16: "12"
             text run at (41,0) width 15 RTL: "\x{5D0}\x{5D1}"
-        LayoutBlockFlow {P} at (0,576) size 769x20
+        LayoutBlockFlow {P} at (0,580) size 769x20
           LayoutText {#text} at (0,0) size 55x19
             text run at (0,0) width 25 RTL: "(^\x{5D2}\x{5D3}"
             text run at (25,0) width 16: "12"
             text run at (41,0) width 14 RTL: "\x{627}\x{628}"
-        LayoutBlockFlow {P} at (0,612) size 769x20
+        LayoutBlockFlow {P} at (0,616) size 769x20
           LayoutText {#text} at (0,0) size 56x19
             text run at (0,0) width 25 RTL: "(^\x{5D2}\x{5D3}"
             text run at (25,0) width 31: "ab\x{661}\x{662}"
-        LayoutBlockFlow {P} at (0,648) size 769x20
+        LayoutBlockFlow {P} at (0,652) size 769x20
           LayoutText {#text} at (0,0) size 56x19
             text run at (0,0) width 25 RTL: "(^\x{5D2}\x{5D3}"
             text run at (25,0) width 16: "\x{661}\x{662}"
             text run at (41,0) width 15 RTL: "\x{5D0}\x{5D1}"
-        LayoutBlockFlow {P} at (0,684) size 769x20
+        LayoutBlockFlow {P} at (0,688) size 769x20
           LayoutText {#text} at (0,0) size 55x19
             text run at (0,0) width 25 RTL: "(^\x{5D2}\x{5D3}"
             text run at (25,0) width 16: "\x{661}\x{662}"
             text run at (41,0) width 14 RTL: "\x{627}\x{628}"
-        LayoutBlockFlow {P} at (0,720) size 769x20
-          LayoutText {#text} at (0,0) size 32x19
-            text run at (0,0) width 25 RTL: "\x{202C}(^\x{5D2}\x{5D3}"
-            text run at (25,0) width 7: "\x{202A}?"
-        LayoutBlockFlow {P} at (0,756) size 769x20
-          LayoutText {#text} at (0,0) size 32x19
-            text run at (0,0) width 25 RTL: "\x{202C}(^\x{5D2}\x{5D3}"
-            text run at (25,0) width 7 RTL: "\x{202B}?"
-        LayoutBlockFlow {P} at (0,792) size 769x20
+        LayoutBlockFlow {P} at (0,724) size 769x22
+          LayoutText {#text} at (0,2) size 32x19
+            text run at (0,2) width 25 RTL: "\x{202C}(^\x{5D2}\x{5D3}"
+            text run at (25,2) width 7: "\x{202A}?"
+        LayoutBlockFlow {P} at (0,762) size 769x22
+          LayoutText {#text} at (0,2) size 32x19
+            text run at (0,2) width 25 RTL: "\x{202C}(^\x{5D2}\x{5D3}"
+            text run at (25,2) width 7 RTL: "\x{202B}?"
+        LayoutBlockFlow {P} at (0,800) size 769x20
           LayoutText {#text} at (0,0) size 41x19
             text run at (0,0) width 26 RTL: "(^\x{62C}\x{62F}"
             text run at (26,0) width 15: "ab"
-        LayoutBlockFlow {P} at (0,828) size 769x20
+        LayoutBlockFlow {P} at (0,836) size 769x20
           LayoutText {#text} at (0,0) size 41x19
             text run at (0,0) width 41 RTL: "\x{5D0}\x{5D1}(^\x{62C}\x{62F}"
-        LayoutBlockFlow {P} at (0,864) size 769x20
+        LayoutBlockFlow {P} at (0,872) size 769x20
           LayoutText {#text} at (0,0) size 40x19
             text run at (0,0) width 40 RTL: "\x{627}\x{628}(^\x{62C}\x{62F}"
-        LayoutBlockFlow {P} at (0,900) size 769x20
+        LayoutBlockFlow {P} at (0,908) size 769x20
           LayoutText {#text} at (0,0) size 57x19
             text run at (0,0) width 26 RTL: "(^\x{62C}\x{62F}"
             text run at (26,0) width 31: "ab12"
-        LayoutBlockFlow {P} at (0,936) size 769x20
+        LayoutBlockFlow {P} at (0,944) size 769x20
           LayoutText {#text} at (0,0) size 57x19
             text run at (0,0) width 26 RTL: "(^\x{62C}\x{62F}"
             text run at (26,0) width 16: "12"
             text run at (42,0) width 15 RTL: "\x{5D0}\x{5D1}"
-        LayoutBlockFlow {P} at (0,972) size 769x20
+        LayoutBlockFlow {P} at (0,980) size 769x20
           LayoutText {#text} at (0,0) size 56x19
             text run at (0,0) width 26 RTL: "(^\x{62C}\x{62F}"
             text run at (26,0) width 16: "12"
             text run at (42,0) width 14 RTL: "\x{627}\x{628}"
-        LayoutBlockFlow {P} at (0,1008) size 769x20
+        LayoutBlockFlow {P} at (0,1016) size 769x20
           LayoutText {#text} at (0,0) size 57x19
             text run at (0,0) width 26 RTL: "(^\x{62C}\x{62F}"
             text run at (26,0) width 31: "ab\x{661}\x{662}"
-        LayoutBlockFlow {P} at (0,1044) size 769x20
+        LayoutBlockFlow {P} at (0,1052) size 769x20
           LayoutText {#text} at (0,0) size 57x19
             text run at (0,0) width 26 RTL: "(^\x{62C}\x{62F}"
             text run at (26,0) width 16: "\x{661}\x{662}"
             text run at (42,0) width 15 RTL: "\x{5D0}\x{5D1}"
-        LayoutBlockFlow {P} at (0,1080) size 769x20
+        LayoutBlockFlow {P} at (0,1088) size 769x20
           LayoutText {#text} at (0,0) size 56x19
             text run at (0,0) width 26 RTL: "(^\x{62C}\x{62F}"
             text run at (26,0) width 16: "\x{661}\x{662}"
             text run at (42,0) width 14 RTL: "\x{627}\x{628}"
-        LayoutBlockFlow {P} at (0,1116) size 769x22
+        LayoutBlockFlow {P} at (0,1124) size 769x22
           LayoutText {#text} at (0,2) size 33x19
             text run at (0,2) width 26 RTL: "\x{202C}(^\x{62C}\x{62F}"
             text run at (26,2) width 7: "\x{202A}?"
-        LayoutBlockFlow {P} at (0,1154) size 769x22
+        LayoutBlockFlow {P} at (0,1162) size 769x22
           LayoutText {#text} at (0,2) size 33x19
             text run at (0,2) width 26 RTL: "\x{202C}(^\x{62C}\x{62F}"
             text run at (26,2) width 7 RTL: "\x{202B}?"
-        LayoutBlockFlow {P} at (0,1192) size 769x20
+        LayoutBlockFlow {P} at (0,1200) size 769x20
           LayoutText {#text} at (0,0) size 60x19
             text run at (0,0) width 6: "z"
             text run at (6,0) width 10 RTL: "\x{5E9}"
             text run at (16,0) width 44: "ab(^34"
-        LayoutBlockFlow {P} at (0,1228) size 769x20
+        LayoutBlockFlow {P} at (0,1236) size 769x20
           LayoutText {#text} at (0,0) size 60x19
             text run at (0,0) width 6: "z"
             text run at (6,0) width 10 RTL: "\x{5E9}"
             text run at (16,0) width 16: "34"
             text run at (32,0) width 28 RTL: "\x{5D0}\x{5D1}(^"
-        LayoutBlockFlow {P} at (0,1264) size 769x20
+        LayoutBlockFlow {P} at (0,1272) size 769x20
           LayoutText {#text} at (0,0) size 59x19
             text run at (0,0) width 6: "z"
             text run at (6,0) width 10 RTL: "\x{5E9}"
             text run at (16,0) width 16: "34"
             text run at (32,0) width 27 RTL: "\x{627}\x{628}(^"
-        LayoutBlockFlow {P} at (0,1300) size 769x20
+        LayoutBlockFlow {P} at (0,1308) size 769x20
           LayoutText {#text} at (0,0) size 76x19
             text run at (0,0) width 6: "z"
             text run at (6,0) width 10 RTL: "\x{5E9}"
             text run at (16,0) width 60: "ab12(^34"
-        LayoutBlockFlow {P} at (0,1336) size 769x20
+        LayoutBlockFlow {P} at (0,1344) size 769x20
           LayoutText {#text} at (0,0) size 76x19
             text run at (0,0) width 6: "z"
             text run at (6,0) width 10 RTL: "\x{5E9}"
@@ -673,7 +673,7 @@
             text run at (32,0) width 13 RTL: "(^"
             text run at (45,0) width 16: "12"
             text run at (61,0) width 15 RTL: "\x{5D0}\x{5D1}"
-        LayoutBlockFlow {P} at (0,1372) size 769x20
+        LayoutBlockFlow {P} at (0,1380) size 769x20
           LayoutText {#text} at (0,0) size 75x19
             text run at (0,0) width 6: "z"
             text run at (6,0) width 10 RTL: "\x{5E9}"
@@ -681,14 +681,14 @@
             text run at (32,0) width 13 RTL: "(^"
             text run at (45,0) width 16: "12"
             text run at (61,0) width 14 RTL: "\x{627}\x{628}"
-        LayoutBlockFlow {P} at (0,1408) size 769x20
+        LayoutBlockFlow {P} at (0,1416) size 769x20
           LayoutText {#text} at (0,0) size 76x19
             text run at (0,0) width 6: "z"
             text run at (6,0) width 10 RTL: "\x{5E9}"
             text run at (16,0) width 16: "34"
             text run at (32,0) width 13 RTL: "(^"
             text run at (45,0) width 31: "ab\x{661}\x{662}"
-        LayoutBlockFlow {P} at (0,1444) size 769x20
+        LayoutBlockFlow {P} at (0,1452) size 769x20
           LayoutText {#text} at (0,0) size 76x19
             text run at (0,0) width 6: "z"
             text run at (6,0) width 10 RTL: "\x{5E9}"
@@ -696,7 +696,7 @@
             text run at (32,0) width 13 RTL: "(^"
             text run at (45,0) width 16: "\x{661}\x{662}"
             text run at (61,0) width 15 RTL: "\x{5D0}\x{5D1}"
-        LayoutBlockFlow {P} at (0,1480) size 769x20
+        LayoutBlockFlow {P} at (0,1488) size 769x20
           LayoutText {#text} at (0,0) size 75x19
             text run at (0,0) width 6: "z"
             text run at (6,0) width 10 RTL: "\x{5E9}"
@@ -704,46 +704,46 @@
             text run at (32,0) width 13 RTL: "(^"
             text run at (45,0) width 16: "\x{661}\x{662}"
             text run at (61,0) width 14 RTL: "\x{627}\x{628}"
-        LayoutBlockFlow {P} at (0,1516) size 769x20
-          LayoutText {#text} at (0,0) size 52x19
-            text run at (0,0) width 6: "z"
-            text run at (6,0) width 10 RTL: "\x{5E9}"
-            text run at (16,0) width 7: "\x{202A}?"
-            text run at (23,0) width 29: "\x{202C}(^34"
-        LayoutBlockFlow {P} at (0,1552) size 769x20
-          LayoutText {#text} at (0,0) size 52x19
-            text run at (0,0) width 6: "z"
-            text run at (6,0) width 10 RTL: "\x{5E9}"
-            text run at (16,0) width 16: "34"
-            text run at (32,0) width 13 RTL: "\x{202C}(^"
-            text run at (45,0) width 7 RTL: "\x{202B}?"
-        LayoutBlockFlow {P} at (0,1588) size 769x20
+        LayoutBlockFlow {P} at (0,1524) size 769x22
+          LayoutText {#text} at (0,2) size 52x19
+            text run at (0,2) width 6: "z"
+            text run at (6,2) width 10 RTL: "\x{5E9}"
+            text run at (16,2) width 7: "\x{202A}?"
+            text run at (23,2) width 29: "\x{202C}(^34"
+        LayoutBlockFlow {P} at (0,1562) size 769x22
+          LayoutText {#text} at (0,2) size 52x19
+            text run at (0,2) width 6: "z"
+            text run at (6,2) width 10 RTL: "\x{5E9}"
+            text run at (16,2) width 16: "34"
+            text run at (32,2) width 13 RTL: "\x{202C}(^"
+            text run at (45,2) width 7 RTL: "\x{202B}?"
+        LayoutBlockFlow {P} at (0,1600) size 769x20
           LayoutText {#text} at (0,0) size 60x19
             text run at (0,0) width 6: "z"
             text run at (6,0) width 10 RTL: "\x{5E9}"
             text run at (16,0) width 16: "\x{663}\x{664}"
             text run at (32,0) width 13 RTL: "(^"
             text run at (45,0) width 15: "ab"
-        LayoutBlockFlow {P} at (0,1624) size 769x20
+        LayoutBlockFlow {P} at (0,1636) size 769x20
           LayoutText {#text} at (0,0) size 60x19
             text run at (0,0) width 6: "z"
             text run at (6,0) width 10 RTL: "\x{5E9}"
             text run at (16,0) width 16: "\x{663}\x{664}"
             text run at (32,0) width 28 RTL: "\x{5D0}\x{5D1}(^"
-        LayoutBlockFlow {P} at (0,1660) size 769x20
+        LayoutBlockFlow {P} at (0,1672) size 769x20
           LayoutText {#text} at (0,0) size 59x19
             text run at (0,0) width 6: "z"
             text run at (6,0) width 10 RTL: "\x{5E9}"
             text run at (16,0) width 16: "\x{663}\x{664}"
             text run at (32,0) width 27 RTL: "\x{627}\x{628}(^"
-        LayoutBlockFlow {P} at (0,1696) size 769x20
+        LayoutBlockFlow {P} at (0,1708) size 769x20
           LayoutText {#text} at (0,0) size 76x19
             text run at (0,0) width 6: "z"
             text run at (6,0) width 10 RTL: "\x{5E9}"
             text run at (16,0) width 16: "\x{663}\x{664}"
             text run at (32,0) width 13 RTL: "(^"
             text run at (45,0) width 31: "ab12"
-        LayoutBlockFlow {P} at (0,1732) size 769x20
+        LayoutBlockFlow {P} at (0,1744) size 769x20
           LayoutText {#text} at (0,0) size 76x19
             text run at (0,0) width 6: "z"
             text run at (6,0) width 10 RTL: "\x{5E9}"
@@ -751,7 +751,7 @@
             text run at (32,0) width 13 RTL: "(^"
             text run at (45,0) width 16: "12"
             text run at (61,0) width 15 RTL: "\x{5D0}\x{5D1}"
-        LayoutBlockFlow {P} at (0,1768) size 769x20
+        LayoutBlockFlow {P} at (0,1780) size 769x20
           LayoutText {#text} at (0,0) size 75x19
             text run at (0,0) width 6: "z"
             text run at (6,0) width 10 RTL: "\x{5E9}"
@@ -759,14 +759,14 @@
             text run at (32,0) width 13 RTL: "(^"
             text run at (45,0) width 16: "12"
             text run at (61,0) width 14 RTL: "\x{627}\x{628}"
-        LayoutBlockFlow {P} at (0,1804) size 769x20
+        LayoutBlockFlow {P} at (0,1816) size 769x20
           LayoutText {#text} at (0,0) size 76x19
             text run at (0,0) width 6: "z"
             text run at (6,0) width 10 RTL: "\x{5E9}"
             text run at (16,0) width 16: "\x{663}\x{664}"
             text run at (32,0) width 13 RTL: "(^"
             text run at (45,0) width 31: "ab\x{661}\x{662}"
-        LayoutBlockFlow {P} at (0,1840) size 769x20
+        LayoutBlockFlow {P} at (0,1852) size 769x20
           LayoutText {#text} at (0,0) size 76x19
             text run at (0,0) width 6: "z"
             text run at (6,0) width 10 RTL: "\x{5E9}"
@@ -774,7 +774,7 @@
             text run at (32,0) width 13 RTL: "(^"
             text run at (45,0) width 16: "\x{661}\x{662}"
             text run at (61,0) width 15 RTL: "\x{5D0}\x{5D1}"
-        LayoutBlockFlow {P} at (0,1876) size 769x20
+        LayoutBlockFlow {P} at (0,1888) size 769x20
           LayoutText {#text} at (0,0) size 75x19
             text run at (0,0) width 6: "z"
             text run at (6,0) width 10 RTL: "\x{5E9}"
@@ -782,211 +782,211 @@
             text run at (32,0) width 13 RTL: "(^"
             text run at (45,0) width 16: "\x{661}\x{662}"
             text run at (61,0) width 14 RTL: "\x{627}\x{628}"
-        LayoutBlockFlow {P} at (0,1912) size 769x22
+        LayoutBlockFlow {P} at (0,1924) size 769x22
           LayoutText {#text} at (0,2) size 52x19
             text run at (0,2) width 6: "z"
             text run at (6,2) width 10 RTL: "\x{5E9}"
             text run at (16,2) width 16: "\x{663}\x{664}"
             text run at (32,2) width 13 RTL: "\x{202C}(^"
             text run at (45,2) width 7: "\x{202A}?"
-        LayoutBlockFlow {P} at (0,1950) size 769x22
+        LayoutBlockFlow {P} at (0,1962) size 769x22
           LayoutText {#text} at (0,2) size 52x19
             text run at (0,2) width 6: "z"
             text run at (6,2) width 10 RTL: "\x{5E9}"
             text run at (16,2) width 16: "\x{663}\x{664}"
             text run at (32,2) width 13 RTL: "\x{202C}(^"
             text run at (45,2) width 7 RTL: "\x{202B}?"
-        LayoutBlockFlow {P} at (0,1988) size 769x20
-          LayoutText {#text} at (0,0) size 33x19
-            text run at (0,0) width 0 RTL: "\x{202C}"
-            text run at (0,0) width 28: "ab(^"
-            text run at (28,0) width 5: "\x{202A}!"
-        LayoutBlockFlow {P} at (0,2024) size 769x20
-          LayoutText {#text} at (0,0) size 33x19
-            text run at (0,0) width 0 RTL: "\x{202C}"
-            text run at (0,0) width 5: "\x{202A}!"
-            text run at (5,0) width 28 RTL: "\x{5D0}\x{5D1}(^"
-        LayoutBlockFlow {P} at (0,2060) size 769x22
+        LayoutBlockFlow {P} at (0,2000) size 769x22
+          LayoutText {#text} at (0,2) size 33x19
+            text run at (0,2) width 0 RTL: "\x{202C}"
+            text run at (0,2) width 28: "ab(^"
+            text run at (28,2) width 5: "\x{202A}!"
+        LayoutBlockFlow {P} at (0,2038) size 769x22
+          LayoutText {#text} at (0,2) size 33x19
+            text run at (0,2) width 0 RTL: "\x{202C}"
+            text run at (0,2) width 5: "\x{202A}!"
+            text run at (5,2) width 28 RTL: "\x{5D0}\x{5D1}(^"
+        LayoutBlockFlow {P} at (0,2076) size 769x22
           LayoutText {#text} at (0,2) size 32x19
             text run at (0,2) width 0 RTL: "\x{202C}"
             text run at (0,2) width 5: "\x{202A}!"
             text run at (5,2) width 27 RTL: "\x{627}\x{628}(^"
-        LayoutBlockFlow {P} at (0,2098) size 769x20
-          LayoutText {#text} at (0,0) size 49x19
-            text run at (0,0) width 0 RTL: "\x{202C}"
-            text run at (0,0) width 44: "ab12(^"
-            text run at (44,0) width 5: "\x{202A}!"
-        LayoutBlockFlow {P} at (0,2134) size 769x20
-          LayoutText {#text} at (0,0) size 49x19
-            text run at (0,0) width 0 RTL: "\x{202C}"
-            text run at (0,0) width 5: "\x{202A}!"
-            text run at (5,0) width 13 RTL: "(^"
-            text run at (18,0) width 16: "12"
-            text run at (34,0) width 15 RTL: "\x{5D0}\x{5D1}"
-        LayoutBlockFlow {P} at (0,2170) size 769x22
+        LayoutBlockFlow {P} at (0,2114) size 769x22
+          LayoutText {#text} at (0,2) size 49x19
+            text run at (0,2) width 0 RTL: "\x{202C}"
+            text run at (0,2) width 44: "ab12(^"
+            text run at (44,2) width 5: "\x{202A}!"
+        LayoutBlockFlow {P} at (0,2152) size 769x22
+          LayoutText {#text} at (0,2) size 49x19
+            text run at (0,2) width 0 RTL: "\x{202C}"
+            text run at (0,2) width 5: "\x{202A}!"
+            text run at (5,2) width 13 RTL: "(^"
+            text run at (18,2) width 16: "12"
+            text run at (34,2) width 15 RTL: "\x{5D0}\x{5D1}"
+        LayoutBlockFlow {P} at (0,2190) size 769x22
           LayoutText {#text} at (0,2) size 48x19
             text run at (0,2) width 0 RTL: "\x{202C}"
             text run at (0,2) width 5: "\x{202A}!"
             text run at (5,2) width 13 RTL: "(^"
             text run at (18,2) width 16: "12"
             text run at (34,2) width 14 RTL: "\x{627}\x{628}"
-        LayoutBlockFlow {P} at (0,2208) size 769x22
+        LayoutBlockFlow {P} at (0,2228) size 769x22
           LayoutText {#text} at (0,2) size 49x19
             text run at (0,2) width 0 RTL: "\x{202C}"
             text run at (0,2) width 5: "\x{202A}!"
             text run at (5,2) width 13 RTL: "(^"
             text run at (18,2) width 31: "ab\x{661}\x{662}"
-        LayoutBlockFlow {P} at (0,2246) size 769x22
+        LayoutBlockFlow {P} at (0,2266) size 769x22
           LayoutText {#text} at (0,2) size 49x19
             text run at (0,2) width 0 RTL: "\x{202C}"
             text run at (0,2) width 5: "\x{202A}!"
             text run at (5,2) width 13 RTL: "(^"
             text run at (18,2) width 16: "\x{661}\x{662}"
             text run at (34,2) width 15 RTL: "\x{5D0}\x{5D1}"
-        LayoutBlockFlow {P} at (0,2284) size 769x22
+        LayoutBlockFlow {P} at (0,2304) size 769x22
           LayoutText {#text} at (0,2) size 48x19
             text run at (0,2) width 0 RTL: "\x{202C}"
             text run at (0,2) width 5: "\x{202A}!"
             text run at (5,2) width 13 RTL: "(^"
             text run at (18,2) width 16: "\x{661}\x{662}"
             text run at (34,2) width 14 RTL: "\x{627}\x{628}"
-        LayoutBlockFlow {P} at (0,2322) size 769x20
-          LayoutText {#text} at (0,0) size 25x19
-            text run at (0,0) width 0 RTL: "\x{202C}"
-            text run at (0,0) width 7: "\x{202A}?"
-            text run at (7,0) width 13: "\x{202C}(^"
-            text run at (20,0) width 5: "\x{202A}!"
-        LayoutBlockFlow {P} at (0,2358) size 769x20
-          LayoutText {#text} at (0,0) size 25x19
-            text run at (0,0) width 0 RTL: "\x{202C}"
-            text run at (0,0) width 5: "\x{202A}!"
-            text run at (5,0) width 13 RTL: "\x{202C}(^"
-            text run at (18,0) width 7 RTL: "\x{202B}?"
-        LayoutBlockFlow {P} at (0,2394) size 769x20
-          LayoutText {#text} at (0,0) size 33x19
-            text run at (0,0) width 0 RTL: "\x{202C}"
-            text run at (0,0) width 5 RTL: "\x{202B}!"
-            text run at (5,0) width 13 RTL: "(^"
-            text run at (18,0) width 15: "ab"
-        LayoutBlockFlow {P} at (0,2430) size 769x20
-          LayoutText {#text} at (0,0) size 33x19
-            text run at (0,0) width 0 RTL: "\x{202C}"
-            text run at (0,0) width 5 RTL: "\x{202B}!"
-            text run at (5,0) width 28 RTL: "\x{5D0}\x{5D1}(^"
-        LayoutBlockFlow {P} at (0,2466) size 769x22
+        LayoutBlockFlow {P} at (0,2342) size 769x22
+          LayoutText {#text} at (0,2) size 25x19
+            text run at (0,2) width 0 RTL: "\x{202C}"
+            text run at (0,2) width 7: "\x{202A}?"
+            text run at (7,2) width 13: "\x{202C}(^"
+            text run at (20,2) width 5: "\x{202A}!"
+        LayoutBlockFlow {P} at (0,2380) size 769x22
+          LayoutText {#text} at (0,2) size 25x19
+            text run at (0,2) width 0 RTL: "\x{202C}"
+            text run at (0,2) width 5: "\x{202A}!"
+            text run at (5,2) width 13 RTL: "\x{202C}(^"
+            text run at (18,2) width 7 RTL: "\x{202B}?"
+        LayoutBlockFlow {P} at (0,2418) size 769x22
+          LayoutText {#text} at (0,2) size 33x19
+            text run at (0,2) width 0 RTL: "\x{202C}"
+            text run at (0,2) width 5 RTL: "\x{202B}!"
+            text run at (5,2) width 13 RTL: "(^"
+            text run at (18,2) width 15: "ab"
+        LayoutBlockFlow {P} at (0,2456) size 769x22
+          LayoutText {#text} at (0,2) size 33x19
+            text run at (0,2) width 0 RTL: "\x{202C}"
+            text run at (0,2) width 5 RTL: "\x{202B}!"
+            text run at (5,2) width 28 RTL: "\x{5D0}\x{5D1}(^"
+        LayoutBlockFlow {P} at (0,2494) size 769x22
           LayoutText {#text} at (0,2) size 32x19
             text run at (0,2) width 0 RTL: "\x{202C}"
             text run at (0,2) width 5 RTL: "\x{202B}!"
             text run at (5,2) width 27 RTL: "\x{627}\x{628}(^"
-        LayoutBlockFlow {P} at (0,2504) size 769x20
-          LayoutText {#text} at (0,0) size 49x19
-            text run at (0,0) width 0 RTL: "\x{202C}"
-            text run at (0,0) width 5 RTL: "\x{202B}!"
-            text run at (5,0) width 13 RTL: "(^"
-            text run at (18,0) width 31: "ab12"
-        LayoutBlockFlow {P} at (0,2540) size 769x20
-          LayoutText {#text} at (0,0) size 49x19
-            text run at (0,0) width 0 RTL: "\x{202C}"
-            text run at (0,0) width 5 RTL: "\x{202B}!"
-            text run at (5,0) width 13 RTL: "(^"
-            text run at (18,0) width 16: "12"
-            text run at (34,0) width 15 RTL: "\x{5D0}\x{5D1}"
-        LayoutBlockFlow {P} at (0,2576) size 769x22
+        LayoutBlockFlow {P} at (0,2532) size 769x22
+          LayoutText {#text} at (0,2) size 49x19
+            text run at (0,2) width 0 RTL: "\x{202C}"
+            text run at (0,2) width 5 RTL: "\x{202B}!"
+            text run at (5,2) width 13 RTL: "(^"
+            text run at (18,2) width 31: "ab12"
+        LayoutBlockFlow {P} at (0,2570) size 769x22
+          LayoutText {#text} at (0,2) size 49x19
+            text run at (0,2) width 0 RTL: "\x{202C}"
+            text run at (0,2) width 5 RTL: "\x{202B}!"
+            text run at (5,2) width 13 RTL: "(^"
+            text run at (18,2) width 16: "12"
+            text run at (34,2) width 15 RTL: "\x{5D0}\x{5D1}"
+        LayoutBlockFlow {P} at (0,2608) size 769x22
           LayoutText {#text} at (0,2) size 48x19
             text run at (0,2) width 0 RTL: "\x{202C}"
             text run at (0,2) width 5 RTL: "\x{202B}!"
             text run at (5,2) width 13 RTL: "(^"
             text run at (18,2) width 16: "12"
             text run at (34,2) width 14 RTL: "\x{627}\x{628}"
-        LayoutBlockFlow {P} at (0,2614) size 769x22
+        LayoutBlockFlow {P} at (0,2646) size 769x22
           LayoutText {#text} at (0,2) size 49x19
             text run at (0,2) width 0 RTL: "\x{202C}"
             text run at (0,2) width 5 RTL: "\x{202B}!"
             text run at (5,2) width 13 RTL: "(^"
             text run at (18,2) width 31: "ab\x{661}\x{662}"
-        LayoutBlockFlow {P} at (0,2652) size 769x22
+        LayoutBlockFlow {P} at (0,2684) size 769x22
           LayoutText {#text} at (0,2) size 49x19
             text run at (0,2) width 0 RTL: "\x{202C}"
             text run at (0,2) width 5 RTL: "\x{202B}!"
             text run at (5,2) width 13 RTL: "(^"
             text run at (18,2) width 16: "\x{661}\x{662}"
             text run at (34,2) width 15 RTL: "\x{5D0}\x{5D1}"
-        LayoutBlockFlow {P} at (0,2690) size 769x22
+        LayoutBlockFlow {P} at (0,2722) size 769x22
           LayoutText {#text} at (0,2) size 48x19
             text run at (0,2) width 0 RTL: "\x{202C}"
             text run at (0,2) width 5 RTL: "\x{202B}!"
             text run at (5,2) width 13 RTL: "(^"
             text run at (18,2) width 16: "\x{661}\x{662}"
             text run at (34,2) width 14 RTL: "\x{627}\x{628}"
-        LayoutBlockFlow {P} at (0,2728) size 769x20
-          LayoutText {#text} at (0,0) size 25x19
-            text run at (0,0) width 0 RTL: "\x{202C}"
-            text run at (0,0) width 5 RTL: "\x{202B}!"
-            text run at (5,0) width 13 RTL: "\x{202C}(^"
-            text run at (18,0) width 7: "\x{202A}?"
-        LayoutBlockFlow {P} at (0,2764) size 769x20
-          LayoutText {#text} at (0,0) size 25x19
-            text run at (0,0) width 0 RTL: "\x{202C}"
-            text run at (0,0) width 5 RTL: "\x{202B}!"
-            text run at (5,0) width 13 RTL: "\x{202C}(^"
-            text run at (18,0) width 7 RTL: "\x{202B}?"
-        LayoutBlockFlow {P} at (0,2800) size 769x20
-          LayoutText {#text} at (0,0) size 28x19
-            text run at (0,0) width 0 RTL: "\x{202C}"
-            text run at (0,0) width 28: "\x{202A}ab(^"
-        LayoutBlockFlow {P} at (0,2836) size 769x20
-          LayoutText {#text} at (0,0) size 28x19
-            text run at (0,0) width 0 RTL: "\x{202C}"
-            text run at (0,0) width 15 RTL: "\x{202A}\x{5D0}\x{5D1}"
-            text run at (15,0) width 13: "(^"
-        LayoutBlockFlow {P} at (0,2872) size 769x22
+        LayoutBlockFlow {P} at (0,2760) size 769x22
+          LayoutText {#text} at (0,2) size 25x19
+            text run at (0,2) width 0 RTL: "\x{202C}"
+            text run at (0,2) width 5 RTL: "\x{202B}!"
+            text run at (5,2) width 13 RTL: "\x{202C}(^"
+            text run at (18,2) width 7: "\x{202A}?"
+        LayoutBlockFlow {P} at (0,2798) size 769x22
+          LayoutText {#text} at (0,2) size 25x19
+            text run at (0,2) width 0 RTL: "\x{202C}"
+            text run at (0,2) width 5 RTL: "\x{202B}!"
+            text run at (5,2) width 13 RTL: "\x{202C}(^"
+            text run at (18,2) width 7 RTL: "\x{202B}?"
+        LayoutBlockFlow {P} at (0,2836) size 769x22
+          LayoutText {#text} at (0,2) size 28x19
+            text run at (0,2) width 0 RTL: "\x{202C}"
+            text run at (0,2) width 28: "\x{202A}ab(^"
+        LayoutBlockFlow {P} at (0,2874) size 769x22
+          LayoutText {#text} at (0,2) size 28x19
+            text run at (0,2) width 0 RTL: "\x{202C}"
+            text run at (0,2) width 15 RTL: "\x{202A}\x{5D0}\x{5D1}"
+            text run at (15,2) width 13: "(^"
+        LayoutBlockFlow {P} at (0,2912) size 769x22
           LayoutText {#text} at (0,2) size 27x19
             text run at (0,2) width 0 RTL: "\x{202C}"
             text run at (0,2) width 14 RTL: "\x{202A}\x{627}\x{628}"
             text run at (14,2) width 13: "(^"
-        LayoutBlockFlow {P} at (0,2910) size 769x20
-          LayoutText {#text} at (0,0) size 44x19
-            text run at (0,0) width 0 RTL: "\x{202C}"
-            text run at (0,0) width 44: "\x{202A}ab12(^"
-        LayoutBlockFlow {P} at (0,2946) size 769x20
-          LayoutText {#text} at (0,0) size 44x19
-            text run at (0,0) width 0 RTL: "\x{202C}"
-            text run at (0,0) width 16: "12"
-            text run at (16,0) width 15 RTL: "\x{202A}\x{5D0}\x{5D1}"
-            text run at (31,0) width 13: "(^"
-        LayoutBlockFlow {P} at (0,2982) size 769x22
+        LayoutBlockFlow {P} at (0,2950) size 769x22
+          LayoutText {#text} at (0,2) size 44x19
+            text run at (0,2) width 0 RTL: "\x{202C}"
+            text run at (0,2) width 44: "\x{202A}ab12(^"
+        LayoutBlockFlow {P} at (0,2988) size 769x22
+          LayoutText {#text} at (0,2) size 44x19
+            text run at (0,2) width 0 RTL: "\x{202C}"
+            text run at (0,2) width 16: "12"
+            text run at (16,2) width 15 RTL: "\x{202A}\x{5D0}\x{5D1}"
+            text run at (31,2) width 13: "(^"
+        LayoutBlockFlow {P} at (0,3026) size 769x22
           LayoutText {#text} at (0,2) size 43x19
             text run at (0,2) width 0 RTL: "\x{202C}"
             text run at (0,2) width 16: "12"
             text run at (16,2) width 14 RTL: "\x{202A}\x{627}\x{628}"
             text run at (30,2) width 13: "(^"
-        LayoutBlockFlow {P} at (0,3020) size 769x22
+        LayoutBlockFlow {P} at (0,3064) size 769x22
           LayoutText {#text} at (0,2) size 44x19
             text run at (0,2) width 0 RTL: "\x{202C}"
             text run at (0,2) width 15: "\x{202A}ab"
             text run at (15,2) width 16: "\x{661}\x{662}"
             text run at (31,2) width 13: "(^"
-        LayoutBlockFlow {P} at (0,3058) size 769x22
+        LayoutBlockFlow {P} at (0,3102) size 769x22
           LayoutText {#text} at (0,2) size 44x19
             text run at (0,2) width 0 RTL: "\x{202C}"
             text run at (0,2) width 16: "\x{661}\x{662}"
             text run at (16,2) width 15 RTL: "\x{202A}\x{5D0}\x{5D1}"
             text run at (31,2) width 13: "(^"
-        LayoutBlockFlow {P} at (0,3096) size 769x22
+        LayoutBlockFlow {P} at (0,3140) size 769x22
           LayoutText {#text} at (0,2) size 43x19
             text run at (0,2) width 0 RTL: "\x{202C}"
             text run at (0,2) width 16: "\x{661}\x{662}"
             text run at (16,2) width 14 RTL: "\x{202A}\x{627}\x{628}"
             text run at (30,2) width 13: "(^"
-        LayoutBlockFlow {P} at (0,3134) size 769x20
-          LayoutText {#text} at (0,0) size 20x19
-            text run at (0,0) width 0 RTL: "\x{202C}"
-            text run at (0,0) width 0: "\x{202A}"
-            text run at (0,0) width 7: "\x{202A}?"
-            text run at (7,0) width 13: "\x{202C}(^"
-        LayoutBlockFlow {P} at (0,3170) size 769x20
-          LayoutText {#text} at (0,0) size 20x19
-            text run at (0,0) width 0 RTL: "\x{202C}"
-            text run at (0,0) width 0: "\x{202A}"
-            text run at (0,0) width 7 RTL: "\x{202B}?"
-            text run at (7,0) width 13: "\x{202C}(^"
+        LayoutBlockFlow {P} at (0,3178) size 769x22
+          LayoutText {#text} at (0,2) size 20x19
+            text run at (0,2) width 0 RTL: "\x{202C}"
+            text run at (0,2) width 0: "\x{202A}"
+            text run at (0,2) width 7: "\x{202A}?"
+            text run at (7,2) width 13: "\x{202C}(^"
+        LayoutBlockFlow {P} at (0,3216) size 769x22
+          LayoutText {#text} at (0,2) size 20x19
+            text run at (0,2) width 0 RTL: "\x{202C}"
+            text run at (0,2) width 0: "\x{202A}"
+            text run at (0,2) width 7 RTL: "\x{202B}?"
+            text run at (7,2) width 13: "\x{202C}(^"
diff --git a/third_party/WebKit/LayoutTests/platform/win-xp/fast/text/international/bidi-override-expected.png b/third_party/WebKit/LayoutTests/platform/win-xp/fast/text/international/bidi-override-expected.png
index 8e07a2c0..8c1f782 100644
--- a/third_party/WebKit/LayoutTests/platform/win-xp/fast/text/international/bidi-override-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win-xp/fast/text/international/bidi-override-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win-xp/fast/text/international/bidi-override-expected.txt b/third_party/WebKit/LayoutTests/platform/win-xp/fast/text/international/bidi-override-expected.txt
index ee7e24b..14e85ba6 100644
--- a/third_party/WebKit/LayoutTests/platform/win-xp/fast/text/international/bidi-override-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win-xp/fast/text/international/bidi-override-expected.txt
@@ -1,13 +1,13 @@
 layer at (0,0) size 800x600
   LayoutView at (0,0) size 800x600
-layer at (0,0) size 800x356
-  LayoutBlockFlow {HTML} at (0,0) size 800x356
-    LayoutBlockFlow {BODY} at (8,16) size 784x332
+layer at (0,0) size 800x358
+  LayoutBlockFlow {HTML} at (0,0) size 800x358
+    LayoutBlockFlow {BODY} at (8,16) size 784x334
       LayoutBlockFlow {P} at (0,0) size 784x20
         LayoutText {#text} at (0,0) size 296x19
           text run at (0,0) width 296: "All rows should be identical to the reference row."
-      LayoutTable {TABLE} at (0,36) size 506x117 [border: none]
-        LayoutTableSection {TBODY} at (0,0) size 505x116
+      LayoutTable {TABLE} at (0,36) size 506x119 [border: none]
+        LayoutTableSection {TBODY} at (0,0) size 505x118
           LayoutTableRow {TR} at (0,0) size 505x29
             LayoutTableCell {TD} at (0,0) size 93x29 [border: (1px solid #008000)] [r=0 c=0 rs=1 cs=1]
               LayoutText {#text} at (28,5) size 61x19
@@ -103,31 +103,31 @@
                     text run at (23,5) width 62 LTR override: "\x{5D8}\x{5D7}\x{5D6}abc\x{5D5}\x{5D4}\x{5D3}"
                 LayoutText {#text} at (5,5) size 18x19
                   text run at (5,5) width 18 RTL: "\x{5D9}\x{5DB}\x{5DC}"
-          LayoutTableRow {TR} at (0,87) size 505x29
-            LayoutTableCell {TD} at (0,87) size 93x29 [border: (1px solid #008000)] [r=3 c=0 rs=1 cs=1]
+          LayoutTableRow {TR} at (0,87) size 505x31
+            LayoutTableCell {TD} at (0,88) size 93x29 [border: (1px solid #008000)] [r=3 c=0 rs=1 cs=1]
               LayoutText {#text} at (38,5) size 51x19
                 text run at (38,5) width 51: "Unicode"
-            LayoutTableCell {TD} at (93,87) size 206x29 [border: (1px solid #008000)] [r=3 c=1 rs=1 cs=1]
-              LayoutText {#text} at (5,5) size 197x19
-                text run at (5,5) width 22: "abc"
-                text run at (27,5) width 56 RTL override: "\x{202E}ihg\x{5D0}\x{5D1}\x{5D2}fed"
-                text run at (83,5) width 19: "\x{202C}jkl "
-                text run at (102,5) width 18 RTL: "\x{202C}\x{5D9}\x{5DB}\x{5DC}"
-                text run at (120,5) width 62 LTR override: "\x{202D}\x{5D8}\x{5D7}\x{5D6}abc\x{5D5}\x{5D4}\x{5D3}"
-                text run at (182,5) width 20 RTL: "\x{5D0}\x{5D1}\x{5D2}"
-            LayoutTableCell {TD} at (299,87) size 206x29 [border: (1px solid #008000)] [r=3 c=2 rs=1 cs=1]
-              LayoutText {#text} at (5,5) size 197x19
-                text run at (5,5) width 18 RTL: "\x{202C}\x{5D9}\x{5DB}\x{5DC}"
-                text run at (23,5) width 62 LTR override: "\x{202D}\x{5D8}\x{5D7}\x{5D6}abc\x{5D5}\x{5D4}\x{5D3}"
-                text run at (85,5) width 20 RTL: "\x{5D0}\x{5D1}\x{5D2}"
-                text run at (105,5) width 4 RTL: " "
-                text run at (109,5) width 22: "abc"
-                text run at (131,5) width 56 RTL override: "\x{202E}ihg\x{5D0}\x{5D1}\x{5D2}fed"
-                text run at (187,5) width 15: "\x{202C}jkl"
-      LayoutBlockFlow {P} at (0,169) size 784x20
+            LayoutTableCell {TD} at (93,87) size 206x31 [border: (1px solid #008000)] [r=3 c=1 rs=1 cs=1]
+              LayoutText {#text} at (5,7) size 197x19
+                text run at (5,7) width 22: "abc"
+                text run at (27,7) width 56 RTL override: "\x{202E}ihg\x{5D0}\x{5D1}\x{5D2}fed"
+                text run at (83,7) width 19: "\x{202C}jkl "
+                text run at (102,7) width 18 RTL: "\x{202C}\x{5D9}\x{5DB}\x{5DC}"
+                text run at (120,7) width 62 LTR override: "\x{202D}\x{5D8}\x{5D7}\x{5D6}abc\x{5D5}\x{5D4}\x{5D3}"
+                text run at (182,7) width 20 RTL: "\x{5D0}\x{5D1}\x{5D2}"
+            LayoutTableCell {TD} at (299,87) size 206x31 [border: (1px solid #008000)] [r=3 c=2 rs=1 cs=1]
+              LayoutText {#text} at (5,7) size 197x19
+                text run at (5,7) width 18 RTL: "\x{202C}\x{5D9}\x{5DB}\x{5DC}"
+                text run at (23,7) width 62 LTR override: "\x{202D}\x{5D8}\x{5D7}\x{5D6}abc\x{5D5}\x{5D4}\x{5D3}"
+                text run at (85,7) width 20 RTL: "\x{5D0}\x{5D1}\x{5D2}"
+                text run at (105,7) width 4 RTL: " "
+                text run at (109,7) width 22: "abc"
+                text run at (131,7) width 56 RTL override: "\x{202E}ihg\x{5D0}\x{5D1}\x{5D2}fed"
+                text run at (187,7) width 15: "\x{202C}jkl"
+      LayoutBlockFlow {P} at (0,171) size 784x20
         LayoutText {#text} at (0,0) size 367x19
           text run at (0,0) width 367: "The CSS column should be identical to the reference column."
-      LayoutTable {TABLE} at (0,205) size 219x127 [border: none]
+      LayoutTable {TABLE} at (0,207) size 219x127 [border: none]
         LayoutTableSection {TBODY} at (0,0) size 218x126
           LayoutTableRow {TR} at (0,0) size 218x29
             LayoutTableCell {TD} at (0,0) size 109x29 [border: (1px solid #008000)] [r=0 c=0 rs=1 cs=1]
diff --git a/third_party/WebKit/LayoutTests/platform/win-xp/fast/text/international/bidi-word-spacing-rtl-expected.png b/third_party/WebKit/LayoutTests/platform/win-xp/fast/text/international/bidi-word-spacing-rtl-expected.png
index 6314bca7..5dc6396 100644
--- a/third_party/WebKit/LayoutTests/platform/win-xp/fast/text/international/bidi-word-spacing-rtl-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win-xp/fast/text/international/bidi-word-spacing-rtl-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win-xp/fast/text/international/bidi-word-spacing-rtl-expected.txt b/third_party/WebKit/LayoutTests/platform/win-xp/fast/text/international/bidi-word-spacing-rtl-expected.txt
index 504236d..2beac8c 100644
--- a/third_party/WebKit/LayoutTests/platform/win-xp/fast/text/international/bidi-word-spacing-rtl-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win-xp/fast/text/international/bidi-word-spacing-rtl-expected.txt
@@ -1,8 +1,8 @@
 layer at (0,0) size 800x600
   LayoutView at (0,0) size 800x600
-layer at (0,0) size 800x370
-  LayoutBlockFlow {HTML} at (0,0) size 800x370
-    LayoutBlockFlow {BODY} at (8,10) size 784x350
+layer at (0,0) size 800x373
+  LayoutBlockFlow {HTML} at (0,0) size 800x373
+    LayoutBlockFlow {BODY} at (8,10) size 784x353
       LayoutBlockFlow {DIV} at (300,0) size 184x50 [border: (1px solid #000000)]
         LayoutText {#text} at (172,2) size 11x46
           text run at (172,2) width 11 RTL: "!"
@@ -24,15 +24,15 @@
             text run at (62,2) width 121 RTL: "! "
         LayoutText {#text} at (25,2) size 37x46
           text run at (25,2) width 37 RTL: "@"
-      LayoutBlockFlow {DIV} at (300,180) size 184x50 [border: (1px solid #000000)]
-        LayoutText {#text} at (172,2) size 11x46
-          text run at (172,2) width 11 RTL: "!"
+      LayoutBlockFlow {DIV} at (300,180) size 184x53 [border: (1px solid #000000)]
+        LayoutText {#text} at (172,5) size 11x46
+          text run at (172,5) width 11 RTL: "!"
         LayoutInline {SPAN} at (0,0) size 110x46
-          LayoutText {#text} at (162,2) size 10x46
-            text run at (162,2) width 10 RTL: " "
-        LayoutText {#text} at (15,2) size 47x46
-          text run at (15,2) width 47 RTL: "@ \x{200F}"
-      LayoutBlockFlow {DIV} at (300,240) size 184x50 [border: (1px solid #000000)]
+          LayoutText {#text} at (162,5) size 10x46
+            text run at (162,5) width 10 RTL: " "
+        LayoutText {#text} at (15,5) size 47x46
+          text run at (15,5) width 47 RTL: "@ \x{200F}"
+      LayoutBlockFlow {DIV} at (300,243) size 184x50 [border: (1px solid #000000)]
         LayoutText {#text} at (172,2) size 11x46
           text run at (172,2) width 11 RTL: "!"
         LayoutInline {SPAN} at (0,0) size 110x46
@@ -40,7 +40,7 @@
             text run at (162,2) width 10 RTL: " "
         LayoutText {#text} at (25,2) size 37x46
           text run at (25,2) width 37 RTL: "@"
-      LayoutBlockFlow {DIV} at (300,300) size 184x50 [border: (1px solid #000000)]
+      LayoutBlockFlow {DIV} at (300,303) size 184x50 [border: (1px solid #000000)]
         LayoutText {#text} at (25,2) size 37x46
           text run at (25,2) width 37: "@"
         LayoutInline {SPAN} at (0,0) size 110x46
diff --git a/third_party/WebKit/LayoutTests/platform/win-xp/fast/text/international/rtl-negative-letter-spacing-expected.png b/third_party/WebKit/LayoutTests/platform/win-xp/fast/text/international/rtl-negative-letter-spacing-expected.png
index 236f6f2..946e018 100644
--- a/third_party/WebKit/LayoutTests/platform/win-xp/fast/text/international/rtl-negative-letter-spacing-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win-xp/fast/text/international/rtl-negative-letter-spacing-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win-xp/fast/text/letter-spacing-negative-opacity-expected.png b/third_party/WebKit/LayoutTests/platform/win-xp/fast/text/letter-spacing-negative-opacity-expected.png
index c0ec2de..8745021 100644
--- a/third_party/WebKit/LayoutTests/platform/win-xp/fast/text/letter-spacing-negative-opacity-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win-xp/fast/text/letter-spacing-negative-opacity-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win-xp/fast/text/letter-spacing-negative-opacity-expected.txt b/third_party/WebKit/LayoutTests/platform/win-xp/fast/text/letter-spacing-negative-opacity-expected.txt
index 03ab839..066f728ba 100644
--- a/third_party/WebKit/LayoutTests/platform/win-xp/fast/text/letter-spacing-negative-opacity-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win-xp/fast/text/letter-spacing-negative-opacity-expected.txt
@@ -3,7 +3,7 @@
 layer at (0,0) size 800x600
   LayoutBlockFlow {HTML} at (0,0) size 800x600
     LayoutBlockFlow {BODY} at (8,8) size 784x584
-layer at (8,8) size 273x167 transparent
-  LayoutBlockFlow (positioned) {DIV} at (8,8) size 273x167 [border: (1px solid #FF0000)]
-    LayoutText {#text} at (1,4) size 271x159
-      text run at (1,4) width 271: "Testing the bug"
+layer at (8,8) size 283x167 transparent
+  LayoutBlockFlow (positioned) {DIV} at (8,8) size 283x167 [border: (1px solid #FF0000)]
+    LayoutText {#text} at (1,4) size 281x159
+      text run at (1,4) width 281: "Testing the bug"
diff --git a/third_party/WebKit/LayoutTests/platform/win-xp/fast/text/midword-break-before-surrogate-pair-expected.png b/third_party/WebKit/LayoutTests/platform/win-xp/fast/text/midword-break-before-surrogate-pair-expected.png
index 8fdd620..7937fe6e 100644
--- a/third_party/WebKit/LayoutTests/platform/win-xp/fast/text/midword-break-before-surrogate-pair-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win-xp/fast/text/midword-break-before-surrogate-pair-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win-xp/fast/text/midword-break-before-surrogate-pair-expected.txt b/third_party/WebKit/LayoutTests/platform/win-xp/fast/text/midword-break-before-surrogate-pair-expected.txt
index bc4ee65b..168e570 100644
--- a/third_party/WebKit/LayoutTests/platform/win-xp/fast/text/midword-break-before-surrogate-pair-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win-xp/fast/text/midword-break-before-surrogate-pair-expected.txt
@@ -11,8 +11,8 @@
           text run at (188,20) width 279: "unicode character, for which break-all applies."
       LayoutBlockFlow {DIV} at (0,56) size 186x92 [border: (3px solid #0000FF)]
         LayoutText {#text} at (3,4) size 168x84
-          text run at (3,4) width 168: "\x{D835}\x{DC9E}\x{D835}\x{DC9E}\x{D835}\x{DC9E}\x{D835}\x{DC9E}\x{D835}\x{DC9E}\x{D835}\x{DC9E}"
-          text run at (3,47) width 112: "\x{D835}\x{DC9E}\x{D835}\x{DC9E}\x{D835}\x{DC9E}\x{D835}\x{DC9E}"
+          text run at (3,4) width 168: "\x{D835}\x{DC9E}\x{D835}\x{DC9E}\x{D835}\x{DC9E}\x{D835}\x{DC9E}\x{D835}\x{DC9E}\x{D835}\x{DC9E}\x{D835}\x{DC9E}"
+          text run at (3,47) width 72: "\x{D835}\x{DC9E}\x{D835}\x{DC9E}\x{D835}\x{DC9E}"
       LayoutBlockFlow {P} at (0,164) size 784x20
         LayoutText {#text} at (0,0) size 732x19
           text run at (0,0) width 505: "The following box should not break the sequence of symbols since U+1F1EF is not "
diff --git a/third_party/WebKit/LayoutTests/platform/win-xp/fast/text/shaping/same-script-different-lang-expected.png b/third_party/WebKit/LayoutTests/platform/win-xp/fast/text/shaping/same-script-different-lang-expected.png
index 4c914b5..b541eb1 100644
--- a/third_party/WebKit/LayoutTests/platform/win-xp/fast/text/shaping/same-script-different-lang-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win-xp/fast/text/shaping/same-script-different-lang-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win-xp/fast/text/shaping/same-script-different-lang-expected.txt b/third_party/WebKit/LayoutTests/platform/win-xp/fast/text/shaping/same-script-different-lang-expected.txt
index 8dc2794..bfca388 100644
--- a/third_party/WebKit/LayoutTests/platform/win-xp/fast/text/shaping/same-script-different-lang-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win-xp/fast/text/shaping/same-script-different-lang-expected.txt
@@ -1,18 +1,22 @@
 layer at (0,0) size 800x600
   LayoutView at (0,0) size 800x600
-layer at (0,0) size 800x204
-  LayoutBlockFlow {HTML} at (0,0) size 800x204.44
-    LayoutBlockFlow {BODY} at (8,18.72) size 784x177.72
+layer at (0,0) size 800x180
+  LayoutBlockFlow {HTML} at (0,0) size 800x180.44
+    LayoutBlockFlow {BODY} at (8,18.72) size 784x145.72
       LayoutBlockFlow {H3} at (0,0) size 784x23
         LayoutText {#text} at (0,0) size 764x22
           text run at (0,0) width 764: "The glyph for JHA should look different for Nepali and Hindi, depending on the lang attribute."
       LayoutBlockFlow {P} at (0,41.72) size 784x24
         LayoutText {#text} at (0,3) size 82x21
           text run at (0,3) width 82: "Hindi:JHA \x{91D}"
-      LayoutBlockFlow (anonymous) at (0,81.72) size 784x20
-        LayoutBR {BR} at (0,0) size 0x19
-      LayoutBlockFlow {P} at (0,117.72) size 784x24
+      LayoutBlockFlow {P} at (0,81.72) size 784x24
         LayoutText {#text} at (0,3) size 93x21
           text run at (0,3) width 93: "Nepali:JHA \x{91D}"
-      LayoutBlockFlow (anonymous) at (0,157.72) size 784x20
-        LayoutBR {BR} at (0,0) size 0x19
+      LayoutBlockFlow {P} at (0,121.72) size 784x24
+        LayoutText {#text} at (0,3) size 78x21
+          text run at (0,3) width 78: "Nepali:JHA "
+        LayoutInline {SPAN} at (0,0) size 15x21
+          LayoutText {#text} at (78,3) size 15x21
+            text run at (78,3) width 15: "\x{91D}"
+        LayoutText {#text} at (93,3) size 287x21
+          text run at (93,3) width 287: " - \"ne\" in \"hi\" should look the same as above."
diff --git a/third_party/WebKit/LayoutTests/platform/win-xp/fast/text/small-caps-turkish-expected.png b/third_party/WebKit/LayoutTests/platform/win-xp/fast/text/small-caps-turkish-expected.png
index 83b31382..54a9f171 100644
--- a/third_party/WebKit/LayoutTests/platform/win-xp/fast/text/small-caps-turkish-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win-xp/fast/text/small-caps-turkish-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win-xp/fast/text/soft-hyphen-3-expected.png b/third_party/WebKit/LayoutTests/platform/win-xp/fast/text/soft-hyphen-3-expected.png
index aed6f3f..ec53297c 100644
--- a/third_party/WebKit/LayoutTests/platform/win-xp/fast/text/soft-hyphen-3-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win-xp/fast/text/soft-hyphen-3-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win-xp/fast/text/soft-hyphen-3-expected.txt b/third_party/WebKit/LayoutTests/platform/win-xp/fast/text/soft-hyphen-3-expected.txt
new file mode 100644
index 0000000..53608e6
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/win-xp/fast/text/soft-hyphen-3-expected.txt
@@ -0,0 +1,13 @@
+layer at (0,0) size 800x600
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  LayoutBlockFlow {HTML} at (0,0) size 800x600
+    LayoutBlockFlow {BODY} at (8,8) size 784x584
+      LayoutBlockFlow {DIV} at (0,0) size 225x56 [color=#FFFFFF]
+        LayoutText {#text} at (0,6) size 100x25
+          text run at (0,6) width 100: "Did \x{AD}"
+        LayoutInline {SPAN} at (0,0) size 75x25 [color=#008000]
+          LayoutText {#text} at (100,6) size 75x25
+            text run at (100,6) width 75: "not"
+        LayoutText {#text} at (0,31) size 100x25
+          text run at (0,31) width 100: "fail"
diff --git a/third_party/WebKit/LayoutTests/platform/win-xp/fast/text/softHyphen-expected.png b/third_party/WebKit/LayoutTests/platform/win-xp/fast/text/softHyphen-expected.png
index ccf12a1..7b4892c 100644
--- a/third_party/WebKit/LayoutTests/platform/win-xp/fast/text/softHyphen-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win-xp/fast/text/softHyphen-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win-xp/fast/text/softHyphen-expected.txt b/third_party/WebKit/LayoutTests/platform/win-xp/fast/text/softHyphen-expected.txt
index 8febd2f2..1583882 100644
--- a/third_party/WebKit/LayoutTests/platform/win-xp/fast/text/softHyphen-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win-xp/fast/text/softHyphen-expected.txt
@@ -1,8 +1,8 @@
-layer at (0,0) size 800x600 clip at (0,0) size 785x600 scrollHeight 1050
+layer at (0,0) size 800x600 clip at (0,0) size 785x600 scrollHeight 1056
   LayoutView at (0,0) size 800x600
-layer at (0,0) size 785x1050 backgroundClip at (0,0) size 785x600 clip at (0,0) size 785x600
-  LayoutBlockFlow {HTML} at (0,0) size 785x1050
-    LayoutBlockFlow {BODY} at (8,16) size 769x1018
+layer at (0,0) size 785x1056 backgroundClip at (0,0) size 785x600 clip at (0,0) size 785x600
+  LayoutBlockFlow {HTML} at (0,0) size 785x1056
+    LayoutBlockFlow {BODY} at (8,16) size 769x1024
       LayoutBlockFlow {P} at (0,0) size 769x20
         LayoutText {#text} at (0,0) size 403x19
           text run at (0,0) width 403: "In all of the following, there should not be a hyphen before \x{201C}lorem\x{201D}."
@@ -96,53 +96,53 @@
       LayoutBlockFlow {P} at (0,562) size 769x20
         LayoutText {#text} at (0,0) size 57x19
           text run at (0,0) width 57: "Do\x{AD} \x{AD}lorem"
-      LayoutBlockFlow {P} at (0,598) size 769x20
-        LayoutText {#text} at (0,0) size 57x19
-          text run at (0,0) width 23: "Do "
-          text run at (23,0) width 34: "\x{AD}lorem"
-      LayoutBlockFlow {P} at (0,634) size 769x20
+      LayoutBlockFlow {P} at (0,598) size 769x22
+        LayoutText {#text} at (0,2) size 57x19
+          text run at (0,2) width 23: "Do "
+          text run at (23,2) width 34: "\x{AD}lorem"
+      LayoutBlockFlow {P} at (0,636) size 769x20
         LayoutText {#text} at (0,0) size 57x19
           text run at (0,0) width 23: "Do\x{AD} "
           text run at (23,0) width 34: "lorem"
-      LayoutBlockFlow {P} at (0,670) size 769x20
-        LayoutText {#text} at (0,0) size 61x19
-          text run at (0,0) width 27: "Do \x{AD} "
-          text run at (27,0) width 34: "lorem"
-      LayoutBlockFlow {P} at (0,706) size 769x20
-        LayoutText {#text} at (0,0) size 61x19
-          text run at (0,0) width 23: "Do "
-          text run at (23,0) width 38: "\x{AD} lorem"
-      LayoutBlockFlow {P} at (0,742) size 769x20
+      LayoutBlockFlow {P} at (0,672) size 769x22
+        LayoutText {#text} at (0,2) size 61x19
+          text run at (0,2) width 27: "Do \x{AD} "
+          text run at (27,2) width 34: "lorem"
+      LayoutBlockFlow {P} at (0,710) size 769x22
+        LayoutText {#text} at (0,2) size 61x19
+          text run at (0,2) width 23: "Do "
+          text run at (23,2) width 38: "\x{AD} lorem"
+      LayoutBlockFlow {P} at (0,748) size 769x20
         LayoutText {#text} at (0,0) size 19x19
           text run at (0,0) width 19: "Do"
         LayoutInline {SPAN} at (0,0) size 0x19
         LayoutText {#text} at (19,0) size 73x19
           text run at (19,0) width 73: "\x{AD}lorem ipsum"
-      LayoutBlockFlow {P} at (0,778) size 769x20
+      LayoutBlockFlow {P} at (0,784) size 769x20
         LayoutText {#text} at (0,0) size 92x19
           text run at (0,0) width 92: "Do\x{AD}\x{AD}lorem ipsum"
-      LayoutBlockFlow {P} at (0,814) size 769x20
+      LayoutBlockFlow {P} at (0,820) size 769x20
         LayoutInline {SPAN} at (0,0) size 19x19
           LayoutText {#text} at (0,0) size 19x19
             text run at (0,0) width 19: "Do\x{AD}"
         LayoutText {#text} at (19,0) size 73x19
           text run at (19,0) width 73: "\x{AD}lorem ipsum"
-      LayoutBlockFlow {P} at (0,850) size 769x20
+      LayoutBlockFlow {P} at (0,856) size 769x20
         LayoutText {#text} at (0,0) size 19x19
           text run at (0,0) width 19: "Do\x{AD}"
         LayoutInline {SPAN} at (0,0) size 73x19
           LayoutText {#text} at (19,0) size 73x19
             text run at (19,0) width 73: "\x{AD}lorem ipsum"
-      LayoutBlockFlow {P} at (0,886) size 769x20
+      LayoutBlockFlow {P} at (0,892) size 769x20
         LayoutInline {SPAN} at (0,0) size 19x19
           LayoutText {#text} at (0,0) size 19x19
             text run at (0,0) width 19: "Do\x{AD}\x{AD}"
         LayoutText {#text} at (19,0) size 73x19
           text run at (19,0) width 73: "lorem ipsum"
-      LayoutBlockFlow {P} at (0,922) size 769x20
+      LayoutBlockFlow {P} at (0,928) size 769x20
         LayoutText {#text} at (0,0) size 230x19
           text run at (0,0) width 230: "The following pair should be the same:"
-      LayoutBlockFlow {P} at (0,958) size 769x22
+      LayoutBlockFlow {P} at (0,964) size 769x22
         LayoutText {#text} at (0,1) size 15x19
           text run at (0,1) width 15: "W"
         LayoutBlockFlow {SPAN} at (15,0) size 13x22 [border: (1px solid #FF0000)]
@@ -150,7 +150,7 @@
             text run at (1,1) width 11: "X"
         LayoutText {#text} at (28,1) size 11x19
           text run at (28,1) width 11: "Y"
-      LayoutBlockFlow {P} at (0,996) size 769x22
+      LayoutBlockFlow {P} at (0,1002) size 769x22
         LayoutText {#text} at (0,1) size 15x19
           text run at (0,1) width 15: "W"
         LayoutBlockFlow {SPAN} at (15,0) size 13x22 [border: (1px solid #FF0000)]
diff --git a/third_party/WebKit/LayoutTests/platform/win-xp/fast/text/unicode-fallback-font-expected.png b/third_party/WebKit/LayoutTests/platform/win-xp/fast/text/unicode-fallback-font-expected.png
index f53ee63..4dc7422 100644
--- a/third_party/WebKit/LayoutTests/platform/win-xp/fast/text/unicode-fallback-font-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win-xp/fast/text/unicode-fallback-font-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win-xp/fast/text/unicode-fallback-font-expected.txt b/third_party/WebKit/LayoutTests/platform/win-xp/fast/text/unicode-fallback-font-expected.txt
index 1f3ab79e..bcad53e1 100644
--- a/third_party/WebKit/LayoutTests/platform/win-xp/fast/text/unicode-fallback-font-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win-xp/fast/text/unicode-fallback-font-expected.txt
@@ -21,7 +21,7 @@
           text run at (304,80) width 0: " "
           text run at (0,96) width 64: "U+16Fx \x{16F0}"
           text run at (64,96) width 0: " "
-        LayoutText {#text} at (0,112) size 309x133
+        LayoutText {#text} at (0,112) size 328x133
           text run at (0,112) width 0: " "
           text run at (0,129) width 239: "U+200x \x{2000} \x{2001} \x{2002} \x{2003} \x{2004} \x{2004} \x{2004} \x{2004} \x{2004} \x{2009} \x{200A} \x{200B} \x{200C} \x{200D} \x{200E} "
           text run at (239,129) width 0 RTL: "\x{200F}"
@@ -37,12 +37,12 @@
           text run at (222,163) width 16 RTL override: "\x{202E} \x{202F}"
           text run at (0,180) width 309: "U+203x \x{2030} \x{2031} \x{2032} \x{2033} \x{2034} \x{2035} \x{2036} \x{2037} \x{2038} \x{2039} \x{203A} \x{203B} \x{203C} \x{203D} \x{203E} \x{203F}"
           text run at (309,180) width 0: " "
-          text run at (0,197) width 296: "U+204x \x{2040} \x{2041} \x{2042} \x{2043} \x{2044} \x{2045} \x{2046} \x{2047} \x{2048} \x{2049} \x{204A} \x{204B} \x{204C} \x{204D} \x{204E} \x{204F}"
-          text run at (296,197) width 0: " "
-          text run at (0,213) width 304: "U+205x \x{2050} \x{2051} \x{2052} \x{2053} \x{2054} \x{2055} \x{2056} \x{2057} \x{2058} \x{2059} \x{205A} \x{205B} \x{205C} \x{205D} \x{205E} \x{205F}"
-          text run at (304,213) width 0: " "
-          text run at (0,229) width 224: "U+206x \x{2060} \x{2061} \x{2062} \x{2063} \x{2064} \x{206A} \x{206B} \x{206C} \x{206D} \x{206E} \x{206F}"
-          text run at (224,229) width 0: " "
+          text run at (0,197) width 320: "U+204x \x{2040} \x{2041} \x{2042} \x{2043} \x{2044} \x{2045} \x{2046} \x{2047} \x{2048} \x{2049} \x{204A} \x{204B} \x{204C} \x{204D} \x{204E} \x{204F}"
+          text run at (320,197) width 0: " "
+          text run at (0,213) width 328: "U+205x \x{2050} \x{2051} \x{2052} \x{2053} \x{2054} \x{2055} \x{2056} \x{2057} \x{2058} \x{2059} \x{205A} \x{205B} \x{205C} \x{205D} \x{205E} \x{205F}"
+          text run at (328,213) width 0: " "
+          text run at (0,229) width 136: "U+206x \x{2060} \x{2061} \x{2062} \x{2063} \x{2064} \x{206A} \x{206B} \x{206C} \x{206D} \x{206E} \x{206F}"
+          text run at (136,229) width 0: " "
         LayoutText {#text} at (0,245) size 384x273
           text run at (0,245) width 0: " "
           text run at (0,261) width 384: "U+260x \x{2600} \x{2601} \x{2602} \x{2603} \x{2604} \x{2605} \x{2606} \x{2607} \x{2608} \x{2609} \x{260A} \x{260B} \x{260C} \x{260D} \x{260E} \x{260F}"
@@ -103,10 +103,10 @@
           text run at (384,694) width 0: " "
           text run at (0,710) width 374: "U+27Bx \x{27B0} \x{27B1} \x{27B2} \x{27B3} \x{27B4} \x{27B5} \x{27B6} \x{27B7} \x{27B8} \x{27B9} \x{27BA} \x{27BB} \x{27BC} \x{27BD} \x{27BE} \x{27BF}"
           text run at (374,710) width 0: " "
-        LayoutText {#text} at (0,726) size 304x288
+        LayoutText {#text} at (0,726) size 344x288
           text run at (0,726) width 0: " "
-          text run at (0,742) width 304: "U+2A0x \x{2A00} \x{2A01} \x{2A02} \x{2A03} \x{2A04} \x{2A05} \x{2A06} \x{2A07} \x{2A08} \x{2A09} \x{2A0A} \x{2A0B} \x{2A0C} \x{2A0D} \x{2A0E} \x{2A0F}"
-          text run at (304,742) width 0: " "
+          text run at (0,742) width 328: "U+2A0x \x{2A00} \x{2A01} \x{2A02} \x{2A03} \x{2A04} \x{2A05} \x{2A06} \x{2A07} \x{2A08} \x{2A09} \x{2A0A} \x{2A0B} \x{2A0C} \x{2A0D} \x{2A0E} \x{2A0F}"
+          text run at (328,742) width 0: " "
           text run at (0,758) width 304: "U+2A1x \x{2A10} \x{2A11} \x{2A12} \x{2A13} \x{2A14} \x{2A15} \x{2A16} \x{2A17} \x{2A18} \x{2A19} \x{2A1A} \x{2A1B} \x{2A1C} \x{2A1D} \x{2A1E} \x{2A1F}"
           text run at (304,758) width 0: " "
           text run at (0,774) width 304: "U+2A2x \x{2A20} \x{2A21} \x{2A22} \x{2A23} \x{2A24} \x{2A25} \x{2A26} \x{2A27} \x{2A28} \x{2A29} \x{2A2A} \x{2A2B} \x{2A2C} \x{2A2D} \x{2A2E} \x{2A2F}"
@@ -119,8 +119,8 @@
           text run at (304,822) width 0: " "
           text run at (0,838) width 304: "U+2A6x \x{2A60} \x{2A61} \x{2A62} \x{2A63} \x{2A64} \x{2A65} \x{2A66} \x{2A67} \x{2A68} \x{2A69} \x{2A6A} \x{2A6B} \x{2A6C} \x{2A6D} \x{2A6E} \x{2A6F}"
           text run at (304,838) width 0: " "
-          text run at (0,854) width 304: "U+2A7x \x{2A70} \x{2A71} \x{2A72} \x{2A73} \x{2A74} \x{2A75} \x{2A76} \x{2A77} \x{2A78} \x{2A79} \x{2A7A} \x{2A7B} \x{2A7C} \x{2A7D} \x{2A7E} \x{2A7F}"
-          text run at (304,854) width 0: " "
+          text run at (0,854) width 344: "U+2A7x \x{2A70} \x{2A71} \x{2A72} \x{2A73} \x{2A74} \x{2A75} \x{2A76} \x{2A77} \x{2A78} \x{2A79} \x{2A7A} \x{2A7B} \x{2A7C} \x{2A7D} \x{2A7E} \x{2A7F}"
+          text run at (344,854) width 0: " "
           text run at (0,870) width 304: "U+2A8x \x{2A80} \x{2A81} \x{2A82} \x{2A83} \x{2A84} \x{2A85} \x{2A86} \x{2A87} \x{2A88} \x{2A89} \x{2A8A} \x{2A8B} \x{2A8C} \x{2A8D} \x{2A8E} \x{2A8F}"
           text run at (304,870) width 0: " "
           text run at (0,886) width 304: "U+2A9x \x{2A90} \x{2A91} \x{2A92} \x{2A93} \x{2A94} \x{2A95} \x{2A96} \x{2A97} \x{2A98} \x{2A99} \x{2A9A} \x{2A9B} \x{2A9C} \x{2A9D} \x{2A9E} \x{2A9F}"
diff --git a/third_party/WebKit/LayoutTests/platform/win-xp/fast/writing-mode/broken-ideograph-small-caps-expected.png b/third_party/WebKit/LayoutTests/platform/win-xp/fast/writing-mode/broken-ideograph-small-caps-expected.png
deleted file mode 100644
index a1011998..0000000
--- a/third_party/WebKit/LayoutTests/platform/win-xp/fast/writing-mode/broken-ideograph-small-caps-expected.png
+++ /dev/null
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/atsui-partial-selection-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/text/atsui-partial-selection-expected.png
index a8491ce..bfdfef3 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/atsui-partial-selection-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/atsui-partial-selection-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/atsui-partial-selection-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/text/atsui-partial-selection-expected.txt
index fdcf823c..ed3968e4 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/atsui-partial-selection-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/atsui-partial-selection-expected.txt
@@ -4,15 +4,15 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x600
     LayoutBlockFlow {BODY} at (8,8) size 784x576
       LayoutBlockFlow {P} at (0,0) size 784x36
-        LayoutText {#text} at (0,0) size 55x17
-          text run at (0,0) width 55: "Test for "
-        LayoutInline {I} at (0,0) size 763x35
-          LayoutInline {A} at (0,0) size 306x17 [color=#0000EE]
-            LayoutText {#text} at (54,0) size 306x17
-              text run at (54,0) width 306: "http://bugs.webkit.org/show_bug.cgi?id=11124"
-          LayoutText {#text} at (359,0) size 763x35
-            text run at (359,0) width 5: " "
-            text run at (363,0) width 400: "REGRESSION (r14297): No drag image for partially-selected"
+        LayoutText {#text} at (0,0) size 54x17
+          text run at (0,0) width 54: "Test for "
+        LayoutInline {I} at (0,0) size 759x35
+          LayoutInline {A} at (0,0) size 303x17 [color=#0000EE]
+            LayoutText {#text} at (53,0) size 303x17
+              text run at (53,0) width 303: "http://bugs.webkit.org/show_bug.cgi?id=11124"
+          LayoutText {#text} at (355,0) size 759x35
+            text run at (355,0) width 5: " "
+            text run at (359,0) width 400: "REGRESSION (r14297): No drag image for partially-selected"
             text run at (0,18) width 81: "complex text"
         LayoutText {#text} at (80,18) size 5x17
           text run at (80,18) width 5: "."
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/atsui-pointtooffset-calls-cg-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/text/atsui-pointtooffset-calls-cg-expected.png
index 4ea7b7a..d0a65f6 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/atsui-pointtooffset-calls-cg-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/atsui-pointtooffset-calls-cg-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/atsui-pointtooffset-calls-cg-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/text/atsui-pointtooffset-calls-cg-expected.txt
index dc356cb1..8cd99575 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/atsui-pointtooffset-calls-cg-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/atsui-pointtooffset-calls-cg-expected.txt
@@ -10,9 +10,9 @@
       LayoutBlockFlow (anonymous) at (0,36) size 800x36
         LayoutText {#text} at (0,0) size 213x17
           text run at (0,0) width 213: "This tests for regressions against "
-        LayoutInline {I} at (0,0) size 794x35
-          LayoutText {#text} at (212,0) size 794x35
-            text run at (212,0) width 582: "http://bugzilla.opendarwin.org/show_bug.cgi?id=5878 pointToOffset always takes the CG"
+        LayoutInline {I} at (0,0) size 792x35
+          LayoutText {#text} at (212,0) size 792x35
+            text run at (212,0) width 580: "http://bugzilla.opendarwin.org/show_bug.cgi?id=5878 pointToOffset always takes the CG"
             text run at (0,18) width 63: "code path"
         LayoutText {#text} at (62,18) size 648x17
           text run at (62,18) width 648: " by clicking the X and verifying that the correct caret position (13) is reported to the editing delegate."
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/atsui-small-caps-punctuation-size-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/text/atsui-small-caps-punctuation-size-expected.png
index 2e73b9b..4f740888 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/atsui-small-caps-punctuation-size-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/atsui-small-caps-punctuation-size-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/atsui-small-caps-punctuation-size-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/text/atsui-small-caps-punctuation-size-expected.txt
index 381d5871..3e91d66 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/atsui-small-caps-punctuation-size-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/atsui-small-caps-punctuation-size-expected.txt
@@ -6,12 +6,12 @@
       LayoutBlockFlow {P} at (0,0) size 784x36
         LayoutText {#text} at (0,0) size 218x17
           text run at (0,0) width 218: "This tests for a regression against "
-        LayoutInline {I} at (0,0) size 755x35
-          LayoutInline {A} at (0,0) size 355x17 [color=#0000EE]
-            LayoutText {#text} at (217,0) size 355x17
-              text run at (217,0) width 355: "http://bugzilla.opendarwin.org/show_bug.cgi?id=6397"
-          LayoutText {#text} at (571,0) size 755x35
-            text run at (571,0) width 184: " ATSUI small caps use small"
+        LayoutInline {I} at (0,0) size 754x35
+          LayoutInline {A} at (0,0) size 354x17 [color=#0000EE]
+            LayoutText {#text} at (217,0) size 354x17
+              text run at (217,0) width 354: "http://bugzilla.opendarwin.org/show_bug.cgi?id=6397"
+          LayoutText {#text} at (570,0) size 754x35
+            text run at (570,0) width 184: " ATSUI small caps use small"
             text run at (0,18) width 77: "punctuation"
         LayoutText {#text} at (76,18) size 5x17
           text run at (76,18) width 5: "."
@@ -20,11 +20,11 @@
           text run at (0,0) width 375: "All four question marks below should be \x{201C}big\x{201D}, like this: ?"
       LayoutBlockFlow {HR} at (0,86) size 784x2 [border: (1px inset #EEEEEE)]
       LayoutBlockFlow {P} at (0,104) size 784x18
-        LayoutText {#text} at (0,0) size 56x17
-          text run at (0,0) width 56: "ATSUI: "
+        LayoutText {#text} at (0,0) size 54x17
+          text run at (0,0) width 54: "ATSUI: "
         LayoutInline {SPAN} at (0,0) size 41x17
-          LayoutText {#text} at (55,0) size 41x17
-            text run at (55,0) width 41: "A?b?e\x{300}"
+          LayoutText {#text} at (53,0) size 41x17
+            text run at (53,0) width 41: "A?b?e\x{300}"
       LayoutBlockFlow {P} at (0,138) size 784x18
         LayoutText {#text} at (0,0) size 31x17
           text run at (0,0) width 31: "CG: "
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/basic/002-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/text/basic/002-expected.png
index 0e5f474..d51d5b76 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/basic/002-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/basic/002-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/basic/005-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/text/basic/005-expected.png
index 32164b2..e5dbd3f 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/basic/005-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/basic/005-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/basic/005-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/text/basic/005-expected.txt
index 8f27ad5c..c1a5f0f 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/basic/005-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/basic/005-expected.txt
@@ -3,6 +3,6 @@
 layer at (0,0) size 800x600
   LayoutBlockFlow {HTML} at (0,0) size 800x600
     LayoutBlockFlow {BODY} at (8,8) size 784x584
-      LayoutBlockFlow (floating) {DIV} at (0,0) size 264.03x22 [border: (2px solid #008000)]
-        LayoutText {#text} at (2,2) size 261x17
-          text run at (2,2) width 261: "Words should have a negative spacing of 5px."
+      LayoutBlockFlow (floating) {DIV} at (0,0) size 262.75x22 [border: (2px solid #008000)]
+        LayoutText {#text} at (2,2) size 259x17
+          text run at (2,2) width 259: "Words should have a negative spacing of 5px."
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/basic/012-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/text/basic/012-expected.png
index 72391a57..e4a4e25f 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/basic/012-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/basic/012-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/basic/012-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/text/basic/012-expected.txt
index 572efb8..467ce33 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/basic/012-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/basic/012-expected.txt
@@ -10,11 +10,11 @@
         LayoutText {#text} at (0,0) size 781x35
           text run at (0,0) width 654: "Apart from whitespace (tab and linefeed characters), the two lists below (in red) use identical HTML. "
           text run at (653,0) width 128: "Both lists should be"
-          text run at (0,18) width 595: "rendered on a single line. In Safari, however, the first list shows each item on a separate line."
+          text run at (0,18) width 594: "rendered on a single line. In Safari, however, the first list shows each item on a separate line."
       LayoutBlockFlow {P} at (0,98.91) size 784x36
         LayoutText {#text} at (0,0) size 764x35
           text run at (0,0) width 764: "This bug only seems to occur if the bullet character is non-ASCII (has a Unicode value higher than 127). Non-breaking"
-          text run at (0,18) width 286: "spaces (&#160;), however, are an exception."
+          text run at (0,18) width 285: "spaces (&#160;), however, are an exception."
       LayoutBlockFlow (anonymous) at (0,150.91) size 784x72
         LayoutBR {BR} at (0,0) size 0x17
         LayoutInline {FONT} at (0,0) size 338x53 [color=#CC0000]
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/bidi-embedding-pop-and-push-same-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/text/bidi-embedding-pop-and-push-same-expected.png
index 57f4487..48ab123 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/bidi-embedding-pop-and-push-same-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/bidi-embedding-pop-and-push-same-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/bidi-embedding-pop-and-push-same-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/text/bidi-embedding-pop-and-push-same-expected.txt
index ee6fcb5..77d2629 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/bidi-embedding-pop-and-push-same-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/bidi-embedding-pop-and-push-same-expected.txt
@@ -4,8 +4,8 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x600
     LayoutBlockFlow {BODY} at (8,8) size 784x584
       LayoutBlockFlow {P} at (0,0) size 784x18
-        LayoutText {#text} at (0,0) size 521x17
-          text run at (0,0) width 521: "In each box below, the words or letters should be in the same order on every line."
+        LayoutText {#text} at (0,0) size 520x17
+          text run at (0,0) width 520: "In each box below, the words or letters should be in the same order on every line."
       LayoutBlockFlow {DIV} at (8,34) size 768x64 [border: (1px solid #ADD8E6)]
         LayoutBlockFlow {DIV} at (5,5) size 758x18
           LayoutText {#text} at (0,0) size 47x17
@@ -32,19 +32,19 @@
           LayoutInline {SPAN} at (0,0) size 44x17
             LayoutText {#text} at (46,0) size 44x17
               text run at (46,0) width 44: "ipsum "
-          LayoutInline {B} at (0,0) size 95x17
-            LayoutInline {SPAN} at (0,0) size 38x17
-              LayoutText {#text} at (89,0) size 38x17
-                text run at (89,0) width 38: "dolor"
-            LayoutText {#text} at (126,0) size 5x17
-              text run at (126,0) width 5: " "
-            LayoutInline {I} at (0,0) size 16x17
-              LayoutText {#text} at (130,0) size 16x17
-                text run at (130,0) width 16: "sit"
-            LayoutText {#text} at (145,0) size 39x17
-              text run at (145,0) width 39: " amet"
-          LayoutText {#text} at (183,0) size 5x17
-            text run at (183,0) width 5: "."
+          LayoutInline {B} at (0,0) size 94x17
+            LayoutInline {SPAN} at (0,0) size 37x17
+              LayoutText {#text} at (89,0) size 37x17
+                text run at (89,0) width 37: "dolor"
+            LayoutText {#text} at (125,0) size 5x17
+              text run at (125,0) width 5: " "
+            LayoutInline {I} at (0,0) size 17x17
+              LayoutText {#text} at (129,0) size 17x17
+                text run at (129,0) width 17: "sit"
+            LayoutText {#text} at (145,0) size 38x17
+              text run at (145,0) width 38: " amet"
+          LayoutText {#text} at (182,0) size 5x17
+            text run at (182,0) width 5: "."
       LayoutBlockFlow {DIV} at (8,106) size 768x64 [border: (1px solid #ADD8E6)]
         LayoutBlockFlow {DIV} at (5,5) size 758x18
           LayoutText {#text} at (0,0) size 47x17
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/bidi-img-alt-text-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/text/bidi-img-alt-text-expected.png
index 4cda7c15..23b4cda 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/bidi-img-alt-text-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/bidi-img-alt-text-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/bidi-img-alt-text-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/text/bidi-img-alt-text-expected.txt
index 4e7484b..073c26d 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/bidi-img-alt-text-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/bidi-img-alt-text-expected.txt
@@ -17,8 +17,8 @@
           text run at (302,406) width 4: " "
         LayoutText {#text} at (0,0) size 0x0
       LayoutBlockFlow {P} at (0,440) size 784x18
-        LayoutText {#text} at (0,0) size 366x17
-          text run at (0,0) width 366: "Tests that image alt text takes directionality into account."
+        LayoutText {#text} at (0,0) size 365x17
+          text run at (0,0) width 365: "Tests that image alt text takes directionality into account."
 layer at (8,8) size 302x102 clip at (9,9) size 300x100 scrollHeight 133
   LayoutBlockFlow (relative positioned) {SECTION} at (0,0) size 302x102 [border: (1px solid #FF0000)]
     LayoutBlockFlow {H2} at (1,20.91) size 300x27
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/break-word-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/text/break-word-expected.png
index 09d92cb..3941150 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/break-word-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/break-word-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/break-word-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/text/break-word-expected.txt
index 4239697d..40fa7e1 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/break-word-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/break-word-expected.txt
@@ -4,18 +4,18 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x600
     LayoutBlockFlow {BODY} at (8,8) size 784x584
       LayoutBlockFlow {P} at (0,0) size 784x36
-        LayoutText {#text} at (0,0) size 55x17
-          text run at (0,0) width 55: "Test for "
-        LayoutInline {I} at (0,0) size 752x35
-          LayoutInline {A} at (0,0) size 306x17 [color=#0000EE]
-            LayoutText {#text} at (54,0) size 306x17
-              text run at (54,0) width 306: "http://bugs.webkit.org/show_bug.cgi?id=12726"
-          LayoutText {#text} at (359,0) size 752x35
-            text run at (359,0) width 5: " "
-            text run at (363,0) width 389: "REGRESSION (r12073): Text wraps in the middle of a word"
-            text run at (0,18) width 314: "instead of wrapping at the space before the word"
-        LayoutText {#text} at (313,18) size 5x17
-          text run at (313,18) width 5: "."
+        LayoutText {#text} at (0,0) size 54x17
+          text run at (0,0) width 54: "Test for "
+        LayoutInline {I} at (0,0) size 748x35
+          LayoutInline {A} at (0,0) size 305x17 [color=#0000EE]
+            LayoutText {#text} at (53,0) size 305x17
+              text run at (53,0) width 305: "http://bugs.webkit.org/show_bug.cgi?id=12726"
+          LayoutText {#text} at (357,0) size 748x35
+            text run at (357,0) width 5: " "
+            text run at (361,0) width 387: "REGRESSION (r12073): Text wraps in the middle of a word"
+            text run at (0,18) width 313: "instead of wrapping at the space before the word"
+        LayoutText {#text} at (312,18) size 5x17
+          text run at (312,18) width 5: "."
       LayoutBlockFlow {P} at (0,52) size 784x18
         LayoutText {#text} at (0,0) size 388x17
           text run at (0,0) width 388: "\x{201C}onelongwrodwithnobreaks\x{201D} should not break in the middle."
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/capitalize-empty-generated-string-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/text/capitalize-empty-generated-string-expected.png
index cc36f41..a149b56 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/capitalize-empty-generated-string-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/capitalize-empty-generated-string-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/capitalize-empty-generated-string-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/text/capitalize-empty-generated-string-expected.txt
index cb385b8..fdcf38c8 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/capitalize-empty-generated-string-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/capitalize-empty-generated-string-expected.txt
@@ -7,12 +7,12 @@
         LayoutText {#text} at (0,0) size 177x17
           text run at (0,0) width 177: "This is a regression test for "
         LayoutInline {I} at (0,0) size 782x35
-          LayoutInline {A} at (0,0) size 355x17 [color=#0000EE]
-            LayoutText {#text} at (176,0) size 355x17
-              text run at (176,0) width 355: "http://bugzilla.opendarwin.org/show_bug.cgi?id=9432"
-          LayoutText {#text} at (530,0) size 782x35
-            text run at (530,0) width 5: " "
-            text run at (534,0) width 248: "REGRESSION: crash in capitalization"
+          LayoutInline {A} at (0,0) size 354x17 [color=#0000EE]
+            LayoutText {#text} at (176,0) size 354x17
+              text run at (176,0) width 354: "http://bugzilla.opendarwin.org/show_bug.cgi?id=9432"
+          LayoutText {#text} at (529,0) size 782x35
+            text run at (529,0) width 5: " "
+            text run at (533,0) width 249: "REGRESSION: crash in capitalization"
             text run at (0,18) width 278: "code due to empty-string generated content"
         LayoutText {#text} at (277,18) size 5x17
           text run at (277,18) width 5: "."
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/capitalize-preserve-nbsp-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/text/capitalize-preserve-nbsp-expected.png
index df50ce5..059d5dc 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/capitalize-preserve-nbsp-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/capitalize-preserve-nbsp-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/capitalize-preserve-nbsp-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/text/capitalize-preserve-nbsp-expected.txt
index a15346ea..0c091e4f 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/capitalize-preserve-nbsp-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/capitalize-preserve-nbsp-expected.txt
@@ -4,15 +4,15 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x600
     LayoutBlockFlow {BODY} at (8,8) size 784x576
       LayoutBlockFlow {P} at (0,0) size 784x36
-        LayoutText {#text} at (0,0) size 55x17
-          text run at (0,0) width 55: "Test for "
-        LayoutInline {I} at (0,0) size 781x35
-          LayoutInline {A} at (0,0) size 306x17 [color=#0000EE]
-            LayoutText {#text} at (54,0) size 306x17
-              text run at (54,0) width 306: "http://bugs.webkit.org/show_bug.cgi?id=11671"
-          LayoutText {#text} at (359,0) size 781x35
-            text run at (359,0) width 5: " "
-            text run at (363,0) width 418: "REGRESSION (r13702): text-transform: capitalize changes non-"
+        LayoutText {#text} at (0,0) size 54x17
+          text run at (0,0) width 54: "Test for "
+        LayoutInline {I} at (0,0) size 778x35
+          LayoutInline {A} at (0,0) size 304x17 [color=#0000EE]
+            LayoutText {#text} at (53,0) size 304x17
+              text run at (53,0) width 304: "http://bugs.webkit.org/show_bug.cgi?id=11671"
+          LayoutText {#text} at (356,0) size 778x35
+            text run at (356,0) width 5: " "
+            text run at (360,0) width 418: "REGRESSION (r13702): text-transform: capitalize changes non-"
             text run at (0,18) width 167: "breaking spaces to spaces"
         LayoutText {#text} at (166,18) size 5x17
           text run at (166,18) width 5: "."
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/caps-lock-indicator-disabled-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/text/caps-lock-indicator-disabled-expected.png
index 6662c73d..914f4ae9 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/caps-lock-indicator-disabled-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/caps-lock-indicator-disabled-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/caps-lock-indicator-disabled-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/text/caps-lock-indicator-disabled-expected.txt
index d863b99..ece5968 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/caps-lock-indicator-disabled-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/caps-lock-indicator-disabled-expected.txt
@@ -3,9 +3,9 @@
 layer at (0,0) size 800x55
   LayoutBlockFlow {HTML} at (0,0) size 800x55
     LayoutBlockFlow {BODY} at (8,8) size 784x39
-      LayoutText {#text} at (0,0) size 587x17
-        text run at (0,0) width 587: "Test passes if password field does not include caps lock icon on right edge on any platform."
-      LayoutBR {BR} at (586,0) size 1x17
+      LayoutText {#text} at (0,0) size 586x17
+        text run at (0,0) width 586: "Test passes if password field does not include caps lock icon on right edge on any platform."
+      LayoutBR {BR} at (585,0) size 1x17
       LayoutTextControl {INPUT} at (0,18) size 173x21 [bgcolor=#FFFFFF] [border: (2px inset #EEEEEE)]
       LayoutText {#text} at (0,0) size 0x0
       LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/caps-lock-indicator-enabled-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/text/caps-lock-indicator-enabled-expected.png
index 323a65c..33fb475 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/caps-lock-indicator-enabled-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/caps-lock-indicator-enabled-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/caps-lock-indicator-enabled-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/text/caps-lock-indicator-enabled-expected.txt
index c141a763..7997ee1 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/caps-lock-indicator-enabled-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/caps-lock-indicator-enabled-expected.txt
@@ -3,9 +3,9 @@
 layer at (0,0) size 800x55
   LayoutBlockFlow {HTML} at (0,0) size 800x55
     LayoutBlockFlow {BODY} at (8,8) size 784x39
-      LayoutText {#text} at (0,0) size 580x17
-        text run at (0,0) width 580: "Test passes if password field includes caps lock icon on right edge on Mac platforms only."
-      LayoutBR {BR} at (579,0) size 1x17
+      LayoutText {#text} at (0,0) size 578x17
+        text run at (0,0) width 578: "Test passes if password field includes caps lock icon on right edge on Mac platforms only."
+      LayoutBR {BR} at (577,0) size 1x17
       LayoutTextControl {INPUT} at (0,18) size 173x21 [bgcolor=#FFFFFF] [border: (2px inset #EEEEEE)]
       LayoutText {#text} at (0,0) size 0x0
       LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/complex-text-rtl-selection-repaint-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/text/complex-text-rtl-selection-repaint-expected.png
index 5bf156e..506c12d 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/complex-text-rtl-selection-repaint-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/complex-text-rtl-selection-repaint-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/complex-text-rtl-selection-repaint-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/text/complex-text-rtl-selection-repaint-expected.txt
index 56dbd50..e4589a8 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/complex-text-rtl-selection-repaint-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/complex-text-rtl-selection-repaint-expected.txt
@@ -9,7 +9,7 @@
             text run at (0,0) width 82 RTL override: "m\x{300}uspimeroL"
         LayoutText {#text} at (0,0) size 0x0
       LayoutBlockFlow {P} at (0,34) size 784x18
-        LayoutText {#text} at (0,0) size 409x17
-          text run at (0,0) width 409: "Tests that rtl selections are repainted correctly for complex text."
+        LayoutText {#text} at (0,0) size 408x17
+          text run at (0,0) width 408: "Tests that rtl selections are repainted correctly for complex text."
 selection start: position 2 of child 0 {#text} of child 3 {BDO} of body
 selection end:   position 6 of child 0 {#text} of child 3 {BDO} of body
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/delete-hard-break-character-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/text/delete-hard-break-character-expected.png
index d978fac32..d12a855 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/delete-hard-break-character-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/delete-hard-break-character-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/delete-hard-break-character-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/text/delete-hard-break-character-expected.txt
index e599163..1171bba 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/delete-hard-break-character-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/delete-hard-break-character-expected.txt
@@ -4,15 +4,15 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x600
     LayoutBlockFlow {BODY} at (8,8) size 784x584
       LayoutBlockFlow {P} at (0,0) size 784x36
-        LayoutText {#text} at (0,0) size 55x17
-          text run at (0,0) width 55: "Test for "
-        LayoutInline {I} at (0,0) size 680x35
-          LayoutInline {A} at (0,0) size 306x17 [color=#0000EE]
-            LayoutText {#text} at (54,0) size 306x17
-              text run at (54,0) width 306: "http://bugs.webkit.org/show_bug.cgi?id=10144"
-          LayoutText {#text} at (359,0) size 680x35
-            text run at (359,0) width 5: " "
-            text run at (363,0) width 317: "REGRESSION: Reproducible assertion failure in"
+        LayoutText {#text} at (0,0) size 54x17
+          text run at (0,0) width 54: "Test for "
+        LayoutInline {I} at (0,0) size 677x35
+          LayoutInline {A} at (0,0) size 305x17 [color=#0000EE]
+            LayoutText {#text} at (53,0) size 305x17
+              text run at (53,0) width 305: "http://bugs.webkit.org/show_bug.cgi?id=10144"
+          LayoutText {#text} at (357,0) size 677x35
+            text run at (357,0) width 5: " "
+            text run at (361,0) width 316: "REGRESSION: Reproducible assertion failure in"
             text run at (0,18) width 294: "DeleteSelectionCommand::fixupWhitespace()"
         LayoutText {#text} at (293,18) size 5x17
           text run at (293,18) width 5: "."
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/ellipsis-platform-font-change-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/text/ellipsis-platform-font-change-expected.png
index 6f785a6..dbbb29c 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/ellipsis-platform-font-change-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/ellipsis-platform-font-change-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/emphasis-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/text/emphasis-expected.png
index f96c46b..12804721 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/emphasis-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/emphasis-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/emphasis-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/text/emphasis-expected.txt
index 5de8a0a9..cdf39bd 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/emphasis-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/emphasis-expected.txt
@@ -18,7 +18,7 @@
         LayoutText {#text} at (112,70) size 334x66
           text run at (112,70) width 13: ", "
           text run at (124,70) width 213: "lobortis eu iaculis vel,"
-          text run at (3,110) width 209: "scelerisque nec dolor."
+          text run at (3,110) width 208: "scelerisque nec dolor."
       LayoutBlockFlow (floating) {DIV} at (390,8) size 366x140 [border: (3px solid #000000)]
         LayoutText {#text} at (3,3) size 273x26
           text run at (3,3) width 273: "Lorem ipsum dolor sit amet,"
@@ -94,7 +94,7 @@
         LayoutText {#text} at (198,121) size 334x53
           text run at (198,121) width 7: " "
           text run at (204,121) width 133: "eu iaculis vel,"
-          text run at (3,148) width 209: "scelerisque nec dolor."
+          text run at (3,148) width 208: "scelerisque nec dolor."
       LayoutBlockFlow (floating) {DIV} at (390,164) size 366x177 [border: (3px solid #000000)]
         LayoutText {#text} at (3,3) size 70x26
           text run at (3,3) width 70: "Lorem "
@@ -154,7 +154,7 @@
         LayoutText {#text} at (198,95) size 334x78
           text run at (198,95) width 7: " "
           text run at (204,95) width 133: "eu iaculis vel,"
-          text run at (3,147) width 209: "scelerisque nec dolor."
+          text run at (3,147) width 208: "scelerisque nec dolor."
       LayoutBlockFlow (floating) {DIV} at (390,357) size 366x198 [border: (3px solid #000000)]
         LayoutText {#text} at (3,14) size 273x26
           text run at (3,14) width 273: "Lorem ipsum dolor sit amet,"
@@ -170,7 +170,7 @@
         LayoutText {#text} at (112,110) size 334x74
           text run at (112,110) width 13: ", "
           text run at (124,110) width 213: "lobortis eu iaculis vel,"
-          text run at (3,158) width 209: "scelerisque nec dolor."
+          text run at (3,158) width 208: "scelerisque nec dolor."
       LayoutBlockFlow (floating) {DIV} at (8,571) size 366x140 [border: (3px solid #000000)]
         LayoutText {#text} at (3,3) size 273x26
           text run at (3,3) width 273: "Lorem ipsum dolor sit amet,"
@@ -186,6 +186,6 @@
         LayoutText {#text} at (112,70) size 334x66
           text run at (112,70) width 13: ", "
           text run at (124,70) width 213: "lobortis eu iaculis vel,"
-          text run at (3,110) width 209: "scelerisque nec dolor."
+          text run at (3,110) width 208: "scelerisque nec dolor."
 selection start: position 10 of child 0 {#text} of child 1 {SPAN} of child 10 {DIV} of body
 selection end:   position 7 of child 0 {#text} of child 3 {SPAN} of child 10 {DIV} of body
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/fake-italic-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/text/fake-italic-expected.png
index f88d28aa..6c6faf5f 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/fake-italic-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/fake-italic-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/fake-italic-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/text/fake-italic-expected.txt
index 5f2560c6..3001807 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/fake-italic-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/fake-italic-expected.txt
@@ -5,9 +5,9 @@
     LayoutBlockFlow {BODY} at (8,8) size 784x576
       LayoutBlockFlow {P} at (0,0) size 784x54
         LayoutText {#text} at (0,0) size 778x53
-          text run at (0,0) width 759: "This layout test is designed to test that our fake italic mode is working correctly. The Ahem font, used below, does not"
+          text run at (0,0) width 756: "This layout test is designed to test that our fake italic mode is working correctly. The Ahem font, used below, does not"
           text run at (0,18) width 778: "include an italic variant. Thus, when we ask for italic Ahem, we should skew the glyphs ourselves, resulting in a series of"
-          text run at (0,36) width 160: "italic black boxes below."
+          text run at (0,36) width 159: "italic black boxes below."
       LayoutBlockFlow {P} at (0,70) size 784x16
         LayoutText {#text} at (0,0) size 112x16
           text run at (0,0) width 112: "A A A A"
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/fallback-for-custom-font-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/text/fallback-for-custom-font-expected.png
index 44c1c99..2d0b982 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/fallback-for-custom-font-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/fallback-for-custom-font-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/fallback-for-custom-font-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/text/fallback-for-custom-font-expected.txt
index 0229c36..2fedf48 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/fallback-for-custom-font-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/fallback-for-custom-font-expected.txt
@@ -4,15 +4,15 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x600
     LayoutBlockFlow {BODY} at (8,8) size 784x576
       LayoutBlockFlow {P} at (0,0) size 784x36
-        LayoutText {#text} at (0,0) size 55x17
-          text run at (0,0) width 55: "Test for "
-        LayoutInline {I} at (0,0) size 712x35
+        LayoutText {#text} at (0,0) size 54x17
+          text run at (0,0) width 54: "Test for "
+        LayoutInline {I} at (0,0) size 710x35
           LayoutInline {A} at (0,0) size 160x17 [color=#0000EE]
-            LayoutText {#text} at (54,0) size 160x17
-              text run at (54,0) width 160: "http://crbug.com/373389"
-          LayoutText {#text} at (213,0) size 712x35
-            text run at (213,0) width 5: " "
-            text run at (217,0) width 495: "When a webfont is missing a glyph, synthesization from the fallback font isn't"
+            LayoutText {#text} at (53,0) size 160x17
+              text run at (53,0) width 160: "http://crbug.com/373389"
+          LayoutText {#text} at (212,0) size 710x35
+            text run at (212,0) width 5: " "
+            text run at (216,0) width 494: "When a webfont is missing a glyph, synthesization from the fallback font isn't"
             text run at (0,18) width 68: "happening"
         LayoutText {#text} at (67,18) size 5x17
           text run at (67,18) width 5: "."
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/fallback-traits-fixup-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/text/fallback-traits-fixup-expected.png
index fcf809d7..785dd0d 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/fallback-traits-fixup-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/fallback-traits-fixup-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/fallback-traits-fixup-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/text/fallback-traits-fixup-expected.txt
index af079a4..46aee3c8 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/fallback-traits-fixup-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/fallback-traits-fixup-expected.txt
@@ -4,17 +4,17 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x600
     LayoutBlockFlow {BODY} at (8,8) size 784x576
       LayoutBlockFlow {P} at (0,0) size 784x18
-        LayoutText {#text} at (0,0) size 55x17
-          text run at (0,0) width 55: "Test for "
-        LayoutInline {I} at (0,0) size 515x17
-          LayoutInline {A} at (0,0) size 157x17 [color=#0000EE]
-            LayoutText {#text} at (54,0) size 157x17
-              text run at (54,0) width 157: "rdar://problem/9528843"
-          LayoutText {#text} at (210,0) size 359x17
-            text run at (210,0) width 5: " "
-            text run at (214,0) width 355: "STIX glyphs not rendered on this stackoverflow answer"
-        LayoutText {#text} at (568,0) size 5x17
-          text run at (568,0) width 5: "."
+        LayoutText {#text} at (0,0) size 54x17
+          text run at (0,0) width 54: "Test for "
+        LayoutInline {I} at (0,0) size 513x17
+          LayoutInline {A} at (0,0) size 156x17 [color=#0000EE]
+            LayoutText {#text} at (53,0) size 156x17
+              text run at (53,0) width 156: "rdar://problem/9528843"
+          LayoutText {#text} at (208,0) size 358x17
+            text run at (208,0) width 5: " "
+            text run at (212,0) width 354: "STIX glyphs not rendered on this stackoverflow answer"
+        LayoutText {#text} at (565,0) size 5x17
+          text run at (565,0) width 5: "."
       LayoutBlockFlow {P} at (0,34) size 784x43
         LayoutText {#text} at (0,21) size 99x17
           text run at (0,21) width 99: "A black circle: "
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/font-initial-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/text/font-initial-expected.png
index 85e67e3..ed23037 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/font-initial-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/font-initial-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/font-initial-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/text/font-initial-expected.txt
index 22955a5c..06a1ebd3 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/font-initial-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/font-initial-expected.txt
@@ -4,19 +4,19 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x600
     LayoutBlockFlow {BODY} at (8,8) size 784x584
       LayoutBlockFlow {P} at (0,0) size 784x18
-        LayoutText {#text} at (0,0) size 55x17
-          text run at (0,0) width 55: "Test for "
-        LayoutInline {I} at (0,0) size 631x17
-          LayoutInline {A} at (0,0) size 306x17 [color=#0000EE]
-            LayoutText {#text} at (54,0) size 306x17
-              text run at (54,0) width 306: "http://bugs.webkit.org/show_bug.cgi?id=12039"
-          LayoutText {#text} at (359,0) size 326x17
-            text run at (359,0) width 5: " "
-            text run at (363,0) width 322: "Assertion failure in WebCore::Font::primaryFont"
-        LayoutText {#text} at (684,0) size 5x17
-          text run at (684,0) width 5: "."
+        LayoutText {#text} at (0,0) size 54x17
+          text run at (0,0) width 54: "Test for "
+        LayoutInline {I} at (0,0) size 628x17
+          LayoutInline {A} at (0,0) size 305x17 [color=#0000EE]
+            LayoutText {#text} at (53,0) size 305x17
+              text run at (53,0) width 305: "http://bugs.webkit.org/show_bug.cgi?id=12039"
+          LayoutText {#text} at (357,0) size 324x17
+            text run at (357,0) width 5: " "
+            text run at (361,0) width 320: "Assertion failure in WebCore::Font::primaryFont"
+        LayoutText {#text} at (680,0) size 5x17
+          text run at (680,0) width 5: "."
       LayoutBlockFlow (anonymous) at (0,34) size 784x18
-        LayoutInline {SPAN} at (0,0) size 39x17
-          LayoutText {#text} at (0,0) size 39x17
-            text run at (0,0) width 39: "PASS"
+        LayoutInline {SPAN} at (0,0) size 37x17
+          LayoutText {#text} at (0,0) size 37x17
+            text run at (0,0) width 37: "PASS"
         LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/font-kerning-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/text/font-kerning-expected.png
index 22feda68..44f2dfe 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/font-kerning-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/font-kerning-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/font-smallcaps-layout-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/text/font-smallcaps-layout-expected.png
index edc1741..f362cce 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/font-smallcaps-layout-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/font-smallcaps-layout-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/font-smallcaps-layout-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/text/font-smallcaps-layout-expected.txt
index 5d83331..58318459 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/font-smallcaps-layout-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/font-smallcaps-layout-expected.txt
@@ -3,8 +3,8 @@
 layer at (0,0) size 800x36
   LayoutBlockFlow {HTML} at (0,0) size 800x36
     LayoutBlockFlow {BODY} at (0,0) size 800x36
-      LayoutText {#text} at (0,0) size 798x35
-        text run at (0,0) width 798: "Testing for incorrect text overflow when using small caps in the complex test path. There should be no red characters visible"
+      LayoutText {#text} at (0,0) size 797x35
+        text run at (0,0) width 797: "Testing for incorrect text overflow when using small caps in the complex test path. There should be no red characters visible"
         text run at (0,18) width 146: "on the green rectangle."
       LayoutText {#text} at (0,0) size 0x0
 layer at (-500,36) size 1000x366 backgroundClip at (0,0) size 800x600 clip at (0,0) size 800x600
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/in-rendered-text-rtl-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/text/in-rendered-text-rtl-expected.png
index 93bb5bd..f93f327 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/in-rendered-text-rtl-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/in-rendered-text-rtl-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/in-rendered-text-rtl-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/text/in-rendered-text-rtl-expected.txt
index 269d221..ff0b287 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/in-rendered-text-rtl-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/in-rendered-text-rtl-expected.txt
@@ -4,14 +4,14 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x600
     LayoutBlockFlow {BODY} at (8,8) size 784x584
       LayoutBlockFlow {P} at (0,0) size 784x36
-        LayoutText {#text} at (0,0) size 55x17
-          text run at (0,0) width 55: "Test for "
-        LayoutInline {I} at (0,0) size 768x35
-          LayoutInline {A} at (0,0) size 354x17 [color=#0000EE]
-            LayoutText {#text} at (54,0) size 354x17
-              text run at (54,0) width 354: "http://bugzilla.opendarwin.org/show_bug.cgi?id=7433"
-          LayoutText {#text} at (407,0) size 768x35
-            text run at (407,0) width 361: " REGRESSION (r12789): Second RTL text run on a line"
+        LayoutText {#text} at (0,0) size 54x17
+          text run at (0,0) width 54: "Test for "
+        LayoutInline {I} at (0,0) size 766x35
+          LayoutInline {A} at (0,0) size 353x17 [color=#0000EE]
+            LayoutText {#text} at (53,0) size 353x17
+              text run at (53,0) width 353: "http://bugzilla.opendarwin.org/show_bug.cgi?id=7433"
+          LayoutText {#text} at (405,0) size 766x35
+            text run at (405,0) width 361: " REGRESSION (r12789): Second RTL text run on a line"
             text run at (0,18) width 119: "cannot be selected"
         LayoutText {#text} at (118,18) size 5x17
           text run at (118,18) width 5: "."
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/international/bidi-AN-after-empty-run-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/text/international/bidi-AN-after-empty-run-expected.png
index 29de205..349a87a 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/international/bidi-AN-after-empty-run-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/international/bidi-AN-after-empty-run-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/international/bidi-AN-after-empty-run-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/text/international/bidi-AN-after-empty-run-expected.txt
index a7e2f222..be46475 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/international/bidi-AN-after-empty-run-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/international/bidi-AN-after-empty-run-expected.txt
@@ -4,19 +4,19 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x600
     LayoutBlockFlow {BODY} at (8,8) size 784x584
       LayoutBlockFlow {P} at (0,0) size 784x18
-        LayoutText {#text} at (0,0) size 55x17
-          text run at (0,0) width 55: "Test for "
-        LayoutInline {I} at (0,0) size 402x17
-          LayoutInline {A} at (0,0) size 157x17 [color=#0000EE]
-            LayoutText {#text} at (54,0) size 157x17
-              text run at (54,0) width 157: "rdar://problem/6020930"
-          LayoutText {#text} at (210,0) size 246x17
-            text run at (210,0) width 246: " Bidi Problem When Resizing Window"
-        LayoutText {#text} at (455,0) size 5x17
-          text run at (455,0) width 5: "."
+        LayoutText {#text} at (0,0) size 54x17
+          text run at (0,0) width 54: "Test for "
+        LayoutInline {I} at (0,0) size 399x17
+          LayoutInline {A} at (0,0) size 156x17 [color=#0000EE]
+            LayoutText {#text} at (53,0) size 156x17
+              text run at (53,0) width 156: "rdar://problem/6020930"
+          LayoutText {#text} at (208,0) size 244x17
+            text run at (208,0) width 244: " Bidi Problem When Resizing Window"
+        LayoutText {#text} at (451,0) size 5x17
+          text run at (451,0) width 5: "."
       LayoutBlockFlow {P} at (0,34) size 784x18
-        LayoutText {#text} at (0,0) size 325x17
-          text run at (0,0) width 325: "The boxes below should be identical to each other."
+        LayoutText {#text} at (0,0) size 324x17
+          text run at (0,0) width 324: "The boxes below should be identical to each other."
       LayoutBlockFlow {DIV} at (0,68) size 90x46 [border: (1px solid #0000FF)]
         LayoutText {#text} at (5,5) size 60x35
           text run at (5,5) width 56 RTL: "\x{627}\x{644}\x{645}\x{627}\x{626}\x{629} \x{645}\x{644}\x{64A}\x{627}\x{631}"
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/international/bidi-LDB-2-CSS-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/text/international/bidi-LDB-2-CSS-expected.png
index 5ca6208..75a3bb9 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/international/bidi-LDB-2-CSS-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/international/bidi-LDB-2-CSS-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/international/bidi-LDB-2-CSS-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/text/international/bidi-LDB-2-CSS-expected.txt
index c54d550..0e83dce 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/international/bidi-LDB-2-CSS-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/international/bidi-LDB-2-CSS-expected.txt
@@ -4,8 +4,8 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x553.88
     LayoutBlockFlow {BODY} at (8,21.44) size 784x516.44
       LayoutBlockFlow {H1} at (0,0) size 784x37
-        LayoutText {#text} at (0,0) size 424x36
-          text run at (0,0) width 424: "Bidirectional Text Test 2 - CSS"
+        LayoutText {#text} at (0,0) size 418x36
+          text run at (0,0) width 418: "Bidirectional Text Test 2 - CSS"
       LayoutBlockFlow {P} at (0,58.44) size 784x18
         LayoutText {#text} at (0,0) size 134x17
           text run at (0,0) width 134: "This test is based on "
@@ -571,16 +571,16 @@
       LayoutBlockFlow {P} at (0,430.44) size 784x18
         LayoutText {#text} at (0,0) size 59x17
           text run at (0,0) width 59: "(Back to "
-        LayoutInline {A} at (0,0) size 162x17 [color=#0000EE]
-          LayoutText {#text} at (58,0) size 162x17
-            text run at (58,0) width 162: "CSS Testing Information"
-        LayoutText {#text} at (219,0) size 9x17
-          text run at (219,0) width 9: ", "
+        LayoutInline {A} at (0,0) size 161x17 [color=#0000EE]
+          LayoutText {#text} at (58,0) size 161x17
+            text run at (58,0) width 161: "CSS Testing Information"
+        LayoutText {#text} at (218,0) size 9x17
+          text run at (218,0) width 9: ", "
         LayoutInline {A} at (0,0) size 83x17 [color=#0000EE]
-          LayoutText {#text} at (227,0) size 83x17
-            text run at (227,0) width 83: "David Baron"
-        LayoutText {#text} at (309,0) size 7x17
-          text run at (309,0) width 7: ")"
+          LayoutText {#text} at (226,0) size 83x17
+            text run at (226,0) width 83: "David Baron"
+        LayoutText {#text} at (308,0) size 6x17
+          text run at (308,0) width 6: ")"
       LayoutBlockFlow {P} at (0,464.44) size 784x18
         LayoutInline {A} at (0,0) size 32x17 [color=#0000EE]
           LayoutText {#text} at (0,0) size 32x17
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/international/bidi-LDB-2-HTML-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/text/international/bidi-LDB-2-HTML-expected.png
index 8440ff2..e00e94e 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/international/bidi-LDB-2-HTML-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/international/bidi-LDB-2-HTML-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/international/bidi-LDB-2-HTML-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/text/international/bidi-LDB-2-HTML-expected.txt
index 8c9e4e8e..12a4e778 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/international/bidi-LDB-2-HTML-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/international/bidi-LDB-2-HTML-expected.txt
@@ -4,8 +4,8 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x501.88
     LayoutBlockFlow {BODY} at (8,21.44) size 784x464.44
       LayoutBlockFlow {H1} at (0,0) size 784x37
-        LayoutText {#text} at (0,0) size 464x36
-          text run at (0,0) width 464: "Bidirectional Text Test 2 - HTML"
+        LayoutText {#text} at (0,0) size 457x36
+          text run at (0,0) width 457: "Bidirectional Text Test 2 - HTML"
       LayoutBlockFlow {P} at (0,58.44) size 784x18
         LayoutText {#text} at (0,0) size 134x17
           text run at (0,0) width 134: "This test is based on "
@@ -558,16 +558,16 @@
       LayoutBlockFlow {P} at (0,378.44) size 784x18
         LayoutText {#text} at (0,0) size 59x17
           text run at (0,0) width 59: "(Back to "
-        LayoutInline {A} at (0,0) size 162x17 [color=#0000EE]
-          LayoutText {#text} at (58,0) size 162x17
-            text run at (58,0) width 162: "CSS Testing Information"
-        LayoutText {#text} at (219,0) size 9x17
-          text run at (219,0) width 9: ", "
+        LayoutInline {A} at (0,0) size 161x17 [color=#0000EE]
+          LayoutText {#text} at (58,0) size 161x17
+            text run at (58,0) width 161: "CSS Testing Information"
+        LayoutText {#text} at (218,0) size 9x17
+          text run at (218,0) width 9: ", "
         LayoutInline {A} at (0,0) size 83x17 [color=#0000EE]
-          LayoutText {#text} at (227,0) size 83x17
-            text run at (227,0) width 83: "David Baron"
-        LayoutText {#text} at (309,0) size 7x17
-          text run at (309,0) width 7: ")"
+          LayoutText {#text} at (226,0) size 83x17
+            text run at (226,0) width 83: "David Baron"
+        LayoutText {#text} at (308,0) size 6x17
+          text run at (308,0) width 6: ")"
       LayoutBlockFlow {P} at (0,412.44) size 784x18
         LayoutInline {A} at (0,0) size 32x17 [color=#0000EE]
           LayoutText {#text} at (0,0) size 32x17
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/international/bidi-LDB-2-formatting-characters-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/text/international/bidi-LDB-2-formatting-characters-expected.png
index 911f155..acb2943 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/international/bidi-LDB-2-formatting-characters-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/international/bidi-LDB-2-formatting-characters-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/international/bidi-LDB-2-formatting-characters-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/text/international/bidi-LDB-2-formatting-characters-expected.txt
index 8fb0d9bf..f72feb07 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/international/bidi-LDB-2-formatting-characters-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/international/bidi-LDB-2-formatting-characters-expected.txt
@@ -4,8 +4,8 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x577.88
     LayoutBlockFlow {BODY} at (8,21.44) size 784x540.44
       LayoutBlockFlow {H1} at (0,0) size 784x37
-        LayoutText {#text} at (0,0) size 683x36
-          text run at (0,0) width 683: "Bidirectional Text Test 2 - Formatting Characters"
+        LayoutText {#text} at (0,0) size 677x36
+          text run at (0,0) width 677: "Bidirectional Text Test 2 - Formatting Characters"
       LayoutBlockFlow {P} at (0,58.44) size 784x18
         LayoutText {#text} at (0,0) size 134x17
           text run at (0,0) width 134: "This test is based on "
@@ -543,16 +543,16 @@
       LayoutBlockFlow {P} at (0,454.44) size 784x18
         LayoutText {#text} at (0,0) size 59x17
           text run at (0,0) width 59: "(Back to "
-        LayoutInline {A} at (0,0) size 162x17 [color=#0000EE]
-          LayoutText {#text} at (58,0) size 162x17
-            text run at (58,0) width 162: "CSS Testing Information"
-        LayoutText {#text} at (219,0) size 9x17
-          text run at (219,0) width 9: ", "
+        LayoutInline {A} at (0,0) size 161x17 [color=#0000EE]
+          LayoutText {#text} at (58,0) size 161x17
+            text run at (58,0) width 161: "CSS Testing Information"
+        LayoutText {#text} at (218,0) size 9x17
+          text run at (218,0) width 9: ", "
         LayoutInline {A} at (0,0) size 83x17 [color=#0000EE]
-          LayoutText {#text} at (227,0) size 83x17
-            text run at (227,0) width 83: "David Baron"
-        LayoutText {#text} at (309,0) size 7x17
-          text run at (309,0) width 7: ")"
+          LayoutText {#text} at (226,0) size 83x17
+            text run at (226,0) width 83: "David Baron"
+        LayoutText {#text} at (308,0) size 6x17
+          text run at (308,0) width 6: ")"
       LayoutBlockFlow {P} at (0,488.44) size 784x18
         LayoutInline {A} at (0,0) size 32x17 [color=#0000EE]
           LayoutText {#text} at (0,0) size 32x17
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/international/bidi-european-terminators-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/text/international/bidi-european-terminators-expected.png
index feeb1d7..260f0b56 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/international/bidi-european-terminators-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/international/bidi-european-terminators-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/international/bidi-european-terminators-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/text/international/bidi-european-terminators-expected.txt
index a3aacde..96ae6ed 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/international/bidi-european-terminators-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/international/bidi-european-terminators-expected.txt
@@ -6,20 +6,20 @@
       LayoutBlockFlow {P} at (0,0) size 784x36
         LayoutText {#text} at (0,0) size 88x17
           text run at (0,0) width 88: "This tests for "
-        LayoutInline {I} at (0,0) size 729x35
-          LayoutText {#text} at (87,0) size 729x35
-            text run at (87,0) width 642: "http://bugzilla.opendarwin.org/show_bug.cgi?id=6014 Bidi algorithm: incorrect resolved levels for"
-            text run at (0,18) width 213: "neutrals between R and ET ON L"
-        LayoutText {#text} at (212,18) size 5x17
-          text run at (212,18) width 5: "."
+        LayoutInline {I} at (0,0) size 783x35
+          LayoutText {#text} at (87,0) size 783x35
+            text run at (87,0) width 696: "http://bugzilla.opendarwin.org/show_bug.cgi?id=6014 Bidi algorithm: incorrect resolved levels for neutrals"
+            text run at (0,18) width 156: "between R and ET ON L"
+        LayoutText {#text} at (155,18) size 5x17
+          text run at (155,18) width 5: "."
       LayoutBlockFlow {P} at (0,52) size 784x36
-        LayoutText {#text} at (0,0) size 769x35
+        LayoutText {#text} at (0,0) size 768x35
           text run at (0,0) width 98: "The characters "
           text run at (97,0) width 9 RTL: "\x{5D0}"
           text run at (105,0) width 32: " and "
           text run at (136,0) width 8 RTL: "\x{5D1}"
-          text run at (143,0) width 626: " are of type R; ^ and @ are of type ON; $ and % are of type ET; a is of type L; 1 is of type EN. In"
-          text run at (0,18) width 477: "each of the following pairs, the two lines should be identical to each other."
+          text run at (143,0) width 625: " are of type R; ^ and @ are of type ON; $ and % are of type ET; a is of type L; 1 is of type EN. In"
+          text run at (0,18) width 476: "each of the following pairs, the two lines should be identical to each other."
       LayoutBlockFlow {HR} at (0,104) size 784x2 [border: (1px inset #EEEEEE)]
       LayoutBlockFlow {P} at (0,122) size 784x18
         LayoutText {#text} at (0,0) size 75x17
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/international/bidi-ignored-for-first-child-inline-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/text/international/bidi-ignored-for-first-child-inline-expected.png
index 52ff615..3feb0ba 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/international/bidi-ignored-for-first-child-inline-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/international/bidi-ignored-for-first-child-inline-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/international/bidi-ignored-for-first-child-inline-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/text/international/bidi-ignored-for-first-child-inline-expected.txt
index 800eeb4..5718d00e 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/international/bidi-ignored-for-first-child-inline-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/international/bidi-ignored-for-first-child-inline-expected.txt
@@ -6,12 +6,12 @@
       LayoutBlockFlow {P} at (0,0) size 784x36
         LayoutText {#text} at (0,0) size 108x17
           text run at (0,0) width 108: "This is a test for "
-        LayoutInline {I} at (0,0) size 777x35
-          LayoutText {#text} at (107,0) size 777x35
-            text run at (107,0) width 670: "http://bugzilla.opendarwin.org/show_bug.cgi?id=5980 Bidi properties of an inline container whose first"
-            text run at (0,18) width 252: "child is an inline container are ignored"
-        LayoutText {#text} at (251,18) size 5x17
-          text run at (251,18) width 5: "."
+        LayoutInline {I} at (0,0) size 776x35
+          LayoutText {#text} at (107,0) size 776x35
+            text run at (107,0) width 669: "http://bugzilla.opendarwin.org/show_bug.cgi?id=5980 Bidi properties of an inline container whose first"
+            text run at (0,18) width 251: "child is an inline container are ignored"
+        LayoutText {#text} at (250,18) size 5x17
+          text run at (250,18) width 5: "."
       LayoutBlockFlow {HR} at (0,52) size 784x2 [border: (1px inset #EEEEEE)]
       LayoutBlockFlow {P} at (0,70) size 784x18
         LayoutText {#text} at (0,0) size 318x17
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/international/bidi-innertext-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/text/international/bidi-innertext-expected.png
index 20cb45aa..96b535f 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/international/bidi-innertext-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/international/bidi-innertext-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/international/bidi-innertext-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/text/international/bidi-innertext-expected.txt
index 26556ba..7df9230 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/international/bidi-innertext-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/international/bidi-innertext-expected.txt
@@ -4,83 +4,83 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x600
     LayoutBlockFlow {BODY} at (8,8) size 784x576
       LayoutBlockFlow (anonymous) at (0,0) size 784x36
-        LayoutText {#text} at (0,0) size 775x35
-          text run at (0,0) width 476: "The following tests text iteration over RTL text embedded with LTR text. "
-          text run at (475,0) width 300: "TextIterators are used for find, spellcheck, and"
-          text run at (0,18) width 67: ".innerText"
+        LayoutText {#text} at (0,0) size 771x35
+          text run at (0,0) width 474: "The following tests text iteration over RTL text embedded with LTR text. "
+          text run at (473,0) width 298: "TextIterators are used for find, spellcheck, and"
+          text run at (0,18) width 66: ".innerText"
       LayoutBlockFlow {HR} at (0,44) size 784x2 [border: (1px inset #EEEEEE)]
       LayoutBlockFlow (anonymous) at (0,54) size 784x18
         LayoutText {#text} at (0,0) size 136x17
           text run at (0,0) width 136: "Embedded Numbers:"
       LayoutBlockFlow {DIV} at (0,72) size 784x18 [color=#0000FF]
-        LayoutText {#text} at (0,0) size 110x17
-          text run at (0,0) width 58: "Testing ("
-          text run at (57,0) width 13 RTL: "\x{5DF}\x{5DE}"
-          text run at (69,0) width 9: "3"
-          text run at (77,0) width 27 RTL: "\x{5D7}\x{5D5}\x{5D3}\x{5D0}"
-          text run at (103,0) width 7: ")"
+        LayoutText {#text} at (0,0) size 109x17
+          text run at (0,0) width 57: "Testing ("
+          text run at (56,0) width 13 RTL: "\x{5DF}\x{5DE}"
+          text run at (68,0) width 9: "3"
+          text run at (76,0) width 27 RTL: "\x{5D7}\x{5D5}\x{5D3}\x{5D0}"
+          text run at (102,0) width 7: ")"
       LayoutBlockFlow (anonymous) at (0,90) size 784x18
-        LayoutText {#text} at (0,0) size 108x17
-          text run at (0,0) width 108: "Embedded LTR:"
+        LayoutText {#text} at (0,0) size 106x17
+          text run at (0,0) width 106: "Embedded LTR:"
       LayoutBlockFlow {DIV} at (0,108) size 784x18 [color=#0000FF]
-        LayoutText {#text} at (0,0) size 134x17
-          text run at (0,0) width 58: "Testing ("
-          text run at (57,0) width 27 RTL: "\x{5D7}\x{5D5}\x{5D3}\x{5D0}"
-          text run at (83,0) width 33: "hello"
-          text run at (115,0) width 13 RTL: "\x{5DF}\x{5DE}"
-          text run at (127,0) width 7: ")"
+        LayoutText {#text} at (0,0) size 133x17
+          text run at (0,0) width 57: "Testing ("
+          text run at (56,0) width 27 RTL: "\x{5D7}\x{5D5}\x{5D3}\x{5D0}"
+          text run at (82,0) width 33: "hello"
+          text run at (114,0) width 13 RTL: "\x{5DF}\x{5DE}"
+          text run at (126,0) width 7: ")"
       LayoutBlockFlow (anonymous) at (0,126) size 784x18
-        LayoutText {#text} at (0,0) size 193x17
-          text run at (0,0) width 193: "Embedded Numbers and LTR"
+        LayoutText {#text} at (0,0) size 191x17
+          text run at (0,0) width 191: "Embedded Numbers and LTR"
       LayoutBlockFlow {DIV} at (0,144) size 784x18 [color=#0000FF]
-        LayoutText {#text} at (0,0) size 129x17
-          text run at (0,0) width 58: "Testing ("
-          text run at (57,0) width 23 RTL: "\x{5E7}\x{5E7}\x{5E8}"
-          text run at (79,0) width 9: "3"
-          text run at (87,0) width 28 RTL: "\x{5D9}\x{5E7}\x{5DD}\x{5DC}"
-          text run at (114,0) width 15: "h)"
+        LayoutText {#text} at (0,0) size 128x17
+          text run at (0,0) width 57: "Testing ("
+          text run at (56,0) width 23 RTL: "\x{5E7}\x{5E7}\x{5E8}"
+          text run at (78,0) width 9: "3"
+          text run at (86,0) width 28 RTL: "\x{5D9}\x{5E7}\x{5DD}\x{5DC}"
+          text run at (113,0) width 15: "h)"
       LayoutBlockFlow (anonymous) at (0,162) size 784x18
         LayoutText {#text} at (0,0) size 221x17
           text run at (0,0) width 221: "Embedded Numbers with spacing:"
       LayoutBlockFlow {DIV} at (0,180) size 784x18 [color=#0000FF]
-        LayoutText {#text} at (0,0) size 235x17
-          text run at (0,0) width 58: "Testing ("
-          text run at (57,0) width 31 RTL: " \x{5D7}\x{5D5}\x{5D3}\x{5D0}"
-          text run at (87,0) width 25: "300"
-          text run at (111,0) width 44 RTL: "\x{5D7}\x{5D5}\x{5D3}\x{5D0}\x{5DF}\x{5DE} "
-          text run at (154,0) width 41: "34023"
-          text run at (194,0) width 35 RTL: "\x{5D9}\x{5E7}\x{5DA}\x{5DA}\x{5DD}"
-          text run at (228,0) width 7: ")"
+        LayoutText {#text} at (0,0) size 234x17
+          text run at (0,0) width 57: "Testing ("
+          text run at (56,0) width 31 RTL: " \x{5D7}\x{5D5}\x{5D3}\x{5D0}"
+          text run at (86,0) width 25: "300"
+          text run at (110,0) width 44 RTL: "\x{5D7}\x{5D5}\x{5D3}\x{5D0}\x{5DF}\x{5DE} "
+          text run at (153,0) width 41: "34023"
+          text run at (193,0) width 35 RTL: "\x{5D9}\x{5E7}\x{5DA}\x{5DA}\x{5DD}"
+          text run at (227,0) width 7: ")"
       LayoutBlockFlow (anonymous) at (0,198) size 784x18
-        LayoutText {#text} at (0,0) size 72x17
-          text run at (0,0) width 72: "Plain LTR:"
+        LayoutText {#text} at (0,0) size 71x17
+          text run at (0,0) width 71: "Plain LTR:"
       LayoutBlockFlow {DIV} at (0,216) size 784x18 [color=#0000FF]
-        LayoutText {#text} at (0,0) size 95x17
-          text run at (0,0) width 95: "Testing (hello)"
+        LayoutText {#text} at (0,0) size 94x17
+          text run at (0,0) width 94: "Testing (hello)"
       LayoutBlockFlow (anonymous) at (0,234) size 784x18
-        LayoutText {#text} at (0,0) size 193x17
-          text run at (0,0) width 193: "Embedded LTR with spacing:"
+        LayoutText {#text} at (0,0) size 191x17
+          text run at (0,0) width 191: "Embedded LTR with spacing:"
       LayoutBlockFlow {DIV} at (0,252) size 784x18 [color=#0000FF]
-        LayoutText {#text} at (0,0) size 173x17
-          text run at (0,0) width 58: "Testing ("
-          text run at (57,0) width 54 RTL: "\x{5D7}\x{5D5}\x{5D3}\x{5D9}\x{5E7}\x{5DA}\x{5DA}\x{5DD}"
-          text run at (110,0) width 41: " hello "
-          text run at (150,0) width 17 RTL: "\x{5DF}\x{5DE}\x{5D9}"
-          text run at (166,0) width 7: ")"
+        LayoutText {#text} at (0,0) size 172x17
+          text run at (0,0) width 57: "Testing ("
+          text run at (56,0) width 54 RTL: "\x{5D7}\x{5D5}\x{5D3}\x{5D9}\x{5E7}\x{5DA}\x{5DA}\x{5DD}"
+          text run at (109,0) width 41: " hello "
+          text run at (149,0) width 17 RTL: "\x{5DF}\x{5DE}\x{5D9}"
+          text run at (165,0) width 7: ")"
       LayoutBlockFlow (anonymous) at (0,270) size 784x18
         LayoutText {#text} at (0,0) size 165x17
           text run at (0,0) width 165: "Mixed but not embedded:"
       LayoutBlockFlow {DIV} at (0,288) size 784x18 [color=#0000FF]
-        LayoutText {#text} at (0,0) size 126x17
-          text run at (0,0) width 90: "Testing (hello"
-          text run at (89,0) width 32 RTL: "\x{5D7}\x{5D5}\x{5D3}\x{5DF}\x{5DE}"
-          text run at (120,0) width 6: ")"
+        LayoutText {#text} at (0,0) size 125x17
+          text run at (0,0) width 89: "Testing (hello"
+          text run at (88,0) width 32 RTL: "\x{5D7}\x{5D5}\x{5D3}\x{5DF}\x{5DE}"
+          text run at (119,0) width 6: ")"
       LayoutBlockFlow (anonymous) at (0,306) size 784x18
         LayoutText {#text} at (0,0) size 165x17
           text run at (0,0) width 165: "Mixed but not embedded:"
       LayoutBlockFlow {DIV} at (0,324) size 784x18 [color=#0000FF]
-        LayoutText {#text} at (0,0) size 126x17
-          text run at (0,0) width 58: "Testing ("
-          text run at (57,0) width 32 RTL: "\x{5D7}\x{5D5}\x{5D3}\x{5DF}\x{5DE}"
-          text run at (88,0) width 38: "hello)"
+        LayoutText {#text} at (0,0) size 125x17
+          text run at (0,0) width 57: "Testing ("
+          text run at (56,0) width 32 RTL: "\x{5D7}\x{5D5}\x{5D3}\x{5DF}\x{5DE}"
+          text run at (87,0) width 38: "hello)"
       LayoutBlockFlow {OL} at (0,358) size 784x0
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/international/bidi-listbox-atsui-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/text/international/bidi-listbox-atsui-expected.png
index 1adb88b..5c72183 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/international/bidi-listbox-atsui-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/international/bidi-listbox-atsui-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/international/bidi-listbox-atsui-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/text/international/bidi-listbox-atsui-expected.txt
index d6c38968..d75d386b 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/international/bidi-listbox-atsui-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/international/bidi-listbox-atsui-expected.txt
@@ -4,9 +4,9 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x600
     LayoutBlockFlow {BODY} at (8,8) size 784x584
       LayoutBlockFlow {P} at (0,0) size 784x36
-        LayoutText {#text} at (0,0) size 594x17
-          text run at (0,0) width 594: "This tests that bidirectional text is correctly rendered when using ATSUI in list box controls."
-        LayoutBR {BR} at (593,14) size 1x0
+        LayoutText {#text} at (0,0) size 592x17
+          text run at (0,0) width 592: "This tests that bidirectional text is correctly rendered when using ATSUI in list box controls."
+        LayoutBR {BR} at (591,14) size 1x0
         LayoutText {#text} at (0,18) size 578x17
           text run at (0,18) width 578: "The order of the text below each list box should match the order of the select's option text."
       LayoutBlockFlow (anonymous) at (0,52) size 784x54
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/international/bidi-neutral-directionality-paragraph-start-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/text/international/bidi-neutral-directionality-paragraph-start-expected.png
index fe3c559..e11a0a97 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/international/bidi-neutral-directionality-paragraph-start-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/international/bidi-neutral-directionality-paragraph-start-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/international/bidi-neutral-directionality-paragraph-start-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/text/international/bidi-neutral-directionality-paragraph-start-expected.txt
index 8361d29..7c6644c8 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/international/bidi-neutral-directionality-paragraph-start-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/international/bidi-neutral-directionality-paragraph-start-expected.txt
@@ -7,19 +7,19 @@
         LayoutText {#text} at (0,0) size 581x17
           text run at (0,0) width 581: "Mitz Pettel contributed this fix to KDE, and now we're rolling it in. Here's his explanation:"
       LayoutBlockFlow {P} at (0,34) size 784x72
-        LayoutText {#text} at (0,0) size 774x71
+        LayoutText {#text} at (0,0) size 773x71
           text run at (0,0) width 772: "The directionality of a neutral character at the beginning of a paragraph (or after a hard line break) is decided incorrectly"
-          text run at (0,18) width 774: "if the first non-neutral character in the paragraph has directionality opposite to the paragraph directionality. For example,"
-          text run at (0,36) width 754: "if the paragraph direction is LTR, the first character on the paragraph is a question mark and the next one is a Hebrew"
-          text run at (0,54) width 725: "character, then the question mark will is considered right-to-left and appears to the right of the Hebrew character."
+          text run at (0,18) width 773: "if the first non-neutral character in the paragraph has directionality opposite to the paragraph directionality. For example,"
+          text run at (0,36) width 752: "if the paragraph direction is LTR, the first character on the paragraph is a question mark and the next one is a Hebrew"
+          text run at (0,54) width 724: "character, then the question mark will is considered right-to-left and appears to the right of the Hebrew character."
       LayoutBlockFlow {P} at (0,122) size 784x36
         LayoutText {#text} at (0,0) size 517x17
           text run at (0,0) width 517: "The rule to follow is 3.3.4.N2 in the Unicode Standard's Bidirectional Algorithm"
-        LayoutInline {A} at (0,0) size 405x17 [color=#0000EE]
-          LayoutText {#text} at (0,18) size 405x17
-            text run at (0,18) width 405: "http://www.unicode.org/reports/tr9/#Resolving_Neutral_Types"
-        LayoutText {#text} at (404,18) size 5x17
-          text run at (404,18) width 5: "."
+        LayoutInline {A} at (0,0) size 402x17 [color=#0000EE]
+          LayoutText {#text} at (0,18) size 402x17
+            text run at (0,18) width 402: "http://www.unicode.org/reports/tr9/#Resolving_Neutral_Types"
+        LayoutText {#text} at (401,18) size 5x17
+          text run at (401,18) width 5: "."
       LayoutBlockFlow {P} at (0,174) size 784x18
         LayoutText {#text} at (0,0) size 692x17
           text run at (0,0) width 692: "If the test is successful, the question marks should be on the far left and far right of the next two paragraphs."
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/international/bidi-neutral-run-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/text/international/bidi-neutral-run-expected.png
index 442ada1..78dfad0f 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/international/bidi-neutral-run-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/international/bidi-neutral-run-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/international/bidi-neutral-run-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/text/international/bidi-neutral-run-expected.txt
index f30881b..783a22f 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/international/bidi-neutral-run-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/international/bidi-neutral-run-expected.txt
@@ -4,8 +4,8 @@
   LayoutBlockFlow {HTML} at (0,0) size 785x6026
     LayoutBlockFlow {BODY} at (8,8) size 769x6002
       LayoutBlockFlow {P} at (0,0) size 769x18
-        LayoutText {#text} at (0,0) size 308x17
-          text run at (0,0) width 308: "Tests the resolved level of runs of neutral types."
+        LayoutText {#text} at (0,0) size 306x17
+          text run at (0,0) width 306: "Tests the resolved level of runs of neutral types."
       LayoutBlockFlow {DIV} at (0,34) size 769x2976
         LayoutBlockFlow {P} at (0,0) size 769x18
           LayoutText {#text} at (0,0) size 44x17
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/international/bidi-override-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/text/international/bidi-override-expected.png
index ecb2ce6..f584d0f 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/international/bidi-override-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/international/bidi-override-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/international/bidi-override-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/text/international/bidi-override-expected.txt
index 8a70961..14c6c97 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/international/bidi-override-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/international/bidi-override-expected.txt
@@ -4,8 +4,8 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x338
     LayoutBlockFlow {BODY} at (8,16) size 784x314
       LayoutBlockFlow {P} at (0,0) size 784x18
-        LayoutText {#text} at (0,0) size 317x17
-          text run at (0,0) width 317: "All rows should be identical to the reference row."
+        LayoutText {#text} at (0,0) size 316x17
+          text run at (0,0) width 316: "All rows should be identical to the reference row."
       LayoutTable {TABLE} at (0,34) size 525x109 [border: none]
         LayoutTableSection {TBODY} at (0,0) size 524x108
           LayoutTableRow {TR} at (0,0) size 524x27
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/international/rtl-caret-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/text/international/rtl-caret-expected.png
index 846bb7a..7c7d9f3 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/international/rtl-caret-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/international/rtl-caret-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/international/rtl-caret-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/text/international/rtl-caret-expected.txt
index 7352841..dde6692 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/international/rtl-caret-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/international/rtl-caret-expected.txt
@@ -6,13 +6,13 @@
       LayoutBlockFlow {P} at (0,0) size 784x36
         LayoutText {#text} at (0,0) size 177x17
           text run at (0,0) width 177: "This is a regression test for "
-        LayoutInline {I} at (0,0) size 735x35
-          LayoutInline {A} at (0,0) size 355x17 [color=#0000EE]
-            LayoutText {#text} at (176,0) size 355x17
-              text run at (176,0) width 355: "http://bugzilla.opendarwin.org/show_bug.cgi?id=8866"
-          LayoutText {#text} at (530,0) size 735x35
-            text run at (530,0) width 5: " "
-            text run at (534,0) width 201: "REGRESSION: Incorrect caret"
+        LayoutInline {I} at (0,0) size 733x35
+          LayoutInline {A} at (0,0) size 354x17 [color=#0000EE]
+            LayoutText {#text} at (176,0) size 354x17
+              text run at (176,0) width 354: "http://bugzilla.opendarwin.org/show_bug.cgi?id=8866"
+          LayoutText {#text} at (529,0) size 733x35
+            text run at (529,0) width 5: " "
+            text run at (533,0) width 200: "REGRESSION: Incorrect caret"
             text run at (0,18) width 127: "position in RTL text"
         LayoutText {#text} at (126,18) size 5x17
           text run at (126,18) width 5: "."
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/international/rtl-negative-letter-spacing-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/text/international/rtl-negative-letter-spacing-expected.png
index aef05b1d..3806a1ad 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/international/rtl-negative-letter-spacing-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/international/rtl-negative-letter-spacing-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/international/rtl-negative-letter-spacing-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/text/international/rtl-negative-letter-spacing-expected.txt
index 758f0266..2797d59 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/international/rtl-negative-letter-spacing-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/international/rtl-negative-letter-spacing-expected.txt
@@ -4,8 +4,8 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x60
     LayoutBlockFlow {BODY} at (8,8) size 784x36
       LayoutBlockFlow {P} at (0,18) size 784x18
-        LayoutText {#text} at (0,0) size 467x17
-          text run at (0,0) width 467: "The line above should have the letter 'a' to the right of the pipe character."
+        LayoutText {#text} at (0,0) size 466x17
+          text run at (0,0) width 466: "The line above should have the letter 'a' to the right of the pipe character."
 layer at (792,8) size 0x18
   LayoutBlockFlow (floating) {DIV} at (784,0) size 0x18
     LayoutText {#text} at (0,0) size 0x17
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/international/text-combine-image-test-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/text/international/text-combine-image-test-expected.png
index d6819544..f20c3db3 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/international/text-combine-image-test-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/international/text-combine-image-test-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/international/thai-baht-space-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/text/international/thai-baht-space-expected.png
index 0e6682e..df8bcec 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/international/thai-baht-space-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/international/thai-baht-space-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/international/thai-baht-space-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/text/international/thai-baht-space-expected.txt
index e2bff97..8041e93 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/international/thai-baht-space-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/international/thai-baht-space-expected.txt
@@ -4,14 +4,14 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x600
     LayoutBlockFlow {BODY} at (8,8) size 784x576
       LayoutBlockFlow (anonymous) at (0,0) size 784x36
-        LayoutText {#text} at (0,0) size 55x17
-          text run at (0,0) width 55: "Test for "
+        LayoutText {#text} at (0,0) size 54x17
+          text run at (0,0) width 54: "Test for "
         LayoutInline {A} at (0,0) size 69x17 [color=#0000EE]
-          LayoutText {#text} at (54,0) size 69x17
-            text run at (54,0) width 69: "bug 25464"
-        LayoutText {#text} at (122,0) size 727x35
-          text run at (122,0) width 605: ". Characters belonging to 'Common' script followed / preceeded by a space should be rendered"
-          text run at (0,18) width 648: "correctly. Two lines below have 4 Thai currency signs (U+0E3F) and all of them should be rendered."
+          LayoutText {#text} at (53,0) size 69x17
+            text run at (53,0) width 69: "bug 25464"
+        LayoutText {#text} at (121,0) size 726x35
+          text run at (121,0) width 605: ". Characters belonging to 'Common' script followed / preceeded by a space should be rendered"
+          text run at (0,18) width 646: "correctly. Two lines below have 4 Thai currency signs (U+0E3F) and all of them should be rendered."
       LayoutBlockFlow {P} at (0,52) size 784x40
         LayoutText {#text} at (0,2) size 285x17
           text run at (0,2) width 285: "abc \x{E25}\x{E07}\x{E17}\x{E38}\x{E19}4000\x{E3F} \x{E23}\x{E31}\x{E1A}\x{E1B}\x{E23}\x{E30}\x{E01}\x{E31}\x{E19}\x{E23}\x{E32}\x{E22}\x{E44}\x{E14}\x{E49} 50000\x{E3F}/M"
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/international/thai-line-breaks-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/text/international/thai-line-breaks-expected.png
index edeaf04..6e08c7eeb 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/international/thai-line-breaks-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/international/thai-line-breaks-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/international/thai-line-breaks-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/text/international/thai-line-breaks-expected.txt
index 824a174..983167e7 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/international/thai-line-breaks-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/international/thai-line-breaks-expected.txt
@@ -4,11 +4,11 @@
   LayoutBlockFlow {HTML} at (0,0) size 785x600
     LayoutBlockFlow {BODY} at (8,8) size 769x576
       LayoutBlockFlow {P} at (0,0) size 769x72
-        LayoutText {#text} at (0,0) size 762x71
+        LayoutText {#text} at (0,0) size 761x71
           text run at (0,0) width 743: "The column on the right has explicit spaces. Line breaks should be roughly the same if Thai line breaks are working"
           text run at (0,18) width 760: "well. The original source of this text was ICU, and the test program said \"by it's very nature, Thai word breaking is not"
-          text run at (0,36) width 762: "exact\", so the columns don't match exactly. In a future version we might decide to tweak the right column to match our"
-          text run at (0,54) width 121: "expected behavior."
+          text run at (0,36) width 761: "exact\", so the columns don't match exactly. In a future version we might decide to tweak the right column to match our"
+          text run at (0,54) width 120: "expected behavior."
 layer at (236,96) size 1x25360 backgroundClip at (0,0) size 785x600 clip at (0,0) size 785x600
   LayoutBlockFlow (positioned) {DIV} at (235.50,96) size 1x25360
     LayoutText {#text} at (0,2) size 83x25357
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/international/unicode-bidi-plaintext-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/text/international/unicode-bidi-plaintext-expected.png
index e11bae2..4bb52e6 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/international/unicode-bidi-plaintext-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/international/unicode-bidi-plaintext-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/international/unicode-bidi-plaintext-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/text/international/unicode-bidi-plaintext-expected.txt
index 7cd7d887..7cd8b2fc 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/international/unicode-bidi-plaintext-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/international/unicode-bidi-plaintext-expected.txt
@@ -4,8 +4,8 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x204
     LayoutBlockFlow {BODY} at (8,8) size 784x183
       LayoutBlockFlow {DIV} at (0,0) size 784x18
-        LayoutText {#text} at (0,0) size 520x17
-          text run at (0,0) width 520: "This tests proper handling of unicode-bidi: plaintext. You should not see any red."
+        LayoutText {#text} at (0,0) size 519x17
+          text run at (0,0) width 519: "This tests proper handling of unicode-bidi: plaintext. You should not see any red."
       LayoutBlockFlow {DIV} at (0,18) size 784x72
         LayoutText {#text} at (0,0) size 46x17
           text run at (0,0) width 46: "!hello. "
@@ -18,9 +18,9 @@
           text run at (39,36) width 17 RTL: "\x{5DC}\x{5D5}\x{5D9}"
           text run at (55,36) width 10: "! "
         LayoutBR {BR} at (64,36) size 1x17
-        LayoutText {#text} at (690,54) size 94x17
-          text run at (690,54) width 7 RTL: "!"
-          text run at (696,54) width 51: "WebKit"
+        LayoutText {#text} at (692,54) size 92x17
+          text run at (692,54) width 6 RTL: "!"
+          text run at (697,54) width 50: "WebKit"
           text run at (746,54) width 38 RTL: "\x{5E9}\x{5DC}\x{5D5}\x{5DD}, "
       LayoutBlockFlow {PRE} at (0,103) size 784x80
         LayoutText {#text} at (0,0) size 784x80
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/international/unicode-bidi-plaintext-in-textarea-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/text/international/unicode-bidi-plaintext-in-textarea-expected.png
index 8769e965..97725be6 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/international/unicode-bidi-plaintext-in-textarea-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/international/unicode-bidi-plaintext-in-textarea-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/international/unicode-bidi-plaintext-in-textarea-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/text/international/unicode-bidi-plaintext-in-textarea-expected.txt
index fe169d33..9db63e0 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/international/unicode-bidi-plaintext-in-textarea-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/international/unicode-bidi-plaintext-in-textarea-expected.txt
@@ -5,8 +5,8 @@
     LayoutBlockFlow {BODY} at (8,8) size 784x332
       LayoutBlockFlow {DIV} at (0,0) size 784x332
         LayoutBlockFlow (anonymous) at (0,0) size 784x36
-          LayoutText {#text} at (0,0) size 779x35
-            text run at (0,0) width 779: "In all four cases below, the exclamation mark should be on the left side of the first line and on the right side of the second"
+          LayoutText {#text} at (0,0) size 778x35
+            text run at (0,0) width 778: "In all four cases below, the exclamation mark should be on the left side of the first line and on the right side of the second"
             text run at (0,18) width 28: "line."
         LayoutBlockFlow {DIV} at (0,36) size 784x296
           LayoutBR {BR} at (421,56) size 0x17
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/justified-selection-at-edge-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/text/justified-selection-at-edge-expected.png
index edd4a995..f02d499 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/justified-selection-at-edge-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/justified-selection-at-edge-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/justified-selection-at-edge-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/text/justified-selection-at-edge-expected.txt
index 38a72f2..c761ceb 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/justified-selection-at-edge-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/justified-selection-at-edge-expected.txt
@@ -4,8 +4,8 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x600
     LayoutBlockFlow {BODY} at (8,8) size 784x576
       LayoutBlockFlow {P} at (0,0) size 784x18
-        LayoutText {#text} at (0,0) size 395x17
-          text run at (0,0) width 395: "Test for bug 13234, layout of selected justified text is broken."
+        LayoutText {#text} at (0,0) size 394x17
+          text run at (0,0) width 394: "Test for bug 13234, layout of selected justified text is broken."
       LayoutBlockFlow {P} at (0,34) size 784x18
         LayoutText {#text} at (0,0) size 255x17
           text run at (0,0) width 255: "The two blue boxes should be identical."
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/justified-selection-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/text/justified-selection-expected.png
index cc68c24..7439b96 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/justified-selection-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/justified-selection-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/justified-selection-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/text/justified-selection-expected.txt
index e34cab5..c1903f5 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/justified-selection-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/justified-selection-expected.txt
@@ -4,13 +4,13 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x600
     LayoutBlockFlow {BODY} at (8,8) size 784x584
       LayoutBlockFlow {P} at (0,0) size 784x18
-        LayoutText {#text} at (0,0) size 110x17
-          text run at (0,0) width 110: "Test for revision "
+        LayoutText {#text} at (0,0) size 109x17
+          text run at (0,0) width 109: "Test for revision "
         LayoutInline {A} at (0,0) size 49x17 [color=#0000EE]
-          LayoutText {#text} at (109,0) size 49x17
-            text run at (109,0) width 49: "#20574"
-        LayoutText {#text} at (157,0) size 5x17
-          text run at (157,0) width 5: "."
+          LayoutText {#text} at (108,0) size 49x17
+            text run at (108,0) width 49: "#20574"
+        LayoutText {#text} at (156,0) size 5x17
+          text run at (156,0) width 5: "."
       LayoutBlockFlow {P} at (0,34) size 784x18
         LayoutText {#text} at (0,0) size 255x17
           text run at (0,0) width 255: "The two blue boxes should be identical."
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/justify-ideograph-complex-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/text/justify-ideograph-complex-expected.png
index 9300ab58..c958abf 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/justify-ideograph-complex-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/justify-ideograph-complex-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/line-initial-and-final-swashes-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/text/line-initial-and-final-swashes-expected.png
index 9dc95a82..eff0f9f 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/line-initial-and-final-swashes-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/line-initial-and-final-swashes-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/line-initial-and-final-swashes-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/text/line-initial-and-final-swashes-expected.txt
index 9143dbf..45860398 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/line-initial-and-final-swashes-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/line-initial-and-final-swashes-expected.txt
@@ -4,8 +4,8 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x600
     LayoutBlockFlow {BODY} at (8,8) size 784x584
       LayoutBlockFlow {P} at (0,0) size 784x18
-        LayoutText {#text} at (0,0) size 654x17
-          text run at (0,0) width 654: "The black text should be identical to, and overlap, the red text, so there should be no red pixels below."
+        LayoutText {#text} at (0,0) size 653x17
+          text run at (0,0) width 653: "The black text should be identical to, and overlap, the red text, so there should be no red pixels below."
       LayoutBlockFlow {DIV} at (0,34) size 784x186
         LayoutBlockFlow {DIV} at (0,0) size 784x165 [color=#FF0000]
           LayoutText {#text} at (0,3) size 272x159
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/midword-break-after-breakable-char-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/text/midword-break-after-breakable-char-expected.png
index 1967f46..a159aba 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/midword-break-after-breakable-char-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/midword-break-after-breakable-char-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/midword-break-after-breakable-char-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/text/midword-break-after-breakable-char-expected.txt
index d72b77e..eabf1b78 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/midword-break-after-breakable-char-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/midword-break-after-breakable-char-expected.txt
@@ -4,21 +4,21 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x600
     LayoutBlockFlow {BODY} at (8,8) size 784x576
       LayoutBlockFlow {P} at (0,0) size 784x36
-        LayoutText {#text} at (0,0) size 55x17
-          text run at (0,0) width 55: "Test for "
-        LayoutInline {I} at (0,0) size 740x35
-          LayoutInline {A} at (0,0) size 306x17 [color=#0000EE]
-            LayoutText {#text} at (54,0) size 306x17
-              text run at (54,0) width 306: "http://bugs.webkit.org/show_bug.cgi?id=13156"
-          LayoutText {#text} at (359,0) size 740x35
-            text run at (359,0) width 5: " "
-            text run at (363,0) width 377: "REGRESSION (r19621): Pasting breakable content where"
-            text run at (0,18) width 504: "wrapped line is too long to fit in a textarea fails to draw a horizontal scrollbar"
-        LayoutText {#text} at (503,18) size 5x17
-          text run at (503,18) width 5: "."
+        LayoutText {#text} at (0,0) size 54x17
+          text run at (0,0) width 54: "Test for "
+        LayoutInline {I} at (0,0) size 737x35
+          LayoutInline {A} at (0,0) size 305x17 [color=#0000EE]
+            LayoutText {#text} at (53,0) size 305x17
+              text run at (53,0) width 305: "http://bugs.webkit.org/show_bug.cgi?id=13156"
+          LayoutText {#text} at (357,0) size 737x35
+            text run at (357,0) width 5: " "
+            text run at (361,0) width 376: "REGRESSION (r19621): Pasting breakable content where"
+            text run at (0,18) width 503: "wrapped line is too long to fit in a textarea fails to draw a horizontal scrollbar"
+        LayoutText {#text} at (502,18) size 5x17
+          text run at (502,18) width 5: "."
       LayoutBlockFlow {P} at (0,52) size 784x36
-        LayoutText {#text} at (0,0) size 726x35
-          text run at (0,0) width 726: "This tests that a line break will occur in the middle of the first word on a line if it\x{2019}s too long to fit on the line. The"
+        LayoutText {#text} at (0,0) size 725x35
+          text run at (0,0) width 725: "This tests that a line break will occur in the middle of the first word on a line if it\x{2019}s too long to fit on the line. The"
           text run at (0,18) width 707: "behavior is tested after breakable characters (question mark and hyphen), after a space and after a soft hyphen."
       LayoutBlockFlow {P} at (0,104) size 784x18
         LayoutText {#text} at (0,0) size 266x17
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/midword-break-before-surrogate-pair-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/text/midword-break-before-surrogate-pair-expected.png
index f6b41658..46994d3 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/midword-break-before-surrogate-pair-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/midword-break-before-surrogate-pair-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/midword-break-before-surrogate-pair-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/text/midword-break-before-surrogate-pair-expected.txt
index 35f0e59..6e459db1 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/midword-break-before-surrogate-pair-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/midword-break-before-surrogate-pair-expected.txt
@@ -13,9 +13,9 @@
           text run at (3,3) width 173: "\x{D835}\x{DC9E}\x{D835}\x{DC9E}\x{D835}\x{DC9E}\x{D835}\x{DC9E}\x{D835}\x{DC9E}\x{D835}\x{DC9E}\x{D835}\x{DC9E}"
           text run at (3,52) width 74: "\x{D835}\x{DC9E}\x{D835}\x{DC9E}\x{D835}\x{DC9E}"
       LayoutBlockFlow {P} at (0,172) size 784x18
-        LayoutText {#text} at (0,0) size 779x17
+        LayoutText {#text} at (0,0) size 778x17
           text run at (0,0) width 539: "The following box should not break the sequence of symbols since U+1F1EF is not "
-          text run at (538,0) width 241: "a letter or number category character."
+          text run at (538,0) width 240: "a letter or number category character."
       LayoutBlockFlow {DIV} at (0,206) size 186x56 [border: (3px solid #0000FF)]
         LayoutText {#text} at (3,4) size 422x49
           text run at (3,4) width 422: "\x{D83C}\x{DDEF}\x{D83C}\x{DDF5}\x{D83C}\x{DDEF}\x{D83C}\x{DDF5}\x{D83C}\x{DDEF}\x{D83C}\x{DDF5}\x{D83C}\x{DDEF}\x{D83C}\x{DDF5}\x{D83C}\x{DDEF}\x{D83C}\x{DDF5}\x{D83C}\x{DDEF}\x{D83C}\x{DDF5}\x{D83C}\x{DDEF}\x{D83C}\x{DDF5}\x{D83C}\x{DDEF}\x{D83C}\x{DDF5}"
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/monospace-width-cache-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/text/monospace-width-cache-expected.png
index 4827ffb..8fe96dc6 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/monospace-width-cache-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/monospace-width-cache-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/monospace-width-cache-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/text/monospace-width-cache-expected.txt
index 576d293..88ccc2c 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/monospace-width-cache-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/monospace-width-cache-expected.txt
@@ -4,19 +4,19 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x600
     LayoutBlockFlow {BODY} at (8,8) size 784x576
       LayoutBlockFlow {P} at (0,0) size 784x36
-        LayoutText {#text} at (0,0) size 328x17
-          text run at (0,0) width 328: "Test for monospace width cache bug mentioned in "
-        LayoutInline {A} at (0,0) size 69x17 [color=#0000EE]
-          LayoutText {#text} at (327,0) size 69x17
-            text run at (327,0) width 69: "bug 11197"
-        LayoutText {#text} at (395,0) size 5x17
-          text run at (395,0) width 5: " "
-        LayoutInline {I} at (0,0) size 751x35
-          LayoutText {#text} at (399,0) size 751x35
-            text run at (399,0) width 352: "REGRESSION: Specifying a counter for a CODE tag's"
-            text run at (0,18) width 356: "content style property on before or after causes a crash"
-        LayoutText {#text} at (355,18) size 5x17
-          text run at (355,18) width 5: "."
+        LayoutText {#text} at (0,0) size 326x17
+          text run at (0,0) width 326: "Test for monospace width cache bug mentioned in "
+        LayoutInline {A} at (0,0) size 68x17 [color=#0000EE]
+          LayoutText {#text} at (325,0) size 68x17
+            text run at (325,0) width 68: "bug 11197"
+        LayoutText {#text} at (392,0) size 5x17
+          text run at (392,0) width 5: " "
+        LayoutInline {I} at (0,0) size 749x35
+          LayoutText {#text} at (396,0) size 749x35
+            text run at (396,0) width 353: "REGRESSION: Specifying a counter for a CODE tag's"
+            text run at (0,18) width 354: "content style property on before or after causes a crash"
+        LayoutText {#text} at (353,18) size 5x17
+          text run at (353,18) width 5: "."
       LayoutBlockFlow {P} at (0,52) size 784x18
         LayoutText {#text} at (0,0) size 376x17
           text run at (0,0) width 376: "The blue line and the black line should be the same length."
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/reset-emptyRun-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/text/reset-emptyRun-expected.png
index b8a47258..9e3f7f2 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/reset-emptyRun-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/reset-emptyRun-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/reset-emptyRun-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/text/reset-emptyRun-expected.txt
index 759c57a5..ca6f43f 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/reset-emptyRun-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/reset-emptyRun-expected.txt
@@ -4,17 +4,17 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x600
     LayoutBlockFlow {BODY} at (8,8) size 784x584
       LayoutBlockFlow {P} at (0,0) size 784x18
-        LayoutText {#text} at (0,0) size 55x17
-          text run at (0,0) width 55: "Test for "
-        LayoutInline {I} at (0,0) size 715x17
-          LayoutInline {A} at (0,0) size 306x17 [color=#0000EE]
-            LayoutText {#text} at (54,0) size 306x17
-              text run at (54,0) width 306: "http://bugs.webkit.org/show_bug.cgi?id=14758"
-          LayoutText {#text} at (359,0) size 410x17
-            text run at (359,0) width 5: " "
-            text run at (363,0) width 406: "REGRESSION: Repeated text after line break on facebook.com"
-        LayoutText {#text} at (768,0) size 5x17
-          text run at (768,0) width 5: "."
+        LayoutText {#text} at (0,0) size 54x17
+          text run at (0,0) width 54: "Test for "
+        LayoutInline {I} at (0,0) size 714x17
+          LayoutInline {A} at (0,0) size 305x17 [color=#0000EE]
+            LayoutText {#text} at (53,0) size 305x17
+              text run at (53,0) width 305: "http://bugs.webkit.org/show_bug.cgi?id=14758"
+          LayoutText {#text} at (357,0) size 410x17
+            text run at (357,0) width 5: " "
+            text run at (361,0) width 406: "REGRESSION: Repeated text after line break on facebook.com"
+        LayoutText {#text} at (766,0) size 5x17
+          text run at (766,0) width 5: "."
       LayoutBlockFlow {P} at (0,34) size 784x18
         LayoutText {#text} at (0,0) size 237x17
           text run at (0,0) width 237: "These two boxes should be identical:"
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/selection-hard-linebreak-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/text/selection-hard-linebreak-expected.png
index d75d632..c161d5b7 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/selection-hard-linebreak-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/selection-hard-linebreak-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/selection-hard-linebreak-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/text/selection-hard-linebreak-expected.txt
index 8feaadd6..4657276 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/selection-hard-linebreak-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/selection-hard-linebreak-expected.txt
@@ -4,26 +4,26 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x600
     LayoutBlockFlow {BODY} at (8,8) size 784x584
       LayoutBlockFlow {P} at (0,0) size 784x36
-        LayoutText {#text} at (0,0) size 55x17
-          text run at (0,0) width 55: "Test for "
-        LayoutInline {I} at (0,0) size 769x35
-          LayoutInline {A} at (0,0) size 306x17 [color=#0000EE]
-            LayoutText {#text} at (54,0) size 306x17
-              text run at (54,0) width 306: "http://bugs.webkit.org/show_bug.cgi?id=13153"
-          LayoutText {#text} at (359,0) size 769x35
-            text run at (359,0) width 5: " "
-            text run at (363,0) width 406: "REGRESSION: Visual highlighting of pre-populated blank line"
-            text run at (0,18) width 132: "in textarea is broken"
-        LayoutText {#text} at (131,18) size 5x17
-          text run at (131,18) width 5: "."
+        LayoutText {#text} at (0,0) size 54x17
+          text run at (0,0) width 54: "Test for "
+        LayoutInline {I} at (0,0) size 782x35
+          LayoutInline {A} at (0,0) size 305x17 [color=#0000EE]
+            LayoutText {#text} at (53,0) size 305x17
+              text run at (53,0) width 305: "http://bugs.webkit.org/show_bug.cgi?id=13153"
+          LayoutText {#text} at (357,0) size 782x35
+            text run at (357,0) width 5: " "
+            text run at (361,0) width 421: "REGRESSION: Visual highlighting of pre-populated blank line in"
+            text run at (0,18) width 115: "textarea is broken"
+        LayoutText {#text} at (114,18) size 5x17
+          text run at (114,18) width 5: "."
       LayoutBlockFlow {P} at (0,52) size 784x18
-        LayoutText {#text} at (0,0) size 340x17
-          text run at (0,0) width 340: "Testing the highlighting of and near hard line breaks."
+        LayoutText {#text} at (0,0) size 339x17
+          text run at (0,0) width 339: "Testing the highlighting of and near hard line breaks."
       LayoutBlockFlow (anonymous) at (0,86) size 784x80
         LayoutText {#text} at (0,0) size 0x0
       LayoutBlockFlow {P} at (0,182) size 784x18
-        LayoutText {#text} at (0,0) size 320x17
-          text run at (0,0) width 320: "Testing the highlighting of text split across boxes."
+        LayoutText {#text} at (0,0) size 319x17
+          text run at (0,0) width 319: "Testing the highlighting of text split across boxes."
       LayoutBlockFlow (anonymous) at (0,216) size 784x80
         LayoutText {#text} at (0,0) size 0x0
 layer at (12,98) size 62x72
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/shadow-translucent-fill-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/text/shadow-translucent-fill-expected.png
index 4d74a70..8962e82 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/shadow-translucent-fill-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/shadow-translucent-fill-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/shadow-translucent-fill-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/text/shadow-translucent-fill-expected.txt
index 467c314..033a353 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/shadow-translucent-fill-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/shadow-translucent-fill-expected.txt
@@ -4,9 +4,9 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x600
     LayoutBlockFlow {BODY} at (8,8) size 784x576
       LayoutBlockFlow {P} at (0,0) size 784x18
-        LayoutText {#text} at (0,0) size 608x17
-          text run at (0,0) width 479: "Test that the intensity of text-shadow does not depend on the transparency "
-          text run at (478,0) width 130: "of the text fill color."
+        LayoutText {#text} at (0,0) size 606x17
+          text run at (0,0) width 478: "Test that the intensity of text-shadow does not depend on the transparency "
+          text run at (477,0) width 129: "of the text fill color."
       LayoutBlockFlow {DIV} at (0,34) size 784x72
         LayoutText {#text} at (0,0) size 48x24
           text run at (0,0) width 48: "A "
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/shaping/same-script-different-lang-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/text/shaping/same-script-different-lang-expected.png
index 474db18..30357a2 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/shaping/same-script-different-lang-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/shaping/same-script-different-lang-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/shaping/same-script-different-lang-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/text/shaping/same-script-different-lang-expected.txt
index ab25ac95..77ee473 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/shaping/same-script-different-lang-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/shaping/same-script-different-lang-expected.txt
@@ -1,18 +1,22 @@
 layer at (0,0) size 800x600
   LayoutView at (0,0) size 800x600
-layer at (0,0) size 800x201
-  LayoutBlockFlow {HTML} at (0,0) size 800x201.44
-    LayoutBlockFlow {BODY} at (8,18.72) size 784x174.72
+layer at (0,0) size 800x182
+  LayoutBlockFlow {HTML} at (0,0) size 800x182.44
+    LayoutBlockFlow {BODY} at (8,18.72) size 784x147.72
       LayoutBlockFlow {H3} at (0,0) size 784x22
         LayoutText {#text} at (0,0) size 759x21
           text run at (0,0) width 759: "The glyph for JHA should look different for Nepali and Hindi, depending on the lang attribute."
       LayoutBlockFlow {P} at (0,40.72) size 784x25
         LayoutText {#text} at (0,4) size 88x21
           text run at (0,4) width 88: "Hindi:JHA \x{91D}"
-      LayoutBlockFlow (anonymous) at (0,81.72) size 784x18
-        LayoutBR {BR} at (0,0) size 0x17
-      LayoutBlockFlow {P} at (0,115.72) size 784x25
+      LayoutBlockFlow {P} at (0,81.72) size 784x25
         LayoutText {#text} at (0,4) size 97x21
           text run at (0,4) width 97: "Nepali:JHA \x{91D}"
-      LayoutBlockFlow (anonymous) at (0,156.72) size 784x18
-        LayoutBR {BR} at (0,0) size 0x17
+      LayoutBlockFlow {P} at (0,122.72) size 784x25
+        LayoutText {#text} at (0,4) size 83x21
+          text run at (0,4) width 83: "Nepali:JHA "
+        LayoutInline {SPAN} at (0,0) size 15x21
+          LayoutText {#text} at (82,4) size 15x21
+            text run at (82,4) width 15: "\x{91D}"
+        LayoutText {#text} at (96,4) size 305x21
+          text run at (96,4) width 305: " - \"ne\" in \"hi\" should look the same as above."
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/shaping/shaping-selection-rect-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/text/shaping/shaping-selection-rect-expected.png
index 97f6d6e..29bcfa6 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/shaping/shaping-selection-rect-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/shaping/shaping-selection-rect-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/shaping/shaping-selection-rect-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/text/shaping/shaping-selection-rect-expected.txt
index eb10102..c59d3d9 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/shaping/shaping-selection-rect-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/shaping/shaping-selection-rect-expected.txt
@@ -4,8 +4,8 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x600
     LayoutBlockFlow {BODY} at (8,8) size 784x584
       LayoutBlockFlow {P} at (0,0) size 784x18
-        LayoutText {#text} at (0,0) size 655x17
-          text run at (0,0) width 655: "The selection should cover the all of the below text. There should be no blank between either C and F."
+        LayoutText {#text} at (0,0) size 654x17
+          text run at (0,0) width 654: "The selection should cover the all of the below text. There should be no blank between either C and F."
       LayoutBlockFlow {DIV} at (0,34) size 784x18
         LayoutText {#text} at (0,0) size 33x17
           text run at (0,0) width 33: "ABC"
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/should-use-atsui-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/text/should-use-atsui-expected.png
index 3a8be9803..5546081e 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/should-use-atsui-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/should-use-atsui-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/should-use-atsui-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/text/should-use-atsui-expected.txt
index 9050eb8..062a0b7 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/should-use-atsui-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/should-use-atsui-expected.txt
@@ -4,17 +4,17 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x600
     LayoutBlockFlow {BODY} at (8,8) size 784x584
       LayoutBlockFlow {P} at (0,0) size 784x36
-        LayoutText {#text} at (0,0) size 55x17
-          text run at (0,0) width 55: "Test for "
-        LayoutInline {I} at (0,0) size 750x35
-          LayoutText {#text} at (54,0) size 750x35
-            text run at (54,0) width 696: "http://bugzilla.opendarwin.org/show_bug.cgi?id=6132 Incorrect selection highlighting for ATSUI text when"
+        LayoutText {#text} at (0,0) size 54x17
+          text run at (0,0) width 54: "Test for "
+        LayoutInline {I} at (0,0) size 747x35
+          LayoutText {#text} at (53,0) size 747x35
+            text run at (53,0) width 694: "http://bugzilla.opendarwin.org/show_bug.cgi?id=6132 Incorrect selection highlighting for ATSUI text when"
             text run at (0,18) width 179: "selected range is \"CG-safe\""
         LayoutText {#text} at (178,18) size 5x17
           text run at (178,18) width 5: "."
       LayoutBlockFlow {P} at (0,52) size 784x18
-        LayoutText {#text} at (0,0) size 721x17
-          text run at (0,0) width 721: "The word \x{201C}dolor\x{201D} below should be highlighted in its entirety. The highlight should not extend beyond that word."
+        LayoutText {#text} at (0,0) size 720x17
+          text run at (0,0) width 720: "The word \x{201C}dolor\x{201D} below should be highlighted in its entirety. The highlight should not extend beyond that word."
       LayoutBlockFlow {HR} at (0,86) size 784x2 [border: (1px inset #EEEEEE)]
       LayoutBlockFlow (anonymous) at (0,96) size 784x18
         LayoutInline {SPAN} at (0,0) size 178x17
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/small-caps-turkish-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/text/small-caps-turkish-expected.png
index 7a49923..522fddd 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/small-caps-turkish-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/small-caps-turkish-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/small-caps-turkish-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/text/small-caps-turkish-expected.txt
index c4fb88d..088b0ca 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/small-caps-turkish-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/small-caps-turkish-expected.txt
@@ -20,11 +20,11 @@
         LayoutText {#text} at (139,0) size 9x17
           text run at (139,0) width 9: " :"
       LayoutBlockFlow {P} at (0,68) size 784x18
-        LayoutText {#text} at (0,0) size 92x17
-          text run at (0,0) width 92: "locale=tr-TR: "
-        LayoutInline {SPAN} at (0,0) size 46x17
-          LayoutText {#text} at (91,0) size 46x17
-            text run at (91,0) width 46: "Isi\x{130} \x{130}s\x{131}I"
+        LayoutText {#text} at (0,0) size 91x17
+          text run at (0,0) width 91: "locale=tr-TR: "
+        LayoutInline {SPAN} at (0,0) size 47x17
+          LayoutText {#text} at (90,0) size 47x17
+            text run at (90,0) width 47: "Isi\x{130} \x{130}s\x{131}I"
         LayoutText {#text} at (136,0) size 9x17
           text run at (136,0) width 9: " :"
       LayoutBlockFlow {P} at (0,102) size 784x18
@@ -68,11 +68,11 @@
         LayoutText {#text} at (180,0) size 10x17
           text run at (180,0) width 10: " :"
       LayoutBlockFlow {P} at (0,272) size 784x18
-        LayoutText {#text} at (0,0) size 92x17
-          text run at (0,0) width 92: "locale=tr-US: "
-        LayoutInline {SPAN} at (0,0) size 46x17
-          LayoutText {#text} at (91,0) size 46x17
-            text run at (91,0) width 46: "Isi\x{130} \x{130}s\x{131}I"
+        LayoutText {#text} at (0,0) size 91x17
+          text run at (0,0) width 91: "locale=tr-US: "
+        LayoutInline {SPAN} at (0,0) size 47x17
+          LayoutText {#text} at (90,0) size 47x17
+            text run at (90,0) width 47: "Isi\x{130} \x{130}s\x{131}I"
         LayoutText {#text} at (136,0) size 9x17
           text run at (136,0) width 9: " :"
       LayoutBlockFlow {P} at (0,306) size 784x18
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/soft-hyphen-3-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/text/soft-hyphen-3-expected.png
index 3eed52a..a02e7d8 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/soft-hyphen-3-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/soft-hyphen-3-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/soft-hyphen-3-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/text/soft-hyphen-3-expected.txt
new file mode 100644
index 0000000..3a242de
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/soft-hyphen-3-expected.txt
@@ -0,0 +1,13 @@
+layer at (0,0) size 800x600
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  LayoutBlockFlow {HTML} at (0,0) size 800x600
+    LayoutBlockFlow {BODY} at (8,8) size 784x584
+      LayoutBlockFlow {DIV} at (0,0) size 225x63 [color=#FFFFFF]
+        LayoutText {#text} at (0,7) size 100x25
+          text run at (0,7) width 100: "Did \x{AD}"
+        LayoutInline {SPAN} at (0,0) size 75x25 [color=#008000]
+          LayoutText {#text} at (100,7) size 75x25
+            text run at (100,7) width 75: "not"
+        LayoutText {#text} at (0,38) size 100x25
+          text run at (0,38) width 100: "fail"
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/text-letter-spacing-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/text/text-letter-spacing-expected.png
index a55d2a6..d420cc75 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/text-letter-spacing-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/text-letter-spacing-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/text-letter-spacing-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/text/text-letter-spacing-expected.txt
index 1432ac3..31d3bb1 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/text-letter-spacing-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/text-letter-spacing-expected.txt
@@ -4,11 +4,11 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x1728
     LayoutBlockFlow {BODY} at (8,16) size 784x1696
       LayoutBlockFlow {P} at (0,0) size 784x90 [bgcolor=#FFFFFF]
-        LayoutText {#text} at (0,0) size 765x89
-          text run at (0,0) width 765: "The following lines test various combinations of letter-spacing (especially negative values) and opacity. All of the lines"
+        LayoutText {#text} at (0,0) size 764x89
+          text run at (0,0) width 764: "The following lines test various combinations of letter-spacing (especially negative values) and opacity. All of the lines"
           text run at (0,18) width 764: "should say \"Hello, world\" but the spacing and background shading will vary from test to test. The W3C specs are fairly"
           text run at (0,36) width 761: "silent on how user agents should handle unusual values of letter-spacing, especially negative ones, which are explicitly"
-          text run at (0,54) width 738: "implementation-dependent. Different browsers will render these differently, but hopefully the WebKit ports will be"
+          text run at (0,54) width 736: "implementation-dependent. Different browsers will render these differently, but hopefully the WebKit ports will be"
           text run at (0,72) width 121: "consistent, at least."
       LayoutBlockFlow {P} at (0,106) size 784x18 [bgcolor=#FFFFFF]
         LayoutText {#text} at (0,0) size 262x17
@@ -25,8 +25,8 @@
           LayoutText {#text} at (160,0) size 177x17
             text run at (160,0) width 177: "Hello, world"
       LayoutBlockFlow {P} at (0,242) size 784x36 [bgcolor=#FFFFFF]
-        LayoutText {#text} at (0,0) size 754x35
-          text run at (0,0) width 754: "The next line tests a large positive letter spacing, and should be *very* spaced out. You may only see an 'H' and a 'w',"
+        LayoutText {#text} at (0,0) size 752x35
+          text run at (0,0) width 752: "The next line tests a large positive letter spacing, and should be *very* spaced out. You may only see an 'H' and a 'w',"
           text run at (0,18) width 54: "perhaps "
           text run at (53,18) width 363: "on two different lines, unless you scroll way to the right."
       LayoutBlockFlow {P} at (0,294) size 784x36 [bgcolor=#EEEEEE]
@@ -35,8 +35,8 @@
             text run at (160,0) width 19240: "Hello,"
             text run at (0,18) width 16038: "world"
       LayoutBlockFlow {P} at (0,346) size 784x36 [bgcolor=#FFFFFF]
-        LayoutText {#text} at (0,0) size 780x35
-          text run at (0,0) width 780: "The next line tests a very large positive letter spacing, and should also be *very* spaced out. You may only see an 'H' and"
+        LayoutText {#text} at (0,0) size 778x35
+          text run at (0,0) width 778: "The next line tests a very large positive letter spacing, and should also be *very* spaced out. You may only see an 'H' and"
           text run at (0,18) width 37: "a 'w', "
           text run at (36,18) width 416: "perhaps on two different lines, unless you scroll way to the right."
       LayoutBlockFlow {P} at (0,398) size 784x36 [bgcolor=#EEEEEE]
@@ -66,9 +66,9 @@
           LayoutText {#text} at (160,0) size 0x17
             text run at (160,0) width 0: "Hello, world"
       LayoutBlockFlow {P} at (0,654) size 784x36 [bgcolor=#FFFFFF]
-        LayoutText {#text} at (0,0) size 783x35
-          text run at (0,0) width 729: "The next few lines test the interaction with opacity. The first line should be normally spaced out, slightly opaque, "
-          text run at (728,0) width 55: "and on a"
+        LayoutText {#text} at (0,0) size 782x35
+          text run at (0,0) width 728: "The next few lines test the interaction with opacity. The first line should be normally spaced out, slightly opaque, "
+          text run at (727,0) width 55: "and on a"
           text run at (0,18) width 201: "differently-colored background"
       LayoutBlockFlow {P} at (0,706) size 784x18 [bgcolor=#EEEEEE]
       LayoutBlockFlow {P} at (0,740) size 784x18 [bgcolor=#FFFFFF]
@@ -124,17 +124,17 @@
             text run at (160,0) width 0 RTL override: "Hello, world"
       LayoutBlockFlow {P} at (0,1422) size 784x18 [bgcolor=#FFFFFF]
         LayoutText {#text} at (0,0) size 471x17
-          text run at (0,0) width 339: "The next line tests a large negative line spacing, and "
-          text run at (338,0) width 133: "should just print a 'd'"
+          text run at (0,0) width 338: "The next line tests a large negative line spacing, and "
+          text run at (337,0) width 134: "should just print a 'd'"
       LayoutBlockFlow {P} at (0,1456) size 784x18 [bgcolor=#EEEEEE]
         LayoutInline {SPAN} at (0,0) size 0x17
           LayoutText {#text} at (160,0) size 0x17
             text run at (160,0) width 0 RTL override: "Hello, world"
       LayoutBlockFlow {P} at (0,1490) size 784x36 [bgcolor=#FFFFFF]
-        LayoutText {#text} at (0,0) size 747x35
-          text run at (0,0) width 149: "Now, opacity as well - "
-          text run at (148,0) width 408: "The next line should be printed right to left, slightly spaced out "
-          text run at (555,0) width 192: "(wider than normal), and on a"
+        LayoutText {#text} at (0,0) size 745x35
+          text run at (0,0) width 148: "Now, opacity as well - "
+          text run at (147,0) width 408: "The next line should be printed right to left, slightly spaced out "
+          text run at (554,0) width 191: "(wider than normal), and on a"
           text run at (0,18) width 80: "background."
       LayoutBlockFlow {P} at (0,1542) size 784x18 [bgcolor=#EEEEEE]
       LayoutBlockFlow {P} at (0,1576) size 784x18 [bgcolor=#FFFFFF]
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/text-shadow-no-default-color-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/text/text-shadow-no-default-color-expected.png
index 77b176b..dc60de8 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/text-shadow-no-default-color-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/text-shadow-no-default-color-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/text-shadow-no-default-color-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/text/text-shadow-no-default-color-expected.txt
index 7ab47d64..0bb2b71 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/text-shadow-no-default-color-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/text-shadow-no-default-color-expected.txt
@@ -4,8 +4,8 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x600
     LayoutBlockFlow {BODY} at (8,8) size 784x567
       LayoutBlockFlow {P} at (0,0) size 784x18
-        LayoutText {#text} at (0,0) size 364x17
-          text run at (0,0) width 364: "Test passes if there are two green rectangles on the page."
+        LayoutText {#text} at (0,0) size 363x17
+          text run at (0,0) width 363: "Test passes if there are two green rectangles on the page."
       LayoutBlockFlow {DIV} at (25,43) size 734x30 [color=#008000]
         LayoutText {#text} at (0,0) size 300x30
           text run at (0,0) width 300: "FillerText"
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/unicode-fallback-font-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/text/unicode-fallback-font-expected.png
index 72c8f9f..9d3bb8f 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/unicode-fallback-font-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/unicode-fallback-font-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/unicode-fallback-font-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/text/unicode-fallback-font-expected.txt
index e8e9ece..9d712108 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/unicode-fallback-font-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/unicode-fallback-font-expected.txt
@@ -1,12 +1,12 @@
-layer at (0,0) size 800x600 clip at (0,0) size 785x600 scrollHeight 1233
+layer at (0,0) size 800x600 clip at (0,0) size 785x600 scrollHeight 1234
   LayoutView at (0,0) size 800x600
-layer at (0,0) size 785x1233 backgroundClip at (0,0) size 785x600 clip at (0,0) size 785x600
-  LayoutBlockFlow {HTML} at (0,0) size 785x1232.88
-    LayoutBlockFlow {BODY} at (8,21.44) size 769x1195.44
+layer at (0,0) size 785x1234 backgroundClip at (0,0) size 785x600 clip at (0,0) size 785x600
+  LayoutBlockFlow {HTML} at (0,0) size 785x1233.88
+    LayoutBlockFlow {BODY} at (8,21.44) size 769x1196.44
       LayoutBlockFlow {H1} at (0,0) size 769x37
         LayoutText {#text} at (0,0) size 236x36
           text run at (0,0) width 236: "Unicode Symbols"
-      LayoutBlockFlow {PRE} at (0,58.44) size 769x1085
+      LayoutBlockFlow {PRE} at (0,58.44) size 769x1086
         LayoutText {#text} at (0,0) size 304x112
           text run at (0,0) width 0: " "
           text run at (0,16) width 304: "U+16Ax \x{16A0} \x{16A1} \x{16A2} \x{16A3} \x{16A4} \x{16A5} \x{16A6} \x{16A7} \x{16A8} \x{16A9} \x{16AA} \x{16AB} \x{16AC} \x{16AD} \x{16AE} \x{16AF}"
@@ -21,7 +21,7 @@
           text run at (304,80) width 0: " "
           text run at (0,96) width 64: "U+16Fx \x{16F0}"
           text run at (64,96) width 0: " "
-        LayoutText {#text} at (0,112) size 309x149
+        LayoutText {#text} at (0,112) size 326x150
           text run at (0,112) width 0: " "
           text run at (0,130) width 239: "U+200x \x{2000} \x{2001} \x{2002} \x{2003} \x{2004} \x{2004} \x{2004} \x{2004} \x{2004} \x{2009} \x{200A} \x{200B} \x{200C} \x{200D} \x{200E} "
           text run at (239,130) width 0 RTL: "\x{200F}"
@@ -37,108 +37,108 @@
           text run at (222,170) width 10 RTL override: "\x{202E} \x{202F}"
           text run at (0,190) width 309: "U+203x \x{2030} \x{2031} \x{2032} \x{2033} \x{2034} \x{2035} \x{2036} \x{2037} \x{2038} \x{2039} \x{203A} \x{203B} \x{203C} \x{203D} \x{203E} \x{203F}"
           text run at (309,190) width 0: " "
-          text run at (0,210) width 302: "U+204x \x{2040} \x{2041} \x{2042} \x{2043} \x{2044} \x{2045} \x{2046} \x{2047} \x{2048} \x{2049} \x{204A} \x{204B} \x{204C} \x{204D} \x{204E} \x{204F}"
-          text run at (302,210) width 0: " "
-          text run at (0,229) width 299: "U+205x \x{2050} \x{2051} \x{2052} \x{2053} \x{2054} \x{2055} \x{2056} \x{2057} \x{2058} \x{2059} \x{205A} \x{205B} \x{205C} \x{205D} \x{205E} \x{205F}"
-          text run at (299,229) width 0: " "
-          text run at (0,245) width 176: "U+206x \x{2060} \x{2061} \x{2062} \x{2063} \x{2064} \x{206A} \x{206B} \x{206C} \x{206D} \x{206E} \x{206F}"
-          text run at (176,245) width 0: " "
-        LayoutText {#text} at (0,261) size 384x304
-          text run at (0,261) width 0: " "
-          text run at (0,279) width 339: "U+260x \x{2600} \x{2601} \x{2602} \x{2603} \x{2604} \x{2605} \x{2606} \x{2607} \x{2608} \x{2609} \x{260A} \x{260B} \x{260C} \x{260D} \x{260E} \x{260F}"
-          text run at (339,279) width 0: " "
-          text run at (0,297) width 339: "U+261x \x{2610} \x{2611} \x{2612} \x{2613} \x{2614} \x{2615} \x{2616} \x{2617} \x{2618} \x{2619} \x{261A} \x{261B} \x{261C} \x{261D} \x{261E} \x{261F}"
-          text run at (339,297) width 0: " "
-          text run at (0,315) width 332: "U+262x \x{2620} \x{2621} \x{2622} \x{2623} \x{2624} \x{2625} \x{2626} \x{2627} \x{2628} \x{2629} \x{262A} \x{262B} \x{262C} \x{262D} \x{262E} \x{262F}"
-          text run at (332,315) width 0: " "
-          text run at (0,333) width 341: "U+263x \x{2630} \x{2631} \x{2632} \x{2633} \x{2634} \x{2635} \x{2636} \x{2637} \x{2638} \x{2639} \x{263A} \x{263B} \x{263C} \x{263D} \x{263E} \x{263F}"
-          text run at (341,333) width 0: " "
-          text run at (0,351) width 340: "U+264x \x{2640} \x{2641} \x{2642} \x{2643} \x{2644} \x{2645} \x{2646} \x{2647} \x{2648} \x{2649} \x{264A} \x{264B} \x{264C} \x{264D} \x{264E} \x{264F}"
-          text run at (340,351) width 0: " "
-          text run at (0,369) width 380: "U+265x \x{2650} \x{2651} \x{2652} \x{2653} \x{2654} \x{2655} \x{2656} \x{2657} \x{2658} \x{2659} \x{265A} \x{265B} \x{265C} \x{265D} \x{265E} \x{265F}"
-          text run at (380,369) width 0: " "
-          text run at (0,387) width 307: "U+266x \x{2660} \x{2661} \x{2662} \x{2663} \x{2664} \x{2665} \x{2666} \x{2667} \x{2668} \x{2669} \x{266A} \x{266B} \x{266C} \x{266D} \x{266E} \x{266F}"
-          text run at (307,387) width 0: " "
-          text run at (0,405) width 344: "U+267x \x{2670} \x{2671} \x{2672} \x{2673} \x{2674} \x{2675} \x{2676} \x{2677} \x{2678} \x{2679} \x{267A} \x{267B} \x{267C} \x{267D} \x{267E} \x{267F}"
-          text run at (344,405) width 0: " "
-          text run at (0,423) width 352: "U+268x \x{2680} \x{2681} \x{2682} \x{2683} \x{2684} \x{2685} \x{2686} \x{2687} \x{2688} \x{2689} \x{268A} \x{268B} \x{268C} \x{268D} \x{268E} \x{268F}"
-          text run at (352,423) width 0: " "
-          text run at (0,441) width 335: "U+269x \x{2690} \x{2691} \x{2692} \x{2693} \x{2694} \x{2695} \x{2696} \x{2697} \x{2698} \x{2699} \x{269A} \x{269B} \x{269C} \x{269D} \x{269E} \x{269F}"
-          text run at (335,441) width 0: " "
-          text run at (0,459) width 334: "U+26Ax \x{26A0} \x{26A1} \x{26A2} \x{26A3} \x{26A4} \x{26A5} \x{26A6} \x{26A7} \x{26A8} \x{26A9} \x{26AA} \x{26AB} \x{26AC} \x{26AD} \x{26AE} \x{26AF}"
-          text run at (334,459) width 0: " "
-          text run at (0,477) width 323: "U+26Bx \x{26B0} \x{26B1} \x{26B2} \x{26B3} \x{26B4} \x{26B5} \x{26B6} \x{26B7} \x{26B8} \x{26B9} \x{26BA} \x{26BB} \x{26BC} \x{26BD} \x{26BE} \x{26BF}"
-          text run at (323,477) width 0: " "
-          text run at (0,495) width 384: "U+26Cx \x{26C0} \x{26C1} \x{26C2} \x{26C3} \x{26C4} \x{26C5} \x{26C6} \x{26C7} \x{26C8} \x{26C9} \x{26CA} \x{26CB} \x{26CC} \x{26CD} \x{26CE} \x{26CF}"
-          text run at (384,495) width 0: " "
-          text run at (0,513) width 384: "U+26Dx \x{26D0} \x{26D1} \x{26D2} \x{26D3} \x{26D4} \x{26D5} \x{26D6} \x{26D7} \x{26D8} \x{26D9} \x{26DA} \x{26DB} \x{26DC} \x{26DD} \x{26DE} \x{26DF}"
-          text run at (384,513) width 0: " "
-          text run at (0,531) width 384: "U+26Ex \x{26E0} \x{26E1} \x{26E2} \x{26E3} \x{26E4} \x{26E5} \x{26E6} \x{26E7} \x{26E8} \x{26E9} \x{26EA} \x{26EB} \x{26EC} \x{26ED} \x{26EE} \x{26EF}"
-          text run at (384,531) width 0: " "
-          text run at (0,549) width 376: "U+26Fx \x{26F0} \x{26F1} \x{26F2} \x{26F3} \x{26F4} \x{26F5} \x{26F6} \x{26F7} \x{26F8} \x{26F9} \x{26FA} \x{26FB} \x{26FC} \x{26FD} \x{26FE} \x{26FF}"
-          text run at (376,549) width 0: " "
-        LayoutText {#text} at (0,565) size 382x232
-          text run at (0,565) width 0: " "
-          text run at (0,583) width 371: "U+270x \x{2700} \x{2701} \x{2702} \x{2703} \x{2704} \x{2705} \x{2706} \x{2707} \x{2708} \x{2709} \x{270A} \x{270B} \x{270C} \x{270D} \x{270E} \x{270F}"
-          text run at (371,583) width 0: " "
-          text run at (0,601) width 349: "U+271x \x{2710} \x{2711} \x{2712} \x{2713} \x{2714} \x{2715} \x{2716} \x{2717} \x{2718} \x{2719} \x{271A} \x{271B} \x{271C} \x{271D} \x{271E} \x{271F}"
-          text run at (349,601) width 0: " "
-          text run at (0,619) width 356: "U+272x \x{2720} \x{2721} \x{2722} \x{2723} \x{2724} \x{2725} \x{2726} \x{2727} \x{2728} \x{2729} \x{272A} \x{272B} \x{272C} \x{272D} \x{272E} \x{272F}"
-          text run at (356,619) width 0: " "
-          text run at (0,637) width 367: "U+273x \x{2730} \x{2731} \x{2732} \x{2733} \x{2734} \x{2735} \x{2736} \x{2737} \x{2738} \x{2739} \x{273A} \x{273B} \x{273C} \x{273D} \x{273E} \x{273F}"
-          text run at (367,637) width 0: " "
-          text run at (0,655) width 369: "U+274x \x{2740} \x{2741} \x{2742} \x{2743} \x{2744} \x{2745} \x{2746} \x{2747} \x{2748} \x{2749} \x{274A} \x{274B} \x{274C} \x{274D} \x{274E} \x{274F}"
-          text run at (369,655) width 0: " "
-          text run at (0,673) width 303: "U+275x \x{2750} \x{2751} \x{2752} \x{2753} \x{2754} \x{2755} \x{2756} \x{2757} \x{2758} \x{2759} \x{275A} \x{275B} \x{275C} \x{275D} \x{275E} \x{275F}"
-          text run at (303,673) width 0: " "
-          text run at (0,691) width 284: "U+276x \x{2760} \x{2761} \x{2762} \x{2763} \x{2764} \x{2765} \x{2766} \x{2767} \x{2768} \x{2769} \x{276A} \x{276B} \x{276C} \x{276D} \x{276E} \x{276F}"
-          text run at (284,691) width 0: " "
-          text run at (0,709) width 316: "U+277x \x{2770} \x{2771} \x{2772} \x{2773} \x{2774} \x{2775} \x{2776} \x{2777} \x{2778} \x{2779} \x{277A} \x{277B} \x{277C} \x{277D} \x{277E} \x{277F}"
-          text run at (316,709) width 0: " "
-          text run at (0,727) width 352: "U+278x \x{2780} \x{2781} \x{2782} \x{2783} \x{2784} \x{2785} \x{2786} \x{2787} \x{2788} \x{2789} \x{278A} \x{278B} \x{278C} \x{278D} \x{278E} \x{278F}"
-          text run at (352,727) width 0: " "
-          text run at (0,745) width 368: "U+279x \x{2790} \x{2791} \x{2792} \x{2793} \x{2794} \x{2795} \x{2796} \x{2797} \x{2798} \x{2799} \x{279A} \x{279B} \x{279C} \x{279D} \x{279E} \x{279F}"
-          text run at (368,745) width 0: " "
-          text run at (0,763) width 371: "U+27Ax \x{27A0} \x{27A1} \x{27A2} \x{27A3} \x{27A4} \x{27A5} \x{27A6} \x{27A7} \x{27A8} \x{27A9} \x{27AA} \x{27AB} \x{27AC} \x{27AD} \x{27AE} \x{27AF}"
-          text run at (371,763) width 0: " "
-          text run at (0,781) width 382: "U+27Bx \x{27B0} \x{27B1} \x{27B2} \x{27B3} \x{27B4} \x{27B5} \x{27B6} \x{27B7} \x{27B8} \x{27B9} \x{27BA} \x{27BB} \x{27BC} \x{27BD} \x{27BE} \x{27BF}"
-          text run at (382,781) width 0: " "
-        LayoutText {#text} at (0,797) size 357x288
-          text run at (0,797) width 0: " "
-          text run at (0,813) width 347: "U+2A0x \x{2A00} \x{2A01} \x{2A02} \x{2A03} \x{2A04} \x{2A05} \x{2A06} \x{2A07} \x{2A08} \x{2A09} \x{2A0A} \x{2A0B} \x{2A0C} \x{2A0D} \x{2A0E} \x{2A0F}"
-          text run at (347,813) width 0: " "
-          text run at (0,829) width 309: "U+2A1x \x{2A10} \x{2A11} \x{2A12} \x{2A13} \x{2A14} \x{2A15} \x{2A16} \x{2A17} \x{2A18} \x{2A19} \x{2A1A} \x{2A1B} \x{2A1C} \x{2A1D} \x{2A1E} \x{2A1F}"
-          text run at (309,829) width 0: " "
-          text run at (0,845) width 339: "U+2A2x \x{2A20} \x{2A21} \x{2A22} \x{2A23} \x{2A24} \x{2A25} \x{2A26} \x{2A27} \x{2A28} \x{2A29} \x{2A2A} \x{2A2B} \x{2A2C} \x{2A2D} \x{2A2E} \x{2A2F}"
-          text run at (339,845) width 0: " "
-          text run at (0,861) width 350: "U+2A3x \x{2A30} \x{2A31} \x{2A32} \x{2A33} \x{2A34} \x{2A35} \x{2A36} \x{2A37} \x{2A38} \x{2A39} \x{2A3A} \x{2A3B} \x{2A3C} \x{2A3D} \x{2A3E} \x{2A3F}"
-          text run at (350,861) width 0: " "
-          text run at (0,877) width 322: "U+2A4x \x{2A40} \x{2A41} \x{2A42} \x{2A43} \x{2A44} \x{2A45} \x{2A46} \x{2A47} \x{2A48} \x{2A49} \x{2A4A} \x{2A4B} \x{2A4C} \x{2A4D} \x{2A4E} \x{2A4F}"
-          text run at (322,877) width 0: " "
-          text run at (0,893) width 309: "U+2A5x \x{2A50} \x{2A51} \x{2A52} \x{2A53} \x{2A54} \x{2A55} \x{2A56} \x{2A57} \x{2A58} \x{2A59} \x{2A5A} \x{2A5B} \x{2A5C} \x{2A5D} \x{2A5E} \x{2A5F}"
-          text run at (309,893) width 0: " "
-          text run at (0,909) width 330: "U+2A6x \x{2A60} \x{2A61} \x{2A62} \x{2A63} \x{2A64} \x{2A65} \x{2A66} \x{2A67} \x{2A68} \x{2A69} \x{2A6A} \x{2A6B} \x{2A6C} \x{2A6D} \x{2A6E} \x{2A6F}"
-          text run at (330,909) width 0: " "
-          text run at (0,925) width 357: "U+2A7x \x{2A70} \x{2A71} \x{2A72} \x{2A73} \x{2A74} \x{2A75} \x{2A76} \x{2A77} \x{2A78} \x{2A79} \x{2A7A} \x{2A7B} \x{2A7C} \x{2A7D} \x{2A7E} \x{2A7F}"
-          text run at (357,925) width 0: " "
-          text run at (0,941) width 336: "U+2A8x \x{2A80} \x{2A81} \x{2A82} \x{2A83} \x{2A84} \x{2A85} \x{2A86} \x{2A87} \x{2A88} \x{2A89} \x{2A8A} \x{2A8B} \x{2A8C} \x{2A8D} \x{2A8E} \x{2A8F}"
-          text run at (336,941) width 0: " "
-          text run at (0,957) width 336: "U+2A9x \x{2A90} \x{2A91} \x{2A92} \x{2A93} \x{2A94} \x{2A95} \x{2A96} \x{2A97} \x{2A98} \x{2A99} \x{2A9A} \x{2A9B} \x{2A9C} \x{2A9D} \x{2A9E} \x{2A9F}"
-          text run at (336,957) width 0: " "
-          text run at (0,973) width 351: "U+2AAx \x{2AA0} \x{2AA1} \x{2AA2} \x{2AA3} \x{2AA4} \x{2AA5} \x{2AA6} \x{2AA7} \x{2AA8} \x{2AA9} \x{2AAA} \x{2AAB} \x{2AAC} \x{2AAD} \x{2AAE} \x{2AAF}"
-          text run at (351,973) width 0: " "
-          text run at (0,989) width 346: "U+2ABx \x{2AB0} \x{2AB1} \x{2AB2} \x{2AB3} \x{2AB4} \x{2AB5} \x{2AB6} \x{2AB7} \x{2AB8} \x{2AB9} \x{2ABA} \x{2ABB} \x{2ABC} \x{2ABD} \x{2ABE} \x{2ABF}"
-          text run at (346,989) width 0: " "
-          text run at (0,1005) width 346: "U+2ACx \x{2AC0} \x{2AC1} \x{2AC2} \x{2AC3} \x{2AC4} \x{2AC5} \x{2AC6} \x{2AC7} \x{2AC8} \x{2AC9} \x{2ACA} \x{2ACB} \x{2ACC} \x{2ACD} \x{2ACE} \x{2ACF}"
-          text run at (346,1005) width 0: " "
-          text run at (0,1021) width 342: "U+2ADx \x{2AD0} \x{2AD1} \x{2AD2} \x{2AD3} \x{2AD4} \x{2AD5} \x{2AD6} \x{2AD7} \x{2AD8} \x{2AD9} \x{2ADA} \x{2ADB} \x{2ADC} \x{2ADD} \x{2ADE} \x{2ADF}"
-          text run at (342,1021) width 0: " "
-          text run at (0,1037) width 320: "U+2AEx \x{2AE0} \x{2AE1} \x{2AE2} \x{2AE3} \x{2AE4} \x{2AE5} \x{2AE6} \x{2AE7} \x{2AE8} \x{2AE9} \x{2AEA} \x{2AEB} \x{2AEC} \x{2AED} \x{2AEE} \x{2AEF}"
-          text run at (320,1037) width 0: " "
-          text run at (0,1053) width 312: "U+2AFx \x{2AF0} \x{2AF1} \x{2AF2} \x{2AF3} \x{2AF4} \x{2AF5} \x{2AF6} \x{2AF7} \x{2AF8} \x{2AF9} \x{2AFA} \x{2AFB} \x{2AFC} \x{2AFD} \x{2AFE} \x{2AFF}"
-          text run at (312,1053) width 0: " "
-          text run at (0,1069) width 64: "        "
-      LayoutBlockFlow {P} at (0,1159.44) size 769x36
+          text run at (0,210) width 326: "U+204x \x{2040} \x{2041} \x{2042} \x{2043} \x{2044} \x{2045} \x{2046} \x{2047} \x{2048} \x{2049} \x{204A} \x{204B} \x{204C} \x{204D} \x{204E} \x{204F}"
+          text run at (326,210) width 0: " "
+          text run at (0,229) width 323: "U+205x \x{2050} \x{2051} \x{2052} \x{2053} \x{2054} \x{2055} \x{2056} \x{2057} \x{2058} \x{2059} \x{205A} \x{205B} \x{205C} \x{205D} \x{205E} \x{205F}"
+          text run at (323,229) width 0: " "
+          text run at (0,246) width 136: "U+206x \x{2060} \x{2061} \x{2062} \x{2063} \x{2064} \x{206A} \x{206B} \x{206C} \x{206D} \x{206E} \x{206F}"
+          text run at (136,246) width 0: " "
+        LayoutText {#text} at (0,262) size 384x304
+          text run at (0,262) width 0: " "
+          text run at (0,280) width 339: "U+260x \x{2600} \x{2601} \x{2602} \x{2603} \x{2604} \x{2605} \x{2606} \x{2607} \x{2608} \x{2609} \x{260A} \x{260B} \x{260C} \x{260D} \x{260E} \x{260F}"
+          text run at (339,280) width 0: " "
+          text run at (0,298) width 339: "U+261x \x{2610} \x{2611} \x{2612} \x{2613} \x{2614} \x{2615} \x{2616} \x{2617} \x{2618} \x{2619} \x{261A} \x{261B} \x{261C} \x{261D} \x{261E} \x{261F}"
+          text run at (339,298) width 0: " "
+          text run at (0,316) width 332: "U+262x \x{2620} \x{2621} \x{2622} \x{2623} \x{2624} \x{2625} \x{2626} \x{2627} \x{2628} \x{2629} \x{262A} \x{262B} \x{262C} \x{262D} \x{262E} \x{262F}"
+          text run at (332,316) width 0: " "
+          text run at (0,334) width 341: "U+263x \x{2630} \x{2631} \x{2632} \x{2633} \x{2634} \x{2635} \x{2636} \x{2637} \x{2638} \x{2639} \x{263A} \x{263B} \x{263C} \x{263D} \x{263E} \x{263F}"
+          text run at (341,334) width 0: " "
+          text run at (0,352) width 340: "U+264x \x{2640} \x{2641} \x{2642} \x{2643} \x{2644} \x{2645} \x{2646} \x{2647} \x{2648} \x{2649} \x{264A} \x{264B} \x{264C} \x{264D} \x{264E} \x{264F}"
+          text run at (340,352) width 0: " "
+          text run at (0,370) width 380: "U+265x \x{2650} \x{2651} \x{2652} \x{2653} \x{2654} \x{2655} \x{2656} \x{2657} \x{2658} \x{2659} \x{265A} \x{265B} \x{265C} \x{265D} \x{265E} \x{265F}"
+          text run at (380,370) width 0: " "
+          text run at (0,388) width 307: "U+266x \x{2660} \x{2661} \x{2662} \x{2663} \x{2664} \x{2665} \x{2666} \x{2667} \x{2668} \x{2669} \x{266A} \x{266B} \x{266C} \x{266D} \x{266E} \x{266F}"
+          text run at (307,388) width 0: " "
+          text run at (0,406) width 344: "U+267x \x{2670} \x{2671} \x{2672} \x{2673} \x{2674} \x{2675} \x{2676} \x{2677} \x{2678} \x{2679} \x{267A} \x{267B} \x{267C} \x{267D} \x{267E} \x{267F}"
+          text run at (344,406) width 0: " "
+          text run at (0,424) width 352: "U+268x \x{2680} \x{2681} \x{2682} \x{2683} \x{2684} \x{2685} \x{2686} \x{2687} \x{2688} \x{2689} \x{268A} \x{268B} \x{268C} \x{268D} \x{268E} \x{268F}"
+          text run at (352,424) width 0: " "
+          text run at (0,442) width 335: "U+269x \x{2690} \x{2691} \x{2692} \x{2693} \x{2694} \x{2695} \x{2696} \x{2697} \x{2698} \x{2699} \x{269A} \x{269B} \x{269C} \x{269D} \x{269E} \x{269F}"
+          text run at (335,442) width 0: " "
+          text run at (0,460) width 334: "U+26Ax \x{26A0} \x{26A1} \x{26A2} \x{26A3} \x{26A4} \x{26A5} \x{26A6} \x{26A7} \x{26A8} \x{26A9} \x{26AA} \x{26AB} \x{26AC} \x{26AD} \x{26AE} \x{26AF}"
+          text run at (334,460) width 0: " "
+          text run at (0,478) width 323: "U+26Bx \x{26B0} \x{26B1} \x{26B2} \x{26B3} \x{26B4} \x{26B5} \x{26B6} \x{26B7} \x{26B8} \x{26B9} \x{26BA} \x{26BB} \x{26BC} \x{26BD} \x{26BE} \x{26BF}"
+          text run at (323,478) width 0: " "
+          text run at (0,496) width 384: "U+26Cx \x{26C0} \x{26C1} \x{26C2} \x{26C3} \x{26C4} \x{26C5} \x{26C6} \x{26C7} \x{26C8} \x{26C9} \x{26CA} \x{26CB} \x{26CC} \x{26CD} \x{26CE} \x{26CF}"
+          text run at (384,496) width 0: " "
+          text run at (0,514) width 384: "U+26Dx \x{26D0} \x{26D1} \x{26D2} \x{26D3} \x{26D4} \x{26D5} \x{26D6} \x{26D7} \x{26D8} \x{26D9} \x{26DA} \x{26DB} \x{26DC} \x{26DD} \x{26DE} \x{26DF}"
+          text run at (384,514) width 0: " "
+          text run at (0,532) width 384: "U+26Ex \x{26E0} \x{26E1} \x{26E2} \x{26E3} \x{26E4} \x{26E5} \x{26E6} \x{26E7} \x{26E8} \x{26E9} \x{26EA} \x{26EB} \x{26EC} \x{26ED} \x{26EE} \x{26EF}"
+          text run at (384,532) width 0: " "
+          text run at (0,550) width 376: "U+26Fx \x{26F0} \x{26F1} \x{26F2} \x{26F3} \x{26F4} \x{26F5} \x{26F6} \x{26F7} \x{26F8} \x{26F9} \x{26FA} \x{26FB} \x{26FC} \x{26FD} \x{26FE} \x{26FF}"
+          text run at (376,550) width 0: " "
+        LayoutText {#text} at (0,566) size 382x232
+          text run at (0,566) width 0: " "
+          text run at (0,584) width 371: "U+270x \x{2700} \x{2701} \x{2702} \x{2703} \x{2704} \x{2705} \x{2706} \x{2707} \x{2708} \x{2709} \x{270A} \x{270B} \x{270C} \x{270D} \x{270E} \x{270F}"
+          text run at (371,584) width 0: " "
+          text run at (0,602) width 349: "U+271x \x{2710} \x{2711} \x{2712} \x{2713} \x{2714} \x{2715} \x{2716} \x{2717} \x{2718} \x{2719} \x{271A} \x{271B} \x{271C} \x{271D} \x{271E} \x{271F}"
+          text run at (349,602) width 0: " "
+          text run at (0,620) width 356: "U+272x \x{2720} \x{2721} \x{2722} \x{2723} \x{2724} \x{2725} \x{2726} \x{2727} \x{2728} \x{2729} \x{272A} \x{272B} \x{272C} \x{272D} \x{272E} \x{272F}"
+          text run at (356,620) width 0: " "
+          text run at (0,638) width 367: "U+273x \x{2730} \x{2731} \x{2732} \x{2733} \x{2734} \x{2735} \x{2736} \x{2737} \x{2738} \x{2739} \x{273A} \x{273B} \x{273C} \x{273D} \x{273E} \x{273F}"
+          text run at (367,638) width 0: " "
+          text run at (0,656) width 369: "U+274x \x{2740} \x{2741} \x{2742} \x{2743} \x{2744} \x{2745} \x{2746} \x{2747} \x{2748} \x{2749} \x{274A} \x{274B} \x{274C} \x{274D} \x{274E} \x{274F}"
+          text run at (369,656) width 0: " "
+          text run at (0,674) width 303: "U+275x \x{2750} \x{2751} \x{2752} \x{2753} \x{2754} \x{2755} \x{2756} \x{2757} \x{2758} \x{2759} \x{275A} \x{275B} \x{275C} \x{275D} \x{275E} \x{275F}"
+          text run at (303,674) width 0: " "
+          text run at (0,692) width 284: "U+276x \x{2760} \x{2761} \x{2762} \x{2763} \x{2764} \x{2765} \x{2766} \x{2767} \x{2768} \x{2769} \x{276A} \x{276B} \x{276C} \x{276D} \x{276E} \x{276F}"
+          text run at (284,692) width 0: " "
+          text run at (0,710) width 316: "U+277x \x{2770} \x{2771} \x{2772} \x{2773} \x{2774} \x{2775} \x{2776} \x{2777} \x{2778} \x{2779} \x{277A} \x{277B} \x{277C} \x{277D} \x{277E} \x{277F}"
+          text run at (316,710) width 0: " "
+          text run at (0,728) width 352: "U+278x \x{2780} \x{2781} \x{2782} \x{2783} \x{2784} \x{2785} \x{2786} \x{2787} \x{2788} \x{2789} \x{278A} \x{278B} \x{278C} \x{278D} \x{278E} \x{278F}"
+          text run at (352,728) width 0: " "
+          text run at (0,746) width 368: "U+279x \x{2790} \x{2791} \x{2792} \x{2793} \x{2794} \x{2795} \x{2796} \x{2797} \x{2798} \x{2799} \x{279A} \x{279B} \x{279C} \x{279D} \x{279E} \x{279F}"
+          text run at (368,746) width 0: " "
+          text run at (0,764) width 371: "U+27Ax \x{27A0} \x{27A1} \x{27A2} \x{27A3} \x{27A4} \x{27A5} \x{27A6} \x{27A7} \x{27A8} \x{27A9} \x{27AA} \x{27AB} \x{27AC} \x{27AD} \x{27AE} \x{27AF}"
+          text run at (371,764) width 0: " "
+          text run at (0,782) width 382: "U+27Bx \x{27B0} \x{27B1} \x{27B2} \x{27B3} \x{27B4} \x{27B5} \x{27B6} \x{27B7} \x{27B8} \x{27B9} \x{27BA} \x{27BB} \x{27BC} \x{27BD} \x{27BE} \x{27BF}"
+          text run at (382,782) width 0: " "
+        LayoutText {#text} at (0,798) size 357x288
+          text run at (0,798) width 0: " "
+          text run at (0,814) width 347: "U+2A0x \x{2A00} \x{2A01} \x{2A02} \x{2A03} \x{2A04} \x{2A05} \x{2A06} \x{2A07} \x{2A08} \x{2A09} \x{2A0A} \x{2A0B} \x{2A0C} \x{2A0D} \x{2A0E} \x{2A0F}"
+          text run at (347,814) width 0: " "
+          text run at (0,830) width 309: "U+2A1x \x{2A10} \x{2A11} \x{2A12} \x{2A13} \x{2A14} \x{2A15} \x{2A16} \x{2A17} \x{2A18} \x{2A19} \x{2A1A} \x{2A1B} \x{2A1C} \x{2A1D} \x{2A1E} \x{2A1F}"
+          text run at (309,830) width 0: " "
+          text run at (0,846) width 339: "U+2A2x \x{2A20} \x{2A21} \x{2A22} \x{2A23} \x{2A24} \x{2A25} \x{2A26} \x{2A27} \x{2A28} \x{2A29} \x{2A2A} \x{2A2B} \x{2A2C} \x{2A2D} \x{2A2E} \x{2A2F}"
+          text run at (339,846) width 0: " "
+          text run at (0,862) width 350: "U+2A3x \x{2A30} \x{2A31} \x{2A32} \x{2A33} \x{2A34} \x{2A35} \x{2A36} \x{2A37} \x{2A38} \x{2A39} \x{2A3A} \x{2A3B} \x{2A3C} \x{2A3D} \x{2A3E} \x{2A3F}"
+          text run at (350,862) width 0: " "
+          text run at (0,878) width 322: "U+2A4x \x{2A40} \x{2A41} \x{2A42} \x{2A43} \x{2A44} \x{2A45} \x{2A46} \x{2A47} \x{2A48} \x{2A49} \x{2A4A} \x{2A4B} \x{2A4C} \x{2A4D} \x{2A4E} \x{2A4F}"
+          text run at (322,878) width 0: " "
+          text run at (0,894) width 309: "U+2A5x \x{2A50} \x{2A51} \x{2A52} \x{2A53} \x{2A54} \x{2A55} \x{2A56} \x{2A57} \x{2A58} \x{2A59} \x{2A5A} \x{2A5B} \x{2A5C} \x{2A5D} \x{2A5E} \x{2A5F}"
+          text run at (309,894) width 0: " "
+          text run at (0,910) width 330: "U+2A6x \x{2A60} \x{2A61} \x{2A62} \x{2A63} \x{2A64} \x{2A65} \x{2A66} \x{2A67} \x{2A68} \x{2A69} \x{2A6A} \x{2A6B} \x{2A6C} \x{2A6D} \x{2A6E} \x{2A6F}"
+          text run at (330,910) width 0: " "
+          text run at (0,926) width 357: "U+2A7x \x{2A70} \x{2A71} \x{2A72} \x{2A73} \x{2A74} \x{2A75} \x{2A76} \x{2A77} \x{2A78} \x{2A79} \x{2A7A} \x{2A7B} \x{2A7C} \x{2A7D} \x{2A7E} \x{2A7F}"
+          text run at (357,926) width 0: " "
+          text run at (0,942) width 336: "U+2A8x \x{2A80} \x{2A81} \x{2A82} \x{2A83} \x{2A84} \x{2A85} \x{2A86} \x{2A87} \x{2A88} \x{2A89} \x{2A8A} \x{2A8B} \x{2A8C} \x{2A8D} \x{2A8E} \x{2A8F}"
+          text run at (336,942) width 0: " "
+          text run at (0,958) width 336: "U+2A9x \x{2A90} \x{2A91} \x{2A92} \x{2A93} \x{2A94} \x{2A95} \x{2A96} \x{2A97} \x{2A98} \x{2A99} \x{2A9A} \x{2A9B} \x{2A9C} \x{2A9D} \x{2A9E} \x{2A9F}"
+          text run at (336,958) width 0: " "
+          text run at (0,974) width 351: "U+2AAx \x{2AA0} \x{2AA1} \x{2AA2} \x{2AA3} \x{2AA4} \x{2AA5} \x{2AA6} \x{2AA7} \x{2AA8} \x{2AA9} \x{2AAA} \x{2AAB} \x{2AAC} \x{2AAD} \x{2AAE} \x{2AAF}"
+          text run at (351,974) width 0: " "
+          text run at (0,990) width 346: "U+2ABx \x{2AB0} \x{2AB1} \x{2AB2} \x{2AB3} \x{2AB4} \x{2AB5} \x{2AB6} \x{2AB7} \x{2AB8} \x{2AB9} \x{2ABA} \x{2ABB} \x{2ABC} \x{2ABD} \x{2ABE} \x{2ABF}"
+          text run at (346,990) width 0: " "
+          text run at (0,1006) width 346: "U+2ACx \x{2AC0} \x{2AC1} \x{2AC2} \x{2AC3} \x{2AC4} \x{2AC5} \x{2AC6} \x{2AC7} \x{2AC8} \x{2AC9} \x{2ACA} \x{2ACB} \x{2ACC} \x{2ACD} \x{2ACE} \x{2ACF}"
+          text run at (346,1006) width 0: " "
+          text run at (0,1022) width 342: "U+2ADx \x{2AD0} \x{2AD1} \x{2AD2} \x{2AD3} \x{2AD4} \x{2AD5} \x{2AD6} \x{2AD7} \x{2AD8} \x{2AD9} \x{2ADA} \x{2ADB} \x{2ADC} \x{2ADD} \x{2ADE} \x{2ADF}"
+          text run at (342,1022) width 0: " "
+          text run at (0,1038) width 320: "U+2AEx \x{2AE0} \x{2AE1} \x{2AE2} \x{2AE3} \x{2AE4} \x{2AE5} \x{2AE6} \x{2AE7} \x{2AE8} \x{2AE9} \x{2AEA} \x{2AEB} \x{2AEC} \x{2AED} \x{2AEE} \x{2AEF}"
+          text run at (320,1038) width 0: " "
+          text run at (0,1054) width 312: "U+2AFx \x{2AF0} \x{2AF1} \x{2AF2} \x{2AF3} \x{2AF4} \x{2AF5} \x{2AF6} \x{2AF7} \x{2AF8} \x{2AF9} \x{2AFA} \x{2AFB} \x{2AFC} \x{2AFD} \x{2AFE} \x{2AFF}"
+          text run at (312,1054) width 0: " "
+          text run at (0,1070) width 64: "        "
+      LayoutBlockFlow {P} at (0,1160.44) size 769x36
         LayoutText {#text} at (0,0) size 764x35
           text run at (0,0) width 764: "A series of unicode symbols (Runic, General Punctuation, Miscellaneous Symbols, and Mathematical Symbols) should"
           text run at (0,18) width 108: "be shown above."
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/vertical-rl-rtl-linebreak-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/text/vertical-rl-rtl-linebreak-expected.png
index 58d14d12..9259bf4 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/vertical-rl-rtl-linebreak-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/vertical-rl-rtl-linebreak-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/wbr-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/text/wbr-expected.png
index 6938ab7..5ac5f185 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/wbr-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/wbr-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/wbr-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/text/wbr-expected.txt
index 1544127..7e2acd6 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/wbr-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/wbr-expected.txt
@@ -4,8 +4,8 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x788
     LayoutBlockFlow {BODY} at (8,8) size 784x770
       LayoutBlockFlow {P} at (0,0) size 784x18
-        LayoutText {#text} at (0,0) size 175x17
-          text run at (0,0) width 175: "Two words with no spaces."
+        LayoutText {#text} at (0,0) size 174x17
+          text run at (0,0) width 174: "Two words with no spaces."
       LayoutBlockFlow {DIV} at (0,34) size 302x20 [border: (1px solid #0000FF)]
         LayoutText {#text} at (1,1) size 484x17
           text run at (1,1) width 484: "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"
@@ -109,8 +109,8 @@
                   text run at (1,37) width 171: "cccccccccccccccccccccccc"
             LayoutTableCell {TD} at (194,28) size 590x0 [r=0 c=1 rs=1 cs=1]
       LayoutBlockFlow {P} at (0,716) size 784x18
-        LayoutText {#text} at (0,0) size 444x17
-          text run at (0,0) width 444: "Spaces both before and after <wbr> to check for collapsing behavior."
+        LayoutText {#text} at (0,0) size 443x17
+          text run at (0,0) width 443: "Spaces both before and after <wbr> to check for collapsing behavior."
       LayoutBlockFlow {DIV} at (0,750) size 302x20 [border: (1px solid #0000FF)]
         LayoutText {#text} at (1,1) size 26x17
           text run at (1,1) width 26: "aaa "
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/wbr-in-pre-crash-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/text/wbr-in-pre-crash-expected.png
index 8237cdc..56fec0ad 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/wbr-in-pre-crash-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/wbr-in-pre-crash-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/wbr-in-pre-crash-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/text/wbr-in-pre-crash-expected.txt
index c9c9916..09b5396 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/wbr-in-pre-crash-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/wbr-in-pre-crash-expected.txt
@@ -4,15 +4,15 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x600
     LayoutBlockFlow {BODY} at (8,8) size 784x584
       LayoutBlockFlow {P} at (0,0) size 784x36
-        LayoutText {#text} at (0,0) size 55x17
-          text run at (0,0) width 55: "Test for "
-        LayoutInline {I} at (0,0) size 773x35
-          LayoutInline {A} at (0,0) size 306x17 [color=#0000EE]
-            LayoutText {#text} at (54,0) size 306x17
-              text run at (54,0) width 306: "http://bugs.webkit.org/show_bug.cgi?id=17464"
-          LayoutText {#text} at (359,0) size 773x35
-            text run at (359,0) width 5: " "
-            text run at (363,0) width 410: "REGRESSION: Crash in LayoutBlockFlow::findNextLineBreak"
+        LayoutText {#text} at (0,0) size 54x17
+          text run at (0,0) width 54: "Test for "
+        LayoutInline {I} at (0,0) size 770x35
+          LayoutInline {A} at (0,0) size 305x17 [color=#0000EE]
+            LayoutText {#text} at (53,0) size 305x17
+              text run at (53,0) width 305: "http://bugs.webkit.org/show_bug.cgi?id=17464"
+          LayoutText {#text} at (357,0) size 770x35
+            text run at (357,0) width 5: " "
+            text run at (361,0) width 409: "REGRESSION: Crash in LayoutBlockFlow::findNextLineBreak"
             text run at (0,18) width 253: "reading r30444 commit email in GMail"
         LayoutText {#text} at (252,18) size 5x17
           text run at (252,18) width 5: "."
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/wbr-styled-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/text/wbr-styled-expected.png
index c464c24..e1ac88a 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/wbr-styled-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/wbr-styled-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/wbr-styled-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/text/wbr-styled-expected.txt
index 2f51351..ee72b83 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/wbr-styled-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/wbr-styled-expected.txt
@@ -19,8 +19,8 @@
         LayoutInline {TT} at (0,0) size 65x16
           LayoutText {#text} at (509,2) size 65x16
             text run at (509,2) width 65: "absolute"
-        LayoutText {#text} at (573,0) size 155x17
-          text run at (573,0) width 155: " does not crash WebKit."
+        LayoutText {#text} at (573,0) size 154x17
+          text run at (573,0) width 154: " does not crash WebKit."
       LayoutBlockFlow {P} at (0,34) size 784x18
         LayoutText {#text} at (0,0) size 128x17
           text run at (0,0) width 128: "There should be no "
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/003-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/003-expected.png
index 92ee7b5f7..0aa2b12 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/003-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/003-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/003-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/003-expected.txt
index f2e54e0..19afac6 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/003-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/003-expected.txt
@@ -9,8 +9,8 @@
             text run at (0,1) width 528: "Ahem_font_required_for_this_test."
         LayoutText {#text} at (0,0) size 0x0
       LayoutBlockFlow {P} at (0,34) size 784x18
-        LayoutText {#text} at (0,0) size 648x17
-          text run at (0,0) width 648: "There should be three columns below, dark green, light green, and dark green, with no red anywhere."
+        LayoutText {#text} at (0,0) size 647x17
+          text run at (0,0) width 647: "There should be three columns below, dark green, light green, and dark green, with no red anywhere."
       LayoutTable {TABLE} at (0,68) size 66x126 [border: (3px solid #000000)]
         LayoutTableSection {TBODY} at (3,3) size 60x120
           LayoutTableRow {TR} at (0,0) size 60x120
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/004-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/004-expected.png
index 62907f6..b4d974b 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/004-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/004-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/004-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/004-expected.txt
index 7584413..b326c8dd0 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/004-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/004-expected.txt
@@ -9,8 +9,8 @@
             text run at (0,1) width 528: "Ahem_font_required_for_this_test."
         LayoutText {#text} at (0,0) size 0x0
       LayoutBlockFlow {P} at (0,34) size 784x18
-        LayoutText {#text} at (0,0) size 445x17
-          text run at (0,0) width 445: "There should be no red below, only a green square bordered in green."
+        LayoutText {#text} at (0,0) size 444x17
+          text run at (0,0) width 444: "There should be no red below, only a green square bordered in green."
       LayoutTable {TABLE} at (0,68) size 104x104
         LayoutTableSection {TBODY} at (0,0) size 104x104
           LayoutTableRow {TR} at (0,2) size 104x100
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/005-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/005-expected.png
index 6cca89e..93933f0c 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/005-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/005-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/005-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/005-expected.txt
index 6c1c4ad..55a1bd21 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/005-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/005-expected.txt
@@ -9,8 +9,8 @@
             text run at (0,1) width 528: "Ahem_font_required_for_this_test."
         LayoutText {#text} at (0,0) size 0x0
       LayoutBlockFlow {P} at (0,34) size 784x18
-        LayoutText {#text} at (0,0) size 445x17
-          text run at (0,0) width 445: "There should be no red below, only a green square bordered in green."
+        LayoutText {#text} at (0,0) size 444x17
+          text run at (0,0) width 444: "There should be no red below, only a green square bordered in green."
       LayoutTable {TABLE} at (0,68) size 104x104
         LayoutTableSection {TBODY} at (0,0) size 104x104
           LayoutTableRow {TR} at (0,2) size 104x100
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/006-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/006-expected.png
index af57c47f..76c486f9 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/006-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/006-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/006-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/006-expected.txt
index 43425763..387dc89 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/006-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/006-expected.txt
@@ -9,8 +9,8 @@
             text run at (16,1) width 528: "Ahem_font_required_for_this_test."
         LayoutText {#text} at (0,0) size 0x0
       LayoutBlockFlow {P} at (0,34) size 784x18
-        LayoutText {#text} at (0,0) size 504x17
-          text run at (0,0) width 504: "There should be no red below, only three identical striped green and lime bars."
+        LayoutText {#text} at (0,0) size 503x17
+          text run at (0,0) width 503: "There should be no red below, only three identical striped green and lime bars."
       LayoutBlockFlow {DIV} at (20,72) size 744x20
         LayoutInline {SPAN} at (0,0) size 220x20 [color=#800000] [bgcolor=#FF0000]
           LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/007-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/007-expected.png
index b51afed..72ede78 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/007-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/007-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/007-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/007-expected.txt
index 1c864ac..b1371ca 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/007-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/007-expected.txt
@@ -9,8 +9,8 @@
             text run at (16,1) width 528: "Ahem_font_required_for_this_test."
         LayoutText {#text} at (0,0) size 0x0
       LayoutBlockFlow {P} at (0,34) size 784x18
-        LayoutText {#text} at (0,0) size 496x17
-          text run at (0,0) width 496: "There should be no red below, only two identical striped green and lime bars."
+        LayoutText {#text} at (0,0) size 495x17
+          text run at (0,0) width 495: "There should be no red below, only two identical striped green and lime bars."
       LayoutBlockFlow {DIV} at (20,72) size 744x20
         LayoutInline {SPAN} at (0,0) size 220x20 [color=#800000] [bgcolor=#FF0000]
           LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/008-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/008-expected.png
index 02d9ffd..b77a2cb 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/008-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/008-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/008-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/008-expected.txt
index d0c2c66..0099fca 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/008-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/008-expected.txt
@@ -9,8 +9,8 @@
             text run at (16,1) width 528: "Ahem_font_required_for_this_test."
         LayoutText {#text} at (0,0) size 0x0
       LayoutBlockFlow {P} at (0,34) size 784x18
-        LayoutText {#text} at (0,0) size 289x17
-          text run at (0,0) width 289: "There should be a green block below, no red."
+        LayoutText {#text} at (0,0) size 288x17
+          text run at (0,0) width 288: "There should be a green block below, no red."
       LayoutBlockFlow {DIV} at (20,72) size 80x40 [color=#008000] [bgcolor=#FF0000]
         LayoutText {#text} at (0,0) size 80x40
           text run at (0,0) width 80: "xxxx"
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/009-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/009-expected.png
index 6460e30..152ab712 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/009-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/009-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/009-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/009-expected.txt
index 3e92aca..364d7ff 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/009-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/009-expected.txt
@@ -9,8 +9,8 @@
             text run at (0,1) width 528: "Ahem_font_required_for_this_test."
         LayoutText {#text} at (0,0) size 0x0
       LayoutBlockFlow {P} at (0,34) size 784x18
-        LayoutText {#text} at (0,0) size 461x17
-          text run at (0,0) width 461: "There should be no red below, only a lime line with a green square in it."
+        LayoutText {#text} at (0,0) size 460x17
+          text run at (0,0) width 460: "There should be no red below, only a lime line with a green square in it."
       LayoutBlockFlow {DIV} at (0,68) size 784x20
         LayoutBlockFlow {DIV} at (0,0) size 200x20 [bgcolor=#FF0000]
           LayoutBlockFlow {DIV} at (0,0) size 140x20 [color=#00FF00] [bgcolor=#008000]
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/010-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/010-expected.png
index 62907f6..b4d974b 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/010-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/010-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/010-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/010-expected.txt
index 7584413..b326c8dd0 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/010-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/010-expected.txt
@@ -9,8 +9,8 @@
             text run at (0,1) width 528: "Ahem_font_required_for_this_test."
         LayoutText {#text} at (0,0) size 0x0
       LayoutBlockFlow {P} at (0,34) size 784x18
-        LayoutText {#text} at (0,0) size 445x17
-          text run at (0,0) width 445: "There should be no red below, only a green square bordered in green."
+        LayoutText {#text} at (0,0) size 444x17
+          text run at (0,0) width 444: "There should be no red below, only a green square bordered in green."
       LayoutTable {TABLE} at (0,68) size 104x104
         LayoutTableSection {TBODY} at (0,0) size 104x104
           LayoutTableRow {TR} at (0,2) size 104x100
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/011-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/011-expected.png
index 6cca89e..93933f0c 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/011-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/011-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/011-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/011-expected.txt
index 6c1c4ad..55a1bd21 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/011-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/011-expected.txt
@@ -9,8 +9,8 @@
             text run at (0,1) width 528: "Ahem_font_required_for_this_test."
         LayoutText {#text} at (0,0) size 0x0
       LayoutBlockFlow {P} at (0,34) size 784x18
-        LayoutText {#text} at (0,0) size 445x17
-          text run at (0,0) width 445: "There should be no red below, only a green square bordered in green."
+        LayoutText {#text} at (0,0) size 444x17
+          text run at (0,0) width 444: "There should be no red below, only a green square bordered in green."
       LayoutTable {TABLE} at (0,68) size 104x104
         LayoutTableSection {TBODY} at (0,0) size 104x104
           LayoutTableRow {TR} at (0,2) size 104x100
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/015-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/015-expected.png
index 62907f6..b4d974b 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/015-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/015-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/015-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/015-expected.txt
index 7584413..b326c8dd0 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/015-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/015-expected.txt
@@ -9,8 +9,8 @@
             text run at (0,1) width 528: "Ahem_font_required_for_this_test."
         LayoutText {#text} at (0,0) size 0x0
       LayoutBlockFlow {P} at (0,34) size 784x18
-        LayoutText {#text} at (0,0) size 445x17
-          text run at (0,0) width 445: "There should be no red below, only a green square bordered in green."
+        LayoutText {#text} at (0,0) size 444x17
+          text run at (0,0) width 444: "There should be no red below, only a green square bordered in green."
       LayoutTable {TABLE} at (0,68) size 104x104
         LayoutTableSection {TBODY} at (0,0) size 104x104
           LayoutTableRow {TR} at (0,2) size 104x100
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/016-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/016-expected.png
index 6cca89e..93933f0c 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/016-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/016-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/016-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/016-expected.txt
index 6c1c4ad..55a1bd21 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/016-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/016-expected.txt
@@ -9,8 +9,8 @@
             text run at (0,1) width 528: "Ahem_font_required_for_this_test."
         LayoutText {#text} at (0,0) size 0x0
       LayoutBlockFlow {P} at (0,34) size 784x18
-        LayoutText {#text} at (0,0) size 445x17
-          text run at (0,0) width 445: "There should be no red below, only a green square bordered in green."
+        LayoutText {#text} at (0,0) size 444x17
+          text run at (0,0) width 444: "There should be no red below, only a green square bordered in green."
       LayoutTable {TABLE} at (0,68) size 104x104
         LayoutTableSection {TBODY} at (0,0) size 104x104
           LayoutTableRow {TR} at (0,2) size 104x100
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/018-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/018-expected.png
index 76d515c..d1b5b22 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/018-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/018-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/018-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/018-expected.txt
index 68a7717d..8e6403e 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/018-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/018-expected.txt
@@ -9,8 +9,8 @@
             text run at (0,1) width 528: "Ahem_font_required_for_this_test."
         LayoutText {#text} at (0,0) size 0x0
       LayoutBlockFlow {P} at (0,34) size 784x18
-        LayoutText {#text} at (0,0) size 602x17
-          text run at (0,0) width 602: "There should be a pretty green and lime pattern and the word \"PASS\" in lime on white below."
+        LayoutText {#text} at (0,0) size 599x17
+          text run at (0,0) width 599: "There should be a pretty green and lime pattern and the word \"PASS\" in lime on white below."
       LayoutBlockFlow {DIV} at (0,68) size 304x128 [color=#00FF00] [bgcolor=#008000]
         LayoutText {#text} at (0,0) size 304x32
           text run at (0,0) width 0: " "
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/021-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/021-expected.png
index 56c8bf39..70ea90a 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/021-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/021-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/021-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/021-expected.txt
index 5db05ae..6088932 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/021-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/021-expected.txt
@@ -7,12 +7,12 @@
         LayoutTableSection {TBODY} at (0,0) size 450x60
           LayoutTableRow {TR} at (0,2) size 450x56
             LayoutTableCell {TD} at (2,2) size 446x56 [bgcolor=#CCCC44] [r=0 c=0 rs=1 cs=1]
-              LayoutText {#text} at (1,1) size 428x35
-                text run at (1,1) width 428: "This stuff should all be within the table boundaries, and not off the"
+              LayoutText {#text} at (1,1) size 427x35
+                text run at (1,1) width 427: "This stuff should all be within the table boundaries, and not off the"
                 text run at (1,19) width 39: "edge. "
                 text run at (39,19) width 329: "No way should it be off the edge of the damn table."
-              LayoutInline {SPAN} at (0,0) size 206x17
+              LayoutInline {SPAN} at (0,0) size 205x17
                 LayoutImage {IMG} at (1,51) size 50x0
-                LayoutText {#text} at (51,37) size 156x17
-                  text run at (51,37) width 156: "oh, no I fell off the edge"
+                LayoutText {#text} at (51,37) size 155x17
+                  text run at (51,37) width 155: "oh, no I fell off the edge"
               LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/024-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/024-expected.png
index c85991c0..eaceb50 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/024-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/024-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/024-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/024-expected.txt
index f60797e..e4540d1 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/024-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/024-expected.txt
@@ -19,7 +19,7 @@
           text run at (0,18) width 286: "If a nested container element is preceded by "
           text run at (285,18) width 449: "uncontained text and a blank line, and there are \"too many\" characters"
           text run at (0,36) width 419: "contained in the nested element, the PRE width will be too wide. "
-          text run at (418,36) width 343: "In the examples below, the nested element is a SPAN"
+          text run at (418,36) width 341: "In the examples below, the nested element is a SPAN"
           text run at (0,54) width 96: "whose content "
           text run at (95,54) width 233: "is the days-of-week line, as follows:"
       LayoutBlockFlow {PRE} at (0,143.44) size 769x16
@@ -174,6 +174,6 @@
                 text run at (346,1) width 211: "no longer triggers the width bug,"
                 text run at (1,19) width 289: "because now the '2003' is itself contained by "
                 text run at (289,19) width 244: "a nested element (in this case, another"
-                text run at (1,37) width 51: "SPAN)."
+                text run at (1,37) width 49: "SPAN)."
       LayoutBlockFlow (anonymous) at (0,1188.69) size 769x18
         LayoutBR {BR} at (0,0) size 0x17
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/027-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/027-expected.png
index 575d9481..44772d9 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/027-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/027-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/027-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/027-expected.txt
index b9227c5..a0b3ee9 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/027-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/027-expected.txt
@@ -42,15 +42,15 @@
       LayoutTable {TABLE} at (0,416) size 784x66 [border: (2px outset #808080)]
         LayoutTableSection {TBODY} at (2,2) size 780x62
           LayoutTableRow {TR} at (0,2) size 780x58
-            LayoutTableCell {TD} at (2,2) size 586x58 [border: (1px inset #808080)] [r=0 c=0 rs=1 cs=1]
+            LayoutTableCell {TD} at (2,2) size 584x58 [border: (1px inset #808080)] [r=0 c=0 rs=1 cs=1]
               LayoutText {#text} at (2,2) size 136x17
                 text run at (2,2) width 136: "This is a test to see if"
-              LayoutInline {SPAN} at (0,0) size 582x53
-                LayoutText {#text} at (137,2) size 582x53
+              LayoutInline {SPAN} at (0,0) size 580x53
+                LayoutText {#text} at (137,2) size 580x53
                   text run at (137,2) width 105: "this is computed"
                   text run at (241,2) width 1: " "
-                  text run at (2,20) width 582: "correctly.  In particular, we have a really long line here that could throw off the min-width."
-                  text run at (583,20) width 1: " "
+                  text run at (2,20) width 580: "correctly.  In particular, we have a really long line here that could throw off the min-width."
+                  text run at (581,20) width 1: " "
                   text run at (2,38) width 32: "Is it?"
               LayoutText {#text} at (0,0) size 0x0
-            LayoutTableCell {TD} at (590,29) size 188x4 [border: (1px inset #808080)] [r=0 c=1 rs=1 cs=1]
+            LayoutTableCell {TD} at (588,29) size 190x4 [border: (1px inset #808080)] [r=0 c=1 rs=1 cs=1]
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/pre-break-word-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/pre-break-word-expected.png
index 31c97571..febc828 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/pre-break-word-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/pre-break-word-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/pre-break-word-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/pre-break-word-expected.txt
index 5103e42..e74b2bd 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/pre-break-word-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/pre-break-word-expected.txt
@@ -11,4 +11,4 @@
           text run at (2,56) width 148: "rap to multiple lines be"
           text run at (2,74) width 143: "cause of the word-wra"
           text run at (2,92) width 144: "p:break-word CSS pro"
-          text run at (2,110) width 37: "perty."
+          text run at (2,110) width 36: "perty."
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/pre-wrap-last-char-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/pre-wrap-last-char-expected.png
index c1a573d..8283801 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/pre-wrap-last-char-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/pre-wrap-last-char-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/pre-wrap-last-char-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/pre-wrap-last-char-expected.txt
index 49ddf14..67da521a 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/pre-wrap-last-char-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/pre-wrap-last-char-expected.txt
@@ -4,15 +4,15 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x600
     LayoutBlockFlow {BODY} at (8,8) size 784x584
       LayoutBlockFlow {P} at (0,0) size 784x36
-        LayoutText {#text} at (0,0) size 55x17
-          text run at (0,0) width 55: "Test for "
-        LayoutInline {I} at (0,0) size 765x35
-          LayoutInline {A} at (0,0) size 306x17 [color=#0000EE]
-            LayoutText {#text} at (54,0) size 306x17
-              text run at (54,0) width 306: "http://bugs.webkit.org/show_bug.cgi?id=13072"
-          LayoutText {#text} at (359,0) size 765x35
-            text run at (359,0) width 5: " "
-            text run at (363,0) width 402: "REGRESSION (r15617): white-space: pre-wrap breaks off the"
+        LayoutText {#text} at (0,0) size 54x17
+          text run at (0,0) width 54: "Test for "
+        LayoutInline {I} at (0,0) size 762x35
+          LayoutInline {A} at (0,0) size 305x17 [color=#0000EE]
+            LayoutText {#text} at (53,0) size 305x17
+              text run at (53,0) width 305: "http://bugs.webkit.org/show_bug.cgi?id=13072"
+          LayoutText {#text} at (357,0) size 762x35
+            text run at (357,0) width 5: " "
+            text run at (361,0) width 401: "REGRESSION (r15617): white-space: pre-wrap breaks off the"
             text run at (0,18) width 189: "last character of a wide word"
         LayoutText {#text} at (188,18) size 5x17
           text run at (188,18) width 5: "."
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/pre-wrap-line-test-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/pre-wrap-line-test-expected.png
index 0009edc..02462bb 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/pre-wrap-line-test-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/pre-wrap-line-test-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/pre-wrap-line-test-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/pre-wrap-line-test-expected.txt
index 51b9cdb8..c28d7e2 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/pre-wrap-line-test-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/pre-wrap-line-test-expected.txt
@@ -9,8 +9,8 @@
             LayoutTableCell {TD} at (2,2) size 780x56 [r=0 c=0 rs=1 cs=1]
               LayoutBlockFlow {DIV} at (1,1) size 778x54
                 LayoutText {#text} at (0,0) size 778x53
-                  text run at (0,0) width 756: "Three cheers    for OldVet and the letter he wrote to Senator Dodd (see above Comment).  We all need to be proactive"
-                  text run at (755,0) width 5: " "
+                  text run at (0,0) width 753: "Three cheers    for OldVet and the letter he wrote to Senator Dodd (see above Comment).  We all need to be proactive"
+                  text run at (752,0) width 5: " "
                   text run at (0,18) width 775: "and contact our senators and representatives to let them know our strong feelings on this subject.  I would lose what little"
                   text run at (774,18) width 4: " "
                   text run at (0,36) width 471: "faith I have left in our government if they engineered a tax payer bailout. "
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/pre-wrap-overflow-selection-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/pre-wrap-overflow-selection-expected.png
index 148fb17..cb03b4a4 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/pre-wrap-overflow-selection-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/pre-wrap-overflow-selection-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/pre-wrap-overflow-selection-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/pre-wrap-overflow-selection-expected.txt
index 04b4d14..1f9276f 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/pre-wrap-overflow-selection-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/pre-wrap-overflow-selection-expected.txt
@@ -6,12 +6,12 @@
       LayoutBlockFlow {P} at (0,0) size 784x36
         LayoutText {#text} at (0,0) size 260x17
           text run at (0,0) width 260: "This test checks for a regression against "
-        LayoutInline {I} at (0,0) size 747x35
-          LayoutInline {A} at (0,0) size 354x17 [color=#0000EE]
-            LayoutText {#text} at (259,0) size 354x17
-              text run at (259,0) width 354: "http://bugzilla.opendarwin.org/show_bug.cgi?id=5619"
-          LayoutText {#text} at (612,0) size 747x35
-            text run at (612,0) width 135: " CSS2: pre-wrap has"
+        LayoutInline {I} at (0,0) size 746x35
+          LayoutInline {A} at (0,0) size 353x17 [color=#0000EE]
+            LayoutText {#text} at (259,0) size 353x17
+              text run at (259,0) width 353: "http://bugzilla.opendarwin.org/show_bug.cgi?id=5619"
+          LayoutText {#text} at (611,0) size 746x35
+            text run at (611,0) width 135: " CSS2: pre-wrap has"
             text run at (0,18) width 181: "overflow/selection problems"
         LayoutText {#text} at (180,18) size 5x17
           text run at (180,18) width 5: "."
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/pre-wrap-spaces-after-newline-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/pre-wrap-spaces-after-newline-expected.png
index 41df8f2..33709f8 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/pre-wrap-spaces-after-newline-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/pre-wrap-spaces-after-newline-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/pre-wrap-spaces-after-newline-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/pre-wrap-spaces-after-newline-expected.txt
index d1c9b24..4e040e3b 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/pre-wrap-spaces-after-newline-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/whitespace/pre-wrap-spaces-after-newline-expected.txt
@@ -4,15 +4,15 @@
   LayoutBlockFlow {HTML} at (0,0) size 785x812
     LayoutBlockFlow {BODY} at (8,8) size 769x791
       LayoutBlockFlow {P} at (0,0) size 769x36
-        LayoutText {#text} at (0,0) size 55x17
-          text run at (0,0) width 55: "Test for "
-        LayoutInline {I} at (0,0) size 748x35
-          LayoutInline {A} at (0,0) size 354x17 [color=#0000EE]
-            LayoutText {#text} at (54,0) size 354x17
-              text run at (54,0) width 354: "http://bugzilla.opendarwin.org/show_bug.cgi?id=7216"
-          LayoutText {#text} at (407,0) size 748x35
-            text run at (407,0) width 5: " "
-            text run at (411,0) width 337: "white-space: pre-wrap collapses leading whitespace"
+        LayoutText {#text} at (0,0) size 54x17
+          text run at (0,0) width 54: "Test for "
+        LayoutInline {I} at (0,0) size 746x35
+          LayoutInline {A} at (0,0) size 353x17 [color=#0000EE]
+            LayoutText {#text} at (53,0) size 353x17
+              text run at (53,0) width 353: "http://bugzilla.opendarwin.org/show_bug.cgi?id=7216"
+          LayoutText {#text} at (405,0) size 746x35
+            text run at (405,0) width 5: " "
+            text run at (409,0) width 337: "white-space: pre-wrap collapses leading whitespace"
             text run at (0,18) width 127: "following a newline"
         LayoutText {#text} at (126,18) size 5x17
           text run at (126,18) width 5: "."
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/word-break-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/text/word-break-expected.png
index 7bb88a5..159dd1d 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/word-break-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/word-break-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/word-break-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/text/word-break-expected.txt
index 2c3ca5a..becb0595 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/word-break-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/word-break-expected.txt
@@ -30,9 +30,9 @@
           text run at (453,5) width 0: " "
       LayoutBlockFlow (anonymous) at (0,216) size 769x72
         LayoutBR {BR} at (0,0) size 0x17
-        LayoutText {#text} at (0,18) size 753x53
+        LayoutText {#text} at (0,18) size 751x53
           text run at (0,18) width 476: "The next two examples test our custom break-word value for word-break. "
-          text run at (475,18) width 278: "We should get the same results as break-all"
+          text run at (475,18) width 276: "We should get the same results as break-all"
           text run at (0,36) width 738: "for the first test, but we should break up the word in the second test (since our behavior matches word-wrap: break-"
           text run at (0,54) width 119: "word in that case)."
       LayoutTable {TABLE} at (0,288) size 769x110 [border: (1px outset #808080)]
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/word-break-run-rounding-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/text/word-break-run-rounding-expected.png
index eede3e3d..a80a04e9 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/word-break-run-rounding-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/word-break-run-rounding-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/word-break-run-rounding-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/text/word-break-run-rounding-expected.txt
index 9f57e810..c792f439 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/word-break-run-rounding-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/word-break-run-rounding-expected.txt
@@ -4,34 +4,34 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x600
     LayoutBlockFlow {BODY} at (8,8) size 784x584
       LayoutBlockFlow {P} at (0,0) size 784x18
-        LayoutText {#text} at (0,0) size 61x17
-          text run at (0,0) width 61: "Tests for "
-        LayoutInline {I} at (0,0) size 716x17
+        LayoutText {#text} at (0,0) size 60x17
+          text run at (0,0) width 60: "Tests for "
+        LayoutInline {I} at (0,0) size 712x17
           LayoutInline {A} at (0,0) size 306x17 [color=#0000EE]
-            LayoutText {#text} at (60,0) size 306x17
-              text run at (60,0) width 306: "http://bugs.webkit.org/show_bug.cgi?id=13438"
-          LayoutText {#text} at (365,0) size 411x17
-            text run at (365,0) width 5: " "
-            text run at (369,0) width 407: "Run rounding makes word-break:break-all/word not functional"
-        LayoutText {#text} at (775,0) size 5x17
-          text run at (775,0) width 5: "."
+            LayoutText {#text} at (59,0) size 306x17
+              text run at (59,0) width 306: "http://bugs.webkit.org/show_bug.cgi?id=13438"
+          LayoutText {#text} at (364,0) size 407x17
+            text run at (364,0) width 5: " "
+            text run at (368,0) width 403: "Run rounding makes word-break:break-all/word not functional"
+        LayoutText {#text} at (770,0) size 5x17
+          text run at (770,0) width 5: "."
       LayoutBlockFlow {P} at (0,34) size 784x18
-        LayoutText {#text} at (0,0) size 316x17
-          text run at (0,0) width 316: "Test that the preferred (maximum) width is right:"
+        LayoutText {#text} at (0,0) size 314x17
+          text run at (0,0) width 314: "Test that the preferred (maximum) width is right:"
       LayoutBlockFlow (anonymous) at (0,68) size 784x24
         LayoutBlockFlow (floating) {DIV} at (0,0) size 599.63x24 [border: (3px solid #000000)]
           LayoutText {#text} at (3,3) size 594x17
             text run at (3,3) width 594: "The black border should fit tightly around this one line of text with no space after the period."
         LayoutBR {BR} at (599,0) size 1x17
       LayoutBlockFlow {P} at (0,108) size 784x18
-        LayoutText {#text} at (0,0) size 389x17
-          text run at (0,0) width 389: "Test that text does not wrap too early due to rounding errors:"
+        LayoutText {#text} at (0,0) size 388x17
+          text run at (0,0) width 388: "Test that text does not wrap too early due to rounding errors:"
       LayoutBlockFlow {DIV} at (0,142) size 431x24 [border: (3px solid #000000)]
         LayoutText {#text} at (3,3) size 351x17
           text run at (3,3) width 351: "This text fits nicely on a single line of the given width."
       LayoutBlockFlow {P} at (0,182) size 784x18
-        LayoutText {#text} at (0,0) size 234x17
-          text run at (0,0) width 234: "Test that text does not wrap too late:"
+        LayoutText {#text} at (0,0) size 233x17
+          text run at (0,0) width 233: "Test that text does not wrap too late:"
       LayoutBlockFlow {DIV} at (0,216) size 597x42 [border: (3px solid #000000)]
         LayoutText {#text} at (3,3) size 587x35
           text run at (3,3) width 389: "J u s t a b u n c h o f l e t t e r s h e r e , n o t h i n g t o s e e . "
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/word-break-soft-hyphen-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/text/word-break-soft-hyphen-expected.png
index a5af238..f3f66c3 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/word-break-soft-hyphen-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/word-break-soft-hyphen-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/word-break-soft-hyphen-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/text/word-break-soft-hyphen-expected.txt
index fe6177b..0d43698 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/word-break-soft-hyphen-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/word-break-soft-hyphen-expected.txt
@@ -4,15 +4,15 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x600
     LayoutBlockFlow {BODY} at (8,8) size 784x576
       LayoutBlockFlow {P} at (0,0) size 784x36
-        LayoutText {#text} at (0,0) size 55x17
-          text run at (0,0) width 55: "Test for "
-        LayoutInline {I} at (0,0) size 761x35
-          LayoutInline {A} at (0,0) size 306x17 [color=#0000EE]
-            LayoutText {#text} at (54,0) size 306x17
-              text run at (54,0) width 306: "http://bugs.webkit.org/show_bug.cgi?id=15367"
-          LayoutText {#text} at (359,0) size 761x35
-            text run at (359,0) width 5: " "
-            text run at (363,0) width 398: "Assertion failure inspecting a document including soft hyphen"
+        LayoutText {#text} at (0,0) size 54x17
+          text run at (0,0) width 54: "Test for "
+        LayoutInline {I} at (0,0) size 759x35
+          LayoutInline {A} at (0,0) size 305x17 [color=#0000EE]
+            LayoutText {#text} at (53,0) size 305x17
+              text run at (53,0) width 305: "http://bugs.webkit.org/show_bug.cgi?id=15367"
+          LayoutText {#text} at (357,0) size 759x35
+            text run at (357,0) width 5: " "
+            text run at (361,0) width 398: "Assertion failure inspecting a document including soft hyphen"
             text run at (0,18) width 76: "code (0xad)"
         LayoutText {#text} at (75,18) size 5x17
           text run at (75,18) width 5: "."
@@ -21,5 +21,5 @@
           text run at (0,0) width 499: "The following text should not wrap and the border should fit tightly around it."
 layer at (8,94) size 117x24
   LayoutBlockFlow (positioned) {DIV} at (8,94) size 116.66x24 [border: (3px solid #000000)]
-    LayoutText {#text} at (3,3) size 111x17
-      text run at (3,3) width 111: "Two soft\x{AD}hyp\x{AD}hens"
+    LayoutText {#text} at (3,3) size 110x17
+      text run at (3,3) width 110: "Two soft\x{AD}hyp\x{AD}hens"
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/word-space-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/text/word-space-expected.png
index 63df17db..9919a62 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/word-space-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/word-space-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/word-space-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/text/word-space-expected.txt
index 987fc851..b829fa7 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/word-space-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/word-space-expected.txt
@@ -4,15 +4,15 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x600
     LayoutBlockFlow {BODY} at (8,8) size 784x576
       LayoutBlockFlow {P} at (0,0) size 784x36
-        LayoutText {#text} at (0,0) size 55x17
-          text run at (0,0) width 55: "Test for "
-        LayoutInline {I} at (0,0) size 767x35
-          LayoutInline {A} at (0,0) size 306x17 [color=#0000EE]
-            LayoutText {#text} at (54,0) size 306x17
-              text run at (54,0) width 306: "http://bugs.webkit.org/show_bug.cgi?id=15259"
-          LayoutText {#text} at (359,0) size 767x35
-            text run at (359,0) width 5: " "
-            text run at (363,0) width 404: "REGRESSION:Text overflows if a empty <td> is followed by a"
+        LayoutText {#text} at (0,0) size 54x17
+          text run at (0,0) width 54: "Test for "
+        LayoutInline {I} at (0,0) size 764x35
+          LayoutInline {A} at (0,0) size 305x17 [color=#0000EE]
+            LayoutText {#text} at (53,0) size 305x17
+              text run at (53,0) width 305: "http://bugs.webkit.org/show_bug.cgi?id=15259"
+          LayoutText {#text} at (357,0) size 764x35
+            text run at (357,0) width 5: " "
+            text run at (361,0) width 403: "REGRESSION:Text overflows if a empty <td> is followed by a"
             text run at (0,18) width 136: "<td align=\"center\">"
         LayoutText {#text} at (135,18) size 5x17
           text run at (135,18) width 5: "."
@@ -20,11 +20,11 @@
         LayoutText {#text} at (0,0) size 267x17
           text run at (0,0) width 267: "The next 7 lines should all look the same."
       LayoutBlockFlow (floating) {DIV} at (0,86) size 82.23x24 [border: (3px solid #000000)]
-        LayoutText {#text} at (3,3) size 77x17
-          text run at (3,3) width 77: "A B"
+        LayoutText {#text} at (3,3) size 76x17
+          text run at (3,3) width 76: "A B"
       LayoutBlockFlow (floating) {DIV} at (0,110) size 82.23x24 [border: (3px solid #000000)]
-        LayoutText {#text} at (3,3) size 77x17
-          text run at (3,3) width 77: "A B"
+        LayoutText {#text} at (3,3) size 76x17
+          text run at (3,3) width 76: "A B"
       LayoutBlockFlow (floating) {DIV} at (0,134) size 82.23x24 [border: (3px solid #000000)]
         LayoutInline {SPAN} at (0,0) size 12x17
           LayoutText {#text} at (3,3) size 12x17
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/zero-font-size-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/text/zero-font-size-expected.png
index 68a7932..5f23c61 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/zero-font-size-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/zero-font-size-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/text/zero-font-size-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/text/zero-font-size-expected.txt
index 6a54e4d..c7d5862 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/text/zero-font-size-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/text/zero-font-size-expected.txt
@@ -4,8 +4,8 @@
   LayoutBlockFlow {HTML} at (0,0) size 800x600
     LayoutBlockFlow {BODY} at (8,8) size 784x584
       LayoutBlockFlow {P} at (0,0) size 784x36
-        LayoutText {#text} at (0,0) size 763x35
-          text run at (0,0) width 763: "Test that text with 0px font size is not displayed, even if a non-zero minimum font size setting is specified. On success,"
+        LayoutText {#text} at (0,0) size 762x35
+          text run at (0,0) width 762: "Test that text with 0px font size is not displayed, even if a non-zero minimum font size setting is specified. On success,"
           text run at (0,18) width 370: "this paragraph should be the only text visible on the page."
       LayoutBlockFlow {DIV} at (0,52) size 784x0 [color=#FF0000]
         LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/win7/fast/text-autosizing/display-type-change-expected.png b/third_party/WebKit/LayoutTests/platform/win7/fast/text-autosizing/display-type-change-expected.png
new file mode 100644
index 0000000..ff44704f
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/win7/fast/text-autosizing/display-type-change-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win7/fast/text-autosizing/display-type-change-expected.txt b/third_party/WebKit/LayoutTests/platform/win7/fast/text-autosizing/display-type-change-expected.txt
new file mode 100644
index 0000000..e407ed7
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/win7/fast/text-autosizing/display-type-change-expected.txt
@@ -0,0 +1,35 @@
+layer at (0,0) size 800x600 scrollHeight 811
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x810 backgroundClip at (0,0) size 800x600 clip at (0,0) size 800x600
+  LayoutBlockFlow {HTML} at (0,0) size 800x810
+    LayoutBlockFlow {BODY} at (0,0) size 800x810
+      LayoutBlockFlow {SPAN} at (0,0) size 200x810
+        LayoutBlockFlow {DIV} at (0,0) size 200x810
+          LayoutText {#text} at (0,-2) size 200x813
+            text run at (0,-2) width 200: "This test verifies"
+            text run at (0,28) width 140: "that display"
+            text run at (0,58) width 97: "changes"
+            text run at (0,88) width 102: "properly"
+            text run at (0,118) width 163: "invalidate the"
+            text run at (0,148) width 167: "text autosizer."
+            text run at (0,178) width 187: "This test passes"
+            text run at (0,208) width 195: "if this text is not"
+            text run at (0,238) width 144: "overlapping"
+            text run at (0,268) width 129: "with itself."
+            text run at (0,298) width 161: "Lorem ipsum"
+            text run at (0,328) width 173: "dolor sit amet,"
+            text run at (0,358) width 137: "consectetur"
+            text run at (0,388) width 185: "adipisicing elit,"
+            text run at (0,418) width 187: "sed do eiusmod"
+            text run at (0,448) width 85: "tempor"
+            text run at (0,478) width 153: "incididunt ut"
+            text run at (0,508) width 189: "labore et dolore"
+            text run at (0,538) width 169: "magna aliqua."
+            text run at (0,568) width 134: "Ut enim ad"
+            text run at (0,598) width 182: "minim veniam,"
+            text run at (0,628) width 148: "quis nostrud"
+            text run at (0,658) width 142: "exercitation"
+            text run at (0,688) width 186: "ullamco laboris"
+            text run at (0,718) width 165: "nisi ut aliquip"
+            text run at (0,748) width 190: "ex ea commodo"
+            text run at (0,778) width 128: "consequat."
diff --git a/third_party/WebKit/LayoutTests/platform/win7/fast/text-autosizing/list-item-above-dbcat-expected.png b/third_party/WebKit/LayoutTests/platform/win7/fast/text-autosizing/list-item-above-dbcat-expected.png
new file mode 100644
index 0000000..33f29be
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/win7/fast/text-autosizing/list-item-above-dbcat-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win7/fast/text-autosizing/list-item-above-dbcat-expected.txt b/third_party/WebKit/LayoutTests/platform/win7/fast/text-autosizing/list-item-above-dbcat-expected.txt
new file mode 100644
index 0000000..e794a7d
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/win7/fast/text-autosizing/list-item-above-dbcat-expected.txt
@@ -0,0 +1,25 @@
+layer at (0,0) size 800x600 scrollHeight 628
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x628 backgroundClip at (0,0) size 800x600 clip at (0,0) size 800x600
+  LayoutBlockFlow {HTML} at (0,0) size 800x628
+    LayoutBlockFlow {BODY} at (0,0) size 800x376
+      LayoutBlockFlow {DIV} at (0,0) size 800x376
+        LayoutText {#text} at (0,1) size 779x374
+          text run at (0,1) width 640: "This test verifies that FastTextAutosizer"
+          text run at (0,48) width 701: "considers a list item (LI) to be \"text\" for the"
+          text run at (0,95) width 661: "purpose of determining the deepest block"
+          text run at (0,142) width 779: "containing all text (DBCAT). If this were not the"
+          text run at (0,189) width 716: "case, the cluster's DBCAT would be the DIV"
+          text run at (0,236) width 719: "inside the LI, which hasn't entered layout yet"
+          text run at (0,283) width 730: "when the list marker is autosized (causing the"
+          text run at (0,330) width 304: "autosizer to crash)."
+      LayoutBlockFlow (floating) {UL} at (0,392) size 800x220
+        LayoutListItem {LI} at (40,0) size 760x220
+          LayoutBlockFlow {DIV} at (0,0) size 760x220
+            LayoutListMarker (anonymous) at (-30,1) size 13x42: bullet
+            LayoutText {#text} at (0,1) size 733x218
+              text run at (0,1) width 725: "List item list item list item list item list item list"
+              text run at (0,45) width 733: "item list item list item list item list item list item"
+              text run at (0,89) width 712: "list item list item list item list item list item list"
+              text run at (0,133) width 733: "item list item list item list item list item list item"
+              text run at (0,177) width 124: "list item"
diff --git a/third_party/WebKit/LayoutTests/platform/win7/fast/text-autosizing/tables/css-table-single-cell-lots-of-text-expected.png b/third_party/WebKit/LayoutTests/platform/win7/fast/text-autosizing/tables/css-table-single-cell-lots-of-text-expected.png
new file mode 100644
index 0000000..11b632f
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/win7/fast/text-autosizing/tables/css-table-single-cell-lots-of-text-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win7/fast/text-autosizing/tables/css-table-single-cell-lots-of-text-expected.txt b/third_party/WebKit/LayoutTests/platform/win7/fast/text-autosizing/tables/css-table-single-cell-lots-of-text-expected.txt
new file mode 100644
index 0000000..573f16c
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/win7/fast/text-autosizing/tables/css-table-single-cell-lots-of-text-expected.txt
@@ -0,0 +1,46 @@
+layer at (0,0) size 800x600
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x552
+  LayoutBlockFlow {HTML} at (0,0) size 800x552
+    LayoutBlockFlow {BODY} at (0,0) size 800x551
+      LayoutBlockFlow {DIV} at (0,0) size 600x36
+        LayoutText {#text} at (0,0) size 284x14
+          text run at (0,0) width 284: "Table autosizing tests - css-table-single-cell-lots-of-text.html"
+        LayoutBR {BR} at (283,0) size 1x14
+        LayoutText {#text} at (0,15) size 552x14
+          text run at (0,15) width 552: "This test passes if there is a one cell with lots of text that's autosized, and five single-word cells that are not autosized."
+      LayoutTable {DIV} at (1,37) size 798x514
+        LayoutTableSection (anonymous) at (0,0) size 798x514
+          LayoutTableRow {DIV} at (0,0) size 798x36
+            LayoutTableCell {DIV} at (0,16) size 25x17 [bgcolor=#F0FFF0] [border: (1px dotted #006400)] [r=0 c=0 rs=1 cs=1]
+              LayoutText {#text} at (1,1) size 23x14
+                text run at (1,1) width 23: "hello"
+            LayoutTableCell {DIV} at (25,0) size 748x36 [bgcolor=#F0FFF0] [border: (1px dotted #006400)] [r=0 c=1 rs=1 cs=1]
+              LayoutText {#text} at (1,1) size 60x33
+                text run at (1,1) width 60: "hello"
+            LayoutTableCell {DIV} at (773,16) size 25x17 [bgcolor=#F0FFF0] [border: (1px dotted #006400)] [r=0 c=2 rs=1 cs=1]
+              LayoutText {#text} at (1,1) size 23x14
+                text run at (1,1) width 23: "hello"
+          LayoutTableRow {DIV} at (0,36) size 798x478
+            LayoutTableCell {DIV} at (0,52) size 25x17 [bgcolor=#F0FFF0] [border: (1px dotted #006400)] [r=1 c=0 rs=1 cs=1]
+              LayoutText {#text} at (1,1) size 23x14
+                text run at (1,1) width 23: "hello"
+            LayoutTableCell {DIV} at (25,36) size 748x478 [bgcolor=#F0FFF0] [border: (1px dotted #006400)] [r=1 c=1 rs=1 cs=1]
+              LayoutText {#text} at (1,1) size 735x475
+                text run at (1,1) width 735: "hello hello hello hello hello hello hello hello hello hello hello"
+                text run at (1,35) width 735: "hello hello hello hello hello hello hello hello hello hello hello"
+                text run at (1,69) width 735: "hello hello hello hello hello hello hello hello hello hello hello"
+                text run at (1,103) width 735: "hello hello hello hello hello hello hello hello hello hello hello"
+                text run at (1,137) width 735: "hello hello hello hello hello hello hello hello hello hello hello"
+                text run at (1,171) width 735: "hello hello hello hello hello hello hello hello hello hello hello"
+                text run at (1,205) width 735: "hello hello hello hello hello hello hello hello hello hello hello"
+                text run at (1,239) width 735: "hello hello hello hello hello hello hello hello hello hello hello"
+                text run at (1,273) width 735: "hello hello hello hello hello hello hello hello hello hello hello"
+                text run at (1,307) width 735: "hello hello hello hello hello hello hello hello hello hello hello"
+                text run at (1,341) width 735: "hello hello hello hello hello hello hello hello hello hello hello"
+                text run at (1,375) width 735: "hello hello hello hello hello hello hello hello hello hello hello"
+                text run at (1,409) width 735: "hello hello hello hello hello hello hello hello hello hello hello"
+                text run at (1,443) width 600: "hello hello hello hello hello hello hello hello hello"
+            LayoutTableCell {DIV} at (773,52) size 25x17 [bgcolor=#F0FFF0] [border: (1px dotted #006400)] [r=1 c=2 rs=1 cs=1]
+              LayoutText {#text} at (1,1) size 23x14
+                text run at (1,1) width 23: "hello"
diff --git a/third_party/WebKit/LayoutTests/platform/win7/fast/text-autosizing/tables/fixed-table-single-cell-lots-of-text-expected.png b/third_party/WebKit/LayoutTests/platform/win7/fast/text-autosizing/tables/fixed-table-single-cell-lots-of-text-expected.png
new file mode 100644
index 0000000..f23653a
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/win7/fast/text-autosizing/tables/fixed-table-single-cell-lots-of-text-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win7/fast/text-autosizing/tables/fixed-table-single-cell-lots-of-text-expected.txt b/third_party/WebKit/LayoutTests/platform/win7/fast/text-autosizing/tables/fixed-table-single-cell-lots-of-text-expected.txt
new file mode 100644
index 0000000..dc4947d
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/win7/fast/text-autosizing/tables/fixed-table-single-cell-lots-of-text-expected.txt
@@ -0,0 +1,46 @@
+layer at (0,0) size 800x600
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x555
+  LayoutBlockFlow {HTML} at (0,0) size 800x555
+    LayoutBlockFlow {BODY} at (0,0) size 800x554
+      LayoutBlockFlow {DIV} at (0,0) size 600x36
+        LayoutText {#text} at (0,0) size 293x14
+          text run at (0,0) width 293: "Table autosizing tests - fixed-table-single-cell-lots-of-text.html"
+        LayoutBR {BR} at (292,0) size 1x14
+        LayoutText {#text} at (0,15) size 552x14
+          text run at (0,15) width 552: "This test passes if there is a one cell with lots of text that's autosized, and five single-word cells that are not autosized."
+      LayoutTable {TABLE} at (1,37) size 798x517 [border: none]
+        LayoutTableSection {TBODY} at (0,0) size 797x516
+          LayoutTableRow {TR} at (0,0) size 797x37
+            LayoutTableCell {TD} at (0,9) size 26x18 [bgcolor=#F0FFF0] [border: (1px dotted #006400)] [r=0 c=0 rs=1 cs=1]
+              LayoutText {#text} at (2,2) size 23x14
+                text run at (2,2) width 23: "hello"
+            LayoutTableCell {TD} at (26,0) size 745x37 [bgcolor=#F0FFF0] [border: (1px dotted #006400)] [r=0 c=1 rs=1 cs=1]
+              LayoutText {#text} at (2,2) size 60x33
+                text run at (2,2) width 60: "hello"
+            LayoutTableCell {TD} at (771,9) size 26x18 [bgcolor=#F0FFF0] [border: (1px dotted #006400)] [r=0 c=2 rs=1 cs=1]
+              LayoutText {#text} at (2,2) size 23x14
+                text run at (2,2) width 23: "hello"
+          LayoutTableRow {TR} at (0,37) size 797x479
+            LayoutTableCell {TD} at (0,267) size 26x18 [bgcolor=#F0FFF0] [border: (1px dotted #006400)] [r=1 c=0 rs=1 cs=1]
+              LayoutText {#text} at (2,2) size 23x14
+                text run at (2,2) width 23: "hello"
+            LayoutTableCell {TD} at (26,37) size 745x479 [bgcolor=#F0FFF0] [border: (1px dotted #006400)] [r=1 c=1 rs=1 cs=1]
+              LayoutText {#text} at (2,2) size 735x475
+                text run at (2,2) width 735: "hello hello hello hello hello hello hello hello hello hello hello"
+                text run at (2,36) width 735: "hello hello hello hello hello hello hello hello hello hello hello"
+                text run at (2,70) width 735: "hello hello hello hello hello hello hello hello hello hello hello"
+                text run at (2,104) width 735: "hello hello hello hello hello hello hello hello hello hello hello"
+                text run at (2,138) width 735: "hello hello hello hello hello hello hello hello hello hello hello"
+                text run at (2,172) width 735: "hello hello hello hello hello hello hello hello hello hello hello"
+                text run at (2,206) width 735: "hello hello hello hello hello hello hello hello hello hello hello"
+                text run at (2,240) width 735: "hello hello hello hello hello hello hello hello hello hello hello"
+                text run at (2,274) width 735: "hello hello hello hello hello hello hello hello hello hello hello"
+                text run at (2,308) width 735: "hello hello hello hello hello hello hello hello hello hello hello"
+                text run at (2,342) width 735: "hello hello hello hello hello hello hello hello hello hello hello"
+                text run at (2,376) width 735: "hello hello hello hello hello hello hello hello hello hello hello"
+                text run at (2,410) width 735: "hello hello hello hello hello hello hello hello hello hello hello"
+                text run at (2,444) width 600: "hello hello hello hello hello hello hello hello hello"
+            LayoutTableCell {TD} at (771,267) size 26x18 [bgcolor=#F0FFF0] [border: (1px dotted #006400)] [r=1 c=2 rs=1 cs=1]
+              LayoutText {#text} at (2,2) size 23x14
+                text run at (2,2) width 23: "hello"
diff --git a/third_party/WebKit/LayoutTests/platform/win7/fast/text-autosizing/tables/nested-table-wrapping-expected.png b/third_party/WebKit/LayoutTests/platform/win7/fast/text-autosizing/tables/nested-table-wrapping-expected.png
new file mode 100644
index 0000000..150f258
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/win7/fast/text-autosizing/tables/nested-table-wrapping-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win7/fast/text-autosizing/tables/nested-table-wrapping-expected.txt b/third_party/WebKit/LayoutTests/platform/win7/fast/text-autosizing/tables/nested-table-wrapping-expected.txt
new file mode 100644
index 0000000..e73ee8f
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/win7/fast/text-autosizing/tables/nested-table-wrapping-expected.txt
@@ -0,0 +1,29 @@
+layer at (0,0) size 800x600
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x267
+  LayoutBlockFlow {HTML} at (0,0) size 800x267
+    LayoutBlockFlow {BODY} at (0,0) size 800x266
+      LayoutBlockFlow {DIV} at (0,0) size 600x36
+        LayoutText {#text} at (0,0) size 240x14
+          text run at (0,0) width 240: "Table autosizing tests - nested-table-wrapping.html"
+        LayoutBR {BR} at (239,0) size 1x14
+        LayoutText {#text} at (0,15) size 381x14
+          text run at (0,15) width 381: "This test passes if \"the table cell should tightly wrap this text\" is tightly wrapped."
+      LayoutTable {TABLE} at (1,37) size 798x229 [border: none]
+        LayoutTableSection {TBODY} at (0,0) size 797x228
+          LayoutTableRow {TR} at (0,0) size 797x228
+            LayoutTableCell {TD} at (0,0) size 797x228 [bgcolor=#F0FFF0] [border: (1px dotted #006400)] [r=0 c=0 rs=1 cs=1]
+              LayoutBlockFlow (anonymous) at (2,2) size 794x204
+                LayoutText {#text} at (0,0) size 786x203
+                  text run at (0,0) width 786: "Autosize Autosize Autosize Autosize Autosize Autosize Autosize"
+                  text run at (0,34) width 786: "Autosize Autosize Autosize Autosize Autosize Autosize Autosize"
+                  text run at (0,68) width 786: "Autosize Autosize Autosize Autosize Autosize Autosize Autosize"
+                  text run at (0,102) width 786: "Autosize Autosize Autosize Autosize Autosize Autosize Autosize"
+                  text run at (0,136) width 786: "Autosize Autosize Autosize Autosize Autosize Autosize Autosize"
+                  text run at (0,170) width 446: "Autosize Autosize Autosize Autosize"
+              LayoutTable {TABLE} at (3,207) size 197x19 [border: none]
+                LayoutTableSection {TBODY} at (0,0) size 196x18
+                  LayoutTableRow {TR} at (0,0) size 196x18
+                    LayoutTableCell {TD} at (0,0) size 196x18 [bgcolor=#F0FFF0] [border: (1px dotted #006400)] [r=0 c=0 rs=1 cs=1]
+                      LayoutText {#text} at (2,2) size 193x14
+                        text run at (2,2) width 193: "the table cell should tightly wrap this text"
diff --git a/third_party/WebKit/LayoutTests/platform/win7/fast/text-autosizing/tables/nested-tables-expected.png b/third_party/WebKit/LayoutTests/platform/win7/fast/text-autosizing/tables/nested-tables-expected.png
new file mode 100644
index 0000000..ab3b48a0
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/win7/fast/text-autosizing/tables/nested-tables-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win7/fast/text-autosizing/tables/nested-tables-expected.txt b/third_party/WebKit/LayoutTests/platform/win7/fast/text-autosizing/tables/nested-tables-expected.txt
new file mode 100644
index 0000000..2f22e24
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/win7/fast/text-autosizing/tables/nested-tables-expected.txt
@@ -0,0 +1,43 @@
+layer at (0,0) size 800x600
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x315
+  LayoutBlockFlow {HTML} at (0,0) size 800x315
+    LayoutBlockFlow {BODY} at (0,0) size 800x314
+      LayoutBlockFlow {DIV} at (0,0) size 600x36
+        LayoutText {#text} at (0,0) size 196x14
+          text run at (0,0) width 196: "Table autosizing tests - nested-tables.html"
+        LayoutBR {BR} at (195,0) size 1x14
+        LayoutText {#text} at (0,15) size 358x14
+          text run at (0,15) width 358: "This test passes if \"This text should not overlap itself\" doesn't overlap itself."
+      LayoutTable {TABLE} at (1,37) size 798x277 [border: none]
+        LayoutTableSection {TBODY} at (0,0) size 797x276
+          LayoutTableRow {TR} at (0,0) size 797x276
+            LayoutTableCell {TD} at (0,0) size 797x276 [bgcolor=#F0FFF0] [border: (1px dotted #006400)] [r=0 c=0 rs=1 cs=1]
+              LayoutBlockFlow (anonymous) at (2,2) size 794x204
+                LayoutText {#text} at (0,0) size 786x203
+                  text run at (0,0) width 786: "Autosize Autosize Autosize Autosize Autosize Autosize Autosize"
+                  text run at (0,34) width 786: "Autosize Autosize Autosize Autosize Autosize Autosize Autosize"
+                  text run at (0,68) width 786: "Autosize Autosize Autosize Autosize Autosize Autosize Autosize"
+                  text run at (0,102) width 786: "Autosize Autosize Autosize Autosize Autosize Autosize Autosize"
+                  text run at (0,136) width 786: "Autosize Autosize Autosize Autosize Autosize Autosize Autosize"
+                  text run at (0,170) width 106: "Autosize"
+              LayoutTable {TABLE} at (3,207) size 92x67 [border: none]
+                LayoutTableSection {TBODY} at (0,0) size 91x66
+                  LayoutTableRow {TR} at (0,0) size 91x48
+                    LayoutTableCell {TD} at (0,0) size 91x48 [bgcolor=#F0FFF0] [border: (1px dotted #006400)] [r=0 c=0 rs=1 cs=1]
+                      LayoutText {#text} at (2,2) size 41x14
+                        text run at (2,2) width 41: "This text"
+                      LayoutBR {BR} at (43,2) size 0x14
+                      LayoutText {#text} at (2,17) size 88x14
+                        text run at (2,17) width 88: "should not overlap"
+                      LayoutBR {BR} at (90,17) size 0x14
+                      LayoutText {#text} at (2,32) size 26x14
+                        text run at (2,32) width 26: "itself."
+                  LayoutTableRow {TR} at (0,48) size 91x18
+                    LayoutTableCell {TD} at (0,48) size 91x18 [bgcolor=#F0FFF0] [border: (1px dotted #006400)] [r=1 c=0 rs=1 cs=1]
+                      LayoutBlockFlow {IMG} at (2,2) size 5x5
+layer at (6,300) size 5x5 clip at (7,301) size 3x3 scrollWidth 17 scrollHeight 18
+  LayoutBlockFlow {DIV} at (0,6) size 5x5 [border: (1px solid #C0C0C0)]
+    LayoutImage (floating) {IMG} at (2,2) size 16x16
+layer at (24,302) size 0x0
+  LayoutBlockFlow {DIV} at (18,2) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/win7/fast/text-autosizing/tables/single-cell-lots-of-text-expected.png b/third_party/WebKit/LayoutTests/platform/win7/fast/text-autosizing/tables/single-cell-lots-of-text-expected.png
new file mode 100644
index 0000000..e15d6ada
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/win7/fast/text-autosizing/tables/single-cell-lots-of-text-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win7/fast/text-autosizing/tables/single-cell-lots-of-text-expected.txt b/third_party/WebKit/LayoutTests/platform/win7/fast/text-autosizing/tables/single-cell-lots-of-text-expected.txt
new file mode 100644
index 0000000..3ed4e68
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/win7/fast/text-autosizing/tables/single-cell-lots-of-text-expected.txt
@@ -0,0 +1,46 @@
+layer at (0,0) size 800x600
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x555
+  LayoutBlockFlow {HTML} at (0,0) size 800x555
+    LayoutBlockFlow {BODY} at (0,0) size 800x554
+      LayoutBlockFlow {DIV} at (0,0) size 600x36
+        LayoutText {#text} at (0,0) size 239x14
+          text run at (0,0) width 239: "Table autosizing tests - single-cell-lots-of-text.html"
+        LayoutBR {BR} at (238,0) size 1x14
+        LayoutText {#text} at (0,15) size 552x14
+          text run at (0,15) width 552: "This test passes if there is a one cell with lots of text that's autosized, and five single-word cells that are not autosized."
+      LayoutTable {TABLE} at (1,37) size 798x517 [border: none]
+        LayoutTableSection {TBODY} at (0,0) size 797x516
+          LayoutTableRow {TR} at (0,0) size 797x37
+            LayoutTableCell {TD} at (0,9) size 26x18 [bgcolor=#F0FFF0] [border: (1px dotted #006400)] [r=0 c=0 rs=1 cs=1]
+              LayoutText {#text} at (2,2) size 23x14
+                text run at (2,2) width 23: "hello"
+            LayoutTableCell {TD} at (26,0) size 745x37 [bgcolor=#F0FFF0] [border: (1px dotted #006400)] [r=0 c=1 rs=1 cs=1]
+              LayoutText {#text} at (2,2) size 60x33
+                text run at (2,2) width 60: "hello"
+            LayoutTableCell {TD} at (771,9) size 26x18 [bgcolor=#F0FFF0] [border: (1px dotted #006400)] [r=0 c=2 rs=1 cs=1]
+              LayoutText {#text} at (2,2) size 23x14
+                text run at (2,2) width 23: "hello"
+          LayoutTableRow {TR} at (0,37) size 797x479
+            LayoutTableCell {TD} at (0,267) size 26x18 [bgcolor=#F0FFF0] [border: (1px dotted #006400)] [r=1 c=0 rs=1 cs=1]
+              LayoutText {#text} at (2,2) size 23x14
+                text run at (2,2) width 23: "hello"
+            LayoutTableCell {TD} at (26,37) size 745x479 [bgcolor=#F0FFF0] [border: (1px dotted #006400)] [r=1 c=1 rs=1 cs=1]
+              LayoutText {#text} at (2,2) size 735x475
+                text run at (2,2) width 735: "hello hello hello hello hello hello hello hello hello hello hello"
+                text run at (2,36) width 735: "hello hello hello hello hello hello hello hello hello hello hello"
+                text run at (2,70) width 735: "hello hello hello hello hello hello hello hello hello hello hello"
+                text run at (2,104) width 735: "hello hello hello hello hello hello hello hello hello hello hello"
+                text run at (2,138) width 735: "hello hello hello hello hello hello hello hello hello hello hello"
+                text run at (2,172) width 735: "hello hello hello hello hello hello hello hello hello hello hello"
+                text run at (2,206) width 735: "hello hello hello hello hello hello hello hello hello hello hello"
+                text run at (2,240) width 735: "hello hello hello hello hello hello hello hello hello hello hello"
+                text run at (2,274) width 735: "hello hello hello hello hello hello hello hello hello hello hello"
+                text run at (2,308) width 735: "hello hello hello hello hello hello hello hello hello hello hello"
+                text run at (2,342) width 735: "hello hello hello hello hello hello hello hello hello hello hello"
+                text run at (2,376) width 735: "hello hello hello hello hello hello hello hello hello hello hello"
+                text run at (2,410) width 735: "hello hello hello hello hello hello hello hello hello hello hello"
+                text run at (2,444) width 600: "hello hello hello hello hello hello hello hello hello"
+            LayoutTableCell {TD} at (771,267) size 26x18 [bgcolor=#F0FFF0] [border: (1px dotted #006400)] [r=1 c=2 rs=1 cs=1]
+              LayoutText {#text} at (2,2) size 23x14
+                text run at (2,2) width 23: "hello"
diff --git a/third_party/WebKit/LayoutTests/platform/win7/fast/text-autosizing/tables/single-percent-width-cell-lots-of-text-expected.png b/third_party/WebKit/LayoutTests/platform/win7/fast/text-autosizing/tables/single-percent-width-cell-lots-of-text-expected.png
new file mode 100644
index 0000000..2a011c1c
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/win7/fast/text-autosizing/tables/single-percent-width-cell-lots-of-text-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win7/fast/text-autosizing/tables/single-percent-width-cell-lots-of-text-expected.txt b/third_party/WebKit/LayoutTests/platform/win7/fast/text-autosizing/tables/single-percent-width-cell-lots-of-text-expected.txt
new file mode 100644
index 0000000..14ebf5e
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/win7/fast/text-autosizing/tables/single-percent-width-cell-lots-of-text-expected.txt
@@ -0,0 +1,83 @@
+layer at (0,0) size 800x600 scrollHeight 1794
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x1794 backgroundClip at (0,0) size 800x600 clip at (0,0) size 800x600
+  LayoutBlockFlow {HTML} at (0,0) size 800x1794
+    LayoutBlockFlow {BODY} at (0,0) size 800x1793
+      LayoutBlockFlow {DIV} at (0,0) size 600x36
+        LayoutText {#text} at (0,0) size 308x14
+          text run at (0,0) width 308: "Table autosizing tests - single-percent-width-cell-lots-of-text.html"
+        LayoutBR {BR} at (307,0) size 1x14
+        LayoutText {#text} at (0,15) size 492x14
+          text run at (0,15) width 492: "This test passes if there is a one cell with lots of text that's autosized, and five cells that are not autosized."
+      LayoutTable {TABLE} at (1,37) size 798x1756 [border: none]
+        LayoutTableSection {TBODY} at (0,0) size 797x1755
+          LayoutTableRow {TR} at (0,0) size 797x18
+            LayoutTableCell {TD} at (0,0) size 279x18 [bgcolor=#F0FFF0] [border: (1px dotted #006400)] [r=0 c=0 rs=1 cs=1]
+              LayoutText {#text} at (2,2) size 23x14
+                text run at (2,2) width 23: "hello"
+            LayoutTableCell {TD} at (279,0) size 239x18 [bgcolor=#F0FFF0] [border: (1px dotted #006400)] [r=0 c=1 rs=1 cs=1]
+              LayoutText {#text} at (2,2) size 23x14
+                text run at (2,2) width 23: "hello"
+            LayoutTableCell {TD} at (518,0) size 279x18 [bgcolor=#F0FFF0] [border: (1px dotted #006400)] [r=0 c=2 rs=1 cs=1]
+              LayoutText {#text} at (2,2) size 23x14
+                text run at (2,2) width 23: "hello"
+          LayoutTableRow {TR} at (0,18) size 797x1737
+            LayoutTableCell {TD} at (0,877) size 279x18 [bgcolor=#F0FFF0] [border: (1px dotted #006400)] [r=1 c=0 rs=1 cs=1]
+              LayoutText {#text} at (2,2) size 23x14
+                text run at (2,2) width 23: "hello"
+            LayoutTableCell {TD} at (279,18) size 239x1737 [bgcolor=#F0FFF0] [border: (1px dotted #006400)] [r=1 c=1 rs=1 cs=1]
+              LayoutText {#text} at (2,2) size 195x1733
+                text run at (2,2) width 195: "hello hello hello"
+                text run at (2,36) width 195: "hello hello hello"
+                text run at (2,70) width 195: "hello hello hello"
+                text run at (2,104) width 195: "hello hello hello"
+                text run at (2,138) width 195: "hello hello hello"
+                text run at (2,172) width 195: "hello hello hello"
+                text run at (2,206) width 195: "hello hello hello"
+                text run at (2,240) width 195: "hello hello hello"
+                text run at (2,274) width 195: "hello hello hello"
+                text run at (2,308) width 195: "hello hello hello"
+                text run at (2,342) width 195: "hello hello hello"
+                text run at (2,376) width 195: "hello hello hello"
+                text run at (2,410) width 195: "hello hello hello"
+                text run at (2,444) width 195: "hello hello hello"
+                text run at (2,478) width 195: "hello hello hello"
+                text run at (2,512) width 195: "hello hello hello"
+                text run at (2,546) width 195: "hello hello hello"
+                text run at (2,580) width 195: "hello hello hello"
+                text run at (2,614) width 195: "hello hello hello"
+                text run at (2,648) width 195: "hello hello hello"
+                text run at (2,682) width 195: "hello hello hello"
+                text run at (2,716) width 195: "hello hello hello"
+                text run at (2,750) width 195: "hello hello hello"
+                text run at (2,784) width 195: "hello hello hello"
+                text run at (2,818) width 195: "hello hello hello"
+                text run at (2,852) width 195: "hello hello hello"
+                text run at (2,886) width 195: "hello hello hello"
+                text run at (2,920) width 195: "hello hello hello"
+                text run at (2,954) width 195: "hello hello hello"
+                text run at (2,988) width 195: "hello hello hello"
+                text run at (2,1022) width 195: "hello hello hello"
+                text run at (2,1056) width 195: "hello hello hello"
+                text run at (2,1090) width 195: "hello hello hello"
+                text run at (2,1124) width 195: "hello hello hello"
+                text run at (2,1158) width 195: "hello hello hello"
+                text run at (2,1192) width 195: "hello hello hello"
+                text run at (2,1226) width 195: "hello hello hello"
+                text run at (2,1260) width 195: "hello hello hello"
+                text run at (2,1294) width 195: "hello hello hello"
+                text run at (2,1328) width 195: "hello hello hello"
+                text run at (2,1362) width 195: "hello hello hello"
+                text run at (2,1396) width 195: "hello hello hello"
+                text run at (2,1430) width 195: "hello hello hello"
+                text run at (2,1464) width 195: "hello hello hello"
+                text run at (2,1498) width 195: "hello hello hello"
+                text run at (2,1532) width 195: "hello hello hello"
+                text run at (2,1566) width 195: "hello hello hello"
+                text run at (2,1600) width 195: "hello hello hello"
+                text run at (2,1634) width 195: "hello hello hello"
+                text run at (2,1668) width 195: "hello hello hello"
+                text run at (2,1702) width 128: "hello hello"
+            LayoutTableCell {TD} at (518,877) size 279x18 [bgcolor=#F0FFF0] [border: (1px dotted #006400)] [r=1 c=2 rs=1 cs=1]
+              LayoutText {#text} at (2,2) size 23x14
+                text run at (2,2) width 23: "hello"
diff --git a/third_party/WebKit/LayoutTests/platform/win7/fast/text-autosizing/tables/table-cell-inflation-expected.png b/third_party/WebKit/LayoutTests/platform/win7/fast/text-autosizing/tables/table-cell-inflation-expected.png
new file mode 100644
index 0000000..62a12d1b
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/win7/fast/text-autosizing/tables/table-cell-inflation-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win7/fast/text-autosizing/tables/table-cell-inflation-expected.txt b/third_party/WebKit/LayoutTests/platform/win7/fast/text-autosizing/tables/table-cell-inflation-expected.txt
new file mode 100644
index 0000000..5914669e
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/win7/fast/text-autosizing/tables/table-cell-inflation-expected.txt
@@ -0,0 +1,29 @@
+layer at (0,0) size 800x600
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x240
+  LayoutBlockFlow {HTML} at (0,0) size 800x240
+    LayoutBlockFlow {BODY} at (0,0) size 500x239
+      LayoutBlockFlow {DIV} at (0,0) size 600x36
+        LayoutText {#text} at (0,0) size 220x14
+          text run at (0,0) width 220: "Table autosizing tests - table-cell-inflation.html"
+        LayoutBR {BR} at (219,0) size 1x14
+        LayoutText {#text} at (0,15) size 357x14
+          text run at (0,15) width 357: "This test passes if there are no numbers overflowing outside this green box."
+      LayoutTable {TABLE} at (1,37) size 722x202 [border: none]
+        LayoutTableSection {TBODY} at (0,0) size 721x201
+          LayoutTableRow {TR} at (0,0) size 721x201
+            LayoutTableCell {TD} at (0,0) size 721x201 [bgcolor=#F0FFF0] [border: (1px dotted #006400)] [r=0 c=0 rs=1 cs=1]
+              LayoutText {#text} at (2,2) size 443x21
+                text run at (2,2) width 443: "The pi approximation below should not overrun this block."
+              LayoutBR {BR} at (444,2) size 1x21
+              LayoutText {#text} at (2,24) size 718x21
+                text run at (2,24) width 718: "3.141592653589793238462643383279502884197169399375105820974944592307816406286"
+              LayoutBR {BR} at (719,24) size 1x21
+              LayoutText {#text} at (2,46) size 713x153
+                text run at (2,46) width 713: "hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello"
+                text run at (2,68) width 713: "hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello"
+                text run at (2,90) width 713: "hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello"
+                text run at (2,112) width 713: "hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello"
+                text run at (2,134) width 713: "hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello"
+                text run at (2,156) width 713: "hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello"
+                text run at (2,178) width 249: "hello hello hello hello hello hello"
diff --git a/third_party/WebKit/LayoutTests/platform/win7/fast/text-autosizing/tables/table-for-layout-expected.png b/third_party/WebKit/LayoutTests/platform/win7/fast/text-autosizing/tables/table-for-layout-expected.png
new file mode 100644
index 0000000..a96744f
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/win7/fast/text-autosizing/tables/table-for-layout-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win7/fast/text-autosizing/tables/table-for-layout-expected.txt b/third_party/WebKit/LayoutTests/platform/win7/fast/text-autosizing/tables/table-for-layout-expected.txt
new file mode 100644
index 0000000..13a6752
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/win7/fast/text-autosizing/tables/table-for-layout-expected.txt
@@ -0,0 +1,55 @@
+layer at (0,0) size 800x600
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x400
+  LayoutBlockFlow {HTML} at (0,0) size 800x400
+    LayoutBlockFlow {BODY} at (0,0) size 800x399
+      LayoutBlockFlow {DIV} at (0,0) size 600x36
+        LayoutText {#text} at (0,0) size 207x14
+          text run at (0,0) width 207: "Table autosizing tests - table-for-layout.html"
+        LayoutBR {BR} at (206,0) size 1x14
+        LayoutText {#text} at (0,15) size 247x14
+          text run at (0,15) width 247: "This test passes if the main content area is autosized."
+      LayoutTable {TABLE} at (1,37) size 798x362 [border: none]
+        LayoutTableSection {TBODY} at (0,0) size 797x361
+          LayoutTableRow {TR} at (0,0) size 797x18
+            LayoutTableCell {TD} at (0,0) size 797x18 [bgcolor=#F0FFF0] [border: (1px dotted #006400)] [r=0 c=0 rs=1 cs=2]
+              LayoutText {#text} at (2,2) size 21x14
+                text run at (2,2) width 21: "Title"
+          LayoutTableRow {TR} at (0,18) size 797x343
+            LayoutTableCell {TD} at (0,128) size 52x123 [bgcolor=#F0FFF0] [border: (1px dotted #006400)] [r=1 c=0 rs=1 cs=1]
+              LayoutText {#text} at (2,2) size 23x14
+                text run at (2,2) width 23: "hello"
+              LayoutBR {BR} at (25,2) size 0x14
+              LayoutText {#text} at (2,17) size 49x14
+                text run at (2,17) width 49: "navigation"
+              LayoutBR {BR} at (51,17) size 0x14
+              LayoutText {#text} at (2,32) size 49x14
+                text run at (2,32) width 49: "navigation"
+              LayoutBR {BR} at (51,32) size 0x14
+              LayoutText {#text} at (2,47) size 49x14
+                text run at (2,47) width 49: "navigation"
+              LayoutBR {BR} at (51,47) size 0x14
+              LayoutText {#text} at (2,62) size 49x14
+                text run at (2,62) width 49: "navigation"
+              LayoutBR {BR} at (51,62) size 0x14
+              LayoutText {#text} at (2,77) size 49x14
+                text run at (2,77) width 49: "navigation"
+              LayoutBR {BR} at (51,77) size 0x14
+              LayoutText {#text} at (2,92) size 49x14
+                text run at (2,92) width 49: "navigation"
+              LayoutBR {BR} at (51,92) size 0x14
+              LayoutText {#text} at (2,107) size 49x14
+                text run at (2,107) width 49: "navigation"
+              LayoutBR {BR} at (51,107) size 0x14
+            LayoutTableCell {TD} at (52,18) size 745x343 [bgcolor=#F0FFF0] [border: (1px dotted #006400)] [r=1 c=1 rs=1 cs=1]
+              LayoutText {#text} at (2,2) size 735x339
+                text run at (2,2) width 735: "hello hello hello hello hello hello hello hello hello hello hello"
+                text run at (2,36) width 735: "hello hello hello hello hello hello hello hello hello hello hello"
+                text run at (2,70) width 735: "hello hello hello hello hello hello hello hello hello hello hello"
+                text run at (2,104) width 735: "hello hello hello hello hello hello hello hello hello hello hello"
+                text run at (2,138) width 735: "hello hello hello hello hello hello hello hello hello hello hello"
+                text run at (2,172) width 735: "hello hello hello hello hello hello hello hello hello hello hello"
+                text run at (2,206) width 735: "hello hello hello hello hello hello hello hello hello hello hello"
+                text run at (2,240) width 735: "hello hello hello hello hello hello hello hello hello hello hello"
+                text run at (2,274) width 735: "hello hello hello hello hello hello hello hello hello hello hello"
+                text run at (2,308) width 330: "hello hello hello hello hello"
diff --git a/third_party/WebKit/LayoutTests/platform/win7/fast/text-autosizing/tables/table-with-inline-block-expected.png b/third_party/WebKit/LayoutTests/platform/win7/fast/text-autosizing/tables/table-with-inline-block-expected.png
new file mode 100644
index 0000000..a57ce98
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/win7/fast/text-autosizing/tables/table-with-inline-block-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win7/fast/text-autosizing/tables/table-with-inline-block-expected.txt b/third_party/WebKit/LayoutTests/platform/win7/fast/text-autosizing/tables/table-with-inline-block-expected.txt
new file mode 100644
index 0000000..c3224c3
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/win7/fast/text-autosizing/tables/table-with-inline-block-expected.txt
@@ -0,0 +1,85 @@
+layer at (0,0) size 800x600 scrollHeight 1187
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x1187 backgroundClip at (0,0) size 800x600 clip at (0,0) size 800x600
+  LayoutBlockFlow {HTML} at (0,0) size 800x1187
+    LayoutBlockFlow {BODY} at (0,0) size 800x1186
+      LayoutBlockFlow {DIV} at (0,0) size 600x48
+        LayoutText {#text} at (0,0) size 332x17
+          text run at (0,0) width 332: "Table autosizing tests - table-with-inline-block.html"
+        LayoutBR {BR} at (331,0) size 1x17
+        LayoutText {#text} at (0,18) size 382x17
+          text run at (0,18) width 382: "This test passes if there is not extra space in the pink boxes."
+      LayoutTable {TABLE} at (1,49) size 798x286 [border: none]
+        LayoutTableSection {TBODY} at (0,0) size 797x285
+          LayoutTableRow {TR} at (0,0) size 797x285
+            LayoutTableCell {TD} at (0,0) size 797x285 [bgcolor=#F0FFF0] [border: (1px dotted #006400)] [r=0 c=0 rs=1 cs=1]
+              LayoutText {#text} at (2,3) size 751x139
+                text run at (2,3) width 751: "Autosize Autosize Autosize Autosize Autosize"
+                text run at (2,50) width 751: "Autosize Autosize Autosize Autosize Autosize"
+                text run at (2,97) width 609: "Autosize Autosize Autosize Autosize "
+              LayoutBlockFlow {B} at (610.75,119) size 90.22x18 [bgcolor=#FFC0CB]
+                LayoutText {#text} at (0,0) size 91x17
+                  text run at (0,0) width 91: "wrapped text"
+              LayoutText {#text} at (2,144) size 751x139
+                text run at (2,144) width 751: "Autosize Autosize Autosize Autosize Autosize"
+                text run at (2,191) width 751: "Autosize Autosize Autosize Autosize Autosize"
+                text run at (2,238) width 599: "Autosize Autosize Autosize Autosize"
+      LayoutTable {TABLE} at (1,336) size 147x850 [border: none]
+        LayoutTableSection {TBODY} at (0,0) size 146x849
+          LayoutTableRow {TR} at (0,0) size 146x849
+            LayoutTableCell {TD} at (0,0) size 146x849 [bgcolor=#F0FFF0] [border: (1px dotted #006400)] [r=0 c=0 rs=1 cs=1]
+              LayoutText {#text} at (2,3) size 143x45
+                text run at (2,3) width 143: "Autosize"
+              LayoutBR {BR} at (144,3) size 1x45
+              LayoutBlockFlow {B} at (2,72) size 94.38x18 [bgcolor=#FFC0CB]
+                LayoutText {#text} at (0,0) size 95x17
+                  text run at (0,0) width 95: "Wrapped text"
+              LayoutBR {BR} at (96,50) size 1x45
+              LayoutText {#text} at (2,97) size 143x45
+                text run at (2,97) width 143: "Autosize"
+              LayoutBR {BR} at (144,97) size 1x45
+              LayoutText {#text} at (2,144) size 143x45
+                text run at (2,144) width 143: "Autosize"
+              LayoutBR {BR} at (144,144) size 1x45
+              LayoutText {#text} at (2,191) size 143x45
+                text run at (2,191) width 143: "Autosize"
+              LayoutBR {BR} at (144,191) size 1x45
+              LayoutText {#text} at (2,238) size 143x45
+                text run at (2,238) width 143: "Autosize"
+              LayoutBR {BR} at (144,238) size 1x45
+              LayoutText {#text} at (2,285) size 143x45
+                text run at (2,285) width 143: "Autosize"
+              LayoutBR {BR} at (144,285) size 1x45
+              LayoutText {#text} at (2,332) size 143x45
+                text run at (2,332) width 143: "Autosize"
+              LayoutBR {BR} at (144,332) size 1x45
+              LayoutText {#text} at (2,379) size 143x45
+                text run at (2,379) width 143: "Autosize"
+              LayoutBR {BR} at (144,379) size 1x45
+              LayoutText {#text} at (2,426) size 143x45
+                text run at (2,426) width 143: "Autosize"
+              LayoutBR {BR} at (144,426) size 1x45
+              LayoutText {#text} at (2,473) size 143x45
+                text run at (2,473) width 143: "Autosize"
+              LayoutBR {BR} at (144,473) size 1x45
+              LayoutText {#text} at (2,520) size 143x45
+                text run at (2,520) width 143: "Autosize"
+              LayoutBR {BR} at (144,520) size 1x45
+              LayoutText {#text} at (2,567) size 143x45
+                text run at (2,567) width 143: "Autosize"
+              LayoutBR {BR} at (144,567) size 1x45
+              LayoutText {#text} at (2,614) size 143x45
+                text run at (2,614) width 143: "Autosize"
+              LayoutBR {BR} at (144,614) size 1x45
+              LayoutText {#text} at (2,661) size 143x45
+                text run at (2,661) width 143: "Autosize"
+              LayoutBR {BR} at (144,661) size 1x45
+              LayoutText {#text} at (2,708) size 143x45
+                text run at (2,708) width 143: "Autosize"
+              LayoutBR {BR} at (144,708) size 1x45
+              LayoutText {#text} at (2,755) size 143x45
+                text run at (2,755) width 143: "Autosize"
+              LayoutBR {BR} at (144,755) size 1x45
+              LayoutText {#text} at (2,802) size 143x45
+                text run at (2,802) width 143: "Autosize"
+              LayoutBR {BR} at (144,802) size 1x45
diff --git a/third_party/WebKit/LayoutTests/platform/win7/fast/text-autosizing/tables/wide-percentage-width-expected.png b/third_party/WebKit/LayoutTests/platform/win7/fast/text-autosizing/tables/wide-percentage-width-expected.png
new file mode 100644
index 0000000..b35ece2
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/win7/fast/text-autosizing/tables/wide-percentage-width-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win7/fast/text-autosizing/tables/wide-percentage-width-expected.txt b/third_party/WebKit/LayoutTests/platform/win7/fast/text-autosizing/tables/wide-percentage-width-expected.txt
new file mode 100644
index 0000000..4078ad22
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/win7/fast/text-autosizing/tables/wide-percentage-width-expected.txt
@@ -0,0 +1,38 @@
+layer at (0,0) size 800x600
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x199
+  LayoutBlockFlow {HTML} at (0,0) size 800x199
+    LayoutBlockFlow {BODY} at (0,0) size 800x198
+      LayoutBlockFlow {DIV} at (0,0) size 600x36
+        LayoutText {#text} at (0,0) size 243x14
+          text run at (0,0) width 243: "Table autosizing tests - wide-percentage-width.html"
+        LayoutBR {BR} at (242,0) size 1x14
+        LayoutText {#text} at (0,15) size 458x14
+          text run at (0,15) width 458: "This test passes if the cell with lots of text is autosized and none of the other 5 cells are autosized."
+      LayoutTable {TABLE} at (1,37) size 500x161 [border: none]
+        LayoutTableSection {TBODY} at (0,0) size 499x160
+          LayoutTableRow {TR} at (0,0) size 499x25
+            LayoutTableCell {TD} at (0,3) size 26x18 [bgcolor=#F0FFF0] [border: (1px dotted #006400)] [r=0 c=0 rs=1 cs=1]
+              LayoutText {#text} at (2,2) size 23x14
+                text run at (2,2) width 23: "hello"
+            LayoutTableCell {TD} at (26,0) size 447x25 [bgcolor=#F0FFF0] [border: (1px dotted #006400)] [r=0 c=1 rs=1 cs=1]
+              LayoutText {#text} at (2,2) size 38x21
+                text run at (2,2) width 38: "hello"
+            LayoutTableCell {TD} at (473,3) size 26x18 [bgcolor=#F0FFF0] [border: (1px dotted #006400)] [r=0 c=2 rs=1 cs=1]
+              LayoutText {#text} at (2,2) size 23x14
+                text run at (2,2) width 23: "hello"
+          LayoutTableRow {TR} at (0,25) size 499x135
+            LayoutTableCell {TD} at (0,83) size 26x18 [bgcolor=#F0FFF0] [border: (1px dotted #006400)] [r=1 c=0 rs=1 cs=1]
+              LayoutText {#text} at (2,2) size 23x14
+                text run at (2,2) width 23: "hello"
+            LayoutTableCell {TD} at (26,25) size 447x135 [bgcolor=#F0FFF0] [border: (1px dotted #006400)] [r=1 c=1 rs=1 cs=1]
+              LayoutText {#text} at (2,2) size 418x131
+                text run at (2,2) width 418: "hello hello hello hello hello hello hello hello hello hello"
+                text run at (2,24) width 418: "hello hello hello hello hello hello hello hello hello hello"
+                text run at (2,46) width 418: "hello hello hello hello hello hello hello hello hello hello"
+                text run at (2,68) width 418: "hello hello hello hello hello hello hello hello hello hello"
+                text run at (2,90) width 418: "hello hello hello hello hello hello hello hello hello hello"
+                text run at (2,112) width 80: "hello hello"
+            LayoutTableCell {TD} at (473,83) size 26x18 [bgcolor=#F0FFF0] [border: (1px dotted #006400)] [r=1 c=2 rs=1 cs=1]
+              LayoutText {#text} at (2,2) size 23x14
+                text run at (2,2) width 23: "hello"
diff --git a/third_party/WebKit/LayoutTests/platform/win7/fast/text-autosizing/tables/wide-specified-width-expected.png b/third_party/WebKit/LayoutTests/platform/win7/fast/text-autosizing/tables/wide-specified-width-expected.png
new file mode 100644
index 0000000..fe2232d
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/win7/fast/text-autosizing/tables/wide-specified-width-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win7/fast/text-autosizing/tables/wide-specified-width-expected.txt b/third_party/WebKit/LayoutTests/platform/win7/fast/text-autosizing/tables/wide-specified-width-expected.txt
new file mode 100644
index 0000000..8acbaa6
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/win7/fast/text-autosizing/tables/wide-specified-width-expected.txt
@@ -0,0 +1,38 @@
+layer at (0,0) size 800x600
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x199
+  LayoutBlockFlow {HTML} at (0,0) size 800x199
+    LayoutBlockFlow {BODY} at (0,0) size 800x198
+      LayoutBlockFlow {DIV} at (0,0) size 600x36
+        LayoutText {#text} at (0,0) size 235x14
+          text run at (0,0) width 235: "Table autosizing tests - wide-specified-width.html"
+        LayoutBR {BR} at (234,0) size 1x14
+        LayoutText {#text} at (0,15) size 458x14
+          text run at (0,15) width 458: "This test passes if the cell with lots of text is autosized and none of the other 5 cells are autosized."
+      LayoutTable {TABLE} at (1,37) size 500x161 [border: none]
+        LayoutTableSection {TBODY} at (0,0) size 499x160
+          LayoutTableRow {TR} at (0,0) size 499x25
+            LayoutTableCell {TD} at (0,3) size 26x18 [bgcolor=#F0FFF0] [border: (1px dotted #006400)] [r=0 c=0 rs=1 cs=1]
+              LayoutText {#text} at (2,2) size 23x14
+                text run at (2,2) width 23: "hello"
+            LayoutTableCell {TD} at (26,0) size 447x25 [bgcolor=#F0FFF0] [border: (1px dotted #006400)] [r=0 c=1 rs=1 cs=1]
+              LayoutText {#text} at (2,2) size 38x21
+                text run at (2,2) width 38: "hello"
+            LayoutTableCell {TD} at (473,3) size 26x18 [bgcolor=#F0FFF0] [border: (1px dotted #006400)] [r=0 c=2 rs=1 cs=1]
+              LayoutText {#text} at (2,2) size 23x14
+                text run at (2,2) width 23: "hello"
+          LayoutTableRow {TR} at (0,25) size 499x135
+            LayoutTableCell {TD} at (0,83) size 26x18 [bgcolor=#F0FFF0] [border: (1px dotted #006400)] [r=1 c=0 rs=1 cs=1]
+              LayoutText {#text} at (2,2) size 23x14
+                text run at (2,2) width 23: "hello"
+            LayoutTableCell {TD} at (26,25) size 447x135 [bgcolor=#F0FFF0] [border: (1px dotted #006400)] [r=1 c=1 rs=1 cs=1]
+              LayoutText {#text} at (2,2) size 418x131
+                text run at (2,2) width 418: "hello hello hello hello hello hello hello hello hello hello"
+                text run at (2,24) width 418: "hello hello hello hello hello hello hello hello hello hello"
+                text run at (2,46) width 418: "hello hello hello hello hello hello hello hello hello hello"
+                text run at (2,68) width 418: "hello hello hello hello hello hello hello hello hello hello"
+                text run at (2,90) width 418: "hello hello hello hello hello hello hello hello hello hello"
+                text run at (2,112) width 80: "hello hello"
+            LayoutTableCell {TD} at (473,83) size 26x18 [bgcolor=#F0FFF0] [border: (1px dotted #006400)] [r=1 c=2 rs=1 cs=1]
+              LayoutText {#text} at (2,2) size 23x14
+                text run at (2,2) width 23: "hello"
diff --git a/third_party/WebKit/LayoutTests/platform/win7/fast/text/atsui-kerning-and-ligatures-expected.png b/third_party/WebKit/LayoutTests/platform/win7/fast/text/atsui-kerning-and-ligatures-expected.png
new file mode 100644
index 0000000..cecfd5c
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/win7/fast/text/atsui-kerning-and-ligatures-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win7/fast/text/atsui-kerning-and-ligatures-expected.txt b/third_party/WebKit/LayoutTests/platform/win7/fast/text/atsui-kerning-and-ligatures-expected.txt
new file mode 100644
index 0000000..a10e65a
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/win7/fast/text/atsui-kerning-and-ligatures-expected.txt
@@ -0,0 +1,26 @@
+layer at (0,0) size 800x600
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  LayoutBlockFlow {HTML} at (0,0) size 800x600
+    LayoutBlockFlow {BODY} at (8,8) size 784x584
+      LayoutBlockFlow {P} at (0,0) size 784x36
+        LayoutText {#text} at (0,0) size 54x17
+          text run at (0,0) width 54: "Test for "
+        LayoutInline {I} at (0,0) size 759x35
+          LayoutText {#text} at (53,0) size 759x35
+            text run at (53,0) width 706: "http://bugzilla.opendarwin.org/show_bug.cgi?id=6137 Disable kerning and some ligatures in the ATSUI code"
+            text run at (0,18) width 29: "path"
+        LayoutText {#text} at (28,18) size 5x17
+          text run at (28,18) width 5: "."
+      LayoutBlockFlow {P} at (0,52) size 784x18
+        LayoutText {#text} at (0,0) size 720x17
+          text run at (0,0) width 720: "The word \x{201C}dolor\x{201D} below should be highlighted in its entirety. The highlight should not extend beyond that word."
+      LayoutBlockFlow {DIV} at (0,86) size 784x41
+        LayoutBlockFlow {HR} at (0,0) size 784x2 [border: (1px inset #EEEEEE)]
+        LayoutBlockFlow (anonymous) at (0,14) size 784x27
+          LayoutInline {SPAN} at (0,0) size 521x26
+            LayoutText {#text} at (0,0) size 521x26
+              text run at (0,0) width 521: "AVAVAVAVAVfififififififi Lorem ipsum dolor sit ame\x{300}t"
+          LayoutText {#text} at (0,0) size 0x0
+selection start: position 37 of child 0 {#text} of child 3 {SPAN} of child 5 {DIV} of body
+selection end:   position 42 of child 0 {#text} of child 3 {SPAN} of child 5 {DIV} of body
diff --git a/third_party/WebKit/LayoutTests/platform/win7/fast/text/atsui-multiple-renderers-expected.png b/third_party/WebKit/LayoutTests/platform/win7/fast/text/atsui-multiple-renderers-expected.png
index 318f9b1..d995f9c 100644
--- a/third_party/WebKit/LayoutTests/platform/win7/fast/text/atsui-multiple-renderers-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win7/fast/text/atsui-multiple-renderers-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win7/fast/text/atsui-multiple-renderers-expected.txt b/third_party/WebKit/LayoutTests/platform/win7/fast/text/atsui-multiple-renderers-expected.txt
new file mode 100644
index 0000000..57879e6
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/win7/fast/text/atsui-multiple-renderers-expected.txt
@@ -0,0 +1,101 @@
+layer at (0,0) size 800x600
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  LayoutBlockFlow {HTML} at (0,0) size 800x600
+    LayoutBlockFlow {BODY} at (8,8) size 784x576
+      LayoutBlockFlow {P} at (0,0) size 784x36
+        LayoutText {#text} at (0,0) size 108x17
+          text run at (0,0) width 108: "This is a test for "
+        LayoutInline {I} at (0,0) size 767x35
+          LayoutText {#text} at (107,0) size 767x35
+            text run at (107,0) width 660: "http://bugzilla.opendarwin.org/show_bug.cgi?id=6139 ATSUI code path should implement small caps,"
+            text run at (0,18) width 412: "synthetic bold and oblique and correct metrics for fallback fonts"
+        LayoutText {#text} at (411,18) size 5x17
+          text run at (411,18) width 5: "."
+      LayoutBlockFlow {HR} at (0,52) size 784x2 [border: (1px inset #EEEEEE)]
+      LayoutBlockFlow {P} at (0,70) size 784x18
+        LayoutText {#text} at (0,0) size 611x17
+          text run at (0,0) width 611: "The two columns should be identical except for the accent over the e and the umlaut over the u."
+      LayoutTable {TABLE} at (0,104) size 238x131 [border: none]
+        LayoutTableSection {TBODY} at (0,0) size 237x130
+          LayoutTableRow {TR} at (0,0) size 237x26
+            LayoutTableCell {TD} at (0,0) size 119x26 [border: (1px solid #008000)] [r=0 c=0 rs=1 cs=1]
+              LayoutText {#text} at (2,2) size 59x22
+                text run at (2,2) width 59: "Lore\x{300}m "
+              LayoutInline {SPAN} at (0,0) size 50x22
+                LayoutText {#text} at (60,2) size 50x22
+                  text run at (60,2) width 50: "ipsu\x{308}m"
+              LayoutText {#text} at (0,0) size 0x0
+            LayoutTableCell {TD} at (119,0) size 118x26 [border: (1px solid #008000)] [r=0 c=1 rs=1 cs=1]
+              LayoutText {#text} at (2,2) size 59x22
+                text run at (2,2) width 59: "Lorem "
+              LayoutInline {SPAN} at (0,0) size 50x22
+                LayoutText {#text} at (60,2) size 50x22
+                  text run at (60,2) width 50: "ipsum"
+              LayoutText {#text} at (0,0) size 0x0
+          LayoutTableRow {TR} at (0,26) size 237x26
+            LayoutTableCell {TD} at (0,26) size 119x26 [border: (1px solid #008000)] [r=1 c=0 rs=1 cs=1]
+              LayoutText {#text} at (2,2) size 63x22
+                text run at (2,2) width 63: "Lore\x{300}m "
+              LayoutInline {SPAN} at (0,0) size 53x22
+                LayoutText {#text} at (64,2) size 53x22
+                  text run at (64,2) width 53: "ipsu\x{308}m"
+              LayoutText {#text} at (0,0) size 0x0
+            LayoutTableCell {TD} at (119,26) size 118x26 [border: (1px solid #008000)] [r=1 c=1 rs=1 cs=1]
+              LayoutText {#text} at (2,2) size 63x22
+                text run at (2,2) width 63: "Lorem "
+              LayoutInline {SPAN} at (0,0) size 53x22
+                LayoutText {#text} at (64,2) size 53x22
+                  text run at (64,2) width 53: "ipsum"
+              LayoutText {#text} at (0,0) size 0x0
+          LayoutTableRow {TR} at (0,52) size 237x26
+            LayoutTableCell {TD} at (0,52) size 119x26 [border: (1px solid #008000)] [r=2 c=0 rs=1 cs=1]
+              LayoutText {#text} at (2,2) size 58x22
+                text run at (2,2) width 58: "Lore\x{300}m "
+              LayoutInline {SPAN} at (0,0) size 48x22
+                LayoutText {#text} at (59,2) size 48x22
+                  text run at (59,2) width 48: "ipsu\x{308}m"
+              LayoutText {#text} at (0,0) size 0x0
+            LayoutTableCell {TD} at (119,52) size 118x26 [border: (1px solid #008000)] [r=2 c=1 rs=1 cs=1]
+              LayoutText {#text} at (2,2) size 57x22
+                text run at (2,2) width 57: "Lorem "
+              LayoutInline {SPAN} at (0,0) size 49x22
+                LayoutText {#text} at (58,2) size 49x22
+                  text run at (58,2) width 49: "ipsum"
+              LayoutText {#text} at (0,0) size 0x0
+          LayoutTableRow {TR} at (0,78) size 237x26
+            LayoutTableCell {TD} at (0,78) size 119x26 [border: (1px solid #008000)] [r=3 c=0 rs=1 cs=1]
+              LayoutText {#text} at (2,2) size 60x22
+                text run at (2,2) width 60: "Lore\x{300}m "
+              LayoutInline {SPAN} at (0,0) size 51x22
+                LayoutText {#text} at (61,2) size 51x22
+                  text run at (61,2) width 51: "ipsu\x{308}m"
+              LayoutText {#text} at (0,0) size 0x0
+            LayoutTableCell {TD} at (119,78) size 118x26 [border: (1px solid #008000)] [r=3 c=1 rs=1 cs=1]
+              LayoutText {#text} at (2,2) size 60x22
+                text run at (2,2) width 60: "Lorem "
+              LayoutInline {SPAN} at (0,0) size 51x22
+                LayoutText {#text} at (61,2) size 51x22
+                  text run at (61,2) width 51: "ipsum"
+              LayoutText {#text} at (0,0) size 0x0
+          LayoutTableRow {TR} at (0,104) size 237x26
+            LayoutTableCell {TD} at (0,104) size 119x26 [border: (1px solid #008000)] [r=4 c=0 rs=1 cs=1]
+              LayoutText {#text} at (2,2) size 101x22
+                text run at (2,2) width 101: "Lore\x{300}m ipsu\x{308}m"
+            LayoutTableCell {TD} at (119,104) size 118x26 [border: (1px solid #008000)] [r=4 c=1 rs=1 cs=1]
+              LayoutText {#text} at (2,2) size 101x22
+                text run at (2,2) width 101: "Lorem ipsum"
+      LayoutBlockFlow {HR} at (0,243) size 784x2 [border: (1px inset #EEEEEE)]
+      LayoutBlockFlow {P} at (0,261) size 784x18
+        LayoutText {#text} at (0,0) size 283x17
+          text run at (0,0) width 283: "The following two lines should be identical."
+      LayoutBlockFlow {P} at (0,295) size 784x23
+        LayoutInline {SPAN} at (0,0) size 349x22 [border: (1px solid #008000)]
+          LayoutText {#text} at (1,2) size 347x20
+            text run at (1,2) width 347: "\x{E01}\x{E02}\x{E03}\x{E04}\x{E05}\x{E06}\x{E07}\x{E08}\x{E01}\x{E02}\x{E03}\x{E04}\x{E05}\x{E06}\x{E07}\x{E08}\x{E01}\x{E02}\x{E03}\x{E04}\x{E05}\x{E06}\x{E07}\x{E08}\x{E01}\x{E02}\x{E03}\x{E04}\x{E05}\x{E06}\x{E07}\x{E08}"
+        LayoutText {#text} at (0,0) size 0x0
+      LayoutBlockFlow {P} at (0,334) size 784x23
+        LayoutInline {SPAN} at (0,0) size 349x22 [border: (1px solid #008000)]
+          LayoutText {#text} at (1,2) size 347x20
+            text run at (1,2) width 347: "\x{E01}\x{E02}\x{E03}\x{E04}\x{E05}\x{E06}\x{E07}\x{E08}\x{E01}\x{E02}\x{E03}\x{E04}\x{E05}\x{E06}\x{E07}\x{E08}\x{E01}\x{E02}\x{E03}\x{E04}\x{E05}\x{E06}\x{E07}\x{E08}\x{E01}\x{E02}\x{E03}\x{E04}\x{E05}\x{E06}\x{E07}\x{E08}"
+        LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/win7/fast/text/atsui-negative-spacing-features-expected.png b/third_party/WebKit/LayoutTests/platform/win7/fast/text/atsui-negative-spacing-features-expected.png
new file mode 100644
index 0000000..956bf987
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/win7/fast/text/atsui-negative-spacing-features-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win7/fast/text/atsui-negative-spacing-features-expected.txt b/third_party/WebKit/LayoutTests/platform/win7/fast/text/atsui-negative-spacing-features-expected.txt
new file mode 100644
index 0000000..a78cab4
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/win7/fast/text/atsui-negative-spacing-features-expected.txt
@@ -0,0 +1,51 @@
+layer at (0,0) size 800x600
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x246
+  LayoutBlockFlow {HTML} at (0,0) size 800x246
+    LayoutBlockFlow {BODY} at (8,16) size 784x222
+      LayoutBlockFlow {P} at (0,0) size 784x18
+        LayoutText {#text} at (0,0) size 378x17
+          text run at (0,0) width 378: "Test for negative spacing values in complex text rendering."
+      LayoutBlockFlow (anonymous) at (0,34) size 784x18
+        LayoutText {#text} at (0,0) size 517x17
+          text run at (0,0) width 517: "Each green box should be identical to the blue box it follows, except for accents."
+      LayoutBlockFlow {HR} at (0,60) size 784x2 [border: (1px inset #EEEEEE)]
+      LayoutTable {TABLE} at (0,70) size 414x152
+        LayoutTableSection {TBODY} at (0,0) size 414x152
+          LayoutTableRow {TR} at (0,2) size 414x20
+            LayoutTableCell {TD} at (2,2) size 204x20 [r=0 c=0 rs=1 cs=1]
+              LayoutText {#text} at (57,1) size 89x17
+                text run at (57,1) width 89: "Word spacing"
+            LayoutTableCell {TD} at (208,2) size 204x20 [r=0 c=1 rs=1 cs=1]
+              LayoutText {#text} at (56,1) size 92x17
+                text run at (56,1) width 92: "Letter spacing"
+          LayoutTableRow {TR} at (0,24) size 414x126
+            LayoutTableCell {TD} at (2,24) size 204x126 [r=1 c=0 rs=1 cs=1]
+              LayoutBlockFlow {DIV} at (1,1) size 202x124
+                LayoutBlockFlow {DIV} at (0,0) size 202x38 [border: (1px solid #0000FF)]
+                  LayoutText {#text} at (27,1) size 174x35
+                    text run at (27,1) width 174 RTL: "\x{5D9}\x{5B0}\x{5D4}\x{5B4}\x{5D9}, \x{5D0}\x{5B8}\x{5D7}\x{5B4}\x{5D9}, \x{5DC}\x{5B0}\x{5DA}\x{5B8} \x{5E1}\x{5B5}\x{5E4}\x{5B6}\x{5E8} \x{5E9}\x{5C1}\x{5B0}\x{5DC}\x{5B7}\x{5D7}\x{5B0}\x{5EA}\x{5BC}\x{5B4}\x{5D9}\x{5D5} \x{5D5}\x{5BC}\x{5DE}\x{5B4}\x{5DE}\x{5B0}\x{5DB}\x{5BC}\x{5B6}\x{5E8}\x{5B6}\x{5EA}"
+                    text run at (100,19) width 101 RTL: "\x{5E6}\x{5B0}\x{5DE}\x{5B4}\x{5D9}\x{5EA}\x{5D5}\x{5BC}\x{5EA} \x{5DC}\x{5B8}\x{5DA}\x{5B0} \x{5DE}\x{5B0}\x{5DB}\x{5B7}\x{5E8}\x{5B0}\x{5EA}\x{5BC}\x{5B4}\x{5D9}\x{5D5}."
+                LayoutBlockFlow {DIV} at (0,43) size 202x38 [border: (1px solid #0000FF)]
+                  LayoutText {#text} at (1,1) size 175x35
+                    text run at (1,1) width 174: "Lore\x{300}m ipsum dolor sit ame\x{300}t,"
+                    text run at (1,19) width 175: "consectetuer adipiscing e\x{300}lit."
+                LayoutBlockFlow {DIV} at (0,86) size 202x38 [border: (1px solid #008000)]
+                  LayoutText {#text} at (1,1) size 175x35
+                    text run at (1,1) width 174: "Lorem ipsum dolor sit amet,"
+                    text run at (1,19) width 175: "consectetuer adipiscing elit."
+            LayoutTableCell {TD} at (208,24) size 204x126 [r=1 c=1 rs=1 cs=1]
+              LayoutBlockFlow {DIV} at (1,1) size 202x124
+                LayoutBlockFlow {DIV} at (0,0) size 202x38 [border: (1px solid #0000FF)]
+                  LayoutText {#text} at (10,1) size 191x35
+                    text run at (10,1) width 35 RTL: "\x{5E6}\x{5B0}\x{5DE}\x{5B4}\x{5D9}\x{5EA}\x{5D5}\x{5BC}\x{5EA}"
+                    text run at (44,1) width 157 RTL: "\x{5D9}\x{5B0}\x{5D4}\x{5B4}\x{5D9}, \x{5D0}\x{5B8}\x{5D7}\x{5B4}\x{5D9}, \x{5DC}\x{5B0}\x{5DA}\x{5B8} \x{5E1}\x{5B5}\x{5E4}\x{5B6}\x{5E8} \x{5E9}\x{5C1}\x{5B0}\x{5DC}\x{5B7}\x{5D7}\x{5B0}\x{5EA}\x{5BC}\x{5B4}\x{5D9}\x{5D5} \x{5D5}\x{5BC}\x{5DE}\x{5B4}\x{5DE}\x{5B0}\x{5DB}\x{5BC}\x{5B6}\x{5E8}\x{5B6}\x{5EA} "
+                    text run at (149,19) width 52 RTL: "\x{5DC}\x{5B8}\x{5DA}\x{5B0} \x{5DE}\x{5B0}\x{5DB}\x{5B7}\x{5E8}\x{5B0}\x{5EA}\x{5BC}\x{5B4}\x{5D9}\x{5D5}."
+                LayoutBlockFlow {DIV} at (0,43) size 202x38 [border: (1px solid #0000FF)]
+                  LayoutText {#text} at (1,1) size 155x35
+                    text run at (1,1) width 155: "Lore\x{300}m ipsum dolor sit ame\x{300}t,"
+                    text run at (1,19) width 150: "consectetue\x{300}r adipiscing e\x{300}lit."
+                LayoutBlockFlow {DIV} at (0,86) size 202x38 [border: (1px solid #008000)]
+                  LayoutText {#text} at (1,1) size 155x35
+                    text run at (1,1) width 155: "Lorem ipsum dolor sit amet,"
+                    text run at (1,19) width 150: "consectetuer adipiscing elit."
diff --git a/third_party/WebKit/LayoutTests/platform/win7/fast/text/atsui-spacing-features-expected.png b/third_party/WebKit/LayoutTests/platform/win7/fast/text/atsui-spacing-features-expected.png
new file mode 100644
index 0000000..425d078
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/win7/fast/text/atsui-spacing-features-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win7/fast/text/atsui-spacing-features-expected.txt b/third_party/WebKit/LayoutTests/platform/win7/fast/text/atsui-spacing-features-expected.txt
new file mode 100644
index 0000000..13ed13fc
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/win7/fast/text/atsui-spacing-features-expected.txt
@@ -0,0 +1,84 @@
+layer at (0,0) size 800x600
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x354
+  LayoutBlockFlow {HTML} at (0,0) size 800x354
+    LayoutBlockFlow {BODY} at (8,16) size 784x330
+      LayoutBlockFlow {P} at (0,0) size 784x36
+        LayoutText {#text} at (0,0) size 179x17
+          text run at (0,0) width 179: "Test for regressions against "
+        LayoutInline {I} at (0,0) size 772x35
+          LayoutInline {A} at (0,0) size 354x17 [color=#0000EE]
+            LayoutText {#text} at (178,0) size 354x17
+              text run at (178,0) width 354: "http://bugzilla.opendarwin.org/show_bug.cgi?id=3922"
+          LayoutText {#text} at (531,0) size 772x35
+            text run at (531,0) width 241: " Variable word/letter spacing and full"
+            text run at (0,18) width 328: "justification not supported for ATSUI-rendered text"
+        LayoutText {#text} at (327,18) size 5x17
+          text run at (327,18) width 5: "."
+      LayoutBlockFlow (anonymous) at (0,52) size 784x18
+        LayoutText {#text} at (0,0) size 517x17
+          text run at (0,0) width 517: "Each green box should be identical to the blue box it follows, except for accents."
+      LayoutBlockFlow {HR} at (0,78) size 784x2 [border: (1px inset #EEEEEE)]
+      LayoutTable {TABLE} at (0,88) size 620x242
+        LayoutTableSection {TBODY} at (0,0) size 620x242
+          LayoutTableRow {TR} at (0,2) size 620x20
+            LayoutTableCell {TD} at (2,2) size 204x20 [r=0 c=0 rs=1 cs=1]
+              LayoutText {#text} at (57,1) size 89x17
+                text run at (57,1) width 89: "Word spacing"
+            LayoutTableCell {TD} at (208,2) size 204x20 [r=0 c=1 rs=1 cs=1]
+              LayoutText {#text} at (56,1) size 92x17
+                text run at (56,1) width 92: "Letter spacing"
+            LayoutTableCell {TD} at (414,2) size 204x20 [r=0 c=2 rs=1 cs=1]
+              LayoutText {#text} at (62,1) size 80x17
+                text run at (62,1) width 80: "Justification"
+          LayoutTableRow {TR} at (0,24) size 620x216
+            LayoutTableCell {TD} at (2,24) size 204x162 [r=1 c=0 rs=1 cs=1]
+              LayoutBlockFlow {DIV} at (1,1) size 202x160
+                LayoutBlockFlow {DIV} at (0,0) size 202x38 [border: (1px solid #0000FF)]
+                  LayoutText {#text} at (24,1) size 182x35
+                    text run at (24,1) width 177 RTL: "\x{5D9}\x{5B0}\x{5D4}\x{5B4}\x{5D9}, \x{5D0}\x{5B8}\x{5D7}\x{5B4}\x{5D9}, \x{5DC}\x{5B0}\x{5DA}\x{5B8} \x{5E1}\x{5B5}\x{5E4}\x{5B6}\x{5E8} \x{5E9}\x{5C1}\x{5B0}\x{5DC}\x{5B7}\x{5D7}\x{5B0}\x{5EA}\x{5BC}\x{5B4}\x{5D9}\x{5D5}"
+                    text run at (19,19) width 126 RTL: "\x{5E6}\x{5B0}\x{5DE}\x{5B4}\x{5D9}\x{5EA}\x{5D5}\x{5BC}\x{5EA} \x{5DC}\x{5B8}\x{5DA}\x{5B0} \x{5DE}\x{5B0}\x{5DB}\x{5B7}\x{5E8}\x{5B0}\x{5EA}\x{5BC}\x{5B4}\x{5D9}\x{5D5}."
+                    text run at (144,19) width 57 RTL: "\x{5D5}\x{5BC}\x{5DE}\x{5B4}\x{5DE}\x{5B0}\x{5DB}\x{5BC}\x{5B6}\x{5E8}\x{5B6}\x{5EA} "
+                LayoutBlockFlow {DIV} at (0,43) size 202x56 [border: (1px solid #0000FF)]
+                  LayoutText {#text} at (1,1) size 173x53
+                    text run at (1,1) width 173: "Lore\x{300}m ipsum dolor sit"
+                    text run at (1,19) width 130: "ame\x{300}t, consectetuer"
+                    text run at (1,37) width 105: "adipiscing e\x{300}lit."
+                LayoutBlockFlow {DIV} at (0,104) size 202x56 [border: (1px solid #008000)]
+                  LayoutText {#text} at (1,1) size 173x53
+                    text run at (1,1) width 173: "Lorem ipsum dolor sit"
+                    text run at (1,19) width 130: "amet, consectetuer"
+                    text run at (1,37) width 105: "adipiscing elit."
+            LayoutTableCell {TD} at (208,24) size 204x216 [r=1 c=1 rs=1 cs=1]
+              LayoutBlockFlow {DIV} at (1,1) size 202x214
+                LayoutBlockFlow {DIV} at (0,0) size 202x56 [border: (1px solid #0000FF)]
+                  LayoutText {#text} at (29,1) size 190x53
+                    text run at (29,1) width 172 RTL: "\x{5D9}\x{5B0}\x{5D4}\x{5B4}\x{5D9}, \x{5D0}\x{5B8}\x{5D7}\x{5B4}\x{5D9}, \x{5DC}\x{5B0}\x{5DA}\x{5B8} \x{5E1}\x{5B5}\x{5E4}\x{5B6}\x{5E8}"
+                    text run at (48,19) width 153 RTL: "\x{5E9}\x{5C1}\x{5B0}\x{5DC}\x{5B7}\x{5D7}\x{5B0}\x{5EA}\x{5BC}\x{5B4}\x{5D9}\x{5D5} \x{5D5}\x{5BC}\x{5DE}\x{5B4}\x{5DE}\x{5B0}\x{5DB}\x{5BC}\x{5B6}\x{5E8}\x{5B6}\x{5EA}"
+                    text run at (11,37) width 190 RTL: "\x{5E6}\x{5B0}\x{5DE}\x{5B4}\x{5D9}\x{5EA}\x{5D5}\x{5BC}\x{5EA} \x{5DC}\x{5B8}\x{5DA}\x{5B0} \x{5DE}\x{5B0}\x{5DB}\x{5B7}\x{5E8}\x{5B0}\x{5EA}\x{5BC}\x{5B4}\x{5D9}\x{5D5}."
+                LayoutBlockFlow {DIV} at (0,61) size 202x74 [border: (1px solid #0000FF)]
+                  LayoutText {#text} at (1,1) size 175x71
+                    text run at (1,1) width 141: "Lore\x{300}m ipsum"
+                    text run at (1,19) width 167: "dolor sit ame\x{300}t,"
+                    text run at (1,37) width 140: "consectetue\x{300}r"
+                    text run at (1,55) width 175: "adipiscing e\x{300}lit."
+                LayoutBlockFlow {DIV} at (0,140) size 202x74 [border: (1px solid #008000)]
+                  LayoutText {#text} at (1,1) size 175x71
+                    text run at (1,1) width 141: "Lorem ipsum"
+                    text run at (1,19) width 167: "dolor sit amet,"
+                    text run at (1,37) width 140: "consectetuer"
+                    text run at (1,55) width 175: "adipiscing elit."
+            LayoutTableCell {TD} at (414,24) size 204x126 [r=1 c=2 rs=1 cs=1]
+              LayoutBlockFlow {DIV} at (1,1) size 202x124
+                LayoutBlockFlow {DIV} at (0,0) size 202x38 [border: (1px solid #0000FF)]
+                  LayoutText {#text} at (1,1) size 200x35
+                    text run at (1,1) width 200 RTL: "\x{5D9}\x{5B0}\x{5D4}\x{5B4}\x{5D9}, \x{5D0}\x{5B8}\x{5D7}\x{5B4}\x{5D9}, \x{5DC}\x{5B0}\x{5DA}\x{5B8} \x{5E1}\x{5B5}\x{5E4}\x{5B6}\x{5E8} \x{5E9}\x{5C1}\x{5B0}\x{5DC}\x{5B7}\x{5D7}\x{5B0}\x{5EA}\x{5BC}\x{5B4}\x{5D9}\x{5D5} \x{5D5}\x{5BC}\x{5DE}\x{5B4}\x{5DE}\x{5B0}\x{5DB}\x{5BC}\x{5B6}\x{5E8}\x{5B6}\x{5EA}"
+                    text run at (96,19) width 105 RTL: "\x{5E6}\x{5B0}\x{5DE}\x{5B4}\x{5D9}\x{5EA}\x{5D5}\x{5BC}\x{5EA} \x{5DC}\x{5B8}\x{5DA}\x{5B0} \x{5DE}\x{5B0}\x{5DB}\x{5B7}\x{5E8}\x{5B0}\x{5EA}\x{5BC}\x{5B4}\x{5D9}\x{5D5}."
+                LayoutBlockFlow {DIV} at (0,43) size 202x38 [border: (1px solid #0000FF)]
+                  LayoutText {#text} at (1,1) size 200x35
+                    text run at (1,1) width 200: "Lore\x{300}m ipsum dolor sit ame\x{300}t,"
+                    text run at (1,19) width 179: "consectetue\x{300}r adipiscing e\x{300}lit."
+                LayoutBlockFlow {DIV} at (0,86) size 202x38 [border: (1px solid #008000)]
+                  LayoutText {#text} at (1,1) size 200x35
+                    text run at (1,1) width 200: "Lorem ipsum dolor sit amet,"
+                    text run at (1,19) width 179: "consectetuer adipiscing elit."
diff --git a/third_party/WebKit/LayoutTests/platform/win7/fast/text/basic/011-expected.png b/third_party/WebKit/LayoutTests/platform/win7/fast/text/basic/011-expected.png
new file mode 100644
index 0000000..a074835
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/win7/fast/text/basic/011-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win7/fast/text/basic/011-expected.txt b/third_party/WebKit/LayoutTests/platform/win7/fast/text/basic/011-expected.txt
new file mode 100644
index 0000000..ae03f2a
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/win7/fast/text/basic/011-expected.txt
@@ -0,0 +1,27 @@
+layer at (0,0) size 800x600
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x142
+  LayoutBlockFlow {HTML} at (0,0) size 800x142
+    LayoutBlockFlow {BODY} at (8,8) size 784x126
+      LayoutBlockFlow {DIV} at (0,0) size 784x36
+        LayoutText {#text} at (0,0) size 103x17
+          text run at (0,0) width 103: "Select this text. "
+        LayoutInline {FONT} at (0,0) size 767x29
+          LayoutText {#text} at (102,5) size 767x29
+            text run at (102,5) width 84: "I am teeny and tiny. "
+            text run at (185,5) width 298: "I am going to have lots of text but each line should retain the big height. "
+            text run at (482,5) width 285: "If the lines shrink, it means that the root line box's height is not being"
+            text run at (0,23) width 114: "considered and that's wrong."
+        LayoutText {#text} at (0,0) size 0x0
+      LayoutBlockFlow {P} at (0,52) size 784x0
+      LayoutBlockFlow {DIV} at (0,52) size 784x74
+        LayoutInline {FONT} at (0,0) size 779x73
+          LayoutText {#text} at (0,0) size 432x36
+            text run at (0,0) width 432: "This text is absolutely enormous. "
+          LayoutInline {FONT} at (0,0) size 779x48
+            LayoutText {#text} at (431,20) size 779x48
+              text run at (431,20) width 85: "I am teeny and tiny. "
+              text run at (515,20) width 264: "I am going to have lots of text but each line should retain the big"
+              text run at (0,57) width 31: "height. "
+              text run at (31,57) width 409: "If the lines shrink, it means that the span's line box's height is not being considered and that's wrong."
+          LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/win7/fast/text/basic/013-expected.png b/third_party/WebKit/LayoutTests/platform/win7/fast/text/basic/013-expected.png
new file mode 100644
index 0000000..59f3312
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/win7/fast/text/basic/013-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win7/fast/text/basic/013-expected.txt b/third_party/WebKit/LayoutTests/platform/win7/fast/text/basic/013-expected.txt
new file mode 100644
index 0000000..e2767dc3
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/win7/fast/text/basic/013-expected.txt
@@ -0,0 +1,70 @@
+layer at (0,0) size 800x600
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x268
+  LayoutBlockFlow {HTML} at (0,0) size 800x267.88
+    LayoutBlockFlow {BODY} at (8,21.44) size 784x230.44
+      LayoutBlockFlow {H1} at (0,0) size 784x37
+        LayoutText {#text} at (0,0) size 529x36
+          text run at (0,0) width 529: "Letter spacing lost for emphasized text"
+      LayoutBlockFlow {P} at (0,58.44) size 784x36
+        LayoutText {#text} at (0,0) size 289x17
+          text run at (0,0) width 289: "This example demonstrates that text inside a "
+        LayoutInline {CODE} at (0,0) size 9x16
+          LayoutText {#text} at (288,2) size 9x16
+            text run at (288,2) width 9: "b"
+        LayoutText {#text} at (296,0) size 9x17
+          text run at (296,0) width 9: ", "
+        LayoutInline {CODE} at (0,0) size 9x16
+          LayoutText {#text} at (304,2) size 9x16
+            text run at (304,2) width 9: "i"
+        LayoutText {#text} at (312,0) size 9x17
+          text run at (312,0) width 9: ", "
+        LayoutInline {CODE} at (0,0) size 49x16
+          LayoutText {#text} at (320,2) size 49x16
+            text run at (320,2) width 49: "strong"
+        LayoutText {#text} at (368,0) size 22x17
+          text run at (368,0) width 22: " or "
+        LayoutInline {CODE} at (0,0) size 17x16
+          LayoutText {#text} at (389,2) size 17x16
+            text run at (389,2) width 17: "em"
+        LayoutText {#text} at (405,0) size 115x17
+          text run at (405,0) width 115: " element loses its "
+        LayoutInline {CODE} at (0,0) size 113x16
+          LayoutText {#text} at (519,2) size 113x16
+            text run at (519,2) width 113: "letter-spacing"
+        LayoutText {#text} at (631,0) size 750x35
+          text run at (631,0) width 119: " CSS attribute that"
+          text run at (0,18) width 348: "should be inherited. This was discovered in Safari 1.0."
+      LayoutBlockFlow {DIV} at (0,110.44) size 784x120
+        LayoutBlockFlow {P} at (0,0) size 784x18
+          LayoutText {#text} at (0,0) size 133x17
+            text run at (0,0) width 133: "Text inside "
+          LayoutInline {B} at (0,0) size 50x17
+            LayoutText {#text} at (132,0) size 50x17
+              text run at (132,0) width 50: "bold"
+          LayoutText {#text} at (181,0) size 103x17
+            text run at (181,0) width 103: " element."
+        LayoutBlockFlow {P} at (0,34) size 784x18
+          LayoutText {#text} at (0,0) size 133x17
+            text run at (0,0) width 133: "Text inside "
+          LayoutInline {STRONG} at (0,0) size 73x17
+            LayoutText {#text} at (132,0) size 73x17
+              text run at (132,0) width 73: "strong"
+          LayoutText {#text} at (204,0) size 102x17
+            text run at (204,0) width 102: " element."
+        LayoutBlockFlow {P} at (0,68) size 784x18
+          LayoutText {#text} at (0,0) size 133x17
+            text run at (0,0) width 133: "Text inside "
+          LayoutInline {I} at (0,0) size 62x17
+            LayoutText {#text} at (132,0) size 62x17
+              text run at (132,0) width 62: "italic"
+          LayoutText {#text} at (193,0) size 103x17
+            text run at (193,0) width 103: " element."
+        LayoutBlockFlow {P} at (0,102) size 784x18
+          LayoutText {#text} at (0,0) size 133x17
+            text run at (0,0) width 133: "Text inside "
+          LayoutInline {EM} at (0,0) size 98x17
+            LayoutText {#text} at (132,0) size 98x17
+              text run at (132,0) width 98: "emphasis"
+          LayoutText {#text} at (229,0) size 103x17
+            text run at (229,0) width 103: " element."
diff --git a/third_party/WebKit/LayoutTests/platform/win7/fast/text/basic/generic-family-changes-expected.png b/third_party/WebKit/LayoutTests/platform/win7/fast/text/basic/generic-family-changes-expected.png
new file mode 100644
index 0000000..4105e4bb
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/win7/fast/text/basic/generic-family-changes-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win7/fast/text/basic/generic-family-changes-expected.txt b/third_party/WebKit/LayoutTests/platform/win7/fast/text/basic/generic-family-changes-expected.txt
new file mode 100644
index 0000000..2c80771
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/win7/fast/text/basic/generic-family-changes-expected.txt
@@ -0,0 +1,43 @@
+layer at (0,0) size 800x600
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x306
+  LayoutBlockFlow {HTML} at (0,0) size 800x306
+    LayoutBlockFlow {BODY} at (8,8) size 784x282
+      LayoutBlockFlow (anonymous) at (0,0) size 784x54
+        LayoutText {#text} at (0,0) size 756x53
+          text run at (0,0) width 539: "Tests of WebKit's intepretation of font sizes when no absolute font size is specified. "
+          text run at (538,0) width 218: "Percentages and logical keywords"
+          text run at (0,18) width 203: "scale to reflect the family type. "
+          text run at (202,18) width 539: "Opera 9 matches this behavior as well (except it has a bug with multiple font-family"
+          text run at (0,36) width 217: "mappings as in the first example)."
+      LayoutBlockFlow {PRE} at (0,67) size 784x16
+        LayoutInline {SPAN} at (0,0) size 120x16
+          LayoutText {#text} at (0,0) size 120x16
+            text run at (0,0) width 120: "Should be 13 px"
+      LayoutBlockFlow {PRE} at (0,96) size 784x16
+        LayoutInline {SPAN} at (0,0) size 86x15
+          LayoutText {#text} at (0,0) size 86x15
+            text run at (0,0) width 86: "Should be 13px"
+      LayoutBlockFlow {PRE} at (0,125) size 784x16
+        LayoutInline {SPAN} at (0,0) size 86x15
+          LayoutText {#text} at (0,0) size 86x15
+            text run at (0,0) width 86: "Should be 13px"
+      LayoutBlockFlow {P} at (0,157) size 784x18
+        LayoutInline {SPAN} at (0,0) size 86x15
+          LayoutText {#text} at (0,2) size 86x15
+            text run at (0,2) width 86: "Should be 13px"
+      LayoutBlockFlow {P} at (0,191) size 784x19
+        LayoutInline {TT} at (0,0) size 101x18
+          LayoutInline {SPAN} at (0,0) size 101x17
+            LayoutText {#text} at (0,0) size 101x17
+              text run at (0,0) width 101: "Should be 16px"
+      LayoutBlockFlow {P} at (0,226) size 784x18
+        LayoutInline {TT} at (0,0) size 101x16
+          LayoutInline {SPAN} at (0,0) size 101x17
+            LayoutText {#text} at (0,0) size 101x17
+              text run at (0,0) width 101: "Should be 16px"
+      LayoutBlockFlow {P} at (0,260) size 784x22
+        LayoutInline {TT} at (0,0) size 121x16
+          LayoutInline {SPAN} at (0,0) size 121x21
+            LayoutText {#text} at (0,0) size 121x21
+              text run at (0,0) width 121: "Should be 19px"
diff --git a/third_party/WebKit/LayoutTests/platform/win7/fast/text/capitalize-boundaries-expected.png b/third_party/WebKit/LayoutTests/platform/win7/fast/text/capitalize-boundaries-expected.png
new file mode 100644
index 0000000..9ad8303
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/win7/fast/text/capitalize-boundaries-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win7/fast/text/capitalize-boundaries-expected.txt b/third_party/WebKit/LayoutTests/platform/win7/fast/text/capitalize-boundaries-expected.txt
new file mode 100644
index 0000000..d31001b
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/win7/fast/text/capitalize-boundaries-expected.txt
@@ -0,0 +1,330 @@
+layer at (0,0) size 800x600 clip at (0,0) size 785x600 scrollHeight 1279
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 785x1279 backgroundClip at (0,0) size 785x600 clip at (0,0) size 785x600
+  LayoutBlockFlow {HTML} at (0,0) size 785x1279
+    LayoutBlockFlow {BODY} at (8,8) size 769x1263
+      LayoutBlockFlow (anonymous) at (0,0) size 769x90
+        LayoutText {#text} at (0,0) size 352x17
+          text run at (0,0) width 352: "This test was provided by open-source contributors on "
+        LayoutInline {A} at (0,0) size 56x17 [color=#0000EE]
+          LayoutText {#text} at (351,0) size 56x17
+            text run at (351,0) width 56: "Bugzilla"
+        LayoutText {#text} at (406,0) size 757x71
+          text run at (406,0) width 327: ". Currently, the \"Browser rendering\" results are not"
+          text run at (0,18) width 757: "expected to match the \"Correct output sample\" results. In fact, I do not entirely agree with all of the given test cases in"
+          text run at (0,36) width 744: "terms of their expected results, nor do I think that the browser should yet be expected to match all of the cases in the"
+          text run at (0,54) width 189: "different languages, but I am "
+          text run at (188,54) width 293: "(at least temporarily) adding the test anyway. "
+        LayoutBR {BR} at (480,68) size 1x0
+        LayoutBR {BR} at (0,72) size 0x17
+      LayoutTable {TABLE} at (0,90) size 769x391
+        LayoutBlockFlow {CAPTION} at (0,0) size 769x18
+          LayoutText {#text} at (344,0) size 81x17
+            text run at (344,0) width 81: "Input source"
+        LayoutTableSection {TBODY} at (0,18) size 769x373
+          LayoutTableRow {TR} at (0,2) size 769x58
+            LayoutTableCell {TH} at (2,20) size 54x22 [bgcolor=#F8F8F8] [border: (1px solid #EEEEEE)] [r=0 c=0 rs=1 cs=1]
+              LayoutText {#text} at (2,2) size 50x17
+                text run at (2,2) width 50: "generic"
+            LayoutTableCell {TD} at (58,2) size 709x58 [border: (1px solid #EEEEEE)] [r=0 c=1 rs=1 cs=1]
+              LayoutText {#text} at (2,2) size 689x53
+                text run at (2,2) width 689: "lip\x{AD}smackin\x{AD}thirst\x{AD}quenchin\x{AD}acetastin\x{AD}motivatin\x{AD}good\x{AD}buzzin\x{AD}cool\x{AD}talkin\x{AD}high\x{AD}walkin\x{AD}fast\x{AD}livin\x{AD}ever\x{AD}givin\x{AD}cool\x{AD}fizzin\x{AD}lip\x{AD}" + hyphen string "-"
+                text run at (2,20) width 672: "smackin\x{AD}thirst\x{AD}quenchin\x{AD}acetastin\x{AD}motivatin\x{AD}good\x{AD}buzzin\x{AD}cool\x{AD}talkin\x{AD}high\x{AD}walkin\x{AD}fast\x{AD}livin\x{AD}ever\x{AD}givin\x{AD}cool\x{AD}fizzin\x{AD}lip\x{AD}" + hyphen string "-"
+                text run at (2,38) width 650: "smackin\x{AD}thirst\x{AD}quenchin\x{AD}acetastin\x{AD}motivatin\x{AD}good\x{AD}buzzin\x{AD}cool\x{AD}talkin\x{AD}high\x{AD}walkin\x{AD}fast\x{AD}livin\x{AD}ever\x{AD}givin\x{AD}cool\x{AD}fizzin"
+          LayoutTableRow {TR} at (0,62) size 769x22
+            LayoutTableCell {TH} at (2,62) size 54x22 [bgcolor=#F8F8F8] [border: (1px solid #EEEEEE)] [r=1 c=0 rs=1 cs=1]
+              LayoutText {#text} at (19,2) size 16x17
+                text run at (19,2) width 16: "cy"
+            LayoutTableCell {TD} at (58,62) size 709x22 [border: (1px solid #EEEEEE)] [r=1 c=1 rs=1 cs=1]
+              LayoutText {#text} at (2,2) size 24x17
+                text run at (2,2) width 24: "\x{175}yl"
+          LayoutTableRow {TR} at (0,86) size 769x29
+            LayoutTableCell {TH} at (2,89) size 54x22 [bgcolor=#F8F8F8] [border: (1px solid #EEEEEE)] [r=2 c=0 rs=1 cs=1]
+              LayoutText {#text} at (21,2) size 12x17
+                text run at (21,2) width 12: "el"
+            LayoutTableCell {TD} at (58,86) size 709x29 [border: (1px solid #EEEEEE)] [r=2 c=1 rs=1 cs=1]
+              LayoutText {#text} at (2,6) size 204x17
+                text run at (2,6) width 204: "\x{3B3}\x{3B5}\x{3C9}\x{3B3}\x{3C1}\x{3B1}\x{3C6}\x{3B9}\x{3BA}\x{3AC}\x{2010}\x{3C3}\x{3C5}\x{3C3}\x{3C7}\x{3B5}\x{3C4}\x{3B9}\x{3C3}\x{3BC}\x{3AD}\x{3BD}\x{3B5}\x{3C2} \x{3AE}\x{3C4}\x{3B1}"
+          LayoutTableRow {TR} at (0,117) size 769x72
+            LayoutTableCell {TH} at (2,142) size 54x22 [bgcolor=#F8F8F8] [border: (1px solid #EEEEEE)] [r=3 c=0 rs=1 cs=1]
+              LayoutText {#text} at (19,2) size 16x17
+                text run at (19,2) width 16: "en"
+            LayoutTableCell {TD} at (58,117) size 709x72 [border: (1px solid #EEEEEE)] [r=3 c=1 rs=1 cs=1]
+              LayoutText {#text} at (2,6) size 437x17
+                text run at (2,6) width 437: "'cept nut'in safari\x{2019}s \x{2018}sure\x{2019} nai\x{308}ve r\x{E9}sum\x{E9}\x{2014}h\x{E1}c\x{30C}ek full\x{2010}time one-to-one"
+              LayoutBR {BR} at (438,20) size 1x0
+              LayoutText {#text} at (2,31) size 317x17
+                text run at (2,31) width 317: "\"newcastle\x{2011}upon\x{2011}tyne\" washington\x{2011}on\x{2011}the\x{2011}brazos"
+              LayoutBR {BR} at (318,45) size 1x0
+              LayoutInline {SPAN} at (0,0) size 32x17
+                LayoutText {#text} at (2,52) size 32x17
+                  text run at (2,52) width 32: "earth"
+              LayoutText {#text} at (33,52) size 76x17
+                text run at (33,52) width 76: "quake earth"
+              LayoutInline {SPAN} at (0,0) size 38x17
+                LayoutText {#text} at (108,52) size 38x17
+                  text run at (108,52) width 38: "worm"
+              LayoutText {#text} at (145,52) size 5x17
+                text run at (145,52) width 5: " "
+              LayoutInline {SPAN} at (0,0) size 44x17
+                LayoutText {#text} at (149,52) size 44x17
+                  text run at (149,52) width 44: "cheese"
+              LayoutInline {SPAN} at (0,0) size 42x17
+                LayoutText {#text} at (192,52) size 42x17
+                  text run at (192,52) width 42: "burger"
+              LayoutText {#text} at (233,52) size 119x17
+                text run at (233,52) width 119: " [house] ~six -big-"
+          LayoutTableRow {TR} at (0,191) size 769x22
+            LayoutTableCell {TH} at (2,191) size 54x22 [bgcolor=#F8F8F8] [border: (1px solid #EEEEEE)] [r=4 c=0 rs=1 cs=1]
+              LayoutText {#text} at (20,2) size 14x17
+                text run at (20,2) width 14: "es"
+            LayoutTableCell {TD} at (58,191) size 709x22 [border: (1px solid #EEEEEE)] [r=4 c=1 rs=1 cs=1]
+              LayoutText {#text} at (2,2) size 65x17
+                text run at (2,2) width 65: "\x{A1}jalape\x{F1}o!"
+          LayoutTableRow {TR} at (0,215) size 769x29
+            LayoutTableCell {TH} at (2,218) size 54x22 [bgcolor=#F8F8F8] [border: (1px solid #EEEEEE)] [r=5 c=0 rs=1 cs=1]
+              LayoutText {#text} at (20,2) size 14x17
+                text run at (20,2) width 14: "fr"
+            LayoutTableCell {TD} at (58,215) size 709x29 [border: (1px solid #EEEEEE)] [r=5 c=1 rs=1 cs=1]
+              LayoutText {#text} at (2,6) size 211x17
+                text run at (2,6) width 211: "quelqu'un l\x{2019}amour t'appelles\x{2011}tu 3"
+              LayoutInline {SUP} at (0,0) size 23x15
+                LayoutText {#text} at (212,2) size 23x15
+                  text run at (212,2) width 23: "eme"
+          LayoutTableRow {TR} at (0,246) size 769x29
+            LayoutTableCell {TH} at (2,249) size 54x22 [bgcolor=#F8F8F8] [border: (1px solid #EEEEEE)] [r=6 c=0 rs=1 cs=1]
+              LayoutText {#text} at (18,2) size 18x17
+                text run at (18,2) width 18: "hu"
+            LayoutTableCell {TD} at (58,246) size 709x29 [border: (1px solid #EEEEEE)] [r=6 c=1 rs=1 cs=1]
+              LayoutText {#text} at (2,6) size 110x17
+                text run at (2,6) width 110: "11-ei london\x{2011}ban"
+          LayoutTableRow {TR} at (0,277) size 769x22
+            LayoutTableCell {TH} at (2,277) size 54x22 [bgcolor=#F8F8F8] [border: (1px solid #EEEEEE)] [r=7 c=0 rs=1 cs=1]
+              LayoutText {#text} at (20,2) size 14x17
+                text run at (20,2) width 14: "nl"
+            LayoutTableCell {TD} at (58,277) size 709x22 [border: (1px solid #EEEEEE)] [r=7 c=1 rs=1 cs=1]
+              LayoutText {#text} at (2,2) size 70x17
+                text run at (2,2) width 70: "'s ochtends"
+          LayoutTableRow {TR} at (0,301) size 769x22
+            LayoutTableCell {TH} at (2,301) size 54x22 [bgcolor=#F8F8F8] [border: (1px solid #EEEEEE)] [r=8 c=0 rs=1 cs=1]
+              LayoutText {#text} at (20,2) size 14x17
+                text run at (20,2) width 14: "pl"
+            LayoutTableCell {TD} at (58,301) size 709x22 [border: (1px solid #EEEEEE)] [r=8 c=1 rs=1 cs=1]
+              LayoutText {#text} at (2,2) size 94x17
+                text run at (2,2) width 94: "wzi\x{119}\x{142}a bie\x{17C}\x{105}ce"
+          LayoutTableRow {TR} at (0,325) size 769x22
+            LayoutTableCell {TH} at (2,325) size 54x22 [bgcolor=#F8F8F8] [border: (1px solid #EEEEEE)] [r=9 c=0 rs=1 cs=1]
+              LayoutText {#text} at (19,2) size 16x17
+                text run at (19,2) width 16: "ru"
+            LayoutTableCell {TD} at (58,325) size 709x22 [border: (1px solid #EEEEEE)] [r=9 c=1 rs=1 cs=1]
+              LayoutText {#text} at (2,2) size 195x17
+                text run at (2,2) width 195: "\x{43D}\x{44C}\x{44E}-\x{439}\x{43E}\x{440}\x{43A} 1990-\x{445} 14-vii-1789"
+          LayoutTableRow {TR} at (0,349) size 769x22
+            LayoutTableCell {TH} at (2,349) size 54x22 [bgcolor=#F8F8F8] [border: (1px solid #EEEEEE)] [r=10 c=0 rs=1 cs=1]
+              LayoutText {#text} at (17,2) size 20x17
+                text run at (17,2) width 20: "tlh"
+            LayoutTableCell {TD} at (58,349) size 709x22 [border: (1px solid #EEEEEE)] [r=10 c=1 rs=1 cs=1]
+              LayoutText {#text} at (2,2) size 189x17
+                text run at (2,2) width 189: "tlhIngan Hol wa''uy' loghqam"
+      LayoutTable {TABLE} at (0,481) size 769x391
+        LayoutBlockFlow {CAPTION} at (0,0) size 769x18
+          LayoutText {#text} at (313,0) size 143x17
+            text run at (313,0) width 143: "Correct output sample"
+        LayoutTableSection {TBODY} at (0,18) size 769x373
+          LayoutTableRow {TR} at (0,2) size 769x58
+            LayoutTableCell {TH} at (2,20) size 54x22 [bgcolor=#F8F8F8] [border: (1px solid #EEEEEE)] [r=0 c=0 rs=1 cs=1]
+              LayoutText {#text} at (2,2) size 50x17
+                text run at (2,2) width 50: "generic"
+            LayoutTableCell {TD} at (58,2) size 709x58 [border: (1px solid #EEEEEE)] [r=0 c=1 rs=1 cs=1]
+              LayoutText {#text} at (2,2) size 694x53
+                text run at (2,2) width 694: "Lip\x{AD}smackin\x{AD}thirst\x{AD}quenchin\x{AD}acetastin\x{AD}motivatin\x{AD}good\x{AD}buzzin\x{AD}cool\x{AD}talkin\x{AD}high\x{AD}walkin\x{AD}fast\x{AD}livin\x{AD}ever\x{AD}givin\x{AD}cool\x{AD}fizzin\x{AD}lip\x{AD}" + hyphen string "-"
+                text run at (2,20) width 672: "smackin\x{AD}thirst\x{AD}quenchin\x{AD}acetastin\x{AD}motivatin\x{AD}good\x{AD}buzzin\x{AD}cool\x{AD}talkin\x{AD}high\x{AD}walkin\x{AD}fast\x{AD}livin\x{AD}ever\x{AD}givin\x{AD}cool\x{AD}fizzin\x{AD}lip\x{AD}" + hyphen string "-"
+                text run at (2,38) width 650: "smackin\x{AD}thirst\x{AD}quenchin\x{AD}acetastin\x{AD}motivatin\x{AD}good\x{AD}buzzin\x{AD}cool\x{AD}talkin\x{AD}high\x{AD}walkin\x{AD}fast\x{AD}livin\x{AD}ever\x{AD}givin\x{AD}cool\x{AD}fizzin"
+          LayoutTableRow {TR} at (0,62) size 769x22
+            LayoutTableCell {TH} at (2,62) size 54x22 [bgcolor=#F8F8F8] [border: (1px solid #EEEEEE)] [r=1 c=0 rs=1 cs=1]
+              LayoutText {#text} at (19,2) size 16x17
+                text run at (19,2) width 16: "cy"
+            LayoutTableCell {TD} at (58,62) size 709x22 [border: (1px solid #EEEEEE)] [r=1 c=1 rs=1 cs=1]
+              LayoutText {#text} at (2,2) size 28x17
+                text run at (2,2) width 28: "\x{174}yl"
+          LayoutTableRow {TR} at (0,86) size 769x29
+            LayoutTableCell {TH} at (2,89) size 54x22 [bgcolor=#F8F8F8] [border: (1px solid #EEEEEE)] [r=2 c=0 rs=1 cs=1]
+              LayoutText {#text} at (21,2) size 12x17
+                text run at (21,2) width 12: "el"
+            LayoutTableCell {TD} at (58,86) size 709x29 [border: (1px solid #EEEEEE)] [r=2 c=1 rs=1 cs=1]
+              LayoutText {#text} at (2,6) size 212x17
+                text run at (2,6) width 212: "\x{393}\x{3B5}\x{3C9}\x{3B3}\x{3C1}\x{3B1}\x{3C6}\x{3B9}\x{3BA}\x{3AC}\x{2010}\x{3A3}\x{3C5}\x{3C3}\x{3C7}\x{3B5}\x{3C4}\x{3B9}\x{3C3}\x{3BC}\x{3AD}\x{3BD}\x{3B5}\x{3C2} \x{389}\x{3C4}\x{3B1}"
+          LayoutTableRow {TR} at (0,117) size 769x72
+            LayoutTableCell {TH} at (2,142) size 54x22 [bgcolor=#F8F8F8] [border: (1px solid #EEEEEE)] [r=3 c=0 rs=1 cs=1]
+              LayoutText {#text} at (19,2) size 16x17
+                text run at (19,2) width 16: "en"
+            LayoutTableCell {TD} at (58,117) size 709x72 [border: (1px solid #EEEEEE)] [r=3 c=1 rs=1 cs=1]
+              LayoutText {#text} at (2,6) size 472x17
+                text run at (2,6) width 472: "'Cept Nut'in Safari\x{2019}s \x{2018}Sure\x{2019} Na\x{EF}ve R\x{E9}sum\x{E9}\x{2014}H\x{E1}\x{10D}ek Full\x{2010}time One-to-One"
+              LayoutBR {BR} at (473,20) size 1x0
+              LayoutText {#text} at (2,31) size 330x17
+                text run at (2,31) width 330: "\"Newcastle-upon-Tyne\" Washington\x{2011}on\x{2011}the\x{2011}Brazos"
+              LayoutBR {BR} at (331,45) size 1x0
+              LayoutText {#text} at (2,52) size 368x17
+                text run at (2,52) width 368: "Earthquake Earthworm Cheeseburger [House] ~Six -Big-"
+          LayoutTableRow {TR} at (0,191) size 769x22
+            LayoutTableCell {TH} at (2,191) size 54x22 [bgcolor=#F8F8F8] [border: (1px solid #EEEEEE)] [r=4 c=0 rs=1 cs=1]
+              LayoutText {#text} at (20,2) size 14x17
+                text run at (20,2) width 14: "es"
+            LayoutTableCell {TD} at (58,191) size 709x22 [border: (1px solid #EEEEEE)] [r=4 c=1 rs=1 cs=1]
+              LayoutText {#text} at (2,2) size 67x17
+                text run at (2,2) width 67: "\x{A1}Jalape\x{F1}o!"
+          LayoutTableRow {TR} at (0,215) size 769x29
+            LayoutTableCell {TH} at (2,218) size 54x22 [bgcolor=#F8F8F8] [border: (1px solid #EEEEEE)] [r=5 c=0 rs=1 cs=1]
+              LayoutText {#text} at (20,2) size 14x17
+                text run at (20,2) width 14: "fr"
+            LayoutTableCell {TD} at (58,215) size 709x29 [border: (1px solid #EEEEEE)] [r=5 c=1 rs=1 cs=1]
+              LayoutText {#text} at (2,6) size 228x17
+                text run at (2,6) width 228: "Quelqu'un l\x{2019}Amour t'Appelles\x{2011}Tu 3"
+              LayoutInline {SUP} at (0,0) size 23x15
+                LayoutText {#text} at (229,2) size 23x15
+                  text run at (229,2) width 23: "eme"
+          LayoutTableRow {TR} at (0,246) size 769x29
+            LayoutTableCell {TH} at (2,249) size 54x22 [bgcolor=#F8F8F8] [border: (1px solid #EEEEEE)] [r=6 c=0 rs=1 cs=1]
+              LayoutText {#text} at (18,2) size 18x17
+                text run at (18,2) width 18: "hu"
+            LayoutTableCell {TD} at (58,246) size 709x29 [border: (1px solid #EEEEEE)] [r=6 c=1 rs=1 cs=1]
+              LayoutText {#text} at (2,6) size 115x17
+                text run at (2,6) width 115: "11-ei London\x{2011}ban"
+          LayoutTableRow {TR} at (0,277) size 769x22
+            LayoutTableCell {TH} at (2,277) size 54x22 [bgcolor=#F8F8F8] [border: (1px solid #EEEEEE)] [r=7 c=0 rs=1 cs=1]
+              LayoutText {#text} at (20,2) size 14x17
+                text run at (20,2) width 14: "nl"
+            LayoutTableCell {TD} at (58,277) size 709x22 [border: (1px solid #EEEEEE)] [r=7 c=1 rs=1 cs=1]
+              LayoutText {#text} at (2,2) size 74x17
+                text run at (2,2) width 74: "'s Ochtends"
+          LayoutTableRow {TR} at (0,301) size 769x22
+            LayoutTableCell {TH} at (2,301) size 54x22 [bgcolor=#F8F8F8] [border: (1px solid #EEEEEE)] [r=8 c=0 rs=1 cs=1]
+              LayoutText {#text} at (20,2) size 14x17
+                text run at (20,2) width 14: "pl"
+            LayoutTableCell {TD} at (58,301) size 709x22 [border: (1px solid #EEEEEE)] [r=8 c=1 rs=1 cs=1]
+              LayoutText {#text} at (2,2) size 100x17
+                text run at (2,2) width 100: "Wzi\x{119}\x{142}a Bie\x{17C}\x{105}ce"
+          LayoutTableRow {TR} at (0,325) size 769x22
+            LayoutTableCell {TH} at (2,325) size 54x22 [bgcolor=#F8F8F8] [border: (1px solid #EEEEEE)] [r=9 c=0 rs=1 cs=1]
+              LayoutText {#text} at (19,2) size 16x17
+                text run at (19,2) width 16: "ru"
+            LayoutTableCell {TD} at (58,325) size 709x22 [border: (1px solid #EEEEEE)] [r=9 c=1 rs=1 cs=1]
+              LayoutText {#text} at (2,2) size 201x17
+                text run at (2,2) width 201: "\x{41D}\x{44C}\x{44E}-\x{419}\x{43E}\x{440}\x{43A} 1990-\x{445} 14-vii-1789"
+          LayoutTableRow {TR} at (0,349) size 769x22
+            LayoutTableCell {TH} at (2,349) size 54x22 [bgcolor=#F8F8F8] [border: (1px solid #EEEEEE)] [r=10 c=0 rs=1 cs=1]
+              LayoutText {#text} at (17,2) size 20x17
+                text run at (17,2) width 20: "tlh"
+            LayoutTableCell {TD} at (58,349) size 709x22 [border: (1px solid #EEEEEE)] [r=10 c=1 rs=1 cs=1]
+              LayoutText {#text} at (2,2) size 189x17
+                text run at (2,2) width 189: "tlhIngan Hol wa''uy' loghqam"
+      LayoutTable {TABLE} at (0,872) size 769x391
+        LayoutBlockFlow {CAPTION} at (0,0) size 769x18
+          LayoutText {#text} at (324,0) size 121x17
+            text run at (324,0) width 121: "Browser rendering"
+        LayoutTableSection {TBODY} at (0,18) size 769x373
+          LayoutTableRow {TR} at (0,2) size 769x58
+            LayoutTableCell {TH} at (2,20) size 54x22 [bgcolor=#F8F8F8] [border: (1px solid #EEEEEE)] [r=0 c=0 rs=1 cs=1]
+              LayoutText {#text} at (2,2) size 50x17
+                text run at (2,2) width 50: "generic"
+            LayoutTableCell {TD} at (58,2) size 709x58 [border: (1px solid #EEEEEE)] [r=0 c=1 rs=1 cs=1]
+              LayoutText {#text} at (2,2) size 694x53
+                text run at (2,2) width 694: "Lip\x{AD}smackin\x{AD}thirst\x{AD}quenchin\x{AD}acetastin\x{AD}motivatin\x{AD}good\x{AD}buzzin\x{AD}cool\x{AD}talkin\x{AD}high\x{AD}walkin\x{AD}fast\x{AD}livin\x{AD}ever\x{AD}givin\x{AD}cool\x{AD}fizzin\x{AD}lip\x{AD}" + hyphen string "-"
+                text run at (2,20) width 672: "smackin\x{AD}thirst\x{AD}quenchin\x{AD}acetastin\x{AD}motivatin\x{AD}good\x{AD}buzzin\x{AD}cool\x{AD}talkin\x{AD}high\x{AD}walkin\x{AD}fast\x{AD}livin\x{AD}ever\x{AD}givin\x{AD}cool\x{AD}fizzin\x{AD}lip\x{AD}" + hyphen string "-"
+                text run at (2,38) width 650: "smackin\x{AD}thirst\x{AD}quenchin\x{AD}acetastin\x{AD}motivatin\x{AD}good\x{AD}buzzin\x{AD}cool\x{AD}talkin\x{AD}high\x{AD}walkin\x{AD}fast\x{AD}livin\x{AD}ever\x{AD}givin\x{AD}cool\x{AD}fizzin"
+          LayoutTableRow {TR} at (0,62) size 769x22
+            LayoutTableCell {TH} at (2,62) size 54x22 [bgcolor=#F8F8F8] [border: (1px solid #EEEEEE)] [r=1 c=0 rs=1 cs=1]
+              LayoutText {#text} at (19,2) size 16x17
+                text run at (19,2) width 16: "cy"
+            LayoutTableCell {TD} at (58,62) size 709x22 [border: (1px solid #EEEEEE)] [r=1 c=1 rs=1 cs=1]
+              LayoutText {#text} at (2,2) size 28x17
+                text run at (2,2) width 28: "\x{174}yl"
+          LayoutTableRow {TR} at (0,86) size 769x29
+            LayoutTableCell {TH} at (2,89) size 54x22 [bgcolor=#F8F8F8] [border: (1px solid #EEEEEE)] [r=2 c=0 rs=1 cs=1]
+              LayoutText {#text} at (21,2) size 12x17
+                text run at (21,2) width 12: "el"
+            LayoutTableCell {TD} at (58,86) size 709x29 [border: (1px solid #EEEEEE)] [r=2 c=1 rs=1 cs=1]
+              LayoutText {#text} at (2,6) size 212x17
+                text run at (2,6) width 212: "\x{393}\x{3B5}\x{3C9}\x{3B3}\x{3C1}\x{3B1}\x{3C6}\x{3B9}\x{3BA}\x{3AC}\x{2010}\x{3A3}\x{3C5}\x{3C3}\x{3C7}\x{3B5}\x{3C4}\x{3B9}\x{3C3}\x{3BC}\x{3AD}\x{3BD}\x{3B5}\x{3C2} \x{389}\x{3C4}\x{3B1}"
+          LayoutTableRow {TR} at (0,117) size 769x72
+            LayoutTableCell {TH} at (2,142) size 54x22 [bgcolor=#F8F8F8] [border: (1px solid #EEEEEE)] [r=3 c=0 rs=1 cs=1]
+              LayoutText {#text} at (19,2) size 16x17
+                text run at (19,2) width 16: "en"
+            LayoutTableCell {TD} at (58,117) size 709x72 [border: (1px solid #EEEEEE)] [r=3 c=1 rs=1 cs=1]
+              LayoutText {#text} at (2,6) size 481x17
+                text run at (2,6) width 481: "'Cept Nut'in Safari\x{2019}s \x{2018}Sure\x{2019} Nai\x{308}ve R\x{E9}sum\x{E9}\x{2014}H\x{E1}c\x{30C}ek Full\x{2010}Time One-To-One"
+              LayoutBR {BR} at (482,20) size 1x0
+              LayoutText {#text} at (2,31) size 342x17
+                text run at (2,31) width 342: "\"Newcastle\x{2011}Upon\x{2011}Tyne\" Washington\x{2011}On\x{2011}The\x{2011}Brazos"
+              LayoutBR {BR} at (343,45) size 1x0
+              LayoutInline {SPAN} at (0,0) size 35x17
+                LayoutText {#text} at (2,52) size 35x17
+                  text run at (2,52) width 35: "Earth"
+              LayoutText {#text} at (36,52) size 78x17
+                text run at (36,52) width 78: "quake Earth"
+              LayoutInline {SPAN} at (0,0) size 38x17
+                LayoutText {#text} at (113,52) size 38x17
+                  text run at (113,52) width 38: "worm"
+              LayoutText {#text} at (150,52) size 5x17
+                text run at (150,52) width 5: " "
+              LayoutInline {SPAN} at (0,0) size 48x17
+                LayoutText {#text} at (154,52) size 48x17
+                  text run at (154,52) width 48: "Cheese"
+              LayoutInline {SPAN} at (0,0) size 42x17
+                LayoutText {#text} at (201,52) size 42x17
+                  text run at (201,52) width 42: "burger"
+              LayoutText {#text} at (242,52) size 128x17
+                text run at (242,52) width 128: " [House] ~Six -Big-"
+          LayoutTableRow {TR} at (0,191) size 769x22
+            LayoutTableCell {TH} at (2,191) size 54x22 [bgcolor=#F8F8F8] [border: (1px solid #EEEEEE)] [r=4 c=0 rs=1 cs=1]
+              LayoutText {#text} at (20,2) size 14x17
+                text run at (20,2) width 14: "es"
+            LayoutTableCell {TD} at (58,191) size 709x22 [border: (1px solid #EEEEEE)] [r=4 c=1 rs=1 cs=1]
+              LayoutText {#text} at (2,2) size 67x17
+                text run at (2,2) width 67: "\x{A1}Jalape\x{F1}o!"
+          LayoutTableRow {TR} at (0,215) size 769x29
+            LayoutTableCell {TH} at (2,218) size 54x22 [bgcolor=#F8F8F8] [border: (1px solid #EEEEEE)] [r=5 c=0 rs=1 cs=1]
+              LayoutText {#text} at (20,2) size 14x17
+                text run at (20,2) width 14: "fr"
+            LayoutTableCell {TD} at (58,215) size 709x29 [border: (1px solid #EEEEEE)] [r=5 c=1 rs=1 cs=1]
+              LayoutText {#text} at (2,6) size 228x17
+                text run at (2,6) width 228: "Quelqu'un L\x{2019}amour T'appelles\x{2011}Tu 3"
+              LayoutInline {SUP} at (0,0) size 23x15
+                LayoutText {#text} at (229,2) size 23x15
+                  text run at (229,2) width 23: "eme"
+          LayoutTableRow {TR} at (0,246) size 769x29
+            LayoutTableCell {TH} at (2,249) size 54x22 [bgcolor=#F8F8F8] [border: (1px solid #EEEEEE)] [r=6 c=0 rs=1 cs=1]
+              LayoutText {#text} at (18,2) size 18x17
+                text run at (18,2) width 18: "hu"
+            LayoutTableCell {TD} at (58,246) size 709x29 [border: (1px solid #EEEEEE)] [r=6 c=1 rs=1 cs=1]
+              LayoutText {#text} at (2,6) size 120x17
+                text run at (2,6) width 120: "11-Ei London\x{2011}Ban"
+          LayoutTableRow {TR} at (0,277) size 769x22
+            LayoutTableCell {TH} at (2,277) size 54x22 [bgcolor=#F8F8F8] [border: (1px solid #EEEEEE)] [r=7 c=0 rs=1 cs=1]
+              LayoutText {#text} at (20,2) size 14x17
+                text run at (20,2) width 14: "nl"
+            LayoutTableCell {TD} at (58,277) size 709x22 [border: (1px solid #EEEEEE)] [r=7 c=1 rs=1 cs=1]
+              LayoutText {#text} at (2,2) size 77x17
+                text run at (2,2) width 77: "'S Ochtends"
+          LayoutTableRow {TR} at (0,301) size 769x22
+            LayoutTableCell {TH} at (2,301) size 54x22 [bgcolor=#F8F8F8] [border: (1px solid #EEEEEE)] [r=8 c=0 rs=1 cs=1]
+              LayoutText {#text} at (20,2) size 14x17
+                text run at (20,2) width 14: "pl"
+            LayoutTableCell {TD} at (58,301) size 709x22 [border: (1px solid #EEEEEE)] [r=8 c=1 rs=1 cs=1]
+              LayoutText {#text} at (2,2) size 100x17
+                text run at (2,2) width 100: "Wzi\x{119}\x{142}a Bie\x{17C}\x{105}ce"
+          LayoutTableRow {TR} at (0,325) size 769x22
+            LayoutTableCell {TH} at (2,325) size 54x22 [bgcolor=#F8F8F8] [border: (1px solid #EEEEEE)] [r=9 c=0 rs=1 cs=1]
+              LayoutText {#text} at (19,2) size 16x17
+                text run at (19,2) width 16: "ru"
+            LayoutTableCell {TD} at (58,325) size 709x22 [border: (1px solid #EEEEEE)] [r=9 c=1 rs=1 cs=1]
+              LayoutText {#text} at (2,2) size 207x17
+                text run at (2,2) width 207: "\x{41D}\x{44C}\x{44E}-\x{419}\x{43E}\x{440}\x{43A} 1990-\x{425} 14-Vii-1789"
+          LayoutTableRow {TR} at (0,349) size 769x22
+            LayoutTableCell {TH} at (2,349) size 54x22 [bgcolor=#F8F8F8] [border: (1px solid #EEEEEE)] [r=10 c=0 rs=1 cs=1]
+              LayoutText {#text} at (17,2) size 20x17
+                text run at (17,2) width 20: "tlh"
+            LayoutTableCell {TD} at (58,349) size 709x22 [border: (1px solid #EEEEEE)] [r=10 c=1 rs=1 cs=1]
+              LayoutText {#text} at (2,2) size 206x17
+                text run at (2,2) width 206: "TlhIngan Hol Wa''Uy' Loghqam"
diff --git a/third_party/WebKit/LayoutTests/platform/win7/fast/text/cg-fallback-bolding-expected.png b/third_party/WebKit/LayoutTests/platform/win7/fast/text/cg-fallback-bolding-expected.png
new file mode 100644
index 0000000..44bb309
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/win7/fast/text/cg-fallback-bolding-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win7/fast/text/drawBidiText-expected.png b/third_party/WebKit/LayoutTests/platform/win7/fast/text/drawBidiText-expected.png
new file mode 100644
index 0000000..90cd63d
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/win7/fast/text/drawBidiText-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win7/fast/text/drawBidiText-expected.txt b/third_party/WebKit/LayoutTests/platform/win7/fast/text/drawBidiText-expected.txt
new file mode 100644
index 0000000..63dc6f5
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/win7/fast/text/drawBidiText-expected.txt
@@ -0,0 +1,56 @@
+layer at (0,0) size 800x600
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  LayoutBlockFlow {HTML} at (0,0) size 800x600
+    LayoutBlockFlow {BODY} at (8,8) size 784x584
+      LayoutBlockFlow {P} at (0,0) size 784x18
+        LayoutText {#text} at (0,0) size 285x17
+          text run at (0,0) width 285: "This tests GraphicsContext::drawBidiText()."
+layer at (8,42) size 322x205 clip at (9,43) size 305x203
+  LayoutListBox {SELECT} at (0,34) size 322.03x205.34 [bgcolor=#FFFFFF] [border: (1px solid #A9A9A9)]
+    LayoutBlockFlow {OPTION} at (1,1) size 305.03x22.59
+      LayoutText {#text} at (2,0) size 199x20
+        text run at (2,0) width 40: "First "
+        text run at (41,0) width 61 RTL: ") \x{5E8}\x{5D1}\x{5D9}\x{5E2}\x{5D9}\x{5EA}"
+        text run at (101,0) width 21: "03"
+        text run at (121,0) width 46 RTL: "\x{5E9}\x{5E0}\x{5D9}\x{5D4} ("
+        text run at (166,0) width 35: " fifth"
+    LayoutBlockFlow {OPTION} at (1,23.59) size 305.03x22.59
+      LayoutText {#text} at (104,0) size 200x20
+        text run at (104,0) width 30: "fifth"
+        text run at (133,0) width 65 RTL: ") \x{5E8}\x{5D1}\x{5D9}\x{5E2}\x{5D9}\x{5EA} "
+        text run at (197,0) width 21: "03"
+        text run at (217,0) width 52 RTL: " \x{5E9}\x{5E0}\x{5D9}\x{5D4} ("
+        text run at (268,0) width 36: "First"
+    LayoutBlockFlow {OPTION} at (1,46.19) size 305.03x22.59
+      LayoutText {#text} at (2,0) size 200x20
+        text run at (2,0) width 200 LTR override: "First \x{5E9}\x{5E0}\x{5D9}\x{5D4} (03) \x{5E8}\x{5D1}\x{5D9}\x{5E2}\x{5D9}\x{5EA} fifth"
+    LayoutBlockFlow {OPTION} at (1,68.78) size 305.03x22.59
+      LayoutText {#text} at (104,0) size 200x20
+        text run at (104,0) width 200 RTL override: "First \x{5E9}\x{5E0}\x{5D9}\x{5D4} (03) \x{5E8}\x{5D1}\x{5D9}\x{5E2}\x{5D9}\x{5EA} fifth"
+    LayoutBlockFlow {OPTION} at (1,91.38) size 305.03x22.59
+      LayoutText {#text} at (2,0) size 100x20
+        text run at (2,0) width 100 RTL: "\x{5DE}\x{5E9}\x{5D4}\x{5D5} \x{5E2}\x{5DD} \x{5E0}\x{5B4}\x{5E7}\x{5BC}\x{5D5}\x{5BC}\x{5D3}"
+    LayoutBlockFlow {OPTION} at (1,113.97) size 305.03x22.59
+      LayoutText {#text} at (2,0) size 69x20
+        text run at (2,0) width 69 RTL: "\x{627}\x{644}\x{644}\x{63A}\x{629} \x{627}\x{644}\x{639}\x{631}\x{628}\x{64A}\x{629}"
+    LayoutBlockFlow {OPTION} at (1,136.56) size 305.03x22.59
+      LayoutText {#text} at (2,0) size 126x20
+        text run at (2,0) width 126: "Et volia\x{300}: ATSUI!"
+    LayoutBlockFlow {OPTION} at (1,159.16) size 305.03x22.59
+      LayoutText {#text} at (2,0) size 283x20
+        text run at (2,0) width 91: "Directional "
+        text run at (92,0) width 75 RTL override: "\x{202E}overrides"
+        text run at (166,0) width 119: "\x{202C} are confusing."
+    LayoutBlockFlow {OPTION} at (1,181.75) size 305.03x22.59
+      LayoutText {#text} at (2,0) size 301x20
+        text run at (2,0) width 82: "She said \x{201C}"
+        text run at (83,0) width 67 RTL: " \x{5D1}\x{5DE}\x{5D6}\x{5D5}\x{5D5}\x{5D3}\x{5D4}!"
+        text run at (149,0) width 36: "TNT"
+        text run at (184,0) width 23 RTL: "\x{202B}\x{5D9}\x{5E9} "
+        text run at (206,0) width 97: "\x{202C}\x{201D} and ran off"
+layer at (8,247) size 366x18 clip at (9,248) size 349x16
+  LayoutListBox {SELECT} at (0,239.34) size 366x18 [bgcolor=#FFFFFF] [border: (1px solid #A9A9A9)]
+    LayoutBlockFlow {OPTION} at (1,1) size 349x15.39
+      LayoutText {#text} at (2,0) size 345x14
+        text run at (2,0) width 345: "There are two ways to measure text: my way and the wrong way"
diff --git a/third_party/WebKit/LayoutTests/platform/win7/fast/text/emphasis-ellipsis-complextext-expected.png b/third_party/WebKit/LayoutTests/platform/win7/fast/text/emphasis-ellipsis-complextext-expected.png
index 7064680..fa4b55e 100644
--- a/third_party/WebKit/LayoutTests/platform/win7/fast/text/emphasis-ellipsis-complextext-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win7/fast/text/emphasis-ellipsis-complextext-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win7/fast/text/emphasis-expected.png b/third_party/WebKit/LayoutTests/platform/win7/fast/text/emphasis-expected.png
index 7dd0cd9..1137a77 100644
--- a/third_party/WebKit/LayoutTests/platform/win7/fast/text/emphasis-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win7/fast/text/emphasis-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win7/fast/text/emphasis-expected.txt b/third_party/WebKit/LayoutTests/platform/win7/fast/text/emphasis-expected.txt
index f9c728f..57fc424 100644
--- a/third_party/WebKit/LayoutTests/platform/win7/fast/text/emphasis-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win7/fast/text/emphasis-expected.txt
@@ -18,7 +18,7 @@
         LayoutText {#text} at (112,70) size 334x66
           text run at (112,70) width 13: ", "
           text run at (124,70) width 213: "lobortis eu iaculis vel,"
-          text run at (3,110) width 209: "scelerisque nec dolor."
+          text run at (3,110) width 208: "scelerisque nec dolor."
       LayoutBlockFlow (floating) {DIV} at (390,8) size 366x140 [border: (3px solid #000000)]
         LayoutText {#text} at (3,3) size 273x26
           text run at (3,3) width 273: "Lorem ipsum dolor sit amet,"
@@ -94,7 +94,7 @@
         LayoutText {#text} at (198,105) size 334x53
           text run at (198,105) width 7: " "
           text run at (204,105) width 133: "eu iaculis vel,"
-          text run at (3,132) width 209: "scelerisque nec dolor."
+          text run at (3,132) width 208: "scelerisque nec dolor."
       LayoutBlockFlow (floating) {DIV} at (390,164) size 366x161 [border: (3px solid #000000)]
         LayoutText {#text} at (3,3) size 70x26
           text run at (3,3) width 70: "Lorem "
@@ -154,7 +154,7 @@
         LayoutText {#text} at (198,87) size 334x70
           text run at (198,87) width 7: " "
           text run at (204,87) width 133: "eu iaculis vel,"
-          text run at (3,131) width 209: "scelerisque nec dolor."
+          text run at (3,131) width 208: "scelerisque nec dolor."
       LayoutBlockFlow (floating) {DIV} at (390,341) size 366x198 [border: (3px solid #000000)]
         LayoutText {#text} at (3,14) size 273x26
           text run at (3,14) width 273: "Lorem ipsum dolor sit amet,"
@@ -170,7 +170,7 @@
         LayoutText {#text} at (112,110) size 334x74
           text run at (112,110) width 13: ", "
           text run at (124,110) width 213: "lobortis eu iaculis vel,"
-          text run at (3,158) width 209: "scelerisque nec dolor."
+          text run at (3,158) width 208: "scelerisque nec dolor."
       LayoutBlockFlow (floating) {DIV} at (8,555) size 366x140 [border: (3px solid #000000)]
         LayoutText {#text} at (3,3) size 273x26
           text run at (3,3) width 273: "Lorem ipsum dolor sit amet,"
@@ -186,6 +186,6 @@
         LayoutText {#text} at (112,70) size 334x66
           text run at (112,70) width 13: ", "
           text run at (124,70) width 213: "lobortis eu iaculis vel,"
-          text run at (3,110) width 209: "scelerisque nec dolor."
+          text run at (3,110) width 208: "scelerisque nec dolor."
 selection start: position 10 of child 0 {#text} of child 1 {SPAN} of child 10 {DIV} of body
 selection end:   position 7 of child 0 {#text} of child 3 {SPAN} of child 10 {DIV} of body
diff --git a/third_party/WebKit/LayoutTests/platform/win7/fast/text/firstline/002-expected.png b/third_party/WebKit/LayoutTests/platform/win7/fast/text/firstline/002-expected.png
new file mode 100644
index 0000000..8bffd1c
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/win7/fast/text/firstline/002-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win7/fast/text/firstline/002-expected.txt b/third_party/WebKit/LayoutTests/platform/win7/fast/text/firstline/002-expected.txt
new file mode 100644
index 0000000..a4ea838c
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/win7/fast/text/firstline/002-expected.txt
@@ -0,0 +1,11 @@
+layer at (0,0) size 800x600
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  LayoutBlockFlow {HTML} at (0,0) size 800x600
+    LayoutBlockFlow {BODY} at (8,8) size 784x576
+      LayoutBlockFlow {P} at (0,0) size 784x46 [border: (2px solid #0000FF)]
+        LayoutInline {<pseudo:first-letter>} at (0,0) size 32x40 [color=#800000]
+          LayoutTextFragment (anonymous) at (2,3) size 32x40
+            text run at (2,3) width 32: "M"
+        LayoutTextFragment {#text} at (34,21) size 183x17
+          text run at (34,21) width 183: "aroon on the first letter only."
diff --git a/third_party/WebKit/LayoutTests/platform/win7/fast/text/font-kerning-expected.png b/third_party/WebKit/LayoutTests/platform/win7/fast/text/font-kerning-expected.png
index a2daacbe..e7f14474 100644
--- a/third_party/WebKit/LayoutTests/platform/win7/fast/text/font-kerning-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win7/fast/text/font-kerning-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win7/fast/text/font-stretch-expected.png b/third_party/WebKit/LayoutTests/platform/win7/fast/text/font-stretch-expected.png
new file mode 100644
index 0000000..7d82f8e
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/win7/fast/text/font-stretch-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win7/fast/text/font-stretch-expected.txt b/third_party/WebKit/LayoutTests/platform/win7/fast/text/font-stretch-expected.txt
new file mode 100644
index 0000000..d9458b8
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/win7/fast/text/font-stretch-expected.txt
@@ -0,0 +1,127 @@
+layer at (0,0) size 800x600
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x431
+  LayoutBlockFlow {HTML} at (0,0) size 800x431
+    LayoutBlockFlow {BODY} at (8,8) size 784x415
+      LayoutBlockFlow {H1} at (0,0) size 784x23
+        LayoutText {#text} at (0,0) size 250x22
+          text run at (0,0) width 250: "Tests support for font-stretch"
+      LayoutBlockFlow {P} at (0,25) size 784x16
+        LayoutText {#text} at (0,0) size 228x15
+          text run at (0,0) width 228: "Tests that CSS font-stretch is supported."
+      LayoutBlockFlow {SECTION} at (0,49) size 784x194
+        LayoutBlockFlow {H2} at (0,0) size 784x21
+          LayoutText {#text} at (0,0) size 68x21
+            text run at (0,0) width 68: "Segoe UI"
+        LayoutBlockFlow {P} at (0,23) size 784x19
+          LayoutBlockFlow {SPAN} at (0,0) size 210x19
+            LayoutText {#text} at (0,0) size 181x19
+              text run at (0,0) width 181: "font-stretch: ultra-condensed"
+          LayoutText {#text} at (210,0) size 379x19
+            text run at (210,0) width 379: " - Just poets wax boldly as kings and queens march over fuzz."
+        LayoutBlockFlow {P} at (0,42) size 784x19
+          LayoutBlockFlow {SPAN} at (0,0) size 210x19
+            LayoutText {#text} at (0,0) size 184x19
+              text run at (0,0) width 184: "font-stretch: extra-condensed"
+          LayoutText {#text} at (210,0) size 379x19
+            text run at (210,0) width 379: " - Just poets wax boldly as kings and queens march over fuzz."
+        LayoutBlockFlow {P} at (0,61) size 784x19
+          LayoutBlockFlow {SPAN} at (0,0) size 210x19
+            LayoutText {#text} at (0,0) size 148x19
+              text run at (0,0) width 148: "font-stretch: condensed"
+          LayoutText {#text} at (210,0) size 379x19
+            text run at (210,0) width 379: " - Just poets wax boldly as kings and queens march over fuzz."
+        LayoutBlockFlow {P} at (0,80) size 784x19
+          LayoutBlockFlow {SPAN} at (0,0) size 210x19
+            LayoutText {#text} at (0,0) size 182x19
+              text run at (0,0) width 182: "font-stretch: semi-condensed"
+          LayoutText {#text} at (210,0) size 379x19
+            text run at (210,0) width 379: " - Just poets wax boldly as kings and queens march over fuzz."
+        LayoutBlockFlow {P} at (0,99) size 784x19
+          LayoutBlockFlow {SPAN} at (0,0) size 210x19
+            LayoutText {#text} at (0,0) size 124x19
+              text run at (0,0) width 124: "font-stretch: normal"
+          LayoutText {#text} at (210,0) size 379x19
+            text run at (210,0) width 379: " - Just poets wax boldly as kings and queens march over fuzz."
+        LayoutBlockFlow {P} at (0,118) size 784x19
+          LayoutBlockFlow {SPAN} at (0,0) size 210x19
+            LayoutText {#text} at (0,0) size 175x19
+              text run at (0,0) width 175: "font-stretch: semi-expanded"
+          LayoutText {#text} at (210,0) size 379x19
+            text run at (210,0) width 379: " - Just poets wax boldly as kings and queens march over fuzz."
+        LayoutBlockFlow {P} at (0,137) size 784x19
+          LayoutBlockFlow {SPAN} at (0,0) size 210x19
+            LayoutText {#text} at (0,0) size 141x19
+              text run at (0,0) width 141: "font-stretch: expanded"
+          LayoutText {#text} at (210,0) size 379x19
+            text run at (210,0) width 379: " - Just poets wax boldly as kings and queens march over fuzz."
+        LayoutBlockFlow {P} at (0,156) size 784x19
+          LayoutBlockFlow {SPAN} at (0,0) size 210x19
+            LayoutText {#text} at (0,0) size 177x19
+              text run at (0,0) width 177: "font-stretch: extra-expanded"
+          LayoutText {#text} at (210,0) size 379x19
+            text run at (210,0) width 379: " - Just poets wax boldly as kings and queens march over fuzz."
+        LayoutBlockFlow {P} at (0,175) size 784x19
+          LayoutBlockFlow {SPAN} at (0,0) size 210x19
+            LayoutText {#text} at (0,0) size 175x19
+              text run at (0,0) width 175: "font-stretch: ultra-expanded"
+          LayoutText {#text} at (210,0) size 379x19
+            text run at (210,0) width 379: " - Just poets wax boldly as kings and queens march over fuzz."
+      LayoutBlockFlow {SECTION} at (0,251) size 784x164
+        LayoutBlockFlow {H2} at (0,0) size 784x18
+          LayoutText {#text} at (0,0) size 36x17
+            text run at (0,0) width 36: "Arial"
+        LayoutBlockFlow {P} at (0,20) size 784x16
+          LayoutBlockFlow {SPAN} at (0,0) size 217.78x16
+            LayoutText {#text} at (0,0) size 183x16
+              text run at (0,0) width 183: "font-stretch: ultra-condensed"
+          LayoutText {#text} at (217,0) size 394x16
+            text run at (217,0) width 394: " - Just poets wax boldly as kings and queens march over fuzz."
+        LayoutBlockFlow {P} at (0,36) size 784x16
+          LayoutBlockFlow {SPAN} at (0,0) size 217.78x16
+            LayoutText {#text} at (0,0) size 187x16
+              text run at (0,0) width 187: "font-stretch: extra-condensed"
+          LayoutText {#text} at (217,0) size 394x16
+            text run at (217,0) width 394: " - Just poets wax boldly as kings and queens march over fuzz."
+        LayoutBlockFlow {P} at (0,52) size 784x16
+          LayoutBlockFlow {SPAN} at (0,0) size 217.78x16
+            LayoutText {#text} at (0,0) size 150x16
+              text run at (0,0) width 150: "font-stretch: condensed"
+          LayoutText {#text} at (217,0) size 394x16
+            text run at (217,0) width 394: " - Just poets wax boldly as kings and queens march over fuzz."
+        LayoutBlockFlow {P} at (0,68) size 784x16
+          LayoutBlockFlow {SPAN} at (0,0) size 217.78x16
+            LayoutText {#text} at (0,0) size 185x16
+              text run at (0,0) width 185: "font-stretch: semi-condensed"
+          LayoutText {#text} at (217,0) size 394x16
+            text run at (217,0) width 394: " - Just poets wax boldly as kings and queens march over fuzz."
+        LayoutBlockFlow {P} at (0,84) size 784x16
+          LayoutBlockFlow {SPAN} at (0,0) size 217.78x16
+            LayoutText {#text} at (0,0) size 124x16
+              text run at (0,0) width 124: "font-stretch: normal"
+          LayoutText {#text} at (217,0) size 394x16
+            text run at (217,0) width 394: " - Just poets wax boldly as kings and queens march over fuzz."
+        LayoutBlockFlow {P} at (0,100) size 784x16
+          LayoutBlockFlow {SPAN} at (0,0) size 217.78x16
+            LayoutText {#text} at (0,0) size 178x16
+              text run at (0,0) width 178: "font-stretch: semi-expanded"
+          LayoutText {#text} at (217,0) size 394x16
+            text run at (217,0) width 394: " - Just poets wax boldly as kings and queens march over fuzz."
+        LayoutBlockFlow {P} at (0,116) size 784x16
+          LayoutBlockFlow {SPAN} at (0,0) size 217.78x16
+            LayoutText {#text} at (0,0) size 143x16
+              text run at (0,0) width 143: "font-stretch: expanded"
+          LayoutText {#text} at (217,0) size 394x16
+            text run at (217,0) width 394: " - Just poets wax boldly as kings and queens march over fuzz."
+        LayoutBlockFlow {P} at (0,132) size 784x16
+          LayoutBlockFlow {SPAN} at (0,0) size 217.78x16
+            LayoutText {#text} at (0,0) size 180x16
+              text run at (0,0) width 180: "font-stretch: extra-expanded"
+          LayoutText {#text} at (217,0) size 394x16
+            text run at (217,0) width 394: " - Just poets wax boldly as kings and queens march over fuzz."
+        LayoutBlockFlow {P} at (0,148) size 784x16
+          LayoutBlockFlow {SPAN} at (0,0) size 217.78x16
+            LayoutText {#text} at (0,0) size 176x16
+              text run at (0,0) width 176: "font-stretch: ultra-expanded"
+          LayoutText {#text} at (217,0) size 394x16
+            text run at (217,0) width 394: " - Just poets wax boldly as kings and queens march over fuzz."
diff --git a/third_party/WebKit/LayoutTests/platform/win7/fast/text/font-stretch-variant-expected.png b/third_party/WebKit/LayoutTests/platform/win7/fast/text/font-stretch-variant-expected.png
new file mode 100644
index 0000000..3588d17
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/win7/fast/text/font-stretch-variant-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win7/fast/text/font-stretch-variant-expected.txt b/third_party/WebKit/LayoutTests/platform/win7/fast/text/font-stretch-variant-expected.txt
new file mode 100644
index 0000000..0d40fb1
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/win7/fast/text/font-stretch-variant-expected.txt
@@ -0,0 +1,83 @@
+layer at (0,0) size 800x600 clip at (0,0) size 785x600 scrollHeight 620
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 785x620 backgroundClip at (0,0) size 785x600 clip at (0,0) size 785x600
+  LayoutBlockFlow {HTML} at (0,0) size 785x620.44
+    LayoutBlockFlow {BODY} at (8,19.91) size 769x592.53
+      LayoutBlockFlow {SECTION} at (0,0) size 769x134.91
+        LayoutBlockFlow {H2} at (0,0) size 769x27
+          LayoutText {#text} at (0,0) size 413x26
+            text run at (0,0) width 413: "font-stretch: condensed vs Arial Narrow"
+        LayoutBlockFlow {DIV} at (0,46.91) size 769x18
+          LayoutText {#text} at (0,0) size 447x17
+            text run at (0,0) width 447: "Back in June we delivered oxygen equipment of the same size."
+        LayoutBlockFlow {DIV} at (0,64.91) size 769x18
+          LayoutText {#text} at (0,0) size 447x17
+            text run at (0,0) width 447: "Back in June we delivered oxygen equipment of the same size."
+        LayoutBlockFlow {DIV} at (0,82.91) size 769x18
+          LayoutText {#text} at (0,0) size 447x17
+            text run at (0,0) width 447: "Back in June we delivered oxygen equipment of the same size."
+        LayoutBlockFlow {P} at (0,116.91) size 769x18
+          LayoutText {#text} at (0,0) size 331x17
+            text run at (0,0) width 331: "The three lines above should have the same weight."
+      LayoutBlockFlow {SECTION} at (0,154.81) size 769x208.91
+        LayoutBlockFlow {H2} at (0,0) size 769x27
+          LayoutText {#text} at (0,0) size 210x26
+            text run at (0,0) width 210: "Specific width, Arial"
+        LayoutBlockFlow {DIV} at (0,46.91) size 769x18
+          LayoutText {#text} at (0,0) size 665x17
+            text run at (0,0) width 665: "font-stretch: ultra-condensed - Back in June we delivered oxygen equipment of the same size."
+        LayoutBlockFlow {DIV} at (0,64.91) size 769x18
+          LayoutText {#text} at (0,0) size 669x17
+            text run at (0,0) width 669: "font-stretch: extra-condensed - Back in June we delivered oxygen equipment of the same size."
+        LayoutBlockFlow {DIV} at (0,82.91) size 769x18
+          LayoutText {#text} at (0,0) size 628x17
+            text run at (0,0) width 628: "font-stretch: condensed - Back in June we delivered oxygen equipment of the same size."
+        LayoutBlockFlow {DIV} at (0,100.91) size 769x18
+          LayoutText {#text} at (0,0) size 668x17
+            text run at (0,0) width 668: "font-stretch: semi-condensed - Back in June we delivered oxygen equipment of the same size."
+        LayoutBlockFlow {DIV} at (0,118.91) size 769x18
+          LayoutText {#text} at (0,0) size 599x17
+            text run at (0,0) width 599: "font-stretch: normal - Back in June we delivered oxygen equipment of the same size."
+        LayoutBlockFlow {DIV} at (0,136.91) size 769x18
+          LayoutText {#text} at (0,0) size 660x17
+            text run at (0,0) width 660: "font-stretch: semi-expanded - Back in June we delivered oxygen equipment of the same size."
+        LayoutBlockFlow {DIV} at (0,154.91) size 769x18
+          LayoutText {#text} at (0,0) size 620x17
+            text run at (0,0) width 620: "font-stretch: expanded - Back in June we delivered oxygen equipment of the same size."
+        LayoutBlockFlow {DIV} at (0,172.91) size 769x18
+          LayoutText {#text} at (0,0) size 661x17
+            text run at (0,0) width 661: "font-stretch: extra-expanded - Back in June we delivered oxygen equipment of the same size."
+        LayoutBlockFlow {DIV} at (0,190.91) size 769x18
+          LayoutText {#text} at (0,0) size 652x17
+            text run at (0,0) width 652: "font-stretch: ulta-expanded - Back in June we delivered oxygen equipment of the same size."
+      LayoutBlockFlow {SECTION} at (0,383.63) size 769x208.91
+        LayoutBlockFlow {H2} at (0,0) size 769x27
+          LayoutText {#text} at (0,0) size 296x26
+            text run at (0,0) width 296: "Specific width, Arial Narrow"
+        LayoutBlockFlow {DIV} at (0,46.91) size 769x18
+          LayoutText {#text} at (0,0) size 665x17
+            text run at (0,0) width 665: "font-stretch: ultra-condensed - Back in June we delivered oxygen equipment of the same size."
+        LayoutBlockFlow {DIV} at (0,64.91) size 769x18
+          LayoutText {#text} at (0,0) size 669x17
+            text run at (0,0) width 669: "font-stretch: extra-condensed - Back in June we delivered oxygen equipment of the same size."
+        LayoutBlockFlow {DIV} at (0,82.91) size 769x18
+          LayoutText {#text} at (0,0) size 628x17
+            text run at (0,0) width 628: "font-stretch: condensed - Back in June we delivered oxygen equipment of the same size."
+        LayoutBlockFlow {DIV} at (0,100.91) size 769x18
+          LayoutText {#text} at (0,0) size 668x17
+            text run at (0,0) width 668: "font-stretch: semi-condensed - Back in June we delivered oxygen equipment of the same size."
+        LayoutBlockFlow {DIV} at (0,118.91) size 769x18
+          LayoutText {#text} at (0,0) size 599x17
+            text run at (0,0) width 599: "font-stretch: normal - Back in June we delivered oxygen equipment of the same size."
+        LayoutBlockFlow {DIV} at (0,136.91) size 769x18
+          LayoutText {#text} at (0,0) size 660x17
+            text run at (0,0) width 660: "font-stretch: semi-expanded - Back in June we delivered oxygen equipment of the same size."
+        LayoutBlockFlow {DIV} at (0,154.91) size 769x18
+          LayoutText {#text} at (0,0) size 620x17
+            text run at (0,0) width 620: "font-stretch: expanded - Back in June we delivered oxygen equipment of the same size."
+        LayoutBlockFlow {DIV} at (0,172.91) size 769x18
+          LayoutText {#text} at (0,0) size 661x17
+            text run at (0,0) width 661: "font-stretch: extra-expanded - Back in June we delivered oxygen equipment of the same size."
+        LayoutBlockFlow {DIV} at (0,190.91) size 769x18
+          LayoutText {#text} at (0,0) size 652x17
+            text run at (0,0) width 652: "font-stretch: ulta-expanded - Back in June we delivered oxygen equipment of the same size."
diff --git a/third_party/WebKit/LayoutTests/platform/win7/fast/text/font-weight-expected.png b/third_party/WebKit/LayoutTests/platform/win7/fast/text/font-weight-expected.png
new file mode 100644
index 0000000..08d5f942
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/win7/fast/text/font-weight-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win7/fast/text/font-weight-expected.txt b/third_party/WebKit/LayoutTests/platform/win7/fast/text/font-weight-expected.txt
new file mode 100644
index 0000000..55861ce
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/win7/fast/text/font-weight-expected.txt
@@ -0,0 +1,73 @@
+layer at (0,0) size 800x600
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x437
+  LayoutBlockFlow {HTML} at (0,0) size 800x437
+    LayoutBlockFlow {BODY} at (8,8) size 784x421
+      LayoutBlockFlow {H1} at (0,0) size 784x23
+        LayoutText {#text} at (0,0) size 248x22
+          text run at (0,0) width 248: "Tests support for font-weight"
+      LayoutBlockFlow {P} at (0,25) size 784x16
+        LayoutText {#text} at (0,0) size 347x15
+          text run at (0,0) width 347: "Tests that CSS font-weight with numeric values is supported."
+      LayoutBlockFlow {SECTION} at (0,49) size 784x194
+        LayoutBlockFlow {H2} at (0,0) size 784x21
+          LayoutText {#text} at (0,0) size 68x21
+            text run at (0,0) width 68: "Segoe UI"
+        LayoutBlockFlow {P} at (0,23) size 784x19
+          LayoutText {#text} at (0,0) size 343x19
+            text run at (0,0) width 343: "font-weight: 100 - Fix problem quickly with galvanized jets."
+        LayoutBlockFlow {P} at (0,42) size 784x19
+          LayoutText {#text} at (0,0) size 343x19
+            text run at (0,0) width 343: "font-weight: 200 - Fix problem quickly with galvanized jets."
+        LayoutBlockFlow {P} at (0,61) size 784x19
+          LayoutText {#text} at (0,0) size 343x19
+            text run at (0,0) width 343: "font-weight: 300 - Fix problem quickly with galvanized jets."
+        LayoutBlockFlow {P} at (0,80) size 784x19
+          LayoutText {#text} at (0,0) size 364x19
+            text run at (0,0) width 364: "font-weight: 400 - Fix problem quickly with galvanized jets."
+        LayoutBlockFlow {P} at (0,99) size 784x19
+          LayoutText {#text} at (0,0) size 377x19
+            text run at (0,0) width 377: "font-weight: 500 - Fix problem quickly with galvanized jets."
+        LayoutBlockFlow {P} at (0,118) size 784x19
+          LayoutText {#text} at (0,0) size 377x19
+            text run at (0,0) width 377: "font-weight: 600 - Fix problem quickly with galvanized jets."
+        LayoutBlockFlow {P} at (0,137) size 784x19
+          LayoutText {#text} at (0,0) size 392x19
+            text run at (0,0) width 392: "font-weight: 700 - Fix problem quickly with galvanized jets."
+        LayoutBlockFlow {P} at (0,156) size 784x19
+          LayoutText {#text} at (0,0) size 392x19
+            text run at (0,0) width 392: "font-weight: 800 - Fix problem quickly with galvanized jets."
+        LayoutBlockFlow {P} at (0,175) size 784x19
+          LayoutText {#text} at (0,0) size 392x19
+            text run at (0,0) width 392: "font-weight: 900 - Fix problem quickly with galvanized jets."
+      LayoutBlockFlow {SECTION} at (0,251) size 784x170
+        LayoutBlockFlow {H2} at (0,0) size 784x18
+          LayoutText {#text} at (0,0) size 36x17
+            text run at (0,0) width 36: "Arial"
+        LayoutBlockFlow {P} at (0,20) size 784x16
+          LayoutText {#text} at (0,0) size 368x16
+            text run at (0,0) width 368: "font-weight: 100 - Fix problem quickly with galvanized jets."
+        LayoutBlockFlow {P} at (0,36) size 784x16
+          LayoutText {#text} at (0,0) size 368x16
+            text run at (0,0) width 368: "font-weight: 200 - Fix problem quickly with galvanized jets."
+        LayoutBlockFlow {P} at (0,52) size 784x16
+          LayoutText {#text} at (0,0) size 368x16
+            text run at (0,0) width 368: "font-weight: 300 - Fix problem quickly with galvanized jets."
+        LayoutBlockFlow {P} at (0,68) size 784x16
+          LayoutText {#text} at (0,0) size 368x16
+            text run at (0,0) width 368: "font-weight: 400 - Fix problem quickly with galvanized jets."
+        LayoutBlockFlow {P} at (0,84) size 784x16
+          LayoutText {#text} at (0,0) size 368x16
+            text run at (0,0) width 368: "font-weight: 500 - Fix problem quickly with galvanized jets."
+        LayoutBlockFlow {P} at (0,100) size 784x16
+          LayoutText {#text} at (0,0) size 404x16
+            text run at (0,0) width 404: "font-weight: 600 - Fix problem quickly with galvanized jets."
+        LayoutBlockFlow {P} at (0,116) size 784x16
+          LayoutText {#text} at (0,0) size 404x16
+            text run at (0,0) width 404: "font-weight: 700 - Fix problem quickly with galvanized jets."
+        LayoutBlockFlow {P} at (0,132) size 784x19
+          LayoutText {#text} at (0,0) size 449x19
+            text run at (0,0) width 449: "font-weight: 800 - Fix problem quickly with galvanized jets."
+        LayoutBlockFlow {P} at (0,151) size 784x19
+          LayoutText {#text} at (0,0) size 449x19
+            text run at (0,0) width 449: "font-weight: 900 - Fix problem quickly with galvanized jets."
diff --git a/third_party/WebKit/LayoutTests/platform/win7/fast/text/format-control-expected.png b/third_party/WebKit/LayoutTests/platform/win7/fast/text/format-control-expected.png
new file mode 100644
index 0000000..9a2b0a5
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/win7/fast/text/format-control-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win7/fast/text/format-control-expected.txt b/third_party/WebKit/LayoutTests/platform/win7/fast/text/format-control-expected.txt
new file mode 100644
index 0000000..f9b29431
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/win7/fast/text/format-control-expected.txt
@@ -0,0 +1,28 @@
+layer at (0,0) size 800x600
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  LayoutBlockFlow {HTML} at (0,0) size 800x600
+    LayoutBlockFlow {BODY} at (8,8) size 784x552
+      LayoutBlockFlow (anonymous) at (0,0) size 784x18
+        LayoutText {#text} at (0,0) size 485x17
+          text run at (0,0) width 485: "This tests the ZWJ and ZWNJ format control characters on basic Latin text."
+      LayoutBlockFlow {DIV} at (0,58) size 784x221
+        LayoutBlockFlow {P} at (0,0) size 784x47
+          LayoutText {#text} at (0,1) size 288x45
+            text run at (0,1) width 288: "fi fl ff ffi ffl fl f   i"
+        LayoutBlockFlow {P} at (0,87) size 784x47
+          LayoutText {#text} at (0,1) size 288x45
+            text run at (0,1) width 288: "f\x{200C}i f\x{200C}l f\x{200C}f f\x{200C}f\x{200C}i f\x{200C}f\x{200C}l f\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}l f\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C} \x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C} \x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C} \x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}i"
+        LayoutBlockFlow {P} at (0,174) size 784x47
+          LayoutText {#text} at (0,1) size 288x45
+            text run at (0,1) width 288: "f\x{200D}i f\x{200D}l f\x{200D}f f\x{200D}f\x{200D}i f\x{200D}f\x{200D}l f\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}l f\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D} \x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D} \x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D} \x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}i"
+      LayoutBlockFlow {DIV} at (0,319) size 784x221
+        LayoutBlockFlow {P} at (0,0) size 784x47
+          LayoutText {#text} at (0,1) size 288x45
+            text run at (0,1) width 288: "fi fl ff ffi ffl fl f   i"
+        LayoutBlockFlow {P} at (0,87) size 784x47
+          LayoutText {#text} at (0,1) size 288x45
+            text run at (0,1) width 288: "f\x{200C}i f\x{200C}l f\x{200C}f f\x{200C}f\x{200C}i f\x{200C}f\x{200C}l f\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}l f\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C} \x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C} \x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C} \x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}\x{200C}i"
+        LayoutBlockFlow {P} at (0,174) size 784x47
+          LayoutText {#text} at (0,1) size 288x45
+            text run at (0,1) width 288: "f\x{200D}i f\x{200D}l f\x{200D}f f\x{200D}f\x{200D}i f\x{200D}f\x{200D}l f\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}l f\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D} \x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D} \x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D} \x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}\x{200D}i"
diff --git a/third_party/WebKit/LayoutTests/platform/win7/fast/text/international/bold-bengali-expected.png b/third_party/WebKit/LayoutTests/platform/win7/fast/text/international/bold-bengali-expected.png
new file mode 100644
index 0000000..268bb76
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/win7/fast/text/international/bold-bengali-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win7/fast/text/international/bold-bengali-expected.txt b/third_party/WebKit/LayoutTests/platform/win7/fast/text/international/bold-bengali-expected.txt
new file mode 100644
index 0000000..c234b96
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/win7/fast/text/international/bold-bengali-expected.txt
@@ -0,0 +1,22 @@
+layer at (0,0) size 800x600
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  LayoutBlockFlow {HTML} at (0,0) size 800x600
+    LayoutBlockFlow {BODY} at (8,8) size 784x576
+      LayoutBlockFlow {P} at (0,0) size 784x36
+        LayoutText {#text} at (0,0) size 756x35
+          text run at (0,0) width 352: "This test verifies we can render bold Bengali properly. "
+          text run at (351,0) width 405: "(This is complicated on Linux because it's typically covered by"
+          text run at (0,18) width 473: "fake-bolded FreeSans even though there's also a FreeSansBold available.)"
+      LayoutBlockFlow {P} at (0,52) size 784x18
+        LayoutText {#text} at (0,0) size 751x17
+          text run at (0,0) width 487: "The test passes if the two words below look similar, but the top one is bold. "
+          text run at (486,0) width 265: "There should be no missing-glyph boxes."
+      LayoutBlockFlow {P} at (0,86) size 784x23
+        LayoutInline {B} at (0,0) size 39x17
+          LayoutText {#text} at (0,2) size 39x17
+            text run at (0,2) width 39: "\x{9AC}\x{9BE}\x{982}\x{9B2}\x{9BE}"
+      LayoutBlockFlow {P} at (0,125) size 784x0
+      LayoutBlockFlow {P} at (0,125) size 784x23
+        LayoutText {#text} at (0,2) size 34x17
+          text run at (0,2) width 34: "\x{9AC}\x{9BE}\x{982}\x{9B2}\x{9BE}"
diff --git a/third_party/WebKit/LayoutTests/platform/win7/fast/text/international/complex-character-based-fallback-expected.png b/third_party/WebKit/LayoutTests/platform/win7/fast/text/international/complex-character-based-fallback-expected.png
new file mode 100644
index 0000000..ff7394f1
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/win7/fast/text/international/complex-character-based-fallback-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win7/fast/text/international/complex-character-based-fallback-expected.txt b/third_party/WebKit/LayoutTests/platform/win7/fast/text/international/complex-character-based-fallback-expected.txt
new file mode 100644
index 0000000..f8b0b79
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/win7/fast/text/international/complex-character-based-fallback-expected.txt
@@ -0,0 +1,43 @@
+layer at (0,0) size 800x600 clip at (0,0) size 785x600 scrollHeight 714
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 785x714 backgroundClip at (0,0) size 785x600 clip at (0,0) size 785x600
+  LayoutBlockFlow {HTML} at (0,0) size 785x714
+    LayoutBlockFlow {BODY} at (8,8) size 769x690
+      LayoutBlockFlow {P} at (0,0) size 769x54
+        LayoutText {#text} at (0,0) size 748x35
+          text run at (0,0) width 748: "This tests that complex text that requires font fallback wraps correctly. The text is Tamil, which is not covered by the"
+          text run at (0,18) width 479: "default font, so fallback occurs. Note that the exclamation point in the end "
+        LayoutInline {I} at (0,0) size 12x17
+          LayoutText {#text} at (478,18) size 12x17
+            text run at (478,18) width 12: "is"
+        LayoutText {#text} at (489,18) size 768x35
+          text run at (489,18) width 279: " covered by the default font and is rendered"
+          text run at (0,36) width 52: "using it."
+      LayoutBlockFlow {P} at (0,70) size 306x276 [border: (3px solid #000000)]
+        LayoutText {#text} at (3,7) size 265x260
+          text run at (3,7) width 205: "\x{B87}\x{BA4}\x{BC1} \x{B89}\x{B99}\x{BCD}\x{B95}\x{BB3}\x{BC8}\x{BAA}\x{BCD} \x{BAA}\x{BCB}\x{BA9}\x{BCD}\x{BB1}"
+          text run at (3,34) width 209: "\x{B86}\x{BB0}\x{BCD}\x{BB5}\x{BAE}\x{BC1}\x{B9F}\x{BC8}\x{BAF}\x{BB5}\x{BB0}\x{BCD}\x{B95}\x{BB3}\x{BBE}\x{BB2}\x{BCD}"
+          text run at (3,61) width 262: "\x{BA4}\x{BCA}\x{B95}\x{BC1}\x{B95}\x{BCD}\x{B95}\x{BAA}\x{BCD}\x{BAA}\x{B9F}\x{BCD}\x{B9F}\x{BC1} \x{B95}\x{B9F}\x{BCD}\x{B9F}\x{BC1}\x{BAA}\x{BCD}\x{BAA}\x{BBE}\x{B9F}\x{BC1}\x{B95}\x{BB3}\x{BCD}"
+          text run at (3,88) width 223: "\x{B8F}\x{BA4}\x{BC1}\x{BAE}\x{BCD} \x{B87}\x{BA9}\x{BCD}\x{BB1}\x{BBF} \x{B87}\x{BB2}\x{BB5}\x{B9A}\x{BAE}\x{BBE}\x{B95}\x{BAA}\x{BCD}"
+          text run at (3,115) width 208: "\x{BAA}\x{BAF}\x{BA9}\x{BCD}\x{BAA}\x{B9F}\x{BC1}\x{BA4}\x{BCD}\x{BA4}\x{B95}\x{BCD}\x{B95}\x{BC2}\x{B9F}\x{BBF}\x{BAF} \x{B92}\x{BB0}\x{BC1}"
+          text run at (3,142) width 265: "\x{BAA}\x{BA9}\x{BCD}\x{BAE}\x{BCA}\x{BB4}\x{BBF}\x{B95}\x{BCD} \x{B95}\x{BB2}\x{BC8}\x{B95}\x{BCD} \x{B95}\x{BB3}\x{B9E}\x{BCD}\x{B9A}\x{BBF}\x{BAF}\x{BA4}\x{BCD}"
+          text run at (3,169) width 247: "\x{BA4}\x{BBF}\x{B9F}\x{BCD}\x{B9F}\x{BAE}\x{BBE}\x{B95}\x{BC1}\x{BAE}\x{BCD}. \x{B87}\x{B99}\x{BCD}\x{B95}\x{BC1} \x{BA8}\x{BC0}\x{B99}\x{BCD}\x{B95}\x{BB3}\x{BC1}\x{BAE}\x{BCD}"
+          text run at (3,196) width 212: "\x{B89}\x{B99}\x{BCD}\x{B95}\x{BB3}\x{BC1}\x{B95}\x{BCD}\x{B95}\x{BC1} \x{BB5}\x{BBF}\x{BB0}\x{BC1}\x{BAA}\x{BCD}\x{BAA}\x{BAE}\x{BBE}\x{BA9}"
+          text run at (3,223) width 206: "\x{BA4}\x{BB2}\x{BC8}\x{BAA}\x{BCD}\x{BAA}\x{BC1}\x{B95}\x{BB3}\x{BBF}\x{BB2}\x{BCD} \x{BAA}\x{BC1}\x{BA4}\x{BBF}\x{BA4}\x{BBE}\x{B95}\x{B95}\x{BCD}"
+          text run at (3,250) width 109: "\x{B95}\x{B9F}\x{BCD}\x{B9F}\x{BC1}\x{BB0}\x{BC8}\x{B95}\x{BB3}\x{BCD}!"
+      LayoutBlockFlow {P} at (0,362) size 769x36
+        LayoutText {#text} at (0,0) size 766x35
+          text run at (0,0) width 766: "This is the same text but specifying a font that covers Tamil. Note that the exclamation point is rendered using the same"
+          text run at (0,18) width 99: "font as the text."
+      LayoutBlockFlow {P} at (0,414) size 306x276 [border: (3px solid #000000)]
+        LayoutText {#text} at (3,5) size 276x265
+          text run at (3,5) width 215: "\x{B87}\x{BA4}\x{BC1} \x{B89}\x{B99}\x{BCD}\x{B95}\x{BB3}\x{BC8}\x{BAA}\x{BCD} \x{BAA}\x{BCB}\x{BA9}\x{BCD}\x{BB1}"
+          text run at (3,32) width 209: "\x{B86}\x{BB0}\x{BCD}\x{BB5}\x{BAE}\x{BC1}\x{B9F}\x{BC8}\x{BAF}\x{BB5}\x{BB0}\x{BCD}\x{B95}\x{BB3}\x{BBE}\x{BB2}\x{BCD}"
+          text run at (3,59) width 267: "\x{BA4}\x{BCA}\x{B95}\x{BC1}\x{B95}\x{BCD}\x{B95}\x{BAA}\x{BCD}\x{BAA}\x{B9F}\x{BCD}\x{B9F}\x{BC1} \x{B95}\x{B9F}\x{BCD}\x{B9F}\x{BC1}\x{BAA}\x{BCD}\x{BAA}\x{BBE}\x{B9F}\x{BC1}\x{B95}\x{BB3}\x{BCD}"
+          text run at (3,86) width 233: "\x{B8F}\x{BA4}\x{BC1}\x{BAE}\x{BCD} \x{B87}\x{BA9}\x{BCD}\x{BB1}\x{BBF} \x{B87}\x{BB2}\x{BB5}\x{B9A}\x{BAE}\x{BBE}\x{B95}\x{BAA}\x{BCD}"
+          text run at (3,113) width 214: "\x{BAA}\x{BAF}\x{BA9}\x{BCD}\x{BAA}\x{B9F}\x{BC1}\x{BA4}\x{BCD}\x{BA4}\x{B95}\x{BCD}\x{B95}\x{BC2}\x{B9F}\x{BBF}\x{BAF} \x{B92}\x{BB0}\x{BC1}"
+          text run at (3,140) width 276: "\x{BAA}\x{BA9}\x{BCD}\x{BAE}\x{BCA}\x{BB4}\x{BBF}\x{B95}\x{BCD} \x{B95}\x{BB2}\x{BC8}\x{B95}\x{BCD} \x{B95}\x{BB3}\x{B9E}\x{BCD}\x{B9A}\x{BBF}\x{BAF}\x{BA4}\x{BCD}"
+          text run at (3,167) width 257: "\x{BA4}\x{BBF}\x{B9F}\x{BCD}\x{B9F}\x{BAE}\x{BBE}\x{B95}\x{BC1}\x{BAE}\x{BCD}. \x{B87}\x{B99}\x{BCD}\x{B95}\x{BC1} \x{BA8}\x{BC0}\x{B99}\x{BCD}\x{B95}\x{BB3}\x{BC1}\x{BAE}\x{BCD}"
+          text run at (3,194) width 218: "\x{B89}\x{B99}\x{BCD}\x{B95}\x{BB3}\x{BC1}\x{B95}\x{BCD}\x{B95}\x{BC1} \x{BB5}\x{BBF}\x{BB0}\x{BC1}\x{BAA}\x{BCD}\x{BAA}\x{BAE}\x{BBE}\x{BA9}"
+          text run at (3,221) width 211: "\x{BA4}\x{BB2}\x{BC8}\x{BAA}\x{BCD}\x{BAA}\x{BC1}\x{B95}\x{BB3}\x{BBF}\x{BB2}\x{BCD} \x{BAA}\x{BC1}\x{BA4}\x{BBF}\x{BA4}\x{BBE}\x{B95}\x{B95}\x{BCD}"
+          text run at (3,248) width 107: "\x{B95}\x{B9F}\x{BCD}\x{B9F}\x{BC1}\x{BB0}\x{BC8}\x{B95}\x{BB3}\x{BCD}!"
diff --git a/third_party/WebKit/LayoutTests/platform/win7/fast/text/international/danda-space-expected.png b/third_party/WebKit/LayoutTests/platform/win7/fast/text/international/danda-space-expected.png
new file mode 100644
index 0000000..b747fea
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/win7/fast/text/international/danda-space-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win7/fast/text/international/danda-space-expected.txt b/third_party/WebKit/LayoutTests/platform/win7/fast/text/international/danda-space-expected.txt
new file mode 100644
index 0000000..786e349
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/win7/fast/text/international/danda-space-expected.txt
@@ -0,0 +1,16 @@
+layer at (0,0) size 800x600
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  LayoutBlockFlow {HTML} at (0,0) size 800x600
+    LayoutBlockFlow {BODY} at (8,8) size 784x576
+      LayoutBlockFlow {P} at (0,0) size 784x18
+        LayoutText {#text} at (0,0) size 54x17
+          text run at (0,0) width 54: "Test for "
+        LayoutInline {A} at (0,0) size 69x17 [color=#0000EE]
+          LayoutText {#text} at (53,0) size 69x17
+            text run at (53,0) width 69: "bug 25464"
+        LayoutText {#text} at (121,0) size 389x17
+          text run at (121,0) width 389: ": Test for rendering of Danda (U+0964) followed by a space."
+      LayoutBlockFlow {P} at (0,34) size 784x32
+        LayoutText {#text} at (0,6) size 297x17
+          text run at (0,6) width 297: "\x{A39}\x{A41}\x{A70}\x{A26}\x{A40} \x{A39}\x{A48}\x{964} \x{A07}\x{A38} \x{A32}\x{A3F}\x{A2A}\x{A40} \x{A26}\x{A47} \x{A35}\x{A3F}\x{A1A} \x{A69}\x{A6B} (35) \x{A05}\x{A71}\x{A16}\x{A30} \x{A39}\x{A41}\x{A70}\x{A26}\x{A47} \x{A39}\x{A28}\x{964}"
diff --git a/third_party/WebKit/LayoutTests/platform/win7/fast/text/international/hebrew-vowels-expected.png b/third_party/WebKit/LayoutTests/platform/win7/fast/text/international/hebrew-vowels-expected.png
new file mode 100644
index 0000000..9cddbf2f
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/win7/fast/text/international/hebrew-vowels-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win7/fast/text/international/hebrew-vowels-expected.txt b/third_party/WebKit/LayoutTests/platform/win7/fast/text/international/hebrew-vowels-expected.txt
new file mode 100644
index 0000000..c171f8a
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/win7/fast/text/international/hebrew-vowels-expected.txt
@@ -0,0 +1,29 @@
+layer at (0,0) size 800x600
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  LayoutBlockFlow {HTML} at (0,0) size 800x600
+    LayoutBlockFlow {BODY} at (8,8) size 784x584
+      LayoutBlockFlow {P} at (0,0) size 784x18
+        LayoutText {#text} at (0,0) size 279x17
+          text run at (0,0) width 279: "This test covers Hebrew vowel positioning."
+      LayoutBlockFlow {HR} at (0,34) size 784x2 [border: (1px inset #EEEEEE)]
+      LayoutBlockFlow {P} at (0,52) size 784x18
+        LayoutText {#text} at (0,0) size 467x17
+          text run at (0,0) width 467: "The vowel (two vertical dots) should be centered beneath the main letter."
+      LayoutBlockFlow {DIV} at (0,86) size 784x91
+        LayoutText {#text} at (48,1) size 59x88
+          text run at (48,1) width 59 RTL: "\x{5E1}\x{5B0} "
+        LayoutText {#text} at (0,1) size 49x88
+          text run at (0,1) width 49 RTL: "\x{5E9}\x{5B0}"
+        LayoutText {#text} at (0,0) size 0x0
+      LayoutBlockFlow {HR} at (0,185) size 784x2 [border: (1px inset #EEEEEE)]
+      LayoutBlockFlow {P} at (0,203) size 784x18
+        LayoutText {#text} at (0,0) size 651x17
+          text run at (0,0) width 651: "The dot should be positioned on the right side of the first letter, and on the left side of the second one."
+      LayoutBlockFlow {DIV} at (0,237) size 784x182
+        LayoutText {#text} at (0,1) size 49x88
+          text run at (0,1) width 49 RTL: "\x{5E9}\x{5C1}"
+        LayoutBR {BR} at (48,72) size 1x0
+        LayoutText {#text} at (0,92) size 49x88
+          text run at (0,92) width 49 RTL: "\x{5E9}\x{5C2}"
+        LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/win7/fast/text/international/khmer-selection-expected.png b/third_party/WebKit/LayoutTests/platform/win7/fast/text/international/khmer-selection-expected.png
new file mode 100644
index 0000000..822e745
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/win7/fast/text/international/khmer-selection-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win7/fast/text/international/khmer-selection-expected.txt b/third_party/WebKit/LayoutTests/platform/win7/fast/text/international/khmer-selection-expected.txt
new file mode 100644
index 0000000..5be0bab2
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/win7/fast/text/international/khmer-selection-expected.txt
@@ -0,0 +1,47 @@
+layer at (0,0) size 800x600
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x127
+  LayoutBlockFlow {HTML} at (0,0) size 800x127
+    LayoutBlockFlow {BODY} at (8,16) size 784x95
+      LayoutBlockFlow {P} at (0,0) size 784x25
+        LayoutInline {NOBR} at (0,0) size 112x17
+          LayoutInline {B} at (0,0) size 18x17
+            LayoutText {#text} at (0,0) size 18x17
+              text run at (0,0) width 18: "\x{179C}\x{17C9}\x{17C2}\x{1794}"
+          LayoutText {#text} at (17,0) size 5x17
+            text run at (17,0) width 5: " "
+          LayoutInline {A} at (0,0) size 27x17 [color=#0000EE]
+            LayoutText {#text} at (21,0) size 27x17
+              text run at (21,0) width 27: "\x{179A}\x{17BC}\x{1794}\x{1797}\x{17B6}\x{1796}"
+          LayoutText {#text} at (47,0) size 5x17
+            text run at (47,0) width 5: " "
+          LayoutInline {A} at (0,0) size 17x17 [color=#0000EE]
+            LayoutText {#text} at (51,0) size 17x17
+              text run at (51,0) width 17: "\x{1780}\x{17D2}\x{179A}\x{17BB}\x{1798}"
+          LayoutText {#text} at (67,0) size 5x17
+            text run at (67,0) width 5: " "
+          LayoutInline {A} at (0,0) size 41x17 [color=#0000EE]
+            LayoutText {#text} at (71,0) size 41x17
+              text run at (71,0) width 41: "\x{1790}\x{178F}\x{17AF}\x{1780}\x{179F}\x{17B6}\x{179A}"
+        LayoutText {#text} at (0,0) size 0x0
+      LayoutBlockFlow {P} at (0,41) size 784x54
+        LayoutText {#text} at (0,0) size 542x17
+          text run at (0,0) width 542: "Some Harfbuzz shapers will output cluster logs which suggest that some glyphs had "
+        LayoutInline {I} at (0,0) size 17x17
+          LayoutText {#text} at (541,0) size 17x17
+            text run at (541,0) width 17: "no"
+        LayoutText {#text} at (557,0) size 780x35
+          text run at (557,0) width 223: " contributing code points. This test"
+          text run at (0,18) width 178: "contains such text and uses "
+        LayoutInline {TT} at (0,0) size 89x16
+          LayoutText {#text} at (177,20) size 89x16
+            text run at (177,20) width 89: "eventSender"
+        LayoutText {#text} at (265,18) size 446x17
+          text run at (265,18) width 446: " to select the text. You should see some of the above text selected and"
+        LayoutInline {TT} at (0,0) size 80x16
+          LayoutText {#text} at (0,38) size 80x16
+            text run at (0,38) width 80: "test_shell"
+        LayoutText {#text} at (80,36) size 262x17
+          text run at (80,36) width 262: " shouldn't trigger any assertions or crash."
+selection start: position 0 of child 0 {#text} of child 0 {B} of child 1 {NOBR} of child 1 {P} of body
+selection end:   position 7 of child 0 {#text} of child 6 {A} of child 1 {NOBR} of child 1 {P} of body
diff --git a/third_party/WebKit/LayoutTests/platform/win7/fast/text/international/lang-glyph-cache-separation-expected.png b/third_party/WebKit/LayoutTests/platform/win7/fast/text/international/lang-glyph-cache-separation-expected.png
new file mode 100644
index 0000000..54a9169
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/win7/fast/text/international/lang-glyph-cache-separation-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win7/fast/text/international/lang-glyph-cache-separation-expected.txt b/third_party/WebKit/LayoutTests/platform/win7/fast/text/international/lang-glyph-cache-separation-expected.txt
new file mode 100644
index 0000000..141086c2
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/win7/fast/text/international/lang-glyph-cache-separation-expected.txt
@@ -0,0 +1,61 @@
+layer at (0,0) size 800x600
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x352
+  LayoutBlockFlow {HTML} at (0,0) size 800x352
+    LayoutBlockFlow {BODY} at (8,8) size 784x336
+      LayoutBlockFlow (anonymous) at (0,0) size 784x54
+        LayoutText {#text} at (0,0) size 340x17
+          text run at (0,0) width 340: "Tests if glyph caches of different languages interfere."
+        LayoutBR {BR} at (339,0) size 1x17
+        LayoutText {#text} at (0,18) size 743x35
+          text run at (0,18) width 743: "On systems that the locales have different font preferences, the following divs should be displayed in corresponding"
+          text run at (0,36) width 179: "preferred fonts respectively."
+        LayoutBR {BR} at (178,36) size 1x17
+      LayoutBlockFlow {DIV} at (0,54) size 784x94
+        LayoutBlockFlow (anonymous) at (0,0) size 784x18
+          LayoutText {#text} at (0,0) size 130x17
+            text run at (0,0) width 130: "Default font-family:"
+        LayoutBlockFlow {DIV} at (0,18) size 784x19
+          LayoutText {#text} at (0,1) size 180x17
+            text run at (0,1) width 180: "Simplified Chinese: \x{8AA4}\x{904E}\x{9AA8}"
+        LayoutBlockFlow {DIV} at (0,37) size 784x19
+          LayoutText {#text} at (0,1) size 183x17
+            text run at (0,1) width 183: "Traditional Chinese: \x{8AA4}\x{904E}\x{9AA8}"
+        LayoutBlockFlow {DIV} at (0,56) size 784x19
+          LayoutText {#text} at (0,1) size 114x17
+            text run at (0,1) width 114: "Japanese: \x{8AA4}\x{904E}\x{9AA8}"
+        LayoutBlockFlow {DIV} at (0,75) size 784x19
+          LayoutText {#text} at (0,1) size 104x17
+            text run at (0,1) width 104: "Korean: \x{8AA4}\x{904E}\x{9AA8}"
+      LayoutBlockFlow {DIV} at (0,148) size 784x94
+        LayoutBlockFlow (anonymous) at (0,0) size 784x18
+          LayoutText {#text} at (0,0) size 224x17
+            text run at (0,0) width 224: "Generic font-family (sans-serif):"
+        LayoutBlockFlow {DIV} at (0,18) size 784x19
+          LayoutText {#text} at (0,1) size 190x17
+            text run at (0,1) width 190: "Simplified Chinese: \x{8AA4}\x{904E}\x{9AA8}"
+        LayoutBlockFlow {DIV} at (0,37) size 784x19
+          LayoutText {#text} at (0,1) size 195x17
+            text run at (0,1) width 195: "Traditional Chinese: \x{8AA4}\x{904E}\x{9AA8}"
+        LayoutBlockFlow {DIV} at (0,56) size 784x19
+          LayoutText {#text} at (0,1) size 127x17
+            text run at (0,1) width 127: "Japanese: \x{8AA4}\x{904E}\x{9AA8}"
+        LayoutBlockFlow {DIV} at (0,75) size 784x19
+          LayoutText {#text} at (0,1) size 109x17
+            text run at (0,1) width 109: "Korean: \x{8AA4}\x{904E}\x{9AA8}"
+      LayoutBlockFlow {DIV} at (0,242) size 784x94
+        LayoutBlockFlow (anonymous) at (0,0) size 784x18
+          LayoutText {#text} at (0,0) size 300x17
+            text run at (0,0) width 300: "Non-generic font-family (Times New Roman):"
+        LayoutBlockFlow {DIV} at (0,18) size 784x19
+          LayoutText {#text} at (0,1) size 180x17
+            text run at (0,1) width 180: "Simplified Chinese: \x{8AA4}\x{904E}\x{9AA8}"
+        LayoutBlockFlow {DIV} at (0,37) size 784x19
+          LayoutText {#text} at (0,1) size 183x17
+            text run at (0,1) width 183: "Traditional Chinese: \x{8AA4}\x{904E}\x{9AA8}"
+        LayoutBlockFlow {DIV} at (0,56) size 784x19
+          LayoutText {#text} at (0,1) size 114x17
+            text run at (0,1) width 114: "Japanese: \x{8AA4}\x{904E}\x{9AA8}"
+        LayoutBlockFlow {DIV} at (0,75) size 784x19
+          LayoutText {#text} at (0,1) size 104x17
+            text run at (0,1) width 104: "Korean: \x{8AA4}\x{904E}\x{9AA8}"
diff --git a/third_party/WebKit/LayoutTests/platform/win7/fast/text/international/plane2-expected.png b/third_party/WebKit/LayoutTests/platform/win7/fast/text/international/plane2-expected.png
new file mode 100644
index 0000000..c04145b1
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/win7/fast/text/international/plane2-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win7/fast/text/international/plane2-expected.txt b/third_party/WebKit/LayoutTests/platform/win7/fast/text/international/plane2-expected.txt
new file mode 100644
index 0000000..9cf54b3
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/win7/fast/text/international/plane2-expected.txt
@@ -0,0 +1,22 @@
+layer at (0,0) size 800x600
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  LayoutBlockFlow {HTML} at (0,0) size 800x600
+    LayoutBlockFlow {BODY} at (8,8) size 784x584
+      LayoutBlockFlow {P} at (0,0) size 784x54
+        LayoutText {#text} at (0,0) size 54x17
+          text run at (0,0) width 54: "Test for "
+        LayoutInline {A} at (0,0) size 69x17 [color=#0000EE]
+          LayoutText {#text} at (53,0) size 69x17
+            text run at (53,0) width 69: "bug 35605"
+        LayoutText {#text} at (121,0) size 771x53
+          text run at (121,0) width 640: ": Two lines below have one character from CJK Ideograph, one from CJK Ext A (both in BMP) and"
+          text run at (0,18) width 771: "three characters from CJK Ext B (plane 2). The last group of characters are covered by Japanese fonts on Mac as well as"
+          text run at (0,36) width 334: "two Chinese fonts for Ext B shipped with Windows."
+      LayoutBlockFlow {DIV} at (0,70) size 784x76
+        LayoutBlockFlow {DIV} at (0,0) size 784x38
+          LayoutText {#text} at (0,1) size 176x36
+            text run at (0,1) width 176: "\x{4E00} \x{3400} \x{D867}\x{DE8A}\x{D867}\x{DE49}\x{D867}\x{DEDB}"
+        LayoutBlockFlow {DIV} at (0,38) size 784x38
+          LayoutText {#text} at (0,1) size 176x36
+            text run at (0,1) width 176: "\x{4E00} \x{3400} \x{D867}\x{DE8A}\x{D867}\x{DE49}\x{D867}\x{DEDB}"
diff --git a/third_party/WebKit/LayoutTests/platform/win7/fast/text/international/pop-up-button-text-alignment-and-direction-expected.png b/third_party/WebKit/LayoutTests/platform/win7/fast/text/international/pop-up-button-text-alignment-and-direction-expected.png
new file mode 100644
index 0000000..c1b3a27
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/win7/fast/text/international/pop-up-button-text-alignment-and-direction-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win7/fast/text/international/pop-up-button-text-alignment-and-direction-expected.txt b/third_party/WebKit/LayoutTests/platform/win7/fast/text/international/pop-up-button-text-alignment-and-direction-expected.txt
new file mode 100644
index 0000000..8899fb77
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/win7/fast/text/international/pop-up-button-text-alignment-and-direction-expected.txt
@@ -0,0 +1,99 @@
+layer at (0,0) size 800x600
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x522
+  LayoutBlockFlow {HTML} at (0,0) size 800x522
+    LayoutBlockFlow {BODY} at (8,16) size 784x498
+      LayoutBlockFlow {P} at (0,0) size 784x18
+        LayoutText {#text} at (0,0) size 709x17
+          text run at (0,0) width 497: "Verify that the alignment and writing direction of each selected item matches "
+          text run at (496,0) width 213: "the one below the pop-up button."
+      LayoutBlockFlow {DIV} at (0,34) size 784x232
+        LayoutMenuList {SELECT} at (0,0) size 500x22 [bgcolor=#FFFFFF] [border: (1px solid #A9A9A9)]
+          LayoutBlockFlow (anonymous) at (1,1) size 498x20
+            LayoutText (anonymous) at (4,1) size 177x17
+              text run at (4,1) width 36: "First "
+              text run at (39,1) width 54 RTL: ") \x{5E8}\x{5D1}\x{5D9}\x{5E2}\x{5D9}\x{5EA}"
+              text run at (92,1) width 19: "03"
+              text run at (110,1) width 41 RTL: "\x{5E9}\x{5E0}\x{5D9}\x{5D4} ("
+              text run at (150,1) width 31: " fifth"
+        LayoutBlockFlow {DIV} at (0,22) size 470x36
+          LayoutText {#text} at (10,10) size 133x15
+            text run at (10,10) width 27: "First "
+            text run at (37,10) width 38 RTL: ") \x{5E8}\x{5D1}\x{5D9}\x{5E2}\x{5D9}\x{5EA}"
+            text run at (75,10) width 14: "03"
+            text run at (89,10) width 28 RTL: "\x{5E9}\x{5E0}\x{5D9}\x{5D4} ("
+            text run at (117,10) width 26: " fifth"
+        LayoutMenuList {SELECT} at (0,58) size 500x22 [bgcolor=#FFFFFF] [border: (1px solid #A9A9A9)]
+          LayoutBlockFlow (anonymous) at (1,1) size 498x20
+            LayoutText (anonymous) at (4,1) size 177x17
+              text run at (4,1) width 26: "fifth"
+              text run at (29,1) width 59 RTL: ") \x{5E8}\x{5D1}\x{5D9}\x{5E2}\x{5D9}\x{5EA} "
+              text run at (87,1) width 19: "03"
+              text run at (105,1) width 45 RTL: " \x{5E9}\x{5E0}\x{5D9}\x{5D4} ("
+              text run at (149,1) width 32: "First"
+        LayoutBlockFlow {DIV} at (0,80) size 470x36
+          LayoutText {#text} at (10,10) size 133x15
+            text run at (10,10) width 23: "fifth"
+            text run at (33,10) width 41 RTL: ") \x{5E8}\x{5D1}\x{5D9}\x{5E2}\x{5D9}\x{5EA} "
+            text run at (74,10) width 14: "03"
+            text run at (88,10) width 31 RTL: " \x{5E9}\x{5E0}\x{5D9}\x{5D4} ("
+            text run at (119,10) width 24: "First"
+        LayoutMenuList {SELECT} at (0,116) size 500x22 [bgcolor=#FFFFFF] [border: (1px solid #A9A9A9)]
+          LayoutBlockFlow (anonymous) at (1,1) size 498x20
+            LayoutText (anonymous) at (4,1) size 177x17
+              text run at (4,1) width 177 LTR override: "First \x{5E9}\x{5E0}\x{5D9}\x{5D4} (03) \x{5E8}\x{5D1}\x{5D9}\x{5E2}\x{5D9}\x{5EA} fifth"
+        LayoutBlockFlow {DIV} at (0,138) size 470x36
+          LayoutText {#text} at (10,10) size 133x15
+            text run at (10,10) width 133 LTR override: "First \x{5E9}\x{5E0}\x{5D9}\x{5D4} (03) \x{5E8}\x{5D1}\x{5D9}\x{5E2}\x{5D9}\x{5EA} fifth"
+        LayoutMenuList {SELECT} at (0,174) size 500x22 [bgcolor=#FFFFFF] [border: (1px solid #A9A9A9)]
+          LayoutBlockFlow (anonymous) at (1,1) size 498x20
+            LayoutText (anonymous) at (4,1) size 177x17
+              text run at (4,1) width 177 RTL override: "First \x{5E9}\x{5E0}\x{5D9}\x{5D4} (03) \x{5E8}\x{5D1}\x{5D9}\x{5E2}\x{5D9}\x{5EA} fifth"
+        LayoutBlockFlow {DIV} at (0,196) size 470x36
+          LayoutText {#text} at (10,10) size 133x15
+            text run at (10,10) width 133 RTL override: "First \x{5E9}\x{5E0}\x{5D9}\x{5D4} (03) \x{5E8}\x{5D1}\x{5D9}\x{5E2}\x{5D9}\x{5EA} fifth"
+      LayoutBlockFlow {DIV} at (0,266) size 784x232
+        LayoutMenuList {SELECT} at (0,0) size 500x22 [bgcolor=#FFFFFF] [border: (1px solid #A9A9A9)]
+          LayoutBlockFlow (anonymous) at (1,1) size 498x20
+            LayoutText (anonymous) at (317,1) size 177x17
+              text run at (317,1) width 36: "First "
+              text run at (352,1) width 54 RTL: ") \x{5E8}\x{5D1}\x{5D9}\x{5E2}\x{5D9}\x{5EA}"
+              text run at (405,1) width 19: "03"
+              text run at (423,1) width 41 RTL: "\x{5E9}\x{5E0}\x{5D9}\x{5D4} ("
+              text run at (463,1) width 31: " fifth"
+        LayoutBlockFlow {DIV} at (0,22) size 470x36
+          LayoutText {#text} at (327,10) size 133x15
+            text run at (327,10) width 27: "First "
+            text run at (354,10) width 38 RTL: ") \x{5E8}\x{5D1}\x{5D9}\x{5E2}\x{5D9}\x{5EA}"
+            text run at (392,10) width 14: "03"
+            text run at (406,10) width 28 RTL: "\x{5E9}\x{5E0}\x{5D9}\x{5D4} ("
+            text run at (434,10) width 26: " fifth"
+        LayoutMenuList {SELECT} at (0,58) size 500x22 [bgcolor=#FFFFFF] [border: (1px solid #A9A9A9)]
+          LayoutBlockFlow (anonymous) at (1,1) size 498x20
+            LayoutText (anonymous) at (317,1) size 177x17
+              text run at (317,1) width 26: "fifth"
+              text run at (342,1) width 59 RTL: ") \x{5E8}\x{5D1}\x{5D9}\x{5E2}\x{5D9}\x{5EA} "
+              text run at (400,1) width 19: "03"
+              text run at (418,1) width 45 RTL: " \x{5E9}\x{5E0}\x{5D9}\x{5D4} ("
+              text run at (462,1) width 32: "First"
+        LayoutBlockFlow {DIV} at (0,80) size 470x36
+          LayoutText {#text} at (327,10) size 133x15
+            text run at (327,10) width 23: "fifth"
+            text run at (350,10) width 41 RTL: ") \x{5E8}\x{5D1}\x{5D9}\x{5E2}\x{5D9}\x{5EA} "
+            text run at (391,10) width 14: "03"
+            text run at (405,10) width 31 RTL: " \x{5E9}\x{5E0}\x{5D9}\x{5D4} ("
+            text run at (436,10) width 24: "First"
+        LayoutMenuList {SELECT} at (0,116) size 500x22 [bgcolor=#FFFFFF] [border: (1px solid #A9A9A9)]
+          LayoutBlockFlow (anonymous) at (1,1) size 498x20
+            LayoutText (anonymous) at (317,1) size 177x17
+              text run at (317,1) width 177 LTR override: "First \x{5E9}\x{5E0}\x{5D9}\x{5D4} (03) \x{5E8}\x{5D1}\x{5D9}\x{5E2}\x{5D9}\x{5EA} fifth"
+        LayoutBlockFlow {DIV} at (0,138) size 470x36
+          LayoutText {#text} at (327,10) size 133x15
+            text run at (327,10) width 133 LTR override: "First \x{5E9}\x{5E0}\x{5D9}\x{5D4} (03) \x{5E8}\x{5D1}\x{5D9}\x{5E2}\x{5D9}\x{5EA} fifth"
+        LayoutMenuList {SELECT} at (0,174) size 500x22 [bgcolor=#FFFFFF] [border: (1px solid #A9A9A9)]
+          LayoutBlockFlow (anonymous) at (1,1) size 498x20
+            LayoutText (anonymous) at (317,1) size 177x17
+              text run at (317,1) width 177 RTL override: "First \x{5E9}\x{5E0}\x{5D9}\x{5D4} (03) \x{5E8}\x{5D1}\x{5D9}\x{5E2}\x{5D9}\x{5EA} fifth"
+        LayoutBlockFlow {DIV} at (0,196) size 470x36
+          LayoutText {#text} at (327,10) size 133x15
+            text run at (327,10) width 133 RTL override: "First \x{5E9}\x{5E0}\x{5D9}\x{5D4} (03) \x{5E8}\x{5D1}\x{5D9}\x{5E2}\x{5D9}\x{5EA} fifth"
diff --git a/third_party/WebKit/LayoutTests/platform/win7/fast/text/international/rtl-white-space-pre-wrap-expected.png b/third_party/WebKit/LayoutTests/platform/win7/fast/text/international/rtl-white-space-pre-wrap-expected.png
new file mode 100644
index 0000000..59239cf
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/win7/fast/text/international/rtl-white-space-pre-wrap-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win7/fast/text/international/rtl-white-space-pre-wrap-expected.txt b/third_party/WebKit/LayoutTests/platform/win7/fast/text/international/rtl-white-space-pre-wrap-expected.txt
new file mode 100644
index 0000000..a653c4c
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/win7/fast/text/international/rtl-white-space-pre-wrap-expected.txt
@@ -0,0 +1,38 @@
+layer at (0,0) size 800x600
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  LayoutBlockFlow {HTML} at (0,0) size 800x600
+    LayoutBlockFlow {BODY} at (8,8) size 784x584
+      LayoutBlockFlow {P} at (0,0) size 784x36
+        LayoutText {#text} at (0,0) size 108x17
+          text run at (0,0) width 108: "This is a test for "
+        LayoutInline {I} at (0,0) size 762x35
+          LayoutInline {A} at (0,0) size 353x17 [color=#0000EE]
+            LayoutText {#text} at (107,0) size 353x17
+              text run at (107,0) width 353: "http://bugzilla.opendarwin.org/show_bug.cgi?id=9670"
+          LayoutText {#text} at (459,0) size 762x35
+            text run at (459,0) width 5: " "
+            text run at (463,0) width 299: "http://bugzilla.opendarwin.org/show_bug.cgi?"
+            text run at (0,18) width 56: "id=9670"
+        LayoutText {#text} at (55,18) size 5x17
+          text run at (55,18) width 5: "."
+      LayoutBlockFlow {P} at (0,52) size 784x18
+        LayoutText {#text} at (0,0) size 553x17
+          text run at (0,0) width 553: "All text should be aligned with the right edge of its container and should not overflow."
+      LayoutBlockFlow {HR} at (0,86) size 784x2 [border: (1px inset #EEEEEE)]
+      LayoutBlockFlow {DIV} at (0,96) size 191x27 [bgcolor=#FFFF00]
+        LayoutText {#text} at (0,0) size 191x26
+          text run at (0,0) width 191 RTL: "\x{5D0}\x{5DB}\x{5DC}\x{5EA} \x{5E4}\x{5DC}\x{5E4}\x{5DC}? \x{5E9}\x{5EA}\x{5D4} \x{5DE}\x{5D9}\x{5E5}!"
+      LayoutBlockFlow (anonymous) at (0,123) size 784x80
+        LayoutBR {BR} at (0,0) size 0x17
+        LayoutText {#text} at (199,62) size 4x17
+          text run at (199,62) width 4: " "
+        LayoutBR {BR} at (0,0) size 0x0
+      LayoutBlockFlow {DIV} at (0,203) size 191x27 [bgcolor=#FFFF00]
+        LayoutText {#text} at (0,0) size 191x26
+          text run at (0,0) width 191 RTL: "\x{5D0}\x{5DB}\x{5DC}\x{5EA} \x{5E4}\x{5DC}\x{5E4}\x{5DC}? \x{5E9}\x{5EA}\x{5D4} \x{5DE}\x{5D9}\x{5E5}!"
+layer at (8,149) size 199x58 clip at (9,150) size 197x56
+  LayoutTextControl {TEXTAREA} at (0,18) size 199x58 [bgcolor=#FFFFFF] [border: (1px solid #A9A9A9)]
+    LayoutBlockFlow {DIV} at (3,3) size 195x27
+      LayoutText {#text} at (4,0) size 191x26
+        text run at (4,0) width 191 RTL: "\x{5D0}\x{5DB}\x{5DC}\x{5EA} \x{5E4}\x{5DC}\x{5E4}\x{5DC}? \x{5E9}\x{5EA}\x{5D4} \x{5DE}\x{5D9}\x{5E5}!"
diff --git a/third_party/WebKit/LayoutTests/platform/win7/fast/text/international/wrap-CJK-001-expected.png b/third_party/WebKit/LayoutTests/platform/win7/fast/text/international/wrap-CJK-001-expected.png
new file mode 100644
index 0000000..3d5975b
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/win7/fast/text/international/wrap-CJK-001-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win7/fast/text/letter-spacing-negative-opacity-expected.png b/third_party/WebKit/LayoutTests/platform/win7/fast/text/letter-spacing-negative-opacity-expected.png
new file mode 100644
index 0000000..91fc8c2
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/win7/fast/text/letter-spacing-negative-opacity-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win7/fast/text/letter-spacing-negative-opacity-expected.txt b/third_party/WebKit/LayoutTests/platform/win7/fast/text/letter-spacing-negative-opacity-expected.txt
new file mode 100644
index 0000000..7b0f37f
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/win7/fast/text/letter-spacing-negative-opacity-expected.txt
@@ -0,0 +1,9 @@
+layer at (0,0) size 800x600
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  LayoutBlockFlow {HTML} at (0,0) size 800x600
+    LayoutBlockFlow {BODY} at (8,8) size 784x584
+layer at (8,8) size 273x163 transparent
+  LayoutBlockFlow (positioned) {DIV} at (8,8) size 273.20x163 [border: (1px solid #FF0000)]
+    LayoutText {#text} at (1,4) size 272x155
+      text run at (1,4) width 272: "Testing the bug"
diff --git a/third_party/WebKit/LayoutTests/platform/win7/fast/text/midword-break-hang-expected.png b/third_party/WebKit/LayoutTests/platform/win7/fast/text/midword-break-hang-expected.png
new file mode 100644
index 0000000..c420d22
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/win7/fast/text/midword-break-hang-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win7/fast/text/midword-break-hang-expected.txt b/third_party/WebKit/LayoutTests/platform/win7/fast/text/midword-break-hang-expected.txt
new file mode 100644
index 0000000..7c97d2d
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/win7/fast/text/midword-break-hang-expected.txt
@@ -0,0 +1,23 @@
+layer at (0,0) size 800x600
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  LayoutBlockFlow {HTML} at (0,0) size 800x600
+    LayoutBlockFlow {BODY} at (8,8) size 784x584
+      LayoutBlockFlow {P} at (0,0) size 784x36
+        LayoutText {#text} at (0,0) size 177x17
+          text run at (0,0) width 177: "This is a regression test for "
+        LayoutInline {I} at (0,0) size 723x35
+          LayoutInline {A} at (0,0) size 354x17 [color=#0000EE]
+            LayoutText {#text} at (176,0) size 354x17
+              text run at (176,0) width 354: "http://bugzilla.opendarwin.org/show_bug.cgi?id=8485"
+          LayoutText {#text} at (529,0) size 723x35
+            text run at (529,0) width 5: " "
+            text run at (533,0) width 190: "iExploder(#11705): Freeze in"
+            text run at (0,18) width 176: "LayoutBlockFlow::layout()"
+        LayoutText {#text} at (175,18) size 5x17
+          text run at (175,18) width 5: "."
+      LayoutBlockFlow {HR} at (0,52) size 784x2 [border: (1px inset #EEEEEE)]
+      LayoutBlockFlow {DIV} at (0,62) size 30x276
+        LayoutText {#text} at (0,2) size 87x271
+          text run at (0,2) width 0: " "
+          text run at (0,140) width 87: "A"
diff --git a/third_party/WebKit/LayoutTests/platform/win7/fast/text/shadow-no-blur-expected.png b/third_party/WebKit/LayoutTests/platform/win7/fast/text/shadow-no-blur-expected.png
new file mode 100644
index 0000000..f5f2faece
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/win7/fast/text/shadow-no-blur-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win7/fast/text/shadow-no-blur-expected.txt b/third_party/WebKit/LayoutTests/platform/win7/fast/text/shadow-no-blur-expected.txt
new file mode 100644
index 0000000..3d0e4b8
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/win7/fast/text/shadow-no-blur-expected.txt
@@ -0,0 +1,21 @@
+layer at (0,0) size 800x600
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  LayoutBlockFlow {HTML} at (0,0) size 800x600
+    LayoutBlockFlow {BODY} at (8,8) size 784x584
+      LayoutBlockFlow {DIV} at (0,0) size 784x275 [color=#0000007F]
+        LayoutBlockFlow {DIV} at (0,0) size 784x55
+          LayoutText {#text} at (0,1) size 244x53
+            text run at (0,1) width 244: "Text shadow"
+        LayoutBlockFlow {DIV} at (0,55) size 784x55
+          LayoutText {#text} at (0,1) size 244x53
+            text run at (0,1) width 244: "Text shadow"
+        LayoutBlockFlow {DIV} at (0,110) size 784x55
+          LayoutText {#text} at (0,1) size 244x53
+            text run at (0,1) width 244: "Text shadow"
+        LayoutBlockFlow {DIV} at (0,165) size 784x55
+          LayoutText {#text} at (0,1) size 244x53
+            text run at (0,1) width 244: "Text shadow"
+        LayoutBlockFlow {DIV} at (0,220) size 784x55
+          LayoutText {#text} at (0,1) size 244x53
+            text run at (0,1) width 244: "Text shadow"
diff --git a/third_party/WebKit/LayoutTests/platform/win7/fast/text/shaping/same-script-different-lang-expected.png b/third_party/WebKit/LayoutTests/platform/win7/fast/text/shaping/same-script-different-lang-expected.png
new file mode 100644
index 0000000..03b4171
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/win7/fast/text/shaping/same-script-different-lang-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win7/fast/text/stroking-decorations-expected.png b/third_party/WebKit/LayoutTests/platform/win7/fast/text/stroking-decorations-expected.png
new file mode 100644
index 0000000..a235ae0
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/win7/fast/text/stroking-decorations-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win7/fast/text/stroking-decorations-expected.txt b/third_party/WebKit/LayoutTests/platform/win7/fast/text/stroking-decorations-expected.txt
new file mode 100644
index 0000000..d4f3151
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/win7/fast/text/stroking-decorations-expected.txt
@@ -0,0 +1,17 @@
+layer at (0,0) size 800x600
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  LayoutBlockFlow {HTML} at (0,0) size 800x600
+    LayoutBlockFlow {BODY} at (8,8) size 784x584
+      LayoutBlockFlow {DIV} at (0,0) size 784x148 [textFillColor=#800080] [textStrokeWidth=2.00]
+        LayoutText {#text} at (0,1) size 761x145
+          text run at (0,1) width 617: "Purple\x{300} fill, black stroke,"
+          text run at (0,75) width 761: "complex text, black underline"
+      LayoutBlockFlow {DIV} at (0,148) size 784x148 [textStrokeColor=#FFA500] [textStrokeWidth=1.33]
+        LayoutText {#text} at (0,1) size 638x145
+          text run at (0,1) width 638: "Orange stroke, black fill,"
+          text run at (0,75) width 416: "orange overline."
+      LayoutBlockFlow {DIV} at (0,296) size 784x148 [textFillColor=#0000FF] [textStrokeWidth=1.33]
+        LayoutText {#text} at (0,1) size 598x145
+          text run at (0,1) width 598: "No stroke, blue fill, red"
+          text run at (0,75) width 592: "shadow, blue underline"
diff --git a/third_party/WebKit/LayoutTests/platform/win7/fast/text/stroking-expected.png b/third_party/WebKit/LayoutTests/platform/win7/fast/text/stroking-expected.png
new file mode 100644
index 0000000..6979c0a
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/win7/fast/text/stroking-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win7/fast/text/stroking-expected.txt b/third_party/WebKit/LayoutTests/platform/win7/fast/text/stroking-expected.txt
new file mode 100644
index 0000000..8a4c9ab
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/win7/fast/text/stroking-expected.txt
@@ -0,0 +1,16 @@
+layer at (0,0) size 800x600
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  LayoutBlockFlow {HTML} at (0,0) size 800x600
+    LayoutBlockFlow {BODY} at (8,8) size 784x584
+      LayoutBlockFlow {DIV} at (0,0) size 784x148 [textFillColor=#800080] [textStrokeWidth=2.00]
+        LayoutText {#text} at (0,1) size 617x145
+          text run at (0,1) width 617: "Purple\x{300} fill, black stroke,"
+          text run at (0,75) width 333: "complex text"
+      LayoutBlockFlow {DIV} at (0,148) size 784x74 [textStrokeColor=#FFA500] [textStrokeWidth=1.33]
+        LayoutText {#text} at (0,1) size 638x71
+          text run at (0,1) width 638: "Orange stroke, black fill."
+      LayoutBlockFlow {DIV} at (0,222) size 784x148 [textStrokeColor=#0000FF] [textStrokeWidth=1.33]
+        LayoutText {#text} at (0,1) size 594x145
+          text run at (0,1) width 594: "Blue stroke, no fill, red"
+          text run at (0,75) width 208: "shadow."
diff --git a/third_party/WebKit/LayoutTests/platform/win7/fast/text/sub-pixel/text-scaling-pixel-expected.png b/third_party/WebKit/LayoutTests/platform/win7/fast/text/sub-pixel/text-scaling-pixel-expected.png
new file mode 100644
index 0000000..8b19974
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/win7/fast/text/sub-pixel/text-scaling-pixel-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win7/fast/text/sub-pixel/text-scaling-pixel-expected.txt b/third_party/WebKit/LayoutTests/platform/win7/fast/text/sub-pixel/text-scaling-pixel-expected.txt
new file mode 100644
index 0000000..6a724de
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/win7/fast/text/sub-pixel/text-scaling-pixel-expected.txt
@@ -0,0 +1,992 @@
+layer at (0,0) size 800x600 scrollWidth 803 scrollHeight 1299
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x1299 backgroundClip at (0,0) size 800x600 clip at (0,0) size 800x600
+  LayoutBlockFlow {HTML} at (0,0) size 800x1299
+    LayoutBlockFlow {BODY} at (8,8) size 784x1283
+      LayoutBlockFlow {SECTION} at (0,0) size 795.11x1267
+        LayoutBlockFlow {H1} at (0,0) size 795.11x27
+          LayoutText {#text} at (0,0) size 281x26
+            text run at (0,0) width 281: "Font Size Scaling Pixel Test"
+        LayoutBlockFlow {P} at (0,31) size 795.11x18
+          LayoutText {#text} at (0,0) size 766x17
+            text run at (0,0) width 250: "Size of the text should scale smoothly. "
+            text run at (249,0) width 517: "Reported width should be within 0.02px of that of the highlighted reference row."
+        LayoutBlockFlow {DIV} at (0,53) size 795.11x1214
+          LayoutBlockFlow {DIV} at (0,0) size 795.11x12 [border: none (1px solid #000000) none]
+            LayoutBlockFlow {DIV} at (0,0) size 67.39x11
+              LayoutText {#text} at (18,0) size 45x11
+                text run at (18,0) width 45: "Font Size"
+            LayoutBlockFlow {DIV} at (67.39,0) size 67.39x11
+              LayoutText {#text} at (36,0) size 27x11
+                text run at (36,0) width 27: "Width"
+            LayoutBlockFlow {DIV} at (134.78,0) size 67.39x11
+              LayoutText {#text} at (11,0) size 52x11
+                text run at (11,0) width 52: "Normalized"
+            LayoutBlockFlow {DIV} at (202.17,0) size 67.39x11
+              LayoutText {#text} at (47,0) size 16x11
+                text run at (47,0) width 16: "Diff"
+            LayoutInline {SPAN} at (0,0) size 38x11
+              LayoutText {#text} at (269,0) size 38x11
+                text run at (269,0) width 38: "Content"
+          LayoutBlockFlow {DIV} at (0,12) size 795.11x11
+            LayoutBlockFlow {DIV} at (0,0) size 67.39x11
+              LayoutText {#text} at (35,0) size 28x11
+                text run at (35,0) width 28: "10.00"
+            LayoutBlockFlow {DIV} at (67.39,0) size 67.39x11
+              LayoutText {#text} at (29,0) size 34x11
+                text run at (29,0) width 34: "221.00"
+            LayoutBlockFlow {DIV} at (134.78,0) size 67.39x11
+              LayoutText {#text} at (29,0) size 34x11
+                text run at (29,0) width 34: "265.20"
+            LayoutBlockFlow {DIV} at (202.17,0) size 67.39x11 [color=#FF0000]
+              LayoutText {#text} at (41,0) size 22x11
+                text run at (41,0) width 22: "4.20"
+            LayoutInline {SPAN} at (0,0) size 222x11
+              LayoutText {#text} at (269,0) size 222x11
+                text run at (269,0) width 222: "Amazingly few discotheques provide jukeboxes."
+          LayoutBlockFlow {DIV} at (0,23) size 795.11x11
+            LayoutBlockFlow {DIV} at (0,0) size 67.39x11
+              LayoutText {#text} at (35,0) size 28x11
+                text run at (35,0) width 28: "10.25"
+            LayoutBlockFlow {DIV} at (67.39,0) size 67.39x11
+              LayoutText {#text} at (29,0) size 34x11
+                text run at (29,0) width 34: "222.00"
+            LayoutBlockFlow {DIV} at (134.78,0) size 67.39x11
+              LayoutText {#text} at (29,0) size 34x11
+                text run at (29,0) width 34: "259.90"
+            LayoutBlockFlow {DIV} at (202.17,0) size 67.39x11 [color=#FF0000]
+              LayoutText {#text} at (38,0) size 25x11
+                text run at (38,0) width 25: "-1.10"
+            LayoutInline {SPAN} at (0,0) size 223x11
+              LayoutText {#text} at (269,0) size 223x11
+                text run at (269,0) width 223: "Amazingly few discotheques provide jukeboxes."
+          LayoutBlockFlow {DIV} at (0,34) size 795.11x12
+            LayoutBlockFlow {DIV} at (0,1) size 67.39x11
+              LayoutText {#text} at (35,0) size 28x11
+                text run at (35,0) width 28: "10.50"
+            LayoutBlockFlow {DIV} at (67.39,1) size 67.39x11
+              LayoutText {#text} at (29,0) size 34x11
+                text run at (29,0) width 34: "223.00"
+            LayoutBlockFlow {DIV} at (134.78,1) size 67.39x11
+              LayoutText {#text} at (29,0) size 34x11
+                text run at (29,0) width 34: "254.86"
+            LayoutBlockFlow {DIV} at (202.17,1) size 67.39x11 [color=#FF0000]
+              LayoutText {#text} at (38,0) size 25x11
+                text run at (38,0) width 25: "-6.14"
+            LayoutInline {SPAN} at (0,0) size 224x12
+              LayoutText {#text} at (269,0) size 224x12
+                text run at (269,0) width 224: "Amazingly few discotheques provide jukeboxes."
+          LayoutBlockFlow {DIV} at (0,46) size 795.11x12
+            LayoutBlockFlow {DIV} at (0,1) size 67.39x11
+              LayoutText {#text} at (35,0) size 28x11
+                text run at (35,0) width 28: "10.75"
+            LayoutBlockFlow {DIV} at (67.39,1) size 67.39x11
+              LayoutText {#text} at (29,0) size 34x11
+                text run at (29,0) width 34: "224.00"
+            LayoutBlockFlow {DIV} at (134.78,1) size 67.39x11
+              LayoutText {#text} at (29,0) size 34x11
+                text run at (29,0) width 34: "250.05"
+            LayoutBlockFlow {DIV} at (202.17,1) size 67.39x11 [color=#FF0000]
+              LayoutText {#text} at (32,0) size 31x11
+                text run at (32,0) width 31: "-10.95"
+            LayoutInline {SPAN} at (0,0) size 225x12
+              LayoutText {#text} at (269,0) size 225x12
+                text run at (269,0) width 225: "Amazingly few discotheques provide jukeboxes."
+          LayoutBlockFlow {DIV} at (0,58) size 795.11x12
+            LayoutBlockFlow {DIV} at (0,1) size 67.39x11
+              LayoutText {#text} at (35,0) size 28x11
+                text run at (35,0) width 28: "11.00"
+            LayoutBlockFlow {DIV} at (67.39,1) size 67.39x11
+              LayoutText {#text} at (29,0) size 34x11
+                text run at (29,0) width 34: "233.00"
+            LayoutBlockFlow {DIV} at (134.78,1) size 67.39x11
+              LayoutText {#text} at (29,0) size 34x11
+                text run at (29,0) width 34: "254.18"
+            LayoutBlockFlow {DIV} at (202.17,1) size 67.39x11 [color=#FF0000]
+              LayoutText {#text} at (38,0) size 25x11
+                text run at (38,0) width 25: "-6.82"
+            LayoutInline {SPAN} at (0,0) size 234x12
+              LayoutText {#text} at (269,0) size 234x12
+                text run at (269,0) width 234: "Amazingly few discotheques provide jukeboxes."
+          LayoutBlockFlow {DIV} at (0,70) size 795.11x12
+            LayoutBlockFlow {DIV} at (0,1) size 67.39x11
+              LayoutText {#text} at (35,0) size 28x11
+                text run at (35,0) width 28: "11.25"
+            LayoutBlockFlow {DIV} at (67.39,1) size 67.39x11
+              LayoutText {#text} at (29,0) size 34x11
+                text run at (29,0) width 34: "234.00"
+            LayoutBlockFlow {DIV} at (134.78,1) size 67.39x11
+              LayoutText {#text} at (29,0) size 34x11
+                text run at (29,0) width 34: "249.60"
+            LayoutBlockFlow {DIV} at (202.17,1) size 67.39x11 [color=#FF0000]
+              LayoutText {#text} at (32,0) size 31x11
+                text run at (32,0) width 31: "-11.40"
+            LayoutInline {SPAN} at (0,0) size 235x12
+              LayoutText {#text} at (269,0) size 235x12
+                text run at (269,0) width 235: "Amazingly few discotheques provide jukeboxes."
+          LayoutBlockFlow {DIV} at (0,82) size 795.11x12
+            LayoutBlockFlow {DIV} at (0,1) size 67.39x11
+              LayoutText {#text} at (35,0) size 28x11
+                text run at (35,0) width 28: "11.50"
+            LayoutBlockFlow {DIV} at (67.39,1) size 67.39x11
+              LayoutText {#text} at (29,0) size 34x11
+                text run at (29,0) width 34: "240.00"
+            LayoutBlockFlow {DIV} at (134.78,1) size 67.39x11
+              LayoutText {#text} at (29,0) size 34x11
+                text run at (29,0) width 34: "250.43"
+            LayoutBlockFlow {DIV} at (202.17,1) size 67.39x11 [color=#FF0000]
+              LayoutText {#text} at (32,0) size 31x11
+                text run at (32,0) width 31: "-10.57"
+            LayoutInline {SPAN} at (0,0) size 241x12
+              LayoutText {#text} at (269,0) size 241x12
+                text run at (269,0) width 241: "Amazingly few discotheques provide jukeboxes."
+          LayoutBlockFlow {DIV} at (0,94) size 795.11x13
+            LayoutBlockFlow {DIV} at (0,2) size 67.39x11
+              LayoutText {#text} at (35,0) size 28x11
+                text run at (35,0) width 28: "11.75"
+            LayoutBlockFlow {DIV} at (67.39,2) size 67.39x11
+              LayoutText {#text} at (29,0) size 34x11
+                text run at (29,0) width 34: "260.00"
+            LayoutBlockFlow {DIV} at (134.78,2) size 67.39x11
+              LayoutText {#text} at (29,0) size 34x11
+                text run at (29,0) width 34: "265.53"
+            LayoutBlockFlow {DIV} at (202.17,2) size 67.39x11 [color=#FF0000]
+              LayoutText {#text} at (41,0) size 22x11
+                text run at (41,0) width 22: "4.53"
+            LayoutInline {SPAN} at (0,0) size 261x13
+              LayoutText {#text} at (269,0) size 261x13
+                text run at (269,0) width 261: "Amazingly few discotheques provide jukeboxes."
+          LayoutBlockFlow {DIV} at (0,107) size 795.11x14 [bgcolor=#FBFCC5]
+            LayoutBlockFlow {DIV} at (0,2) size 67.39x11
+              LayoutText {#text} at (35,0) size 28x11
+                text run at (35,0) width 28: "12.00"
+            LayoutBlockFlow {DIV} at (67.39,2) size 67.39x11
+              LayoutText {#text} at (29,0) size 34x11
+                text run at (29,0) width 34: "261.00"
+            LayoutBlockFlow {DIV} at (134.78,2) size 67.39x11
+              LayoutText {#text} at (29,0) size 34x11
+                text run at (29,0) width 34: "261.00"
+            LayoutBlockFlow {DIV} at (202.17,2) size 67.39x11
+              LayoutText {#text} at (41,0) size 22x11
+                text run at (41,0) width 22: "0.00"
+            LayoutInline {SPAN} at (0,0) size 262x14
+              LayoutText {#text} at (269,0) size 262x14
+                text run at (269,0) width 262: "Amazingly few discotheques provide jukeboxes."
+          LayoutBlockFlow {DIV} at (0,121) size 795.11x14
+            LayoutBlockFlow {DIV} at (0,2) size 67.39x11
+              LayoutText {#text} at (35,0) size 28x11
+                text run at (35,0) width 28: "12.25"
+            LayoutBlockFlow {DIV} at (67.39,2) size 67.39x11
+              LayoutText {#text} at (29,0) size 34x11
+                text run at (29,0) width 34: "261.00"
+            LayoutBlockFlow {DIV} at (134.78,2) size 67.39x11
+              LayoutText {#text} at (29,0) size 34x11
+                text run at (29,0) width 34: "255.67"
+            LayoutBlockFlow {DIV} at (202.17,2) size 67.39x11 [color=#FF0000]
+              LayoutText {#text} at (38,0) size 25x11
+                text run at (38,0) width 25: "-5.33"
+            LayoutInline {SPAN} at (0,0) size 262x14
+              LayoutText {#text} at (269,0) size 262x14
+                text run at (269,0) width 262: "Amazingly few discotheques provide jukeboxes."
+          LayoutBlockFlow {DIV} at (0,135) size 795.11x14
+            LayoutBlockFlow {DIV} at (0,2) size 67.39x11
+              LayoutText {#text} at (35,0) size 28x11
+                text run at (35,0) width 28: "12.50"
+            LayoutBlockFlow {DIV} at (67.39,2) size 67.39x11
+              LayoutText {#text} at (29,0) size 34x11
+                text run at (29,0) width 34: "261.00"
+            LayoutBlockFlow {DIV} at (134.78,2) size 67.39x11
+              LayoutText {#text} at (29,0) size 34x11
+                text run at (29,0) width 34: "250.56"
+            LayoutBlockFlow {DIV} at (202.17,2) size 67.39x11 [color=#FF0000]
+              LayoutText {#text} at (32,0) size 31x11
+                text run at (32,0) width 31: "-10.44"
+            LayoutInline {SPAN} at (0,0) size 262x14
+              LayoutText {#text} at (269,0) size 262x14
+                text run at (269,0) width 262: "Amazingly few discotheques provide jukeboxes."
+          LayoutBlockFlow {DIV} at (0,149) size 795.11x15
+            LayoutBlockFlow {DIV} at (0,3) size 67.39x11
+              LayoutText {#text} at (35,0) size 28x11
+                text run at (35,0) width 28: "12.75"
+            LayoutBlockFlow {DIV} at (67.39,3) size 67.39x11
+              LayoutText {#text} at (29,0) size 34x11
+                text run at (29,0) width 34: "270.00"
+            LayoutBlockFlow {DIV} at (134.78,3) size 67.39x11
+              LayoutText {#text} at (29,0) size 34x11
+                text run at (29,0) width 34: "254.12"
+            LayoutBlockFlow {DIV} at (202.17,3) size 67.39x11 [color=#FF0000]
+              LayoutText {#text} at (38,0) size 25x11
+                text run at (38,0) width 25: "-6.88"
+            LayoutInline {SPAN} at (0,0) size 271x15
+              LayoutText {#text} at (269,0) size 271x15
+                text run at (269,0) width 271: "Amazingly few discotheques provide jukeboxes."
+          LayoutBlockFlow {DIV} at (0,164) size 795.11x15
+            LayoutBlockFlow {DIV} at (0,3) size 67.39x11
+              LayoutText {#text} at (35,0) size 28x11
+                text run at (35,0) width 28: "13.00"
+            LayoutBlockFlow {DIV} at (67.39,3) size 67.39x11
+              LayoutText {#text} at (29,0) size 34x11
+                text run at (29,0) width 34: "279.00"
+            LayoutBlockFlow {DIV} at (134.78,3) size 67.39x11
+              LayoutText {#text} at (29,0) size 34x11
+                text run at (29,0) width 34: "257.54"
+            LayoutBlockFlow {DIV} at (202.17,3) size 67.39x11 [color=#FF0000]
+              LayoutText {#text} at (38,0) size 25x11
+                text run at (38,0) width 25: "-3.46"
+            LayoutInline {SPAN} at (0,0) size 280x15
+              LayoutText {#text} at (269,0) size 280x15
+                text run at (269,0) width 280: "Amazingly few discotheques provide jukeboxes."
+          LayoutBlockFlow {DIV} at (0,179) size 795.11x15
+            LayoutBlockFlow {DIV} at (0,3) size 67.39x11
+              LayoutText {#text} at (35,0) size 28x11
+                text run at (35,0) width 28: "13.25"
+            LayoutBlockFlow {DIV} at (67.39,3) size 67.39x11
+              LayoutText {#text} at (29,0) size 34x11
+                text run at (29,0) width 34: "280.00"
+            LayoutBlockFlow {DIV} at (134.78,3) size 67.39x11
+              LayoutText {#text} at (29,0) size 34x11
+                text run at (29,0) width 34: "253.58"
+            LayoutBlockFlow {DIV} at (202.17,3) size 67.39x11 [color=#FF0000]
+              LayoutText {#text} at (38,0) size 25x11
+                text run at (38,0) width 25: "-7.42"
+            LayoutInline {SPAN} at (0,0) size 281x15
+              LayoutText {#text} at (269,0) size 281x15
+                text run at (269,0) width 281: "Amazingly few discotheques provide jukeboxes."
+          LayoutBlockFlow {DIV} at (0,194) size 795.11x15
+            LayoutBlockFlow {DIV} at (0,3) size 67.39x11
+              LayoutText {#text} at (35,0) size 28x11
+                text run at (35,0) width 28: "13.50"
+            LayoutBlockFlow {DIV} at (67.39,3) size 67.39x11
+              LayoutText {#text} at (29,0) size 34x11
+                text run at (29,0) width 34: "300.00"
+            LayoutBlockFlow {DIV} at (134.78,3) size 67.39x11
+              LayoutText {#text} at (29,0) size 34x11
+                text run at (29,0) width 34: "266.67"
+            LayoutBlockFlow {DIV} at (202.17,3) size 67.39x11 [color=#FF0000]
+              LayoutText {#text} at (41,0) size 22x11
+                text run at (41,0) width 22: "5.67"
+            LayoutInline {SPAN} at (0,0) size 301x15
+              LayoutText {#text} at (269,0) size 301x15
+                text run at (269,0) width 301: "Amazingly few discotheques provide jukeboxes."
+          LayoutBlockFlow {DIV} at (0,209) size 795.11x15
+            LayoutBlockFlow {DIV} at (0,3) size 67.39x11
+              LayoutText {#text} at (35,0) size 28x11
+                text run at (35,0) width 28: "13.75"
+            LayoutBlockFlow {DIV} at (67.39,3) size 67.39x11
+              LayoutText {#text} at (29,0) size 34x11
+                text run at (29,0) width 34: "301.00"
+            LayoutBlockFlow {DIV} at (134.78,3) size 67.39x11
+              LayoutText {#text} at (29,0) size 34x11
+                text run at (29,0) width 34: "262.69"
+            LayoutBlockFlow {DIV} at (202.17,3) size 67.39x11 [color=#FF0000]
+              LayoutText {#text} at (41,0) size 22x11
+                text run at (41,0) width 22: "1.69"
+            LayoutInline {SPAN} at (0,0) size 302x15
+              LayoutText {#text} at (269,0) size 302x15
+                text run at (269,0) width 302: "Amazingly few discotheques provide jukeboxes."
+          LayoutBlockFlow {DIV} at (0,224) size 795.11x16
+            LayoutBlockFlow {DIV} at (0,4) size 67.39x11
+              LayoutText {#text} at (35,0) size 28x11
+                text run at (35,0) width 28: "14.00"
+            LayoutBlockFlow {DIV} at (67.39,4) size 67.39x11
+              LayoutText {#text} at (29,0) size 34x11
+                text run at (29,0) width 34: "302.00"
+            LayoutBlockFlow {DIV} at (134.78,4) size 67.39x11
+              LayoutText {#text} at (29,0) size 34x11
+                text run at (29,0) width 34: "258.86"
+            LayoutBlockFlow {DIV} at (202.17,4) size 67.39x11 [color=#FF0000]
+              LayoutText {#text} at (38,0) size 25x11
+                text run at (38,0) width 25: "-2.14"
+            LayoutInline {SPAN} at (0,0) size 303x16
+              LayoutText {#text} at (269,0) size 303x16
+                text run at (269,0) width 303: "Amazingly few discotheques provide jukeboxes."
+          LayoutBlockFlow {DIV} at (0,240) size 795.11x16
+            LayoutBlockFlow {DIV} at (0,4) size 67.39x11
+              LayoutText {#text} at (35,0) size 28x11
+                text run at (35,0) width 28: "14.25"
+            LayoutBlockFlow {DIV} at (67.39,4) size 67.39x11
+              LayoutText {#text} at (29,0) size 34x11
+                text run at (29,0) width 34: "303.00"
+            LayoutBlockFlow {DIV} at (134.78,4) size 67.39x11
+              LayoutText {#text} at (29,0) size 34x11
+                text run at (29,0) width 34: "255.16"
+            LayoutBlockFlow {DIV} at (202.17,4) size 67.39x11 [color=#FF0000]
+              LayoutText {#text} at (38,0) size 25x11
+                text run at (38,0) width 25: "-5.84"
+            LayoutInline {SPAN} at (0,0) size 304x16
+              LayoutText {#text} at (269,0) size 304x16
+                text run at (269,0) width 304: "Amazingly few discotheques provide jukeboxes."
+          LayoutBlockFlow {DIV} at (0,256) size 795.11x16
+            LayoutBlockFlow {DIV} at (0,4) size 67.39x11
+              LayoutText {#text} at (35,0) size 28x11
+                text run at (35,0) width 28: "14.50"
+            LayoutBlockFlow {DIV} at (67.39,4) size 67.39x11
+              LayoutText {#text} at (29,0) size 34x11
+                text run at (29,0) width 34: "303.00"
+            LayoutBlockFlow {DIV} at (134.78,4) size 67.39x11
+              LayoutText {#text} at (29,0) size 34x11
+                text run at (29,0) width 34: "250.76"
+            LayoutBlockFlow {DIV} at (202.17,4) size 67.39x11 [color=#FF0000]
+              LayoutText {#text} at (32,0) size 31x11
+                text run at (32,0) width 31: "-10.24"
+            LayoutInline {SPAN} at (0,0) size 304x16
+              LayoutText {#text} at (269,0) size 304x16
+                text run at (269,0) width 304: "Amazingly few discotheques provide jukeboxes."
+          LayoutBlockFlow {DIV} at (0,272) size 795.11x16
+            LayoutBlockFlow {DIV} at (0,4) size 67.39x11
+              LayoutText {#text} at (35,0) size 28x11
+                text run at (35,0) width 28: "14.75"
+            LayoutBlockFlow {DIV} at (67.39,4) size 67.39x11
+              LayoutText {#text} at (29,0) size 34x11
+                text run at (29,0) width 34: "304.00"
+            LayoutBlockFlow {DIV} at (134.78,4) size 67.39x11
+              LayoutText {#text} at (29,0) size 34x11
+                text run at (29,0) width 34: "247.32"
+            LayoutBlockFlow {DIV} at (202.17,4) size 67.39x11 [color=#FF0000]
+              LayoutText {#text} at (32,0) size 31x11
+                text run at (32,0) width 31: "-13.68"
+            LayoutInline {SPAN} at (0,0) size 305x16
+              LayoutText {#text} at (269,0) size 305x16
+                text run at (269,0) width 305: "Amazingly few discotheques provide jukeboxes."
+          LayoutBlockFlow {DIV} at (0,288) size 795.11x17
+            LayoutBlockFlow {DIV} at (0,5) size 67.39x11
+              LayoutText {#text} at (35,0) size 28x11
+                text run at (35,0) width 28: "15.00"
+            LayoutBlockFlow {DIV} at (67.39,5) size 67.39x11
+              LayoutText {#text} at (29,0) size 34x11
+                text run at (29,0) width 34: "313.00"
+            LayoutBlockFlow {DIV} at (134.78,5) size 67.39x11
+              LayoutText {#text} at (29,0) size 34x11
+                text run at (29,0) width 34: "250.40"
+            LayoutBlockFlow {DIV} at (202.17,5) size 67.39x11 [color=#FF0000]
+              LayoutText {#text} at (32,0) size 31x11
+                text run at (32,0) width 31: "-10.60"
+            LayoutInline {SPAN} at (0,0) size 314x17
+              LayoutText {#text} at (269,0) size 314x17
+                text run at (269,0) width 314: "Amazingly few discotheques provide jukeboxes."
+          LayoutBlockFlow {DIV} at (0,305) size 795.11x17
+            LayoutBlockFlow {DIV} at (0,5) size 67.39x11
+              LayoutText {#text} at (35,0) size 28x11
+                text run at (35,0) width 28: "15.25"
+            LayoutBlockFlow {DIV} at (67.39,5) size 67.39x11
+              LayoutText {#text} at (29,0) size 34x11
+                text run at (29,0) width 34: "314.00"
+            LayoutBlockFlow {DIV} at (134.78,5) size 67.39x11
+              LayoutText {#text} at (29,0) size 34x11
+                text run at (29,0) width 34: "247.08"
+            LayoutBlockFlow {DIV} at (202.17,5) size 67.39x11 [color=#FF0000]
+              LayoutText {#text} at (32,0) size 31x11
+                text run at (32,0) width 31: "-13.92"
+            LayoutInline {SPAN} at (0,0) size 315x17
+              LayoutText {#text} at (269,0) size 315x17
+                text run at (269,0) width 315: "Amazingly few discotheques provide jukeboxes."
+          LayoutBlockFlow {DIV} at (0,322) size 795.11x18
+            LayoutBlockFlow {DIV} at (0,5) size 67.39x11
+              LayoutText {#text} at (35,0) size 28x11
+                text run at (35,0) width 28: "15.50"
+            LayoutBlockFlow {DIV} at (67.39,5) size 67.39x11
+              LayoutText {#text} at (29,0) size 34x11
+                text run at (29,0) width 34: "334.00"
+            LayoutBlockFlow {DIV} at (134.78,5) size 67.39x11
+              LayoutText {#text} at (29,0) size 34x11
+                text run at (29,0) width 34: "258.58"
+            LayoutBlockFlow {DIV} at (202.17,5) size 67.39x11 [color=#FF0000]
+              LayoutText {#text} at (38,0) size 25x11
+                text run at (38,0) width 25: "-2.42"
+            LayoutInline {SPAN} at (0,0) size 335x17
+              LayoutText {#text} at (269,0) size 335x17
+                text run at (269,0) width 335: "Amazingly few discotheques provide jukeboxes."
+          LayoutBlockFlow {DIV} at (0,340) size 795.11x18
+            LayoutBlockFlow {DIV} at (0,5) size 67.39x11
+              LayoutText {#text} at (35,0) size 28x11
+                text run at (35,0) width 28: "15.75"
+            LayoutBlockFlow {DIV} at (67.39,5) size 67.39x11
+              LayoutText {#text} at (29,0) size 34x11
+                text run at (29,0) width 34: "335.00"
+            LayoutBlockFlow {DIV} at (134.78,5) size 67.39x11
+              LayoutText {#text} at (29,0) size 34x11
+                text run at (29,0) width 34: "255.24"
+            LayoutBlockFlow {DIV} at (202.17,5) size 67.39x11 [color=#FF0000]
+              LayoutText {#text} at (38,0) size 25x11
+                text run at (38,0) width 25: "-5.76"
+            LayoutInline {SPAN} at (0,0) size 336x17
+              LayoutText {#text} at (269,0) size 336x17
+                text run at (269,0) width 336: "Amazingly few discotheques provide jukeboxes."
+          LayoutBlockFlow {DIV} at (0,358) size 795.11x18
+            LayoutBlockFlow {DIV} at (0,5) size 67.39x11
+              LayoutText {#text} at (35,0) size 28x11
+                text run at (35,0) width 28: "16.00"
+            LayoutBlockFlow {DIV} at (67.39,5) size 67.39x11
+              LayoutText {#text} at (29,0) size 34x11
+                text run at (29,0) width 34: "339.73"
+            LayoutBlockFlow {DIV} at (134.78,5) size 67.39x11
+              LayoutText {#text} at (29,0) size 34x11
+                text run at (29,0) width 34: "254.80"
+            LayoutBlockFlow {DIV} at (202.17,5) size 67.39x11 [color=#FF0000]
+              LayoutText {#text} at (38,0) size 25x11
+                text run at (38,0) width 25: "-6.20"
+            LayoutInline {SPAN} at (0,0) size 341x17
+              LayoutText {#text} at (269,0) size 341x17
+                text run at (269,0) width 341: "Amazingly few discotheques provide jukeboxes."
+          LayoutBlockFlow {DIV} at (0,376) size 795.11x19
+            LayoutBlockFlow {DIV} at (0,6) size 67.39x11
+              LayoutText {#text} at (35,0) size 28x11
+                text run at (35,0) width 28: "16.25"
+            LayoutBlockFlow {DIV} at (67.39,6) size 67.39x11
+              LayoutText {#text} at (29,0) size 34x11
+                text run at (29,0) width 34: "345.05"
+            LayoutBlockFlow {DIV} at (134.78,6) size 67.39x11
+              LayoutText {#text} at (29,0) size 34x11
+                text run at (29,0) width 34: "254.80"
+            LayoutBlockFlow {DIV} at (202.17,6) size 67.39x11 [color=#FF0000]
+              LayoutText {#text} at (38,0) size 25x11
+                text run at (38,0) width 25: "-6.20"
+            LayoutInline {SPAN} at (0,0) size 346x18
+              LayoutText {#text} at (269,0) size 346x18
+                text run at (269,0) width 346: "Amazingly few discotheques provide jukeboxes."
+          LayoutBlockFlow {DIV} at (0,395) size 795.11x19
+            LayoutBlockFlow {DIV} at (0,6) size 67.39x11
+              LayoutText {#text} at (35,0) size 28x11
+                text run at (35,0) width 28: "16.50"
+            LayoutBlockFlow {DIV} at (67.39,6) size 67.39x11
+              LayoutText {#text} at (29,0) size 34x11
+                text run at (29,0) width 34: "350.34"
+            LayoutBlockFlow {DIV} at (134.78,6) size 67.39x11
+              LayoutText {#text} at (29,0) size 34x11
+                text run at (29,0) width 34: "254.80"
+            LayoutBlockFlow {DIV} at (202.17,6) size 67.39x11 [color=#FF0000]
+              LayoutText {#text} at (38,0) size 25x11
+                text run at (38,0) width 25: "-6.20"
+            LayoutInline {SPAN} at (0,0) size 351x18
+              LayoutText {#text} at (269,0) size 351x18
+                text run at (269,0) width 351: "Amazingly few discotheques provide jukeboxes."
+          LayoutBlockFlow {DIV} at (0,414) size 795.11x20
+            LayoutBlockFlow {DIV} at (0,6) size 67.39x11
+              LayoutText {#text} at (35,0) size 28x11
+                text run at (35,0) width 28: "16.75"
+            LayoutBlockFlow {DIV} at (67.39,6) size 67.39x11
+              LayoutText {#text} at (29,0) size 34x11
+                text run at (29,0) width 34: "355.66"
+            LayoutBlockFlow {DIV} at (134.78,6) size 67.39x11
+              LayoutText {#text} at (29,0) size 34x11
+                text run at (29,0) width 34: "254.80"
+            LayoutBlockFlow {DIV} at (202.17,6) size 67.39x11 [color=#FF0000]
+              LayoutText {#text} at (38,0) size 25x11
+                text run at (38,0) width 25: "-6.20"
+            LayoutInline {SPAN} at (0,0) size 357x19
+              LayoutText {#text} at (269,0) size 357x19
+                text run at (269,0) width 357: "Amazingly few discotheques provide jukeboxes."
+          LayoutBlockFlow {DIV} at (0,434) size 795.11x20
+            LayoutBlockFlow {DIV} at (0,6) size 67.39x11
+              LayoutText {#text} at (35,0) size 28x11
+                text run at (35,0) width 28: "17.00"
+            LayoutBlockFlow {DIV} at (67.39,6) size 67.39x11
+              LayoutText {#text} at (29,0) size 34x11
+                text run at (29,0) width 34: "360.97"
+            LayoutBlockFlow {DIV} at (134.78,6) size 67.39x11
+              LayoutText {#text} at (29,0) size 34x11
+                text run at (29,0) width 34: "254.80"
+            LayoutBlockFlow {DIV} at (202.17,6) size 67.39x11 [color=#FF0000]
+              LayoutText {#text} at (38,0) size 25x11
+                text run at (38,0) width 25: "-6.20"
+            LayoutInline {SPAN} at (0,0) size 362x19
+              LayoutText {#text} at (269,0) size 362x19
+                text run at (269,0) width 362: "Amazingly few discotheques provide jukeboxes."
+          LayoutBlockFlow {DIV} at (0,454) size 795.11x21
+            LayoutBlockFlow {DIV} at (0,7) size 67.39x11
+              LayoutText {#text} at (35,0) size 28x11
+                text run at (35,0) width 28: "17.25"
+            LayoutBlockFlow {DIV} at (67.39,7) size 67.39x11
+              LayoutText {#text} at (29,0) size 34x11
+                text run at (29,0) width 34: "366.28"
+            LayoutBlockFlow {DIV} at (134.78,7) size 67.39x11
+              LayoutText {#text} at (29,0) size 34x11
+                text run at (29,0) width 34: "254.80"
+            LayoutBlockFlow {DIV} at (202.17,7) size 67.39x11 [color=#FF0000]
+              LayoutText {#text} at (38,0) size 25x11
+                text run at (38,0) width 25: "-6.20"
+            LayoutInline {SPAN} at (0,0) size 367x20
+              LayoutText {#text} at (269,0) size 367x20
+                text run at (269,0) width 367: "Amazingly few discotheques provide jukeboxes."
+          LayoutBlockFlow {DIV} at (0,475) size 795.11x21
+            LayoutBlockFlow {DIV} at (0,7) size 67.39x11
+              LayoutText {#text} at (35,0) size 28x11
+                text run at (35,0) width 28: "17.50"
+            LayoutBlockFlow {DIV} at (67.39,7) size 67.39x11
+              LayoutText {#text} at (29,0) size 34x11
+                text run at (29,0) width 34: "371.58"
+            LayoutBlockFlow {DIV} at (134.78,7) size 67.39x11
+              LayoutText {#text} at (29,0) size 34x11
+                text run at (29,0) width 34: "254.80"
+            LayoutBlockFlow {DIV} at (202.17,7) size 67.39x11 [color=#FF0000]
+              LayoutText {#text} at (38,0) size 25x11
+                text run at (38,0) width 25: "-6.20"
+            LayoutInline {SPAN} at (0,0) size 373x20
+              LayoutText {#text} at (269,0) size 373x20
+                text run at (269,0) width 373: "Amazingly few discotheques provide jukeboxes."
+          LayoutBlockFlow {DIV} at (0,496) size 795.11x21
+            LayoutBlockFlow {DIV} at (0,7) size 67.39x11
+              LayoutText {#text} at (35,0) size 28x11
+                text run at (35,0) width 28: "17.75"
+            LayoutBlockFlow {DIV} at (67.39,7) size 67.39x11
+              LayoutText {#text} at (29,0) size 34x11
+                text run at (29,0) width 34: "376.89"
+            LayoutBlockFlow {DIV} at (134.78,7) size 67.39x11
+              LayoutText {#text} at (29,0) size 34x11
+                text run at (29,0) width 34: "254.80"
+            LayoutBlockFlow {DIV} at (202.17,7) size 67.39x11 [color=#FF0000]
+              LayoutText {#text} at (38,0) size 25x11
+                text run at (38,0) width 25: "-6.20"
+            LayoutInline {SPAN} at (0,0) size 378x20
+              LayoutText {#text} at (269,0) size 378x20
+                text run at (269,0) width 378: "Amazingly few discotheques provide jukeboxes."
+          LayoutBlockFlow {DIV} at (0,517) size 795.11x21
+            LayoutBlockFlow {DIV} at (0,7) size 67.39x11
+              LayoutText {#text} at (35,0) size 28x11
+                text run at (35,0) width 28: "18.00"
+            LayoutBlockFlow {DIV} at (67.39,7) size 67.39x11
+              LayoutText {#text} at (29,0) size 34x11
+                text run at (29,0) width 34: "382.20"
+            LayoutBlockFlow {DIV} at (134.78,7) size 67.39x11
+              LayoutText {#text} at (29,0) size 34x11
+                text run at (29,0) width 34: "254.80"
+            LayoutBlockFlow {DIV} at (202.17,7) size 67.39x11 [color=#FF0000]
+              LayoutText {#text} at (38,0) size 25x11
+                text run at (38,0) width 25: "-6.20"
+            LayoutInline {SPAN} at (0,0) size 383x20
+              LayoutText {#text} at (269,0) size 383x20
+                text run at (269,0) width 383: "Amazingly few discotheques provide jukeboxes."
+          LayoutBlockFlow {DIV} at (0,538) size 795.11x22
+            LayoutBlockFlow {DIV} at (0,8) size 67.39x11
+              LayoutText {#text} at (35,0) size 28x11
+                text run at (35,0) width 28: "18.25"
+            LayoutBlockFlow {DIV} at (67.39,8) size 67.39x11
+              LayoutText {#text} at (29,0) size 34x11
+                text run at (29,0) width 34: "387.52"
+            LayoutBlockFlow {DIV} at (134.78,8) size 67.39x11
+              LayoutText {#text} at (29,0) size 34x11
+                text run at (29,0) width 34: "254.80"
+            LayoutBlockFlow {DIV} at (202.17,8) size 67.39x11 [color=#FF0000]
+              LayoutText {#text} at (38,0) size 25x11
+                text run at (38,0) width 25: "-6.20"
+            LayoutInline {SPAN} at (0,0) size 389x21
+              LayoutText {#text} at (269,0) size 389x21
+                text run at (269,0) width 389: "Amazingly few discotheques provide jukeboxes."
+          LayoutBlockFlow {DIV} at (0,560) size 795.11x22
+            LayoutBlockFlow {DIV} at (0,8) size 67.39x11
+              LayoutText {#text} at (35,0) size 28x11
+                text run at (35,0) width 28: "18.50"
+            LayoutBlockFlow {DIV} at (67.39,8) size 67.39x11
+              LayoutText {#text} at (29,0) size 34x11
+                text run at (29,0) width 34: "392.81"
+            LayoutBlockFlow {DIV} at (134.78,8) size 67.39x11
+              LayoutText {#text} at (29,0) size 34x11
+                text run at (29,0) width 34: "254.80"
+            LayoutBlockFlow {DIV} at (202.17,8) size 67.39x11 [color=#FF0000]
+              LayoutText {#text} at (38,0) size 25x11
+                text run at (38,0) width 25: "-6.20"
+            LayoutInline {SPAN} at (0,0) size 394x21
+              LayoutText {#text} at (269,0) size 394x21
+                text run at (269,0) width 394: "Amazingly few discotheques provide jukeboxes."
+          LayoutBlockFlow {DIV} at (0,582) size 795.11x22
+            LayoutBlockFlow {DIV} at (0,8) size 67.39x11
+              LayoutText {#text} at (35,0) size 28x11
+                text run at (35,0) width 28: "18.75"
+            LayoutBlockFlow {DIV} at (67.39,8) size 67.39x11
+              LayoutText {#text} at (29,0) size 34x11
+                text run at (29,0) width 34: "398.13"
+            LayoutBlockFlow {DIV} at (134.78,8) size 67.39x11
+              LayoutText {#text} at (29,0) size 34x11
+                text run at (29,0) width 34: "254.80"
+            LayoutBlockFlow {DIV} at (202.17,8) size 67.39x11 [color=#FF0000]
+              LayoutText {#text} at (38,0) size 25x11
+                text run at (38,0) width 25: "-6.20"
+            LayoutInline {SPAN} at (0,0) size 399x21
+              LayoutText {#text} at (269,0) size 399x21
+                text run at (269,0) width 399: "Amazingly few discotheques provide jukeboxes."
+          LayoutBlockFlow {DIV} at (0,604) size 795.11x22
+            LayoutBlockFlow {DIV} at (0,8) size 67.39x11
+              LayoutText {#text} at (35,0) size 28x11
+                text run at (35,0) width 28: "19.00"
+            LayoutBlockFlow {DIV} at (67.39,8) size 67.39x11
+              LayoutText {#text} at (29,0) size 34x11
+                text run at (29,0) width 34: "403.44"
+            LayoutBlockFlow {DIV} at (134.78,8) size 67.39x11
+              LayoutText {#text} at (29,0) size 34x11
+                text run at (29,0) width 34: "254.80"
+            LayoutBlockFlow {DIV} at (202.17,8) size 67.39x11 [color=#FF0000]
+              LayoutText {#text} at (38,0) size 25x11
+                text run at (38,0) width 25: "-6.20"
+            LayoutInline {SPAN} at (0,0) size 404x21
+              LayoutText {#text} at (269,0) size 404x21
+                text run at (269,0) width 404: "Amazingly few discotheques provide jukeboxes."
+          LayoutBlockFlow {DIV} at (0,626) size 795.11x22
+            LayoutBlockFlow {DIV} at (0,8) size 67.39x11
+              LayoutText {#text} at (35,0) size 28x11
+                text run at (35,0) width 28: "19.25"
+            LayoutBlockFlow {DIV} at (67.39,8) size 67.39x11
+              LayoutText {#text} at (29,0) size 34x11
+                text run at (29,0) width 34: "408.75"
+            LayoutBlockFlow {DIV} at (134.78,8) size 67.39x11
+              LayoutText {#text} at (29,0) size 34x11
+                text run at (29,0) width 34: "254.81"
+            LayoutBlockFlow {DIV} at (202.17,8) size 67.39x11 [color=#FF0000]
+              LayoutText {#text} at (38,0) size 25x11
+                text run at (38,0) width 25: "-6.19"
+            LayoutInline {SPAN} at (0,0) size 410x21
+              LayoutText {#text} at (269,0) size 410x21
+                text run at (269,0) width 410: "Amazingly few discotheques provide jukeboxes."
+          LayoutBlockFlow {DIV} at (0,648) size 795.11x23
+            LayoutBlockFlow {DIV} at (0,9) size 67.39x11
+              LayoutText {#text} at (35,0) size 28x11
+                text run at (35,0) width 28: "19.50"
+            LayoutBlockFlow {DIV} at (67.39,9) size 67.39x11
+              LayoutText {#text} at (29,0) size 34x11
+                text run at (29,0) width 34: "414.05"
+            LayoutBlockFlow {DIV} at (134.78,9) size 67.39x11
+              LayoutText {#text} at (29,0) size 34x11
+                text run at (29,0) width 34: "254.80"
+            LayoutBlockFlow {DIV} at (202.17,9) size 67.39x11 [color=#FF0000]
+              LayoutText {#text} at (38,0) size 25x11
+                text run at (38,0) width 25: "-6.20"
+            LayoutInline {SPAN} at (0,0) size 415x22
+              LayoutText {#text} at (269,0) size 415x22
+                text run at (269,0) width 415: "Amazingly few discotheques provide jukeboxes."
+          LayoutBlockFlow {DIV} at (0,671) size 795.11x23
+            LayoutBlockFlow {DIV} at (0,9) size 67.39x11
+              LayoutText {#text} at (35,0) size 28x11
+                text run at (35,0) width 28: "19.75"
+            LayoutBlockFlow {DIV} at (67.39,9) size 67.39x11
+              LayoutText {#text} at (29,0) size 34x11
+                text run at (29,0) width 34: "419.36"
+            LayoutBlockFlow {DIV} at (134.78,9) size 67.39x11
+              LayoutText {#text} at (29,0) size 34x11
+                text run at (29,0) width 34: "254.80"
+            LayoutBlockFlow {DIV} at (202.17,9) size 67.39x11 [color=#FF0000]
+              LayoutText {#text} at (38,0) size 25x11
+                text run at (38,0) width 25: "-6.20"
+            LayoutInline {SPAN} at (0,0) size 420x22
+              LayoutText {#text} at (269,0) size 420x22
+                text run at (269,0) width 420: "Amazingly few discotheques provide jukeboxes."
+          LayoutBlockFlow {DIV} at (0,694) size 795.11x23
+            LayoutBlockFlow {DIV} at (0,9) size 67.39x11
+              LayoutText {#text} at (35,0) size 28x11
+                text run at (35,0) width 28: "20.00"
+            LayoutBlockFlow {DIV} at (67.39,9) size 67.39x11
+              LayoutText {#text} at (29,0) size 34x11
+                text run at (29,0) width 34: "424.67"
+            LayoutBlockFlow {DIV} at (134.78,9) size 67.39x11
+              LayoutText {#text} at (29,0) size 34x11
+                text run at (29,0) width 34: "254.80"
+            LayoutBlockFlow {DIV} at (202.17,9) size 67.39x11 [color=#FF0000]
+              LayoutText {#text} at (38,0) size 25x11
+                text run at (38,0) width 25: "-6.20"
+            LayoutInline {SPAN} at (0,0) size 426x22
+              LayoutText {#text} at (269,0) size 426x22
+                text run at (269,0) width 426: "Amazingly few discotheques provide jukeboxes."
+          LayoutBlockFlow {DIV} at (0,717) size 795.11x23
+            LayoutBlockFlow {DIV} at (0,9) size 67.39x11
+              LayoutText {#text} at (35,0) size 28x11
+                text run at (35,0) width 28: "20.25"
+            LayoutBlockFlow {DIV} at (67.39,9) size 67.39x11
+              LayoutText {#text} at (29,0) size 34x11
+                text run at (29,0) width 34: "429.98"
+            LayoutBlockFlow {DIV} at (134.78,9) size 67.39x11
+              LayoutText {#text} at (29,0) size 34x11
+                text run at (29,0) width 34: "254.81"
+            LayoutBlockFlow {DIV} at (202.17,9) size 67.39x11 [color=#FF0000]
+              LayoutText {#text} at (38,0) size 25x11
+                text run at (38,0) width 25: "-6.19"
+            LayoutInline {SPAN} at (0,0) size 431x22
+              LayoutText {#text} at (269,0) size 431x22
+                text run at (269,0) width 431: "Amazingly few discotheques provide jukeboxes."
+          LayoutBlockFlow {DIV} at (0,740) size 795.11x24
+            LayoutBlockFlow {DIV} at (0,10) size 67.39x11
+              LayoutText {#text} at (35,0) size 28x11
+                text run at (35,0) width 28: "20.50"
+            LayoutBlockFlow {DIV} at (67.39,10) size 67.39x11
+              LayoutText {#text} at (29,0) size 34x11
+                text run at (29,0) width 34: "435.28"
+            LayoutBlockFlow {DIV} at (134.78,10) size 67.39x11
+              LayoutText {#text} at (29,0) size 34x11
+                text run at (29,0) width 34: "254.80"
+            LayoutBlockFlow {DIV} at (202.17,10) size 67.39x11 [color=#FF0000]
+              LayoutText {#text} at (38,0) size 25x11
+                text run at (38,0) width 25: "-6.20"
+            LayoutInline {SPAN} at (0,0) size 436x23
+              LayoutText {#text} at (269,0) size 436x23
+                text run at (269,0) width 436: "Amazingly few discotheques provide jukeboxes."
+          LayoutBlockFlow {DIV} at (0,764) size 795.11x24
+            LayoutBlockFlow {DIV} at (0,10) size 67.39x11
+              LayoutText {#text} at (35,0) size 28x11
+                text run at (35,0) width 28: "20.75"
+            LayoutBlockFlow {DIV} at (67.39,10) size 67.39x11
+              LayoutText {#text} at (29,0) size 34x11
+                text run at (29,0) width 34: "440.59"
+            LayoutBlockFlow {DIV} at (134.78,10) size 67.39x11
+              LayoutText {#text} at (29,0) size 34x11
+                text run at (29,0) width 34: "254.80"
+            LayoutBlockFlow {DIV} at (202.17,10) size 67.39x11 [color=#FF0000]
+              LayoutText {#text} at (38,0) size 25x11
+                text run at (38,0) width 25: "-6.20"
+            LayoutInline {SPAN} at (0,0) size 442x23
+              LayoutText {#text} at (269,0) size 442x23
+                text run at (269,0) width 442: "Amazingly few discotheques provide jukeboxes."
+          LayoutBlockFlow {DIV} at (0,788) size 795.11x24
+            LayoutBlockFlow {DIV} at (0,10) size 67.39x11
+              LayoutText {#text} at (35,0) size 28x11
+                text run at (35,0) width 28: "21.00"
+            LayoutBlockFlow {DIV} at (67.39,10) size 67.39x11
+              LayoutText {#text} at (29,0) size 34x11
+                text run at (29,0) width 34: "445.91"
+            LayoutBlockFlow {DIV} at (134.78,10) size 67.39x11
+              LayoutText {#text} at (29,0) size 34x11
+                text run at (29,0) width 34: "254.80"
+            LayoutBlockFlow {DIV} at (202.17,10) size 67.39x11 [color=#FF0000]
+              LayoutText {#text} at (38,0) size 25x11
+                text run at (38,0) width 25: "-6.20"
+            LayoutInline {SPAN} at (0,0) size 447x23
+              LayoutText {#text} at (269,0) size 447x23
+                text run at (269,0) width 447: "Amazingly few discotheques provide jukeboxes."
+          LayoutBlockFlow {DIV} at (0,812) size 795.11x25
+            LayoutBlockFlow {DIV} at (0,10) size 67.39x11
+              LayoutText {#text} at (35,0) size 28x11
+                text run at (35,0) width 28: "21.25"
+            LayoutBlockFlow {DIV} at (67.39,10) size 67.39x11
+              LayoutText {#text} at (29,0) size 34x11
+                text run at (29,0) width 34: "451.22"
+            LayoutBlockFlow {DIV} at (134.78,10) size 67.39x11
+              LayoutText {#text} at (29,0) size 34x11
+                text run at (29,0) width 34: "254.81"
+            LayoutBlockFlow {DIV} at (202.17,10) size 67.39x11 [color=#FF0000]
+              LayoutText {#text} at (38,0) size 25x11
+                text run at (38,0) width 25: "-6.19"
+            LayoutInline {SPAN} at (0,0) size 452x24
+              LayoutText {#text} at (269,0) size 452x24
+                text run at (269,0) width 452: "Amazingly few discotheques provide jukeboxes."
+          LayoutBlockFlow {DIV} at (0,837) size 795.11x25
+            LayoutBlockFlow {DIV} at (0,10) size 67.39x11
+              LayoutText {#text} at (35,0) size 28x11
+                text run at (35,0) width 28: "21.50"
+            LayoutBlockFlow {DIV} at (67.39,10) size 67.39x11
+              LayoutText {#text} at (29,0) size 34x11
+                text run at (29,0) width 34: "456.52"
+            LayoutBlockFlow {DIV} at (134.78,10) size 67.39x11
+              LayoutText {#text} at (29,0) size 34x11
+                text run at (29,0) width 34: "254.80"
+            LayoutBlockFlow {DIV} at (202.17,10) size 67.39x11 [color=#FF0000]
+              LayoutText {#text} at (38,0) size 25x11
+                text run at (38,0) width 25: "-6.20"
+            LayoutInline {SPAN} at (0,0) size 458x24
+              LayoutText {#text} at (269,0) size 458x24
+                text run at (269,0) width 458: "Amazingly few discotheques provide jukeboxes."
+          LayoutBlockFlow {DIV} at (0,862) size 795.11x26
+            LayoutBlockFlow {DIV} at (0,11) size 67.39x11
+              LayoutText {#text} at (35,0) size 28x11
+                text run at (35,0) width 28: "21.75"
+            LayoutBlockFlow {DIV} at (67.39,11) size 67.39x11
+              LayoutText {#text} at (29,0) size 34x11
+                text run at (29,0) width 34: "461.83"
+            LayoutBlockFlow {DIV} at (134.78,11) size 67.39x11
+              LayoutText {#text} at (29,0) size 34x11
+                text run at (29,0) width 34: "254.80"
+            LayoutBlockFlow {DIV} at (202.17,11) size 67.39x11 [color=#FF0000]
+              LayoutText {#text} at (38,0) size 25x11
+                text run at (38,0) width 25: "-6.20"
+            LayoutInline {SPAN} at (0,0) size 463x25
+              LayoutText {#text} at (269,0) size 463x25
+                text run at (269,0) width 463: "Amazingly few discotheques provide jukeboxes."
+          LayoutBlockFlow {DIV} at (0,888) size 795.11x26
+            LayoutBlockFlow {DIV} at (0,11) size 67.39x11
+              LayoutText {#text} at (35,0) size 28x11
+                text run at (35,0) width 28: "22.00"
+            LayoutBlockFlow {DIV} at (67.39,11) size 67.39x11
+              LayoutText {#text} at (29,0) size 34x11
+                text run at (29,0) width 34: "467.14"
+            LayoutBlockFlow {DIV} at (134.78,11) size 67.39x11
+              LayoutText {#text} at (29,0) size 34x11
+                text run at (29,0) width 34: "254.80"
+            LayoutBlockFlow {DIV} at (202.17,11) size 67.39x11 [color=#FF0000]
+              LayoutText {#text} at (38,0) size 25x11
+                text run at (38,0) width 25: "-6.20"
+            LayoutInline {SPAN} at (0,0) size 468x25
+              LayoutText {#text} at (269,0) size 468x25
+                text run at (269,0) width 468: "Amazingly few discotheques provide jukeboxes."
+          LayoutBlockFlow {DIV} at (0,914) size 795.11x26
+            LayoutBlockFlow {DIV} at (0,11) size 67.39x11
+              LayoutText {#text} at (35,0) size 28x11
+                text run at (35,0) width 28: "22.25"
+            LayoutBlockFlow {DIV} at (67.39,11) size 67.39x11
+              LayoutText {#text} at (29,0) size 34x11
+                text run at (29,0) width 34: "472.45"
+            LayoutBlockFlow {DIV} at (134.78,11) size 67.39x11
+              LayoutText {#text} at (29,0) size 34x11
+                text run at (29,0) width 34: "254.81"
+            LayoutBlockFlow {DIV} at (202.17,11) size 67.39x11 [color=#FF0000]
+              LayoutText {#text} at (38,0) size 25x11
+                text run at (38,0) width 25: "-6.19"
+            LayoutInline {SPAN} at (0,0) size 474x25
+              LayoutText {#text} at (269,0) size 474x25
+                text run at (269,0) width 474: "Amazingly few discotheques provide jukeboxes."
+          LayoutBlockFlow {DIV} at (0,940) size 795.11x26
+            LayoutBlockFlow {DIV} at (0,11) size 67.39x11
+              LayoutText {#text} at (35,0) size 28x11
+                text run at (35,0) width 28: "22.50"
+            LayoutBlockFlow {DIV} at (67.39,11) size 67.39x11
+              LayoutText {#text} at (29,0) size 34x11
+                text run at (29,0) width 34: "477.75"
+            LayoutBlockFlow {DIV} at (134.78,11) size 67.39x11
+              LayoutText {#text} at (29,0) size 34x11
+                text run at (29,0) width 34: "254.80"
+            LayoutBlockFlow {DIV} at (202.17,11) size 67.39x11 [color=#FF0000]
+              LayoutText {#text} at (38,0) size 25x11
+                text run at (38,0) width 25: "-6.20"
+            LayoutInline {SPAN} at (0,0) size 479x25
+              LayoutText {#text} at (269,0) size 479x25
+                text run at (269,0) width 479: "Amazingly few discotheques provide jukeboxes."
+          LayoutBlockFlow {DIV} at (0,966) size 795.11x27
+            LayoutBlockFlow {DIV} at (0,12) size 67.39x11
+              LayoutText {#text} at (35,0) size 28x11
+                text run at (35,0) width 28: "22.75"
+            LayoutBlockFlow {DIV} at (67.39,12) size 67.39x11
+              LayoutText {#text} at (29,0) size 34x11
+                text run at (29,0) width 34: "483.06"
+            LayoutBlockFlow {DIV} at (134.78,12) size 67.39x11
+              LayoutText {#text} at (29,0) size 34x11
+                text run at (29,0) width 34: "254.80"
+            LayoutBlockFlow {DIV} at (202.17,12) size 67.39x11 [color=#FF0000]
+              LayoutText {#text} at (38,0) size 25x11
+                text run at (38,0) width 25: "-6.20"
+            LayoutInline {SPAN} at (0,0) size 484x26
+              LayoutText {#text} at (269,0) size 484x26
+                text run at (269,0) width 484: "Amazingly few discotheques provide jukeboxes."
+          LayoutBlockFlow {DIV} at (0,993) size 795.11x27
+            LayoutBlockFlow {DIV} at (0,12) size 67.39x11
+              LayoutText {#text} at (35,0) size 28x11
+                text run at (35,0) width 28: "23.00"
+            LayoutBlockFlow {DIV} at (67.39,12) size 67.39x11
+              LayoutText {#text} at (29,0) size 34x11
+                text run at (29,0) width 34: "488.38"
+            LayoutBlockFlow {DIV} at (134.78,12) size 67.39x11
+              LayoutText {#text} at (29,0) size 34x11
+                text run at (29,0) width 34: "254.80"
+            LayoutBlockFlow {DIV} at (202.17,12) size 67.39x11 [color=#FF0000]
+              LayoutText {#text} at (38,0) size 25x11
+                text run at (38,0) width 25: "-6.20"
+            LayoutInline {SPAN} at (0,0) size 489x26
+              LayoutText {#text} at (269,0) size 489x26
+                text run at (269,0) width 489: "Amazingly few discotheques provide jukeboxes."
+          LayoutBlockFlow {DIV} at (0,1020) size 795.11x27
+            LayoutBlockFlow {DIV} at (0,12) size 67.39x11
+              LayoutText {#text} at (35,0) size 28x11
+                text run at (35,0) width 28: "23.25"
+            LayoutBlockFlow {DIV} at (67.39,12) size 67.39x11
+              LayoutText {#text} at (29,0) size 34x11
+                text run at (29,0) width 34: "493.69"
+            LayoutBlockFlow {DIV} at (134.78,12) size 67.39x11
+              LayoutText {#text} at (29,0) size 34x11
+                text run at (29,0) width 34: "254.81"
+            LayoutBlockFlow {DIV} at (202.17,12) size 67.39x11 [color=#FF0000]
+              LayoutText {#text} at (38,0) size 25x11
+                text run at (38,0) width 25: "-6.19"
+            LayoutInline {SPAN} at (0,0) size 495x26
+              LayoutText {#text} at (269,0) size 495x26
+                text run at (269,0) width 495: "Amazingly few discotheques provide jukeboxes."
+          LayoutBlockFlow {DIV} at (0,1047) size 795.11x27
+            LayoutBlockFlow {DIV} at (0,12) size 67.39x11
+              LayoutText {#text} at (35,0) size 28x11
+                text run at (35,0) width 28: "23.50"
+            LayoutBlockFlow {DIV} at (67.39,12) size 67.39x11
+              LayoutText {#text} at (29,0) size 34x11
+                text run at (29,0) width 34: "498.98"
+            LayoutBlockFlow {DIV} at (134.78,12) size 67.39x11
+              LayoutText {#text} at (29,0) size 34x11
+                text run at (29,0) width 34: "254.80"
+            LayoutBlockFlow {DIV} at (202.17,12) size 67.39x11 [color=#FF0000]
+              LayoutText {#text} at (38,0) size 25x11
+                text run at (38,0) width 25: "-6.20"
+            LayoutInline {SPAN} at (0,0) size 500x26
+              LayoutText {#text} at (269,0) size 500x26
+                text run at (269,0) width 500: "Amazingly few discotheques provide jukeboxes."
+          LayoutBlockFlow {DIV} at (0,1074) size 795.11x28
+            LayoutBlockFlow {DIV} at (0,13) size 67.39x11
+              LayoutText {#text} at (35,0) size 28x11
+                text run at (35,0) width 28: "23.75"
+            LayoutBlockFlow {DIV} at (67.39,13) size 67.39x11
+              LayoutText {#text} at (29,0) size 34x11
+                text run at (29,0) width 34: "504.30"
+            LayoutBlockFlow {DIV} at (134.78,13) size 67.39x11
+              LayoutText {#text} at (29,0) size 34x11
+                text run at (29,0) width 34: "254.80"
+            LayoutBlockFlow {DIV} at (202.17,13) size 67.39x11 [color=#FF0000]
+              LayoutText {#text} at (38,0) size 25x11
+                text run at (38,0) width 25: "-6.20"
+            LayoutInline {SPAN} at (0,0) size 505x27
+              LayoutText {#text} at (269,0) size 505x27
+                text run at (269,0) width 505: "Amazingly few discotheques provide jukeboxes."
+          LayoutBlockFlow {DIV} at (0,1102) size 795.11x28
+            LayoutBlockFlow {DIV} at (0,13) size 67.39x11
+              LayoutText {#text} at (35,0) size 28x11
+                text run at (35,0) width 28: "24.00"
+            LayoutBlockFlow {DIV} at (67.39,13) size 67.39x11
+              LayoutText {#text} at (29,0) size 34x11
+                text run at (29,0) width 34: "509.61"
+            LayoutBlockFlow {DIV} at (134.78,13) size 67.39x11
+              LayoutText {#text} at (29,0) size 34x11
+                text run at (29,0) width 34: "254.80"
+            LayoutBlockFlow {DIV} at (202.17,13) size 67.39x11 [color=#FF0000]
+              LayoutText {#text} at (38,0) size 25x11
+                text run at (38,0) width 25: "-6.20"
+            LayoutInline {SPAN} at (0,0) size 511x27
+              LayoutText {#text} at (269,0) size 511x27
+                text run at (269,0) width 511: "Amazingly few discotheques provide jukeboxes."
+          LayoutBlockFlow {DIV} at (0,1130) size 795.11x28
+            LayoutBlockFlow {DIV} at (0,13) size 67.39x11
+              LayoutText {#text} at (35,0) size 28x11
+                text run at (35,0) width 28: "24.25"
+            LayoutBlockFlow {DIV} at (67.39,13) size 67.39x11
+              LayoutText {#text} at (29,0) size 34x11
+                text run at (29,0) width 34: "514.91"
+            LayoutBlockFlow {DIV} at (134.78,13) size 67.39x11
+              LayoutText {#text} at (29,0) size 34x11
+                text run at (29,0) width 34: "254.80"
+            LayoutBlockFlow {DIV} at (202.17,13) size 67.39x11 [color=#FF0000]
+              LayoutText {#text} at (38,0) size 25x11
+                text run at (38,0) width 25: "-6.20"
+            LayoutInline {SPAN} at (0,0) size 516x27
+              LayoutText {#text} at (269,0) size 516x27
+                text run at (269,0) width 516: "Amazingly few discotheques provide jukeboxes."
+          LayoutBlockFlow {DIV} at (0,1158) size 795.11x28
+            LayoutBlockFlow {DIV} at (0,13) size 67.39x11
+              LayoutText {#text} at (35,0) size 28x11
+                text run at (35,0) width 28: "24.50"
+            LayoutBlockFlow {DIV} at (67.39,13) size 67.39x11
+              LayoutText {#text} at (29,0) size 34x11
+                text run at (29,0) width 34: "520.22"
+            LayoutBlockFlow {DIV} at (134.78,13) size 67.39x11
+              LayoutText {#text} at (29,0) size 34x11
+                text run at (29,0) width 34: "254.80"
+            LayoutBlockFlow {DIV} at (202.17,13) size 67.39x11 [color=#FF0000]
+              LayoutText {#text} at (38,0) size 25x11
+                text run at (38,0) width 25: "-6.20"
+            LayoutInline {SPAN} at (0,0) size 521x27
+              LayoutText {#text} at (269,0) size 521x27
+                text run at (269,0) width 521: "Amazingly few discotheques provide jukeboxes."
+          LayoutBlockFlow {DIV} at (0,1186) size 795.11x28
+            LayoutBlockFlow {DIV} at (0,13) size 67.39x11
+              LayoutText {#text} at (35,0) size 28x11
+                text run at (35,0) width 28: "24.75"
+            LayoutBlockFlow {DIV} at (67.39,13) size 67.39x11
+              LayoutText {#text} at (29,0) size 34x11
+                text run at (29,0) width 34: "525.53"
+            LayoutBlockFlow {DIV} at (134.78,13) size 67.39x11
+              LayoutText {#text} at (29,0) size 34x11
+                text run at (29,0) width 34: "254.80"
+            LayoutBlockFlow {DIV} at (202.17,13) size 67.39x11 [color=#FF0000]
+              LayoutText {#text} at (38,0) size 25x11
+                text run at (38,0) width 25: "-6.20"
+            LayoutInline {SPAN} at (0,0) size 527x27
+              LayoutText {#text} at (269,0) size 527x27
+                text run at (269,0) width 527: "Amazingly few discotheques provide jukeboxes."
+      LayoutText {#text} at (0,0) size 0x0
+      LayoutText {#text} at (0,0) size 0x0
diff --git a/third_party/WebKit/LayoutTests/platform/win7/fast/text/unicode-fallback-font-expected.png b/third_party/WebKit/LayoutTests/platform/win7/fast/text/unicode-fallback-font-expected.png
index 4f0ac1dc..ef8c6b0 100644
--- a/third_party/WebKit/LayoutTests/platform/win7/fast/text/unicode-fallback-font-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win7/fast/text/unicode-fallback-font-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win7/fast/text/unicode-fallback-font-expected.txt b/third_party/WebKit/LayoutTests/platform/win7/fast/text/unicode-fallback-font-expected.txt
index cef57d1..35abc51 100644
--- a/third_party/WebKit/LayoutTests/platform/win7/fast/text/unicode-fallback-font-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win7/fast/text/unicode-fallback-font-expected.txt
@@ -21,7 +21,7 @@
           text run at (276,90) width 0: " "
           text run at (0,108) width 63: "U+16Fx \x{16F0}"
           text run at (63,108) width 0: " "
-        LayoutText {#text} at (0,124) size 307x148
+        LayoutText {#text} at (0,124) size 328x148
           text run at (0,124) width 0: " "
           text run at (0,142) width 239: "U+200x \x{2000} \x{2001} \x{2002} \x{2003} \x{2004} \x{2004} \x{2004} \x{2004} \x{2004} \x{2009} \x{200A} \x{200B} \x{200C} \x{200D} \x{200E} "
           text run at (239,142) width 0 RTL: "\x{200F}"
@@ -39,10 +39,10 @@
           text run at (307,202) width 0: " "
           text run at (0,222) width 296: "U+204x \x{2040} \x{2041} \x{2042} \x{2043} \x{2044} \x{2045} \x{2046} \x{2047} \x{2048} \x{2049} \x{204A} \x{204B} \x{204C} \x{204D} \x{204E} \x{204F}"
           text run at (296,222) width 0: " "
-          text run at (0,240) width 304: "U+205x \x{2050} \x{2051} \x{2052} \x{2053} \x{2054} \x{2055} \x{2056} \x{2057} \x{2058} \x{2059} \x{205A} \x{205B} \x{205C} \x{205D} \x{205E} \x{205F}"
-          text run at (304,240) width 0: " "
-          text run at (0,256) width 224: "U+206x \x{2060} \x{2061} \x{2062} \x{2063} \x{2064} \x{206A} \x{206B} \x{206C} \x{206D} \x{206E} \x{206F}"
-          text run at (224,256) width 0: " "
+          text run at (0,240) width 328: "U+205x \x{2050} \x{2051} \x{2052} \x{2053} \x{2054} \x{2055} \x{2056} \x{2057} \x{2058} \x{2059} \x{205A} \x{205B} \x{205C} \x{205D} \x{205E} \x{205F}"
+          text run at (328,240) width 0: " "
+          text run at (0,256) width 136: "U+206x \x{2060} \x{2061} \x{2062} \x{2063} \x{2064} \x{206A} \x{206B} \x{206C} \x{206D} \x{206E} \x{206F}"
+          text run at (136,256) width 0: " "
         LayoutText {#text} at (0,272) size 380x304
           text run at (0,272) width 0: " "
           text run at (0,290) width 339: "U+260x \x{2600} \x{2601} \x{2602} \x{2603} \x{2604} \x{2605} \x{2606} \x{2607} \x{2608} \x{2609} \x{260A} \x{260B} \x{260C} \x{260D} \x{260E} \x{260F}"
diff --git a/third_party/WebKit/LayoutTests/platform/win7/fast/text/whitespace/nbsp-mode-and-linewraps-expected.png b/third_party/WebKit/LayoutTests/platform/win7/fast/text/whitespace/nbsp-mode-and-linewraps-expected.png
new file mode 100644
index 0000000..1e6ad8f
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/win7/fast/text/whitespace/nbsp-mode-and-linewraps-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win7/fast/text/whitespace/nbsp-mode-and-linewraps-expected.txt b/third_party/WebKit/LayoutTests/platform/win7/fast/text/whitespace/nbsp-mode-and-linewraps-expected.txt
new file mode 100644
index 0000000..7c8592231
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/win7/fast/text/whitespace/nbsp-mode-and-linewraps-expected.txt
@@ -0,0 +1,10 @@
+layer at (0,0) size 800x600 scrollWidth 1983
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  LayoutBlockFlow {HTML} at (0,0) size 800x600
+    LayoutBlockFlow {BODY} at (8,8) size 784x584
+layer at (100,8) size 1883x82 backgroundClip at (0,0) size 800x600 clip at (0,0) size 800x600
+  LayoutBlockFlow (positioned) {DIV} at (100,8) size 1883.08x82 [border: (2px solid #FF0000)]
+    LayoutText {#text} at (14,14) size 1856x53
+      text run at (14,14) width 1832: "This div is absolutely positioned to the left. All the spaces in this div are replaced with non-breaking spaces, and the nbsp-mode for this div is 'space', so when calculating line breaks, the non-"
+      text run at (14,41) width 1856: "breaking spaces should be treated as normal spaces. If this isn't the case, then all the text for this paragraph will be rendered in two lines, and a horizontal scroll bar will appear along the bottom."
diff --git a/third_party/WebKit/LayoutTests/platform/win7/fast/text/wide-zero-width-space-expected.png b/third_party/WebKit/LayoutTests/platform/win7/fast/text/wide-zero-width-space-expected.png
new file mode 100644
index 0000000..28c1d5e
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/win7/fast/text/wide-zero-width-space-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win7/fast/text/wide-zero-width-space-expected.txt b/third_party/WebKit/LayoutTests/platform/win7/fast/text/wide-zero-width-space-expected.txt
new file mode 100644
index 0000000..027cd2e
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/win7/fast/text/wide-zero-width-space-expected.txt
@@ -0,0 +1,29 @@
+layer at (0,0) size 800x600
+  LayoutView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  LayoutBlockFlow {HTML} at (0,0) size 800x600
+    LayoutBlockFlow {BODY} at (8,8) size 784x584
+      LayoutBlockFlow {P} at (0,0) size 784x18
+        LayoutText {#text} at (0,0) size 54x17
+          text run at (0,0) width 54: "Test for "
+        LayoutInline {I} at (0,0) size 609x17
+          LayoutInline {A} at (0,0) size 305x17 [color=#0000EE]
+            LayoutText {#text} at (53,0) size 305x17
+              text run at (53,0) width 305: "http://bugs.webkit.org/show_bug.cgi?id=13178"
+          LayoutText {#text} at (357,0) size 305x17
+            text run at (357,0) width 5: " "
+            text run at (361,0) width 301: "Helvetica zero-width space has non-zero width"
+        LayoutText {#text} at (661,0) size 5x17
+          text run at (661,0) width 5: "."
+      LayoutBlockFlow {P} at (0,34) size 784x18
+        LayoutText {#text} at (0,0) size 275x17
+          text run at (0,0) width 275: "The following lines should all be identical."
+      LayoutBlockFlow {DIV} at (0,68) size 784x42
+        LayoutText {#text} at (0,0) size 387x41
+          text run at (0,0) width 387: "Lor\x{E9}m\x{200B}ipsum\x{200E}dolor\x{1F}sit"
+      LayoutBlockFlow {DIV} at (0,110) size 784x42
+        LayoutText {#text} at (0,0) size 387x41
+          text run at (0,0) width 387: "Lore\x{301}m\x{200B}ipsum\x{200E}dolor\x{1F}sit"
+      LayoutBlockFlow {DIV} at (0,152) size 784x42
+        LayoutText {#text} at (0,0) size 387x41
+          text run at (0,0) width 387: "Lor\x{E9}mipsumdolorsit"
diff --git a/third_party/WebKit/LayoutTests/platform/win7/printing/iframe-print-expected.png b/third_party/WebKit/LayoutTests/platform/win7/printing/iframe-print-expected.png
new file mode 100644
index 0000000..c97fa1a9
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/win7/printing/iframe-print-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win7/virtual/threaded/printing/iframe-print-expected.png b/third_party/WebKit/LayoutTests/platform/win7/virtual/threaded/printing/iframe-print-expected.png
new file mode 100644
index 0000000..c97fa1a9
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/win7/virtual/threaded/printing/iframe-print-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/virtual/stable/http/tests/serviceworker/webexposed/global-interface-listing-service-worker-expected.txt b/third_party/WebKit/LayoutTests/virtual/stable/http/tests/serviceworker/webexposed/global-interface-listing-service-worker-expected.txt
index bf933349f..b0ea3fd 100644
--- a/third_party/WebKit/LayoutTests/virtual/stable/http/tests/serviceworker/webexposed/global-interface-listing-service-worker-expected.txt
+++ b/third_party/WebKit/LayoutTests/virtual/stable/http/tests/serviceworker/webexposed/global-interface-listing-service-worker-expected.txt
@@ -285,6 +285,8 @@
     method constructor
     method count
     method get
+    method getAll
+    method getAllKeys
     method getKey
     method openCursor
     method openKeyCursor
@@ -308,8 +310,11 @@
     method delete
     method deleteIndex
     method get
+    method getAll
+    method getAllKeys
     method index
     method openCursor
+    method openKeyCursor
     method put
 interface IDBOpenDBRequest
     getter onblocked
@@ -332,6 +337,7 @@
     getter db
     getter error
     getter mode
+    getter objectStoreNames
     getter onabort
     getter oncomplete
     getter onerror
@@ -633,6 +639,8 @@
     method constructor
     method count
     method get
+    method getAll
+    method getAllKeys
     method getKey
     method openCursor
     method openKeyCursor
@@ -656,8 +664,11 @@
     method delete
     method deleteIndex
     method get
+    method getAll
+    method getAllKeys
     method index
     method openCursor
+    method openKeyCursor
     method put
 interface webkitIDBRequest
     getter error
@@ -674,6 +685,7 @@
     getter db
     getter error
     getter mode
+    getter objectStoreNames
     getter onabort
     getter oncomplete
     getter onerror
diff --git a/third_party/WebKit/LayoutTests/virtual/stable/webexposed/global-interface-listing-dedicated-worker-expected.txt b/third_party/WebKit/LayoutTests/virtual/stable/webexposed/global-interface-listing-dedicated-worker-expected.txt
index 3d3a64c..52e478ea 100644
--- a/third_party/WebKit/LayoutTests/virtual/stable/webexposed/global-interface-listing-dedicated-worker-expected.txt
+++ b/third_party/WebKit/LayoutTests/virtual/stable/webexposed/global-interface-listing-dedicated-worker-expected.txt
@@ -283,6 +283,8 @@
 [Worker]     method constructor
 [Worker]     method count
 [Worker]     method get
+[Worker]     method getAll
+[Worker]     method getAllKeys
 [Worker]     method getKey
 [Worker]     method openCursor
 [Worker]     method openKeyCursor
@@ -306,8 +308,11 @@
 [Worker]     method delete
 [Worker]     method deleteIndex
 [Worker]     method get
+[Worker]     method getAll
+[Worker]     method getAllKeys
 [Worker]     method index
 [Worker]     method openCursor
+[Worker]     method openKeyCursor
 [Worker]     method put
 [Worker] interface IDBOpenDBRequest
 [Worker]     getter onblocked
@@ -330,6 +335,7 @@
 [Worker]     getter db
 [Worker]     getter error
 [Worker]     getter mode
+[Worker]     getter objectStoreNames
 [Worker]     getter onabort
 [Worker]     getter oncomplete
 [Worker]     getter onerror
@@ -662,6 +668,8 @@
 [Worker]     method constructor
 [Worker]     method count
 [Worker]     method get
+[Worker]     method getAll
+[Worker]     method getAllKeys
 [Worker]     method getKey
 [Worker]     method openCursor
 [Worker]     method openKeyCursor
@@ -685,8 +693,11 @@
 [Worker]     method delete
 [Worker]     method deleteIndex
 [Worker]     method get
+[Worker]     method getAll
+[Worker]     method getAllKeys
 [Worker]     method index
 [Worker]     method openCursor
+[Worker]     method openKeyCursor
 [Worker]     method put
 [Worker] interface webkitIDBRequest
 [Worker]     getter error
@@ -703,6 +714,7 @@
 [Worker]     getter db
 [Worker]     getter error
 [Worker]     getter mode
+[Worker]     getter objectStoreNames
 [Worker]     getter onabort
 [Worker]     getter oncomplete
 [Worker]     getter onerror
diff --git a/third_party/WebKit/LayoutTests/virtual/stable/webexposed/global-interface-listing-expected.txt b/third_party/WebKit/LayoutTests/virtual/stable/webexposed/global-interface-listing-expected.txt
index 09f817c..15714cc 100644
--- a/third_party/WebKit/LayoutTests/virtual/stable/webexposed/global-interface-listing-expected.txt
+++ b/third_party/WebKit/LayoutTests/virtual/stable/webexposed/global-interface-listing-expected.txt
@@ -2605,6 +2605,8 @@
     method constructor
     method count
     method get
+    method getAll
+    method getAllKeys
     method getKey
     method openCursor
     method openKeyCursor
@@ -2628,8 +2630,11 @@
     method delete
     method deleteIndex
     method get
+    method getAll
+    method getAllKeys
     method index
     method openCursor
+    method openKeyCursor
     method put
 interface IDBOpenDBRequest
     getter onblocked
@@ -2652,6 +2657,7 @@
     getter db
     getter error
     getter mode
+    getter objectStoreNames
     getter onabort
     getter oncomplete
     getter onerror
@@ -5719,6 +5725,8 @@
     method constructor
     method count
     method get
+    method getAll
+    method getAllKeys
     method getKey
     method openCursor
     method openKeyCursor
@@ -5742,8 +5750,11 @@
     method delete
     method deleteIndex
     method get
+    method getAll
+    method getAllKeys
     method index
     method openCursor
+    method openKeyCursor
     method put
 interface webkitIDBRequest
     getter error
@@ -5760,6 +5771,7 @@
     getter db
     getter error
     getter mode
+    getter objectStoreNames
     getter onabort
     getter oncomplete
     getter onerror
diff --git a/third_party/WebKit/LayoutTests/virtual/stable/webexposed/global-interface-listing-shared-worker-expected.txt b/third_party/WebKit/LayoutTests/virtual/stable/webexposed/global-interface-listing-shared-worker-expected.txt
index 0fdbe03a..1168b49 100644
--- a/third_party/WebKit/LayoutTests/virtual/stable/webexposed/global-interface-listing-shared-worker-expected.txt
+++ b/third_party/WebKit/LayoutTests/virtual/stable/webexposed/global-interface-listing-shared-worker-expected.txt
@@ -273,6 +273,8 @@
 [Worker]     method constructor
 [Worker]     method count
 [Worker]     method get
+[Worker]     method getAll
+[Worker]     method getAllKeys
 [Worker]     method getKey
 [Worker]     method openCursor
 [Worker]     method openKeyCursor
@@ -296,8 +298,11 @@
 [Worker]     method delete
 [Worker]     method deleteIndex
 [Worker]     method get
+[Worker]     method getAll
+[Worker]     method getAllKeys
 [Worker]     method index
 [Worker]     method openCursor
+[Worker]     method openKeyCursor
 [Worker]     method put
 [Worker] interface IDBOpenDBRequest
 [Worker]     getter onblocked
@@ -320,6 +325,7 @@
 [Worker]     getter db
 [Worker]     getter error
 [Worker]     getter mode
+[Worker]     getter objectStoreNames
 [Worker]     getter onabort
 [Worker]     getter oncomplete
 [Worker]     getter onerror
@@ -654,6 +660,8 @@
 [Worker]     method constructor
 [Worker]     method count
 [Worker]     method get
+[Worker]     method getAll
+[Worker]     method getAllKeys
 [Worker]     method getKey
 [Worker]     method openCursor
 [Worker]     method openKeyCursor
@@ -677,8 +685,11 @@
 [Worker]     method delete
 [Worker]     method deleteIndex
 [Worker]     method get
+[Worker]     method getAll
+[Worker]     method getAllKeys
 [Worker]     method index
 [Worker]     method openCursor
+[Worker]     method openKeyCursor
 [Worker]     method put
 [Worker] interface webkitIDBRequest
 [Worker]     getter error
@@ -695,6 +706,7 @@
 [Worker]     getter db
 [Worker]     getter error
 [Worker]     getter mode
+[Worker]     getter objectStoreNames
 [Worker]     getter onabort
 [Worker]     getter oncomplete
 [Worker]     getter onerror
diff --git a/third_party/WebKit/PerformanceTests/Canvas/createImageBitmapFromImageData.html b/third_party/WebKit/PerformanceTests/Canvas/createImageBitmapFromImageData.html
new file mode 100644
index 0000000..940ac0a
--- /dev/null
+++ b/third_party/WebKit/PerformanceTests/Canvas/createImageBitmapFromImageData.html
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<html>
+<body>
+<script src="../resources/runner.js"></script>
+<script>
+var imgHeight = 1024;
+var imgWidth = 1024;
+var canvas = document.createElement("canvas");
+canvas.width = imgWidth;
+canvas.height = imgHeight;
+var context = canvas.getContext('2d');
+var image = context.createImageData(imgWidth, imgHeight);
+
+function rand(range) {
+    return Math.floor(Math.random() * range);
+}
+
+function initializeImageData() {
+  for(var i = 0; i < image.data.length; i++)
+    image.data[i] = rand(256);
+}
+
+function imageBitmapFromImageData() {
+  /*The return Promise is not retained because this test 
+    is meant to only measure the immediate run time of 
+    createImageBitmap from an ImageData, which is known 
+    to be implemented in a way that does all the work
+    synchronously, even though the API is technically async.*/
+  createImageBitmap(image, 0, 0, imgWidth, imgHeight);
+}
+
+initializeImageData();
+PerfTestRunner.measureRunsPerSecond({run: imageBitmapFromImageData, description: "This bench test checks the speed on creating ImageBitmap from ImageData(1024x1024)."});
+</script>
+</body>
+</html>
diff --git a/third_party/WebKit/PerformanceTests/Layout/add-remove-inline-floats.html b/third_party/WebKit/PerformanceTests/Layout/add-remove-inline-floats.html
new file mode 100644
index 0000000..be1959bf
--- /dev/null
+++ b/third_party/WebKit/PerformanceTests/Layout/add-remove-inline-floats.html
@@ -0,0 +1,40 @@
+<!DOCTYPE html>
+<style>
+#test-container span {
+    float: left; /* This is the root cause */
+    width: 18px;
+    height: 18px;
+}
+</style>
+<div id="test-container"></div>
+<script src="../resources/runner.js"></script>
+<script>
+    var count = 3000;
+
+    function addFloats() {
+        var container = document.getElementById("test-container");
+        var newDiv = document.createElement("div");
+        for (var i = 0; i < count; i++) {
+            var span = document.createElement("span");
+            newDiv.appendChild(span);
+        }
+        container.appendChild(newDiv);
+    };
+
+    function removeFloats() {
+        var container = document.getElementById("test-container");
+        if (container.lastChild) container.removeChild(container.lastChild);
+    }
+
+    function test() {
+        addFloats();
+        PerfTestRunner.forceLayoutOrFullFrame();
+        removeFloats();
+    }
+
+    PerfTestRunner.measureRunsPerSecond({
+    description: "Measures performance of removing floats in a block with a lot of inline children.",
+    run: test
+});
+</script>
+</html>
diff --git a/third_party/WebKit/Source/bindings/core/v8/ScriptStreamer.cpp b/third_party/WebKit/Source/bindings/core/v8/ScriptStreamer.cpp
index 7c178f9..d38e6cc 100644
--- a/third_party/WebKit/Source/bindings/core/v8/ScriptStreamer.cpp
+++ b/third_party/WebKit/Source/bindings/core/v8/ScriptStreamer.cpp
@@ -18,7 +18,6 @@
 #include "platform/ThreadSafeFunctional.h"
 #include "platform/TraceEvent.h"
 #include "public/platform/Platform.h"
-#include "public/platform/WebScheduler.h"
 #include "wtf/MainThread.h"
 #include "wtf/text/TextEncodingRegistry.h"
 
@@ -163,7 +162,7 @@
 class SourceStream : public v8::ScriptCompiler::ExternalSourceStream {
     WTF_MAKE_NONCOPYABLE(SourceStream);
 public:
-    explicit SourceStream(WebTaskRunner* loadingTaskRunner)
+    SourceStream()
         : v8::ScriptCompiler::ExternalSourceStream()
         , m_cancelled(false)
         , m_finished(false)
@@ -171,7 +170,6 @@
         , m_queueTailPosition(0)
         , m_bookmarkPosition(0)
         , m_lengthOfBOM(0)
-        , m_loadingTaskRunner(adoptPtr(loadingTaskRunner->clone()))
     {
     }
 
@@ -221,7 +219,7 @@
         }
 
         // Inform main thread to re-queue the data.
-        m_loadingTaskRunner->postTask(
+        Platform::current()->mainThread()->taskRunner()->postTask(
             FROM_HERE, bind(&SourceStream::fetchDataFromResourceBuffer, this, 0));
     }
 
@@ -372,18 +370,16 @@
     // We store this separately, to avoid having to guard all
     // m_queueLeadPosition references with a mutex.
     unsigned m_lengthOfBOM; // Used by both threads; guarded by m_mutex.
-
-    OwnPtr<WebTaskRunner> m_loadingTaskRunner;
 };
 
 size_t ScriptStreamer::kSmallScriptThreshold = 30 * 1024;
 
-void ScriptStreamer::startStreaming(PendingScript& script, PendingScript::Type scriptType, Settings* settings, ScriptState* scriptState, WebTaskRunner* loadingTaskRunner)
+void ScriptStreamer::startStreaming(PendingScript& script, PendingScript::Type scriptType, Settings* settings, ScriptState* scriptState)
 {
     // We don't yet know whether the script will really be streamed. E.g.,
     // suppressing streaming for short scripts is done later. Record only the
     // sure negative cases here.
-    bool startedStreaming = startStreamingInternal(script, scriptType, settings, scriptState, loadingTaskRunner);
+    bool startedStreaming = startStreamingInternal(script, scriptType, settings, scriptState);
     if (!startedStreaming)
         Platform::current()->histogramEnumeration(startedStreamingHistogramName(scriptType), 0, 2);
 }
@@ -425,7 +421,7 @@
 
     // notifyFinished might already be called, or it might be called in the
     // future (if the parsing finishes earlier because of a parse error).
-    m_loadingTaskRunner->postTask(FROM_HERE, threadSafeBind(&ScriptStreamer::streamingComplete, AllowCrossThreadAccess(this)));
+    Platform::current()->mainThread()->taskRunner()->postTask(FROM_HERE, threadSafeBind(&ScriptStreamer::streamingComplete, AllowCrossThreadAccess(this)));
 
     // The task might delete ScriptStreamer, so it's not safe to do anything
     // after posting it. Note that there's no way to guarantee that this
@@ -517,7 +513,7 @@
 
         ASSERT(!m_stream);
         ASSERT(!m_source);
-        m_stream = new SourceStream(m_loadingTaskRunner.get());
+        m_stream = new SourceStream();
         // m_source takes ownership of m_stream.
         m_source = adoptPtr(new v8::ScriptCompiler::StreamedSource(m_stream, m_encoding));
 
@@ -568,7 +564,7 @@
     notifyFinishedToClient();
 }
 
-ScriptStreamer::ScriptStreamer(ScriptResource* resource, PendingScript::Type scriptType, ScriptState* scriptState, v8::ScriptCompiler::CompileOptions compileOptions, WebTaskRunner* loadingTaskRunner)
+ScriptStreamer::ScriptStreamer(ScriptResource* resource, PendingScript::Type scriptType, ScriptState* scriptState, v8::ScriptCompiler::CompileOptions compileOptions)
     : m_resource(resource)
     , m_detached(false)
     , m_stream(0)
@@ -581,7 +577,6 @@
     , m_scriptState(scriptState)
     , m_scriptType(scriptType)
     , m_encoding(v8::ScriptCompiler::StreamedSource::TWO_BYTE) // Unfortunately there's no dummy encoding value in the enum; let's use one we don't stream.
-    , m_loadingTaskRunner(adoptPtr(loadingTaskRunner->clone()))
 {
 }
 
@@ -637,7 +632,7 @@
         m_client->notifyFinished(m_resource);
 }
 
-bool ScriptStreamer::startStreamingInternal(PendingScript& script, PendingScript::Type scriptType, Settings* settings, ScriptState* scriptState, WebTaskRunner* loadingTaskRunner)
+bool ScriptStreamer::startStreamingInternal(PendingScript& script, PendingScript::Type scriptType, Settings* settings, ScriptState* scriptState)
 {
     ASSERT(isMainThread());
     ASSERT(scriptState->contextIsValid());
@@ -670,7 +665,7 @@
     // The Resource might go out of scope if the script is no longer
     // needed. This makes PendingScript notify the ScriptStreamer when it is
     // destroyed.
-    script.setStreamer(ScriptStreamer::create(resource, scriptType, scriptState, compileOption, loadingTaskRunner));
+    script.setStreamer(ScriptStreamer::create(resource, scriptType, scriptState, compileOption));
 
     return true;
 }
diff --git a/third_party/WebKit/Source/bindings/core/v8/ScriptStreamer.h b/third_party/WebKit/Source/bindings/core/v8/ScriptStreamer.h
index c002175..e3eb425 100644
--- a/third_party/WebKit/Source/bindings/core/v8/ScriptStreamer.h
+++ b/third_party/WebKit/Source/bindings/core/v8/ScriptStreamer.h
@@ -21,7 +21,6 @@
 class ScriptState;
 class Settings;
 class SourceStream;
-class WebTaskRunner;
 
 // ScriptStreamer streams incomplete script data to V8 so that it can be parsed
 // while it's loaded. PendingScript holds a reference to ScriptStreamer. At the
@@ -33,9 +32,9 @@
 class CORE_EXPORT ScriptStreamer final : public RefCountedWillBeRefCountedGarbageCollected<ScriptStreamer> {
     WTF_MAKE_NONCOPYABLE(ScriptStreamer);
 public:
-    static PassRefPtrWillBeRawPtr<ScriptStreamer> create(ScriptResource* resource, PendingScript::Type scriptType, ScriptState* scriptState, v8::ScriptCompiler::CompileOptions compileOptions, WebTaskRunner* loadingTaskRunner)
+    static PassRefPtrWillBeRawPtr<ScriptStreamer> create(ScriptResource* resource, PendingScript::Type scriptType, ScriptState* scriptState, v8::ScriptCompiler::CompileOptions compileOptions)
     {
-        return adoptRefWillBeNoop(new ScriptStreamer(resource, scriptType, scriptState, compileOptions, loadingTaskRunner));
+        return adoptRefWillBeNoop(new ScriptStreamer(resource, scriptType, scriptState, compileOptions));
     }
 
     ~ScriptStreamer();
@@ -43,7 +42,7 @@
 
     // Launches a task (on a background thread) which will stream the given
     // PendingScript into V8 as it loads.
-    static void startStreaming(PendingScript&, PendingScript::Type, Settings*, ScriptState*, WebTaskRunner*);
+    static void startStreaming(PendingScript&, PendingScript::Type, Settings*, ScriptState*);
 
     // Returns false if we cannot stream the given encoding.
     static bool convertEncoding(const char* encodingName, v8::ScriptCompiler::StreamedSource::Encoding*);
@@ -108,12 +107,12 @@
     // streamed. Non-const for testing.
     static size_t kSmallScriptThreshold;
 
-    ScriptStreamer(ScriptResource*, PendingScript::Type, ScriptState*, v8::ScriptCompiler::CompileOptions, WebTaskRunner*);
+    ScriptStreamer(ScriptResource*, PendingScript::Type, ScriptState*, v8::ScriptCompiler::CompileOptions);
 
     void streamingComplete();
     void notifyFinishedToClient();
 
-    static bool startStreamingInternal(PendingScript&, PendingScript::Type, Settings*, ScriptState*, WebTaskRunner*);
+    static bool startStreamingInternal(PendingScript&, PendingScript::Type, Settings*, ScriptState*);
 
     // This pointer is weak. If PendingScript and its Resource are deleted
     // before ScriptStreamer, PendingScript will notify ScriptStreamer of its
@@ -150,8 +149,6 @@
 
     // Encoding of the streamed script. Saved for sanity checking purposes.
     v8::ScriptCompiler::StreamedSource::Encoding m_encoding;
-
-    OwnPtr<WebTaskRunner> m_loadingTaskRunner;
 };
 
 } // namespace blink
diff --git a/third_party/WebKit/Source/bindings/core/v8/ScriptStreamerTest.cpp b/third_party/WebKit/Source/bindings/core/v8/ScriptStreamerTest.cpp
index cbfdd8c..62d9c84c 100644
--- a/third_party/WebKit/Source/bindings/core/v8/ScriptStreamerTest.cpp
+++ b/third_party/WebKit/Source/bindings/core/v8/ScriptStreamerTest.cpp
@@ -18,7 +18,6 @@
 #include "platform/heap/Handle.h"
 #include "platform/testing/UnitTestHelpers.h"
 #include "public/platform/Platform.h"
-#include "public/platform/WebScheduler.h"
 
 #include <gtest/gtest.h>
 #include <v8.h>
@@ -65,8 +64,7 @@
 class ScriptStreamingTest : public ::testing::Test {
 public:
     ScriptStreamingTest()
-        : m_loadingTaskRunner(Platform::current()->currentThread()->scheduler()->loadingTaskRunner())
-        , m_scope(v8::Isolate::GetCurrent())
+        : m_scope(v8::Isolate::GetCurrent())
         , m_settings(Settings::create())
         , m_resourceRequest("http://www.streaming-test.com/")
         , m_resource(new ScriptResource(m_resourceRequest, "UTF-8"))
@@ -118,7 +116,6 @@
         testing::runPendingTasks();
     }
 
-    WebTaskRunner* m_loadingTaskRunner; // NOT OWNED
     V8TestingScope m_scope;
     OwnPtr<Settings> m_settings;
     // The Resource and PendingScript where we stream from. These don't really
@@ -145,7 +142,7 @@
 TEST_F(ScriptStreamingTest, CompilingStreamedScript)
 {
     // Test that we can successfully compile a streamed script.
-    ScriptStreamer::startStreaming(pendingScript(), PendingScript::ParsingBlocking, m_settings.get(), m_scope.scriptState(), m_loadingTaskRunner);
+    ScriptStreamer::startStreaming(pendingScript(), PendingScript::ParsingBlocking, m_settings.get(), m_scope.scriptState());
     TestScriptResourceClient client;
     pendingScript().watchForLoad(&client);
 
@@ -176,7 +173,7 @@
     // Test that scripts with parse errors are handled properly. In those cases,
     // the V8 side typically finished before loading finishes: make sure we
     // handle it gracefully.
-    ScriptStreamer::startStreaming(pendingScript(), PendingScript::ParsingBlocking, m_settings.get(), m_scope.scriptState(), m_loadingTaskRunner);
+    ScriptStreamer::startStreaming(pendingScript(), PendingScript::ParsingBlocking, m_settings.get(), m_scope.scriptState());
     TestScriptResourceClient client;
     pendingScript().watchForLoad(&client);
     appendData("function foo() {");
@@ -208,7 +205,7 @@
 {
     // Test that the upper layers (PendingScript and up) can be ramped down
     // while streaming is ongoing, and ScriptStreamer handles it gracefully.
-    ScriptStreamer::startStreaming(pendingScript(), PendingScript::ParsingBlocking, m_settings.get(), m_scope.scriptState(), m_loadingTaskRunner);
+    ScriptStreamer::startStreaming(pendingScript(), PendingScript::ParsingBlocking, m_settings.get(), m_scope.scriptState());
     TestScriptResourceClient client;
     pendingScript().watchForLoad(&client);
     appendData("function foo() {");
@@ -237,7 +234,7 @@
     // is suppressed (V8 doesn't parse while the script is loading), and the
     // upper layer (ScriptResourceClient) should get a notification when the
     // script is loaded.
-    ScriptStreamer::startStreaming(pendingScript(), PendingScript::ParsingBlocking, m_settings.get(), m_scope.scriptState(), m_loadingTaskRunner);
+    ScriptStreamer::startStreaming(pendingScript(), PendingScript::ParsingBlocking, m_settings.get(), m_scope.scriptState());
     TestScriptResourceClient client;
     pendingScript().watchForLoad(&client);
     appendData("function foo() {");
@@ -266,7 +263,7 @@
     // Empty scripts should also be streamed properly, that is, the upper layer
     // (ScriptResourceClient) should be notified when an empty script has been
     // loaded.
-    ScriptStreamer::startStreaming(pendingScript(), PendingScript::ParsingBlocking, m_settings.get(), m_scope.scriptState(), m_loadingTaskRunner);
+    ScriptStreamer::startStreaming(pendingScript(), PendingScript::ParsingBlocking, m_settings.get(), m_scope.scriptState());
     TestScriptResourceClient client;
     pendingScript().watchForLoad(&client);
 
@@ -287,7 +284,7 @@
     // Small scripts shouldn't be streamed.
     ScriptStreamer::setSmallScriptThresholdForTesting(100);
 
-    ScriptStreamer::startStreaming(pendingScript(), PendingScript::ParsingBlocking, m_settings.get(), m_scope.scriptState(), m_loadingTaskRunner);
+    ScriptStreamer::startStreaming(pendingScript(), PendingScript::ParsingBlocking, m_settings.get(), m_scope.scriptState());
     TestScriptResourceClient client;
     pendingScript().watchForLoad(&client);
 
@@ -311,7 +308,7 @@
     // chunk is small.
     ScriptStreamer::setSmallScriptThresholdForTesting(100);
 
-    ScriptStreamer::startStreaming(pendingScript(), PendingScript::ParsingBlocking, m_settings.get(), m_scope.scriptState(), m_loadingTaskRunner);
+    ScriptStreamer::startStreaming(pendingScript(), PendingScript::ParsingBlocking, m_settings.get(), m_scope.scriptState());
     TestScriptResourceClient client;
     pendingScript().watchForLoad(&client);
 
@@ -341,7 +338,7 @@
     // loading it.
     m_resource->setEncoding("windows-1252");
 
-    ScriptStreamer::startStreaming(pendingScript(), PendingScript::ParsingBlocking, m_settings.get(), m_scope.scriptState(), m_loadingTaskRunner);
+    ScriptStreamer::startStreaming(pendingScript(), PendingScript::ParsingBlocking, m_settings.get(), m_scope.scriptState());
     TestScriptResourceClient client;
     pendingScript().watchForLoad(&client);
 
@@ -370,7 +367,7 @@
     // will also affect encoding detection.
     m_resource->setEncoding("windows-1252"); // This encoding is wrong on purpose.
 
-    ScriptStreamer::startStreaming(pendingScript(), PendingScript::ParsingBlocking, m_settings.get(), m_scope.scriptState(), m_loadingTaskRunner);
+    ScriptStreamer::startStreaming(pendingScript(), PendingScript::ParsingBlocking, m_settings.get(), m_scope.scriptState());
     TestScriptResourceClient client;
     pendingScript().watchForLoad(&client);
 
diff --git a/third_party/WebKit/Source/core/animation/CSSValueInterpolationType.cpp b/third_party/WebKit/Source/core/animation/CSSValueInterpolationType.cpp
index 728a9bb..bf9e74c3 100644
--- a/third_party/WebKit/Source/core/animation/CSSValueInterpolationType.cpp
+++ b/third_party/WebKit/Source/core/animation/CSSValueInterpolationType.cpp
@@ -25,7 +25,9 @@
 private:
     CSSValueNonInterpolableValue(PassRefPtrWillBeRawPtr<CSSValue> cssValue)
         : m_cssValue(cssValue)
-    { }
+    {
+        ASSERT(m_cssValue);
+    }
 
     RefPtrWillBePersistent<CSSValue> m_cssValue;
 };
@@ -35,14 +37,15 @@
 
 PassOwnPtr<InterpolationValue> CSSValueInterpolationType::maybeConvertSingle(const CSSPropertySpecificKeyframe& keyframe, const StyleResolverState*, ConversionCheckers&) const
 {
+    if (keyframe.isNeutral())
+        return nullptr;
+
     return InterpolationValue::create(*this, InterpolableList::create(0), CSSValueNonInterpolableValue::create(keyframe.value()));
 }
 
 void CSSValueInterpolationType::apply(const InterpolableValue&, const NonInterpolableValue* nonInterpolableValue, StyleResolverState& state) const
 {
-    CSSValue* value = toCSSValueNonInterpolableValue(nonInterpolableValue)->cssValue();
-    if (value)
-        StyleBuilder::applyProperty(m_property, state, value);
+    StyleBuilder::applyProperty(m_property, state, toCSSValueNonInterpolableValue(nonInterpolableValue)->cssValue());
 }
 
 } // namespace blink
diff --git a/third_party/WebKit/Source/core/animation/CSSValueInterpolationType.h b/third_party/WebKit/Source/core/animation/CSSValueInterpolationType.h
index 9d8ac2e..51c3490 100644
--- a/third_party/WebKit/Source/core/animation/CSSValueInterpolationType.h
+++ b/third_party/WebKit/Source/core/animation/CSSValueInterpolationType.h
@@ -29,6 +29,11 @@
         return nullptr;
     }
 
+    void composite(UnderlyingValue& underlyingValue, double underlyingFraction, const InterpolationValue& value) const final
+    {
+        underlyingValue.set(&value);
+    }
+
     void apply(const InterpolableValue&, const NonInterpolableValue*, StyleResolverState&) const final;
 };
 
diff --git a/third_party/WebKit/Source/core/animation/InvalidatableStyleInterpolation.cpp b/third_party/WebKit/Source/core/animation/InvalidatableStyleInterpolation.cpp
index 490a11c..9c10a73 100644
--- a/third_party/WebKit/Source/core/animation/InvalidatableStyleInterpolation.cpp
+++ b/third_party/WebKit/Source/core/animation/InvalidatableStyleInterpolation.cpp
@@ -10,40 +10,31 @@
 
 namespace blink {
 
-InvalidatableStyleInterpolation::InvalidatableStyleInterpolation(
-    const Vector<const InterpolationType*>& interpolationTypes,
-    const CSSPropertySpecificKeyframe& startKeyframe,
-    const CSSPropertySpecificKeyframe& endKeyframe)
-    : StyleInterpolation(nullptr, nullptr, interpolationTypes.first()->property())
-    , m_interpolationTypes(interpolationTypes)
-    , m_startKeyframe(&startKeyframe)
-    , m_endKeyframe(&endKeyframe)
+void InvalidatableStyleInterpolation::interpolate(int, double fraction)
 {
-    maybeCachePairwiseConversion(nullptr, nullptr);
-    interpolate(0, 0);
+    if (fraction == m_currentFraction)
+        return;
+
+    if (m_currentFraction == 0 || m_currentFraction == 1 || fraction == 0 || fraction == 1)
+        clearCache();
+
+    m_currentFraction = fraction;
+    if (m_isCached && m_cachedPairConversion)
+        m_cachedPairConversion->interpolateValue(fraction, m_cachedValue);
+    // We defer the interpolation to ensureValidInterpolation() if m_cachedPairConversion is null.
 }
 
-bool InvalidatableStyleInterpolation::maybeCachePairwiseConversion(const StyleResolverState* state, const InterpolationValue* underlyingValue) const
+PassOwnPtr<PairwisePrimitiveInterpolation> InvalidatableStyleInterpolation::maybeConvertPairwise(const StyleResolverState* state, const InterpolationValue* underlyingValue) const
 {
+    ASSERT(m_currentFraction != 0 && m_currentFraction != 1);
     for (const auto& interpolationType : m_interpolationTypes) {
         if ((m_startKeyframe->isNeutral() || m_endKeyframe->isNeutral()) && (!underlyingValue || underlyingValue->type() != *interpolationType))
             continue;
         OwnPtr<PairwisePrimitiveInterpolation> pairwiseConversion = interpolationType->maybeConvertPairwise(*m_startKeyframe, *m_endKeyframe, state, m_conversionCheckers);
-        if (pairwiseConversion) {
-            m_cachedValue = pairwiseConversion->initialValue();
-            m_cachedConversion = pairwiseConversion.release();
-            return true;
-        }
+        if (pairwiseConversion)
+            return pairwiseConversion.release();
     }
-    return false;
-}
-
-void InvalidatableStyleInterpolation::interpolate(int, double fraction)
-{
-    m_currentFraction = fraction;
-    if (m_cachedConversion)
-        m_cachedConversion->interpolateValue(fraction, m_cachedValue);
-    // We defer the interpolation to ensureValidInterpolation() if m_cachedConversion is null.
+    return nullptr;
 }
 
 PassOwnPtr<InterpolationValue> InvalidatableStyleInterpolation::convertSingleKeyframe(const CSSPropertySpecificKeyframe& keyframe, const StyleResolverState& state, const InterpolationValue* underlyingValue) const
@@ -81,10 +72,20 @@
     return (m_startKeyframe->isNeutral() && m_currentFraction != 1) || (m_endKeyframe->isNeutral() && m_currentFraction != 0);
 }
 
+void InvalidatableStyleInterpolation::clearCache() const
+{
+    m_isCached = false;
+    m_cachedPairConversion.clear();
+    m_conversionCheckers.clear();
+    m_cachedValue.clear();
+}
+
 bool InvalidatableStyleInterpolation::isCacheValid(const StyleResolverState& state, const InterpolationValue* underlyingValue) const
 {
+    if (!m_isCached)
+        return false;
     if (isNeutralKeyframeActive()) {
-        if (m_cachedConversion->isFlip())
+        if (m_cachedPairConversion && m_cachedPairConversion->isFlip())
             return false;
         // Pairwise interpolation can never happen between different InterpolationTypes, neutral values always represent the underlying value.
         if (!underlyingValue || !m_cachedValue || m_cachedValue->type() != underlyingValue->type())
@@ -99,15 +100,27 @@
 
 const InterpolationValue* InvalidatableStyleInterpolation::ensureValidInterpolation(const StyleResolverState& state, const InterpolationValue* underlyingValue) const
 {
-    if (m_cachedConversion && isCacheValid(state, underlyingValue))
+    ASSERT(!std::isnan(m_currentFraction));
+    if (isCacheValid(state, underlyingValue))
         return m_cachedValue.get();
-    m_conversionCheckers.clear();
-    if (!maybeCachePairwiseConversion(&state, underlyingValue)) {
-        m_cachedConversion = FlipPrimitiveInterpolation::create(
-            convertSingleKeyframe(*m_startKeyframe, state, underlyingValue),
-            convertSingleKeyframe(*m_endKeyframe, state, underlyingValue));
+    clearCache();
+    if (m_currentFraction == 0) {
+        m_cachedValue = convertSingleKeyframe(*m_startKeyframe, state, underlyingValue);
+    } else if (m_currentFraction == 1) {
+        m_cachedValue = convertSingleKeyframe(*m_endKeyframe, state, underlyingValue);
+    } else {
+        OwnPtr<PairwisePrimitiveInterpolation> pairwiseConversion = maybeConvertPairwise(&state, underlyingValue);
+        if (pairwiseConversion) {
+            m_cachedValue = pairwiseConversion->initialValue();
+            m_cachedPairConversion = pairwiseConversion.release();
+        } else {
+            m_cachedPairConversion = FlipPrimitiveInterpolation::create(
+                convertSingleKeyframe(*m_startKeyframe, state, underlyingValue),
+                convertSingleKeyframe(*m_endKeyframe, state, underlyingValue));
+        }
+        m_cachedPairConversion->interpolateValue(m_currentFraction, m_cachedValue);
     }
-    m_cachedConversion->interpolateValue(m_currentFraction, m_cachedValue);
+    m_isCached = true;
     return m_cachedValue.get();
 }
 
@@ -123,7 +136,11 @@
 
 double InvalidatableStyleInterpolation::underlyingFraction() const
 {
-    return m_cachedConversion->interpolateUnderlyingFraction(m_startKeyframe->underlyingFraction(), m_endKeyframe->underlyingFraction(), m_currentFraction);
+    if (m_currentFraction == 0)
+        return m_startKeyframe->underlyingFraction();
+    if (m_currentFraction == 1)
+        return m_endKeyframe->underlyingFraction();
+    return m_cachedPairConversion->interpolateUnderlyingFraction(m_startKeyframe->underlyingFraction(), m_endKeyframe->underlyingFraction(), m_currentFraction);
 }
 
 void InvalidatableStyleInterpolation::applyStack(const ActiveInterpolations& interpolations, StyleResolverState& state)
diff --git a/third_party/WebKit/Source/core/animation/InvalidatableStyleInterpolation.h b/third_party/WebKit/Source/core/animation/InvalidatableStyleInterpolation.h
index 5f14c4d..f9c174b 100644
--- a/third_party/WebKit/Source/core/animation/InvalidatableStyleInterpolation.h
+++ b/third_party/WebKit/Source/core/animation/InvalidatableStyleInterpolation.h
@@ -34,15 +34,23 @@
 
 private:
     InvalidatableStyleInterpolation(
-        const Vector<const InterpolationType*>& InterpolationTypes,
+        const Vector<const InterpolationType*>& interpolationTypes,
         const CSSPropertySpecificKeyframe& startKeyframe,
-        const CSSPropertySpecificKeyframe& endKeyframe);
+        const CSSPropertySpecificKeyframe& endKeyframe)
+        : StyleInterpolation(nullptr, nullptr, interpolationTypes.first()->property())
+        , m_interpolationTypes(interpolationTypes)
+        , m_startKeyframe(&startKeyframe)
+        , m_endKeyframe(&endKeyframe)
+        , m_currentFraction(std::numeric_limits<double>::quiet_NaN())
+        , m_isCached(false)
+    { }
 
     PassOwnPtr<InterpolationValue> maybeConvertUnderlyingValue(const StyleResolverState&) const;
     const InterpolationValue* ensureValidInterpolation(const StyleResolverState&, const InterpolationValue* underlyingValue) const;
+    void clearCache() const;
     bool isCacheValid(const StyleResolverState&, const InterpolationValue* underlyingValue) const;
     bool isNeutralKeyframeActive() const;
-    bool maybeCachePairwiseConversion(const StyleResolverState*, const InterpolationValue* underlyingValue) const;
+    PassOwnPtr<PairwisePrimitiveInterpolation> maybeConvertPairwise(const StyleResolverState*, const InterpolationValue* underlyingValue) const;
     PassOwnPtr<InterpolationValue> convertSingleKeyframe(const CSSPropertySpecificKeyframe&, const StyleResolverState&, const InterpolationValue* underlyingValue) const;
     void setFlagIfInheritUsed(StyleResolverState&) const;
     double underlyingFraction() const;
@@ -51,7 +59,8 @@
     const CSSPropertySpecificKeyframe* m_startKeyframe;
     const CSSPropertySpecificKeyframe* m_endKeyframe;
     double m_currentFraction;
-    mutable OwnPtr<PrimitiveInterpolation> m_cachedConversion;
+    mutable bool m_isCached;
+    mutable OwnPtr<PrimitiveInterpolation> m_cachedPairConversion;
     mutable InterpolationType::ConversionCheckers m_conversionCheckers;
     mutable OwnPtr<InterpolationValue> m_cachedValue;
 };
diff --git a/third_party/WebKit/Source/core/compositing/DisplayListCompositingBuilder.cpp b/third_party/WebKit/Source/core/compositing/DisplayListCompositingBuilder.cpp
index a0bea57..99c7268 100644
--- a/third_party/WebKit/Source/core/compositing/DisplayListCompositingBuilder.cpp
+++ b/third_party/WebKit/Source/core/compositing/DisplayListCompositingBuilder.cpp
@@ -14,7 +14,7 @@
     // TODO(pdr): Properly implement simple layer compositing here.
     // See: https://docs.google.com/document/d/1qF7wpO_lhuxUO6YXKZ3CJuXi0grcb5gKZJBBgnoTd0k/view
     DisplayItemPropertyTreeBuilder treeBuilder;
-    for (const auto& displayItem : m_displayItemList.displayItems())
+    for (const auto& displayItem : m_paintController.displayItems())
         treeBuilder.processDisplayItem(displayItem);
     compositedDisplayList.transformTree = treeBuilder.releaseTransformTree();
     // TODO(pdr, jbroman): Also release other trees, and use range records to
diff --git a/third_party/WebKit/Source/core/compositing/DisplayListCompositingBuilder.h b/third_party/WebKit/Source/core/compositing/DisplayListCompositingBuilder.h
index 6a38379..ef159c5 100644
--- a/third_party/WebKit/Source/core/compositing/DisplayListCompositingBuilder.h
+++ b/third_party/WebKit/Source/core/compositing/DisplayListCompositingBuilder.h
@@ -7,19 +7,19 @@
 
 #include "core/CoreExport.h"
 #include "platform/graphics/CompositedDisplayList.h"
-#include "platform/graphics/paint/DisplayItemList.h"
+#include "platform/graphics/paint/PaintController.h"
 
 namespace blink {
 
 class CORE_EXPORT DisplayListCompositingBuilder {
 public:
-    DisplayListCompositingBuilder(const DisplayItemList& displayItemList)
-        : m_displayItemList(displayItemList) { }
+    DisplayListCompositingBuilder(const PaintController& paintController)
+        : m_paintController(paintController) { }
 
     void build(CompositedDisplayList&);
 
 private:
-    const DisplayItemList& m_displayItemList;
+    const PaintController& m_paintController;
 };
 
 } // namespace blink
diff --git a/third_party/WebKit/Source/core/compositing/DisplayListCompositingBuilderTest.cpp b/third_party/WebKit/Source/core/compositing/DisplayListCompositingBuilderTest.cpp
index f753e2ebe..bb3ae613 100644
--- a/third_party/WebKit/Source/core/compositing/DisplayListCompositingBuilderTest.cpp
+++ b/third_party/WebKit/Source/core/compositing/DisplayListCompositingBuilderTest.cpp
@@ -31,10 +31,10 @@
 
 TEST_F(DisplayListCompositingBuilderTest, BasicTransformPropertyTree)
 {
-    OwnPtr<DisplayItemList> displayItemList = DisplayItemList::create();
-    displayItemList->commitNewDisplayItems();
+    OwnPtr<PaintController> paintController = PaintController::create();
+    paintController->commitNewDisplayItems();
 
-    DisplayListCompositingBuilder compositingBuilder(*displayItemList);
+    DisplayListCompositingBuilder compositingBuilder(*paintController);
     CompositedDisplayList compositedDisplayList;
     compositingBuilder.build(compositedDisplayList);
 
diff --git a/third_party/WebKit/Source/core/core.gypi b/third_party/WebKit/Source/core/core.gypi
index 57fa60da..744d0642 100644
--- a/third_party/WebKit/Source/core/core.gypi
+++ b/third_party/WebKit/Source/core/core.gypi
@@ -577,8 +577,6 @@
             'layout/LayoutFrame.h',
             'layout/LayoutFrameSet.cpp',
             'layout/LayoutFrameSet.h',
-            'layout/LayoutFullScreen.cpp',
-            'layout/LayoutFullScreen.h',
             'layout/LayoutGeometryMap.cpp',
             'layout/LayoutGeometryMap.h',
             'layout/LayoutGeometryMapStep.h',
@@ -3894,11 +3892,11 @@
             'page/PagePopupClientTest.cpp',
             'page/PrintContextTest.cpp',
             'page/scrolling/ScrollStateTest.cpp',
-            'paint/DisplayItemListPaintTest.cpp',
-            'paint/DisplayItemListPaintTest.h',
             'paint/LayerClipRecorderTest.cpp',
             'paint/LayoutObjectDrawingRecorderTest.cpp',
             'paint/NinePieceImageGridTest.cpp',
+            'paint/PaintControllerPaintTest.cpp',
+            'paint/PaintControllerPaintTest.h',
             'paint/PaintLayerPainterTest.cpp',
             'paint/TableCellPainterTest.cpp',
             'paint/TextPainterTest.cpp',
diff --git a/third_party/WebKit/Source/core/css/CSSFontFace.cpp b/third_party/WebKit/Source/core/css/CSSFontFace.cpp
index 73fa060..838fb993 100644
--- a/third_party/WebKit/Source/core/css/CSSFontFace.cpp
+++ b/third_party/WebKit/Source/core/css/CSSFontFace.cpp
@@ -115,6 +115,17 @@
     return false;
 }
 
+bool CSSFontFace::maybeScheduleFontLoad(const FontDescription& fontDescription, const FontDataRange& range)
+{
+    if (m_ranges.contains(range) || (range.isEntireRange() && m_ranges.isEntireRange())) {
+        if (loadStatus() == FontFace::Unloaded) {
+            load(fontDescription);
+        }
+        return true;
+    }
+    return false;
+}
+
 void CSSFontFace::load()
 {
     FontDescription fontDescription;
@@ -214,6 +225,15 @@
     return it != m_ranges.end() && it->contains(c);
 }
 
+bool CSSFontFace::UnicodeRangeSet::contains(const FontDataRange& range) const
+{
+    for (auto it = m_ranges.begin(); it != m_ranges.end(); ++it) {
+        if (*it == range)
+            return true;
+    }
+    return false;
+}
+
 bool CSSFontFace::UnicodeRangeSet::intersectsWith(const String& text) const
 {
     if (text.isEmpty())
diff --git a/third_party/WebKit/Source/core/css/CSSFontFace.h b/third_party/WebKit/Source/core/css/CSSFontFace.h
index ef0a283..29b61c3 100644
--- a/third_party/WebKit/Source/core/css/CSSFontFace.h
+++ b/third_party/WebKit/Source/core/css/CSSFontFace.h
@@ -30,6 +30,7 @@
 #include "core/css/CSSFontFaceSource.h"
 #include "core/css/CSSSegmentedFontFace.h"
 #include "core/css/FontFace.h"
+#include "platform/fonts/SegmentedFontData.h"
 #include "wtf/Deque.h"
 #include "wtf/Forward.h"
 #include "wtf/PassRefPtr.h"
@@ -86,6 +87,7 @@
         bool contains(UChar32 c) const { return m_from <= c && c <= m_to; }
         bool operator<(const UnicodeRange& other) const { return m_from < other.m_from; }
         bool operator<(UChar32 c) const { return m_to < c; }
+        bool operator==(const FontDataRange& fontDataRange) const { return fontDataRange.from() == m_from && fontDataRange.to() == m_to; };
 
     private:
         UChar32 m_from;
@@ -97,6 +99,7 @@
     public:
         explicit UnicodeRangeSet(const Vector<UnicodeRange>&);
         bool contains(UChar32) const;
+        bool contains(const FontDataRange&) const;
         bool intersectsWith(const String&) const;
         bool isEntireRange() const { return m_ranges.isEmpty(); }
         size_t size() const { return m_ranges.size(); }
@@ -107,6 +110,7 @@
 
     FontFace::LoadStatus loadStatus() const { return m_fontFace->loadStatus(); }
     bool maybeScheduleFontLoad(const FontDescription&, UChar32);
+    bool maybeScheduleFontLoad(const FontDescription&, const FontDataRange&);
     void load();
     void load(const FontDescription&);
 
diff --git a/third_party/WebKit/Source/core/css/CSSFontSelector.cpp b/third_party/WebKit/Source/core/css/CSSFontSelector.cpp
index d984785..6eca679 100644
--- a/third_party/WebKit/Source/core/css/CSSFontSelector.cpp
+++ b/third_party/WebKit/Source/core/css/CSSFontSelector.cpp
@@ -148,6 +148,13 @@
         face->willUseFontData(fontDescription, character);
 }
 
+void CSSFontSelector::willUseRange(const FontDescription& fontDescription, const AtomicString& family, const FontDataRange& range)
+{
+    CSSSegmentedFontFace* face = m_fontFaceCache.get(fontDescription, family);
+    if (face)
+        face->willUseRange(fontDescription, range);
+}
+
 bool CSSFontSelector::isPlatformFontAvailable(const FontDescription& fontDescription, const AtomicString& passedFamily)
 {
     AtomicString family = familyNameFromSettings(m_genericFontFamilySettings, fontDescription, passedFamily);
diff --git a/third_party/WebKit/Source/core/css/CSSFontSelector.h b/third_party/WebKit/Source/core/css/CSSFontSelector.h
index 1ef33994..ce8985f 100644
--- a/third_party/WebKit/Source/core/css/CSSFontSelector.h
+++ b/third_party/WebKit/Source/core/css/CSSFontSelector.h
@@ -54,6 +54,7 @@
 
     PassRefPtr<FontData> getFontData(const FontDescription&, const AtomicString&) override;
     void willUseFontData(const FontDescription&, const AtomicString& family, UChar32) override;
+    void willUseRange(const FontDescription&, const AtomicString& familyName, const FontDataRange&) override;
     bool isPlatformFontAvailable(const FontDescription&, const AtomicString& family);
 
 #if !ENABLE(OILPAN)
diff --git a/third_party/WebKit/Source/core/css/CSSPrimitiveValue.cpp b/third_party/WebKit/Source/core/css/CSSPrimitiveValue.cpp
index 40f2c48..8f6b2ab6 100644
--- a/third_party/WebKit/Source/core/css/CSSPrimitiveValue.cpp
+++ b/third_party/WebKit/Source/core/css/CSSPrimitiveValue.cpp
@@ -155,7 +155,7 @@
     }
 }
 
-using CSSTextCache = HashMap<const CSSPrimitiveValue*, String>;
+using CSSTextCache = WillBePersistentHeapHashMap<RawPtrWillBeWeakMember<const CSSPrimitiveValue>, String>;
 static CSSTextCache& cssTextCache()
 {
     AtomicallyInitializedStaticReference(ThreadSpecific<CSSTextCache>, cache, new ThreadSpecific<CSSTextCache>());
diff --git a/third_party/WebKit/Source/core/css/CSSSegmentedFontFace.cpp b/third_party/WebKit/Source/core/css/CSSSegmentedFontFace.cpp
index 2159ee3..9a222cb 100644
--- a/third_party/WebKit/Source/core/css/CSSSegmentedFontFace.cpp
+++ b/third_party/WebKit/Source/core/css/CSSSegmentedFontFace.cpp
@@ -169,6 +169,18 @@
     }
 }
 
+void CSSSegmentedFontFace::willUseRange(const blink::FontDescription& fontDescription, const blink::FontDataRange& range)
+{
+    // Iterating backwards since later defined unicode-range faces override
+    // previously defined ones, according to the CSS3 fonts module.
+    // https://drafts.csswg.org/css-fonts/#composite-fonts
+    for (FontFaceList::reverse_iterator it = m_fontFaces.rbegin(); it != m_fontFaces.rend(); ++it) {
+        CSSFontFace* cssFontFace = (*it)->cssFontFace();
+        if (cssFontFace->maybeScheduleFontLoad(fontDescription, range))
+            break;
+    }
+}
+
 bool CSSSegmentedFontFace::checkFont(const String& text) const
 {
     for (const auto& fontFace : m_fontFaces) {
diff --git a/third_party/WebKit/Source/core/css/CSSSegmentedFontFace.h b/third_party/WebKit/Source/core/css/CSSSegmentedFontFace.h
index f7933dd..25e25956 100644
--- a/third_party/WebKit/Source/core/css/CSSSegmentedFontFace.h
+++ b/third_party/WebKit/Source/core/css/CSSSegmentedFontFace.h
@@ -27,6 +27,7 @@
 #define CSSSegmentedFontFace_h
 
 #include "platform/fonts/FontTraits.h"
+#include "platform/fonts/SegmentedFontData.h"
 #include "platform/heap/Handle.h"
 #include "wtf/HashMap.h"
 #include "wtf/ListHashSet.h"
@@ -67,6 +68,7 @@
     bool checkFont(const String&) const;
     void match(const String&, WillBeHeapVector<RefPtrWillBeMember<FontFace>>&) const;
     void willUseFontData(const FontDescription&, UChar32);
+    void willUseRange(const FontDescription&, const FontDataRange&);
 
     DECLARE_TRACE();
 
diff --git a/third_party/WebKit/Source/core/css/MediaQueryEvaluator.cpp b/third_party/WebKit/Source/core/css/MediaQueryEvaluator.cpp
index d3b35740..d9a6db1 100644
--- a/third_party/WebKit/Source/core/css/MediaQueryEvaluator.cpp
+++ b/third_party/WebKit/Source/core/css/MediaQueryEvaluator.cpp
@@ -221,6 +221,11 @@
 
 static bool displayModeMediaFeatureEval(const MediaQueryExpValue& value, MediaFeaturePrefix, const MediaValues& mediaValues)
 {
+    // isValid() is false if there is no parameter. Without parameter we should return true to indicate that
+    // displayModeMediaFeature is enabled in the browser.
+    if (!value.isValid())
+        return true;
+
     if (!value.isID)
         return false;
 
diff --git a/third_party/WebKit/Source/core/css/MediaQueryEvaluatorTest.cpp b/third_party/WebKit/Source/core/css/MediaQueryEvaluatorTest.cpp
index dc205a1..99a0cf2 100644
--- a/third_party/WebKit/Source/core/css/MediaQueryEvaluatorTest.cpp
+++ b/third_party/WebKit/Source/core/css/MediaQueryEvaluatorTest.cpp
@@ -54,7 +54,7 @@
     {"(hover: hover)", 1},
     {"(hover: on-demand)", 0},
     {"(hover: none)", 0},
-    {"(display-mode)", 0},
+    {"(display-mode)", 1},
     {"(display-mode: fullscreen)", 0},
     {"(display-mode: standalone)", 0},
     {"(display-mode: minimal-ui)", 0},
diff --git a/third_party/WebKit/Source/core/css/MediaQueryExp.cpp b/third_party/WebKit/Source/core/css/MediaQueryExp.cpp
index e702faeb..46fe8c472 100644
--- a/third_party/WebKit/Source/core/css/MediaQueryExp.cpp
+++ b/third_party/WebKit/Source/core/css/MediaQueryExp.cpp
@@ -157,6 +157,7 @@
         || mediaFeature == anyPointerMediaFeature
         || mediaFeature == devicePixelRatioMediaFeature
         || mediaFeature == resolutionMediaFeature
+        || mediaFeature == displayModeMediaFeature
         || mediaFeature == scanMediaFeature;
 }
 
diff --git a/third_party/WebKit/Source/core/css/fullscreen.css b/third_party/WebKit/Source/core/css/fullscreen.css
index bb9c79e..4654b47 100644
--- a/third_party/WebKit/Source/core/css/fullscreen.css
+++ b/third_party/WebKit/Source/core/css/fullscreen.css
@@ -1,60 +1,40 @@
-:-webkit-full-screen {
-    background-color: white;
-    z-index: 2147483647 !important;
-}
-
-:root:-webkit-full-screen-ancestor {
-    overflow: hidden !important;
-}
-
-:-webkit-full-screen-ancestor:not(iframe) {
-    z-index: auto !important;
-    position: static !important;
-    opacity: 1 !important;
-    transform: none !important;
-    -webkit-mask: none !important;
-    clip: none !important;
-    -webkit-filter: none !important;
-    transition: none !important;
-    -webkit-box-reflect: none !important;
-    -webkit-perspective: none !important;
-    -webkit-transform-style: flat !important;
-}
-
-video:-webkit-full-screen, audio:-webkit-full-screen {
-    background-color: transparent !important;
-    position: relative !important;
+:not(:root):-webkit-full-screen {
+    position: fixed !important;
+    top: 0 !important;
+    right: 0 !important;
+    bottom: 0 !important;
     left: 0 !important;
-    top: 0 ! important;
     margin: 0 !important;
+    box-sizing: border-box !important;
     min-width: 0 !important;
     max-width: none !important;
     min-height: 0 !important;
     max-height: none !important;
     width: 100% !important;
     height: 100% !important;
-    flex: 1 !important;
-    display: block !important;
+    object-fit: contain !important;
     transform: none !important;
 }
 
-img:-webkit-full-screen {
-    width: auto;
-    height: 100%;
-    max-width: 100%;
-}
-
 iframe:-webkit-full-screen {
-    margin: 0 !important;
+    border: none !important;
     padding: 0 !important;
-    border: 0 !important;
-    position: fixed !important;
-    min-width: 0 !important;
-    max-width: none !important;
-    min-height: 0 !important;
-    max-height: none !important;
-    width: 100% !important;
-    height: 100% !important;
-    left: 0 !important;
-    top: 0 !important;
+}
+
+:not(:root):-webkit-full-screen::backdrop {
+    position: fixed;
+    top: 0;
+    right: 0;
+    bottom: 0;
+    left: 0;
+    background: black;
+}
+
+/* Anything below are extensions over what the Fullscreen API (29 September 2015) mandates. */
+
+/* This prevents video from overflowing the viewport in
+   virtual/android/fullscreen/video-scrolled-iframe.html
+   FIXME: We should remove this (see crbug.com/441890). */
+:root:-webkit-full-screen-ancestor {
+    overflow: hidden;
 }
diff --git a/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp b/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp
index 9eaca7d..b058883 100644
--- a/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp
+++ b/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp
@@ -11,6 +11,7 @@
 #include "core/css/CSSFontFaceSrcValue.h"
 #include "core/css/CSSFontFeatureValue.h"
 #include "core/css/CSSPrimitiveValueMappings.h"
+#include "core/css/CSSQuadValue.h"
 #include "core/css/CSSStringValue.h"
 #include "core/css/CSSURIValue.h"
 #include "core/css/CSSUnicodeRangeValue.h"
@@ -713,6 +714,127 @@
     return result.release();
 }
 
+static PassRefPtrWillBeRawPtr<CSSValue> consumeTextIndent(CSSParserTokenRange& range, CSSParserMode cssParserMode)
+{
+    // [ <length> | <percentage> ] && hanging? && each-line?
+    // Keywords only allowed when css3Text is enabled.
+    RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated();
+
+    bool hasLengthOrPercentage = false;
+    bool hasEachLine = false;
+    bool hasHanging = false;
+
+    do {
+        if (!hasLengthOrPercentage) {
+            if (RefPtrWillBeRawPtr<CSSValue> textIndent = consumeLengthOrPercent(range, cssParserMode, ValueRangeAll, UnitlessQuirk::Allow)) {
+                list->append(textIndent.release());
+                hasLengthOrPercentage = true;
+                continue;
+            }
+        }
+
+        if (RuntimeEnabledFeatures::css3TextEnabled()) {
+            CSSValueID id = range.peek().id();
+            if (!hasEachLine && id == CSSValueEachLine) {
+                list->append(consumeIdent(range));
+                hasEachLine = true;
+                continue;
+            }
+            if (!hasHanging && id == CSSValueHanging) {
+                list->append(consumeIdent(range));
+                hasHanging = true;
+                continue;
+            }
+        }
+        return nullptr;
+    } while (!range.atEnd());
+
+    if (!hasLengthOrPercentage)
+        return nullptr;
+
+    return list.release();
+}
+
+static bool validWidthOrHeightKeyword(CSSValueID id, const CSSParserContext& context)
+{
+    if (id == CSSValueIntrinsic || id == CSSValueMinIntrinsic
+        || id == CSSValueWebkitMinContent || id == CSSValueWebkitMaxContent || id == CSSValueWebkitFillAvailable || id == CSSValueWebkitFitContent
+        || id == CSSValueMinContent || id == CSSValueMaxContent || id == CSSValueFitContent) {
+        if (context.useCounter()) {
+            switch (id) {
+            case CSSValueIntrinsic:
+            case CSSValueMinIntrinsic:
+                // These two will be counted in StyleAdjuster because they emit a deprecation
+                // message, and we don't have access to a Document/LocalFrame here.
+                break;
+            case CSSValueWebkitMinContent:
+                context.useCounter()->count(UseCounter::CSSValuePrefixedMinContent);
+                break;
+            case CSSValueWebkitMaxContent:
+                context.useCounter()->count(UseCounter::CSSValuePrefixedMaxContent);
+                break;
+            case CSSValueWebkitFillAvailable:
+                context.useCounter()->count(UseCounter::CSSValuePrefixedFillAvailable);
+                break;
+            case CSSValueWebkitFitContent:
+                context.useCounter()->count(UseCounter::CSSValuePrefixedFitContent);
+                break;
+            default:
+                break;
+            }
+        }
+        return true;
+    }
+    return false;
+}
+
+static PassRefPtrWillBeRawPtr<CSSValue> consumeMaxWidthOrHeight(CSSParserTokenRange& range, const CSSParserContext& context, UnitlessQuirk unitless = UnitlessQuirk::Forbid)
+{
+    if (range.peek().id() == CSSValueNone || validWidthOrHeightKeyword(range.peek().id(), context))
+        return consumeIdent(range);
+    return consumeLengthOrPercent(range, context.mode(), ValueRangeNonNegative, unitless);
+}
+
+static PassRefPtrWillBeRawPtr<CSSValue> consumeWidthOrHeight(CSSParserTokenRange& range, const CSSParserContext& context, UnitlessQuirk unitless = UnitlessQuirk::Forbid)
+{
+    if (range.peek().id() == CSSValueAuto || validWidthOrHeightKeyword(range.peek().id(), context))
+        return consumeIdent(range);
+    return consumeLengthOrPercent(range, context.mode(), ValueRangeNonNegative, unitless);
+}
+
+static PassRefPtrWillBeRawPtr<CSSPrimitiveValue> consumeClipComponent(CSSParserTokenRange& range, CSSParserMode cssParserMode)
+{
+    if (range.peek().id() == CSSValueAuto)
+        return consumeIdent(range);
+    return consumeLength(range, cssParserMode, ValueRangeAll, UnitlessQuirk::Allow);
+}
+
+static PassRefPtrWillBeRawPtr<CSSValue> consumeClip(CSSParserTokenRange& range, CSSParserMode cssParserMode)
+{
+    if (range.peek().id() == CSSValueAuto)
+        return consumeIdent(range);
+
+    if (range.peek().functionId() != CSSValueRect)
+        return nullptr;
+
+    CSSParserTokenRange args = consumeFunction(range);
+    // rect(t, r, b, l) || rect(t r b l)
+    RefPtrWillBeRawPtr<CSSPrimitiveValue> top = consumeClipComponent(args, cssParserMode);
+    if (!top)
+        return nullptr;
+    bool needsComma = consumeCommaIncludingWhitespace(args);
+    RefPtrWillBeRawPtr<CSSPrimitiveValue> right = consumeClipComponent(args, cssParserMode);
+    if (!right || (needsComma && !consumeCommaIncludingWhitespace(args)))
+        return nullptr;
+    RefPtrWillBeRawPtr<CSSPrimitiveValue> bottom = consumeClipComponent(args, cssParserMode);
+    if (!bottom || (needsComma && !consumeCommaIncludingWhitespace(args)))
+        return nullptr;
+    RefPtrWillBeRawPtr<CSSPrimitiveValue> left = consumeClipComponent(args, cssParserMode);
+    if (!left || !args.atEnd())
+        return nullptr;
+    return CSSQuadValue::create(top.release(), right.release(), bottom.release(), left.release(), CSSQuadValue::SerializeAsRect);
+}
+
 PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseSingleValue(CSSPropertyID propId)
 {
     m_range.consumeWhitespace();
@@ -754,6 +876,26 @@
         return consumeCounter(m_range, m_context.mode(), propId == CSSPropertyCounterIncrement ? 1 : 0);
     case CSSPropertySize:
         return consumeSize(m_range, m_context.mode());
+    case CSSPropertyTextIndent:
+        return consumeTextIndent(m_range, m_context.mode());
+    case CSSPropertyMaxWidth:
+    case CSSPropertyMaxHeight:
+        return consumeMaxWidthOrHeight(m_range, m_context, UnitlessQuirk::Allow);
+    case CSSPropertyWebkitMaxLogicalWidth:
+    case CSSPropertyWebkitMaxLogicalHeight:
+        return consumeMaxWidthOrHeight(m_range, m_context);
+    case CSSPropertyMinWidth:
+    case CSSPropertyMinHeight:
+    case CSSPropertyWidth:
+    case CSSPropertyHeight:
+        return consumeWidthOrHeight(m_range, m_context, UnitlessQuirk::Allow);
+    case CSSPropertyWebkitMinLogicalWidth:
+    case CSSPropertyWebkitMinLogicalHeight:
+    case CSSPropertyWebkitLogicalWidth:
+    case CSSPropertyWebkitLogicalHeight:
+        return consumeWidthOrHeight(m_range, m_context);
+    case CSSPropertyClip:
+        return consumeClip(m_range, m_context.mode());
     default:
         return nullptr;
     }
diff --git a/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.h b/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.h
index 3fcf2a3..e6750b4 100644
--- a/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.h
+++ b/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.h
@@ -179,8 +179,6 @@
     bool parseGridLineNames(CSSParserValueList&, CSSValueList&, CSSGridLineNamesValue* = nullptr);
     PassRefPtrWillBeRawPtr<CSSValue> parseGridAutoFlow(CSSParserValueList&);
 
-    PassRefPtrWillBeRawPtr<CSSQuadValue> parseClipShape();
-
     bool parseLegacyPosition(CSSPropertyID, bool important);
     bool parseItemPositionOverflowPosition(CSSPropertyID, bool important);
     PassRefPtrWillBeRawPtr<CSSValue> parseContentDistributionOverflowPosition();
@@ -264,8 +262,6 @@
 
     PassRefPtrWillBeRawPtr<CSSValue> parseTextDecoration();
 
-    PassRefPtrWillBeRawPtr<CSSValue> parseTextIndent();
-
     bool parseCalculation(CSSParserValue*, ValueRange);
 
     bool parseGeneratedImage(CSSParserValueList*, RefPtrWillBeRawPtr<CSSValue>&);
@@ -328,8 +324,6 @@
         return static_cast<Units>(static_cast<unsigned>(a) | static_cast<unsigned>(b));
     }
 
-    bool validWidthOrHeight(CSSParserValue*, Units);
-
     bool validCalculationUnit(CSSParserValue*, Units, ReleaseParsedCalcValueCondition releaseCalc = DoNotReleaseParsedCalcValue);
 
     bool shouldAcceptUnitLessValues(CSSParserValue*, Units, CSSParserMode);
diff --git a/third_party/WebKit/Source/core/css/parser/LegacyCSSPropertyParser.cpp b/third_party/WebKit/Source/core/css/parser/LegacyCSSPropertyParser.cpp
index d5d2522..ca14e73d 100644
--- a/third_party/WebKit/Source/core/css/parser/LegacyCSSPropertyParser.cpp
+++ b/third_party/WebKit/Source/core/css/parser/LegacyCSSPropertyParser.cpp
@@ -309,40 +309,6 @@
         || id == CSSValueWebkitCrossFade;
 }
 
-bool CSSPropertyParser::validWidthOrHeight(CSSParserValue* value, Units unitless)
-{
-    int id = value->id;
-    if (id == CSSValueIntrinsic || id == CSSValueMinIntrinsic
-        || id == CSSValueWebkitMinContent || id == CSSValueWebkitMaxContent || id == CSSValueWebkitFillAvailable || id == CSSValueWebkitFitContent
-        || id == CSSValueMinContent || id == CSSValueMaxContent || id == CSSValueFitContent) {
-        if (m_context.useCounter()) {
-            switch (value->id) {
-            case CSSValueIntrinsic:
-            case CSSValueMinIntrinsic:
-                // These two will be counted in StyleAdjuster because they emit a deprecation
-                // message, and we don't have access to a Document/LocalFrame here.
-                break;
-            case CSSValueWebkitMinContent:
-                m_context.useCounter()->count(UseCounter::CSSValuePrefixedMinContent);
-                break;
-            case CSSValueWebkitMaxContent:
-                m_context.useCounter()->count(UseCounter::CSSValuePrefixedMaxContent);
-                break;
-            case CSSValueWebkitFillAvailable:
-                m_context.useCounter()->count(UseCounter::CSSValuePrefixedFillAvailable);
-                break;
-            case CSSValueWebkitFitContent:
-                m_context.useCounter()->count(UseCounter::CSSValuePrefixedFitContent);
-                break;
-            default:
-                break;
-            }
-        }
-        return true;
-    }
-    return validUnit(value, FLength | FPercent | FNonNeg | unitless);
-}
-
 inline PassRefPtrWillBeRawPtr<CSSPrimitiveValue> CSSPropertyParser::parseValidPrimitive(CSSValueID identifier, CSSParserValue* value)
 {
     if (identifier)
@@ -435,12 +401,6 @@
         // close-quote | no-open-quote | no-close-quote ]+ | inherit
         parsedValue = parseContent();
         break;
-    case CSSPropertyClip:                 // <shape> | auto | inherit
-        if (id == CSSValueAuto)
-            validPrimitive = true;
-        else if (value->m_unit == CSSParserValue::Function)
-            parsedValue = parseClipShape();
-        break;
 
     /* Start of supported CSS properties with validation. This is needed for parseShorthand to work
      * correctly and allows optimization in blink::applyRule(..)
@@ -660,10 +620,6 @@
             validPrimitive = validUnit(value, FLength | FNonNeg | unitless);
         break;
 
-    case CSSPropertyTextIndent:
-        parsedValue = parseTextIndent();
-        break;
-
     case CSSPropertyPaddingTop:          //// <padding-width> | inherit
     case CSSPropertyPaddingRight:        //   Which is defined as
     case CSSPropertyPaddingBottom:       //   <length> | <percentage>
@@ -677,28 +633,6 @@
         validPrimitive = validUnit(value, FLength | FPercent | FNonNeg | unitless);
         break;
 
-    case CSSPropertyMaxWidth:
-    case CSSPropertyMaxHeight:
-        unitless = FUnitlessQuirk;
-        // fall through
-    case CSSPropertyWebkitMaxLogicalWidth:
-    case CSSPropertyWebkitMaxLogicalHeight:
-        validPrimitive = (id == CSSValueNone || validWidthOrHeight(value, unitless));
-        break;
-
-    case CSSPropertyMinWidth:
-    case CSSPropertyMinHeight:
-    case CSSPropertyWidth:
-    case CSSPropertyHeight:
-        unitless = FUnitlessQuirk;
-        // fall through
-    case CSSPropertyWebkitMinLogicalWidth:
-    case CSSPropertyWebkitMinLogicalHeight:
-    case CSSPropertyWebkitLogicalWidth:
-    case CSSPropertyWebkitLogicalHeight:
-        validPrimitive = (id == CSSValueAuto || validWidthOrHeight(value, unitless));
-        break;
-
     case CSSPropertyVerticalAlign:
         // baseline | sub | super | top | text-top | middle | bottom | text-bottom |
         // <percentage> | <length> | inherit
@@ -1354,6 +1288,20 @@
     case CSSPropertyCounterIncrement:
     case CSSPropertyCounterReset:
     case CSSPropertySize:
+    case CSSPropertyTextIndent:
+    case CSSPropertyMaxWidth:
+    case CSSPropertyMaxHeight:
+    case CSSPropertyWebkitMaxLogicalWidth:
+    case CSSPropertyWebkitMaxLogicalHeight:
+    case CSSPropertyMinWidth:
+    case CSSPropertyMinHeight:
+    case CSSPropertyWidth:
+    case CSSPropertyHeight:
+    case CSSPropertyWebkitMinLogicalWidth:
+    case CSSPropertyWebkitMinLogicalHeight:
+    case CSSPropertyWebkitLogicalWidth:
+    case CSSPropertyWebkitLogicalHeight:
+    case CSSPropertyClip:
         validPrimitive = false;
         break;
 
@@ -3728,50 +3676,6 @@
     return CSSCounterValue::create(identifier.release(), listStyle.release(), separator.release());
 }
 
-PassRefPtrWillBeRawPtr<CSSQuadValue> CSSPropertyParser::parseClipShape()
-{
-    CSSParserValue* value = m_valueList->current();
-    CSSParserValueList* args = value->function->args.get();
-
-    if (value->function->id != CSSValueRect || !args)
-        return nullptr;
-
-    // rect(t, r, b, l) || rect(t r b l)
-    if (args->size() != 4 && args->size() != 7)
-        return nullptr;
-    int i = 0;
-    CSSParserValue* a = args->current();
-
-    RefPtrWillBeRawPtr<CSSPrimitiveValue> top = nullptr;
-    RefPtrWillBeRawPtr<CSSPrimitiveValue> right = nullptr;
-    RefPtrWillBeRawPtr<CSSPrimitiveValue> bottom = nullptr;
-    RefPtrWillBeRawPtr<CSSPrimitiveValue> left = nullptr;
-    while (a) {
-        if (a->id != CSSValueAuto && !validUnit(a, FLength | FUnitlessQuirk))
-            return nullptr;
-        RefPtrWillBeRawPtr<CSSPrimitiveValue> length = a->id == CSSValueAuto ?
-            cssValuePool().createIdentifierValue(CSSValueAuto) :
-            createPrimitiveNumericValue(a);
-        if (i == 0)
-            top = length;
-        else if (i == 1)
-            right = length;
-        else if (i == 2)
-            bottom = length;
-        else
-            left = length;
-        a = args->next();
-        if (a && args->size() == 7) {
-            if (!consumeComma(args))
-                return nullptr;
-            a = args->current();
-        }
-        i++;
-    }
-    m_valueList->next();
-    return CSSQuadValue::create(top.release(), right.release(), bottom.release(), left.release(), CSSQuadValue::SerializeAsRect);
-}
-
 static void completeBorderRadii(RefPtrWillBeRawPtr<CSSPrimitiveValue> radii[4])
 {
     if (radii[3])
@@ -4491,8 +4395,8 @@
 
 PassRefPtrWillBeRawPtr<CSSShadowValue> CSSPropertyParser::parseSingleShadow(CSSParserValueList* valueList, bool allowInset, bool allowSpread)
 {
-    RefPtrWillBeRawPtr<CSSPrimitiveValue> style;
-    RefPtrWillBeRawPtr<CSSPrimitiveValue> color;
+    RefPtrWillBeRawPtr<CSSPrimitiveValue> style = nullptr;
+    RefPtrWillBeRawPtr<CSSPrimitiveValue> color = nullptr;
     WillBeHeapVector<RefPtrWillBeMember<CSSPrimitiveValue>, 4> lengths;
 
     CSSParserValue* val = valueList->current();
@@ -4536,7 +4440,7 @@
     }
 
     if (val) {
-        if (RefPtrWillBeMember<CSSPrimitiveValue> colorValue = parseColor(val)) {
+        if (RefPtrWillBeRawPtr<CSSPrimitiveValue> colorValue = parseColor(val)) {
             if (color)
                 return nullptr;
             color = colorValue;
@@ -6365,45 +6269,6 @@
     return nullptr;
 }
 
-PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseTextIndent()
-{
-    RefPtrWillBeRawPtr<CSSValueList> list = CSSValueList::createSpaceSeparated();
-
-    bool hasLengthOrPercentage = false;
-    bool hasEachLine = false;
-    bool hasHanging = false;
-
-    for (CSSParserValue* value = m_valueList->current(); value; value = m_valueList->next()) {
-        // <length> | <percentage> | inherit when RuntimeEnabledFeatures::css3TextEnabled() returns false
-        if (!hasLengthOrPercentage && validUnit(value, FLength | FPercent | FUnitlessQuirk)) {
-            list->append(createPrimitiveNumericValue(value));
-            hasLengthOrPercentage = true;
-            continue;
-        }
-
-        // [ <length> | <percentage> ] && hanging? && each-line? | inherit
-        // when RuntimeEnabledFeatures::css3TextEnabled() returns true
-        if (RuntimeEnabledFeatures::css3TextEnabled()) {
-            if (!hasEachLine && value->id == CSSValueEachLine) {
-                list->append(cssValuePool().createIdentifierValue(CSSValueEachLine));
-                hasEachLine = true;
-                continue;
-            }
-            if (!hasHanging && value->id == CSSValueHanging) {
-                list->append(cssValuePool().createIdentifierValue(CSSValueHanging));
-                hasHanging = true;
-                continue;
-            }
-        }
-        return nullptr;
-    }
-
-    if (!hasLengthOrPercentage)
-        return nullptr;
-
-    return list.release();
-}
-
 bool CSSPropertyParser::parseCalculation(CSSParserValue* value, ValueRange range)
 {
     ASSERT(isCalculation(value));
diff --git a/third_party/WebKit/Source/core/css/resolver/StyleAdjuster.cpp b/third_party/WebKit/Source/core/css/resolver/StyleAdjuster.cpp
index 87b4b979..e5c21e3 100644
--- a/third_party/WebKit/Source/core/css/resolver/StyleAdjuster.cpp
+++ b/third_party/WebKit/Source/core/css/resolver/StyleAdjuster.cpp
@@ -34,6 +34,8 @@
 #include "core/dom/ContainerNode.h"
 #include "core/dom/Document.h"
 #include "core/dom/Element.h"
+#include "core/dom/Fullscreen.h"
+#include "core/frame/FrameHost.h"
 #include "core/frame/FrameView.h"
 #include "core/frame/Settings.h"
 #include "core/frame/UseCounter.h"
@@ -44,6 +46,7 @@
 #include "core/html/HTMLTextAreaElement.h"
 #include "core/layout/LayoutReplaced.h"
 #include "core/layout/LayoutTheme.h"
+#include "core/page/Page.h"
 #include "core/style/ComputedStyle.h"
 #include "core/style/ComputedStyleConstants.h"
 #include "core/svg/SVGSVGElement.h"
@@ -177,6 +180,17 @@
         adjustStyleForFirstLetter(style);
 
         adjustStyleForDisplay(style, parentStyle, element ? &element->document() : 0);
+
+        if (element && Fullscreen::isActiveFullScreenElement(*element)) {
+            // We need to size the fullscreen element to the inner viewport and not to the
+            // outer viewport (what percentage would do). Unfortunately CSS can't handle
+            // that as we don't expose the inner viewport information.
+            //
+            // TODO(dsinclair): We should find a way to get this standardized. crbug.com/534924
+            IntSize viewportSize = element->document().page()->frameHost().visualViewport().size();
+            style.setWidth(Length(viewportSize.width(), Fixed));
+            style.setHeight(Length(viewportSize.height(), Fixed));
+        }
     } else {
         adjustStyleForFirstLetter(style);
     }
diff --git a/third_party/WebKit/Source/core/dom/AXObjectCache.h b/third_party/WebKit/Source/core/dom/AXObjectCache.h
index 973fe8d6..38814ea 100644
--- a/third_party/WebKit/Source/core/dom/AXObjectCache.h
+++ b/third_party/WebKit/Source/core/dom/AXObjectCache.h
@@ -60,6 +60,7 @@
         AXBlur,
         AXCheckedStateChanged,
         AXChildrenChanged,
+        AXDocumentSelectionChanged,
         AXFocusedUIElementChanged,
         AXHide,
         AXHover,
diff --git a/third_party/WebKit/Source/core/dom/ContainerNode.cpp b/third_party/WebKit/Source/core/dom/ContainerNode.cpp
index 69d4867..36251dd7 100644
--- a/third_party/WebKit/Source/core/dom/ContainerNode.cpp
+++ b/third_party/WebKit/Source/core/dom/ContainerNode.cpp
@@ -77,8 +77,9 @@
 #if !ENABLE(OILPAN)
 void ContainerNode::removeDetachedChildren()
 {
-    ASSERT(!connectedSubframeCount());
-    ASSERT(needsAttach());
+    // TODO(bokan): Temporarily made RELEASE_ASSERT to trackdown crbug.com/519752.
+    RELEASE_ASSERT(!connectedSubframeCount());
+    RELEASE_ASSERT(needsAttach());
     removeDetachedChildrenInContainer(*this);
 }
 #endif
diff --git a/third_party/WebKit/Source/core/dom/Document.cpp b/third_party/WebKit/Source/core/dom/Document.cpp
index 15359a4fb..a6bc05b 100644
--- a/third_party/WebKit/Source/core/dom/Document.cpp
+++ b/third_party/WebKit/Source/core/dom/Document.cpp
@@ -5058,9 +5058,12 @@
 
 HTMLDialogElement* Document::activeModalDialog() const
 {
-    if (m_topLayerElements.isEmpty())
-        return 0;
-    return toHTMLDialogElement(m_topLayerElements.last().get());
+    for (auto it = m_topLayerElements.rbegin(); it != m_topLayerElements.rend(); ++it) {
+        if (isHTMLDialogElement(*it))
+            return toHTMLDialogElement((*it).get());
+    }
+
+    return nullptr;
 }
 
 void Document::exitPointerLock()
@@ -5693,13 +5696,6 @@
     return true;
 }
 
-WebTaskRunner* Document::loadingTaskRunner() const
-{
-    if (frame())
-        return frame()->frameScheduler()->loadingTaskRunner();
-    return Platform::current()->currentThread()->scheduler()->loadingTaskRunner();
-}
-
 DEFINE_TRACE(Document)
 {
 #if ENABLE(OILPAN)
diff --git a/third_party/WebKit/Source/core/dom/Document.h b/third_party/WebKit/Source/core/dom/Document.h
index 8792af4f..9dcaf66 100644
--- a/third_party/WebKit/Source/core/dom/Document.h
+++ b/third_party/WebKit/Source/core/dom/Document.h
@@ -1050,8 +1050,6 @@
     using WeakDocumentSet = WillBeHeapHashSet<RawPtrWillBeWeakMember<Document>>;
     static WeakDocumentSet& liveDocumentSet();
 
-    WebTaskRunner* loadingTaskRunner() const;
-
 protected:
     Document(const DocumentInit&, DocumentClassFlags = DefaultDocumentClass);
 
diff --git a/third_party/WebKit/Source/core/dom/Element.cpp b/third_party/WebKit/Source/core/dom/Element.cpp
index c9ea807b..68af23e 100644
--- a/third_party/WebKit/Source/core/dom/Element.cpp
+++ b/third_party/WebKit/Source/core/dom/Element.cpp
@@ -1920,7 +1920,7 @@
 
 PassRefPtrWillBeRawPtr<ShadowRoot> Element::createShadowRoot(const ScriptState* scriptState, const ShadowRootInit& shadowRootInitDict, ExceptionState& exceptionState)
 {
-    ASSERT(RuntimeEnabledFeatures::createShadowRootWithParameterEnabled());
+    ASSERT(RuntimeEnabledFeatures::shadowDOMV1Enabled());
     UseCounter::count(document(), UseCounter::ElementCreateShadowRootWithParameter);
 
     OriginsUsingFeatures::countMainWorldOnly(scriptState, document(), OriginsUsingFeatures::Feature::ElementCreateShadowRoot);
diff --git a/third_party/WebKit/Source/core/dom/Element.idl b/third_party/WebKit/Source/core/dom/Element.idl
index 2e2bad2..f83577e 100644
--- a/third_party/WebKit/Source/core/dom/Element.idl
+++ b/third_party/WebKit/Source/core/dom/Element.idl
@@ -70,7 +70,7 @@
     // Shadow DOM
     // http://w3c.github.io/webcomponents/spec/shadow/#extensions-to-element-interface
     [RaisesException, CallWith=ScriptState, MeasureAs=ElementCreateShadowRoot] ShadowRoot createShadowRoot();
-    [RuntimeEnabled=CreateShadowRootWithParameter, RaisesException, CallWith=ScriptState, MeasureAs=ElementCreateShadowRoot] ShadowRoot createShadowRoot(ShadowRootInit shadowRootInitDict);
+    [RuntimeEnabled=ShadowDOMV1, RaisesException, CallWith=ScriptState, MeasureAs=ElementCreateShadowRoot] ShadowRoot createShadowRoot(ShadowRootInit shadowRootInitDict);
     NodeList getDestinationInsertionPoints();
     [PerWorldBindings, ImplementedAs=openShadowRoot] readonly attribute ShadowRoot? shadowRoot;
 
diff --git a/third_party/WebKit/Source/core/dom/Fullscreen.cpp b/third_party/WebKit/Source/core/dom/Fullscreen.cpp
index f4ea213..46c01d3 100644
--- a/third_party/WebKit/Source/core/dom/Fullscreen.cpp
+++ b/third_party/WebKit/Source/core/dom/Fullscreen.cpp
@@ -28,6 +28,7 @@
 #include "config.h"
 #include "core/dom/Fullscreen.h"
 
+#include "bindings/core/v8/ExceptionMessages.h"
 #include "core/HTMLNames.h"
 #include "core/dom/Document.h"
 #include "core/dom/ElementTraversal.h"
@@ -41,8 +42,9 @@
 #include "core/html/HTMLMediaElement.h"
 #include "core/input/EventHandler.h"
 #include "core/inspector/ConsoleMessage.h"
-#include "core/layout/LayoutFullScreen.h"
 #include "core/page/ChromeClient.h"
+#include "core/page/Page.h"
+#include "core/style/ComputedStyle.h"
 #include "platform/UserGestureIndicator.h"
 
 namespace blink {
@@ -159,7 +161,6 @@
 
 Fullscreen::Fullscreen(Document& document)
     : DocumentLifecycleObserver(&document)
-    , m_fullScreenLayoutObject(nullptr)
     , m_eventQueueTimer(this, &Fullscreen::eventQueueTimerFired)
 {
     document.setHasFullscreenSupplement();
@@ -178,9 +179,6 @@
 {
     m_eventQueue.clear();
 
-    if (m_fullScreenLayoutObject)
-        m_fullScreenLayoutObject->destroy();
-
 #if ENABLE(OILPAN)
     m_fullScreenElement = nullptr;
     m_fullScreenElementStack.clear();
@@ -425,28 +423,12 @@
 void Fullscreen::didEnterFullScreenForElement(Element* element)
 {
     ASSERT(element);
+    ASSERT(element->isInTopLayer());
+
     if (!document()->isActive())
         return;
 
-    if (m_fullScreenLayoutObject)
-        m_fullScreenLayoutObject->unwrapLayoutObject();
-
     m_fullScreenElement = element;
-
-    // Create a placeholder block for a the full-screen element, to keep the page from reflowing
-    // when the element is removed from the normal flow. Only do this for a LayoutBox, as only
-    // a box will have a frameRect. The placeholder will be created in setFullScreenLayoutObject()
-    // during layout.
-    LayoutObject* layoutObject = m_fullScreenElement->layoutObject();
-    bool shouldCreatePlaceholder = layoutObject && layoutObject->isBox();
-    if (shouldCreatePlaceholder) {
-        m_savedPlaceholderFrameRect = toLayoutBox(layoutObject)->frameRect();
-        m_savedPlaceholderComputedStyle = ComputedStyle::clone(layoutObject->styleRef());
-    }
-
-    if (m_fullScreenElement != document()->documentElement())
-        LayoutFullScreen::wrapLayoutObject(layoutObject, layoutObject ? layoutObject->parent() : 0, document());
-
     m_fullScreenElement->setContainsFullScreenElementOnAncestorsCrossingFrameBoundaries(true);
 
     // FIXME: This should not call updateStyleIfNeeded.
@@ -469,13 +451,11 @@
     if (!document()->isActive())
         return;
 
+    document()->removeFromTopLayer(m_fullScreenElement.get());
     m_fullScreenElement->willStopBeingFullscreenElement();
 
     m_fullScreenElement->setContainsFullScreenElementOnAncestorsCrossingFrameBoundaries(false);
 
-    if (m_fullScreenLayoutObject)
-        m_fullScreenLayoutObject->unwrapLayoutObject();
-
     m_fullScreenElement = nullptr;
     document()->setNeedsStyleRecalc(SubtreeStyleChange, StyleChangeReasonForTracing::create(StyleChangeReason::FullScreen));
 
@@ -492,28 +472,12 @@
     from(*exitingDocument).m_eventQueueTimer.startOneShot(0, FROM_HERE);
 }
 
-void Fullscreen::setFullScreenLayoutObject(LayoutFullScreen* layoutObject)
+void Fullscreen::didUpdateSize(Element& element)
 {
-    if (layoutObject == m_fullScreenLayoutObject)
-        return;
-
-    if (layoutObject && m_savedPlaceholderComputedStyle) {
-        layoutObject->createPlaceholder(m_savedPlaceholderComputedStyle.release(), m_savedPlaceholderFrameRect);
-    } else if (layoutObject && m_fullScreenLayoutObject && m_fullScreenLayoutObject->placeholder()) {
-        LayoutBlock* placeholder = m_fullScreenLayoutObject->placeholder();
-        layoutObject->createPlaceholder(ComputedStyle::clone(placeholder->styleRef()), placeholder->frameRect());
-    }
-
-    if (m_fullScreenLayoutObject)
-        m_fullScreenLayoutObject->unwrapLayoutObject();
-    ASSERT(!m_fullScreenLayoutObject);
-
-    m_fullScreenLayoutObject = layoutObject;
-}
-
-void Fullscreen::fullScreenLayoutObjectDestroyed()
-{
-    m_fullScreenLayoutObject = nullptr;
+    // StyleAdjuster will set the size so we need to do a style recalc.
+    // Normally changing size means layout so just doing a style recalc is a
+    // bit surprising.
+    element.setNeedsStyleRecalc(LocalStyleChange, StyleChangeReasonForTracing::create(StyleChangeReason::FullScreen));
 }
 
 void Fullscreen::enqueueChangeEvent(Document& document, RequestType requestType)
@@ -602,12 +566,14 @@
     if (m_fullScreenElementStack.isEmpty())
         return;
 
+    document()->removeFromTopLayer(m_fullScreenElementStack.last().first.get());
     m_fullScreenElementStack.removeLast();
 }
 
 void Fullscreen::pushFullscreenElementStack(Element& element, RequestType requestType)
 {
     m_fullScreenElementStack.append(std::make_pair(&element, requestType));
+    document()->addToTopLayer(&element);
 }
 
 DEFINE_TRACE(Fullscreen)
diff --git a/third_party/WebKit/Source/core/dom/Fullscreen.h b/third_party/WebKit/Source/core/dom/Fullscreen.h
index 8e8a863..1f49774 100644
--- a/third_party/WebKit/Source/core/dom/Fullscreen.h
+++ b/third_party/WebKit/Source/core/dom/Fullscreen.h
@@ -41,7 +41,6 @@
 
 namespace blink {
 
-class LayoutFullScreen;
 class ComputedStyle;
 
 class CORE_EXPORT Fullscreen final
@@ -78,9 +77,7 @@
     void didEnterFullScreenForElement(Element*);
     void didExitFullScreenForElement(Element*);
 
-    void setFullScreenLayoutObject(LayoutFullScreen*);
-    LayoutFullScreen* fullScreenLayoutObject() const { return m_fullScreenLayoutObject; }
-    void fullScreenLayoutObjectDestroyed();
+    void didUpdateSize(Element&);
 
     void elementRemoved(Element&);
 
@@ -94,6 +91,9 @@
 
     DECLARE_VIRTUAL_TRACE();
 
+    using ElementStack = WillBeHeapVector<std::pair<RefPtrWillBeMember<Element>, RequestType>>;
+    const ElementStack& fullScreenElementStack() const { return m_fullScreenElementStack; }
+
 private:
     static Fullscreen* fromIfExistsSlow(Document&);
 
@@ -110,8 +110,7 @@
     void eventQueueTimerFired(Timer<Fullscreen>*);
 
     RefPtrWillBeMember<Element> m_fullScreenElement;
-    WillBeHeapVector<std::pair<RefPtrWillBeMember<Element>, RequestType>> m_fullScreenElementStack;
-    LayoutFullScreen* m_fullScreenLayoutObject;
+    ElementStack m_fullScreenElementStack;
     Timer<Fullscreen> m_eventQueueTimer;
     WillBeHeapDeque<RefPtrWillBeMember<Event>> m_eventQueue;
     LayoutRect m_savedPlaceholderFrameRect;
diff --git a/third_party/WebKit/Source/core/dom/LayoutTreeBuilder.cpp b/third_party/WebKit/Source/core/dom/LayoutTreeBuilder.cpp
index bbd8b190..09ebf6d 100644
--- a/third_party/WebKit/Source/core/dom/LayoutTreeBuilder.cpp
+++ b/third_party/WebKit/Source/core/dom/LayoutTreeBuilder.cpp
@@ -35,7 +35,6 @@
 #include "core/dom/PseudoElement.h"
 #include "core/dom/Text.h"
 #include "core/dom/shadow/InsertionPoint.h"
-#include "core/layout/LayoutFullScreen.h"
 #include "core/layout/LayoutObject.h"
 #include "core/layout/LayoutText.h"
 #include "core/layout/LayoutView.h"
@@ -136,12 +135,6 @@
     m_node->setLayoutObject(newLayoutObject);
     newLayoutObject->setStyle(&style); // setStyle() can depend on layoutObject() already being set.
 
-    if (Fullscreen::isActiveFullScreenElement(*m_node)) {
-        newLayoutObject = LayoutFullScreen::wrapLayoutObject(newLayoutObject, parentLayoutObject, &m_node->document());
-        if (!newLayoutObject)
-            return;
-    }
-
     // Note: Adding newLayoutObject instead of layoutObject(). layoutObject() may be a child of newLayoutObject.
     parentLayoutObject->addChild(newLayoutObject, nextLayoutObject);
 }
diff --git a/third_party/WebKit/Source/core/dom/ScriptLoader.cpp b/third_party/WebKit/Source/core/dom/ScriptLoader.cpp
index 0477cd8..a379ffe4 100644
--- a/third_party/WebKit/Source/core/dom/ScriptLoader.cpp
+++ b/third_party/WebKit/Source/core/dom/ScriptLoader.cpp
@@ -50,7 +50,6 @@
 #include "core/svg/SVGScriptElement.h"
 #include "platform/MIMETypeRegistry.h"
 #include "platform/weborigin/SecurityOrigin.h"
-#include "public/platform/WebFrameScheduler.h"
 #include "wtf/StdLibExtras.h"
 #include "wtf/text/StringBuilder.h"
 #include "wtf/text/StringHash.h"
@@ -260,7 +259,7 @@
         if (frame) {
             ScriptState* scriptState = ScriptState::forMainWorld(frame);
             if (scriptState->contextIsValid())
-                ScriptStreamer::startStreaming(m_pendingScript, PendingScript::Async, frame->settings(), scriptState, frame->frameScheduler()->loadingTaskRunner());
+                ScriptStreamer::startStreaming(m_pendingScript, PendingScript::Async, frame->settings(), scriptState);
         }
         contextDocument->scriptRunner()->queueScriptForExecution(this, ScriptRunner::ASYNC_EXECUTION);
         // Note that watchForLoad can immediately call notifyFinished.
diff --git a/third_party/WebKit/Source/core/dom/ScriptRunnerTest.cpp b/third_party/WebKit/Source/core/dom/ScriptRunnerTest.cpp
index 18683001..6db3012 100644
--- a/third_party/WebKit/Source/core/dom/ScriptRunnerTest.cpp
+++ b/third_party/WebKit/Source/core/dom/ScriptRunnerTest.cpp
@@ -72,7 +72,7 @@
     explicit MockWebTaskRunner(Deque<OwnPtr<WebTaskRunner::Task>>* tasks) : m_tasks(tasks) { }
     ~MockWebTaskRunner() override { }
 
-    void postTask(const WebTraceLocation&, Task* task) override
+    virtual void postTask(const WebTraceLocation&, Task* task)
     {
         m_tasks->append(adoptPtr(task));
     }
@@ -82,12 +82,6 @@
         ASSERT_NOT_REACHED();
     }
 
-    WebTaskRunner* clone() override
-    {
-        ASSERT_NOT_REACHED();
-        return nullptr;
-    }
-
     Deque<OwnPtr<WebTaskRunner::Task>>* m_tasks; // NOT OWNED
 };
 
diff --git a/third_party/WebKit/Source/core/dom/shadow/InsertionPoint.cpp b/third_party/WebKit/Source/core/dom/shadow/InsertionPoint.cpp
index f02bbba1..eba7d6e 100644
--- a/third_party/WebKit/Source/core/dom/shadow/InsertionPoint.cpp
+++ b/third_party/WebKit/Source/core/dom/shadow/InsertionPoint.cpp
@@ -214,6 +214,10 @@
         }
     }
 
+    // We could have been distributed into in a detached subtree, make sure to
+    // clear the distribution when inserted again to avoid cycles.
+    clearDistribution();
+
     return InsertionDone;
 }
 
diff --git a/third_party/WebKit/Source/core/editing/InputMethodControllerTest.cpp b/third_party/WebKit/Source/core/editing/InputMethodControllerTest.cpp
index 0522bb3..81f38e2c 100644
--- a/third_party/WebKit/Source/core/editing/InputMethodControllerTest.cpp
+++ b/third_party/WebKit/Source/core/editing/InputMethodControllerTest.cpp
@@ -121,6 +121,32 @@
     EXPECT_EQ(0, frame().selection().end().computeOffsetInContainerNode());
 }
 
+TEST_F(InputMethodControllerTest, DeleteBySettingEmptyComposition)
+{
+    HTMLInputElement* input = toHTMLInputElement(
+        insertHTMLElement("<input id='sample'>", "sample"));
+
+    input->setValue("foo ");
+    controller().setEditableSelectionOffsets(PlainTextRange(4, 4));
+    EXPECT_STREQ("foo ", input->value().utf8().data());
+    controller().extendSelectionAndDelete(0, 0);
+    EXPECT_STREQ("foo ", input->value().utf8().data());
+
+    input->setValue("foo ");
+    controller().setEditableSelectionOffsets(PlainTextRange(4, 4));
+    EXPECT_STREQ("foo ", input->value().utf8().data());
+    controller().extendSelectionAndDelete(1, 0);
+    EXPECT_STREQ("foo", input->value().utf8().data());
+
+    Vector<CompositionUnderline> underlines;
+    underlines.append(CompositionUnderline(0, 3, Color(255, 0, 0), false, 0));
+    controller().setCompositionFromExistingText(underlines, 0, 3);
+
+    controller().setComposition(String(""), underlines, 0, 3);
+
+    EXPECT_STREQ("", input->value().utf8().data());
+}
+
 TEST_F(InputMethodControllerTest, SetCompositionFromExistingTextWithCollapsedWhiteSpace)
 {
     // Creates a div with one leading new line char. The new line char is hidden
diff --git a/third_party/WebKit/Source/core/editing/commands/TypingCommand.cpp b/third_party/WebKit/Source/core/editing/commands/TypingCommand.cpp
index 8689541..0808cfb 100644
--- a/third_party/WebKit/Source/core/editing/commands/TypingCommand.cpp
+++ b/third_party/WebKit/Source/core/editing/commands/TypingCommand.cpp
@@ -101,6 +101,8 @@
         return;
 
     if (RefPtrWillBeRawPtr<TypingCommand> lastTypingCommand = lastTypingCommandIfStillOpenForTyping(frame)) {
+        updateSelectionIfDifferentFromCurrentSelection(lastTypingCommand.get(), frame);
+
         lastTypingCommand->setShouldPreventSpellChecking(options & PreventSpellChecking);
         lastTypingCommand->deleteSelection(options & SmartDelete);
         return;
diff --git a/third_party/WebKit/Source/core/fetch/FetchContext.h b/third_party/WebKit/Source/core/fetch/FetchContext.h
index 22869f1..054b465 100644
--- a/third_party/WebKit/Source/core/fetch/FetchContext.h
+++ b/third_party/WebKit/Source/core/fetch/FetchContext.h
@@ -48,7 +48,6 @@
 class ResourceResponse;
 class ResourceRequest;
 class ResourceTimingInfo;
-class WebTaskRunner;
 
 enum FetchResourceType {
     FetchMainResource,
@@ -107,8 +106,6 @@
 
     virtual ResourceLoadPriority modifyPriorityForExperiments(ResourceLoadPriority priority, Resource::Type, const FetchRequest&, ResourcePriority::VisibilityStatus) { return priority; }
 
-    virtual WebTaskRunner* loadingTaskRunner() const { return nullptr; }
-
 protected:
     FetchContext() { }
 };
diff --git a/third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp b/third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp
index 09a6763..d901976 100644
--- a/third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp
+++ b/third_party/WebKit/Source/core/fetch/ResourceFetcher.cpp
@@ -189,14 +189,6 @@
 #endif
 }
 
-WebTaskRunner* ResourceFetcher::loadingTaskRunner()
-{
-    if (!m_context)
-        return nullptr;
-
-    return m_context->loadingTaskRunner();
-}
-
 Resource* ResourceFetcher::cachedResource(const KURL& resourceURL) const
 {
     KURL url = MemoryCache::removeFragmentIdentifierIfNeeded(resourceURL);
diff --git a/third_party/WebKit/Source/core/fetch/ResourceFetcher.h b/third_party/WebKit/Source/core/fetch/ResourceFetcher.h
index d082cf7..066cb6b 100644
--- a/third_party/WebKit/Source/core/fetch/ResourceFetcher.h
+++ b/third_party/WebKit/Source/core/fetch/ResourceFetcher.h
@@ -146,8 +146,6 @@
     bool clientDefersImage(const KURL&) const;
     void determineRequestContext(ResourceRequest&, Resource::Type);
 
-    WebTaskRunner* loadingTaskRunner();
-
     void updateAllImageResourcePriorities();
 
 private:
diff --git a/third_party/WebKit/Source/core/fetch/ResourceLoader.cpp b/third_party/WebKit/Source/core/fetch/ResourceLoader.cpp
index fdb7702..b8dbb1d 100644
--- a/third_party/WebKit/Source/core/fetch/ResourceLoader.cpp
+++ b/third_party/WebKit/Source/core/fetch/ResourceLoader.cpp
@@ -142,7 +142,6 @@
 
     m_loader = adoptPtr(Platform::current()->createURLLoader());
     ASSERT(m_loader);
-    m_loader->setLoadingTaskRunner(m_fetcher->loadingTaskRunner());
     WrappedResourceRequest wrappedRequest(m_request);
     m_loader->loadAsynchronously(wrappedRequest, this);
 }
diff --git a/third_party/WebKit/Source/core/frame/FrameView.cpp b/third_party/WebKit/Source/core/frame/FrameView.cpp
index f435801..4ebef6f 100644
--- a/third_party/WebKit/Source/core/frame/FrameView.cpp
+++ b/third_party/WebKit/Source/core/frame/FrameView.cpp
@@ -92,7 +92,7 @@
 #include "platform/graphics/GraphicsContext.h"
 #include "platform/graphics/GraphicsLayer.h"
 #include "platform/graphics/GraphicsLayerDebugInfo.h"
-#include "platform/graphics/paint/DisplayItemList.h"
+#include "platform/graphics/paint/PaintController.h"
 #include "platform/scroll/ScrollAnimator.h"
 #include "platform/text/TextStream.h"
 #include "public/platform/WebDisplayItemList.h"
@@ -2478,7 +2478,7 @@
 
 void FrameView::synchronizedPaintRecursively(GraphicsLayer* graphicsLayer, const LayoutRect* interestRect)
 {
-    GraphicsContext context(graphicsLayer->displayItemList());
+    GraphicsContext context(graphicsLayer->paintController());
 
     // TODO(chrishtr): fix unit tests to not inject one-off interest rects.
     if (interestRect) {
@@ -2515,7 +2515,7 @@
 
     rootGraphicsLayer->commitIfNeeded();
 
-    DisplayListCompositingBuilder compositingBuilder(*rootGraphicsLayer->displayItemList());
+    DisplayListCompositingBuilder compositingBuilder(*rootGraphicsLayer->paintController());
     OwnPtr<CompositedDisplayList> compositedDisplayList = adoptPtr(new CompositedDisplayList());
     compositingBuilder.build(*compositedDisplayList);
     page()->setCompositedDisplayList(compositedDisplayList.release());
diff --git a/third_party/WebKit/Source/core/frame/FrameView.h b/third_party/WebKit/Source/core/frame/FrameView.h
index 55aad9a7..ac44e9d8 100644
--- a/third_party/WebKit/Source/core/frame/FrameView.h
+++ b/third_party/WebKit/Source/core/frame/FrameView.h
@@ -79,7 +79,7 @@
 class CORE_EXPORT FrameView final : public Widget, public ScrollableArea {
     WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(FrameView);
 
-    friend class DisplayItemListPaintTestForSlimmingPaintV2;
+    friend class PaintControllerPaintTestForSlimmingPaintV2;
     friend class Internals;
     friend class LayoutPart; // for invalidateTreeIfNeeded
 
diff --git a/third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp b/third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp
index 8532109..4a03c84 100644
--- a/third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp
+++ b/third_party/WebKit/Source/core/frame/LocalDOMWindow.cpp
@@ -285,9 +285,10 @@
 LocalDOMWindow::LocalDOMWindow(LocalFrame& frame)
     : m_frameObserver(WindowFrameObserver::create(this, frame))
     , m_shouldPrintWhenFinishedLoading(false)
-#if ENABLE(ASSERT)
+// TODO(bokan): Temporarily enabled in release to trackdown crbug.com/519752.
+// #if ENABLE(ASSERT)
     , m_hasBeenReset(false)
-#endif
+// #endif
 {
 #if ENABLE(OILPAN)
     ThreadState::current()->registerPreFinalizer(this);
@@ -299,7 +300,8 @@
     if (!m_document)
         return;
 
-    ASSERT(!m_document->isActive());
+    // TODO(bokan): Temporarily made RELEASE_ASSERT to trackdown crbug.com/519752.
+    RELEASE_ASSERT(!m_document->isActive());
 
     // FIXME: This should be part of ActiveDOMObject shutdown
     clearEventQueue();
@@ -341,7 +343,9 @@
 
 PassRefPtrWillBeRawPtr<Document> LocalDOMWindow::installNewDocument(const String& mimeType, const DocumentInit& init, bool forceXHTML)
 {
-    ASSERT(init.frame() == frame());
+
+    // TODO(bokan): Temporarily made RELEASE_ASSERT to trackdown crbug.com/519752.
+    RELEASE_ASSERT(init.frame() == frame());
 
     clearDocument();
 
@@ -349,8 +353,8 @@
     m_eventQueue = DOMWindowEventQueue::create(m_document.get());
     m_document->attach();
 
-    if (!frame())
-        return m_document;
+    // TODO(bokan): Temporarily made RELEASE_ASSERT to trackdown crbug.com/519752.
+    RELEASE_ASSERT(frame());
 
     frame()->script().updateDocument();
     m_document->updateViewportDescription();
@@ -440,8 +444,9 @@
     // Cleared when detaching document.
     ASSERT(!m_eventQueue);
 #else
-    ASSERT(m_hasBeenReset);
-    ASSERT(m_document->isStopped());
+    // TODO(bokan): Temporarily enabled in release to trackdown crbug.com/519752.
+    RELEASE_ASSERT(m_hasBeenReset);
+    RELEASE_ASSERT(m_document->isStopped());
     clearDocument();
 #endif
 }
@@ -537,9 +542,10 @@
     m_navigator = nullptr;
     m_media = nullptr;
     m_applicationCache = nullptr;
-#if ENABLE(ASSERT)
+// TODO(bokan): Temporarily enabled in release to trackdown crbug.com/519752.
+// #if ENABLE(ASSERT)
     m_hasBeenReset = true;
-#endif
+// #endif
 
     LocalDOMWindow::notifyContextDestroyed();
 }
@@ -1524,7 +1530,7 @@
     // back to this LocalDOMWindow: otherwise, it's easy to get into a situation
     // where script execution leaks between different LocalDOMWindows.
     if (m_frameObserver->frame())
-        ASSERT_WITH_SECURITY_IMPLICATION(m_frameObserver->frame()->domWindow() == this);
+        RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(m_frameObserver->frame()->domWindow() == this);
     return m_frameObserver->frame();
 }
 
diff --git a/third_party/WebKit/Source/core/frame/LocalDOMWindow.h b/third_party/WebKit/Source/core/frame/LocalDOMWindow.h
index 279ee89..a8a16af 100644
--- a/third_party/WebKit/Source/core/frame/LocalDOMWindow.h
+++ b/third_party/WebKit/Source/core/frame/LocalDOMWindow.h
@@ -249,9 +249,11 @@
     RefPtrWillBeMember<Document> m_document;
 
     bool m_shouldPrintWhenFinishedLoading;
-#if ENABLE(ASSERT)
+
+// TODO(bokan): Temporarily enabled in release to trackdown crbug.com/519752.
+// #if ENABLE(ASSERT)
     bool m_hasBeenReset;
-#endif
+// #endif
 
     WillBeHeapHashSet<RawPtrWillBeWeakMember<DOMWindowProperty>> m_properties;
 
diff --git a/third_party/WebKit/Source/core/frame/UseCounter.h b/third_party/WebKit/Source/core/frame/UseCounter.h
index 23201c6..ccaf404 100644
--- a/third_party/WebKit/Source/core/frame/UseCounter.h
+++ b/third_party/WebKit/Source/core/frame/UseCounter.h
@@ -813,6 +813,8 @@
         CSSAnimationsStackedNeutralKeyframe = 937,
         ReadingCheckedInClickHandler = 938,
         FlexboxIntrinsicSizeAlgorithmIsDifferent = 939,
+        // The above items are available in M46 branch.
+
         HTMLImportsHasStyleSheets = 940,
         WebkitTextInClipProperty = 941,
         WebkitTextInColorProperty = 942,
@@ -838,9 +840,9 @@
         CredentialManagerGetWithoutUI = 962,
         CredentialManagerStore = 963,
         CredentialManagerRequireUserMediation = 964,
+        // The above items are available in M47 branch.
+
         RequestAutocomplete = 965,
-        CastOverlayClicked = 966,
-        CastOverlayShown = 967,
 
         // Add new features immediately above this line. Don't change assigned
         // numbers of any item, and don't reuse removed slots.
diff --git a/third_party/WebKit/Source/core/html/HTMLFrameOwnerElement.cpp b/third_party/WebKit/Source/core/html/HTMLFrameOwnerElement.cpp
index c5e86452..dbbf1961 100644
--- a/third_party/WebKit/Source/core/html/HTMLFrameOwnerElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLFrameOwnerElement.cpp
@@ -109,6 +109,11 @@
     , m_contentFrame(nullptr)
     , m_widget(nullptr)
     , m_sandboxFlags(SandboxNone)
+    , m_wasDisconnected(false)
+    , m_wasWidgetAttached(false)
+    , m_wasWidgetDetached(false)
+    , m_domWindow(nullptr)
+    , m_document(nullptr)
 {
 }
 
@@ -129,6 +134,11 @@
     ASSERT(inDocument());
     m_contentFrame = &frame;
 
+    if (m_contentFrame->isLocalFrame()) {
+        m_domWindow = toLocalFrame(m_contentFrame)->localDOMWindow();
+        m_document = toLocalFrame(m_contentFrame)->localDOMWindow()->document();
+    }
+
     for (ContainerNode* node = this; node; node = node->parentOrShadowHostNode())
         node->incrementConnectedSubframeCount();
 }
@@ -146,6 +156,7 @@
 
 void HTMLFrameOwnerElement::disconnectContentFrame()
 {
+    m_wasDisconnected = true;
     // FIXME: Currently we don't do this in removedFrom because this causes an
     // unload event in the subframe which could execute script that could then
     // reach up into this document and then attempt to look back down. We should
@@ -167,9 +178,12 @@
 
 HTMLFrameOwnerElement::~HTMLFrameOwnerElement()
 {
+#if !ENABLE(OILPAN)
     // An owner must by now have been informed of detachment
     // when the frame was closed.
-    ASSERT(!m_contentFrame);
+    // TODO(bokan): Temporarily made RELEASE_ASSERT to trackdown crbug.com/519752.
+    RELEASE_ASSERT(!m_contentFrame);
+#endif
 }
 
 Document* HTMLFrameOwnerElement::contentDocument() const
@@ -220,6 +234,11 @@
         m_widget = nullptr;
     }
 
+    if (widget)
+        m_wasWidgetAttached = true;
+    else
+        m_wasWidgetDetached = true;
+
     m_widget = widget;
 
     LayoutPart* layoutPart = toLayoutPart(layoutObject());
diff --git a/third_party/WebKit/Source/core/html/HTMLFrameOwnerElement.h b/third_party/WebKit/Source/core/html/HTMLFrameOwnerElement.h
index f0236a6..aebb1dd 100644
--- a/third_party/WebKit/Source/core/html/HTMLFrameOwnerElement.h
+++ b/third_party/WebKit/Source/core/html/HTMLFrameOwnerElement.h
@@ -100,6 +100,13 @@
     RawPtrWillBeMember<Frame> m_contentFrame;
     RefPtrWillBeMember<Widget> m_widget;
     SandboxFlags m_sandboxFlags;
+
+    // TODO(bokan): Temporarily added to help debug crbug.com/519752.
+    volatile bool m_wasDisconnected;
+    volatile bool m_wasWidgetAttached;
+    volatile bool m_wasWidgetDetached;
+    volatile LocalDOMWindow* m_domWindow;
+    volatile Document* m_document;
 };
 
 DEFINE_ELEMENT_TYPE_CASTS(HTMLFrameOwnerElement, isFrameOwnerElement());
diff --git a/third_party/WebKit/Source/core/html/parser/BackgroundHTMLParser.cpp b/third_party/WebKit/Source/core/html/parser/BackgroundHTMLParser.cpp
index 51b92074..3589b67 100644
--- a/third_party/WebKit/Source/core/html/parser/BackgroundHTMLParser.cpp
+++ b/third_party/WebKit/Source/core/html/parser/BackgroundHTMLParser.cpp
@@ -33,7 +33,7 @@
 #include "platform/Task.h"
 #include "platform/ThreadSafeFunctional.h"
 #include "public/platform/Platform.h"
-#include "public/platform/WebTaskRunner.h"
+#include "public/platform/WebScheduler.h"
 #include "wtf/text/TextPosition.h"
 
 namespace blink {
@@ -81,9 +81,9 @@
 
 #endif
 
-void BackgroundHTMLParser::start(PassRefPtr<WeakReference<BackgroundHTMLParser>> reference, PassOwnPtr<Configuration> config, PassOwnPtr<WebTaskRunner> loadingTaskRunner)
+void BackgroundHTMLParser::start(PassRefPtr<WeakReference<BackgroundHTMLParser>> reference, PassOwnPtr<Configuration> config, WebScheduler* scheduler)
 {
-    new BackgroundHTMLParser(reference, config, loadingTaskRunner);
+    new BackgroundHTMLParser(reference, config, scheduler);
     // Caller must free by calling stop().
 }
 
@@ -93,7 +93,7 @@
 {
 }
 
-BackgroundHTMLParser::BackgroundHTMLParser(PassRefPtr<WeakReference<BackgroundHTMLParser>> reference, PassOwnPtr<Configuration> config, PassOwnPtr<WebTaskRunner> loadingTaskRunner)
+BackgroundHTMLParser::BackgroundHTMLParser(PassRefPtr<WeakReference<BackgroundHTMLParser>> reference, PassOwnPtr<Configuration> config, WebScheduler* scheduler)
     : m_weakFactory(reference, this)
     , m_token(adoptPtr(new HTMLToken))
     , m_tokenizer(HTMLTokenizer::create(config->options))
@@ -106,7 +106,7 @@
     , m_xssAuditor(config->xssAuditor.release())
     , m_preloadScanner(config->preloadScanner.release())
     , m_decoder(config->decoder.release())
-    , m_loadingTaskRunner(loadingTaskRunner)
+    , m_scheduler(scheduler)
     , m_startingScript(false)
 {
     ASSERT(m_outstandingTokenLimit > 0);
@@ -157,7 +157,7 @@
         m_lastSeenEncodingData = encodingData;
 
         m_xssAuditor->setEncoding(encodingData.encoding());
-        m_loadingTaskRunner->postTask(
+        m_scheduler->loadingTaskRunner()->postTask(
             FROM_HERE,
             threadSafeBind(&HTMLDocumentParser::didReceiveEncodingDataFromBackgroundParser, AllowCrossThreadAccess(m_parser), encodingData));
     }
@@ -291,7 +291,7 @@
     chunk->startingScript = m_startingScript;
     m_startingScript = false;
 
-    m_loadingTaskRunner->postTask(
+    m_scheduler->loadingTaskRunner()->postTask(
         FROM_HERE,
         new Task(threadSafeBind(&HTMLDocumentParser::didReceiveParsedChunkFromBackgroundParser, AllowCrossThreadAccess(m_parser), chunk.release())));
 
diff --git a/third_party/WebKit/Source/core/html/parser/BackgroundHTMLParser.h b/third_party/WebKit/Source/core/html/parser/BackgroundHTMLParser.h
index d3f7c8e3..6922c310 100644
--- a/third_party/WebKit/Source/core/html/parser/BackgroundHTMLParser.h
+++ b/third_party/WebKit/Source/core/html/parser/BackgroundHTMLParser.h
@@ -42,7 +42,7 @@
 
 class HTMLDocumentParser;
 class XSSAuditor;
-class WebTaskRunner;
+class WebScheduler;
 
 class BackgroundHTMLParser {
     WTF_MAKE_FAST_ALLOCATED(BackgroundHTMLParser);
@@ -63,7 +63,7 @@
         size_t pendingTokenLimit;
     };
 
-    static void start(PassRefPtr<WeakReference<BackgroundHTMLParser>>, PassOwnPtr<Configuration>, PassOwnPtr<WebTaskRunner>);
+    static void start(PassRefPtr<WeakReference<BackgroundHTMLParser>>, PassOwnPtr<Configuration>, WebScheduler*);
 
     struct Checkpoint {
         WTF_MAKE_FAST_ALLOCATED(CheckPoint);
@@ -90,7 +90,7 @@
     void forcePlaintextForTextDocument();
 
 private:
-    BackgroundHTMLParser(PassRefPtr<WeakReference<BackgroundHTMLParser>>, PassOwnPtr<Configuration>, PassOwnPtr<WebTaskRunner>);
+    BackgroundHTMLParser(PassRefPtr<WeakReference<BackgroundHTMLParser>>, PassOwnPtr<Configuration>, WebScheduler*);
     ~BackgroundHTMLParser();
 
     void appendDecodedBytes(const String&);
@@ -118,7 +118,7 @@
     OwnPtr<TokenPreloadScanner> m_preloadScanner;
     OwnPtr<TextResourceDecoder> m_decoder;
     DocumentEncodingData m_lastSeenEncodingData;
-    OwnPtr<WebTaskRunner> m_loadingTaskRunner;
+    WebScheduler* m_scheduler; // NOT OWNED, scheduler will outlive BackgroundHTMLParser
 
     bool m_startingScript;
 };
diff --git a/third_party/WebKit/Source/core/html/parser/HTMLDocumentParser.cpp b/third_party/WebKit/Source/core/html/parser/HTMLDocumentParser.cpp
index 80f5c23..070fd43 100644
--- a/third_party/WebKit/Source/core/html/parser/HTMLDocumentParser.cpp
+++ b/third_party/WebKit/Source/core/html/parser/HTMLDocumentParser.cpp
@@ -50,7 +50,6 @@
 #include "platform/TraceEvent.h"
 #include "platform/heap/Handle.h"
 #include "public/platform/Platform.h"
-#include "public/platform/WebFrameScheduler.h"
 #include "public/platform/WebScheduler.h"
 #include "public/platform/WebThread.h"
 #include "wtf/RefCounted.h"
@@ -144,8 +143,7 @@
     , m_tokenizer(syncPolicy == ForceSynchronousParsing ? HTMLTokenizer::create(m_options) : nullptr)
     , m_scriptRunner(HTMLScriptRunner::create(&document, this))
     , m_treeBuilder(HTMLTreeBuilder::create(this, &document, parserContentPolicy(), reportErrors, m_options))
-    , m_loadingTaskRunner(adoptPtr(document.loadingTaskRunner()->clone()))
-    , m_parserScheduler(HTMLParserScheduler::create(this, m_loadingTaskRunner.get()))
+    , m_parserScheduler(HTMLParserScheduler::create(this))
     , m_xssAuditorDelegate(&document)
     , m_weakFactory(this)
     , m_preloader(HTMLResourcePreloader::create(document))
@@ -168,7 +166,6 @@
     , m_token(adoptPtr(new HTMLToken))
     , m_tokenizer(HTMLTokenizer::create(m_options))
     , m_treeBuilder(HTMLTreeBuilder::create(this, fragment, contextElement, this->parserContentPolicy(), m_options))
-    , m_loadingTaskRunner(adoptPtr(fragment->document().loadingTaskRunner()->clone()))
     , m_xssAuditorDelegate(&fragment->document())
     , m_weakFactory(this)
     , m_shouldUseThreading(false)
@@ -804,7 +801,7 @@
     ASSERT(config->xssAuditor->isSafeToSendToAnotherThread());
     ASSERT(config->preloadScanner->isSafeToSendToAnotherThread());
     HTMLParserThread::shared()->postTask(threadSafeBind(&BackgroundHTMLParser::start, reference.release(), config.release(),
-        adoptPtr(m_loadingTaskRunner->clone())));
+        AllowCrossThreadAccess(Platform::current()->currentThread()->scheduler())));
 }
 
 void HTMLDocumentParser::stopBackgroundParser()
diff --git a/third_party/WebKit/Source/core/html/parser/HTMLDocumentParser.h b/third_party/WebKit/Source/core/html/parser/HTMLDocumentParser.h
index f41d9b03..8fba554 100644
--- a/third_party/WebKit/Source/core/html/parser/HTMLDocumentParser.h
+++ b/third_party/WebKit/Source/core/html/parser/HTMLDocumentParser.h
@@ -187,7 +187,6 @@
     OwnPtrWillBeMember<HTMLTreeBuilder> m_treeBuilder;
     OwnPtr<HTMLPreloadScanner> m_preloadScanner;
     OwnPtr<HTMLPreloadScanner> m_insertionPreloadScanner;
-    OwnPtr<WebTaskRunner> m_loadingTaskRunner;
     OwnPtr<HTMLParserScheduler> m_parserScheduler;
     HTMLSourceTracker m_sourceTracker;
     TextPosition m_textPosition;
diff --git a/third_party/WebKit/Source/core/html/parser/HTMLParserScheduler.cpp b/third_party/WebKit/Source/core/html/parser/HTMLParserScheduler.cpp
index 58a3ded9..c15e43b5 100644
--- a/third_party/WebKit/Source/core/html/parser/HTMLParserScheduler.cpp
+++ b/third_party/WebKit/Source/core/html/parser/HTMLParserScheduler.cpp
@@ -82,9 +82,9 @@
     m_processedElementTokens += count;
 }
 
-HTMLParserScheduler::HTMLParserScheduler(HTMLDocumentParser* parser, WebTaskRunner* loadingTaskRunner)
+HTMLParserScheduler::HTMLParserScheduler(HTMLDocumentParser* parser)
     : m_parser(parser)
-    , m_loadingTaskRunner(adoptPtr(loadingTaskRunner->clone()))
+    , m_loadingTaskRunner(Platform::current()->currentThread()->scheduler()->loadingTaskRunner())
     , m_cancellableContinueParse(CancellableTaskFactory::create(this, &HTMLParserScheduler::continueParsing))
     , m_isSuspendedWithActiveTimer(false)
 {
diff --git a/third_party/WebKit/Source/core/html/parser/HTMLParserScheduler.h b/third_party/WebKit/Source/core/html/parser/HTMLParserScheduler.h
index ad3ccaa..d7878dbc 100644
--- a/third_party/WebKit/Source/core/html/parser/HTMLParserScheduler.h
+++ b/third_party/WebKit/Source/core/html/parser/HTMLParserScheduler.h
@@ -36,7 +36,6 @@
 
 class Document;
 class HTMLDocumentParser;
-class WebTaskRunner;
 
 class ActiveParserSession : public NestingLevelIncrementer {
     STACK_ALLOCATED();
@@ -73,9 +72,9 @@
 class HTMLParserScheduler {
     WTF_MAKE_NONCOPYABLE(HTMLParserScheduler); WTF_MAKE_FAST_ALLOCATED(HTMLParserScheduler);
 public:
-    static PassOwnPtr<HTMLParserScheduler> create(HTMLDocumentParser* parser, WebTaskRunner* loadingTaskRunner)
+    static PassOwnPtr<HTMLParserScheduler> create(HTMLDocumentParser* parser)
     {
-        return adoptPtr(new HTMLParserScheduler(parser, loadingTaskRunner));
+        return adoptPtr(new HTMLParserScheduler(parser));
     }
     ~HTMLParserScheduler();
 
@@ -99,13 +98,13 @@
     void detach(); // Clear active tasks if any.
 
 private:
-    HTMLParserScheduler(HTMLDocumentParser*, WebTaskRunner*);
+    explicit HTMLParserScheduler(HTMLDocumentParser*);
 
     bool shouldYield(const SpeculationsPumpSession&, bool startingScript) const;
     void continueParsing();
 
     HTMLDocumentParser* m_parser;
-    OwnPtr<WebTaskRunner> m_loadingTaskRunner;
+    WebTaskRunner* m_loadingTaskRunner; // NOT OWNED
 
     OwnPtr<CancellableTaskFactory> m_cancellableContinueParse;
     bool m_isSuspendedWithActiveTimer;
diff --git a/third_party/WebKit/Source/core/html/parser/HTMLScriptRunner.cpp b/third_party/WebKit/Source/core/html/parser/HTMLScriptRunner.cpp
index 35b1258..3d80848 100644
--- a/third_party/WebKit/Source/core/html/parser/HTMLScriptRunner.cpp
+++ b/third_party/WebKit/Source/core/html/parser/HTMLScriptRunner.cpp
@@ -40,7 +40,6 @@
 #include "core/html/parser/NestingLevelIncrementer.h"
 #include "platform/NotImplemented.h"
 #include "public/platform/Platform.h"
-#include "public/platform/WebFrameScheduler.h"
 
 namespace blink {
 
@@ -288,7 +287,7 @@
         if (m_document->frame()) {
             ScriptState* scriptState = ScriptState::forMainWorld(m_document->frame());
             if (scriptState->contextIsValid())
-                ScriptStreamer::startStreaming(m_parserBlockingScript, PendingScript::ParsingBlocking, m_document->frame()->settings(), scriptState, m_document->loadingTaskRunner());
+                ScriptStreamer::startStreaming(m_parserBlockingScript, PendingScript::ParsingBlocking, m_document->frame()->settings(), scriptState);
         }
 
         m_parserBlockingScript.watchForLoad(this);
@@ -304,7 +303,7 @@
     if (m_document->frame() && !pendingScript.isReady()) {
         ScriptState* scriptState = ScriptState::forMainWorld(m_document->frame());
         if (scriptState->contextIsValid())
-            ScriptStreamer::startStreaming(pendingScript, PendingScript::Deferred, m_document->frame()->settings(), scriptState, m_document->loadingTaskRunner());
+            ScriptStreamer::startStreaming(pendingScript, PendingScript::Deferred, m_document->frame()->settings(), scriptState);
     }
 
     ASSERT(pendingScript.resource());
diff --git a/third_party/WebKit/Source/core/html/shadow/MediaControlElements.cpp b/third_party/WebKit/Source/core/html/shadow/MediaControlElements.cpp
index 18447841..5cd9eea 100644
--- a/third_party/WebKit/Source/core/html/shadow/MediaControlElements.cpp
+++ b/third_party/WebKit/Source/core/html/shadow/MediaControlElements.cpp
@@ -46,6 +46,7 @@
 #include "core/layout/LayoutTheme.h"
 #include "core/layout/LayoutVideo.h"
 #include "platform/RuntimeEnabledFeatures.h"
+#include "public/platform/Platform.h"
 
 namespace blink {
 
@@ -551,6 +552,8 @@
 MediaControlCastButtonElement::MediaControlCastButtonElement(MediaControls& mediaControls, bool isOverlayButton)
     : MediaControlInputElement(mediaControls, MediaCastOnButton), m_isOverlayButton(isOverlayButton)
 {
+    if (m_isOverlayButton)
+        recordMetrics(CastOverlayMetrics::Created);
     setIsPlayingRemotely(false);
 }
 
@@ -567,7 +570,7 @@
     if (event->type() == EventTypeNames::click) {
         if (m_isOverlayButton && !m_clickUseCounted) {
             m_clickUseCounted = true;
-            UseCounter::count(document(), UseCounter::CastOverlayClicked);
+            recordMetrics(CastOverlayMetrics::Clicked);
         }
         if (mediaElement().isPlayingRemotely()) {
             mediaElement().requestRemotePlaybackControl();
@@ -615,7 +618,7 @@
     ASSERT(isWanted());
     if (!m_showUseCounted) {
         m_showUseCounted = true;
-        UseCounter::count(document(), UseCounter::CastOverlayShown);
+        recordMetrics(CastOverlayMetrics::Shown);
     }
 }
 
@@ -624,6 +627,12 @@
     return isUserInteractionEvent(event);
 }
 
+void MediaControlCastButtonElement::recordMetrics(CastOverlayMetrics metric)
+{
+    ASSERT(m_isOverlayButton);
+    Platform::current()->histogramEnumeration("Cast.Sender.Overlay", static_cast<int>(metric), static_cast<int>(CastOverlayMetrics::Count));
+}
+
 // ----------------------------
 
 MediaControlTimeRemainingDisplayElement::MediaControlTimeRemainingDisplayElement(MediaControls& mediaControls)
diff --git a/third_party/WebKit/Source/core/html/shadow/MediaControlElements.h b/third_party/WebKit/Source/core/html/shadow/MediaControlElements.h
index 6f124c6..1762f9d 100644
--- a/third_party/WebKit/Source/core/html/shadow/MediaControlElements.h
+++ b/third_party/WebKit/Source/core/html/shadow/MediaControlElements.h
@@ -203,8 +203,18 @@
 
     bool m_isOverlayButton;
 
-    // UseCounter related boolean. They are used to prevent counting something
-    // twice for the same media element.
+    // This is used for UMA histogram (Cast.Sender.Overlay). New values should
+    // be appended only and must be added before |Count|.
+    enum class CastOverlayMetrics {
+        Created = 0,
+        Shown,
+        Clicked,
+        Count // Keep last.
+    };
+    void recordMetrics(CastOverlayMetrics);
+
+    // UMA related boolean. They are used to prevent counting something twice
+    // for the same media element.
     bool m_clickUseCounted = false;
     bool m_showUseCounted = false;
 };
diff --git a/third_party/WebKit/Source/core/inspector/InspectorAnimationAgent.cpp b/third_party/WebKit/Source/core/inspector/InspectorAnimationAgent.cpp
index 98196ff..8ebc891c5 100644
--- a/third_party/WebKit/Source/core/inspector/InspectorAnimationAgent.cpp
+++ b/third_party/WebKit/Source/core/inspector/InspectorAnimationAgent.cpp
@@ -340,7 +340,6 @@
 DEFINE_TRACE(InspectorAnimationAgent)
 {
 #if ENABLE(OILPAN)
-    visitor->trace(m_inspectedFrames);
     visitor->trace(m_domAgent);
     visitor->trace(m_injectedScriptManager);
     visitor->trace(m_idToAnimation);
diff --git a/third_party/WebKit/Source/core/inspector/InspectorAnimationAgent.h b/third_party/WebKit/Source/core/inspector/InspectorAnimationAgent.h
index 50cb25b5..3ca0414 100644
--- a/third_party/WebKit/Source/core/inspector/InspectorAnimationAgent.h
+++ b/third_party/WebKit/Source/core/inspector/InspectorAnimationAgent.h
@@ -68,7 +68,7 @@
     AnimationTimeline& referenceTimeline();
     Animation* animationClone(Animation*);
 
-    RawPtrWillBeMember<InspectedFrames> m_inspectedFrames;
+    InspectedFrames* m_inspectedFrames;
     RawPtrWillBeMember<InspectorDOMAgent> m_domAgent;
     RawPtrWillBeMember<InjectedScriptManager> m_injectedScriptManager;
     PersistentHeapHashMapWillBeHeapHashMap<String, Member<Animation>> m_idToAnimation;
diff --git a/third_party/WebKit/Source/core/inspector/InspectorApplicationCacheAgent.cpp b/third_party/WebKit/Source/core/inspector/InspectorApplicationCacheAgent.cpp
index 99ebf86..8e336691 100644
--- a/third_party/WebKit/Source/core/inspector/InspectorApplicationCacheAgent.cpp
+++ b/third_party/WebKit/Source/core/inspector/InspectorApplicationCacheAgent.cpp
@@ -201,7 +201,6 @@
 
 DEFINE_TRACE(InspectorApplicationCacheAgent)
 {
-    visitor->trace(m_inspectedFrames);
     InspectorBaseAgent::trace(visitor);
 }
 
diff --git a/third_party/WebKit/Source/core/inspector/InspectorApplicationCacheAgent.h b/third_party/WebKit/Source/core/inspector/InspectorApplicationCacheAgent.h
index 1434a55..e9208362 100644
--- a/third_party/WebKit/Source/core/inspector/InspectorApplicationCacheAgent.h
+++ b/third_party/WebKit/Source/core/inspector/InspectorApplicationCacheAgent.h
@@ -73,7 +73,7 @@
 
     DocumentLoader* assertFrameWithDocumentLoader(ErrorString*, String frameId);
 
-    RawPtrWillBeMember<InspectedFrames> m_inspectedFrames;
+    InspectedFrames* m_inspectedFrames;
 };
 
 } // namespace blink
diff --git a/third_party/WebKit/Source/core/inspector/InspectorCSSAgent.cpp b/third_party/WebKit/Source/core/inspector/InspectorCSSAgent.cpp
index fd359448..81d64a0 100644
--- a/third_party/WebKit/Source/core/inspector/InspectorCSSAgent.cpp
+++ b/third_party/WebKit/Source/core/inspector/InspectorCSSAgent.cpp
@@ -1741,7 +1741,6 @@
 DEFINE_TRACE(InspectorCSSAgent)
 {
     visitor->trace(m_domAgent);
-    visitor->trace(m_inspectedFrames);
     visitor->trace(m_resourceAgent);
     visitor->trace(m_resourceContentLoader);
 #if ENABLE(OILPAN)
diff --git a/third_party/WebKit/Source/core/inspector/InspectorCSSAgent.h b/third_party/WebKit/Source/core/inspector/InspectorCSSAgent.h
index 20340d9..5798fbb 100644
--- a/third_party/WebKit/Source/core/inspector/InspectorCSSAgent.h
+++ b/third_party/WebKit/Source/core/inspector/InspectorCSSAgent.h
@@ -204,7 +204,7 @@
     void resetPseudoStates();
 
     RawPtrWillBeMember<InspectorDOMAgent> m_domAgent;
-    RawPtrWillBeMember<InspectedFrames> m_inspectedFrames;
+    InspectedFrames* m_inspectedFrames;
     RawPtrWillBeMember<InspectorResourceAgent> m_resourceAgent;
     RawPtrWillBeMember<InspectorResourceContentLoader> m_resourceContentLoader;
 
diff --git a/third_party/WebKit/Source/core/inspector/InspectorDOMAgent.cpp b/third_party/WebKit/Source/core/inspector/InspectorDOMAgent.cpp
index 29d2568..4e91190 100644
--- a/third_party/WebKit/Source/core/inspector/InspectorDOMAgent.cpp
+++ b/third_party/WebKit/Source/core/inspector/InspectorDOMAgent.cpp
@@ -1109,6 +1109,21 @@
     frontend()->inspectNodeRequested(backendNodeId);
 }
 
+void InspectorDOMAgent::nodeHighlightedInOverlay(Node* node)
+{
+    if (!frontend() || !enabled())
+        return;
+
+    while (node && !node->isElementNode() && !node->isDocumentNode() && !node->isDocumentFragment())
+        node = node->parentOrShadowHostNode();
+
+    if (!node)
+        return;
+
+    int nodeId = pushNodePathToFrontend(node);
+    frontend()->nodeHighlightRequested(nodeId);
+}
+
 void InspectorDOMAgent::setSearchingForNode(ErrorString* errorString, SearchMode searchMode, JSONObject* highlightInspectorObject)
 {
     if (m_client)
@@ -2127,7 +2142,6 @@
 DEFINE_TRACE(InspectorDOMAgent)
 {
     visitor->trace(m_domListener);
-    visitor->trace(m_inspectedFrames);
     visitor->trace(m_injectedScriptManager);
 #if ENABLE(OILPAN)
     visitor->trace(m_documentNodeToIdMap);
diff --git a/third_party/WebKit/Source/core/inspector/InspectorDOMAgent.h b/third_party/WebKit/Source/core/inspector/InspectorDOMAgent.h
index 4169f05..f8ff183 100644
--- a/third_party/WebKit/Source/core/inspector/InspectorDOMAgent.h
+++ b/third_party/WebKit/Source/core/inspector/InspectorDOMAgent.h
@@ -183,6 +183,7 @@
     int boundNodeId(Node*);
     void setDOMListener(DOMListener*);
     void inspect(Node*);
+    void nodeHighlightedInOverlay(Node*);
 
     static String documentURLString(Document*);
 
@@ -244,7 +245,7 @@
 
     RawPtrWillBeMember<InspectorRevalidateDOMTask> revalidateTask();
 
-    RawPtrWillBeMember<InspectedFrames> m_inspectedFrames;
+    InspectedFrames* m_inspectedFrames;
     RawPtrWillBeMember<InjectedScriptManager> m_injectedScriptManager;
     Client* m_client;
     RawPtrWillBeMember<DOMListener> m_domListener;
diff --git a/third_party/WebKit/Source/core/inspector/InspectorInputAgent.cpp b/third_party/WebKit/Source/core/inspector/InspectorInputAgent.cpp
index 00a43da..57cbb06e 100644
--- a/third_party/WebKit/Source/core/inspector/InspectorInputAgent.cpp
+++ b/third_party/WebKit/Source/core/inspector/InspectorInputAgent.cpp
@@ -208,7 +208,6 @@
 
 DEFINE_TRACE(InspectorInputAgent)
 {
-    visitor->trace(m_inspectedFrames);
     InspectorBaseAgent::trace(visitor);
 }
 
diff --git a/third_party/WebKit/Source/core/inspector/InspectorInputAgent.h b/third_party/WebKit/Source/core/inspector/InspectorInputAgent.h
index 6422132..12bb726 100644
--- a/third_party/WebKit/Source/core/inspector/InspectorInputAgent.h
+++ b/third_party/WebKit/Source/core/inspector/InspectorInputAgent.h
@@ -61,7 +61,7 @@
 private:
     explicit InspectorInputAgent(InspectedFrames*);
 
-    RawPtrWillBeMember<InspectedFrames> m_inspectedFrames;
+    InspectedFrames* m_inspectedFrames;
 };
 
 
diff --git a/third_party/WebKit/Source/core/inspector/InspectorInstrumentation.cpp b/third_party/WebKit/Source/core/inspector/InspectorInstrumentation.cpp
index 8ac227d..7e12bb0 100644
--- a/third_party/WebKit/Source/core/inspector/InspectorInstrumentation.cpp
+++ b/third_party/WebKit/Source/core/inspector/InspectorInstrumentation.cpp
@@ -49,7 +49,13 @@
 namespace blink {
 
 namespace {
-static HashSet<InstrumentingAgents*>* instrumentingAgentsSet = 0;
+
+WillBePersistentHeapHashSet<RawPtrWillBeWeakMember<InstrumentingAgents>>& instrumentingAgentsSet()
+{
+    DEFINE_STATIC_LOCAL(WillBePersistentHeapHashSet<RawPtrWillBeWeakMember<InstrumentingAgents>>, instrumentingAgentsSet, ());
+    return instrumentingAgentsSet;
+}
+
 }
 
 namespace InspectorInstrumentation {
@@ -109,9 +115,7 @@
 void willDestroyResourceImpl(Resource* cachedResource)
 {
     ASSERT(isMainThread());
-    if (!instrumentingAgentsSet)
-        return;
-    for (InstrumentingAgents* instrumentingAgents: *instrumentingAgentsSet) {
+    for (InstrumentingAgents* instrumentingAgents: instrumentingAgentsSet()) {
         if (InspectorResourceAgent* inspectorResourceAgent = instrumentingAgents->inspectorResourceAgent())
             inspectorResourceAgent->willDestroyResource(cachedResource);
     }
@@ -120,9 +124,7 @@
 bool collectingHTMLParseErrorsImpl(InstrumentingAgents* instrumentingAgents)
 {
     ASSERT(isMainThread());
-    if (!instrumentingAgentsSet)
-        return false;
-    return instrumentingAgentsSet->contains(instrumentingAgents);
+    return instrumentingAgentsSet().contains(instrumentingAgents);
 }
 
 void appendAsyncCallStack(ExecutionContext* executionContext, ScriptCallStack* callStack)
@@ -144,21 +146,14 @@
 void registerInstrumentingAgents(InstrumentingAgents* instrumentingAgents)
 {
     ASSERT(isMainThread());
-    if (!instrumentingAgentsSet)
-        instrumentingAgentsSet = new HashSet<InstrumentingAgents*>();
-    instrumentingAgentsSet->add(instrumentingAgents);
+    instrumentingAgentsSet().add(instrumentingAgents);
 }
 
 void unregisterInstrumentingAgents(InstrumentingAgents* instrumentingAgents)
 {
     ASSERT(isMainThread());
-    if (!instrumentingAgentsSet)
-        return;
-    instrumentingAgentsSet->remove(instrumentingAgents);
-    if (instrumentingAgentsSet->isEmpty()) {
-        delete instrumentingAgentsSet;
-        instrumentingAgentsSet = 0;
-    }
+    ASSERT(instrumentingAgentsSet().contains(instrumentingAgents));
+    instrumentingAgentsSet().remove(instrumentingAgents);
 }
 
 InstrumentingAgents* instrumentingAgentsFor(LocalFrame* frame)
@@ -221,4 +216,3 @@
 }
 
 } // namespace blink
-
diff --git a/third_party/WebKit/Source/core/inspector/InspectorLayerTreeAgent.cpp b/third_party/WebKit/Source/core/inspector/InspectorLayerTreeAgent.cpp
index ae34bd5..fe10ad5 100644
--- a/third_party/WebKit/Source/core/inspector/InspectorLayerTreeAgent.cpp
+++ b/third_party/WebKit/Source/core/inspector/InspectorLayerTreeAgent.cpp
@@ -158,7 +158,6 @@
 
 DEFINE_TRACE(InspectorLayerTreeAgent)
 {
-    visitor->trace(m_inspectedFrames);
     InspectorBaseAgent::trace(visitor);
 }
 
diff --git a/third_party/WebKit/Source/core/inspector/InspectorLayerTreeAgent.h b/third_party/WebKit/Source/core/inspector/InspectorLayerTreeAgent.h
index c960f0e..016fa3f7 100644
--- a/third_party/WebKit/Source/core/inspector/InspectorLayerTreeAgent.h
+++ b/third_party/WebKit/Source/core/inspector/InspectorLayerTreeAgent.h
@@ -103,7 +103,7 @@
     void gatherGraphicsLayers(GraphicsLayer*, HashMap<int, int>& layerIdToNodeIdMap, RefPtr<TypeBuilder::Array<TypeBuilder::LayerTree::Layer> >&);
     int idForNode(Node*);
 
-    RawPtrWillBeMember<InspectedFrames> m_inspectedFrames;
+    InspectedFrames* m_inspectedFrames;
     Vector<int, 2> m_pageOverlayLayerIds;
 
     typedef HashMap<String, RefPtr<PictureSnapshot> > SnapshotById;
diff --git a/third_party/WebKit/Source/core/inspector/InspectorPageAgent.cpp b/third_party/WebKit/Source/core/inspector/InspectorPageAgent.cpp
index 61b9688..e53a831 100644
--- a/third_party/WebKit/Source/core/inspector/InspectorPageAgent.cpp
+++ b/third_party/WebKit/Source/core/inspector/InspectorPageAgent.cpp
@@ -789,7 +789,6 @@
 
 DEFINE_TRACE(InspectorPageAgent)
 {
-    visitor->trace(m_inspectedFrames);
     visitor->trace(m_debuggerAgent);
     visitor->trace(m_inspectorResourceContentLoader);
     InspectorBaseAgent::trace(visitor);
diff --git a/third_party/WebKit/Source/core/inspector/InspectorPageAgent.h b/third_party/WebKit/Source/core/inspector/InspectorPageAgent.h
index a34aaeb..63917a6 100644
--- a/third_party/WebKit/Source/core/inspector/InspectorPageAgent.h
+++ b/third_party/WebKit/Source/core/inspector/InspectorPageAgent.h
@@ -143,7 +143,7 @@
 
     PassRefPtr<TypeBuilder::Page::Frame> buildObjectForFrame(LocalFrame*);
     PassRefPtr<TypeBuilder::Page::FrameResourceTree> buildObjectForFrameTree(LocalFrame*);
-    RawPtrWillBeMember<InspectedFrames> m_inspectedFrames;
+    InspectedFrames* m_inspectedFrames;
     RawPtrWillBeMember<InspectorDebuggerAgent> m_debuggerAgent;
     Client* m_client;
     long m_lastScriptIdentifier;
diff --git a/third_party/WebKit/Source/core/inspector/InspectorResourceAgent.cpp b/third_party/WebKit/Source/core/inspector/InspectorResourceAgent.cpp
index 6970c1b..07a0fdc 100644
--- a/third_party/WebKit/Source/core/inspector/InspectorResourceAgent.cpp
+++ b/third_party/WebKit/Source/core/inspector/InspectorResourceAgent.cpp
@@ -411,7 +411,6 @@
 
 DEFINE_TRACE(InspectorResourceAgent)
 {
-    visitor->trace(m_inspectedFrames);
     visitor->trace(m_replayXHRs);
     visitor->trace(m_replayXHRsToBeDeleted);
     visitor->trace(m_pendingXHRReplayData);
diff --git a/third_party/WebKit/Source/core/inspector/InspectorResourceAgent.h b/third_party/WebKit/Source/core/inspector/InspectorResourceAgent.h
index c516d6a9..424c298 100644
--- a/third_party/WebKit/Source/core/inspector/InspectorResourceAgent.h
+++ b/third_party/WebKit/Source/core/inspector/InspectorResourceAgent.h
@@ -165,7 +165,7 @@
 
     bool getResponseBodyBlob(const String& requestId, PassRefPtrWillBeRawPtr<GetResponseBodyCallback>);
 
-    RawPtrWillBeMember<InspectedFrames> m_inspectedFrames;
+    InspectedFrames* m_inspectedFrames;
     String m_userAgentOverride;
     String m_hostId;
     OwnPtr<NetworkResourcesData> m_resourcesData;
diff --git a/third_party/WebKit/Source/core/inspector/InspectorTracingAgent.cpp b/third_party/WebKit/Source/core/inspector/InspectorTracingAgent.cpp
index cab7508..219b5d0 100644
--- a/third_party/WebKit/Source/core/inspector/InspectorTracingAgent.cpp
+++ b/third_party/WebKit/Source/core/inspector/InspectorTracingAgent.cpp
@@ -38,7 +38,6 @@
 DEFINE_TRACE(InspectorTracingAgent)
 {
     visitor->trace(m_workerAgent);
-    visitor->trace(m_inspectedFrames);
     InspectorBaseAgent::trace(visitor);
 }
 
diff --git a/third_party/WebKit/Source/core/inspector/InspectorTracingAgent.h b/third_party/WebKit/Source/core/inspector/InspectorTracingAgent.h
index 522f039..ad6cf17 100644
--- a/third_party/WebKit/Source/core/inspector/InspectorTracingAgent.h
+++ b/third_party/WebKit/Source/core/inspector/InspectorTracingAgent.h
@@ -59,7 +59,7 @@
     int m_layerTreeId;
     Client* m_client;
     RawPtrWillBeMember<InspectorWorkerAgent> m_workerAgent;
-    RawPtrWillBeMember<InspectedFrames> m_inspectedFrames;
+    InspectedFrames* m_inspectedFrames;
 };
 
 } // namespace blink
diff --git a/third_party/WebKit/Source/core/inspector/PageConsoleAgent.cpp b/third_party/WebKit/Source/core/inspector/PageConsoleAgent.cpp
index 227b3e2..63e8a43 100644
--- a/third_party/WebKit/Source/core/inspector/PageConsoleAgent.cpp
+++ b/third_party/WebKit/Source/core/inspector/PageConsoleAgent.cpp
@@ -63,7 +63,6 @@
 DEFINE_TRACE(PageConsoleAgent)
 {
     visitor->trace(m_inspectorDOMAgent);
-    visitor->trace(m_inspectedFrames);
     InspectorConsoleAgent::trace(visitor);
 }
 
diff --git a/third_party/WebKit/Source/core/inspector/PageConsoleAgent.h b/third_party/WebKit/Source/core/inspector/PageConsoleAgent.h
index 279c35c..8a689e5d 100644
--- a/third_party/WebKit/Source/core/inspector/PageConsoleAgent.h
+++ b/third_party/WebKit/Source/core/inspector/PageConsoleAgent.h
@@ -72,7 +72,7 @@
     void clearMessages(ErrorString*) override;
 
     RawPtrWillBeMember<InspectorDOMAgent> m_inspectorDOMAgent;
-    RawPtrWillBeMember<InspectedFrames> m_inspectedFrames;
+    InspectedFrames* m_inspectedFrames;
     HashSet<WorkerGlobalScopeProxy*> m_workersWithEnabledConsole;
 
     static int s_enabledAgentCount;
diff --git a/third_party/WebKit/Source/core/inspector/PageDebuggerAgent.cpp b/third_party/WebKit/Source/core/inspector/PageDebuggerAgent.cpp
index 6cb0c23..0480a3a 100644
--- a/third_party/WebKit/Source/core/inspector/PageDebuggerAgent.cpp
+++ b/third_party/WebKit/Source/core/inspector/PageDebuggerAgent.cpp
@@ -70,7 +70,6 @@
 
 DEFINE_TRACE(PageDebuggerAgent)
 {
-    visitor->trace(m_inspectedFrames);
     visitor->trace(m_injectedScriptManager);
     InspectorDebuggerAgent::trace(visitor);
 }
diff --git a/third_party/WebKit/Source/core/inspector/PageDebuggerAgent.h b/third_party/WebKit/Source/core/inspector/PageDebuggerAgent.h
index bdc523ff..deda90f 100644
--- a/third_party/WebKit/Source/core/inspector/PageDebuggerAgent.h
+++ b/third_party/WebKit/Source/core/inspector/PageDebuggerAgent.h
@@ -70,7 +70,7 @@
     // V8DebuggerAgent::Client implemntation.
     bool canExecuteScripts() const;
 
-    RawPtrWillBeMember<InspectedFrames> m_inspectedFrames;
+    InspectedFrames* m_inspectedFrames;
     RawPtrWillBeMember<InjectedScriptManager> m_injectedScriptManager;
     HashMap<String, String> m_compiledScriptURLs;
 };
diff --git a/third_party/WebKit/Source/core/inspector/PageRuntimeAgent.cpp b/third_party/WebKit/Source/core/inspector/PageRuntimeAgent.cpp
index f338a67c..d456478 100644
--- a/third_party/WebKit/Source/core/inspector/PageRuntimeAgent.cpp
+++ b/third_party/WebKit/Source/core/inspector/PageRuntimeAgent.cpp
@@ -62,7 +62,6 @@
 
 DEFINE_TRACE(PageRuntimeAgent)
 {
-    visitor->trace(m_inspectedFrames);
     InspectorRuntimeAgent::trace(visitor);
 }
 
diff --git a/third_party/WebKit/Source/core/inspector/PageRuntimeAgent.h b/third_party/WebKit/Source/core/inspector/PageRuntimeAgent.h
index 4584ef0..e6815d2 100644
--- a/third_party/WebKit/Source/core/inspector/PageRuntimeAgent.h
+++ b/third_party/WebKit/Source/core/inspector/PageRuntimeAgent.h
@@ -66,7 +66,7 @@
     void reportExecutionContextCreation();
     void reportExecutionContext(ScriptState*, bool isPageContext, const String& origin, const String& frameId);
 
-    RawPtrWillBeMember<InspectedFrames> m_inspectedFrames;
+    InspectedFrames* m_inspectedFrames;
     bool m_mainWorldContextCreated;
     typedef HashMap<RefPtr<ScriptState>, int> ScriptStateToId;
     ScriptStateToId m_scriptStateToId;
diff --git a/third_party/WebKit/Source/core/layout/ImageQualityControllerTest.cpp b/third_party/WebKit/Source/core/layout/ImageQualityControllerTest.cpp
index e70a6f4b..41fcfd9 100644
--- a/third_party/WebKit/Source/core/layout/ImageQualityControllerTest.cpp
+++ b/third_party/WebKit/Source/core/layout/ImageQualityControllerTest.cpp
@@ -8,7 +8,7 @@
 #include "core/layout/LayoutImage.h"
 #include "core/layout/LayoutTestHelper.h"
 #include "platform/graphics/GraphicsContext.h"
-#include "platform/graphics/paint/DisplayItemList.h"
+#include "platform/graphics/paint/PaintController.h"
 
 #include <gtest/gtest.h>
 
@@ -106,8 +106,8 @@
     LayoutImage* img = toLayoutImage(document().body()->firstChild()->layoutObject());
 
     RefPtr<TestImageLowQuality> testImage = adoptRef(new TestImageLowQuality);
-    OwnPtr<DisplayItemList> displayItemList = DisplayItemList::create();
-    GraphicsContext context(displayItemList.get());
+    OwnPtr<PaintController> paintController = PaintController::create();
+    GraphicsContext context(paintController.get());
     EXPECT_EQ(InterpolationMedium, controller()->chooseInterpolationQuality(&context, img, testImage.get(), testImage.get(), LayoutSize(1, 1)));
 }
 
@@ -134,8 +134,8 @@
     LayoutImage* img = toLayoutImage(document().body()->firstChild()->layoutObject());
 
     RefPtr<TestImageLowQuality> testImage = adoptRef(new TestImageLowQuality);
-    OwnPtr<DisplayItemList> displayItemList = DisplayItemList::create();
-    GraphicsContext context(displayItemList.get());
+    OwnPtr<PaintController> paintController = PaintController::create();
+    GraphicsContext context(paintController.get());
 
     // Start a resize
     document().frame()->view()->willStartLiveResize();
@@ -166,8 +166,8 @@
     LayoutImage* img = toLayoutImage(document().body()->firstChild()->layoutObject());
 
     RefPtr<TestImageLowQuality> testImage = adoptRef(new TestImageLowQuality);
-    OwnPtr<DisplayItemList> displayItemList = DisplayItemList::create();
-    GraphicsContext context(displayItemList.get());
+    OwnPtr<PaintController> paintController = PaintController::create();
+    GraphicsContext context(paintController.get());
 
     // Paint once. This will kick off a timer to see if we resize it during that timer's execution.
     EXPECT_EQ(InterpolationMedium, controller()->chooseInterpolationQuality(&context, img, testImage.get(), testImage.get(), LayoutSize(2, 2)));
@@ -191,8 +191,8 @@
     LayoutImage* img = toLayoutImage(document().body()->firstChild()->layoutObject());
 
     RefPtr<TestImageLowQuality> testImage = adoptRef(new TestImageLowQuality);
-    OwnPtr<DisplayItemList> displayItemList = DisplayItemList::create();
-    GraphicsContext context(displayItemList.get());
+    OwnPtr<PaintController> paintController = PaintController::create();
+    GraphicsContext context(paintController.get());
 
     // Paint once. This will kick off a timer to see if we resize it during that timer's execution.
     EXPECT_EQ(InterpolationMedium, controller()->chooseInterpolationQuality(&context, img, testImage.get(), testImage.get(), LayoutSize(2, 2)));
diff --git a/third_party/WebKit/Source/core/layout/LayoutBlock.cpp b/third_party/WebKit/Source/core/layout/LayoutBlock.cpp
index 2281d82..ad6462f 100644
--- a/third_party/WebKit/Source/core/layout/LayoutBlock.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutBlock.cpp
@@ -381,11 +381,7 @@
             // If the requested beforeChild is not one of our children, then this is because
             // there is an anonymous container within this object that contains the beforeChild.
             LayoutObject* beforeChildAnonymousContainer = beforeChildContainer;
-            if (beforeChildAnonymousContainer->isAnonymousBlock()
-                // Full screen layoutObjects and full screen placeholders act as anonymous blocks, not tables:
-                || beforeChildAnonymousContainer->isLayoutFullScreen()
-                || beforeChildAnonymousContainer->isLayoutFullScreenPlaceholder()
-                ) {
+            if (beforeChildAnonymousContainer->isAnonymousBlock()) {
                 // Insert the child into the anonymous block box instead of here.
                 if (newChild->isInline() || newChild->isFloatingOrOutOfFlowPositioned() || beforeChild->parent()->slowFirstChild() != beforeChild)
                     beforeChild->parent()->addChild(newChild, beforeChild);
@@ -638,9 +634,10 @@
     if (child->beingDestroyed())
         return;
     parent->setNeedsLayoutAndPrefWidthsRecalcAndFullPaintInvalidation(LayoutInvalidationReason::ChildAnonymousBlockChanged);
-    parent->setChildrenInline(child->childrenInline());
 
     child->moveAllChildrenTo(parent, child->nextSibling(), child->hasLayer());
+    parent->setChildrenInline(child->childrenInline());
+
     parent->children()->removeChildNode(parent, child, child->hasLayer());
     child->destroy();
 }
diff --git a/third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp b/third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp
index f9c1115..a83112b 100644
--- a/third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp
@@ -1752,7 +1752,7 @@
         removeFloatingObject(floatToRemove);
 
     // Iterate over our children and mark them as needed.
-    if (!childrenInline() || floatToRemove) {
+    if (!childrenInline()) {
         for (LayoutObject* child = firstChild(); child; child = child->nextSibling()) {
             if ((!floatToRemove && child->isFloatingOrOutOfFlowPositioned()) || !child->isLayoutBlock())
                 continue;
diff --git a/third_party/WebKit/Source/core/layout/LayoutBlockFlow.h b/third_party/WebKit/Source/core/layout/LayoutBlockFlow.h
index 7d180d6..a1b44b8 100644
--- a/third_party/WebKit/Source/core/layout/LayoutBlockFlow.h
+++ b/third_party/WebKit/Source/core/layout/LayoutBlockFlow.h
@@ -73,6 +73,15 @@
 // perform inline layout. See LayoutBlockFlowLine.cpp for these parts.
 //
 // TODO(jchaffraix): We need some float and line box expert to expand on this.
+//
+// LayoutBlockFlow enforces the following invariant:
+//
+// All in-flow children (ie excluding floating and out-of-flow positioned) are
+// either all blocks or all inline boxes.
+//
+// This is suggested by CSS to correctly the layout mixed inlines and blocks
+// lines (http://www.w3.org/TR/CSS21/visuren.html#anonymous-block-level). See
+// LayoutBlock::addChild about how the invariant is enforced.
 class CORE_EXPORT LayoutBlockFlow : public LayoutBlock {
 public:
     explicit LayoutBlockFlow(ContainerNode*);
diff --git a/third_party/WebKit/Source/core/layout/LayoutBox.cpp b/third_party/WebKit/Source/core/layout/LayoutBox.cpp
index 2852e51..00fc888 100644
--- a/third_party/WebKit/Source/core/layout/LayoutBox.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutBox.cpp
@@ -65,7 +65,7 @@
 #include "platform/geometry/FloatRoundedRect.h"
 #include "platform/geometry/TransformState.h"
 #include "platform/graphics/GraphicsContext.h"
-#include "platform/graphics/paint/DisplayItemList.h"
+#include "platform/graphics/paint/PaintController.h"
 #include <algorithm>
 #include <math.h>
 
@@ -455,7 +455,7 @@
 int LayoutBox::pixelSnappedScrollHeight() const
 {
     if (hasOverflowClip())
-        return layer()->scrollableArea()->scrollHeight();
+        return snapSizeToPixel(layer()->scrollableArea()->scrollHeight(), location().y() + clientTop());
     // For objects with visible overflow, this matches IE.
     // FIXME: Need to work right with writing modes.
     return snapSizeToPixel(scrollHeight(), location().y() + clientTop());
diff --git a/third_party/WebKit/Source/core/layout/LayoutBox.h b/third_party/WebKit/Source/core/layout/LayoutBox.h
index 7bdeb24..b5fffef 100644
--- a/third_party/WebKit/Source/core/layout/LayoutBox.h
+++ b/third_party/WebKit/Source/core/layout/LayoutBox.h
@@ -388,8 +388,8 @@
 
     // IE extensions. Used to calculate offsetWidth/Height.  Overridden by inlines (LayoutFlow)
     // to return the remaining width on a given line (and the height of a single line).
-    LayoutUnit offsetWidth() const override { return m_frameRect.width(); }
-    LayoutUnit offsetHeight() const override { return m_frameRect.height(); }
+    LayoutUnit offsetWidth() const final { return m_frameRect.width(); }
+    LayoutUnit offsetHeight() const final { return m_frameRect.height(); }
 
     int pixelSnappedOffsetWidth() const final;
     int pixelSnappedOffsetHeight() const final;
@@ -728,8 +728,8 @@
     LayoutUnit lineHeight(bool firstLine, LineDirectionMode, LinePositionMode = PositionOnContainingLine) const override;
     int baselinePosition(FontBaseline, bool firstLine, LineDirectionMode, LinePositionMode = PositionOnContainingLine) const override;
 
-    LayoutUnit offsetLeft() const override;
-    LayoutUnit offsetTop() const override;
+    LayoutUnit offsetLeft() const final;
+    LayoutUnit offsetTop() const final;
 
     LayoutPoint flipForWritingModeForChild(const LayoutBox* child, const LayoutPoint&) const;
     LayoutUnit flipForWritingMode(LayoutUnit position) const WARN_UNUSED_RETURN {
diff --git a/third_party/WebKit/Source/core/layout/LayoutFlexibleBox.cpp b/third_party/WebKit/Source/core/layout/LayoutFlexibleBox.cpp
index a92026e..e7ec5b3 100644
--- a/third_party/WebKit/Source/core/layout/LayoutFlexibleBox.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutFlexibleBox.cpp
@@ -437,7 +437,7 @@
         // We don't have to check for "auto" here - computeContentLogicalHeight will just return -1 for that case anyway.
         // It's safe to access scrollbarLogicalHeight here because computeNextFlexLine will have already
         // forced layout on the child.
-        return child.computeContentLogicalHeight(sizeType, size, child.logicalHeight() - child.borderAndPaddingLogicalHeight()) + child.scrollbarLogicalHeight();
+        return child.computeContentLogicalHeight(sizeType, size, child.contentLogicalHeight()) + child.scrollbarLogicalHeight();
     }
     return child.computeLogicalWidthUsing(sizeType, size, contentLogicalWidth(), this) - child.borderAndPaddingLogicalWidth();
 }
diff --git a/third_party/WebKit/Source/core/layout/LayoutFullScreen.cpp b/third_party/WebKit/Source/core/layout/LayoutFullScreen.cpp
deleted file mode 100644
index e65a678e..0000000
--- a/third_party/WebKit/Source/core/layout/LayoutFullScreen.cpp
+++ /dev/null
@@ -1,203 +0,0 @@
-/*
- * Copyright (C) 2010 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "core/layout/LayoutFullScreen.h"
-
-#include "core/dom/Fullscreen.h"
-#include "core/frame/FrameHost.h"
-#include "core/frame/Settings.h"
-#include "core/layout/LayoutBlockFlow.h"
-#include "core/page/Page.h"
-
-#include "public/platform/WebScreenInfo.h"
-
-using namespace blink;
-
-class LayoutFullScreenPlaceholder final : public LayoutBlockFlow {
-public:
-    LayoutFullScreenPlaceholder(LayoutFullScreen* owner)
-        : LayoutBlockFlow(nullptr)
-        , m_owner(owner)
-    {
-        setDocumentForAnonymous(&owner->document());
-    }
-private:
-    bool isOfType(LayoutObjectType type) const override { return type == LayoutObjectLayoutFullScreenPlaceholder || LayoutBlockFlow::isOfType(type); }
-    void willBeDestroyed() override;
-    LayoutFullScreen* m_owner;
-};
-
-void LayoutFullScreenPlaceholder::willBeDestroyed()
-{
-    m_owner->setPlaceholder(nullptr);
-    LayoutBlockFlow::willBeDestroyed();
-}
-
-LayoutFullScreen::LayoutFullScreen()
-    : LayoutFlexibleBox(nullptr)
-    , m_placeholder(nullptr)
-{
-    setReplaced(false);
-}
-
-LayoutFullScreen* LayoutFullScreen::createAnonymous(Document* document)
-{
-    LayoutFullScreen* layoutObject = new LayoutFullScreen();
-    layoutObject->setDocumentForAnonymous(document);
-    return layoutObject;
-}
-
-void LayoutFullScreen::willBeDestroyed()
-{
-    if (m_placeholder) {
-        remove();
-        if (!m_placeholder->beingDestroyed())
-            m_placeholder->destroy();
-        ASSERT(!m_placeholder);
-    }
-
-    // LayoutObjects are unretained, so notify the document (which holds a pointer to a LayoutFullScreen)
-    // if its LayoutFullScreen is destroyed.
-    Fullscreen& fullscreen = Fullscreen::from(document());
-    if (fullscreen.fullScreenLayoutObject() == this)
-        fullscreen.fullScreenLayoutObjectDestroyed();
-
-    LayoutFlexibleBox::willBeDestroyed();
-}
-
-void LayoutFullScreen::updateStyle()
-{
-    RefPtr<ComputedStyle> fullscreenStyle = ComputedStyle::create();
-
-    // Create a stacking context:
-    fullscreenStyle->setZIndex(INT_MAX);
-
-    fullscreenStyle->setFontDescription(FontDescription());
-    fullscreenStyle->font().update(nullptr);
-
-    fullscreenStyle->setDisplay(FLEX);
-    fullscreenStyle->setJustifyContentPosition(ContentPositionCenter);
-    fullscreenStyle->setAlignItemsPosition(ItemPositionCenter);
-    fullscreenStyle->setFlexDirection(FlowColumn);
-
-    fullscreenStyle->setPosition(FixedPosition);
-    fullscreenStyle->setLeft(Length(0, blink::Fixed));
-    fullscreenStyle->setTop(Length(0, blink::Fixed));
-    IntSize viewportSize = document().page()->frameHost().visualViewport().size();
-    fullscreenStyle->setWidth(Length(viewportSize.width(), blink::Fixed));
-    fullscreenStyle->setHeight(Length(viewportSize.height(), blink::Fixed));
-
-    fullscreenStyle->setBackgroundColor(StyleColor(Color::black));
-
-    setStyle(fullscreenStyle);
-}
-
-LayoutObject* LayoutFullScreen::wrapLayoutObject(LayoutObject* object, LayoutObject* parent, Document* document)
-{
-    // FIXME: We should not modify the structure of the layout tree during
-    // layout. crbug.com/370459
-    DeprecatedDisableModifyLayoutTreeStructureAsserts disabler;
-
-    LayoutFullScreen* fullscreenLayoutObject = LayoutFullScreen::createAnonymous(document);
-    fullscreenLayoutObject->updateStyle();
-    if (parent && !parent->isChildAllowed(fullscreenLayoutObject, fullscreenLayoutObject->styleRef())) {
-        fullscreenLayoutObject->destroy();
-        return nullptr;
-    }
-    if (object) {
-        // |object->parent()| can be null if the object is not yet attached
-        // to |parent|.
-        if (LayoutObject* parent = object->parent()) {
-            LayoutBlock* containingBlock = object->containingBlock();
-            ASSERT(containingBlock);
-            // Since we are moving the |object| to a new parent |fullscreenLayoutObject|,
-            // the line box tree underneath our |containingBlock| is not longer valid.
-            containingBlock->deleteLineBoxTree();
-
-            parent->addChild(fullscreenLayoutObject, object);
-            object->remove();
-
-            // Always just do a full layout to ensure that line boxes get deleted properly.
-            // Because objects moved from |parent| to |fullscreenLayoutObject|, we want to
-            // make new line boxes instead of leaving the old ones around.
-            parent->setNeedsLayoutAndPrefWidthsRecalcAndFullPaintInvalidation(LayoutInvalidationReason::Fullscreen);
-            containingBlock->setNeedsLayoutAndPrefWidthsRecalcAndFullPaintInvalidation(LayoutInvalidationReason::Fullscreen);
-        }
-        fullscreenLayoutObject->addChild(object);
-        fullscreenLayoutObject->setNeedsLayoutAndPrefWidthsRecalcAndFullPaintInvalidation(LayoutInvalidationReason::Fullscreen);
-    }
-
-    ASSERT(document);
-    Fullscreen::from(*document).setFullScreenLayoutObject(fullscreenLayoutObject);
-    return fullscreenLayoutObject;
-}
-
-void LayoutFullScreen::unwrapLayoutObject()
-{
-    // FIXME: We should not modify the structure of the layout tree during
-    // layout. crbug.com/370459
-    DeprecatedDisableModifyLayoutTreeStructureAsserts disabler;
-
-    if (parent()) {
-        for (LayoutObject* child = firstChild(); child; child = firstChild()) {
-            // We have to clear the override size, because as a flexbox, we
-            // may have set one on the child, and we don't want to leave that
-            // lying around on the child.
-            if (child->isBox())
-                toLayoutBox(child)->clearOverrideSize();
-            child->remove();
-            parent()->addChild(child, this);
-            parent()->setNeedsLayoutAndPrefWidthsRecalcAndFullPaintInvalidation(LayoutInvalidationReason::Fullscreen);
-        }
-    }
-    if (placeholder())
-        placeholder()->remove();
-    remove();
-    destroy();
-}
-
-void LayoutFullScreen::setPlaceholder(LayoutBlock* placeholder)
-{
-    m_placeholder = placeholder;
-}
-
-void LayoutFullScreen::createPlaceholder(PassRefPtr<ComputedStyle> style, const LayoutRect& frameRect)
-{
-    if (style->width().isAuto())
-        style->setWidth(Length(frameRect.width(), Fixed));
-    if (style->height().isAuto())
-        style->setHeight(Length(frameRect.height(), Fixed));
-
-    if (!m_placeholder) {
-        m_placeholder = new LayoutFullScreenPlaceholder(this);
-        m_placeholder->setStyle(style);
-        if (parent()) {
-            parent()->addChild(m_placeholder, this);
-            parent()->setNeedsLayoutAndPrefWidthsRecalcAndFullPaintInvalidation(LayoutInvalidationReason::Fullscreen);
-        }
-    } else {
-        m_placeholder->setStyle(style);
-    }
-}
diff --git a/third_party/WebKit/Source/core/layout/LayoutFullScreen.h b/third_party/WebKit/Source/core/layout/LayoutFullScreen.h
deleted file mode 100644
index 66a0dbd..0000000
--- a/third_party/WebKit/Source/core/layout/LayoutFullScreen.h
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * Copyright (C) 2010 Apple Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1.  Redistributions of source code must retain the above copyright
- *     notice, this list of conditions and the following disclaimer.
- * 2.  Redistributions in binary form must reproduce the above copyright
- *     notice, this list of conditions and the following disclaimer in the
- *     documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
- * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
- * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef LayoutFullScreen_h
-#define LayoutFullScreen_h
-
-#include "core/CoreExport.h"
-#include "core/layout/LayoutFlexibleBox.h"
-#include "core/style/StyleInheritedData.h"
-
-namespace blink {
-
-class CORE_EXPORT LayoutFullScreen final : public LayoutFlexibleBox {
-public:
-    static LayoutFullScreen* createAnonymous(Document*);
-
-    bool isOfType(LayoutObjectType type) const override { return type == LayoutObjectLayoutFullScreen || LayoutFlexibleBox::isOfType(type); }
-    const char* name() const override { return "LayoutFullScreen"; }
-
-    void setPlaceholder(LayoutBlock*);
-    LayoutBlock* placeholder() { return m_placeholder; }
-    void createPlaceholder(PassRefPtr<ComputedStyle>, const LayoutRect& frameRect);
-
-
-    static LayoutObject* wrapLayoutObject(LayoutObject*, LayoutObject*, Document*);
-    void unwrapLayoutObject();
-
-    void updateStyle();
-
-private:
-    LayoutFullScreen();
-    void willBeDestroyed() override;
-
-protected:
-    LayoutBlock* m_placeholder;
-};
-
-DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutFullScreen, isLayoutFullScreen());
-
-}
-
-#endif
diff --git a/third_party/WebKit/Source/core/layout/LayoutInline.cpp b/third_party/WebKit/Source/core/layout/LayoutInline.cpp
index 4ca3a45..32e03507 100644
--- a/third_party/WebKit/Source/core/layout/LayoutInline.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutInline.cpp
@@ -28,7 +28,6 @@
 #include "core/layout/HitTestResult.h"
 #include "core/layout/LayoutBlock.h"
 #include "core/layout/LayoutFlowThread.h"
-#include "core/layout/LayoutFullScreen.h"
 #include "core/layout/LayoutGeometryMap.h"
 #include "core/layout/LayoutTheme.h"
 #include "core/layout/LayoutView.h"
@@ -351,17 +350,6 @@
 {
     ASSERT(isDescendantOf(fromBlock));
 
-    // If we're splitting the inline containing the fullscreened element,
-    // |beforeChild| may be the layoutObject for the fullscreened element. However,
-    // that layoutObject is wrapped in a LayoutFullScreen, so |this| is not its
-    // parent. Since the splitting logic expects |this| to be the parent, set
-    // |beforeChild| to be the LayoutFullScreen.
-    if (Fullscreen* fullscreen = Fullscreen::fromIfExists(document())) {
-        const Element* fullScreenElement = fullscreen->webkitCurrentFullScreenElement();
-        if (fullScreenElement && beforeChild && beforeChild->node() == fullScreenElement)
-            beforeChild = fullscreen->fullScreenLayoutObject();
-    }
-
     // FIXME: Because splitting is O(n^2) as tags nest pathologically, we cap the depth at which we're willing to clone.
     // There will eventually be a better approach to this problem that will let us nest to a much
     // greater depth (see bugzilla bug 13430) but for now we have a limit.  This *will* result in
diff --git a/third_party/WebKit/Source/core/layout/LayoutMenuList.cpp b/third_party/WebKit/Source/core/layout/LayoutMenuList.cpp
index a416b51..2841fbc 100644
--- a/third_party/WebKit/Source/core/layout/LayoutMenuList.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutMenuList.cpp
@@ -67,7 +67,7 @@
 // to prevent children from rendering.
 bool LayoutMenuList::isChildAllowed(LayoutObject* object, const ComputedStyle&) const
 {
-    return object->isAnonymous() && !object->isLayoutFullScreen();
+    return object->isAnonymous();
 }
 
 void LayoutMenuList::createInnerBlock()
diff --git a/third_party/WebKit/Source/core/layout/LayoutObject.cpp b/third_party/WebKit/Source/core/layout/LayoutObject.cpp
index dd976b7..2499b03 100644
--- a/third_party/WebKit/Source/core/layout/LayoutObject.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutObject.cpp
@@ -86,7 +86,7 @@
 #include "platform/TracedValue.h"
 #include "platform/geometry/TransformState.h"
 #include "platform/graphics/GraphicsContext.h"
-#include "platform/graphics/paint/DisplayItemList.h"
+#include "platform/graphics/paint/PaintController.h"
 #include "wtf/Partitions.h"
 #include "wtf/RefCountedLeakCounter.h"
 #include "wtf/text/StringBuilder.h"
@@ -1450,9 +1450,9 @@
     ASSERT(paintInfo.paintInvalidationState);
     ASSERT(paintInfo.paintContainer());
 
-    DisplayItemList* displayItemList = paintInfo.context->displayItemList();
-    if (displayItemList->clientHasCheckedPaintInvalidation(displayItemClient())) {
-        ASSERT(displayItemList->clientCacheIsValid(displayItemClient())
+    PaintController* paintController = paintInfo.context->paintController();
+    if (paintController->clientHasCheckedPaintInvalidation(displayItemClient())) {
+        ASSERT(paintController->clientCacheIsValid(displayItemClient())
             == (invalidatePaintIfNeeded(*paintInfo.paintInvalidationState, *paintInfo.paintContainer()) == PaintInvalidationNone));
         return;
     }
@@ -1463,7 +1463,7 @@
     if (reason == PaintInvalidationDelayedFull)
         paintInfo.paintInvalidationState->pushDelayedPaintInvalidationTarget(*this);
 
-    displayItemList->setClientHasCheckedPaintInvalidation(displayItemClient());
+    paintController->setClientHasCheckedPaintInvalidation(displayItemClient());
 }
 
 PaintInvalidationReason LayoutObject::paintInvalidationReason(const LayoutBoxModelObject& paintInvalidationContainer,
@@ -2068,9 +2068,6 @@
         if (blockChildrenOnly && !child->isLayoutBlock())
             continue;
 
-        if (child->isLayoutFullScreen() || child->isLayoutFullScreenPlaceholder())
-            continue;
-
         RefPtr<ComputedStyle> newStyle = ComputedStyle::createAnonymousStyleWithDisplay(styleRef(), child->style()->display());
 
         // Preserve the position style of anonymous block continuations as they can have relative position when
diff --git a/third_party/WebKit/Source/core/layout/LayoutObject.h b/third_party/WebKit/Source/core/layout/LayoutObject.h
index 6ee0b9bd..339ee246 100644
--- a/third_party/WebKit/Source/core/layout/LayoutObject.h
+++ b/third_party/WebKit/Source/core/layout/LayoutObject.h
@@ -442,8 +442,6 @@
     bool isProgress() const { return isOfType(LayoutObjectProgress); }
     bool isQuote() const { return isOfType(LayoutObjectQuote); }
     bool isLayoutButton() const { return isOfType(LayoutObjectLayoutButton); }
-    bool isLayoutFullScreen() const { return isOfType(LayoutObjectLayoutFullScreen); }
-    bool isLayoutFullScreenPlaceholder() const { return isOfType(LayoutObjectLayoutFullScreenPlaceholder); }
     bool isLayoutGrid() const { return isOfType(LayoutObjectLayoutGrid); }
     bool isLayoutIFrame() const { return isOfType(LayoutObjectLayoutIFrame); }
     bool isLayoutImage() const { return isOfType(LayoutObjectLayoutImage); }
@@ -590,9 +588,7 @@
         // LayoutBlock::createAnonymousBlock(). This includes creating an anonymous
         // LayoutBlock having a BLOCK or BOX display. Other classes such as LayoutTextFragment
         // are not LayoutBlocks and will return false. See https://bugs.webkit.org/show_bug.cgi?id=56709.
-        return isAnonymous() && (style()->display() == BLOCK || style()->display() == BOX) && style()->styleType() == NOPSEUDO && isLayoutBlock() && !isListMarker() && !isLayoutFlowThread() && !isLayoutMultiColumnSet()
-            && !isLayoutFullScreen()
-            && !isLayoutFullScreenPlaceholder();
+        return isAnonymous() && (style()->display() == BLOCK || style()->display() == BOX) && style()->styleType() == NOPSEUDO && isLayoutBlock() && !isListMarker() && !isLayoutFlowThread() && !isLayoutMultiColumnSet();
     }
     bool isElementContinuation() const { return node() && node()->layoutObject() != this; }
     bool isInlineElementContinuation() const { return isElementContinuation() && isInline(); }
@@ -1307,8 +1303,6 @@
         LayoutObjectQuote,
         LayoutObjectLayoutButton,
         LayoutObjectLayoutFlowThread,
-        LayoutObjectLayoutFullScreen,
-        LayoutObjectLayoutFullScreenPlaceholder,
         LayoutObjectLayoutGrid,
         LayoutObjectLayoutIFrame,
         LayoutObjectLayoutImage,
diff --git a/third_party/WebKit/Source/core/layout/LayoutReplica.cpp b/third_party/WebKit/Source/core/layout/LayoutReplica.cpp
index 84714aaa..c2c404d 100644
--- a/third_party/WebKit/Source/core/layout/LayoutReplica.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutReplica.cpp
@@ -64,8 +64,9 @@
 
 void LayoutReplica::computePreferredLogicalWidths()
 {
-    m_minPreferredLogicalWidth = parentBox()->size().width();
-    m_maxPreferredLogicalWidth = m_minPreferredLogicalWidth;
+    // LayoutReplica is a synthetic object, PaintLayerReflectionInfo is what
+    // calls into it, so this should never be called.
+    ASSERT_NOT_REACHED();
     clearPreferredLogicalWidthsDirty();
 }
 
diff --git a/third_party/WebKit/Source/core/layout/LayoutReplica.h b/third_party/WebKit/Source/core/layout/LayoutReplica.h
index 6bf658d..83b71373 100644
--- a/third_party/WebKit/Source/core/layout/LayoutReplica.h
+++ b/third_party/WebKit/Source/core/layout/LayoutReplica.h
@@ -33,6 +33,28 @@
 
 namespace blink {
 
+// LayoutReplica is a synthetic object used to represent reflections.
+// https://www.webkit.org/blog/182/css-reflections/
+//
+// The object is part of the layout tree, however it is not fully inserted into
+// it: LayoutReplica::parent() will return the right information but the
+// parent's children() don't know about the LayoutReplica.
+// Note that its PaintLayer is fully inserted into the PaintLayer tree, which
+// requires some special casing in the painting code (e.g. in
+// PaintLayerStackingNode).
+//
+// LayoutReplica's parent() is the object with the -webkit-box-reflect.
+// LayoutReplica inherits its style from its parent() but also have an extra
+// 'transform' to paint the reflection correctly. This is done by
+// PaintLayerReflectionInfo.
+//
+// The object is created and managed by PaintLayerReflectionInfo. Also all of
+// its operations happen through PaintLayerReflectionInfo (e.g. layout, style
+// updates, ...).
+//
+// This class is a big hack. The original intent for it is unclear but has to do
+// with implementing the correct painting of reflection. It may be to apply a
+// 'transform' and offset during painting.
 class LayoutReplica final : public LayoutBox {
 public:
     static LayoutReplica* createAnonymous(Document*);
diff --git a/third_party/WebKit/Source/core/layout/LayoutVideo.cpp b/third_party/WebKit/Source/core/layout/LayoutVideo.cpp
index 946a568..3d1bf77 100644
--- a/third_party/WebKit/Source/core/layout/LayoutVideo.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutVideo.cpp
@@ -29,7 +29,6 @@
 #include "core/HTMLNames.h"
 #include "core/dom/Document.h"
 #include "core/html/HTMLVideoElement.h"
-#include "core/layout/LayoutFullScreen.h"
 #include "core/paint/VideoPainter.h"
 #include "public/platform/WebLayer.h"
 
@@ -203,47 +202,6 @@
     return !!mediaElement()->platformLayer();
 }
 
-static const LayoutBlock* layoutObjectPlaceholder(const LayoutObject* layoutObject)
-{
-    LayoutObject* parent = layoutObject->parent();
-    if (!parent)
-        return nullptr;
-
-    LayoutFullScreen* fullScreen = parent->isLayoutFullScreen() ? toLayoutFullScreen(parent) : 0;
-    if (!fullScreen)
-        return nullptr;
-
-    return fullScreen->placeholder();
-}
-
-LayoutUnit LayoutVideo::offsetLeft() const
-{
-    if (const LayoutBlock* block = layoutObjectPlaceholder(this))
-        return block->offsetLeft();
-    return LayoutMedia::offsetLeft();
-}
-
-LayoutUnit LayoutVideo::offsetTop() const
-{
-    if (const LayoutBlock* block = layoutObjectPlaceholder(this))
-        return block->offsetTop();
-    return LayoutMedia::offsetTop();
-}
-
-LayoutUnit LayoutVideo::offsetWidth() const
-{
-    if (const LayoutBlock* block = layoutObjectPlaceholder(this))
-        return block->offsetWidth();
-    return LayoutMedia::offsetWidth();
-}
-
-LayoutUnit LayoutVideo::offsetHeight() const
-{
-    if (const LayoutBlock* block = layoutObjectPlaceholder(this))
-        return block->offsetHeight();
-    return LayoutMedia::offsetHeight();
-}
-
 CompositingReasons LayoutVideo::additionalCompositingReasons() const
 {
     HTMLMediaElement* element = toHTMLMediaElement(node());
diff --git a/third_party/WebKit/Source/core/layout/LayoutVideo.h b/third_party/WebKit/Source/core/layout/LayoutVideo.h
index c2a189d..e4602e24 100644
--- a/third_party/WebKit/Source/core/layout/LayoutVideo.h
+++ b/third_party/WebKit/Source/core/layout/LayoutVideo.h
@@ -68,11 +68,6 @@
     LayoutUnit computeReplacedLogicalHeight() const override;
     LayoutUnit minimumReplacedHeight() const override;
 
-    LayoutUnit offsetLeft() const override;
-    LayoutUnit offsetTop() const override;
-    LayoutUnit offsetWidth() const override;
-    LayoutUnit offsetHeight() const override;
-
     CompositingReasons additionalCompositingReasons() const override;
 
     void updatePlayer();
diff --git a/third_party/WebKit/Source/core/layout/LayoutView.cpp b/third_party/WebKit/Source/core/layout/LayoutView.cpp
index 7f063b7..1b48b38 100644
--- a/third_party/WebKit/Source/core/layout/LayoutView.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutView.cpp
@@ -44,7 +44,7 @@
 #include "platform/TracedValue.h"
 #include "platform/geometry/FloatQuad.h"
 #include "platform/geometry/TransformState.h"
-#include "platform/graphics/paint/DisplayItemList.h"
+#include "platform/graphics/paint/PaintController.h"
 #include <inttypes.h>
 
 namespace blink {
diff --git a/third_party/WebKit/Source/core/layout/OverflowModel.h b/third_party/WebKit/Source/core/layout/OverflowModel.h
index cd865d3..52bab13 100644
--- a/third_party/WebKit/Source/core/layout/OverflowModel.h
+++ b/third_party/WebKit/Source/core/layout/OverflowModel.h
@@ -60,12 +60,15 @@
 // would be clipped by the overflow clip ('overflow' != visible). This
 // corresponds to children that overflows their parent.
 // It's important to note that this overflow ignores descendants with
-// self-painting layers. This is required by the simplification made by this
-// model (single united rectangle) to avoid gigantic invalidation. A good
-// example for this is positioned objects that can be anywhere on the page and
-// could artificially inflate the visual overflow.
-// TODO(jchaffraix): Explain the interaction with the content visual overflow
-// code path (BoxPainter) and PaintLayerClipper.
+// self-painting layers (see the SELF-PAINTING LAYER section in PaintLayer).
+// This is required by the simplification made by this model (single united
+// rectangle) to avoid gigantic invalidation. A good example for this is
+// positioned objects that can be anywhere on the page and could artificially
+// inflate the visual overflow.
+// The main use of content visual overflow is to prevent unneeded clipping in
+// BoxPainter (see https://crbug.com/238732). Note that the code path for
+// self-painting layer is handled by PaintLayerPainter, which relies on
+// PaintLayerClipper and thus ignores this optimization.
 //
 // This object is allocated only when some of these fields have non-default
 // values in the owning box. Care should be taken to use LayoutBox adder
diff --git a/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp b/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp
index 4f85281..60a312d 100644
--- a/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp
+++ b/third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp
@@ -61,7 +61,7 @@
 #include "platform/graphics/BitmapImage.h"
 #include "platform/graphics/GraphicsContext.h"
 #include "platform/graphics/paint/ClipDisplayItem.h"
-#include "platform/graphics/paint/DisplayItemList.h"
+#include "platform/graphics/paint/PaintController.h"
 #include "platform/graphics/paint/TransformDisplayItem.h"
 #include "wtf/CurrentTime.h"
 #include "wtf/text/StringBuilder.h"
@@ -2143,13 +2143,13 @@
         // FIXME: Combine similar code here and LayerClipRecorder.
         dirtyRect.intersect(paintInfo.localClipRectForSquashedLayer);
         {
-            ASSERT(context->displayItemList());
-            context->displayItemList()->createAndAppend<ClipDisplayItem>(*this, DisplayItem::ClipLayerOverflowControls, dirtyRect);
+            ASSERT(context->paintController());
+            context->paintController()->createAndAppend<ClipDisplayItem>(*this, DisplayItem::ClipLayerOverflowControls, dirtyRect);
         }
         PaintLayerPainter(*paintInfo.paintLayer).paintLayer(context, paintingInfo, paintLayerFlags);
         {
-            ASSERT(context->displayItemList());
-            context->displayItemList()->endItem<EndClipDisplayItem>(*this, DisplayItem::clipTypeToEndClipType(DisplayItem::ClipLayerOverflowControls));
+            ASSERT(context->paintController());
+            context->paintController()->endItem<EndClipDisplayItem>(*this, DisplayItem::clipTypeToEndClipType(DisplayItem::ClipLayerOverflowControls));
         }
     }
 }
diff --git a/third_party/WebKit/Source/core/layout/compositing/PaintLayerCompositor.cpp b/third_party/WebKit/Source/core/layout/compositing/PaintLayerCompositor.cpp
index 02b8e5f..ae05623 100644
--- a/third_party/WebKit/Source/core/layout/compositing/PaintLayerCompositor.cpp
+++ b/third_party/WebKit/Source/core/layout/compositing/PaintLayerCompositor.cpp
@@ -58,8 +58,8 @@
 #include "platform/ScriptForbiddenScope.h"
 #include "platform/TraceEvent.h"
 #include "platform/graphics/GraphicsLayer.h"
-#include "platform/graphics/paint/DisplayItemList.h"
 #include "platform/graphics/paint/DrawingRecorder.h"
+#include "platform/graphics/paint/PaintController.h"
 #include "platform/graphics/paint/TransformDisplayItem.h"
 #include "public/platform/Platform.h"
 
diff --git a/third_party/WebKit/Source/core/layout/line/InlineBox.h b/third_party/WebKit/Source/core/layout/line/InlineBox.h
index c7d13ce..2858df41 100644
--- a/third_party/WebKit/Source/core/layout/line/InlineBox.h
+++ b/third_party/WebKit/Source/core/layout/line/InlineBox.h
@@ -269,7 +269,9 @@
 
     bool visibleToHitTestRequest(const HitTestRequest& request) const { return lineLayoutItem().visibleToHitTestRequest(request); }
 
-    EVerticalAlign verticalAlign() const { return lineLayoutItem().isText() ? ComputedStyle::initialVerticalAlign() : lineLayoutItem().style(m_bitfields.firstLine())->verticalAlign(); }
+    // Anonymous inline: https://drafts.csswg.org/css2/visuren.html#anonymous
+    bool isAnonymousInline() const { return lineLayoutItem().isText() && lineLayoutItem().parent() && lineLayoutItem().parent().isBox(); }
+    EVerticalAlign verticalAlign() const { return isAnonymousInline() ? ComputedStyle::initialVerticalAlign() : lineLayoutItem().style(m_bitfields.firstLine())->verticalAlign(); }
 
     // Use with caution! The type is not checked!
     LineLayoutBoxModel boxModelObject() const
diff --git a/third_party/WebKit/Source/core/layout/svg/LayoutSVGResourcePattern.cpp b/third_party/WebKit/Source/core/layout/svg/LayoutSVGResourcePattern.cpp
index 7f34620b..ab82be1 100644
--- a/third_party/WebKit/Source/core/layout/svg/LayoutSVGResourcePattern.cpp
+++ b/third_party/WebKit/Source/core/layout/svg/LayoutSVGResourcePattern.cpp
@@ -29,7 +29,7 @@
 #include "core/svg/SVGFitToViewBox.h"
 #include "core/svg/SVGPatternElement.h"
 #include "platform/graphics/GraphicsContext.h"
-#include "platform/graphics/paint/DisplayItemList.h"
+#include "platform/graphics/paint/PaintController.h"
 #include "platform/graphics/paint/SkPictureBuilder.h"
 #include "third_party/skia/include/core/SkPicture.h"
 
diff --git a/third_party/WebKit/Source/core/loader/FrameFetchContext.cpp b/third_party/WebKit/Source/core/loader/FrameFetchContext.cpp
index ff2440b7..57adb2a7 100644
--- a/third_party/WebKit/Source/core/loader/FrameFetchContext.cpp
+++ b/third_party/WebKit/Source/core/loader/FrameFetchContext.cpp
@@ -64,7 +64,6 @@
 #include "platform/network/ResourceTimingInfo.h"
 #include "platform/weborigin/SchemeRegistry.h"
 #include "platform/weborigin/SecurityPolicy.h"
-#include "public/platform/WebFrameScheduler.h"
 
 #include <algorithm>
 
@@ -736,11 +735,6 @@
     return static_cast<ResourceLoadPriority>(modifiedPriority);
 }
 
-WebTaskRunner* FrameFetchContext::loadingTaskRunner() const
-{
-    return frame()->frameScheduler()->loadingTaskRunner();
-}
-
 DEFINE_TRACE(FrameFetchContext)
 {
     visitor->trace(m_document);
diff --git a/third_party/WebKit/Source/core/loader/FrameFetchContext.h b/third_party/WebKit/Source/core/loader/FrameFetchContext.h
index c2cbc75..a8137621 100644
--- a/third_party/WebKit/Source/core/loader/FrameFetchContext.h
+++ b/third_party/WebKit/Source/core/loader/FrameFetchContext.h
@@ -108,8 +108,6 @@
     void countClientHintsResourceWidth() override;
     void countClientHintsViewportWidth() override;
 
-    WebTaskRunner* loadingTaskRunner() const override;
-
     DECLARE_VIRTUAL_TRACE();
 
 private:
diff --git a/third_party/WebKit/Source/core/loader/FrameLoader.cpp b/third_party/WebKit/Source/core/loader/FrameLoader.cpp
index 3c711ab..68d09cd 100644
--- a/third_party/WebKit/Source/core/loader/FrameLoader.cpp
+++ b/third_party/WebKit/Source/core/loader/FrameLoader.cpp
@@ -1072,7 +1072,6 @@
     if (m_frame->document())
         m_frame->document()->detach();
     m_documentLoader = m_provisionalDocumentLoader.release();
-    m_frame->updateFrameSecurityOrigin();
 
     return true;
 }
diff --git a/third_party/WebKit/Source/core/page/ChromeClient.cpp b/third_party/WebKit/Source/core/page/ChromeClient.cpp
index 680a8eb..63919db4 100644
--- a/third_party/WebKit/Source/core/page/ChromeClient.cpp
+++ b/third_party/WebKit/Source/core/page/ChromeClient.cpp
@@ -78,10 +78,10 @@
     setResizable(features.resizable);
 }
 
-template<typename... Args>
+template<typename... DelegateArgs, typename... Args>
 bool openJavaScriptDialog(
     ChromeClient* chromeClient,
-    bool(ChromeClient::*function)(LocalFrame*, const String& message, Args...),
+    bool(ChromeClient::*function)(LocalFrame*, const String& message, DelegateArgs...),
     LocalFrame& frame,
     const String& message,
     ChromeClient::DialogType dialogType,
diff --git a/third_party/WebKit/Source/core/page/FrameTree.cpp b/third_party/WebKit/Source/core/page/FrameTree.cpp
index 9529551..b769bf33 100644
--- a/third_party/WebKit/Source/core/page/FrameTree.cpp
+++ b/third_party/WebKit/Source/core/page/FrameTree.cpp
@@ -274,7 +274,7 @@
 
     // Search the entire tree of each of the other pages in this namespace.
     // FIXME: Is random order OK?
-    const HashSet<Page*>& pages = Page::ordinaryPages();
+    const WillBePersistentHeapHashSet<RawPtrWillBeWeakMember<Page>>& pages = Page::ordinaryPages();
     for (const Page* otherPage : pages) {
         if (otherPage != page) {
             for (Frame* frame = otherPage->mainFrame(); frame; frame = frame->tree().traverseNext()) {
diff --git a/third_party/WebKit/Source/core/page/Page.cpp b/third_party/WebKit/Source/core/page/Page.cpp
index 91ea712a..3e893394 100644
--- a/third_party/WebKit/Source/core/page/Page.cpp
+++ b/third_party/WebKit/Source/core/page/Page.cpp
@@ -56,20 +56,19 @@
 namespace blink {
 
 // static
-HashSet<Page*>& Page::allPages()
+WillBePersistentHeapHashSet<RawPtrWillBeWeakMember<Page>>& Page::allPages()
 {
-    DEFINE_STATIC_LOCAL(HashSet<Page*>, allPages, ());
+    DEFINE_STATIC_LOCAL(WillBePersistentHeapHashSet<RawPtrWillBeWeakMember<Page>>, allPages, ());
     return allPages;
 }
 
 // static
-HashSet<Page*>& Page::ordinaryPages()
+WillBePersistentHeapHashSet<RawPtrWillBeWeakMember<Page>>& Page::ordinaryPages()
 {
-    DEFINE_STATIC_LOCAL(HashSet<Page*>, ordinaryPages, ());
+    DEFINE_STATIC_LOCAL(WillBePersistentHeapHashSet<RawPtrWillBeWeakMember<Page>>, ordinaryPages, ());
     return ordinaryPages;
 }
 
-
 void Page::networkStateChanged(bool online)
 {
     WillBeHeapVector<RefPtrWillBeMember<LocalFrame>> frames;
@@ -585,9 +584,9 @@
         toRemoteFrame(mainFrame.get())->setView(nullptr);
     }
 
+    ASSERT(allPages().contains(this));
     allPages().remove(this);
-    if (ordinaryPages().contains(this))
-        ordinaryPages().remove(this);
+    ordinaryPages().remove(this);
 
     if (m_scrollingCoordinator)
         m_scrollingCoordinator->willBeDestroyed();
diff --git a/third_party/WebKit/Source/core/page/Page.h b/third_party/WebKit/Source/core/page/Page.h
index 20db326..ec5f8def 100644
--- a/third_party/WebKit/Source/core/page/Page.h
+++ b/third_party/WebKit/Source/core/page/Page.h
@@ -100,9 +100,9 @@
 
     // This method returns all pages, incl. private ones associated with
     // inspector overlay, popups, SVGImage, etc.
-    static HashSet<Page*>& allPages();
+    static WillBePersistentHeapHashSet<RawPtrWillBeWeakMember<Page>>& allPages();
     // This method returns all ordinary pages.
-    static HashSet<Page*>& ordinaryPages();
+    static WillBePersistentHeapHashSet<RawPtrWillBeWeakMember<Page>>& ordinaryPages();
 
     FrameHost& frameHost() const { return *m_frameHost; }
 
diff --git a/third_party/WebKit/Source/core/page/ScopedPageLoadDeferrer.cpp b/third_party/WebKit/Source/core/page/ScopedPageLoadDeferrer.cpp
index ba7e5dd..c6f893f1 100644
--- a/third_party/WebKit/Source/core/page/ScopedPageLoadDeferrer.cpp
+++ b/third_party/WebKit/Source/core/page/ScopedPageLoadDeferrer.cpp
@@ -33,7 +33,7 @@
 
 ScopedPageLoadDeferrer::ScopedPageLoadDeferrer(Page* exclusion)
 {
-    const HashSet<Page*>& pages = Page::ordinaryPages();
+    const WillBePersistentHeapHashSet<RawPtrWillBeWeakMember<Page>>& pages = Page::ordinaryPages();
     for (const Page* page : pages) {
         if (page == exclusion || page->defersLoading())
             continue;
diff --git a/third_party/WebKit/Source/core/paint/BlockPainter.cpp b/third_party/WebKit/Source/core/paint/BlockPainter.cpp
index 4c08b5e..9227b4df 100644
--- a/third_party/WebKit/Source/core/paint/BlockPainter.cpp
+++ b/third_party/WebKit/Source/core/paint/BlockPainter.cpp
@@ -143,10 +143,10 @@
 
 void BlockPainter::paintObject(const PaintInfo& paintInfo, const LayoutPoint& paintOffset)
 {
-    if (RuntimeEnabledFeatures::slimmingPaintOffsetCachingEnabled() && m_layoutBlock.childrenInline() && !paintInfo.context->displayItemList()->skippingCache()) {
+    if (RuntimeEnabledFeatures::slimmingPaintOffsetCachingEnabled() && m_layoutBlock.childrenInline() && !paintInfo.context->paintController()->skippingCache()) {
         if (m_layoutBlock.paintOffsetChanged(paintOffset)) {
             LineBoxListPainter(m_layoutBlock.lineBoxes()).invalidateLineBoxPaintOffsets(paintInfo);
-            paintInfo.context->displayItemList()->invalidatePaintOffset(m_layoutBlock);
+            paintInfo.context->paintController()->invalidatePaintOffset(m_layoutBlock);
         }
         // Set previousPaintOffset here in case that m_layoutBlock paints nothing and no
         // LayoutObjectDrawingRecorder updates its previousPaintOffset.
diff --git a/third_party/WebKit/Source/core/paint/BoxClipper.cpp b/third_party/WebKit/Source/core/paint/BoxClipper.cpp
index e72609af..4e68812 100644
--- a/third_party/WebKit/Source/core/paint/BoxClipper.cpp
+++ b/third_party/WebKit/Source/core/paint/BoxClipper.cpp
@@ -11,7 +11,7 @@
 #include "platform/RuntimeEnabledFeatures.h"
 #include "platform/graphics/GraphicsLayer.h"
 #include "platform/graphics/paint/ClipDisplayItem.h"
-#include "platform/graphics/paint/DisplayItemList.h"
+#include "platform/graphics/paint/PaintController.h"
 
 namespace blink {
 
@@ -50,13 +50,13 @@
             return;
     }
 
-    ASSERT(m_paintInfo.context->displayItemList());
-    if (!m_paintInfo.context->displayItemList()->displayItemConstructionIsDisabled()) {
+    ASSERT(m_paintInfo.context->paintController());
+    if (!m_paintInfo.context->paintController()->displayItemConstructionIsDisabled()) {
         m_clipType = m_paintInfo.displayItemTypeForClipping();
         Vector<FloatRoundedRect> roundedRects;
         if (hasBorderRadius)
             roundedRects.append(clipRoundedRect);
-        m_paintInfo.context->displayItemList()->createAndAppend<ClipDisplayItem>(m_box, m_clipType, pixelSnappedIntRect(clipRect), roundedRects);
+        m_paintInfo.context->paintController()->createAndAppend<ClipDisplayItem>(m_box, m_clipType, pixelSnappedIntRect(clipRect), roundedRects);
     }
 }
 
@@ -66,8 +66,8 @@
         return;
 
     ASSERT(m_box.hasControlClip() || (m_box.hasOverflowClip() && !m_box.layer()->isSelfPaintingLayer()));
-    ASSERT(m_paintInfo.context->displayItemList());
-    m_paintInfo.context->displayItemList()->endItem<EndClipDisplayItem>(m_box, DisplayItem::clipTypeToEndClipType(m_clipType));
+    ASSERT(m_paintInfo.context->paintController());
+    m_paintInfo.context->paintController()->endItem<EndClipDisplayItem>(m_box, DisplayItem::clipTypeToEndClipType(m_clipType));
 }
 
 } // namespace blink
diff --git a/third_party/WebKit/Source/core/paint/CompositingRecorder.cpp b/third_party/WebKit/Source/core/paint/CompositingRecorder.cpp
index 0fb894e..e08a31c9 100644
--- a/third_party/WebKit/Source/core/paint/CompositingRecorder.cpp
+++ b/third_party/WebKit/Source/core/paint/CompositingRecorder.cpp
@@ -9,7 +9,7 @@
 #include "platform/graphics/GraphicsContext.h"
 #include "platform/graphics/GraphicsLayer.h"
 #include "platform/graphics/paint/CompositingDisplayItem.h"
-#include "platform/graphics/paint/DisplayItemList.h"
+#include "platform/graphics/paint/PaintController.h"
 
 namespace blink {
 
@@ -27,14 +27,14 @@
 
 void CompositingRecorder::beginCompositing(GraphicsContext& graphicsContext, const DisplayItemClientWrapper& client, const SkXfermode::Mode xferMode, const float opacity, const FloatRect* bounds, ColorFilter colorFilter)
 {
-    ASSERT(graphicsContext.displayItemList());
-    graphicsContext.displayItemList()->createAndAppend<BeginCompositingDisplayItem>(client, xferMode, opacity, bounds, colorFilter);
+    ASSERT(graphicsContext.paintController());
+    graphicsContext.paintController()->createAndAppend<BeginCompositingDisplayItem>(client, xferMode, opacity, bounds, colorFilter);
 }
 
 void CompositingRecorder::endCompositing(GraphicsContext& graphicsContext, const DisplayItemClientWrapper& client)
 {
-    ASSERT(graphicsContext.displayItemList());
-    graphicsContext.displayItemList()->endItem<EndCompositingDisplayItem>(client);
+    ASSERT(graphicsContext.paintController());
+    graphicsContext.paintController()->endItem<EndCompositingDisplayItem>(client);
 }
 
 } // namespace blink
diff --git a/third_party/WebKit/Source/core/paint/DisplayItemListPaintTest.cpp b/third_party/WebKit/Source/core/paint/DisplayItemListPaintTest.cpp
deleted file mode 100644
index 2efebc7..0000000
--- a/third_party/WebKit/Source/core/paint/DisplayItemListPaintTest.cpp
+++ /dev/null
@@ -1,149 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "config.h"
-#include "core/paint/DisplayItemListPaintTest.h"
-
-#include "core/layout/LayoutText.h"
-#include "core/layout/line/InlineTextBox.h"
-#include "core/page/FocusController.h"
-#include "core/paint/LayoutObjectDrawingRecorder.h"
-#include "core/paint/PaintLayerPainter.h"
-#include "platform/graphics/GraphicsContext.h"
-#include "platform/graphics/paint/DrawingDisplayItem.h"
-
-namespace blink {
-
-TEST_F(DisplayItemListPaintTest, FullDocumentPaintingWithCaret)
-{
-    setBodyInnerHTML("<div id='div' contentEditable='true' style='outline:none'>XYZ</div>");
-    document().page()->focusController().setActive(true);
-    document().page()->focusController().setFocused(true);
-    PaintLayer& rootLayer = *layoutView().layer();
-    Element& div = *toElement(document().body()->firstChild());
-    LayoutObject& divLayoutObject = *document().body()->firstChild()->layoutObject();
-    InlineTextBox& textInlineBox = *toLayoutText(div.firstChild()->layoutObject())->firstTextBox();
-
-    GraphicsContext context(&rootDisplayItemList());
-    PaintLayerPaintingInfo paintingInfo(&rootLayer, LayoutRect(0, 0, 800, 600), GlobalPaintNormalPhase, LayoutSize());
-    PaintLayerPainter(rootLayer).paintLayerContents(&context, paintingInfo, PaintLayerPaintingCompositingAllPhases);
-    rootDisplayItemList().commitNewDisplayItems();
-
-    EXPECT_DISPLAY_LIST(rootDisplayItemList().displayItems(), 2,
-        TestDisplayItem(layoutView(), backgroundType),
-        TestDisplayItem(textInlineBox, foregroundType));
-
-    div.focus();
-    document().view()->updateAllLifecyclePhases();
-    EXPECT_TRUE(rootDisplayItemList().clientCacheIsValid(layoutView().displayItemClient()));
-    EXPECT_FALSE(rootDisplayItemList().clientCacheIsValid(divLayoutObject.displayItemClient()));
-    EXPECT_TRUE(rootDisplayItemList().clientCacheIsValid(textInlineBox.displayItemClient()));
-    PaintLayerPainter(rootLayer).paintLayerContents(&context, paintingInfo, PaintLayerPaintingCompositingAllPhases);
-    rootDisplayItemList().commitNewDisplayItems();
-
-    EXPECT_DISPLAY_LIST(rootDisplayItemList().displayItems(), 3,
-        TestDisplayItem(layoutView(), backgroundType),
-        TestDisplayItem(textInlineBox, foregroundType),
-        TestDisplayItem(divLayoutObject, DisplayItem::Caret)); // New!
-}
-
-TEST_F(DisplayItemListPaintTest, InlineRelayout)
-{
-    setBodyInnerHTML("<div id='div' style='width:100px; height: 200px'>AAAAAAAAAA BBBBBBBBBB</div>");
-    PaintLayer& rootLayer = *layoutView().layer();
-    Element& div = *toElement(document().body()->firstChild());
-    LayoutBlock& divBlock = *toLayoutBlock(document().body()->firstChild()->layoutObject());
-    LayoutText& text = *toLayoutText(divBlock.firstChild());
-    InlineTextBox& firstTextBox = *text.firstTextBox();
-    DisplayItemClient firstTextBoxDisplayItemClient = firstTextBox.displayItemClient();
-
-    GraphicsContext context(&rootDisplayItemList());
-    PaintLayerPaintingInfo paintingInfo(&rootLayer, LayoutRect(0, 0, 800, 600), GlobalPaintNormalPhase, LayoutSize());
-    PaintLayerPainter(rootLayer).paintLayerContents(&context, paintingInfo, PaintLayerPaintingCompositingAllPhases);
-    rootDisplayItemList().commitNewDisplayItems();
-
-    EXPECT_DISPLAY_LIST(rootDisplayItemList().displayItems(), 2,
-        TestDisplayItem(layoutView(), backgroundType),
-        TestDisplayItem(firstTextBox, foregroundType));
-
-    div.setAttribute(HTMLNames::styleAttr, "width: 10px; height: 200px");
-    document().view()->updateAllLifecyclePhases();
-    EXPECT_TRUE(rootDisplayItemList().clientCacheIsValid(layoutView().displayItemClient()));
-    EXPECT_FALSE(rootDisplayItemList().clientCacheIsValid(divBlock.displayItemClient()));
-    EXPECT_FALSE(rootDisplayItemList().clientCacheIsValid(firstTextBoxDisplayItemClient));
-    PaintLayerPainter(rootLayer).paintLayerContents(&context, paintingInfo, PaintLayerPaintingCompositingAllPhases);
-    rootDisplayItemList().commitNewDisplayItems();
-
-    LayoutText& newText = *toLayoutText(divBlock.firstChild());
-    InlineTextBox& newFirstTextBox = *newText.firstTextBox();
-    InlineTextBox& secondTextBox = *newText.firstTextBox()->nextTextBox();
-
-    EXPECT_DISPLAY_LIST(rootDisplayItemList().displayItems(), 3,
-        TestDisplayItem(layoutView(), backgroundType),
-        TestDisplayItem(newFirstTextBox, foregroundType),
-        TestDisplayItem(secondTextBox, foregroundType));
-}
-
-TEST_F(DisplayItemListPaintTestForSlimmingPaintV2, FullDocumentPaintingWithCaret)
-{
-    setBodyInnerHTML("<div id='div' contentEditable='true' style='outline:none'>XYZ</div>");
-    document().page()->focusController().setActive(true);
-    document().page()->focusController().setFocused(true);
-    PaintLayer& rootLayer = *layoutView().layer();
-    Element& div = *toElement(document().body()->firstChild());
-    LayoutObject& divLayoutObject = *document().body()->firstChild()->layoutObject();
-    InlineTextBox& textInlineBox = *toLayoutText(div.firstChild()->layoutObject())->firstTextBox();
-
-    document().view()->updateAllLifecyclePhases();
-
-    EXPECT_DISPLAY_LIST(rootDisplayItemList().displayItems(), 4,
-        TestDisplayItem(layoutView(), backgroundType),
-        TestDisplayItem(rootLayer, subsequenceType),
-        TestDisplayItem(textInlineBox, foregroundType),
-        TestDisplayItem(rootLayer, endSubsequenceType));
-
-    div.focus();
-    document().view()->updateAllLifecyclePhases();
-
-    EXPECT_DISPLAY_LIST(rootDisplayItemList().displayItems(), 5,
-        TestDisplayItem(layoutView(), backgroundType),
-        TestDisplayItem(rootLayer, subsequenceType),
-        TestDisplayItem(textInlineBox, foregroundType),
-        TestDisplayItem(divLayoutObject, DisplayItem::Caret), // New!
-        TestDisplayItem(rootLayer, endSubsequenceType));
-}
-
-TEST_F(DisplayItemListPaintTestForSlimmingPaintV2, InlineRelayout)
-{
-    setBodyInnerHTML("<div id='div' style='width:100px; height: 200px'>AAAAAAAAAA BBBBBBBBBB</div>");
-    PaintLayer& rootLayer = *layoutView().layer();
-    Element& div = *toElement(document().body()->firstChild());
-    LayoutBlock& divBlock = *toLayoutBlock(document().body()->firstChild()->layoutObject());
-    LayoutText& text = *toLayoutText(divBlock.firstChild());
-    InlineTextBox& firstTextBox = *text.firstTextBox();
-
-    document().view()->updateAllLifecyclePhases();
-
-    EXPECT_DISPLAY_LIST(rootDisplayItemList().displayItems(), 4,
-        TestDisplayItem(layoutView(), backgroundType),
-        TestDisplayItem(rootLayer, subsequenceType),
-        TestDisplayItem(firstTextBox, foregroundType),
-        TestDisplayItem(rootLayer, endSubsequenceType));
-
-    div.setAttribute(HTMLNames::styleAttr, "width: 10px; height: 200px");
-    document().view()->updateAllLifecyclePhases();
-
-    LayoutText& newText = *toLayoutText(divBlock.firstChild());
-    InlineTextBox& newFirstTextBox = *newText.firstTextBox();
-    InlineTextBox& secondTextBox = *newText.firstTextBox()->nextTextBox();
-
-    EXPECT_DISPLAY_LIST(rootDisplayItemList().displayItems(), 5,
-        TestDisplayItem(layoutView(), backgroundType),
-        TestDisplayItem(rootLayer, subsequenceType),
-        TestDisplayItem(newFirstTextBox, foregroundType),
-        TestDisplayItem(secondTextBox, foregroundType),
-        TestDisplayItem(rootLayer, endSubsequenceType));
-}
-
-} // namespace blink
diff --git a/third_party/WebKit/Source/core/paint/DisplayItemListPaintTest.h b/third_party/WebKit/Source/core/paint/DisplayItemListPaintTest.h
deleted file mode 100644
index 0355fa2..0000000
--- a/third_party/WebKit/Source/core/paint/DisplayItemListPaintTest.h
+++ /dev/null
@@ -1,132 +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 DisplayItemListPaintTest_h
-#define DisplayItemListPaintTest_h
-
-#include "core/frame/FrameView.h"
-#include "core/layout/LayoutTestHelper.h"
-#include "core/layout/LayoutView.h"
-#include "core/paint/PaintLayer.h"
-#include "platform/graphics/GraphicsLayer.h"
-#include <gtest/gtest.h>
-
-namespace blink {
-
-class DisplayItemListPaintTest : public RenderingTest {
-public:
-    DisplayItemListPaintTest()
-        : m_originalSlimmingPaintSubsequenceCachingEnabled(RuntimeEnabledFeatures::slimmingPaintSubsequenceCachingEnabled())
-        , m_originalSlimmingPaintOffsetCachingEnabled(RuntimeEnabledFeatures::slimmingPaintOffsetCachingEnabled())
-        { }
-
-protected:
-    LayoutView& layoutView() { return *document().layoutView(); }
-    DisplayItemList& rootDisplayItemList() { return *layoutView().layer()->graphicsLayerBacking()->displayItemList(); }
-
-private:
-    void SetUp() override
-    {
-        RenderingTest::SetUp();
-        enableCompositing();
-    }
-    void TearDown() override
-    {
-        RuntimeEnabledFeatures::setSlimmingPaintSubsequenceCachingEnabled(m_originalSlimmingPaintSubsequenceCachingEnabled);
-        RuntimeEnabledFeatures::setSlimmingPaintOffsetCachingEnabled(m_originalSlimmingPaintOffsetCachingEnabled);
-    }
-
-    bool m_originalSlimmingPaintSubsequenceCachingEnabled;
-    bool m_originalSlimmingPaintOffsetCachingEnabled;
-};
-
-// Slimming paint v2 has subtly different behavior on some paint tests. This
-// class is used to test only v2 behavior while maintaining v1 test coverage.
-class DisplayItemListPaintTestForSlimmingPaintV2 : public RenderingTest {
-public:
-    DisplayItemListPaintTestForSlimmingPaintV2()
-        : m_originalSlimmingPaintV2Enabled(RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { }
-
-protected:
-    LayoutView& layoutView() { return *document().layoutView(); }
-    DisplayItemList& rootDisplayItemList() { return *layoutView().layer()->graphicsLayerBacking()->displayItemList(); }
-    void setNeedsDisplayForRoot()
-    {
-        layoutView().layer()->graphicsLayerBacking()->setNeedsDisplay();
-    }
-    void setNeedsDisplayWithoutInvalidationForRoot()
-    {
-        layoutView().layer()->graphicsLayerBacking()->setNeedsDisplayWithoutInvalidateForTesting();
-    }
-
-    // Expose some document lifecycle steps for checking new display items before commiting.
-    void updateLifecyclePhasesToPaintClean(const LayoutRect& interestRect = LayoutRect(LayoutRect::infiniteIntRect()))
-    {
-        document().view()->updateLifecyclePhasesInternal(FrameView::OnlyUpToCompositingCleanPlusScrolling, nullptr);
-        document().view()->invalidateTreeIfNeededRecursive();
-        document().view()->updatePaintProperties();
-        document().view()->synchronizedPaint(&interestRect);
-    }
-    void compositeForSlimmingPaintV2() { document().view()->compositeForSlimmingPaintV2(); }
-
-private:
-    void SetUp() override
-    {
-        RuntimeEnabledFeatures::setSlimmingPaintV2Enabled(true);
-
-        RenderingTest::SetUp();
-        enableCompositing();
-        GraphicsLayer::setDrawDebugRedFillForTesting(false);
-    }
-
-    void TearDown() override
-    {
-        GraphicsLayer::setDrawDebugRedFillForTesting(true);
-        RuntimeEnabledFeatures::setSlimmingPaintV2Enabled(m_originalSlimmingPaintV2Enabled);
-    }
-
-    bool m_originalSlimmingPaintV2Enabled;
-};
-
-class TestDisplayItem final : public DisplayItem {
-public:
-    TestDisplayItem(const DisplayItemClientWrapper& client, Type type) : DisplayItem(client, type, sizeof(*this)) { }
-
-    void replay(GraphicsContext&) const final { ASSERT_NOT_REACHED(); }
-    void appendToWebDisplayItemList(WebDisplayItemList*) const final { ASSERT_NOT_REACHED(); }
-};
-
-#ifndef NDEBUG
-#define TRACE_DISPLAY_ITEMS(i, expected, actual) \
-    String trace = String::format("%d: ", (int)i) + "Expected: " + (expected).asDebugString() + " Actual: " + (actual).asDebugString(); \
-    SCOPED_TRACE(trace.utf8().data());
-#else
-#define TRACE_DISPLAY_ITEMS(i, expected, actual)
-#endif
-
-#define EXPECT_DISPLAY_LIST(actual, expectedSize, ...) \
-    do { \
-        EXPECT_EQ((size_t)expectedSize, actual.size()); \
-        if (expectedSize != actual.size()) \
-            break; \
-        const TestDisplayItem expected[] = { __VA_ARGS__ }; \
-        for (size_t index = 0; index < std::min<size_t>(actual.size(), expectedSize); index++) { \
-            TRACE_DISPLAY_ITEMS(index, expected[index], actual[index]); \
-            EXPECT_EQ(expected[index].client(), actual[index].client()); \
-            EXPECT_EQ(expected[index].type(), actual[index].type()); \
-        } \
-    } while (false);
-
-// Shorter names for frequently used display item types in tests.
-const DisplayItem::Type backgroundType = DisplayItem::BoxDecorationBackground;
-const DisplayItem::Type cachedBackgroundType = DisplayItem::drawingTypeToCachedDrawingType(backgroundType);
-const DisplayItem::Type foregroundType = DisplayItem::paintPhaseToDrawingType(PaintPhaseForeground);
-const DisplayItem::Type cachedForegroundType = DisplayItem::drawingTypeToCachedDrawingType(foregroundType);
-const DisplayItem::Type subsequenceType = DisplayItem::SubsequenceNormalFlowAndPositiveZOrder;
-const DisplayItem::Type endSubsequenceType = DisplayItem::subsequenceTypeToEndSubsequenceType(subsequenceType);
-const DisplayItem::Type cachedSubsequenceType = DisplayItem::subsequenceTypeToCachedSubsequenceType(subsequenceType);
-
-} // namespace blink
-
-#endif // DisplayItemListPaintTest_h
diff --git a/third_party/WebKit/Source/core/paint/FilterPainter.cpp b/third_party/WebKit/Source/core/paint/FilterPainter.cpp
index ddd978b..7eae1854 100644
--- a/third_party/WebKit/Source/core/paint/FilterPainter.cpp
+++ b/third_party/WebKit/Source/core/paint/FilterPainter.cpp
@@ -13,8 +13,8 @@
 #include "platform/graphics/GraphicsLayer.h"
 #include "platform/graphics/filters/FilterEffect.h"
 #include "platform/graphics/filters/SkiaImageFilterBuilder.h"
-#include "platform/graphics/paint/DisplayItemList.h"
 #include "platform/graphics/paint/FilterDisplayItem.h"
+#include "platform/graphics/paint/PaintController.h"
 #include "public/platform/Platform.h"
 #include "public/platform/WebCompositorSupport.h"
 #include "public/platform/WebFilterOperations.h"
@@ -57,8 +57,8 @@
     }
 
     ASSERT(m_layoutObject);
-    ASSERT(context->displayItemList());
-    if (!context->displayItemList()->displayItemConstructionIsDisabled()) {
+    ASSERT(context->paintController());
+    if (!context->paintController()->displayItemConstructionIsDisabled()) {
         FilterOperations filterOperations(layer.computeFilterOperations(m_layoutObject->styleRef()));
         OwnPtr<WebFilterOperations> webFilterOperations = adoptPtr(Platform::current()->compositorSupport()->createFilterOperations());
         builder.buildFilterOperations(filterOperations, webFilterOperations.get());
@@ -68,7 +68,7 @@
         // the layer's filter. See crbug.com/502026.
         if (webFilterOperations->isEmpty())
             return;
-        context->displayItemList()->createAndAppend<BeginFilterDisplayItem>(*m_layoutObject, imageFilter, FloatRect(rootRelativeBounds), webFilterOperations.release());
+        context->paintController()->createAndAppend<BeginFilterDisplayItem>(*m_layoutObject, imageFilter, FloatRect(rootRelativeBounds), webFilterOperations.release());
     }
 
     m_filterInProgress = true;
@@ -79,8 +79,8 @@
     if (!m_filterInProgress)
         return;
 
-    ASSERT(m_context->displayItemList());
-    m_context->displayItemList()->endItem<EndFilterDisplayItem>(*m_layoutObject);
+    ASSERT(m_context->paintController());
+    m_context->paintController()->endItem<EndFilterDisplayItem>(*m_layoutObject);
 }
 
 } // namespace blink
diff --git a/third_party/WebKit/Source/core/paint/FloatClipRecorder.cpp b/third_party/WebKit/Source/core/paint/FloatClipRecorder.cpp
index 5e534ed..1c2cc16 100644
--- a/third_party/WebKit/Source/core/paint/FloatClipRecorder.cpp
+++ b/third_party/WebKit/Source/core/paint/FloatClipRecorder.cpp
@@ -6,8 +6,8 @@
 #include "core/paint/FloatClipRecorder.h"
 
 #include "platform/graphics/GraphicsContext.h"
-#include "platform/graphics/paint/DisplayItemList.h"
 #include "platform/graphics/paint/FloatClipDisplayItem.h"
+#include "platform/graphics/paint/PaintController.h"
 
 namespace blink {
 
@@ -16,15 +16,15 @@
     , m_client(client)
     , m_clipType(DisplayItem::paintPhaseToFloatClipType(paintPhase))
 {
-    ASSERT(m_context.displayItemList());
-    m_context.displayItemList()->createAndAppend<FloatClipDisplayItem>(m_client, m_clipType, clipRect);
+    ASSERT(m_context.paintController());
+    m_context.paintController()->createAndAppend<FloatClipDisplayItem>(m_client, m_clipType, clipRect);
 }
 
 FloatClipRecorder::~FloatClipRecorder()
 {
     DisplayItem::Type endType = DisplayItem::floatClipTypeToEndFloatClipType(m_clipType);
-    ASSERT(m_context.displayItemList());
-    m_context.displayItemList()->endItem<EndFloatClipDisplayItem>(m_client, endType);
+    ASSERT(m_context.paintController());
+    m_context.paintController()->endItem<EndFloatClipDisplayItem>(m_client, endType);
 }
 
 } // namespace blink
diff --git a/third_party/WebKit/Source/core/paint/InlinePainter.cpp b/third_party/WebKit/Source/core/paint/InlinePainter.cpp
index 07874e78..a9486a7 100644
--- a/third_party/WebKit/Source/core/paint/InlinePainter.cpp
+++ b/third_party/WebKit/Source/core/paint/InlinePainter.cpp
@@ -21,9 +21,9 @@
 
 void InlinePainter::paint(const PaintInfo& paintInfo, const LayoutPoint& paintOffset)
 {
-    if (RuntimeEnabledFeatures::slimmingPaintOffsetCachingEnabled() && !paintInfo.context->displayItemList()->skippingCache()) {
+    if (RuntimeEnabledFeatures::slimmingPaintOffsetCachingEnabled() && !paintInfo.context->paintController()->skippingCache()) {
         if (m_layoutInline.paintOffsetChanged(paintOffset)) {
-            paintInfo.context->displayItemList()->invalidatePaintOffset(m_layoutInline);
+            paintInfo.context->paintController()->invalidatePaintOffset(m_layoutInline);
             LineBoxListPainter(*m_layoutInline.lineBoxes()).invalidateLineBoxPaintOffsets(paintInfo);
         }
         // Set previousPaintOffset here in case that m_layoutInline paints nothing and no
diff --git a/third_party/WebKit/Source/core/paint/LayerClipRecorder.cpp b/third_party/WebKit/Source/core/paint/LayerClipRecorder.cpp
index 91579e11..809ca486 100644
--- a/third_party/WebKit/Source/core/paint/LayerClipRecorder.cpp
+++ b/third_party/WebKit/Source/core/paint/LayerClipRecorder.cpp
@@ -12,7 +12,7 @@
 #include "platform/graphics/GraphicsContext.h"
 #include "platform/graphics/GraphicsLayer.h"
 #include "platform/graphics/paint/ClipRecorder.h"
-#include "platform/graphics/paint/DisplayItemList.h"
+#include "platform/graphics/paint/PaintController.h"
 
 namespace blink {
 
@@ -28,8 +28,8 @@
         collectRoundedRectClips(*layoutObject.layer(), *localPaintingInfo, graphicsContext, fragmentOffset, paintFlags, rule, roundedRects);
     }
 
-    ASSERT(m_graphicsContext.displayItemList());
-    m_graphicsContext.displayItemList()->createAndAppend<ClipDisplayItem>(layoutObject, m_clipType, snappedClipRect, roundedRects);
+    ASSERT(m_graphicsContext.paintController());
+    m_graphicsContext.paintController()->createAndAppend<ClipDisplayItem>(layoutObject, m_clipType, snappedClipRect, roundedRects);
 }
 
 static bool inContainingBlockChain(PaintLayer* startLayer, PaintLayer* endLayer)
@@ -73,8 +73,8 @@
 
 LayerClipRecorder::~LayerClipRecorder()
 {
-    ASSERT(m_graphicsContext.displayItemList());
-    m_graphicsContext.displayItemList()->endItem<EndClipDisplayItem>(m_layoutObject, DisplayItem::clipTypeToEndClipType(m_clipType));
+    ASSERT(m_graphicsContext.paintController());
+    m_graphicsContext.paintController()->endItem<EndClipDisplayItem>(m_layoutObject, DisplayItem::clipTypeToEndClipType(m_clipType));
 }
 
 } // namespace blink
diff --git a/third_party/WebKit/Source/core/paint/LayerClipRecorderTest.cpp b/third_party/WebKit/Source/core/paint/LayerClipRecorderTest.cpp
index 53153a9..59591db 100644
--- a/third_party/WebKit/Source/core/paint/LayerClipRecorderTest.cpp
+++ b/third_party/WebKit/Source/core/paint/LayerClipRecorderTest.cpp
@@ -12,7 +12,7 @@
 #include "core/paint/PaintLayer.h"
 #include "platform/graphics/GraphicsContext.h"
 #include "platform/graphics/GraphicsLayer.h"
-#include "platform/graphics/paint/DisplayItemList.h"
+#include "platform/graphics/paint/PaintController.h"
 #include <gtest/gtest.h>
 
 namespace blink {
@@ -25,7 +25,7 @@
 
 protected:
     LayoutView& layoutView() { return *m_layoutView; }
-    DisplayItemList& rootDisplayItemList() { return *layoutView().layer()->graphicsLayerBacking()->displayItemList(); }
+    PaintController& rootPaintController() { return *layoutView().layer()->graphicsLayerBacking()->paintController(); }
 
 private:
     void SetUp() override
@@ -60,26 +60,26 @@
 
 TEST_F(LayerClipRecorderTest, Single)
 {
-    GraphicsContext context(&rootDisplayItemList());
+    GraphicsContext context(&rootPaintController());
     LayoutRect bound = layoutView().viewRect();
-    EXPECT_EQ((size_t)0, rootDisplayItemList().displayItems().size());
+    EXPECT_EQ((size_t)0, rootPaintController().displayItems().size());
 
     drawRectInClip(context, layoutView(), PaintPhaseForeground, bound);
-    rootDisplayItemList().commitNewDisplayItems();
-    EXPECT_EQ((size_t)3, rootDisplayItemList().displayItems().size());
-    EXPECT_TRUE(DisplayItem::isClipType(rootDisplayItemList().displayItems()[0].type()));
-    EXPECT_TRUE(DisplayItem::isDrawingType(rootDisplayItemList().displayItems()[1].type()));
-    EXPECT_TRUE(DisplayItem::isEndClipType(rootDisplayItemList().displayItems()[2].type()));
+    rootPaintController().commitNewDisplayItems();
+    EXPECT_EQ((size_t)3, rootPaintController().displayItems().size());
+    EXPECT_TRUE(DisplayItem::isClipType(rootPaintController().displayItems()[0].type()));
+    EXPECT_TRUE(DisplayItem::isDrawingType(rootPaintController().displayItems()[1].type()));
+    EXPECT_TRUE(DisplayItem::isEndClipType(rootPaintController().displayItems()[2].type()));
 }
 
 TEST_F(LayerClipRecorderTest, Empty)
 {
-    GraphicsContext context(&rootDisplayItemList());
-    EXPECT_EQ((size_t)0, rootDisplayItemList().displayItems().size());
+    GraphicsContext context(&rootPaintController());
+    EXPECT_EQ((size_t)0, rootPaintController().displayItems().size());
 
     drawEmptyClip(context, layoutView(), PaintPhaseForeground);
-    rootDisplayItemList().commitNewDisplayItems();
-    EXPECT_EQ((size_t)0, rootDisplayItemList().displayItems().size());
+    rootPaintController().commitNewDisplayItems();
+    EXPECT_EQ((size_t)0, rootPaintController().displayItems().size());
 }
 
 }
diff --git a/third_party/WebKit/Source/core/paint/LayerFixedPositionRecorder.cpp b/third_party/WebKit/Source/core/paint/LayerFixedPositionRecorder.cpp
index 8ef3fc1..551acd3 100644
--- a/third_party/WebKit/Source/core/paint/LayerFixedPositionRecorder.cpp
+++ b/third_party/WebKit/Source/core/paint/LayerFixedPositionRecorder.cpp
@@ -8,9 +8,9 @@
 #include "core/layout/LayoutBoxModelObject.h"
 #include "platform/RuntimeEnabledFeatures.h"
 #include "platform/graphics/GraphicsContext.h"
-#include "platform/graphics/paint/DisplayItemList.h"
 #include "platform/graphics/paint/FixedPositionContainerDisplayItem.h"
 #include "platform/graphics/paint/FixedPositionDisplayItem.h"
+#include "platform/graphics/paint/PaintController.h"
 
 namespace blink {
 
@@ -24,13 +24,13 @@
         return;
 
     if (m_isFixedPosition)
-        m_graphicsContext.displayItemList()->createAndAppend<BeginFixedPositionDisplayItem>(m_layoutObject);
+        m_graphicsContext.paintController()->createAndAppend<BeginFixedPositionDisplayItem>(m_layoutObject);
 
     // TODO(trchen): Adding a pair of display items on every transformed
     // element can be expensive. Investigate whether we can optimize out some
     // of them if applicable.
     if (m_isFixedPositionContainer)
-        m_graphicsContext.displayItemList()->createAndAppend<BeginFixedPositionContainerDisplayItem>(m_layoutObject);
+        m_graphicsContext.paintController()->createAndAppend<BeginFixedPositionContainerDisplayItem>(m_layoutObject);
 }
 
 LayerFixedPositionRecorder::~LayerFixedPositionRecorder()
@@ -38,11 +38,11 @@
     if (!RuntimeEnabledFeatures::slimmingPaintV2Enabled())
         return;
 
-    ASSERT(m_graphicsContext.displayItemList());
+    ASSERT(m_graphicsContext.paintController());
     if (m_isFixedPositionContainer)
-        m_graphicsContext.displayItemList()->endItem<EndFixedPositionDisplayItem>(m_layoutObject);
+        m_graphicsContext.paintController()->endItem<EndFixedPositionDisplayItem>(m_layoutObject);
     if (m_isFixedPosition)
-        m_graphicsContext.displayItemList()->endItem<EndFixedPositionDisplayItem>(m_layoutObject);
+        m_graphicsContext.paintController()->endItem<EndFixedPositionDisplayItem>(m_layoutObject);
 }
 
 } // namespace blink
diff --git a/third_party/WebKit/Source/core/paint/LayoutObjectDrawingRecorder.h b/third_party/WebKit/Source/core/paint/LayoutObjectDrawingRecorder.h
index 394bd7c..d904957d 100644
--- a/third_party/WebKit/Source/core/paint/LayoutObjectDrawingRecorder.h
+++ b/third_party/WebKit/Source/core/paint/LayoutObjectDrawingRecorder.h
@@ -38,7 +38,7 @@
 
     LayoutObjectDrawingRecorder(GraphicsContext& context, const LayoutObject& layoutObject, DisplayItem::Type displayItemType, const FloatRect& clip, const LayoutPoint& paintOffset)
     {
-        updatePaintOffsetIfNeeded(context.displayItemList(), layoutObject, paintOffset);
+        updatePaintOffsetIfNeeded(context.paintController(), layoutObject, paintOffset);
         // We may paint a delayed-invalidation object before it's actually invalidated.
         if (layoutObject.fullPaintInvalidationReason() == PaintInvalidationDelayedFull)
             m_cacheSkipper.emplace(context);
@@ -62,15 +62,15 @@
 #endif
 
 private:
-    static void updatePaintOffsetIfNeeded(DisplayItemList* displayItemList, const LayoutObject& layoutObject, const LayoutPoint& paintOffset)
+    static void updatePaintOffsetIfNeeded(PaintController* paintController, const LayoutObject& layoutObject, const LayoutPoint& paintOffset)
     {
-        if (!RuntimeEnabledFeatures::slimmingPaintOffsetCachingEnabled() || displayItemList->skippingCache())
+        if (!RuntimeEnabledFeatures::slimmingPaintOffsetCachingEnabled() || paintController->skippingCache())
             return;
 
         if (layoutObject.paintOffsetChanged(paintOffset))
-            displayItemList->invalidatePaintOffset(layoutObject);
+            paintController->invalidatePaintOffset(layoutObject);
         else
-            ASSERT(!displayItemList->paintOffsetWasInvalidated(layoutObject.displayItemClient()) || !displayItemList->clientCacheIsValid(layoutObject.displayItemClient()));
+            ASSERT(!paintController->paintOffsetWasInvalidated(layoutObject.displayItemClient()) || !paintController->clientCacheIsValid(layoutObject.displayItemClient()));
 
         layoutObject.mutableForPainting().setPreviousPaintOffset(paintOffset);
     }
diff --git a/third_party/WebKit/Source/core/paint/LayoutObjectDrawingRecorderTest.cpp b/third_party/WebKit/Source/core/paint/LayoutObjectDrawingRecorderTest.cpp
index 3cf0adf..a893aa5 100644
--- a/third_party/WebKit/Source/core/paint/LayoutObjectDrawingRecorderTest.cpp
+++ b/third_party/WebKit/Source/core/paint/LayoutObjectDrawingRecorderTest.cpp
@@ -7,18 +7,18 @@
 
 #include "core/layout/LayoutTestHelper.h"
 #include "core/layout/LayoutView.h"
-#include "core/paint/DisplayItemListPaintTest.h"
+#include "core/paint/PaintControllerPaintTest.h"
 #include "core/paint/PaintLayer.h"
 #include "platform/graphics/GraphicsContext.h"
 #include "platform/graphics/GraphicsLayer.h"
-#include "platform/graphics/paint/DisplayItemList.h"
 #include "platform/graphics/paint/DrawingDisplayItem.h"
+#include "platform/graphics/paint/PaintController.h"
 #include <gtest/gtest.h>
 
 namespace blink {
 
-using LayoutObjectDrawingRecorderTest = DisplayItemListPaintTest;
-using LayoutObjectDrawingRecorderTestForSlimmingPaintV2 = DisplayItemListPaintTestForSlimmingPaintV2;
+using LayoutObjectDrawingRecorderTest = PaintControllerPaintTest;
+using LayoutObjectDrawingRecorderTestForSlimmingPaintV2 = PaintControllerPaintTestForSlimmingPaintV2;
 
 namespace {
 
@@ -41,66 +41,66 @@
 
 TEST_F(LayoutObjectDrawingRecorderTest, Nothing)
 {
-    GraphicsContext context(&rootDisplayItemList());
+    GraphicsContext context(&rootPaintController());
     LayoutRect bound = layoutView().viewRect();
-    EXPECT_EQ((size_t)0, rootDisplayItemList().displayItems().size());
+    EXPECT_EQ((size_t)0, rootPaintController().displayItems().size());
 
     drawNothing(context, layoutView(), PaintPhaseForeground, bound);
-    rootDisplayItemList().commitNewDisplayItems();
-    EXPECT_DISPLAY_LIST(rootDisplayItemList().displayItems(), 1,
+    rootPaintController().commitNewDisplayItems();
+    EXPECT_DISPLAY_LIST(rootPaintController().displayItems(), 1,
         TestDisplayItem(layoutView(), DisplayItem::paintPhaseToDrawingType(PaintPhaseForeground)));
-    EXPECT_FALSE(static_cast<const DrawingDisplayItem&>(rootDisplayItemList().displayItems()[0]).picture());
+    EXPECT_FALSE(static_cast<const DrawingDisplayItem&>(rootPaintController().displayItems()[0]).picture());
 }
 
 TEST_F(LayoutObjectDrawingRecorderTest, Rect)
 {
-    GraphicsContext context(&rootDisplayItemList());
+    GraphicsContext context(&rootPaintController());
     LayoutRect bound = layoutView().viewRect();
     drawRect(context, layoutView(), PaintPhaseForeground, bound);
-    rootDisplayItemList().commitNewDisplayItems();
-    EXPECT_DISPLAY_LIST(rootDisplayItemList().displayItems(), 1,
+    rootPaintController().commitNewDisplayItems();
+    EXPECT_DISPLAY_LIST(rootPaintController().displayItems(), 1,
         TestDisplayItem(layoutView(), DisplayItem::paintPhaseToDrawingType(PaintPhaseForeground)));
 }
 
 TEST_F(LayoutObjectDrawingRecorderTest, Cached)
 {
-    GraphicsContext context(&rootDisplayItemList());
+    GraphicsContext context(&rootPaintController());
     LayoutRect bound = layoutView().viewRect();
     drawNothing(context, layoutView(), PaintPhaseBlockBackground, bound);
     drawRect(context, layoutView(), PaintPhaseForeground, bound);
-    rootDisplayItemList().commitNewDisplayItems();
+    rootPaintController().commitNewDisplayItems();
 
-    EXPECT_DISPLAY_LIST(rootDisplayItemList().displayItems(), 2,
+    EXPECT_DISPLAY_LIST(rootPaintController().displayItems(), 2,
         TestDisplayItem(layoutView(), DisplayItem::paintPhaseToDrawingType(PaintPhaseBlockBackground)),
         TestDisplayItem(layoutView(), DisplayItem::paintPhaseToDrawingType(PaintPhaseForeground)));
 
     drawNothing(context, layoutView(), PaintPhaseBlockBackground, bound);
     drawRect(context, layoutView(), PaintPhaseForeground, bound);
 
-    EXPECT_DISPLAY_LIST(rootDisplayItemList().newDisplayItems(), 2,
+    EXPECT_DISPLAY_LIST(rootPaintController().newDisplayItems(), 2,
         TestDisplayItem(layoutView(), DisplayItem::drawingTypeToCachedDrawingType(DisplayItem::paintPhaseToDrawingType(PaintPhaseBlockBackground))),
         TestDisplayItem(layoutView(), DisplayItem::drawingTypeToCachedDrawingType(DisplayItem::paintPhaseToDrawingType(PaintPhaseForeground))));
 
-    rootDisplayItemList().commitNewDisplayItems();
+    rootPaintController().commitNewDisplayItems();
 
-    EXPECT_DISPLAY_LIST(rootDisplayItemList().displayItems(), 2,
+    EXPECT_DISPLAY_LIST(rootPaintController().displayItems(), 2,
         TestDisplayItem(layoutView(), DisplayItem::paintPhaseToDrawingType(PaintPhaseBlockBackground)),
         TestDisplayItem(layoutView(), DisplayItem::paintPhaseToDrawingType(PaintPhaseForeground)));
 }
 
 template <typename T>
-FloatRect drawAndGetCullRect(DisplayItemList& list, const LayoutObject& layoutObject, const T& bounds)
+FloatRect drawAndGetCullRect(PaintController& controller, const LayoutObject& layoutObject, const T& bounds)
 {
-    list.invalidateAll();
+    controller.invalidateAll();
     {
         // Draw some things which will produce a non-null picture.
-        GraphicsContext context(&list);
+        GraphicsContext context(&controller);
         LayoutObjectDrawingRecorder recorder(
             context, layoutObject, DisplayItem::BoxDecorationBackground, bounds, LayoutPoint());
         context.drawRect(enclosedIntRect(FloatRect(bounds)));
     }
-    list.commitNewDisplayItems();
-    const auto& drawing = static_cast<const DrawingDisplayItem&>(list.displayItems()[0]);
+    controller.commitNewDisplayItems();
+    const auto& drawing = static_cast<const DrawingDisplayItem&>(controller.displayItems()[0]);
     return drawing.picture()->cullRect();
 }
 
@@ -115,19 +115,19 @@
     // are exactly on a half-pixel boundary. The numbers chosen map nicely to
     // both float and LayoutUnit, to make equality checking reliable.
     FloatRect rect(20.75, -5.5, 5.375, 10);
-    EXPECT_EQ(rect, drawAndGetCullRect(rootDisplayItemList(), layoutView(), rect));
-    EXPECT_EQ(rect, drawAndGetCullRect(rootDisplayItemList(), layoutView(), LayoutRect(rect)));
+    EXPECT_EQ(rect, drawAndGetCullRect(rootPaintController(), layoutView(), rect));
+    EXPECT_EQ(rect, drawAndGetCullRect(rootPaintController(), layoutView(), LayoutRect(rect)));
 }
 
 TEST_F(LayoutObjectDrawingRecorderTest, PaintOffsetCache)
 {
     RuntimeEnabledFeatures::setSlimmingPaintOffsetCachingEnabled(true);
 
-    GraphicsContext context(&rootDisplayItemList());
+    GraphicsContext context(&rootPaintController());
     LayoutRect bounds = layoutView().viewRect();
     LayoutPoint paintOffset(1, 2);
 
-    rootDisplayItemList().invalidateAll();
+    rootPaintController().invalidateAll();
     EXPECT_FALSE(LayoutObjectDrawingRecorder::useCachedDrawingIfPossible(context, layoutView(), PaintPhaseForeground, paintOffset));
     {
         LayoutObjectDrawingRecorder drawingRecorder(context, layoutView(), PaintPhaseForeground, bounds, paintOffset);
@@ -135,8 +135,8 @@
         context.drawRect(rect);
     }
 
-    rootDisplayItemList().commitNewDisplayItems();
-    EXPECT_DISPLAY_LIST(rootDisplayItemList().displayItems(), 1,
+    rootPaintController().commitNewDisplayItems();
+    EXPECT_DISPLAY_LIST(rootPaintController().displayItems(), 1,
         TestDisplayItem(layoutView(), DisplayItem::paintPhaseToDrawingType(PaintPhaseForeground)));
 
     // Ensure we cannot use the cache with a new paint offset.
@@ -150,8 +150,8 @@
         context.drawRect(rect);
     }
 
-    rootDisplayItemList().commitNewDisplayItems();
-    EXPECT_DISPLAY_LIST(rootDisplayItemList().displayItems(), 1,
+    rootPaintController().commitNewDisplayItems();
+    EXPECT_DISPLAY_LIST(rootPaintController().displayItems(), 1,
         TestDisplayItem(layoutView(), DisplayItem::paintPhaseToDrawingType(PaintPhaseForeground)));
 
     // Ensure the old paint offset cannot be used.
@@ -159,8 +159,8 @@
 
     // Ensure the new paint offset can be used.
     EXPECT_TRUE(LayoutObjectDrawingRecorder::useCachedDrawingIfPossible(context, layoutView(), PaintPhaseForeground, newPaintOffset));
-    rootDisplayItemList().commitNewDisplayItems();
-    EXPECT_DISPLAY_LIST(rootDisplayItemList().displayItems(), 1,
+    rootPaintController().commitNewDisplayItems();
+    EXPECT_DISPLAY_LIST(rootPaintController().displayItems(), 1,
         TestDisplayItem(layoutView(), DisplayItem::paintPhaseToDrawingType(PaintPhaseForeground)));
 }
 
diff --git a/third_party/WebKit/Source/core/paint/LineBoxListPainter.cpp b/third_party/WebKit/Source/core/paint/LineBoxListPainter.cpp
index 9074de0..d27d73f 100644
--- a/third_party/WebKit/Source/core/paint/LineBoxListPainter.cpp
+++ b/third_party/WebKit/Source/core/paint/LineBoxListPainter.cpp
@@ -14,7 +14,7 @@
 #include "core/paint/InlinePainter.h"
 #include "core/paint/ObjectPainter.h"
 #include "core/paint/PaintInfo.h"
-#include "platform/graphics/paint/DisplayItemList.h"
+#include "platform/graphics/paint/PaintController.h"
 
 namespace blink {
 
@@ -63,24 +63,24 @@
     }
 }
 
-static void invalidateLineBoxPaintOffsetsInternal(DisplayItemList* displayItemList, InlineFlowBox* inlineBox)
+static void invalidateLineBoxPaintOffsetsInternal(PaintController* paintController, InlineFlowBox* inlineBox)
 {
-    displayItemList->invalidatePaintOffset(*inlineBox);
+    paintController->invalidatePaintOffset(*inlineBox);
     for (InlineBox* child = inlineBox->firstChild(); child; child = child->nextOnLine()) {
         if (!child->lineLayoutItem().isText() && child->boxModelObject().hasSelfPaintingLayer())
             continue;
         if (child->isInlineFlowBox())
-            invalidateLineBoxPaintOffsetsInternal(displayItemList, toInlineFlowBox(child));
+            invalidateLineBoxPaintOffsetsInternal(paintController, toInlineFlowBox(child));
         else
-            displayItemList->invalidatePaintOffset(*child);
+            paintController->invalidatePaintOffset(*child);
     }
 }
 
 void LineBoxListPainter::invalidateLineBoxPaintOffsets(const PaintInfo& paintInfo) const
 {
-    DisplayItemList* displayItemList = paintInfo.context->displayItemList();
+    PaintController* paintController = paintInfo.context->paintController();
     for (InlineFlowBox* curr = m_lineBoxList.firstLineBox(); curr; curr = curr->nextLineBox())
-        invalidateLineBoxPaintOffsetsInternal(displayItemList, curr);
+        invalidateLineBoxPaintOffsetsInternal(paintController, curr);
 }
 
 } // namespace blink
diff --git a/third_party/WebKit/Source/core/paint/PaintControllerPaintTest.cpp b/third_party/WebKit/Source/core/paint/PaintControllerPaintTest.cpp
new file mode 100644
index 0000000..743080c2
--- /dev/null
+++ b/third_party/WebKit/Source/core/paint/PaintControllerPaintTest.cpp
@@ -0,0 +1,149 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "config.h"
+#include "core/paint/PaintControllerPaintTest.h"
+
+#include "core/layout/LayoutText.h"
+#include "core/layout/line/InlineTextBox.h"
+#include "core/page/FocusController.h"
+#include "core/paint/LayoutObjectDrawingRecorder.h"
+#include "core/paint/PaintLayerPainter.h"
+#include "platform/graphics/GraphicsContext.h"
+#include "platform/graphics/paint/DrawingDisplayItem.h"
+
+namespace blink {
+
+TEST_F(PaintControllerPaintTest, FullDocumentPaintingWithCaret)
+{
+    setBodyInnerHTML("<div id='div' contentEditable='true' style='outline:none'>XYZ</div>");
+    document().page()->focusController().setActive(true);
+    document().page()->focusController().setFocused(true);
+    PaintLayer& rootLayer = *layoutView().layer();
+    Element& div = *toElement(document().body()->firstChild());
+    LayoutObject& divLayoutObject = *document().body()->firstChild()->layoutObject();
+    InlineTextBox& textInlineBox = *toLayoutText(div.firstChild()->layoutObject())->firstTextBox();
+
+    GraphicsContext context(&rootPaintController());
+    PaintLayerPaintingInfo paintingInfo(&rootLayer, LayoutRect(0, 0, 800, 600), GlobalPaintNormalPhase, LayoutSize());
+    PaintLayerPainter(rootLayer).paintLayerContents(&context, paintingInfo, PaintLayerPaintingCompositingAllPhases);
+    rootPaintController().commitNewDisplayItems();
+
+    EXPECT_DISPLAY_LIST(rootPaintController().displayItems(), 2,
+        TestDisplayItem(layoutView(), backgroundType),
+        TestDisplayItem(textInlineBox, foregroundType));
+
+    div.focus();
+    document().view()->updateAllLifecyclePhases();
+    EXPECT_TRUE(rootPaintController().clientCacheIsValid(layoutView().displayItemClient()));
+    EXPECT_FALSE(rootPaintController().clientCacheIsValid(divLayoutObject.displayItemClient()));
+    EXPECT_TRUE(rootPaintController().clientCacheIsValid(textInlineBox.displayItemClient()));
+    PaintLayerPainter(rootLayer).paintLayerContents(&context, paintingInfo, PaintLayerPaintingCompositingAllPhases);
+    rootPaintController().commitNewDisplayItems();
+
+    EXPECT_DISPLAY_LIST(rootPaintController().displayItems(), 3,
+        TestDisplayItem(layoutView(), backgroundType),
+        TestDisplayItem(textInlineBox, foregroundType),
+        TestDisplayItem(divLayoutObject, DisplayItem::Caret)); // New!
+}
+
+TEST_F(PaintControllerPaintTest, InlineRelayout)
+{
+    setBodyInnerHTML("<div id='div' style='width:100px; height: 200px'>AAAAAAAAAA BBBBBBBBBB</div>");
+    PaintLayer& rootLayer = *layoutView().layer();
+    Element& div = *toElement(document().body()->firstChild());
+    LayoutBlock& divBlock = *toLayoutBlock(document().body()->firstChild()->layoutObject());
+    LayoutText& text = *toLayoutText(divBlock.firstChild());
+    InlineTextBox& firstTextBox = *text.firstTextBox();
+    DisplayItemClient firstTextBoxDisplayItemClient = firstTextBox.displayItemClient();
+
+    GraphicsContext context(&rootPaintController());
+    PaintLayerPaintingInfo paintingInfo(&rootLayer, LayoutRect(0, 0, 800, 600), GlobalPaintNormalPhase, LayoutSize());
+    PaintLayerPainter(rootLayer).paintLayerContents(&context, paintingInfo, PaintLayerPaintingCompositingAllPhases);
+    rootPaintController().commitNewDisplayItems();
+
+    EXPECT_DISPLAY_LIST(rootPaintController().displayItems(), 2,
+        TestDisplayItem(layoutView(), backgroundType),
+        TestDisplayItem(firstTextBox, foregroundType));
+
+    div.setAttribute(HTMLNames::styleAttr, "width: 10px; height: 200px");
+    document().view()->updateAllLifecyclePhases();
+    EXPECT_TRUE(rootPaintController().clientCacheIsValid(layoutView().displayItemClient()));
+    EXPECT_FALSE(rootPaintController().clientCacheIsValid(divBlock.displayItemClient()));
+    EXPECT_FALSE(rootPaintController().clientCacheIsValid(firstTextBoxDisplayItemClient));
+    PaintLayerPainter(rootLayer).paintLayerContents(&context, paintingInfo, PaintLayerPaintingCompositingAllPhases);
+    rootPaintController().commitNewDisplayItems();
+
+    LayoutText& newText = *toLayoutText(divBlock.firstChild());
+    InlineTextBox& newFirstTextBox = *newText.firstTextBox();
+    InlineTextBox& secondTextBox = *newText.firstTextBox()->nextTextBox();
+
+    EXPECT_DISPLAY_LIST(rootPaintController().displayItems(), 3,
+        TestDisplayItem(layoutView(), backgroundType),
+        TestDisplayItem(newFirstTextBox, foregroundType),
+        TestDisplayItem(secondTextBox, foregroundType));
+}
+
+TEST_F(PaintControllerPaintTestForSlimmingPaintV2, FullDocumentPaintingWithCaret)
+{
+    setBodyInnerHTML("<div id='div' contentEditable='true' style='outline:none'>XYZ</div>");
+    document().page()->focusController().setActive(true);
+    document().page()->focusController().setFocused(true);
+    PaintLayer& rootLayer = *layoutView().layer();
+    Element& div = *toElement(document().body()->firstChild());
+    LayoutObject& divLayoutObject = *document().body()->firstChild()->layoutObject();
+    InlineTextBox& textInlineBox = *toLayoutText(div.firstChild()->layoutObject())->firstTextBox();
+
+    document().view()->updateAllLifecyclePhases();
+
+    EXPECT_DISPLAY_LIST(rootPaintController().displayItems(), 4,
+        TestDisplayItem(layoutView(), backgroundType),
+        TestDisplayItem(rootLayer, subsequenceType),
+        TestDisplayItem(textInlineBox, foregroundType),
+        TestDisplayItem(rootLayer, endSubsequenceType));
+
+    div.focus();
+    document().view()->updateAllLifecyclePhases();
+
+    EXPECT_DISPLAY_LIST(rootPaintController().displayItems(), 5,
+        TestDisplayItem(layoutView(), backgroundType),
+        TestDisplayItem(rootLayer, subsequenceType),
+        TestDisplayItem(textInlineBox, foregroundType),
+        TestDisplayItem(divLayoutObject, DisplayItem::Caret), // New!
+        TestDisplayItem(rootLayer, endSubsequenceType));
+}
+
+TEST_F(PaintControllerPaintTestForSlimmingPaintV2, InlineRelayout)
+{
+    setBodyInnerHTML("<div id='div' style='width:100px; height: 200px'>AAAAAAAAAA BBBBBBBBBB</div>");
+    PaintLayer& rootLayer = *layoutView().layer();
+    Element& div = *toElement(document().body()->firstChild());
+    LayoutBlock& divBlock = *toLayoutBlock(document().body()->firstChild()->layoutObject());
+    LayoutText& text = *toLayoutText(divBlock.firstChild());
+    InlineTextBox& firstTextBox = *text.firstTextBox();
+
+    document().view()->updateAllLifecyclePhases();
+
+    EXPECT_DISPLAY_LIST(rootPaintController().displayItems(), 4,
+        TestDisplayItem(layoutView(), backgroundType),
+        TestDisplayItem(rootLayer, subsequenceType),
+        TestDisplayItem(firstTextBox, foregroundType),
+        TestDisplayItem(rootLayer, endSubsequenceType));
+
+    div.setAttribute(HTMLNames::styleAttr, "width: 10px; height: 200px");
+    document().view()->updateAllLifecyclePhases();
+
+    LayoutText& newText = *toLayoutText(divBlock.firstChild());
+    InlineTextBox& newFirstTextBox = *newText.firstTextBox();
+    InlineTextBox& secondTextBox = *newText.firstTextBox()->nextTextBox();
+
+    EXPECT_DISPLAY_LIST(rootPaintController().displayItems(), 5,
+        TestDisplayItem(layoutView(), backgroundType),
+        TestDisplayItem(rootLayer, subsequenceType),
+        TestDisplayItem(newFirstTextBox, foregroundType),
+        TestDisplayItem(secondTextBox, foregroundType),
+        TestDisplayItem(rootLayer, endSubsequenceType));
+}
+
+} // namespace blink
diff --git a/third_party/WebKit/Source/core/paint/PaintControllerPaintTest.h b/third_party/WebKit/Source/core/paint/PaintControllerPaintTest.h
new file mode 100644
index 0000000..c1cd46b
--- /dev/null
+++ b/third_party/WebKit/Source/core/paint/PaintControllerPaintTest.h
@@ -0,0 +1,132 @@
+// 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 PaintControllerPaintTest_h
+#define PaintControllerPaintTest_h
+
+#include "core/frame/FrameView.h"
+#include "core/layout/LayoutTestHelper.h"
+#include "core/layout/LayoutView.h"
+#include "core/paint/PaintLayer.h"
+#include "platform/graphics/GraphicsLayer.h"
+#include <gtest/gtest.h>
+
+namespace blink {
+
+class PaintControllerPaintTest : public RenderingTest {
+public:
+    PaintControllerPaintTest()
+        : m_originalSlimmingPaintSubsequenceCachingEnabled(RuntimeEnabledFeatures::slimmingPaintSubsequenceCachingEnabled())
+        , m_originalSlimmingPaintOffsetCachingEnabled(RuntimeEnabledFeatures::slimmingPaintOffsetCachingEnabled())
+        { }
+
+protected:
+    LayoutView& layoutView() { return *document().layoutView(); }
+    PaintController& rootPaintController() { return *layoutView().layer()->graphicsLayerBacking()->paintController(); }
+
+private:
+    void SetUp() override
+    {
+        RenderingTest::SetUp();
+        enableCompositing();
+    }
+    void TearDown() override
+    {
+        RuntimeEnabledFeatures::setSlimmingPaintSubsequenceCachingEnabled(m_originalSlimmingPaintSubsequenceCachingEnabled);
+        RuntimeEnabledFeatures::setSlimmingPaintOffsetCachingEnabled(m_originalSlimmingPaintOffsetCachingEnabled);
+    }
+
+    bool m_originalSlimmingPaintSubsequenceCachingEnabled;
+    bool m_originalSlimmingPaintOffsetCachingEnabled;
+};
+
+// Slimming paint v2 has subtly different behavior on some paint tests. This
+// class is used to test only v2 behavior while maintaining v1 test coverage.
+class PaintControllerPaintTestForSlimmingPaintV2 : public RenderingTest {
+public:
+    PaintControllerPaintTestForSlimmingPaintV2()
+        : m_originalSlimmingPaintV2Enabled(RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { }
+
+protected:
+    LayoutView& layoutView() { return *document().layoutView(); }
+    PaintController& rootPaintController() { return *layoutView().layer()->graphicsLayerBacking()->paintController(); }
+    void setNeedsDisplayForRoot()
+    {
+        layoutView().layer()->graphicsLayerBacking()->setNeedsDisplay();
+    }
+    void setNeedsDisplayWithoutInvalidationForRoot()
+    {
+        layoutView().layer()->graphicsLayerBacking()->setNeedsDisplayWithoutInvalidateForTesting();
+    }
+
+    // Expose some document lifecycle steps for checking new display items before commiting.
+    void updateLifecyclePhasesToPaintClean(const LayoutRect& interestRect = LayoutRect(LayoutRect::infiniteIntRect()))
+    {
+        document().view()->updateLifecyclePhasesInternal(FrameView::OnlyUpToCompositingCleanPlusScrolling, nullptr);
+        document().view()->invalidateTreeIfNeededRecursive();
+        document().view()->updatePaintProperties();
+        document().view()->synchronizedPaint(&interestRect);
+    }
+    void compositeForSlimmingPaintV2() { document().view()->compositeForSlimmingPaintV2(); }
+
+private:
+    void SetUp() override
+    {
+        RuntimeEnabledFeatures::setSlimmingPaintV2Enabled(true);
+
+        RenderingTest::SetUp();
+        enableCompositing();
+        GraphicsLayer::setDrawDebugRedFillForTesting(false);
+    }
+
+    void TearDown() override
+    {
+        GraphicsLayer::setDrawDebugRedFillForTesting(true);
+        RuntimeEnabledFeatures::setSlimmingPaintV2Enabled(m_originalSlimmingPaintV2Enabled);
+    }
+
+    bool m_originalSlimmingPaintV2Enabled;
+};
+
+class TestDisplayItem final : public DisplayItem {
+public:
+    TestDisplayItem(const DisplayItemClientWrapper& client, Type type) : DisplayItem(client, type, sizeof(*this)) { }
+
+    void replay(GraphicsContext&) const final { ASSERT_NOT_REACHED(); }
+    void appendToWebDisplayItemList(WebDisplayItemList*) const final { ASSERT_NOT_REACHED(); }
+};
+
+#ifndef NDEBUG
+#define TRACE_DISPLAY_ITEMS(i, expected, actual) \
+    String trace = String::format("%d: ", (int)i) + "Expected: " + (expected).asDebugString() + " Actual: " + (actual).asDebugString(); \
+    SCOPED_TRACE(trace.utf8().data());
+#else
+#define TRACE_DISPLAY_ITEMS(i, expected, actual)
+#endif
+
+#define EXPECT_DISPLAY_LIST(actual, expectedSize, ...) \
+    do { \
+        EXPECT_EQ((size_t)expectedSize, actual.size()); \
+        if (expectedSize != actual.size()) \
+            break; \
+        const TestDisplayItem expected[] = { __VA_ARGS__ }; \
+        for (size_t index = 0; index < std::min<size_t>(actual.size(), expectedSize); index++) { \
+            TRACE_DISPLAY_ITEMS(index, expected[index], actual[index]); \
+            EXPECT_EQ(expected[index].client(), actual[index].client()); \
+            EXPECT_EQ(expected[index].type(), actual[index].type()); \
+        } \
+    } while (false);
+
+// Shorter names for frequently used display item types in tests.
+const DisplayItem::Type backgroundType = DisplayItem::BoxDecorationBackground;
+const DisplayItem::Type cachedBackgroundType = DisplayItem::drawingTypeToCachedDrawingType(backgroundType);
+const DisplayItem::Type foregroundType = DisplayItem::paintPhaseToDrawingType(PaintPhaseForeground);
+const DisplayItem::Type cachedForegroundType = DisplayItem::drawingTypeToCachedDrawingType(foregroundType);
+const DisplayItem::Type subsequenceType = DisplayItem::SubsequenceNormalFlowAndPositiveZOrder;
+const DisplayItem::Type endSubsequenceType = DisplayItem::subsequenceTypeToEndSubsequenceType(subsequenceType);
+const DisplayItem::Type cachedSubsequenceType = DisplayItem::subsequenceTypeToCachedSubsequenceType(subsequenceType);
+
+} // namespace blink
+
+#endif // PaintControllerPaintTest_h
diff --git a/third_party/WebKit/Source/core/paint/PaintLayer.cpp b/third_party/WebKit/Source/core/paint/PaintLayer.cpp
index 8bdfda45..36bfa4d4 100644
--- a/third_party/WebKit/Source/core/paint/PaintLayer.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintLayer.cpp
@@ -904,6 +904,7 @@
     while (!compositedLayer) {
         compositedLayer = layer->enclosingLayerForPaintInvalidation();
         if (!compositedLayer) {
+            RELEASE_ASSERT(layer->layoutObject()->frame());
             LayoutObject* owner = layer->layoutObject()->frame()->ownerLayoutObject();
             if (!owner)
                 break;
diff --git a/third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp b/third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp
index c7502237..6aa1248 100644
--- a/third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintLayerPainter.cpp
@@ -113,7 +113,7 @@
     // Paint the reflection first if we have one.
     if (m_paintLayer.reflectionInfo()) {
         ScopeRecorder scopeRecorder(*context);
-        m_paintLayer.reflectionInfo()->paint(context, paintingInfo, localPaintFlags | PaintLayerPaintingReflection);
+        m_paintLayer.reflectionInfo()->paint(context, paintingInfo, localPaintFlags);
         result = MaybeNotFullyPainted;
     }
 
diff --git a/third_party/WebKit/Source/core/paint/PaintLayerPainterTest.cpp b/third_party/WebKit/Source/core/paint/PaintLayerPainterTest.cpp
index 34aecb8..95ee586 100644
--- a/third_party/WebKit/Source/core/paint/PaintLayerPainterTest.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintLayerPainterTest.cpp
@@ -4,20 +4,20 @@
 
 #include "config.h"
 
-#include "core/paint/DisplayItemListPaintTest.h"
+#include "core/paint/PaintControllerPaintTest.h"
 #include "platform/graphics/GraphicsContext.h"
 
 namespace blink {
 
 class PaintLayerPainterTest
-    : public DisplayItemListPaintTest
+    : public PaintControllerPaintTest
     , public testing::WithParamInterface<FrameSettingOverrideFunction> {
     WTF_MAKE_FAST_ALLOCATED(PaintLayerPainterTest);
 public:
     FrameSettingOverrideFunction settingOverrider() const override { return GetParam(); }
 };
 
-using PaintLayerPainterTestForSlimmingPaintV2 = DisplayItemListPaintTestForSlimmingPaintV2;
+using PaintLayerPainterTestForSlimmingPaintV2 = PaintControllerPaintTestForSlimmingPaintV2;
 
 INSTANTIATE_TEST_CASE_P(All, PaintLayerPainterTest, ::testing::Values(
     nullptr,
@@ -46,13 +46,13 @@
     PaintLayer& container2Layer = *toLayoutBoxModelObject(container2).layer();
     LayoutObject& content2 = *document().getElementById("content2")->layoutObject();
 
-    GraphicsContext context(&rootDisplayItemList());
+    GraphicsContext context(&rootPaintController());
     PaintLayerPaintingInfo paintingInfo(&rootLayer, LayoutRect(0, 0, 800, 600), GlobalPaintNormalPhase, LayoutSize());
     PaintLayerPainter(rootLayer).paintLayerContents(&context, paintingInfo, PaintLayerPaintingCompositingAllPhases);
-    rootDisplayItemList().commitNewDisplayItems();
+    rootPaintController().commitNewDisplayItems();
 
     if (rootLayerScrolls) {
-        EXPECT_DISPLAY_LIST(rootDisplayItemList().displayItems(), 11,
+        EXPECT_DISPLAY_LIST(rootPaintController().displayItems(), 11,
             TestDisplayItem(layoutView(), backgroundType),
             TestDisplayItem(rootLayer, subsequenceType),
             TestDisplayItem(container1, backgroundType),
@@ -65,7 +65,7 @@
             TestDisplayItem(container2Layer, endSubsequenceType),
             TestDisplayItem(rootLayer, endSubsequenceType));
     } else {
-        EXPECT_DISPLAY_LIST(rootDisplayItemList().displayItems(), 13,
+        EXPECT_DISPLAY_LIST(rootPaintController().displayItems(), 13,
             TestDisplayItem(layoutView(), backgroundType),
             TestDisplayItem(rootLayer, subsequenceType),
             TestDisplayItem(htmlLayer, subsequenceType),
@@ -86,7 +86,7 @@
     PaintLayerPainter(rootLayer).paintLayerContents(&context, paintingInfo, PaintLayerPaintingCompositingAllPhases);
 
     if (rootLayerScrolls) {
-        EXPECT_DISPLAY_LIST(rootDisplayItemList().newDisplayItems(), 9,
+        EXPECT_DISPLAY_LIST(rootPaintController().newDisplayItems(), 9,
             TestDisplayItem(layoutView(), cachedBackgroundType),
             TestDisplayItem(rootLayer, subsequenceType),
             TestDisplayItem(container1, cachedBackgroundType),
@@ -97,7 +97,7 @@
             TestDisplayItem(container2Layer, cachedSubsequenceType),
             TestDisplayItem(rootLayer, endSubsequenceType));
     } else {
-        EXPECT_DISPLAY_LIST(rootDisplayItemList().newDisplayItems(), 11,
+        EXPECT_DISPLAY_LIST(rootPaintController().newDisplayItems(), 11,
             TestDisplayItem(layoutView(), cachedBackgroundType),
             TestDisplayItem(rootLayer, subsequenceType),
             TestDisplayItem(htmlLayer, subsequenceType),
@@ -111,10 +111,10 @@
             TestDisplayItem(rootLayer, endSubsequenceType));
     }
 
-    rootDisplayItemList().commitNewDisplayItems();
+    rootPaintController().commitNewDisplayItems();
 
     if (rootLayerScrolls) {
-        EXPECT_DISPLAY_LIST(rootDisplayItemList().displayItems(), 11,
+        EXPECT_DISPLAY_LIST(rootPaintController().displayItems(), 11,
             TestDisplayItem(layoutView(), backgroundType),
             TestDisplayItem(rootLayer, subsequenceType),
             TestDisplayItem(container1, backgroundType),
@@ -127,7 +127,7 @@
             TestDisplayItem(container2Layer, endSubsequenceType),
             TestDisplayItem(rootLayer, endSubsequenceType));
     } else {
-        EXPECT_DISPLAY_LIST(rootDisplayItemList().displayItems(), 13,
+        EXPECT_DISPLAY_LIST(rootPaintController().displayItems(), 13,
             TestDisplayItem(layoutView(), backgroundType),
             TestDisplayItem(rootLayer, subsequenceType),
             TestDisplayItem(htmlLayer, subsequenceType),
@@ -145,14 +145,14 @@
 
     // Repeated painting should just generate the root cached subsequence.
     PaintLayerPainter(rootLayer).paintLayerContents(&context, paintingInfo, PaintLayerPaintingCompositingAllPhases);
-    EXPECT_DISPLAY_LIST(rootDisplayItemList().newDisplayItems(), 2,
+    EXPECT_DISPLAY_LIST(rootPaintController().newDisplayItems(), 2,
         TestDisplayItem(layoutView(), cachedBackgroundType),
         TestDisplayItem(rootLayer, cachedSubsequenceType));
 
-    rootDisplayItemList().commitNewDisplayItems();
+    rootPaintController().commitNewDisplayItems();
 
     if (rootLayerScrolls) {
-        EXPECT_DISPLAY_LIST(rootDisplayItemList().displayItems(), 11,
+        EXPECT_DISPLAY_LIST(rootPaintController().displayItems(), 11,
             TestDisplayItem(layoutView(), backgroundType),
             TestDisplayItem(rootLayer, subsequenceType),
             TestDisplayItem(container1, backgroundType),
@@ -165,7 +165,7 @@
             TestDisplayItem(container2Layer, endSubsequenceType),
             TestDisplayItem(rootLayer, endSubsequenceType));
     } else {
-        EXPECT_DISPLAY_LIST(rootDisplayItemList().displayItems(), 13,
+        EXPECT_DISPLAY_LIST(rootPaintController().displayItems(), 13,
             TestDisplayItem(layoutView(), backgroundType),
             TestDisplayItem(rootLayer, subsequenceType),
             TestDisplayItem(htmlLayer, subsequenceType),
@@ -197,7 +197,7 @@
         "<div id='container3' style='position: absolute; z-index: 2; left: 300px; top: 0; width: 200px; height: 200px; background-color: blue'>"
         "  <div id='content3' style='position: absolute; width: 200px; height: 200px; background-color: green'></div>"
         "</div>");
-    rootDisplayItemList().invalidateAll();
+    rootPaintController().invalidateAll();
 
     bool rootLayerScrolls = document().frame()->settings()->rootLayerScrolls();
     PaintLayer& rootLayer = *layoutView().layer();
@@ -213,17 +213,17 @@
     LayoutObject& content3 = *document().getElementById("content3")->layoutObject();
 
     document().view()->updateAllLifecyclePhases();
-    GraphicsContext context(&rootDisplayItemList());
+    GraphicsContext context(&rootPaintController());
     PaintLayerPaintingInfo paintingInfo(&rootLayer, LayoutRect(0, 0, 400, 300), GlobalPaintNormalPhase, LayoutSize());
     PaintLayerPainter(rootLayer).paintLayerContents(&context, paintingInfo, PaintLayerPaintingCompositingAllPhases);
-    rootDisplayItemList().commitNewDisplayItems();
+    rootPaintController().commitNewDisplayItems();
 
     // Container1 is fully in the interest rect;
     // Container2 is partly (including its stacking chidren) in the interest rect;
     // Content2b is out of the interest rect and output nothing;
     // Container3 is partly in the interest rect.
     if (rootLayerScrolls) {
-        EXPECT_DISPLAY_LIST(rootDisplayItemList().displayItems(), 15,
+        EXPECT_DISPLAY_LIST(rootPaintController().displayItems(), 15,
             TestDisplayItem(layoutView(), backgroundType),
             TestDisplayItem(rootLayer, subsequenceType),
             TestDisplayItem(container1, backgroundType),
@@ -240,7 +240,7 @@
             TestDisplayItem(container3Layer, endSubsequenceType),
             TestDisplayItem(rootLayer, endSubsequenceType));
     } else {
-        EXPECT_DISPLAY_LIST(rootDisplayItemList().displayItems(), 17,
+        EXPECT_DISPLAY_LIST(rootPaintController().displayItems(), 17,
             TestDisplayItem(layoutView(), backgroundType),
             TestDisplayItem(rootLayer, subsequenceType),
             TestDisplayItem(htmlLayer, subsequenceType),
@@ -269,7 +269,7 @@
     PaintLayerPainter(rootLayer).paintLayerContents(&context, paintingInfo1, PaintLayerPaintingCompositingAllPhases);
 
     if (rootLayerScrolls) {
-        EXPECT_DISPLAY_LIST(rootDisplayItemList().newDisplayItems(), 9,
+        EXPECT_DISPLAY_LIST(rootPaintController().newDisplayItems(), 9,
             TestDisplayItem(layoutView(), cachedBackgroundType),
             TestDisplayItem(rootLayer, subsequenceType),
             TestDisplayItem(container1, cachedBackgroundType),
@@ -281,7 +281,7 @@
             TestDisplayItem(rootLayer, endSubsequenceType));
 
     } else {
-        EXPECT_DISPLAY_LIST(rootDisplayItemList().newDisplayItems(), 11,
+        EXPECT_DISPLAY_LIST(rootPaintController().newDisplayItems(), 11,
             TestDisplayItem(layoutView(), cachedBackgroundType),
             TestDisplayItem(rootLayer, subsequenceType),
             TestDisplayItem(htmlLayer, subsequenceType),
@@ -295,10 +295,10 @@
             TestDisplayItem(rootLayer, endSubsequenceType));
     }
 
-    rootDisplayItemList().commitNewDisplayItems();
+    rootPaintController().commitNewDisplayItems();
 
     if (rootLayerScrolls) {
-        EXPECT_DISPLAY_LIST(rootDisplayItemList().displayItems(), 11,
+        EXPECT_DISPLAY_LIST(rootPaintController().displayItems(), 11,
             TestDisplayItem(layoutView(), backgroundType),
             TestDisplayItem(rootLayer, subsequenceType),
             TestDisplayItem(container1, backgroundType),
@@ -311,7 +311,7 @@
             TestDisplayItem(container2Layer, endSubsequenceType),
             TestDisplayItem(rootLayer, endSubsequenceType));
     } else {
-        EXPECT_DISPLAY_LIST(rootDisplayItemList().displayItems(), 13,
+        EXPECT_DISPLAY_LIST(rootPaintController().displayItems(), 13,
             TestDisplayItem(layoutView(), backgroundType),
             TestDisplayItem(rootLayer, subsequenceType),
             TestDisplayItem(htmlLayer, subsequenceType),
@@ -348,7 +348,7 @@
     PaintLayer& container2Layer = *toLayoutBoxModelObject(container2).layer();
     LayoutObject& content2 = *document().getElementById("content2")->layoutObject();
 
-    EXPECT_DISPLAY_LIST(rootDisplayItemList().displayItems(), 13,
+    EXPECT_DISPLAY_LIST(rootPaintController().displayItems(), 13,
         TestDisplayItem(layoutView(), backgroundType),
         TestDisplayItem(rootLayer, subsequenceType),
         TestDisplayItem(htmlLayer, subsequenceType),
@@ -366,7 +366,7 @@
     toHTMLElement(content1.node())->setAttribute(HTMLNames::styleAttr, "position: absolute; width: 100px; height: 100px; background-color: green");
     updateLifecyclePhasesToPaintClean(LayoutRect(LayoutRect::infiniteIntRect()));
 
-    EXPECT_DISPLAY_LIST(rootDisplayItemList().newDisplayItems(), 11,
+    EXPECT_DISPLAY_LIST(rootPaintController().newDisplayItems(), 11,
         TestDisplayItem(layoutView(), cachedBackgroundType),
         TestDisplayItem(rootLayer, subsequenceType),
         TestDisplayItem(htmlLayer, subsequenceType),
@@ -381,7 +381,7 @@
 
     compositeForSlimmingPaintV2();
 
-    EXPECT_DISPLAY_LIST(rootDisplayItemList().displayItems(), 13,
+    EXPECT_DISPLAY_LIST(rootPaintController().displayItems(), 13,
         TestDisplayItem(layoutView(), backgroundType),
         TestDisplayItem(rootLayer, subsequenceType),
         TestDisplayItem(htmlLayer, subsequenceType),
@@ -399,13 +399,13 @@
     // Repeated painting should just generate the root cached subsequence.
     setNeedsDisplayWithoutInvalidationForRoot();
     updateLifecyclePhasesToPaintClean();
-    EXPECT_DISPLAY_LIST(rootDisplayItemList().newDisplayItems(), 2,
+    EXPECT_DISPLAY_LIST(rootPaintController().newDisplayItems(), 2,
         TestDisplayItem(layoutView(), cachedBackgroundType),
         TestDisplayItem(rootLayer, cachedSubsequenceType));
 
     compositeForSlimmingPaintV2();
 
-    EXPECT_DISPLAY_LIST(rootDisplayItemList().displayItems(), 13,
+    EXPECT_DISPLAY_LIST(rootPaintController().displayItems(), 13,
         TestDisplayItem(layoutView(), backgroundType),
         TestDisplayItem(rootLayer, subsequenceType),
         TestDisplayItem(htmlLayer, subsequenceType),
@@ -455,7 +455,7 @@
     // Container2 is partly (including its stacking chidren) in the interest rect;
     // Content2b is out of the interest rect and output nothing;
     // Container3 is partly in the interest rect.
-    EXPECT_DISPLAY_LIST(rootDisplayItemList().displayItems(), 17,
+    EXPECT_DISPLAY_LIST(rootPaintController().displayItems(), 17,
         TestDisplayItem(layoutView(), backgroundType),
         TestDisplayItem(rootLayer, subsequenceType),
         TestDisplayItem(htmlLayer, subsequenceType),
@@ -483,7 +483,7 @@
     // Container3 becomes out of the interest rect and outputs nothing.
     updateLifecyclePhasesToPaintClean(LayoutRect(0, 100, 300, 300));
 
-    EXPECT_DISPLAY_LIST(rootDisplayItemList().newDisplayItems(), 11,
+    EXPECT_DISPLAY_LIST(rootPaintController().newDisplayItems(), 11,
         TestDisplayItem(layoutView(), cachedBackgroundType),
         TestDisplayItem(rootLayer, subsequenceType),
         TestDisplayItem(htmlLayer, subsequenceType),
@@ -498,7 +498,7 @@
 
     compositeForSlimmingPaintV2();
 
-    EXPECT_DISPLAY_LIST(rootDisplayItemList().displayItems(), 13,
+    EXPECT_DISPLAY_LIST(rootPaintController().displayItems(), 13,
         TestDisplayItem(layoutView(), backgroundType),
         TestDisplayItem(rootLayer, subsequenceType),
         TestDisplayItem(htmlLayer, subsequenceType),
diff --git a/third_party/WebKit/Source/core/paint/PaintLayerReflectionInfo.cpp b/third_party/WebKit/Source/core/paint/PaintLayerReflectionInfo.cpp
index b89cb9e..0ff42bb8 100644
--- a/third_party/WebKit/Source/core/paint/PaintLayerReflectionInfo.cpp
+++ b/third_party/WebKit/Source/core/paint/PaintLayerReflectionInfo.cpp
@@ -136,7 +136,7 @@
 
     // Mark that we are now inside replica painting.
     m_isPaintingInsideReflection = true;
-    PaintLayerPainter(*reflectionLayer()).paintLayer(context, paintingInfo, flags);
+    PaintLayerPainter(*reflectionLayer()).paintLayer(context, paintingInfo, flags | PaintLayerPaintingReflection);
     m_isPaintingInsideReflection = false;
 }
 
diff --git a/third_party/WebKit/Source/core/paint/PaintLayerReflectionInfo.h b/third_party/WebKit/Source/core/paint/PaintLayerReflectionInfo.h
index 226fb3eb..81dfd28a 100644
--- a/third_party/WebKit/Source/core/paint/PaintLayerReflectionInfo.h
+++ b/third_party/WebKit/Source/core/paint/PaintLayerReflectionInfo.h
@@ -55,6 +55,18 @@
 class PaintLayer;
 class LayoutReplica;
 
+// PaintLayerReflectionInfo is the main object used for reflections.
+// https://www.webkit.org/blog/182/css-reflections/
+//
+// All reflection operations are done through this object, which delegates to
+// LayoutReplica and ReflectionPainter.
+//
+// Painting Reflections is handled by painting the same PaintLayer again with
+// some special paint flags (the most important being
+// PaintLayerPaintingReflection). See PaintLayerReflectionInfo::paint() and
+// ReplicaPainter for the entry point into the reflection painting code.
+//
+// See LayoutReplica for the peculiar tree structure generated by this design.
 class PaintLayerReflectionInfo {
     WTF_MAKE_FAST_ALLOCATED(PaintLayerReflectionInfo);
     WTF_MAKE_NONCOPYABLE(PaintLayerReflectionInfo);
@@ -75,10 +87,16 @@
     LayoutBox& box() { return *m_box; }
     const LayoutBox& box() const { return *m_box; }
 
+    // The reflected box, ie the box with -webkit-box-reflect.
     LayoutBox* m_box;
+
+    // The reflection object.
+    // This LayoutObject is owned by PaintLayerReflectinInfo.
     LayoutReplica* m_reflection;
 
-    // A state bit tracking if we are painting inside a replica.
+    // A state bit tracking if we are painting inside this replica.
+    // This is done to avoid infinite recursion during painting while also
+    // enabling nested reflection.
     unsigned m_isPaintingInsideReflection : 1;
 };
 
diff --git a/third_party/WebKit/Source/core/paint/ReplicaPainter.cpp b/third_party/WebKit/Source/core/paint/ReplicaPainter.cpp
index 20fd08d..3c21f7b 100644
--- a/third_party/WebKit/Source/core/paint/ReplicaPainter.cpp
+++ b/third_party/WebKit/Source/core/paint/ReplicaPainter.cpp
@@ -15,6 +15,10 @@
 
 void ReplicaPainter::paint(const PaintInfo& paintInfo, const LayoutPoint& paintOffset)
 {
+    // PaintLayerReflectionInfo should have set a transform on the LayoutReplica.
+    // Without it, we won't paint the reflection correctly.
+    ASSERT(m_layoutReplica.layer()->transform());
+
     if (paintInfo.phase != PaintPhaseForeground && paintInfo.phase != PaintPhaseMask)
         return;
 
@@ -23,7 +27,7 @@
     if (paintInfo.phase == PaintPhaseForeground) {
         // Turn around and paint the parent layer. Use temporary clipRects, so that the layer doesn't end up caching clip rects
         // computing using the wrong rootLayer
-        PaintLayer* rootPaintingLayer = m_layoutReplica.layer()->transform() ? m_layoutReplica.layer()->parent() : m_layoutReplica.layer()->enclosingTransformedAncestor();
+        PaintLayer* rootPaintingLayer = m_layoutReplica.layer()->parent();
         PaintLayerPaintingInfo paintingInfo(rootPaintingLayer, LayoutRect(paintInfo.rect), GlobalPaintNormalPhase, LayoutSize(), 0);
         PaintLayerFlags flags = PaintLayerHaveTransparency | PaintLayerAppliedTransform | PaintLayerUncachedClipRects | PaintLayerPaintingReflection;
         PaintLayerPainter(*m_layoutReplica.layer()->parent()).paintLayer(paintInfo.context, paintingInfo, flags);
diff --git a/third_party/WebKit/Source/core/paint/ReplicaPainter.h b/third_party/WebKit/Source/core/paint/ReplicaPainter.h
index 7841f7b..c997750 100644
--- a/third_party/WebKit/Source/core/paint/ReplicaPainter.h
+++ b/third_party/WebKit/Source/core/paint/ReplicaPainter.h
@@ -13,6 +13,9 @@
 class LayoutPoint;
 class LayoutReplica;
 
+// ReplicaPainter is used to paint reflections.
+//
+// See LayoutReplica for more details on our implementation.
 class ReplicaPainter {
     STACK_ALLOCATED();
 public:
diff --git a/third_party/WebKit/Source/core/paint/RoundedInnerRectClipper.cpp b/third_party/WebKit/Source/core/paint/RoundedInnerRectClipper.cpp
index d8ed29b..70da1f8 100644
--- a/third_party/WebKit/Source/core/paint/RoundedInnerRectClipper.cpp
+++ b/third_party/WebKit/Source/core/paint/RoundedInnerRectClipper.cpp
@@ -8,15 +8,15 @@
 #include "core/layout/LayoutBox.h"
 #include "core/paint/PaintInfo.h"
 #include "platform/graphics/paint/ClipDisplayItem.h"
-#include "platform/graphics/paint/DisplayItemList.h"
+#include "platform/graphics/paint/PaintController.h"
 
 namespace blink {
 
 RoundedInnerRectClipper::RoundedInnerRectClipper(const LayoutObject& layoutObject, const PaintInfo& paintInfo, const LayoutRect& rect, const FloatRoundedRect& clipRect, RoundedInnerRectClipperBehavior behavior)
     : m_layoutObject(layoutObject)
     , m_paintInfo(paintInfo)
-    , m_useDisplayItemList(behavior == ApplyToDisplayListIfEnabled)
-    , m_clipType(m_useDisplayItemList ? m_paintInfo.displayItemTypeForClipping() : DisplayItem::ClipBoxPaintPhaseFirst)
+    , m_usePaintController(behavior == ApplyToDisplayListIfEnabled)
+    , m_clipType(m_usePaintController ? m_paintInfo.displayItemTypeForClipping() : DisplayItem::ClipBoxPaintPhaseFirst)
 {
     Vector<FloatRoundedRect> roundedRectClips;
     if (clipRect.isRenderable()) {
@@ -48,9 +48,9 @@
         }
     }
 
-    if (m_useDisplayItemList) {
-        ASSERT(m_paintInfo.context->displayItemList());
-        m_paintInfo.context->displayItemList()->createAndAppend<ClipDisplayItem>(layoutObject, m_clipType, LayoutRect::infiniteIntRect(), roundedRectClips);
+    if (m_usePaintController) {
+        ASSERT(m_paintInfo.context->paintController());
+        m_paintInfo.context->paintController()->createAndAppend<ClipDisplayItem>(layoutObject, m_clipType, LayoutRect::infiniteIntRect(), roundedRectClips);
     } else {
         ClipDisplayItem clipDisplayItem(layoutObject, m_clipType, LayoutRect::infiniteIntRect(), roundedRectClips);
         clipDisplayItem.replay(*paintInfo.context);
@@ -60,9 +60,9 @@
 RoundedInnerRectClipper::~RoundedInnerRectClipper()
 {
     DisplayItem::Type endType = DisplayItem::clipTypeToEndClipType(m_clipType);
-    if (m_useDisplayItemList) {
-        ASSERT(m_paintInfo.context->displayItemList());
-        m_paintInfo.context->displayItemList()->endItem<EndClipDisplayItem>(m_layoutObject, endType);
+    if (m_usePaintController) {
+        ASSERT(m_paintInfo.context->paintController());
+        m_paintInfo.context->paintController()->endItem<EndClipDisplayItem>(m_layoutObject, endType);
     } else {
         EndClipDisplayItem endClipDisplayItem(m_layoutObject, endType);
         endClipDisplayItem.replay(*m_paintInfo.context);
diff --git a/third_party/WebKit/Source/core/paint/RoundedInnerRectClipper.h b/third_party/WebKit/Source/core/paint/RoundedInnerRectClipper.h
index 05d002f..3ab455b 100644
--- a/third_party/WebKit/Source/core/paint/RoundedInnerRectClipper.h
+++ b/third_party/WebKit/Source/core/paint/RoundedInnerRectClipper.h
@@ -29,7 +29,7 @@
 private:
     const LayoutObject& m_layoutObject;
     const PaintInfo& m_paintInfo;
-    bool m_useDisplayItemList;
+    bool m_usePaintController;
     DisplayItem::Type m_clipType;
 };
 
diff --git a/third_party/WebKit/Source/core/paint/SVGClipPainter.cpp b/third_party/WebKit/Source/core/paint/SVGClipPainter.cpp
index 5738e22..31cf20c 100644
--- a/third_party/WebKit/Source/core/paint/SVGClipPainter.cpp
+++ b/third_party/WebKit/Source/core/paint/SVGClipPainter.cpp
@@ -15,8 +15,8 @@
 #include "core/paint/TransformRecorder.h"
 #include "platform/graphics/paint/ClipPathDisplayItem.h"
 #include "platform/graphics/paint/CompositingDisplayItem.h"
-#include "platform/graphics/paint/DisplayItemList.h"
 #include "platform/graphics/paint/DrawingDisplayItem.h"
+#include "platform/graphics/paint/PaintController.h"
 
 namespace blink {
 
@@ -59,8 +59,8 @@
     Path clipPath;
     if (m_clip.asPath(animatedLocalTransform, targetBoundingBox, clipPath)) {
         clipperState = ClipperAppliedPath;
-        ASSERT(context->displayItemList());
-        context->displayItemList()->createAndAppend<BeginClipPathDisplayItem>(target, clipPath);
+        ASSERT(context->paintController());
+        context->paintController()->createAndAppend<BeginClipPathDisplayItem>(target, clipPath);
         return true;
     }
 
@@ -99,8 +99,8 @@
     switch (clipperState) {
     case ClipperAppliedPath:
         // Path-only clipping, no layers to restore but we need to emit an end to the clip path display item.
-        ASSERT(context->displayItemList());
-        context->displayItemList()->endItem<EndClipPathDisplayItem>(target);
+        ASSERT(context->paintController());
+        context->paintController()->endItem<EndClipPathDisplayItem>(target);
         break;
     case ClipperAppliedMask:
         // Transfer content -> clip mask (SrcIn)
diff --git a/third_party/WebKit/Source/core/paint/SVGFilterPainter.cpp b/third_party/WebKit/Source/core/paint/SVGFilterPainter.cpp
index 80164db..5cc82e8 100644
--- a/third_party/WebKit/Source/core/paint/SVGFilterPainter.cpp
+++ b/third_party/WebKit/Source/core/paint/SVGFilterPainter.cpp
@@ -13,8 +13,8 @@
 #include "platform/graphics/filters/SkiaImageFilterBuilder.h"
 #include "platform/graphics/filters/SourceGraphic.h"
 #include "platform/graphics/paint/CompositingDisplayItem.h"
-#include "platform/graphics/paint/DisplayItemList.h"
 #include "platform/graphics/paint/DrawingDisplayItem.h"
+#include "platform/graphics/paint/PaintController.h"
 
 #define CHECK_CTM_FOR_TRANSFORMED_IMAGEFILTER
 
@@ -27,8 +27,8 @@
     GraphicsContext* context = paintingContext();
 
     // Create a new context so the contents of the filter can be drawn and cached.
-    m_displayItemList = DisplayItemList::create();
-    m_context = adoptPtr(new GraphicsContext(m_displayItemList.get()));
+    m_paintController = PaintController::create();
+    m_context = adoptPtr(new GraphicsContext(m_paintController.get()));
     context = m_context.get();
 
     filterData->m_state = FilterData::RecordingContent;
@@ -45,17 +45,17 @@
     GraphicsContext* context = paintingContext();
 
     // Use the context that contains the filtered content.
-    ASSERT(m_displayItemList);
+    ASSERT(m_paintController);
     ASSERT(m_context);
     context = m_context.get();
     context->beginRecording(filterData->filter->filterRegion());
-    m_displayItemList->commitNewDisplayItems();
-    m_displayItemList->paintArtifact().replay(*context);
+    m_paintController->commitNewDisplayItems();
+    m_paintController->paintArtifact().replay(*context);
 
     sourceGraphic->setPicture(context->endRecording());
 
     // Content is cached by the source graphic so temporaries can be freed.
-    m_displayItemList = nullptr;
+    m_paintController = nullptr;
     m_context = nullptr;
 
     filterData->m_state = FilterData::ReadyToPaint;
diff --git a/third_party/WebKit/Source/core/paint/SVGFilterPainter.h b/third_party/WebKit/Source/core/paint/SVGFilterPainter.h
index 9bd93b9..e3e7d4e 100644
--- a/third_party/WebKit/Source/core/paint/SVGFilterPainter.h
+++ b/third_party/WebKit/Source/core/paint/SVGFilterPainter.h
@@ -6,7 +6,7 @@
 #define SVGFilterPainter_h
 
 #include "platform/graphics/GraphicsContext.h"
-#include "platform/graphics/paint/DisplayItemList.h"
+#include "platform/graphics/paint/PaintController.h"
 #include "wtf/Allocator.h"
 #include "wtf/OwnPtr.h"
 
@@ -28,7 +28,7 @@
     GraphicsContext* paintingContext() const { return m_initialContext; }
 
 private:
-    OwnPtr<DisplayItemList> m_displayItemList;
+    OwnPtr<PaintController> m_paintController;
     OwnPtr<GraphicsContext> m_context;
     GraphicsContext* m_initialContext;
 };
diff --git a/third_party/WebKit/Source/core/paint/SVGMaskPainter.cpp b/third_party/WebKit/Source/core/paint/SVGMaskPainter.cpp
index 6beb4ca..bed6b52 100644
--- a/third_party/WebKit/Source/core/paint/SVGMaskPainter.cpp
+++ b/third_party/WebKit/Source/core/paint/SVGMaskPainter.cpp
@@ -11,8 +11,8 @@
 #include "core/paint/PaintInfo.h"
 #include "core/paint/TransformRecorder.h"
 #include "platform/graphics/paint/CompositingDisplayItem.h"
-#include "platform/graphics/paint/DisplayItemList.h"
 #include "platform/graphics/paint/DrawingDisplayItem.h"
+#include "platform/graphics/paint/PaintController.h"
 
 namespace blink {
 
@@ -28,8 +28,8 @@
     if (paintInvalidationRect.isEmpty() || !m_mask.element()->hasChildren())
         return false;
 
-    ASSERT(context->displayItemList());
-    context->displayItemList()->createAndAppend<BeginCompositingDisplayItem>(object, SkXfermode::kSrcOver_Mode, 1, &paintInvalidationRect);
+    ASSERT(context->paintController());
+    context->paintController()->createAndAppend<BeginCompositingDisplayItem>(object, SkXfermode::kSrcOver_Mode, 1, &paintInvalidationRect);
     return true;
 }
 
@@ -47,8 +47,8 @@
         drawMaskForLayoutObject(context, object, object.objectBoundingBox(), paintInvalidationRect);
     }
 
-    ASSERT(context->displayItemList());
-    context->displayItemList()->endItem<EndCompositingDisplayItem>(object);
+    ASSERT(context->paintController());
+    context->paintController()->endItem<EndCompositingDisplayItem>(object);
 }
 
 void SVGMaskPainter::drawMaskForLayoutObject(GraphicsContext* context, const LayoutObject& layoutObject, const FloatRect& targetBoundingBox, const FloatRect& targetPaintInvalidationRect)
diff --git a/third_party/WebKit/Source/core/paint/ScopeRecorder.cpp b/third_party/WebKit/Source/core/paint/ScopeRecorder.cpp
index 76236454e..c70a1ef1 100644
--- a/third_party/WebKit/Source/core/paint/ScopeRecorder.cpp
+++ b/third_party/WebKit/Source/core/paint/ScopeRecorder.cpp
@@ -7,20 +7,20 @@
 
 #include "core/layout/LayoutObject.h"
 #include "platform/graphics/GraphicsContext.h"
-#include "platform/graphics/paint/DisplayItemList.h"
+#include "platform/graphics/paint/PaintController.h"
 
 namespace blink {
 
 ScopeRecorder::ScopeRecorder(GraphicsContext& context)
-    : m_displayItemList(context.displayItemList())
+    : m_paintController(context.paintController())
 {
-    ASSERT(m_displayItemList);
-    m_displayItemList->beginScope();
+    ASSERT(m_paintController);
+    m_paintController->beginScope();
 }
 
 ScopeRecorder::~ScopeRecorder()
 {
-    m_displayItemList->endScope();
+    m_paintController->endScope();
 }
 
 } // namespace blink
diff --git a/third_party/WebKit/Source/core/paint/ScopeRecorder.h b/third_party/WebKit/Source/core/paint/ScopeRecorder.h
index 99ac59c..3ec8296 100644
--- a/third_party/WebKit/Source/core/paint/ScopeRecorder.h
+++ b/third_party/WebKit/Source/core/paint/ScopeRecorder.h
@@ -11,9 +11,9 @@
 
 namespace blink {
 
-class DisplayItemList;
 class GraphicsContext;
 class LayoutObject;
+class PaintController;
 
 class CORE_EXPORT ScopeRecorder {
     ALLOW_ONLY_INLINE_ALLOCATION();
@@ -23,7 +23,7 @@
     ~ScopeRecorder();
 
 private:
-    DisplayItemList* m_displayItemList;
+    PaintController* m_paintController;
 };
 
 } // namespace blink
diff --git a/third_party/WebKit/Source/core/paint/ScrollRecorder.cpp b/third_party/WebKit/Source/core/paint/ScrollRecorder.cpp
index ad539ee2..cb9ace74 100644
--- a/third_party/WebKit/Source/core/paint/ScrollRecorder.cpp
+++ b/third_party/WebKit/Source/core/paint/ScrollRecorder.cpp
@@ -6,7 +6,7 @@
 #include "core/paint/ScrollRecorder.h"
 
 #include "platform/graphics/GraphicsContext.h"
-#include "platform/graphics/paint/DisplayItemList.h"
+#include "platform/graphics/paint/PaintController.h"
 #include "platform/graphics/paint/ScrollDisplayItem.h"
 
 namespace blink {
@@ -16,14 +16,14 @@
     , m_beginItemType(DisplayItem::paintPhaseToScrollType(phase))
     , m_context(context)
 {
-    ASSERT(m_context.displayItemList());
-    m_context.displayItemList()->createAndAppend<BeginScrollDisplayItem>(m_client, m_beginItemType, currentOffset);
+    ASSERT(m_context.paintController());
+    m_context.paintController()->createAndAppend<BeginScrollDisplayItem>(m_client, m_beginItemType, currentOffset);
 }
 
 ScrollRecorder::~ScrollRecorder()
 {
-    ASSERT(m_context.displayItemList());
-    m_context.displayItemList()->endItem<EndScrollDisplayItem>(m_client, DisplayItem::scrollTypeToEndScrollType(m_beginItemType));
+    ASSERT(m_context.paintController());
+    m_context.paintController()->endItem<EndScrollDisplayItem>(m_client, DisplayItem::scrollTypeToEndScrollType(m_beginItemType));
 }
 
 } // namespace blink
diff --git a/third_party/WebKit/Source/core/paint/TableCellPainterTest.cpp b/third_party/WebKit/Source/core/paint/TableCellPainterTest.cpp
index 5fce23a..353abc1 100644
--- a/third_party/WebKit/Source/core/paint/TableCellPainterTest.cpp
+++ b/third_party/WebKit/Source/core/paint/TableCellPainterTest.cpp
@@ -4,13 +4,13 @@
 
 #include "config.h"
 
-#include "core/paint/DisplayItemListPaintTest.h"
+#include "core/paint/PaintControllerPaintTest.h"
 #include "core/paint/PaintLayerPainter.h"
 #include "platform/graphics/GraphicsContext.h"
 
 namespace blink {
 
-using TableCellPainterTest = DisplayItemListPaintTest;
+using TableCellPainterTest = PaintControllerPaintTest;
 
 // TODO(wangxianzhu): Create a version for slimming paint v2 when it supports interest rect
 TEST_F(TableCellPainterTest, TableCellBackgroundInterestRect)
@@ -31,20 +31,20 @@
     LayoutObject& cell1 = *document().getElementById("cell1")->layoutObject();
     LayoutObject& cell2 = *document().getElementById("cell2")->layoutObject();
 
-    GraphicsContext context(&rootDisplayItemList());
+    GraphicsContext context(&rootPaintController());
     PaintLayerPaintingInfo paintingInfo(&rootLayer, LayoutRect(0, 0, 200, 200), GlobalPaintNormalPhase, LayoutSize());
     PaintLayerPainter(rootLayer).paintLayerContents(&context, paintingInfo, PaintLayerPaintingCompositingAllPhases);
-    rootDisplayItemList().commitNewDisplayItems();
+    rootPaintController().commitNewDisplayItems();
 
-    EXPECT_DISPLAY_LIST(rootDisplayItemList().displayItems(), 2,
+    EXPECT_DISPLAY_LIST(rootPaintController().displayItems(), 2,
         TestDisplayItem(layoutView, DisplayItem::BoxDecorationBackground),
         TestDisplayItem(cell1, DisplayItem::TableCellBackgroundFromRow));
 
     PaintLayerPaintingInfo paintingInfo1(&rootLayer, LayoutRect(0, 300, 200, 200), GlobalPaintNormalPhase, LayoutSize());
     PaintLayerPainter(rootLayer).paintLayerContents(&context, paintingInfo1, PaintLayerPaintingCompositingAllPhases);
-    rootDisplayItemList().commitNewDisplayItems();
+    rootPaintController().commitNewDisplayItems();
 
-    EXPECT_DISPLAY_LIST(rootDisplayItemList().displayItems(), 2,
+    EXPECT_DISPLAY_LIST(rootPaintController().displayItems(), 2,
         TestDisplayItem(layoutView, DisplayItem::BoxDecorationBackground),
         TestDisplayItem(cell2, DisplayItem::TableCellBackgroundFromRow));
 }
diff --git a/third_party/WebKit/Source/core/paint/ThemePainter.cpp b/third_party/WebKit/Source/core/paint/ThemePainter.cpp
index 859564e2..6ea382f 100644
--- a/third_party/WebKit/Source/core/paint/ThemePainter.cpp
+++ b/third_party/WebKit/Source/core/paint/ThemePainter.cpp
@@ -246,7 +246,7 @@
         return;
 
     HTMLInputElement* input = toHTMLInputElement(node);
-    if (input->type() != InputTypeNames::range)
+    if (input->type() != InputTypeNames::range || !input->userAgentShadowRoot()->hasChildren())
         return;
 
     HTMLDataListElement* dataList = input->dataList();
diff --git a/third_party/WebKit/Source/core/paint/Transform3DRecorder.cpp b/third_party/WebKit/Source/core/paint/Transform3DRecorder.cpp
index d8de8e1..7e48aa2 100644
--- a/third_party/WebKit/Source/core/paint/Transform3DRecorder.cpp
+++ b/third_party/WebKit/Source/core/paint/Transform3DRecorder.cpp
@@ -6,7 +6,7 @@
 #include "core/paint/Transform3DRecorder.h"
 
 #include "platform/graphics/GraphicsContext.h"
-#include "platform/graphics/paint/DisplayItemList.h"
+#include "platform/graphics/paint/PaintController.h"
 #include "platform/graphics/paint/Transform3DDisplayItem.h"
 
 namespace blink {
@@ -27,8 +27,8 @@
     if (m_skipRecordingForIdentityTransform)
         return;
 
-    ASSERT(m_context.displayItemList());
-    m_context.displayItemList()->createAndAppend<BeginTransform3DDisplayItem>(m_client, m_type, transform, transformOrigin);
+    ASSERT(m_context.paintController());
+    m_context.paintController()->createAndAppend<BeginTransform3DDisplayItem>(m_client, m_type, transform, transformOrigin);
 }
 
 Transform3DRecorder::~Transform3DRecorder()
@@ -36,8 +36,8 @@
     if (m_skipRecordingForIdentityTransform)
         return;
 
-    ASSERT(m_context.displayItemList());
-    m_context.displayItemList()->endItem<EndTransform3DDisplayItem>(m_client, DisplayItem::transform3DTypeToEndTransform3DType(m_type));
+    ASSERT(m_context.paintController());
+    m_context.paintController()->endItem<EndTransform3DDisplayItem>(m_client, DisplayItem::transform3DTypeToEndTransform3DType(m_type));
 }
 
 } // namespace blink
diff --git a/third_party/WebKit/Source/core/paint/TransformRecorder.cpp b/third_party/WebKit/Source/core/paint/TransformRecorder.cpp
index 4f66ea3..90b29d4 100644
--- a/third_party/WebKit/Source/core/paint/TransformRecorder.cpp
+++ b/third_party/WebKit/Source/core/paint/TransformRecorder.cpp
@@ -6,7 +6,7 @@
 #include "core/paint/TransformRecorder.h"
 
 #include "platform/graphics/GraphicsContext.h"
-#include "platform/graphics/paint/DisplayItemList.h"
+#include "platform/graphics/paint/PaintController.h"
 #include "platform/graphics/paint/TransformDisplayItem.h"
 
 namespace blink {
@@ -20,8 +20,8 @@
     if (m_skipRecordingForIdentityTransform)
         return;
 
-    ASSERT(m_context.displayItemList());
-    m_context.displayItemList()->createAndAppend<BeginTransformDisplayItem>(m_client, transform);
+    ASSERT(m_context.paintController());
+    m_context.paintController()->createAndAppend<BeginTransformDisplayItem>(m_client, transform);
 }
 
 TransformRecorder::~TransformRecorder()
@@ -29,8 +29,8 @@
     if (m_skipRecordingForIdentityTransform)
         return;
 
-    ASSERT(m_context.displayItemList());
-    m_context.displayItemList()->endItem<EndTransformDisplayItem>(m_client);
+    ASSERT(m_context.paintController());
+    m_context.paintController()->endItem<EndTransformDisplayItem>(m_client);
 }
 
 } // namespace blink
diff --git a/third_party/WebKit/Source/core/testing/Internals.cpp b/third_party/WebKit/Source/core/testing/Internals.cpp
index c5f68d3..61ae4c1 100644
--- a/third_party/WebKit/Source/core/testing/Internals.cpp
+++ b/third_party/WebKit/Source/core/testing/Internals.cpp
@@ -1997,19 +1997,19 @@
 void Internals::startTrackingPaintInvalidationObjects()
 {
     ASSERT(RuntimeEnabledFeatures::slimmingPaintV2Enabled());
-    toLocalFrame(frame()->page()->mainFrame())->view()->layoutView()->layer()->graphicsLayerBacking()->displayItemList()->startTrackingPaintInvalidationObjects();
+    toLocalFrame(frame()->page()->mainFrame())->view()->layoutView()->layer()->graphicsLayerBacking()->paintController()->startTrackingPaintInvalidationObjects();
 }
 
 void Internals::stopTrackingPaintInvalidationObjects()
 {
     ASSERT(RuntimeEnabledFeatures::slimmingPaintV2Enabled());
-    toLocalFrame(frame()->page()->mainFrame())->view()->layoutView()->layer()->graphicsLayerBacking()->displayItemList()->stopTrackingPaintInvalidationObjects();
+    toLocalFrame(frame()->page()->mainFrame())->view()->layoutView()->layer()->graphicsLayerBacking()->paintController()->stopTrackingPaintInvalidationObjects();
 }
 
 Vector<String> Internals::trackedPaintInvalidationObjects()
 {
     ASSERT(RuntimeEnabledFeatures::slimmingPaintV2Enabled());
-    return toLocalFrame(frame()->page()->mainFrame())->view()->layoutView()->layer()->graphicsLayerBacking()->displayItemList()->trackedPaintInvalidationObjects();
+    return toLocalFrame(frame()->page()->mainFrame())->view()->layoutView()->layer()->graphicsLayerBacking()->paintController()->trackedPaintInvalidationObjects();
 }
 
 ClientRectList* Internals::draggableRegions(Document* document, ExceptionState& exceptionState)
diff --git a/third_party/WebKit/Source/devtools/devtools.gypi b/third_party/WebKit/Source/devtools/devtools.gypi
index 708f71a..b57c56d 100644
--- a/third_party/WebKit/Source/devtools/devtools.gypi
+++ b/third_party/WebKit/Source/devtools/devtools.gypi
@@ -148,7 +148,6 @@
             'front_end/sdk/HeapProfilerModel.js',
             'front_end/sdk/InspectorBackend.js',
             'front_end/sdk/InspectorBackendHostedMode.js',
-            'front_end/sdk/LayerTreeModel.js',
             'front_end/sdk/NetworkLog.js',
             'front_end/sdk/NetworkManager.js',
             'front_end/sdk/NetworkRequest.js',
@@ -649,6 +648,7 @@
             'front_end/timeline/timelinePanel.css',
             'front_end/timeline/CountersGraph.js',
             'front_end/timeline/LayerDetailsView.js',
+            'front_end/timeline/LayerTreeModel.js',
             'front_end/timeline/LayerTreeOutline.js',
             'front_end/timeline/LayerViewHost.js',
             'front_end/timeline/Layers3DView.js',
diff --git a/third_party/WebKit/Source/devtools/front_end/animation/AnimationModel.js b/third_party/WebKit/Source/devtools/front_end/animation/AnimationModel.js
index 2e278f7..1439f862 100644
--- a/third_party/WebKit/Source/devtools/front_end/animation/AnimationModel.js
+++ b/third_party/WebKit/Source/devtools/front_end/animation/AnimationModel.js
@@ -19,6 +19,7 @@
     this._animationGroups = new Map();
     /** @type {!Array.<string>} */
     this._pendingAnimations = [];
+    target.resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.EventTypes.MainFrameNavigated, this._mainFrameNavigated, this);
 }
 
 WebInspector.AnimationModel.Events = {
@@ -27,6 +28,13 @@
 }
 
 WebInspector.AnimationModel.prototype = {
+    _mainFrameNavigated: function()
+    {
+        this._animationsById.clear();
+        this._animationGroups.clear();
+        this._pendingAnimations = [];
+    },
+
     /**
      * @param {string} id
      */
@@ -50,12 +58,29 @@
 
         while (this._pendingAnimations.length) {
             var group = this._createGroupFromPendingAnimations();
-            this._animationGroups.set(group.id(), group);
-            this.dispatchEventToListeners(WebInspector.AnimationModel.Events.AnimationGroupStarted, group);
+            var matchedGroup = this._matchExistingGroups(group);
+            if (!matchedGroup)
+                this._animationGroups.set(group.id(), group);
+            this.dispatchEventToListeners(WebInspector.AnimationModel.Events.AnimationGroupStarted, matchedGroup || group);
         }
     },
 
     /**
+     * @param {!WebInspector.AnimationModel.AnimationGroup} incomingGroup
+     * @return {?WebInspector.AnimationModel.AnimationGroup}
+     */
+    _matchExistingGroups: function(incomingGroup)
+    {
+        for (var group of this._animationGroups.values()) {
+            if (incomingGroup._matches(group)) {
+                group._update(incomingGroup);
+                return group;
+            }
+        }
+        return null;
+    },
+
+    /**
      * @return {!WebInspector.AnimationModel.AnimationGroup}
      */
     _createGroupFromPendingAnimations: function()
@@ -630,6 +655,40 @@
         return this.target().animationAgent().getCurrentTime(this._animations[0].id(), callback).catchException(0);
     },
 
+    /**
+     * @param {!WebInspector.AnimationModel.AnimationGroup} group
+     * @return {boolean}
+     */
+    _matches: function(group)
+    {
+        /**
+         * @param {!WebInspector.AnimationModel.Animation} anim
+         * @return {string}
+         */
+        function extractId(anim)
+        {
+            return anim.type() + ":" + (anim.name() || anim.id());
+        }
+
+        if (this._animations.length !== group._animations.length)
+            return false;
+        var left = this._animations.map(extractId).sort();
+        var right = group._animations.map(extractId).sort();
+        for (var i = 0; i < left.length; i++) {
+            if (left[i] !== right[i])
+                return false;
+        }
+        return true;
+    },
+
+    /**
+     * @param {!WebInspector.AnimationModel.AnimationGroup} group
+     */
+    _update: function(group)
+    {
+        this._animations = group._animations;
+    },
+
     __proto__: WebInspector.SDKObject.prototype
 }
 
diff --git a/third_party/WebKit/Source/devtools/front_end/animation/AnimationTimeline.js b/third_party/WebKit/Source/devtools/front_end/animation/AnimationTimeline.js
index d0d12918..01faadb 100644
--- a/third_party/WebKit/Source/devtools/front_end/animation/AnimationTimeline.js
+++ b/third_party/WebKit/Source/devtools/front_end/animation/AnimationTimeline.js
@@ -363,6 +363,12 @@
             return left.startTime() > right.startTime();
         }
 
+        if (this._previewMap.get(group)) {
+            if (this._selectedGroup === group)
+                this._syncScrubber();
+            this._previewMap.get(group).element.animate([{ opacity: "0.3", transform: "scale(0.7)" }, { opacity: "1", transform: "scale(1)" }], { duration : 150, easing: "cubic-bezier(0, 0, 0.2, 1)" });
+            return;
+        }
         this._groupBuffer.push(group);
         this._groupBuffer.sort(startTimeComparator);
         // Discard oldest groups from buffer if necessary
@@ -544,6 +550,8 @@
 
     _syncScrubber: function()
     {
+        if (!this._selectedGroup)
+            return;
         this._selectedGroup.currentTimePromise()
             .then(this._animateTime.bind(this))
             .then(this._updateControlButton.bind(this));
diff --git a/third_party/WebKit/Source/devtools/front_end/components/InspectElementModeController.js b/third_party/WebKit/Source/devtools/front_end/components/InspectElementModeController.js
index 7f747b1..ce8665c 100644
--- a/third_party/WebKit/Source/devtools/front_end/components/InspectElementModeController.js
+++ b/third_party/WebKit/Source/devtools/front_end/components/InspectElementModeController.js
@@ -166,6 +166,13 @@
         if (!WebInspector.inspectElementModeController)
             return;
         WebInspector.inspectElementModeController._toggleInspectMode();
+
+        if (WebInspector.inspectElementModeController.isInInspectElementMode())
+            return;
+
+        var node = WebInspector.context.flavor(WebInspector.DOMNode);
+        if (node)
+            WebInspector.Revealer.reveal(node);
     }
 }
 
diff --git a/third_party/WebKit/Source/devtools/front_end/components/inspectorViewTabbedPane.css b/third_party/WebKit/Source/devtools/front_end/components/inspectorViewTabbedPane.css
index bf9d78e..2830f41 100644
--- a/third_party/WebKit/Source/devtools/front_end/components/inspectorViewTabbedPane.css
+++ b/third_party/WebKit/Source/devtools/front_end/components/inspectorViewTabbedPane.css
@@ -38,3 +38,7 @@
     color: #333;
     border-width: 0 2px 0 2px;
 }
+
+.tabbed-pane-header-contents {
+    margin-left: 0;
+}
diff --git a/third_party/WebKit/Source/devtools/front_end/elements/ElementsPanel.js b/third_party/WebKit/Source/devtools/front_end/elements/ElementsPanel.js
index e9beaa2b..a401a39 100644
--- a/third_party/WebKit/Source/devtools/front_end/elements/ElementsPanel.js
+++ b/third_party/WebKit/Source/devtools/front_end/elements/ElementsPanel.js
@@ -99,6 +99,7 @@
     WebInspector.targetManager.observeTargets(this);
     WebInspector.moduleSetting("showUAShadowDOM").addChangeListener(this._showUAShadowDOMChanged.bind(this));
     WebInspector.targetManager.addModelListener(WebInspector.DOMModel, WebInspector.DOMModel.Events.DocumentUpdated, this._documentUpdatedEvent, this);
+    WebInspector.targetManager.addModelListener(WebInspector.DOMModel, WebInspector.DOMModel.Events.NodeHighlightedInOverlay, this._highlightNode, this);
     WebInspector.extensionServer.addEventListener(WebInspector.ExtensionServer.Events.SidebarPaneAdded, this._extensionSidebarPaneAdded, this);
 }
 
@@ -696,6 +697,18 @@
     },
 
     /**
+     * @param {!WebInspector.Event} event
+     */
+    _highlightNode: function(event)
+    {
+        var domNode = /** @type {!WebInspector.DOMNode} */ (event.data);
+        for (var i = 0; i < this._treeOutlines.length; ++i) {
+            var treeOutline = this._treeOutlines[i];
+            treeOutline.highlightNode(treeOutline.domModel() === domNode.domModel() ? domNode : null);
+        }
+    },
+
+    /**
      * @param {!WebInspector.DOMNode} node
      * @param {boolean=} focus
      */
diff --git a/third_party/WebKit/Source/devtools/front_end/elements/ElementsTreeOutline.js b/third_party/WebKit/Source/devtools/front_end/elements/ElementsTreeOutline.js
index 73b6698..5d399ba6 100644
--- a/third_party/WebKit/Source/devtools/front_end/elements/ElementsTreeOutline.js
+++ b/third_party/WebKit/Source/devtools/front_end/elements/ElementsTreeOutline.js
@@ -614,6 +614,19 @@
     },
 
     /**
+     * @param {?WebInspector.DOMNode} node
+     */
+    highlightNode: function(node)
+    {
+        var treeElement = null;
+        if (node) {
+            treeElement = this.createTreeElementFor(node);
+            treeElement.reveal();
+        }
+        this._setHoverEffect(treeElement);
+    },
+
+    /**
      * @return {?TreeElement}
      */
     _treeElementFromEvent: function(event)
@@ -723,10 +736,12 @@
         element.select();
     },
 
-    _onmousemove: function(event)
+    /**
+     * @param {?TreeElement} treeElement
+     */
+    _setHoverEffect: function (treeElement)
     {
-        var element = this._treeElementFromEvent(event);
-        if (element && this._previousHoveredElement === element)
+        if (this._previousHoveredElement === treeElement)
             return;
 
         if (this._previousHoveredElement) {
@@ -734,10 +749,19 @@
             delete this._previousHoveredElement;
         }
 
-        if (element) {
-            element.hovered = true;
-            this._previousHoveredElement = element;
+        if (treeElement) {
+            treeElement.hovered = true;
+            this._previousHoveredElement = treeElement;
         }
+    },
+
+    _onmousemove: function(event)
+    {
+        var element = this._treeElementFromEvent(event);
+        if (element && this._previousHoveredElement === element)
+            return;
+
+        this._setHoverEffect(element);
 
         if (element instanceof WebInspector.ElementsTreeElement) {
             this._domModel.highlightDOMNodeWithConfig(element.node().id, { mode: "all", showInfo: !WebInspector.KeyboardShortcut.eventHasCtrlOrMeta(event) });
@@ -750,11 +774,7 @@
 
     _onmouseleave: function(event)
     {
-        if (this._previousHoveredElement) {
-            this._previousHoveredElement.hovered = false;
-            delete this._previousHoveredElement;
-        }
-
+        this._setHoverEffect(null);
         WebInspector.DOMModel.hideDOMNodeHighlight();
     },
 
diff --git a/third_party/WebKit/Source/devtools/front_end/inspectorStyle.css b/third_party/WebKit/Source/devtools/front_end/inspectorStyle.css
index 12bb327d..ecf126de 100644
--- a/third_party/WebKit/Source/devtools/front_end/inspectorStyle.css
+++ b/third_party/WebKit/Source/devtools/front_end/inspectorStyle.css
@@ -83,10 +83,6 @@
     background-clip: padding-box;
 }
 
-.inspector-view-toolbar-left {
-    margin-right: -5px; /* Should compensate for .tabbed-pane-header-contents margin-left. */
-}
-
 .bubble-repeat-count {
     display: inline-block;
     height: 14px;
diff --git a/third_party/WebKit/Source/devtools/front_end/layers/LayersPanel.js b/third_party/WebKit/Source/devtools/front_end/layers/LayersPanel.js
index b377e2b..cc12f75 100644
--- a/third_party/WebKit/Source/devtools/front_end/layers/LayersPanel.js
+++ b/third_party/WebKit/Source/devtools/front_end/layers/LayersPanel.js
@@ -38,7 +38,8 @@
     WebInspector.PanelWithSidebar.call(this, "layers", 225);
     this.registerRequiredCSS("timeline/timelinePanel.css");
 
-    this._target = null;
+    /** @type {?WebInspector.LayerTreeModel} */
+    this._model = null;
 
     WebInspector.targetManager.observeTargets(this);
     this._layerViewHost = new WebInspector.LayerViewHost();
@@ -77,15 +78,15 @@
     wasShown: function()
     {
         WebInspector.Panel.prototype.wasShown.call(this);
-        if (this._target)
-            this._target.layerTreeModel.enable();
+        if (this._model)
+            this._model.enable();
         this._layerTreeOutline.focus();
     },
 
     willHide: function()
     {
-        if (this._target)
-            this._target.layerTreeModel.disable();
+        if (this._model)
+            this._model.disable();
         WebInspector.Panel.prototype.willHide.call(this);
     },
 
@@ -95,13 +96,15 @@
      */
     targetAdded: function(target)
     {
-        if (this._target)
+        if (this._model)
             return;
-        this._target = target;
-        this._target.layerTreeModel.addEventListener(WebInspector.LayerTreeModel.Events.LayerTreeChanged, this._onLayerTreeUpdated, this);
-        this._target.layerTreeModel.addEventListener(WebInspector.LayerTreeModel.Events.LayerPainted, this._onLayerPainted, this);
+        this._model = WebInspector.LayerTreeModel.fromTarget(target);
+        if (!this._model)
+            return;
+        this._model.addEventListener(WebInspector.LayerTreeModel.Events.LayerTreeChanged, this._onLayerTreeUpdated, this);
+        this._model.addEventListener(WebInspector.LayerTreeModel.Events.LayerPainted, this._onLayerPainted, this);
         if (this.isShowing())
-            this._target.layerTreeModel.enable();
+            this._model.enable();
     },
 
     /**
@@ -110,12 +113,12 @@
      */
     targetRemoved: function(target)
     {
-        if (this._target !== target)
+        if (!this._model || this._model.target() !== target)
             return;
-        this._target.layerTreeModel.removeEventListener(WebInspector.LayerTreeModel.Events.LayerTreeChanged, this._onLayerTreeUpdated, this);
-        this._target.layerTreeModel.removeEventListener(WebInspector.LayerTreeModel.Events.LayerPainted, this._onLayerPainted, this);
-        this._target.layerTreeModel.disable();
-        this._target = null;
+        this._model.removeEventListener(WebInspector.LayerTreeModel.Events.LayerTreeChanged, this._onLayerTreeUpdated, this);
+        this._model.removeEventListener(WebInspector.LayerTreeModel.Events.LayerPainted, this._onLayerPainted, this);
+        this._model.disable();
+        this._model = null;
     },
 
     /**
@@ -128,8 +131,8 @@
 
     _onLayerTreeUpdated: function()
     {
-        if (this._target)
-            this._layerViewHost.setLayerTree(this._target.layerTreeModel.layerTree());
+        if (this._model)
+            this._layerViewHost.setLayerTree(this._model.layerTree());
     },
 
     /**
@@ -137,9 +140,9 @@
      */
     _onLayerPainted: function(event)
     {
-        if (!this._target)
+        if (!this._model)
             return;
-        this._layers3DView.setLayerTree(this._target.layerTreeModel.layerTree());
+        this._layers3DView.setLayerTree(this._model.layerTree());
         if (this._layerViewHost.selection() && this._layerViewHost.selection().layer() === event.data)
             this._layerDetailsView.update();
     },
diff --git a/third_party/WebKit/Source/devtools/front_end/screencast/ScreencastView.js b/third_party/WebKit/Source/devtools/front_end/screencast/ScreencastView.js
index 25f24a4..ef87846 100644
--- a/third_party/WebKit/Source/devtools/front_end/screencast/ScreencastView.js
+++ b/third_party/WebKit/Source/devtools/front_end/screencast/ScreencastView.js
@@ -245,10 +245,12 @@
         {
             if (!node)
                 return;
-            if (event.type === "mousemove")
+            if (event.type === "mousemove") {
                 this.highlightDOMNode(node, this._inspectModeConfig);
-            else if (event.type === "click")
+                this._domModel.nodeHighlightRequested(node.id);
+            } else if (event.type === "click") {
                 WebInspector.Revealer.reveal(node);
+            }
         }
     },
 
@@ -513,21 +515,6 @@
 
     },
 
-
-    /**
-     * @param {!DOMAgent.Quad} quad1
-     * @param {!DOMAgent.Quad} quad2
-     * @return {boolean}
-     */
-    _quadsAreEqual: function(quad1, quad2)
-    {
-        for (var i = 0; i < quad1.length; ++i) {
-            if (quad1[i] !== quad2[i])
-                return false;
-        }
-        return true;
-    },
-
     /**
      * @param {!DOMAgent.RGBA} color
      * @return {string}
diff --git a/third_party/WebKit/Source/devtools/front_end/sdk/DOMModel.js b/third_party/WebKit/Source/devtools/front_end/sdk/DOMModel.js
index 26eefa9..37b1f22 100644
--- a/third_party/WebKit/Source/devtools/front_end/sdk/DOMModel.js
+++ b/third_party/WebKit/Source/devtools/front_end/sdk/DOMModel.js
@@ -1101,6 +1101,7 @@
     DOMMutated: "DOMMutated",
     NodeInserted: "NodeInserted",
     NodeInspected: "NodeInspected",
+    NodeHighlightedInOverlay: "NodeHighlightedInOverlay",
     NodeRemoved: "NodeRemoved",
     DocumentUpdated: "DocumentUpdated",
     ChildNodeCountUpdated: "ChildNodeCountUpdated",
@@ -1944,6 +1945,18 @@
         }
     },
 
+    /**
+     * @param {!DOMAgent.NodeId} nodeId
+     */
+    nodeHighlightRequested: function(nodeId)
+    {
+        var node = this.nodeForId(nodeId);
+        if (!node)
+            return;
+
+        this.dispatchEventToListeners(WebInspector.DOMModel.Events.NodeHighlightedInOverlay, node);
+    },
+
     __proto__: WebInspector.SDKModel.prototype
 }
 
@@ -2104,6 +2117,15 @@
     distributedNodesUpdated: function(insertionPointId, distributedNodes)
     {
         this._domModel._distributedNodesUpdated(insertionPointId, distributedNodes);
+    },
+
+    /**
+     * @override
+     * @param {!DOMAgent.NodeId} nodeId
+     */
+    nodeHighlightRequested: function(nodeId)
+    {
+        this._domModel.nodeHighlightRequested(nodeId);
     }
 }
 
diff --git a/third_party/WebKit/Source/devtools/front_end/sdk/LayerTreeModel.js b/third_party/WebKit/Source/devtools/front_end/sdk/LayerTreeModel.js
deleted file mode 100644
index d673579..0000000
--- a/third_party/WebKit/Source/devtools/front_end/sdk/LayerTreeModel.js
+++ /dev/null
@@ -1,1267 +0,0 @@
-/*
- * Copyright (C) 2013 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- *     * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
- *     * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/** @typedef {!{
-        bounds: {height: number, width: number},
-        children: Array.<!WebInspector.TracingLayerPayload>,
-        layer_id: number,
-        position: Array.<number>,
-        scroll_offset: Array.<number>,
-        layer_quad: Array.<number>,
-        draws_content: number,
-        gpu_memory_usage: number,
-        transform: Array.<number>,
-        owner_node: number,
-        compositing_reasons: Array.<string>
-    }}
-*/
-WebInspector.TracingLayerPayload;
-
-/** @typedef {!{
-        id: string,
-        layer_id: number,
-        gpu_memory_usage: number,
-        content_rect: !Array.<number>
-    }}
-*/
-WebInspector.TracingLayerTile;
-
-/**
-  * @constructor
-  * @extends {WebInspector.SDKModel}
-  */
-WebInspector.LayerTreeModel = function(target)
-{
-    WebInspector.SDKModel.call(this, WebInspector.LayerTreeModel, target);
-    target.registerLayerTreeDispatcher(new WebInspector.LayerTreeDispatcher(this));
-    WebInspector.targetManager.addEventListener(WebInspector.TargetManager.Events.MainFrameNavigated, this._onMainFrameNavigated, this);
-    /** @type {?WebInspector.LayerTreeBase} */
-    this._layerTree = null;
-}
-
-WebInspector.LayerTreeModel.Events = {
-    LayerTreeChanged: "LayerTreeChanged",
-    LayerPainted: "LayerPainted",
-}
-
-WebInspector.LayerTreeModel.ScrollRectType = {
-    NonFastScrollable: {name: "NonFastScrollable", description: "Non fast scrollable"},
-    TouchEventHandler: {name: "TouchEventHandler", description: "Touch event handler"},
-    WheelEventHandler: {name: "WheelEventHandler", description: "Wheel event handler"},
-    RepaintsOnScroll: {name: "RepaintsOnScroll", description: "Repaints on scroll"}
-}
-
-WebInspector.LayerTreeModel.prototype = {
-    disable: function()
-    {
-        if (!this._enabled)
-            return;
-        this._enabled = false;
-        this._layerTree = null;
-        this.target().layerTreeAgent().disable();
-    },
-
-    enable: function()
-    {
-        if (this._enabled)
-            return;
-        this._enabled = true;
-        this._forceEnable();
-    },
-
-    _forceEnable: function()
-    {
-        this._layerTree = new WebInspector.AgentLayerTree(this.target());
-        this._lastPaintRectByLayerId = {};
-        this.target().layerTreeAgent().enable();
-    },
-
-    /**
-     * @param {!WebInspector.LayerTreeBase} layerTree
-     */
-    setLayerTree: function(layerTree)
-    {
-        this.disable();
-        this._layerTree = layerTree;
-        this.dispatchEventToListeners(WebInspector.LayerTreeModel.Events.LayerTreeChanged);
-    },
-
-    /**
-     * @return {?WebInspector.LayerTreeBase}
-     */
-    layerTree: function()
-    {
-        return this._layerTree;
-    },
-
-    /**
-     * @param {?Array.<!LayerTreeAgent.Layer>} layers
-     */
-    _layerTreeChanged: function(layers)
-    {
-        if (!this._enabled)
-            return;
-        var layerTree = /** @type {!WebInspector.AgentLayerTree} */ (this._layerTree);
-        layerTree.setLayers(layers, onLayersSet.bind(this));
-
-        /**
-         * @this {WebInspector.LayerTreeModel}
-         */
-        function onLayersSet()
-        {
-            for (var layerId in this._lastPaintRectByLayerId) {
-                var lastPaintRect = this._lastPaintRectByLayerId[layerId];
-                var layer = layerTree.layerById(layerId);
-                if (layer)
-                    layer._lastPaintRect = lastPaintRect;
-            }
-            this._lastPaintRectByLayerId = {};
-
-            this.dispatchEventToListeners(WebInspector.LayerTreeModel.Events.LayerTreeChanged);
-        }
-    },
-
-    /**
-     * @param {!LayerTreeAgent.LayerId} layerId
-     * @param {!DOMAgent.Rect} clipRect
-     */
-    _layerPainted: function(layerId, clipRect)
-    {
-        if (!this._enabled)
-            return;
-        var layerTree = /** @type {!WebInspector.AgentLayerTree} */ (this._layerTree);
-        var layer = layerTree.layerById(layerId);
-        if (!layer) {
-            this._lastPaintRectByLayerId[layerId] = clipRect;
-            return;
-        }
-        layer._didPaint(clipRect);
-        this.dispatchEventToListeners(WebInspector.LayerTreeModel.Events.LayerPainted, layer);
-    },
-
-    _onMainFrameNavigated: function()
-    {
-        if (this._enabled)
-            this._forceEnable();
-    },
-
-    __proto__: WebInspector.SDKModel.prototype
-}
-
-/**
-  * @constructor
-  * @param {?WebInspector.Target} target
-  */
-WebInspector.LayerTreeBase = function(target)
-{
-    this._target = target;
-    this._domModel = target ? WebInspector.DOMModel.fromTarget(target) : null;
-    this._layersById = {};
-    /** @type Map<number, ?WebInspector.DOMNode> */
-    this._backendNodeIdToNode = new Map();
-    this._reset();
-}
-
-WebInspector.LayerTreeBase.prototype = {
-    _reset: function()
-    {
-        this._root = null;
-        this._contentRoot = null;
-    },
-
-    /**
-     * @return {?WebInspector.Target}
-     */
-    target: function()
-    {
-        return this._target;
-    },
-
-    /**
-     * @return {?WebInspector.Layer}
-     */
-    root: function()
-    {
-        return this._root;
-    },
-
-    /**
-     * @return {?WebInspector.Layer}
-     */
-    contentRoot: function()
-    {
-        return this._contentRoot;
-    },
-
-    /**
-     * @param {function(!WebInspector.Layer)} callback
-     * @param {?WebInspector.Layer=} root
-     * @return {boolean}
-     */
-    forEachLayer: function(callback, root)
-    {
-        if (!root) {
-            root = this.root();
-            if (!root)
-                return false;
-        }
-        return callback(root) || root.children().some(this.forEachLayer.bind(this, callback));
-    },
-
-    /**
-     * @param {string} id
-     * @return {?WebInspector.Layer}
-     */
-    layerById: function(id)
-    {
-        return this._layersById[id] || null;
-    },
-
-    /**
-     * @param {!Set<number>} requestedNodeIds
-     * @param {function()} callback
-     */
-    _resolveBackendNodeIds: function(requestedNodeIds, callback)
-    {
-        if (!requestedNodeIds.size || !this._domModel) {
-            callback();
-            return;
-        }
-        if (this._domModel)
-            this._domModel.pushNodesByBackendIdsToFrontend(requestedNodeIds, populateBackendNodeMap.bind(this));
-
-        /**
-         * @this {WebInspector.LayerTreeBase}
-         * @param {?Map<number, ?WebInspector.DOMNode>} nodesMap
-         */
-        function populateBackendNodeMap(nodesMap)
-        {
-            if (nodesMap) {
-                for (var entry of nodesMap)
-                    this._backendNodeIdToNode.set(entry[0], entry[1]);
-            }
-            callback();
-        }
-    },
-
-    /**
-     * @param {!Object} viewportSize
-     */
-    setViewportSize: function(viewportSize)
-    {
-        this._viewportSize = viewportSize;
-    },
-
-    /**
-     * @return {!Object | undefined}
-     */
-    viewportSize: function()
-    {
-        return this._viewportSize;
-    },
-
-    /**
-     * @param {number} id
-     * @return {?WebInspector.DOMNode}
-     */
-    _nodeForId: function(id)
-    {
-        return this._domModel ? this._domModel.nodeForId(id) : null;
-    }
-}
-
-/**
-  * @constructor
-  * @extends {WebInspector.LayerTreeBase}
-  * @param {?WebInspector.Target} target
-  */
-WebInspector.TracingLayerTree = function(target)
-{
-    WebInspector.LayerTreeBase.call(this, target);
-    /** @type {!Map.<string, !WebInspector.TracingLayerTile>} */
-    this._tileById = new Map();
-}
-
-WebInspector.TracingLayerTree.prototype = {
-    /**
-     * @param {!WebInspector.TracingLayerPayload} root
-     * @param {function()} callback
-     */
-    setLayers: function(root, callback)
-    {
-        var idsToResolve = new Set();
-        this._extractNodeIdsToResolve(idsToResolve, {}, root);
-        this._resolveBackendNodeIds(idsToResolve, onBackendNodeIdsResolved.bind(this));
-
-        /**
-         * @this {WebInspector.TracingLayerTree}
-         */
-        function onBackendNodeIdsResolved()
-        {
-            var oldLayersById = this._layersById;
-            this._layersById = {};
-            this._contentRoot = null;
-            this._root = this._innerSetLayers(oldLayersById, root);
-            callback();
-        }
-    },
-
-    /**
-     * @param {!Array.<!WebInspector.TracingLayerTile>} tiles
-     */
-    setTiles: function(tiles)
-    {
-        this._tileById = new Map();
-        for (var tile of tiles)
-            this._tileById.set(tile.id, tile);
-    },
-
-    /**
-     * @param {string} id
-     * @return {?WebInspector.TracingLayerTile}
-     */
-    tileById: function(id)
-    {
-        return this._tileById.get(id) || null;
-    },
-
-    /**
-     * @param {!Object.<(string|number), !WebInspector.Layer>} oldLayersById
-     * @param {!WebInspector.TracingLayerPayload} payload
-     * @return {!WebInspector.TracingLayer}
-     */
-    _innerSetLayers: function(oldLayersById, payload)
-    {
-        var layer = /** @type {?WebInspector.TracingLayer} */ (oldLayersById[payload.layer_id]);
-        if (layer)
-            layer._reset(payload);
-        else
-            layer = new WebInspector.TracingLayer(payload);
-        this._layersById[payload.layer_id] = layer;
-        if (payload.owner_node)
-            layer._setNode(this._backendNodeIdToNode.get(payload.owner_node) || null);
-        if (!this._contentRoot && layer.drawsContent())
-            this._contentRoot = layer;
-        for (var i = 0; payload.children && i < payload.children.length; ++i)
-            layer.addChild(this._innerSetLayers(oldLayersById, payload.children[i]));
-        return layer;
-    },
-
-    /**
-     * @param {!Set<number>} nodeIdsToResolve
-     * @param {!Object} seenNodeIds
-     * @param {!WebInspector.TracingLayerPayload} payload
-     */
-    _extractNodeIdsToResolve: function(nodeIdsToResolve, seenNodeIds, payload)
-    {
-        var backendNodeId = payload.owner_node;
-        if (backendNodeId && !this._backendNodeIdToNode[backendNodeId])
-            nodeIdsToResolve.add(backendNodeId);
-        for (var i = 0; payload.children && i < payload.children.length; ++i)
-            this._extractNodeIdsToResolve(nodeIdsToResolve, seenNodeIds, payload.children[i]);
-    },
-
-    __proto__: WebInspector.LayerTreeBase.prototype
-}
-
-/**
-  * @constructor
-  * @param {?WebInspector.Target} target
-  * @extends {WebInspector.LayerTreeBase}
-  */
-WebInspector.AgentLayerTree = function(target)
-{
-    WebInspector.LayerTreeBase.call(this, target);
-}
-
-WebInspector.AgentLayerTree.prototype = {
-    /**
-     * @param {?Array.<!LayerTreeAgent.Layer>} payload
-     * @param {function()} callback
-     */
-    setLayers: function(payload, callback)
-    {
-        if (!payload) {
-            onBackendNodeIdsResolved.call(this);
-            return;
-        }
-
-        var idsToResolve = new Set();
-        for (var i = 0; i < payload.length; ++i) {
-            var backendNodeId = payload[i].backendNodeId;
-            if (!backendNodeId || this._backendNodeIdToNode.has(backendNodeId))
-                continue;
-            idsToResolve.add(backendNodeId);
-        }
-        this._resolveBackendNodeIds(idsToResolve, onBackendNodeIdsResolved.bind(this));
-
-        /**
-         * @this {WebInspector.AgentLayerTree}
-         */
-        function onBackendNodeIdsResolved()
-        {
-            this._innerSetLayers(payload);
-            callback();
-        }
-    },
-
-    /**
-     * @param {?Array.<!LayerTreeAgent.Layer>} layers
-     */
-    _innerSetLayers: function(layers)
-    {
-        this._reset();
-        // Payload will be null when not in the composited mode.
-        if (!layers)
-            return;
-        var oldLayersById = this._layersById;
-        this._layersById = {};
-        for (var i = 0; i < layers.length; ++i) {
-            var layerId = layers[i].layerId;
-            var layer = oldLayersById[layerId];
-            if (layer)
-                layer._reset(layers[i]);
-            else
-                layer = new WebInspector.AgentLayer(this._target, layers[i]);
-            this._layersById[layerId] = layer;
-            var backendNodeId = layers[i].backendNodeId;
-            if (backendNodeId)
-                layer._setNode(this._backendNodeIdToNode.get(backendNodeId));
-            if (!this._contentRoot && layer.drawsContent())
-                this._contentRoot = layer;
-            var parentId = layer.parentId();
-            if (parentId) {
-                var parent = this._layersById[parentId];
-                if (!parent)
-                    console.assert(parent, "missing parent " + parentId + " for layer " + layerId);
-                parent.addChild(layer);
-            } else {
-                if (this._root)
-                    console.assert(false, "Multiple root layers");
-                this._root = layer;
-            }
-        }
-        if (this._root)
-            this._root._calculateQuad(new WebKitCSSMatrix());
-    },
-
-    __proto__: WebInspector.LayerTreeBase.prototype
-}
-
-/**
- * @interface
- */
-WebInspector.Layer = function()
-{
-}
-
-WebInspector.Layer.prototype = {
-    /**
-     * @return {string}
-     */
-    id: function() { },
-
-    /**
-     * @return {?string}
-     */
-    parentId: function() { },
-
-    /**
-     * @return {?WebInspector.Layer}
-     */
-    parent: function() { },
-
-    /**
-     * @return {boolean}
-     */
-    isRoot: function() { },
-
-    /**
-     * @return {!Array.<!WebInspector.Layer>}
-     */
-    children: function() { },
-
-    /**
-     * @param {!WebInspector.Layer} child
-     */
-    addChild: function(child) { },
-
-    /**
-     * @return {?WebInspector.DOMNode}
-     */
-    node: function() { },
-
-    /**
-     * @return {?WebInspector.DOMNode}
-     */
-    nodeForSelfOrAncestor: function() { },
-
-    /**
-     * @return {number}
-     */
-    offsetX: function() { },
-
-    /**
-     * @return {number}
-     */
-    offsetY: function() { },
-
-    /**
-     * @return {number}
-     */
-    width: function() { },
-
-    /**
-     * @return {number}
-     */
-    height: function() { },
-
-    /**
-     * @return {?Array.<number>}
-     */
-    transform: function() { },
-
-    /**
-     * @return {!Array.<number>}
-     */
-    quad: function() { },
-
-    /**
-     * @return {!Array.<number>}
-     */
-    anchorPoint: function() { },
-
-    /**
-     * @return {boolean}
-     */
-    invisible: function() { },
-
-    /**
-     * @return {number}
-     */
-    paintCount: function() { },
-
-    /**
-     * @return {?DOMAgent.Rect}
-     */
-    lastPaintRect: function() { },
-
-    /**
-     * @return {!Array.<!LayerTreeAgent.ScrollRect>}
-     */
-    scrollRects: function() { },
-
-    /**
-     * @return {number}
-     */
-    gpuMemoryUsage: function() { },
-
-    /**
-     * @param {function(!Array.<string>)} callback
-     */
-    requestCompositingReasons: function(callback) { },
-
-    /**
-     * @return {boolean}
-     */
-    drawsContent: function() { }
-}
-
-/**
- * @constructor
- * @implements {WebInspector.Layer}
- * @param {?WebInspector.Target} target
- * @param {!LayerTreeAgent.Layer} layerPayload
- */
-WebInspector.AgentLayer = function(target, layerPayload)
-{
-    this._target = target;
-    this._reset(layerPayload);
-}
-
-WebInspector.AgentLayer.prototype = {
-    /**
-     * @override
-     * @return {string}
-     */
-    id: function()
-    {
-        return this._layerPayload.layerId;
-    },
-
-    /**
-     * @override
-     * @return {?string}
-     */
-    parentId: function()
-    {
-        return this._layerPayload.parentLayerId;
-    },
-
-    /**
-     * @override
-     * @return {?WebInspector.Layer}
-     */
-    parent: function()
-    {
-        return this._parent;
-    },
-
-    /**
-     * @override
-     * @return {boolean}
-     */
-    isRoot: function()
-    {
-        return !this.parentId();
-    },
-
-    /**
-     * @override
-     * @return {!Array.<!WebInspector.Layer>}
-     */
-    children: function()
-    {
-        return this._children;
-    },
-
-    /**
-     * @override
-     * @param {!WebInspector.Layer} child
-     */
-    addChild: function(child)
-    {
-        if (child._parent)
-            console.assert(false, "Child already has a parent");
-        this._children.push(child);
-        child._parent = this;
-    },
-
-    /**
-     * @param {?WebInspector.DOMNode} node
-     */
-    _setNode: function(node)
-    {
-        this._node = node;
-    },
-
-    /**
-     * @override
-     * @return {?WebInspector.DOMNode}
-     */
-    node: function()
-    {
-        return this._node;
-    },
-
-    /**
-     * @override
-     * @return {?WebInspector.DOMNode}
-     */
-    nodeForSelfOrAncestor: function()
-    {
-        for (var layer = this; layer; layer = layer._parent) {
-            if (layer._node)
-                return layer._node;
-        }
-        return null;
-    },
-
-    /**
-     * @override
-     * @return {number}
-     */
-    offsetX: function()
-    {
-        return this._layerPayload.offsetX;
-    },
-
-    /**
-     * @override
-     * @return {number}
-     */
-    offsetY: function()
-    {
-        return this._layerPayload.offsetY;
-    },
-
-    /**
-     * @override
-     * @return {number}
-     */
-    width: function()
-    {
-        return this._layerPayload.width;
-    },
-
-    /**
-     * @override
-     * @return {number}
-     */
-    height: function()
-    {
-        return this._layerPayload.height;
-    },
-
-    /**
-     * @override
-     * @return {?Array.<number>}
-     */
-    transform: function()
-    {
-        return this._layerPayload.transform;
-    },
-
-    /**
-     * @override
-     * @return {!Array.<number>}
-     */
-    quad: function()
-    {
-        return this._quad;
-    },
-
-    /**
-     * @override
-     * @return {!Array.<number>}
-     */
-    anchorPoint: function()
-    {
-        return [
-            this._layerPayload.anchorX || 0,
-            this._layerPayload.anchorY || 0,
-            this._layerPayload.anchorZ || 0,
-        ];
-    },
-
-    /**
-     * @override
-     * @return {boolean}
-     */
-    invisible: function()
-    {
-        return this._layerPayload.invisible;
-    },
-
-    /**
-     * @override
-     * @return {number}
-     */
-    paintCount: function()
-    {
-        return this._paintCount || this._layerPayload.paintCount;
-    },
-
-    /**
-     * @override
-     * @return {?DOMAgent.Rect}
-     */
-    lastPaintRect: function()
-    {
-        return this._lastPaintRect;
-    },
-
-    /**
-     * @override
-     * @return {!Array.<!LayerTreeAgent.ScrollRect>}
-     */
-    scrollRects: function()
-    {
-        return this._scrollRects;
-    },
-
-    /**
-     * @override
-     * @param {function(!Array.<string>)} callback
-     */
-    requestCompositingReasons: function(callback)
-    {
-        if (!this._target) {
-            callback([]);
-            return;
-        }
-
-        var wrappedCallback = InspectorBackend.wrapClientCallback(callback, "LayerTreeAgent.reasonsForCompositingLayer(): ", undefined, []);
-        this._target.layerTreeAgent().compositingReasons(this.id(), wrappedCallback);
-    },
-
-    /**
-     * @override
-     * @return {boolean}
-     */
-    drawsContent: function()
-    {
-        return this._layerPayload.drawsContent;
-    },
-
-    /**
-     * @override
-     * @return {number}
-     */
-    gpuMemoryUsage: function()
-    {
-        /**
-         * @const
-         */
-        var bytesPerPixel = 4;
-        return this.drawsContent() ? this.width() * this.height() * bytesPerPixel : 0;
-    },
-
-    /**
-     * @param {function(!WebInspector.PaintProfilerSnapshot=)} callback
-     */
-    requestSnapshot: function(callback)
-    {
-        if (!this._target) {
-            callback();
-            return;
-        }
-
-        var wrappedCallback = InspectorBackend.wrapClientCallback(callback, "LayerTreeAgent.makeSnapshot(): ", WebInspector.PaintProfilerSnapshot.bind(null, this._target));
-        this._target.layerTreeAgent().makeSnapshot(this.id(), wrappedCallback);
-    },
-
-    /**
-     * @param {!DOMAgent.Rect} rect
-     */
-    _didPaint: function(rect)
-    {
-        this._lastPaintRect = rect;
-        this._paintCount = this.paintCount() + 1;
-        this._image = null;
-    },
-
-    /**
-     * @param {!LayerTreeAgent.Layer} layerPayload
-     */
-    _reset: function(layerPayload)
-    {
-        /** @type {?WebInspector.DOMNode} */
-        this._node = null;
-        this._children = [];
-        this._parent = null;
-        this._paintCount = 0;
-        this._layerPayload = layerPayload;
-        this._image = null;
-        this._scrollRects = this._layerPayload.scrollRects || [];
-    },
-
-    /**
-     * @param {!Array.<number>} a
-     * @return {!CSSMatrix}
-     */
-    _matrixFromArray: function(a)
-    {
-        function toFixed9(x) { return x.toFixed(9); }
-        return new WebKitCSSMatrix("matrix3d(" + a.map(toFixed9).join(",") + ")");
-    },
-
-    /**
-     * @param {!CSSMatrix} parentTransform
-     * @return {!CSSMatrix}
-     */
-    _calculateTransformToViewport: function(parentTransform)
-    {
-        var offsetMatrix = new WebKitCSSMatrix().translate(this._layerPayload.offsetX, this._layerPayload.offsetY);
-        var matrix = offsetMatrix;
-
-        if (this._layerPayload.transform) {
-            var transformMatrix = this._matrixFromArray(this._layerPayload.transform);
-            var anchorVector = new WebInspector.Geometry.Vector(this._layerPayload.width * this.anchorPoint()[0], this._layerPayload.height * this.anchorPoint()[1], this.anchorPoint()[2]);
-            var anchorPoint = WebInspector.Geometry.multiplyVectorByMatrixAndNormalize(anchorVector, matrix);
-            var anchorMatrix = new WebKitCSSMatrix().translate(-anchorPoint.x, -anchorPoint.y, -anchorPoint.z);
-            matrix = anchorMatrix.inverse().multiply(transformMatrix.multiply(anchorMatrix.multiply(matrix)));
-        }
-
-        matrix = parentTransform.multiply(matrix);
-        return matrix;
-    },
-
-    /**
-     * @param {number} width
-     * @param {number} height
-     * @return {!Array.<number>}
-     */
-    _createVertexArrayForRect: function(width, height)
-    {
-        return [0, 0, 0, width, 0, 0, width, height, 0, 0, height, 0];
-    },
-
-    /**
-     * @param {!CSSMatrix} parentTransform
-     */
-    _calculateQuad: function(parentTransform)
-    {
-        var matrix = this._calculateTransformToViewport(parentTransform);
-        this._quad = [];
-        var vertices = this._createVertexArrayForRect(this._layerPayload.width, this._layerPayload.height);
-        for (var i = 0; i < 4; ++i) {
-            var point = WebInspector.Geometry.multiplyVectorByMatrixAndNormalize(new WebInspector.Geometry.Vector(vertices[i * 3], vertices[i * 3 + 1], vertices[i * 3 + 2]), matrix);
-            this._quad.push(point.x, point.y);
-        }
-
-        function calculateQuadForLayer(layer)
-        {
-            layer._calculateQuad(matrix);
-        }
-
-        this._children.forEach(calculateQuadForLayer);
-    }
-}
-
-/**
- * @constructor
- * @param {!WebInspector.TracingLayerPayload} payload
- * @implements {WebInspector.Layer}
- */
-WebInspector.TracingLayer = function(payload)
-{
-    this._reset(payload);
-}
-
-WebInspector.TracingLayer.prototype = {
-    /**
-     * @param {!WebInspector.TracingLayerPayload} payload
-     */
-    _reset: function(payload)
-    {
-        /** @type {?WebInspector.DOMNode} */
-        this._node = null;
-        this._layerId = String(payload.layer_id);
-        this._offsetX = payload.position[0];
-        this._offsetY = payload.position[1];
-        this._width = payload.bounds.width;
-        this._height = payload.bounds.height;
-        this._children = [];
-        this._parentLayerId = null;
-        this._parent = null;
-        this._quad = payload.layer_quad || [];
-        this._createScrollRects(payload);
-        this._compositingReasons = payload.compositing_reasons || [];
-        this._drawsContent = !!payload.draws_content;
-        this._gpuMemoryUsage = payload.gpu_memory_usage;
-    },
-
-    /**
-     * @override
-     * @return {string}
-     */
-    id: function()
-    {
-        return this._layerId;
-    },
-
-    /**
-     * @override
-     * @return {?string}
-     */
-    parentId: function()
-    {
-        return this._parentLayerId;
-    },
-
-    /**
-     * @override
-     * @return {?WebInspector.Layer}
-     */
-    parent: function()
-    {
-        return this._parent;
-    },
-
-    /**
-     * @override
-     * @return {boolean}
-     */
-    isRoot: function()
-    {
-        return !this.parentId();
-    },
-
-    /**
-     * @override
-     * @return {!Array.<!WebInspector.Layer>}
-     */
-    children: function()
-    {
-        return this._children;
-    },
-
-    /**
-     * @override
-     * @param {!WebInspector.Layer} child
-     */
-    addChild: function(child)
-    {
-        if (child._parent)
-            console.assert(false, "Child already has a parent");
-        this._children.push(child);
-        child._parent = this;
-        child._parentLayerId = this._layerId;
-    },
-
-
-    /**
-     * @param {?WebInspector.DOMNode} node
-     */
-    _setNode: function(node)
-    {
-        this._node = node;
-    },
-
-    /**
-     * @override
-     * @return {?WebInspector.DOMNode}
-     */
-    node: function()
-    {
-        return this._node;
-    },
-
-    /**
-     * @override
-     * @return {?WebInspector.DOMNode}
-     */
-    nodeForSelfOrAncestor: function()
-    {
-        for (var layer = this; layer; layer = layer._parent) {
-            if (layer._node)
-                return layer._node;
-        }
-        return null;
-    },
-
-    /**
-     * @override
-     * @return {number}
-     */
-    offsetX: function()
-    {
-        return this._offsetX;
-    },
-
-    /**
-     * @override
-     * @return {number}
-     */
-    offsetY: function()
-    {
-        return this._offsetY;
-    },
-
-    /**
-     * @override
-     * @return {number}
-     */
-    width: function()
-    {
-        return this._width;
-    },
-
-    /**
-     * @override
-     * @return {number}
-     */
-    height: function()
-    {
-        return this._height;
-    },
-
-    /**
-     * @override
-     * @return {?Array.<number>}
-     */
-    transform: function()
-    {
-        return null;
-    },
-
-    /**
-     * @override
-     * @return {!Array.<number>}
-     */
-    quad: function()
-    {
-        return this._quad;
-    },
-
-    /**
-     * @override
-     * @return {!Array.<number>}
-     */
-    anchorPoint: function()
-    {
-        return [0.5, 0.5, 0];
-    },
-
-    /**
-     * @override
-     * @return {boolean}
-     */
-    invisible: function()
-    {
-        return false;
-    },
-
-    /**
-     * @override
-     * @return {number}
-     */
-    paintCount: function()
-    {
-        return 0;
-    },
-
-    /**
-     * @override
-     * @return {?DOMAgent.Rect}
-     */
-    lastPaintRect: function()
-    {
-        return null;
-    },
-
-    /**
-     * @override
-     * @return {!Array.<!LayerTreeAgent.ScrollRect>}
-     */
-    scrollRects: function()
-    {
-        return this._scrollRects;
-    },
-
-    /**
-     * @override
-     * @return {number}
-     */
-    gpuMemoryUsage: function()
-    {
-        return this._gpuMemoryUsage;
-    },
-
-    /**
-     * @param {!Array.<number>} params
-     * @param {string} type
-     * @return {!Object}
-     */
-    _scrollRectsFromParams: function(params, type)
-    {
-        return {rect: {x: params[0], y: params[1], width: params[2], height: params[3]}, type: type};
-    },
-
-    /**
-     * @param {!WebInspector.TracingLayerPayload} payload
-     */
-    _createScrollRects: function(payload)
-    {
-        this._scrollRects = [];
-        if (payload.non_fast_scrollable_region)
-            this._scrollRects.push(this._scrollRectsFromParams(payload.non_fast_scrollable_region, WebInspector.LayerTreeModel.ScrollRectType.NonFastScrollable.name));
-        if (payload.touch_event_handler_region)
-            this._scrollRects.push(this._scrollRectsFromParams(payload.touch_event_handler_region, WebInspector.LayerTreeModel.ScrollRectType.TouchEventHandler.name));
-        if (payload.wheel_event_handler_region)
-            this._scrollRects.push(this._scrollRectsFromParams(payload.wheel_event_handler_region, WebInspector.LayerTreeModel.ScrollRectType.WheelEventHandler.name));
-        if (payload.scroll_event_handler_region)
-            this._scrollRects.push(this._scrollRectsFromParams(payload.scroll_event_handler_region, WebInspector.LayerTreeModel.ScrollRectType.RepaintsOnScroll.name));
-    },
-
-    /**
-     * @override
-     * @param {function(!Array.<string>)} callback
-     */
-    requestCompositingReasons: function(callback)
-    {
-        callback(this._compositingReasons);
-    },
-
-    /**
-     * @override
-     * @return {boolean}
-     */
-    drawsContent: function()
-    {
-        return this._drawsContent;
-    }
-}
-
-/**
- * @constructor
- * @param {?WebInspector.Target} target
- */
-WebInspector.DeferredLayerTree = function(target)
-{
-    this._target = target;
-}
-
-WebInspector.DeferredLayerTree.prototype = {
-    /**
-     * @param {function(!WebInspector.LayerTreeBase)} callback
-     */
-    resolve: function(callback) { },
-
-    /**
-     * @return {?WebInspector.Target}
-     */
-    target: function()
-    {
-        return this._target;
-    }
-};
-
-/**
- * @constructor
- * @implements {LayerTreeAgent.Dispatcher}
- * @param {!WebInspector.LayerTreeModel} layerTreeModel
- */
-WebInspector.LayerTreeDispatcher = function(layerTreeModel)
-{
-    this._layerTreeModel = layerTreeModel;
-}
-
-WebInspector.LayerTreeDispatcher.prototype = {
-    /**
-     * @override
-     * @param {!Array.<!LayerTreeAgent.Layer>=} layers
-     */
-    layerTreeDidChange: function(layers)
-    {
-        this._layerTreeModel._layerTreeChanged(layers || null);
-    },
-
-    /**
-     * @override
-     * @param {!LayerTreeAgent.LayerId} layerId
-     * @param {!DOMAgent.Rect} clipRect
-     */
-    layerPainted: function(layerId, clipRect)
-    {
-        this._layerTreeModel._layerPainted(layerId, clipRect);
-    }
-}
diff --git a/third_party/WebKit/Source/devtools/front_end/sdk/Target.js b/third_party/WebKit/Source/devtools/front_end/sdk/Target.js
index 83c461f..a692d26 100644
--- a/third_party/WebKit/Source/devtools/front_end/sdk/Target.js
+++ b/third_party/WebKit/Source/devtools/front_end/sdk/Target.js
@@ -145,8 +145,6 @@
         this.cpuProfilerModel = new WebInspector.CPUProfilerModel(this);
         /** @type {!WebInspector.HeapProfilerModel} */
         this.heapProfilerModel = new WebInspector.HeapProfilerModel(this);
-        /** @type {!WebInspector.LayerTreeModel} */
-        this.layerTreeModel = new WebInspector.LayerTreeModel(this);
 
         this.tracingManager = new WebInspector.TracingManager(this);
 
diff --git a/third_party/WebKit/Source/devtools/front_end/sdk/module.json b/third_party/WebKit/Source/devtools/front_end/sdk/module.json
index 569ad7f..9c64ea4a 100644
--- a/third_party/WebKit/Source/devtools/front_end/sdk/module.json
+++ b/third_party/WebKit/Source/devtools/front_end/sdk/module.json
@@ -59,7 +59,6 @@
         "DOMModel.js",
         "DebuggerModel.js",
         "HAREntry.js",
-        "LayerTreeModel.js",
         "NetworkLog.js",
         "ServiceWorkerManager.js",
         "TracingManager.js",
diff --git a/third_party/WebKit/Source/devtools/front_end/timeline/LayerTreeModel.js b/third_party/WebKit/Source/devtools/front_end/timeline/LayerTreeModel.js
new file mode 100644
index 0000000..a22642d
--- /dev/null
+++ b/third_party/WebKit/Source/devtools/front_end/timeline/LayerTreeModel.js
@@ -0,0 +1,1282 @@
+/*
+ * Copyright (C) 2013 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ *     * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** @typedef {!{
+        bounds: {height: number, width: number},
+        children: Array.<!WebInspector.TracingLayerPayload>,
+        layer_id: number,
+        position: Array.<number>,
+        scroll_offset: Array.<number>,
+        layer_quad: Array.<number>,
+        draws_content: number,
+        gpu_memory_usage: number,
+        transform: Array.<number>,
+        owner_node: number,
+        compositing_reasons: Array.<string>
+    }}
+*/
+WebInspector.TracingLayerPayload;
+
+/** @typedef {!{
+        id: string,
+        layer_id: number,
+        gpu_memory_usage: number,
+        content_rect: !Array.<number>
+    }}
+*/
+WebInspector.TracingLayerTile;
+
+/**
+  * @constructor
+  * @extends {WebInspector.SDKModel}
+  */
+WebInspector.LayerTreeModel = function(target)
+{
+    WebInspector.SDKModel.call(this, WebInspector.LayerTreeModel, target);
+    target.registerLayerTreeDispatcher(new WebInspector.LayerTreeDispatcher(this));
+    WebInspector.targetManager.addEventListener(WebInspector.TargetManager.Events.MainFrameNavigated, this._onMainFrameNavigated, this);
+    /** @type {?WebInspector.LayerTreeBase} */
+    this._layerTree = null;
+}
+
+WebInspector.LayerTreeModel.Events = {
+    LayerTreeChanged: "LayerTreeChanged",
+    LayerPainted: "LayerPainted",
+}
+
+WebInspector.LayerTreeModel.ScrollRectType = {
+    NonFastScrollable: {name: "NonFastScrollable", description: "Non fast scrollable"},
+    TouchEventHandler: {name: "TouchEventHandler", description: "Touch event handler"},
+    WheelEventHandler: {name: "WheelEventHandler", description: "Wheel event handler"},
+    RepaintsOnScroll: {name: "RepaintsOnScroll", description: "Repaints on scroll"}
+}
+
+WebInspector.LayerTreeModel.prototype = {
+    disable: function()
+    {
+        if (!this._enabled)
+            return;
+        this._enabled = false;
+        this._layerTree = null;
+        this.target().layerTreeAgent().disable();
+    },
+
+    enable: function()
+    {
+        if (this._enabled)
+            return;
+        this._enabled = true;
+        this._forceEnable();
+    },
+
+    _forceEnable: function()
+    {
+        this._layerTree = new WebInspector.AgentLayerTree(this.target());
+        this._lastPaintRectByLayerId = {};
+        this.target().layerTreeAgent().enable();
+    },
+
+    /**
+     * @param {!WebInspector.LayerTreeBase} layerTree
+     */
+    setLayerTree: function(layerTree)
+    {
+        this.disable();
+        this._layerTree = layerTree;
+        this.dispatchEventToListeners(WebInspector.LayerTreeModel.Events.LayerTreeChanged);
+    },
+
+    /**
+     * @return {?WebInspector.LayerTreeBase}
+     */
+    layerTree: function()
+    {
+        return this._layerTree;
+    },
+
+    /**
+     * @param {?Array.<!LayerTreeAgent.Layer>} layers
+     */
+    _layerTreeChanged: function(layers)
+    {
+        if (!this._enabled)
+            return;
+        var layerTree = /** @type {!WebInspector.AgentLayerTree} */ (this._layerTree);
+        layerTree.setLayers(layers, onLayersSet.bind(this));
+
+        /**
+         * @this {WebInspector.LayerTreeModel}
+         */
+        function onLayersSet()
+        {
+            for (var layerId in this._lastPaintRectByLayerId) {
+                var lastPaintRect = this._lastPaintRectByLayerId[layerId];
+                var layer = layerTree.layerById(layerId);
+                if (layer)
+                    layer._lastPaintRect = lastPaintRect;
+            }
+            this._lastPaintRectByLayerId = {};
+
+            this.dispatchEventToListeners(WebInspector.LayerTreeModel.Events.LayerTreeChanged);
+        }
+    },
+
+    /**
+     * @param {!LayerTreeAgent.LayerId} layerId
+     * @param {!DOMAgent.Rect} clipRect
+     */
+    _layerPainted: function(layerId, clipRect)
+    {
+        if (!this._enabled)
+            return;
+        var layerTree = /** @type {!WebInspector.AgentLayerTree} */ (this._layerTree);
+        var layer = layerTree.layerById(layerId);
+        if (!layer) {
+            this._lastPaintRectByLayerId[layerId] = clipRect;
+            return;
+        }
+        layer._didPaint(clipRect);
+        this.dispatchEventToListeners(WebInspector.LayerTreeModel.Events.LayerPainted, layer);
+    },
+
+    _onMainFrameNavigated: function()
+    {
+        if (this._enabled)
+            this._forceEnable();
+    },
+
+    __proto__: WebInspector.SDKModel.prototype
+}
+
+/**
+  * @constructor
+  * @param {?WebInspector.Target} target
+  */
+WebInspector.LayerTreeBase = function(target)
+{
+    this._target = target;
+    this._domModel = target ? WebInspector.DOMModel.fromTarget(target) : null;
+    this._layersById = {};
+    /** @type Map<number, ?WebInspector.DOMNode> */
+    this._backendNodeIdToNode = new Map();
+    this._reset();
+}
+
+WebInspector.LayerTreeBase.prototype = {
+    _reset: function()
+    {
+        this._root = null;
+        this._contentRoot = null;
+    },
+
+    /**
+     * @return {?WebInspector.Target}
+     */
+    target: function()
+    {
+        return this._target;
+    },
+
+    /**
+     * @return {?WebInspector.Layer}
+     */
+    root: function()
+    {
+        return this._root;
+    },
+
+    /**
+     * @return {?WebInspector.Layer}
+     */
+    contentRoot: function()
+    {
+        return this._contentRoot;
+    },
+
+    /**
+     * @param {function(!WebInspector.Layer)} callback
+     * @param {?WebInspector.Layer=} root
+     * @return {boolean}
+     */
+    forEachLayer: function(callback, root)
+    {
+        if (!root) {
+            root = this.root();
+            if (!root)
+                return false;
+        }
+        return callback(root) || root.children().some(this.forEachLayer.bind(this, callback));
+    },
+
+    /**
+     * @param {string} id
+     * @return {?WebInspector.Layer}
+     */
+    layerById: function(id)
+    {
+        return this._layersById[id] || null;
+    },
+
+    /**
+     * @param {!Set<number>} requestedNodeIds
+     * @param {function()} callback
+     */
+    _resolveBackendNodeIds: function(requestedNodeIds, callback)
+    {
+        if (!requestedNodeIds.size || !this._domModel) {
+            callback();
+            return;
+        }
+        if (this._domModel)
+            this._domModel.pushNodesByBackendIdsToFrontend(requestedNodeIds, populateBackendNodeMap.bind(this));
+
+        /**
+         * @this {WebInspector.LayerTreeBase}
+         * @param {?Map<number, ?WebInspector.DOMNode>} nodesMap
+         */
+        function populateBackendNodeMap(nodesMap)
+        {
+            if (nodesMap) {
+                for (var entry of nodesMap)
+                    this._backendNodeIdToNode.set(entry[0], entry[1]);
+            }
+            callback();
+        }
+    },
+
+    /**
+     * @param {!Object} viewportSize
+     */
+    setViewportSize: function(viewportSize)
+    {
+        this._viewportSize = viewportSize;
+    },
+
+    /**
+     * @return {!Object | undefined}
+     */
+    viewportSize: function()
+    {
+        return this._viewportSize;
+    },
+
+    /**
+     * @param {number} id
+     * @return {?WebInspector.DOMNode}
+     */
+    _nodeForId: function(id)
+    {
+        return this._domModel ? this._domModel.nodeForId(id) : null;
+    }
+}
+
+/**
+  * @constructor
+  * @extends {WebInspector.LayerTreeBase}
+  * @param {?WebInspector.Target} target
+  */
+WebInspector.TracingLayerTree = function(target)
+{
+    WebInspector.LayerTreeBase.call(this, target);
+    /** @type {!Map.<string, !WebInspector.TracingLayerTile>} */
+    this._tileById = new Map();
+}
+
+WebInspector.TracingLayerTree.prototype = {
+    /**
+     * @param {!WebInspector.TracingLayerPayload} root
+     * @param {function()} callback
+     */
+    setLayers: function(root, callback)
+    {
+        var idsToResolve = new Set();
+        this._extractNodeIdsToResolve(idsToResolve, {}, root);
+        this._resolveBackendNodeIds(idsToResolve, onBackendNodeIdsResolved.bind(this));
+
+        /**
+         * @this {WebInspector.TracingLayerTree}
+         */
+        function onBackendNodeIdsResolved()
+        {
+            var oldLayersById = this._layersById;
+            this._layersById = {};
+            this._contentRoot = null;
+            this._root = this._innerSetLayers(oldLayersById, root);
+            callback();
+        }
+    },
+
+    /**
+     * @param {!Array.<!WebInspector.TracingLayerTile>} tiles
+     */
+    setTiles: function(tiles)
+    {
+        this._tileById = new Map();
+        for (var tile of tiles)
+            this._tileById.set(tile.id, tile);
+    },
+
+    /**
+     * @param {string} id
+     * @return {?WebInspector.TracingLayerTile}
+     */
+    tileById: function(id)
+    {
+        return this._tileById.get(id) || null;
+    },
+
+    /**
+     * @param {!Object.<(string|number), !WebInspector.Layer>} oldLayersById
+     * @param {!WebInspector.TracingLayerPayload} payload
+     * @return {!WebInspector.TracingLayer}
+     */
+    _innerSetLayers: function(oldLayersById, payload)
+    {
+        var layer = /** @type {?WebInspector.TracingLayer} */ (oldLayersById[payload.layer_id]);
+        if (layer)
+            layer._reset(payload);
+        else
+            layer = new WebInspector.TracingLayer(payload);
+        this._layersById[payload.layer_id] = layer;
+        if (payload.owner_node)
+            layer._setNode(this._backendNodeIdToNode.get(payload.owner_node) || null);
+        if (!this._contentRoot && layer.drawsContent())
+            this._contentRoot = layer;
+        for (var i = 0; payload.children && i < payload.children.length; ++i)
+            layer.addChild(this._innerSetLayers(oldLayersById, payload.children[i]));
+        return layer;
+    },
+
+    /**
+     * @param {!Set<number>} nodeIdsToResolve
+     * @param {!Object} seenNodeIds
+     * @param {!WebInspector.TracingLayerPayload} payload
+     */
+    _extractNodeIdsToResolve: function(nodeIdsToResolve, seenNodeIds, payload)
+    {
+        var backendNodeId = payload.owner_node;
+        if (backendNodeId && !this._backendNodeIdToNode[backendNodeId])
+            nodeIdsToResolve.add(backendNodeId);
+        for (var i = 0; payload.children && i < payload.children.length; ++i)
+            this._extractNodeIdsToResolve(nodeIdsToResolve, seenNodeIds, payload.children[i]);
+    },
+
+    __proto__: WebInspector.LayerTreeBase.prototype
+}
+
+/**
+  * @constructor
+  * @param {?WebInspector.Target} target
+  * @extends {WebInspector.LayerTreeBase}
+  */
+WebInspector.AgentLayerTree = function(target)
+{
+    WebInspector.LayerTreeBase.call(this, target);
+}
+
+WebInspector.AgentLayerTree.prototype = {
+    /**
+     * @param {?Array.<!LayerTreeAgent.Layer>} payload
+     * @param {function()} callback
+     */
+    setLayers: function(payload, callback)
+    {
+        if (!payload) {
+            onBackendNodeIdsResolved.call(this);
+            return;
+        }
+
+        var idsToResolve = new Set();
+        for (var i = 0; i < payload.length; ++i) {
+            var backendNodeId = payload[i].backendNodeId;
+            if (!backendNodeId || this._backendNodeIdToNode.has(backendNodeId))
+                continue;
+            idsToResolve.add(backendNodeId);
+        }
+        this._resolveBackendNodeIds(idsToResolve, onBackendNodeIdsResolved.bind(this));
+
+        /**
+         * @this {WebInspector.AgentLayerTree}
+         */
+        function onBackendNodeIdsResolved()
+        {
+            this._innerSetLayers(payload);
+            callback();
+        }
+    },
+
+    /**
+     * @param {?Array.<!LayerTreeAgent.Layer>} layers
+     */
+    _innerSetLayers: function(layers)
+    {
+        this._reset();
+        // Payload will be null when not in the composited mode.
+        if (!layers)
+            return;
+        var oldLayersById = this._layersById;
+        this._layersById = {};
+        for (var i = 0; i < layers.length; ++i) {
+            var layerId = layers[i].layerId;
+            var layer = oldLayersById[layerId];
+            if (layer)
+                layer._reset(layers[i]);
+            else
+                layer = new WebInspector.AgentLayer(this._target, layers[i]);
+            this._layersById[layerId] = layer;
+            var backendNodeId = layers[i].backendNodeId;
+            if (backendNodeId)
+                layer._setNode(this._backendNodeIdToNode.get(backendNodeId));
+            if (!this._contentRoot && layer.drawsContent())
+                this._contentRoot = layer;
+            var parentId = layer.parentId();
+            if (parentId) {
+                var parent = this._layersById[parentId];
+                if (!parent)
+                    console.assert(parent, "missing parent " + parentId + " for layer " + layerId);
+                parent.addChild(layer);
+            } else {
+                if (this._root)
+                    console.assert(false, "Multiple root layers");
+                this._root = layer;
+            }
+        }
+        if (this._root)
+            this._root._calculateQuad(new WebKitCSSMatrix());
+    },
+
+    __proto__: WebInspector.LayerTreeBase.prototype
+}
+
+/**
+ * @interface
+ */
+WebInspector.Layer = function()
+{
+}
+
+WebInspector.Layer.prototype = {
+    /**
+     * @return {string}
+     */
+    id: function() { },
+
+    /**
+     * @return {?string}
+     */
+    parentId: function() { },
+
+    /**
+     * @return {?WebInspector.Layer}
+     */
+    parent: function() { },
+
+    /**
+     * @return {boolean}
+     */
+    isRoot: function() { },
+
+    /**
+     * @return {!Array.<!WebInspector.Layer>}
+     */
+    children: function() { },
+
+    /**
+     * @param {!WebInspector.Layer} child
+     */
+    addChild: function(child) { },
+
+    /**
+     * @return {?WebInspector.DOMNode}
+     */
+    node: function() { },
+
+    /**
+     * @return {?WebInspector.DOMNode}
+     */
+    nodeForSelfOrAncestor: function() { },
+
+    /**
+     * @return {number}
+     */
+    offsetX: function() { },
+
+    /**
+     * @return {number}
+     */
+    offsetY: function() { },
+
+    /**
+     * @return {number}
+     */
+    width: function() { },
+
+    /**
+     * @return {number}
+     */
+    height: function() { },
+
+    /**
+     * @return {?Array.<number>}
+     */
+    transform: function() { },
+
+    /**
+     * @return {!Array.<number>}
+     */
+    quad: function() { },
+
+    /**
+     * @return {!Array.<number>}
+     */
+    anchorPoint: function() { },
+
+    /**
+     * @return {boolean}
+     */
+    invisible: function() { },
+
+    /**
+     * @return {number}
+     */
+    paintCount: function() { },
+
+    /**
+     * @return {?DOMAgent.Rect}
+     */
+    lastPaintRect: function() { },
+
+    /**
+     * @return {!Array.<!LayerTreeAgent.ScrollRect>}
+     */
+    scrollRects: function() { },
+
+    /**
+     * @return {number}
+     */
+    gpuMemoryUsage: function() { },
+
+    /**
+     * @param {function(!Array.<string>)} callback
+     */
+    requestCompositingReasons: function(callback) { },
+
+    /**
+     * @return {boolean}
+     */
+    drawsContent: function() { }
+}
+
+/**
+ * @constructor
+ * @implements {WebInspector.Layer}
+ * @param {?WebInspector.Target} target
+ * @param {!LayerTreeAgent.Layer} layerPayload
+ */
+WebInspector.AgentLayer = function(target, layerPayload)
+{
+    this._target = target;
+    this._reset(layerPayload);
+}
+
+WebInspector.AgentLayer.prototype = {
+    /**
+     * @override
+     * @return {string}
+     */
+    id: function()
+    {
+        return this._layerPayload.layerId;
+    },
+
+    /**
+     * @override
+     * @return {?string}
+     */
+    parentId: function()
+    {
+        return this._layerPayload.parentLayerId;
+    },
+
+    /**
+     * @override
+     * @return {?WebInspector.Layer}
+     */
+    parent: function()
+    {
+        return this._parent;
+    },
+
+    /**
+     * @override
+     * @return {boolean}
+     */
+    isRoot: function()
+    {
+        return !this.parentId();
+    },
+
+    /**
+     * @override
+     * @return {!Array.<!WebInspector.Layer>}
+     */
+    children: function()
+    {
+        return this._children;
+    },
+
+    /**
+     * @override
+     * @param {!WebInspector.Layer} child
+     */
+    addChild: function(child)
+    {
+        if (child._parent)
+            console.assert(false, "Child already has a parent");
+        this._children.push(child);
+        child._parent = this;
+    },
+
+    /**
+     * @param {?WebInspector.DOMNode} node
+     */
+    _setNode: function(node)
+    {
+        this._node = node;
+    },
+
+    /**
+     * @override
+     * @return {?WebInspector.DOMNode}
+     */
+    node: function()
+    {
+        return this._node;
+    },
+
+    /**
+     * @override
+     * @return {?WebInspector.DOMNode}
+     */
+    nodeForSelfOrAncestor: function()
+    {
+        for (var layer = this; layer; layer = layer._parent) {
+            if (layer._node)
+                return layer._node;
+        }
+        return null;
+    },
+
+    /**
+     * @override
+     * @return {number}
+     */
+    offsetX: function()
+    {
+        return this._layerPayload.offsetX;
+    },
+
+    /**
+     * @override
+     * @return {number}
+     */
+    offsetY: function()
+    {
+        return this._layerPayload.offsetY;
+    },
+
+    /**
+     * @override
+     * @return {number}
+     */
+    width: function()
+    {
+        return this._layerPayload.width;
+    },
+
+    /**
+     * @override
+     * @return {number}
+     */
+    height: function()
+    {
+        return this._layerPayload.height;
+    },
+
+    /**
+     * @override
+     * @return {?Array.<number>}
+     */
+    transform: function()
+    {
+        return this._layerPayload.transform;
+    },
+
+    /**
+     * @override
+     * @return {!Array.<number>}
+     */
+    quad: function()
+    {
+        return this._quad;
+    },
+
+    /**
+     * @override
+     * @return {!Array.<number>}
+     */
+    anchorPoint: function()
+    {
+        return [
+            this._layerPayload.anchorX || 0,
+            this._layerPayload.anchorY || 0,
+            this._layerPayload.anchorZ || 0,
+        ];
+    },
+
+    /**
+     * @override
+     * @return {boolean}
+     */
+    invisible: function()
+    {
+        return this._layerPayload.invisible;
+    },
+
+    /**
+     * @override
+     * @return {number}
+     */
+    paintCount: function()
+    {
+        return this._paintCount || this._layerPayload.paintCount;
+    },
+
+    /**
+     * @override
+     * @return {?DOMAgent.Rect}
+     */
+    lastPaintRect: function()
+    {
+        return this._lastPaintRect;
+    },
+
+    /**
+     * @override
+     * @return {!Array.<!LayerTreeAgent.ScrollRect>}
+     */
+    scrollRects: function()
+    {
+        return this._scrollRects;
+    },
+
+    /**
+     * @override
+     * @param {function(!Array.<string>)} callback
+     */
+    requestCompositingReasons: function(callback)
+    {
+        if (!this._target) {
+            callback([]);
+            return;
+        }
+
+        var wrappedCallback = InspectorBackend.wrapClientCallback(callback, "LayerTreeAgent.reasonsForCompositingLayer(): ", undefined, []);
+        this._target.layerTreeAgent().compositingReasons(this.id(), wrappedCallback);
+    },
+
+    /**
+     * @override
+     * @return {boolean}
+     */
+    drawsContent: function()
+    {
+        return this._layerPayload.drawsContent;
+    },
+
+    /**
+     * @override
+     * @return {number}
+     */
+    gpuMemoryUsage: function()
+    {
+        /**
+         * @const
+         */
+        var bytesPerPixel = 4;
+        return this.drawsContent() ? this.width() * this.height() * bytesPerPixel : 0;
+    },
+
+    /**
+     * @param {function(!WebInspector.PaintProfilerSnapshot=)} callback
+     */
+    requestSnapshot: function(callback)
+    {
+        if (!this._target) {
+            callback();
+            return;
+        }
+
+        var wrappedCallback = InspectorBackend.wrapClientCallback(callback, "LayerTreeAgent.makeSnapshot(): ", WebInspector.PaintProfilerSnapshot.bind(null, this._target));
+        this._target.layerTreeAgent().makeSnapshot(this.id(), wrappedCallback);
+    },
+
+    /**
+     * @param {!DOMAgent.Rect} rect
+     */
+    _didPaint: function(rect)
+    {
+        this._lastPaintRect = rect;
+        this._paintCount = this.paintCount() + 1;
+        this._image = null;
+    },
+
+    /**
+     * @param {!LayerTreeAgent.Layer} layerPayload
+     */
+    _reset: function(layerPayload)
+    {
+        /** @type {?WebInspector.DOMNode} */
+        this._node = null;
+        this._children = [];
+        this._parent = null;
+        this._paintCount = 0;
+        this._layerPayload = layerPayload;
+        this._image = null;
+        this._scrollRects = this._layerPayload.scrollRects || [];
+    },
+
+    /**
+     * @param {!Array.<number>} a
+     * @return {!CSSMatrix}
+     */
+    _matrixFromArray: function(a)
+    {
+        function toFixed9(x) { return x.toFixed(9); }
+        return new WebKitCSSMatrix("matrix3d(" + a.map(toFixed9).join(",") + ")");
+    },
+
+    /**
+     * @param {!CSSMatrix} parentTransform
+     * @return {!CSSMatrix}
+     */
+    _calculateTransformToViewport: function(parentTransform)
+    {
+        var offsetMatrix = new WebKitCSSMatrix().translate(this._layerPayload.offsetX, this._layerPayload.offsetY);
+        var matrix = offsetMatrix;
+
+        if (this._layerPayload.transform) {
+            var transformMatrix = this._matrixFromArray(this._layerPayload.transform);
+            var anchorVector = new WebInspector.Geometry.Vector(this._layerPayload.width * this.anchorPoint()[0], this._layerPayload.height * this.anchorPoint()[1], this.anchorPoint()[2]);
+            var anchorPoint = WebInspector.Geometry.multiplyVectorByMatrixAndNormalize(anchorVector, matrix);
+            var anchorMatrix = new WebKitCSSMatrix().translate(-anchorPoint.x, -anchorPoint.y, -anchorPoint.z);
+            matrix = anchorMatrix.inverse().multiply(transformMatrix.multiply(anchorMatrix.multiply(matrix)));
+        }
+
+        matrix = parentTransform.multiply(matrix);
+        return matrix;
+    },
+
+    /**
+     * @param {number} width
+     * @param {number} height
+     * @return {!Array.<number>}
+     */
+    _createVertexArrayForRect: function(width, height)
+    {
+        return [0, 0, 0, width, 0, 0, width, height, 0, 0, height, 0];
+    },
+
+    /**
+     * @param {!CSSMatrix} parentTransform
+     */
+    _calculateQuad: function(parentTransform)
+    {
+        var matrix = this._calculateTransformToViewport(parentTransform);
+        this._quad = [];
+        var vertices = this._createVertexArrayForRect(this._layerPayload.width, this._layerPayload.height);
+        for (var i = 0; i < 4; ++i) {
+            var point = WebInspector.Geometry.multiplyVectorByMatrixAndNormalize(new WebInspector.Geometry.Vector(vertices[i * 3], vertices[i * 3 + 1], vertices[i * 3 + 2]), matrix);
+            this._quad.push(point.x, point.y);
+        }
+
+        function calculateQuadForLayer(layer)
+        {
+            layer._calculateQuad(matrix);
+        }
+
+        this._children.forEach(calculateQuadForLayer);
+    }
+}
+
+/**
+ * @constructor
+ * @param {!WebInspector.TracingLayerPayload} payload
+ * @implements {WebInspector.Layer}
+ */
+WebInspector.TracingLayer = function(payload)
+{
+    this._reset(payload);
+}
+
+WebInspector.TracingLayer.prototype = {
+    /**
+     * @param {!WebInspector.TracingLayerPayload} payload
+     */
+    _reset: function(payload)
+    {
+        /** @type {?WebInspector.DOMNode} */
+        this._node = null;
+        this._layerId = String(payload.layer_id);
+        this._offsetX = payload.position[0];
+        this._offsetY = payload.position[1];
+        this._width = payload.bounds.width;
+        this._height = payload.bounds.height;
+        this._children = [];
+        this._parentLayerId = null;
+        this._parent = null;
+        this._quad = payload.layer_quad || [];
+        this._createScrollRects(payload);
+        this._compositingReasons = payload.compositing_reasons || [];
+        this._drawsContent = !!payload.draws_content;
+        this._gpuMemoryUsage = payload.gpu_memory_usage;
+    },
+
+    /**
+     * @override
+     * @return {string}
+     */
+    id: function()
+    {
+        return this._layerId;
+    },
+
+    /**
+     * @override
+     * @return {?string}
+     */
+    parentId: function()
+    {
+        return this._parentLayerId;
+    },
+
+    /**
+     * @override
+     * @return {?WebInspector.Layer}
+     */
+    parent: function()
+    {
+        return this._parent;
+    },
+
+    /**
+     * @override
+     * @return {boolean}
+     */
+    isRoot: function()
+    {
+        return !this.parentId();
+    },
+
+    /**
+     * @override
+     * @return {!Array.<!WebInspector.Layer>}
+     */
+    children: function()
+    {
+        return this._children;
+    },
+
+    /**
+     * @override
+     * @param {!WebInspector.Layer} child
+     */
+    addChild: function(child)
+    {
+        if (child._parent)
+            console.assert(false, "Child already has a parent");
+        this._children.push(child);
+        child._parent = this;
+        child._parentLayerId = this._layerId;
+    },
+
+
+    /**
+     * @param {?WebInspector.DOMNode} node
+     */
+    _setNode: function(node)
+    {
+        this._node = node;
+    },
+
+    /**
+     * @override
+     * @return {?WebInspector.DOMNode}
+     */
+    node: function()
+    {
+        return this._node;
+    },
+
+    /**
+     * @override
+     * @return {?WebInspector.DOMNode}
+     */
+    nodeForSelfOrAncestor: function()
+    {
+        for (var layer = this; layer; layer = layer._parent) {
+            if (layer._node)
+                return layer._node;
+        }
+        return null;
+    },
+
+    /**
+     * @override
+     * @return {number}
+     */
+    offsetX: function()
+    {
+        return this._offsetX;
+    },
+
+    /**
+     * @override
+     * @return {number}
+     */
+    offsetY: function()
+    {
+        return this._offsetY;
+    },
+
+    /**
+     * @override
+     * @return {number}
+     */
+    width: function()
+    {
+        return this._width;
+    },
+
+    /**
+     * @override
+     * @return {number}
+     */
+    height: function()
+    {
+        return this._height;
+    },
+
+    /**
+     * @override
+     * @return {?Array.<number>}
+     */
+    transform: function()
+    {
+        return null;
+    },
+
+    /**
+     * @override
+     * @return {!Array.<number>}
+     */
+    quad: function()
+    {
+        return this._quad;
+    },
+
+    /**
+     * @override
+     * @return {!Array.<number>}
+     */
+    anchorPoint: function()
+    {
+        return [0.5, 0.5, 0];
+    },
+
+    /**
+     * @override
+     * @return {boolean}
+     */
+    invisible: function()
+    {
+        return false;
+    },
+
+    /**
+     * @override
+     * @return {number}
+     */
+    paintCount: function()
+    {
+        return 0;
+    },
+
+    /**
+     * @override
+     * @return {?DOMAgent.Rect}
+     */
+    lastPaintRect: function()
+    {
+        return null;
+    },
+
+    /**
+     * @override
+     * @return {!Array.<!LayerTreeAgent.ScrollRect>}
+     */
+    scrollRects: function()
+    {
+        return this._scrollRects;
+    },
+
+    /**
+     * @override
+     * @return {number}
+     */
+    gpuMemoryUsage: function()
+    {
+        return this._gpuMemoryUsage;
+    },
+
+    /**
+     * @param {!Array.<number>} params
+     * @param {string} type
+     * @return {!Object}
+     */
+    _scrollRectsFromParams: function(params, type)
+    {
+        return {rect: {x: params[0], y: params[1], width: params[2], height: params[3]}, type: type};
+    },
+
+    /**
+     * @param {!WebInspector.TracingLayerPayload} payload
+     */
+    _createScrollRects: function(payload)
+    {
+        this._scrollRects = [];
+        if (payload.non_fast_scrollable_region)
+            this._scrollRects.push(this._scrollRectsFromParams(payload.non_fast_scrollable_region, WebInspector.LayerTreeModel.ScrollRectType.NonFastScrollable.name));
+        if (payload.touch_event_handler_region)
+            this._scrollRects.push(this._scrollRectsFromParams(payload.touch_event_handler_region, WebInspector.LayerTreeModel.ScrollRectType.TouchEventHandler.name));
+        if (payload.wheel_event_handler_region)
+            this._scrollRects.push(this._scrollRectsFromParams(payload.wheel_event_handler_region, WebInspector.LayerTreeModel.ScrollRectType.WheelEventHandler.name));
+        if (payload.scroll_event_handler_region)
+            this._scrollRects.push(this._scrollRectsFromParams(payload.scroll_event_handler_region, WebInspector.LayerTreeModel.ScrollRectType.RepaintsOnScroll.name));
+    },
+
+    /**
+     * @override
+     * @param {function(!Array.<string>)} callback
+     */
+    requestCompositingReasons: function(callback)
+    {
+        callback(this._compositingReasons);
+    },
+
+    /**
+     * @override
+     * @return {boolean}
+     */
+    drawsContent: function()
+    {
+        return this._drawsContent;
+    }
+}
+
+/**
+ * @constructor
+ * @param {?WebInspector.Target} target
+ */
+WebInspector.DeferredLayerTree = function(target)
+{
+    this._target = target;
+}
+
+WebInspector.DeferredLayerTree.prototype = {
+    /**
+     * @param {function(!WebInspector.LayerTreeBase)} callback
+     */
+    resolve: function(callback) { },
+
+    /**
+     * @return {?WebInspector.Target}
+     */
+    target: function()
+    {
+        return this._target;
+    }
+};
+
+/**
+ * @constructor
+ * @implements {LayerTreeAgent.Dispatcher}
+ * @param {!WebInspector.LayerTreeModel} layerTreeModel
+ */
+WebInspector.LayerTreeDispatcher = function(layerTreeModel)
+{
+    this._layerTreeModel = layerTreeModel;
+}
+
+WebInspector.LayerTreeDispatcher.prototype = {
+    /**
+     * @override
+     * @param {!Array.<!LayerTreeAgent.Layer>=} layers
+     */
+    layerTreeDidChange: function(layers)
+    {
+        this._layerTreeModel._layerTreeChanged(layers || null);
+    },
+
+    /**
+     * @override
+     * @param {!LayerTreeAgent.LayerId} layerId
+     * @param {!DOMAgent.Rect} clipRect
+     */
+    layerPainted: function(layerId, clipRect)
+    {
+        this._layerTreeModel._layerPainted(layerId, clipRect);
+    }
+}
+
+/**
+ * @param {!WebInspector.Target} target
+ * @return {?WebInspector.LayerTreeModel}
+ */
+WebInspector.LayerTreeModel.fromTarget = function(target)
+{
+    if (!target.isPage())
+        return null;
+
+    var model = /** @type {?WebInspector.LayerTreeModel} */ (target.model(WebInspector.LayerTreeModel));
+    if (!model)
+        model = new WebInspector.LayerTreeModel(target);
+    return model;
+}
diff --git a/third_party/WebKit/Source/devtools/front_end/timeline/module.json b/third_party/WebKit/Source/devtools/front_end/timeline/module.json
index 3644d28c..b04d938 100644
--- a/third_party/WebKit/Source/devtools/front_end/timeline/module.json
+++ b/third_party/WebKit/Source/devtools/front_end/timeline/module.json
@@ -44,6 +44,7 @@
         "ui_lazy"
     ],
     "scripts": [
+        "LayerTreeModel.js",
         "CountersGraph.js",
         "LayerDetailsView.js",
         "LayerTreeOutline.js",
diff --git a/third_party/WebKit/Source/devtools/front_end/ui/Toolbar.js b/third_party/WebKit/Source/devtools/front_end/ui/Toolbar.js
index a56de42e..dfc27815 100644
--- a/third_party/WebKit/Source/devtools/front_end/ui/Toolbar.js
+++ b/third_party/WebKit/Source/devtools/front_end/ui/Toolbar.js
@@ -113,9 +113,10 @@
         if (!this._items.length)
             return;
         // Don't hide first and last separators if they were added explicitly.
-        var previousIsSeparator = this._items[0] instanceof WebInspector.ToolbarSeparator;
+        var previousIsSeparator = false;
         var lastSeparator;
-        for (var i = 1; i < this._items.length; ++i) {
+        var nonSeparatorVisible = false;
+        for (var i = 0; i < this._items.length; ++i) {
             if (this._items[i] instanceof WebInspector.ToolbarSeparator) {
                 this._items[i].setVisible(!previousIsSeparator);
                 previousIsSeparator = true;
@@ -125,10 +126,13 @@
             if (this._items[i].visible()) {
                 previousIsSeparator = false;
                 lastSeparator = null;
+                nonSeparatorVisible = true;
             }
         }
         if (lastSeparator && lastSeparator !== this._items.peekLast())
             lastSeparator.setVisible(false);
+
+        this.element.classList.toggle("hidden", lastSeparator && lastSeparator.visible() && !nonSeparatorVisible);
     }
 }
 
diff --git a/third_party/WebKit/Source/devtools/protocol.json b/third_party/WebKit/Source/devtools/protocol.json
index 00634851..adf6e9b 100644
--- a/third_party/WebKit/Source/devtools/protocol.json
+++ b/third_party/WebKit/Source/devtools/protocol.json
@@ -2920,6 +2920,13 @@
                 ],
                 "description": "Called when distrubution is changed.",
                 "hidden": true
+            },
+            {
+                "name": "nodeHighlightRequested",
+                "parameters": [
+                    {"name": "nodeId", "$ref": "NodeId"}
+                ],
+                "hidden": true
             }
         ]
     },
diff --git a/third_party/WebKit/Source/modules/accessibility/AXARIAGridRow.cpp b/third_party/WebKit/Source/modules/accessibility/AXARIAGridRow.cpp
index df52e7f..074570a 100644
--- a/third_party/WebKit/Source/modules/accessibility/AXARIAGridRow.cpp
+++ b/third_party/WebKit/Source/modules/accessibility/AXARIAGridRow.cpp
@@ -58,7 +58,7 @@
     return parent->ariaRoleAttribute() == TreeGridRole;
 }
 
-void AXARIAGridRow::headerObjectsForRow(AccessibilityChildrenVector& headers)
+void AXARIAGridRow::headerObjectsForRow(AXObjectVector& headers)
 {
     for (const auto& cell : children()) {
         if (cell->roleValue() == RowHeaderRole)
diff --git a/third_party/WebKit/Source/modules/accessibility/AXARIAGridRow.h b/third_party/WebKit/Source/modules/accessibility/AXARIAGridRow.h
index afd58c48..f8738d6 100644
--- a/third_party/WebKit/Source/modules/accessibility/AXARIAGridRow.h
+++ b/third_party/WebKit/Source/modules/accessibility/AXARIAGridRow.h
@@ -44,7 +44,7 @@
     static AXARIAGridRow* create(LayoutObject*, AXObjectCacheImpl&);
     ~AXARIAGridRow() override;
 
-    void headerObjectsForRow(AccessibilityChildrenVector&) override;
+    void headerObjectsForRow(AXObjectVector&) override;
 
 private:
     bool isARIATreeGridRow() const override;
diff --git a/third_party/WebKit/Source/modules/accessibility/AXLayoutObject.cpp b/third_party/WebKit/Source/modules/accessibility/AXLayoutObject.cpp
index 4f98c10..d6bf9fd 100644
--- a/third_party/WebKit/Source/modules/accessibility/AXLayoutObject.cpp
+++ b/third_party/WebKit/Source/modules/accessibility/AXLayoutObject.cpp
@@ -1175,27 +1175,27 @@
     return 0;
 }
 
-void AXLayoutObject::ariaFlowToElements(AccessibilityChildrenVector& flowTo) const
+void AXLayoutObject::ariaFlowToElements(AXObjectVector& flowTo) const
 {
     accessibilityChildrenFromAttribute(aria_flowtoAttr, flowTo);
 }
 
-void AXLayoutObject::ariaControlsElements(AccessibilityChildrenVector& controls) const
+void AXLayoutObject::ariaControlsElements(AXObjectVector& controls) const
 {
     accessibilityChildrenFromAttribute(aria_controlsAttr, controls);
 }
 
-void AXLayoutObject::deprecatedAriaDescribedbyElements(AccessibilityChildrenVector& describedby) const
+void AXLayoutObject::deprecatedAriaDescribedbyElements(AXObjectVector& describedby) const
 {
     accessibilityChildrenFromAttribute(aria_describedbyAttr, describedby);
 }
 
-void AXLayoutObject::deprecatedAriaLabelledbyElements(AccessibilityChildrenVector& labelledby) const
+void AXLayoutObject::deprecatedAriaLabelledbyElements(AXObjectVector& labelledby) const
 {
     accessibilityChildrenFromAttribute(aria_labelledbyAttr, labelledby);
 }
 
-void AXLayoutObject::ariaOwnsElements(AccessibilityChildrenVector& owns) const
+void AXLayoutObject::ariaOwnsElements(AXObjectVector& owns) const
 {
     accessibilityChildrenFromAttribute(aria_ownsAttr, owns);
 }
diff --git a/third_party/WebKit/Source/modules/accessibility/AXLayoutObject.h b/third_party/WebKit/Source/modules/accessibility/AXLayoutObject.h
index 9a41d165..1e1ce4a 100644
--- a/third_party/WebKit/Source/modules/accessibility/AXLayoutObject.h
+++ b/third_party/WebKit/Source/modules/accessibility/AXLayoutObject.h
@@ -123,11 +123,11 @@
 
     // ARIA attributes.
     AXObject* activeDescendant() const override;
-    void ariaFlowToElements(AccessibilityChildrenVector&) const override;
-    void ariaControlsElements(AccessibilityChildrenVector&) const override;
-    void deprecatedAriaDescribedbyElements(AccessibilityChildrenVector&) const override;
-    void deprecatedAriaLabelledbyElements(AccessibilityChildrenVector&) const override;
-    void ariaOwnsElements(AccessibilityChildrenVector&) const override;
+    void ariaFlowToElements(AXObjectVector&) const override;
+    void ariaControlsElements(AXObjectVector&) const override;
+    void deprecatedAriaDescribedbyElements(AXObjectVector&) const override;
+    void deprecatedAriaLabelledbyElements(AXObjectVector&) const override;
+    void ariaOwnsElements(AXObjectVector&) const override;
 
     bool ariaHasPopup() const override;
     bool ariaRoleHasPresentationalChildren() const override;
diff --git a/third_party/WebKit/Source/modules/accessibility/AXNodeObject.cpp b/third_party/WebKit/Source/modules/accessibility/AXNodeObject.cpp
index 2db9efc..7729842 100644
--- a/third_party/WebKit/Source/modules/accessibility/AXNodeObject.cpp
+++ b/third_party/WebKit/Source/modules/accessibility/AXNodeObject.cpp
@@ -578,7 +578,7 @@
     }
 }
 
-void AXNodeObject::accessibilityChildrenFromAttribute(QualifiedName attr, AXObject::AccessibilityChildrenVector& children) const
+void AXNodeObject::accessibilityChildrenFromAttribute(QualifiedName attr, AXObject::AXObjectVector& children) const
 {
     WillBeHeapVector<RawPtrWillBeMember<Element>> elements;
     elementsFromAttribute(elements, attr);
@@ -2423,10 +2423,15 @@
     // Post the selected text changed event on the first ancestor that's
     // focused (to handle form controls, ARIA text boxes and contentEditable),
     // or the web area if the selection is just in the document somewhere.
-    if (isFocused() || isWebArea())
+    if (isFocused() || isWebArea()) {
         axObjectCache().postNotification(this, AXObjectCacheImpl::AXSelectedTextChanged);
-    else
+        if (document()) {
+            AXObject* documentObject = axObjectCache().getOrCreate(document());
+            axObjectCache().postNotification(documentObject, AXObjectCacheImpl::AXDocumentSelectionChanged);
+        }
+    } else {
         AXObject::selectionChanged(); // Calls selectionChanged on parent.
+    }
 }
 
 void AXNodeObject::textChanged()
diff --git a/third_party/WebKit/Source/modules/accessibility/AXNodeObject.h b/third_party/WebKit/Source/modules/accessibility/AXNodeObject.h
index b4614f3..08e5ed91 100644
--- a/third_party/WebKit/Source/modules/accessibility/AXNodeObject.h
+++ b/third_party/WebKit/Source/modules/accessibility/AXNodeObject.h
@@ -70,7 +70,7 @@
     AccessibilityRole determineAriaRoleAttribute() const;
     void tokenVectorFromAttribute(Vector<String>&, const QualifiedName&) const;
     void elementsFromAttribute(WillBeHeapVector<RawPtrWillBeMember<Element>>& elements, const QualifiedName&) const;
-    void accessibilityChildrenFromAttribute(QualifiedName attr, AXObject::AccessibilityChildrenVector&) const;
+    void accessibilityChildrenFromAttribute(QualifiedName attr, AXObject::AXObjectVector&) const;
 
     bool hasContentEditableAttributeSet() const;
     bool isTextControl() const override;
diff --git a/third_party/WebKit/Source/modules/accessibility/AXObject.cpp b/third_party/WebKit/Source/modules/accessibility/AXObject.cpp
index c6b9701..e03b0ad 100644
--- a/third_party/WebKit/Source/modules/accessibility/AXObject.cpp
+++ b/third_party/WebKit/Source/modules/accessibility/AXObject.cpp
@@ -673,7 +673,7 @@
     return m_cachedIsPresentationalChild;
 }
 
-String AXObject::name(AXNameFrom& nameFrom, AXObject::AccessibilityChildrenVector* nameObjects) const
+String AXObject::name(AXNameFrom& nameFrom, AXObject::AXObjectVector* nameObjects) const
 {
     HeapHashSet<Member<const AXObject>> visited;
     AXRelatedObjectVector relatedObjects;
@@ -834,7 +834,7 @@
     return 0;
 }
 
-void AXObject::ariaTreeRows(AccessibilityChildrenVector& result)
+void AXObject::ariaTreeRows(AXObjectVector& result)
 {
     for (const auto& child : children()) {
         // Add tree items as the rows.
@@ -936,7 +936,7 @@
     return const_cast<AXObject*>(this);
 }
 
-const AXObject::AccessibilityChildrenVector& AXObject::children()
+const AXObject::AXObjectVector& AXObject::children()
 {
     updateChildrenIfNecessary();
 
diff --git a/third_party/WebKit/Source/modules/accessibility/AXObject.h b/third_party/WebKit/Source/modules/accessibility/AXObject.h
index edcf525..3111ccd 100644
--- a/third_party/WebKit/Source/modules/accessibility/AXObject.h
+++ b/third_party/WebKit/Source/modules/accessibility/AXObject.h
@@ -435,7 +435,7 @@
 
 class MODULES_EXPORT AXObject : public GarbageCollectedFinalized<AXObject> {
 public:
-    typedef HeapVector<Member<AXObject>> AccessibilityChildrenVector;
+    typedef HeapVector<Member<AXObject>> AXObjectVector;
 
     struct AXRange {
         ALLOW_ONLY_INLINE_ALLOCATION();
@@ -638,8 +638,8 @@
     virtual bool deprecatedExposesTitleUIElement() const { return true; }
     virtual AXObject* deprecatedTitleUIElement() const { return 0; }
     virtual String deprecatedPlaceholder() const { return String(); }
-    virtual void deprecatedAriaDescribedbyElements(AccessibilityChildrenVector& describedby) const { }
-    virtual void deprecatedAriaLabelledbyElements(AccessibilityChildrenVector& labelledby) const { }
+    virtual void deprecatedAriaDescribedbyElements(AXObjectVector& describedby) const { }
+    virtual void deprecatedAriaLabelledbyElements(AXObjectVector& labelledby) const { }
     virtual String deprecatedAccessibilityDescription() const { return String(); }
     virtual String deprecatedTitle(TextUnderElementMode mode = TextUnderElementAll) const { return String(); }
     virtual String deprecatedHelpText() const { return String(); }
@@ -651,7 +651,7 @@
 
     // Retrieves the accessible name of the object, an enum indicating where the name
     // was derived from, and a list of objects that were used to derive the name, if any.
-    virtual String name(AXNameFrom&, AccessibilityChildrenVector* nameObjects) const;
+    virtual String name(AXNameFrom&, AXObjectVector* nameObjects) const;
 
     typedef HeapVector<NameSource> NameSources;
     // Retrieves the accessible name of the object and a list of all potential sources
@@ -662,7 +662,7 @@
     // accessible description of the object, which is secondary to |name|, an enum indicating
     // where the description was derived from, and a list of objects that were used to
     // derive the description, if any.
-    virtual String description(AXNameFrom, AXDescriptionFrom&, AccessibilityChildrenVector* descriptionObjects) { return String(); }
+    virtual String description(AXNameFrom, AXDescriptionFrom&, AXObjectVector* descriptionObjects) { return String(); }
 
     // Takes the result of nameFrom and descriptionFrom from calling |name| and |description|,
     // above, and retrieves the placeholder of the object, if present and if it wasn't already
@@ -730,9 +730,9 @@
     virtual AXObject* activeDescendant() const { return 0; }
     virtual String ariaAutoComplete() const { return String(); }
     virtual String ariaDescribedByAttribute() const { return String(); }
-    virtual void ariaFlowToElements(AccessibilityChildrenVector&) const { }
-    virtual void ariaControlsElements(AccessibilityChildrenVector&) const { }
-    virtual void ariaOwnsElements(AccessibilityChildrenVector& owns) const { }
+    virtual void ariaFlowToElements(AXObjectVector&) const { }
+    virtual void ariaControlsElements(AXObjectVector&) const { }
+    virtual void ariaOwnsElements(AXObjectVector& owns) const { }
     virtual bool ariaHasPopup() const { return false; }
     virtual bool isEditable() const { return false; }
     bool isMultiline() const;
@@ -761,7 +761,7 @@
 
     // ARIA trees.
     // Used by an ARIA tree to get all its rows.
-    void ariaTreeRows(AccessibilityChildrenVector&);
+    void ariaTreeRows(AXObjectVector&);
 
     // ARIA live-region features.
     bool isLiveRegion() const;
@@ -789,7 +789,7 @@
     virtual AXObject* elementAccessibilityHitTest(const IntPoint&) const;
 
     // High-level accessibility tree access. Other modules should only use these functions.
-    const AccessibilityChildrenVector& children();
+    const AXObjectVector& children();
     AXObject* parentObject() const;
     AXObject* parentObjectIfExists() const;
     virtual AXObject* computeParent() const = 0;
@@ -890,7 +890,7 @@
 
 protected:
     AXID m_id;
-    AccessibilityChildrenVector m_children;
+    AXObjectVector m_children;
     mutable bool m_haveChildren;
     AccessibilityRole m_role;
     AXObjectInclusion m_lastKnownIsIgnoredValue;
diff --git a/third_party/WebKit/Source/modules/accessibility/AXObjectCacheImpl.cpp b/third_party/WebKit/Source/modules/accessibility/AXObjectCacheImpl.cpp
index 7d8ecad..dc7f2fe 100644
--- a/third_party/WebKit/Source/modules/accessibility/AXObjectCacheImpl.cpp
+++ b/third_party/WebKit/Source/modules/accessibility/AXObjectCacheImpl.cpp
@@ -139,7 +139,7 @@
     if (!axLayoutImage)
         return 0;
 
-    const AXObject::AccessibilityChildrenVector& imageChildren = axLayoutImage->children();
+    const AXObject::AXObjectVector& imageChildren = axLayoutImage->children();
     unsigned count = imageChildren.size();
     for (unsigned k = 0; k < count; ++k) {
         AXObject* child = imageChildren[k];
diff --git a/third_party/WebKit/Source/modules/accessibility/AXTable.cpp b/third_party/WebKit/Source/modules/accessibility/AXTable.cpp
index 527eb86f..78f113ee 100644
--- a/third_party/WebKit/Source/modules/accessibility/AXTable.cpp
+++ b/third_party/WebKit/Source/modules/accessibility/AXTable.cpp
@@ -449,21 +449,21 @@
     return m_headerContainer.get();
 }
 
-const AXObject::AccessibilityChildrenVector& AXTable::columns()
+const AXObject::AXObjectVector& AXTable::columns()
 {
     updateChildrenIfNecessary();
 
     return m_columns;
 }
 
-const AXObject::AccessibilityChildrenVector& AXTable::rows()
+const AXObject::AXObjectVector& AXTable::rows()
 {
     updateChildrenIfNecessary();
 
     return m_rows;
 }
 
-void AXTable::columnHeaders(AccessibilityChildrenVector& headers)
+void AXTable::columnHeaders(AXObjectVector& headers)
 {
     if (!m_layoutObject)
         return;
@@ -474,7 +474,7 @@
         toAXTableColumn(m_columns[c].get())->headerObjectsForColumn(headers);
 }
 
-void AXTable::rowHeaders(AccessibilityChildrenVector& headers)
+void AXTable::rowHeaders(AXObjectVector& headers)
 {
     if (!m_layoutObject)
         return;
@@ -485,7 +485,7 @@
         toAXTableRow(m_rows[r].get())->headerObjectsForRow(headers);
 }
 
-void AXTable::cells(AXObject::AccessibilityChildrenVector& cells)
+void AXTable::cells(AXObject::AXObjectVector& cells)
 {
     if (!m_layoutObject)
         return;
diff --git a/third_party/WebKit/Source/modules/accessibility/AXTable.h b/third_party/WebKit/Source/modules/accessibility/AXTable.h
index a295969..db4a61f 100644
--- a/third_party/WebKit/Source/modules/accessibility/AXTable.h
+++ b/third_party/WebKit/Source/modules/accessibility/AXTable.h
@@ -62,8 +62,8 @@
     virtual bool isAriaTable() const { return false; }
     virtual bool supportsSelectedRows() { return false; }
 
-    const AccessibilityChildrenVector& columns();
-    const AccessibilityChildrenVector& rows();
+    const AXObjectVector& columns();
+    const AXObjectVector& rows();
 
     unsigned columnCount();
     unsigned rowCount();
@@ -71,18 +71,18 @@
     String deprecatedTitle(TextUnderElementMode) const final;
 
     // all the cells in the table
-    void cells(AccessibilityChildrenVector&);
+    void cells(AXObjectVector&);
     AXTableCell* cellForColumnAndRow(unsigned column, unsigned row);
 
-    void columnHeaders(AccessibilityChildrenVector&);
-    void rowHeaders(AccessibilityChildrenVector&);
+    void columnHeaders(AXObjectVector&);
+    void rowHeaders(AXObjectVector&);
 
     // an object that contains, as children, all the objects that act as headers
     AXObject* headerContainer();
 
 protected:
-    AccessibilityChildrenVector m_rows;
-    AccessibilityChildrenVector m_columns;
+    AXObjectVector m_rows;
+    AXObjectVector m_columns;
 
     Member<AXObject> m_headerContainer;
     bool m_isAXTable;
diff --git a/third_party/WebKit/Source/modules/accessibility/AXTableColumn.cpp b/third_party/WebKit/Source/modules/accessibility/AXTableColumn.cpp
index f5bcd22..53ead4e 100644
--- a/third_party/WebKit/Source/modules/accessibility/AXTableColumn.cpp
+++ b/third_party/WebKit/Source/modules/accessibility/AXTableColumn.cpp
@@ -66,7 +66,7 @@
     return m_columnRect;
 }
 
-void AXTableColumn::headerObjectsForColumn(AccessibilityChildrenVector& headers)
+void AXTableColumn::headerObjectsForColumn(AXObjectVector& headers)
 {
     if (!m_parent)
         return;
@@ -113,7 +113,7 @@
 
 AXObject* AXTableColumn::headerObject()
 {
-    AccessibilityChildrenVector headers;
+    AXObjectVector headers;
     headerObjectsForColumn(headers);
     if (!headers.size())
         return 0;
diff --git a/third_party/WebKit/Source/modules/accessibility/AXTableColumn.h b/third_party/WebKit/Source/modules/accessibility/AXTableColumn.h
index bec26b4..f1ce42f 100644
--- a/third_party/WebKit/Source/modules/accessibility/AXTableColumn.h
+++ b/third_party/WebKit/Source/modules/accessibility/AXTableColumn.h
@@ -50,7 +50,7 @@
     // retrieves the topmost "column" header (th)
     AXObject* headerObject();
     // retrieves the "column" headers (th, scope) from top to bottom
-    void headerObjectsForColumn(AccessibilityChildrenVector&);
+    void headerObjectsForColumn(AXObjectVector&);
 
     AccessibilityRole roleValue() const override { return ColumnRole; }
 
diff --git a/third_party/WebKit/Source/modules/accessibility/AXTableRow.cpp b/third_party/WebKit/Source/modules/accessibility/AXTableRow.cpp
index a130294..84b1c25 100644
--- a/third_party/WebKit/Source/modules/accessibility/AXTableRow.cpp
+++ b/third_party/WebKit/Source/modules/accessibility/AXTableRow.cpp
@@ -97,7 +97,7 @@
 
 AXObject* AXTableRow::headerObject()
 {
-    AccessibilityChildrenVector headers;
+    AXObjectVector headers;
     headerObjectsForRow(headers);
     if (!headers.size())
         return 0;
@@ -105,7 +105,7 @@
     return headers[0].get();
 }
 
-void AXTableRow::headerObjectsForRow(AccessibilityChildrenVector& headers)
+void AXTableRow::headerObjectsForRow(AXObjectVector& headers)
 {
     if (!m_layoutObject || !m_layoutObject->isTableRow())
         return;
diff --git a/third_party/WebKit/Source/modules/accessibility/AXTableRow.h b/third_party/WebKit/Source/modules/accessibility/AXTableRow.h
index cb50b1c..ff1797f 100644
--- a/third_party/WebKit/Source/modules/accessibility/AXTableRow.h
+++ b/third_party/WebKit/Source/modules/accessibility/AXTableRow.h
@@ -49,7 +49,7 @@
     // retrieves the "row" header (a th tag in the rightmost column)
     virtual AXObject* headerObject();
     // retrieves the "row" headers (th, scope) from left to right for the each row.
-    virtual void headerObjectsForRow(AccessibilityChildrenVector&);
+    virtual void headerObjectsForRow(AXObjectVector&);
     AXObject* parentTable() const;
 
     void setRowIndex(int rowIndex) { m_rowIndex = rowIndex; }
diff --git a/third_party/WebKit/Source/modules/accessibility/InspectorAccessibilityAgent.cpp b/third_party/WebKit/Source/modules/accessibility/InspectorAccessibilityAgent.cpp
index dcc789c..79a81d3 100644
--- a/third_party/WebKit/Source/modules/accessibility/InspectorAccessibilityAgent.cpp
+++ b/third_party/WebKit/Source/modules/accessibility/InspectorAccessibilityAgent.cpp
@@ -247,7 +247,7 @@
     }
 }
 
-PassRefPtr<AXProperty> createRelatedNodeListProperty(AXRelationshipAttributes::Enum key, AXObject::AccessibilityChildrenVector& nodes, const QualifiedName& attr, AXObject* axObject)
+PassRefPtr<AXProperty> createRelatedNodeListProperty(AXRelationshipAttributes::Enum key, AXObject::AXObjectVector& nodes, const QualifiedName& attr, AXObject* axObject)
 {
     RefPtr<AXValue> nodeListValue = createRelatedNodeListValue(nodes);
     const AtomicString& attrValue = axObject->getAttribute(attr);
@@ -261,7 +261,7 @@
         properties->addItem(createProperty(AXRelationshipAttributes::Activedescendant, createRelatedNodeValue(activeDescendant)));
     }
 
-    AXObject::AccessibilityChildrenVector results;
+    AXObject::AXObjectVector results;
     axObject->ariaFlowToElements(results);
     if (!results.isEmpty())
         properties->addItem(createRelatedNodeListProperty(AXRelationshipAttributes::Flowto, results, aria_flowtoAttr, axObject));
diff --git a/third_party/WebKit/Source/modules/accessibility/InspectorTypeBuilderHelper.cpp b/third_party/WebKit/Source/modules/accessibility/InspectorTypeBuilderHelper.cpp
index 03435da..0e7c8100 100644
--- a/third_party/WebKit/Source/modules/accessibility/InspectorTypeBuilderHelper.cpp
+++ b/third_party/WebKit/Source/modules/accessibility/InspectorTypeBuilderHelper.cpp
@@ -167,7 +167,7 @@
     return axValue;
 }
 
-PassRefPtr<AXValue> createRelatedNodeListValue(AXObject::AccessibilityChildrenVector& axObjects, AXValueType::Enum valueType)
+PassRefPtr<AXValue> createRelatedNodeListValue(AXObject::AXObjectVector& axObjects, AXValueType::Enum valueType)
 {
     RefPtr<TypeBuilder::Array<AXRelatedNode>> relatedNodes = TypeBuilder::Array<AXRelatedNode>::create();
     for (unsigned i = 0; i < axObjects.size(); i++) {
diff --git a/third_party/WebKit/Source/modules/accessibility/InspectorTypeBuilderHelper.h b/third_party/WebKit/Source/modules/accessibility/InspectorTypeBuilderHelper.h
index ae7808e..e2876b3 100644
--- a/third_party/WebKit/Source/modules/accessibility/InspectorTypeBuilderHelper.h
+++ b/third_party/WebKit/Source/modules/accessibility/InspectorTypeBuilderHelper.h
@@ -36,7 +36,7 @@
 PassRefPtr<AXValue> createBooleanValue(bool value, AXValueType::Enum = AXValueType::Boolean);
 PassRefPtr<AXValue> createRelatedNodeValue(const AXObject*, String* name = nullptr, AXValueType::Enum = AXValueType::Idref);
 PassRefPtr<AXValue> createRelatedNodeListValue(AXRelatedObjectVector&, AXValueType::Enum);
-PassRefPtr<AXValue> createRelatedNodeListValue(AXObject::AccessibilityChildrenVector& axObjects, AXValueType::Enum = AXValueType::IdrefList);
+PassRefPtr<AXValue> createRelatedNodeListValue(AXObject::AXObjectVector& axObjects, AXValueType::Enum = AXValueType::IdrefList);
 
 PassRefPtr<AXValueSource> createValueSource(NameSource&);
 
diff --git a/third_party/WebKit/Source/modules/fetch/DataConsumerTee.cpp b/third_party/WebKit/Source/modules/fetch/DataConsumerTee.cpp
index 857c855..34a5d0f 100644
--- a/third_party/WebKit/Source/modules/fetch/DataConsumerTee.cpp
+++ b/third_party/WebKit/Source/modules/fetch/DataConsumerTee.cpp
@@ -265,7 +265,7 @@
     DestinationReader(PassRefPtr<DestinationContext::Proxy> contextProxy, WebDataConsumerHandle::Client* client)
         : m_contextProxy(contextProxy)
     {
-        MutexLocker(context()->mutex());
+        MutexLocker locker(context()->mutex());
         context()->attachReader(client);
         if (client) {
             // We need to use threadSafeBind here to retain the context. Note
@@ -276,7 +276,7 @@
     }
     ~DestinationReader() override
     {
-        MutexLocker(context()->mutex());
+        MutexLocker locker(context()->mutex());
         context()->detachReader();
     }
 
diff --git a/third_party/WebKit/Source/modules/filesystem/InspectorFileSystemAgent.cpp b/third_party/WebKit/Source/modules/filesystem/InspectorFileSystemAgent.cpp
index 7bdbf6f..75ea630 100644
--- a/third_party/WebKit/Source/modules/filesystem/InspectorFileSystemAgent.cpp
+++ b/third_party/WebKit/Source/modules/filesystem/InspectorFileSystemAgent.cpp
@@ -765,7 +765,6 @@
 
 DEFINE_TRACE(InspectorFileSystemAgent)
 {
-    visitor->trace(m_inspectedFrames);
     InspectorBaseAgent::trace(visitor);
 }
 
diff --git a/third_party/WebKit/Source/modules/filesystem/InspectorFileSystemAgent.h b/third_party/WebKit/Source/modules/filesystem/InspectorFileSystemAgent.h
index fab4370..3a2ee25 100644
--- a/third_party/WebKit/Source/modules/filesystem/InspectorFileSystemAgent.h
+++ b/third_party/WebKit/Source/modules/filesystem/InspectorFileSystemAgent.h
@@ -65,7 +65,7 @@
     bool assertEnabled(ErrorString*);
     ExecutionContext* assertExecutionContextForOrigin(ErrorString*, SecurityOrigin*);
 
-    RawPtrWillBeMember<InspectedFrames> m_inspectedFrames;
+    InspectedFrames* m_inspectedFrames;
     bool m_enabled;
 };
 
diff --git a/third_party/WebKit/Source/modules/indexeddb/IDBIndex.idl b/third_party/WebKit/Source/modules/indexeddb/IDBIndex.idl
index ac023ed..e2e17b74 100644
--- a/third_party/WebKit/Source/modules/indexeddb/IDBIndex.idl
+++ b/third_party/WebKit/Source/modules/indexeddb/IDBIndex.idl
@@ -38,9 +38,9 @@
     [CallWith=ScriptState, RaisesException] IDBRequest get(any key);
     [CallWith=ScriptState, RaisesException] IDBRequest getKey(any key);
     // TODO(cmumford): 0xFFFFFFFF is not necessary. Remove once crbug.com/335871 is fixed.
-    [CallWith=ScriptState, RaisesException, RuntimeEnabled=IndexedDBExperimental] IDBRequest getAll([Default=Undefined] optional any range, optional unsigned long maxCount = 0xFFFFFFFF);
+    [CallWith=ScriptState, RaisesException] IDBRequest getAll([Default=Undefined] optional any range, optional unsigned long maxCount = 0xFFFFFFFF);
     // TODO(cmumford): 0xFFFFFFFF is not necessary. Remove once crbug.com/335871 is fixed.
-    [CallWith=ScriptState, RaisesException, RuntimeEnabled=IndexedDBExperimental] IDBRequest getAllKeys([Default=Undefined] optional any range, [EnforceRange] optional unsigned long maxCount = 0xFFFFFFFF);
+    [CallWith=ScriptState, RaisesException] IDBRequest getAllKeys([Default=Undefined] optional any range, [EnforceRange] optional unsigned long maxCount = 0xFFFFFFFF);
     [CallWith=ScriptState, RaisesException] IDBRequest count([Default=Undefined] optional any key);
     [CallWith=ScriptState, RaisesException] IDBRequest openCursor([Default=Undefined] optional any range, optional IDBCursorDirection direction = "next");
     [CallWith=ScriptState, RaisesException] IDBRequest openKeyCursor([Default=Undefined] optional any range, optional IDBCursorDirection direction = "next");
diff --git a/third_party/WebKit/Source/modules/indexeddb/IDBObjectStore.idl b/third_party/WebKit/Source/modules/indexeddb/IDBObjectStore.idl
index ae4fc4f..3422d7c 100644
--- a/third_party/WebKit/Source/modules/indexeddb/IDBObjectStore.idl
+++ b/third_party/WebKit/Source/modules/indexeddb/IDBObjectStore.idl
@@ -41,14 +41,12 @@
     [CallWith=ScriptState, RaisesException] IDBRequest clear();
     [CallWith=ScriptState, RaisesException] IDBRequest get(any key);
     // TODO(cmumford): 0xFFFFFFFF is not necessary. Remove once crbug.com/335871 is fixed.
-    [CallWith=ScriptState, RaisesException, RuntimeEnabled=IndexedDBExperimental] IDBRequest getAll([Default=Undefined] optional any range, optional unsigned long maxCount = 0xFFFFFFFF);
-    // TODO(cmumford): Standardize or eventually remove. More info at:
-    // https://w3c.github.io/IndexedDB/#widl-IDBObjectStore-getAllKeys-IDBRequest-any-query-unsigned-long-count
+    [CallWith=ScriptState, RaisesException] IDBRequest getAll([Default=Undefined] optional any range, optional unsigned long maxCount = 0xFFFFFFFF);
     // TODO(cmumford): 0xFFFFFFFF is not necessary. Remove once crbug.com/335871 is fixed.
-    [CallWith=ScriptState, RaisesException, RuntimeEnabled=IndexedDBExperimental] IDBRequest getAllKeys([Default=Undefined] optional any range, optional unsigned long maxCount = 0xFFFFFFFF);
+    [CallWith=ScriptState, RaisesException] IDBRequest getAllKeys([Default=Undefined] optional any range, optional unsigned long maxCount = 0xFFFFFFFF);
     [CallWith=ScriptState, RaisesException] IDBRequest count([Default=Undefined] optional any key);
     [CallWith=ScriptState, RaisesException] IDBRequest openCursor([Default=Undefined] optional any range, optional IDBCursorDirection direction = "next");
-    [CallWith=ScriptState, RaisesException, RuntimeEnabled=IndexedDBExperimental] IDBRequest openKeyCursor([Default=Undefined] optional any range, optional IDBCursorDirection direction = "next");
+    [CallWith=ScriptState, RaisesException] IDBRequest openKeyCursor([Default=Undefined] optional any range, optional IDBCursorDirection direction = "next");
     [CallWith=ScriptState, RaisesException] IDBIndex createIndex(DOMString name, (DOMString or sequence<DOMString>) keyPath, optional IDBIndexParameters options);
     [RaisesException] IDBIndex index(DOMString name);
     [RaisesException] void deleteIndex(DOMString name);
diff --git a/third_party/WebKit/Source/modules/indexeddb/IDBTransaction.idl b/third_party/WebKit/Source/modules/indexeddb/IDBTransaction.idl
index 7f56759..ebd0c7e3 100644
--- a/third_party/WebKit/Source/modules/indexeddb/IDBTransaction.idl
+++ b/third_party/WebKit/Source/modules/indexeddb/IDBTransaction.idl
@@ -41,7 +41,7 @@
 ] interface IDBTransaction : EventTarget {
 
     // Properties
-    [RuntimeEnabled=IndexedDBExperimental, Measure] readonly attribute DOMStringList objectStoreNames;
+    [Measure] readonly attribute DOMStringList objectStoreNames;
     readonly attribute IDBTransactionMode mode;
     readonly attribute IDBDatabase db;
     [Measure] readonly attribute DOMError error;
diff --git a/third_party/WebKit/Source/modules/indexeddb/InspectorIndexedDBAgent.cpp b/third_party/WebKit/Source/modules/indexeddb/InspectorIndexedDBAgent.cpp
index 4bb2afbe..f0cb0d8 100644
--- a/third_party/WebKit/Source/modules/indexeddb/InspectorIndexedDBAgent.cpp
+++ b/third_party/WebKit/Source/modules/indexeddb/InspectorIndexedDBAgent.cpp
@@ -792,7 +792,6 @@
 
 DEFINE_TRACE(InspectorIndexedDBAgent)
 {
-    visitor->trace(m_inspectedFrames);
     InspectorBaseAgent::trace(visitor);
 }
 
diff --git a/third_party/WebKit/Source/modules/indexeddb/InspectorIndexedDBAgent.h b/third_party/WebKit/Source/modules/indexeddb/InspectorIndexedDBAgent.h
index 0cc331f..a86fc86 100644
--- a/third_party/WebKit/Source/modules/indexeddb/InspectorIndexedDBAgent.h
+++ b/third_party/WebKit/Source/modules/indexeddb/InspectorIndexedDBAgent.h
@@ -63,7 +63,7 @@
 private:
     explicit InspectorIndexedDBAgent(InspectedFrames*);
 
-    RawPtrWillBeMember<InspectedFrames> m_inspectedFrames;
+    InspectedFrames* m_inspectedFrames;
 };
 
 } // namespace blink
diff --git a/third_party/WebKit/Source/modules/modules.gypi b/third_party/WebKit/Source/modules/modules.gypi
index f72c738..0efdf10 100644
--- a/third_party/WebKit/Source/modules/modules.gypi
+++ b/third_party/WebKit/Source/modules/modules.gypi
@@ -465,6 +465,9 @@
       'navigatorconnect/ServicePortConnectOptions.idl',
       'navigatorconnect/ServicePortConnectResponse.idl',
       'navigatorconnect/ServicePortMatchOptions.idl',
+      'nfc/NFCPushOptions.idl',
+      'nfc/NFCRecord.idl',
+      'nfc/NFCWatchOptions.idl',
       'notifications/GetNotificationOptions.idl',
       'notifications/NotificationAction.idl',
       'notifications/NotificationEventInit.idl',
@@ -589,6 +592,12 @@
       '<(blink_modules_output_dir)/navigatorconnect/ServicePortConnectResponse.h',
       '<(blink_modules_output_dir)/navigatorconnect/ServicePortMatchOptions.cpp',
       '<(blink_modules_output_dir)/navigatorconnect/ServicePortMatchOptions.h',
+      '<(blink_modules_output_dir)/nfc/NFCPushOptions.cpp',
+      '<(blink_modules_output_dir)/nfc/NFCPushOptions.h',
+      '<(blink_modules_output_dir)/nfc/NFCRecord.cpp',
+      '<(blink_modules_output_dir)/nfc/NFCRecord.h',
+      '<(blink_modules_output_dir)/nfc/NFCWatchOptions.cpp',
+      '<(blink_modules_output_dir)/nfc/NFCWatchOptions.h',
       '<(blink_modules_output_dir)/notifications/GetNotificationOptions.cpp',
       '<(blink_modules_output_dir)/notifications/GetNotificationOptions.h',
       '<(blink_modules_output_dir)/notifications/NotificationAction.cpp',
diff --git a/third_party/WebKit/Source/modules/nfc/NFCPushOptions.idl b/third_party/WebKit/Source/modules/nfc/NFCPushOptions.idl
new file mode 100644
index 0000000..2fe24e81
--- /dev/null
+++ b/third_party/WebKit/Source/modules/nfc/NFCPushOptions.idl
@@ -0,0 +1,12 @@
+// 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.
+
+// https://w3c.github.io/web-nfc/index.html#the-nfcpushoptions-dictionary
+
+enum NFCPushTarget { "tag", "peer" };
+
+dictionary NFCPushOptions {
+    NFCPushTarget target;
+    unsigned long timeout;
+};
diff --git a/third_party/WebKit/Source/modules/nfc/NFCRecord.idl b/third_party/WebKit/Source/modules/nfc/NFCRecord.idl
new file mode 100644
index 0000000..a20ccbb
--- /dev/null
+++ b/third_party/WebKit/Source/modules/nfc/NFCRecord.idl
@@ -0,0 +1,18 @@
+// 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.
+
+// https://w3c.github.io/web-nfc/index.html#the-nfcrecord-dictionary
+
+enum NFCRecordType { "empty", "text", "url", "json", "opaque" };
+
+// typedef (DOMString or unrestricted double or object or ArrayBuffer) NFCRecordData;
+
+dictionary NFCRecord {
+    NFCRecordType kind;
+    USVString type;
+    // NFCRecordData data;
+    // Use ´any´ as Blink IDL compiler complains that Object is not supported as
+    // union member. Tracked in https://crbug.com/537133 .
+    any data;
+};
diff --git a/third_party/WebKit/Source/modules/nfc/NFCWatchOptions.idl b/third_party/WebKit/Source/modules/nfc/NFCWatchOptions.idl
new file mode 100644
index 0000000..971497a
--- /dev/null
+++ b/third_party/WebKit/Source/modules/nfc/NFCWatchOptions.idl
@@ -0,0 +1,16 @@
+// 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.
+
+// https://w3c.github.io/web-nfc/#idl-def-nfcwatchoptions
+
+enum NFCWatchMode { "web-nfc-only", "any" };
+
+[
+   RuntimeEnabled=WebNFC,
+] dictionary NFCWatchOptions {
+    USVString    url = "";
+    USVString    kind = "";
+    USVString    type = "";
+    NFCWatchMode mode = "web-nfc-only";
+};
diff --git a/third_party/WebKit/Source/modules/storage/StorageArea.cpp b/third_party/WebKit/Source/modules/storage/StorageArea.cpp
index 4b9a45e..f1d2e1b 100644
--- a/third_party/WebKit/Source/modules/storage/StorageArea.cpp
+++ b/third_party/WebKit/Source/modules/storage/StorageArea.cpp
@@ -163,7 +163,7 @@
 void StorageArea::dispatchLocalStorageEvent(const String& key, const String& oldValue, const String& newValue, SecurityOrigin* securityOrigin, const KURL& pageURL, WebStorageArea* sourceAreaInstance, bool originatedInProcess)
 {
     // FIXME: This looks suspicious. Why doesn't this use allPages instead?
-    const HashSet<Page*>& pages = Page::ordinaryPages();
+    const WillBePersistentHeapHashSet<RawPtrWillBeWeakMember<Page>>& pages = Page::ordinaryPages();
     for (Page* page : pages) {
         for (Frame* frame = page->mainFrame(); frame; frame = frame->tree().traverseNext()) {
             // FIXME: We do not yet have a way to dispatch events to out-of-process frames.
@@ -183,7 +183,7 @@
 static Page* findPageWithSessionStorageNamespace(const WebStorageNamespace& sessionNamespace)
 {
     // FIXME: This looks suspicious. Why doesn't this use allPages instead?
-    const HashSet<Page*>& pages = Page::ordinaryPages();
+    const WillBePersistentHeapHashSet<RawPtrWillBeWeakMember<Page>>& pages = Page::ordinaryPages();
     for (Page* page : pages) {
         const bool dontCreateIfMissing = false;
         StorageNamespace* storageNamespace = StorageNamespaceController::from(page)->sessionStorage(dontCreateIfMissing);
diff --git a/third_party/WebKit/Source/modules/webgl/OESVertexArrayObject.cpp b/third_party/WebKit/Source/modules/webgl/OESVertexArrayObject.cpp
index a61945b3..6c50ce8d 100644
--- a/third_party/WebKit/Source/modules/webgl/OESVertexArrayObject.cpp
+++ b/third_party/WebKit/Source/modules/webgl/OESVertexArrayObject.cpp
@@ -64,14 +64,14 @@
     return o;
 }
 
-void OESVertexArrayObject::deleteVertexArrayOES(WebGLVertexArrayObjectOES* arrayObject)
+void OESVertexArrayObject::deleteVertexArrayOES(ScriptState* scriptState, WebGLVertexArrayObjectOES* arrayObject)
 {
     WebGLExtensionScopedContext scoped(this);
     if (!arrayObject || scoped.isLost())
         return;
 
     if (!arrayObject->isDefaultObject() && arrayObject == scoped.context()->m_boundVertexArrayObject)
-        scoped.context()->setBoundVertexArrayObject(nullptr);
+        scoped.context()->setBoundVertexArrayObject(scriptState, nullptr);
 
     arrayObject->deleteObject(scoped.context()->webContext());
 }
@@ -88,7 +88,7 @@
     return scoped.context()->webContext()->isVertexArrayOES(arrayObject->object());
 }
 
-void OESVertexArrayObject::bindVertexArrayOES(WebGLVertexArrayObjectOES* arrayObject)
+void OESVertexArrayObject::bindVertexArrayOES(ScriptState* scriptState, WebGLVertexArrayObjectOES* arrayObject)
 {
     WebGLExtensionScopedContext scoped(this);
     if (scoped.isLost())
@@ -103,10 +103,10 @@
         scoped.context()->webContext()->bindVertexArrayOES(arrayObject->object());
 
         arrayObject->setHasEverBeenBound();
-        scoped.context()->setBoundVertexArrayObject(arrayObject);
+        scoped.context()->setBoundVertexArrayObject(scriptState, arrayObject);
     } else {
         scoped.context()->webContext()->bindVertexArrayOES(0);
-        scoped.context()->setBoundVertexArrayObject(nullptr);
+        scoped.context()->setBoundVertexArrayObject(scriptState, nullptr);
     }
 }
 
diff --git a/third_party/WebKit/Source/modules/webgl/OESVertexArrayObject.h b/third_party/WebKit/Source/modules/webgl/OESVertexArrayObject.h
index 760e90f7..52c50e5 100644
--- a/third_party/WebKit/Source/modules/webgl/OESVertexArrayObject.h
+++ b/third_party/WebKit/Source/modules/webgl/OESVertexArrayObject.h
@@ -44,9 +44,9 @@
     WebGLExtensionName name() const override;
 
     WebGLVertexArrayObjectOES* createVertexArrayOES();
-    void deleteVertexArrayOES(WebGLVertexArrayObjectOES*);
+    void deleteVertexArrayOES(ScriptState*, WebGLVertexArrayObjectOES*);
     GLboolean isVertexArrayOES(WebGLVertexArrayObjectOES*);
-    void bindVertexArrayOES(WebGLVertexArrayObjectOES*);
+    void bindVertexArrayOES(ScriptState*, WebGLVertexArrayObjectOES*);
 
 private:
     explicit OESVertexArrayObject(WebGLRenderingContextBase*);
diff --git a/third_party/WebKit/Source/modules/webgl/OESVertexArrayObject.idl b/third_party/WebKit/Source/modules/webgl/OESVertexArrayObject.idl
index 899cdb4..4d648bb 100644
--- a/third_party/WebKit/Source/modules/webgl/OESVertexArrayObject.idl
+++ b/third_party/WebKit/Source/modules/webgl/OESVertexArrayObject.idl
@@ -33,7 +33,7 @@
     const unsigned long VERTEX_ARRAY_BINDING_OES = 0x85B5;
 
     WebGLVertexArrayObjectOES createVertexArrayOES();
-    void deleteVertexArrayOES([Default=Undefined] optional WebGLVertexArrayObjectOES? arrayObject);
+    [CallWith=ScriptState] void deleteVertexArrayOES([Default=Undefined] optional WebGLVertexArrayObjectOES? arrayObject);
     boolean isVertexArrayOES([Default=Undefined] optional WebGLVertexArrayObjectOES? arrayObject);
-    void bindVertexArrayOES([Default=Undefined] optional WebGLVertexArrayObjectOES? arrayObject);
+    [CallWith=ScriptState] void bindVertexArrayOES([Default=Undefined] optional WebGLVertexArrayObjectOES? arrayObject);
 };
diff --git a/third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.cpp b/third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.cpp
index fbbb060..16afe7a 100644
--- a/third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.cpp
+++ b/third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.cpp
@@ -640,7 +640,7 @@
         return;
     }
 
-    webContext()->texImage3D(target, level, convertTexInternalFormat(internalformat, type), width, height, depth, border, format, type, pixels);
+    webContext()->texImage3D(target, level, convertTexInternalFormat(internalformat, type), width, height, depth, border, format, type, data);
     tex->setLevelInfo(target, level, internalformat, width, height, depth, type);
 }
 
@@ -2065,13 +2065,13 @@
     return o;
 }
 
-void WebGL2RenderingContextBase::deleteVertexArray(WebGLVertexArrayObject* vertexArray)
+void WebGL2RenderingContextBase::deleteVertexArray(ScriptState* scriptState, WebGLVertexArrayObject* vertexArray)
 {
     if (isContextLost() || !vertexArray)
         return;
 
     if (!vertexArray->isDefaultObject() && vertexArray == m_boundVertexArrayObject)
-        setBoundVertexArrayObject(nullptr);
+        setBoundVertexArrayObject(scriptState, nullptr);
 
     vertexArray->deleteObject(webContext());
 }
@@ -2087,7 +2087,7 @@
     return webContext()->isVertexArrayOES(vertexArray->object());
 }
 
-void WebGL2RenderingContextBase::bindVertexArray(WebGLVertexArrayObject* vertexArray)
+void WebGL2RenderingContextBase::bindVertexArray(ScriptState* scriptState, WebGLVertexArrayObject* vertexArray)
 {
     if (isContextLost())
         return;
@@ -2101,14 +2101,14 @@
         webContext()->bindVertexArrayOES(objectOrZero(vertexArray));
 
         vertexArray->setHasEverBeenBound();
-        setBoundVertexArrayObject(vertexArray);
+        setBoundVertexArrayObject(scriptState, vertexArray);
     } else {
         webContext()->bindVertexArrayOES(0);
-        setBoundVertexArrayObject(nullptr);
+        setBoundVertexArrayObject(scriptState, nullptr);
     }
 }
 
-void WebGL2RenderingContextBase::bindFramebuffer(GLenum target, WebGLFramebuffer* buffer)
+void WebGL2RenderingContextBase::bindFramebuffer(ScriptState* scriptState, GLenum target, WebGLFramebuffer* buffer)
 {
     bool deleted;
     if (!checkObjectToBeBound("bindFramebuffer", buffer, deleted))
@@ -2130,6 +2130,8 @@
     }
 
     setFramebuffer(target, buffer);
+    if (scriptState)
+        preserveObjectWrapper(scriptState, this, "framebuffer", 0, buffer);
 }
 
 void WebGL2RenderingContextBase::deleteFramebuffer(WebGLFramebuffer* framebuffer)
@@ -2947,8 +2949,8 @@
 
 void WebGL2RenderingContextBase::restoreCurrentFramebuffer()
 {
-    bindFramebuffer(GL_DRAW_FRAMEBUFFER, m_framebufferBinding.get());
-    bindFramebuffer(GL_READ_FRAMEBUFFER, m_readFramebufferBinding.get());
+    bindFramebuffer(nullptr, GL_DRAW_FRAMEBUFFER, m_framebufferBinding.get());
+    bindFramebuffer(nullptr, GL_READ_FRAMEBUFFER, m_readFramebufferBinding.get());
 }
 
 GLenum WebGL2RenderingContextBase::boundFramebufferColorFormat()
diff --git a/third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.h b/third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.h
index e9ae9ea..a2427378 100644
--- a/third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.h
+++ b/third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.h
@@ -160,16 +160,16 @@
 
     /* Vertex Array Objects */
     WebGLVertexArrayObject* createVertexArray();
-    void deleteVertexArray(WebGLVertexArrayObject*);
+    void deleteVertexArray(ScriptState*, WebGLVertexArrayObject*);
     GLboolean isVertexArray(WebGLVertexArrayObject*);
-    void bindVertexArray(WebGLVertexArrayObject*);
+    void bindVertexArray(ScriptState*, WebGLVertexArrayObject*);
 
     /* Reading */
     void readPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, long long offset);
 
     /* WebGLRenderingContextBase overrides */
     void initializeNewContext() override;
-    void bindFramebuffer(GLenum target, WebGLFramebuffer*) override;
+    void bindFramebuffer(ScriptState*, GLenum target, WebGLFramebuffer*) override;
     void deleteFramebuffer(WebGLFramebuffer*) override;
     ScriptValue getParameter(ScriptState*, GLenum pname) override;
     ScriptValue getTexParameter(ScriptState*, GLenum target, GLenum pname) override;
diff --git a/third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.idl b/third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.idl
index a50ea1f4..10ed0f5 100644
--- a/third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.idl
+++ b/third_party/WebKit/Source/modules/webgl/WebGL2RenderingContextBase.idl
@@ -435,9 +435,9 @@
 
     /* Vertex Array Objects */
     WebGLVertexArrayObject createVertexArray();
-    void deleteVertexArray(WebGLVertexArrayObject? vertexArray);
+    [CallWith=ScriptState] void deleteVertexArray(WebGLVertexArrayObject? vertexArray);
     GLboolean isVertexArray(WebGLVertexArrayObject? vertexArray);
-    void bindVertexArray(WebGLVertexArrayObject? vertexArray);
+    [CallWith=ScriptState] void bindVertexArray(WebGLVertexArrayObject? vertexArray);
 
     /* Reading */
     void readPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLintptr offset);
diff --git a/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp b/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp
index 81cd3abc..43cecb80 100644
--- a/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp
+++ b/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.cpp
@@ -873,6 +873,7 @@
     , m_dispatchContextLostEventTimer(this, &WebGLRenderingContextBase::dispatchContextLostEvent)
     , m_restoreAllowed(false)
     , m_restoreTimer(this, &WebGLRenderingContextBase::maybeRestoreContext)
+    , m_preservedDefaultVAOObjectWrapper(false)
     , m_generatedImageCache(4)
     , m_requestedAttributes(requestedAttributes)
     , m_synthesizedErrorsToConsole(true)
@@ -993,6 +994,12 @@
         m_defaultVertexArrayObject = WebGLVertexArrayObjectOES::create(this, WebGLVertexArrayObjectBase::VaoTypeDefault);
     }
     addContextObject(m_defaultVertexArrayObject.get());
+    // It's not convenient or necessary to pass a ScriptState this far down; while one is available
+    // during WebGLRenderingContext construction, the wrapper for the context itself hasn't been
+    // created yet. It's simpler to instead lazily instantiate and preserve the JavaScript wrapper
+    // for the default VAO. (This object is never exposed to JavaScript, but we need to link other
+    // JavaScript wrappers to it.)
+    m_preservedDefaultVAOObjectWrapper = false;
     m_boundVertexArrayObject = m_defaultVertexArrayObject;
 
     m_vertexAttribValue.resize(m_maxVertexAttribs);
@@ -1364,7 +1371,7 @@
 
 }
 
-void WebGLRenderingContextBase::attachShader(WebGLProgram* program, WebGLShader* shader)
+void WebGLRenderingContextBase::attachShader(ScriptState* scriptState, WebGLProgram* program, WebGLShader* shader)
 {
     if (isContextLost() || !validateWebGLObject("attachShader", program) || !validateWebGLObject("attachShader", shader))
         return;
@@ -1374,6 +1381,7 @@
     }
     webContext()->attachShader(objectOrZero(program), objectOrZero(shader));
     shader->onAttached();
+    preserveObjectWrapper(scriptState, program, "shader", shader->type(), shader);
 }
 
 void WebGLRenderingContextBase::bindAttribLocation(WebGLProgram* program, GLuint index, const String& name)
@@ -1437,7 +1445,7 @@
     return true;
 }
 
-void WebGLRenderingContextBase::bindBuffer(GLenum target, WebGLBuffer* buffer)
+void WebGLRenderingContextBase::bindBuffer(ScriptState* scriptState, GLenum target, WebGLBuffer* buffer)
 {
     bool deleted;
     if (!checkObjectToBeBound("bindBuffer", buffer, deleted))
@@ -1448,9 +1456,11 @@
         return;
 
     webContext()->bindBuffer(target, objectOrZero(buffer));
+    preserveObjectWrapper(scriptState, this, "buffer", target, buffer);
+    maybePreserveDefaultVAOObjectWrapper(scriptState);
 }
 
-void WebGLRenderingContextBase::bindFramebuffer(GLenum target, WebGLFramebuffer* buffer)
+void WebGLRenderingContextBase::bindFramebuffer(ScriptState* scriptState, GLenum target, WebGLFramebuffer* buffer)
 {
     bool deleted;
     if (!checkObjectToBeBound("bindFramebuffer", buffer, deleted))
@@ -1465,9 +1475,13 @@
     }
 
     setFramebuffer(target, buffer);
+    // This is called both internally and externally (from JavaScript). We only update which wrapper
+    // is preserved when it's called from JavaScript.
+    if (scriptState)
+        preserveObjectWrapper(scriptState, this, "framebuffer", 0, buffer);
 }
 
-void WebGLRenderingContextBase::bindRenderbuffer(GLenum target, WebGLRenderbuffer* renderBuffer)
+void WebGLRenderingContextBase::bindRenderbuffer(ScriptState* scriptState, GLenum target, WebGLRenderbuffer* renderBuffer)
 {
     bool deleted;
     if (!checkObjectToBeBound("bindRenderbuffer", renderBuffer, deleted))
@@ -1480,11 +1494,12 @@
     }
     m_renderbufferBinding = renderBuffer;
     webContext()->bindRenderbuffer(target, objectOrZero(renderBuffer));
+    preserveObjectWrapper(scriptState, this, "renderbuffer", 0, renderBuffer);
     if (renderBuffer)
         renderBuffer->setHasEverBeenBound();
 }
 
-void WebGLRenderingContextBase::bindTexture(GLenum target, WebGLTexture* texture)
+void WebGLRenderingContextBase::bindTexture(ScriptState* scriptState, GLenum target, WebGLTexture* texture)
 {
     bool deleted;
     if (!checkObjectToBeBound("bindTexture", texture, deleted))
@@ -1495,23 +1510,34 @@
         synthesizeGLError(GL_INVALID_OPERATION, "bindTexture", "textures can not be used with multiple targets");
         return;
     }
+
+    const char* bindingPointName = nullptr;
     if (target == GL_TEXTURE_2D) {
         m_textureUnits[m_activeTextureUnit].m_texture2DBinding = texture;
 
         if (!m_activeTextureUnit)
             drawingBuffer()->setTexture2DBinding(objectOrZero(texture));
+        bindingPointName = "texture_2d";
     } else if (target == GL_TEXTURE_CUBE_MAP) {
         m_textureUnits[m_activeTextureUnit].m_textureCubeMapBinding = texture;
+        bindingPointName = "texture_cube_map";
     } else if (isWebGL2OrHigher() && target == GL_TEXTURE_2D_ARRAY) {
         m_textureUnits[m_activeTextureUnit].m_texture2DArrayBinding = texture;
+        bindingPointName = "texture_2d_array";
     } else if (isWebGL2OrHigher() && target == GL_TEXTURE_3D) {
         m_textureUnits[m_activeTextureUnit].m_texture3DBinding = texture;
+        bindingPointName = "texture_3d";
     } else {
         synthesizeGLError(GL_INVALID_ENUM, "bindTexture", "invalid target");
         return;
     }
 
     webContext()->bindTexture(target, objectOrZero(texture));
+    // This is called both internally and externally (from JavaScript). We only update which wrapper
+    // is preserved when it's called from JavaScript.
+    if (scriptState) {
+        preserveObjectWrapper(scriptState, this, bindingPointName, m_activeTextureUnit, texture);
+    }
     if (texture) {
         texture->setTarget(target, getMaxTextureLevelForTarget(target));
         m_onePlusMaxNonDefaultTextureUnit = max(m_activeTextureUnit + 1, m_onePlusMaxNonDefaultTextureUnit);
@@ -1945,6 +1971,16 @@
     return renderbuffer->emulatedStencilBuffer();
 }
 
+void WebGLRenderingContextBase::setBoundVertexArrayObject(ScriptState* scriptState, WebGLVertexArrayObjectBase* arrayObject)
+{
+    if (arrayObject)
+        m_boundVertexArrayObject = arrayObject;
+    else
+        m_boundVertexArrayObject = m_defaultVertexArrayObject;
+
+    preserveObjectWrapper(scriptState, this, "boundvao", 0, arrayObject);
+}
+
 WebGLShader* WebGLRenderingContextBase::createShader(GLenum type)
 {
     if (isContextLost())
@@ -2101,7 +2137,7 @@
     webContext()->depthRange(zNear, zFar);
 }
 
-void WebGLRenderingContextBase::detachShader(WebGLProgram* program, WebGLShader* shader)
+void WebGLRenderingContextBase::detachShader(ScriptState* scriptState, WebGLProgram* program, WebGLShader* shader)
 {
     if (isContextLost() || !validateWebGLObject("detachShader", program) || !validateWebGLObject("detachShader", shader))
         return;
@@ -2111,6 +2147,7 @@
     }
     webContext()->detachShader(objectOrZero(program), objectOrZero(shader));
     shader->onDetached(webContext());
+    preserveObjectWrapper(scriptState, program, "shader", shader->type(), nullptr);
 }
 
 void WebGLRenderingContextBase::disable(GLenum cap)
@@ -2270,7 +2307,7 @@
     webContext()->flush();
 }
 
-void WebGLRenderingContextBase::framebufferRenderbuffer(GLenum target, GLenum attachment, GLenum renderbuffertarget, WebGLRenderbuffer* buffer)
+void WebGLRenderingContextBase::framebufferRenderbuffer(ScriptState* scriptState, GLenum target, GLenum attachment, GLenum renderbuffertarget, WebGLRenderbuffer* buffer)
 {
     if (isContextLost() || !validateFramebufferFuncParameters("framebufferRenderbuffer", target, attachment))
         return;
@@ -2318,9 +2355,10 @@
         framebufferBinding->setAttachmentForBoundFramebuffer(target, attachment, buffer);
     }
     applyStencilTest();
+    preserveObjectWrapper(scriptState, framebufferBinding, "renderbuffer", attachment, buffer);
 }
 
-void WebGLRenderingContextBase::framebufferTexture2D(GLenum target, GLenum attachment, GLenum textarget, WebGLTexture* texture, GLint level)
+void WebGLRenderingContextBase::framebufferTexture2D(ScriptState* scriptState, GLenum target, GLenum attachment, GLenum textarget, WebGLTexture* texture, GLint level)
 {
     if (isContextLost() || !validateFramebufferFuncParameters("framebufferTexture2D", target, attachment))
         return;
@@ -2360,6 +2398,7 @@
     }
     framebufferBinding->setAttachmentForBoundFramebuffer(target, attachment, textarget, texture, level);
     applyStencilTest();
+    preserveObjectWrapper(scriptState, framebufferBinding, "texture2d", attachment, texture);
 }
 
 void WebGLRenderingContextBase::frontFace(GLenum mode)
@@ -2564,6 +2603,7 @@
 ScriptValue WebGLRenderingContextBase::getExtension(ScriptState* scriptState, const String& name)
 {
     WebGLExtension* extension = nullptr;
+    bool linkContextToExtension = false;
 
     if (!isContextLost()) {
         for (size_t i = 0; i < m_extensions.size(); ++i) {
@@ -2571,15 +2611,27 @@
             if (tracker->matchesNameWithPrefixes(name)) {
                 if (extensionSupportedAndAllowed(tracker)) {
                     extension = tracker->getExtension(this);
-                    if (extension)
-                        m_extensionEnabled[extension->name()] = true;
+                    if (extension) {
+                        if (!m_extensionEnabled[extension->name()]) {
+                            linkContextToExtension = true;
+                            m_extensionEnabled[extension->name()] = true;
+                        }
+                    }
                 }
                 break;
             }
         }
     }
 
-    return ScriptValue(scriptState, toV8(extension, scriptState->context()->Global(), scriptState->isolate()));
+    v8::Local<v8::Value> wrappedExtension = toV8(extension, scriptState->context()->Global(), scriptState->isolate());
+
+    if (linkContextToExtension) {
+        // Keep the extension's JavaScript wrapper alive as long as the context is alive, so that
+        // expando properties that are added to the extension persist.
+        preserveObjectWrapper(scriptState, this, "extension", static_cast<unsigned long>(extension->name()), extension);
+    }
+
+    return ScriptValue(scriptState, wrappedExtension);
 }
 
 ScriptValue WebGLRenderingContextBase::getFramebufferAttachmentParameter(ScriptState* scriptState, GLenum target, GLenum attachment, GLenum pname)
@@ -4857,7 +4909,7 @@
     webContext()->uniformMatrix4fv(location->location(), v.size() >> 4, transpose, v.data());
 }
 
-void WebGLRenderingContextBase::useProgram(WebGLProgram* program)
+void WebGLRenderingContextBase::useProgram(ScriptState* scriptState, WebGLProgram* program)
 {
     bool deleted;
     if (!checkObjectToBeBound("useProgram", program, deleted))
@@ -4875,6 +4927,7 @@
         webContext()->useProgram(objectOrZero(program));
         if (program)
             program->onAttached();
+        preserveObjectWrapper(scriptState, this, "program", 0, program);
     }
 }
 
@@ -4945,7 +4998,7 @@
     vertexAttribfvImpl("vertexAttrib4fv", index, v.data(), v.size(), 4);
 }
 
-void WebGLRenderingContextBase::vertexAttribPointer(GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, long long offset)
+void WebGLRenderingContextBase::vertexAttribPointer(ScriptState* scriptState, GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, long long offset)
 {
     if (isContextLost())
         return;
@@ -4984,6 +5037,8 @@
 
     m_boundVertexArrayObject->setVertexAttribState(index, bytesPerElement, size, type, normalized, stride, static_cast<GLintptr>(offset), m_boundArrayBuffer);
     webContext()->vertexAttribPointer(index, size, type, normalized, stride, static_cast<GLintptr>(offset));
+    maybePreserveDefaultVAOObjectWrapper(scriptState);
+    preserveObjectWrapper(scriptState, m_boundVertexArrayObject, "arraybuffer", index, m_boundArrayBuffer);
 }
 
 void WebGLRenderingContextBase::vertexAttribDivisorANGLE(GLuint index, GLuint divisor)
@@ -6646,12 +6701,12 @@
 
 void WebGLRenderingContextBase::restoreCurrentFramebuffer()
 {
-    bindFramebuffer(GL_FRAMEBUFFER, m_framebufferBinding.get());
+    bindFramebuffer(nullptr, GL_FRAMEBUFFER, m_framebufferBinding.get());
 }
 
 void WebGLRenderingContextBase::restoreCurrentTexture2D()
 {
-    bindTexture(GL_TEXTURE_2D, m_textureUnits[m_activeTextureUnit].m_texture2DBinding.get());
+    bindTexture(nullptr, GL_TEXTURE_2D, m_textureUnits[m_activeTextureUnit].m_texture2DBinding.get());
 }
 
 void WebGLRenderingContextBase::multisamplingChanged(bool enabled)
@@ -6676,6 +6731,52 @@
     m_onePlusMaxNonDefaultTextureUnit = 0;
 }
 
+void WebGLRenderingContextBase::preserveObjectWrapper(ScriptState* scriptState, ScriptWrappable* sourceObject, const char* baseName, unsigned long index, ScriptWrappable* targetObject)
+{
+    ASSERT(scriptState);
+
+    v8::Local<v8::Value> value;
+    v8::Isolate* isolate = scriptState->isolate();
+
+    // TODO (kbr): move this logic to V8HiddenValue. The difficulty in doing so is that the index
+    // may vary, so it'd be necessary to lazily instantiate the V8 internalized strings, and have
+    // efficient lookup for already-created ones.
+    StringBuilder builder;
+    builder.append(baseName);
+    builder.appendNumber(static_cast<unsigned>(index));
+    CString name = builder.toString().utf8();
+    v8::Local<v8::String> jsName = v8::String::NewFromUtf8(
+        isolate,
+        name.data(),
+        v8::NewStringType::kNormal,
+        name.length()).ToLocalChecked();
+    if (targetObject) {
+        V8HiddenValue::setHiddenValue(
+            isolate,
+            sourceObject->newLocalWrapper(isolate),
+            jsName,
+            targetObject->newLocalWrapper(isolate));
+    } else {
+        V8HiddenValue::deleteHiddenValue(
+            isolate,
+            sourceObject->newLocalWrapper(isolate),
+            jsName);
+    }
+}
+
+void WebGLRenderingContextBase::maybePreserveDefaultVAOObjectWrapper(ScriptState* scriptState)
+{
+    ASSERT(scriptState);
+
+    if (!m_preservedDefaultVAOObjectWrapper) {
+        // The default VAO does not have a JavaScript wrapper created for it, but one is needed to
+        // link up the WebGLBuffers associated with the vertex attributes.
+        toV8(m_defaultVertexArrayObject, scriptState->context()->Global(), scriptState->isolate());
+        preserveObjectWrapper(scriptState, this, "defaultvao", 0, m_defaultVertexArrayObject);
+        m_preservedDefaultVAOObjectWrapper = true;
+    }
+}
+
 DEFINE_TRACE(WebGLRenderingContextBase::TextureUnitState)
 {
     visitor->trace(m_texture2DBinding);
diff --git a/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.h b/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.h
index bcbc377..450a0963 100644
--- a/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.h
+++ b/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.h
@@ -170,12 +170,12 @@
     int drawingBufferHeight() const;
 
     void activeTexture(GLenum texture);
-    void attachShader(WebGLProgram*, WebGLShader*);
+    void attachShader(ScriptState*, WebGLProgram*, WebGLShader*);
     void bindAttribLocation(WebGLProgram*, GLuint index, const String& name);
-    void bindBuffer(GLenum target, WebGLBuffer*);
-    virtual void bindFramebuffer(GLenum target, WebGLFramebuffer*);
-    void bindRenderbuffer(GLenum target, WebGLRenderbuffer*);
-    void bindTexture(GLenum target, WebGLTexture*);
+    void bindBuffer(ScriptState*, GLenum target, WebGLBuffer*);
+    virtual void bindFramebuffer(ScriptState*, GLenum target, WebGLFramebuffer*);
+    void bindRenderbuffer(ScriptState*, GLenum target, WebGLRenderbuffer*);
+    void bindTexture(ScriptState*, GLenum target, WebGLTexture*);
     void blendColor(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
     void blendEquation(GLenum mode);
     void blendEquationSeparate(GLenum modeRGB, GLenum modeAlpha);
@@ -221,7 +221,7 @@
     void depthFunc(GLenum);
     void depthMask(GLboolean);
     void depthRange(GLfloat zNear, GLfloat zFar);
-    void detachShader(WebGLProgram*, WebGLShader*);
+    void detachShader(ScriptState*, WebGLProgram*, WebGLShader*);
     void disable(GLenum cap);
     void disableVertexAttribArray(GLuint index);
     void drawArrays(GLenum mode, GLint first, GLsizei count);
@@ -234,8 +234,8 @@
     void enableVertexAttribArray(GLuint index);
     void finish();
     void flush();
-    void framebufferRenderbuffer(GLenum target, GLenum attachment, GLenum renderbuffertarget, WebGLRenderbuffer*);
-    void framebufferTexture2D(GLenum target, GLenum attachment, GLenum textarget, WebGLTexture*, GLint level);
+    void framebufferRenderbuffer(ScriptState*, GLenum target, GLenum attachment, GLenum renderbuffertarget, WebGLRenderbuffer*);
+    void framebufferTexture2D(ScriptState*, GLenum target, GLenum attachment, GLenum textarget, WebGLTexture*, GLint level);
     void frontFace(GLenum mode);
     void generateMipmap(GLenum target);
 
@@ -348,7 +348,7 @@
     void uniformMatrix4fv(const WebGLUniformLocation*, GLboolean transpose, DOMFloat32Array* value);
     void uniformMatrix4fv(const WebGLUniformLocation*, GLboolean transpose, Vector<GLfloat>& value);
 
-    void useProgram(WebGLProgram*);
+    void useProgram(ScriptState*, WebGLProgram*);
     void validateProgram(WebGLProgram*);
 
     void vertexAttrib1f(GLuint index, GLfloat x);
@@ -363,7 +363,7 @@
     void vertexAttrib4f(GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
     void vertexAttrib4fv(GLuint index, const DOMFloat32Array* values);
     void vertexAttrib4fv(GLuint index, const Vector<GLfloat>& values);
-    void vertexAttribPointer(GLuint index, GLint size, GLenum type, GLboolean normalized,
+    void vertexAttribPointer(ScriptState*, GLuint index, GLint size, GLenum type, GLboolean normalized,
         GLsizei stride, long long offset);
 
     void vertexAttribDivisorANGLE(GLuint index, GLuint divisor);
@@ -531,13 +531,8 @@
 
     PersistentWillBeMember<WebGLVertexArrayObjectBase> m_defaultVertexArrayObject;
     PersistentWillBeMember<WebGLVertexArrayObjectBase> m_boundVertexArrayObject;
-    void setBoundVertexArrayObject(WebGLVertexArrayObjectBase* arrayObject)
-    {
-        if (arrayObject)
-            m_boundVertexArrayObject = arrayObject;
-        else
-            m_boundVertexArrayObject = m_defaultVertexArrayObject;
-    }
+    bool m_preservedDefaultVAOObjectWrapper;
+    void setBoundVertexArrayObject(ScriptState*, WebGLVertexArrayObjectBase*);
 
     enum VertexAttribValueType {
         Float32ArrayType,
@@ -1104,6 +1099,16 @@
 
     virtual void renderbufferStorageImpl(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, const char* functionName);
 
+    // Ensures that the JavaScript wrappers for objects that are
+    // latched into the context's state, or which are implicitly
+    // linked together (like programs and their attached shaders), are
+    // not garbage collected before they should be.
+    static void preserveObjectWrapper(ScriptState*, ScriptWrappable* sourceObject, const char* baseName, unsigned long index, ScriptWrappable* targetObject);
+    // Called to lazily instantiate the wrapper for the default VAO
+    // during calls to bindBuffer and vertexAttribPointer (from
+    // JavaScript).
+    void maybePreserveDefaultVAOObjectWrapper(ScriptState*);
+
     friend class WebGLStateRestorer;
     friend class WebGLRenderingContextEvictionManager;
 
diff --git a/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.idl b/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.idl
index ad3c1b81..520650a 100644
--- a/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.idl
+++ b/third_party/WebKit/Source/modules/webgl/WebGLRenderingContextBase.idl
@@ -474,12 +474,12 @@
     readonly attribute GLsizei drawingBufferHeight;
 
     void activeTexture(GLenum texture);
-    void attachShader(WebGLProgram? program, WebGLShader? shader);
+    [CallWith=ScriptState] void attachShader(WebGLProgram? program, WebGLShader? shader);
     void bindAttribLocation(WebGLProgram? program, GLuint index, DOMString name);
-    void bindBuffer(GLenum target, WebGLBuffer? buffer);
-    void bindFramebuffer(GLenum target, WebGLFramebuffer? framebuffer);
-    void bindRenderbuffer(GLenum target, WebGLRenderbuffer? renderbuffer);
-    void bindTexture(GLenum target, WebGLTexture? texture);
+    [CallWith=ScriptState] void bindBuffer(GLenum target, WebGLBuffer? buffer);
+    [CallWith=ScriptState] void bindFramebuffer(GLenum target, WebGLFramebuffer? framebuffer);
+    [CallWith=ScriptState] void bindRenderbuffer(GLenum target, WebGLRenderbuffer? renderbuffer);
+    [CallWith=ScriptState] void bindTexture(GLenum target, WebGLTexture? texture);
     void blendColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
     void blendEquation(GLenum mode);
     void blendEquationSeparate(GLenum modeRGB, GLenum modeAlpha);
@@ -528,7 +528,7 @@
     void depthFunc(GLenum func);
     void depthMask(GLboolean flag);
     void depthRange(GLclampf zNear, GLclampf zFar);
-    void detachShader(WebGLProgram? program, WebGLShader? shader);
+    [CallWith=ScriptState] void detachShader(WebGLProgram? program, WebGLShader? shader);
     void disable(GLenum cap);
     void disableVertexAttribArray(GLuint index);
     void drawArrays(GLenum mode, GLint first, GLsizei count);
@@ -538,8 +538,8 @@
     void enableVertexAttribArray(GLuint index);
     void finish();
     void flush();
-    void framebufferRenderbuffer(GLenum target, GLenum attachment, GLenum renderbuffertarget, WebGLRenderbuffer? renderbuffer);
-    void framebufferTexture2D(GLenum target, GLenum attachment, GLenum textarget, WebGLTexture? texture, GLint level);
+    [CallWith=ScriptState] void framebufferRenderbuffer(GLenum target, GLenum attachment, GLenum renderbuffertarget, WebGLRenderbuffer? renderbuffer);
+    [CallWith=ScriptState] void framebufferTexture2D(GLenum target, GLenum attachment, GLenum textarget, WebGLTexture? texture, GLint level);
     void frontFace(GLenum mode);
     void generateMipmap(GLenum target);
 
@@ -682,7 +682,7 @@
     void uniformMatrix4fv(WebGLUniformLocation? location, GLboolean transpose, Float32Array array);
     void uniformMatrix4fv(WebGLUniformLocation? location, GLboolean transpose, sequence<GLfloat> array);
 
-    void useProgram(WebGLProgram? program);
+    [CallWith=ScriptState] void useProgram(WebGLProgram? program);
     void validateProgram(WebGLProgram? program);
 
     void vertexAttrib1f(GLuint indx, GLfloat x);
@@ -697,8 +697,8 @@
     void vertexAttrib4f(GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
     void vertexAttrib4fv(GLuint indx, Float32Array values);
     void vertexAttrib4fv(GLuint indx, sequence<GLfloat> values);
-    void vertexAttribPointer(GLuint indx, GLint size, GLenum type, GLboolean normalized,
-                             GLsizei stride, GLintptr offset);
+    [CallWith=ScriptState] void vertexAttribPointer(GLuint indx, GLint size, GLenum type, GLboolean normalized,
+                                                    GLsizei stride, GLintptr offset);
 
     void viewport(GLint x, GLint y, GLsizei width, GLsizei height);
 };
diff --git a/third_party/WebKit/Source/platform/RuntimeEnabledFeatures.in b/third_party/WebKit/Source/platform/RuntimeEnabledFeatures.in
index ba96635..479e5d4 100644
--- a/third_party/WebKit/Source/platform/RuntimeEnabledFeatures.in
+++ b/third_party/WebKit/Source/platform/RuntimeEnabledFeatures.in
@@ -38,7 +38,6 @@
 // Unified Chrome Compositor and Blink Animations engine (Project Heaviside). crbug.com/394772
 CompositorAnimationTimelines
 ContextMenu status=experimental
-CreateShadowRootWithParameter status=experimental
 CredentialManager status=test
 CSS3Text status=experimental
 CSS3TextDecorations status=experimental
@@ -148,6 +147,7 @@
 ServiceWorkerClientAttributes status=stable
 ServiceWorkerPerformanceTimeline status=stable
 ServiceWorkerWindowClientNavigate status=experimental
+ShadowDOMV1 status=experimental
 ShadowRootClosedMode status=experimental
 ShadowRootDelegatesFocus status=experimental
 SharedArrayBuffer
diff --git a/third_party/WebKit/Source/platform/TimerTest.cpp b/third_party/WebKit/Source/platform/TimerTest.cpp
index a75a16a..91b62dc 100644
--- a/third_party/WebKit/Source/platform/TimerTest.cpp
+++ b/third_party/WebKit/Source/platform/TimerTest.cpp
@@ -77,7 +77,7 @@
     explicit MockWebTaskRunner(std::priority_queue<DelayedTask>* timerTasks) : m_timerTasks(timerTasks) { }
     ~MockWebTaskRunner() override { }
 
-    void postTask(const WebTraceLocation&, Task* task) override
+    virtual void postTask(const WebTraceLocation&, Task* task)
     {
         m_timerTasks->push(DelayedTask(task, 0));
     }
@@ -87,12 +87,6 @@
         m_timerTasks->push(DelayedTask(task, delayMs * 0.001));
     }
 
-    WebTaskRunner* clone() override
-    {
-        ASSERT_NOT_REACHED();
-        return nullptr;
-    }
-
     std::priority_queue<DelayedTask>* m_timerTasks; // NOT OWNED
 };
 
diff --git a/third_party/WebKit/Source/platform/blink_platform.gypi b/third_party/WebKit/Source/platform/blink_platform.gypi
index 3bfd1fe3..b62819ce 100644
--- a/third_party/WebKit/Source/platform/blink_platform.gypi
+++ b/third_party/WebKit/Source/platform/blink_platform.gypi
@@ -376,6 +376,8 @@
       'fonts/FontDataCache.h',
       'fonts/FontDescription.cpp',
       'fonts/FontFaceCreationParams.h',
+      'fonts/FontFallbackIterator.cpp',
+      'fonts/FontFallbackIterator.h',
       'fonts/FontFallbackList.cpp',
       'fonts/FontFallbackList.h',
       'fonts/FontFamily.cpp',
@@ -670,8 +672,6 @@
       'graphics/paint/DisplayItems.h',
       'graphics/paint/DisplayItemCacheSkipper.h',
       'graphics/paint/DisplayItemClient.h',
-      'graphics/paint/DisplayItemList.cpp',
-      'graphics/paint/DisplayItemList.h',
       'graphics/paint/DisplayItemClipTree.cpp',
       'graphics/paint/DisplayItemClipTree.h',
       'graphics/paint/DisplayItemPropertyTreeBuilder.cpp',
@@ -696,6 +696,8 @@
       'graphics/paint/PaintChunk.h',
       'graphics/paint/PaintChunker.cpp',
       'graphics/paint/PaintChunker.h',
+      'graphics/paint/PaintController.cpp',
+      'graphics/paint/PaintController.h',
       'graphics/paint/ScrollDisplayItem.cpp',
       'graphics/paint/ScrollDisplayItem.h',
       'graphics/paint/SkPictureBuilder.h',
@@ -1008,9 +1010,9 @@
       'graphics/filters/ImageFilterBuilderTest.cpp',
       'graphics/gpu/DrawingBufferTest.cpp',
       'graphics/paint/DisplayItemPropertyTreeBuilderTest.cpp',
-      'graphics/paint/DisplayItemListTest.cpp',
       'graphics/paint/DisplayItemTest.cpp',
       'graphics/paint/PaintChunkerTest.cpp',
+      'graphics/paint/PaintControllerTest.cpp',
       'image-decoders/FastSharedBufferReaderTest.cpp',
       'image-decoders/ImageDecoderTest.cpp',
       'mac/VersionUtilMacTest.mm',
diff --git a/third_party/WebKit/Source/platform/fonts/Font.cpp b/third_party/WebKit/Source/platform/fonts/Font.cpp
index 77ab8d9..5b0df14 100644
--- a/third_party/WebKit/Source/platform/fonts/Font.cpp
+++ b/third_party/WebKit/Source/platform/fonts/Font.cpp
@@ -30,6 +30,7 @@
 #include "platform/RuntimeEnabledFeatures.h"
 #include "platform/fonts/Character.h"
 #include "platform/fonts/FontCache.h"
+#include "platform/fonts/FontFallbackIterator.h"
 #include "platform/fonts/FontFallbackList.h"
 #include "platform/fonts/GlyphBuffer.h"
 #include "platform/fonts/GlyphPageTreeNode.h"
@@ -412,6 +413,11 @@
     return data;
 }
 
+PassRefPtr<FontFallbackIterator> Font::createFontFallbackIterator() const
+{
+    return FontFallbackIterator::create(m_fontDescription, m_fontFallbackList);
+}
+
 GlyphData Font::glyphDataForCharacter(UChar32& c, bool mirror, bool normalizeSpace, FontDataVariant variant) const
 {
     ASSERT(isMainThread());
diff --git a/third_party/WebKit/Source/platform/fonts/Font.h b/third_party/WebKit/Source/platform/fonts/Font.h
index 6fd1f70..248af2f 100644
--- a/third_party/WebKit/Source/platform/fonts/Font.h
+++ b/third_party/WebKit/Source/platform/fonts/Font.h
@@ -48,6 +48,7 @@
 
 class FloatPoint;
 class FloatRect;
+class FontFallbackIterator;
 class FontData;
 class FontMetrics;
 class FontSelector;
@@ -146,6 +147,7 @@
 
 public:
     FontSelector* fontSelector() const;
+    PassRefPtr<FontFallbackIterator> createFontFallbackIterator() const;
 
     void willUseFontData(UChar32) const;
 
diff --git a/third_party/WebKit/Source/platform/fonts/FontDescription.h b/third_party/WebKit/Source/platform/fonts/FontDescription.h
index 2e59ab4..3f7a1bf 100644
--- a/third_party/WebKit/Source/platform/fonts/FontDescription.h
+++ b/third_party/WebKit/Source/platform/fonts/FontDescription.h
@@ -278,6 +278,7 @@
 inline bool FontDescription::operator==(const FontDescription& other) const
 {
     return m_familyList == other.m_familyList
+        && m_locale == other.m_locale
         && m_specifiedSize == other.m_specifiedSize
         && m_computedSize == other.m_computedSize
         && m_adjustedSize == other.m_adjustedSize
diff --git a/third_party/WebKit/Source/platform/fonts/FontFallbackIterator.cpp b/third_party/WebKit/Source/platform/fonts/FontFallbackIterator.cpp
new file mode 100644
index 0000000..1d4db95
--- /dev/null
+++ b/third_party/WebKit/Source/platform/fonts/FontFallbackIterator.cpp
@@ -0,0 +1,140 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "config.h"
+#include "platform/fonts/FontFallbackIterator.h"
+
+#include "platform/Logging.h"
+#include "platform/fonts/FontCache.h"
+#include "platform/fonts/FontDescription.h"
+#include "platform/fonts/FontFallbackList.h"
+#include "platform/fonts/SegmentedFontData.h"
+#include "platform/fonts/SimpleFontData.h"
+
+namespace blink {
+
+PassRefPtr<FontFallbackIterator> FontFallbackIterator::create(const FontDescription& description, PassRefPtr<FontFallbackList> fallbackList)
+{
+    return adoptRef(new FontFallbackIterator(description, fallbackList));
+}
+
+FontFallbackIterator::FontFallbackIterator(const FontDescription& description, PassRefPtr<FontFallbackList> fallbackList)
+    : m_fontDescription(description)
+    , m_fontFallbackList(fallbackList)
+    , m_currentFontDataIndex(0)
+    , m_segmentedIndex(0)
+    , m_fallbackStage(FontGroupFonts)
+    , m_currentFamily(&description.family())
+{
+}
+
+bool FontFallbackIterator::needsHintList() const
+{
+    if (m_fallbackStage != FontGroupFonts && m_fallbackStage != SegmentedFace) {
+        return false;
+    }
+
+    const FontData* fontData = m_fontFallbackList->fontDataAt(m_fontDescription, m_currentFontDataIndex);
+    return fontData && fontData->isSegmented();
+}
+
+static bool rangeContributesForHint(const Vector<UChar32> hintList, const FontDataRange& fontDataRange)
+{
+    for (auto it = hintList.begin(); it != hintList.end(); ++it) {
+        if (*it >= fontDataRange.from() && *it <= fontDataRange.to()) {
+            return true;
+        }
+    }
+    return false;
+}
+
+void FontFallbackIterator::willUseRange(const AtomicString& family, const FontDataRange& range)
+{
+    FontSelector* selector = m_fontFallbackList->fontSelector();
+    if (!selector)
+        return;
+
+    selector->willUseRange(m_fontDescription, family, range);
+}
+
+const SimpleFontData* FontFallbackIterator::next(const Vector<UChar32>& hintList)
+{
+    if (m_fallbackStage == OutOfLuck)
+        return nullptr;
+
+    const FontData* fontData = m_fontFallbackList->fontDataAt(m_fontDescription, m_currentFontDataIndex);
+
+    if (!fontData) {
+        m_fallbackStage = SystemFonts;
+        // We've reached pref + system fallback.
+        ASSERT(hintList.size());
+        const SimpleFontData* systemFont = uniqueSystemFontForHint(hintList[0]);
+        if (systemFont)
+            return systemFont;
+
+        // If we don't have options from the system fallback anymore or had
+        // previously returned them, we only have the last resort font left.
+        // TODO: crbug.com/42217 Improve this by doing the last run with a last
+        // resort font that has glyphs for everything, for example the Unicode
+        // LastResort font, not just Times or Arial.
+        FontCache* fontCache = FontCache::fontCache();
+        m_fallbackStage = OutOfLuck;
+        SimpleFontData* lastResort = fontCache->getLastResortFallbackFont(m_fontDescription).get();
+        RELEASE_ASSERT(lastResort);
+        return lastResort;
+    }
+
+    if (!fontData->isSegmented()) {
+        // Skip forward to the next font family for the next call to next().
+        m_currentFontDataIndex++;
+        m_currentFamily = m_currentFamily->next();
+        return toSimpleFontData(fontData);
+    }
+
+    // Iterate over ranges of a segmented font below.
+
+    const SegmentedFontData* segmented = toSegmentedFontData(fontData);
+    if (m_fallbackStage != SegmentedFace) {
+        m_segmentedIndex = 0;
+        m_fallbackStage = SegmentedFace;
+    }
+
+    ASSERT(m_segmentedIndex < segmented->numRanges());
+    FontDataRange currentRange = segmented->rangeAt(m_segmentedIndex);
+    m_segmentedIndex++;
+    AtomicString segmentedFamily = m_currentFamily->family();
+
+    if (m_segmentedIndex == segmented->numRanges()) {
+        // Switch from iterating over a segmented face to the next family from
+        // the font-family: group of fonts.
+        m_fallbackStage = FontGroupFonts;
+        m_currentFontDataIndex++;
+        m_currentFamily = m_currentFamily->next();
+    }
+
+    if (rangeContributesForHint(hintList, currentRange)) {
+        willUseRange(segmentedFamily, currentRange);
+        return currentRange.fontData().get();
+    }
+
+    return next(hintList);
+}
+
+const SimpleFontData* FontFallbackIterator::uniqueSystemFontForHint(UChar32 hint)
+{
+    FontCache* fontCache = FontCache::fontCache();
+
+    // When we're asked for a fallback for the same characters again, we give up
+    // because the shaper must have previously tried shaping with the font
+    // already.
+    if (m_visitedSystemFonts.find(hint) != m_visitedSystemFonts.end()) {
+        return nullptr;
+    }
+
+    RefPtr<SimpleFontData> fallbackFont = fontCache->fallbackFontForCharacter(m_fontDescription, hint, m_fontFallbackList->primarySimpleFontData(m_fontDescription));
+
+    return m_visitedSystemFonts.add(hint, fallbackFont).storedValue->value.get();
+}
+
+} // namespace blink
diff --git a/third_party/WebKit/Source/platform/fonts/FontFallbackIterator.h b/third_party/WebKit/Source/platform/fonts/FontFallbackIterator.h
new file mode 100644
index 0000000..2d653bc02
--- /dev/null
+++ b/third_party/WebKit/Source/platform/fonts/FontFallbackIterator.h
@@ -0,0 +1,70 @@
+// 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 FontFallbackIterator_h
+#define FontFallbackIterator_h
+
+#include "platform/fonts/SegmentedFontData.h"
+#include "wtf/HashMap.h"
+#include "wtf/PassRefPtr.h"
+#include "wtf/RefCounted.h"
+#include "wtf/RefPtr.h"
+#include "wtf/Vector.h"
+#include "wtf/text/Unicode.h"
+
+namespace blink {
+
+using namespace WTF;
+
+class FontDescription;
+class FontFallbackList;
+class SimpleFontData;
+struct FontDataRange;
+class FontFamily;
+
+class FontFallbackIterator : public RefCounted<FontFallbackIterator> {
+    WTF_MAKE_NONCOPYABLE(FontFallbackIterator);
+
+public:
+    static PassRefPtr<FontFallbackIterator> create(const FontDescription&, PassRefPtr<FontFallbackList>);
+
+    // Returns whether a list of all remaining characters to be shaped is
+    // needed.  Needed by the FontfallbackIterator in order to check whether a
+    // font from a segmented range should be loaded.
+    bool needsHintList() const;
+
+    bool hasNext() const { return m_fallbackStage != OutOfLuck; };
+
+    // Some system fallback APIs (Windows, Android) require a character, or a
+    // portion of the string to be passed.  On Mac and Linux, we get a list of
+    // fonts without passing in characters.
+    const SimpleFontData* next(const Vector<UChar32>& hintList);
+
+private:
+    FontFallbackIterator(const FontDescription&, PassRefPtr<FontFallbackList>);
+    void willUseRange(const AtomicString& family, const FontDataRange&);
+
+    const SimpleFontData* uniqueSystemFontForHint(UChar32 hint);
+
+    const FontDescription& m_fontDescription;
+    RefPtr<FontFallbackList> m_fontFallbackList;
+    int m_currentFontDataIndex;
+    unsigned m_segmentedIndex;
+
+    enum FallbackStage {
+        FontGroupFonts,
+        SegmentedFace,
+        PreferencesFonts,
+        SystemFonts,
+        OutOfLuck
+    };
+
+    FallbackStage m_fallbackStage;
+    const FontFamily* m_currentFamily;
+    HashMap<UChar32, RefPtr<SimpleFontData>> m_visitedSystemFonts;
+};
+
+} // namespace blink
+
+#endif
diff --git a/third_party/WebKit/Source/platform/fonts/FontSelector.h b/third_party/WebKit/Source/platform/fonts/FontSelector.h
index 8bd8c86..183b877 100644
--- a/third_party/WebKit/Source/platform/fonts/FontSelector.h
+++ b/third_party/WebKit/Source/platform/fonts/FontSelector.h
@@ -28,6 +28,7 @@
 
 #include "platform/PlatformExport.h"
 #include "platform/fonts/FontCacheClient.h"
+#include "platform/fonts/SegmentedFontData.h"
 #include "wtf/Forward.h"
 #include "wtf/PassRefPtr.h"
 #include "wtf/text/AtomicString.h"
@@ -41,7 +42,10 @@
 public:
     virtual ~FontSelector() { }
     virtual PassRefPtr<FontData> getFontData(const FontDescription&, const AtomicString& familyName) = 0;
+
+    // TODO crbug.com/542629 - The UChar32 variant of this method should go away after switching to complex text.
     virtual void willUseFontData(const FontDescription&, const AtomicString& familyName, UChar32) = 0;
+    virtual void willUseRange(const FontDescription&, const AtomicString& familyName, const FontDataRange&) = 0;
 
     virtual unsigned version() const = 0;
 };
diff --git a/third_party/WebKit/Source/platform/fonts/ScriptRunIteratorTest.cpp b/third_party/WebKit/Source/platform/fonts/ScriptRunIteratorTest.cpp
index 624ad0b..ffbba9a 100644
--- a/third_party/WebKit/Source/platform/fonts/ScriptRunIteratorTest.cpp
+++ b/third_party/WebKit/Source/platform/fonts/ScriptRunIteratorTest.cpp
@@ -517,6 +517,12 @@
         { "Unicode\"", USCRIPT_LATIN } });
 }
 
+// Emojies are resolved to the leading script.
+TEST_F(ScriptRunIteratorTest, EmojiCommon)
+{
+    CHECK_RUNS({ { "百家姓🌱🌲🌳🌴", USCRIPT_HAN } });
+}
+
 // Unmatched close brace gets leading context
 TEST_F(ScriptRunIteratorTest, UnmatchedClose)
 {
@@ -664,6 +670,22 @@
         { " \xE0\xA5\x91", USCRIPT_DEVANAGARI } });
 }
 
+// Corresponds to one test in RunSegmenter, where orientation of the
+// space character is sidesways in vertical.
+TEST_F(ScriptRunIteratorTest, Hangul)
+{
+    CHECK_RUNS({ { "키스의 고유조건은", USCRIPT_HANGUL } });
+}
+
+// Corresponds to one test in RunSegmenter, which tests that the punctuation
+// characters mixed in are actually sideways in vertical. The ScriptIterator
+// should report one run, but the RunSegmenter should report three, with the
+// middle one rotated sideways.
+TEST_F(ScriptRunIteratorTest, HiraganaMixedPunctuation)
+{
+    CHECK_RUNS({ { "いろはに.…¡ほへと", USCRIPT_HIRAGANA } });
+}
+
 // Make sure Mock code works too.
 TEST_F(ScriptRunIteratorTest, MockHanInheritedGL)
 {
diff --git a/third_party/WebKit/Source/platform/fonts/SegmentedFontData.h b/third_party/WebKit/Source/platform/fonts/SegmentedFontData.h
index 325137e..0120ca5 100644
--- a/third_party/WebKit/Source/platform/fonts/SegmentedFontData.h
+++ b/third_party/WebKit/Source/platform/fonts/SegmentedFontData.h
@@ -28,7 +28,7 @@
 
 #include "platform/PlatformExport.h"
 #include "platform/fonts/FontData.h"
-#include "wtf/Vector.h"
+#include "platform/fonts/SimpleFontData.h"
 
 namespace blink {
 
diff --git a/third_party/WebKit/Source/platform/fonts/TestFontSelector.h b/third_party/WebKit/Source/platform/fonts/TestFontSelector.h
index 044b188..3d2bb18 100644
--- a/third_party/WebKit/Source/platform/fonts/TestFontSelector.h
+++ b/third_party/WebKit/Source/platform/fonts/TestFontSelector.h
@@ -69,6 +69,9 @@
 
     void willUseFontData(const FontDescription&, const AtomicString& familyName,
         UChar32) override { }
+    void willUseRange(const FontDescription&, const AtomicString& familyName,
+        const FontDataRange&) override { };
+
     unsigned version() const override { return 0; }
     void fontCacheInvalidated() override { }
 
diff --git a/third_party/WebKit/Source/platform/fonts/shaping/ShapeCache.h b/third_party/WebKit/Source/platform/fonts/shaping/ShapeCache.h
index 60dc1f1..ac8278c3 100644
--- a/third_party/WebKit/Source/platform/fonts/shaping/ShapeCache.h
+++ b/third_party/WebKit/Source/platform/fonts/shaping/ShapeCache.h
@@ -51,6 +51,7 @@
 };
 
 class ShapeCache {
+    WTF_MAKE_NONCOPYABLE(ShapeCache);
 private:
     // Used to optimize small strings as hash table keys. Avoids malloc'ing an out-of-line StringImpl.
     class SmallStringKey {
diff --git a/third_party/WebKit/Source/platform/graphics/CompositedDisplayList.h b/third_party/WebKit/Source/platform/graphics/CompositedDisplayList.h
index 3668756..d2f945d 100644
--- a/third_party/WebKit/Source/platform/graphics/CompositedDisplayList.h
+++ b/third_party/WebKit/Source/platform/graphics/CompositedDisplayList.h
@@ -5,8 +5,8 @@
 #ifndef CompositedDisplayList_h
 #define CompositedDisplayList_h
 
-#include "platform/graphics/paint/DisplayItemList.h"
 #include "platform/graphics/paint/DisplayItemTransformTree.h"
+#include "platform/graphics/paint/PaintController.h"
 
 namespace blink {
 
diff --git a/third_party/WebKit/Source/platform/graphics/ContentLayerDelegate.cpp b/third_party/WebKit/Source/platform/graphics/ContentLayerDelegate.cpp
index 2fa29b1d..86569bc 100644
--- a/third_party/WebKit/Source/platform/graphics/ContentLayerDelegate.cpp
+++ b/third_party/WebKit/Source/platform/graphics/ContentLayerDelegate.cpp
@@ -32,7 +32,7 @@
 #include "platform/TracedValue.h"
 #include "platform/geometry/IntRect.h"
 #include "platform/graphics/GraphicsContext.h"
-#include "platform/graphics/paint/DisplayItemList.h"
+#include "platform/graphics/paint/PaintController.h"
 #include "platform/transforms/AffineTransform.h"
 #include "platform/transforms/TransformationMatrix.h"
 #include "public/platform/WebDisplayItemList.h"
@@ -85,35 +85,35 @@
     // here so the browser is usable during development and does not crash due
     // to committing the new display items twice.
     if (RuntimeEnabledFeatures::slimmingPaintSynchronizedPaintingEnabled()) {
-        m_painter->displayItemList()->paintArtifact().appendToWebDisplayItemList(webDisplayItemList);
+        m_painter->paintController()->paintArtifact().appendToWebDisplayItemList(webDisplayItemList);
         return;
     }
 
-    DisplayItemList* displayItemList = m_painter->displayItemList();
-    ASSERT(displayItemList);
-    displayItemList->setDisplayItemConstructionIsDisabled(
+    PaintController* paintController = m_painter->paintController();
+    ASSERT(paintController);
+    paintController->setDisplayItemConstructionIsDisabled(
         paintingControl == WebContentLayerClient::DisplayListConstructionDisabled);
 
     // We also disable caching when Painting or Construction are disabled. In both cases we would like
     // to compare assuming the full cost of recording, not the cost of re-using cached content.
     if (paintingControl != WebContentLayerClient::PaintDefaultBehavior)
-        displayItemList->invalidateAll();
+        paintController->invalidateAll();
 
     GraphicsContext::DisabledMode disabledMode = GraphicsContext::NothingDisabled;
     if (paintingControl == WebContentLayerClient::DisplayListPaintingDisabled
         || paintingControl == WebContentLayerClient::DisplayListConstructionDisabled)
         disabledMode = GraphicsContext::FullyDisabled;
-    GraphicsContext context(displayItemList, disabledMode);
+    GraphicsContext context(paintController, disabledMode);
 
     m_painter->paint(context, clip);
 
-    displayItemList->commitNewDisplayItems();
-    displayItemList->paintArtifact().appendToWebDisplayItemList(webDisplayItemList);
+    paintController->commitNewDisplayItems();
+    paintController->paintArtifact().appendToWebDisplayItemList(webDisplayItemList);
 }
 
 size_t ContentLayerDelegate::approximateUnsharedMemoryUsage() const
 {
-    return m_painter->displayItemList()->approximateUnsharedMemoryUsage();
+    return m_painter->paintController()->approximateUnsharedMemoryUsage();
 }
 
 } // namespace blink
diff --git a/third_party/WebKit/Source/platform/graphics/ContentLayerDelegate.h b/third_party/WebKit/Source/platform/graphics/ContentLayerDelegate.h
index 813f51e..9d055181 100644
--- a/third_party/WebKit/Source/platform/graphics/ContentLayerDelegate.h
+++ b/third_party/WebKit/Source/platform/graphics/ContentLayerDelegate.h
@@ -35,16 +35,16 @@
 
 namespace blink {
 
-class DisplayItemList;
 class GraphicsContext;
 class IntRect;
+class PaintController;
 
 class PLATFORM_EXPORT GraphicsContextPainter {
 public:
     virtual void paint(GraphicsContext&, const IntRect& clip) = 0;
     // Paints the content if required, either because the content changed or its interest rect has too much unpainted area.
     virtual void paintIfNeeded(GraphicsContext&) = 0;
-    virtual DisplayItemList* displayItemList() = 0;
+    virtual PaintController* paintController() = 0;
 
 protected:
     virtual ~GraphicsContextPainter() { }
diff --git a/third_party/WebKit/Source/platform/graphics/GraphicsContext.cpp b/third_party/WebKit/Source/platform/graphics/GraphicsContext.cpp
index 54153ce..8a211e6 100644
--- a/third_party/WebKit/Source/platform/graphics/GraphicsContext.cpp
+++ b/third_party/WebKit/Source/platform/graphics/GraphicsContext.cpp
@@ -32,7 +32,7 @@
 #include "platform/graphics/ColorSpace.h"
 #include "platform/graphics/Gradient.h"
 #include "platform/graphics/ImageBuffer.h"
-#include "platform/graphics/paint/DisplayItemList.h"
+#include "platform/graphics/paint/PaintController.h"
 #include "platform/weborigin/KURL.h"
 #include "skia/ext/platform_device.h"
 #include "third_party/skia/include/core/SkAnnotation.h"
@@ -50,10 +50,10 @@
 
 namespace blink {
 
-GraphicsContext::GraphicsContext(DisplayItemList* displayItemList, DisabledMode disableContextOrPainting, SkMetaData* metaData)
+GraphicsContext::GraphicsContext(PaintController* paintController, DisabledMode disableContextOrPainting, SkMetaData* metaData)
     : m_canvas(nullptr)
     , m_originalCanvas(nullptr)
-    , m_displayItemList(displayItemList)
+    , m_paintController(paintController)
     , m_paintStateStack()
     , m_paintStateIndex(0)
 #if ENABLE(ASSERT)
@@ -66,8 +66,8 @@
     , m_printing(false)
     , m_hasMetaData(!!metaData)
 {
-    // TODO(chrishtr): switch the type of the parameter to DisplayItemList&.
-    ASSERT(displayItemList);
+    // TODO(chrishtr): switch the type of the parameter to PaintController&.
+    ASSERT(paintController);
 
     if (metaData)
         m_metaData = *metaData;
@@ -734,7 +734,7 @@
         return;
 
     if (font.drawText(m_canvas, runInfo, point, m_deviceScaleFactor, paint))
-        m_displayItemList->setTextPainted();
+        m_paintController->setTextPainted();
 }
 
 template<typename DrawTextFunc>
@@ -762,7 +762,7 @@
 
     drawTextPasses([&font, &runInfo, &point, this](const SkPaint& paint) {
         if (font.drawText(m_canvas, runInfo, point, m_deviceScaleFactor, paint))
-            m_displayItemList->setTextPainted();
+            m_paintController->setTextPainted();
     });
 }
 
@@ -783,7 +783,7 @@
 
     drawTextPasses([&font, &runInfo, &point, customFontNotReadyAction, this](const SkPaint& paint) {
         if (font.drawBidiText(m_canvas, runInfo, point, customFontNotReadyAction, m_deviceScaleFactor, paint))
-            m_displayItemList->setTextPainted();
+            m_paintController->setTextPainted();
     });
 }
 
diff --git a/third_party/WebKit/Source/platform/graphics/GraphicsContext.h b/third_party/WebKit/Source/platform/graphics/GraphicsContext.h
index 2006b82..8491ed4 100644
--- a/third_party/WebKit/Source/platform/graphics/GraphicsContext.h
+++ b/third_party/WebKit/Source/platform/graphics/GraphicsContext.h
@@ -57,9 +57,9 @@
 
 namespace blink {
 
-class DisplayItemList;
 class ImageBuffer;
 class KURL;
+class PaintController;
 
 class PLATFORM_EXPORT GraphicsContext {
     WTF_MAKE_NONCOPYABLE(GraphicsContext); WTF_MAKE_FAST_ALLOCATED(GraphicsContext);
@@ -69,14 +69,14 @@
         FullyDisabled = 1 // Do absolutely minimal work to remove the cost of the context from performance tests.
     };
 
-    explicit GraphicsContext(DisplayItemList*, DisabledMode = NothingDisabled, SkMetaData* = 0);
+    explicit GraphicsContext(PaintController*, DisabledMode = NothingDisabled, SkMetaData* = 0);
 
     ~GraphicsContext();
 
     SkCanvas* canvas() { return m_canvas; }
     const SkCanvas* canvas() const { return m_canvas; }
 
-    DisplayItemList* displayItemList() { return m_displayItemList; }
+    PaintController* paintController() { return m_paintController; }
 
     bool contextDisabled() const { return m_disabledState; }
 
@@ -343,8 +343,8 @@
     // used when Slimming Paint is active.
     SkCanvas* m_originalCanvas;
 
-    // This being null indicates not to paint into a DisplayItemList, and instead directly into the canvas.
-    DisplayItemList* m_displayItemList;
+    // This being null indicates not to paint using the PaintController, and instead directly into the canvas.
+    PaintController* m_paintController;
 
     // Paint states stack. Enables local drawing state change with save()/restore() calls.
     // This state controls the appearance of drawn content.
diff --git a/third_party/WebKit/Source/platform/graphics/GraphicsContextTest.cpp b/third_party/WebKit/Source/platform/graphics/GraphicsContextTest.cpp
index c182880..91d4805d 100644
--- a/third_party/WebKit/Source/platform/graphics/GraphicsContextTest.cpp
+++ b/third_party/WebKit/Source/platform/graphics/GraphicsContextTest.cpp
@@ -26,7 +26,7 @@
 #include "platform/graphics/GraphicsContext.h"
 
 #include "platform/graphics/BitmapImage.h"
-#include "platform/graphics/paint/DisplayItemList.h"
+#include "platform/graphics/paint/PaintController.h"
 #include "third_party/skia/include/core/SkBitmap.h"
 #include "third_party/skia/include/core/SkCanvas.h"
 #include "third_party/skia/include/core/SkPicture.h"
@@ -69,8 +69,8 @@
     bitmap.eraseColor(0);
     SkCanvas canvas(bitmap);
 
-    OwnPtr<DisplayItemList> displayItemList = DisplayItemList::create();
-    GraphicsContext context(displayItemList.get());
+    OwnPtr<PaintController> paintController = PaintController::create();
+    GraphicsContext context(paintController.get());
 
     Color opaque(1.0f, 0.0f, 0.0f, 1.0f);
     FloatRect bounds(0, 0, 100, 100);
@@ -102,8 +102,8 @@
     Color alpha(0.0f, 0.0f, 0.0f, 0.0f);
     FloatRect bounds(0, 0, 100, 100);
 
-    OwnPtr<DisplayItemList> displayItemList = DisplayItemList::create();
-    GraphicsContext context(displayItemList.get());
+    OwnPtr<PaintController> paintController = PaintController::create();
+    GraphicsContext context(paintController.get());
     context.beginRecording(bounds);
 
     context.setShouldAntialias(false);
diff --git a/third_party/WebKit/Source/platform/graphics/GraphicsLayer.cpp b/third_party/WebKit/Source/platform/graphics/GraphicsLayer.cpp
index 4cd8d0a..aff912d 100644
--- a/third_party/WebKit/Source/platform/graphics/GraphicsLayer.cpp
+++ b/third_party/WebKit/Source/platform/graphics/GraphicsLayer.cpp
@@ -39,8 +39,8 @@
 #include "platform/graphics/Image.h"
 #include "platform/graphics/LinkHighlight.h"
 #include "platform/graphics/filters/SkiaImageFilterBuilder.h"
-#include "platform/graphics/paint/DisplayItemList.h"
 #include "platform/graphics/paint/DrawingRecorder.h"
+#include "platform/graphics/paint/PaintController.h"
 #include "platform/scroll/ScrollableArea.h"
 #include "platform/text/TextStream.h"
 #include "public/platform/Platform.h"
@@ -311,7 +311,7 @@
         m_debugInfo.clearAnnotatedInvalidateRects();
     incrementPaintCount();
 #ifndef NDEBUG
-    if (m_displayItemList && contentsOpaque() && s_drawDebugRedFill) {
+    if (m_paintController && contentsOpaque() && s_drawDebugRedFill) {
         FloatRect rect(FloatPoint(), size());
         if (!DrawingRecorder::useCachedDrawingIfPossible(context, *this, DisplayItem::DebugRedFill)) {
             DrawingRecorder recorder(context, *this, DisplayItem::DebugRedFill, rect);
@@ -320,7 +320,7 @@
     }
 #endif
     m_client->paintContents(this, context, m_paintingPhase, clip);
-    if (!m_textPainted && m_displayItemList->textPainted()) {
+    if (!m_textPainted && m_paintController->textPainted()) {
         m_textPainted = true;
         m_client->notifyTextPainted();
     }
@@ -813,8 +813,8 @@
 
 #ifndef NDEBUG
     // The red debug fill needs to be invalidated if the layer resizes.
-    if (m_displayItemList)
-        m_displayItemList->invalidateUntracked(displayItemClient());
+    if (m_paintController)
+        m_paintController->invalidateUntracked(displayItemClient());
 #endif
 }
 
@@ -1006,7 +1006,7 @@
     for (size_t i = 0; i < m_linkHighlights.size(); ++i)
         m_linkHighlights[i]->invalidate();
 
-    displayItemList()->invalidateAll();
+    paintController()->invalidateAll();
     if (isTrackingPaintInvalidations())
         trackPaintInvalidationObject("##ALL##");
 }
@@ -1021,7 +1021,7 @@
 {
     ASSERT(RuntimeEnabledFeatures::slimmingPaintSynchronizedPaintingEnabled());
     if (m_needsDisplay) {
-        displayItemList()->commitNewDisplayItems(this);
+        paintController()->commitNewDisplayItems(this);
         m_needsDisplay = false;
         return true;
     }
@@ -1048,7 +1048,7 @@
 void GraphicsLayer::invalidateDisplayItemClient(const DisplayItemClientWrapper& displayItemClient, PaintInvalidationReason paintInvalidationReason, const IntRect& previousPaintInvalidationRect, const IntRect& newPaintInvalidationRect)
 {
     m_needsDisplay = true;
-    displayItemList()->invalidate(displayItemClient, paintInvalidationReason, previousPaintInvalidationRect, newPaintInvalidationRect);
+    paintController()->invalidate(displayItemClient, paintInvalidationReason, previousPaintInvalidationRect, newPaintInvalidationRect);
     if (isTrackingPaintInvalidations())
         trackPaintInvalidationObject(displayItemClient.debugName());
 }
@@ -1203,11 +1203,11 @@
     }
 }
 
-DisplayItemList* GraphicsLayer::displayItemList()
+PaintController* GraphicsLayer::paintController()
 {
-    if (!m_displayItemList)
-        m_displayItemList = DisplayItemList::create();
-    return m_displayItemList.get();
+    if (!m_paintController)
+        m_paintController = PaintController::create();
+    return m_paintController.get();
 }
 
 } // namespace blink
diff --git a/third_party/WebKit/Source/platform/graphics/GraphicsLayer.h b/third_party/WebKit/Source/platform/graphics/GraphicsLayer.h
index 0763cc5..919cac7c 100644
--- a/third_party/WebKit/Source/platform/graphics/GraphicsLayer.h
+++ b/third_party/WebKit/Source/platform/graphics/GraphicsLayer.h
@@ -40,7 +40,7 @@
 #include "platform/graphics/PaintInvalidationReason.h"
 #include "platform/graphics/filters/FilterOperations.h"
 #include "platform/graphics/paint/DisplayItemClient.h"
-#include "platform/graphics/paint/DisplayItemList.h"
+#include "platform/graphics/paint/PaintController.h"
 #include "platform/transforms/TransformationMatrix.h"
 #include "public/platform/WebCompositorAnimationDelegate.h"
 #include "public/platform/WebContentLayer.h"
@@ -55,7 +55,6 @@
 
 namespace blink {
 
-class DisplayItemList;
 class FloatRect;
 class GraphicsContext;
 class GraphicsLayer;
@@ -64,6 +63,7 @@
 class Image;
 class LinkHighlight;
 class JSONObject;
+class PaintController;
 class ScrollableArea;
 class WebCompositorAnimation;
 class WebLayer;
@@ -255,7 +255,7 @@
     // WebLayerScrollClient implementation.
     void didScroll() override;
 
-    DisplayItemList* displayItemList() override;
+    PaintController* paintController() override;
 
     // Exposed for tests.
     virtual WebLayer* contentsLayer() const { return m_contentsLayer; }
@@ -278,7 +278,7 @@
     friend class FakeGraphicsLayerFactory;
 
 private:
-    // Sets m_needsDisplay, but without invalidating the DisplayItemList. This allows us to test
+    // Sets m_needsDisplay, but without invalidating the PaintController. This allows us to test
     // scenarios where paint needs to be re-calculated, but no DisplayItemClients were invalidated
     // (such as re-paints due to change of interest rect).
     void setNeedsDisplayWithoutInvalidateForTesting();
@@ -375,9 +375,9 @@
     GraphicsLayerDebugInfo m_debugInfo;
     int m_3dRenderingContext;
 
-    OwnPtr<DisplayItemList> m_displayItemList;
+    OwnPtr<PaintController> m_paintController;
 
-    friend class DisplayItemListPaintTestForSlimmingPaintV2;
+    friend class PaintControllerPaintTestForSlimmingPaintV2;
 };
 
 } // namespace blink
diff --git a/third_party/WebKit/Source/platform/graphics/RecordingImageBufferSurfaceTest.cpp b/third_party/WebKit/Source/platform/graphics/RecordingImageBufferSurfaceTest.cpp
index abc94b7..8cf1c048 100644
--- a/third_party/WebKit/Source/platform/graphics/RecordingImageBufferSurfaceTest.cpp
+++ b/third_party/WebKit/Source/platform/graphics/RecordingImageBufferSurfaceTest.cpp
@@ -260,7 +260,7 @@
         MockWebTaskRunner() : m_task(0) { }
         ~MockWebTaskRunner() override { }
 
-        void postTask(const WebTraceLocation&, Task* task) override
+        virtual void postTask(const WebTraceLocation&, Task* task)
         {
             EXPECT_EQ((Task*)0, m_task);
             m_task = task;
@@ -268,12 +268,6 @@
 
         void postDelayedTask(const WebTraceLocation&, Task*, double delayMs) override { ASSERT_NOT_REACHED(); };
 
-        WebTaskRunner* clone() override
-        {
-            ASSERT_NOT_REACHED();
-            return nullptr;
-        }
-
         Task* m_task;
     };
 
diff --git a/third_party/WebKit/Source/platform/graphics/paint/CachedDisplayItem.h b/third_party/WebKit/Source/platform/graphics/paint/CachedDisplayItem.h
index 1cdc4369..d18ec7e 100644
--- a/third_party/WebKit/Source/platform/graphics/paint/CachedDisplayItem.h
+++ b/third_party/WebKit/Source/platform/graphics/paint/CachedDisplayItem.h
@@ -10,7 +10,7 @@
 
 namespace blink {
 
-// A placeholder of a DrawingDisplayItem or a subtree in the new paint list of DisplayItemList,
+// A placeholder of a DrawingDisplayItem or a subtree in the new paint DisplayItems,
 // to indicate that the DrawingDisplayItem/subtree has not been changed and should be replaced with
 // the cached DrawingDisplayItem/subtree when merging new paint list to cached paint list.
 class CachedDisplayItem final : public DisplayItem {
diff --git a/third_party/WebKit/Source/platform/graphics/paint/ClipPathRecorder.cpp b/third_party/WebKit/Source/platform/graphics/paint/ClipPathRecorder.cpp
index c2ea498..8af92f1 100644
--- a/third_party/WebKit/Source/platform/graphics/paint/ClipPathRecorder.cpp
+++ b/third_party/WebKit/Source/platform/graphics/paint/ClipPathRecorder.cpp
@@ -7,7 +7,7 @@
 
 #include "platform/graphics/GraphicsContext.h"
 #include "platform/graphics/paint/ClipPathDisplayItem.h"
-#include "platform/graphics/paint/DisplayItemList.h"
+#include "platform/graphics/paint/PaintController.h"
 
 namespace blink {
 
@@ -15,14 +15,14 @@
     : m_context(context)
     , m_client(client)
 {
-    ASSERT(m_context.displayItemList());
-    m_context.displayItemList()->createAndAppend<BeginClipPathDisplayItem>(m_client, clipPath);
+    ASSERT(m_context.paintController());
+    m_context.paintController()->createAndAppend<BeginClipPathDisplayItem>(m_client, clipPath);
 }
 
 ClipPathRecorder::~ClipPathRecorder()
 {
-    ASSERT(m_context.displayItemList());
-    m_context.displayItemList()->endItem<EndClipPathDisplayItem>(m_client);
+    ASSERT(m_context.paintController());
+    m_context.paintController()->endItem<EndClipPathDisplayItem>(m_client);
 }
 
 } // namespace blink
diff --git a/third_party/WebKit/Source/platform/graphics/paint/ClipRecorder.cpp b/third_party/WebKit/Source/platform/graphics/paint/ClipRecorder.cpp
index 841154c..816996f 100644
--- a/third_party/WebKit/Source/platform/graphics/paint/ClipRecorder.cpp
+++ b/third_party/WebKit/Source/platform/graphics/paint/ClipRecorder.cpp
@@ -7,7 +7,7 @@
 
 #include "platform/graphics/GraphicsContext.h"
 #include "platform/graphics/paint/ClipDisplayItem.h"
-#include "platform/graphics/paint/DisplayItemList.h"
+#include "platform/graphics/paint/PaintController.h"
 
 namespace blink {
 
@@ -16,14 +16,14 @@
     , m_context(context)
     , m_type(type)
 {
-    ASSERT(m_context.displayItemList());
-    m_context.displayItemList()->createAndAppend<ClipDisplayItem>(m_client, type, pixelSnappedIntRect(clipRect));
+    ASSERT(m_context.paintController());
+    m_context.paintController()->createAndAppend<ClipDisplayItem>(m_client, type, pixelSnappedIntRect(clipRect));
 }
 
 ClipRecorder::~ClipRecorder()
 {
-    ASSERT(m_context.displayItemList());
-    m_context.displayItemList()->endItem<EndClipDisplayItem>(m_client, DisplayItem::clipTypeToEndClipType(m_type));
+    ASSERT(m_context.paintController());
+    m_context.paintController()->endItem<EndClipDisplayItem>(m_client, DisplayItem::clipTypeToEndClipType(m_type));
 }
 
 } // namespace blink
diff --git a/third_party/WebKit/Source/platform/graphics/paint/DisplayItem.h b/third_party/WebKit/Source/platform/graphics/paint/DisplayItem.h
index f7f0890..611b282 100644
--- a/third_party/WebKit/Source/platform/graphics/paint/DisplayItem.h
+++ b/third_party/WebKit/Source/platform/graphics/paint/DisplayItem.h
@@ -260,7 +260,7 @@
     // supply this to the DisplayItem constructor.
     size_t derivedSize() const { return m_derivedSize; }
 
-    // For DisplayItemList only. Painters should use DisplayItemCacheSkipper instead.
+    // For PaintController only. Painters should use DisplayItemCacheSkipper instead.
     void setSkippedCache() { m_skippedCache = true; }
     bool skippedCache() const { return m_skippedCache; }
 
diff --git a/third_party/WebKit/Source/platform/graphics/paint/DisplayItemCacheSkipper.h b/third_party/WebKit/Source/platform/graphics/paint/DisplayItemCacheSkipper.h
index 7cae9b9..33d7328 100644
--- a/third_party/WebKit/Source/platform/graphics/paint/DisplayItemCacheSkipper.h
+++ b/third_party/WebKit/Source/platform/graphics/paint/DisplayItemCacheSkipper.h
@@ -6,7 +6,7 @@
 #define DisplayItemCacheSkipper_h
 
 #include "platform/graphics/GraphicsContext.h"
-#include "platform/graphics/paint/DisplayItemList.h"
+#include "platform/graphics/paint/PaintController.h"
 
 namespace blink {
 
@@ -15,11 +15,11 @@
     DisplayItemCacheSkipper(GraphicsContext& context)
         : m_context(context)
     {
-        context.displayItemList()->beginSkippingCache();
+        context.paintController()->beginSkippingCache();
     }
     ~DisplayItemCacheSkipper()
     {
-        m_context.displayItemList()->endSkippingCache();
+        m_context.paintController()->endSkippingCache();
     }
 
 private:
diff --git a/third_party/WebKit/Source/platform/graphics/paint/DisplayItemList.cpp b/third_party/WebKit/Source/platform/graphics/paint/DisplayItemList.cpp
deleted file mode 100644
index 03fb9447..0000000
--- a/third_party/WebKit/Source/platform/graphics/paint/DisplayItemList.cpp
+++ /dev/null
@@ -1,565 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "config.h"
-#include "platform/graphics/paint/DisplayItemList.h"
-
-#include "platform/NotImplemented.h"
-#include "platform/TraceEvent.h"
-#include "platform/graphics/GraphicsLayer.h"
-#include "platform/graphics/paint/DrawingDisplayItem.h"
-
-#ifndef NDEBUG
-#include "platform/graphics/LoggingCanvas.h"
-#include "wtf/text/StringBuilder.h"
-#include <stdio.h>
-#endif
-
-namespace blink {
-
-const PaintArtifact& DisplayItemList::paintArtifact() const
-{
-    ASSERT(m_newDisplayItems.isEmpty());
-    ASSERT(m_newPaintChunks.isInInitialState());
-    return m_currentPaintArtifact;
-}
-
-bool DisplayItemList::lastDisplayItemIsNoopBegin() const
-{
-    if (m_newDisplayItems.isEmpty())
-        return false;
-
-    const auto& lastDisplayItem = m_newDisplayItems.last();
-    return lastDisplayItem.isBegin() && !lastDisplayItem.drawsContent();
-}
-
-void DisplayItemList::removeLastDisplayItem()
-{
-    if (m_newDisplayItems.isEmpty())
-        return;
-
-#if ENABLE(ASSERT)
-    // Also remove the index pointing to the removed display item.
-    DisplayItemIndicesByClientMap::iterator it = m_newDisplayItemIndicesByClient.find(m_newDisplayItems.last().client());
-    if (it != m_newDisplayItemIndicesByClient.end()) {
-        Vector<size_t>& indices = it->value;
-        if (!indices.isEmpty() && indices.last() == (m_newDisplayItems.size() - 1))
-            indices.removeLast();
-    }
-#endif
-    m_newDisplayItems.removeLast();
-
-    if (RuntimeEnabledFeatures::slimmingPaintV2Enabled())
-        m_newPaintChunks.decrementDisplayItemIndex();
-}
-
-void DisplayItemList::processNewItem(DisplayItem& displayItem)
-{
-    ASSERT(!m_constructionDisabled);
-    ASSERT(!skippingCache() || !displayItem.isCached());
-
-    if (displayItem.isCached())
-        ++m_numCachedItems;
-
-#if ENABLE(ASSERT)
-    // Verify noop begin/end pairs have been removed.
-    if (m_newDisplayItems.size() >= 2 && displayItem.isEnd()) {
-        const auto& beginDisplayItem = m_newDisplayItems[m_newDisplayItems.size() - 2];
-        if (beginDisplayItem.isBegin() && !beginDisplayItem.isSubsequence() && !beginDisplayItem.drawsContent())
-            ASSERT(!displayItem.isEndAndPairedWith(beginDisplayItem.type()));
-    }
-#endif
-
-    if (!m_scopeStack.isEmpty())
-        displayItem.setScope(m_scopeStack.last());
-
-#if ENABLE(ASSERT)
-    size_t index = findMatchingItemFromIndex(displayItem.nonCachedId(), m_newDisplayItemIndicesByClient, m_newDisplayItems);
-    if (index != kNotFound) {
-#ifndef NDEBUG
-        showDebugData();
-        WTFLogAlways("DisplayItem %s has duplicated id with previous %s (index=%d)\n",
-            displayItem.asDebugString().utf8().data(), m_newDisplayItems[index].asDebugString().utf8().data(), static_cast<int>(index));
-#endif
-        ASSERT_NOT_REACHED();
-    }
-    addItemToIndexIfNeeded(displayItem, m_newDisplayItems.size() - 1, m_newDisplayItemIndicesByClient);
-#endif // ENABLE(ASSERT)
-
-    if (skippingCache())
-        displayItem.setSkippedCache();
-
-    if (RuntimeEnabledFeatures::slimmingPaintV2Enabled())
-        m_newPaintChunks.incrementDisplayItemIndex();
-}
-
-void DisplayItemList::updateCurrentPaintChunkProperties(const PaintChunkProperties& newProperties)
-{
-    m_newPaintChunks.updateCurrentPaintChunkProperties(newProperties);
-}
-
-void DisplayItemList::beginScope()
-{
-    ASSERT_WITH_SECURITY_IMPLICATION(m_nextScope < UINT_MAX);
-    m_scopeStack.append(m_nextScope++);
-    beginSkippingCache();
-}
-
-void DisplayItemList::endScope()
-{
-    m_scopeStack.removeLast();
-    endSkippingCache();
-}
-
-void DisplayItemList::invalidate(const DisplayItemClientWrapper& client, PaintInvalidationReason paintInvalidationReason, const IntRect& previousPaintInvalidationRect, const IntRect& newPaintInvalidationRect)
-{
-    invalidateClient(client);
-
-    if (RuntimeEnabledFeatures::slimmingPaintSynchronizedPaintingEnabled()) {
-        Invalidation invalidation = { previousPaintInvalidationRect, paintInvalidationReason };
-        if (!previousPaintInvalidationRect.isEmpty())
-            m_invalidations.append(invalidation);
-        if (newPaintInvalidationRect != previousPaintInvalidationRect && !newPaintInvalidationRect.isEmpty()) {
-            invalidation.rect = newPaintInvalidationRect;
-            m_invalidations.append(invalidation);
-        }
-    }
-}
-
-void DisplayItemList::invalidateClient(const DisplayItemClientWrapper& client)
-{
-    invalidateUntracked(client.displayItemClient());
-    if (RuntimeEnabledFeatures::slimmingPaintV2Enabled() && m_trackedPaintInvalidationObjects)
-        m_trackedPaintInvalidationObjects->append(client.debugName());
-}
-
-void DisplayItemList::invalidateUntracked(DisplayItemClient client)
-{
-    // This can be called during painting, but we can't invalidate already painted clients.
-    ASSERT(!m_newDisplayItemIndicesByClient.contains(client));
-    updateValidlyCachedClientsIfNeeded();
-    m_validlyCachedClients.remove(client);
-}
-
-void DisplayItemList::invalidateAll()
-{
-    // Can only be called during layout/paintInvalidation, not during painting.
-    ASSERT(m_newDisplayItems.isEmpty());
-    m_currentPaintArtifact.reset();
-    m_validlyCachedClients.clear();
-    m_validlyCachedClientsDirty = false;
-
-    if (RuntimeEnabledFeatures::slimmingPaintV2Enabled() && m_trackedPaintInvalidationObjects)
-        m_trackedPaintInvalidationObjects->append("##ALL##");
-}
-
-bool DisplayItemList::clientCacheIsValid(DisplayItemClient client) const
-{
-    if (skippingCache())
-        return false;
-    updateValidlyCachedClientsIfNeeded();
-    return m_validlyCachedClients.contains(client);
-}
-
-void DisplayItemList::invalidatePaintOffset(const DisplayItemClientWrapper& client)
-{
-    ASSERT(RuntimeEnabledFeatures::slimmingPaintOffsetCachingEnabled());
-    invalidateClient(client);
-
-#if ENABLE(ASSERT)
-    ASSERT(!paintOffsetWasInvalidated(client.displayItemClient()));
-    m_clientsWithPaintOffsetInvalidations.add(client.displayItemClient());
-#endif
-}
-
-#if ENABLE(ASSERT)
-bool DisplayItemList::paintOffsetWasInvalidated(DisplayItemClient client) const
-{
-    ASSERT(RuntimeEnabledFeatures::slimmingPaintOffsetCachingEnabled());
-    return m_clientsWithPaintOffsetInvalidations.contains(client);
-}
-#endif
-
-size_t DisplayItemList::findMatchingItemFromIndex(const DisplayItem::Id& id, const DisplayItemIndicesByClientMap& displayItemIndicesByClient, const DisplayItems& list)
-{
-    DisplayItemIndicesByClientMap::const_iterator it = displayItemIndicesByClient.find(id.client);
-    if (it == displayItemIndicesByClient.end())
-        return kNotFound;
-
-    const Vector<size_t>& indices = it->value;
-    for (size_t index : indices) {
-        const DisplayItem& existingItem = list[index];
-        ASSERT(!existingItem.isValid() || existingItem.client() == id.client);
-        if (existingItem.isValid() && id.matches(existingItem))
-            return index;
-    }
-
-    return kNotFound;
-}
-
-void DisplayItemList::addItemToIndexIfNeeded(const DisplayItem& displayItem, size_t index, DisplayItemIndicesByClientMap& displayItemIndicesByClient)
-{
-    if (!displayItem.isCacheable())
-        return;
-
-    DisplayItemIndicesByClientMap::iterator it = displayItemIndicesByClient.find(displayItem.client());
-    Vector<size_t>& indices = it == displayItemIndicesByClient.end() ?
-        displayItemIndicesByClient.add(displayItem.client(), Vector<size_t>()).storedValue->value : it->value;
-    indices.append(index);
-}
-
-struct DisplayItemList::OutOfOrderIndexContext {
-    OutOfOrderIndexContext(DisplayItems::iterator begin) : nextItemToIndex(begin) { }
-
-    DisplayItems::iterator nextItemToIndex;
-    DisplayItemIndicesByClientMap displayItemIndicesByClient;
-};
-
-DisplayItems::iterator DisplayItemList::findOutOfOrderCachedItem(const DisplayItem::Id& id, OutOfOrderIndexContext& context)
-{
-    ASSERT(clientCacheIsValid(id.client));
-
-    size_t foundIndex = findMatchingItemFromIndex(id, context.displayItemIndicesByClient, m_currentPaintArtifact.displayItems());
-    if (foundIndex != kNotFound)
-        return m_currentPaintArtifact.displayItems().begin() + foundIndex;
-
-    return findOutOfOrderCachedItemForward(id, context);
-}
-
-// Find forward for the item and index all skipped indexable items.
-DisplayItems::iterator DisplayItemList::findOutOfOrderCachedItemForward(const DisplayItem::Id& id, OutOfOrderIndexContext& context)
-{
-    DisplayItems::iterator currentEnd = m_currentPaintArtifact.displayItems().end();
-    for (; context.nextItemToIndex != currentEnd; ++context.nextItemToIndex) {
-        const DisplayItem& item = *context.nextItemToIndex;
-        ASSERT(item.isValid());
-        if (item.isCacheable() && clientCacheIsValid(item.client())) {
-            if (id.matches(item))
-                return context.nextItemToIndex++;
-
-            addItemToIndexIfNeeded(item, context.nextItemToIndex - m_currentPaintArtifact.displayItems().begin(), context.displayItemIndicesByClient);
-        }
-    }
-    return currentEnd;
-}
-
-void DisplayItemList::copyCachedSubsequence(DisplayItems::iterator& currentIt, DisplayItems& updatedList)
-{
-    ASSERT(currentIt->isSubsequence());
-    ASSERT(!currentIt->scope());
-    DisplayItem::Id endSubsequenceId(currentIt->client(), DisplayItem::subsequenceTypeToEndSubsequenceType(currentIt->type()), 0);
-    do {
-        // We should always find the EndSubsequence display item.
-        ASSERT(currentIt != m_currentPaintArtifact.displayItems().end());
-        ASSERT(currentIt->isValid());
-        updatedList.appendByMoving(*currentIt);
-        ++currentIt;
-    } while (!endSubsequenceId.matches(updatedList.last()));
-}
-
-// Update the existing display items by removing invalidated entries, updating
-// repainted ones, and appending new items.
-// - For cached drawing display item, copy the corresponding cached DrawingDisplayItem;
-// - For cached subsequence display item, copy the cached display items between the
-//   corresponding SubsequenceDisplayItem and EndSubsequenceDisplayItem (incl.);
-// - Otherwise, copy the new display item.
-//
-// The algorithm is O(|m_currentDisplayItems| + |m_newDisplayItems|).
-// Coefficients are related to the ratio of out-of-order CachedDisplayItems
-// and the average number of (Drawing|Subsequence)DisplayItems per client.
-//
-void DisplayItemList::commitNewDisplayItems(GraphicsLayer* graphicsLayer)
-{
-    TRACE_EVENT2("blink,benchmark", "DisplayItemList::commitNewDisplayItems",
-        "current_display_list_size", (int)m_currentPaintArtifact.displayItems().size(),
-        "num_non_cached_new_items", (int)m_newDisplayItems.size() - m_numCachedItems);
-
-    if (RuntimeEnabledFeatures::slimmingPaintSynchronizedPaintingEnabled()) {
-        for (const auto& invalidation : m_invalidations)
-            graphicsLayer->setNeedsDisplayInRect(invalidation.rect, invalidation.invalidationReason);
-        m_invalidations.clear();
-        m_clientsCheckedPaintInvalidation.clear();
-    }
-
-    // These data structures are used during painting only.
-    ASSERT(m_scopeStack.isEmpty());
-    m_scopeStack.clear();
-    m_nextScope = 1;
-    ASSERT(!skippingCache());
-#if ENABLE(ASSERT)
-    m_newDisplayItemIndicesByClient.clear();
-    m_clientsWithPaintOffsetInvalidations.clear();
-#endif
-
-    if (m_currentPaintArtifact.isEmpty()) {
-#if ENABLE(ASSERT)
-        for (const auto& item : m_newDisplayItems)
-            ASSERT(!item.isCached());
-#endif
-        m_currentPaintArtifact.displayItems().swap(m_newDisplayItems);
-        m_currentPaintArtifact.paintChunks() = m_newPaintChunks.releasePaintChunks();
-        m_validlyCachedClientsDirty = true;
-        m_numCachedItems = 0;
-        return;
-    }
-
-    updateValidlyCachedClientsIfNeeded();
-
-    // Stores indices to valid DrawingDisplayItems in m_currentDisplayItems that have not been matched
-    // by CachedDisplayItems during synchronized matching. The indexed items will be matched
-    // by later out-of-order CachedDisplayItems in m_newDisplayItems. This ensures that when
-    // out-of-order CachedDisplayItems occur, we only traverse at most once over m_currentDisplayItems
-    // looking for potential matches. Thus we can ensure that the algorithm runs in linear time.
-    OutOfOrderIndexContext outOfOrderIndexContext(m_currentPaintArtifact.displayItems().begin());
-
-    // TODO(jbroman): Consider revisiting this heuristic.
-    DisplayItems updatedList(std::max(m_currentPaintArtifact.displayItems().usedCapacityInBytes(), m_newDisplayItems.usedCapacityInBytes()));
-    Vector<PaintChunk> updatedPaintChunks;
-    DisplayItems::iterator currentIt = m_currentPaintArtifact.displayItems().begin();
-    DisplayItems::iterator currentEnd = m_currentPaintArtifact.displayItems().end();
-    for (DisplayItems::iterator newIt = m_newDisplayItems.begin(); newIt != m_newDisplayItems.end(); ++newIt) {
-        const DisplayItem& newDisplayItem = *newIt;
-        const DisplayItem::Id newDisplayItemId = newDisplayItem.nonCachedId();
-        bool newDisplayItemHasCachedType = newDisplayItem.type() != newDisplayItemId.type;
-
-        bool isSynchronized = currentIt != currentEnd && newDisplayItemId.matches(*currentIt);
-
-        if (newDisplayItemHasCachedType) {
-            ASSERT(newDisplayItem.isCached());
-            ASSERT(clientCacheIsValid(newDisplayItem.client()) || (RuntimeEnabledFeatures::slimmingPaintOffsetCachingEnabled() && !paintOffsetWasInvalidated(newDisplayItem.client())));
-            if (!isSynchronized) {
-                currentIt = findOutOfOrderCachedItem(newDisplayItemId, outOfOrderIndexContext);
-
-                if (currentIt == currentEnd) {
-#ifndef NDEBUG
-                    showDebugData();
-                    WTFLogAlways("%s not found in m_currentDisplayItems\n", newDisplayItem.asDebugString().utf8().data());
-#endif
-                    ASSERT_NOT_REACHED();
-                    // We did not find the cached display item. This should be impossible, but may occur if there is a bug
-                    // in the system, such as under-invalidation, incorrect cache checking or duplicate display ids.
-                    // In this case, attempt to recover rather than crashing or bailing on display of the rest of the display list.
-                    continue;
-                }
-            }
-#if ENABLE(ASSERT)
-            if (RuntimeEnabledFeatures::slimmingPaintUnderInvalidationCheckingEnabled()) {
-                DisplayItems::iterator temp = currentIt;
-                checkUnderInvalidation(newIt, temp);
-            }
-#endif
-            if (newDisplayItem.isCachedDrawing()) {
-                updatedList.appendByMoving(*currentIt);
-                ++currentIt;
-            } else {
-                ASSERT(newDisplayItem.isCachedSubsequence());
-                copyCachedSubsequence(currentIt, updatedList);
-                ASSERT(updatedList.last().isEndSubsequence());
-            }
-        } else {
-            ASSERT(!newDisplayItem.isDrawing()
-                || newDisplayItem.skippedCache()
-                || !clientCacheIsValid(newDisplayItem.client())
-                || (RuntimeEnabledFeatures::slimmingPaintOffsetCachingEnabled() && paintOffsetWasInvalidated(newDisplayItem.client())));
-
-            updatedList.appendByMoving(*newIt);
-
-            if (isSynchronized)
-                ++currentIt;
-        }
-        // Items before currentIt should have been copied so we don't need to index them.
-        if (currentIt - outOfOrderIndexContext.nextItemToIndex > 0)
-            outOfOrderIndexContext.nextItemToIndex = currentIt;
-    }
-
-#if ENABLE(ASSERT)
-    if (RuntimeEnabledFeatures::slimmingPaintUnderInvalidationCheckingEnabled())
-        checkNoRemainingCachedDisplayItems();
-#endif // ENABLE(ASSERT)
-
-
-    // TODO(jbroman): When subsequence caching applies to SPv2, we'll need to
-    // merge the paint chunks as well.
-    m_currentPaintArtifact.displayItems().swap(updatedList);
-    m_currentPaintArtifact.paintChunks() = m_newPaintChunks.releasePaintChunks();
-
-    m_newDisplayItems.clear();
-    m_validlyCachedClientsDirty = true;
-    m_numCachedItems = 0;
-}
-
-size_t DisplayItemList::approximateUnsharedMemoryUsage() const
-{
-    size_t memoryUsage = sizeof(*this);
-
-    // Memory outside this class due to m_currentPaintArtifact.
-    memoryUsage += m_currentPaintArtifact.approximateUnsharedMemoryUsage() - sizeof(m_currentPaintArtifact);
-
-    // TODO(jbroman): If display items begin to have significant external memory
-    // usage that's not shared with the embedder, we should account for it here.
-    //
-    // External objects, shared with the embedder, such as SkPicture, should be
-    // excluded to avoid double counting. It is the embedder's responsibility to
-    // count such objects.
-    //
-    // At time of writing, the only known case of unshared external memory was
-    // the rounded clips vector in ClipDisplayItem, which is not expected to
-    // contribute significantly to memory usage.
-
-    // Memory outside this class due to m_newDisplayItems.
-    ASSERT(m_newDisplayItems.isEmpty());
-    memoryUsage += m_newDisplayItems.memoryUsageInBytes();
-
-    return memoryUsage;
-}
-
-void DisplayItemList::updateValidlyCachedClientsIfNeeded() const
-{
-    if (!m_validlyCachedClientsDirty)
-        return;
-
-    m_validlyCachedClients.clear();
-    m_validlyCachedClientsDirty = false;
-
-    DisplayItemClient lastAddedClient = nullptr;
-    for (const DisplayItem& displayItem : m_currentPaintArtifact.displayItems()) {
-        if (displayItem.client() == lastAddedClient)
-            continue;
-        if (displayItem.isCacheable()) {
-            lastAddedClient = displayItem.client();
-            m_validlyCachedClients.add(lastAddedClient);
-        }
-    }
-}
-
-#if ENABLE(ASSERT)
-
-void DisplayItemList::checkUnderInvalidation(DisplayItems::iterator& newIt, DisplayItems::iterator& currentIt)
-{
-    ASSERT(RuntimeEnabledFeatures::slimmingPaintUnderInvalidationCheckingEnabled());
-    ASSERT(newIt->isCached());
-
-    // When under-invalidation-checking is enabled, the forced painting is following the cached display item.
-    DisplayItem::Type nextItemType = DisplayItem::nonCachedType(newIt->type());
-    ++newIt;
-    ASSERT(newIt->type() == nextItemType);
-
-    if (newIt->isDrawing()) {
-        checkCachedDisplayItemIsUnchanged("", *newIt, *currentIt);
-        return;
-    }
-
-    ASSERT(newIt->isSubsequence());
-
-#ifndef NDEBUG
-    CString messagePrefix = String::format("(In CachedSubsequence of %s)", newIt->clientDebugString().utf8().data()).utf8();
-#else
-    CString messagePrefix = "(In CachedSubsequence)";
-#endif
-
-    DisplayItem::Id endSubsequenceId(newIt->client(), DisplayItem::subsequenceTypeToEndSubsequenceType(newIt->type()), 0);
-    while (true) {
-        ASSERT(newIt != m_newDisplayItems.end());
-        if (newIt->isCached())
-            checkUnderInvalidation(newIt, currentIt);
-        else
-            checkCachedDisplayItemIsUnchanged(messagePrefix.data(), *newIt, *currentIt);
-
-        if (endSubsequenceId.matches(*newIt))
-            break;
-
-        ++newIt;
-        ++currentIt;
-    }
-}
-
-static void showUnderInvalidationError(const char* messagePrefix, const char* reason, const DisplayItem* newItem, const DisplayItem* oldItem)
-{
-#ifndef NDEBUG
-    WTFLogAlways("%s %s:\nNew display item: %s\nOld display item: %s\nSee http://crbug.com/450725.", messagePrefix, reason,
-        newItem ? newItem->asDebugString().utf8().data() : "None",
-        oldItem ? oldItem->asDebugString().utf8().data() : "None");
-#else
-    WTFLogAlways("%s %s. Run debug build to get more details\nSee http://crbug.com/450725.", messagePrefix, reason);
-#endif // NDEBUG
-}
-
-void DisplayItemList::checkCachedDisplayItemIsUnchanged(const char* messagePrefix, const DisplayItem& newItem, const DisplayItem& oldItem)
-{
-    ASSERT(RuntimeEnabledFeatures::slimmingPaintUnderInvalidationCheckingEnabled());
-    ASSERT(!newItem.isCached());
-    ASSERT(!oldItem.isCached());
-
-    if (newItem.skippedCache()) {
-        showUnderInvalidationError(messagePrefix, "ERROR: under-invalidation: skipped-cache in cached subsequence", &newItem, &oldItem);
-        ASSERT_NOT_REACHED();
-    }
-
-    if (newItem.isCacheable() && !m_validlyCachedClients.contains(newItem.client())) {
-        showUnderInvalidationError(messagePrefix, "ERROR: under-invalidation: invalidated in cached subsequence", &newItem, &oldItem);
-        ASSERT_NOT_REACHED();
-    }
-
-    if (newItem.equals(oldItem))
-        return;
-
-    showUnderInvalidationError(messagePrefix, "ERROR: under-invalidation: display item changed", &newItem, &oldItem);
-
-#ifndef NDEBUG
-    if (newItem.isDrawing()) {
-        RefPtr<const SkPicture> newPicture = static_cast<const DrawingDisplayItem&>(newItem).picture();
-        RefPtr<const SkPicture> oldPicture = static_cast<const DrawingDisplayItem&>(oldItem).picture();
-        String oldPictureDebugString = oldPicture ? pictureAsDebugString(oldPicture.get()) : "None";
-        String newPictureDebugString = newPicture ? pictureAsDebugString(newPicture.get()) : "None";
-        WTFLogAlways("old picture:\n%s\n", oldPictureDebugString.utf8().data());
-        WTFLogAlways("new picture:\n%s\n", newPictureDebugString.utf8().data());
-    }
-#endif // NDEBUG
-
-    ASSERT_NOT_REACHED();
-}
-
-void DisplayItemList::checkNoRemainingCachedDisplayItems()
-{
-    ASSERT(RuntimeEnabledFeatures::slimmingPaintUnderInvalidationCheckingEnabled());
-
-    for (const auto& displayItem : m_currentPaintArtifact.displayItems()) {
-        if (!displayItem.isValid() || !displayItem.isCacheable() || !clientCacheIsValid(displayItem.client()))
-            continue;
-        showUnderInvalidationError("", "May be under-invalidation: no new display item", nullptr, &displayItem);
-    }
-}
-
-#endif // ENABLE(ASSERT)
-
-#ifndef NDEBUG
-
-WTF::String DisplayItemList::displayItemsAsDebugString(const DisplayItems& list) const
-{
-    StringBuilder stringBuilder;
-    size_t i = 0;
-    for (auto it = list.begin(); it != list.end(); ++it, ++i) {
-        const DisplayItem& displayItem = *it;
-        if (i)
-            stringBuilder.append(",\n");
-        stringBuilder.append(String::format("{index: %d, ", (int)i));
-        displayItem.dumpPropertiesAsDebugString(stringBuilder);
-        if (displayItem.isValid()) {
-            stringBuilder.append(", cacheIsValid: ");
-            stringBuilder.append(clientCacheIsValid(displayItem.client()) ? "true" : "false");
-        }
-        stringBuilder.append('}');
-    }
-    return stringBuilder.toString();
-}
-
-void DisplayItemList::showDebugData() const
-{
-    WTFLogAlways("current display items: [%s]\n", displayItemsAsDebugString(m_currentPaintArtifact.displayItems()).utf8().data());
-    WTFLogAlways("new display items: [%s]\n", displayItemsAsDebugString(m_newDisplayItems).utf8().data());
-}
-
-#endif // ifndef NDEBUG
-
-} // namespace blink
diff --git a/third_party/WebKit/Source/platform/graphics/paint/DisplayItemList.h b/third_party/WebKit/Source/platform/graphics/paint/DisplayItemList.h
deleted file mode 100644
index 22660f0..0000000
--- a/third_party/WebKit/Source/platform/graphics/paint/DisplayItemList.h
+++ /dev/null
@@ -1,265 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef DisplayItemList_h
-#define DisplayItemList_h
-
-#include "platform/PlatformExport.h"
-#include "platform/RuntimeEnabledFeatures.h"
-#include "platform/geometry/IntRect.h"
-#include "platform/geometry/LayoutPoint.h"
-#include "platform/graphics/ContiguousContainer.h"
-#include "platform/graphics/PaintInvalidationReason.h"
-#include "platform/graphics/paint/DisplayItem.h"
-#include "platform/graphics/paint/DisplayItems.h"
-#include "platform/graphics/paint/PaintArtifact.h"
-#include "platform/graphics/paint/PaintChunk.h"
-#include "platform/graphics/paint/PaintChunker.h"
-#include "platform/graphics/paint/Transform3DDisplayItem.h"
-#include "wtf/Alignment.h"
-#include "wtf/HashMap.h"
-#include "wtf/PassOwnPtr.h"
-#include "wtf/Utility.h"
-#include "wtf/Vector.h"
-
-namespace blink {
-
-class GraphicsLayer;
-class GraphicsContext;
-
-static const size_t kInitialDisplayItemsCapacity = 64;
-
-// Responsible for processing display items as they are produced, and producing
-// a final paint artifact when complete. This class includes logic for caching,
-// cache invalidation, and merging.
-class PLATFORM_EXPORT DisplayItemList {
-    WTF_MAKE_NONCOPYABLE(DisplayItemList);
-    WTF_MAKE_FAST_ALLOCATED(DisplayItemList);
-public:
-    static PassOwnPtr<DisplayItemList> create()
-    {
-        return adoptPtr(new DisplayItemList());
-    }
-
-    // These methods are called during paint invalidation (or paint if SlimmingPaintSynchronizedPainting is on).
-    void invalidate(const DisplayItemClientWrapper&, PaintInvalidationReason, const IntRect& previousPaintInvalidationRect, const IntRect& newPaintInvalidationRect);
-    void invalidateUntracked(DisplayItemClient);
-    void invalidateAll();
-
-    // Record when paint offsets change during paint.
-    void invalidatePaintOffset(const DisplayItemClientWrapper&);
-#if ENABLE(ASSERT)
-    bool paintOffsetWasInvalidated(DisplayItemClient) const;
-#endif
-
-    // These methods are called during painting.
-
-    // Provide a new set of paint chunk properties to apply to recorded display
-    // items, for Slimming Paint v2.
-    // TODO(pdr): This should be moved to PaintArtifact.
-    void updateCurrentPaintChunkProperties(const PaintChunkProperties&);
-
-    template <typename DisplayItemClass, typename... Args>
-    void createAndAppend(Args&&... args)
-    {
-        static_assert(WTF::IsSubclass<DisplayItemClass, DisplayItem>::value,
-            "Can only createAndAppend subclasses of DisplayItem.");
-        static_assert(sizeof(DisplayItemClass) <= kMaximumDisplayItemSize,
-            "DisplayItem subclass is larger than kMaximumDisplayItemSize.");
-
-        if (displayItemConstructionIsDisabled())
-            return;
-        DisplayItemClass& displayItem = m_newDisplayItems.allocateAndConstruct<DisplayItemClass>(WTF::forward<Args>(args)...);
-        processNewItem(displayItem);
-    }
-
-    // Creates and appends an ending display item to pair with a preceding
-    // beginning item iff the display item actually draws content. For no-op
-    // items, rather than creating an ending item, the begin item will
-    // instead be removed, thereby maintaining brevity of the list. If display
-    // item construction is disabled, no list mutations will be performed.
-    template <typename DisplayItemClass, typename... Args>
-    void endItem(Args&&... args)
-    {
-        if (displayItemConstructionIsDisabled())
-            return;
-        if (lastDisplayItemIsNoopBegin())
-            removeLastDisplayItem();
-        else
-            createAndAppend<DisplayItemClass>(WTF::forward<Args>(args)...);
-    }
-
-    // Scopes must be used to avoid duplicated display item ids when we paint some object
-    // multiple times and generate multiple display items with the same type.
-    // We don't cache display items added in scopes.
-    void beginScope();
-    void endScope();
-
-    // True if the last display item is a begin that doesn't draw content.
-    bool lastDisplayItemIsNoopBegin() const;
-    void removeLastDisplayItem();
-
-    void beginSkippingCache() { ++m_skippingCacheCount; }
-    void endSkippingCache() { ASSERT(m_skippingCacheCount > 0); --m_skippingCacheCount; }
-    bool skippingCache() const { return m_skippingCacheCount; }
-
-    // Must be called when a painting is finished. If passed, invalidations are recorded on the given
-    // GraphicsLayer.
-    void commitNewDisplayItems(GraphicsLayer* = 0);
-
-    // Returns the approximate memory usage, excluding memory likely to be
-    // shared with the embedder after copying to WebDisplayItemList.
-    // Should only be called right after commitNewDisplayItems.
-    size_t approximateUnsharedMemoryUsage() const;
-
-    // Get the artifact generated after the last commit.
-    const PaintArtifact& paintArtifact() const;
-    const DisplayItems& displayItems() const { return paintArtifact().displayItems(); }
-    const Vector<PaintChunk>& paintChunks() const { return paintArtifact().paintChunks(); }
-
-    bool clientCacheIsValid(DisplayItemClient) const;
-
-    bool displayItemConstructionIsDisabled() const { return m_constructionDisabled; }
-    void setDisplayItemConstructionIsDisabled(const bool disable) { m_constructionDisabled = disable; }
-
-    bool textPainted() const { return m_textPainted; }
-    void setTextPainted() { m_textPainted = true; }
-
-    // Returns displayItems added using createAndAppend() since beginning or the last
-    // commitNewDisplayItems(). Use with care.
-    DisplayItems& newDisplayItems() { return m_newDisplayItems; }
-
-#ifndef NDEBUG
-    void showDebugData() const;
-#endif
-
-    void startTrackingPaintInvalidationObjects()
-    {
-        ASSERT(RuntimeEnabledFeatures::slimmingPaintV2Enabled());
-        m_trackedPaintInvalidationObjects = adoptPtr(new Vector<String>());
-    }
-    void stopTrackingPaintInvalidationObjects()
-    {
-        ASSERT(RuntimeEnabledFeatures::slimmingPaintV2Enabled());
-        m_trackedPaintInvalidationObjects = nullptr;
-    }
-    Vector<String> trackedPaintInvalidationObjects()
-    {
-        ASSERT(RuntimeEnabledFeatures::slimmingPaintV2Enabled());
-        return m_trackedPaintInvalidationObjects ? *m_trackedPaintInvalidationObjects : Vector<String>();
-    }
-
-    bool clientHasCheckedPaintInvalidation(DisplayItemClient client) const
-    {
-        ASSERT(RuntimeEnabledFeatures::slimmingPaintSynchronizedPaintingEnabled());
-        return m_clientsCheckedPaintInvalidation.contains(client);
-    }
-    void setClientHasCheckedPaintInvalidation(DisplayItemClient client)
-    {
-        ASSERT(RuntimeEnabledFeatures::slimmingPaintSynchronizedPaintingEnabled());
-        m_clientsCheckedPaintInvalidation.add(client);
-    }
-
-protected:
-    DisplayItemList()
-        : m_newDisplayItems(kInitialDisplayItemsCapacity * kMaximumDisplayItemSize)
-        , m_validlyCachedClientsDirty(false)
-        , m_constructionDisabled(false)
-        , m_textPainted(false)
-        , m_skippingCacheCount(0)
-        , m_numCachedItems(0)
-        , m_nextScope(1) { }
-
-private:
-    // Set new item state (scopes, cache skipping, etc) for a new item.
-    void processNewItem(DisplayItem&);
-
-    void updateValidlyCachedClientsIfNeeded() const;
-
-    void invalidateClient(const DisplayItemClientWrapper&);
-
-#ifndef NDEBUG
-    WTF::String displayItemsAsDebugString(const DisplayItems&) const;
-#endif
-
-    // Indices into PaintList of all DrawingDisplayItems and BeginSubsequenceDisplayItems of each client.
-    // Temporarily used during merge to find out-of-order display items.
-    using DisplayItemIndicesByClientMap = HashMap<DisplayItemClient, Vector<size_t>>;
-
-    static size_t findMatchingItemFromIndex(const DisplayItem::Id&, const DisplayItemIndicesByClientMap&, const DisplayItems&);
-    static void addItemToIndexIfNeeded(const DisplayItem&, size_t index, DisplayItemIndicesByClientMap&);
-
-    struct OutOfOrderIndexContext;
-    DisplayItems::iterator findOutOfOrderCachedItem(const DisplayItem::Id&, OutOfOrderIndexContext&);
-    DisplayItems::iterator findOutOfOrderCachedItemForward(const DisplayItem::Id&, OutOfOrderIndexContext&);
-    void copyCachedSubsequence(DisplayItems::iterator& currentIt, DisplayItems& updatedList);
-
-#if ENABLE(ASSERT)
-    // The following two methods are for checking under-invalidations
-    // (when RuntimeEnabledFeatures::slimmingPaintUnderInvalidationCheckingEnabled).
-    void checkUnderInvalidation(DisplayItems::iterator& newIt, DisplayItems::iterator& currentIt);
-    void checkCachedDisplayItemIsUnchanged(const char* messagePrefix, const DisplayItem& newItem, const DisplayItem& oldItem);
-    void checkNoRemainingCachedDisplayItems();
-#endif
-
-    // The last complete paint artifact.
-    // In SPv2, this includes paint chunks as well as display items.
-    PaintArtifact m_currentPaintArtifact;
-
-    // Data being used to build the next paint artifact.
-    DisplayItems m_newDisplayItems;
-    PaintChunker m_newPaintChunks;
-
-    // Contains all clients having valid cached paintings if updated.
-    // It's lazily updated in updateValidlyCachedClientsIfNeeded().
-    // TODO(wangxianzhu): In the future we can replace this with client-side repaint flags
-    // to avoid the cost of building and querying the hash table.
-    mutable HashSet<DisplayItemClient> m_validlyCachedClients;
-    mutable bool m_validlyCachedClientsDirty;
-
-    // Used during painting. Contains clients that have checked paint invalidation and
-    // are known to be valid.
-    // TODO(wangxianzhu): Use client side flag to avoid const of hash table.
-    HashSet<DisplayItemClient> m_clientsCheckedPaintInvalidation;
-
-#if ENABLE(ASSERT)
-    // Set of clients which had paint offset changes since the last commit. This is used for
-    // ensuring paint offsets are only updated once and are the same in all phases.
-    HashSet<DisplayItemClient> m_clientsWithPaintOffsetInvalidations;
-#endif
-
-    // Allow display item construction to be disabled to isolate the costs of construction
-    // in performance metrics.
-    bool m_constructionDisabled;
-
-    // Indicates this DisplayItemList has ever had text. It is never reset to false.
-    bool m_textPainted;
-
-    int m_skippingCacheCount;
-
-    int m_numCachedItems;
-
-    unsigned m_nextScope;
-    Vector<unsigned> m_scopeStack;
-
-    struct Invalidation {
-        IntRect rect;
-        PaintInvalidationReason invalidationReason;
-    };
-
-    Vector<Invalidation> m_invalidations;
-
-#if ENABLE(ASSERT)
-    // This is used to check duplicated ids during add(). We could also check during
-    // updatePaintList(), but checking during add() helps developer easily find where
-    // the duplicated ids are from.
-    DisplayItemIndicesByClientMap m_newDisplayItemIndicesByClient;
-#endif
-
-    OwnPtr<Vector<String>> m_trackedPaintInvalidationObjects;
-};
-
-} // namespace blink
-
-#endif // DisplayItemList_h
diff --git a/third_party/WebKit/Source/platform/graphics/paint/DisplayItemListTest.cpp b/third_party/WebKit/Source/platform/graphics/paint/DisplayItemListTest.cpp
deleted file mode 100644
index bd85b84..0000000
--- a/third_party/WebKit/Source/platform/graphics/paint/DisplayItemListTest.cpp
+++ /dev/null
@@ -1,793 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "config.h"
-#include "platform/graphics/paint/DisplayItemList.h"
-
-#include "platform/RuntimeEnabledFeatures.h"
-#include "platform/graphics/GraphicsContext.h"
-#include "platform/graphics/paint/CachedDisplayItem.h"
-#include "platform/graphics/paint/ClipPathRecorder.h"
-#include "platform/graphics/paint/ClipRecorder.h"
-#include "platform/graphics/paint/DrawingDisplayItem.h"
-#include "platform/graphics/paint/DrawingRecorder.h"
-#include "platform/graphics/paint/SubsequenceRecorder.h"
-#include <gtest/gtest.h>
-
-namespace blink {
-
-class DisplayItemListTest : public ::testing::Test {
-public:
-    DisplayItemListTest()
-        : m_displayItemList(DisplayItemList::create())
-        , m_originalSlimmingPaintSubsequenceCachingEnabled(RuntimeEnabledFeatures::slimmingPaintSubsequenceCachingEnabled())
-        , m_originalSlimmingPaintV2Enabled(RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { }
-
-protected:
-    DisplayItemList& displayItemList() { return *m_displayItemList; }
-
-private:
-    void TearDown() override
-    {
-        RuntimeEnabledFeatures::setSlimmingPaintSubsequenceCachingEnabled(m_originalSlimmingPaintSubsequenceCachingEnabled);
-        RuntimeEnabledFeatures::setSlimmingPaintV2Enabled(m_originalSlimmingPaintV2Enabled);
-    }
-
-    OwnPtr<DisplayItemList> m_displayItemList;
-    bool m_originalSlimmingPaintSubsequenceCachingEnabled;
-    bool m_originalSlimmingPaintV2Enabled;
-};
-
-const DisplayItem::Type foregroundDrawingType = static_cast<DisplayItem::Type>(DisplayItem::DrawingPaintPhaseFirst + 4);
-const DisplayItem::Type backgroundDrawingType = DisplayItem::DrawingPaintPhaseFirst;
-const DisplayItem::Type clipType = DisplayItem::ClipFirst;
-const DisplayItem::Type subsequenceType = DisplayItem::SubsequenceNormalFlowAndPositiveZOrder;
-const DisplayItem::Type endSubsequenceType = DisplayItem::subsequenceTypeToEndSubsequenceType(subsequenceType);
-const DisplayItem::Type cachedSubsequenceType = DisplayItem::subsequenceTypeToCachedSubsequenceType(subsequenceType);
-
-class TestDisplayItemClient {
-public:
-    TestDisplayItemClient(const String& name)
-        : m_name(name)
-    { }
-
-    DisplayItemClient displayItemClient() const { return toDisplayItemClient(this); }
-    String debugName() const { return m_name; }
-
-private:
-    String m_name;
-};
-
-class TestDisplayItem final : public DisplayItem {
-public:
-    TestDisplayItem(const TestDisplayItemClient& client, Type type) : DisplayItem(client, type, sizeof(*this)) { }
-
-    void replay(GraphicsContext&) const final { ASSERT_NOT_REACHED(); }
-    void appendToWebDisplayItemList(WebDisplayItemList*) const final { ASSERT_NOT_REACHED(); }
-};
-
-#ifndef NDEBUG
-#define TRACE_DISPLAY_ITEMS(i, expected, actual) \
-    String trace = String::format("%d: ", (int)i) + "Expected: " + (expected).asDebugString() + " Actual: " + (actual).asDebugString(); \
-    SCOPED_TRACE(trace.utf8().data());
-#else
-#define TRACE_DISPLAY_ITEMS(i, expected, actual)
-#endif
-
-#define EXPECT_DISPLAY_LIST(actual, expectedSize, ...) \
-    do { \
-        EXPECT_EQ((size_t)expectedSize, actual.size()); \
-        if (expectedSize != actual.size()) \
-            break; \
-        const TestDisplayItem expected[] = { __VA_ARGS__ }; \
-        for (size_t index = 0; index < std::min<size_t>(actual.size(), expectedSize); index++) { \
-            TRACE_DISPLAY_ITEMS(index, expected[index], actual[index]); \
-            EXPECT_EQ(expected[index].client(), actual[index].client()); \
-            EXPECT_EQ(expected[index].type(), actual[index].type()); \
-        } \
-    } while (false);
-
-void drawRect(GraphicsContext& context, const TestDisplayItemClient& client, DisplayItem::Type type, const FloatRect& bounds)
-{
-    if (DrawingRecorder::useCachedDrawingIfPossible(context, client, type))
-        return;
-    DrawingRecorder drawingRecorder(context, client, type, bounds);
-    IntRect rect(0, 0, 10, 10);
-    context.drawRect(rect);
-}
-
-void drawClippedRect(GraphicsContext& context, const TestDisplayItemClient& client, DisplayItem::Type clipType, DisplayItem::Type drawingType, const FloatRect& bound)
-{
-    ClipRecorder clipRecorder(context, client, clipType, LayoutRect(1, 1, 9, 9));
-    drawRect(context, client, drawingType, bound);
-}
-
-TEST_F(DisplayItemListTest, NestedRecorders)
-{
-    GraphicsContext context(&displayItemList());
-
-    TestDisplayItemClient client("client");
-
-    drawClippedRect(context, client, clipType, backgroundDrawingType, FloatRect(100, 100, 200, 200));
-    displayItemList().commitNewDisplayItems();
-
-    EXPECT_DISPLAY_LIST(displayItemList().displayItems(), 3,
-        TestDisplayItem(client, clipType),
-        TestDisplayItem(client, backgroundDrawingType),
-        TestDisplayItem(client, DisplayItem::clipTypeToEndClipType(clipType)));
-}
-
-TEST_F(DisplayItemListTest, UpdateBasic)
-{
-    TestDisplayItemClient first("first");
-    TestDisplayItemClient second("second");
-    GraphicsContext context(&displayItemList());
-
-    drawRect(context, first, backgroundDrawingType, FloatRect(100, 100, 300, 300));
-    drawRect(context, second, backgroundDrawingType, FloatRect(100, 100, 200, 200));
-    drawRect(context, first, foregroundDrawingType, FloatRect(100, 100, 300, 300));
-    displayItemList().commitNewDisplayItems();
-
-    EXPECT_DISPLAY_LIST(displayItemList().displayItems(), 3,
-        TestDisplayItem(first, backgroundDrawingType),
-        TestDisplayItem(second, backgroundDrawingType),
-        TestDisplayItem(first, foregroundDrawingType));
-
-    displayItemList().invalidate(second, PaintInvalidationFull, IntRect(), IntRect());
-    drawRect(context, first, backgroundDrawingType, FloatRect(100, 100, 300, 300));
-    drawRect(context, first, foregroundDrawingType, FloatRect(100, 100, 300, 300));
-    displayItemList().commitNewDisplayItems();
-
-    EXPECT_DISPLAY_LIST(displayItemList().displayItems(), 2,
-        TestDisplayItem(first, backgroundDrawingType),
-        TestDisplayItem(first, foregroundDrawingType));
-}
-
-TEST_F(DisplayItemListTest, UpdateSwapOrder)
-{
-    TestDisplayItemClient first("first");
-    TestDisplayItemClient second("second");
-    TestDisplayItemClient unaffected("unaffected");
-    GraphicsContext context(&displayItemList());
-
-    drawRect(context, first, backgroundDrawingType, FloatRect(100, 100, 100, 100));
-    drawRect(context, second, backgroundDrawingType, FloatRect(100, 100, 50, 200));
-    drawRect(context, unaffected, backgroundDrawingType, FloatRect(300, 300, 10, 10));
-    displayItemList().commitNewDisplayItems();
-
-    EXPECT_DISPLAY_LIST(displayItemList().displayItems(), 3,
-        TestDisplayItem(first, backgroundDrawingType),
-        TestDisplayItem(second, backgroundDrawingType),
-        TestDisplayItem(unaffected, backgroundDrawingType));
-
-    displayItemList().invalidate(second, PaintInvalidationFull, IntRect(), IntRect());
-    drawRect(context, second, backgroundDrawingType, FloatRect(100, 100, 50, 200));
-    drawRect(context, first, backgroundDrawingType, FloatRect(100, 100, 100, 100));
-    drawRect(context, unaffected, backgroundDrawingType, FloatRect(300, 300, 10, 10));
-    displayItemList().commitNewDisplayItems();
-
-    EXPECT_DISPLAY_LIST(displayItemList().displayItems(), 3,
-        TestDisplayItem(second, backgroundDrawingType),
-        TestDisplayItem(first, backgroundDrawingType),
-        TestDisplayItem(unaffected, backgroundDrawingType));
-}
-
-TEST_F(DisplayItemListTest, UpdateNewItemInMiddle)
-{
-    TestDisplayItemClient first("first");
-    TestDisplayItemClient second("second");
-    TestDisplayItemClient third("third");
-    GraphicsContext context(&displayItemList());
-
-    drawRect(context, first, backgroundDrawingType, FloatRect(100, 100, 100, 100));
-    drawRect(context, second, backgroundDrawingType, FloatRect(100, 100, 50, 200));
-    displayItemList().commitNewDisplayItems();
-
-    EXPECT_DISPLAY_LIST(displayItemList().displayItems(), 2,
-        TestDisplayItem(first, backgroundDrawingType),
-        TestDisplayItem(second, backgroundDrawingType));
-
-    drawRect(context, first, backgroundDrawingType, FloatRect(100, 100, 100, 100));
-    drawRect(context, third, backgroundDrawingType, FloatRect(125, 100, 200, 50));
-    drawRect(context, second, backgroundDrawingType, FloatRect(100, 100, 50, 200));
-    displayItemList().commitNewDisplayItems();
-
-    EXPECT_DISPLAY_LIST(displayItemList().displayItems(), 3,
-        TestDisplayItem(first, backgroundDrawingType),
-        TestDisplayItem(third, backgroundDrawingType),
-        TestDisplayItem(second, backgroundDrawingType));
-}
-
-TEST_F(DisplayItemListTest, UpdateInvalidationWithPhases)
-{
-    TestDisplayItemClient first("first");
-    TestDisplayItemClient second("second");
-    TestDisplayItemClient third("third");
-    GraphicsContext context(&displayItemList());
-
-    drawRect(context, first, backgroundDrawingType, FloatRect(100, 100, 100, 100));
-    drawRect(context, second, backgroundDrawingType, FloatRect(100, 100, 50, 200));
-    drawRect(context, third, backgroundDrawingType, FloatRect(300, 100, 50, 50));
-    drawRect(context, first, foregroundDrawingType, FloatRect(100, 100, 100, 100));
-    drawRect(context, second, foregroundDrawingType, FloatRect(100, 100, 50, 200));
-    drawRect(context, third, foregroundDrawingType, FloatRect(300, 100, 50, 50));
-    displayItemList().commitNewDisplayItems();
-
-    EXPECT_DISPLAY_LIST(displayItemList().displayItems(), 6,
-        TestDisplayItem(first, backgroundDrawingType),
-        TestDisplayItem(second, backgroundDrawingType),
-        TestDisplayItem(third, backgroundDrawingType),
-        TestDisplayItem(first, foregroundDrawingType),
-        TestDisplayItem(second, foregroundDrawingType),
-        TestDisplayItem(third, foregroundDrawingType));
-
-    displayItemList().invalidate(second, PaintInvalidationFull, IntRect(), IntRect());
-    drawRect(context, first, backgroundDrawingType, FloatRect(100, 100, 100, 100));
-    drawRect(context, second, backgroundDrawingType, FloatRect(100, 100, 50, 200));
-    drawRect(context, third, backgroundDrawingType, FloatRect(300, 100, 50, 50));
-    drawRect(context, first, foregroundDrawingType, FloatRect(100, 100, 100, 100));
-    drawRect(context, second, foregroundDrawingType, FloatRect(100, 100, 50, 200));
-    drawRect(context, third, foregroundDrawingType, FloatRect(300, 100, 50, 50));
-    displayItemList().commitNewDisplayItems();
-
-    EXPECT_DISPLAY_LIST(displayItemList().displayItems(), 6,
-        TestDisplayItem(first, backgroundDrawingType),
-        TestDisplayItem(second, backgroundDrawingType),
-        TestDisplayItem(third, backgroundDrawingType),
-        TestDisplayItem(first, foregroundDrawingType),
-        TestDisplayItem(second, foregroundDrawingType),
-        TestDisplayItem(third, foregroundDrawingType));
-}
-
-TEST_F(DisplayItemListTest, UpdateAddFirstOverlap)
-{
-    TestDisplayItemClient first("first");
-    TestDisplayItemClient second("second");
-    GraphicsContext context(&displayItemList());
-
-    drawRect(context, second, backgroundDrawingType, FloatRect(200, 200, 50, 50));
-    drawRect(context, second, foregroundDrawingType, FloatRect(200, 200, 50, 50));
-    displayItemList().commitNewDisplayItems();
-
-    EXPECT_DISPLAY_LIST(displayItemList().displayItems(), 2,
-        TestDisplayItem(second, backgroundDrawingType),
-        TestDisplayItem(second, foregroundDrawingType));
-
-    displayItemList().invalidate(first, PaintInvalidationFull, IntRect(), IntRect());
-    displayItemList().invalidate(second, PaintInvalidationFull, IntRect(), IntRect());
-    drawRect(context, first, backgroundDrawingType, FloatRect(100, 100, 150, 150));
-    drawRect(context, first, foregroundDrawingType, FloatRect(100, 100, 150, 150));
-    drawRect(context, second, backgroundDrawingType, FloatRect(200, 200, 50, 50));
-    drawRect(context, second, foregroundDrawingType, FloatRect(200, 200, 50, 50));
-    displayItemList().commitNewDisplayItems();
-
-    EXPECT_DISPLAY_LIST(displayItemList().displayItems(), 4,
-        TestDisplayItem(first, backgroundDrawingType),
-        TestDisplayItem(first, foregroundDrawingType),
-        TestDisplayItem(second, backgroundDrawingType),
-        TestDisplayItem(second, foregroundDrawingType));
-
-    displayItemList().invalidate(first, PaintInvalidationFull, IntRect(), IntRect());
-    drawRect(context, second, backgroundDrawingType, FloatRect(200, 200, 50, 50));
-    drawRect(context, second, foregroundDrawingType, FloatRect(200, 200, 50, 50));
-    displayItemList().commitNewDisplayItems();
-
-    EXPECT_DISPLAY_LIST(displayItemList().displayItems(), 2,
-        TestDisplayItem(second, backgroundDrawingType),
-        TestDisplayItem(second, foregroundDrawingType));
-}
-
-TEST_F(DisplayItemListTest, UpdateAddLastOverlap)
-{
-    TestDisplayItemClient first("first");
-    TestDisplayItemClient second("second");
-    GraphicsContext context(&displayItemList());
-
-    drawRect(context, first, backgroundDrawingType, FloatRect(100, 100, 150, 150));
-    drawRect(context, first, foregroundDrawingType, FloatRect(100, 100, 150, 150));
-    displayItemList().commitNewDisplayItems();
-
-    EXPECT_DISPLAY_LIST(displayItemList().displayItems(), 2,
-        TestDisplayItem(first, backgroundDrawingType),
-        TestDisplayItem(first, foregroundDrawingType));
-
-    displayItemList().invalidate(first, PaintInvalidationFull, IntRect(), IntRect());
-    displayItemList().invalidate(second, PaintInvalidationFull, IntRect(), IntRect());
-    drawRect(context, first, backgroundDrawingType, FloatRect(100, 100, 150, 150));
-    drawRect(context, first, foregroundDrawingType, FloatRect(100, 100, 150, 150));
-    drawRect(context, second, backgroundDrawingType, FloatRect(200, 200, 50, 50));
-    drawRect(context, second, foregroundDrawingType, FloatRect(200, 200, 50, 50));
-    displayItemList().commitNewDisplayItems();
-
-    EXPECT_DISPLAY_LIST(displayItemList().displayItems(), 4,
-        TestDisplayItem(first, backgroundDrawingType),
-        TestDisplayItem(first, foregroundDrawingType),
-        TestDisplayItem(second, backgroundDrawingType),
-        TestDisplayItem(second, foregroundDrawingType));
-
-    displayItemList().invalidate(first, PaintInvalidationFull, IntRect(), IntRect());
-    displayItemList().invalidate(second, PaintInvalidationFull, IntRect(), IntRect());
-    drawRect(context, first, backgroundDrawingType, FloatRect(100, 100, 150, 150));
-    drawRect(context, first, foregroundDrawingType, FloatRect(100, 100, 150, 150));
-    displayItemList().commitNewDisplayItems();
-
-    EXPECT_DISPLAY_LIST(displayItemList().displayItems(), 2,
-        TestDisplayItem(first, backgroundDrawingType),
-        TestDisplayItem(first, foregroundDrawingType));
-}
-
-TEST_F(DisplayItemListTest, UpdateClip)
-{
-    TestDisplayItemClient first("first");
-    TestDisplayItemClient second("second");
-    GraphicsContext context(&displayItemList());
-
-    {
-        ClipRecorder clipRecorder(context, first, clipType, LayoutRect(1, 1, 2, 2));
-        drawRect(context, first, backgroundDrawingType, FloatRect(100, 100, 150, 150));
-        drawRect(context, second, backgroundDrawingType, FloatRect(100, 100, 150, 150));
-    }
-    displayItemList().commitNewDisplayItems();
-
-    EXPECT_DISPLAY_LIST(displayItemList().displayItems(), 4,
-        TestDisplayItem(first, clipType),
-        TestDisplayItem(first, backgroundDrawingType),
-        TestDisplayItem(second, backgroundDrawingType),
-        TestDisplayItem(first, DisplayItem::clipTypeToEndClipType(clipType)));
-
-    displayItemList().invalidate(first, PaintInvalidationFull, IntRect(), IntRect());
-    drawRect(context, first, backgroundDrawingType, FloatRect(100, 100, 150, 150));
-    drawRect(context, second, backgroundDrawingType, FloatRect(100, 100, 150, 150));
-    displayItemList().commitNewDisplayItems();
-
-    EXPECT_DISPLAY_LIST(displayItemList().displayItems(), 2,
-        TestDisplayItem(first, backgroundDrawingType),
-        TestDisplayItem(second, backgroundDrawingType));
-
-    displayItemList().invalidate(second, PaintInvalidationFull, IntRect(), IntRect());
-    drawRect(context, first, backgroundDrawingType, FloatRect(100, 100, 150, 150));
-    {
-        ClipRecorder clipRecorder(context, second, clipType, LayoutRect(1, 1, 2, 2));
-        drawRect(context, second, backgroundDrawingType, FloatRect(100, 100, 150, 150));
-    }
-    displayItemList().commitNewDisplayItems();
-
-    EXPECT_DISPLAY_LIST(displayItemList().displayItems(), 4,
-        TestDisplayItem(first, backgroundDrawingType),
-        TestDisplayItem(second, clipType),
-        TestDisplayItem(second, backgroundDrawingType),
-        TestDisplayItem(second, DisplayItem::clipTypeToEndClipType(clipType)));
-}
-
-TEST_F(DisplayItemListTest, CachedDisplayItems)
-{
-    TestDisplayItemClient first("first");
-    TestDisplayItemClient second("second");
-    GraphicsContext context(&displayItemList());
-
-    drawRect(context, first, backgroundDrawingType, FloatRect(100, 100, 150, 150));
-    drawRect(context, second, backgroundDrawingType, FloatRect(100, 100, 150, 150));
-    displayItemList().commitNewDisplayItems();
-
-    EXPECT_DISPLAY_LIST(displayItemList().displayItems(), 2,
-        TestDisplayItem(first, backgroundDrawingType),
-        TestDisplayItem(second, backgroundDrawingType));
-    EXPECT_TRUE(displayItemList().clientCacheIsValid(first.displayItemClient()));
-    EXPECT_TRUE(displayItemList().clientCacheIsValid(second.displayItemClient()));
-    const SkPicture* firstPicture = static_cast<const DrawingDisplayItem&>(displayItemList().displayItems()[0]).picture();
-    const SkPicture* secondPicture = static_cast<const DrawingDisplayItem&>(displayItemList().displayItems()[1]).picture();
-
-    displayItemList().invalidate(first, PaintInvalidationFull, IntRect(), IntRect());
-    EXPECT_FALSE(displayItemList().clientCacheIsValid(first.displayItemClient()));
-    EXPECT_TRUE(displayItemList().clientCacheIsValid(second.displayItemClient()));
-
-    drawRect(context, first, backgroundDrawingType, FloatRect(100, 100, 150, 150));
-    drawRect(context, second, backgroundDrawingType, FloatRect(100, 100, 150, 150));
-    displayItemList().commitNewDisplayItems();
-
-    EXPECT_DISPLAY_LIST(displayItemList().displayItems(), 2,
-        TestDisplayItem(first, backgroundDrawingType),
-        TestDisplayItem(second, backgroundDrawingType));
-    // The first display item should be updated.
-    EXPECT_NE(firstPicture, static_cast<const DrawingDisplayItem&>(displayItemList().displayItems()[0]).picture());
-    // The second display item should be cached.
-    EXPECT_EQ(secondPicture, static_cast<const DrawingDisplayItem&>(displayItemList().displayItems()[1]).picture());
-    EXPECT_TRUE(displayItemList().clientCacheIsValid(first.displayItemClient()));
-    EXPECT_TRUE(displayItemList().clientCacheIsValid(second.displayItemClient()));
-
-    displayItemList().invalidateAll();
-    EXPECT_FALSE(displayItemList().clientCacheIsValid(first.displayItemClient()));
-    EXPECT_FALSE(displayItemList().clientCacheIsValid(second.displayItemClient()));
-}
-
-TEST_F(DisplayItemListTest, ComplexUpdateSwapOrder)
-{
-    TestDisplayItemClient container1("container1");
-    TestDisplayItemClient content1("content1");
-    TestDisplayItemClient container2("container2");
-    TestDisplayItemClient content2("content2");
-    GraphicsContext context(&displayItemList());
-
-    drawRect(context, container1, backgroundDrawingType, FloatRect(100, 100, 100, 100));
-    drawRect(context, content1, backgroundDrawingType, FloatRect(100, 100, 50, 200));
-    drawRect(context, content1, foregroundDrawingType, FloatRect(100, 100, 50, 200));
-    drawRect(context, container1, foregroundDrawingType, FloatRect(100, 100, 100, 100));
-    drawRect(context, container2, backgroundDrawingType, FloatRect(100, 200, 100, 100));
-    drawRect(context, content2, backgroundDrawingType, FloatRect(100, 200, 50, 200));
-    drawRect(context, content2, foregroundDrawingType, FloatRect(100, 200, 50, 200));
-    drawRect(context, container2, foregroundDrawingType, FloatRect(100, 200, 100, 100));
-    displayItemList().commitNewDisplayItems();
-
-    EXPECT_DISPLAY_LIST(displayItemList().displayItems(), 8,
-        TestDisplayItem(container1, backgroundDrawingType),
-        TestDisplayItem(content1, backgroundDrawingType),
-        TestDisplayItem(content1, foregroundDrawingType),
-        TestDisplayItem(container1, foregroundDrawingType),
-        TestDisplayItem(container2, backgroundDrawingType),
-        TestDisplayItem(content2, backgroundDrawingType),
-        TestDisplayItem(content2, foregroundDrawingType),
-        TestDisplayItem(container2, foregroundDrawingType));
-
-    // Simulate the situation when container1 e.g. gets a z-index that is now greater than container2.
-    displayItemList().invalidate(container1, PaintInvalidationFull, IntRect(), IntRect());
-    drawRect(context, container2, backgroundDrawingType, FloatRect(100, 200, 100, 100));
-    drawRect(context, content2, backgroundDrawingType, FloatRect(100, 200, 50, 200));
-    drawRect(context, content2, foregroundDrawingType, FloatRect(100, 200, 50, 200));
-    drawRect(context, container2, foregroundDrawingType, FloatRect(100, 200, 100, 100));
-    drawRect(context, container1, backgroundDrawingType, FloatRect(100, 100, 100, 100));
-    drawRect(context, content1, backgroundDrawingType, FloatRect(100, 100, 50, 200));
-    drawRect(context, content1, foregroundDrawingType, FloatRect(100, 100, 50, 200));
-    drawRect(context, container1, foregroundDrawingType, FloatRect(100, 100, 100, 100));
-    displayItemList().commitNewDisplayItems();
-
-    EXPECT_DISPLAY_LIST(displayItemList().displayItems(), 8,
-        TestDisplayItem(container2, backgroundDrawingType),
-        TestDisplayItem(content2, backgroundDrawingType),
-        TestDisplayItem(content2, foregroundDrawingType),
-        TestDisplayItem(container2, foregroundDrawingType),
-        TestDisplayItem(container1, backgroundDrawingType),
-        TestDisplayItem(content1, backgroundDrawingType),
-        TestDisplayItem(content1, foregroundDrawingType),
-        TestDisplayItem(container1, foregroundDrawingType));
-}
-
-TEST_F(DisplayItemListTest, CachedSubsequenceSwapOrder)
-{
-    RuntimeEnabledFeatures::setSlimmingPaintSubsequenceCachingEnabled(true);
-
-    TestDisplayItemClient container1("container1");
-    TestDisplayItemClient content1("content1");
-    TestDisplayItemClient container2("container2");
-    TestDisplayItemClient content2("content2");
-    GraphicsContext context(&displayItemList());
-
-    {
-        SubsequenceRecorder r(context, container1, subsequenceType);
-        drawRect(context, container1, backgroundDrawingType, FloatRect(100, 100, 100, 100));
-        drawRect(context, content1, backgroundDrawingType, FloatRect(100, 100, 50, 200));
-        drawRect(context, content1, foregroundDrawingType, FloatRect(100, 100, 50, 200));
-        drawRect(context, container1, foregroundDrawingType, FloatRect(100, 100, 100, 100));
-    }
-    {
-        SubsequenceRecorder r(context, container2, subsequenceType);
-        drawRect(context, container2, backgroundDrawingType, FloatRect(100, 200, 100, 100));
-        drawRect(context, content2, backgroundDrawingType, FloatRect(100, 200, 50, 200));
-        drawRect(context, content2, foregroundDrawingType, FloatRect(100, 200, 50, 200));
-        drawRect(context, container2, foregroundDrawingType, FloatRect(100, 200, 100, 100));
-    }
-    displayItemList().commitNewDisplayItems();
-
-    EXPECT_DISPLAY_LIST(displayItemList().displayItems(), 12,
-        TestDisplayItem(container1, subsequenceType),
-        TestDisplayItem(container1, backgroundDrawingType),
-        TestDisplayItem(content1, backgroundDrawingType),
-        TestDisplayItem(content1, foregroundDrawingType),
-        TestDisplayItem(container1, foregroundDrawingType),
-        TestDisplayItem(container1, endSubsequenceType),
-
-        TestDisplayItem(container2, subsequenceType),
-        TestDisplayItem(container2, backgroundDrawingType),
-        TestDisplayItem(content2, backgroundDrawingType),
-        TestDisplayItem(content2, foregroundDrawingType),
-        TestDisplayItem(container2, foregroundDrawingType),
-        TestDisplayItem(container2, endSubsequenceType));
-
-    // Simulate the situation when container1 e.g. gets a z-index that is now greater than container2.
-    EXPECT_TRUE(SubsequenceRecorder::useCachedSubsequenceIfPossible(context, container2, subsequenceType));
-    EXPECT_TRUE(SubsequenceRecorder::useCachedSubsequenceIfPossible(context, container1, subsequenceType));
-
-    EXPECT_DISPLAY_LIST(displayItemList().newDisplayItems(), 2,
-        TestDisplayItem(container2, cachedSubsequenceType),
-        TestDisplayItem(container1, cachedSubsequenceType));
-
-    displayItemList().commitNewDisplayItems();
-
-    EXPECT_DISPLAY_LIST(displayItemList().displayItems(), 12,
-        TestDisplayItem(container2, subsequenceType),
-        TestDisplayItem(container2, backgroundDrawingType),
-        TestDisplayItem(content2, backgroundDrawingType),
-        TestDisplayItem(content2, foregroundDrawingType),
-        TestDisplayItem(container2, foregroundDrawingType),
-        TestDisplayItem(container2, endSubsequenceType),
-
-        TestDisplayItem(container1, subsequenceType),
-        TestDisplayItem(container1, backgroundDrawingType),
-        TestDisplayItem(content1, backgroundDrawingType),
-        TestDisplayItem(content1, foregroundDrawingType),
-        TestDisplayItem(container1, foregroundDrawingType),
-        TestDisplayItem(container1, endSubsequenceType));
-}
-
-TEST_F(DisplayItemListTest, OutOfOrderNoCrash)
-{
-    TestDisplayItemClient client("client");
-    GraphicsContext context(&displayItemList());
-
-    const DisplayItem::Type type1 = DisplayItem::DrawingFirst;
-    const DisplayItem::Type type2 = static_cast<DisplayItem::Type>(DisplayItem::DrawingFirst + 1);
-    const DisplayItem::Type type3 = static_cast<DisplayItem::Type>(DisplayItem::DrawingFirst + 2);
-    const DisplayItem::Type type4 = static_cast<DisplayItem::Type>(DisplayItem::DrawingFirst + 3);
-
-    drawRect(context, client, type1, FloatRect(100, 100, 100, 100));
-    drawRect(context, client, type2, FloatRect(100, 100, 50, 200));
-    drawRect(context, client, type3, FloatRect(100, 100, 50, 200));
-    drawRect(context, client, type4, FloatRect(100, 100, 100, 100));
-
-    displayItemList().commitNewDisplayItems();
-
-    drawRect(context, client, type2, FloatRect(100, 100, 50, 200));
-    drawRect(context, client, type3, FloatRect(100, 100, 50, 200));
-    drawRect(context, client, type1, FloatRect(100, 100, 100, 100));
-    drawRect(context, client, type4, FloatRect(100, 100, 100, 100));
-
-    displayItemList().commitNewDisplayItems();
-}
-
-TEST_F(DisplayItemListTest, CachedNestedSubsequenceUpdate)
-{
-    RuntimeEnabledFeatures::setSlimmingPaintSubsequenceCachingEnabled(true);
-
-    TestDisplayItemClient container1("container1");
-    TestDisplayItemClient content1("content1");
-    TestDisplayItemClient container2("container2");
-    TestDisplayItemClient content2("content2");
-    GraphicsContext context(&displayItemList());
-
-    {
-        SubsequenceRecorder r(context, container1, subsequenceType);
-        drawRect(context, container1, backgroundDrawingType, FloatRect(100, 100, 100, 100));
-        {
-            SubsequenceRecorder r(context, content1, subsequenceType);
-            drawRect(context, content1, backgroundDrawingType, FloatRect(100, 100, 50, 200));
-            drawRect(context, content1, foregroundDrawingType, FloatRect(100, 100, 50, 200));
-        }
-        drawRect(context, container1, foregroundDrawingType, FloatRect(100, 100, 100, 100));
-    }
-    {
-        SubsequenceRecorder r(context, container2, subsequenceType);
-        drawRect(context, container2, backgroundDrawingType, FloatRect(100, 200, 100, 100));
-        {
-            SubsequenceRecorder r(context, content2, subsequenceType);
-            drawRect(context, content2, backgroundDrawingType, FloatRect(100, 200, 50, 200));
-        }
-    }
-    displayItemList().commitNewDisplayItems();
-
-    EXPECT_DISPLAY_LIST(displayItemList().displayItems(), 14,
-        TestDisplayItem(container1, subsequenceType),
-        TestDisplayItem(container1, backgroundDrawingType),
-        TestDisplayItem(content1, subsequenceType),
-        TestDisplayItem(content1, backgroundDrawingType),
-        TestDisplayItem(content1, foregroundDrawingType),
-        TestDisplayItem(content1, endSubsequenceType),
-        TestDisplayItem(container1, foregroundDrawingType),
-        TestDisplayItem(container1, endSubsequenceType),
-
-        TestDisplayItem(container2, subsequenceType),
-        TestDisplayItem(container2, backgroundDrawingType),
-        TestDisplayItem(content2, subsequenceType),
-        TestDisplayItem(content2, backgroundDrawingType),
-        TestDisplayItem(content2, endSubsequenceType),
-        TestDisplayItem(container2, endSubsequenceType));
-
-    // Invalidate container1 but not content1.
-    displayItemList().invalidate(container1, PaintInvalidationFull, IntRect(), IntRect());
-
-    // Container2 itself now becomes empty (but still has the 'content2' child),
-    // and chooses not to output subsequence info.
-
-    displayItemList().invalidate(container2, PaintInvalidationFull, IntRect(), IntRect());
-    displayItemList().invalidate(content2, PaintInvalidationFull, IntRect(), IntRect());
-    EXPECT_FALSE(SubsequenceRecorder::useCachedSubsequenceIfPossible(context, container2, subsequenceType));
-    EXPECT_FALSE(SubsequenceRecorder::useCachedSubsequenceIfPossible(context, content2, subsequenceType));
-    // Content2 now outputs foreground only.
-    {
-        SubsequenceRecorder r(context, content2, subsequenceType);
-        drawRect(context, content2, foregroundDrawingType, FloatRect(100, 200, 50, 200));
-    }
-    // Repaint container1 with foreground only.
-    {
-        EXPECT_FALSE(SubsequenceRecorder::useCachedSubsequenceIfPossible(context, container1, subsequenceType));
-        SubsequenceRecorder r(context, container1, subsequenceType);
-        // Use cached subsequence of content1.
-        EXPECT_TRUE(SubsequenceRecorder::useCachedSubsequenceIfPossible(context, content1, subsequenceType));
-        drawRect(context, container1, foregroundDrawingType, FloatRect(100, 100, 100, 100));
-    }
-    EXPECT_DISPLAY_LIST(displayItemList().newDisplayItems(), 7,
-        TestDisplayItem(content2, subsequenceType),
-        TestDisplayItem(content2, foregroundDrawingType),
-        TestDisplayItem(content2, endSubsequenceType),
-        TestDisplayItem(container1, subsequenceType),
-        TestDisplayItem(content1, cachedSubsequenceType),
-        TestDisplayItem(container1, foregroundDrawingType),
-        TestDisplayItem(container1, endSubsequenceType));
-
-    displayItemList().commitNewDisplayItems();
-
-    EXPECT_DISPLAY_LIST(displayItemList().displayItems(), 10,
-        TestDisplayItem(content2, subsequenceType),
-        TestDisplayItem(content2, foregroundDrawingType),
-        TestDisplayItem(content2, endSubsequenceType),
-
-        TestDisplayItem(container1, subsequenceType),
-        TestDisplayItem(content1, subsequenceType),
-        TestDisplayItem(content1, backgroundDrawingType),
-        TestDisplayItem(content1, foregroundDrawingType),
-        TestDisplayItem(content1, endSubsequenceType),
-        TestDisplayItem(container1, foregroundDrawingType),
-        TestDisplayItem(container1, endSubsequenceType));
-}
-
-TEST_F(DisplayItemListTest, Scope)
-{
-    TestDisplayItemClient multicol("multicol");
-    TestDisplayItemClient content("content");
-    GraphicsContext context(&displayItemList());
-
-    FloatRect rect1(100, 100, 50, 50);
-    FloatRect rect2(150, 100, 50, 50);
-    FloatRect rect3(200, 100, 50, 50);
-
-    drawRect(context, multicol, backgroundDrawingType, FloatRect(100, 200, 100, 100));
-
-    displayItemList().beginScope();
-    drawRect(context, content, foregroundDrawingType, rect1);
-    displayItemList().endScope();
-
-    displayItemList().beginScope();
-    drawRect(context, content, foregroundDrawingType, rect2);
-    displayItemList().endScope();
-    displayItemList().commitNewDisplayItems();
-
-    EXPECT_DISPLAY_LIST(displayItemList().displayItems(), 3,
-        TestDisplayItem(multicol, backgroundDrawingType),
-        TestDisplayItem(content, foregroundDrawingType),
-        TestDisplayItem(content, foregroundDrawingType));
-    RefPtr<const SkPicture> picture1 = static_cast<const DrawingDisplayItem&>(displayItemList().displayItems()[1]).picture();
-    RefPtr<const SkPicture> picture2 = static_cast<const DrawingDisplayItem&>(displayItemList().displayItems()[2]).picture();
-    EXPECT_NE(picture1, picture2);
-
-    // Draw again with nothing invalidated.
-    EXPECT_TRUE(displayItemList().clientCacheIsValid(multicol.displayItemClient()));
-    drawRect(context, multicol, backgroundDrawingType, FloatRect(100, 200, 100, 100));
-    displayItemList().beginScope();
-    drawRect(context, content, foregroundDrawingType, rect1);
-    displayItemList().endScope();
-
-    displayItemList().beginScope();
-    drawRect(context, content, foregroundDrawingType, rect2);
-    displayItemList().endScope();
-
-    EXPECT_DISPLAY_LIST(displayItemList().newDisplayItems(), 3,
-        TestDisplayItem(multicol, DisplayItem::drawingTypeToCachedDrawingType(backgroundDrawingType)),
-        TestDisplayItem(content, foregroundDrawingType),
-        TestDisplayItem(content, foregroundDrawingType));
-
-    displayItemList().commitNewDisplayItems();
-
-    EXPECT_DISPLAY_LIST(displayItemList().displayItems(), 3,
-        TestDisplayItem(multicol, backgroundDrawingType),
-        TestDisplayItem(content, foregroundDrawingType),
-        TestDisplayItem(content, foregroundDrawingType));
-    EXPECT_NE(picture1, static_cast<const DrawingDisplayItem&>(displayItemList().displayItems()[1]).picture());
-    EXPECT_NE(picture2, static_cast<const DrawingDisplayItem&>(displayItemList().displayItems()[2]).picture());
-
-    // Now the multicol becomes 3 columns and repaints.
-    displayItemList().invalidate(multicol, PaintInvalidationFull, IntRect(), IntRect());
-    drawRect(context, multicol, backgroundDrawingType, FloatRect(100, 100, 100, 100));
-
-    displayItemList().beginScope();
-    drawRect(context, content, foregroundDrawingType, rect1);
-    displayItemList().endScope();
-
-    displayItemList().beginScope();
-    drawRect(context, content, foregroundDrawingType, rect2);
-    displayItemList().endScope();
-
-    displayItemList().beginScope();
-    drawRect(context, content, foregroundDrawingType, rect3);
-    displayItemList().endScope();
-
-    // We should repaint everything on invalidation of the scope container.
-    EXPECT_DISPLAY_LIST(displayItemList().newDisplayItems(), 4,
-        TestDisplayItem(multicol, backgroundDrawingType),
-        TestDisplayItem(content, foregroundDrawingType),
-        TestDisplayItem(content, foregroundDrawingType),
-        TestDisplayItem(content, foregroundDrawingType));
-    EXPECT_NE(picture1, static_cast<const DrawingDisplayItem&>(displayItemList().newDisplayItems()[1]).picture());
-    EXPECT_NE(picture2, static_cast<const DrawingDisplayItem&>(displayItemList().newDisplayItems()[2]).picture());
-
-    displayItemList().commitNewDisplayItems();
-}
-
-TEST_F(DisplayItemListTest, OptimizeNoopPairs)
-{
-    TestDisplayItemClient first("first");
-    TestDisplayItemClient second("second");
-    TestDisplayItemClient third("third");
-
-    GraphicsContext context(&displayItemList());
-    drawRect(context, first, backgroundDrawingType, FloatRect(0, 0, 100, 100));
-    {
-        ClipPathRecorder clipRecorder(context, second, Path());
-        drawRect(context, second, backgroundDrawingType, FloatRect(0, 0, 100, 100));
-    }
-    drawRect(context, third, backgroundDrawingType, FloatRect(0, 0, 100, 100));
-
-    displayItemList().commitNewDisplayItems();
-    EXPECT_DISPLAY_LIST(displayItemList().displayItems(), 5,
-        TestDisplayItem(first, backgroundDrawingType),
-        TestDisplayItem(second, DisplayItem::BeginClipPath),
-        TestDisplayItem(second, backgroundDrawingType),
-        TestDisplayItem(second, DisplayItem::EndClipPath),
-        TestDisplayItem(third, backgroundDrawingType));
-
-    displayItemList().invalidate(second, PaintInvalidationFull, IntRect(), IntRect());
-    drawRect(context, first, backgroundDrawingType, FloatRect(0, 0, 100, 100));
-    {
-        ClipRecorder clipRecorder(context, second, clipType, LayoutRect(1, 1, 2, 2));
-        // Do not draw anything for second.
-    }
-    drawRect(context, third, backgroundDrawingType, FloatRect(0, 0, 100, 100));
-    displayItemList().commitNewDisplayItems();
-
-    // Empty clips should have been optimized out.
-    EXPECT_DISPLAY_LIST(displayItemList().displayItems(), 2,
-        TestDisplayItem(first, backgroundDrawingType),
-        TestDisplayItem(third, backgroundDrawingType));
-
-    displayItemList().invalidate(second, PaintInvalidationFull, IntRect(), IntRect());
-    drawRect(context, first, backgroundDrawingType, FloatRect(0, 0, 100, 100));
-    {
-        ClipRecorder clipRecorder(context, second, clipType, LayoutRect(1, 1, 2, 2));
-        {
-            ClipPathRecorder clipPathRecorder(context, second, Path());
-            // Do not draw anything for second.
-        }
-    }
-    drawRect(context, third, backgroundDrawingType, FloatRect(0, 0, 100, 100));
-    displayItemList().commitNewDisplayItems();
-
-    // Empty clips should have been optimized out.
-    EXPECT_DISPLAY_LIST(displayItemList().displayItems(), 2,
-        TestDisplayItem(first, backgroundDrawingType),
-        TestDisplayItem(third, backgroundDrawingType));
-}
-
-TEST_F(DisplayItemListTest, SmallDisplayItemListHasOnePaintChunk)
-{
-    RuntimeEnabledFeatures::setSlimmingPaintV2Enabled(true);
-    TestDisplayItemClient client("test client");
-
-    GraphicsContext context(&displayItemList());
-    drawRect(context, client, backgroundDrawingType, FloatRect(0, 0, 100, 100));
-
-    displayItemList().commitNewDisplayItems();
-    const auto& paintChunks = displayItemList().paintChunks();
-    ASSERT_EQ(1u, paintChunks.size());
-    EXPECT_EQ(0u, paintChunks[0].beginIndex);
-    EXPECT_EQ(1u, paintChunks[0].endIndex);
-}
-
-} // namespace blink
diff --git a/third_party/WebKit/Source/platform/graphics/paint/DisplayItems.h b/third_party/WebKit/Source/platform/graphics/paint/DisplayItems.h
index 5c3ce15..8653bdb6 100644
--- a/third_party/WebKit/Source/platform/graphics/paint/DisplayItems.h
+++ b/third_party/WebKit/Source/platform/graphics/paint/DisplayItems.h
@@ -19,7 +19,7 @@
 
 // kDisplayItemAlignment must be a multiple of alignof(derived display item) for
 // each derived display item; the ideal value is the least common multiple.
-// Currently the limiting factor is TransformtionMatrix (in
+// Currently the limiting factor is TransformationMatrix (in
 // BeginTransform3DDisplayItem), which requests 16-byte alignment.
 static const size_t kDisplayItemAlignment = WTF_ALIGN_OF(BeginTransform3DDisplayItem);
 static const size_t kMaximumDisplayItemSize = sizeof(BeginTransform3DDisplayItem);
diff --git a/third_party/WebKit/Source/platform/graphics/paint/DrawingRecorder.cpp b/third_party/WebKit/Source/platform/graphics/paint/DrawingRecorder.cpp
index cf2859bf..76d8bc95 100644
--- a/third_party/WebKit/Source/platform/graphics/paint/DrawingRecorder.cpp
+++ b/third_party/WebKit/Source/platform/graphics/paint/DrawingRecorder.cpp
@@ -9,20 +9,20 @@
 #include "platform/graphics/GraphicsContext.h"
 #include "platform/graphics/GraphicsLayer.h"
 #include "platform/graphics/paint/CachedDisplayItem.h"
-#include "platform/graphics/paint/DisplayItemList.h"
+#include "platform/graphics/paint/PaintController.h"
 #include "third_party/skia/include/core/SkPicture.h"
 
 namespace blink {
 
 bool DrawingRecorder::useCachedDrawingIfPossible(GraphicsContext& context, const DisplayItemClientWrapper& client, DisplayItem::Type type)
 {
-    ASSERT(context.displayItemList());
+    ASSERT(context.paintController());
     ASSERT(DisplayItem::isDrawingType(type));
 
-    if (!context.displayItemList()->clientCacheIsValid(client.displayItemClient()))
+    if (!context.paintController()->clientCacheIsValid(client.displayItemClient()))
         return false;
 
-    context.displayItemList()->createAndAppend<CachedDisplayItem>(client, DisplayItem::drawingTypeToCachedDrawingType(type));
+    context.paintController()->createAndAppend<CachedDisplayItem>(client, DisplayItem::drawingTypeToCachedDrawingType(type));
 
 #if ENABLE(ASSERT)
     // When under-invalidation checking is enabled, we output CachedDrawing display item
@@ -39,16 +39,16 @@
     , m_displayItemClient(displayItemClient)
     , m_displayItemType(displayItemType)
 #if ENABLE(ASSERT)
-    , m_displayItemPosition(m_context.displayItemList()->newDisplayItems().size())
+    , m_displayItemPosition(m_context.paintController()->newDisplayItems().size())
     , m_underInvalidationCheckingMode(DrawingDisplayItem::CheckPicture)
 #endif
 {
-    ASSERT(context.displayItemList());
-    if (context.displayItemList()->displayItemConstructionIsDisabled())
+    ASSERT(context.paintController());
+    if (context.paintController()->displayItemConstructionIsDisabled())
         return;
 
     // Must check DrawingRecorder::useCachedDrawingIfPossible before creating the DrawingRecorder.
-    ASSERT((RuntimeEnabledFeatures::slimmingPaintOffsetCachingEnabled() && context.displayItemList()->paintOffsetWasInvalidated(displayItemClient.displayItemClient()))
+    ASSERT((RuntimeEnabledFeatures::slimmingPaintOffsetCachingEnabled() && context.paintController()->paintOffsetWasInvalidated(displayItemClient.displayItemClient()))
         || RuntimeEnabledFeatures::slimmingPaintUnderInvalidationCheckingEnabled()
         || !useCachedDrawingIfPossible(m_context, m_displayItemClient, m_displayItemType));
 
@@ -79,8 +79,8 @@
 
 DrawingRecorder::~DrawingRecorder()
 {
-    ASSERT(m_context.displayItemList());
-    if (m_context.displayItemList()->displayItemConstructionIsDisabled())
+    ASSERT(m_context.paintController());
+    if (m_context.paintController()->displayItemConstructionIsDisabled())
         return;
 
 #if ENABLE(ASSERT)
@@ -88,10 +88,10 @@
         m_context.restore();
 
     m_context.setInDrawingRecorder(false);
-    ASSERT(m_displayItemPosition == m_context.displayItemList()->newDisplayItems().size());
+    ASSERT(m_displayItemPosition == m_context.paintController()->newDisplayItems().size());
 #endif
 
-    m_context.displayItemList()->createAndAppend<DrawingDisplayItem>(m_displayItemClient
+    m_context.paintController()->createAndAppend<DrawingDisplayItem>(m_displayItemClient
         , m_displayItemType
         , m_context.endRecording()
 #if ENABLE(ASSERT)
diff --git a/third_party/WebKit/Source/platform/graphics/paint/PaintArtifact.h b/third_party/WebKit/Source/platform/graphics/paint/PaintArtifact.h
index a6b3b5b..f8bcc2f5 100644
--- a/third_party/WebKit/Source/platform/graphics/paint/PaintArtifact.h
+++ b/third_party/WebKit/Source/platform/graphics/paint/PaintArtifact.h
@@ -15,9 +15,9 @@
 class GraphicsContext;
 class WebDisplayItemList;
 
-// The output of painting, consisting of a series of drawings partitioned into
-// discontiguous chunks with a common set of paint properties (i.e. associated
-// with the same transform, clip, effects, etc.).
+// The output of painting, consisting of a series of drawings in paint order,
+// partitioned into discontiguous chunks with a common set of paint properties
+// (i.e. associated with the same transform, clip, effects, etc.).
 //
 // It represents a particular state of the world, and should be immutable
 // (const) to most of its users.
diff --git a/third_party/WebKit/Source/platform/graphics/paint/PaintController.cpp b/third_party/WebKit/Source/platform/graphics/paint/PaintController.cpp
new file mode 100644
index 0000000..9ad1b93d
--- /dev/null
+++ b/third_party/WebKit/Source/platform/graphics/paint/PaintController.cpp
@@ -0,0 +1,565 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "config.h"
+#include "platform/graphics/paint/PaintController.h"
+
+#include "platform/NotImplemented.h"
+#include "platform/TraceEvent.h"
+#include "platform/graphics/GraphicsLayer.h"
+#include "platform/graphics/paint/DrawingDisplayItem.h"
+
+#ifndef NDEBUG
+#include "platform/graphics/LoggingCanvas.h"
+#include "wtf/text/StringBuilder.h"
+#include <stdio.h>
+#endif
+
+namespace blink {
+
+const PaintArtifact& PaintController::paintArtifact() const
+{
+    ASSERT(m_newDisplayItems.isEmpty());
+    ASSERT(m_newPaintChunks.isInInitialState());
+    return m_currentPaintArtifact;
+}
+
+bool PaintController::lastDisplayItemIsNoopBegin() const
+{
+    if (m_newDisplayItems.isEmpty())
+        return false;
+
+    const auto& lastDisplayItem = m_newDisplayItems.last();
+    return lastDisplayItem.isBegin() && !lastDisplayItem.drawsContent();
+}
+
+void PaintController::removeLastDisplayItem()
+{
+    if (m_newDisplayItems.isEmpty())
+        return;
+
+#if ENABLE(ASSERT)
+    // Also remove the index pointing to the removed display item.
+    DisplayItemIndicesByClientMap::iterator it = m_newDisplayItemIndicesByClient.find(m_newDisplayItems.last().client());
+    if (it != m_newDisplayItemIndicesByClient.end()) {
+        Vector<size_t>& indices = it->value;
+        if (!indices.isEmpty() && indices.last() == (m_newDisplayItems.size() - 1))
+            indices.removeLast();
+    }
+#endif
+    m_newDisplayItems.removeLast();
+
+    if (RuntimeEnabledFeatures::slimmingPaintV2Enabled())
+        m_newPaintChunks.decrementDisplayItemIndex();
+}
+
+void PaintController::processNewItem(DisplayItem& displayItem)
+{
+    ASSERT(!m_constructionDisabled);
+    ASSERT(!skippingCache() || !displayItem.isCached());
+
+    if (displayItem.isCached())
+        ++m_numCachedItems;
+
+#if ENABLE(ASSERT)
+    // Verify noop begin/end pairs have been removed.
+    if (m_newDisplayItems.size() >= 2 && displayItem.isEnd()) {
+        const auto& beginDisplayItem = m_newDisplayItems[m_newDisplayItems.size() - 2];
+        if (beginDisplayItem.isBegin() && !beginDisplayItem.isSubsequence() && !beginDisplayItem.drawsContent())
+            ASSERT(!displayItem.isEndAndPairedWith(beginDisplayItem.type()));
+    }
+#endif
+
+    if (!m_scopeStack.isEmpty())
+        displayItem.setScope(m_scopeStack.last());
+
+#if ENABLE(ASSERT)
+    size_t index = findMatchingItemFromIndex(displayItem.nonCachedId(), m_newDisplayItemIndicesByClient, m_newDisplayItems);
+    if (index != kNotFound) {
+#ifndef NDEBUG
+        showDebugData();
+        WTFLogAlways("DisplayItem %s has duplicated id with previous %s (index=%d)\n",
+            displayItem.asDebugString().utf8().data(), m_newDisplayItems[index].asDebugString().utf8().data(), static_cast<int>(index));
+#endif
+        ASSERT_NOT_REACHED();
+    }
+    addItemToIndexIfNeeded(displayItem, m_newDisplayItems.size() - 1, m_newDisplayItemIndicesByClient);
+#endif // ENABLE(ASSERT)
+
+    if (skippingCache())
+        displayItem.setSkippedCache();
+
+    if (RuntimeEnabledFeatures::slimmingPaintV2Enabled())
+        m_newPaintChunks.incrementDisplayItemIndex();
+}
+
+void PaintController::updateCurrentPaintChunkProperties(const PaintChunkProperties& newProperties)
+{
+    m_newPaintChunks.updateCurrentPaintChunkProperties(newProperties);
+}
+
+void PaintController::beginScope()
+{
+    ASSERT_WITH_SECURITY_IMPLICATION(m_nextScope < UINT_MAX);
+    m_scopeStack.append(m_nextScope++);
+    beginSkippingCache();
+}
+
+void PaintController::endScope()
+{
+    m_scopeStack.removeLast();
+    endSkippingCache();
+}
+
+void PaintController::invalidate(const DisplayItemClientWrapper& client, PaintInvalidationReason paintInvalidationReason, const IntRect& previousPaintInvalidationRect, const IntRect& newPaintInvalidationRect)
+{
+    invalidateClient(client);
+
+    if (RuntimeEnabledFeatures::slimmingPaintSynchronizedPaintingEnabled()) {
+        Invalidation invalidation = { previousPaintInvalidationRect, paintInvalidationReason };
+        if (!previousPaintInvalidationRect.isEmpty())
+            m_invalidations.append(invalidation);
+        if (newPaintInvalidationRect != previousPaintInvalidationRect && !newPaintInvalidationRect.isEmpty()) {
+            invalidation.rect = newPaintInvalidationRect;
+            m_invalidations.append(invalidation);
+        }
+    }
+}
+
+void PaintController::invalidateClient(const DisplayItemClientWrapper& client)
+{
+    invalidateUntracked(client.displayItemClient());
+    if (RuntimeEnabledFeatures::slimmingPaintV2Enabled() && m_trackedPaintInvalidationObjects)
+        m_trackedPaintInvalidationObjects->append(client.debugName());
+}
+
+void PaintController::invalidateUntracked(DisplayItemClient client)
+{
+    // This can be called during painting, but we can't invalidate already painted clients.
+    ASSERT(!m_newDisplayItemIndicesByClient.contains(client));
+    updateValidlyCachedClientsIfNeeded();
+    m_validlyCachedClients.remove(client);
+}
+
+void PaintController::invalidateAll()
+{
+    // Can only be called during layout/paintInvalidation, not during painting.
+    ASSERT(m_newDisplayItems.isEmpty());
+    m_currentPaintArtifact.reset();
+    m_validlyCachedClients.clear();
+    m_validlyCachedClientsDirty = false;
+
+    if (RuntimeEnabledFeatures::slimmingPaintV2Enabled() && m_trackedPaintInvalidationObjects)
+        m_trackedPaintInvalidationObjects->append("##ALL##");
+}
+
+bool PaintController::clientCacheIsValid(DisplayItemClient client) const
+{
+    if (skippingCache())
+        return false;
+    updateValidlyCachedClientsIfNeeded();
+    return m_validlyCachedClients.contains(client);
+}
+
+void PaintController::invalidatePaintOffset(const DisplayItemClientWrapper& client)
+{
+    ASSERT(RuntimeEnabledFeatures::slimmingPaintOffsetCachingEnabled());
+    invalidateClient(client);
+
+#if ENABLE(ASSERT)
+    ASSERT(!paintOffsetWasInvalidated(client.displayItemClient()));
+    m_clientsWithPaintOffsetInvalidations.add(client.displayItemClient());
+#endif
+}
+
+#if ENABLE(ASSERT)
+bool PaintController::paintOffsetWasInvalidated(DisplayItemClient client) const
+{
+    ASSERT(RuntimeEnabledFeatures::slimmingPaintOffsetCachingEnabled());
+    return m_clientsWithPaintOffsetInvalidations.contains(client);
+}
+#endif
+
+size_t PaintController::findMatchingItemFromIndex(const DisplayItem::Id& id, const DisplayItemIndicesByClientMap& displayItemIndicesByClient, const DisplayItems& list)
+{
+    DisplayItemIndicesByClientMap::const_iterator it = displayItemIndicesByClient.find(id.client);
+    if (it == displayItemIndicesByClient.end())
+        return kNotFound;
+
+    const Vector<size_t>& indices = it->value;
+    for (size_t index : indices) {
+        const DisplayItem& existingItem = list[index];
+        ASSERT(!existingItem.isValid() || existingItem.client() == id.client);
+        if (existingItem.isValid() && id.matches(existingItem))
+            return index;
+    }
+
+    return kNotFound;
+}
+
+void PaintController::addItemToIndexIfNeeded(const DisplayItem& displayItem, size_t index, DisplayItemIndicesByClientMap& displayItemIndicesByClient)
+{
+    if (!displayItem.isCacheable())
+        return;
+
+    DisplayItemIndicesByClientMap::iterator it = displayItemIndicesByClient.find(displayItem.client());
+    Vector<size_t>& indices = it == displayItemIndicesByClient.end() ?
+        displayItemIndicesByClient.add(displayItem.client(), Vector<size_t>()).storedValue->value : it->value;
+    indices.append(index);
+}
+
+struct PaintController::OutOfOrderIndexContext {
+    OutOfOrderIndexContext(DisplayItems::iterator begin) : nextItemToIndex(begin) { }
+
+    DisplayItems::iterator nextItemToIndex;
+    DisplayItemIndicesByClientMap displayItemIndicesByClient;
+};
+
+DisplayItems::iterator PaintController::findOutOfOrderCachedItem(const DisplayItem::Id& id, OutOfOrderIndexContext& context)
+{
+    ASSERT(clientCacheIsValid(id.client));
+
+    size_t foundIndex = findMatchingItemFromIndex(id, context.displayItemIndicesByClient, m_currentPaintArtifact.displayItems());
+    if (foundIndex != kNotFound)
+        return m_currentPaintArtifact.displayItems().begin() + foundIndex;
+
+    return findOutOfOrderCachedItemForward(id, context);
+}
+
+// Find forward for the item and index all skipped indexable items.
+DisplayItems::iterator PaintController::findOutOfOrderCachedItemForward(const DisplayItem::Id& id, OutOfOrderIndexContext& context)
+{
+    DisplayItems::iterator currentEnd = m_currentPaintArtifact.displayItems().end();
+    for (; context.nextItemToIndex != currentEnd; ++context.nextItemToIndex) {
+        const DisplayItem& item = *context.nextItemToIndex;
+        ASSERT(item.isValid());
+        if (item.isCacheable() && clientCacheIsValid(item.client())) {
+            if (id.matches(item))
+                return context.nextItemToIndex++;
+
+            addItemToIndexIfNeeded(item, context.nextItemToIndex - m_currentPaintArtifact.displayItems().begin(), context.displayItemIndicesByClient);
+        }
+    }
+    return currentEnd;
+}
+
+void PaintController::copyCachedSubsequence(DisplayItems::iterator& currentIt, DisplayItems& updatedList)
+{
+    ASSERT(currentIt->isSubsequence());
+    ASSERT(!currentIt->scope());
+    DisplayItem::Id endSubsequenceId(currentIt->client(), DisplayItem::subsequenceTypeToEndSubsequenceType(currentIt->type()), 0);
+    do {
+        // We should always find the EndSubsequence display item.
+        ASSERT(currentIt != m_currentPaintArtifact.displayItems().end());
+        ASSERT(currentIt->isValid());
+        updatedList.appendByMoving(*currentIt);
+        ++currentIt;
+    } while (!endSubsequenceId.matches(updatedList.last()));
+}
+
+// Update the existing display items by removing invalidated entries, updating
+// repainted ones, and appending new items.
+// - For cached drawing display item, copy the corresponding cached DrawingDisplayItem;
+// - For cached subsequence display item, copy the cached display items between the
+//   corresponding SubsequenceDisplayItem and EndSubsequenceDisplayItem (incl.);
+// - Otherwise, copy the new display item.
+//
+// The algorithm is O(|m_currentDisplayItems| + |m_newDisplayItems|).
+// Coefficients are related to the ratio of out-of-order CachedDisplayItems
+// and the average number of (Drawing|Subsequence)DisplayItems per client.
+//
+void PaintController::commitNewDisplayItems(GraphicsLayer* graphicsLayer)
+{
+    TRACE_EVENT2("blink,benchmark", "PaintController::commitNewDisplayItems",
+        "current_display_list_size", (int)m_currentPaintArtifact.displayItems().size(),
+        "num_non_cached_new_items", (int)m_newDisplayItems.size() - m_numCachedItems);
+
+    if (RuntimeEnabledFeatures::slimmingPaintSynchronizedPaintingEnabled()) {
+        for (const auto& invalidation : m_invalidations)
+            graphicsLayer->setNeedsDisplayInRect(invalidation.rect, invalidation.invalidationReason);
+        m_invalidations.clear();
+        m_clientsCheckedPaintInvalidation.clear();
+    }
+
+    // These data structures are used during painting only.
+    ASSERT(m_scopeStack.isEmpty());
+    m_scopeStack.clear();
+    m_nextScope = 1;
+    ASSERT(!skippingCache());
+#if ENABLE(ASSERT)
+    m_newDisplayItemIndicesByClient.clear();
+    m_clientsWithPaintOffsetInvalidations.clear();
+#endif
+
+    if (m_currentPaintArtifact.isEmpty()) {
+#if ENABLE(ASSERT)
+        for (const auto& item : m_newDisplayItems)
+            ASSERT(!item.isCached());
+#endif
+        m_currentPaintArtifact.displayItems().swap(m_newDisplayItems);
+        m_currentPaintArtifact.paintChunks() = m_newPaintChunks.releasePaintChunks();
+        m_validlyCachedClientsDirty = true;
+        m_numCachedItems = 0;
+        return;
+    }
+
+    updateValidlyCachedClientsIfNeeded();
+
+    // Stores indices to valid DrawingDisplayItems in m_currentDisplayItems that have not been matched
+    // by CachedDisplayItems during synchronized matching. The indexed items will be matched
+    // by later out-of-order CachedDisplayItems in m_newDisplayItems. This ensures that when
+    // out-of-order CachedDisplayItems occur, we only traverse at most once over m_currentDisplayItems
+    // looking for potential matches. Thus we can ensure that the algorithm runs in linear time.
+    OutOfOrderIndexContext outOfOrderIndexContext(m_currentPaintArtifact.displayItems().begin());
+
+    // TODO(jbroman): Consider revisiting this heuristic.
+    DisplayItems updatedList(std::max(m_currentPaintArtifact.displayItems().usedCapacityInBytes(), m_newDisplayItems.usedCapacityInBytes()));
+    Vector<PaintChunk> updatedPaintChunks;
+    DisplayItems::iterator currentIt = m_currentPaintArtifact.displayItems().begin();
+    DisplayItems::iterator currentEnd = m_currentPaintArtifact.displayItems().end();
+    for (DisplayItems::iterator newIt = m_newDisplayItems.begin(); newIt != m_newDisplayItems.end(); ++newIt) {
+        const DisplayItem& newDisplayItem = *newIt;
+        const DisplayItem::Id newDisplayItemId = newDisplayItem.nonCachedId();
+        bool newDisplayItemHasCachedType = newDisplayItem.type() != newDisplayItemId.type;
+
+        bool isSynchronized = currentIt != currentEnd && newDisplayItemId.matches(*currentIt);
+
+        if (newDisplayItemHasCachedType) {
+            ASSERT(newDisplayItem.isCached());
+            ASSERT(clientCacheIsValid(newDisplayItem.client()) || (RuntimeEnabledFeatures::slimmingPaintOffsetCachingEnabled() && !paintOffsetWasInvalidated(newDisplayItem.client())));
+            if (!isSynchronized) {
+                currentIt = findOutOfOrderCachedItem(newDisplayItemId, outOfOrderIndexContext);
+
+                if (currentIt == currentEnd) {
+#ifndef NDEBUG
+                    showDebugData();
+                    WTFLogAlways("%s not found in m_currentDisplayItems\n", newDisplayItem.asDebugString().utf8().data());
+#endif
+                    ASSERT_NOT_REACHED();
+                    // We did not find the cached display item. This should be impossible, but may occur if there is a bug
+                    // in the system, such as under-invalidation, incorrect cache checking or duplicate display ids.
+                    // In this case, attempt to recover rather than crashing or bailing on display of the rest of the display list.
+                    continue;
+                }
+            }
+#if ENABLE(ASSERT)
+            if (RuntimeEnabledFeatures::slimmingPaintUnderInvalidationCheckingEnabled()) {
+                DisplayItems::iterator temp = currentIt;
+                checkUnderInvalidation(newIt, temp);
+            }
+#endif
+            if (newDisplayItem.isCachedDrawing()) {
+                updatedList.appendByMoving(*currentIt);
+                ++currentIt;
+            } else {
+                ASSERT(newDisplayItem.isCachedSubsequence());
+                copyCachedSubsequence(currentIt, updatedList);
+                ASSERT(updatedList.last().isEndSubsequence());
+            }
+        } else {
+            ASSERT(!newDisplayItem.isDrawing()
+                || newDisplayItem.skippedCache()
+                || !clientCacheIsValid(newDisplayItem.client())
+                || (RuntimeEnabledFeatures::slimmingPaintOffsetCachingEnabled() && paintOffsetWasInvalidated(newDisplayItem.client())));
+
+            updatedList.appendByMoving(*newIt);
+
+            if (isSynchronized)
+                ++currentIt;
+        }
+        // Items before currentIt should have been copied so we don't need to index them.
+        if (currentIt - outOfOrderIndexContext.nextItemToIndex > 0)
+            outOfOrderIndexContext.nextItemToIndex = currentIt;
+    }
+
+#if ENABLE(ASSERT)
+    if (RuntimeEnabledFeatures::slimmingPaintUnderInvalidationCheckingEnabled())
+        checkNoRemainingCachedDisplayItems();
+#endif // ENABLE(ASSERT)
+
+
+    // TODO(jbroman): When subsequence caching applies to SPv2, we'll need to
+    // merge the paint chunks as well.
+    m_currentPaintArtifact.displayItems().swap(updatedList);
+    m_currentPaintArtifact.paintChunks() = m_newPaintChunks.releasePaintChunks();
+
+    m_newDisplayItems.clear();
+    m_validlyCachedClientsDirty = true;
+    m_numCachedItems = 0;
+}
+
+size_t PaintController::approximateUnsharedMemoryUsage() const
+{
+    size_t memoryUsage = sizeof(*this);
+
+    // Memory outside this class due to m_currentPaintArtifact.
+    memoryUsage += m_currentPaintArtifact.approximateUnsharedMemoryUsage() - sizeof(m_currentPaintArtifact);
+
+    // TODO(jbroman): If display items begin to have significant external memory
+    // usage that's not shared with the embedder, we should account for it here.
+    //
+    // External objects, shared with the embedder, such as SkPicture, should be
+    // excluded to avoid double counting. It is the embedder's responsibility to
+    // count such objects.
+    //
+    // At time of writing, the only known case of unshared external memory was
+    // the rounded clips vector in ClipDisplayItem, which is not expected to
+    // contribute significantly to memory usage.
+
+    // Memory outside this class due to m_newDisplayItems.
+    ASSERT(m_newDisplayItems.isEmpty());
+    memoryUsage += m_newDisplayItems.memoryUsageInBytes();
+
+    return memoryUsage;
+}
+
+void PaintController::updateValidlyCachedClientsIfNeeded() const
+{
+    if (!m_validlyCachedClientsDirty)
+        return;
+
+    m_validlyCachedClients.clear();
+    m_validlyCachedClientsDirty = false;
+
+    DisplayItemClient lastAddedClient = nullptr;
+    for (const DisplayItem& displayItem : m_currentPaintArtifact.displayItems()) {
+        if (displayItem.client() == lastAddedClient)
+            continue;
+        if (displayItem.isCacheable()) {
+            lastAddedClient = displayItem.client();
+            m_validlyCachedClients.add(lastAddedClient);
+        }
+    }
+}
+
+#if ENABLE(ASSERT)
+
+void PaintController::checkUnderInvalidation(DisplayItems::iterator& newIt, DisplayItems::iterator& currentIt)
+{
+    ASSERT(RuntimeEnabledFeatures::slimmingPaintUnderInvalidationCheckingEnabled());
+    ASSERT(newIt->isCached());
+
+    // When under-invalidation-checking is enabled, the forced painting is following the cached display item.
+    DisplayItem::Type nextItemType = DisplayItem::nonCachedType(newIt->type());
+    ++newIt;
+    ASSERT(newIt->type() == nextItemType);
+
+    if (newIt->isDrawing()) {
+        checkCachedDisplayItemIsUnchanged("", *newIt, *currentIt);
+        return;
+    }
+
+    ASSERT(newIt->isSubsequence());
+
+#ifndef NDEBUG
+    CString messagePrefix = String::format("(In CachedSubsequence of %s)", newIt->clientDebugString().utf8().data()).utf8();
+#else
+    CString messagePrefix = "(In CachedSubsequence)";
+#endif
+
+    DisplayItem::Id endSubsequenceId(newIt->client(), DisplayItem::subsequenceTypeToEndSubsequenceType(newIt->type()), 0);
+    while (true) {
+        ASSERT(newIt != m_newDisplayItems.end());
+        if (newIt->isCached())
+            checkUnderInvalidation(newIt, currentIt);
+        else
+            checkCachedDisplayItemIsUnchanged(messagePrefix.data(), *newIt, *currentIt);
+
+        if (endSubsequenceId.matches(*newIt))
+            break;
+
+        ++newIt;
+        ++currentIt;
+    }
+}
+
+static void showUnderInvalidationError(const char* messagePrefix, const char* reason, const DisplayItem* newItem, const DisplayItem* oldItem)
+{
+#ifndef NDEBUG
+    WTFLogAlways("%s %s:\nNew display item: %s\nOld display item: %s\nSee http://crbug.com/450725.", messagePrefix, reason,
+        newItem ? newItem->asDebugString().utf8().data() : "None",
+        oldItem ? oldItem->asDebugString().utf8().data() : "None");
+#else
+    WTFLogAlways("%s %s. Run debug build to get more details\nSee http://crbug.com/450725.", messagePrefix, reason);
+#endif // NDEBUG
+}
+
+void PaintController::checkCachedDisplayItemIsUnchanged(const char* messagePrefix, const DisplayItem& newItem, const DisplayItem& oldItem)
+{
+    ASSERT(RuntimeEnabledFeatures::slimmingPaintUnderInvalidationCheckingEnabled());
+    ASSERT(!newItem.isCached());
+    ASSERT(!oldItem.isCached());
+
+    if (newItem.skippedCache()) {
+        showUnderInvalidationError(messagePrefix, "ERROR: under-invalidation: skipped-cache in cached subsequence", &newItem, &oldItem);
+        ASSERT_NOT_REACHED();
+    }
+
+    if (newItem.isCacheable() && !m_validlyCachedClients.contains(newItem.client())) {
+        showUnderInvalidationError(messagePrefix, "ERROR: under-invalidation: invalidated in cached subsequence", &newItem, &oldItem);
+        ASSERT_NOT_REACHED();
+    }
+
+    if (newItem.equals(oldItem))
+        return;
+
+    showUnderInvalidationError(messagePrefix, "ERROR: under-invalidation: display item changed", &newItem, &oldItem);
+
+#ifndef NDEBUG
+    if (newItem.isDrawing()) {
+        RefPtr<const SkPicture> newPicture = static_cast<const DrawingDisplayItem&>(newItem).picture();
+        RefPtr<const SkPicture> oldPicture = static_cast<const DrawingDisplayItem&>(oldItem).picture();
+        String oldPictureDebugString = oldPicture ? pictureAsDebugString(oldPicture.get()) : "None";
+        String newPictureDebugString = newPicture ? pictureAsDebugString(newPicture.get()) : "None";
+        WTFLogAlways("old picture:\n%s\n", oldPictureDebugString.utf8().data());
+        WTFLogAlways("new picture:\n%s\n", newPictureDebugString.utf8().data());
+    }
+#endif // NDEBUG
+
+    ASSERT_NOT_REACHED();
+}
+
+void PaintController::checkNoRemainingCachedDisplayItems()
+{
+    ASSERT(RuntimeEnabledFeatures::slimmingPaintUnderInvalidationCheckingEnabled());
+
+    for (const auto& displayItem : m_currentPaintArtifact.displayItems()) {
+        if (!displayItem.isValid() || !displayItem.isCacheable() || !clientCacheIsValid(displayItem.client()))
+            continue;
+        showUnderInvalidationError("", "May be under-invalidation: no new display item", nullptr, &displayItem);
+    }
+}
+
+#endif // ENABLE(ASSERT)
+
+#ifndef NDEBUG
+
+WTF::String PaintController::displayItemsAsDebugString(const DisplayItems& list) const
+{
+    StringBuilder stringBuilder;
+    size_t i = 0;
+    for (auto it = list.begin(); it != list.end(); ++it, ++i) {
+        const DisplayItem& displayItem = *it;
+        if (i)
+            stringBuilder.append(",\n");
+        stringBuilder.append(String::format("{index: %d, ", (int)i));
+        displayItem.dumpPropertiesAsDebugString(stringBuilder);
+        if (displayItem.isValid()) {
+            stringBuilder.append(", cacheIsValid: ");
+            stringBuilder.append(clientCacheIsValid(displayItem.client()) ? "true" : "false");
+        }
+        stringBuilder.append('}');
+    }
+    return stringBuilder.toString();
+}
+
+void PaintController::showDebugData() const
+{
+    WTFLogAlways("current display items: [%s]\n", displayItemsAsDebugString(m_currentPaintArtifact.displayItems()).utf8().data());
+    WTFLogAlways("new display items: [%s]\n", displayItemsAsDebugString(m_newDisplayItems).utf8().data());
+}
+
+#endif // ifndef NDEBUG
+
+} // namespace blink
diff --git a/third_party/WebKit/Source/platform/graphics/paint/PaintController.h b/third_party/WebKit/Source/platform/graphics/paint/PaintController.h
new file mode 100644
index 0000000..7231a74
--- /dev/null
+++ b/third_party/WebKit/Source/platform/graphics/paint/PaintController.h
@@ -0,0 +1,265 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef PaintController_h
+#define PaintController_h
+
+#include "platform/PlatformExport.h"
+#include "platform/RuntimeEnabledFeatures.h"
+#include "platform/geometry/IntRect.h"
+#include "platform/geometry/LayoutPoint.h"
+#include "platform/graphics/ContiguousContainer.h"
+#include "platform/graphics/PaintInvalidationReason.h"
+#include "platform/graphics/paint/DisplayItem.h"
+#include "platform/graphics/paint/DisplayItems.h"
+#include "platform/graphics/paint/PaintArtifact.h"
+#include "platform/graphics/paint/PaintChunk.h"
+#include "platform/graphics/paint/PaintChunker.h"
+#include "platform/graphics/paint/Transform3DDisplayItem.h"
+#include "wtf/Alignment.h"
+#include "wtf/HashMap.h"
+#include "wtf/PassOwnPtr.h"
+#include "wtf/Utility.h"
+#include "wtf/Vector.h"
+
+namespace blink {
+
+class GraphicsLayer;
+class GraphicsContext;
+
+static const size_t kInitialDisplayItemsCapacity = 64;
+
+// Responsible for processing display items as they are produced, and producing
+// a final paint artifact when complete. This class includes logic for caching,
+// cache invalidation, and merging.
+class PLATFORM_EXPORT PaintController {
+    WTF_MAKE_NONCOPYABLE(PaintController);
+    WTF_MAKE_FAST_ALLOCATED(PaintController);
+public:
+    static PassOwnPtr<PaintController> create()
+    {
+        return adoptPtr(new PaintController());
+    }
+
+    // These methods are called during paint invalidation (or paint if SlimmingPaintSynchronizedPainting is on).
+    void invalidate(const DisplayItemClientWrapper&, PaintInvalidationReason, const IntRect& previousPaintInvalidationRect, const IntRect& newPaintInvalidationRect);
+    void invalidateUntracked(DisplayItemClient);
+    void invalidateAll();
+
+    // Record when paint offsets change during paint.
+    void invalidatePaintOffset(const DisplayItemClientWrapper&);
+#if ENABLE(ASSERT)
+    bool paintOffsetWasInvalidated(DisplayItemClient) const;
+#endif
+
+    // These methods are called during painting.
+
+    // Provide a new set of paint chunk properties to apply to recorded display
+    // items, for Slimming Paint v2.
+    // TODO(pdr): This should be moved to PaintArtifact.
+    void updateCurrentPaintChunkProperties(const PaintChunkProperties&);
+
+    template <typename DisplayItemClass, typename... Args>
+    void createAndAppend(Args&&... args)
+    {
+        static_assert(WTF::IsSubclass<DisplayItemClass, DisplayItem>::value,
+            "Can only createAndAppend subclasses of DisplayItem.");
+        static_assert(sizeof(DisplayItemClass) <= kMaximumDisplayItemSize,
+            "DisplayItem subclass is larger than kMaximumDisplayItemSize.");
+
+        if (displayItemConstructionIsDisabled())
+            return;
+        DisplayItemClass& displayItem = m_newDisplayItems.allocateAndConstruct<DisplayItemClass>(WTF::forward<Args>(args)...);
+        processNewItem(displayItem);
+    }
+
+    // Creates and appends an ending display item to pair with a preceding
+    // beginning item iff the display item actually draws content. For no-op
+    // items, rather than creating an ending item, the begin item will
+    // instead be removed, thereby maintaining brevity of the list. If display
+    // item construction is disabled, no list mutations will be performed.
+    template <typename DisplayItemClass, typename... Args>
+    void endItem(Args&&... args)
+    {
+        if (displayItemConstructionIsDisabled())
+            return;
+        if (lastDisplayItemIsNoopBegin())
+            removeLastDisplayItem();
+        else
+            createAndAppend<DisplayItemClass>(WTF::forward<Args>(args)...);
+    }
+
+    // Scopes must be used to avoid duplicated display item ids when we paint some object
+    // multiple times and generate multiple display items with the same type.
+    // We don't cache display items added in scopes.
+    void beginScope();
+    void endScope();
+
+    // True if the last display item is a begin that doesn't draw content.
+    bool lastDisplayItemIsNoopBegin() const;
+    void removeLastDisplayItem();
+
+    void beginSkippingCache() { ++m_skippingCacheCount; }
+    void endSkippingCache() { ASSERT(m_skippingCacheCount > 0); --m_skippingCacheCount; }
+    bool skippingCache() const { return m_skippingCacheCount; }
+
+    // Must be called when a painting is finished. If passed, invalidations are recorded on the given
+    // GraphicsLayer.
+    void commitNewDisplayItems(GraphicsLayer* = 0);
+
+    // Returns the approximate memory usage, excluding memory likely to be
+    // shared with the embedder after copying to WebPaintController.
+    // Should only be called right after commitNewDisplayItems.
+    size_t approximateUnsharedMemoryUsage() const;
+
+    // Get the artifact generated after the last commit.
+    const PaintArtifact& paintArtifact() const;
+    const DisplayItems& displayItems() const { return paintArtifact().displayItems(); }
+    const Vector<PaintChunk>& paintChunks() const { return paintArtifact().paintChunks(); }
+
+    bool clientCacheIsValid(DisplayItemClient) const;
+
+    bool displayItemConstructionIsDisabled() const { return m_constructionDisabled; }
+    void setDisplayItemConstructionIsDisabled(const bool disable) { m_constructionDisabled = disable; }
+
+    bool textPainted() const { return m_textPainted; }
+    void setTextPainted() { m_textPainted = true; }
+
+    // Returns displayItems added using createAndAppend() since beginning or the last
+    // commitNewDisplayItems(). Use with care.
+    DisplayItems& newDisplayItems() { return m_newDisplayItems; }
+
+#ifndef NDEBUG
+    void showDebugData() const;
+#endif
+
+    void startTrackingPaintInvalidationObjects()
+    {
+        ASSERT(RuntimeEnabledFeatures::slimmingPaintV2Enabled());
+        m_trackedPaintInvalidationObjects = adoptPtr(new Vector<String>());
+    }
+    void stopTrackingPaintInvalidationObjects()
+    {
+        ASSERT(RuntimeEnabledFeatures::slimmingPaintV2Enabled());
+        m_trackedPaintInvalidationObjects = nullptr;
+    }
+    Vector<String> trackedPaintInvalidationObjects()
+    {
+        ASSERT(RuntimeEnabledFeatures::slimmingPaintV2Enabled());
+        return m_trackedPaintInvalidationObjects ? *m_trackedPaintInvalidationObjects : Vector<String>();
+    }
+
+    bool clientHasCheckedPaintInvalidation(DisplayItemClient client) const
+    {
+        ASSERT(RuntimeEnabledFeatures::slimmingPaintSynchronizedPaintingEnabled());
+        return m_clientsCheckedPaintInvalidation.contains(client);
+    }
+    void setClientHasCheckedPaintInvalidation(DisplayItemClient client)
+    {
+        ASSERT(RuntimeEnabledFeatures::slimmingPaintSynchronizedPaintingEnabled());
+        m_clientsCheckedPaintInvalidation.add(client);
+    }
+
+protected:
+    PaintController()
+        : m_newDisplayItems(kInitialDisplayItemsCapacity * kMaximumDisplayItemSize)
+        , m_validlyCachedClientsDirty(false)
+        , m_constructionDisabled(false)
+        , m_textPainted(false)
+        , m_skippingCacheCount(0)
+        , m_numCachedItems(0)
+        , m_nextScope(1) { }
+
+private:
+    // Set new item state (scopes, cache skipping, etc) for a new item.
+    void processNewItem(DisplayItem&);
+
+    void updateValidlyCachedClientsIfNeeded() const;
+
+    void invalidateClient(const DisplayItemClientWrapper&);
+
+#ifndef NDEBUG
+    WTF::String displayItemsAsDebugString(const DisplayItems&) const;
+#endif
+
+    // Indices into PaintList of all DrawingDisplayItems and BeginSubsequenceDisplayItems of each client.
+    // Temporarily used during merge to find out-of-order display items.
+    using DisplayItemIndicesByClientMap = HashMap<DisplayItemClient, Vector<size_t>>;
+
+    static size_t findMatchingItemFromIndex(const DisplayItem::Id&, const DisplayItemIndicesByClientMap&, const DisplayItems&);
+    static void addItemToIndexIfNeeded(const DisplayItem&, size_t index, DisplayItemIndicesByClientMap&);
+
+    struct OutOfOrderIndexContext;
+    DisplayItems::iterator findOutOfOrderCachedItem(const DisplayItem::Id&, OutOfOrderIndexContext&);
+    DisplayItems::iterator findOutOfOrderCachedItemForward(const DisplayItem::Id&, OutOfOrderIndexContext&);
+    void copyCachedSubsequence(DisplayItems::iterator& currentIt, DisplayItems& updatedList);
+
+#if ENABLE(ASSERT)
+    // The following two methods are for checking under-invalidations
+    // (when RuntimeEnabledFeatures::slimmingPaintUnderInvalidationCheckingEnabled).
+    void checkUnderInvalidation(DisplayItems::iterator& newIt, DisplayItems::iterator& currentIt);
+    void checkCachedDisplayItemIsUnchanged(const char* messagePrefix, const DisplayItem& newItem, const DisplayItem& oldItem);
+    void checkNoRemainingCachedDisplayItems();
+#endif
+
+    // The last complete paint artifact.
+    // In SPv2, this includes paint chunks as well as display items.
+    PaintArtifact m_currentPaintArtifact;
+
+    // Data being used to build the next paint artifact.
+    DisplayItems m_newDisplayItems;
+    PaintChunker m_newPaintChunks;
+
+    // Contains all clients having valid cached paintings if updated.
+    // It's lazily updated in updateValidlyCachedClientsIfNeeded().
+    // TODO(wangxianzhu): In the future we can replace this with client-side repaint flags
+    // to avoid the cost of building and querying the hash table.
+    mutable HashSet<DisplayItemClient> m_validlyCachedClients;
+    mutable bool m_validlyCachedClientsDirty;
+
+    // Used during painting. Contains clients that have checked paint invalidation and
+    // are known to be valid.
+    // TODO(wangxianzhu): Use client side flag to avoid const of hash table.
+    HashSet<DisplayItemClient> m_clientsCheckedPaintInvalidation;
+
+#if ENABLE(ASSERT)
+    // Set of clients which had paint offset changes since the last commit. This is used for
+    // ensuring paint offsets are only updated once and are the same in all phases.
+    HashSet<DisplayItemClient> m_clientsWithPaintOffsetInvalidations;
+#endif
+
+    // Allow display item construction to be disabled to isolate the costs of construction
+    // in performance metrics.
+    bool m_constructionDisabled;
+
+    // Indicates this PaintController has ever had text. It is never reset to false.
+    bool m_textPainted;
+
+    int m_skippingCacheCount;
+
+    int m_numCachedItems;
+
+    unsigned m_nextScope;
+    Vector<unsigned> m_scopeStack;
+
+    struct Invalidation {
+        IntRect rect;
+        PaintInvalidationReason invalidationReason;
+    };
+
+    Vector<Invalidation> m_invalidations;
+
+#if ENABLE(ASSERT)
+    // This is used to check duplicated ids during add(). We could also check during
+    // updatePaintList(), but checking during add() helps developer easily find where
+    // the duplicated ids are from.
+    DisplayItemIndicesByClientMap m_newDisplayItemIndicesByClient;
+#endif
+
+    OwnPtr<Vector<String>> m_trackedPaintInvalidationObjects;
+};
+
+} // namespace blink
+
+#endif // PaintController_h
diff --git a/third_party/WebKit/Source/platform/graphics/paint/PaintControllerTest.cpp b/third_party/WebKit/Source/platform/graphics/paint/PaintControllerTest.cpp
new file mode 100644
index 0000000..b4e0c30
--- /dev/null
+++ b/third_party/WebKit/Source/platform/graphics/paint/PaintControllerTest.cpp
@@ -0,0 +1,793 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "config.h"
+#include "platform/graphics/paint/PaintController.h"
+
+#include "platform/RuntimeEnabledFeatures.h"
+#include "platform/graphics/GraphicsContext.h"
+#include "platform/graphics/paint/CachedDisplayItem.h"
+#include "platform/graphics/paint/ClipPathRecorder.h"
+#include "platform/graphics/paint/ClipRecorder.h"
+#include "platform/graphics/paint/DrawingDisplayItem.h"
+#include "platform/graphics/paint/DrawingRecorder.h"
+#include "platform/graphics/paint/SubsequenceRecorder.h"
+#include <gtest/gtest.h>
+
+namespace blink {
+
+class PaintControllerTest : public ::testing::Test {
+public:
+    PaintControllerTest()
+        : m_paintController(PaintController::create())
+        , m_originalSlimmingPaintSubsequenceCachingEnabled(RuntimeEnabledFeatures::slimmingPaintSubsequenceCachingEnabled())
+        , m_originalSlimmingPaintV2Enabled(RuntimeEnabledFeatures::slimmingPaintV2Enabled()) { }
+
+protected:
+    PaintController& paintController() { return *m_paintController; }
+
+private:
+    void TearDown() override
+    {
+        RuntimeEnabledFeatures::setSlimmingPaintSubsequenceCachingEnabled(m_originalSlimmingPaintSubsequenceCachingEnabled);
+        RuntimeEnabledFeatures::setSlimmingPaintV2Enabled(m_originalSlimmingPaintV2Enabled);
+    }
+
+    OwnPtr<PaintController> m_paintController;
+    bool m_originalSlimmingPaintSubsequenceCachingEnabled;
+    bool m_originalSlimmingPaintV2Enabled;
+};
+
+const DisplayItem::Type foregroundDrawingType = static_cast<DisplayItem::Type>(DisplayItem::DrawingPaintPhaseFirst + 4);
+const DisplayItem::Type backgroundDrawingType = DisplayItem::DrawingPaintPhaseFirst;
+const DisplayItem::Type clipType = DisplayItem::ClipFirst;
+const DisplayItem::Type subsequenceType = DisplayItem::SubsequenceNormalFlowAndPositiveZOrder;
+const DisplayItem::Type endSubsequenceType = DisplayItem::subsequenceTypeToEndSubsequenceType(subsequenceType);
+const DisplayItem::Type cachedSubsequenceType = DisplayItem::subsequenceTypeToCachedSubsequenceType(subsequenceType);
+
+class TestDisplayItemClient {
+public:
+    TestDisplayItemClient(const String& name)
+        : m_name(name)
+    { }
+
+    DisplayItemClient displayItemClient() const { return toDisplayItemClient(this); }
+    String debugName() const { return m_name; }
+
+private:
+    String m_name;
+};
+
+class TestDisplayItem final : public DisplayItem {
+public:
+    TestDisplayItem(const TestDisplayItemClient& client, Type type) : DisplayItem(client, type, sizeof(*this)) { }
+
+    void replay(GraphicsContext&) const final { ASSERT_NOT_REACHED(); }
+    void appendToWebDisplayItemList(WebDisplayItemList*) const final { ASSERT_NOT_REACHED(); }
+};
+
+#ifndef NDEBUG
+#define TRACE_DISPLAY_ITEMS(i, expected, actual) \
+    String trace = String::format("%d: ", (int)i) + "Expected: " + (expected).asDebugString() + " Actual: " + (actual).asDebugString(); \
+    SCOPED_TRACE(trace.utf8().data());
+#else
+#define TRACE_DISPLAY_ITEMS(i, expected, actual)
+#endif
+
+#define EXPECT_DISPLAY_LIST(actual, expectedSize, ...) \
+    do { \
+        EXPECT_EQ((size_t)expectedSize, actual.size()); \
+        if (expectedSize != actual.size()) \
+            break; \
+        const TestDisplayItem expected[] = { __VA_ARGS__ }; \
+        for (size_t index = 0; index < std::min<size_t>(actual.size(), expectedSize); index++) { \
+            TRACE_DISPLAY_ITEMS(index, expected[index], actual[index]); \
+            EXPECT_EQ(expected[index].client(), actual[index].client()); \
+            EXPECT_EQ(expected[index].type(), actual[index].type()); \
+        } \
+    } while (false);
+
+void drawRect(GraphicsContext& context, const TestDisplayItemClient& client, DisplayItem::Type type, const FloatRect& bounds)
+{
+    if (DrawingRecorder::useCachedDrawingIfPossible(context, client, type))
+        return;
+    DrawingRecorder drawingRecorder(context, client, type, bounds);
+    IntRect rect(0, 0, 10, 10);
+    context.drawRect(rect);
+}
+
+void drawClippedRect(GraphicsContext& context, const TestDisplayItemClient& client, DisplayItem::Type clipType, DisplayItem::Type drawingType, const FloatRect& bound)
+{
+    ClipRecorder clipRecorder(context, client, clipType, LayoutRect(1, 1, 9, 9));
+    drawRect(context, client, drawingType, bound);
+}
+
+TEST_F(PaintControllerTest, NestedRecorders)
+{
+    GraphicsContext context(&paintController());
+
+    TestDisplayItemClient client("client");
+
+    drawClippedRect(context, client, clipType, backgroundDrawingType, FloatRect(100, 100, 200, 200));
+    paintController().commitNewDisplayItems();
+
+    EXPECT_DISPLAY_LIST(paintController().displayItems(), 3,
+        TestDisplayItem(client, clipType),
+        TestDisplayItem(client, backgroundDrawingType),
+        TestDisplayItem(client, DisplayItem::clipTypeToEndClipType(clipType)));
+}
+
+TEST_F(PaintControllerTest, UpdateBasic)
+{
+    TestDisplayItemClient first("first");
+    TestDisplayItemClient second("second");
+    GraphicsContext context(&paintController());
+
+    drawRect(context, first, backgroundDrawingType, FloatRect(100, 100, 300, 300));
+    drawRect(context, second, backgroundDrawingType, FloatRect(100, 100, 200, 200));
+    drawRect(context, first, foregroundDrawingType, FloatRect(100, 100, 300, 300));
+    paintController().commitNewDisplayItems();
+
+    EXPECT_DISPLAY_LIST(paintController().displayItems(), 3,
+        TestDisplayItem(first, backgroundDrawingType),
+        TestDisplayItem(second, backgroundDrawingType),
+        TestDisplayItem(first, foregroundDrawingType));
+
+    paintController().invalidate(second, PaintInvalidationFull, IntRect(), IntRect());
+    drawRect(context, first, backgroundDrawingType, FloatRect(100, 100, 300, 300));
+    drawRect(context, first, foregroundDrawingType, FloatRect(100, 100, 300, 300));
+    paintController().commitNewDisplayItems();
+
+    EXPECT_DISPLAY_LIST(paintController().displayItems(), 2,
+        TestDisplayItem(first, backgroundDrawingType),
+        TestDisplayItem(first, foregroundDrawingType));
+}
+
+TEST_F(PaintControllerTest, UpdateSwapOrder)
+{
+    TestDisplayItemClient first("first");
+    TestDisplayItemClient second("second");
+    TestDisplayItemClient unaffected("unaffected");
+    GraphicsContext context(&paintController());
+
+    drawRect(context, first, backgroundDrawingType, FloatRect(100, 100, 100, 100));
+    drawRect(context, second, backgroundDrawingType, FloatRect(100, 100, 50, 200));
+    drawRect(context, unaffected, backgroundDrawingType, FloatRect(300, 300, 10, 10));
+    paintController().commitNewDisplayItems();
+
+    EXPECT_DISPLAY_LIST(paintController().displayItems(), 3,
+        TestDisplayItem(first, backgroundDrawingType),
+        TestDisplayItem(second, backgroundDrawingType),
+        TestDisplayItem(unaffected, backgroundDrawingType));
+
+    paintController().invalidate(second, PaintInvalidationFull, IntRect(), IntRect());
+    drawRect(context, second, backgroundDrawingType, FloatRect(100, 100, 50, 200));
+    drawRect(context, first, backgroundDrawingType, FloatRect(100, 100, 100, 100));
+    drawRect(context, unaffected, backgroundDrawingType, FloatRect(300, 300, 10, 10));
+    paintController().commitNewDisplayItems();
+
+    EXPECT_DISPLAY_LIST(paintController().displayItems(), 3,
+        TestDisplayItem(second, backgroundDrawingType),
+        TestDisplayItem(first, backgroundDrawingType),
+        TestDisplayItem(unaffected, backgroundDrawingType));
+}
+
+TEST_F(PaintControllerTest, UpdateNewItemInMiddle)
+{
+    TestDisplayItemClient first("first");
+    TestDisplayItemClient second("second");
+    TestDisplayItemClient third("third");
+    GraphicsContext context(&paintController());
+
+    drawRect(context, first, backgroundDrawingType, FloatRect(100, 100, 100, 100));
+    drawRect(context, second, backgroundDrawingType, FloatRect(100, 100, 50, 200));
+    paintController().commitNewDisplayItems();
+
+    EXPECT_DISPLAY_LIST(paintController().displayItems(), 2,
+        TestDisplayItem(first, backgroundDrawingType),
+        TestDisplayItem(second, backgroundDrawingType));
+
+    drawRect(context, first, backgroundDrawingType, FloatRect(100, 100, 100, 100));
+    drawRect(context, third, backgroundDrawingType, FloatRect(125, 100, 200, 50));
+    drawRect(context, second, backgroundDrawingType, FloatRect(100, 100, 50, 200));
+    paintController().commitNewDisplayItems();
+
+    EXPECT_DISPLAY_LIST(paintController().displayItems(), 3,
+        TestDisplayItem(first, backgroundDrawingType),
+        TestDisplayItem(third, backgroundDrawingType),
+        TestDisplayItem(second, backgroundDrawingType));
+}
+
+TEST_F(PaintControllerTest, UpdateInvalidationWithPhases)
+{
+    TestDisplayItemClient first("first");
+    TestDisplayItemClient second("second");
+    TestDisplayItemClient third("third");
+    GraphicsContext context(&paintController());
+
+    drawRect(context, first, backgroundDrawingType, FloatRect(100, 100, 100, 100));
+    drawRect(context, second, backgroundDrawingType, FloatRect(100, 100, 50, 200));
+    drawRect(context, third, backgroundDrawingType, FloatRect(300, 100, 50, 50));
+    drawRect(context, first, foregroundDrawingType, FloatRect(100, 100, 100, 100));
+    drawRect(context, second, foregroundDrawingType, FloatRect(100, 100, 50, 200));
+    drawRect(context, third, foregroundDrawingType, FloatRect(300, 100, 50, 50));
+    paintController().commitNewDisplayItems();
+
+    EXPECT_DISPLAY_LIST(paintController().displayItems(), 6,
+        TestDisplayItem(first, backgroundDrawingType),
+        TestDisplayItem(second, backgroundDrawingType),
+        TestDisplayItem(third, backgroundDrawingType),
+        TestDisplayItem(first, foregroundDrawingType),
+        TestDisplayItem(second, foregroundDrawingType),
+        TestDisplayItem(third, foregroundDrawingType));
+
+    paintController().invalidate(second, PaintInvalidationFull, IntRect(), IntRect());
+    drawRect(context, first, backgroundDrawingType, FloatRect(100, 100, 100, 100));
+    drawRect(context, second, backgroundDrawingType, FloatRect(100, 100, 50, 200));
+    drawRect(context, third, backgroundDrawingType, FloatRect(300, 100, 50, 50));
+    drawRect(context, first, foregroundDrawingType, FloatRect(100, 100, 100, 100));
+    drawRect(context, second, foregroundDrawingType, FloatRect(100, 100, 50, 200));
+    drawRect(context, third, foregroundDrawingType, FloatRect(300, 100, 50, 50));
+    paintController().commitNewDisplayItems();
+
+    EXPECT_DISPLAY_LIST(paintController().displayItems(), 6,
+        TestDisplayItem(first, backgroundDrawingType),
+        TestDisplayItem(second, backgroundDrawingType),
+        TestDisplayItem(third, backgroundDrawingType),
+        TestDisplayItem(first, foregroundDrawingType),
+        TestDisplayItem(second, foregroundDrawingType),
+        TestDisplayItem(third, foregroundDrawingType));
+}
+
+TEST_F(PaintControllerTest, UpdateAddFirstOverlap)
+{
+    TestDisplayItemClient first("first");
+    TestDisplayItemClient second("second");
+    GraphicsContext context(&paintController());
+
+    drawRect(context, second, backgroundDrawingType, FloatRect(200, 200, 50, 50));
+    drawRect(context, second, foregroundDrawingType, FloatRect(200, 200, 50, 50));
+    paintController().commitNewDisplayItems();
+
+    EXPECT_DISPLAY_LIST(paintController().displayItems(), 2,
+        TestDisplayItem(second, backgroundDrawingType),
+        TestDisplayItem(second, foregroundDrawingType));
+
+    paintController().invalidate(first, PaintInvalidationFull, IntRect(), IntRect());
+    paintController().invalidate(second, PaintInvalidationFull, IntRect(), IntRect());
+    drawRect(context, first, backgroundDrawingType, FloatRect(100, 100, 150, 150));
+    drawRect(context, first, foregroundDrawingType, FloatRect(100, 100, 150, 150));
+    drawRect(context, second, backgroundDrawingType, FloatRect(200, 200, 50, 50));
+    drawRect(context, second, foregroundDrawingType, FloatRect(200, 200, 50, 50));
+    paintController().commitNewDisplayItems();
+
+    EXPECT_DISPLAY_LIST(paintController().displayItems(), 4,
+        TestDisplayItem(first, backgroundDrawingType),
+        TestDisplayItem(first, foregroundDrawingType),
+        TestDisplayItem(second, backgroundDrawingType),
+        TestDisplayItem(second, foregroundDrawingType));
+
+    paintController().invalidate(first, PaintInvalidationFull, IntRect(), IntRect());
+    drawRect(context, second, backgroundDrawingType, FloatRect(200, 200, 50, 50));
+    drawRect(context, second, foregroundDrawingType, FloatRect(200, 200, 50, 50));
+    paintController().commitNewDisplayItems();
+
+    EXPECT_DISPLAY_LIST(paintController().displayItems(), 2,
+        TestDisplayItem(second, backgroundDrawingType),
+        TestDisplayItem(second, foregroundDrawingType));
+}
+
+TEST_F(PaintControllerTest, UpdateAddLastOverlap)
+{
+    TestDisplayItemClient first("first");
+    TestDisplayItemClient second("second");
+    GraphicsContext context(&paintController());
+
+    drawRect(context, first, backgroundDrawingType, FloatRect(100, 100, 150, 150));
+    drawRect(context, first, foregroundDrawingType, FloatRect(100, 100, 150, 150));
+    paintController().commitNewDisplayItems();
+
+    EXPECT_DISPLAY_LIST(paintController().displayItems(), 2,
+        TestDisplayItem(first, backgroundDrawingType),
+        TestDisplayItem(first, foregroundDrawingType));
+
+    paintController().invalidate(first, PaintInvalidationFull, IntRect(), IntRect());
+    paintController().invalidate(second, PaintInvalidationFull, IntRect(), IntRect());
+    drawRect(context, first, backgroundDrawingType, FloatRect(100, 100, 150, 150));
+    drawRect(context, first, foregroundDrawingType, FloatRect(100, 100, 150, 150));
+    drawRect(context, second, backgroundDrawingType, FloatRect(200, 200, 50, 50));
+    drawRect(context, second, foregroundDrawingType, FloatRect(200, 200, 50, 50));
+    paintController().commitNewDisplayItems();
+
+    EXPECT_DISPLAY_LIST(paintController().displayItems(), 4,
+        TestDisplayItem(first, backgroundDrawingType),
+        TestDisplayItem(first, foregroundDrawingType),
+        TestDisplayItem(second, backgroundDrawingType),
+        TestDisplayItem(second, foregroundDrawingType));
+
+    paintController().invalidate(first, PaintInvalidationFull, IntRect(), IntRect());
+    paintController().invalidate(second, PaintInvalidationFull, IntRect(), IntRect());
+    drawRect(context, first, backgroundDrawingType, FloatRect(100, 100, 150, 150));
+    drawRect(context, first, foregroundDrawingType, FloatRect(100, 100, 150, 150));
+    paintController().commitNewDisplayItems();
+
+    EXPECT_DISPLAY_LIST(paintController().displayItems(), 2,
+        TestDisplayItem(first, backgroundDrawingType),
+        TestDisplayItem(first, foregroundDrawingType));
+}
+
+TEST_F(PaintControllerTest, UpdateClip)
+{
+    TestDisplayItemClient first("first");
+    TestDisplayItemClient second("second");
+    GraphicsContext context(&paintController());
+
+    {
+        ClipRecorder clipRecorder(context, first, clipType, LayoutRect(1, 1, 2, 2));
+        drawRect(context, first, backgroundDrawingType, FloatRect(100, 100, 150, 150));
+        drawRect(context, second, backgroundDrawingType, FloatRect(100, 100, 150, 150));
+    }
+    paintController().commitNewDisplayItems();
+
+    EXPECT_DISPLAY_LIST(paintController().displayItems(), 4,
+        TestDisplayItem(first, clipType),
+        TestDisplayItem(first, backgroundDrawingType),
+        TestDisplayItem(second, backgroundDrawingType),
+        TestDisplayItem(first, DisplayItem::clipTypeToEndClipType(clipType)));
+
+    paintController().invalidate(first, PaintInvalidationFull, IntRect(), IntRect());
+    drawRect(context, first, backgroundDrawingType, FloatRect(100, 100, 150, 150));
+    drawRect(context, second, backgroundDrawingType, FloatRect(100, 100, 150, 150));
+    paintController().commitNewDisplayItems();
+
+    EXPECT_DISPLAY_LIST(paintController().displayItems(), 2,
+        TestDisplayItem(first, backgroundDrawingType),
+        TestDisplayItem(second, backgroundDrawingType));
+
+    paintController().invalidate(second, PaintInvalidationFull, IntRect(), IntRect());
+    drawRect(context, first, backgroundDrawingType, FloatRect(100, 100, 150, 150));
+    {
+        ClipRecorder clipRecorder(context, second, clipType, LayoutRect(1, 1, 2, 2));
+        drawRect(context, second, backgroundDrawingType, FloatRect(100, 100, 150, 150));
+    }
+    paintController().commitNewDisplayItems();
+
+    EXPECT_DISPLAY_LIST(paintController().displayItems(), 4,
+        TestDisplayItem(first, backgroundDrawingType),
+        TestDisplayItem(second, clipType),
+        TestDisplayItem(second, backgroundDrawingType),
+        TestDisplayItem(second, DisplayItem::clipTypeToEndClipType(clipType)));
+}
+
+TEST_F(PaintControllerTest, CachedDisplayItems)
+{
+    TestDisplayItemClient first("first");
+    TestDisplayItemClient second("second");
+    GraphicsContext context(&paintController());
+
+    drawRect(context, first, backgroundDrawingType, FloatRect(100, 100, 150, 150));
+    drawRect(context, second, backgroundDrawingType, FloatRect(100, 100, 150, 150));
+    paintController().commitNewDisplayItems();
+
+    EXPECT_DISPLAY_LIST(paintController().displayItems(), 2,
+        TestDisplayItem(first, backgroundDrawingType),
+        TestDisplayItem(second, backgroundDrawingType));
+    EXPECT_TRUE(paintController().clientCacheIsValid(first.displayItemClient()));
+    EXPECT_TRUE(paintController().clientCacheIsValid(second.displayItemClient()));
+    const SkPicture* firstPicture = static_cast<const DrawingDisplayItem&>(paintController().displayItems()[0]).picture();
+    const SkPicture* secondPicture = static_cast<const DrawingDisplayItem&>(paintController().displayItems()[1]).picture();
+
+    paintController().invalidate(first, PaintInvalidationFull, IntRect(), IntRect());
+    EXPECT_FALSE(paintController().clientCacheIsValid(first.displayItemClient()));
+    EXPECT_TRUE(paintController().clientCacheIsValid(second.displayItemClient()));
+
+    drawRect(context, first, backgroundDrawingType, FloatRect(100, 100, 150, 150));
+    drawRect(context, second, backgroundDrawingType, FloatRect(100, 100, 150, 150));
+    paintController().commitNewDisplayItems();
+
+    EXPECT_DISPLAY_LIST(paintController().displayItems(), 2,
+        TestDisplayItem(first, backgroundDrawingType),
+        TestDisplayItem(second, backgroundDrawingType));
+    // The first display item should be updated.
+    EXPECT_NE(firstPicture, static_cast<const DrawingDisplayItem&>(paintController().displayItems()[0]).picture());
+    // The second display item should be cached.
+    EXPECT_EQ(secondPicture, static_cast<const DrawingDisplayItem&>(paintController().displayItems()[1]).picture());
+    EXPECT_TRUE(paintController().clientCacheIsValid(first.displayItemClient()));
+    EXPECT_TRUE(paintController().clientCacheIsValid(second.displayItemClient()));
+
+    paintController().invalidateAll();
+    EXPECT_FALSE(paintController().clientCacheIsValid(first.displayItemClient()));
+    EXPECT_FALSE(paintController().clientCacheIsValid(second.displayItemClient()));
+}
+
+TEST_F(PaintControllerTest, ComplexUpdateSwapOrder)
+{
+    TestDisplayItemClient container1("container1");
+    TestDisplayItemClient content1("content1");
+    TestDisplayItemClient container2("container2");
+    TestDisplayItemClient content2("content2");
+    GraphicsContext context(&paintController());
+
+    drawRect(context, container1, backgroundDrawingType, FloatRect(100, 100, 100, 100));
+    drawRect(context, content1, backgroundDrawingType, FloatRect(100, 100, 50, 200));
+    drawRect(context, content1, foregroundDrawingType, FloatRect(100, 100, 50, 200));
+    drawRect(context, container1, foregroundDrawingType, FloatRect(100, 100, 100, 100));
+    drawRect(context, container2, backgroundDrawingType, FloatRect(100, 200, 100, 100));
+    drawRect(context, content2, backgroundDrawingType, FloatRect(100, 200, 50, 200));
+    drawRect(context, content2, foregroundDrawingType, FloatRect(100, 200, 50, 200));
+    drawRect(context, container2, foregroundDrawingType, FloatRect(100, 200, 100, 100));
+    paintController().commitNewDisplayItems();
+
+    EXPECT_DISPLAY_LIST(paintController().displayItems(), 8,
+        TestDisplayItem(container1, backgroundDrawingType),
+        TestDisplayItem(content1, backgroundDrawingType),
+        TestDisplayItem(content1, foregroundDrawingType),
+        TestDisplayItem(container1, foregroundDrawingType),
+        TestDisplayItem(container2, backgroundDrawingType),
+        TestDisplayItem(content2, backgroundDrawingType),
+        TestDisplayItem(content2, foregroundDrawingType),
+        TestDisplayItem(container2, foregroundDrawingType));
+
+    // Simulate the situation when container1 e.g. gets a z-index that is now greater than container2.
+    paintController().invalidate(container1, PaintInvalidationFull, IntRect(), IntRect());
+    drawRect(context, container2, backgroundDrawingType, FloatRect(100, 200, 100, 100));
+    drawRect(context, content2, backgroundDrawingType, FloatRect(100, 200, 50, 200));
+    drawRect(context, content2, foregroundDrawingType, FloatRect(100, 200, 50, 200));
+    drawRect(context, container2, foregroundDrawingType, FloatRect(100, 200, 100, 100));
+    drawRect(context, container1, backgroundDrawingType, FloatRect(100, 100, 100, 100));
+    drawRect(context, content1, backgroundDrawingType, FloatRect(100, 100, 50, 200));
+    drawRect(context, content1, foregroundDrawingType, FloatRect(100, 100, 50, 200));
+    drawRect(context, container1, foregroundDrawingType, FloatRect(100, 100, 100, 100));
+    paintController().commitNewDisplayItems();
+
+    EXPECT_DISPLAY_LIST(paintController().displayItems(), 8,
+        TestDisplayItem(container2, backgroundDrawingType),
+        TestDisplayItem(content2, backgroundDrawingType),
+        TestDisplayItem(content2, foregroundDrawingType),
+        TestDisplayItem(container2, foregroundDrawingType),
+        TestDisplayItem(container1, backgroundDrawingType),
+        TestDisplayItem(content1, backgroundDrawingType),
+        TestDisplayItem(content1, foregroundDrawingType),
+        TestDisplayItem(container1, foregroundDrawingType));
+}
+
+TEST_F(PaintControllerTest, CachedSubsequenceSwapOrder)
+{
+    RuntimeEnabledFeatures::setSlimmingPaintSubsequenceCachingEnabled(true);
+
+    TestDisplayItemClient container1("container1");
+    TestDisplayItemClient content1("content1");
+    TestDisplayItemClient container2("container2");
+    TestDisplayItemClient content2("content2");
+    GraphicsContext context(&paintController());
+
+    {
+        SubsequenceRecorder r(context, container1, subsequenceType);
+        drawRect(context, container1, backgroundDrawingType, FloatRect(100, 100, 100, 100));
+        drawRect(context, content1, backgroundDrawingType, FloatRect(100, 100, 50, 200));
+        drawRect(context, content1, foregroundDrawingType, FloatRect(100, 100, 50, 200));
+        drawRect(context, container1, foregroundDrawingType, FloatRect(100, 100, 100, 100));
+    }
+    {
+        SubsequenceRecorder r(context, container2, subsequenceType);
+        drawRect(context, container2, backgroundDrawingType, FloatRect(100, 200, 100, 100));
+        drawRect(context, content2, backgroundDrawingType, FloatRect(100, 200, 50, 200));
+        drawRect(context, content2, foregroundDrawingType, FloatRect(100, 200, 50, 200));
+        drawRect(context, container2, foregroundDrawingType, FloatRect(100, 200, 100, 100));
+    }
+    paintController().commitNewDisplayItems();
+
+    EXPECT_DISPLAY_LIST(paintController().displayItems(), 12,
+        TestDisplayItem(container1, subsequenceType),
+        TestDisplayItem(container1, backgroundDrawingType),
+        TestDisplayItem(content1, backgroundDrawingType),
+        TestDisplayItem(content1, foregroundDrawingType),
+        TestDisplayItem(container1, foregroundDrawingType),
+        TestDisplayItem(container1, endSubsequenceType),
+
+        TestDisplayItem(container2, subsequenceType),
+        TestDisplayItem(container2, backgroundDrawingType),
+        TestDisplayItem(content2, backgroundDrawingType),
+        TestDisplayItem(content2, foregroundDrawingType),
+        TestDisplayItem(container2, foregroundDrawingType),
+        TestDisplayItem(container2, endSubsequenceType));
+
+    // Simulate the situation when container1 e.g. gets a z-index that is now greater than container2.
+    EXPECT_TRUE(SubsequenceRecorder::useCachedSubsequenceIfPossible(context, container2, subsequenceType));
+    EXPECT_TRUE(SubsequenceRecorder::useCachedSubsequenceIfPossible(context, container1, subsequenceType));
+
+    EXPECT_DISPLAY_LIST(paintController().newDisplayItems(), 2,
+        TestDisplayItem(container2, cachedSubsequenceType),
+        TestDisplayItem(container1, cachedSubsequenceType));
+
+    paintController().commitNewDisplayItems();
+
+    EXPECT_DISPLAY_LIST(paintController().displayItems(), 12,
+        TestDisplayItem(container2, subsequenceType),
+        TestDisplayItem(container2, backgroundDrawingType),
+        TestDisplayItem(content2, backgroundDrawingType),
+        TestDisplayItem(content2, foregroundDrawingType),
+        TestDisplayItem(container2, foregroundDrawingType),
+        TestDisplayItem(container2, endSubsequenceType),
+
+        TestDisplayItem(container1, subsequenceType),
+        TestDisplayItem(container1, backgroundDrawingType),
+        TestDisplayItem(content1, backgroundDrawingType),
+        TestDisplayItem(content1, foregroundDrawingType),
+        TestDisplayItem(container1, foregroundDrawingType),
+        TestDisplayItem(container1, endSubsequenceType));
+}
+
+TEST_F(PaintControllerTest, OutOfOrderNoCrash)
+{
+    TestDisplayItemClient client("client");
+    GraphicsContext context(&paintController());
+
+    const DisplayItem::Type type1 = DisplayItem::DrawingFirst;
+    const DisplayItem::Type type2 = static_cast<DisplayItem::Type>(DisplayItem::DrawingFirst + 1);
+    const DisplayItem::Type type3 = static_cast<DisplayItem::Type>(DisplayItem::DrawingFirst + 2);
+    const DisplayItem::Type type4 = static_cast<DisplayItem::Type>(DisplayItem::DrawingFirst + 3);
+
+    drawRect(context, client, type1, FloatRect(100, 100, 100, 100));
+    drawRect(context, client, type2, FloatRect(100, 100, 50, 200));
+    drawRect(context, client, type3, FloatRect(100, 100, 50, 200));
+    drawRect(context, client, type4, FloatRect(100, 100, 100, 100));
+
+    paintController().commitNewDisplayItems();
+
+    drawRect(context, client, type2, FloatRect(100, 100, 50, 200));
+    drawRect(context, client, type3, FloatRect(100, 100, 50, 200));
+    drawRect(context, client, type1, FloatRect(100, 100, 100, 100));
+    drawRect(context, client, type4, FloatRect(100, 100, 100, 100));
+
+    paintController().commitNewDisplayItems();
+}
+
+TEST_F(PaintControllerTest, CachedNestedSubsequenceUpdate)
+{
+    RuntimeEnabledFeatures::setSlimmingPaintSubsequenceCachingEnabled(true);
+
+    TestDisplayItemClient container1("container1");
+    TestDisplayItemClient content1("content1");
+    TestDisplayItemClient container2("container2");
+    TestDisplayItemClient content2("content2");
+    GraphicsContext context(&paintController());
+
+    {
+        SubsequenceRecorder r(context, container1, subsequenceType);
+        drawRect(context, container1, backgroundDrawingType, FloatRect(100, 100, 100, 100));
+        {
+            SubsequenceRecorder r(context, content1, subsequenceType);
+            drawRect(context, content1, backgroundDrawingType, FloatRect(100, 100, 50, 200));
+            drawRect(context, content1, foregroundDrawingType, FloatRect(100, 100, 50, 200));
+        }
+        drawRect(context, container1, foregroundDrawingType, FloatRect(100, 100, 100, 100));
+    }
+    {
+        SubsequenceRecorder r(context, container2, subsequenceType);
+        drawRect(context, container2, backgroundDrawingType, FloatRect(100, 200, 100, 100));
+        {
+            SubsequenceRecorder r(context, content2, subsequenceType);
+            drawRect(context, content2, backgroundDrawingType, FloatRect(100, 200, 50, 200));
+        }
+    }
+    paintController().commitNewDisplayItems();
+
+    EXPECT_DISPLAY_LIST(paintController().displayItems(), 14,
+        TestDisplayItem(container1, subsequenceType),
+        TestDisplayItem(container1, backgroundDrawingType),
+        TestDisplayItem(content1, subsequenceType),
+        TestDisplayItem(content1, backgroundDrawingType),
+        TestDisplayItem(content1, foregroundDrawingType),
+        TestDisplayItem(content1, endSubsequenceType),
+        TestDisplayItem(container1, foregroundDrawingType),
+        TestDisplayItem(container1, endSubsequenceType),
+
+        TestDisplayItem(container2, subsequenceType),
+        TestDisplayItem(container2, backgroundDrawingType),
+        TestDisplayItem(content2, subsequenceType),
+        TestDisplayItem(content2, backgroundDrawingType),
+        TestDisplayItem(content2, endSubsequenceType),
+        TestDisplayItem(container2, endSubsequenceType));
+
+    // Invalidate container1 but not content1.
+    paintController().invalidate(container1, PaintInvalidationFull, IntRect(), IntRect());
+
+    // Container2 itself now becomes empty (but still has the 'content2' child),
+    // and chooses not to output subsequence info.
+
+    paintController().invalidate(container2, PaintInvalidationFull, IntRect(), IntRect());
+    paintController().invalidate(content2, PaintInvalidationFull, IntRect(), IntRect());
+    EXPECT_FALSE(SubsequenceRecorder::useCachedSubsequenceIfPossible(context, container2, subsequenceType));
+    EXPECT_FALSE(SubsequenceRecorder::useCachedSubsequenceIfPossible(context, content2, subsequenceType));
+    // Content2 now outputs foreground only.
+    {
+        SubsequenceRecorder r(context, content2, subsequenceType);
+        drawRect(context, content2, foregroundDrawingType, FloatRect(100, 200, 50, 200));
+    }
+    // Repaint container1 with foreground only.
+    {
+        EXPECT_FALSE(SubsequenceRecorder::useCachedSubsequenceIfPossible(context, container1, subsequenceType));
+        SubsequenceRecorder r(context, container1, subsequenceType);
+        // Use cached subsequence of content1.
+        EXPECT_TRUE(SubsequenceRecorder::useCachedSubsequenceIfPossible(context, content1, subsequenceType));
+        drawRect(context, container1, foregroundDrawingType, FloatRect(100, 100, 100, 100));
+    }
+    EXPECT_DISPLAY_LIST(paintController().newDisplayItems(), 7,
+        TestDisplayItem(content2, subsequenceType),
+        TestDisplayItem(content2, foregroundDrawingType),
+        TestDisplayItem(content2, endSubsequenceType),
+        TestDisplayItem(container1, subsequenceType),
+        TestDisplayItem(content1, cachedSubsequenceType),
+        TestDisplayItem(container1, foregroundDrawingType),
+        TestDisplayItem(container1, endSubsequenceType));
+
+    paintController().commitNewDisplayItems();
+
+    EXPECT_DISPLAY_LIST(paintController().displayItems(), 10,
+        TestDisplayItem(content2, subsequenceType),
+        TestDisplayItem(content2, foregroundDrawingType),
+        TestDisplayItem(content2, endSubsequenceType),
+
+        TestDisplayItem(container1, subsequenceType),
+        TestDisplayItem(content1, subsequenceType),
+        TestDisplayItem(content1, backgroundDrawingType),
+        TestDisplayItem(content1, foregroundDrawingType),
+        TestDisplayItem(content1, endSubsequenceType),
+        TestDisplayItem(container1, foregroundDrawingType),
+        TestDisplayItem(container1, endSubsequenceType));
+}
+
+TEST_F(PaintControllerTest, Scope)
+{
+    TestDisplayItemClient multicol("multicol");
+    TestDisplayItemClient content("content");
+    GraphicsContext context(&paintController());
+
+    FloatRect rect1(100, 100, 50, 50);
+    FloatRect rect2(150, 100, 50, 50);
+    FloatRect rect3(200, 100, 50, 50);
+
+    drawRect(context, multicol, backgroundDrawingType, FloatRect(100, 200, 100, 100));
+
+    paintController().beginScope();
+    drawRect(context, content, foregroundDrawingType, rect1);
+    paintController().endScope();
+
+    paintController().beginScope();
+    drawRect(context, content, foregroundDrawingType, rect2);
+    paintController().endScope();
+    paintController().commitNewDisplayItems();
+
+    EXPECT_DISPLAY_LIST(paintController().displayItems(), 3,
+        TestDisplayItem(multicol, backgroundDrawingType),
+        TestDisplayItem(content, foregroundDrawingType),
+        TestDisplayItem(content, foregroundDrawingType));
+    RefPtr<const SkPicture> picture1 = static_cast<const DrawingDisplayItem&>(paintController().displayItems()[1]).picture();
+    RefPtr<const SkPicture> picture2 = static_cast<const DrawingDisplayItem&>(paintController().displayItems()[2]).picture();
+    EXPECT_NE(picture1, picture2);
+
+    // Draw again with nothing invalidated.
+    EXPECT_TRUE(paintController().clientCacheIsValid(multicol.displayItemClient()));
+    drawRect(context, multicol, backgroundDrawingType, FloatRect(100, 200, 100, 100));
+    paintController().beginScope();
+    drawRect(context, content, foregroundDrawingType, rect1);
+    paintController().endScope();
+
+    paintController().beginScope();
+    drawRect(context, content, foregroundDrawingType, rect2);
+    paintController().endScope();
+
+    EXPECT_DISPLAY_LIST(paintController().newDisplayItems(), 3,
+        TestDisplayItem(multicol, DisplayItem::drawingTypeToCachedDrawingType(backgroundDrawingType)),
+        TestDisplayItem(content, foregroundDrawingType),
+        TestDisplayItem(content, foregroundDrawingType));
+
+    paintController().commitNewDisplayItems();
+
+    EXPECT_DISPLAY_LIST(paintController().displayItems(), 3,
+        TestDisplayItem(multicol, backgroundDrawingType),
+        TestDisplayItem(content, foregroundDrawingType),
+        TestDisplayItem(content, foregroundDrawingType));
+    EXPECT_NE(picture1, static_cast<const DrawingDisplayItem&>(paintController().displayItems()[1]).picture());
+    EXPECT_NE(picture2, static_cast<const DrawingDisplayItem&>(paintController().displayItems()[2]).picture());
+
+    // Now the multicol becomes 3 columns and repaints.
+    paintController().invalidate(multicol, PaintInvalidationFull, IntRect(), IntRect());
+    drawRect(context, multicol, backgroundDrawingType, FloatRect(100, 100, 100, 100));
+
+    paintController().beginScope();
+    drawRect(context, content, foregroundDrawingType, rect1);
+    paintController().endScope();
+
+    paintController().beginScope();
+    drawRect(context, content, foregroundDrawingType, rect2);
+    paintController().endScope();
+
+    paintController().beginScope();
+    drawRect(context, content, foregroundDrawingType, rect3);
+    paintController().endScope();
+
+    // We should repaint everything on invalidation of the scope container.
+    EXPECT_DISPLAY_LIST(paintController().newDisplayItems(), 4,
+        TestDisplayItem(multicol, backgroundDrawingType),
+        TestDisplayItem(content, foregroundDrawingType),
+        TestDisplayItem(content, foregroundDrawingType),
+        TestDisplayItem(content, foregroundDrawingType));
+    EXPECT_NE(picture1, static_cast<const DrawingDisplayItem&>(paintController().newDisplayItems()[1]).picture());
+    EXPECT_NE(picture2, static_cast<const DrawingDisplayItem&>(paintController().newDisplayItems()[2]).picture());
+
+    paintController().commitNewDisplayItems();
+}
+
+TEST_F(PaintControllerTest, OptimizeNoopPairs)
+{
+    TestDisplayItemClient first("first");
+    TestDisplayItemClient second("second");
+    TestDisplayItemClient third("third");
+
+    GraphicsContext context(&paintController());
+    drawRect(context, first, backgroundDrawingType, FloatRect(0, 0, 100, 100));
+    {
+        ClipPathRecorder clipRecorder(context, second, Path());
+        drawRect(context, second, backgroundDrawingType, FloatRect(0, 0, 100, 100));
+    }
+    drawRect(context, third, backgroundDrawingType, FloatRect(0, 0, 100, 100));
+
+    paintController().commitNewDisplayItems();
+    EXPECT_DISPLAY_LIST(paintController().displayItems(), 5,
+        TestDisplayItem(first, backgroundDrawingType),
+        TestDisplayItem(second, DisplayItem::BeginClipPath),
+        TestDisplayItem(second, backgroundDrawingType),
+        TestDisplayItem(second, DisplayItem::EndClipPath),
+        TestDisplayItem(third, backgroundDrawingType));
+
+    paintController().invalidate(second, PaintInvalidationFull, IntRect(), IntRect());
+    drawRect(context, first, backgroundDrawingType, FloatRect(0, 0, 100, 100));
+    {
+        ClipRecorder clipRecorder(context, second, clipType, LayoutRect(1, 1, 2, 2));
+        // Do not draw anything for second.
+    }
+    drawRect(context, third, backgroundDrawingType, FloatRect(0, 0, 100, 100));
+    paintController().commitNewDisplayItems();
+
+    // Empty clips should have been optimized out.
+    EXPECT_DISPLAY_LIST(paintController().displayItems(), 2,
+        TestDisplayItem(first, backgroundDrawingType),
+        TestDisplayItem(third, backgroundDrawingType));
+
+    paintController().invalidate(second, PaintInvalidationFull, IntRect(), IntRect());
+    drawRect(context, first, backgroundDrawingType, FloatRect(0, 0, 100, 100));
+    {
+        ClipRecorder clipRecorder(context, second, clipType, LayoutRect(1, 1, 2, 2));
+        {
+            ClipPathRecorder clipPathRecorder(context, second, Path());
+            // Do not draw anything for second.
+        }
+    }
+    drawRect(context, third, backgroundDrawingType, FloatRect(0, 0, 100, 100));
+    paintController().commitNewDisplayItems();
+
+    // Empty clips should have been optimized out.
+    EXPECT_DISPLAY_LIST(paintController().displayItems(), 2,
+        TestDisplayItem(first, backgroundDrawingType),
+        TestDisplayItem(third, backgroundDrawingType));
+}
+
+TEST_F(PaintControllerTest, SmallPaintControllerHasOnePaintChunk)
+{
+    RuntimeEnabledFeatures::setSlimmingPaintV2Enabled(true);
+    TestDisplayItemClient client("test client");
+
+    GraphicsContext context(&paintController());
+    drawRect(context, client, backgroundDrawingType, FloatRect(0, 0, 100, 100));
+
+    paintController().commitNewDisplayItems();
+    const auto& paintChunks = paintController().paintChunks();
+    ASSERT_EQ(1u, paintChunks.size());
+    EXPECT_EQ(0u, paintChunks[0].beginIndex);
+    EXPECT_EQ(1u, paintChunks[0].endIndex);
+}
+
+} // namespace blink
diff --git a/third_party/WebKit/Source/platform/graphics/paint/README.md b/third_party/WebKit/Source/platform/graphics/paint/README.md
index 9df21a6..24918af0 100644
--- a/third_party/WebKit/Source/platform/graphics/paint/README.md
+++ b/third_party/WebKit/Source/platform/graphics/paint/README.md
@@ -18,9 +18,9 @@
 ## Paint artifact
 
 The SPv2 [paint artifact](PaintArtifact.h) consists of a list of display items
-(ideally mostly or all drawings), partitioned into *paint chunks* which define
-certain *paint properties* which affect how the content should be drawn or
-composited.
+in paint order (ideally mostly or all drawings), partitioned into *paint chunks*
+which define certain *paint properties* which affect how the content should be
+drawn or composited.
 
 ## Paint properties
 
@@ -93,7 +93,7 @@
 ***
 
 Generally, clients of this code should use stack-allocated recorder classes to
-emit display items to a `DisplayItemList` (using `GraphicsContext`).
+emit display items to a `PaintController` (using `GraphicsContext`).
 
 ### Standalone display items
 
@@ -126,10 +126,10 @@
 ## Display item list
 
 Callers use `GraphicsContext` (via its drawing methods, and its
-`displayItemList()` accessor) and scoped recorder classes, which emit items into
-a `DisplayItemList`.
+`paintController()` accessor) and scoped recorder classes, which emit items into
+a `PaintController`.
 
-`DisplayItemList` is responsible for producing the paint artifact. It contains
+`PaintController` is responsible for producing the paint artifact. It contains
 the *current* paint artifact, which is always complete (i.e. it has no
 `CachedDisplayItem` objects), and *new* display items and paint chunks, which
 are added as content is painted.
diff --git a/third_party/WebKit/Source/platform/graphics/paint/SkPictureBuilder.h b/third_party/WebKit/Source/platform/graphics/paint/SkPictureBuilder.h
index 4ba54884..900a420 100644
--- a/third_party/WebKit/Source/platform/graphics/paint/SkPictureBuilder.h
+++ b/third_party/WebKit/Source/platform/graphics/paint/SkPictureBuilder.h
@@ -7,13 +7,13 @@
 
 #include "platform/RuntimeEnabledFeatures.h"
 #include "platform/graphics/GraphicsContext.h"
-#include "platform/graphics/paint/DisplayItemList.h"
+#include "platform/graphics/paint/PaintController.h"
 #include "wtf/OwnPtr.h"
 
 namespace blink {
 
 // When slimming paint ships we can remove this SkPicture abstraction and
-// rely on DisplayItemList here.
+// rely on PaintController here.
 class SkPictureBuilder {
     WTF_MAKE_NONCOPYABLE(SkPictureBuilder);
     STACK_ALLOCATED();
@@ -25,8 +25,8 @@
         if (containingContext && containingContext->contextDisabled())
             disabledMode = GraphicsContext::FullyDisabled;
 
-        m_displayItemList = DisplayItemList::create();
-        m_context = adoptPtr(new GraphicsContext(m_displayItemList.get(), disabledMode, metaData));
+        m_paintController = PaintController::create();
+        m_context = adoptPtr(new GraphicsContext(m_paintController.get(), disabledMode, metaData));
 
         if (containingContext) {
             m_context->setDeviceScaleFactor(containingContext->deviceScaleFactor());
@@ -39,13 +39,13 @@
     PassRefPtr<const SkPicture> endRecording()
     {
         m_context->beginRecording(m_bounds);
-        m_displayItemList->commitNewDisplayItems();
-        m_displayItemList->paintArtifact().replay(*m_context);
+        m_paintController->commitNewDisplayItems();
+        m_paintController->paintArtifact().replay(*m_context);
         return m_context->endRecording();
     }
 
 private:
-    OwnPtr<DisplayItemList> m_displayItemList;
+    OwnPtr<PaintController> m_paintController;
     OwnPtr<GraphicsContext> m_context;
     FloatRect m_bounds;
 };
diff --git a/third_party/WebKit/Source/platform/graphics/paint/SubsequenceRecorder.cpp b/third_party/WebKit/Source/platform/graphics/paint/SubsequenceRecorder.cpp
index 74976819..e83f8b3 100644
--- a/third_party/WebKit/Source/platform/graphics/paint/SubsequenceRecorder.cpp
+++ b/third_party/WebKit/Source/platform/graphics/paint/SubsequenceRecorder.cpp
@@ -8,7 +8,7 @@
 #include "platform/RuntimeEnabledFeatures.h"
 #include "platform/graphics/GraphicsContext.h"
 #include "platform/graphics/paint/CachedDisplayItem.h"
-#include "platform/graphics/paint/DisplayItemList.h"
+#include "platform/graphics/paint/PaintController.h"
 #include "platform/graphics/paint/SubsequenceDisplayItem.h"
 
 namespace blink {
@@ -18,15 +18,15 @@
     if (!RuntimeEnabledFeatures::slimmingPaintSubsequenceCachingEnabled())
         return false;
 
-    ASSERT(context.displayItemList());
+    ASSERT(context.paintController());
 
-    if (context.displayItemList()->displayItemConstructionIsDisabled())
+    if (context.paintController()->displayItemConstructionIsDisabled())
         return false;
 
-    if (!context.displayItemList()->clientCacheIsValid(client.displayItemClient()))
+    if (!context.paintController()->clientCacheIsValid(client.displayItemClient()))
         return false;
 
-    context.displayItemList()->createAndAppend<CachedDisplayItem>(client, DisplayItem::subsequenceTypeToCachedSubsequenceType(type));
+    context.paintController()->createAndAppend<CachedDisplayItem>(client, DisplayItem::subsequenceTypeToCachedSubsequenceType(type));
 
 #if ENABLE(ASSERT)
     // When under-invalidation checking is enabled, we output CachedSubsequence display item
@@ -39,7 +39,7 @@
 }
 
 SubsequenceRecorder::SubsequenceRecorder(GraphicsContext& context, const DisplayItemClientWrapper& client, DisplayItem::Type type)
-    : m_displayItemList(context.displayItemList())
+    : m_paintController(context.paintController())
     , m_client(client)
     , m_beginSubsequenceIndex(0)
     , m_type(type)
@@ -47,12 +47,12 @@
     if (!RuntimeEnabledFeatures::slimmingPaintSubsequenceCachingEnabled())
         return;
 
-    ASSERT(m_displayItemList);
-    if (m_displayItemList->displayItemConstructionIsDisabled())
+    ASSERT(m_paintController);
+    if (m_paintController->displayItemConstructionIsDisabled())
         return;
 
-    m_beginSubsequenceIndex = m_displayItemList->newDisplayItems().size();
-    m_displayItemList->createAndAppend<BeginSubsequenceDisplayItem>(m_client, type);
+    m_beginSubsequenceIndex = m_paintController->newDisplayItems().size();
+    m_paintController->createAndAppend<BeginSubsequenceDisplayItem>(m_client, type);
 }
 
 SubsequenceRecorder::~SubsequenceRecorder()
@@ -60,20 +60,20 @@
     if (!RuntimeEnabledFeatures::slimmingPaintSubsequenceCachingEnabled())
         return;
 
-    if (m_displayItemList->displayItemConstructionIsDisabled())
+    if (m_paintController->displayItemConstructionIsDisabled())
         return;
 
-    if (m_displayItemList->lastDisplayItemIsNoopBegin()) {
-        ASSERT(m_beginSubsequenceIndex == m_displayItemList->newDisplayItems().size() - 1);
+    if (m_paintController->lastDisplayItemIsNoopBegin()) {
+        ASSERT(m_beginSubsequenceIndex == m_paintController->newDisplayItems().size() - 1);
         // Remove uncacheable no-op BeginSubsequence/EndSubsequence pairs.
         // Don't remove cacheable no-op pairs because we need to match them later with CachedSubsequences.
-        if (m_displayItemList->newDisplayItems().last().skippedCache()) {
-            m_displayItemList->removeLastDisplayItem();
+        if (m_paintController->newDisplayItems().last().skippedCache()) {
+            m_paintController->removeLastDisplayItem();
             return;
         }
     }
 
-    m_displayItemList->createAndAppend<EndSubsequenceDisplayItem>(m_client, DisplayItem::subsequenceTypeToEndSubsequenceType(m_type));
+    m_paintController->createAndAppend<EndSubsequenceDisplayItem>(m_client, DisplayItem::subsequenceTypeToEndSubsequenceType(m_type));
 }
 
 void SubsequenceRecorder::setUncacheable()
@@ -81,11 +81,11 @@
     if (!RuntimeEnabledFeatures::slimmingPaintSubsequenceCachingEnabled())
         return;
 
-    if (m_displayItemList->displayItemConstructionIsDisabled())
+    if (m_paintController->displayItemConstructionIsDisabled())
         return;
 
-    ASSERT(m_displayItemList->newDisplayItems()[m_beginSubsequenceIndex].isSubsequence());
-    m_displayItemList->newDisplayItems()[m_beginSubsequenceIndex].setSkippedCache();
+    ASSERT(m_paintController->newDisplayItems()[m_beginSubsequenceIndex].isSubsequence());
+    m_paintController->newDisplayItems()[m_beginSubsequenceIndex].setSkippedCache();
 }
 
 } // namespace blink
diff --git a/third_party/WebKit/Source/platform/graphics/paint/SubsequenceRecorder.h b/third_party/WebKit/Source/platform/graphics/paint/SubsequenceRecorder.h
index 03c70e3..1957a5d 100644
--- a/third_party/WebKit/Source/platform/graphics/paint/SubsequenceRecorder.h
+++ b/third_party/WebKit/Source/platform/graphics/paint/SubsequenceRecorder.h
@@ -9,8 +9,8 @@
 
 namespace blink {
 
-class DisplayItemList;
 class GraphicsContext;
+class PaintController;
 
 // SubsequenceRecorder records BeginSubsequenceDisplayItem and EndSubsequenceDisplayItem
 // sentinels at either end of a continguous sequence of DisplayItems, and supports
@@ -30,7 +30,7 @@
     void setUncacheable();
 
 private:
-    DisplayItemList* m_displayItemList;
+    PaintController* m_paintController;
     DisplayItemClientWrapper m_client;
     size_t m_beginSubsequenceIndex;
     DisplayItem::Type m_type;
diff --git a/third_party/WebKit/Source/platform/scroll/ScrollbarTheme.cpp b/third_party/WebKit/Source/platform/scroll/ScrollbarTheme.cpp
index 843a41fc..ee46dc0 100644
--- a/third_party/WebKit/Source/platform/scroll/ScrollbarTheme.cpp
+++ b/third_party/WebKit/Source/platform/scroll/ScrollbarTheme.cpp
@@ -30,9 +30,9 @@
 #include "platform/RuntimeEnabledFeatures.h"
 #include "platform/graphics/Color.h"
 #include "platform/graphics/GraphicsContext.h"
-#include "platform/graphics/paint/DisplayItemList.h"
 #include "platform/graphics/paint/DrawingDisplayItem.h"
 #include "platform/graphics/paint/DrawingRecorder.h"
+#include "platform/graphics/paint/PaintController.h"
 #include "platform/scroll/ScrollbarThemeClient.h"
 #include "platform/scroll/ScrollbarThemeMock.h"
 #include "platform/scroll/ScrollbarThemeOverlayMock.h"
diff --git a/third_party/WebKit/Source/web/AssertMatchingEnums.cpp b/third_party/WebKit/Source/web/AssertMatchingEnums.cpp
index 0b06cda..21f9e197 100644
--- a/third_party/WebKit/Source/web/AssertMatchingEnums.cpp
+++ b/third_party/WebKit/Source/web/AssertMatchingEnums.cpp
@@ -157,6 +157,7 @@
 STATIC_ASSERT_MATCHING_ENUM(WebAXEventBlur, AXObjectCache::AXBlur);
 STATIC_ASSERT_MATCHING_ENUM(WebAXEventCheckedStateChanged, AXObjectCache::AXCheckedStateChanged);
 STATIC_ASSERT_MATCHING_ENUM(WebAXEventChildrenChanged, AXObjectCache::AXChildrenChanged);
+STATIC_ASSERT_MATCHING_ENUM(WebAXEventDocumentSelectionChanged, AXObjectCache::AXDocumentSelectionChanged);
 STATIC_ASSERT_MATCHING_ENUM(WebAXEventFocus, AXObjectCache::AXFocusedUIElementChanged);
 STATIC_ASSERT_MATCHING_ENUM(WebAXEventHide, AXObjectCache::AXHide);
 STATIC_ASSERT_MATCHING_ENUM(WebAXEventHover, AXObjectCache::AXHover);
diff --git a/third_party/WebKit/Source/web/AssociatedURLLoader.cpp b/third_party/WebKit/Source/web/AssociatedURLLoader.cpp
index 4c838f7..6170c8d 100644
--- a/third_party/WebKit/Source/web/AssociatedURLLoader.cpp
+++ b/third_party/WebKit/Source/web/AssociatedURLLoader.cpp
@@ -383,9 +383,4 @@
         m_loader->setDefersLoading(defersLoading);
 }
 
-void AssociatedURLLoader::setLoadingTaskRunner(blink::WebTaskRunner*)
-{
-    // TODO(alexclarke): Maybe support this one day if it proves worthwhile.
-}
-
 } // namespace blink
diff --git a/third_party/WebKit/Source/web/AssociatedURLLoader.h b/third_party/WebKit/Source/web/AssociatedURLLoader.h
index 6dcd06e..41b0c26 100644
--- a/third_party/WebKit/Source/web/AssociatedURLLoader.h
+++ b/third_party/WebKit/Source/web/AssociatedURLLoader.h
@@ -54,7 +54,6 @@
     void loadAsynchronously(const WebURLRequest&, WebURLLoaderClient*) override;
     void cancel() override;
     void setDefersLoading(bool) override;
-    void setLoadingTaskRunner(blink::WebTaskRunner*) override;
 
 private:
 
diff --git a/third_party/WebKit/Source/web/FullscreenController.cpp b/third_party/WebKit/Source/web/FullscreenController.cpp
index 019c1d2..6089612 100644
--- a/third_party/WebKit/Source/web/FullscreenController.cpp
+++ b/third_party/WebKit/Source/web/FullscreenController.cpp
@@ -137,6 +137,13 @@
 
 void FullscreenController::enterFullScreenForElement(Element* element)
 {
+    // TODO(dsinclair): This should not be needed because we addToTopLayer
+    // in Fullscreen::pushFullscreenElementStack but, the WebView code doesn't
+    // call Fullscreen::requestFullscreen() and, instead, just enters and
+    // exists itself. This should be unified so there is one way to go
+    // fullscreen.  crbug.com/538158
+    element->document().addToTopLayer(element);
+
     // We are already transitioning to fullscreen for a different element.
     if (m_provisionalFullScreenElement) {
         m_provisionalFullScreenElement = element;
@@ -162,6 +169,13 @@
 {
     ASSERT(element);
 
+    // TODO(dsinclair): This should not be needed because we addToTopLayer
+    // in Fullscreen::popFullscreenElementStack but, the WebView code doesn't
+    // call Fullscreen::requestFullscreen() and, instead, just enters and
+    // exists itself. This should be unified so there is one way to go
+    // fullscreen.  crbug.com/538158
+    element->document().removeFromTopLayer(element);
+
     // The client is exiting full screen, so don't send a notification.
     if (m_isCancelingFullScreen)
         return;
@@ -178,9 +192,9 @@
 
     updatePageScaleConstraints(false);
 
-    LayoutFullScreen* layoutObject = Fullscreen::from(*m_fullScreenFrame->document()).fullScreenLayoutObject();
-    if (layoutObject)
-        layoutObject->updateStyle();
+    Document* document = m_fullScreenFrame->document();
+    if (Element* fullscreenElement = Fullscreen::currentFullScreenElementFrom(*document))
+        Fullscreen::from(fullscreenElement->document()).didUpdateSize(*fullscreenElement);
 }
 
 void FullscreenController::updatePageScaleConstraints(bool removeConstraints)
diff --git a/third_party/WebKit/Source/web/FullscreenController.h b/third_party/WebKit/Source/web/FullscreenController.h
index 6acc421..a5a31f4 100644
--- a/third_party/WebKit/Source/web/FullscreenController.h
+++ b/third_party/WebKit/Source/web/FullscreenController.h
@@ -31,7 +31,6 @@
 #ifndef FullscreenController_h
 #define FullscreenController_h
 
-#include "core/layout/LayoutFullScreen.h"
 #include "platform/geometry/FloatPoint.h"
 #include "platform/geometry/IntSize.h"
 #include "platform/heap/Handle.h"
diff --git a/third_party/WebKit/Source/web/InspectorOverlay.cpp b/third_party/WebKit/Source/web/InspectorOverlay.cpp
index 5f893d8..3709007 100644
--- a/third_party/WebKit/Source/web/InspectorOverlay.cpp
+++ b/third_party/WebKit/Source/web/InspectorOverlay.cpp
@@ -692,6 +692,7 @@
 
     if (node && m_inspectModeHighlightConfig) {
         m_hoveredNodeForInspectMode = node;
+        m_domAgent->nodeHighlightedInOverlay(node);
         highlightNode(node, eventTarget, *m_inspectModeHighlightConfig, event.ctrlKey() || event.metaKey());
     }
     return true;
diff --git a/third_party/WebKit/Source/web/PageOverlay.h b/third_party/WebKit/Source/web/PageOverlay.h
index bdb57c2..b75aeda 100644
--- a/third_party/WebKit/Source/web/PageOverlay.h
+++ b/third_party/WebKit/Source/web/PageOverlay.h
@@ -47,7 +47,7 @@
 // Clients can paint by implementing WebPageOverlay.
 //
 // With Slimming Paint, internal clients can extract a GraphicsContext to add
-// to the DisplayItemList owned by the GraphicsLayer
+// to the PaintController owned by the GraphicsLayer
 class PageOverlay : public GraphicsLayerClient {
 public:
     class Delegate : public GarbageCollectedFinalized<Delegate> {
diff --git a/third_party/WebKit/Source/web/PageOverlayTest.cpp b/third_party/WebKit/Source/web/PageOverlayTest.cpp
index 60e792b..a64de62c 100644
--- a/third_party/WebKit/Source/web/PageOverlayTest.cpp
+++ b/third_party/WebKit/Source/web/PageOverlayTest.cpp
@@ -9,8 +9,8 @@
 #include "core/layout/LayoutView.h"
 #include "platform/graphics/Color.h"
 #include "platform/graphics/GraphicsContext.h"
-#include "platform/graphics/paint/DisplayItemList.h"
 #include "platform/graphics/paint/DrawingRecorder.h"
+#include "platform/graphics/paint/PaintController.h"
 #include "public/platform/Platform.h"
 #include "public/platform/WebCanvas.h"
 #include "public/platform/WebThread.h"
@@ -152,12 +152,12 @@
 
     // Paint the layer with a null canvas to get a display list, and then
     // replay that onto the mock canvas for examination.
-    GraphicsContext graphicsContext(graphicsLayer->displayItemList());
+    GraphicsContext graphicsContext(graphicsLayer->paintController());
     graphicsLayer->paint(graphicsContext, rect);
 
     graphicsContext.beginRecording(IntRect(rect));
-    graphicsLayer->displayItemList()->commitNewDisplayItems();
-    graphicsLayer->displayItemList()->paintArtifact().replay(graphicsContext);
+    graphicsLayer->paintController()->commitNewDisplayItems();
+    graphicsLayer->paintController()->paintArtifact().replay(graphicsContext);
     graphicsContext.endRecording()->playback(&canvas);
 }
 
diff --git a/third_party/WebKit/Source/web/WebAXObject.cpp b/third_party/WebKit/Source/web/WebAXObject.cpp
index b9dc9120..f9aeac1 100644
--- a/third_party/WebKit/Source/web/WebAXObject.cpp
+++ b/third_party/WebKit/Source/web/WebAXObject.cpp
@@ -477,7 +477,7 @@
     if (isDetached())
         return false;
 
-    AXObject::AccessibilityChildrenVector controls;
+    AXObject::AXObjectVector controls;
     m_private->ariaControlsElements(controls);
 
     WebVector<WebAXObject> result(controls.size());
@@ -501,7 +501,7 @@
     if (isDetached())
         return false;
 
-    AXObject::AccessibilityChildrenVector flowTo;
+    AXObject::AXObjectVector flowTo;
     m_private->ariaFlowToElements(flowTo);
 
     WebVector<WebAXObject> result(flowTo.size());
@@ -1007,7 +1007,7 @@
     if (isDetached())
         return false;
 
-    AXObject::AccessibilityChildrenVector describedby;
+    AXObject::AXObjectVector describedby;
     m_private->deprecatedAriaDescribedbyElements(describedby);
 
     WebVector<WebAXObject> result(describedby.size());
@@ -1023,7 +1023,7 @@
     if (isDetached())
         return false;
 
-    AXObject::AccessibilityChildrenVector labelledby;
+    AXObject::AXObjectVector labelledby;
     m_private->deprecatedAriaLabelledbyElements(labelledby);
 
     WebVector<WebAXObject> result(labelledby.size());
@@ -1328,7 +1328,7 @@
     if (!m_private->isAXTable())
         return WebAXObject();
 
-    const AXObject::AccessibilityChildrenVector& rows = toAXTable(m_private.get())->rows();
+    const AXObject::AXObjectVector& rows = toAXTable(m_private.get())->rows();
     if (rowIndex < rows.size())
         return WebAXObject(rows[rowIndex]);
 
@@ -1343,7 +1343,7 @@
     if (!m_private->isAXTable())
         return WebAXObject();
 
-    const AXObject::AccessibilityChildrenVector& columns = toAXTable(m_private.get())->columns();
+    const AXObject::AXObjectVector& columns = toAXTable(m_private.get())->columns();
     if (columnIndex < columns.size())
         return WebAXObject(columns[columnIndex]);
 
@@ -1380,7 +1380,7 @@
     if (!m_private->isAXTable())
         return;
 
-    AXObject::AccessibilityChildrenVector headers;
+    AXObject::AXObjectVector headers;
     toAXTable(m_private.get())->rowHeaders(headers);
 
     size_t headerCount = headers.size();
@@ -1422,7 +1422,7 @@
     if (!m_private->isAXTable())
         return;
 
-    AXObject::AccessibilityChildrenVector headers;
+    AXObject::AXObjectVector headers;
     toAXTable(m_private.get())->columnHeaders(headers);
 
     size_t headerCount = headers.size();
diff --git a/third_party/WebKit/Source/web/WebDOMEvent.cpp b/third_party/WebKit/Source/web/WebDOMEvent.cpp
index 4d980df0..3bb0d5a9 100644
--- a/third_party/WebKit/Source/web/WebDOMEvent.cpp
+++ b/third_party/WebKit/Source/web/WebDOMEvent.cpp
@@ -31,8 +31,6 @@
 #include "config.h"
 #include "public/web/WebDOMEvent.h"
 
-#include "core/EventNames.h"
-#include "core/dom/Node.h"
 #include "core/events/Event.h"
 #include "wtf/PassRefPtr.h"
 
@@ -63,130 +61,4 @@
     return m_private.get();
 }
 
-WebString WebDOMEvent::type() const
-{
-    ASSERT(m_private.get());
-    return m_private->type();
-}
-
-WebNode WebDOMEvent::target() const
-{
-    ASSERT(m_private.get());
-    return WebNode(m_private->target()->toNode());
-}
-
-WebNode WebDOMEvent::currentTarget() const
-{
-    ASSERT(m_private.get());
-    return WebNode(m_private->currentTarget()->toNode());
-}
-
-WebDOMEvent::PhaseType WebDOMEvent::eventPhase() const
-{
-    ASSERT(m_private.get());
-    return static_cast<WebDOMEvent::PhaseType>(m_private->eventPhase());
-}
-
-bool WebDOMEvent::bubbles() const
-{
-    ASSERT(m_private.get());
-    return m_private->bubbles();
-}
-
-bool WebDOMEvent::cancelable() const
-{
-    ASSERT(m_private.get());
-    return m_private->cancelable();
-}
-
-bool WebDOMEvent::isUIEvent() const
-{
-    ASSERT(m_private.get());
-    return m_private->isUIEvent();
-}
-
-bool WebDOMEvent::isMouseEvent() const
-{
-    ASSERT(m_private.get());
-    return m_private->isMouseEvent();
-}
-
-bool WebDOMEvent::isKeyboardEvent() const
-{
-    ASSERT(m_private.get());
-    return m_private->isKeyboardEvent();
-}
-
-bool WebDOMEvent::isMutationEvent() const
-{
-    ASSERT(m_private.get());
-    return m_private->hasInterface(EventNames::MutationEvent);
-}
-
-bool WebDOMEvent::isTextEvent() const
-{
-    ASSERT(m_private.get());
-    return m_private->hasInterface(EventNames::TextEvent);
-}
-
-bool WebDOMEvent::isCompositionEvent() const
-{
-    ASSERT(m_private.get());
-    return m_private->hasInterface(EventNames::CompositionEvent);
-}
-
-bool WebDOMEvent::isDragEvent() const
-{
-    ASSERT(m_private.get());
-    return m_private->isDragEvent();
-}
-
-bool WebDOMEvent::isClipboardEvent() const
-{
-    ASSERT(m_private.get());
-    return m_private->isClipboardEvent();
-}
-
-bool WebDOMEvent::isMessageEvent() const
-{
-    ASSERT(m_private.get());
-    return m_private->hasInterface(EventNames::MessageEvent);
-}
-
-bool WebDOMEvent::isWheelEvent() const
-{
-    ASSERT(m_private.get());
-    return m_private->hasInterface(EventNames::WheelEvent);
-}
-
-bool WebDOMEvent::isBeforeTextInsertedEvent() const
-{
-    ASSERT(m_private.get());
-    return m_private->isBeforeTextInsertedEvent();
-}
-
-bool WebDOMEvent::isPageTransitionEvent() const
-{
-    ASSERT(m_private.get());
-    return m_private->hasInterface(EventNames::PageTransitionEvent);
-}
-
-bool WebDOMEvent::isPopStateEvent() const
-{
-    ASSERT(m_private.get());
-    return m_private->hasInterface(EventNames::PopStateEvent);
-}
-
-bool WebDOMEvent::isProgressEvent() const
-{
-    ASSERT(m_private.get());
-    return m_private->hasInterface(EventNames::ProgressEvent);
-}
-
-bool WebDOMEvent::isXMLHttpRequestProgressEvent() const
-{
-    ASSERT(m_private.get());
-    return m_private->hasInterface(EventNames::XMLHttpRequestProgressEvent);
-}
-
 } // namespace blink
diff --git a/third_party/WebKit/Source/web/WebDOMMouseEvent.cpp b/third_party/WebKit/Source/web/WebDOMMouseEvent.cpp
deleted file mode 100644
index bf21ecad..0000000
--- a/third_party/WebKit/Source/web/WebDOMMouseEvent.cpp
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * Copyright (C) 2010 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- *     * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
- *     * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "public/web/WebDOMMouseEvent.h"
-
-#include "core/events/MouseEvent.h"
-
-namespace blink {
-
-int WebDOMMouseEvent::screenX() const
-{
-    return constUnwrap<MouseEvent>()->screenX();
-}
-
-int WebDOMMouseEvent::screenY() const
-{
-    return constUnwrap<MouseEvent>()->screenY();
-}
-
-int WebDOMMouseEvent::clientX() const
-{
-    return constUnwrap<MouseEvent>()->clientX();
-}
-
-int WebDOMMouseEvent::clientY() const
-{
-    return constUnwrap<MouseEvent>()->clientY();
-}
-
-int WebDOMMouseEvent::offsetX()
-{
-    return unwrap<MouseEvent>()->offsetX();
-}
-
-int WebDOMMouseEvent::offsetY()
-{
-    return unwrap<MouseEvent>()->offsetY();
-}
-
-int WebDOMMouseEvent::pageX() const
-{
-    return constUnwrap<MouseEvent>()->pageX();
-}
-
-int WebDOMMouseEvent::pageY() const
-{
-    return constUnwrap<MouseEvent>()->pageY();
-}
-
-int WebDOMMouseEvent::x() const
-{
-    return constUnwrap<MouseEvent>()->x();
-}
-
-int WebDOMMouseEvent::y() const
-{
-    return constUnwrap<MouseEvent>()->y();
-}
-
-int WebDOMMouseEvent::button() const
-{
-    return constUnwrap<MouseEvent>()->button();
-}
-
-bool WebDOMMouseEvent::buttonDown() const
-{
-    return constUnwrap<MouseEvent>()->buttonDown();
-}
-
-} // namespace blink
diff --git a/third_party/WebKit/Source/web/WebDOMProgressEvent.cpp b/third_party/WebKit/Source/web/WebDOMProgressEvent.cpp
index e38ca18..a1b3bbe 100644
--- a/third_party/WebKit/Source/web/WebDOMProgressEvent.cpp
+++ b/third_party/WebKit/Source/web/WebDOMProgressEvent.cpp
@@ -40,7 +40,6 @@
     : WebDOMEvent(ProgressEvent::create(type, lengthIsComputable, loaded, total))
 {
     ASSERT(m_private.get());
-    ASSERT(isProgressEvent());
 }
 
 } // namespace blink
diff --git a/third_party/WebKit/Source/web/WebDevToolsAgentImpl.cpp b/third_party/WebKit/Source/web/WebDevToolsAgentImpl.cpp
index bcb1922..05125f1 100644
--- a/third_party/WebKit/Source/web/WebDevToolsAgentImpl.cpp
+++ b/third_party/WebKit/Source/web/WebDevToolsAgentImpl.cpp
@@ -84,7 +84,7 @@
 #include "platform/RuntimeEnabledFeatures.h"
 #include "platform/TraceEvent.h"
 #include "platform/graphics/GraphicsContext.h"
-#include "platform/graphics/paint/DisplayItemList.h"
+#include "platform/graphics/paint/PaintController.h"
 #include "public/platform/Platform.h"
 #include "public/platform/WebLayerTreeView.h"
 #include "public/platform/WebRect.h"
@@ -320,7 +320,7 @@
     , m_resourceContentLoader(InspectorResourceContentLoader::create(m_webLocalFrameImpl->frame()))
     , m_state(adoptPtrWillBeNoop(new InspectorCompositeState(this)))
     , m_overlay(overlay)
-    , m_inspectedFrames(adoptPtrWillBeNoop(new InspectedFrames(m_webLocalFrameImpl->frame())))
+    , m_inspectedFrames(adoptPtr(new InspectedFrames(m_webLocalFrameImpl->frame())))
     , m_inspectorAgent(nullptr)
     , m_domAgent(nullptr)
     , m_pageAgent(nullptr)
@@ -413,7 +413,6 @@
     visitor->trace(m_resourceContentLoader);
     visitor->trace(m_state);
     visitor->trace(m_overlay);
-    visitor->trace(m_inspectedFrames);
     visitor->trace(m_inspectorAgent);
     visitor->trace(m_domAgent);
     visitor->trace(m_pageAgent);
diff --git a/third_party/WebKit/Source/web/WebDevToolsAgentImpl.h b/third_party/WebKit/Source/web/WebDevToolsAgentImpl.h
index f377d56..9ce980bb 100644
--- a/third_party/WebKit/Source/web/WebDevToolsAgentImpl.h
+++ b/third_party/WebKit/Source/web/WebDevToolsAgentImpl.h
@@ -143,7 +143,7 @@
     OwnPtrWillBeMember<InspectorResourceContentLoader> m_resourceContentLoader;
     OwnPtrWillBeMember<InspectorCompositeState> m_state;
     OwnPtrWillBeMember<InspectorOverlay> m_overlay;
-    OwnPtrWillBeMember<InspectedFrames> m_inspectedFrames;
+    OwnPtr<InspectedFrames> m_inspectedFrames;
 
     RawPtrWillBeMember<InspectorInspectorAgent> m_inspectorAgent;
     RawPtrWillBeMember<InspectorDOMAgent> m_domAgent;
diff --git a/third_party/WebKit/Source/web/WebPageSerializerImpl.cpp b/third_party/WebKit/Source/web/WebPageSerializerImpl.cpp
index 34bc016..1f7ba05 100644
--- a/third_party/WebKit/Source/web/WebPageSerializerImpl.cpp
+++ b/third_party/WebKit/Source/web/WebPageSerializerImpl.cpp
@@ -287,6 +287,9 @@
                                        status);
 }
 
+// TODO(yosin): We should utilize |MarkupFormatter| here to share code,
+// especially escaping attribute values, done by |WebEntities| |m_htmlEntities|
+// and |m_xmlEntities|.
 void WebPageSerializerImpl::openTagToString(Element* element,
                                             SerializeDomParam* param)
 {
@@ -316,7 +319,7 @@
             if (element->hasLegalLinkAttribute(attrName)) {
                 // For links start with "javascript:", we do not change it.
                 if (attrValue.startsWith("javascript:", TextCaseInsensitive)) {
-                    result.append(attrValue);
+                    result.append(m_htmlEntities.convertEntitiesInString(attrValue));
                 } else {
                     // Get the absolute link
                     WebLocalFrameImpl* subFrame = WebLocalFrameImpl::fromFrameOwnerElement(element);
@@ -329,9 +332,9 @@
                             result.append(param->directoryName);
                             result.append('/');
                         }
-                        result.append(m_localLinks.get(completeURL));
+                        result.append(m_htmlEntities.convertEntitiesInString(m_localLinks.get(completeURL)));
                     } else {
-                        result.append(completeURL);
+                        result.append(m_htmlEntities.convertEntitiesInString(completeURL));
                     }
                 }
             } else {
diff --git a/third_party/WebKit/Source/web/tests/WebFrameTest.cpp b/third_party/WebKit/Source/web/tests/WebFrameTest.cpp
index 6ccabeb..a43202e5 100644
--- a/third_party/WebKit/Source/web/tests/WebFrameTest.cpp
+++ b/third_party/WebKit/Source/web/tests/WebFrameTest.cpp
@@ -64,7 +64,6 @@
 #include "core/html/ImageDocument.h"
 #include "core/input/EventHandler.h"
 #include "core/layout/HitTestResult.h"
-#include "core/layout/LayoutFullScreen.h"
 #include "core/layout/LayoutView.h"
 #include "core/layout/compositing/PaintLayerCompositor.h"
 #include "core/loader/DocumentLoader.h"
@@ -6468,6 +6467,40 @@
     EXPECT_LT(frameView->maximumScrollPosition().x(), 0);
 }
 
+TEST_F(WebFrameTest, FullscreenCleanTopLayerAndFullscreenStack)
+{
+    FakeCompositingWebViewClient client;
+    registerMockedHttpURLLoad("fullscreen_div.html");
+    FrameTestHelpers::WebViewHelper webViewHelper;
+    int viewportWidth = 640;
+    int viewportHeight = 480;
+    client.m_screenInfo.rect.width = viewportWidth;
+    client.m_screenInfo.rect.height = viewportHeight;
+    WebViewImpl* webViewImpl = webViewHelper.initializeAndLoad(
+        m_baseURL + "fullscreen_div.html", true, 0, &client, configureAndroid);
+    webViewImpl->resize(WebSize(viewportWidth, viewportHeight));
+    webViewImpl->layout();
+
+    UserGestureIndicator gesture(DefinitelyProcessingUserGesture);
+    Document* document = toWebLocalFrameImpl(webViewImpl->mainFrame())->frame()->document();
+    Fullscreen& fullscreen = Fullscreen::from(*document);
+
+    Element* divFullscreen = document->getElementById("div1");
+    fullscreen.requestFullscreen(*divFullscreen, Fullscreen::PrefixedRequest);
+    webViewImpl->didEnterFullScreen();
+    ASSERT_TRUE(Fullscreen::isFullScreen(*document));
+
+    // Sanity check. We should have both in our stack.
+    ASSERT_EQ(fullscreen.fullScreenElementStack().size(), 1UL);
+    ASSERT_EQ(document->topLayerElements().size(), 2UL);
+
+    fullscreen.exitFullscreen();
+    webViewImpl->didExitFullScreen();
+
+    ASSERT_EQ(fullscreen.fullScreenElementStack().size(), 0UL);
+    ASSERT_EQ(document->topLayerElements().size(), 0UL);
+}
+
 TEST_P(ParameterizedWebFrameTest, FullscreenLayerSize)
 {
     FakeCompositingWebViewClient client;
@@ -6490,7 +6523,8 @@
     ASSERT_TRUE(Fullscreen::isFullScreen(*document));
 
     // Verify that the element is sized to the viewport.
-    LayoutFullScreen* fullscreenLayoutObject = Fullscreen::from(*document).fullScreenLayoutObject();
+    Element* fullscreenElement = Fullscreen::currentFullScreenElementFrom(*document);
+    LayoutBox* fullscreenLayoutObject = toLayoutBox(fullscreenElement->layoutObject());
     EXPECT_EQ(viewportWidth, fullscreenLayoutObject->logicalWidth().toInt());
     EXPECT_EQ(viewportHeight, fullscreenLayoutObject->logicalHeight().toInt());
 
@@ -6594,7 +6628,8 @@
     webViewImpl->layout();
 
     // Verify that the element is sized to the viewport.
-    LayoutFullScreen* fullscreenLayoutObject = Fullscreen::from(*document).fullScreenLayoutObject();
+    Element* fullscreenElement = Fullscreen::currentFullScreenElementFrom(*document);
+    LayoutBox* fullscreenLayoutObject = toLayoutBox(fullscreenElement->layoutObject());
     EXPECT_EQ(viewportWidth, fullscreenLayoutObject->logicalWidth().toInt());
     EXPECT_EQ(viewportHeight, fullscreenLayoutObject->logicalHeight().toInt());
 
diff --git a/third_party/WebKit/Source/web/tests/WebPageSerializerTest.cpp b/third_party/WebKit/Source/web/tests/WebPageSerializerTest.cpp
index 0c2821a8..afc35c70 100644
--- a/third_party/WebKit/Source/web/tests/WebPageSerializerTest.cpp
+++ b/third_party/WebKit/Source/web/tests/WebPageSerializerTest.cpp
@@ -151,6 +151,27 @@
     EXPECT_TRUE(webVectorContains(resources, "file://c/my_folder/file.gif"));
 }
 
+TEST_F(WebPageSerializerTest, URLAttributeValues)
+{
+    WebURL topFrameURL = toKURL("http://www.test.com");
+    registerMockedURLLoad(topFrameURL.spec(), WebString::fromUTF8("url_attribute_values.html"));
+    loadURLInTopFrame(topFrameURL);
+
+    SimpleWebPageSerializerClient serializerClient;
+    WebVector<WebURL> links(&topFrameURL, 1);
+    WebVector<WebString> localPaths(&"local", 1);
+    WebPageSerializer::serialize(webView()->mainFrame()->toWebLocalFrame(), &serializerClient, links, localPaths, "");
+
+    const char* expectedHTML =
+        "\n<!-- saved from url=(0020)http://www.test.com/ -->\n"
+        "<html><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"><meta charset=\"utf8\">\n"
+        "</head><body><img src=\"javascript:&quot;\">\n"
+        "<a href=\"http://www.test.com/local#&quot;\">local</a>\n"
+        "<a href=\"http://www.example.com/#&quot;&gt;&lt;script&gt;alert(0)&lt;/script&gt;\">external</a>\n"
+        "</body></html>";
+    EXPECT_EQ(expectedHTML, serializerClient.toString());
+}
+
 TEST_F(WebPageSerializerTest, fromUrlWithMinusMinus)
 {
     WebURL topFrameURL = toKURL("http://www.test.com?--x--");
diff --git a/third_party/WebKit/Source/web/tests/data/pageserialization/url_attribute_values.html b/third_party/WebKit/Source/web/tests/data/pageserialization/url_attribute_values.html
new file mode 100644
index 0000000..366d6166c
--- /dev/null
+++ b/third_party/WebKit/Source/web/tests/data/pageserialization/url_attribute_values.html
@@ -0,0 +1,4 @@
+<meta charset="utf8">
+<img src='javascript:"'>
+<a href='local#"'>local</a>
+<a href="http://www.example.com/#&quot;&gt;&lt;script&gt;alert(0)&lt;/script&gt;">external</a>
diff --git a/third_party/WebKit/Source/web/web.gypi b/third_party/WebKit/Source/web/web.gypi
index 42ef62e..ff62502 100644
--- a/third_party/WebKit/Source/web/web.gypi
+++ b/third_party/WebKit/Source/web/web.gypi
@@ -123,7 +123,6 @@
       'WebDOMFileSystem.cpp',
       'WebDOMMediaStreamTrack.cpp',
       'WebDOMMessageEvent.cpp',
-      'WebDOMMouseEvent.cpp',
       'WebDOMProgressEvent.cpp',
       'WebDOMResourceProgressEvent.cpp',
       'WebDataSourceImpl.cpp',
diff --git a/third_party/WebKit/Source/wtf/ASCIICType.cpp b/third_party/WebKit/Source/wtf/ASCIICType.cpp
new file mode 100644
index 0000000..8cbf8980
--- /dev/null
+++ b/third_party/WebKit/Source/wtf/ASCIICType.cpp
@@ -0,0 +1,53 @@
+/*
+ * Copyright (C) 2007, 2008, 2009, 2011 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1.  Redistributions of source code must retain the above copyright
+ *     notice, this list of conditions and the following disclaimer.
+ * 2.  Redistributions in binary form must reproduce the above copyright
+ *     notice, this list of conditions and the following disclaimer in the
+ *     documentation and/or other materials provided with the distribution.
+ * 3.  Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ *     its contributors may be used to endorse or promote products derived
+ *     from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+ * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ * DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+ * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "wtf/ASCIICType.h"
+
+namespace WTF {
+
+extern const LChar ASCIICaseFoldTable[256] = {
+    0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
+    0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f,
+    0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f,
+    0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f,
+    0x40, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f,
+    0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f,
+    0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f,
+    0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f,
+    0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f,
+    0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f,
+    0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf,
+    0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf,
+    0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf,
+    0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf,
+    0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef,
+    0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff
+};
+
+}
diff --git a/third_party/WebKit/Source/wtf/ASCIICType.h b/third_party/WebKit/Source/wtf/ASCIICType.h
index 196ae82bd..052a45b 100644
--- a/third_party/WebKit/Source/wtf/ASCIICType.h
+++ b/third_party/WebKit/Source/wtf/ASCIICType.h
@@ -107,24 +107,7 @@
     return c >= 'A' && c <= 'Z';
 }
 
-const LChar ASCIICaseFoldTable[256] = {
-    0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
-    0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f,
-    0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f,
-    0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f,
-    0x40, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f,
-    0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f,
-    0x60, 0x61, 0x62, 0x63, 0x64, 0x65, 0x66, 0x67, 0x68, 0x69, 0x6a, 0x6b, 0x6c, 0x6d, 0x6e, 0x6f,
-    0x70, 0x71, 0x72, 0x73, 0x74, 0x75, 0x76, 0x77, 0x78, 0x79, 0x7a, 0x7b, 0x7c, 0x7d, 0x7e, 0x7f,
-    0x80, 0x81, 0x82, 0x83, 0x84, 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x8f,
-    0x90, 0x91, 0x92, 0x93, 0x94, 0x95, 0x96, 0x97, 0x98, 0x99, 0x9a, 0x9b, 0x9c, 0x9d, 0x9e, 0x9f,
-    0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7, 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf,
-    0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7, 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf,
-    0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7, 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce, 0xcf,
-    0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6, 0xd7, 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde, 0xdf,
-    0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7, 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xed, 0xee, 0xef,
-    0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff
-};
+WTF_EXPORT extern const LChar ASCIICaseFoldTable[256];
 
 template<typename CharType> inline CharType toASCIILower(CharType c)
 {
diff --git a/third_party/WebKit/Source/wtf/AddressSpaceRandomization.cpp b/third_party/WebKit/Source/wtf/AddressSpaceRandomization.cpp
index 2a363a33..bad3158 100644
--- a/third_party/WebKit/Source/wtf/AddressSpaceRandomization.cpp
+++ b/third_party/WebKit/Source/wtf/AddressSpaceRandomization.cpp
@@ -99,6 +99,10 @@
     // TODO(cevans): I think Win 8.1 has 47-bits like Linux.
     random &= 0x3ffffffffffUL;
     random += 0x10000000000UL;
+#elif defined(MEMORY_TOOL_REPLACES_ALLOCATOR)
+    // This range is copied from the TSan source, but works for all tools.
+    random &= 0x007fffffffffUL;
+    random += 0x7e8000000000UL;
 #else
     // Linux and OS X support the full 47-bit user space of x64 processors.
     random &= 0x3fffffffffffUL;
@@ -108,6 +112,17 @@
     random &= 0x3fffffffffUL;
     random += 0x1000000000UL;
 #else // !CPU(X86_64) && !CPU(ARM64)
+#if OS(WIN)
+    // On win32 host systems the randomization plus huge alignment causes
+    // excessive fragmentation. Plus most of these systems lack ASLR, so the
+    // randomization isn't buying anything. In that case we just skip it.
+    // TODO(jschuh): Just dump the randomization when HE-ASLR is present.
+    static BOOL isWow64 = -1;
+    if (isWow64 == -1 && !IsWow64Process(GetCurrentProcess(), &isWow64))
+        isWow64 = FALSE;
+    if (!isWow64)
+        return nullptr;
+#endif // OS(WIN)
     // This is a good range on Windows, Linux and Mac.
     // Allocates in the 0.5-1.5GB region.
     random &= 0x3fffffff;
diff --git a/third_party/WebKit/Source/wtf/PageAllocator.cpp b/third_party/WebKit/Source/wtf/PageAllocator.cpp
index 5f5eb440..20dfeef 100644
--- a/third_party/WebKit/Source/wtf/PageAllocator.cpp
+++ b/third_party/WebKit/Source/wtf/PageAllocator.cpp
@@ -48,59 +48,76 @@
 #define MAP_ANONYMOUS MAP_ANON
 #endif
 
+// On POSIX memmap uses a nearby address if the hint address is blocked.
+static const bool kHintIsAdvisory = true;
+
 #elif OS(WIN)
 
 #include <windows.h>
 
+// VirtualAlloc will fail if allocation at the hint address is blocked.
+static const bool kHintIsAdvisory = false;
+
 #else
 #error Unknown OS
 #endif // OS(POSIX)
 
 namespace WTF {
 
-// This simple internal function wraps the OS-specific page allocation call so
-// that it behaves consistently: the address is a hint and if it cannot be used,
-// the allocation will be placed elsewhere.
-static void* systemAllocPages(void* addr, size_t len, PageAccessibilityConfiguration pageAccessibility)
+// This internal function wraps the OS-specific page allocation call. The
+// behavior of the hint address is determined by the kHintIsAdvisory constant.
+// If true, a non-zero hint is advisory and the returned address may differ from
+// the hint. If false, the hint is mandatory and a successful allocation will
+// not differ from the hint.
+static void* systemAllocPages(void* hint, size_t len, PageAccessibilityConfiguration pageAccessibility)
 {
     ASSERT(!(len & kPageAllocationGranularityOffsetMask));
-    ASSERT(!(reinterpret_cast<uintptr_t>(addr) & kPageAllocationGranularityOffsetMask));
+    ASSERT(!(reinterpret_cast<uintptr_t>(hint) & kPageAllocationGranularityOffsetMask));
     void* ret;
 #if OS(WIN)
-    int accessFlag = pageAccessibility == PageAccessible ? PAGE_READWRITE : PAGE_NOACCESS;
-    ret = VirtualAlloc(addr, len, MEM_RESERVE | MEM_COMMIT, accessFlag);
-    if (!ret)
-        ret = VirtualAlloc(0, len, MEM_RESERVE | MEM_COMMIT, accessFlag);
+    DWORD accessFlag = pageAccessibility == PageAccessible ? PAGE_READWRITE : PAGE_NOACCESS;
+    ret = VirtualAlloc(hint, len, MEM_RESERVE | MEM_COMMIT, accessFlag);
 #else
     int accessFlag = pageAccessibility == PageAccessible ? (PROT_READ | PROT_WRITE) : PROT_NONE;
-    ret = mmap(addr, len, accessFlag, MAP_ANONYMOUS | MAP_PRIVATE, -1, 0);
+    ret = mmap(hint, len, accessFlag, MAP_ANONYMOUS | MAP_PRIVATE, -1, 0);
     if (ret == MAP_FAILED)
         ret = 0;
 #endif
     return ret;
 }
 
-static bool trimMapping(void* baseAddr, size_t baseLen, void* trimAddr, size_t trimLen)
+// Trims base to given length and alignment. Windows returns null on failure and frees base.
+static void* trimMapping(void *base, size_t baseLen, size_t trimLen, uintptr_t align, PageAccessibilityConfiguration pageAccessibility)
 {
-#if OS(WIN)
-    return false;
-#else
-    char* basePtr = static_cast<char*>(baseAddr);
-    char* trimPtr = static_cast<char*>(trimAddr);
-    ASSERT(trimPtr >= basePtr);
-    ASSERT(trimPtr + trimLen <= basePtr + baseLen);
-    size_t preLen = trimPtr - basePtr;
-    if (preLen) {
-        int ret = munmap(basePtr, preLen);
-        RELEASE_ASSERT(!ret);
+    size_t preSlack = reinterpret_cast<uintptr_t>(base) & (align - 1);
+    if (preSlack)
+        preSlack = align - preSlack;
+    size_t postSlack = baseLen - preSlack - trimLen;
+    ASSERT(baseLen >= trimLen || preSlack || postSlack);
+    ASSERT(preSlack < baseLen);
+    ASSERT(postSlack < baseLen);
+    void* ret = base;
+
+#if OS(POSIX) // On POSIX we can resize the allocation run.
+    (void) pageAccessibility;
+    if (preSlack) {
+        int res = munmap(base, preSlack);
+        RELEASE_ASSERT(!res);
+        ret = reinterpret_cast<char*>(base) + preSlack;
     }
-    size_t postLen = (basePtr + baseLen) - (trimPtr + trimLen);
-    if (postLen) {
-        int ret = munmap(trimPtr + trimLen, postLen);
-        RELEASE_ASSERT(!ret);
+    if (postSlack) {
+        int res = munmap(reinterpret_cast<char*>(ret) + trimLen, postSlack);
+        RELEASE_ASSERT(!res);
     }
-    return true;
+#else // On Windows we can't resize the allocation run.
+    if (preSlack || postSlack) {
+        ret = reinterpret_cast<char*>(base) + preSlack;
+        freePages(base, baseLen);
+        ret = systemAllocPages(ret, trimLen, pageAccessibility);
+    }
 #endif
+
+    return ret;
 }
 
 void* allocPages(void* addr, size_t len, size_t align, PageAccessibilityConfiguration pageAccessibility)
@@ -110,59 +127,55 @@
     ASSERT(align >= kPageAllocationGranularity);
     ASSERT(!(align & kPageAllocationGranularityOffsetMask));
     ASSERT(!(reinterpret_cast<uintptr_t>(addr) & kPageAllocationGranularityOffsetMask));
-    size_t alignOffsetMask = align - 1;
-    size_t alignBaseMask = ~alignOffsetMask;
+    uintptr_t alignOffsetMask = align - 1;
+    uintptr_t alignBaseMask = ~alignOffsetMask;
     ASSERT(!(reinterpret_cast<uintptr_t>(addr) & alignOffsetMask));
+
     // If the client passed null as the address, choose a good one.
     if (!addr) {
         addr = getRandomPageBase();
         addr = reinterpret_cast<void*>(reinterpret_cast<uintptr_t>(addr) & alignBaseMask);
     }
 
-    // The common case, which is also the least work we can do, is that the
-    // address and length are suitable. Just try it.
-    void* ret = systemAllocPages(addr, len, pageAccessibility);
-    // If the alignment is to our liking, we're done.
-    if (!ret || !(reinterpret_cast<uintptr_t>(ret) & alignOffsetMask))
-        return ret;
+    // First try to force an exact-size, aligned allocation from our random base.
+    for (int count = 0; count < 3; ++count) {
+        void* ret = systemAllocPages(addr, len, pageAccessibility);
+        if (kHintIsAdvisory || ret) {
+            // If the alignment is to our liking, we're done.
+            if (!(reinterpret_cast<uintptr_t>(ret)& alignOffsetMask))
+                return ret;
+            freePages(ret, len);
+#if CPU(32BIT)
+            addr = reinterpret_cast<void*>((reinterpret_cast<uintptr_t>(ret)+align) & alignBaseMask);
+#endif
+        } else if (!addr) { // We know we're OOM when an unhinted allocation fails.
+            return nullptr;
 
-    // Annoying. Unmap and map a larger range to be sure to succeed on the
-    // second, slower attempt.
-    freePages(ret, len);
+        } else {
+#if CPU(32BIT)
+            addr = reinterpret_cast<char*>(addr) + align;
+#endif
+        }
 
-    size_t tryLen = len + (align - kPageAllocationGranularity);
-    RELEASE_ASSERT(tryLen > len);
-
-    // We loop to cater for the unlikely case where another thread maps on top
-    // of the aligned location we choose.
-    int count = 0;
-    while (count++ < 100) {
-        ret = systemAllocPages(addr, tryLen, pageAccessibility);
-        if (!ret)
-            return 0;
-        // We can now try and trim out a subset of the mapping.
-        addr = reinterpret_cast<void*>((reinterpret_cast<uintptr_t>(ret) + alignOffsetMask) & alignBaseMask);
-
-        // On POSIX systems, we can trim the oversized mapping to fit exactly.
-        // This will always work on POSIX systems.
-        if (trimMapping(ret, tryLen, addr, len))
-            return addr;
-
-        // On Windows, you can't trim an existing mapping so we unmap and remap
-        // a subset. We used to do for all platforms, but OSX 10.8 has a
-        // broken mmap() that ignores address hints for valid, unused addresses.
-        freePages(ret, tryLen);
-        ret = systemAllocPages(addr, len, pageAccessibility);
-        if (ret == addr || !ret)
-            return ret;
-
-        // Unlikely race / collision. Do the simple thing and just start again.
-        freePages(ret, len);
+#if !CPU(32BIT) // Keep trying random addresses on systems that have a large address space.
         addr = getRandomPageBase();
         addr = reinterpret_cast<void*>(reinterpret_cast<uintptr_t>(addr) & alignBaseMask);
+#endif
     }
-    IMMEDIATE_CRASH();
-    return 0;
+
+    // Map a larger allocation so we can force alignment, but continue randomizing only on 64-bit POSIX.
+    size_t tryLen = len + (align - kPageAllocationGranularity);
+    RELEASE_ASSERT(tryLen >= len);
+    void* ret;
+
+    do {
+        // Don't continue to burn cycles on mandatory hints (Windows).
+        addr = kHintIsAdvisory ? getRandomPageBase() : nullptr;
+        ret = systemAllocPages(addr, tryLen, pageAccessibility);
+    // The retries are for Windows, where a race can steal our mapping on resize.
+    } while (ret && !(ret = trimMapping(ret, tryLen, len, align, pageAccessibility)));
+
+    return ret;
 }
 
 void freePages(void* addr, size_t len)
@@ -231,10 +244,21 @@
     // decommitSystemPages() here to avoid code duplication.
     decommitSystemPages(addr, len);
 #else
-    (void) addr;
-    (void) len;
-    // TODO(cevans): implement this using MEM_RESET for Windows, once we've
-    // decided that the semantics are a match.
+    // On Windows discarded pages are not returned to the system immediately and
+    // not guaranteed to be zeroed when returned to the application.
+    using DiscardVirtualMemoryFunction = DWORD(WINAPI*)(PVOID virtualAddress, SIZE_T size);
+    static DiscardVirtualMemoryFunction discardVirtualMemory = reinterpret_cast<DiscardVirtualMemoryFunction>(-1);
+    if (discardVirtualMemory == reinterpret_cast<DiscardVirtualMemoryFunction>(-1))
+        discardVirtualMemory = reinterpret_cast<DiscardVirtualMemoryFunction>(GetProcAddress(GetModuleHandle(L"Kernel32.dll"), "DiscardVirtualMemory"));
+    // Use DiscardVirtualMemory when available because it releases faster than MEM_RESET.
+    DWORD ret = 1;
+    if (discardVirtualMemory)
+        ret = discardVirtualMemory(addr, len);
+    // DiscardVirtualMemory is buggy in Win10 SP0, so fall back to MEM_RESET on failure.
+    if (ret) {
+        void* ret = VirtualAlloc(addr, len, MEM_RESET, PAGE_READWRITE);
+        RELEASE_ASSERT(ret);
+    }
 #endif
 }
 
diff --git a/third_party/WebKit/Source/wtf/SpinLock.cpp b/third_party/WebKit/Source/wtf/SpinLock.cpp
new file mode 100644
index 0000000..0b5586e
--- /dev/null
+++ b/third_party/WebKit/Source/wtf/SpinLock.cpp
@@ -0,0 +1,75 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "config.h"
+#include "wtf/SpinLock.h"
+
+#include "wtf/Atomics.h"
+#include "wtf/CPU.h"
+#include "wtf/Compiler.h"
+
+#if OS(WIN)
+#include <windows.h>
+#elif OS(POSIX)
+#include <sched.h>
+#endif
+
+// The YIELD_PROCESSOR macro wraps an architecture specific-instruction that
+// informs the processor we're in a busy wait, so it can handle the branch more
+// intelligently and e.g. reduce power to our core or give more resources to the
+// other hyper-thread on this core. See the following for context:
+// https://software.intel.com/en-us/articles/benefitting-power-and-performance-sleep-loops
+//
+// The YIELD_THREAD macro tells the OS to relinquish our quanta. This is
+// basically a worst-case fallback, and if you're hitting it with any frequency
+// you really should be using proper lock rather than these spinlocks.
+#if OS(WIN)
+#define YIELD_PROCESSOR YieldProcessor()
+#define YIELD_THREAD SwitchToThread()
+#elif COMPILER(GCC) || COMPILER(CLANG)
+#if CPU(X86_64) || CPU(X86)
+#define YIELD_PROCESSOR __asm__ __volatile__("pause")
+#elif CPU(ARM) || CPU(ARM64)
+#define YIELD_PROCESSOR __asm__ __volatile__("yield")
+#endif
+#endif
+
+#ifndef YIELD_PROCESSOR
+#warning "Processor yield not supported on this architecture."
+#define YIELD_PROCESSOR ((void)0)
+#endif
+
+#ifndef YIELD_THREAD
+#if OS(POSIX)
+#define YIELD_THREAD sched_yield()
+#else
+#warning "Thread yield not supported on this OS."
+#define YIELD_THREAD ((void)0)
+#endif
+#endif
+
+namespace WTF {
+
+void slowSpinLockLock(int volatile* lock)
+{
+    // The value of kYieldProcessorTries is cargo culted from TCMalloc, Windows
+    // critical section defaults, and various other recommendations.
+    // TODO(jschuh): Further tuning may be warranted.
+    static const int kYieldProcessorTries = 1000;
+    do {
+        do {
+            for (int count = 0; count < kYieldProcessorTries; ++count) {
+                // Let the Processor know we're spinning.
+                YIELD_PROCESSOR;
+                if (!*lock && LIKELY(!atomicTestAndSetToOne(lock)))
+                    return;
+            }
+
+            // Give the OS a chance to schedule something on this core.
+            YIELD_THREAD;
+        } while (*lock);
+    } while (UNLIKELY(atomicTestAndSetToOne(lock)));
+}
+
+} // namespace WTF
diff --git a/third_party/WebKit/Source/wtf/SpinLock.h b/third_party/WebKit/Source/wtf/SpinLock.h
index a51b04e..08724a3 100644
--- a/third_party/WebKit/Source/wtf/SpinLock.h
+++ b/third_party/WebKit/Source/wtf/SpinLock.h
@@ -34,17 +34,23 @@
 // DESCRIPTION
 // spinLockLock() and spinLockUnlock() are simple spinlock primitives based on
 // the standard CPU primitive of atomic increment and decrement of an int at
-// a given memory address.
+// a given memory address. These are intended only for very short duration locks
+// and assume a system with multiple cores. For any potentially longer wait you
+// should be using a real lock.
 
 #include "wtf/Atomics.h"
 
 namespace WTF {
 
+// This is called if the initial attempt to acquire the lock fails. It's a bit
+// slower, but has a much better scheduling and power consumption behavior.
+WTF_EXPORT void slowSpinLockLock(int volatile* lock);
+
 ALWAYS_INLINE void spinLockLock(int volatile* lock)
 {
-    while (UNLIKELY(atomicTestAndSetToOne(lock))) {
-        while (*lock) { } // Spin without spamming locked instructions.
-    }
+    if (LIKELY(!atomicTestAndSetToOne(lock)))
+        return;
+    slowSpinLockLock(lock);
 }
 
 ALWAYS_INLINE void spinLockUnlock(int volatile* lock)
diff --git a/third_party/WebKit/Source/wtf/wtf.gypi b/third_party/WebKit/Source/wtf/wtf.gypi
index 6c5866dd..b972a42 100644
--- a/third_party/WebKit/Source/wtf/wtf.gypi
+++ b/third_party/WebKit/Source/wtf/wtf.gypi
@@ -2,6 +2,7 @@
 {
     'variables': {
         'wtf_files': [
+            'ASCIICType.cpp',
             'ASCIICType.h',
             'AddressSanitizer.h',
             'AddressSpaceRandomization.cpp',
@@ -107,6 +108,7 @@
             'RetainPtr.h',
             'SaturatedArithmetic.h',
             'SizeLimits.cpp',
+            'SpinLock.cpp',
             'SpinLock.h',
             'StaticConstructors.h',
             'StdLibExtras.h',
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/common/checkout/scm/git.py b/third_party/WebKit/Tools/Scripts/webkitpy/common/checkout/scm/git.py
index 2e4d5ee..4d300df 100644
--- a/third_party/WebKit/Tools/Scripts/webkitpy/common/checkout/scm/git.py
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/common/checkout/scm/git.py
@@ -196,8 +196,11 @@
         git_log = self.most_recent_log_matching('Cr-Commit-Position:', path)
         return self._commit_position_from_git_log(git_log)
 
+    def _commit_position_regex_for_timestamp(self):
+        return 'Cr-Commit-Position:.*@{#%s}'
+
     def timestamp_of_revision(self, path, revision):
-        git_log = self.most_recent_log_matching('Cr-Commit-Position:.*@\{%s\}' % revision, path)
+        git_log = self.most_recent_log_matching(self._commit_position_regex_for_timestamp() % revision, path)
         match = re.search("^Date:\s*(\d{4})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2}) ([+-])(\d{2})(\d{2})$", git_log, re.MULTILINE)
         if not match:
             return ""
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/common/checkout/scm/scm_unittest.py b/third_party/WebKit/Tools/Scripts/webkitpy/common/checkout/scm/scm_unittest.py
index 9601bd90..2bea4cd 100644
--- a/third_party/WebKit/Tools/Scripts/webkitpy/common/checkout/scm/scm_unittest.py
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/common/checkout/scm/scm_unittest.py
@@ -375,6 +375,9 @@
         scm = self.tracking_scm
         self.assertEqual(scm._commit_position_from_git_log(git_log), 1234567)
 
+    def test_timestamp_of_revision(self):
+        scm = self.tracking_scm
+        scm.most_recent_log_matching(scm._commit_position_regex_for_timestamp(), scm.checkout_root)
 
 class GitSVNTest(SCMTestBase):
     def setUp(self):
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/base.py b/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/base.py
index 32250bea..575b431 100644
--- a/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/base.py
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/base.py
@@ -1587,7 +1587,7 @@
         return [
             # For example, to turn on force-compositing-mode in the svg/ directory:
             # PhysicalTestSuite('svg', ['--force-compositing-mode']),
-            PhysicalTestSuite('fast/text', ["--enable-direct-write", "--enable-font-antialiasing"]),
+            PhysicalTestSuite('fast/text', ["--always-use-complex-text", "--enable-direct-write", "--enable-font-antialiasing"]),
         ]
 
     def virtual_test_suites(self):
diff --git a/third_party/WebKit/public/blink_headers.gypi b/third_party/WebKit/public/blink_headers.gypi
index dee1970..53211940 100644
--- a/third_party/WebKit/public/blink_headers.gypi
+++ b/third_party/WebKit/public/blink_headers.gypi
@@ -360,7 +360,6 @@
       "web/WebDOMFileSystem.h",
       "web/WebDOMMediaStreamTrack.h",
       "web/WebDOMMessageEvent.h",
-      "web/WebDOMMouseEvent.h",
       "web/WebDOMProgressEvent.h",
       "web/WebDOMResourceProgressEvent.h",
       "web/WebDataSource.h",
@@ -425,7 +424,6 @@
       "web/WebMediaDevicesRequest.h",
       "web/WebMediaPlayerAction.h",
       "web/WebMediaStreamRegistry.h",
-      "web/WebMemoryUsageInfo.h",
       "web/WebMenuItemInfo.h",
       "web/WebNavigationPolicy.h",
       "web/WebNavigationType.h",
diff --git a/third_party/WebKit/public/platform/WebTaskRunner.h b/third_party/WebKit/public/platform/WebTaskRunner.h
index 6d12febc..4369ad9 100644
--- a/third_party/WebKit/public/platform/WebTaskRunner.h
+++ b/third_party/WebKit/public/platform/WebTaskRunner.h
@@ -28,14 +28,11 @@
 
     // Schedule a task to be run on the the associated WebThread.
     // Takes ownership of |Task|. Can be called from any thread.
-    virtual void postTask(const WebTraceLocation&, Task*) = 0;
+    virtual void postTask(const WebTraceLocation&, Task*) {}
 
     // Schedule a task to be run after |delayMs| on the the associated WebThread.
     // Takes ownership of |Task|. Can be called from any thread.
-    virtual void postDelayedTask(const WebTraceLocation&, Task*, double delayMs) = 0;
-
-    // Returns a clone of the WebTaskRunner.
-    virtual WebTaskRunner* clone() = 0;
+    virtual void postDelayedTask(const WebTraceLocation&, Task*, double delayMs) {}
 
 #ifdef INSIDE_BLINK
     // Helpers for posting bound functions as tasks.
diff --git a/third_party/WebKit/public/platform/WebURLLoader.h b/third_party/WebKit/public/platform/WebURLLoader.h
index 3a91423..eada222 100644
--- a/third_party/WebKit/public/platform/WebURLLoader.h
+++ b/third_party/WebKit/public/platform/WebURLLoader.h
@@ -37,7 +37,6 @@
 namespace blink {
 
 class WebData;
-class WebTaskRunner;
 class WebThreadedDataReceiver;
 class WebURLLoaderClient;
 class WebURLResponse;
@@ -79,10 +78,6 @@
     // of the data receiver is assumed by the WebURLLoader and the receiver should
     // be deleted on the main thread when no longer needed.
     virtual bool attachThreadedDataReceiver(WebThreadedDataReceiver*) { return false; }
-
-    // Sets the task runner for which any loading tasks should be posted on.
-    // Takes ownership of the WebTaskRunner.
-    virtual void setLoadingTaskRunner(WebTaskRunner*) = 0;
 };
 
 } // namespace blink
diff --git a/third_party/WebKit/public/web/WebAXEnums.h b/third_party/WebKit/public/web/WebAXEnums.h
index ccfbd50..ea1c58c 100644
--- a/third_party/WebKit/public/web/WebAXEnums.h
+++ b/third_party/WebKit/public/web/WebAXEnums.h
@@ -44,6 +44,7 @@
     WebAXEventBlur,
     WebAXEventCheckedStateChanged,
     WebAXEventChildrenChanged,
+    WebAXEventDocumentSelectionChanged,
     WebAXEventFocus,
     WebAXEventHide,
     WebAXEventHover,
diff --git a/third_party/WebKit/public/web/WebDOMEvent.h b/third_party/WebKit/public/web/WebDOMEvent.h
index 6d07505..0853b5d00 100644
--- a/third_party/WebKit/public/web/WebDOMEvent.h
+++ b/third_party/WebKit/public/web/WebDOMEvent.h
@@ -33,12 +33,6 @@
 
 #include "../platform/WebCommon.h"
 #include "../platform/WebPrivatePtr.h"
-#include "../platform/WebString.h"
-#include "WebNode.h"
-
-#if BLINK_IMPLEMENTATION
-namespace WTF { template <typename T> class PassRefPtr; }
-#endif
 
 namespace blink {
 
@@ -46,12 +40,6 @@
 
 class WebDOMEvent {
 public:
-    enum PhaseType {
-        CapturingPhase     = 1,
-        AtTarget           = 2,
-        BubblingPhase      = 3
-    };
-
     ~WebDOMEvent() { reset(); }
 
     WebDOMEvent() { }
@@ -67,30 +55,6 @@
 
     bool isNull() const { return m_private.isNull(); }
 
-    BLINK_EXPORT WebString type() const;
-    BLINK_EXPORT WebNode target() const;
-    BLINK_EXPORT WebNode currentTarget() const;
-
-    BLINK_EXPORT PhaseType eventPhase() const;
-    BLINK_EXPORT bool bubbles() const;
-    BLINK_EXPORT bool cancelable() const;
-
-    BLINK_EXPORT bool isUIEvent() const;
-    BLINK_EXPORT bool isMouseEvent() const;
-    BLINK_EXPORT bool isMutationEvent() const;
-    BLINK_EXPORT bool isKeyboardEvent() const;
-    BLINK_EXPORT bool isTextEvent() const;
-    BLINK_EXPORT bool isCompositionEvent() const;
-    BLINK_EXPORT bool isDragEvent() const;
-    BLINK_EXPORT bool isClipboardEvent() const;
-    BLINK_EXPORT bool isMessageEvent() const;
-    BLINK_EXPORT bool isWheelEvent() const;
-    BLINK_EXPORT bool isBeforeTextInsertedEvent() const;
-    BLINK_EXPORT bool isPageTransitionEvent() const;
-    BLINK_EXPORT bool isPopStateEvent() const;
-    BLINK_EXPORT bool isProgressEvent() const;
-    BLINK_EXPORT bool isXMLHttpRequestProgressEvent() const;
-
 #if BLINK_IMPLEMENTATION
     WebDOMEvent(const PassRefPtrWillBeRawPtr<Event>&);
     operator PassRefPtrWillBeRawPtr<Event>() const;
diff --git a/third_party/WebKit/public/web/WebDOMMouseEvent.h b/third_party/WebKit/public/web/WebDOMMouseEvent.h
deleted file mode 100644
index 3cdab456..0000000
--- a/third_party/WebKit/public/web/WebDOMMouseEvent.h
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Copyright (C) 2010 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- *     * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
- *     * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-#ifndef WebDOMMouseEvent_h
-#define WebDOMMouseEvent_h
-
-#include "WebDOMEvent.h"
-
-namespace blink {
-
-class WebDOMMouseEvent : public WebDOMEvent {
-public:
-    BLINK_EXPORT int screenX() const;
-    BLINK_EXPORT int screenY() const;
-    BLINK_EXPORT int clientX() const;
-    BLINK_EXPORT int clientY() const;
-    BLINK_EXPORT int offsetX();
-    BLINK_EXPORT int offsetY();
-    BLINK_EXPORT int pageX() const;
-    BLINK_EXPORT int pageY() const;
-    BLINK_EXPORT int x() const;
-    BLINK_EXPORT int y() const;
-
-    BLINK_EXPORT int button() const;
-    BLINK_EXPORT bool buttonDown() const;
-};
-
-} // namespace blink
-
-#endif
diff --git a/third_party/WebKit/public/web/WebMemoryUsageInfo.h b/third_party/WebKit/public/web/WebMemoryUsageInfo.h
deleted file mode 100644
index 9cfcfea..0000000
--- a/third_party/WebKit/public/web/WebMemoryUsageInfo.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Copyright (C) 2013 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *  * Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *  * Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef WebMemoryUsageInfo_h
-#define WebMemoryUsageInfo_h
-
-#include "../platform/WebString.h"
-
-namespace blink {
-
-struct WebMemoryUsageInfo {
-    WebMemoryUsageInfo(const WebString& allocator, size_t allocated)
-        : allocatorName(allocator)
-        , allocatedBytes(allocated)
-    {
-    }
-
-    WebMemoryUsageInfo()
-        : allocatedBytes(0)
-    {
-    }
-
-    WebString allocatorName;
-    size_t allocatedBytes;
-};
-
-} // namespace blink
-
-#endif // WebMemoryUsageInfo_h
diff --git a/third_party/errorprone/BUILD.gn b/third_party/errorprone/BUILD.gn
index 8fb2bd3..8274bfb 100644
--- a/third_party/errorprone/BUILD.gn
+++ b/third_party/errorprone/BUILD.gn
@@ -35,4 +35,7 @@
     "//third_party/findbugs:format_string_java",
   ]
   main_class = "com.google.errorprone.ErrorProneCompiler"
+
+  # TODO(mikecase): Remove this extra arg when the bots are on jdk8 or higher.
+  extra_java_args = "-Xbootclasspath/p:$target_gen_dir/javac_java.jar"
 }
diff --git a/third_party/errorprone/errorprone.gyp b/third_party/errorprone/errorprone.gyp
index 0378dde..4a1f6a1 100644
--- a/third_party/errorprone/errorprone.gyp
+++ b/third_party/errorprone/errorprone.gyp
@@ -83,6 +83,8 @@
           'action': [
             'python', '<(DEPTH)/build/android/gyp/create_java_binary_script.py',
             '--output', '<(PRODUCT_DIR)/bin.java/chromium_errorprone',
+            # TODO(mikecase): Remove this extra arg when the bots are on jdk8 or higher.
+            '--extra-java-args', '-Xbootclasspath/p:<(PRODUCT_DIR)/lib.java/javac_jar.jar',
             '--jar-path=<(jar_path)',
             '--classpath=>@(input_jars_paths)',
             '--main-class=com.google.errorprone.ErrorProneCompiler',
diff --git a/third_party/harfbuzz-ng/NEWS b/third_party/harfbuzz-ng/NEWS
index 67bef7f..b90064f1 100644
--- a/third_party/harfbuzz-ng/NEWS
+++ b/third_party/harfbuzz-ng/NEWS
@@ -1,3 +1,45 @@
+Overview of changes leading to 1.0.5
+Tuesday, October 13, 2015
+====================================
+
+- Fix multiple memory access bugs discovered using libFuzzer.
+  https://github.com/behdad/harfbuzz/issues/139
+  Everyone should upgrade to this version as soon as possible.
+  We now have continuous fuzzing set up, to avoid issues like
+  these creeping in again.
+- Misc fixes.
+
+- New API:
+  * hb_font_set_parent().
+  * hb_ft_font_[sg]et_load_flags()
+    The default flags for fonts created using hb_ft_font_create()
+    has changed to default to FT_LOAD_DEFAULT now.  Previously it
+    was defaulting to FT_LOAD_DFEAULT|FT_LOAD_NO_HINTING.
+
+- API changes:
+  * Fonts now default to units-per-EM as their scale, instead of 0.
+  * hb_font_create_sub_font() does NOT make parent font immutable
+    anymore.  hb_font_make_immutable() does.
+
+
+Overview of changes leading to 1.0.4
+Wednesday, September 30, 2015
+====================================
+
+- Fix minor out-of-bounds read error.
+
+
+Overview of changes leading to 1.0.3
+Tuesday, September 1, 2015
+====================================
+
+- Start of user documentation, from Simon Cozens!
+- Implement glyph_extents() for TrueType fonts in hb-ot-font.
+- Improve GPOS cursive attachments with conflicting lookups.
+- More fixes for cluster-level = 1.
+- Uniscribe positioning fix.
+
+
 Overview of changes leading to 1.0.2
 Wednesday, August 19, 2015
 ====================================
diff --git a/third_party/harfbuzz-ng/README.chromium b/third_party/harfbuzz-ng/README.chromium
index 2a66866..6013ff3 100644
--- a/third_party/harfbuzz-ng/README.chromium
+++ b/third_party/harfbuzz-ng/README.chromium
@@ -1,8 +1,8 @@
 Name: harfbuzz-ng
 Short Name: harfbuzz-ng
 URL: http://harfbuzz.org
-Version: 1.0.2
-Date: 20150820
+Version: 1.0.5
+Date: 20151013
 Security Critical: yes
 License: MIT
 License File: COPYING
@@ -19,5 +19,3 @@
 the NEWS file from HarfBuzz' release notes, and bump the version numbers
 in README.chromium.
 
-Local changes:
-* merge https://github.com/behdad/harfbuzz/commit/2b646fa07f5f9d4d1
diff --git a/third_party/harfbuzz-ng/src/hb-blob.cc b/third_party/harfbuzz-ng/src/hb-blob.cc
index 8759a25..a6870dc 100644
--- a/third_party/harfbuzz-ng/src/hb-blob.cc
+++ b/third_party/harfbuzz-ng/src/hb-blob.cc
@@ -91,7 +91,7 @@
  * Return value: New blob, or the empty blob if something failed or if @length is
  * zero.  Destroy with hb_blob_destroy().
  *
- * Since: 1.0
+ * Since: 0.9.2
  **/
 hb_blob_t *
 hb_blob_create (const char        *data,
@@ -147,7 +147,7 @@
  * @length is zero or @offset is beyond the end of @parent's data.  Destroy
  * with hb_blob_destroy().
  *
- * Since: 1.0
+ * Since: 0.9.2
  **/
 hb_blob_t *
 hb_blob_create_sub_blob (hb_blob_t    *parent,
@@ -179,7 +179,7 @@
  *
  * Return value: (transfer full): the empty blob.
  *
- * Since: 1.0
+ * Since: 0.9.2
  **/
 hb_blob_t *
 hb_blob_get_empty (void)
@@ -210,7 +210,7 @@
  *
  * Return value: @blob.
  *
- * Since: 1.0
+ * Since: 0.9.2
  **/
 hb_blob_t *
 hb_blob_reference (hb_blob_t *blob)
@@ -228,7 +228,7 @@
  *
  * See TODO:link object types for more information.
  *
- * Since: 1.0
+ * Since: 0.9.2
  **/
 void
 hb_blob_destroy (hb_blob_t *blob)
@@ -250,7 +250,7 @@
  *
  * Return value: 
  *
- * Since: 1.0
+ * Since: 0.9.2
  **/
 hb_bool_t
 hb_blob_set_user_data (hb_blob_t          *blob,
@@ -271,7 +271,7 @@
  *
  * Return value: (transfer none): 
  *
- * Since: 1.0
+ * Since: 0.9.2
  **/
 void *
 hb_blob_get_user_data (hb_blob_t          *blob,
@@ -287,7 +287,7 @@
  *
  * 
  *
- * Since: 1.0
+ * Since: 0.9.2
  **/
 void
 hb_blob_make_immutable (hb_blob_t *blob)
@@ -306,7 +306,7 @@
  *
  * Return value: TODO
  *
- * Since: 1.0
+ * Since: 0.9.2
  **/
 hb_bool_t
 hb_blob_is_immutable (hb_blob_t *blob)
@@ -323,7 +323,7 @@
  *
  * Return value: the length of blob data in bytes.
  *
- * Since: 1.0
+ * Since: 0.9.2
  **/
 unsigned int
 hb_blob_get_length (hb_blob_t *blob)
@@ -340,7 +340,7 @@
  *
  * Returns: (transfer none) (array length=length): 
  *
- * Since: 1.0
+ * Since: 0.9.2
  **/
 const char *
 hb_blob_get_data (hb_blob_t *blob, unsigned int *length)
@@ -365,7 +365,7 @@
  * Returns: (transfer none) (array length=length): Writable blob data,
  * or %NULL if failed.
  *
- * Since: 1.0
+ * Since: 0.9.2
  **/
 char *
 hb_blob_get_data_writable (hb_blob_t *blob, unsigned int *length)
diff --git a/third_party/harfbuzz-ng/src/hb-buffer-private.hh b/third_party/harfbuzz-ng/src/hb-buffer-private.hh
index 9aa5e7d..7fed738 100644
--- a/third_party/harfbuzz-ng/src/hb-buffer-private.hh
+++ b/third_party/harfbuzz-ng/src/hb-buffer-private.hh
@@ -201,6 +201,8 @@
   HB_INTERNAL scratch_buffer_t *get_scratch_buffer (unsigned int *size);
 
   inline void clear_context (unsigned int side) { context_len[side] = 0; }
+
+  HB_INTERNAL void sort (unsigned int start, unsigned int end, int(*compar)(const hb_glyph_info_t *, const hb_glyph_info_t *));
 };
 
 
diff --git a/third_party/harfbuzz-ng/src/hb-buffer-serialize.cc b/third_party/harfbuzz-ng/src/hb-buffer-serialize.cc
index 8a22224..7839cbc 100644
--- a/third_party/harfbuzz-ng/src/hb-buffer-serialize.cc
+++ b/third_party/harfbuzz-ng/src/hb-buffer-serialize.cc
@@ -40,7 +40,7 @@
  *
  * Return value: (transfer none):
  *
- * Since: 1.0
+ * Since: 0.9.2
  **/
 const char **
 hb_buffer_serialize_list_formats (void)
@@ -57,7 +57,7 @@
  *
  * Return value: 
  *
- * Since: 1.0
+ * Since: 0.9.2
  **/
 hb_buffer_serialize_format_t
 hb_buffer_serialize_format_from_string (const char *str, int len)
@@ -74,7 +74,7 @@
  *
  * Return value: 
  *
- * Since: 1.0
+ * Since: 0.9.2
  **/
 const char *
 hb_buffer_serialize_format_to_string (hb_buffer_serialize_format_t format)
@@ -145,6 +145,16 @@
 		     pos[i].x_advance, pos[i].y_advance);
     }
 
+    if (flags & HB_BUFFER_SERIALIZE_FLAG_GLYPH_EXTENTS)
+    {
+      hb_glyph_extents_t extents;
+      hb_font_get_glyph_extents(font, info[i].codepoint, &extents);
+      p += MAX (0, snprintf (p, ARRAY_LENGTH (b) - (p - b), ",\"xb\":%d,\"yb\":%d",
+        extents.x_bearing, extents.y_bearing));
+      p += MAX (0, snprintf (p, ARRAY_LENGTH (b) - (p - b), ",\"w\":%d,\"h\":%d",
+        extents.width, extents.height));
+    }
+
     *p++ = '}';
 
     unsigned int l = p - b;
@@ -210,6 +220,13 @@
 	p += MAX (0, snprintf (p, ARRAY_LENGTH (b) - (p - b), ",%d", pos[i].y_advance));
     }
 
+    if (flags & HB_BUFFER_SERIALIZE_FLAG_GLYPH_EXTENTS)
+    {
+      hb_glyph_extents_t extents;
+      hb_font_get_glyph_extents(font, info[i].codepoint, &extents);
+      p += MAX (0, snprintf (p, ARRAY_LENGTH (b) - (p - b), "<%d,%d,%d,%d>", extents.x_bearing, extents.y_bearing, extents.width, extents.height));
+    }
+
     unsigned int l = p - b;
     if (buf_size > l)
     {
@@ -242,7 +259,7 @@
  *
  * Return value: 
  *
- * Since: 1.0
+ * Since: 0.9.2
  **/
 unsigned int
 hb_buffer_serialize_glyphs (hb_buffer_t *buffer,
@@ -349,7 +366,7 @@
  *
  * Return value: 
  *
- * Since: 1.0
+ * Since: 0.9.2
  **/
 hb_bool_t
 hb_buffer_deserialize_glyphs (hb_buffer_t *buffer,
diff --git a/third_party/harfbuzz-ng/src/hb-buffer.cc b/third_party/harfbuzz-ng/src/hb-buffer.cc
index 03fe8e13..50710dd2 100644
--- a/third_party/harfbuzz-ng/src/hb-buffer.cc
+++ b/third_party/harfbuzz-ng/src/hb-buffer.cc
@@ -704,7 +704,7 @@
  *
  * Return value: (transfer full)
  *
- * Since: 1.0
+ * Since: 0.9.2
  **/
 hb_buffer_t *
 hb_buffer_create (void)
@@ -726,7 +726,7 @@
  *
  * Return value: (transfer full):
  *
- * Since: 1.0
+ * Since: 0.9.2
  **/
 hb_buffer_t *
 hb_buffer_get_empty (void)
@@ -759,7 +759,7 @@
  *
  * Return value: (transfer full):
  *
- * Since: 1.0
+ * Since: 0.9.2
  **/
 hb_buffer_t *
 hb_buffer_reference (hb_buffer_t *buffer)
@@ -773,7 +773,7 @@
  *
  * 
  *
- * Since: 1.0
+ * Since: 0.9.2
  **/
 void
 hb_buffer_destroy (hb_buffer_t *buffer)
@@ -800,7 +800,7 @@
  *
  * Return value: 
  *
- * Since: 1.0
+ * Since: 0.9.2
  **/
 hb_bool_t
 hb_buffer_set_user_data (hb_buffer_t        *buffer,
@@ -821,7 +821,7 @@
  *
  * Return value: 
  *
- * Since: 1.0
+ * Since: 0.9.2
  **/
 void *
 hb_buffer_get_user_data (hb_buffer_t        *buffer,
@@ -871,7 +871,7 @@
  *
  * 
  *
- * Since: 1.0
+ * Since: 0.9.2
  **/
 void
 hb_buffer_set_unicode_funcs (hb_buffer_t        *buffer,
@@ -897,7 +897,7 @@
  *
  * Return value: 
  *
- * Since: 1.0
+ * Since: 0.9.2
  **/
 hb_unicode_funcs_t *
 hb_buffer_get_unicode_funcs (hb_buffer_t        *buffer)
@@ -912,7 +912,7 @@
  *
  * 
  *
- * Since: 1.0
+ * Since: 0.9.2
  **/
 void
 hb_buffer_set_direction (hb_buffer_t    *buffer,
@@ -933,7 +933,7 @@
  *
  * Return value: 
  *
- * Since: 1.0
+ * Since: 0.9.2
  **/
 hb_direction_t
 hb_buffer_get_direction (hb_buffer_t    *buffer)
@@ -948,7 +948,7 @@
  *
  * 
  *
- * Since: 1.0
+ * Since: 0.9.2
  **/
 void
 hb_buffer_set_script (hb_buffer_t *buffer,
@@ -968,7 +968,7 @@
  *
  * Return value: 
  *
- * Since: 1.0
+ * Since: 0.9.2
  **/
 hb_script_t
 hb_buffer_get_script (hb_buffer_t *buffer)
@@ -983,7 +983,7 @@
  *
  * 
  *
- * Since: 1.0
+ * Since: 0.9.2
  **/
 void
 hb_buffer_set_language (hb_buffer_t   *buffer,
@@ -1003,7 +1003,7 @@
  *
  * Return value: (transfer none):
  *
- * Since: 1.0
+ * Since: 0.9.2
  **/
 hb_language_t
 hb_buffer_get_language (hb_buffer_t *buffer)
@@ -1160,7 +1160,7 @@
  *
  * 
  *
- * Since: 1.0
+ * Since: 0.9.2
  **/
 void
 hb_buffer_reset (hb_buffer_t *buffer)
@@ -1191,7 +1191,7 @@
  *
  * Return value: 
  *
- * Since: 1.0
+ * Since: 0.9.2
  **/
 hb_bool_t
 hb_buffer_pre_allocate (hb_buffer_t *buffer, unsigned int size)
@@ -1207,7 +1207,7 @@
  *
  * Return value: 
  *
- * Since: 1.0
+ * Since: 0.9.2
  **/
 hb_bool_t
 hb_buffer_allocation_successful (hb_buffer_t  *buffer)
@@ -1223,7 +1223,7 @@
  *
  * 
  *
- * Since: 1.0
+ * Since: 0.9.7
  **/
 void
 hb_buffer_add (hb_buffer_t    *buffer,
@@ -1243,7 +1243,7 @@
  *
  * Return value: 
  *
- * Since: 1.0
+ * Since: 0.9.2
  **/
 hb_bool_t
 hb_buffer_set_length (hb_buffer_t  *buffer,
@@ -1282,7 +1282,7 @@
  *
  * Return value: buffer length.
  *
- * Since: 1.0
+ * Since: 0.9.2
  **/
 unsigned int
 hb_buffer_get_length (hb_buffer_t *buffer)
@@ -1300,7 +1300,7 @@
  *
  * Return value: (transfer none) (array length=length): buffer glyph information array.
  *
- * Since: 1.0
+ * Since: 0.9.2
  **/
 hb_glyph_info_t *
 hb_buffer_get_glyph_infos (hb_buffer_t  *buffer,
@@ -1322,7 +1322,7 @@
  *
  * Return value: (transfer none) (array length=length): buffer glyph position array.
  *
- * Since: 1.0
+ * Since: 0.9.2
  **/
 hb_glyph_position_t *
 hb_buffer_get_glyph_positions (hb_buffer_t  *buffer,
@@ -1343,7 +1343,7 @@
  *
  * Reverses buffer contents.
  *
- * Since: 1.0
+ * Since: 0.9.2
  **/
 void
 hb_buffer_reverse (hb_buffer_t *buffer)
@@ -1357,9 +1357,9 @@
  * @start: start index.
  * @end: end index.
  *
- * Reverses buffer contents between  start to end.
+ * Reverses buffer contents between start to end.
  *
- * Since: 1.0
+ * Since: 0.9.41
  **/
 void
 hb_buffer_reverse_range (hb_buffer_t *buffer,
@@ -1376,7 +1376,7 @@
  * reversed, then each cluster (consecutive items having the
  * same cluster number) are reversed again.
  *
- * Since: 1.0
+ * Since: 0.9.2
  **/
 void
 hb_buffer_reverse_clusters (hb_buffer_t *buffer)
@@ -1493,7 +1493,7 @@
  *
  * 
  *
- * Since: 1.0
+ * Since: 0.9.2
  **/
 void
 hb_buffer_add_utf8 (hb_buffer_t  *buffer,
@@ -1515,7 +1515,7 @@
  *
  * 
  *
- * Since: 1.0
+ * Since: 0.9.2
  **/
 void
 hb_buffer_add_utf16 (hb_buffer_t    *buffer,
@@ -1537,7 +1537,7 @@
  *
  * 
  *
- * Since: 1.0
+ * Since: 0.9.2
  **/
 void
 hb_buffer_add_utf32 (hb_buffer_t    *buffer,
@@ -1636,7 +1636,7 @@
     pos[end - 1].x_advance = total_x_advance;
     pos[end - 1].y_advance = total_y_advance;
 
-    hb_bubble_sort (buffer->info + start, end - start - 1, compare_info_codepoint, buffer->pos + start);
+    hb_stable_sort (buffer->info + start, end - start - 1, compare_info_codepoint, buffer->pos + start);
   } else {
     /* Transfer all cluster advance to the first glyph. */
     pos[start].x_advance += total_x_advance;
@@ -1645,7 +1645,7 @@
       pos[i].x_offset -= total_x_advance;
       pos[i].y_offset -= total_y_advance;
     }
-    hb_bubble_sort (buffer->info + start + 1, end - start - 1, compare_info_codepoint, buffer->pos + start + 1);
+    hb_stable_sort (buffer->info + start + 1, end - start - 1, compare_info_codepoint, buffer->pos + start + 1);
   }
 }
 
@@ -1678,3 +1678,24 @@
     }
   normalize_glyphs_cluster (buffer, start, end, backward);
 }
+
+void
+hb_buffer_t::sort (unsigned int start, unsigned int end, int(*compar)(const hb_glyph_info_t *, const hb_glyph_info_t *))
+{
+  assert (!have_positions);
+  for (unsigned int i = start + 1; i < end; i++)
+  {
+    unsigned int j = i;
+    while (j > start && compar (&info[j - 1], &info[i]) > 0)
+      j--;
+    if (i == j)
+      continue;
+    /* Move item i to occupy place for item j, shift what's in between. */
+    merge_clusters (j, i + 1);
+    {
+      hb_glyph_info_t t = info[i];
+      memmove (&info[j + 1], &info[j], (i - j) * sizeof (hb_glyph_info_t));
+      info[j] = t;
+    }
+  }
+}
diff --git a/third_party/harfbuzz-ng/src/hb-buffer.h b/third_party/harfbuzz-ng/src/hb-buffer.h
index 4b285bb..bb89dc3d 100644
--- a/third_party/harfbuzz-ng/src/hb-buffer.h
+++ b/third_party/harfbuzz-ng/src/hb-buffer.h
@@ -171,6 +171,9 @@
 hb_buffer_guess_segment_properties (hb_buffer_t *buffer);
 
 
+/*
+ * Since: 0.9.20
+ */
 typedef enum { /*< flags >*/
   HB_BUFFER_FLAG_DEFAULT			= 0x00000000u,
   HB_BUFFER_FLAG_BOT				= 0x00000001u, /* Beginning-of-text */
@@ -185,6 +188,9 @@
 hb_buffer_flags_t
 hb_buffer_get_flags (hb_buffer_t *buffer);
 
+/*
+ * Since: 0.9.42
+ */
 typedef enum {
   HB_BUFFER_CLUSTER_LEVEL_MONOTONE_GRAPHEMES	= 0,
   HB_BUFFER_CLUSTER_LEVEL_MONOTONE_CHARACTERS	= 1,
@@ -319,11 +325,15 @@
  * Serialize
  */
 
+/*
+ * Since: 0.9.20
+ */
 typedef enum { /*< flags >*/
   HB_BUFFER_SERIALIZE_FLAG_DEFAULT		= 0x00000000u,
   HB_BUFFER_SERIALIZE_FLAG_NO_CLUSTERS		= 0x00000001u,
   HB_BUFFER_SERIALIZE_FLAG_NO_POSITIONS		= 0x00000002u,
-  HB_BUFFER_SERIALIZE_FLAG_NO_GLYPH_NAMES	= 0x00000004u
+  HB_BUFFER_SERIALIZE_FLAG_NO_GLYPH_NAMES	= 0x00000004u,
+  HB_BUFFER_SERIALIZE_FLAG_GLYPH_EXTENTS	= 0x00000008u
 } hb_buffer_serialize_flags_t;
 
 typedef enum {
diff --git a/third_party/harfbuzz-ng/src/hb-common.cc b/third_party/harfbuzz-ng/src/hb-common.cc
index d510c9be..e67059d 100644
--- a/third_party/harfbuzz-ng/src/hb-common.cc
+++ b/third_party/harfbuzz-ng/src/hb-common.cc
@@ -64,7 +64,7 @@
  *
  * Return value: 
  *
- * Since: 1.0
+ * Since: 0.9.2
  **/
 hb_tag_t
 hb_tag_from_string (const char *str, int len)
@@ -122,7 +122,7 @@
  *
  * Return value: 
  *
- * Since: 1.0
+ * Since: 0.9.2
  **/
 hb_direction_t
 hb_direction_from_string (const char *str, int len)
@@ -149,7 +149,7 @@
  *
  * Return value: (transfer none): 
  *
- * Since: 1.0
+ * Since: 0.9.2
  **/
 const char *
 hb_direction_to_string (hb_direction_t direction)
@@ -288,26 +288,26 @@
  *
  * Return value: (transfer none):
  *
- * Since: 1.0
+ * Since: 0.9.2
  **/
 hb_language_t
 hb_language_from_string (const char *str, int len)
 {
-  char strbuf[64];
-
   if (!str || !len || !*str)
     return HB_LANGUAGE_INVALID;
 
+  hb_language_item_t *item = NULL;
   if (len >= 0)
   {
     /* NUL-terminate it. */
+    char strbuf[64];
     len = MIN (len, (int) sizeof (strbuf) - 1);
     memcpy (strbuf, str, len);
     strbuf[len] = '\0';
-    str = strbuf;
+    item = lang_find_or_insert (strbuf);
   }
-
-  hb_language_item_t *item = lang_find_or_insert (str);
+  else
+    item = lang_find_or_insert (str);
 
   return likely (item) ? item->lang : HB_LANGUAGE_INVALID;
 }
@@ -320,7 +320,7 @@
  *
  * Return value: (transfer none): 
  *
- * Since: 1.0
+ * Since: 0.9.2
  **/
 const char *
 hb_language_to_string (hb_language_t language)
@@ -336,7 +336,7 @@
  *
  * Return value: (transfer none):
  *
- * Since: 1.0
+ * Since: 0.9.2
  **/
 hb_language_t
 hb_language_get_default (void)
@@ -363,7 +363,7 @@
  *
  * Return value: 
  *
- * Since: 1.0
+ * Since: 0.9.2
  **/
 hb_script_t
 hb_script_from_iso15924_tag (hb_tag_t tag)
@@ -408,7 +408,7 @@
  *
  * Return value: 
  *
- * Since: 1.0
+ * Since: 0.9.2
  **/
 hb_script_t
 hb_script_from_string (const char *s, int len)
@@ -424,7 +424,7 @@
  *
  * Return value: 
  *
- * Since: 1.0
+ * Since: 0.9.2
  **/
 hb_tag_t
 hb_script_to_iso15924_tag (hb_script_t script)
@@ -440,7 +440,7 @@
  *
  * Return value: 
  *
- * Since: 1.0
+ * Since: 0.9.2
  **/
 hb_direction_t
 hb_script_get_horizontal_direction (hb_script_t script)
@@ -545,7 +545,7 @@
  *
  * Returns library version as three integer components.
  *
- * Since: 1.0
+ * Since: 0.9.2
  **/
 void
 hb_version (unsigned int *major,
@@ -564,7 +564,7 @@
  *
  * Return value: library version string.
  *
- * Since: 1.0
+ * Since: 0.9.2
  **/
 const char *
 hb_version_string (void)
diff --git a/third_party/harfbuzz-ng/src/hb-common.h b/third_party/harfbuzz-ng/src/hb-common.h
index d160be5..c291dbbe 100644
--- a/third_party/harfbuzz-ng/src/hb-common.h
+++ b/third_party/harfbuzz-ng/src/hb-common.h
@@ -272,6 +272,9 @@
   /*6.1*/ HB_SCRIPT_SORA_SOMPENG		= HB_TAG ('S','o','r','a'),
   /*6.1*/ HB_SCRIPT_TAKRI			= HB_TAG ('T','a','k','r'),
 
+  /*
+   * Since: 0.9.30
+   */
   /*7.0*/ HB_SCRIPT_BASSA_VAH			= HB_TAG ('B','a','s','s'),
   /*7.0*/ HB_SCRIPT_CAUCASIAN_ALBANIAN		= HB_TAG ('A','g','h','b'),
   /*7.0*/ HB_SCRIPT_DUPLOYAN			= HB_TAG ('D','u','p','l'),
diff --git a/third_party/harfbuzz-ng/src/hb-coretext.cc b/third_party/harfbuzz-ng/src/hb-coretext.cc
index a9664ee..13ba5d9 100644
--- a/third_party/harfbuzz-ng/src/hb-coretext.cc
+++ b/third_party/harfbuzz-ng/src/hb-coretext.cc
@@ -125,6 +125,9 @@
   CFRelease (data);
 }
 
+/*
+ * Since: 0.9.10
+ */
 CGFontRef
 hb_coretext_face_get_cg_font (hb_face_t *face)
 {
diff --git a/third_party/harfbuzz-ng/src/hb-face.cc b/third_party/harfbuzz-ng/src/hb-face.cc
index 96ea1da..9effc41 100644
--- a/third_party/harfbuzz-ng/src/hb-face.cc
+++ b/third_party/harfbuzz-ng/src/hb-face.cc
@@ -77,7 +77,7 @@
  *
  * Return value: (transfer full)
  *
- * Since: 1.0
+ * Since: 0.9.2
  **/
 hb_face_t *
 hb_face_create_for_tables (hb_reference_table_func_t  reference_table_func,
@@ -113,7 +113,7 @@
 {
   hb_face_for_data_closure_t *closure;
 
-  closure = (hb_face_for_data_closure_t *) malloc (sizeof (hb_face_for_data_closure_t));
+  closure = (hb_face_for_data_closure_t *) calloc (1, sizeof (hb_face_for_data_closure_t));
   if (unlikely (!closure))
     return NULL;
 
@@ -157,7 +157,7 @@
  *
  * Return value: (transfer full):
  *
- * Since: 1.0
+ * Since: 0.9.2
  **/
 hb_face_t *
 hb_face_create (hb_blob_t    *blob,
@@ -189,7 +189,7 @@
  *
  * Return value: (transfer full)
  *
- * Since: 1.0
+ * Since: 0.9.2
  **/
 hb_face_t *
 hb_face_get_empty (void)
@@ -206,7 +206,7 @@
  *
  * Return value: 
  *
- * Since: 1.0
+ * Since: 0.9.2
  **/
 hb_face_t *
 hb_face_reference (hb_face_t *face)
@@ -220,7 +220,7 @@
  *
  * 
  *
- * Since: 1.0
+ * Since: 0.9.2
  **/
 void
 hb_face_destroy (hb_face_t *face)
@@ -257,7 +257,7 @@
  *
  * Return value: 
  *
- * Since: 1.0
+ * Since: 0.9.2
  **/
 hb_bool_t
 hb_face_set_user_data (hb_face_t          *face,
@@ -278,7 +278,7 @@
  *
  * Return value: (transfer none):
  *
- * Since: 1.0
+ * Since: 0.9.2
  **/
 void *
 hb_face_get_user_data (hb_face_t          *face,
@@ -293,7 +293,7 @@
  *
  * 
  *
- * Since: 1.0
+ * Since: 0.9.2
  **/
 void
 hb_face_make_immutable (hb_face_t *face)
@@ -312,7 +312,7 @@
  *
  * Return value: 
  *
- * Since: 1.0
+ * Since: 0.9.2
  **/
 hb_bool_t
 hb_face_is_immutable (hb_face_t *face)
@@ -330,7 +330,7 @@
  *
  * Return value: (transfer full):
  *
- * Since: 1.0
+ * Since: 0.9.2
  **/
 hb_blob_t *
 hb_face_reference_table (hb_face_t *face,
@@ -417,7 +417,7 @@
  *
  * Return value: 
  *
- * Since: 1.0
+ * Since: 0.9.2
  **/
 unsigned int
 hb_face_get_upem (hb_face_t *face)
diff --git a/third_party/harfbuzz-ng/src/hb-font-private.hh b/third_party/harfbuzz-ng/src/hb-font-private.hh
index 33bbf71..c05499d 100644
--- a/third_party/harfbuzz-ng/src/hb-font-private.hh
+++ b/third_party/harfbuzz-ng/src/hb-font-private.hh
@@ -268,7 +268,7 @@
   {
     *x = get_glyph_h_advance (glyph) / 2;
 
-    /* TODO use font_metics.ascent */
+    /* TODO use font_metrics.ascent */
     *y = y_scale;
   }
 
diff --git a/third_party/harfbuzz-ng/src/hb-font.cc b/third_party/harfbuzz-ng/src/hb-font.cc
index 0cfba83..6a69cae 100644
--- a/third_party/harfbuzz-ng/src/hb-font.cc
+++ b/third_party/harfbuzz-ng/src/hb-font.cc
@@ -236,7 +236,7 @@
  *
  * Return value: (transfer full): 
  *
- * Since: 1.0
+ * Since: 0.9.2
  **/
 hb_font_funcs_t *
 hb_font_funcs_create (void)
@@ -258,7 +258,7 @@
  *
  * Return value: (transfer full): 
  *
- * Since: 1.0
+ * Since: 0.9.2
  **/
 hb_font_funcs_t *
 hb_font_funcs_get_empty (void)
@@ -274,7 +274,7 @@
  *
  * Return value: 
  *
- * Since: 1.0
+ * Since: 0.9.2
  **/
 hb_font_funcs_t *
 hb_font_funcs_reference (hb_font_funcs_t *ffuncs)
@@ -288,7 +288,7 @@
  *
  * 
  *
- * Since: 1.0
+ * Since: 0.9.2
  **/
 void
 hb_font_funcs_destroy (hb_font_funcs_t *ffuncs)
@@ -315,7 +315,7 @@
  *
  * Return value: 
  *
- * Since: 1.0
+ * Since: 0.9.2
  **/
 hb_bool_t
 hb_font_funcs_set_user_data (hb_font_funcs_t    *ffuncs,
@@ -336,7 +336,7 @@
  *
  * Return value: (transfer none): 
  *
- * Since: 1.0
+ * Since: 0.9.2
  **/
 void *
 hb_font_funcs_get_user_data (hb_font_funcs_t    *ffuncs,
@@ -352,7 +352,7 @@
  *
  * 
  *
- * Since: 1.0
+ * Since: 0.9.2
  **/
 void
 hb_font_funcs_make_immutable (hb_font_funcs_t *ffuncs)
@@ -371,7 +371,7 @@
  *
  * Return value: 
  *
- * Since: 1.0
+ * Since: 0.9.2
  **/
 hb_bool_t
 hb_font_funcs_is_immutable (hb_font_funcs_t *ffuncs)
@@ -425,7 +425,7 @@
  *
  * Return value: 
  *
- * Since: 1.0
+ * Since: 0.9.2
  **/
 hb_bool_t
 hb_font_get_glyph (hb_font_t *font,
@@ -444,7 +444,7 @@
  *
  * Return value: 
  *
- * Since: 1.0
+ * Since: 0.9.2
  **/
 hb_position_t
 hb_font_get_glyph_h_advance (hb_font_t *font,
@@ -462,7 +462,7 @@
  *
  * Return value: 
  *
- * Since: 1.0
+ * Since: 0.9.2
  **/
 hb_position_t
 hb_font_get_glyph_v_advance (hb_font_t *font,
@@ -482,7 +482,7 @@
  *
  * Return value: 
  *
- * Since: 1.0
+ * Since: 0.9.2
  **/
 hb_bool_t
 hb_font_get_glyph_h_origin (hb_font_t *font,
@@ -503,7 +503,7 @@
  *
  * Return value: 
  *
- * Since: 1.0
+ * Since: 0.9.2
  **/
 hb_bool_t
 hb_font_get_glyph_v_origin (hb_font_t *font,
@@ -523,7 +523,7 @@
  *
  * Return value: 
  *
- * Since: 1.0
+ * Since: 0.9.2
  **/
 hb_position_t
 hb_font_get_glyph_h_kerning (hb_font_t *font,
@@ -542,7 +542,7 @@
  *
  * Return value: 
  *
- * Since: 1.0
+ * Since: 0.9.2
  **/
 hb_position_t
 hb_font_get_glyph_v_kerning (hb_font_t *font,
@@ -561,7 +561,7 @@
  *
  * Return value: 
  *
- * Since: 1.0
+ * Since: 0.9.2
  **/
 hb_bool_t
 hb_font_get_glyph_extents (hb_font_t *font,
@@ -583,7 +583,7 @@
  *
  * Return value: 
  *
- * Since: 1.0
+ * Since: 0.9.2
  **/
 hb_bool_t
 hb_font_get_glyph_contour_point (hb_font_t *font,
@@ -648,7 +648,7 @@
  *
  * 
  *
- * Since: 1.0
+ * Since: 0.9.2
  **/
 void
 hb_font_get_glyph_advance_for_direction (hb_font_t *font,
@@ -669,7 +669,7 @@
  *
  * 
  *
- * Since: 1.0
+ * Since: 0.9.2
  **/
 void
 hb_font_get_glyph_origin_for_direction (hb_font_t *font,
@@ -690,7 +690,7 @@
  *
  * 
  *
- * Since: 1.0
+ * Since: 0.9.2
  **/
 void
 hb_font_add_glyph_origin_for_direction (hb_font_t *font,
@@ -711,7 +711,7 @@
  *
  * 
  *
- * Since: 1.0
+ * Since: 0.9.2
  **/
 void
 hb_font_subtract_glyph_origin_for_direction (hb_font_t *font,
@@ -733,7 +733,7 @@
  *
  * 
  *
- * Since: 1.0
+ * Since: 0.9.2
  **/
 void
 hb_font_get_glyph_kerning_for_direction (hb_font_t *font,
@@ -755,7 +755,7 @@
  *
  * Return value: 
  *
- * Since: 1.0
+ * Since: 0.9.2
  **/
 hb_bool_t
 hb_font_get_glyph_extents_for_origin (hb_font_t *font,
@@ -779,7 +779,7 @@
  *
  * Return value: 
  *
- * Since: 1.0
+ * Since: 0.9.2
  **/
 hb_bool_t
 hb_font_get_glyph_contour_point_for_origin (hb_font_t *font,
@@ -845,7 +845,7 @@
  *
  * Return value: (transfer full): 
  *
- * Since: 1.0
+ * Since: 0.9.2
  **/
 hb_font_t *
 hb_font_create (hb_face_t *face)
@@ -861,6 +861,8 @@
   font->face = hb_face_reference (face);
   font->klass = hb_font_funcs_get_empty ();
 
+  font->x_scale = font->y_scale = hb_face_get_upem (face);
+
   return font;
 }
 
@@ -872,7 +874,7 @@
  *
  * Return value: (transfer full): 
  *
- * Since: 1.0
+ * Since: 0.9.2
  **/
 hb_font_t *
 hb_font_create_sub_font (hb_font_t *parent)
@@ -885,7 +887,6 @@
   if (unlikely (hb_object_is_inert (font)))
     return font;
 
-  hb_font_make_immutable (parent);
   font->parent = hb_font_reference (parent);
 
   font->x_scale = parent->x_scale;
@@ -903,7 +904,7 @@
  *
  * Return value: (transfer full)
  *
- * Since: 1.0
+ * Since: 0.9.2
  **/
 hb_font_t *
 hb_font_get_empty (void)
@@ -944,7 +945,7 @@
  *
  * Return value: (transfer full): 
  *
- * Since: 1.0
+ * Since: 0.9.2
  **/
 hb_font_t *
 hb_font_reference (hb_font_t *font)
@@ -958,7 +959,7 @@
  *
  * 
  *
- * Since: 1.0
+ * Since: 0.9.2
  **/
 void
 hb_font_destroy (hb_font_t *font)
@@ -991,7 +992,7 @@
  *
  * Return value: 
  *
- * Since: 1.0
+ * Since: 0.9.2
  **/
 hb_bool_t
 hb_font_set_user_data (hb_font_t          *font,
@@ -1012,7 +1013,7 @@
  *
  * Return value: (transfer none): 
  *
- * Since: 1.0
+ * Since: 0.9.2
  **/
 void *
 hb_font_get_user_data (hb_font_t          *font,
@@ -1027,7 +1028,7 @@
  *
  * 
  *
- * Since: 1.0
+ * Since: 0.9.2
  **/
 void
 hb_font_make_immutable (hb_font_t *font)
@@ -1035,6 +1036,9 @@
   if (unlikely (hb_object_is_inert (font)))
     return;
 
+  if (font->parent)
+    hb_font_make_immutable (font->parent);
+
   font->immutable = true;
 }
 
@@ -1046,7 +1050,7 @@
  *
  * Return value: 
  *
- * Since: 1.0
+ * Since: 0.9.2
  **/
 hb_bool_t
 hb_font_is_immutable (hb_font_t *font)
@@ -1055,6 +1059,32 @@
 }
 
 /**
+ * hb_font_set_parent:
+ * @font: a font.
+ * @parent: new parent.
+ *
+ * Sets parent font of @font.
+ *
+ * Since: 1.0.5
+ **/
+void
+hb_font_set_parent (hb_font_t *font,
+		    hb_font_t *parent)
+{
+  if (font->immutable)
+    return;
+
+  if (!parent)
+    parent = hb_font_get_empty ();
+
+  hb_font_t *old = font->parent;
+
+  font->parent = hb_font_reference (parent);
+
+  hb_font_destroy (old);
+}
+
+/**
  * hb_font_get_parent:
  * @font: a font.
  *
@@ -1062,7 +1092,7 @@
  *
  * Return value: (transfer none): 
  *
- * Since: 1.0
+ * Since: 0.9.2
  **/
 hb_font_t *
 hb_font_get_parent (hb_font_t *font)
@@ -1161,7 +1191,7 @@
  *
  * 
  *
- * Since: 1.0
+ * Since: 0.9.2
  **/
 void
 hb_font_set_scale (hb_font_t *font,
@@ -1183,7 +1213,7 @@
  *
  * 
  *
- * Since: 1.0
+ * Since: 0.9.2
  **/
 void
 hb_font_get_scale (hb_font_t *font,
@@ -1202,7 +1232,7 @@
  *
  * 
  *
- * Since: 1.0
+ * Since: 0.9.2
  **/
 void
 hb_font_set_ppem (hb_font_t *font,
@@ -1224,7 +1254,7 @@
  *
  * 
  *
- * Since: 1.0
+ * Since: 0.9.2
  **/
 void
 hb_font_get_ppem (hb_font_t *font,
diff --git a/third_party/harfbuzz-ng/src/hb-font.h b/third_party/harfbuzz-ng/src/hb-font.h
index cf22589..fb4a0ea 100644
--- a/third_party/harfbuzz-ng/src/hb-font.h
+++ b/third_party/harfbuzz-ng/src/hb-font.h
@@ -80,12 +80,13 @@
 
 /* glyph extents */
 
+/* Note that height is negative in coordinate systems that grow up. */
 typedef struct hb_glyph_extents_t
 {
-  hb_position_t x_bearing;
-  hb_position_t y_bearing;
-  hb_position_t width;
-  hb_position_t height;
+  hb_position_t x_bearing; /* left side of glyph from origin. */
+  hb_position_t y_bearing; /* top side of glyph from origin. */
+  hb_position_t width; /* distance from left to right side. */
+  hb_position_t height; /* distance from top to bottom side. */
 } hb_glyph_extents_t;
 
 
@@ -148,7 +149,7 @@
  *
  * 
  *
- * Since: 1.0
+ * Since: 0.9.2
  **/
 void
 hb_font_funcs_set_glyph_func (hb_font_funcs_t *ffuncs,
@@ -164,7 +165,7 @@
  *
  * 
  *
- * Since: 1.0
+ * Since: 0.9.2
  **/
 void
 hb_font_funcs_set_glyph_h_advance_func (hb_font_funcs_t *ffuncs,
@@ -180,7 +181,7 @@
  *
  * 
  *
- * Since: 1.0
+ * Since: 0.9.2
  **/
 void
 hb_font_funcs_set_glyph_v_advance_func (hb_font_funcs_t *ffuncs,
@@ -196,7 +197,7 @@
  *
  * 
  *
- * Since: 1.0
+ * Since: 0.9.2
  **/
 void
 hb_font_funcs_set_glyph_h_origin_func (hb_font_funcs_t *ffuncs,
@@ -212,7 +213,7 @@
  *
  * 
  *
- * Since: 1.0
+ * Since: 0.9.2
  **/
 void
 hb_font_funcs_set_glyph_v_origin_func (hb_font_funcs_t *ffuncs,
@@ -228,7 +229,7 @@
  *
  * 
  *
- * Since: 1.0
+ * Since: 0.9.2
  **/
 void
 hb_font_funcs_set_glyph_h_kerning_func (hb_font_funcs_t *ffuncs,
@@ -244,7 +245,7 @@
  *
  * 
  *
- * Since: 1.0
+ * Since: 0.9.2
  **/
 void
 hb_font_funcs_set_glyph_v_kerning_func (hb_font_funcs_t *ffuncs,
@@ -260,7 +261,7 @@
  *
  * 
  *
- * Since: 1.0
+ * Since: 0.9.2
  **/
 void
 hb_font_funcs_set_glyph_extents_func (hb_font_funcs_t *ffuncs,
@@ -276,7 +277,7 @@
  *
  * 
  *
- * Since: 1.0
+ * Since: 0.9.2
  **/
 void
 hb_font_funcs_set_glyph_contour_point_func (hb_font_funcs_t *ffuncs,
@@ -458,6 +459,10 @@
 hb_bool_t
 hb_font_is_immutable (hb_font_t *font);
 
+void
+hb_font_set_parent (hb_font_t *font,
+		    hb_font_t *parent);
+
 hb_font_t *
 hb_font_get_parent (hb_font_t *font);
 
diff --git a/third_party/harfbuzz-ng/src/hb-ft.cc b/third_party/harfbuzz-ng/src/hb-ft.cc
index 468742cf..b695f81 100644
--- a/third_party/harfbuzz-ng/src/hb-ft.cc
+++ b/third_party/harfbuzz-ng/src/hb-ft.cc
@@ -1,6 +1,7 @@
 /*
  * Copyright © 2009  Red Hat, Inc.
  * Copyright © 2009  Keith Stribley
+ * Copyright © 2015  Google, Inc.
  *
  *  This is part of HarfBuzz, a text shaping library.
  *
@@ -23,6 +24,7 @@
  * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
  *
  * Red Hat Author(s): Behdad Esfahbod
+ * Google Author(s): Behdad Esfahbod
  */
 
 #include "hb-private.hh"
@@ -46,17 +48,15 @@
  * In general, this file does a fine job of what it's supposed to do.
  * There are, however, things that need more work:
  *
- *   - We don't handle any load_flags.  That definitely has API implications. :(
- *     I believe hb_ft_font_create() should take load_flags input.
- *     In particular, FT_Get_Advance() without the NO_HINTING flag seems to be
- *     buggy.
+ *   - I remember seeing FT_Get_Advance() without the NO_HINTING flag to be buggy.
+ *     Have not investigated.
  *
- *     FreeType works in 26.6 mode.  Clients can decide to use that mode, and everything
+ *   - FreeType works in 26.6 mode.  Clients can decide to use that mode, and everything
  *     would work fine.  However, we also abuse this API for performing in font-space,
  *     but don't pass the correct flags to FreeType.  We just abuse the no-hinting mode
  *     for that, such that no rounding etc happens.  As such, we don't set ppem, and
- *     pass NO_HINTING around.  This seems to work best, until we go ahead and add a full
- *     load_flags API.
+ *     pass NO_HINTING as load_flags.  Would be much better to use NO_SCALE, and scale
+ *     ourselves, like we do in uniscribe, etc.
  *
  *   - We don't handle / allow for emboldening / obliqueing.
  *
@@ -66,6 +66,94 @@
  */
 
 
+struct hb_ft_font_t
+{
+  FT_Face ft_face;
+  int load_flags;
+  bool unref; /* Whether to destroy ft_face when done. */
+};
+
+static hb_ft_font_t *
+_hb_ft_font_create (FT_Face ft_face, bool unref)
+{
+  hb_ft_font_t *ft_font = (hb_ft_font_t *) calloc (1, sizeof (hb_ft_font_t));
+
+  if (unlikely (!ft_font))
+    return NULL;
+
+  ft_font->ft_face = ft_face;
+  ft_font->unref = unref;
+
+  ft_font->load_flags = FT_LOAD_DEFAULT;
+
+  return ft_font;
+}
+
+static void
+_hb_ft_font_destroy (hb_ft_font_t *ft_font)
+{
+  if (ft_font->unref)
+    FT_Done_Face (ft_font->ft_face);
+
+  free (ft_font);
+}
+
+/**
+ * hb_ft_font_set_load_flags:
+ * @font:
+ * @load_flags:
+ *
+ * 
+ *
+ * Since: 1.0.5
+ **/
+void
+hb_ft_font_set_load_flags (hb_font_t *font, int load_flags)
+{
+  if (font->immutable)
+    return;
+
+  if (font->destroy != (hb_destroy_func_t) _hb_ft_font_destroy)
+    return;
+
+  hb_ft_font_t *ft_font = (hb_ft_font_t *) font->user_data;
+
+  ft_font->load_flags = load_flags;
+}
+
+/**
+ * hb_ft_font_get_load_flags:
+ * @font:
+ *
+ * 
+ *
+ * Return value:
+ * Since: 1.0.5
+ **/
+int
+hb_ft_font_get_load_flags (hb_font_t *font)
+{
+  if (font->destroy != (hb_destroy_func_t) _hb_ft_font_destroy)
+    return 0;
+
+  const hb_ft_font_t *ft_font = (const hb_ft_font_t *) font->user_data;
+
+  return ft_font->load_flags;
+}
+
+FT_Face
+hb_ft_font_get_face (hb_font_t *font)
+{
+  if (font->destroy != (hb_destroy_func_t) _hb_ft_font_destroy)
+    return NULL;
+
+  const hb_ft_font_t *ft_font = (const hb_ft_font_t *) font->user_data;
+
+  return ft_font->ft_face;
+}
+
+
+
 static hb_bool_t
 hb_ft_get_glyph (hb_font_t *font HB_UNUSED,
 		 void *font_data,
@@ -75,13 +163,13 @@
 		 void *user_data HB_UNUSED)
 
 {
+  const hb_ft_font_t *ft_font = (const hb_ft_font_t *) font_data;
   unsigned int g;
-  FT_Face ft_face = (FT_Face) font_data;
 
   if (likely (!variation_selector))
-    g = FT_Get_Char_Index (ft_face, unicode);
+    g = FT_Get_Char_Index (ft_font->ft_face, unicode);
   else
-    g = FT_Face_GetCharVariantIndex (ft_face, unicode, variation_selector);
+    g = FT_Face_GetCharVariantIndex (ft_font->ft_face, unicode, variation_selector);
 
   if (unlikely (!g))
     return false;
@@ -96,11 +184,10 @@
 			   hb_codepoint_t glyph,
 			   void *user_data HB_UNUSED)
 {
-  FT_Face ft_face = (FT_Face) font_data;
-  int load_flags = FT_LOAD_DEFAULT | FT_LOAD_NO_HINTING;
+  const hb_ft_font_t *ft_font = (const hb_ft_font_t *) font_data;
   FT_Fixed v;
 
-  if (unlikely (FT_Get_Advance (ft_face, glyph, load_flags, &v)))
+  if (unlikely (FT_Get_Advance (ft_font->ft_face, glyph, ft_font->load_flags, &v)))
     return 0;
 
   if (font->x_scale < 0)
@@ -115,11 +202,10 @@
 			   hb_codepoint_t glyph,
 			   void *user_data HB_UNUSED)
 {
-  FT_Face ft_face = (FT_Face) font_data;
-  int load_flags = FT_LOAD_DEFAULT | FT_LOAD_NO_HINTING | FT_LOAD_VERTICAL_LAYOUT;
+  const hb_ft_font_t *ft_font = (const hb_ft_font_t *) font_data;
   FT_Fixed v;
 
-  if (unlikely (FT_Get_Advance (ft_face, glyph, load_flags, &v)))
+  if (unlikely (FT_Get_Advance (ft_font->ft_face, glyph, ft_font->load_flags | FT_LOAD_VERTICAL_LAYOUT, &v)))
     return 0;
 
   if (font->y_scale < 0)
@@ -150,10 +236,10 @@
 			  hb_position_t *y,
 			  void *user_data HB_UNUSED)
 {
-  FT_Face ft_face = (FT_Face) font_data;
-  int load_flags = FT_LOAD_DEFAULT | FT_LOAD_NO_HINTING;
+  const hb_ft_font_t *ft_font = (const hb_ft_font_t *) font_data;
+  FT_Face ft_face = ft_font->ft_face;
 
-  if (unlikely (FT_Load_Glyph (ft_face, glyph, load_flags)))
+  if (unlikely (FT_Load_Glyph (ft_face, glyph, ft_font->load_flags)))
     return false;
 
   /* Note: FreeType's vertical metrics grows downward while other FreeType coordinates
@@ -176,11 +262,11 @@
 			   hb_codepoint_t right_glyph,
 			   void *user_data HB_UNUSED)
 {
-  FT_Face ft_face = (FT_Face) font_data;
+  const hb_ft_font_t *ft_font = (const hb_ft_font_t *) font_data;
   FT_Vector kerningv;
 
   FT_Kerning_Mode mode = font->x_ppem ? FT_KERNING_DEFAULT : FT_KERNING_UNFITTED;
-  if (FT_Get_Kerning (ft_face, left_glyph, right_glyph, mode, &kerningv))
+  if (FT_Get_Kerning (ft_font->ft_face, left_glyph, right_glyph, mode, &kerningv))
     return 0;
 
   return kerningv.x;
@@ -204,10 +290,10 @@
 			 hb_glyph_extents_t *extents,
 			 void *user_data HB_UNUSED)
 {
-  FT_Face ft_face = (FT_Face) font_data;
-  int load_flags = FT_LOAD_DEFAULT | FT_LOAD_NO_HINTING;
+  const hb_ft_font_t *ft_font = (const hb_ft_font_t *) font_data;
+  FT_Face ft_face = ft_font->ft_face;
 
-  if (unlikely (FT_Load_Glyph (ft_face, glyph, load_flags)))
+  if (unlikely (FT_Load_Glyph (ft_face, glyph, ft_font->load_flags)))
     return false;
 
   extents->x_bearing = ft_face->glyph->metrics.horiBearingX;
@@ -226,10 +312,10 @@
 			       hb_position_t *y,
 			       void *user_data HB_UNUSED)
 {
-  FT_Face ft_face = (FT_Face) font_data;
-  int load_flags = FT_LOAD_DEFAULT;
+  const hb_ft_font_t *ft_font = (const hb_ft_font_t *) font_data;
+  FT_Face ft_face = ft_font->ft_face;
 
-  if (unlikely (FT_Load_Glyph (ft_face, glyph, load_flags)))
+  if (unlikely (FT_Load_Glyph (ft_face, glyph, ft_font->load_flags)))
       return false;
 
   if (unlikely (ft_face->glyph->format != FT_GLYPH_FORMAT_OUTLINE))
@@ -251,9 +337,9 @@
 		      char *name, unsigned int size,
 		      void *user_data HB_UNUSED)
 {
-  FT_Face ft_face = (FT_Face) font_data;
+  const hb_ft_font_t *ft_font = (const hb_ft_font_t *) font_data;
 
-  hb_bool_t ret = !FT_Get_Glyph_Name (ft_face, glyph, name, size);
+  hb_bool_t ret = !FT_Get_Glyph_Name (ft_font->ft_face, glyph, name, size);
   if (ret && (size && !*name))
     ret = false;
 
@@ -267,7 +353,8 @@
 			   hb_codepoint_t *glyph,
 			   void *user_data HB_UNUSED)
 {
-  FT_Face ft_face = (FT_Face) font_data;
+  const hb_ft_font_t *ft_font = (const hb_ft_font_t *) font_data;
+  FT_Face ft_face = ft_font->ft_face;
 
   if (len < 0)
     *glyph = FT_Get_Name_Index (ft_face, (FT_String *) name);
@@ -293,8 +380,8 @@
 }
 
 
-static hb_font_funcs_t *
-_hb_ft_get_font_funcs (void)
+static void
+_hb_ft_font_set_funcs (hb_font_t *font, FT_Face ft_face, bool unref)
 {
   static const hb_font_funcs_t ft_ffuncs = {
     HB_OBJECT_HEADER_STATIC,
@@ -308,7 +395,10 @@
     }
   };
 
-  return const_cast<hb_font_funcs_t *> (&ft_ffuncs);
+  hb_font_set_funcs (font,
+		     const_cast<hb_font_funcs_t *> (&ft_ffuncs),
+		     _hb_ft_font_create (ft_face, unref),
+		     (hb_destroy_func_t) _hb_ft_font_destroy);
 }
 
 
@@ -347,7 +437,7 @@
  * 
  *
  * Return value: (transfer full): 
- * Since: 1.0
+ * Since: 0.9.2
  **/
 hb_face_t *
 hb_ft_face_create (FT_Face           ft_face,
@@ -403,7 +493,7 @@
  * 
  *
  * Return value: (transfer full): 
- * Since: 1.0
+ * Since: 0.9.2
  **/
 hb_face_t *
 hb_ft_face_create_cached (FT_Face ft_face)
@@ -420,11 +510,6 @@
   return hb_face_reference ((hb_face_t *) ft_face->generic.data);
 }
 
-static void
-_do_nothing (void)
-{
-}
-
 
 /**
  * hb_ft_font_create:
@@ -434,7 +519,7 @@
  * 
  *
  * Return value: (transfer full): 
- * Since: 1.0
+ * Since: 0.9.2
  **/
 hb_font_t *
 hb_ft_font_create (FT_Face           ft_face,
@@ -446,9 +531,7 @@
   face = hb_ft_face_create (ft_face, destroy);
   font = hb_font_create (face);
   hb_face_destroy (face);
-  hb_font_set_funcs (font,
-		     _hb_ft_get_font_funcs (),
-		     ft_face, (hb_destroy_func_t) _do_nothing);
+  _hb_ft_font_set_funcs (font, ft_face, false);
   hb_font_set_scale (font,
 		     (int) (((uint64_t) ft_face->size->metrics.x_scale * (uint64_t) ft_face->units_per_EM + (1<<15)) >> 16),
 		     (int) (((uint64_t) ft_face->size->metrics.y_scale * (uint64_t) ft_face->units_per_EM + (1<<15)) >> 16));
@@ -562,18 +645,6 @@
   ft_face->generic.data = blob;
   ft_face->generic.finalizer = (FT_Generic_Finalizer) _release_blob;
 
-  hb_font_set_funcs (font,
-		     _hb_ft_get_font_funcs (),
-		     ft_face,
-		     (hb_destroy_func_t) FT_Done_Face);
-}
-
-FT_Face
-hb_ft_font_get_face (hb_font_t *font)
-{
-  if (font->destroy == (hb_destroy_func_t) FT_Done_Face ||
-      font->destroy == (hb_destroy_func_t) _do_nothing)
-    return (FT_Face) font->user_data;
-
-  return NULL;
+  _hb_ft_font_set_funcs (font, ft_face, true);
+  hb_ft_font_set_load_flags (font, FT_LOAD_DEFAULT | FT_LOAD_NO_HINTING);
 }
diff --git a/third_party/harfbuzz-ng/src/hb-ft.h b/third_party/harfbuzz-ng/src/hb-ft.h
index 92f4b3614..4bbc826 100644
--- a/third_party/harfbuzz-ng/src/hb-ft.h
+++ b/third_party/harfbuzz-ng/src/hb-ft.h
@@ -1,5 +1,6 @@
 /*
  * Copyright © 2009  Red Hat, Inc.
+ * Copyright © 2015  Google, Inc.
  *
  *  This is part of HarfBuzz, a text shaping library.
  *
@@ -22,6 +23,7 @@
  * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
  *
  * Red Hat Author(s): Behdad Esfahbod
+ * Google Author(s): Behdad Esfahbod
  */
 
 #ifndef HB_FT_H
@@ -105,14 +107,19 @@
 hb_font_t *
 hb_ft_font_create_referenced (FT_Face ft_face);
 
+FT_Face
+hb_ft_font_get_face (hb_font_t *font);
+
+void
+hb_ft_font_set_load_flags (hb_font_t *font, int load_flags);
+
+int
+hb_ft_font_get_load_flags (hb_font_t *font);
 
 /* Makes an hb_font_t use FreeType internally to implement font functions. */
 void
 hb_ft_font_set_funcs (hb_font_t *font);
 
-FT_Face
-hb_ft_font_get_face (hb_font_t *font);
-
 
 HB_END_DECLS
 
diff --git a/third_party/harfbuzz-ng/src/hb-graphite2.cc b/third_party/harfbuzz-ng/src/hb-graphite2.cc
index 626b84f4..cd694c14 100644
--- a/third_party/harfbuzz-ng/src/hb-graphite2.cc
+++ b/third_party/harfbuzz-ng/src/hb-graphite2.cc
@@ -138,6 +138,9 @@
   free (data);
 }
 
+/*
+ * Since: 0.9.10
+ */
 gr_face *
 hb_graphite2_face_get_gr_face (hb_face_t *face)
 {
@@ -172,6 +175,9 @@
   gr_font_destroy (data);
 }
 
+/*
+ * Since: 0.9.10
+ */
 gr_font *
 hb_graphite2_font_get_gr_font (hb_font_t *font)
 {
diff --git a/third_party/harfbuzz-ng/src/hb-object-private.hh b/third_party/harfbuzz-ng/src/hb-object-private.hh
index 635d62dc..6b73ff9 100644
--- a/third_party/harfbuzz-ng/src/hb-object-private.hh
+++ b/third_party/harfbuzz-ng/src/hb-object-private.hh
@@ -47,8 +47,9 @@
 
 /* reference_count */
 
-#define HB_REFERENCE_COUNT_INVALID_VALUE -1
-#define HB_REFERENCE_COUNT_INIT {HB_ATOMIC_INT_INIT(HB_REFERENCE_COUNT_INVALID_VALUE)}
+#define HB_REFERENCE_COUNT_INERT_VALUE -1
+#define HB_REFERENCE_COUNT_POISON_VALUE -0x0000DEAD
+#define HB_REFERENCE_COUNT_INIT {HB_ATOMIC_INT_INIT(HB_REFERENCE_COUNT_INERT_VALUE)}
 
 struct hb_reference_count_t
 {
@@ -58,9 +59,10 @@
   inline int get_unsafe (void) const { return ref_count.get_unsafe (); }
   inline int inc (void) { return ref_count.inc (); }
   inline int dec (void) { return ref_count.dec (); }
-  inline void finish (void) { ref_count.set_unsafe (HB_REFERENCE_COUNT_INVALID_VALUE); }
+  inline void finish (void) { ref_count.set_unsafe (HB_REFERENCE_COUNT_POISON_VALUE); }
 
-  inline bool is_invalid (void) const { return ref_count.get_unsafe () == HB_REFERENCE_COUNT_INVALID_VALUE; }
+  inline bool is_inert (void) const { return ref_count.get_unsafe () == HB_REFERENCE_COUNT_INERT_VALUE; }
+  inline bool is_valid (void) const { return ref_count.get_unsafe () > 0; }
 };
 
 
@@ -142,7 +144,12 @@
 template <typename Type>
 static inline bool hb_object_is_inert (const Type *obj)
 {
-  return unlikely (obj->header.ref_count.is_invalid ());
+  return unlikely (obj->header.ref_count.is_inert ());
+}
+template <typename Type>
+static inline bool hb_object_is_valid (const Type *obj)
+{
+  return likely (obj->header.ref_count.is_valid ());
 }
 template <typename Type>
 static inline Type *hb_object_reference (Type *obj)
@@ -150,6 +157,7 @@
   hb_object_trace (obj, HB_FUNC);
   if (unlikely (!obj || hb_object_is_inert (obj)))
     return obj;
+  assert (hb_object_is_valid (obj));
   obj->header.ref_count.inc ();
   return obj;
 }
@@ -159,6 +167,7 @@
   hb_object_trace (obj, HB_FUNC);
   if (unlikely (!obj || hb_object_is_inert (obj)))
     return false;
+  assert (hb_object_is_valid (obj));
   if (obj->header.ref_count.dec () != 1)
     return false;
 
@@ -175,6 +184,7 @@
 {
   if (unlikely (!obj || hb_object_is_inert (obj)))
     return false;
+  assert (hb_object_is_valid (obj));
   return obj->header.user_data.set (key, data, destroy, replace);
 }
 
@@ -184,6 +194,7 @@
 {
   if (unlikely (!obj || hb_object_is_inert (obj)))
     return NULL;
+  assert (hb_object_is_valid (obj));
   return obj->header.user_data.get (key);
 }
 
diff --git a/third_party/harfbuzz-ng/src/hb-open-file-private.hh b/third_party/harfbuzz-ng/src/hb-open-file-private.hh
index 178bc7cc..152230a 100644
--- a/third_party/harfbuzz-ng/src/hb-open-file-private.hh
+++ b/third_party/harfbuzz-ng/src/hb-open-file-private.hh
@@ -56,7 +56,7 @@
   inline bool sanitize (hb_sanitize_context_t *c) const
   {
     TRACE_SANITIZE (this);
-    return TRACE_RETURN (c->check_struct (this));
+    return_trace (c->check_struct (this));
   }
 
   Tag		tag;		/* 4-byte identifier. */
@@ -106,7 +106,7 @@
   inline bool sanitize (hb_sanitize_context_t *c) const
   {
     TRACE_SANITIZE (this);
-    return TRACE_RETURN (c->check_struct (this) && c->check_array (tables, TableRecord::static_size, numTables));
+    return_trace (c->check_struct (this) && c->check_array (tables, TableRecord::static_size, numTables));
   }
 
   protected:
@@ -135,7 +135,7 @@
   inline bool sanitize (hb_sanitize_context_t *c) const
   {
     TRACE_SANITIZE (this);
-    return TRACE_RETURN (table.sanitize (c, this));
+    return_trace (table.sanitize (c, this));
   }
 
   protected:
@@ -175,11 +175,11 @@
   inline bool sanitize (hb_sanitize_context_t *c) const
   {
     TRACE_SANITIZE (this);
-    if (unlikely (!u.header.version.sanitize (c))) return TRACE_RETURN (false);
+    if (unlikely (!u.header.version.sanitize (c))) return_trace (false);
     switch (u.header.version.major) {
     case 2: /* version 2 is compatible with version 1 */
-    case 1: return TRACE_RETURN (u.version1.sanitize (c));
-    default:return TRACE_RETURN (true);
+    case 1: return_trace (u.version1.sanitize (c));
+    default:return_trace (true);
     }
   }
 
@@ -240,14 +240,14 @@
   inline bool sanitize (hb_sanitize_context_t *c) const
   {
     TRACE_SANITIZE (this);
-    if (unlikely (!u.tag.sanitize (c))) return TRACE_RETURN (false);
+    if (unlikely (!u.tag.sanitize (c))) return_trace (false);
     switch (u.tag) {
     case CFFTag:	/* All the non-collection tags */
     case TrueTag:
     case Typ1Tag:
-    case TrueTypeTag:	return TRACE_RETURN (u.fontFace.sanitize (c));
-    case TTCTag:	return TRACE_RETURN (u.ttcHeader.sanitize (c));
-    default:		return TRACE_RETURN (true);
+    case TrueTypeTag:	return_trace (u.fontFace.sanitize (c));
+    case TTCTag:	return_trace (u.ttcHeader.sanitize (c));
+    default:		return_trace (true);
     }
   }
 
diff --git a/third_party/harfbuzz-ng/src/hb-open-type-private.hh b/third_party/harfbuzz-ng/src/hb-open-type-private.hh
index 75a0f56..e55d2e1 100644
--- a/third_party/harfbuzz-ng/src/hb-open-type-private.hh
+++ b/third_party/harfbuzz-ng/src/hb-open-type-private.hh
@@ -154,6 +154,20 @@
 #define Null(Type) Null<Type>()
 
 
+/*
+ * Dispatch
+ */
+
+template <typename Context, typename Return, unsigned int MaxDebugDepth>
+struct hb_dispatch_context_t
+{
+  static const unsigned int max_debug_depth = MaxDebugDepth;
+  typedef Return return_t;
+  template <typename T, typename F>
+  inline bool may_dispatch (const T *obj, const F *format) { return true; }
+  static return_t no_dispatch_return_value (void) { return Context::default_return_value (); }
+};
+
 
 /*
  * Sanitize
@@ -174,17 +188,23 @@
 #define HB_SANITIZE_MAX_EDITS 100
 #endif
 
-struct hb_sanitize_context_t
+struct hb_sanitize_context_t :
+       hb_dispatch_context_t<hb_sanitize_context_t, bool, HB_DEBUG_SANITIZE>
 {
+  inline hb_sanitize_context_t (void) :
+	debug_depth (0),
+	start (NULL), end (NULL),
+	writable (false), edit_count (0),
+	blob (NULL) {}
+
   inline const char *get_name (void) { return "SANITIZE"; }
-  static const unsigned int max_debug_depth = HB_DEBUG_SANITIZE;
-  typedef bool return_t;
   template <typename T, typename F>
   inline bool may_dispatch (const T *obj, const F *format)
   { return format->sanitize (this); }
   template <typename T>
   inline return_t dispatch (const T &obj) { return obj.sanitize (this); }
   static return_t default_return_value (void) { return true; }
+  static return_t no_dispatch_return_value (void) { return false; }
   bool stop_sublookup_iteration (const return_t r) const { return !r; }
 
   inline void init (hb_blob_t *b)
@@ -295,7 +315,7 @@
 struct Sanitizer
 {
   static hb_blob_t *sanitize (hb_blob_t *blob) {
-    hb_sanitize_context_t c[1] = {{0, NULL, NULL, false, 0, NULL}};
+    hb_sanitize_context_t c[1];
     bool sane;
 
     /* TODO is_sane() stuff */
@@ -536,6 +556,20 @@
 template <typename Type, int Bytes> struct BEInt;
 
 template <typename Type>
+struct BEInt<Type, 1>
+{
+  public:
+  inline void set (Type V)
+  {
+    v = V;
+  }
+  inline operator Type (void) const
+  {
+    return v;
+  }
+  private: uint8_t v;
+};
+template <typename Type>
 struct BEInt<Type, 2>
 {
   public:
@@ -610,7 +644,7 @@
   inline bool sanitize (hb_sanitize_context_t *c) const
   {
     TRACE_SANITIZE (this);
-    return TRACE_RETURN (likely (c->check_struct (this)));
+    return_trace (likely (c->check_struct (this)));
   }
   protected:
   BEInt<Type, Size> v;
@@ -618,7 +652,7 @@
   DEFINE_SIZE_STATIC (Size);
 };
 
-typedef		uint8_t	     BYTE;	/* 8-bit unsigned integer. */
+typedef	IntType<uint8_t	, 1> BYTE;	/* 8-bit unsigned integer. */
 typedef IntType<uint16_t, 2> USHORT;	/* 16-bit unsigned integer. */
 typedef IntType<int16_t,  2> SHORT;	/* 16-bit signed integer. */
 typedef IntType<uint32_t, 4> ULONG;	/* 32-bit unsigned integer. */
@@ -638,7 +672,7 @@
   inline bool sanitize (hb_sanitize_context_t *c) const
   {
     TRACE_SANITIZE (this);
-    return TRACE_RETURN (likely (c->check_struct (this)));
+    return_trace (likely (c->check_struct (this)));
   }
   protected:
   LONG major;
@@ -715,7 +749,7 @@
   inline bool sanitize (hb_sanitize_context_t *c) const
   {
     TRACE_SANITIZE (this);
-    return TRACE_RETURN (c->check_struct (this));
+    return_trace (c->check_struct (this));
   }
 
   USHORT major;
@@ -751,21 +785,21 @@
   inline bool sanitize (hb_sanitize_context_t *c, const void *base) const
   {
     TRACE_SANITIZE (this);
-    if (unlikely (!c->check_struct (this))) return TRACE_RETURN (false);
+    if (unlikely (!c->check_struct (this))) return_trace (false);
     unsigned int offset = *this;
-    if (unlikely (!offset)) return TRACE_RETURN (true);
+    if (unlikely (!offset)) return_trace (true);
     const Type &obj = StructAtOffset<Type> (base, offset);
-    return TRACE_RETURN (likely (obj.sanitize (c)) || neuter (c));
+    return_trace (likely (obj.sanitize (c)) || neuter (c));
   }
   template <typename T>
   inline bool sanitize (hb_sanitize_context_t *c, const void *base, T user_data) const
   {
     TRACE_SANITIZE (this);
-    if (unlikely (!c->check_struct (this))) return TRACE_RETURN (false);
+    if (unlikely (!c->check_struct (this))) return_trace (false);
     unsigned int offset = *this;
-    if (unlikely (!offset)) return TRACE_RETURN (true);
+    if (unlikely (!offset)) return_trace (true);
     const Type &obj = StructAtOffset<Type> (base, offset);
-    return TRACE_RETURN (likely (obj.sanitize (c, user_data)) || neuter (c));
+    return_trace (likely (obj.sanitize (c, user_data)) || neuter (c));
   }
 
   /* Set the offset to Null */
@@ -816,10 +850,10 @@
 			 unsigned int items_len)
   {
     TRACE_SERIALIZE (this);
-    if (unlikely (!c->extend_min (*this))) return TRACE_RETURN (false);
+    if (unlikely (!c->extend_min (*this))) return_trace (false);
     len.set (items_len); /* TODO(serialize) Overflow? */
-    if (unlikely (!c->extend (*this))) return TRACE_RETURN (false);
-    return TRACE_RETURN (true);
+    if (unlikely (!c->extend (*this))) return_trace (false);
+    return_trace (true);
   }
 
   inline bool serialize (hb_serialize_context_t *c,
@@ -827,17 +861,17 @@
 			 unsigned int items_len)
   {
     TRACE_SERIALIZE (this);
-    if (unlikely (!serialize (c, items_len))) return TRACE_RETURN (false);
+    if (unlikely (!serialize (c, items_len))) return_trace (false);
     for (unsigned int i = 0; i < items_len; i++)
       array[i] = items[i];
     items.advance (items_len);
-    return TRACE_RETURN (true);
+    return_trace (true);
   }
 
   inline bool sanitize (hb_sanitize_context_t *c) const
   {
     TRACE_SANITIZE (this);
-    if (unlikely (!sanitize_shallow (c))) return TRACE_RETURN (false);
+    if (unlikely (!sanitize_shallow (c))) return_trace (false);
 
     /* Note: for structs that do not reference other structs,
      * we do not need to call their sanitize() as we already did
@@ -848,28 +882,28 @@
      */
     (void) (false && array[0].sanitize (c));
 
-    return TRACE_RETURN (true);
+    return_trace (true);
   }
   inline bool sanitize (hb_sanitize_context_t *c, const void *base) const
   {
     TRACE_SANITIZE (this);
-    if (unlikely (!sanitize_shallow (c))) return TRACE_RETURN (false);
+    if (unlikely (!sanitize_shallow (c))) return_trace (false);
     unsigned int count = len;
     for (unsigned int i = 0; i < count; i++)
       if (unlikely (!array[i].sanitize (c, base)))
-        return TRACE_RETURN (false);
-    return TRACE_RETURN (true);
+        return_trace (false);
+    return_trace (true);
   }
   template <typename T>
   inline bool sanitize (hb_sanitize_context_t *c, const void *base, T user_data) const
   {
     TRACE_SANITIZE (this);
-    if (unlikely (!sanitize_shallow (c))) return TRACE_RETURN (false);
+    if (unlikely (!sanitize_shallow (c))) return_trace (false);
     unsigned int count = len;
     for (unsigned int i = 0; i < count; i++)
       if (unlikely (!array[i].sanitize (c, base, user_data)))
-        return TRACE_RETURN (false);
-    return TRACE_RETURN (true);
+        return_trace (false);
+    return_trace (true);
   }
 
   template <typename SearchType>
@@ -886,7 +920,7 @@
   inline bool sanitize_shallow (hb_sanitize_context_t *c) const
   {
     TRACE_SANITIZE (this);
-    return TRACE_RETURN (c->check_struct (this) && c->check_array (this, Type::static_size, len));
+    return_trace (c->check_struct (this) && c->check_array (array, Type::static_size, len));
   }
 
   public:
@@ -913,13 +947,13 @@
   inline bool sanitize (hb_sanitize_context_t *c) const
   {
     TRACE_SANITIZE (this);
-    return TRACE_RETURN (OffsetArrayOf<Type>::sanitize (c, this));
+    return_trace (OffsetArrayOf<Type>::sanitize (c, this));
   }
   template <typename T>
   inline bool sanitize (hb_sanitize_context_t *c, T user_data) const
   {
     TRACE_SANITIZE (this);
-    return TRACE_RETURN (OffsetArrayOf<Type>::sanitize (c, this, user_data));
+    return_trace (OffsetArrayOf<Type>::sanitize (c, this, user_data));
   }
 };
 
@@ -941,14 +975,14 @@
 			 unsigned int items_len)
   {
     TRACE_SERIALIZE (this);
-    if (unlikely (!c->extend_min (*this))) return TRACE_RETURN (false);
+    if (unlikely (!c->extend_min (*this))) return_trace (false);
     len.set (items_len); /* TODO(serialize) Overflow? */
-    if (unlikely (!items_len)) return TRACE_RETURN (true);
-    if (unlikely (!c->extend (*this))) return TRACE_RETURN (false);
+    if (unlikely (!items_len)) return_trace (true);
+    if (unlikely (!c->extend (*this))) return_trace (false);
     for (unsigned int i = 0; i < items_len - 1; i++)
       array[i] = items[i];
     items.advance (items_len - 1);
-    return TRACE_RETURN (true);
+    return_trace (true);
   }
 
   inline bool sanitize_shallow (hb_sanitize_context_t *c) const
@@ -960,7 +994,7 @@
   inline bool sanitize (hb_sanitize_context_t *c) const
   {
     TRACE_SANITIZE (this);
-    if (unlikely (!sanitize_shallow (c))) return TRACE_RETURN (false);
+    if (unlikely (!sanitize_shallow (c))) return_trace (false);
 
     /* Note: for structs that do not reference other structs,
      * we do not need to call their sanitize() as we already did
@@ -971,7 +1005,7 @@
      */
     (void) (false && array[0].sanitize (c));
 
-    return TRACE_RETURN (true);
+    return_trace (true);
   }
 
   LenType len;
diff --git a/third_party/harfbuzz-ng/src/hb-ot-cmap-table.hh b/third_party/harfbuzz-ng/src/hb-ot-cmap-table.hh
index 0482312..c9161f0 100644
--- a/third_party/harfbuzz-ng/src/hb-ot-cmap-table.hh
+++ b/third_party/harfbuzz-ng/src/hb-ot-cmap-table.hh
@@ -54,7 +54,7 @@
   inline bool sanitize (hb_sanitize_context_t *c) const
   {
     TRACE_SANITIZE (this);
-    return TRACE_RETURN (c->check_struct (this));
+    return_trace (c->check_struct (this));
   }
 
   protected:
@@ -130,7 +130,7 @@
   {
     TRACE_SANITIZE (this);
     if (unlikely (!c->check_struct (this)))
-      return TRACE_RETURN (false);
+      return_trace (false);
 
     if (unlikely (!c->check_range (this, length)))
     {
@@ -141,10 +141,10 @@
 					    (uintptr_t) (c->end -
 							 (char *) this));
       if (!c->try_set (&length, new_length))
-	return TRACE_RETURN (false);
+	return_trace (false);
     }
 
-    return TRACE_RETURN (16 + 4 * (unsigned int) segCountX2 <= length);
+    return_trace (16 + 4 * (unsigned int) segCountX2 <= length);
   }
 
   protected:
@@ -187,7 +187,7 @@
   inline bool sanitize (hb_sanitize_context_t *c) const
   {
     TRACE_SANITIZE (this);
-    return TRACE_RETURN (c->check_struct (this));
+    return_trace (c->check_struct (this));
   }
 
   private:
@@ -215,7 +215,7 @@
   inline bool sanitize (hb_sanitize_context_t *c) const
   {
     TRACE_SANITIZE (this);
-    return TRACE_RETURN (c->check_struct (this) && glyphIdArray.sanitize (c));
+    return_trace (c->check_struct (this) && glyphIdArray.sanitize (c));
   }
 
   protected:
@@ -248,7 +248,7 @@
   inline bool sanitize (hb_sanitize_context_t *c) const
   {
     TRACE_SANITIZE (this);
-    return TRACE_RETURN (c->check_struct (this) && groups.sanitize (c));
+    return_trace (c->check_struct (this) && groups.sanitize (c));
   }
 
   protected:
@@ -295,7 +295,7 @@
   inline bool sanitize (hb_sanitize_context_t *c) const
   {
     TRACE_SANITIZE (this);
-    return TRACE_RETURN (c->check_struct (this));
+    return_trace (c->check_struct (this));
   }
 
   UINT24	startUnicodeValue;	/* First value in this range. */
@@ -317,7 +317,7 @@
   inline bool sanitize (hb_sanitize_context_t *c) const
   {
     TRACE_SANITIZE (this);
-    return TRACE_RETURN (c->check_struct (this));
+    return_trace (c->check_struct (this));
   }
 
   UINT24	unicodeValue;	/* Base Unicode value of the UVS */
@@ -357,9 +357,9 @@
   inline bool sanitize (hb_sanitize_context_t *c, const void *base) const
   {
     TRACE_SANITIZE (this);
-    return TRACE_RETURN (c->check_struct (this) &&
-			 defaultUVS.sanitize (c, base) &&
-			 nonDefaultUVS.sanitize (c, base));
+    return_trace (c->check_struct (this) &&
+		  defaultUVS.sanitize (c, base) &&
+		  nonDefaultUVS.sanitize (c, base));
   }
 
   UINT24	varSelector;	/* Variation selector. */
@@ -383,8 +383,8 @@
   inline bool sanitize (hb_sanitize_context_t *c) const
   {
     TRACE_SANITIZE (this);
-    return TRACE_RETURN (c->check_struct (this) &&
-			 record.sanitize (c, this));
+    return_trace (c->check_struct (this) &&
+		  record.sanitize (c, this));
   }
 
   protected:
@@ -429,16 +429,16 @@
   inline bool sanitize (hb_sanitize_context_t *c) const
   {
     TRACE_SANITIZE (this);
-    if (!u.format.sanitize (c)) return TRACE_RETURN (false);
+    if (!u.format.sanitize (c)) return_trace (false);
     switch (u.format) {
-    case  0: return TRACE_RETURN (u.format0 .sanitize (c));
-    case  4: return TRACE_RETURN (u.format4 .sanitize (c));
-    case  6: return TRACE_RETURN (u.format6 .sanitize (c));
-    case 10: return TRACE_RETURN (u.format10.sanitize (c));
-    case 12: return TRACE_RETURN (u.format12.sanitize (c));
-    case 13: return TRACE_RETURN (u.format13.sanitize (c));
-    case 14: return TRACE_RETURN (u.format14.sanitize (c));
-    default:return TRACE_RETURN (true);
+    case  0: return_trace (u.format0 .sanitize (c));
+    case  4: return_trace (u.format4 .sanitize (c));
+    case  6: return_trace (u.format6 .sanitize (c));
+    case 10: return_trace (u.format10.sanitize (c));
+    case 12: return_trace (u.format12.sanitize (c));
+    case 13: return_trace (u.format13.sanitize (c));
+    case 14: return_trace (u.format14.sanitize (c));
+    default:return_trace (true);
     }
   }
 
@@ -473,8 +473,8 @@
   inline bool sanitize (hb_sanitize_context_t *c, const void *base) const
   {
     TRACE_SANITIZE (this);
-    return TRACE_RETURN (c->check_struct (this) &&
-			 subtable.sanitize (c, base));
+    return_trace (c->check_struct (this) &&
+		  subtable.sanitize (c, base));
   }
 
   USHORT	platformID;	/* Platform ID. */
@@ -509,9 +509,9 @@
   inline bool sanitize (hb_sanitize_context_t *c) const
   {
     TRACE_SANITIZE (this);
-    return TRACE_RETURN (c->check_struct (this) &&
-			 likely (version == 0) &&
-			 encodingRecord.sanitize (c, this));
+    return_trace (c->check_struct (this) &&
+		  likely (version == 0) &&
+		  encodingRecord.sanitize (c, this));
   }
 
   USHORT		version;	/* Table version number (0). */
diff --git a/third_party/harfbuzz-ng/src/hb-ot-font.cc b/third_party/harfbuzz-ng/src/hb-ot-font.cc
index df6514d..3102784 100644
--- a/third_party/harfbuzz-ng/src/hb-ot-font.cc
+++ b/third_party/harfbuzz-ng/src/hb-ot-font.cc
@@ -31,6 +31,8 @@
 #include "hb-font-private.hh"
 
 #include "hb-ot-cmap-table.hh"
+#include "hb-ot-glyf-table.hh"
+#include "hb-ot-head-table.hh"
 #include "hb-ot-hhea-table.hh"
 #include "hb-ot-hmtx-table.hh"
 
@@ -76,8 +78,8 @@
     if (unlikely (glyph >= this->num_metrics))
     {
       /* If this->num_metrics is zero, it means we don't have the metrics table
-       * for this direction: return one EM.  Otherwise, it means that the glyph
-       * index is out of bound: return zero. */
+       * for this direction: return default advance.  Otherwise, it means that the
+       * glyph index is out of bound: return zero. */
       if (this->num_metrics)
 	return 0;
       else
@@ -91,6 +93,79 @@
   }
 };
 
+struct hb_ot_face_glyf_accelerator_t
+{
+  bool short_offset;
+  unsigned int num_glyphs;
+  const OT::loca *loca;
+  const OT::glyf *glyf;
+  hb_blob_t *loca_blob;
+  hb_blob_t *glyf_blob;
+  unsigned int glyf_len;
+
+  inline void init (hb_face_t *face)
+  {
+    hb_blob_t *head_blob = OT::Sanitizer<OT::head>::sanitize (face->reference_table (HB_OT_TAG_head));
+    const OT::head *head = OT::Sanitizer<OT::head>::lock_instance (head_blob);
+    if ((unsigned int) head->indexToLocFormat > 1 || head->glyphDataFormat != 0)
+    {
+      /* Unknown format.  Leave num_glyphs=0, that takes care of disabling us. */
+      hb_blob_destroy (head_blob);
+      return;
+    }
+    this->short_offset = 0 == head->indexToLocFormat;
+    hb_blob_destroy (head_blob);
+
+    this->loca_blob = OT::Sanitizer<OT::loca>::sanitize (face->reference_table (HB_OT_TAG_loca));
+    this->loca = OT::Sanitizer<OT::loca>::lock_instance (this->loca_blob);
+    this->glyf_blob = OT::Sanitizer<OT::glyf>::sanitize (face->reference_table (HB_OT_TAG_glyf));
+    this->glyf = OT::Sanitizer<OT::glyf>::lock_instance (this->glyf_blob);
+
+    this->num_glyphs = MAX (1u, hb_blob_get_length (this->loca_blob) / (this->short_offset ? 2 : 4)) - 1;
+    this->glyf_len = hb_blob_get_length (this->glyf_blob);
+  }
+
+  inline void fini (void)
+  {
+    hb_blob_destroy (this->loca_blob);
+    hb_blob_destroy (this->glyf_blob);
+  }
+
+  inline bool get_extents (hb_codepoint_t glyph,
+			   hb_glyph_extents_t *extents) const
+  {
+    if (unlikely (glyph >= this->num_glyphs))
+      return false;
+
+    unsigned int start_offset, end_offset;
+    if (this->short_offset)
+    {
+      start_offset = 2 * this->loca->u.shortsZ[glyph];
+      end_offset   = 2 * this->loca->u.shortsZ[glyph + 1];
+    }
+    else
+    {
+      start_offset = this->loca->u.longsZ[glyph];
+      end_offset   = this->loca->u.longsZ[glyph + 1];
+    }
+
+    if (start_offset > end_offset || end_offset > this->glyf_len)
+      return false;
+
+    if (end_offset - start_offset < OT::glyfGlyphHeader::static_size)
+      return true; /* Empty glyph; zero extents. */
+
+    const OT::glyfGlyphHeader &glyph_header = OT::StructAtOffset<OT::glyfGlyphHeader> (this->glyf, start_offset);
+
+    extents->x_bearing = MIN (glyph_header.xMin, glyph_header.xMax);
+    extents->y_bearing = MAX (glyph_header.yMin, glyph_header.yMax);
+    extents->width     = MAX (glyph_header.xMin, glyph_header.xMax) - extents->x_bearing;
+    extents->height    = MIN (glyph_header.yMin, glyph_header.yMax) - extents->y_bearing;
+
+    return true;
+  }
+};
+
 struct hb_ot_face_cmap_accelerator_t
 {
   const OT::CmapSubtable *table;
@@ -158,14 +233,14 @@
   hb_ot_face_cmap_accelerator_t cmap;
   hb_ot_face_metrics_accelerator_t h_metrics;
   hb_ot_face_metrics_accelerator_t v_metrics;
+  hb_ot_face_glyf_accelerator_t glyf;
 };
 
 
 static hb_ot_font_t *
-_hb_ot_font_create (hb_font_t *font)
+_hb_ot_font_create (hb_face_t *face)
 {
   hb_ot_font_t *ot_font = (hb_ot_font_t *) calloc (1, sizeof (hb_ot_font_t));
-  hb_face_t *face = font->face;
 
   if (unlikely (!ot_font))
     return NULL;
@@ -175,6 +250,7 @@
   ot_font->cmap.init (face);
   ot_font->h_metrics.init (face, HB_OT_TAG_hhea, HB_OT_TAG_hmtx, upem>>1);
   ot_font->v_metrics.init (face, HB_OT_TAG_vhea, HB_OT_TAG_vmtx, upem); /* TODO Can we do this lazily? */
+  ot_font->glyf.init (face);
 
   return ot_font;
 }
@@ -185,6 +261,7 @@
   ot_font->cmap.fini ();
   ot_font->h_metrics.fini ();
   ot_font->v_metrics.fini ();
+  ot_font->glyf.fini ();
 
   free (ot_font);
 }
@@ -276,8 +353,13 @@
 			 hb_glyph_extents_t *extents,
 			 void *user_data HB_UNUSED)
 {
-  /* TODO */
-  return false;
+  const hb_ot_font_t *ot_font = (const hb_ot_font_t *) font_data;
+  bool ret = ot_font->glyf.get_extents (glyph, extents);
+  extents->x_bearing = font->em_scale_x (extents->x_bearing);
+  extents->y_bearing = font->em_scale_y (extents->y_bearing);
+  extents->width     = font->em_scale_x (extents->width);
+  extents->height    = font->em_scale_y (extents->height);
+  return ret;
 }
 
 static hb_bool_t
@@ -341,7 +423,7 @@
 void
 hb_ot_font_set_funcs (hb_font_t *font)
 {
-  hb_ot_font_t *ot_font = _hb_ot_font_create (font);
+  hb_ot_font_t *ot_font = _hb_ot_font_create (font->face);
   if (unlikely (!ot_font))
     return;
 
diff --git a/third_party/harfbuzz-ng/src/hb-ot-glyf-table.hh b/third_party/harfbuzz-ng/src/hb-ot-glyf-table.hh
new file mode 100644
index 0000000..9e5af6d
--- /dev/null
+++ b/third_party/harfbuzz-ng/src/hb-ot-glyf-table.hh
@@ -0,0 +1,104 @@
+/*
+ * Copyright © 2015  Google, Inc.
+ *
+ *  This is part of HarfBuzz, a text shaping library.
+ *
+ * Permission is hereby granted, without written agreement and without
+ * license or royalty fees, to use, copy, modify, and distribute this
+ * software and its documentation for any purpose, provided that the
+ * above copyright notice and the following two paragraphs appear in
+ * all copies of this software.
+ *
+ * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR
+ * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
+ * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN
+ * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+ * DAMAGE.
+ *
+ * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
+ * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+ * FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
+ * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO
+ * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+ *
+ * Google Author(s): Behdad Esfahbod
+ */
+
+#ifndef HB_OT_GLYF_TABLE_HH
+#define HB_OT_GLYF_TABLE_HH
+
+#include "hb-open-type-private.hh"
+
+
+namespace OT {
+
+
+/*
+ * loca -- Index to Location
+ */
+
+#define HB_OT_TAG_loca HB_TAG('l','o','c','a')
+
+
+struct loca
+{
+  static const hb_tag_t tableTag = HB_OT_TAG_loca;
+
+  inline bool sanitize (hb_sanitize_context_t *c) const
+  {
+    TRACE_SANITIZE (this);
+    return_trace (true);
+  }
+
+  public:
+  union {
+    USHORT	shortsZ[VAR];		/* Location offset divided by 2. */
+    ULONG	longsZ[VAR];		/* Location offset. */
+  } u;
+  DEFINE_SIZE_ARRAY (0, u.longsZ);
+};
+
+
+/*
+ * glyf -- TrueType Glyph Data
+ */
+
+#define HB_OT_TAG_glyf HB_TAG('g','l','y','f')
+
+
+struct glyf
+{
+  static const hb_tag_t tableTag = HB_OT_TAG_glyf;
+
+  inline bool sanitize (hb_sanitize_context_t *c) const
+  {
+    TRACE_SANITIZE (this);
+    /* We don't check for anything specific here.  The users of the
+     * struct do all the hard work... */
+    return_trace (true);
+  }
+
+  public:
+  BYTE		dataX[VAR];		/* Glyphs data. */
+
+  DEFINE_SIZE_ARRAY (0, dataX);
+};
+
+struct glyfGlyphHeader
+{
+  SHORT		numberOfContours;	/* If the number of contours is
+					 * greater than or equal to zero,
+					 * this is a simple glyph; if negative,
+					 * this is a composite glyph. */
+  SHORT		xMin;			/* Minimum x for coordinate data. */
+  SHORT		yMin;			/* Minimum y for coordinate data. */
+  SHORT		xMax;			/* Maximum x for coordinate data. */
+  SHORT		yMax;			/* Maximum y for coordinate data. */
+
+  DEFINE_SIZE_STATIC (10);
+};
+
+} /* namespace OT */
+
+
+#endif /* HB_OT_GLYF_TABLE_HH */
diff --git a/third_party/harfbuzz-ng/src/hb-ot-head-table.hh b/third_party/harfbuzz-ng/src/hb-ot-head-table.hh
index 268f133..fc351cf 100644
--- a/third_party/harfbuzz-ng/src/hb-ot-head-table.hh
+++ b/third_party/harfbuzz-ng/src/hb-ot-head-table.hh
@@ -55,7 +55,7 @@
   inline bool sanitize (hb_sanitize_context_t *c) const
   {
     TRACE_SANITIZE (this);
-    return TRACE_RETURN (c->check_struct (this) && likely (version.major == 1));
+    return_trace (c->check_struct (this) && likely (version.major == 1));
   }
 
   protected:
@@ -138,9 +138,10 @@
 					 * 2: Like 1 but also contains neutrals;
 					 * -1: Only strongly right to left;
 					 * -2: Like -1 but also contains neutrals. */
+  public:
   SHORT		indexToLocFormat;	/* 0 for short offsets, 1 for long. */
   SHORT		glyphDataFormat;	/* 0 for current format. */
-  public:
+
   DEFINE_SIZE_STATIC (54);
 };
 
diff --git a/third_party/harfbuzz-ng/src/hb-ot-hhea-table.hh b/third_party/harfbuzz-ng/src/hb-ot-hhea-table.hh
index 992fe552..2411453 100644
--- a/third_party/harfbuzz-ng/src/hb-ot-hhea-table.hh
+++ b/third_party/harfbuzz-ng/src/hb-ot-hhea-table.hh
@@ -52,7 +52,7 @@
   inline bool sanitize (hb_sanitize_context_t *c) const
   {
     TRACE_SANITIZE (this);
-    return TRACE_RETURN (c->check_struct (this) && likely (version.major == 1));
+    return_trace (c->check_struct (this) && likely (version.major == 1));
   }
 
   public:
diff --git a/third_party/harfbuzz-ng/src/hb-ot-hmtx-table.hh b/third_party/harfbuzz-ng/src/hb-ot-hmtx-table.hh
index a0e3855..49056e6 100644
--- a/third_party/harfbuzz-ng/src/hb-ot-hmtx-table.hh
+++ b/third_party/harfbuzz-ng/src/hb-ot-hmtx-table.hh
@@ -62,7 +62,7 @@
     TRACE_SANITIZE (this);
     /* We don't check for anything specific here.  The users of the
      * struct do all the hard work... */
-    return TRACE_RETURN (true);
+    return_trace (true);
   }
 
   public:
diff --git a/third_party/harfbuzz-ng/src/hb-ot-layout-common-private.hh b/third_party/harfbuzz-ng/src/hb-ot-layout-common-private.hh
index 3db7f57..6f818cb 100644
--- a/third_party/harfbuzz-ng/src/hb-ot-layout-common-private.hh
+++ b/third_party/harfbuzz-ng/src/hb-ot-layout-common-private.hh
@@ -75,7 +75,7 @@
   {
     TRACE_SANITIZE (this);
     const sanitize_closure_t closure = {tag, base};
-    return TRACE_RETURN (c->check_struct (this) && offset.sanitize (c, base, &closure));
+    return_trace (c->check_struct (this) && offset.sanitize (c, base, &closure));
   }
 
   Tag		tag;		/* 4-byte Tag identifier */
@@ -131,7 +131,7 @@
   inline bool sanitize (hb_sanitize_context_t *c) const
   {
     TRACE_SANITIZE (this);
-    return TRACE_RETURN (RecordArrayOf<Type>::sanitize (c, this));
+    return_trace (RecordArrayOf<Type>::sanitize (c, this));
   }
 };
 
@@ -145,7 +145,7 @@
   inline bool sanitize (hb_sanitize_context_t *c) const
   {
     TRACE_SANITIZE (this);
-    return TRACE_RETURN (c->check_struct (this));
+    return_trace (c->check_struct (this));
   }
 
   inline bool intersects (const hb_set_t *glyphs) const {
@@ -211,7 +211,7 @@
 			const Record<LangSys>::sanitize_closure_t * = NULL) const
   {
     TRACE_SANITIZE (this);
-    return TRACE_RETURN (c->check_struct (this) && featureIndex.sanitize (c));
+    return_trace (c->check_struct (this) && featureIndex.sanitize (c));
   }
 
   Offset<>	lookupOrderZ;	/* = Null (reserved for an offset to a
@@ -251,7 +251,7 @@
 			const Record<Script>::sanitize_closure_t * = NULL) const
   {
     TRACE_SANITIZE (this);
-    return TRACE_RETURN (defaultLangSys.sanitize (c, this) && langSys.sanitize (c, this));
+    return_trace (defaultLangSys.sanitize (c, this) && langSys.sanitize (c, this));
   }
 
   protected:
@@ -274,7 +274,7 @@
   inline bool sanitize (hb_sanitize_context_t *c) const
   {
     TRACE_SANITIZE (this);
-    if (unlikely (!c->check_struct (this))) return TRACE_RETURN (false);
+    if (unlikely (!c->check_struct (this))) return_trace (false);
 
     /* This subtable has some "history", if you will.  Some earlier versions of
      * Adobe tools calculated the offset of the FeatureParams sutable from the
@@ -326,19 +326,19 @@
      */
 
     if (!designSize)
-      return TRACE_RETURN (false);
+      return_trace (false);
     else if (subfamilyID == 0 &&
 	     subfamilyNameID == 0 &&
 	     rangeStart == 0 &&
 	     rangeEnd == 0)
-      return TRACE_RETURN (true);
+      return_trace (true);
     else if (designSize < rangeStart ||
 	     designSize > rangeEnd ||
 	     subfamilyNameID < 256 ||
 	     subfamilyNameID > 32767)
-      return TRACE_RETURN (false);
+      return_trace (false);
     else
-      return TRACE_RETURN (true);
+      return_trace (true);
   }
 
   USHORT	designSize;	/* Represents the design size in 720/inch
@@ -388,7 +388,7 @@
     TRACE_SANITIZE (this);
     /* Right now minorVersion is at zero.  Which means, any table supports
      * the uiNameID field. */
-    return TRACE_RETURN (c->check_struct (this));
+    return_trace (c->check_struct (this));
   }
 
   USHORT	version;	/* (set to 0): This corresponds to a “minor”
@@ -420,8 +420,8 @@
   inline bool sanitize (hb_sanitize_context_t *c) const
   {
     TRACE_SANITIZE (this);
-    return TRACE_RETURN (c->check_struct (this) &&
-			 characters.sanitize (c));
+    return_trace (c->check_struct (this) &&
+		  characters.sanitize (c));
   }
 
   USHORT	format;			/* Format number is set to 0. */
@@ -462,12 +462,12 @@
   {
     TRACE_SANITIZE (this);
     if (tag == HB_TAG ('s','i','z','e'))
-      return TRACE_RETURN (u.size.sanitize (c));
+      return_trace (u.size.sanitize (c));
     if ((tag & 0xFFFF0000u) == HB_TAG ('s','s','\0','\0')) /* ssXX */
-      return TRACE_RETURN (u.stylisticSet.sanitize (c));
+      return_trace (u.stylisticSet.sanitize (c));
     if ((tag & 0xFFFF0000u) == HB_TAG ('c','v','\0','\0')) /* cvXX */
-      return TRACE_RETURN (u.characterVariants.sanitize (c));
-    return TRACE_RETURN (true);
+      return_trace (u.characterVariants.sanitize (c));
+    return_trace (true);
   }
 
   inline const FeatureParamsSize& get_size_params (hb_tag_t tag) const
@@ -505,7 +505,7 @@
   {
     TRACE_SANITIZE (this);
     if (unlikely (!(c->check_struct (this) && lookupIndex.sanitize (c))))
-      return TRACE_RETURN (false);
+      return_trace (false);
 
     /* Some earlier versions of Adobe tools calculated the offset of the
      * FeatureParams subtable from the beginning of the FeatureList table!
@@ -520,10 +520,10 @@
 
     OffsetTo<FeatureParams> orig_offset = featureParams;
     if (unlikely (!featureParams.sanitize (c, this, closure ? closure->tag : HB_TAG_NONE)))
-      return TRACE_RETURN (false);
+      return_trace (false);
 
     if (likely (orig_offset.is_null ()))
-      return TRACE_RETURN (true);
+      return_trace (true);
 
     if (featureParams == 0 && closure &&
 	closure->tag == HB_TAG ('s','i','z','e') &&
@@ -538,10 +538,10 @@
       if (new_offset == new_offset_int &&
 	  c->try_set (&featureParams, new_offset) &&
 	  !featureParams.sanitize (c, this, closure ? closure->tag : HB_TAG_NONE))
-	return TRACE_RETURN (false);
+	return_trace (false);
     }
 
-    return TRACE_RETURN (true);
+    return_trace (true);
   }
 
   OffsetTo<FeatureParams>
@@ -613,9 +613,9 @@
     for (unsigned int i = 0; i < count; i++) {
       typename context_t::return_t r = get_subtable<SubTableType> (i).dispatch (c, lookup_type);
       if (c->stop_sublookup_iteration (r))
-        return TRACE_RETURN (r);
+        return_trace (r);
     }
-    return TRACE_RETURN (c->default_return_value ());
+    return_trace (c->default_return_value ());
   }
 
   inline bool serialize (hb_serialize_context_t *c,
@@ -624,29 +624,29 @@
 			 unsigned int num_subtables)
   {
     TRACE_SERIALIZE (this);
-    if (unlikely (!c->extend_min (*this))) return TRACE_RETURN (false);
+    if (unlikely (!c->extend_min (*this))) return_trace (false);
     lookupType.set (lookup_type);
     lookupFlag.set (lookup_props & 0xFFFFu);
-    if (unlikely (!subTable.serialize (c, num_subtables))) return TRACE_RETURN (false);
+    if (unlikely (!subTable.serialize (c, num_subtables))) return_trace (false);
     if (lookupFlag & LookupFlag::UseMarkFilteringSet)
     {
       USHORT &markFilteringSet = StructAfter<USHORT> (subTable);
       markFilteringSet.set (lookup_props >> 16);
     }
-    return TRACE_RETURN (true);
+    return_trace (true);
   }
 
   inline bool sanitize (hb_sanitize_context_t *c) const
   {
     TRACE_SANITIZE (this);
     /* Real sanitize of the subtables is done by GSUB/GPOS/... */
-    if (!(c->check_struct (this) && subTable.sanitize (c))) return TRACE_RETURN (false);
+    if (!(c->check_struct (this) && subTable.sanitize (c))) return_trace (false);
     if (lookupFlag & LookupFlag::UseMarkFilteringSet)
     {
       const USHORT &markFilteringSet = StructAfter<USHORT> (subTable);
-      if (!markFilteringSet.sanitize (c)) return TRACE_RETURN (false);
+      if (!markFilteringSet.sanitize (c)) return_trace (false);
     }
-    return TRACE_RETURN (true);
+    return_trace (true);
   }
 
   private:
@@ -685,19 +685,19 @@
 			 unsigned int num_glyphs)
   {
     TRACE_SERIALIZE (this);
-    if (unlikely (!c->extend_min (*this))) return TRACE_RETURN (false);
+    if (unlikely (!c->extend_min (*this))) return_trace (false);
     glyphArray.len.set (num_glyphs);
-    if (unlikely (!c->extend (glyphArray))) return TRACE_RETURN (false);
+    if (unlikely (!c->extend (glyphArray))) return_trace (false);
     for (unsigned int i = 0; i < num_glyphs; i++)
       glyphArray[i] = glyphs[i];
     glyphs.advance (num_glyphs);
-    return TRACE_RETURN (true);
+    return_trace (true);
   }
 
   inline bool sanitize (hb_sanitize_context_t *c) const
   {
     TRACE_SANITIZE (this);
-    return TRACE_RETURN (glyphArray.sanitize (c));
+    return_trace (glyphArray.sanitize (c));
   }
 
   inline bool intersects_coverage (const hb_set_t *glyphs, unsigned int index) const {
@@ -754,16 +754,16 @@
 			 unsigned int num_glyphs)
   {
     TRACE_SERIALIZE (this);
-    if (unlikely (!c->extend_min (*this))) return TRACE_RETURN (false);
+    if (unlikely (!c->extend_min (*this))) return_trace (false);
 
-    if (unlikely (!num_glyphs)) return TRACE_RETURN (true);
+    if (unlikely (!num_glyphs)) return_trace (true);
 
     unsigned int num_ranges = 1;
     for (unsigned int i = 1; i < num_glyphs; i++)
       if (glyphs[i - 1] + 1 != glyphs[i])
         num_ranges++;
     rangeRecord.len.set (num_ranges);
-    if (unlikely (!c->extend (rangeRecord))) return TRACE_RETURN (false);
+    if (unlikely (!c->extend (rangeRecord))) return_trace (false);
 
     unsigned int range = 0;
     rangeRecord[range].start = glyphs[0];
@@ -778,13 +778,13 @@
         rangeRecord[range].end = glyphs[i];
       }
     glyphs.advance (num_glyphs);
-    return TRACE_RETURN (true);
+    return_trace (true);
   }
 
   inline bool sanitize (hb_sanitize_context_t *c) const
   {
     TRACE_SANITIZE (this);
-    return TRACE_RETURN (rangeRecord.sanitize (c));
+    return_trace (rangeRecord.sanitize (c));
   }
 
   inline bool intersects_coverage (const hb_set_t *glyphs, unsigned int index) const {
@@ -864,27 +864,27 @@
 			 unsigned int num_glyphs)
   {
     TRACE_SERIALIZE (this);
-    if (unlikely (!c->extend_min (*this))) return TRACE_RETURN (false);
+    if (unlikely (!c->extend_min (*this))) return_trace (false);
     unsigned int num_ranges = 1;
     for (unsigned int i = 1; i < num_glyphs; i++)
       if (glyphs[i - 1] + 1 != glyphs[i])
         num_ranges++;
     u.format.set (num_glyphs * 2 < num_ranges * 3 ? 1 : 2);
     switch (u.format) {
-    case 1: return TRACE_RETURN (u.format1.serialize (c, glyphs, num_glyphs));
-    case 2: return TRACE_RETURN (u.format2.serialize (c, glyphs, num_glyphs));
-    default:return TRACE_RETURN (false);
+    case 1: return_trace (u.format1.serialize (c, glyphs, num_glyphs));
+    case 2: return_trace (u.format2.serialize (c, glyphs, num_glyphs));
+    default:return_trace (false);
     }
   }
 
   inline bool sanitize (hb_sanitize_context_t *c) const
   {
     TRACE_SANITIZE (this);
-    if (!u.format.sanitize (c)) return TRACE_RETURN (false);
+    if (!u.format.sanitize (c)) return_trace (false);
     switch (u.format) {
-    case 1: return TRACE_RETURN (u.format1.sanitize (c));
-    case 2: return TRACE_RETURN (u.format2.sanitize (c));
-    default:return TRACE_RETURN (true);
+    case 1: return_trace (u.format1.sanitize (c));
+    case 2: return_trace (u.format2.sanitize (c));
+    default:return_trace (true);
     }
   }
 
@@ -993,7 +993,7 @@
   inline bool sanitize (hb_sanitize_context_t *c) const
   {
     TRACE_SANITIZE (this);
-    return TRACE_RETURN (c->check_struct (this) && classValue.sanitize (c));
+    return_trace (c->check_struct (this) && classValue.sanitize (c));
   }
 
   template <typename set_t>
@@ -1050,7 +1050,7 @@
   inline bool sanitize (hb_sanitize_context_t *c) const
   {
     TRACE_SANITIZE (this);
-    return TRACE_RETURN (rangeRecord.sanitize (c));
+    return_trace (rangeRecord.sanitize (c));
   }
 
   template <typename set_t>
@@ -1108,11 +1108,11 @@
   inline bool sanitize (hb_sanitize_context_t *c) const
   {
     TRACE_SANITIZE (this);
-    if (!u.format.sanitize (c)) return TRACE_RETURN (false);
+    if (!u.format.sanitize (c)) return_trace (false);
     switch (u.format) {
-    case 1: return TRACE_RETURN (u.format1.sanitize (c));
-    case 2: return TRACE_RETURN (u.format2.sanitize (c));
-    default:return TRACE_RETURN (true);
+    case 1: return_trace (u.format1.sanitize (c));
+    case 2: return_trace (u.format2.sanitize (c));
+    default:return_trace (true);
     }
   }
 
@@ -1201,7 +1201,7 @@
   inline bool sanitize (hb_sanitize_context_t *c) const
   {
     TRACE_SANITIZE (this);
-    return TRACE_RETURN (c->check_struct (this) && c->check_range (this, this->get_size ()));
+    return_trace (c->check_struct (this) && c->check_range (this, this->get_size ()));
   }
 
   protected:
diff --git a/third_party/harfbuzz-ng/src/hb-ot-layout-gdef-table.hh b/third_party/harfbuzz-ng/src/hb-ot-layout-gdef-table.hh
index 7a6c04d..bc36436 100644
--- a/third_party/harfbuzz-ng/src/hb-ot-layout-gdef-table.hh
+++ b/third_party/harfbuzz-ng/src/hb-ot-layout-gdef-table.hh
@@ -74,7 +74,7 @@
   inline bool sanitize (hb_sanitize_context_t *c) const
   {
     TRACE_SANITIZE (this);
-    return TRACE_RETURN (coverage.sanitize (c, this) && attachPoint.sanitize (c, this));
+    return_trace (coverage.sanitize (c, this) && attachPoint.sanitize (c, this));
   }
 
   protected:
@@ -105,7 +105,7 @@
   inline bool sanitize (hb_sanitize_context_t *c) const
   {
     TRACE_SANITIZE (this);
-    return TRACE_RETURN (c->check_struct (this));
+    return_trace (c->check_struct (this));
   }
 
   protected:
@@ -132,7 +132,7 @@
   inline bool sanitize (hb_sanitize_context_t *c) const
   {
     TRACE_SANITIZE (this);
-    return TRACE_RETURN (c->check_struct (this));
+    return_trace (c->check_struct (this));
   }
 
   protected:
@@ -156,7 +156,7 @@
   inline bool sanitize (hb_sanitize_context_t *c) const
   {
     TRACE_SANITIZE (this);
-    return TRACE_RETURN (c->check_struct (this) && deviceTable.sanitize (c, this));
+    return_trace (c->check_struct (this) && deviceTable.sanitize (c, this));
   }
 
   protected:
@@ -185,12 +185,12 @@
   inline bool sanitize (hb_sanitize_context_t *c) const
   {
     TRACE_SANITIZE (this);
-    if (!u.format.sanitize (c)) return TRACE_RETURN (false);
+    if (!u.format.sanitize (c)) return_trace (false);
     switch (u.format) {
-    case 1: return TRACE_RETURN (u.format1.sanitize (c));
-    case 2: return TRACE_RETURN (u.format2.sanitize (c));
-    case 3: return TRACE_RETURN (u.format3.sanitize (c));
-    default:return TRACE_RETURN (true);
+    case 1: return_trace (u.format1.sanitize (c));
+    case 2: return_trace (u.format2.sanitize (c));
+    case 3: return_trace (u.format3.sanitize (c));
+    default:return_trace (true);
     }
   }
 
@@ -227,7 +227,7 @@
   inline bool sanitize (hb_sanitize_context_t *c) const
   {
     TRACE_SANITIZE (this);
-    return TRACE_RETURN (carets.sanitize (c, this));
+    return_trace (carets.sanitize (c, this));
   }
 
   protected:
@@ -262,7 +262,7 @@
   inline bool sanitize (hb_sanitize_context_t *c) const
   {
     TRACE_SANITIZE (this);
-    return TRACE_RETURN (coverage.sanitize (c, this) && ligGlyph.sanitize (c, this));
+    return_trace (coverage.sanitize (c, this) && ligGlyph.sanitize (c, this));
   }
 
   protected:
@@ -285,7 +285,7 @@
   inline bool sanitize (hb_sanitize_context_t *c) const
   {
     TRACE_SANITIZE (this);
-    return TRACE_RETURN (coverage.sanitize (c, this));
+    return_trace (coverage.sanitize (c, this));
   }
 
   protected:
@@ -310,10 +310,10 @@
   inline bool sanitize (hb_sanitize_context_t *c) const
   {
     TRACE_SANITIZE (this);
-    if (!u.format.sanitize (c)) return TRACE_RETURN (false);
+    if (!u.format.sanitize (c)) return_trace (false);
     switch (u.format) {
-    case 1: return TRACE_RETURN (u.format1.sanitize (c));
-    default:return TRACE_RETURN (true);
+    case 1: return_trace (u.format1.sanitize (c));
+    default:return_trace (true);
     }
   }
 
@@ -376,13 +376,13 @@
   inline bool sanitize (hb_sanitize_context_t *c) const
   {
     TRACE_SANITIZE (this);
-    return TRACE_RETURN (version.sanitize (c) &&
-			 likely (version.major == 1) &&
-			 glyphClassDef.sanitize (c, this) &&
-			 attachList.sanitize (c, this) &&
-			 ligCaretList.sanitize (c, this) &&
-			 markAttachClassDef.sanitize (c, this) &&
-			 (version.to_int () < 0x00010002u || markGlyphSetsDef[0].sanitize (c, this)));
+    return_trace (version.sanitize (c) &&
+		  likely (version.major == 1) &&
+		  glyphClassDef.sanitize (c, this) &&
+		  attachList.sanitize (c, this) &&
+		  ligCaretList.sanitize (c, this) &&
+		  markAttachClassDef.sanitize (c, this) &&
+		  (version.to_int () < 0x00010002u || markGlyphSetsDef[0].sanitize (c, this)));
   }
 
 
diff --git a/third_party/harfbuzz-ng/src/hb-ot-layout-gpos-table.hh b/third_party/harfbuzz-ng/src/hb-ot-layout-gpos-table.hh
index da9506c7..568b5f6 100644
--- a/third_party/harfbuzz-ng/src/hb-ot-layout-gpos-table.hh
+++ b/third_party/harfbuzz-ng/src/hb-ot-layout-gpos-table.hh
@@ -181,7 +181,7 @@
   inline bool sanitize_value (hb_sanitize_context_t *c, const void *base, const Value *values) const
   {
     TRACE_SANITIZE (this);
-    return TRACE_RETURN (c->check_range (values, get_size ()) && (!has_device () || sanitize_value_devices (c, base, values)));
+    return_trace (c->check_range (values, get_size ()) && (!has_device () || sanitize_value_devices (c, base, values)));
   }
 
   inline bool sanitize_values (hb_sanitize_context_t *c, const void *base, const Value *values, unsigned int count) const
@@ -189,17 +189,17 @@
     TRACE_SANITIZE (this);
     unsigned int len = get_len ();
 
-    if (!c->check_array (values, get_size (), count)) return TRACE_RETURN (false);
+    if (!c->check_array (values, get_size (), count)) return_trace (false);
 
-    if (!has_device ()) return TRACE_RETURN (true);
+    if (!has_device ()) return_trace (true);
 
     for (unsigned int i = 0; i < count; i++) {
       if (!sanitize_value_devices (c, base, values))
-        return TRACE_RETURN (false);
+        return_trace (false);
       values += len;
     }
 
-    return TRACE_RETURN (true);
+    return_trace (true);
   }
 
   /* Just sanitize referenced Device tables.  Doesn't check the values themselves. */
@@ -207,15 +207,15 @@
   {
     TRACE_SANITIZE (this);
 
-    if (!has_device ()) return TRACE_RETURN (true);
+    if (!has_device ()) return_trace (true);
 
     for (unsigned int i = 0; i < count; i++) {
       if (!sanitize_value_devices (c, base, values))
-        return TRACE_RETURN (false);
+        return_trace (false);
       values += stride;
     }
 
-    return TRACE_RETURN (true);
+    return_trace (true);
   }
 };
 
@@ -232,7 +232,7 @@
   inline bool sanitize (hb_sanitize_context_t *c) const
   {
     TRACE_SANITIZE (this);
-    return TRACE_RETURN (c->check_struct (this));
+    return_trace (c->check_struct (this));
   }
 
   protected:
@@ -262,7 +262,7 @@
   inline bool sanitize (hb_sanitize_context_t *c) const
   {
     TRACE_SANITIZE (this);
-    return TRACE_RETURN (c->check_struct (this));
+    return_trace (c->check_struct (this));
   }
 
   protected:
@@ -291,7 +291,7 @@
   inline bool sanitize (hb_sanitize_context_t *c) const
   {
     TRACE_SANITIZE (this);
-    return TRACE_RETURN (c->check_struct (this) && xDeviceTable.sanitize (c, this) && yDeviceTable.sanitize (c, this));
+    return_trace (c->check_struct (this) && xDeviceTable.sanitize (c, this) && yDeviceTable.sanitize (c, this));
   }
 
   protected:
@@ -327,12 +327,12 @@
   inline bool sanitize (hb_sanitize_context_t *c) const
   {
     TRACE_SANITIZE (this);
-    if (!u.format.sanitize (c)) return TRACE_RETURN (false);
+    if (!u.format.sanitize (c)) return_trace (false);
     switch (u.format) {
-    case 1: return TRACE_RETURN (u.format1.sanitize (c));
-    case 2: return TRACE_RETURN (u.format2.sanitize (c));
-    case 3: return TRACE_RETURN (u.format3.sanitize (c));
-    default:return TRACE_RETURN (true);
+    case 1: return_trace (u.format1.sanitize (c));
+    case 2: return_trace (u.format2.sanitize (c));
+    case 3: return_trace (u.format3.sanitize (c));
+    default:return_trace (true);
     }
   }
 
@@ -360,13 +360,13 @@
   inline bool sanitize (hb_sanitize_context_t *c, unsigned int cols) const
   {
     TRACE_SANITIZE (this);
-    if (!c->check_struct (this)) return TRACE_RETURN (false);
-    if (unlikely (rows > 0 && cols >= ((unsigned int) -1) / rows)) return TRACE_RETURN (false);
+    if (!c->check_struct (this)) return_trace (false);
+    if (unlikely (rows > 0 && cols >= ((unsigned int) -1) / rows)) return_trace (false);
     unsigned int count = rows * cols;
-    if (!c->check_array (matrixZ, matrixZ[0].static_size, count)) return TRACE_RETURN (false);
+    if (!c->check_array (matrixZ, matrixZ[0].static_size, count)) return_trace (false);
     for (unsigned int i = 0; i < count; i++)
-      if (!matrixZ[i].sanitize (c, this)) return TRACE_RETURN (false);
-    return TRACE_RETURN (true);
+      if (!matrixZ[i].sanitize (c, this)) return_trace (false);
+    return_trace (true);
   }
 
   USHORT	rows;			/* Number of rows */
@@ -386,7 +386,7 @@
   inline bool sanitize (hb_sanitize_context_t *c, const void *base) const
   {
     TRACE_SANITIZE (this);
-    return TRACE_RETURN (c->check_struct (this) && markAnchor.sanitize (c, base));
+    return_trace (c->check_struct (this) && markAnchor.sanitize (c, base));
   }
 
   protected:
@@ -415,7 +415,7 @@
     const Anchor& glyph_anchor = anchors.get_anchor (glyph_index, mark_class, class_count, &found);
     /* If this subtable doesn't have an anchor for this base and this class,
      * return false such that the subsequent subtables have a chance at it. */
-    if (unlikely (!found)) return TRACE_RETURN (false);
+    if (unlikely (!found)) return_trace (false);
 
     hb_position_t mark_x, mark_y, base_x, base_y;
 
@@ -428,13 +428,13 @@
     o.attach_lookback() = buffer->idx - glyph_pos;
 
     buffer->idx++;
-    return TRACE_RETURN (true);
+    return_trace (true);
   }
 
   inline bool sanitize (hb_sanitize_context_t *c) const
   {
     TRACE_SANITIZE (this);
-    return TRACE_RETURN (ArrayOf<MarkRecord>::sanitize (c, this));
+    return_trace (ArrayOf<MarkRecord>::sanitize (c, this));
   }
 };
 
@@ -459,21 +459,21 @@
     TRACE_APPLY (this);
     hb_buffer_t *buffer = c->buffer;
     unsigned int index = (this+coverage).get_coverage  (buffer->cur().codepoint);
-    if (likely (index == NOT_COVERED)) return TRACE_RETURN (false);
+    if (likely (index == NOT_COVERED)) return_trace (false);
 
     valueFormat.apply_value (c->font, c->direction, this,
 			     values, buffer->cur_pos());
 
     buffer->idx++;
-    return TRACE_RETURN (true);
+    return_trace (true);
   }
 
   inline bool sanitize (hb_sanitize_context_t *c) const
   {
     TRACE_SANITIZE (this);
-    return TRACE_RETURN (c->check_struct (this)
-        && coverage.sanitize (c, this)
-	&& valueFormat.sanitize_value (c, this, values));
+    return_trace (c->check_struct (this) &&
+		  coverage.sanitize (c, this) &&
+		  valueFormat.sanitize_value (c, this, values));
   }
 
   protected:
@@ -508,24 +508,24 @@
     TRACE_APPLY (this);
     hb_buffer_t *buffer = c->buffer;
     unsigned int index = (this+coverage).get_coverage  (buffer->cur().codepoint);
-    if (likely (index == NOT_COVERED)) return TRACE_RETURN (false);
+    if (likely (index == NOT_COVERED)) return_trace (false);
 
-    if (likely (index >= valueCount)) return TRACE_RETURN (false);
+    if (likely (index >= valueCount)) return_trace (false);
 
     valueFormat.apply_value (c->font, c->direction, this,
 			     &values[index * valueFormat.get_len ()],
 			     buffer->cur_pos());
 
     buffer->idx++;
-    return TRACE_RETURN (true);
+    return_trace (true);
   }
 
   inline bool sanitize (hb_sanitize_context_t *c) const
   {
     TRACE_SANITIZE (this);
-    return TRACE_RETURN (c->check_struct (this)
-	&& coverage.sanitize (c, this)
-	&& valueFormat.sanitize_values (c, this, values, valueCount));
+    return_trace (c->check_struct (this) &&
+		  coverage.sanitize (c, this) &&
+		  valueFormat.sanitize_values (c, this, values, valueCount));
   }
 
   protected:
@@ -548,11 +548,11 @@
   inline typename context_t::return_t dispatch (context_t *c) const
   {
     TRACE_DISPATCH (this, u.format);
-    if (unlikely (!c->may_dispatch (this, &u.format))) TRACE_RETURN (c->default_return_value ());
+    if (unlikely (!c->may_dispatch (this, &u.format))) return_trace (c->no_dispatch_return_value ());
     switch (u.format) {
-    case 1: return TRACE_RETURN (c->dispatch (u.format1));
-    case 2: return TRACE_RETURN (c->dispatch (u.format2));
-    default:return TRACE_RETURN (c->default_return_value ());
+    case 1: return_trace (c->dispatch (u.format1));
+    case 2: return_trace (c->dispatch (u.format2));
+    default:return_trace (c->default_return_value ());
     }
   }
 
@@ -615,7 +615,7 @@
 
     /* Hand-coded bsearch. */
     if (unlikely (!count))
-      return TRACE_RETURN (false);
+      return_trace (false);
     hb_codepoint_t x = buffer->info[pos].codepoint;
     int min = 0, max = (int) count - 1;
     while (min <= max)
@@ -636,11 +636,11 @@
 	if (len2)
 	  pos++;
 	buffer->idx = pos;
-	return TRACE_RETURN (true);
+	return_trace (true);
       }
     }
 
-    return TRACE_RETURN (false);
+    return_trace (false);
   }
 
   struct sanitize_closure_t {
@@ -654,12 +654,12 @@
   {
     TRACE_SANITIZE (this);
     if (!(c->check_struct (this)
-       && c->check_array (arrayZ, USHORT::static_size * closure->stride, len))) return TRACE_RETURN (false);
+       && c->check_array (arrayZ, USHORT::static_size * closure->stride, len))) return_trace (false);
 
     unsigned int count = len;
     const PairValueRecord *record = CastP<PairValueRecord> (arrayZ);
-    return TRACE_RETURN (closure->valueFormats[0].sanitize_values_stride_unsafe (c, closure->base, &record->values[0], count, closure->stride)
-		      && closure->valueFormats[1].sanitize_values_stride_unsafe (c, closure->base, &record->values[closure->len1], count, closure->stride));
+    return_trace (closure->valueFormats[0].sanitize_values_stride_unsafe (c, closure->base, &record->values[0], count, closure->stride) &&
+		  closure->valueFormats[1].sanitize_values_stride_unsafe (c, closure->base, &record->values[closure->len1], count, closure->stride));
   }
 
   protected:
@@ -691,19 +691,21 @@
     TRACE_APPLY (this);
     hb_buffer_t *buffer = c->buffer;
     unsigned int index = (this+coverage).get_coverage  (buffer->cur().codepoint);
-    if (likely (index == NOT_COVERED)) return TRACE_RETURN (false);
+    if (likely (index == NOT_COVERED)) return_trace (false);
 
     hb_apply_context_t::skipping_iterator_t &skippy_iter = c->iter_input;
     skippy_iter.reset (buffer->idx, 1);
-    if (!skippy_iter.next ()) return TRACE_RETURN (false);
+    if (!skippy_iter.next ()) return_trace (false);
 
-    return TRACE_RETURN ((this+pairSet[index]).apply (c, &valueFormat1, skippy_iter.idx));
+    return_trace ((this+pairSet[index]).apply (c, &valueFormat1, skippy_iter.idx));
   }
 
   inline bool sanitize (hb_sanitize_context_t *c) const
   {
     TRACE_SANITIZE (this);
 
+    if (!c->check_struct (this)) return_trace (false);
+
     unsigned int len1 = valueFormat1.get_len ();
     unsigned int len2 = valueFormat2.get_len ();
     PairSet::sanitize_closure_t closure = {
@@ -713,7 +715,7 @@
       1 + len1 + len2
     };
 
-    return TRACE_RETURN (c->check_struct (this) && coverage.sanitize (c, this) && pairSet.sanitize (c, this, &closure));
+    return_trace (coverage.sanitize (c, this) && pairSet.sanitize (c, this, &closure));
   }
 
   protected:
@@ -762,11 +764,11 @@
     TRACE_APPLY (this);
     hb_buffer_t *buffer = c->buffer;
     unsigned int index = (this+coverage).get_coverage  (buffer->cur().codepoint);
-    if (likely (index == NOT_COVERED)) return TRACE_RETURN (false);
+    if (likely (index == NOT_COVERED)) return_trace (false);
 
     hb_apply_context_t::skipping_iterator_t &skippy_iter = c->iter_input;
     skippy_iter.reset (buffer->idx, 1);
-    if (!skippy_iter.next ()) return TRACE_RETURN (false);
+    if (!skippy_iter.next ()) return_trace (false);
 
     unsigned int len1 = valueFormat1.get_len ();
     unsigned int len2 = valueFormat2.get_len ();
@@ -774,7 +776,7 @@
 
     unsigned int klass1 = (this+classDef1).get_class (buffer->cur().codepoint);
     unsigned int klass2 = (this+classDef2).get_class (buffer->info[skippy_iter.idx].codepoint);
-    if (unlikely (klass1 >= class1Count || klass2 >= class2Count)) return TRACE_RETURN (false);
+    if (unlikely (klass1 >= class1Count || klass2 >= class2Count)) return_trace (false);
 
     const Value *v = &values[record_len * (klass1 * class2Count + klass2)];
     valueFormat1.apply_value (c->font, c->direction, this,
@@ -786,7 +788,7 @@
     if (len2)
       buffer->idx++;
 
-    return TRACE_RETURN (true);
+    return_trace (true);
   }
 
   inline bool sanitize (hb_sanitize_context_t *c) const
@@ -795,16 +797,16 @@
     if (!(c->check_struct (this)
        && coverage.sanitize (c, this)
        && classDef1.sanitize (c, this)
-       && classDef2.sanitize (c, this))) return TRACE_RETURN (false);
+       && classDef2.sanitize (c, this))) return_trace (false);
 
     unsigned int len1 = valueFormat1.get_len ();
     unsigned int len2 = valueFormat2.get_len ();
     unsigned int stride = len1 + len2;
     unsigned int record_size = valueFormat1.get_size () + valueFormat2.get_size ();
     unsigned int count = (unsigned int) class1Count * (unsigned int) class2Count;
-    return TRACE_RETURN (c->check_array (values, record_size, count) &&
-			 valueFormat1.sanitize_values_stride_unsafe (c, this, &values[0], count, stride) &&
-			 valueFormat2.sanitize_values_stride_unsafe (c, this, &values[len1], count, stride));
+    return_trace (c->check_array (values, record_size, count) &&
+		  valueFormat1.sanitize_values_stride_unsafe (c, this, &values[0], count, stride) &&
+		  valueFormat2.sanitize_values_stride_unsafe (c, this, &values[len1], count, stride));
   }
 
   protected:
@@ -843,11 +845,11 @@
   inline typename context_t::return_t dispatch (context_t *c) const
   {
     TRACE_DISPATCH (this, u.format);
-    if (unlikely (!c->may_dispatch (this, &u.format))) TRACE_RETURN (c->default_return_value ());
+    if (unlikely (!c->may_dispatch (this, &u.format))) return_trace (c->no_dispatch_return_value ());
     switch (u.format) {
-    case 1: return TRACE_RETURN (c->dispatch (u.format1));
-    case 2: return TRACE_RETURN (c->dispatch (u.format2));
-    default:return TRACE_RETURN (c->default_return_value ());
+    case 1: return_trace (c->dispatch (u.format1));
+    case 2: return_trace (c->dispatch (u.format2));
+    default:return_trace (c->default_return_value ());
     }
   }
 
@@ -867,7 +869,7 @@
   inline bool sanitize (hb_sanitize_context_t *c, const void *base) const
   {
     TRACE_SANITIZE (this);
-    return TRACE_RETURN (entryAnchor.sanitize (c, base) && exitAnchor.sanitize (c, base));
+    return_trace (entryAnchor.sanitize (c, base) && exitAnchor.sanitize (c, base));
   }
 
   protected:
@@ -883,6 +885,9 @@
   DEFINE_SIZE_STATIC (4);
 };
 
+static void
+reverse_cursive_minor_offset (hb_glyph_position_t *pos, unsigned int i, hb_direction_t direction, unsigned int new_parent);
+
 struct CursivePosFormat1
 {
   inline void collect_glyphs (hb_collect_glyphs_context_t *c) const
@@ -902,17 +907,17 @@
     hb_buffer_t *buffer = c->buffer;
 
     /* We don't handle mark glyphs here. */
-    if (unlikely (_hb_glyph_info_is_mark (&buffer->cur()))) return TRACE_RETURN (false);
+    if (unlikely (_hb_glyph_info_is_mark (&buffer->cur()))) return_trace (false);
 
     const EntryExitRecord &this_record = entryExitRecord[(this+coverage).get_coverage  (buffer->cur().codepoint)];
-    if (!this_record.exitAnchor) return TRACE_RETURN (false);
+    if (!this_record.exitAnchor) return_trace (false);
 
     hb_apply_context_t::skipping_iterator_t &skippy_iter = c->iter_input;
     skippy_iter.reset (buffer->idx, 1);
-    if (!skippy_iter.next ()) return TRACE_RETURN (false);
+    if (!skippy_iter.next ()) return_trace (false);
 
     const EntryExitRecord &next_record = entryExitRecord[(this+coverage).get_coverage  (buffer->info[skippy_iter.idx].codepoint)];
-    if (!next_record.entryAnchor) return TRACE_RETURN (false);
+    if (!next_record.entryAnchor) return_trace (false);
 
     unsigned int i = buffer->idx;
     unsigned int j = skippy_iter.idx;
@@ -960,28 +965,47 @@
     }
 
     /* Cross-direction adjustment */
-    if  (c->lookup_props & LookupFlag::RightToLeft) {
-      pos[i].cursive_chain() = j - i;
-      if (likely (HB_DIRECTION_IS_HORIZONTAL (c->direction)))
-	pos[i].y_offset = entry_y - exit_y;
-      else
-	pos[i].x_offset = entry_x - exit_x;
-    } else {
-      pos[j].cursive_chain() = i - j;
-      if (likely (HB_DIRECTION_IS_HORIZONTAL (c->direction)))
-	pos[j].y_offset = exit_y - entry_y;
-      else
-	pos[j].x_offset = exit_x - entry_x;
+
+    /* We attach child to parent (think graph theory and rooted trees whereas
+     * the root stays on baseline and each node aligns itself against its
+     * parent.
+     *
+     * Optimize things for the case of RightToLeft, as that's most common in
+     * Arabinc. */
+    unsigned int child  = i;
+    unsigned int parent = j;
+    hb_position_t x_offset = entry_x - exit_x;
+    hb_position_t y_offset = entry_y - exit_y;
+    if  (!(c->lookup_props & LookupFlag::RightToLeft))
+    {
+      unsigned int k = child;
+      child = parent;
+      parent = k;
+      x_offset = -x_offset;
+      y_offset = -y_offset;
     }
 
+    /* If child was already connected to someone else, walk through its old
+     * chain and reverse the link direction, such that the whole tree of its
+     * previous connection now attaches to new parent.  Watch out for case
+     * where new parent is on the path from old chain...
+     */
+    reverse_cursive_minor_offset (pos, child, c->direction, parent);
+
+    pos[child].cursive_chain() = parent - child;
+    if (likely (HB_DIRECTION_IS_HORIZONTAL (c->direction)))
+      pos[child].y_offset = y_offset;
+    else
+      pos[child].x_offset = x_offset;
+
     buffer->idx = j;
-    return TRACE_RETURN (true);
+    return_trace (true);
   }
 
   inline bool sanitize (hb_sanitize_context_t *c) const
   {
     TRACE_SANITIZE (this);
-    return TRACE_RETURN (coverage.sanitize (c, this) && entryExitRecord.sanitize (c, this));
+    return_trace (coverage.sanitize (c, this) && entryExitRecord.sanitize (c, this));
   }
 
   protected:
@@ -1002,10 +1026,10 @@
   inline typename context_t::return_t dispatch (context_t *c) const
   {
     TRACE_DISPATCH (this, u.format);
-    if (unlikely (!c->may_dispatch (this, &u.format))) TRACE_RETURN (c->default_return_value ());
+    if (unlikely (!c->may_dispatch (this, &u.format))) return_trace (c->no_dispatch_return_value ());
     switch (u.format) {
-    case 1: return TRACE_RETURN (c->dispatch (u.format1));
-    default:return TRACE_RETURN (c->default_return_value ());
+    case 1: return_trace (c->dispatch (u.format1));
+    default:return_trace (c->default_return_value ());
     }
   }
 
@@ -1041,33 +1065,36 @@
     TRACE_APPLY (this);
     hb_buffer_t *buffer = c->buffer;
     unsigned int mark_index = (this+markCoverage).get_coverage  (buffer->cur().codepoint);
-    if (likely (mark_index == NOT_COVERED)) return TRACE_RETURN (false);
+    if (likely (mark_index == NOT_COVERED)) return_trace (false);
 
     /* now we search backwards for a non-mark glyph */
     hb_apply_context_t::skipping_iterator_t &skippy_iter = c->iter_input;
     skippy_iter.reset (buffer->idx, 1);
     skippy_iter.set_lookup_props (LookupFlag::IgnoreMarks);
     do {
-      if (!skippy_iter.prev ()) return TRACE_RETURN (false);
+      if (!skippy_iter.prev ()) return_trace (false);
       /* We only want to attach to the first of a MultipleSubst sequence.  Reject others. */
       if (0 == _hb_glyph_info_get_lig_comp (&buffer->info[skippy_iter.idx])) break;
       skippy_iter.reject ();
     } while (1);
 
     /* Checking that matched glyph is actually a base glyph by GDEF is too strong; disabled */
-    if (!_hb_glyph_info_is_base_glyph (&buffer->info[skippy_iter.idx])) { /*return TRACE_RETURN (false);*/ }
+    if (!_hb_glyph_info_is_base_glyph (&buffer->info[skippy_iter.idx])) { /*return_trace (false);*/ }
 
     unsigned int base_index = (this+baseCoverage).get_coverage  (buffer->info[skippy_iter.idx].codepoint);
-    if (base_index == NOT_COVERED) return TRACE_RETURN (false);
+    if (base_index == NOT_COVERED) return_trace (false);
 
-    return TRACE_RETURN ((this+markArray).apply (c, mark_index, base_index, this+baseArray, classCount, skippy_iter.idx));
+    return_trace ((this+markArray).apply (c, mark_index, base_index, this+baseArray, classCount, skippy_iter.idx));
   }
 
   inline bool sanitize (hb_sanitize_context_t *c) const
   {
     TRACE_SANITIZE (this);
-    return TRACE_RETURN (c->check_struct (this) && markCoverage.sanitize (c, this) && baseCoverage.sanitize (c, this) &&
-			 markArray.sanitize (c, this) && baseArray.sanitize (c, this, (unsigned int) classCount));
+    return_trace (c->check_struct (this) &&
+		  markCoverage.sanitize (c, this) &&
+		  baseCoverage.sanitize (c, this) &&
+		  markArray.sanitize (c, this) &&
+		  baseArray.sanitize (c, this, (unsigned int) classCount));
   }
 
   protected:
@@ -1095,10 +1122,10 @@
   inline typename context_t::return_t dispatch (context_t *c) const
   {
     TRACE_DISPATCH (this, u.format);
-    if (unlikely (!c->may_dispatch (this, &u.format))) TRACE_RETURN (c->default_return_value ());
+    if (unlikely (!c->may_dispatch (this, &u.format))) return_trace (c->no_dispatch_return_value ());
     switch (u.format) {
-    case 1: return TRACE_RETURN (c->dispatch (u.format1));
-    default:return TRACE_RETURN (c->default_return_value ());
+    case 1: return_trace (c->dispatch (u.format1));
+    default:return_trace (c->default_return_value ());
     }
   }
 
@@ -1139,27 +1166,27 @@
     TRACE_APPLY (this);
     hb_buffer_t *buffer = c->buffer;
     unsigned int mark_index = (this+markCoverage).get_coverage  (buffer->cur().codepoint);
-    if (likely (mark_index == NOT_COVERED)) return TRACE_RETURN (false);
+    if (likely (mark_index == NOT_COVERED)) return_trace (false);
 
     /* now we search backwards for a non-mark glyph */
     hb_apply_context_t::skipping_iterator_t &skippy_iter = c->iter_input;
     skippy_iter.reset (buffer->idx, 1);
     skippy_iter.set_lookup_props (LookupFlag::IgnoreMarks);
-    if (!skippy_iter.prev ()) return TRACE_RETURN (false);
+    if (!skippy_iter.prev ()) return_trace (false);
 
     /* Checking that matched glyph is actually a ligature by GDEF is too strong; disabled */
-    if (!_hb_glyph_info_is_ligature (&buffer->info[skippy_iter.idx])) { /*return TRACE_RETURN (false);*/ }
+    if (!_hb_glyph_info_is_ligature (&buffer->info[skippy_iter.idx])) { /*return_trace (false);*/ }
 
     unsigned int j = skippy_iter.idx;
     unsigned int lig_index = (this+ligatureCoverage).get_coverage  (buffer->info[j].codepoint);
-    if (lig_index == NOT_COVERED) return TRACE_RETURN (false);
+    if (lig_index == NOT_COVERED) return_trace (false);
 
     const LigatureArray& lig_array = this+ligatureArray;
     const LigatureAttach& lig_attach = lig_array[lig_index];
 
     /* Find component to attach to */
     unsigned int comp_count = lig_attach.rows;
-    if (unlikely (!comp_count)) return TRACE_RETURN (false);
+    if (unlikely (!comp_count)) return_trace (false);
 
     /* We must now check whether the ligature ID of the current mark glyph
      * is identical to the ligature ID of the found ligature.  If yes, we
@@ -1174,14 +1201,17 @@
     else
       comp_index = comp_count - 1;
 
-    return TRACE_RETURN ((this+markArray).apply (c, mark_index, comp_index, lig_attach, classCount, j));
+    return_trace ((this+markArray).apply (c, mark_index, comp_index, lig_attach, classCount, j));
   }
 
   inline bool sanitize (hb_sanitize_context_t *c) const
   {
     TRACE_SANITIZE (this);
-    return TRACE_RETURN (c->check_struct (this) && markCoverage.sanitize (c, this) && ligatureCoverage.sanitize (c, this) &&
-			 markArray.sanitize (c, this) && ligatureArray.sanitize (c, this, (unsigned int) classCount));
+    return_trace (c->check_struct (this) &&
+		  markCoverage.sanitize (c, this) &&
+		  ligatureCoverage.sanitize (c, this) &&
+		  markArray.sanitize (c, this) &&
+		  ligatureArray.sanitize (c, this, (unsigned int) classCount));
   }
 
   protected:
@@ -1210,10 +1240,10 @@
   inline typename context_t::return_t dispatch (context_t *c) const
   {
     TRACE_DISPATCH (this, u.format);
-    if (unlikely (!c->may_dispatch (this, &u.format))) TRACE_RETURN (c->default_return_value ());
+    if (unlikely (!c->may_dispatch (this, &u.format))) return_trace (c->no_dispatch_return_value ());
     switch (u.format) {
-    case 1: return TRACE_RETURN (c->dispatch (u.format1));
-    default:return TRACE_RETURN (c->default_return_value ());
+    case 1: return_trace (c->dispatch (u.format1));
+    default:return_trace (c->default_return_value ());
     }
   }
 
@@ -1249,15 +1279,15 @@
     TRACE_APPLY (this);
     hb_buffer_t *buffer = c->buffer;
     unsigned int mark1_index = (this+mark1Coverage).get_coverage  (buffer->cur().codepoint);
-    if (likely (mark1_index == NOT_COVERED)) return TRACE_RETURN (false);
+    if (likely (mark1_index == NOT_COVERED)) return_trace (false);
 
     /* now we search backwards for a suitable mark glyph until a non-mark glyph */
     hb_apply_context_t::skipping_iterator_t &skippy_iter = c->iter_input;
     skippy_iter.reset (buffer->idx, 1);
     skippy_iter.set_lookup_props (c->lookup_props & ~LookupFlag::IgnoreFlags);
-    if (!skippy_iter.prev ()) return TRACE_RETURN (false);
+    if (!skippy_iter.prev ()) return_trace (false);
 
-    if (!_hb_glyph_info_is_mark (&buffer->info[skippy_iter.idx])) { return TRACE_RETURN (false); }
+    if (!_hb_glyph_info_is_mark (&buffer->info[skippy_iter.idx])) { return_trace (false); }
 
     unsigned int j = skippy_iter.idx;
 
@@ -1279,21 +1309,23 @@
     }
 
     /* Didn't match. */
-    return TRACE_RETURN (false);
+    return_trace (false);
 
     good:
     unsigned int mark2_index = (this+mark2Coverage).get_coverage  (buffer->info[j].codepoint);
-    if (mark2_index == NOT_COVERED) return TRACE_RETURN (false);
+    if (mark2_index == NOT_COVERED) return_trace (false);
 
-    return TRACE_RETURN ((this+mark1Array).apply (c, mark1_index, mark2_index, this+mark2Array, classCount, j));
+    return_trace ((this+mark1Array).apply (c, mark1_index, mark2_index, this+mark2Array, classCount, j));
   }
 
   inline bool sanitize (hb_sanitize_context_t *c) const
   {
     TRACE_SANITIZE (this);
-    return TRACE_RETURN (c->check_struct (this) && mark1Coverage.sanitize (c, this) &&
-			 mark2Coverage.sanitize (c, this) && mark1Array.sanitize (c, this)
-			 && mark2Array.sanitize (c, this, (unsigned int) classCount));
+    return_trace (c->check_struct (this) &&
+		  mark1Coverage.sanitize (c, this) &&
+		  mark2Coverage.sanitize (c, this) &&
+		  mark1Array.sanitize (c, this) &&
+		  mark2Array.sanitize (c, this, (unsigned int) classCount));
   }
 
   protected:
@@ -1323,10 +1355,10 @@
   inline typename context_t::return_t dispatch (context_t *c) const
   {
     TRACE_DISPATCH (this, u.format);
-    if (unlikely (!c->may_dispatch (this, &u.format))) TRACE_RETURN (c->default_return_value ());
+    if (unlikely (!c->may_dispatch (this, &u.format))) return_trace (c->no_dispatch_return_value ());
     switch (u.format) {
-    case 1: return TRACE_RETURN (c->dispatch (u.format1));
-    default:return TRACE_RETURN (c->default_return_value ());
+    case 1: return_trace (c->dispatch (u.format1));
+    default:return_trace (c->default_return_value ());
     }
   }
 
@@ -1374,19 +1406,18 @@
   inline typename context_t::return_t dispatch (context_t *c, unsigned int lookup_type) const
   {
     TRACE_DISPATCH (this, lookup_type);
-    /* The sub_format passed to may_dispatch is unnecessary but harmless. */
-    if (unlikely (!c->may_dispatch (this, &u.sub_format))) TRACE_RETURN (c->default_return_value ());
+    if (unlikely (!c->may_dispatch (this, &u.sub_format))) return_trace (c->no_dispatch_return_value ());
     switch (lookup_type) {
-    case Single:		return TRACE_RETURN (u.single.dispatch (c));
-    case Pair:			return TRACE_RETURN (u.pair.dispatch (c));
-    case Cursive:		return TRACE_RETURN (u.cursive.dispatch (c));
-    case MarkBase:		return TRACE_RETURN (u.markBase.dispatch (c));
-    case MarkLig:		return TRACE_RETURN (u.markLig.dispatch (c));
-    case MarkMark:		return TRACE_RETURN (u.markMark.dispatch (c));
-    case Context:		return TRACE_RETURN (u.context.dispatch (c));
-    case ChainContext:		return TRACE_RETURN (u.chainContext.dispatch (c));
-    case Extension:		return TRACE_RETURN (u.extension.dispatch (c));
-    default:			return TRACE_RETURN (c->default_return_value ());
+    case Single:		return_trace (u.single.dispatch (c));
+    case Pair:			return_trace (u.pair.dispatch (c));
+    case Cursive:		return_trace (u.cursive.dispatch (c));
+    case MarkBase:		return_trace (u.markBase.dispatch (c));
+    case MarkLig:		return_trace (u.markLig.dispatch (c));
+    case MarkMark:		return_trace (u.markMark.dispatch (c));
+    case Context:		return_trace (u.context.dispatch (c));
+    case ChainContext:		return_trace (u.chainContext.dispatch (c));
+    case Extension:		return_trace (u.extension.dispatch (c));
+    default:			return_trace (c->default_return_value ());
     }
   }
 
@@ -1421,13 +1452,13 @@
   inline bool apply (hb_apply_context_t *c) const
   {
     TRACE_APPLY (this);
-    return TRACE_RETURN (dispatch (c));
+    return_trace (dispatch (c));
   }
 
   inline hb_collect_glyphs_context_t::return_t collect_glyphs (hb_collect_glyphs_context_t *c) const
   {
     TRACE_COLLECT_GLYPHS (this);
-    return TRACE_RETURN (dispatch (c));
+    return_trace (dispatch (c));
   }
 
   template <typename set_t>
@@ -1449,8 +1480,8 @@
   inline bool sanitize (hb_sanitize_context_t *c) const
   {
     TRACE_SANITIZE (this);
-    if (unlikely (!Lookup::sanitize (c))) return TRACE_RETURN (false);
-    return TRACE_RETURN (dispatch (c));
+    if (unlikely (!Lookup::sanitize (c))) return_trace (false);
+    return_trace (dispatch (c));
   }
 };
 
@@ -1473,9 +1504,9 @@
   inline bool sanitize (hb_sanitize_context_t *c) const
   {
     TRACE_SANITIZE (this);
-    if (unlikely (!GSUBGPOS::sanitize (c))) return TRACE_RETURN (false);
+    if (unlikely (!GSUBGPOS::sanitize (c))) return_trace (false);
     const OffsetTo<PosLookupList> &list = CastR<OffsetTo<PosLookupList> > (lookupList);
-    return TRACE_RETURN (list.sanitize (c, this));
+    return_trace (list.sanitize (c, this));
   }
   public:
   DEFINE_SIZE_STATIC (10);
@@ -1483,6 +1514,30 @@
 
 
 static void
+reverse_cursive_minor_offset (hb_glyph_position_t *pos, unsigned int i, hb_direction_t direction, unsigned int new_parent)
+{
+  unsigned int j = pos[i].cursive_chain();
+  if (likely (!j))
+    return;
+
+  j += i;
+
+  pos[i].cursive_chain() = 0;
+
+  /* Stop if we see new parent in the chain. */
+  if (j == new_parent)
+    return;
+
+  reverse_cursive_minor_offset (pos, j, direction, new_parent);
+
+  if (HB_DIRECTION_IS_HORIZONTAL (direction))
+    pos[j].y_offset = -pos[i].y_offset;
+  else
+    pos[j].x_offset = -pos[i].x_offset;
+
+  pos[j].cursive_chain() = i - j;
+}
+static void
 fix_cursive_minor_offset (hb_glyph_position_t *pos, unsigned int i, hb_direction_t direction)
 {
   unsigned int j = pos[i].cursive_chain();
diff --git a/third_party/harfbuzz-ng/src/hb-ot-layout-gsub-table.hh b/third_party/harfbuzz-ng/src/hb-ot-layout-gsub-table.hh
index ff20484..eebc87b4 100644
--- a/third_party/harfbuzz-ng/src/hb-ot-layout-gsub-table.hh
+++ b/third_party/harfbuzz-ng/src/hb-ot-layout-gsub-table.hh
@@ -67,7 +67,7 @@
   inline bool would_apply (hb_would_apply_context_t *c) const
   {
     TRACE_WOULD_APPLY (this);
-    return TRACE_RETURN (c->len == 1 && (this+coverage).get_coverage (c->glyphs[0]) != NOT_COVERED);
+    return_trace (c->len == 1 && (this+coverage).get_coverage (c->glyphs[0]) != NOT_COVERED);
   }
 
   inline bool apply (hb_apply_context_t *c) const
@@ -75,14 +75,14 @@
     TRACE_APPLY (this);
     hb_codepoint_t glyph_id = c->buffer->cur().codepoint;
     unsigned int index = (this+coverage).get_coverage (glyph_id);
-    if (likely (index == NOT_COVERED)) return TRACE_RETURN (false);
+    if (likely (index == NOT_COVERED)) return_trace (false);
 
     /* According to the Adobe Annotated OpenType Suite, result is always
      * limited to 16bit. */
     glyph_id = (glyph_id + deltaGlyphID) & 0xFFFFu;
     c->replace_glyph (glyph_id);
 
-    return TRACE_RETURN (true);
+    return_trace (true);
   }
 
   inline bool serialize (hb_serialize_context_t *c,
@@ -91,16 +91,16 @@
 			 int delta)
   {
     TRACE_SERIALIZE (this);
-    if (unlikely (!c->extend_min (*this))) return TRACE_RETURN (false);
-    if (unlikely (!coverage.serialize (c, this).serialize (c, glyphs, num_glyphs))) return TRACE_RETURN (false);
+    if (unlikely (!c->extend_min (*this))) return_trace (false);
+    if (unlikely (!coverage.serialize (c, this).serialize (c, glyphs, num_glyphs))) return_trace (false);
     deltaGlyphID.set (delta); /* TODO(serilaize) overflow? */
-    return TRACE_RETURN (true);
+    return_trace (true);
   }
 
   inline bool sanitize (hb_sanitize_context_t *c) const
   {
     TRACE_SANITIZE (this);
-    return TRACE_RETURN (coverage.sanitize (c, this) && deltaGlyphID.sanitize (c));
+    return_trace (coverage.sanitize (c, this) && deltaGlyphID.sanitize (c));
   }
 
   protected:
@@ -144,7 +144,7 @@
   inline bool would_apply (hb_would_apply_context_t *c) const
   {
     TRACE_WOULD_APPLY (this);
-    return TRACE_RETURN (c->len == 1 && (this+coverage).get_coverage (c->glyphs[0]) != NOT_COVERED);
+    return_trace (c->len == 1 && (this+coverage).get_coverage (c->glyphs[0]) != NOT_COVERED);
   }
 
   inline bool apply (hb_apply_context_t *c) const
@@ -152,14 +152,14 @@
     TRACE_APPLY (this);
     hb_codepoint_t glyph_id = c->buffer->cur().codepoint;
     unsigned int index = (this+coverage).get_coverage (glyph_id);
-    if (likely (index == NOT_COVERED)) return TRACE_RETURN (false);
+    if (likely (index == NOT_COVERED)) return_trace (false);
 
-    if (unlikely (index >= substitute.len)) return TRACE_RETURN (false);
+    if (unlikely (index >= substitute.len)) return_trace (false);
 
     glyph_id = substitute[index];
     c->replace_glyph (glyph_id);
 
-    return TRACE_RETURN (true);
+    return_trace (true);
   }
 
   inline bool serialize (hb_serialize_context_t *c,
@@ -168,16 +168,16 @@
 			 unsigned int num_glyphs)
   {
     TRACE_SERIALIZE (this);
-    if (unlikely (!c->extend_min (*this))) return TRACE_RETURN (false);
-    if (unlikely (!substitute.serialize (c, substitutes, num_glyphs))) return TRACE_RETURN (false);
-    if (unlikely (!coverage.serialize (c, this).serialize (c, glyphs, num_glyphs))) return TRACE_RETURN (false);
-    return TRACE_RETURN (true);
+    if (unlikely (!c->extend_min (*this))) return_trace (false);
+    if (unlikely (!substitute.serialize (c, substitutes, num_glyphs))) return_trace (false);
+    if (unlikely (!coverage.serialize (c, this).serialize (c, glyphs, num_glyphs))) return_trace (false);
+    return_trace (true);
   }
 
   inline bool sanitize (hb_sanitize_context_t *c) const
   {
     TRACE_SANITIZE (this);
-    return TRACE_RETURN (coverage.sanitize (c, this) && substitute.sanitize (c));
+    return_trace (coverage.sanitize (c, this) && substitute.sanitize (c));
   }
 
   protected:
@@ -200,7 +200,7 @@
 			 unsigned int num_glyphs)
   {
     TRACE_SERIALIZE (this);
-    if (unlikely (!c->extend_min (u.format))) return TRACE_RETURN (false);
+    if (unlikely (!c->extend_min (u.format))) return_trace (false);
     unsigned int format = 2;
     int delta = 0;
     if (num_glyphs) {
@@ -215,9 +215,9 @@
     }
     u.format.set (format);
     switch (u.format) {
-    case 1: return TRACE_RETURN (u.format1.serialize (c, glyphs, num_glyphs, delta));
-    case 2: return TRACE_RETURN (u.format2.serialize (c, glyphs, substitutes, num_glyphs));
-    default:return TRACE_RETURN (false);
+    case 1: return_trace (u.format1.serialize (c, glyphs, num_glyphs, delta));
+    case 2: return_trace (u.format2.serialize (c, glyphs, substitutes, num_glyphs));
+    default:return_trace (false);
     }
   }
 
@@ -225,11 +225,11 @@
   inline typename context_t::return_t dispatch (context_t *c) const
   {
     TRACE_DISPATCH (this, u.format);
-    if (unlikely (!c->may_dispatch (this, &u.format))) TRACE_RETURN (c->default_return_value ());
+    if (unlikely (!c->may_dispatch (this, &u.format))) return_trace (c->no_dispatch_return_value ());
     switch (u.format) {
-    case 1: return TRACE_RETURN (c->dispatch (u.format1));
-    case 2: return TRACE_RETURN (c->dispatch (u.format2));
-    default:return TRACE_RETURN (c->default_return_value ());
+    case 1: return_trace (c->dispatch (u.format1));
+    case 2: return_trace (c->dispatch (u.format2));
+    default:return_trace (c->default_return_value ());
     }
   }
 
@@ -273,14 +273,14 @@
      * buffer->move_to() makes assumptions about this too.  Perhaps fix
      * in the future after figuring out what to do with the clusters.
      */
-    if (unlikely (!count)) return TRACE_RETURN (false);
+    if (unlikely (!count)) return_trace (false);
 
     /* Special-case to make it in-place and not consider this
      * as a "multiplied" substitution. */
     if (unlikely (count == 1))
     {
       c->replace_glyph (substitute.array[0]);
-      return TRACE_RETURN (true);
+      return_trace (true);
     }
 
     unsigned int klass = _hb_glyph_info_is_ligature (&c->buffer->cur()) ?
@@ -292,7 +292,7 @@
     }
     c->buffer->skip_glyph ();
 
-    return TRACE_RETURN (true);
+    return_trace (true);
   }
 
   inline bool serialize (hb_serialize_context_t *c,
@@ -300,15 +300,15 @@
 			 unsigned int num_glyphs)
   {
     TRACE_SERIALIZE (this);
-    if (unlikely (!c->extend_min (*this))) return TRACE_RETURN (false);
-    if (unlikely (!substitute.serialize (c, glyphs, num_glyphs))) return TRACE_RETURN (false);
-    return TRACE_RETURN (true);
+    if (unlikely (!c->extend_min (*this))) return_trace (false);
+    if (unlikely (!substitute.serialize (c, glyphs, num_glyphs))) return_trace (false);
+    return_trace (true);
   }
 
   inline bool sanitize (hb_sanitize_context_t *c) const
   {
     TRACE_SANITIZE (this);
-    return TRACE_RETURN (substitute.sanitize (c));
+    return_trace (substitute.sanitize (c));
   }
 
   protected:
@@ -347,7 +347,7 @@
   inline bool would_apply (hb_would_apply_context_t *c) const
   {
     TRACE_WOULD_APPLY (this);
-    return TRACE_RETURN (c->len == 1 && (this+coverage).get_coverage (c->glyphs[0]) != NOT_COVERED);
+    return_trace (c->len == 1 && (this+coverage).get_coverage (c->glyphs[0]) != NOT_COVERED);
   }
 
   inline bool apply (hb_apply_context_t *c) const
@@ -355,9 +355,9 @@
     TRACE_APPLY (this);
 
     unsigned int index = (this+coverage).get_coverage (c->buffer->cur().codepoint);
-    if (likely (index == NOT_COVERED)) return TRACE_RETURN (false);
+    if (likely (index == NOT_COVERED)) return_trace (false);
 
-    return TRACE_RETURN ((this+sequence[index]).apply (c));
+    return_trace ((this+sequence[index]).apply (c));
   }
 
   inline bool serialize (hb_serialize_context_t *c,
@@ -367,21 +367,21 @@
 			 Supplier<GlyphID> &substitute_glyphs_list)
   {
     TRACE_SERIALIZE (this);
-    if (unlikely (!c->extend_min (*this))) return TRACE_RETURN (false);
-    if (unlikely (!sequence.serialize (c, num_glyphs))) return TRACE_RETURN (false);
+    if (unlikely (!c->extend_min (*this))) return_trace (false);
+    if (unlikely (!sequence.serialize (c, num_glyphs))) return_trace (false);
     for (unsigned int i = 0; i < num_glyphs; i++)
       if (unlikely (!sequence[i].serialize (c, this).serialize (c,
 								substitute_glyphs_list,
-								substitute_len_list[i]))) return TRACE_RETURN (false);
+								substitute_len_list[i]))) return_trace (false);
     substitute_len_list.advance (num_glyphs);
-    if (unlikely (!coverage.serialize (c, this).serialize (c, glyphs, num_glyphs))) return TRACE_RETURN (false);
-    return TRACE_RETURN (true);
+    if (unlikely (!coverage.serialize (c, this).serialize (c, glyphs, num_glyphs))) return_trace (false);
+    return_trace (true);
   }
 
   inline bool sanitize (hb_sanitize_context_t *c) const
   {
     TRACE_SANITIZE (this);
-    return TRACE_RETURN (coverage.sanitize (c, this) && sequence.sanitize (c, this));
+    return_trace (coverage.sanitize (c, this) && sequence.sanitize (c, this));
   }
 
   protected:
@@ -405,12 +405,12 @@
 			 Supplier<GlyphID> &substitute_glyphs_list)
   {
     TRACE_SERIALIZE (this);
-    if (unlikely (!c->extend_min (u.format))) return TRACE_RETURN (false);
+    if (unlikely (!c->extend_min (u.format))) return_trace (false);
     unsigned int format = 1;
     u.format.set (format);
     switch (u.format) {
-    case 1: return TRACE_RETURN (u.format1.serialize (c, glyphs, substitute_len_list, num_glyphs, substitute_glyphs_list));
-    default:return TRACE_RETURN (false);
+    case 1: return_trace (u.format1.serialize (c, glyphs, substitute_len_list, num_glyphs, substitute_glyphs_list));
+    default:return_trace (false);
     }
   }
 
@@ -418,10 +418,10 @@
   inline typename context_t::return_t dispatch (context_t *c) const
   {
     TRACE_DISPATCH (this, u.format);
-    if (unlikely (!c->may_dispatch (this, &u.format))) TRACE_RETURN (c->default_return_value ());
+    if (unlikely (!c->may_dispatch (this, &u.format))) return_trace (c->no_dispatch_return_value ());
     switch (u.format) {
-    case 1: return TRACE_RETURN (c->dispatch (u.format1));
-    default:return TRACE_RETURN (c->default_return_value ());
+    case 1: return_trace (c->dispatch (u.format1));
+    default:return_trace (c->default_return_value ());
     }
   }
 
@@ -473,7 +473,7 @@
   inline bool would_apply (hb_would_apply_context_t *c) const
   {
     TRACE_WOULD_APPLY (this);
-    return TRACE_RETURN (c->len == 1 && (this+coverage).get_coverage (c->glyphs[0]) != NOT_COVERED);
+    return_trace (c->len == 1 && (this+coverage).get_coverage (c->glyphs[0]) != NOT_COVERED);
   }
 
   inline bool apply (hb_apply_context_t *c) const
@@ -482,11 +482,11 @@
     hb_codepoint_t glyph_id = c->buffer->cur().codepoint;
 
     unsigned int index = (this+coverage).get_coverage (glyph_id);
-    if (likely (index == NOT_COVERED)) return TRACE_RETURN (false);
+    if (likely (index == NOT_COVERED)) return_trace (false);
 
     const AlternateSet &alt_set = this+alternateSet[index];
 
-    if (unlikely (!alt_set.len)) return TRACE_RETURN (false);
+    if (unlikely (!alt_set.len)) return_trace (false);
 
     hb_mask_t glyph_mask = c->buffer->cur().mask;
     hb_mask_t lookup_mask = c->lookup_mask;
@@ -495,13 +495,13 @@
     unsigned int shift = _hb_ctz (lookup_mask);
     unsigned int alt_index = ((lookup_mask & glyph_mask) >> shift);
 
-    if (unlikely (alt_index > alt_set.len || alt_index == 0)) return TRACE_RETURN (false);
+    if (unlikely (alt_index > alt_set.len || alt_index == 0)) return_trace (false);
 
     glyph_id = alt_set[alt_index - 1];
 
     c->replace_glyph (glyph_id);
 
-    return TRACE_RETURN (true);
+    return_trace (true);
   }
 
   inline bool serialize (hb_serialize_context_t *c,
@@ -511,21 +511,21 @@
 			 Supplier<GlyphID> &alternate_glyphs_list)
   {
     TRACE_SERIALIZE (this);
-    if (unlikely (!c->extend_min (*this))) return TRACE_RETURN (false);
-    if (unlikely (!alternateSet.serialize (c, num_glyphs))) return TRACE_RETURN (false);
+    if (unlikely (!c->extend_min (*this))) return_trace (false);
+    if (unlikely (!alternateSet.serialize (c, num_glyphs))) return_trace (false);
     for (unsigned int i = 0; i < num_glyphs; i++)
       if (unlikely (!alternateSet[i].serialize (c, this).serialize (c,
 								    alternate_glyphs_list,
-								    alternate_len_list[i]))) return TRACE_RETURN (false);
+								    alternate_len_list[i]))) return_trace (false);
     alternate_len_list.advance (num_glyphs);
-    if (unlikely (!coverage.serialize (c, this).serialize (c, glyphs, num_glyphs))) return TRACE_RETURN (false);
-    return TRACE_RETURN (true);
+    if (unlikely (!coverage.serialize (c, this).serialize (c, glyphs, num_glyphs))) return_trace (false);
+    return_trace (true);
   }
 
   inline bool sanitize (hb_sanitize_context_t *c) const
   {
     TRACE_SANITIZE (this);
-    return TRACE_RETURN (coverage.sanitize (c, this) && alternateSet.sanitize (c, this));
+    return_trace (coverage.sanitize (c, this) && alternateSet.sanitize (c, this));
   }
 
   protected:
@@ -549,12 +549,12 @@
 			 Supplier<GlyphID> &alternate_glyphs_list)
   {
     TRACE_SERIALIZE (this);
-    if (unlikely (!c->extend_min (u.format))) return TRACE_RETURN (false);
+    if (unlikely (!c->extend_min (u.format))) return_trace (false);
     unsigned int format = 1;
     u.format.set (format);
     switch (u.format) {
-    case 1: return TRACE_RETURN (u.format1.serialize (c, glyphs, alternate_len_list, num_glyphs, alternate_glyphs_list));
-    default:return TRACE_RETURN (false);
+    case 1: return_trace (u.format1.serialize (c, glyphs, alternate_len_list, num_glyphs, alternate_glyphs_list));
+    default:return_trace (false);
     }
   }
 
@@ -562,10 +562,10 @@
   inline typename context_t::return_t dispatch (context_t *c) const
   {
     TRACE_DISPATCH (this, u.format);
-    if (unlikely (!c->may_dispatch (this, &u.format))) TRACE_RETURN (c->default_return_value ());
+    if (unlikely (!c->may_dispatch (this, &u.format))) return_trace (c->no_dispatch_return_value ());
     switch (u.format) {
-    case 1: return TRACE_RETURN (c->dispatch (u.format1));
-    default:return TRACE_RETURN (c->default_return_value ());
+    case 1: return_trace (c->dispatch (u.format1));
+    default:return_trace (c->default_return_value ());
     }
   }
 
@@ -602,13 +602,13 @@
   {
     TRACE_WOULD_APPLY (this);
     if (c->len != component.len)
-      return TRACE_RETURN (false);
+      return_trace (false);
 
     for (unsigned int i = 1; i < c->len; i++)
       if (likely (c->glyphs[i] != component[i]))
-	return TRACE_RETURN (false);
+	return_trace (false);
 
-    return TRACE_RETURN (true);
+    return_trace (true);
   }
 
   inline bool apply (hb_apply_context_t *c) const
@@ -616,14 +616,14 @@
     TRACE_APPLY (this);
     unsigned int count = component.len;
 
-    if (unlikely (!count)) return TRACE_RETURN (false);
+    if (unlikely (!count)) return_trace (false);
 
     /* Special-case to make it in-place and not consider this
      * as a "ligated" substitution. */
     if (unlikely (count == 1))
     {
       c->replace_glyph (ligGlyph);
-      return TRACE_RETURN (true);
+      return_trace (true);
     }
 
     bool is_mark_ligature = false;
@@ -640,7 +640,7 @@
 			      match_positions,
 			      &is_mark_ligature,
 			      &total_component_count)))
-      return TRACE_RETURN (false);
+      return_trace (false);
 
     ligate_input (c,
 		  count,
@@ -650,7 +650,7 @@
 		  is_mark_ligature,
 		  total_component_count);
 
-    return TRACE_RETURN (true);
+    return_trace (true);
   }
 
   inline bool serialize (hb_serialize_context_t *c,
@@ -659,17 +659,17 @@
 			 unsigned int num_components /* Including first component */)
   {
     TRACE_SERIALIZE (this);
-    if (unlikely (!c->extend_min (*this))) return TRACE_RETURN (false);
+    if (unlikely (!c->extend_min (*this))) return_trace (false);
     ligGlyph = ligature;
-    if (unlikely (!component.serialize (c, components, num_components))) return TRACE_RETURN (false);
-    return TRACE_RETURN (true);
+    if (unlikely (!component.serialize (c, components, num_components))) return_trace (false);
+    return_trace (true);
   }
 
   public:
   inline bool sanitize (hb_sanitize_context_t *c) const
   {
     TRACE_SANITIZE (this);
-    return TRACE_RETURN (ligGlyph.sanitize (c) && component.sanitize (c));
+    return_trace (ligGlyph.sanitize (c) && component.sanitize (c));
   }
 
   protected:
@@ -708,9 +708,9 @@
     {
       const Ligature &lig = this+ligature[i];
       if (lig.would_apply (c))
-        return TRACE_RETURN (true);
+        return_trace (true);
     }
-    return TRACE_RETURN (false);
+    return_trace (false);
   }
 
   inline bool apply (hb_apply_context_t *c) const
@@ -720,10 +720,10 @@
     for (unsigned int i = 0; i < num_ligs; i++)
     {
       const Ligature &lig = this+ligature[i];
-      if (lig.apply (c)) return TRACE_RETURN (true);
+      if (lig.apply (c)) return_trace (true);
     }
 
-    return TRACE_RETURN (false);
+    return_trace (false);
   }
 
   inline bool serialize (hb_serialize_context_t *c,
@@ -733,22 +733,22 @@
 			 Supplier<GlyphID> &component_list /* Starting from second for each ligature */)
   {
     TRACE_SERIALIZE (this);
-    if (unlikely (!c->extend_min (*this))) return TRACE_RETURN (false);
-    if (unlikely (!ligature.serialize (c, num_ligatures))) return TRACE_RETURN (false);
+    if (unlikely (!c->extend_min (*this))) return_trace (false);
+    if (unlikely (!ligature.serialize (c, num_ligatures))) return_trace (false);
     for (unsigned int i = 0; i < num_ligatures; i++)
       if (unlikely (!ligature[i].serialize (c, this).serialize (c,
 								ligatures[i],
 								component_list,
-								component_count_list[i]))) return TRACE_RETURN (false);
+								component_count_list[i]))) return_trace (false);
     ligatures.advance (num_ligatures);
     component_count_list.advance (num_ligatures);
-    return TRACE_RETURN (true);
+    return_trace (true);
   }
 
   inline bool sanitize (hb_sanitize_context_t *c) const
   {
     TRACE_SANITIZE (this);
-    return TRACE_RETURN (ligature.sanitize (c, this));
+    return_trace (ligature.sanitize (c, this));
   }
 
   protected:
@@ -790,10 +790,10 @@
   {
     TRACE_WOULD_APPLY (this);
     unsigned int index = (this+coverage).get_coverage (c->glyphs[0]);
-    if (likely (index == NOT_COVERED)) return TRACE_RETURN (false);
+    if (likely (index == NOT_COVERED)) return_trace (false);
 
     const LigatureSet &lig_set = this+ligatureSet[index];
-    return TRACE_RETURN (lig_set.would_apply (c));
+    return_trace (lig_set.would_apply (c));
   }
 
   inline bool apply (hb_apply_context_t *c) const
@@ -802,10 +802,10 @@
     hb_codepoint_t glyph_id = c->buffer->cur().codepoint;
 
     unsigned int index = (this+coverage).get_coverage (glyph_id);
-    if (likely (index == NOT_COVERED)) return TRACE_RETURN (false);
+    if (likely (index == NOT_COVERED)) return_trace (false);
 
     const LigatureSet &lig_set = this+ligatureSet[index];
-    return TRACE_RETURN (lig_set.apply (c));
+    return_trace (lig_set.apply (c));
   }
 
   inline bool serialize (hb_serialize_context_t *c,
@@ -817,23 +817,23 @@
 			 Supplier<GlyphID> &component_list /* Starting from second for each ligature */)
   {
     TRACE_SERIALIZE (this);
-    if (unlikely (!c->extend_min (*this))) return TRACE_RETURN (false);
-    if (unlikely (!ligatureSet.serialize (c, num_first_glyphs))) return TRACE_RETURN (false);
+    if (unlikely (!c->extend_min (*this))) return_trace (false);
+    if (unlikely (!ligatureSet.serialize (c, num_first_glyphs))) return_trace (false);
     for (unsigned int i = 0; i < num_first_glyphs; i++)
       if (unlikely (!ligatureSet[i].serialize (c, this).serialize (c,
 								   ligatures_list,
 								   component_count_list,
 								   ligature_per_first_glyph_count_list[i],
-								   component_list))) return TRACE_RETURN (false);
+								   component_list))) return_trace (false);
     ligature_per_first_glyph_count_list.advance (num_first_glyphs);
-    if (unlikely (!coverage.serialize (c, this).serialize (c, first_glyphs, num_first_glyphs))) return TRACE_RETURN (false);
-    return TRACE_RETURN (true);
+    if (unlikely (!coverage.serialize (c, this).serialize (c, first_glyphs, num_first_glyphs))) return_trace (false);
+    return_trace (true);
   }
 
   inline bool sanitize (hb_sanitize_context_t *c) const
   {
     TRACE_SANITIZE (this);
-    return TRACE_RETURN (coverage.sanitize (c, this) && ligatureSet.sanitize (c, this));
+    return_trace (coverage.sanitize (c, this) && ligatureSet.sanitize (c, this));
   }
 
   protected:
@@ -859,13 +859,18 @@
 			 Supplier<GlyphID> &component_list /* Starting from second for each ligature */)
   {
     TRACE_SERIALIZE (this);
-    if (unlikely (!c->extend_min (u.format))) return TRACE_RETURN (false);
+    if (unlikely (!c->extend_min (u.format))) return_trace (false);
     unsigned int format = 1;
     u.format.set (format);
     switch (u.format) {
-    case 1: return TRACE_RETURN (u.format1.serialize (c, first_glyphs, ligature_per_first_glyph_count_list, num_first_glyphs,
-						      ligatures_list, component_count_list, component_list));
-    default:return TRACE_RETURN (false);
+    case 1: return_trace (u.format1.serialize (c,
+					       first_glyphs,
+					       ligature_per_first_glyph_count_list,
+					       num_first_glyphs,
+					       ligatures_list,
+					       component_count_list,
+					       component_list));
+    default:return_trace (false);
     }
   }
 
@@ -873,10 +878,10 @@
   inline typename context_t::return_t dispatch (context_t *c) const
   {
     TRACE_DISPATCH (this, u.format);
-    if (unlikely (!c->may_dispatch (this, &u.format))) TRACE_RETURN (c->default_return_value ());
+    if (unlikely (!c->may_dispatch (this, &u.format))) return_trace (c->no_dispatch_return_value ());
     switch (u.format) {
-    case 1: return TRACE_RETURN (c->dispatch (u.format1));
-    default:return TRACE_RETURN (c->default_return_value ());
+    case 1: return_trace (c->dispatch (u.format1));
+    default:return_trace (c->default_return_value ());
     }
   }
 
@@ -959,17 +964,17 @@
   inline bool would_apply (hb_would_apply_context_t *c) const
   {
     TRACE_WOULD_APPLY (this);
-    return TRACE_RETURN (c->len == 1 && (this+coverage).get_coverage (c->glyphs[0]) != NOT_COVERED);
+    return_trace (c->len == 1 && (this+coverage).get_coverage (c->glyphs[0]) != NOT_COVERED);
   }
 
   inline bool apply (hb_apply_context_t *c) const
   {
     TRACE_APPLY (this);
     if (unlikely (c->nesting_level_left != MAX_NESTING_LEVEL))
-      return TRACE_RETURN (false); /* No chaining to this type */
+      return_trace (false); /* No chaining to this type */
 
     unsigned int index = (this+coverage).get_coverage (c->buffer->cur().codepoint);
-    if (likely (index == NOT_COVERED)) return TRACE_RETURN (false);
+    if (likely (index == NOT_COVERED)) return_trace (false);
 
     const OffsetArrayOf<Coverage> &lookahead = StructAfter<OffsetArrayOf<Coverage> > (backtrack);
     const ArrayOf<GlyphID> &substitute = StructAfter<ArrayOf<GlyphID> > (lookahead);
@@ -986,22 +991,22 @@
       /* Note: We DON'T decrease buffer->idx.  The main loop does it
        * for us.  This is useful for preventing surprises if someone
        * calls us through a Context lookup. */
-      return TRACE_RETURN (true);
+      return_trace (true);
     }
 
-    return TRACE_RETURN (false);
+    return_trace (false);
   }
 
   inline bool sanitize (hb_sanitize_context_t *c) const
   {
     TRACE_SANITIZE (this);
     if (!(coverage.sanitize (c, this) && backtrack.sanitize (c, this)))
-      return TRACE_RETURN (false);
+      return_trace (false);
     const OffsetArrayOf<Coverage> &lookahead = StructAfter<OffsetArrayOf<Coverage> > (backtrack);
     if (!lookahead.sanitize (c, this))
-      return TRACE_RETURN (false);
+      return_trace (false);
     const ArrayOf<GlyphID> &substitute = StructAfter<ArrayOf<GlyphID> > (lookahead);
-    return TRACE_RETURN (substitute.sanitize (c));
+    return_trace (substitute.sanitize (c));
   }
 
   protected:
@@ -1030,10 +1035,10 @@
   inline typename context_t::return_t dispatch (context_t *c) const
   {
     TRACE_DISPATCH (this, u.format);
-    if (unlikely (!c->may_dispatch (this, &u.format))) TRACE_RETURN (c->default_return_value ());
+    if (unlikely (!c->may_dispatch (this, &u.format))) return_trace (c->no_dispatch_return_value ());
     switch (u.format) {
-    case 1: return TRACE_RETURN (c->dispatch (u.format1));
-    default:return TRACE_RETURN (c->default_return_value ());
+    case 1: return_trace (c->dispatch (u.format1));
+    default:return_trace (c->default_return_value ());
     }
   }
 
@@ -1069,18 +1074,17 @@
   inline typename context_t::return_t dispatch (context_t *c, unsigned int lookup_type) const
   {
     TRACE_DISPATCH (this, lookup_type);
-    /* The sub_format passed to may_dispatch is unnecessary but harmless. */
-    if (unlikely (!c->may_dispatch (this, &u.sub_format))) TRACE_RETURN (c->default_return_value ());
+    if (unlikely (!c->may_dispatch (this, &u.sub_format))) return_trace (c->no_dispatch_return_value ());
     switch (lookup_type) {
-    case Single:		return TRACE_RETURN (u.single.dispatch (c));
-    case Multiple:		return TRACE_RETURN (u.multiple.dispatch (c));
-    case Alternate:		return TRACE_RETURN (u.alternate.dispatch (c));
-    case Ligature:		return TRACE_RETURN (u.ligature.dispatch (c));
-    case Context:		return TRACE_RETURN (u.context.dispatch (c));
-    case ChainContext:		return TRACE_RETURN (u.chainContext.dispatch (c));
-    case Extension:		return TRACE_RETURN (u.extension.dispatch (c));
-    case ReverseChainSingle:	return TRACE_RETURN (u.reverseChainContextSingle.dispatch (c));
-    default:			return TRACE_RETURN (c->default_return_value ());
+    case Single:		return_trace (u.single.dispatch (c));
+    case Multiple:		return_trace (u.multiple.dispatch (c));
+    case Alternate:		return_trace (u.alternate.dispatch (c));
+    case Ligature:		return_trace (u.ligature.dispatch (c));
+    case Context:		return_trace (u.context.dispatch (c));
+    case ChainContext:		return_trace (u.chainContext.dispatch (c));
+    case Extension:		return_trace (u.extension.dispatch (c));
+    case ReverseChainSingle:	return_trace (u.reverseChainContextSingle.dispatch (c));
+    default:			return_trace (c->default_return_value ());
     }
   }
 
@@ -1120,21 +1124,21 @@
   inline bool apply (hb_apply_context_t *c) const
   {
     TRACE_APPLY (this);
-    return TRACE_RETURN (dispatch (c));
+    return_trace (dispatch (c));
   }
 
   inline hb_closure_context_t::return_t closure (hb_closure_context_t *c) const
   {
     TRACE_CLOSURE (this);
     c->set_recurse_func (dispatch_recurse_func<hb_closure_context_t>);
-    return TRACE_RETURN (dispatch (c));
+    return_trace (dispatch (c));
   }
 
   inline hb_collect_glyphs_context_t::return_t collect_glyphs (hb_collect_glyphs_context_t *c) const
   {
     TRACE_COLLECT_GLYPHS (this);
     c->set_recurse_func (dispatch_recurse_func<hb_collect_glyphs_context_t>);
-    return TRACE_RETURN (dispatch (c));
+    return_trace (dispatch (c));
   }
 
   template <typename set_t>
@@ -1148,9 +1152,9 @@
 			   const hb_ot_layout_lookup_accelerator_t *accel) const
   {
     TRACE_WOULD_APPLY (this);
-    if (unlikely (!c->len))  return TRACE_RETURN (false);
-    if (!accel->may_have (c->glyphs[0]))  return TRACE_RETURN (false);
-      return TRACE_RETURN (dispatch (c));
+    if (unlikely (!c->len))  return_trace (false);
+    if (!accel->may_have (c->glyphs[0]))  return_trace (false);
+      return_trace (dispatch (c));
   }
 
   static bool apply_recurse_func (hb_apply_context_t *c, unsigned int lookup_index);
@@ -1166,8 +1170,8 @@
 			        unsigned int num_glyphs)
   {
     TRACE_SERIALIZE (this);
-    if (unlikely (!Lookup::serialize (c, SubstLookupSubTable::Single, lookup_props, 1))) return TRACE_RETURN (false);
-    return TRACE_RETURN (serialize_subtable (c, 0).u.single.serialize (c, glyphs, substitutes, num_glyphs));
+    if (unlikely (!Lookup::serialize (c, SubstLookupSubTable::Single, lookup_props, 1))) return_trace (false);
+    return_trace (serialize_subtable (c, 0).u.single.serialize (c, glyphs, substitutes, num_glyphs));
   }
 
   inline bool serialize_multiple (hb_serialize_context_t *c,
@@ -1178,9 +1182,12 @@
 				  Supplier<GlyphID> &substitute_glyphs_list)
   {
     TRACE_SERIALIZE (this);
-    if (unlikely (!Lookup::serialize (c, SubstLookupSubTable::Multiple, lookup_props, 1))) return TRACE_RETURN (false);
-    return TRACE_RETURN (serialize_subtable (c, 0).u.multiple.serialize (c, glyphs, substitute_len_list, num_glyphs,
-									 substitute_glyphs_list));
+    if (unlikely (!Lookup::serialize (c, SubstLookupSubTable::Multiple, lookup_props, 1))) return_trace (false);
+    return_trace (serialize_subtable (c, 0).u.multiple.serialize (c,
+								  glyphs,
+								  substitute_len_list,
+								  num_glyphs,
+								  substitute_glyphs_list));
   }
 
   inline bool serialize_alternate (hb_serialize_context_t *c,
@@ -1191,9 +1198,12 @@
 				   Supplier<GlyphID> &alternate_glyphs_list)
   {
     TRACE_SERIALIZE (this);
-    if (unlikely (!Lookup::serialize (c, SubstLookupSubTable::Alternate, lookup_props, 1))) return TRACE_RETURN (false);
-    return TRACE_RETURN (serialize_subtable (c, 0).u.alternate.serialize (c, glyphs, alternate_len_list, num_glyphs,
-									  alternate_glyphs_list));
+    if (unlikely (!Lookup::serialize (c, SubstLookupSubTable::Alternate, lookup_props, 1))) return_trace (false);
+    return_trace (serialize_subtable (c, 0).u.alternate.serialize (c,
+								   glyphs,
+								   alternate_len_list,
+								   num_glyphs,
+								   alternate_glyphs_list));
   }
 
   inline bool serialize_ligature (hb_serialize_context_t *c,
@@ -1206,9 +1216,14 @@
 				  Supplier<GlyphID> &component_list /* Starting from second for each ligature */)
   {
     TRACE_SERIALIZE (this);
-    if (unlikely (!Lookup::serialize (c, SubstLookupSubTable::Ligature, lookup_props, 1))) return TRACE_RETURN (false);
-    return TRACE_RETURN (serialize_subtable (c, 0).u.ligature.serialize (c, first_glyphs, ligature_per_first_glyph_count_list, num_first_glyphs,
-									 ligatures_list, component_count_list, component_list));
+    if (unlikely (!Lookup::serialize (c, SubstLookupSubTable::Ligature, lookup_props, 1))) return_trace (false);
+    return_trace (serialize_subtable (c, 0).u.ligature.serialize (c,
+								  first_glyphs,
+								  ligature_per_first_glyph_count_list,
+								  num_first_glyphs,
+								  ligatures_list,
+								  component_count_list,
+								  component_list));
   }
 
   template <typename context_t>
@@ -1221,8 +1236,8 @@
   inline bool sanitize (hb_sanitize_context_t *c) const
   {
     TRACE_SANITIZE (this);
-    if (unlikely (!Lookup::sanitize (c))) return TRACE_RETURN (false);
-    if (unlikely (!dispatch (c))) return TRACE_RETURN (false);
+    if (unlikely (!Lookup::sanitize (c))) return_trace (false);
+    if (unlikely (!dispatch (c))) return_trace (false);
 
     if (unlikely (get_type () == SubstLookupSubTable::Extension))
     {
@@ -1233,9 +1248,9 @@
       unsigned int count = get_subtable_count ();
       for (unsigned int i = 1; i < count; i++)
         if (get_subtable (i).u.extension.get_type () != type)
-	  return TRACE_RETURN (false);
+	  return_trace (false);
     }
-    return TRACE_RETURN (true);
+    return_trace (true);
   }
 };
 
@@ -1258,9 +1273,9 @@
   inline bool sanitize (hb_sanitize_context_t *c) const
   {
     TRACE_SANITIZE (this);
-    if (unlikely (!GSUBGPOS::sanitize (c))) return TRACE_RETURN (false);
+    if (unlikely (!GSUBGPOS::sanitize (c))) return_trace (false);
     const OffsetTo<SubstLookupList> &list = CastR<OffsetTo<SubstLookupList> > (lookupList);
-    return TRACE_RETURN (list.sanitize (c, this));
+    return_trace (list.sanitize (c, this));
   }
   public:
   DEFINE_SIZE_STATIC (10);
diff --git a/third_party/harfbuzz-ng/src/hb-ot-layout-gsubgpos-private.hh b/third_party/harfbuzz-ng/src/hb-ot-layout-gsubgpos-private.hh
index 3e74dfe..2a9f444 100644
--- a/third_party/harfbuzz-ng/src/hb-ot-layout-gsubgpos-private.hh
+++ b/third_party/harfbuzz-ng/src/hb-ot-layout-gsubgpos-private.hh
@@ -46,14 +46,11 @@
 	(&c->debug_depth, c->get_name (), this, HB_FUNC, \
 	 "");
 
-struct hb_closure_context_t
+struct hb_closure_context_t :
+       hb_dispatch_context_t<hb_closure_context_t, hb_void_t, HB_DEBUG_CLOSURE>
 {
   inline const char *get_name (void) { return "CLOSURE"; }
-  static const unsigned int max_debug_depth = HB_DEBUG_CLOSURE;
-  typedef hb_void_t return_t;
   typedef return_t (*recurse_func_t) (hb_closure_context_t *c, unsigned int lookup_index);
-  template <typename T, typename F>
-  inline bool may_dispatch (const T *obj, const F *format) { return true; }
   template <typename T>
   inline return_t dispatch (const T &obj) { obj.closure (this); return HB_VOID; }
   static return_t default_return_value (void) { return HB_VOID; }
@@ -98,13 +95,10 @@
 	(&c->debug_depth, c->get_name (), this, HB_FUNC, \
 	 "%d glyphs", c->len);
 
-struct hb_would_apply_context_t
+struct hb_would_apply_context_t :
+       hb_dispatch_context_t<hb_would_apply_context_t, bool, HB_DEBUG_WOULD_APPLY>
 {
   inline const char *get_name (void) { return "WOULD_APPLY"; }
-  static const unsigned int max_debug_depth = HB_DEBUG_WOULD_APPLY;
-  typedef bool return_t;
-  template <typename T, typename F>
-  inline bool may_dispatch (const T *obj, const F *format) { return true; }
   template <typename T>
   inline return_t dispatch (const T &obj) { return obj.would_apply (this); }
   static return_t default_return_value (void) { return false; }
@@ -138,14 +132,11 @@
 	(&c->debug_depth, c->get_name (), this, HB_FUNC, \
 	 "");
 
-struct hb_collect_glyphs_context_t
+struct hb_collect_glyphs_context_t :
+       hb_dispatch_context_t<hb_collect_glyphs_context_t, hb_void_t, HB_DEBUG_COLLECT_GLYPHS>
 {
   inline const char *get_name (void) { return "COLLECT_GLYPHS"; }
-  static const unsigned int max_debug_depth = HB_DEBUG_COLLECT_GLYPHS;
-  typedef hb_void_t return_t;
   typedef return_t (*recurse_func_t) (hb_collect_glyphs_context_t *c, unsigned int lookup_index);
-  template <typename T, typename F>
-  inline bool may_dispatch (const T *obj, const F *format) { return true; }
   template <typename T>
   inline return_t dispatch (const T &obj) { obj.collect_glyphs (this); return HB_VOID; }
   static return_t default_return_value (void) { return HB_VOID; }
@@ -232,14 +223,14 @@
 #define HB_DEBUG_GET_COVERAGE (HB_DEBUG+0)
 #endif
 
+/* XXX Can we remove this? */
+
 template <typename set_t>
-struct hb_add_coverage_context_t
+struct hb_add_coverage_context_t :
+       hb_dispatch_context_t<hb_add_coverage_context_t<set_t>, const Coverage &, HB_DEBUG_GET_COVERAGE>
 {
   inline const char *get_name (void) { return "GET_COVERAGE"; }
-  static const unsigned int max_debug_depth = HB_DEBUG_GET_COVERAGE;
   typedef const Coverage &return_t;
-  template <typename T, typename F>
-  inline bool may_dispatch (const T *obj, const F *format) { return true; }
   template <typename T>
   inline return_t dispatch (const T &obj) { return obj.get_coverage (); }
   static return_t default_return_value (void) { return Null(Coverage); }
@@ -269,7 +260,8 @@
 	 "idx %d gid %u lookup %d", \
 	 c->buffer->idx, c->buffer->cur().codepoint, (int) c->lookup_index);
 
-struct hb_apply_context_t
+struct hb_apply_context_t :
+       hb_dispatch_context_t<hb_apply_context_t, bool, HB_DEBUG_APPLY>
 {
   struct matcher_t
   {
@@ -449,11 +441,7 @@
 
 
   inline const char *get_name (void) { return "APPLY"; }
-  static const unsigned int max_debug_depth = HB_DEBUG_APPLY;
-  typedef bool return_t;
   typedef return_t (*recurse_func_t) (hb_apply_context_t *c, unsigned int lookup_index);
-  template <typename T, typename F>
-  inline bool may_dispatch (const T *obj, const F *format) { return true; }
   template <typename T>
   inline return_t dispatch (const T &obj) { return obj.apply (this); }
   static return_t default_return_value (void) { return false; }
@@ -722,7 +710,7 @@
 {
   TRACE_APPLY (NULL);
 
-  if (unlikely (count > MAX_CONTEXT_LENGTH)) return TRACE_RETURN (false);
+  if (unlikely (count > MAX_CONTEXT_LENGTH)) return_trace (false);
 
   hb_buffer_t *buffer = c->buffer;
 
@@ -759,7 +747,7 @@
   match_positions[0] = buffer->idx;
   for (unsigned int i = 1; i < count; i++)
   {
-    if (!skippy_iter.next ()) return TRACE_RETURN (false);
+    if (!skippy_iter.next ()) return_trace (false);
 
     match_positions[i] = skippy_iter.idx;
 
@@ -771,13 +759,13 @@
        * all subsequent components should be attached to the same ligature
        * component, otherwise we shouldn't ligate them. */
       if (first_lig_id != this_lig_id || first_lig_comp != this_lig_comp)
-	return TRACE_RETURN (false);
+	return_trace (false);
     } else {
       /* If first component was NOT attached to a previous ligature component,
        * all subsequent components should also NOT be attached to any ligature
        * component, unless they are attached to the first component itself! */
       if (this_lig_id && this_lig_comp && (this_lig_id != first_lig_id))
-	return TRACE_RETURN (false);
+	return_trace (false);
     }
 
     is_mark_ligature = is_mark_ligature && _hb_glyph_info_is_mark (&buffer->info[skippy_iter.idx]);
@@ -792,9 +780,9 @@
   if (p_total_component_count)
     *p_total_component_count = total_component_count;
 
-  return TRACE_RETURN (true);
+  return_trace (true);
 }
-static inline void ligate_input (hb_apply_context_t *c,
+static inline bool ligate_input (hb_apply_context_t *c,
 				 unsigned int count, /* Including the first glyph */
 				 unsigned int match_positions[MAX_CONTEXT_LENGTH], /* Including the first glyph */
 				 unsigned int match_length,
@@ -884,7 +872,7 @@
 	break;
     }
   }
-  TRACE_RETURN (true);
+  return_trace (true);
 }
 
 static inline bool match_backtrack (hb_apply_context_t *c,
@@ -901,9 +889,9 @@
 
   for (unsigned int i = 0; i < count; i++)
     if (!skippy_iter.prev ())
-      return TRACE_RETURN (false);
+      return_trace (false);
 
-  return TRACE_RETURN (true);
+  return_trace (true);
 }
 
 static inline bool match_lookahead (hb_apply_context_t *c,
@@ -921,9 +909,9 @@
 
   for (unsigned int i = 0; i < count; i++)
     if (!skippy_iter.next ())
-      return TRACE_RETURN (false);
+      return_trace (false);
 
-  return TRACE_RETURN (true);
+  return_trace (true);
 }
 
 
@@ -933,7 +921,7 @@
   inline bool sanitize (hb_sanitize_context_t *c) const
   {
     TRACE_SANITIZE (this);
-    return TRACE_RETURN (c->check_struct (this));
+    return_trace (c->check_struct (this));
   }
 
   USHORT	sequenceIndex;		/* Index into current glyph
@@ -1034,7 +1022,7 @@
 
   buffer->move_to (end);
 
-  return TRACE_RETURN (true);
+  return_trace (true);
 }
 
 
@@ -1143,14 +1131,14 @@
   {
     TRACE_WOULD_APPLY (this);
     const LookupRecord *lookupRecord = &StructAtOffset<LookupRecord> (inputZ, inputZ[0].static_size * (inputCount ? inputCount - 1 : 0));
-    return TRACE_RETURN (context_would_apply_lookup (c, inputCount, inputZ, lookupCount, lookupRecord, lookup_context));
+    return_trace (context_would_apply_lookup (c, inputCount, inputZ, lookupCount, lookupRecord, lookup_context));
   }
 
   inline bool apply (hb_apply_context_t *c, ContextApplyLookupContext &lookup_context) const
   {
     TRACE_APPLY (this);
     const LookupRecord *lookupRecord = &StructAtOffset<LookupRecord> (inputZ, inputZ[0].static_size * (inputCount ? inputCount - 1 : 0));
-    return TRACE_RETURN (context_apply_lookup (c, inputCount, inputZ, lookupCount, lookupRecord, lookup_context));
+    return_trace (context_apply_lookup (c, inputCount, inputZ, lookupCount, lookupRecord, lookup_context));
   }
 
   public:
@@ -1202,9 +1190,9 @@
     for (unsigned int i = 0; i < num_rules; i++)
     {
       if ((this+rule[i]).would_apply (c, lookup_context))
-        return TRACE_RETURN (true);
+        return_trace (true);
     }
-    return TRACE_RETURN (false);
+    return_trace (false);
   }
 
   inline bool apply (hb_apply_context_t *c, ContextApplyLookupContext &lookup_context) const
@@ -1214,15 +1202,15 @@
     for (unsigned int i = 0; i < num_rules; i++)
     {
       if ((this+rule[i]).apply (c, lookup_context))
-        return TRACE_RETURN (true);
+        return_trace (true);
     }
-    return TRACE_RETURN (false);
+    return_trace (false);
   }
 
   inline bool sanitize (hb_sanitize_context_t *c) const
   {
     TRACE_SANITIZE (this);
-    return TRACE_RETURN (rule.sanitize (c, this));
+    return_trace (rule.sanitize (c, this));
   }
 
   protected:
@@ -1279,7 +1267,7 @@
       {match_glyph},
       NULL
     };
-    return TRACE_RETURN (rule_set.would_apply (c, lookup_context));
+    return_trace (rule_set.would_apply (c, lookup_context));
   }
 
   inline const Coverage &get_coverage (void) const
@@ -1292,20 +1280,20 @@
     TRACE_APPLY (this);
     unsigned int index = (this+coverage).get_coverage (c->buffer->cur().codepoint);
     if (likely (index == NOT_COVERED))
-      return TRACE_RETURN (false);
+      return_trace (false);
 
     const RuleSet &rule_set = this+ruleSet[index];
     struct ContextApplyLookupContext lookup_context = {
       {match_glyph},
       NULL
     };
-    return TRACE_RETURN (rule_set.apply (c, lookup_context));
+    return_trace (rule_set.apply (c, lookup_context));
   }
 
   inline bool sanitize (hb_sanitize_context_t *c) const
   {
     TRACE_SANITIZE (this);
-    return TRACE_RETURN (coverage.sanitize (c, this) && ruleSet.sanitize (c, this));
+    return_trace (coverage.sanitize (c, this) && ruleSet.sanitize (c, this));
   }
 
   protected:
@@ -1371,7 +1359,7 @@
       {match_class},
       &class_def
     };
-    return TRACE_RETURN (rule_set.would_apply (c, lookup_context));
+    return_trace (rule_set.would_apply (c, lookup_context));
   }
 
   inline const Coverage &get_coverage (void) const
@@ -1383,7 +1371,7 @@
   {
     TRACE_APPLY (this);
     unsigned int index = (this+coverage).get_coverage (c->buffer->cur().codepoint);
-    if (likely (index == NOT_COVERED)) return TRACE_RETURN (false);
+    if (likely (index == NOT_COVERED)) return_trace (false);
 
     const ClassDef &class_def = this+classDef;
     index = class_def.get_class (c->buffer->cur().codepoint);
@@ -1392,13 +1380,13 @@
       {match_class},
       &class_def
     };
-    return TRACE_RETURN (rule_set.apply (c, lookup_context));
+    return_trace (rule_set.apply (c, lookup_context));
   }
 
   inline bool sanitize (hb_sanitize_context_t *c) const
   {
     TRACE_SANITIZE (this);
-    return TRACE_RETURN (coverage.sanitize (c, this) && classDef.sanitize (c, this) && ruleSet.sanitize (c, this));
+    return_trace (coverage.sanitize (c, this) && classDef.sanitize (c, this) && ruleSet.sanitize (c, this));
   }
 
   protected:
@@ -1462,7 +1450,7 @@
       {match_coverage},
       this
     };
-    return TRACE_RETURN (context_would_apply_lookup (c, glyphCount, (const USHORT *) (coverageZ + 1), lookupCount, lookupRecord, lookup_context));
+    return_trace (context_would_apply_lookup (c, glyphCount, (const USHORT *) (coverageZ + 1), lookupCount, lookupRecord, lookup_context));
   }
 
   inline const Coverage &get_coverage (void) const
@@ -1474,27 +1462,27 @@
   {
     TRACE_APPLY (this);
     unsigned int index = (this+coverageZ[0]).get_coverage (c->buffer->cur().codepoint);
-    if (likely (index == NOT_COVERED)) return TRACE_RETURN (false);
+    if (likely (index == NOT_COVERED)) return_trace (false);
 
     const LookupRecord *lookupRecord = &StructAtOffset<LookupRecord> (coverageZ, coverageZ[0].static_size * glyphCount);
     struct ContextApplyLookupContext lookup_context = {
       {match_coverage},
       this
     };
-    return TRACE_RETURN (context_apply_lookup (c, glyphCount, (const USHORT *) (coverageZ + 1), lookupCount, lookupRecord, lookup_context));
+    return_trace (context_apply_lookup (c, glyphCount, (const USHORT *) (coverageZ + 1), lookupCount, lookupRecord, lookup_context));
   }
 
   inline bool sanitize (hb_sanitize_context_t *c) const
   {
     TRACE_SANITIZE (this);
-    if (!c->check_struct (this)) return TRACE_RETURN (false);
+    if (!c->check_struct (this)) return_trace (false);
     unsigned int count = glyphCount;
-    if (!count) return TRACE_RETURN (false); /* We want to access coverageZ[0] freely. */
-    if (!c->check_array (coverageZ, coverageZ[0].static_size, count)) return TRACE_RETURN (false);
+    if (!count) return_trace (false); /* We want to access coverageZ[0] freely. */
+    if (!c->check_array (coverageZ, coverageZ[0].static_size, count)) return_trace (false);
     for (unsigned int i = 0; i < count; i++)
-      if (!coverageZ[i].sanitize (c, this)) return TRACE_RETURN (false);
+      if (!coverageZ[i].sanitize (c, this)) return_trace (false);
     const LookupRecord *lookupRecord = &StructAtOffset<LookupRecord> (coverageZ, coverageZ[0].static_size * count);
-    return TRACE_RETURN (c->check_array (lookupRecord, lookupRecord[0].static_size, lookupCount));
+    return_trace (c->check_array (lookupRecord, lookupRecord[0].static_size, lookupCount));
   }
 
   protected:
@@ -1517,12 +1505,12 @@
   inline typename context_t::return_t dispatch (context_t *c) const
   {
     TRACE_DISPATCH (this, u.format);
-    if (unlikely (!c->may_dispatch (this, &u.format))) TRACE_RETURN (c->default_return_value ());
+    if (unlikely (!c->may_dispatch (this, &u.format))) return_trace (c->no_dispatch_return_value ());
     switch (u.format) {
-    case 1: return TRACE_RETURN (c->dispatch (u.format1));
-    case 2: return TRACE_RETURN (c->dispatch (u.format2));
-    case 3: return TRACE_RETURN (c->dispatch (u.format3));
-    default:return TRACE_RETURN (c->default_return_value ());
+    case 1: return_trace (c->dispatch (u.format1));
+    case 2: return_trace (c->dispatch (u.format2));
+    case 3: return_trace (c->dispatch (u.format3));
+    default:return_trace (c->default_return_value ());
     }
   }
 
@@ -1687,11 +1675,11 @@
     const HeadlessArrayOf<USHORT> &input = StructAfter<HeadlessArrayOf<USHORT> > (backtrack);
     const ArrayOf<USHORT> &lookahead = StructAfter<ArrayOf<USHORT> > (input);
     const ArrayOf<LookupRecord> &lookup = StructAfter<ArrayOf<LookupRecord> > (lookahead);
-    return TRACE_RETURN (chain_context_would_apply_lookup (c,
-							   backtrack.len, backtrack.array,
-							   input.len, input.array,
-							   lookahead.len, lookahead.array, lookup.len,
-							   lookup.array, lookup_context));
+    return_trace (chain_context_would_apply_lookup (c,
+						    backtrack.len, backtrack.array,
+						    input.len, input.array,
+						    lookahead.len, lookahead.array, lookup.len,
+						    lookup.array, lookup_context));
   }
 
   inline bool apply (hb_apply_context_t *c, ChainContextApplyLookupContext &lookup_context) const
@@ -1700,23 +1688,23 @@
     const HeadlessArrayOf<USHORT> &input = StructAfter<HeadlessArrayOf<USHORT> > (backtrack);
     const ArrayOf<USHORT> &lookahead = StructAfter<ArrayOf<USHORT> > (input);
     const ArrayOf<LookupRecord> &lookup = StructAfter<ArrayOf<LookupRecord> > (lookahead);
-    return TRACE_RETURN (chain_context_apply_lookup (c,
-						     backtrack.len, backtrack.array,
-						     input.len, input.array,
-						     lookahead.len, lookahead.array, lookup.len,
-						     lookup.array, lookup_context));
+    return_trace (chain_context_apply_lookup (c,
+					      backtrack.len, backtrack.array,
+					      input.len, input.array,
+					      lookahead.len, lookahead.array, lookup.len,
+					      lookup.array, lookup_context));
   }
 
   inline bool sanitize (hb_sanitize_context_t *c) const
   {
     TRACE_SANITIZE (this);
-    if (!backtrack.sanitize (c)) return TRACE_RETURN (false);
+    if (!backtrack.sanitize (c)) return_trace (false);
     const HeadlessArrayOf<USHORT> &input = StructAfter<HeadlessArrayOf<USHORT> > (backtrack);
-    if (!input.sanitize (c)) return TRACE_RETURN (false);
+    if (!input.sanitize (c)) return_trace (false);
     const ArrayOf<USHORT> &lookahead = StructAfter<ArrayOf<USHORT> > (input);
-    if (!lookahead.sanitize (c)) return TRACE_RETURN (false);
+    if (!lookahead.sanitize (c)) return_trace (false);
     const ArrayOf<LookupRecord> &lookup = StructAfter<ArrayOf<LookupRecord> > (lookahead);
-    return TRACE_RETURN (lookup.sanitize (c));
+    return_trace (lookup.sanitize (c));
   }
 
   protected:
@@ -1761,9 +1749,9 @@
     unsigned int num_rules = rule.len;
     for (unsigned int i = 0; i < num_rules; i++)
       if ((this+rule[i]).would_apply (c, lookup_context))
-        return TRACE_RETURN (true);
+        return_trace (true);
 
-    return TRACE_RETURN (false);
+    return_trace (false);
   }
 
   inline bool apply (hb_apply_context_t *c, ChainContextApplyLookupContext &lookup_context) const
@@ -1772,15 +1760,15 @@
     unsigned int num_rules = rule.len;
     for (unsigned int i = 0; i < num_rules; i++)
       if ((this+rule[i]).apply (c, lookup_context))
-        return TRACE_RETURN (true);
+        return_trace (true);
 
-    return TRACE_RETURN (false);
+    return_trace (false);
   }
 
   inline bool sanitize (hb_sanitize_context_t *c) const
   {
     TRACE_SANITIZE (this);
-    return TRACE_RETURN (rule.sanitize (c, this));
+    return_trace (rule.sanitize (c, this));
   }
 
   protected:
@@ -1835,7 +1823,7 @@
       {match_glyph},
       {NULL, NULL, NULL}
     };
-    return TRACE_RETURN (rule_set.would_apply (c, lookup_context));
+    return_trace (rule_set.would_apply (c, lookup_context));
   }
 
   inline const Coverage &get_coverage (void) const
@@ -1847,20 +1835,20 @@
   {
     TRACE_APPLY (this);
     unsigned int index = (this+coverage).get_coverage (c->buffer->cur().codepoint);
-    if (likely (index == NOT_COVERED)) return TRACE_RETURN (false);
+    if (likely (index == NOT_COVERED)) return_trace (false);
 
     const ChainRuleSet &rule_set = this+ruleSet[index];
     struct ChainContextApplyLookupContext lookup_context = {
       {match_glyph},
       {NULL, NULL, NULL}
     };
-    return TRACE_RETURN (rule_set.apply (c, lookup_context));
+    return_trace (rule_set.apply (c, lookup_context));
   }
 
   inline bool sanitize (hb_sanitize_context_t *c) const
   {
     TRACE_SANITIZE (this);
-    return TRACE_RETURN (coverage.sanitize (c, this) && ruleSet.sanitize (c, this));
+    return_trace (coverage.sanitize (c, this) && ruleSet.sanitize (c, this));
   }
 
   protected:
@@ -1939,7 +1927,7 @@
        &input_class_def,
        &lookahead_class_def}
     };
-    return TRACE_RETURN (rule_set.would_apply (c, lookup_context));
+    return_trace (rule_set.would_apply (c, lookup_context));
   }
 
   inline const Coverage &get_coverage (void) const
@@ -1951,7 +1939,7 @@
   {
     TRACE_APPLY (this);
     unsigned int index = (this+coverage).get_coverage (c->buffer->cur().codepoint);
-    if (likely (index == NOT_COVERED)) return TRACE_RETURN (false);
+    if (likely (index == NOT_COVERED)) return_trace (false);
 
     const ClassDef &backtrack_class_def = this+backtrackClassDef;
     const ClassDef &input_class_def = this+inputClassDef;
@@ -1965,15 +1953,17 @@
        &input_class_def,
        &lookahead_class_def}
     };
-    return TRACE_RETURN (rule_set.apply (c, lookup_context));
+    return_trace (rule_set.apply (c, lookup_context));
   }
 
   inline bool sanitize (hb_sanitize_context_t *c) const
   {
     TRACE_SANITIZE (this);
-    return TRACE_RETURN (coverage.sanitize (c, this) && backtrackClassDef.sanitize (c, this) &&
-			 inputClassDef.sanitize (c, this) && lookaheadClassDef.sanitize (c, this) &&
-			 ruleSet.sanitize (c, this));
+    return_trace (coverage.sanitize (c, this) &&
+		  backtrackClassDef.sanitize (c, this) &&
+		  inputClassDef.sanitize (c, this) &&
+		  lookaheadClassDef.sanitize (c, this) &&
+		  ruleSet.sanitize (c, this));
   }
 
   protected:
@@ -2056,11 +2046,11 @@
       {match_coverage},
       {this, this, this}
     };
-    return TRACE_RETURN (chain_context_would_apply_lookup (c,
-							   backtrack.len, (const USHORT *) backtrack.array,
-							   input.len, (const USHORT *) input.array + 1,
-							   lookahead.len, (const USHORT *) lookahead.array,
-							   lookup.len, lookup.array, lookup_context));
+    return_trace (chain_context_would_apply_lookup (c,
+						    backtrack.len, (const USHORT *) backtrack.array,
+						    input.len, (const USHORT *) input.array + 1,
+						    lookahead.len, (const USHORT *) lookahead.array,
+						    lookup.len, lookup.array, lookup_context));
   }
 
   inline const Coverage &get_coverage (void) const
@@ -2075,7 +2065,7 @@
     const OffsetArrayOf<Coverage> &input = StructAfter<OffsetArrayOf<Coverage> > (backtrack);
 
     unsigned int index = (this+input[0]).get_coverage (c->buffer->cur().codepoint);
-    if (likely (index == NOT_COVERED)) return TRACE_RETURN (false);
+    if (likely (index == NOT_COVERED)) return_trace (false);
 
     const OffsetArrayOf<Coverage> &lookahead = StructAfter<OffsetArrayOf<Coverage> > (input);
     const ArrayOf<LookupRecord> &lookup = StructAfter<ArrayOf<LookupRecord> > (lookahead);
@@ -2083,24 +2073,24 @@
       {match_coverage},
       {this, this, this}
     };
-    return TRACE_RETURN (chain_context_apply_lookup (c,
-						     backtrack.len, (const USHORT *) backtrack.array,
-						     input.len, (const USHORT *) input.array + 1,
-						     lookahead.len, (const USHORT *) lookahead.array,
-						     lookup.len, lookup.array, lookup_context));
+    return_trace (chain_context_apply_lookup (c,
+					      backtrack.len, (const USHORT *) backtrack.array,
+					      input.len, (const USHORT *) input.array + 1,
+					      lookahead.len, (const USHORT *) lookahead.array,
+					      lookup.len, lookup.array, lookup_context));
   }
 
   inline bool sanitize (hb_sanitize_context_t *c) const
   {
     TRACE_SANITIZE (this);
-    if (!backtrack.sanitize (c, this)) return TRACE_RETURN (false);
+    if (!backtrack.sanitize (c, this)) return_trace (false);
     const OffsetArrayOf<Coverage> &input = StructAfter<OffsetArrayOf<Coverage> > (backtrack);
-    if (!input.sanitize (c, this)) return TRACE_RETURN (false);
-    if (!input.len) return TRACE_RETURN (false); /* To be consistent with Context. */
+    if (!input.sanitize (c, this)) return_trace (false);
+    if (!input.len) return_trace (false); /* To be consistent with Context. */
     const OffsetArrayOf<Coverage> &lookahead = StructAfter<OffsetArrayOf<Coverage> > (input);
-    if (!lookahead.sanitize (c, this)) return TRACE_RETURN (false);
+    if (!lookahead.sanitize (c, this)) return_trace (false);
     const ArrayOf<LookupRecord> &lookup = StructAfter<ArrayOf<LookupRecord> > (lookahead);
-    return TRACE_RETURN (lookup.sanitize (c));
+    return_trace (lookup.sanitize (c));
   }
 
   protected:
@@ -2130,12 +2120,12 @@
   inline typename context_t::return_t dispatch (context_t *c) const
   {
     TRACE_DISPATCH (this, u.format);
-    if (unlikely (!c->may_dispatch (this, &u.format))) TRACE_RETURN (c->default_return_value ());
+    if (unlikely (!c->may_dispatch (this, &u.format))) return_trace (c->no_dispatch_return_value ());
     switch (u.format) {
-    case 1: return TRACE_RETURN (c->dispatch (u.format1));
-    case 2: return TRACE_RETURN (c->dispatch (u.format2));
-    case 3: return TRACE_RETURN (c->dispatch (u.format3));
-    default:return TRACE_RETURN (c->default_return_value ());
+    case 1: return_trace (c->dispatch (u.format1));
+    case 2: return_trace (c->dispatch (u.format2));
+    case 3: return_trace (c->dispatch (u.format3));
+    default:return_trace (c->default_return_value ());
     }
   }
 
@@ -2166,15 +2156,15 @@
   inline typename context_t::return_t dispatch (context_t *c) const
   {
     TRACE_DISPATCH (this, format);
-    if (unlikely (!c->may_dispatch (this, this))) TRACE_RETURN (c->default_return_value ());
-    return TRACE_RETURN (get_subtable<typename T::LookupSubTable> ().dispatch (c, get_type ()));
+    if (unlikely (!c->may_dispatch (this, this))) return_trace (c->no_dispatch_return_value ());
+    return_trace (get_subtable<typename T::LookupSubTable> ().dispatch (c, get_type ()));
   }
 
   /* This is called from may_dispatch() above with hb_sanitize_context_t. */
   inline bool sanitize (hb_sanitize_context_t *c) const
   {
     TRACE_SANITIZE (this);
-    return TRACE_RETURN (c->check_struct (this) && extensionOffset != 0);
+    return_trace (c->check_struct (this) && extensionOffset != 0);
   }
 
   protected:
@@ -2211,10 +2201,10 @@
   inline typename context_t::return_t dispatch (context_t *c) const
   {
     TRACE_DISPATCH (this, u.format);
-    if (unlikely (!c->may_dispatch (this, &u.format))) TRACE_RETURN (c->default_return_value ());
+    if (unlikely (!c->may_dispatch (this, &u.format))) return_trace (c->no_dispatch_return_value ());
     switch (u.format) {
-    case 1: return TRACE_RETURN (u.format1.dispatch (c));
-    default:return TRACE_RETURN (c->default_return_value ());
+    case 1: return_trace (u.format1.dispatch (c));
+    default:return_trace (c->default_return_value ());
     }
   }
 
@@ -2269,10 +2259,11 @@
   inline bool sanitize (hb_sanitize_context_t *c) const
   {
     TRACE_SANITIZE (this);
-    return TRACE_RETURN (version.sanitize (c) && likely (version.major == 1) &&
-			 scriptList.sanitize (c, this) &&
-			 featureList.sanitize (c, this) &&
-			 lookupList.sanitize (c, this));
+    return_trace (version.sanitize (c) &&
+		  likely (version.major == 1) &&
+		  scriptList.sanitize (c, this) &&
+		  featureList.sanitize (c, this) &&
+		  lookupList.sanitize (c, this));
   }
 
   protected:
diff --git a/third_party/harfbuzz-ng/src/hb-ot-layout-jstf-table.hh b/third_party/harfbuzz-ng/src/hb-ot-layout-jstf-table.hh
index 739dfd91..7e199c2 100644
--- a/third_party/harfbuzz-ng/src/hb-ot-layout-jstf-table.hh
+++ b/third_party/harfbuzz-ng/src/hb-ot-layout-jstf-table.hh
@@ -57,17 +57,17 @@
   inline bool sanitize (hb_sanitize_context_t *c) const
   {
     TRACE_SANITIZE (this);
-    return TRACE_RETURN (c->check_struct (this) &&
-			 shrinkageEnableGSUB.sanitize (c, this) &&
-			 shrinkageDisableGSUB.sanitize (c, this) &&
-			 shrinkageEnableGPOS.sanitize (c, this) &&
-			 shrinkageDisableGPOS.sanitize (c, this) &&
-			 shrinkageJstfMax.sanitize (c, this) &&
-			 extensionEnableGSUB.sanitize (c, this) &&
-			 extensionDisableGSUB.sanitize (c, this) &&
-			 extensionEnableGPOS.sanitize (c, this) &&
-			 extensionDisableGPOS.sanitize (c, this) &&
-			 extensionJstfMax.sanitize (c, this));
+    return_trace (c->check_struct (this) &&
+		  shrinkageEnableGSUB.sanitize (c, this) &&
+		  shrinkageDisableGSUB.sanitize (c, this) &&
+		  shrinkageEnableGPOS.sanitize (c, this) &&
+		  shrinkageDisableGPOS.sanitize (c, this) &&
+		  shrinkageJstfMax.sanitize (c, this) &&
+		  extensionEnableGSUB.sanitize (c, this) &&
+		  extensionDisableGSUB.sanitize (c, this) &&
+		  extensionEnableGPOS.sanitize (c, this) &&
+		  extensionDisableGPOS.sanitize (c, this) &&
+		  extensionJstfMax.sanitize (c, this));
   }
 
   protected:
@@ -127,7 +127,7 @@
 			const Record<JstfLangSys>::sanitize_closure_t * = NULL) const
   {
     TRACE_SANITIZE (this);
-    return TRACE_RETURN (OffsetListOf<JstfPriority>::sanitize (c));
+    return_trace (OffsetListOf<JstfPriority>::sanitize (c));
   }
 };
 
@@ -168,9 +168,9 @@
 			const Record<JstfScript>::sanitize_closure_t * = NULL) const
   {
     TRACE_SANITIZE (this);
-    return TRACE_RETURN (extenderGlyphs.sanitize (c, this) &&
-			 defaultLangSys.sanitize (c, this) &&
-			 langSys.sanitize (c, this));
+    return_trace (extenderGlyphs.sanitize (c, this) &&
+		  defaultLangSys.sanitize (c, this) &&
+		  langSys.sanitize (c, this));
   }
 
   protected:
@@ -212,8 +212,9 @@
   inline bool sanitize (hb_sanitize_context_t *c) const
   {
     TRACE_SANITIZE (this);
-    return TRACE_RETURN (version.sanitize (c) && likely (version.major == 1) &&
-			 scriptList.sanitize (c, this));
+    return_trace (version.sanitize (c) &&
+		  likely (version.major == 1) &&
+		  scriptList.sanitize (c, this));
   }
 
   protected:
diff --git a/third_party/harfbuzz-ng/src/hb-ot-layout.cc b/third_party/harfbuzz-ng/src/hb-ot-layout.cc
index 39d007d..275a960 100644
--- a/third_party/harfbuzz-ng/src/hb-ot-layout.cc
+++ b/third_party/harfbuzz-ng/src/hb-ot-layout.cc
@@ -28,6 +28,7 @@
  * Google Author(s): Behdad Esfahbod
  */
 
+#include "hb-open-type-private.hh"
 #include "hb-ot-layout-private.hh"
 
 #include "hb-ot-layout-gdef-table.hh"
@@ -798,7 +799,7 @@
 }
 
 /**
- * Since: 0.9.8
+ * Since: 0.9.10
  **/
 hb_bool_t
 hb_ot_layout_get_size_params (hb_face_t    *face,
@@ -925,13 +926,10 @@
   return ret;
 }
 
-struct hb_apply_forward_context_t
+struct hb_apply_forward_context_t :
+       OT::hb_dispatch_context_t<hb_apply_forward_context_t, bool, HB_DEBUG_APPLY>
 {
   inline const char *get_name (void) { return "APPLY_FWD"; }
-  static const unsigned int max_debug_depth = HB_DEBUG_APPLY;
-  typedef bool return_t;
-  template <typename T, typename F>
-  inline bool may_dispatch (const T *obj, const F *format) { return true; }
   template <typename T>
   inline return_t dispatch (const T &obj) { return apply_forward (c, obj, accel); }
   static return_t default_return_value (void) { return false; }
diff --git a/third_party/harfbuzz-ng/src/hb-ot-maxp-table.hh b/third_party/harfbuzz-ng/src/hb-ot-maxp-table.hh
index 0d9a0fa..27105af1 100644
--- a/third_party/harfbuzz-ng/src/hb-ot-maxp-table.hh
+++ b/third_party/harfbuzz-ng/src/hb-ot-maxp-table.hh
@@ -51,8 +51,9 @@
   inline bool sanitize (hb_sanitize_context_t *c) const
   {
     TRACE_SANITIZE (this);
-    return TRACE_RETURN (c->check_struct (this) &&
-			 likely (version.major == 1 || (version.major == 0 && version.minor == 0x5000u)));
+    return_trace (c->check_struct (this) &&
+		  likely (version.major == 1 ||
+			  (version.major == 0 && version.minor == 0x5000u)));
   }
 
   /* We only implement version 0.5 as none of the extra fields in version 1.0 are useful. */
diff --git a/third_party/harfbuzz-ng/src/hb-ot-name-table.hh b/third_party/harfbuzz-ng/src/hb-ot-name-table.hh
index 21450c6..870f123 100644
--- a/third_party/harfbuzz-ng/src/hb-ot-name-table.hh
+++ b/third_party/harfbuzz-ng/src/hb-ot-name-table.hh
@@ -60,7 +60,7 @@
   {
     TRACE_SANITIZE (this);
     /* We can check from base all the way up to the end of string... */
-    return TRACE_RETURN (c->check_struct (this) && c->check_range ((char *) base, (unsigned int) length + offset));
+    return_trace (c->check_struct (this) && c->check_range ((char *) base, (unsigned int) length + offset));
   }
 
   USHORT	platformID;	/* Platform ID. */
@@ -107,17 +107,17 @@
     char *string_pool = (char *) this + stringOffset;
     unsigned int _count = count;
     for (unsigned int i = 0; i < _count; i++)
-      if (!nameRecord[i].sanitize (c, string_pool)) return TRACE_RETURN (false);
-    return TRACE_RETURN (true);
+      if (!nameRecord[i].sanitize (c, string_pool)) return_trace (false);
+    return_trace (true);
   }
 
   inline bool sanitize (hb_sanitize_context_t *c) const
   {
     TRACE_SANITIZE (this);
-    return TRACE_RETURN (c->check_struct (this) &&
-			 likely (format == 0 || format == 1) &&
-			 c->check_array (nameRecord, nameRecord[0].static_size, count) &&
-			 sanitize_records (c));
+    return_trace (c->check_struct (this) &&
+		  likely (format == 0 || format == 1) &&
+		  c->check_array (nameRecord, nameRecord[0].static_size, count) &&
+		  sanitize_records (c));
   }
 
   /* We only implement format 0 for now. */
diff --git a/third_party/harfbuzz-ng/src/hb-ot-shape-complex-arabic-fallback.hh b/third_party/harfbuzz-ng/src/hb-ot-shape-complex-arabic-fallback.hh
index a77f24ec..d97d285 100644
--- a/third_party/harfbuzz-ng/src/hb-ot-shape-complex-arabic-fallback.hh
+++ b/third_party/harfbuzz-ng/src/hb-ot-shape-complex-arabic-fallback.hh
@@ -75,9 +75,9 @@
   if (!num_glyphs)
     return NULL;
 
-  /* Bubble-sort!
+  /* Bubble-sort or something equally good!
    * May not be good-enough for presidential candidate interviews, but good-enough for us... */
-  hb_bubble_sort (&glyphs[0], num_glyphs, OT::GlyphID::cmp, &substitutes[0]);
+  hb_stable_sort (&glyphs[0], num_glyphs, OT::GlyphID::cmp, &substitutes[0]);
 
   OT::Supplier<OT::GlyphID> glyphs_supplier      (glyphs, num_glyphs);
   OT::Supplier<OT::GlyphID> substitutes_supplier (substitutes, num_glyphs);
@@ -126,7 +126,7 @@
     first_glyphs_indirection[num_first_glyphs] = first_glyph_idx;
     num_first_glyphs++;
   }
-  hb_bubble_sort (&first_glyphs[0], num_first_glyphs, OT::GlyphID::cmp, &first_glyphs_indirection[0]);
+  hb_stable_sort (&first_glyphs[0], num_first_glyphs, OT::GlyphID::cmp, &first_glyphs_indirection[0]);
 
   /* Now that the first-glyphs are sorted, walk again, populate ligatures. */
   for (unsigned int i = 0; i < num_first_glyphs; i++)
diff --git a/third_party/harfbuzz-ng/src/hb-ot-shape-complex-hangul.cc b/third_party/harfbuzz-ng/src/hb-ot-shape-complex-hangul.cc
index 763dbf0..1fa79ce 100644
--- a/third_party/harfbuzz-ng/src/hb-ot-shape-complex-hangul.cc
+++ b/third_party/harfbuzz-ng/src/hb-ot-shape-complex-hangul.cc
@@ -205,11 +205,11 @@
 	buffer->next_glyph ();
 	if (!is_zero_width_char (font, u))
 	{
+	  buffer->merge_out_clusters (start, end + 1);
 	  hb_glyph_info_t *info = buffer->out_info;
 	  hb_glyph_info_t tone = info[end];
 	  memmove (&info[start + 1], &info[start], (end - start) * sizeof (hb_glyph_info_t));
 	  info[start] = tone;
-	  buffer->merge_out_clusters (start, end + 1);
 	}
       }
       else
diff --git a/third_party/harfbuzz-ng/src/hb-ot-shape-complex-indic.cc b/third_party/harfbuzz-ng/src/hb-ot-shape-complex-indic.cc
index b7f3d5c..00526f3d 100644
--- a/third_party/harfbuzz-ng/src/hb-ot-shape-complex-indic.cc
+++ b/third_party/harfbuzz-ng/src/hb-ot-shape-complex-indic.cc
@@ -1012,7 +1012,7 @@
       info[i].syllable() = i - start;
 
     /* Sit tight, rock 'n roll! */
-    hb_bubble_sort (info + start, end - start, compare_indic_order);
+    hb_stable_sort (info + start, end - start, compare_indic_order);
     /* Find base again */
     base = end;
     for (unsigned int i = start; i < end; i++)
@@ -1025,7 +1025,11 @@
      * around like crazy.  In old-spec mode, we move halants around, so in
      * that case merge all clusters after base.  Otherwise, check the sort
      * order and merge as needed.
-     * For pre-base stuff, we handle cluster issues in final reordering. */
+     * For pre-base stuff, we handle cluster issues in final reordering.
+     *
+     * We could use buffer->sort() for this, if there was no special
+     * reordering of pre-base stuff happening later...
+     */
     if (indic_plan->is_old_spec || end - base > 127)
       buffer->merge_clusters (base, end);
     else
@@ -1404,12 +1408,17 @@
 	if (info[i - 1].indic_position () == POS_PRE_M)
 	{
 	  unsigned int old_pos = i - 1;
+	  if (old_pos < base && base <= new_pos) /* Shouldn't actually happen. */
+	    base--;
+
 	  hb_glyph_info_t tmp = info[old_pos];
 	  memmove (&info[old_pos], &info[old_pos + 1], (new_pos - old_pos) * sizeof (info[0]));
 	  info[new_pos] = tmp;
-	  if (old_pos < base && base <= new_pos) /* Shouldn't actually happen. */
-	    base--;
+
+	  /* Note: this merge_clusters() is intentionally *after* the reordering.
+	   * Indic matra reordering is special and tricky... */
 	  buffer->merge_clusters (new_pos, MIN (end, base + 1));
+
 	  new_pos--;
 	}
     } else {
@@ -1562,12 +1571,12 @@
 
     reph_move:
     {
-      buffer->merge_clusters (start, new_reph_pos + 1);
-
       /* Move */
+      buffer->merge_clusters (start, new_reph_pos + 1);
       hb_glyph_info_t reph = info[start];
       memmove (&info[start], &info[start + 1], (new_reph_pos - start) * sizeof (info[0]));
       info[new_reph_pos] = reph;
+
       if (start < base && base <= new_reph_pos)
 	base--;
     }
@@ -1640,10 +1649,12 @@
 
 	  {
 	    unsigned int old_pos = i;
+
 	    buffer->merge_clusters (new_pos, old_pos + 1);
 	    hb_glyph_info_t tmp = info[old_pos];
 	    memmove (&info[new_pos + 1], &info[new_pos], (old_pos - new_pos) * sizeof (info[0]));
 	    info[new_pos] = tmp;
+
 	    if (new_pos <= base && base < old_pos)
 	      base++;
 	  }
diff --git a/third_party/harfbuzz-ng/src/hb-ot-shape-complex-myanmar.cc b/third_party/harfbuzz-ng/src/hb-ot-shape-complex-myanmar.cc
index 7e3ab01..30a53c7 100644
--- a/third_party/harfbuzz-ng/src/hb-ot-shape-complex-myanmar.cc
+++ b/third_party/harfbuzz-ng/src/hb-ot-shape-complex-myanmar.cc
@@ -391,9 +391,8 @@
     }
   }
 
-  buffer->merge_clusters (start, end);
   /* Sit tight, rock 'n roll! */
-  hb_bubble_sort (info + start, end - start, compare_myanmar_order);
+  buffer->sort (start, end, compare_myanmar_order);
 }
 
 static void
diff --git a/third_party/harfbuzz-ng/src/hb-ot-shape-complex-thai.cc b/third_party/harfbuzz-ng/src/hb-ot-shape-complex-thai.cc
index feb7fc7..d4ede209 100644
--- a/third_party/harfbuzz-ng/src/hb-ot-shape-complex-thai.cc
+++ b/third_party/harfbuzz-ng/src/hb-ot-shape-complex-thai.cc
@@ -353,7 +353,7 @@
     {
       /* Since we decomposed, and NIKHAHIT is combining, merge clusters with the
        * previous cluster. */
-      if (start)
+      if (start && buffer->cluster_level == HB_BUFFER_CLUSTER_LEVEL_MONOTONE_GRAPHEMES)
 	buffer->merge_out_clusters (start - 1, end);
     }
   }
diff --git a/third_party/harfbuzz-ng/src/hb-ot-shape-complex-use.cc b/third_party/harfbuzz-ng/src/hb-ot-shape-complex-use.cc
index 41eb43ff..4b15dee 100644
--- a/third_party/harfbuzz-ng/src/hb-ot-shape-complex-use.cc
+++ b/third_party/harfbuzz-ng/src/hb-ot-shape-complex-use.cc
@@ -436,10 +436,10 @@
 	if (info[i].use_category() == USE_H)
 	  i--;
 
+	buffer->merge_clusters (start, i + 1);
 	hb_glyph_info_t t = info[start];
 	memmove (&info[start], &info[start + 1], (i - start) * sizeof (info[0]));
 	info[i] = t;
-	buffer->merge_clusters (start, i + 1);
 
 	break;
       }
@@ -464,10 +464,10 @@
 	     0 == _hb_glyph_info_get_lig_comp (&info[i]) &&
 	     j < i)
     {
+      buffer->merge_clusters (j, i + 1);
       hb_glyph_info_t t = info[i];
       memmove (&info[j + 1], &info[j], (i - j) * sizeof (info[0]));
       info[j] = t;
-      buffer->merge_clusters (j, i + 1);
     }
   }
 }
diff --git a/third_party/harfbuzz-ng/src/hb-ot-shape-normalize.cc b/third_party/harfbuzz-ng/src/hb-ot-shape-normalize.cc
index 111b590..09e48e3 100644
--- a/third_party/harfbuzz-ng/src/hb-ot-shape-normalize.cc
+++ b/third_party/harfbuzz-ng/src/hb-ot-shape-normalize.cc
@@ -290,6 +290,8 @@
 			hb_buffer_t *buffer,
 			hb_font_t *font)
 {
+  if (unlikely (!buffer->len)) return;
+
   _hb_buffer_assert_unicode_vars (buffer);
 
   hb_ot_shape_normalization_mode_t mode = plan->shaper->normalization_preference;
@@ -344,15 +346,13 @@
       if (_hb_glyph_info_get_modified_combining_class (&buffer->info[end]) == 0)
         break;
 
-    /* We are going to do a bubble-sort.  Only do this if the
-     * sequence is short.  Doing it on long sequences can result
-     * in an O(n^2) DoS. */
+    /* We are going to do a O(n^2).  Only do this if the sequence is short. */
     if (end - i > 10) {
       i = end;
       continue;
     }
 
-    hb_bubble_sort (buffer->info + i, end - i, compare_combining_class);
+    buffer->sort (i, end, compare_combining_class);
 
     i = end;
   }
diff --git a/third_party/harfbuzz-ng/src/hb-ot-shape.cc b/third_party/harfbuzz-ng/src/hb-ot-shape.cc
index e24f7a83..40332d6 100644
--- a/third_party/harfbuzz-ng/src/hb-ot-shape.cc
+++ b/third_party/harfbuzz-ng/src/hb-ot-shape.cc
@@ -302,15 +302,16 @@
     {
       if (likely (!HB_UNICODE_GENERAL_CATEGORY_IS_MARK (_hb_glyph_info_get_general_category (&info[i]))))
       {
-	buffer->reverse_range (base, i);
 	if (buffer->cluster_level == HB_BUFFER_CLUSTER_LEVEL_MONOTONE_CHARACTERS)
 	  buffer->merge_clusters (base, i);
+	buffer->reverse_range (base, i);
+
 	base = i;
       }
     }
-    buffer->reverse_range (base, count);
     if (buffer->cluster_level == HB_BUFFER_CLUSTER_LEVEL_MONOTONE_CHARACTERS)
       buffer->merge_clusters (base, count);
+    buffer->reverse_range (base, count);
 
     buffer->reverse ();
 
diff --git a/third_party/harfbuzz-ng/src/hb-ot-tag.cc b/third_party/harfbuzz-ng/src/hb-ot-tag.cc
index 61c38b1..a2e5728f 100644
--- a/third_party/harfbuzz-ng/src/hb-ot-tag.cc
+++ b/third_party/harfbuzz-ng/src/hb-ot-tag.cc
@@ -733,7 +733,6 @@
 /*{"fuf?",	HB_TAG('F','T','A',' ')},*/	/* Futa */
 /*{"ar-Syrc?",	HB_TAG('G','A','R',' ')},*/	/* Garshuni */
 /*{"cfm/rnl?",	HB_TAG('H','A','L',' ')},*/	/* Halam */
-/*{"fonipa",	HB_TAG('I','P','P','H')},*/	/* Phonetic transcription—IPA conventions */
 /*{"ga-Latg?/Latg?",	HB_TAG('I','R','T',' ')},*/	/* Irish Traditional */
 /*{"krc",	HB_TAG('K','A','R',' ')},*/	/* Karachay */
 /*{"alw?/ktb?",	HB_TAG('K','E','B',' ')},*/	/* Kebena */
@@ -832,6 +831,14 @@
     }
   }
 
+  /*
+   * The International Phonetic Alphabet is a variant tag in BCP-47,
+   * which can be applied to any language.
+   */
+  if (strstr (lang_str, "-fonipa")) {
+    return HB_TAG('I','P','P','H');  /* Phonetic transcription—IPA conventions */
+  }
+
   /* Find a language matching in the first component */
   {
     const LangTag *lang_tag;
@@ -877,7 +884,7 @@
  *
  * Return value: (transfer none):
  *
- * Since: 1.0
+ * Since: 0.9.2
  **/
 hb_language_t
 hb_ot_tag_to_language (hb_tag_t tag)
@@ -901,6 +908,12 @@
     }
   }
 
+  /* struct LangTag has only room for 3-letter language tags. */
+  switch (tag) {
+  case HB_TAG('I','P','P','H'):  /* Phonetic transcription—IPA conventions */
+    return hb_language_from_string ("und-fonipa", -1);
+  }
+
   /* Else return a custom language in the form of "x-hbotABCD" */
   {
     unsigned char buf[11] = "x-hbot";
diff --git a/third_party/harfbuzz-ng/src/hb-private.hh b/third_party/harfbuzz-ng/src/hb-private.hh
index 8112934..be29391c 100644
--- a/third_party/harfbuzz-ng/src/hb-private.hh
+++ b/third_party/harfbuzz-ng/src/hb-private.hh
@@ -54,6 +54,23 @@
 #include <stdarg.h>
 
 
+/* Compile-time custom allocator support. */
+
+#if defined(hb_malloc_impl) \
+ && defined(hb_calloc_impl) \
+ && defined(hb_realloc_impl) \
+ && defined(hb_free_impl)
+extern "C" void* hb_malloc_impl(size_t size);
+extern "C" void* hb_calloc_impl(size_t nmemb, size_t size);
+extern "C" void* hb_realloc_impl(void *ptr, size_t size);
+extern "C" void  hb_free_impl(void *ptr);
+#define malloc hb_malloc_impl
+#define calloc hb_calloc_impl
+#define realloc hb_realloc_impl
+#define free hb_free_impl
+#endif
+
+
 /* Compiler attributes */
 
 
@@ -740,7 +757,7 @@
 static inline void _hb_warn_no_return (bool returned)
 {
   if (unlikely (!returned)) {
-    fprintf (stderr, "OUCH, returned with no call to TRACE_RETURN.  This is a bug, please report.\n");
+    fprintf (stderr, "OUCH, returned with no call to return_trace().  This is a bug, please report.\n");
   }
 }
 template <>
@@ -775,7 +792,7 @@
   inline ret_t ret (ret_t v, unsigned int line = 0)
   {
     if (unlikely (returned)) {
-      fprintf (stderr, "OUCH, double calls to TRACE_RETURN.  This is a bug, please report.\n");
+      fprintf (stderr, "OUCH, double calls to return_trace().  This is a bug, please report.\n");
       return v;
     }
 
@@ -806,7 +823,7 @@
   inline ret_t ret (ret_t v, unsigned int line HB_UNUSED = 0) { return v; }
 };
 
-#define TRACE_RETURN(RET) trace.ret (RET, __LINE__)
+#define return_trace(RET) return trace.ret (RET, __LINE__)
 
 /* Misc */
 
@@ -855,42 +872,34 @@
 
 
 template <typename T, typename T2> static inline void
-hb_bubble_sort (T *array, unsigned int len, int(*compar)(const T *, const T *), T2 *array2)
+hb_stable_sort (T *array, unsigned int len, int(*compar)(const T *, const T *), T2 *array2)
 {
-  if (unlikely (!len))
-    return;
-
-  unsigned int k = len - 1;
-  do {
-    unsigned int new_k = 0;
-
-    for (unsigned int j = 0; j < k; j++)
-      if (compar (&array[j], &array[j+1]) > 0)
-      {
-        {
-	  T t;
-	  t = array[j];
-	  array[j] = array[j + 1];
-	  array[j + 1] = t;
-	}
-        if (array2)
-        {
-	  T2 t;
-	  t = array2[j];
-	  array2[j] = array2[j + 1];
-	  array2[j + 1] = t;
-	}
-
-	new_k = j;
-      }
-    k = new_k;
-  } while (k);
+  for (unsigned int i = 1; i < len; i++)
+  {
+    unsigned int j = i;
+    while (j && compar (&array[j - 1], &array[i]) > 0)
+      j--;
+    if (i == j)
+      continue;
+    /* Move item i to occupy place for item j, shift what's in between. */
+    {
+      T t = array[i];
+      memmove (&array[j + 1], &array[j], (i - j) * sizeof (T));
+      array[j] = t;
+    }
+    if (array2)
+    {
+      T2 t = array2[i];
+      memmove (&array2[j + 1], &array2[j], (i - j) * sizeof (T2));
+      array2[j] = t;
+    }
+  }
 }
 
 template <typename T> static inline void
-hb_bubble_sort (T *array, unsigned int len, int(*compar)(const T *, const T *))
+hb_stable_sort (T *array, unsigned int len, int(*compar)(const T *, const T *))
 {
-  hb_bubble_sort (array, len, compar, (int *) NULL);
+  hb_stable_sort (array, len, compar, (int *) NULL);
 }
 
 static inline hb_bool_t
diff --git a/third_party/harfbuzz-ng/src/hb-set.h b/third_party/harfbuzz-ng/src/hb-set.h
index bafdae96..29bf655 100644
--- a/third_party/harfbuzz-ng/src/hb-set.h
+++ b/third_party/harfbuzz-ng/src/hb-set.h
@@ -36,6 +36,9 @@
 HB_BEGIN_DECLS
 
 
+/*
+ * Since: 0.9.21
+ */
 #define HB_SET_VALUE_INVALID ((hb_codepoint_t) -1)
 
 typedef struct hb_set_t hb_set_t;
diff --git a/third_party/harfbuzz-ng/src/hb-shape-plan.cc b/third_party/harfbuzz-ng/src/hb-shape-plan.cc
index d2f293d..56e2ea5c 100644
--- a/third_party/harfbuzz-ng/src/hb-shape-plan.cc
+++ b/third_party/harfbuzz-ng/src/hb-shape-plan.cc
@@ -128,7 +128,7 @@
     face = hb_face_get_empty ();
   if (unlikely (!props))
     return hb_shape_plan_get_empty ();
-  if (num_user_features && !(features = (hb_feature_t *) malloc (num_user_features * sizeof (hb_feature_t))))
+  if (num_user_features && !(features = (hb_feature_t *) calloc (num_user_features, sizeof (hb_feature_t))))
     return hb_shape_plan_get_empty ();
   if (!(shape_plan = hb_object_create<hb_shape_plan_t> ())) {
     free (features);
@@ -293,8 +293,13 @@
 		  num_features,
 		  shape_plan->shaper_func);
 
-  if (unlikely (hb_object_is_inert (shape_plan) ||
-		hb_object_is_inert (buffer)))
+  if (unlikely (!buffer->len))
+    return true;
+
+  assert (!hb_object_is_inert (buffer));
+  assert (buffer->content_type == HB_BUFFER_CONTENT_TYPE_UNICODE);
+
+  if (unlikely (hb_object_is_inert (shape_plan)))
     return false;
 
   assert (shape_plan->face_unsafe == font->face);
diff --git a/third_party/harfbuzz-ng/src/hb-shape.cc b/third_party/harfbuzz-ng/src/hb-shape.cc
index 5ddde5ad..8a98583 100644
--- a/third_party/harfbuzz-ng/src/hb-shape.cc
+++ b/third_party/harfbuzz-ng/src/hb-shape.cc
@@ -371,11 +371,6 @@
 	       unsigned int        num_features,
 	       const char * const *shaper_list)
 {
-  if (unlikely (!buffer->len))
-    return true;
-
-  assert (buffer->content_type == HB_BUFFER_CONTENT_TYPE_UNICODE);
-
   hb_shape_plan_t *shape_plan = hb_shape_plan_create_cached (font->face, &buffer->props, features, num_features, shaper_list);
   hb_bool_t res = hb_shape_plan_execute (shape_plan, font, buffer, features, num_features);
   hb_shape_plan_destroy (shape_plan);
@@ -399,7 +394,7 @@
  *
  * Return value: %FALSE if all shapers failed, %TRUE otherwise
  *
- * Since: 1.0
+ * Since: 0.9.2
  **/
 void
 hb_shape (hb_font_t           *font,
diff --git a/third_party/harfbuzz-ng/src/hb-shaper.cc b/third_party/harfbuzz-ng/src/hb-shaper.cc
index 580b95c..b25566d 100644
--- a/third_party/harfbuzz-ng/src/hb-shaper.cc
+++ b/third_party/harfbuzz-ng/src/hb-shaper.cc
@@ -64,7 +64,7 @@
     }
 
     /* Not found; allocate one. */
-    shapers = (hb_shaper_pair_t *) malloc (sizeof (all_shapers));
+    shapers = (hb_shaper_pair_t *) calloc (1, sizeof (all_shapers));
     if (unlikely (!shapers)) {
       (void) hb_atomic_ptr_cmpexch (&static_shapers, NULL, &all_shapers[0]);
       return (const hb_shaper_pair_t *) all_shapers;
diff --git a/third_party/harfbuzz-ng/src/hb-unicode.cc b/third_party/harfbuzz-ng/src/hb-unicode.cc
index 6b32faf..487d10b 100644
--- a/third_party/harfbuzz-ng/src/hb-unicode.cc
+++ b/third_party/harfbuzz-ng/src/hb-unicode.cc
@@ -158,7 +158,7 @@
  *
  * Return value: (transfer full):
  *
- * Since: 1.0
+ * Since: 0.9.2
  **/
 hb_unicode_funcs_t *
 hb_unicode_funcs_create (hb_unicode_funcs_t *parent)
@@ -204,7 +204,7 @@
  *
  * Return value: (transfer full):
  *
- * Since: 1.0
+ * Since: 0.9.2
  **/
 hb_unicode_funcs_t *
 hb_unicode_funcs_get_empty (void)
@@ -220,7 +220,7 @@
  *
  * Return value: (transfer full):
  *
- * Since: 1.0
+ * Since: 0.9.2
  **/
 hb_unicode_funcs_t *
 hb_unicode_funcs_reference (hb_unicode_funcs_t *ufuncs)
@@ -234,7 +234,7 @@
  *
  * 
  *
- * Since: 1.0
+ * Since: 0.9.2
  **/
 void
 hb_unicode_funcs_destroy (hb_unicode_funcs_t *ufuncs)
@@ -263,7 +263,7 @@
  *
  * Return value: 
  *
- * Since: 1.0
+ * Since: 0.9.2
  **/
 hb_bool_t
 hb_unicode_funcs_set_user_data (hb_unicode_funcs_t *ufuncs,
@@ -284,7 +284,7 @@
  *
  * Return value: (transfer none):
  *
- * Since: 1.0
+ * Since: 0.9.2
  **/
 void *
 hb_unicode_funcs_get_user_data (hb_unicode_funcs_t *ufuncs,
@@ -300,7 +300,7 @@
  *
  * 
  *
- * Since: 1.0
+ * Since: 0.9.2
  **/
 void
 hb_unicode_funcs_make_immutable (hb_unicode_funcs_t *ufuncs)
@@ -319,7 +319,7 @@
  *
  * Return value: 
  *
- * Since: 1.0
+ * Since: 0.9.2
  **/
 hb_bool_t
 hb_unicode_funcs_is_immutable (hb_unicode_funcs_t *ufuncs)
@@ -335,7 +335,7 @@
  *
  * Return value: 
  *
- * Since: 1.0
+ * Since: 0.9.2
  **/
 hb_unicode_funcs_t *
 hb_unicode_funcs_get_parent (hb_unicode_funcs_t *ufuncs)
diff --git a/third_party/harfbuzz-ng/src/hb-unicode.h b/third_party/harfbuzz-ng/src/hb-unicode.h
index bf1796d..3a12e2f 100644
--- a/third_party/harfbuzz-ng/src/hb-unicode.h
+++ b/third_party/harfbuzz-ng/src/hb-unicode.h
@@ -283,7 +283,7 @@
  *
  * 
  *
- * Since: 1.0
+ * Since: 0.9.2
  **/
 void
 hb_unicode_funcs_set_combining_class_func (hb_unicode_funcs_t *ufuncs,
@@ -299,7 +299,7 @@
  *
  * 
  *
- * Since: 1.0
+ * Since: 0.9.2
  **/
 void
 hb_unicode_funcs_set_eastasian_width_func (hb_unicode_funcs_t *ufuncs,
@@ -315,7 +315,7 @@
  *
  * 
  *
- * Since: 1.0
+ * Since: 0.9.2
  **/
 void
 hb_unicode_funcs_set_general_category_func (hb_unicode_funcs_t *ufuncs,
@@ -331,7 +331,7 @@
  *
  * 
  *
- * Since: 1.0
+ * Since: 0.9.2
  **/
 void
 hb_unicode_funcs_set_mirroring_func (hb_unicode_funcs_t *ufuncs,
@@ -347,7 +347,7 @@
  *
  * 
  *
- * Since: 1.0
+ * Since: 0.9.2
  **/
 void
 hb_unicode_funcs_set_script_func (hb_unicode_funcs_t *ufuncs,
diff --git a/third_party/harfbuzz-ng/src/hb-version.h b/third_party/harfbuzz-ng/src/hb-version.h
index f46d204..eb1ddbe 100644
--- a/third_party/harfbuzz-ng/src/hb-version.h
+++ b/third_party/harfbuzz-ng/src/hb-version.h
@@ -38,9 +38,9 @@
 
 #define HB_VERSION_MAJOR 1
 #define HB_VERSION_MINOR 0
-#define HB_VERSION_MICRO 2
+#define HB_VERSION_MICRO 5
 
-#define HB_VERSION_STRING "1.0.2"
+#define HB_VERSION_STRING "1.0.5"
 
 #define HB_VERSION_ATLEAST(major,minor,micro) \
 	((major)*10000+(minor)*100+(micro) <= \
diff --git a/third_party/mojo/mojo_edk_tests.gyp b/third_party/mojo/mojo_edk_tests.gyp
index a970700..34f590847 100644
--- a/third_party/mojo/mojo_edk_tests.gyp
+++ b/third_party/mojo/mojo_edk_tests.gyp
@@ -90,6 +90,7 @@
       'dependencies': [
         '../../testing/gtest.gyp:gtest',
         'mojo_edk.gyp:mojo_run_all_unittests',
+        'mojo_public.gyp:mojo_cpp_bindings',
         'mojo_public.gyp:mojo_environment_standalone',
         'mojo_public.gyp:mojo_public_test_utils',
         'mojo_public.gyp:mojo_utility',
@@ -124,6 +125,7 @@
       'dependencies': [
         '../../testing/gtest.gyp:gtest',
         'mojo_edk.gyp:mojo_run_all_unittests',
+        'mojo_public.gyp:mojo_cpp_bindings',
         'mojo_public.gyp:mojo_public_test_utils',
         'mojo_public.gyp:mojo_utility',
       ],
diff --git a/third_party/mojo/mojo_public.gyp b/third_party/mojo/mojo_public.gyp
index 833776d..eaf0cb2 100644
--- a/third_party/mojo/mojo_public.gyp
+++ b/third_party/mojo/mojo_public.gyp
@@ -150,6 +150,9 @@
         'src/mojo/public/cpp/bindings/lib/shared_ptr.h',
         'src/mojo/public/cpp/bindings/lib/string_serialization.h',
         'src/mojo/public/cpp/bindings/lib/string_serialization.cc',
+        'src/mojo/public/cpp/bindings/lib/thread_checker.h',
+        'src/mojo/public/cpp/bindings/lib/thread_checker_posix.cc',
+        'src/mojo/public/cpp/bindings/lib/thread_checker_posix.h',
         'src/mojo/public/cpp/bindings/lib/validate_params.h',
         'src/mojo/public/cpp/bindings/lib/validation_errors.cc',
         'src/mojo/public/cpp/bindings/lib/validation_errors.h',
diff --git a/third_party/mojo/src/mojo/edk/js/tests/BUILD.gn b/third_party/mojo/src/mojo/edk/js/tests/BUILD.gn
index 0d9b3be0..dc3d694 100644
--- a/third_party/mojo/src/mojo/edk/js/tests/BUILD.gn
+++ b/third_party/mojo/src/mojo/edk/js/tests/BUILD.gn
@@ -17,7 +17,7 @@
     "mojo/edk/js",
     "mojo/edk/test:test_support",
   ]
-  
+
   mojo_sdk_deps = [
     "mojo/public/cpp/bindings",
     "mojo/public/cpp/system",
@@ -34,4 +34,6 @@
   sources = [
     "js_to_cpp.mojom",
   ]
+
+  with_environment = false
 }
diff --git a/third_party/mojo/src/mojo/edk/system/channel_manager.cc b/third_party/mojo/src/mojo/edk/system/channel_manager.cc
index bf3edb1..bf70b02 100644
--- a/third_party/mojo/src/mojo/edk/system/channel_manager.cc
+++ b/third_party/mojo/src/mojo/edk/system/channel_manager.cc
@@ -96,7 +96,7 @@
           &bootstrap_channel_endpoint);
   bool ok = io_thread_task_runner_->PostTask(
       FROM_HERE,
-      base::Bind(&ChannelManager::CreateChannelHelper, base::Unretained(this),
+      base::Bind(&ChannelManager::CreateChannelHelper, weak_ptr_,
                  channel_id, base::Passed(&platform_handle),
                  bootstrap_channel_endpoint, callback,
                  callback_thread_task_runner));
@@ -187,14 +187,21 @@
   return channel;
 }
 
+// static
 void ChannelManager::CreateChannelHelper(
+    base::WeakPtr<ChannelManager> channel_manager,
     ChannelId channel_id,
     embedder::ScopedPlatformHandle platform_handle,
     scoped_refptr<system::ChannelEndpoint> bootstrap_channel_endpoint,
     const base::Closure& callback,
     scoped_refptr<base::TaskRunner> callback_thread_task_runner) {
-  CreateChannelOnIOThreadHelper(channel_id, platform_handle.Pass(),
-                                bootstrap_channel_endpoint);
+  // TODO(amistry): Handle this gracefully after determining exactly what cases
+  // can cause this. There appear to be crashes caused by ChannelManager being
+  // destroyed before this point, which shouldn't be possible in the current
+  // uses of ChannelManager.
+  CHECK(channel_manager);
+  channel_manager->CreateChannelOnIOThreadHelper(
+      channel_id, platform_handle.Pass(), bootstrap_channel_endpoint);
   if (callback_thread_task_runner) {
     bool ok = callback_thread_task_runner->PostTask(FROM_HERE, callback);
     DCHECK(ok);
diff --git a/third_party/mojo/src/mojo/edk/system/channel_manager.h b/third_party/mojo/src/mojo/edk/system/channel_manager.h
index 0d6c65dd..360996f7 100644
--- a/third_party/mojo/src/mojo/edk/system/channel_manager.h
+++ b/third_party/mojo/src/mojo/edk/system/channel_manager.h
@@ -139,7 +139,8 @@
       scoped_refptr<system::ChannelEndpoint> bootstrap_channel_endpoint);
 
   // Used by |CreateChannel()|. Called on the I/O thread.
-  void CreateChannelHelper(
+  static void CreateChannelHelper(
+      base::WeakPtr<ChannelManager> channel_manager,
       ChannelId channel_id,
       embedder::ScopedPlatformHandle platform_handle,
       scoped_refptr<system::ChannelEndpoint> bootstrap_channel_endpoint,
diff --git a/third_party/mojo/src/mojo/public/cpp/bindings/BUILD.gn b/third_party/mojo/src/mojo/public/cpp/bindings/BUILD.gn
index 14eb550c..c91bdd5 100644
--- a/third_party/mojo/src/mojo/public/cpp/bindings/BUILD.gn
+++ b/third_party/mojo/src/mojo/public/cpp/bindings/BUILD.gn
@@ -81,6 +81,9 @@
     "lib/shared_data.h",
     "lib/shared_ptr.h",
     "lib/template_util.h",
+    "lib/thread_checker.h",
+    "lib/thread_checker_posix.cc",
+    "lib/thread_checker_posix.h",
   ]
 
   mojo_sdk_deps = [ "mojo/public/cpp/system" ]
diff --git a/third_party/mojo/src/mojo/public/cpp/bindings/lib/router.cc b/third_party/mojo/src/mojo/public/cpp/bindings/lib/router.cc
index 5a7c7e2..fa264b7 100644
--- a/third_party/mojo/src/mojo/public/cpp/bindings/lib/router.cc
+++ b/third_party/mojo/src/mojo/public/cpp/bindings/lib/router.cc
@@ -92,11 +92,13 @@
 }
 
 bool Router::Accept(Message* message) {
+  MOJO_DCHECK(thread_checker_.CalledOnValidThread());
   MOJO_DCHECK(!message->has_flag(kMessageExpectsResponse));
   return connector_.Accept(message);
 }
 
 bool Router::AcceptWithResponder(Message* message, MessageReceiver* responder) {
+  MOJO_DCHECK(thread_checker_.CalledOnValidThread());
   MOJO_DCHECK(message->has_flag(kMessageExpectsResponse));
 
   // Reserve 0 in case we want it to convey special meaning in the future.
@@ -114,11 +116,13 @@
 }
 
 void Router::EnableTestingMode() {
+  MOJO_DCHECK(thread_checker_.CalledOnValidThread());
   testing_mode_ = true;
   connector_.set_enforce_errors_from_incoming_receiver(false);
 }
 
 bool Router::HandleIncomingMessage(Message* message) {
+  MOJO_DCHECK(thread_checker_.CalledOnValidThread());
   if (message->has_flag(kMessageExpectsResponse)) {
     if (incoming_receiver_) {
       MessageReceiverWithStatus* responder = new ResponderThunk(weak_self_);
diff --git a/third_party/mojo/src/mojo/public/cpp/bindings/lib/router.h b/third_party/mojo/src/mojo/public/cpp/bindings/lib/router.h
index d7e5a68..1999947e 100644
--- a/third_party/mojo/src/mojo/public/cpp/bindings/lib/router.h
+++ b/third_party/mojo/src/mojo/public/cpp/bindings/lib/router.h
@@ -11,7 +11,9 @@
 #include "mojo/public/cpp/bindings/lib/connector.h"
 #include "mojo/public/cpp/bindings/lib/filter_chain.h"
 #include "mojo/public/cpp/bindings/lib/shared_data.h"
+#include "mojo/public/cpp/bindings/lib/thread_checker.h"
 #include "mojo/public/cpp/environment/environment.h"
+#include "mojo/public/cpp/environment/logging.h"
 
 namespace mojo {
 namespace internal {
@@ -37,14 +39,24 @@
 
   // Returns true if an error was encountered while reading from the pipe or
   // waiting to read from the pipe.
-  bool encountered_error() const { return connector_.encountered_error(); }
+  bool encountered_error() const {
+    MOJO_DCHECK(thread_checker_.CalledOnValidThread());
+    return connector_.encountered_error();
+  }
 
   // Is the router bound to a MessagePipe handle?
-  bool is_valid() const { return connector_.is_valid(); }
+  bool is_valid() const {
+    MOJO_DCHECK(thread_checker_.CalledOnValidThread());
+    return connector_.is_valid();
+  }
 
-  void CloseMessagePipe() { connector_.CloseMessagePipe(); }
+  void CloseMessagePipe() {
+    MOJO_DCHECK(thread_checker_.CalledOnValidThread());
+    connector_.CloseMessagePipe();
+  }
 
   ScopedMessagePipeHandle PassMessagePipe() {
+    MOJO_DCHECK(thread_checker_.CalledOnValidThread());
     return connector_.PassMessagePipe();
   }
 
@@ -56,14 +68,17 @@
   // Blocks the current thread until the first incoming method call, i.e.,
   // either a call to a client method or a callback method, or |deadline|.
   bool WaitForIncomingMessage(MojoDeadline deadline) {
+    MOJO_DCHECK(thread_checker_.CalledOnValidThread());
     return connector_.WaitForIncomingMessage(deadline);
   }
 
   // See Binding for details of pause/resume.
   void PauseIncomingMethodCallProcessing() {
+    MOJO_DCHECK(thread_checker_.CalledOnValidThread());
     connector_.PauseIncomingMethodCallProcessing();
   }
   void ResumeIncomingMethodCallProcessing() {
+    MOJO_DCHECK(thread_checker_.CalledOnValidThread());
     connector_.ResumeIncomingMethodCallProcessing();
   }
 
@@ -77,7 +92,10 @@
   MessagePipeHandle handle() const { return connector_.handle(); }
 
   // Returns true if this Router has any pending callbacks.
-  bool has_pending_responders() const { return !responders_.empty(); }
+  bool has_pending_responders() const {
+    MOJO_DCHECK(thread_checker_.CalledOnValidThread());
+    return !responders_.empty();
+  }
 
  private:
   typedef std::map<uint64_t, MessageReceiver*> ResponderMap;
@@ -106,6 +124,7 @@
   ResponderMap responders_;
   uint64_t next_request_id_;
   bool testing_mode_;
+  ThreadChecker thread_checker_;
 };
 
 }  // namespace internal
diff --git a/third_party/mojo/src/mojo/public/cpp/bindings/lib/shared_data.h b/third_party/mojo/src/mojo/public/cpp/bindings/lib/shared_data.h
index 54c9346..2676224c 100644
--- a/third_party/mojo/src/mojo/public/cpp/bindings/lib/shared_data.h
+++ b/third_party/mojo/src/mojo/public/cpp/bindings/lib/shared_data.h
@@ -5,6 +5,9 @@
 #ifndef MOJO_PUBLIC_CPP_BINDINGS_LIB_SHARED_DATA_H_
 #define MOJO_PUBLIC_CPP_BINDINGS_LIB_SHARED_DATA_H_
 
+#include <assert.h>
+
+#include "mojo/public/cpp/bindings/lib/thread_checker.h"
 #include "mojo/public/cpp/system/macros.h"
 
 namespace mojo {
@@ -53,8 +56,12 @@
     Holder() : value(), ref_count_(1) {}
     Holder(const T& value) : value(value), ref_count_(1) {}
 
-    void Retain() { ++ref_count_; }
+    void Retain() {
+      assert(thread_checker_.CalledOnValidThread());
+      ++ref_count_;
+    }
     void Release() {
+      assert(thread_checker_.CalledOnValidThread());
       if (--ref_count_ == 0)
         delete this;
     }
@@ -63,6 +70,7 @@
 
    private:
     int ref_count_;
+    ThreadChecker thread_checker_;
     MOJO_DISALLOW_COPY_AND_ASSIGN(Holder);
   };
 
diff --git a/third_party/mojo/src/mojo/public/cpp/bindings/lib/thread_checker.h b/third_party/mojo/src/mojo/public/cpp/bindings/lib/thread_checker.h
new file mode 100644
index 0000000..da45d0a
--- /dev/null
+++ b/third_party/mojo/src/mojo/public/cpp/bindings/lib/thread_checker.h
@@ -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.
+
+#ifndef MOJO_PUBLIC_CPP_BINDINGS_LIB_THREAD_CHECKER_H_
+#define MOJO_PUBLIC_CPP_BINDINGS_LIB_THREAD_CHECKER_H_
+
+#include "mojo/public/cpp/system/macros.h"
+
+#if !defined(_WIN32)
+#include "mojo/public/cpp/bindings/lib/thread_checker_posix.h"
+#endif
+
+namespace mojo {
+namespace internal {
+
+class ThreadCheckerDoNothing {
+ public:
+  bool CalledOnValidThread() const MOJO_WARN_UNUSED_RESULT {
+    return true;
+  }
+};
+
+// ThreadChecker is a class used to verify that some methods of a class are
+// called from the same thread. It is meant to be a member variable of a class.
+// The entire lifecycle of a ThreadChecker must occur on a single thread.
+// In Release mode (without dcheck_always_on), ThreadChecker does nothing.
+#if !defined(_WIN32) && (!defined(NDEBUG) || defined(DCHECK_ALWAYS_ON))
+using ThreadChecker = ThreadCheckerPosix;
+#else
+using ThreadChecker = ThreadCheckerDoNothing;
+#endif
+
+}  // namespace internal
+}  // namespace mojo
+
+#endif  // MOJO_PUBLIC_CPP_BINDINGS_LIB_THREAD_CHECKER_H_
diff --git a/third_party/mojo/src/mojo/public/cpp/bindings/lib/thread_checker_posix.cc b/third_party/mojo/src/mojo/public/cpp/bindings/lib/thread_checker_posix.cc
new file mode 100644
index 0000000..c8a16e2
--- /dev/null
+++ b/third_party/mojo/src/mojo/public/cpp/bindings/lib/thread_checker_posix.cc
@@ -0,0 +1,24 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "mojo/public/cpp/bindings/lib/thread_checker_posix.h"
+
+#include <assert.h>
+
+namespace mojo {
+namespace internal {
+
+ThreadCheckerPosix::ThreadCheckerPosix() : attached_thread_id_(pthread_self()) {
+}
+
+ThreadCheckerPosix::~ThreadCheckerPosix() {
+  assert(CalledOnValidThread());
+}
+
+bool ThreadCheckerPosix::CalledOnValidThread() const {
+  return pthread_equal(pthread_self(), attached_thread_id_);
+}
+
+}  // namespace internal
+}  // namespace mojo
diff --git a/third_party/mojo/src/mojo/public/cpp/bindings/lib/thread_checker_posix.h b/third_party/mojo/src/mojo/public/cpp/bindings/lib/thread_checker_posix.h
new file mode 100644
index 0000000..4701b889
--- /dev/null
+++ b/third_party/mojo/src/mojo/public/cpp/bindings/lib/thread_checker_posix.h
@@ -0,0 +1,31 @@
+// 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 MOJO_PUBLIC_CPP_BINDINGS_LIB_THREAD_CHECKER_POSIX_H_
+#define MOJO_PUBLIC_CPP_BINDINGS_LIB_THREAD_CHECKER_POSIX_H_
+
+#include <pthread.h>
+
+#include "mojo/public/cpp/system/macros.h"
+
+namespace mojo {
+namespace internal {
+
+// An implementation of ThreadChecker for POSIX systems.
+class ThreadCheckerPosix {
+ public:
+  ThreadCheckerPosix();
+  ~ThreadCheckerPosix();
+
+  bool CalledOnValidThread() const MOJO_WARN_UNUSED_RESULT;
+ private:
+  const pthread_t attached_thread_id_;
+
+  MOJO_DISALLOW_COPY_AND_ASSIGN(ThreadCheckerPosix);
+};
+
+}  // namespace internal
+}  // namespace mojo
+
+#endif  // MOJO_PUBLIC_CPP_BINDINGS_LIB_THREAD_CHECKER_POSIX_H_
diff --git a/third_party/mojo/src/mojo/public/interfaces/bindings/BUILD.gn b/third_party/mojo/src/mojo/public/interfaces/bindings/BUILD.gn
index cf8a118..6d755ea 100644
--- a/third_party/mojo/src/mojo/public/interfaces/bindings/BUILD.gn
+++ b/third_party/mojo/src/mojo/public/interfaces/bindings/BUILD.gn
@@ -8,4 +8,6 @@
   sources = [
     "interface_control_messages.mojom",
   ]
+
+  with_environment = false
 }
diff --git a/third_party/mojo/src/mojo/public/interfaces/bindings/tests/BUILD.gn b/third_party/mojo/src/mojo/public/interfaces/bindings/tests/BUILD.gn
index b0a303f..46b6601 100644
--- a/third_party/mojo/src/mojo/public/interfaces/bindings/tests/BUILD.gn
+++ b/third_party/mojo/src/mojo/public/interfaces/bindings/tests/BUILD.gn
@@ -23,6 +23,8 @@
     "test_structs.mojom",
     "validation_test_interfaces.mojom",
   ]
+
+  with_environment = false
 }
 
 mojom("test_interfaces_experimental") {
@@ -30,6 +32,8 @@
   sources = [
     "test_unions.mojom",
   ]
+
+  with_environment = false
 }
 
 mojom("versioning_test_service_interfaces") {
@@ -38,6 +42,8 @@
   sources = [
     "versioning_test_service.mojom",
   ]
+
+  with_environment = false
 }
 
 mojom("versioning_test_client_interfaces") {
@@ -46,4 +52,6 @@
   sources = [
     "versioning_test_client.mojom",
   ]
+
+  with_environment = false
 }
diff --git a/third_party/mojo/src/mojo/public/tools/bindings/mojom.gni b/third_party/mojo/src/mojo/public/tools/bindings/mojom.gni
index b72e96a8..1a9873a4 100644
--- a/third_party/mojo/src/mojo/public/tools/bindings/mojom.gni
+++ b/third_party/mojo/src/mojo/public/tools/bindings/mojom.gni
@@ -38,6 +38,11 @@
 #   import_dirs (optional)
 #       List of import directories that will get added when processing sources.
 #
+#   with_environment (optional)
+#       Set to |false| to omit an implicit bindings dependency on the Chromium
+#       Mojo environment implementation. Defaults to |true| and in general
+#       should only be overridden by mojom targets within the Mojo EDK.
+#
 #   testonly (optional)
 #
 #   visibility (optional)
@@ -151,8 +156,8 @@
       script = generator_script
       inputs = generator_sources
       sources = invoker.sources
-      outputs = generator_cpp_outputs + generator_java_outputs +
-                generator_js_outputs
+      outputs =
+          generator_cpp_outputs + generator_java_outputs + generator_js_outputs
       args = [
         "{{source}}",
         "--use_bundled_pylibs",
@@ -266,6 +271,9 @@
         full_name = get_label_info(d, "label_no_toolchain")
         deps += [ "${full_name}_${cpp_sources_suffix}" ]
       }
+      if (!defined(invoker.with_environment) || invoker.with_environment) {
+        deps += [ "//mojo/environment:chromium" ]
+      }
     }
   }
 
diff --git a/third_party/openh264/DEPS b/third_party/openh264/DEPS
new file mode 100644
index 0000000..d2f34d2d
--- /dev/null
+++ b/third_party/openh264/DEPS
@@ -0,0 +1,3 @@
+include_rules = [
+  '+testing',
+]
diff --git a/third_party/openh264/LICENSE b/third_party/openh264/LICENSE
new file mode 100644
index 0000000..8e730c4
--- /dev/null
+++ b/third_party/openh264/LICENSE
@@ -0,0 +1,23 @@
+Copyright (c) 2013, Cisco Systems
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification,
+are permitted provided that the following conditions are met:
+
+* Redistributions of source code must retain the above copyright notice, this
+  list of conditions and the following disclaimer.
+
+* Redistributions in binary form must reproduce the above copyright notice, this
+  list of conditions and the following disclaimer in the documentation and/or
+  other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
+ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
\ No newline at end of file
diff --git a/third_party/openh264/OWNERS b/third_party/openh264/OWNERS
new file mode 100644
index 0000000..88f08e9a
--- /dev/null
+++ b/third_party/openh264/OWNERS
@@ -0,0 +1 @@
+hbos@chromium.org
diff --git a/third_party/openh264/README.chromium b/third_party/openh264/README.chromium
new file mode 100644
index 0000000..4e1893b8
--- /dev/null
+++ b/third_party/openh264/README.chromium
@@ -0,0 +1,20 @@
+Name: OpenH264
+Short Name: openh264
+URL: http://www.openh264.org/
+Version: v.1.4.0
+License: 2-Clause BSD
+License File: LICENSE
+Security Critical: yes
+
+Description:
+Cisco's H.264 video codec implementation.
+
+  Important:
+  While the OpenH264 source code is under BSD license, other license(s) also
+  apply for builds (MPEG-LA patent), see www.openh264.org for more information.
+
+Local Modifications:
+N/A
+
+   Note: OpenH264 src has not yet been pulled in. A proper README.chromium file
+   was added anyway due to presubmit check.
diff --git a/third_party/openh264/tests/BUILD.gn b/third_party/openh264/tests/BUILD.gn
new file mode 100644
index 0000000..5441a99
--- /dev/null
+++ b/third_party/openh264/tests/BUILD.gn
@@ -0,0 +1,20 @@
+# 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("//testing/test.gni")
+
+test("openh264_unittests") {
+  include_dirs = [
+    "//",
+    "//third_party",
+  ]
+
+  deps = [
+    "//testing/gtest",
+  ]
+
+  sources = [
+    "openh264_unittests.cc",
+  ]
+}
diff --git a/third_party/openh264/tests/openh264_unittests.cc b/third_party/openh264/tests/openh264_unittests.cc
new file mode 100644
index 0000000..443d27f
--- /dev/null
+++ b/third_party/openh264/tests/openh264_unittests.cc
@@ -0,0 +1,20 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "testing/gtest/include/gtest/gtest.h"
+
+namespace openh264 {
+
+class OpenH264Tests : public testing::Test {
+};
+
+TEST_F(OpenH264Tests, DummyTestAlwaysPass) {
+}
+
+}  // namespace openh264
+
+int main(int argc, char **argv) {
+  ::testing::InitGoogleTest(&argc, argv);
+  return RUN_ALL_TESTS();
+}
diff --git a/third_party/openh264/tests/openh264_unittests.gyp b/third_party/openh264/tests/openh264_unittests.gyp
new file mode 100644
index 0000000..72143a3
--- /dev/null
+++ b/third_party/openh264/tests/openh264_unittests.gyp
@@ -0,0 +1,22 @@
+# 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.
+
+{
+  'targets': [
+    {
+      'target_name': 'openh264_unittests',
+      'type': '<(gtest_target_type)',
+      'include_dirs': [
+        '<(DEPTH)',
+        '<(DEPTH)/third_party',
+      ],
+      'dependencies': [
+        '<(DEPTH)/testing/gtest.gyp:gtest',
+      ],
+      'sources': [
+        'openh264_unittests.cc',
+      ],
+    },
+  ],
+}
diff --git a/third_party/zlib/google.patch b/third_party/zlib/google.patch
index c943b410..3818b11 100644
--- a/third_party/zlib/google.patch
+++ b/third_party/zlib/google.patch
@@ -1,15 +1,3 @@
-diff -ru zlib-1.2.5/crc_folding.c zlib/crc_folding.c
---- zlib-1.2.5/crc_folding.c
-+++ zlib/crc_folding.c
-@@ -283,7 +283,7 @@
-         goto partial;
-     }
-
--    algn_diff = 0 - (unsigned long)src & 0xF;
-+    algn_diff = 0 - (uintptr_t)src & 0xF;
-     if (algn_diff) {
-         xmm_crc_part = _mm_loadu_si128((__m128i *)src);
-         _mm_storeu_si128((__m128i *)dst, xmm_crc_part);
 diff -ru zlib-1.2.5/gzlib.c zlib/gzlib.c
 --- zlib-1.2.5/gzlib.c
 +++ zlib/gzlib.c
diff --git a/tools/metrics/histograms/histograms.xml b/tools/metrics/histograms/histograms.xml
index e066f27..9035cd7 100644
--- a/tools/metrics/histograms/histograms.xml
+++ b/tools/metrics/histograms/histograms.xml
@@ -3474,6 +3474,15 @@
   </summary>
 </histogram>
 
+<histogram name="Cast.Sender.Overlay" enum="CastOverlayEvents">
+  <owner>avayvod@chromium.org</owner>
+  <owner>mlamouri@chromium.org</owner>
+  <summary>
+    Records events and user interactions related to the Cast overlay shown on
+    video elements.
+  </summary>
+</histogram>
+
 <histogram name="Cast.Sender.UrlResolveResult"
     enum="RemotePlaybackUrlResolveResult">
   <owner>aberent@google.com</owner>
@@ -13581,6 +13590,11 @@
   </summary>
 </histogram>
 
+<histogram name="GCM.AndroidGcmReceiver" enum="GcmReceiverStatus">
+  <owner>khushalsagar@chromium.org</owner>
+  <summary>Result of a message received by the GcmReceiver on Android.</summary>
+</histogram>
+
 <histogram name="GCM.APICallUnregister">
   <owner>jianli@chromium.org</owner>
   <summary>Number of times when gcm.unregister API is called.</summary>
@@ -14285,6 +14299,13 @@
   </summary>
 </histogram>
 
+<histogram name="GPU.GPUProcessLaunchCause" enum="GPUProcessLaunchCauses">
+  <owner>vangelis@chromium.org</owner>
+  <summary>
+    Counts enumerating the initial cause for the GPU Process to be launched.
+  </summary>
+</histogram>
+
 <histogram name="GPU.InitializeOneOffMediumTime" units="milliseconds">
   <owner>jmadill@chromium.org</owner>
   <summary>
@@ -16490,6 +16511,11 @@
   </summary>
 </histogram>
 
+<histogram name="LevelDB.Open" enum="LevelDBStatus">
+  <owner>cmumford@chromium.org</owner>
+  <summary>The result of an open attempt of a leveldb.</summary>
+</histogram>
+
 <histogram name="LevelDBEnv.All.SafeThreadAccess" units="accesses">
   <obsolete>
     Deprecated 2013-10. No thread-unsafety was found.
@@ -18112,6 +18138,18 @@
   <summary>Video codec profile used in RTC video encoder.</summary>
 </histogram>
 
+<histogram name="Media.Session.ActiveTime" units="ms">
+  <owner>avayvod@chromium.org</owner>
+  <owner>mlamouri@chromium.org</owner>
+  <summary>
+    Time during which a media session has been active, in other words, the time
+    between an activation and deactivation, without counting time while it was
+    suspended. If a session is activated after being deactivated, there will be
+    two entries. For example, if a user plays a song but is interrupted by a
+    phone call, it will only account for the song playing time.
+  </summary>
+</histogram>
+
 <histogram name="Media.Session.Pause" enum="MediaSessionActionSource">
   <owner>avayvod@chromium.org</owner>
   <owner>mlamouri@chromium.org</owner>
@@ -18139,6 +18177,15 @@
   </summary>
 </histogram>
 
+<histogram name="Media.Session.Suspended" enum="MediaSessionSuspendedSource">
+  <owner>avayvod@chromium.org</owner>
+  <owner>mlamouri@chromium.org</owner>
+  <summary>
+    The number of times a media session is suspended and why it has been
+    suspended.
+  </summary>
+</histogram>
+
 <histogram name="Media.TimeToPipelineStarted" units="ms">
   <obsolete>
     Removed from code 2014/6/18.
@@ -45622,6 +45669,33 @@
   <summary>Transition type that didn't match a synced tab.</summary>
 </histogram>
 
+<histogram name="Sync.PageRevisitTypedUrlDuration" units="milliseconds">
+  <owner>skym@chromium.org</owner>
+  <summary>
+    The client side execution time to check for revisits with typed URL data.
+  </summary>
+</histogram>
+
+<histogram name="Sync.PageRevisitTypedUrlMatchAge" units="minutes">
+  <owner>skym@chromium.org</owner>
+  <summary>
+    Difference in time between finding the match and the last time this URL was
+    typed on a foreign client.
+  </summary>
+</histogram>
+
+<histogram name="Sync.PageRevisitTypedUrlMatchTransition"
+    units="PageVisitTransitionType">
+  <owner>skym@chromium.org</owner>
+  <summary>Transition type that didn't match a typed URL.</summary>
+</histogram>
+
+<histogram name="Sync.PageRevisitTypedUrlMissTransition"
+    units="PageVisitTransitionType">
+  <owner>skym@chromium.org</owner>
+  <summary>Transition type that matched a typed URL.</summary>
+</histogram>
+
 <histogram name="Sync.PartiallySyncedTypes">
   <owner>zea@chromium.org</owner>
   <summary>
@@ -47241,7 +47315,7 @@
   </summary>
   <details>
     NOTE: This metric was incorrectly recorded on ChromeOS for versions 42
-    through 44, see http://crbug.com/499476 for more details.
+    through 45, see http://crbug.com/499476 for more details.
   </details>
 </histogram>
 
@@ -48741,6 +48815,20 @@
   <summary>Time spent doing a full GC during an IdleNotification.</summary>
 </histogram>
 
+<histogram name="V8.GCFinalizeMCReduceMemory" units="milliseconds">
+  <owner>ulan@chromium.org</owner>
+  <owner>hpayer@chromium.org</owner>
+  <summary>
+    Time spent in finalize incremental memory-reducing mark-sweep phase of GC.
+  </summary>
+</histogram>
+
+<histogram name="V8.GCFinalzeMC" units="milliseconds">
+  <owner>ulan@chromium.org</owner>
+  <owner>hpayer@chromium.org</owner>
+  <summary>Time spent in finalize incremental mark-sweep phase of GC.</summary>
+</histogram>
+
 <histogram name="V8.GCIdleNotification" units="milliseconds">
   <owner>jochen@chromium.org</owner>
   <owner>hpayer@chromium.org</owner>
@@ -52349,7 +52437,7 @@
   <int value="11" label="SOURCE_KEYBOARD"/>
   <int value="12" label="SOURCE_EXTENSIONS_PAGE"/>
   <int value="13" label="SOURCE_MANAGEMENT_API"/>
-  <int value="14" label="SOURCE_EPHEMERAL_APP"/>
+  <int value="14" label="SOURCE_EPHEMERAL_APP_UNUSED"/>
   <int value="15" label="SOURCE_BACKGROUND"/>
   <int value="16" label="SOURCE_KIOSK"/>
   <int value="17" label="SOURCE_CHROME_INTERNAL"/>
@@ -53778,6 +53866,12 @@
   <int value="3" label="Failed to open stream"/>
 </enum>
 
+<enum name="CastOverlayEvents" type="int">
+  <int value="0" label="Created"/>
+  <int value="1" label="Shown"/>
+  <int value="2" label="Clicked"/>
+</enum>
+
 <enum name="CastPlayBackState" type="int">
   <int value="0" label="YT_PLAYER_SUCCESS"/>
   <int value="1" label="YT_PLAYER_FAILURE"/>
@@ -54539,6 +54633,7 @@
   <int value="15" label="Open link in a new window"/>
   <int value="16" label="Print"/>
   <int value="17" label="Search web for..."/>
+  <int value="18" label="Save media as"/>
 </enum>
 
 <enum name="CookieDeletionCause" type="int">
@@ -60204,8 +60299,6 @@
   <int value="963" label="CredentialManagerStore"/>
   <int value="964" label="CredentialManagerRequireUserMediation"/>
   <int value="965" label="RequestAutocomplete"/>
-  <int value="966" label="CastOverlayClicked"/>
-  <int value="967" label="CastOverlayShown"/>
 </enum>
 
 <enum name="FetchRequestMode" type="int">
@@ -61450,6 +61543,11 @@
   <int value="6" label="Default or maximium time"/>
 </enum>
 
+<enum name="GcmReceiverStatus" type="int">
+  <int value="0" label="SUCCESS"/>
+  <int value="1" label="ERROR_SECURITY_EXCEPTION"/>
+</enum>
+
 <enum name="GCMRegistrationRequestStatus" type="int">
   <int value="0" label="Success (this is not logged currently)"/>
   <int value="1" label="Invalid parameters"/>
@@ -61745,6 +61843,47 @@
   <int value="5" label="UPGRADE_ERROR"/>
 </enum>
 
+<enum name="GPUProcessLaunchCauses" type="int">
+  <summary>
+    Causes for the GPU Process to be launched. From:
+    content/common/gpu/gpu_process_launch_causes.h
+  </summary>
+  <int value="0" label="about:gpucrash">
+    CAUSE_FOR_GPU_LAUNCH_ABOUT_GPUCRASH
+  </int>
+  <int value="1" label="about:gpuhang">CAUSE_FOR_GPU_LAUNCH_ABOUT_GPUHANG</int>
+  <int value="2" label="GpuDataManager RequestCompleteGpuInfoIfNeeded">
+    CAUSE_FOR_GPU_LAUNCH_GPUDATAMANAGER_REQUESTCOMPLETEGPUINFOIFNEEDED
+  </int>
+  <int value="3" label="RenderWidgetFullScreenPepper CreateContext">
+    CAUSE_FOR_GPU_LAUNCH_RENDERWIDGETFULLSCREENPEPPER_CREATECONTEXT
+  </int>
+  <int value="4" label="WebGraphicsContext3DCommandBufferImpl Initialize">
+    CAUSE_FOR_GPU_LAUNCH_WEBGRAPHICSCONTEXT3DCOMMANDBUFFERIMPL_INITIALIZE
+  </int>
+  <int value="5" label="NoLaunch">CAUSE_FOR_GPU_LAUNCH_NO_LAUNCH</int>
+  <int value="6" label="VideoDecodeAccelerator Initialize">
+    CAUSE_FOR_GPU_LAUNCH_VIDEODECODEACCELERATOR_INITIALIZE
+  </int>
+  <int value="7" label="Pepper PlatformContext3DImpl Initialize">
+    CAUSE_FOR_GPU_LAUNCH_PEPPERPLATFORMCONTEXT3DIMPL_INITIALIZE
+  </int>
+  <int value="8" label="Browser Startup">
+    CAUSE_FOR_GPU_LAUNCH_BROWSER_STARTUP
+  </int>
+  <int value="9" label="Canvas 2D">CAUSE_FOR_GPU_LAUNCH_CANVAS_2D</int>
+  <int value="10" label="Pepper VideoEncodeAccelerator Initialize">
+    CAUSE_FOR_GPU_LAUNCH_PEPPERVIDEOENCODERACCELERATOR_INITIALIZE
+  </int>
+  <int value="11" label="GpuMemoryBuffer allocate">
+    CAUSE_FOR_GPU_LAUNCH_GPU_MEMORY_BUFFER_ALLOCATE
+  </int>
+  <int value="12" label="JpegDecodeAccelerator Initialize">
+    CAUSE_FOR_GPU_LAUNCH_JPEGDECODEACCELERATOR_INITIALIZE
+  </int>
+  <int value="13" label="Mojo Setup">CAUSE_FOR_GPU_LAUNCH_MOJO_SETUP</int>
+</enum>
+
 <enum name="GzipEncodingFixupResult" type="int">
   <int value="0" label="Gzip encoding left as-is"/>
   <int value="1" label="MIME type indicated GZIP content"/>
@@ -65499,6 +65638,12 @@
   <int value="1" label="MediaSession (Android)"/>
 </enum>
 
+<enum name="MediaSessionSuspendedSource" type="int">
+  <int value="0" label="System Transient"/>
+  <int value="1" label="System Permanent"/>
+  <int value="2" label="UI"/>
+</enum>
+
 <enum name="MediaStreamRequestResult" type="int">
   <int value="0" label="Ok"/>
   <int value="1" label="Permission Denied"/>
@@ -76595,6 +76740,15 @@
   <affected-histogram name="LevelDBEnv.TimeTo"/>
 </histogram_suffixes>
 
+<histogram_suffixes name="LevelDBOpenResults">
+  <suffix name="DomDistillerStore" label="Databases for DomDistillerStore"/>
+  <suffix name="GCMKeyStore" label="Databases for GCMKeyStore"/>
+  <suffix name="ImageManager" label="Databases for ImageManager"/>
+  <suffix name="OfflinePageMetadataStore"
+      label="Databases for OfflinePageMetadataStore"/>
+  <affected-histogram name="LevelDB.Open"/>
+</histogram_suffixes>
+
 <histogram_suffixes name="LocalStorageSizes" separator="">
   <suffix name="Under100KB" label="DB size under 100KB"/>
   <suffix name="100KBTo1MB" label="DB size between 100KB and 1MB"/>
diff --git a/tools/perf/benchmarks/blink_perf.py b/tools/perf/benchmarks/blink_perf.py
index e009e30..8fe9b7e 100644
--- a/tools/perf/benchmarks/blink_perf.py
+++ b/tools/perf/benchmarks/blink_perf.py
@@ -86,7 +86,8 @@
     options.AppendExtraBrowserArgs([
         '--js-flags=--expose_gc',
         '--enable-experimental-web-platform-features',
-        '--disable-gesture-requirement-for-media-playback'
+        '--disable-gesture-requirement-for-media-playback',
+        '--enable-experimental-canvas-features'
     ])
     if 'content-shell' in options.browser_type:
       options.AppendExtraBrowserArgs('--expose-internals-for-testing')
diff --git a/tools/perf/benchmarks/memory_infra.py b/tools/perf/benchmarks/memory_infra.py
index 4ec7498..1d2843b2 100644
--- a/tools/perf/benchmarks/memory_infra.py
+++ b/tools/perf/benchmarks/memory_infra.py
@@ -51,10 +51,8 @@
 
   @classmethod
   def ValueCanBeAddedPredicate(cls, value, is_first_result):
-    # TODO(perezju): Do not ignore baidu failures http://crbug.com/538143
     return (value.tir_label in ['foreground', 'background']
-            and value.name.startswith('memory_')
-            and not ('baidu' in value.page.name and value.values is None))
+            and value.name.startswith('memory_'))
 
 
 # TODO(bashi): Workaround for http://crbug.com/532075
@@ -86,8 +84,9 @@
     return bool(cls._RE_RENDERER_VALUES.match(value.name))
 
 
-# Disabled on all non android bots see http://crbug.com/540022
-@benchmark.Enabled('android')
+# Disabled on reference builds because they don't support the new
+# Tracing.requestMemoryDump DevTools API. See http://crbug.com/540022.
+@benchmark.Disabled('reference')
 class MemoryBenchmarkTop10Mobile(_MemoryInfra):
   """Timeline based benchmark for measuring memory on top 10 mobile sites."""
 
diff --git a/tools/perf/benchmarks/webrtc_rendering.py b/tools/perf/benchmarks/webrtc_rendering.py
deleted file mode 100644
index 273c71b..0000000
--- a/tools/perf/benchmarks/webrtc_rendering.py
+++ /dev/null
@@ -1,33 +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.
-
-from core import perf_benchmark
-from telemetry.timeline import tracing_category_filter
-from telemetry.web_perf import timeline_based_measurement
-
-import page_sets
-
-BENCHMARK_VALUES = 'WebRTCRendering_'
-
-class WebRTCRendering(perf_benchmark.PerfBenchmark):
-  """Timeline based benchmark for the WebRtc rendering."""
-
-  page_set = page_sets.WebrtcRenderingPageSet
-
-  def CreateTimelineBasedMeasurementOptions(self):
-    cc_filter = tracing_category_filter.TracingCategoryFilter(
-        filter_string='webrtc,webkit.console,blink.console')
-    return timeline_based_measurement.Options(overhead_level=cc_filter)
-
-  def SetExtraBrowserOptions(self, options):
-    options.AppendExtraBrowserArgs('--use-fake-device-for-media-stream')
-    options.AppendExtraBrowserArgs('--use-fake-ui-for-media-stream')
-
-  @classmethod
-  def Name(cls):
-    return 'webrtc_rendering.webrtc_rendering'
-
-  @classmethod
-  def ValueCanBeAddedPredicate(cls, value, is_first_result):
-    return value.name.startswith(BENCHMARK_VALUES)
diff --git a/tools/perf/chrome_telemetry_build/__init__.py b/tools/perf/chrome_telemetry_build/__init__.py
new file mode 100644
index 0000000..040d52a6
--- /dev/null
+++ b/tools/perf/chrome_telemetry_build/__init__.py
@@ -0,0 +1,14 @@
+# Copyright (c) 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.
+
+""" This directory contains all the necessary files for clients in chromium/src
+to use telemetry.
+
+Those includes:
+  - chromium_config module that defines a subclass of project_config, which
+  specify binary dependencies & other references used by telemetry that are
+  specific to chromium project.
+  - binary_dependencies.json which specifies local paths to the binaries that
+  are used by telemetry.
+"""
diff --git a/tools/perf/core/binary_dependencies.json b/tools/perf/chrome_telemetry_build/binary_dependencies.json
similarity index 100%
rename from tools/perf/core/binary_dependencies.json
rename to tools/perf/chrome_telemetry_build/binary_dependencies.json
diff --git a/tools/perf/chrome_telemetry_build/chromium_config.py b/tools/perf/chrome_telemetry_build/chromium_config.py
new file mode 100644
index 0000000..eda8b65
--- /dev/null
+++ b/tools/perf/chrome_telemetry_build/chromium_config.py
@@ -0,0 +1,40 @@
+# Copyright (c) 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 logging
+import os
+import sys
+
+CHROMIUM_SRC_DIR = os.path.join(
+    os.path.dirname(__file__), os.path.pardir, os.path.pardir, os.path.pardir)
+
+sys.path.append(os.path.join(CHROMIUM_SRC_DIR, 'tools', 'telemetry'))
+
+from telemetry import project_config
+
+
+CLIENT_CONFIG_PATH = os.path.join(
+    os.path.dirname(__file__), 'binary_dependencies.json')
+
+
+class ChromiumConfig(project_config.ProjectConfig):
+  def __init__(self, top_level_dir=None, benchmark_dirs=None,
+               client_config=CLIENT_CONFIG_PATH,
+               chromium_src_dir=CHROMIUM_SRC_DIR):
+
+    perf_dir = os.path.join(CHROMIUM_SRC_DIR, 'tools', 'perf')
+    if not benchmark_dirs:
+      benchmark_dirs = [os.path.join(perf_dir, 'benchmarks')]
+      logging.info('No benchmark directories specified. Defaulting to %s',
+                   benchmark_dirs)
+    if not top_level_dir:
+      top_level_dir = perf_dir
+      logging.info('No top level directory specified. Defaulting to %s',
+                   top_level_dir)
+
+    super(ChromiumConfig, self).__init__(
+        top_level_dir=top_level_dir, benchmark_dirs=benchmark_dirs,
+        client_config=client_config)
+
+    self._chromium_src_dir = chromium_src_dir
diff --git a/tools/perf/core/chromium_config.py b/tools/perf/core/chromium_config.py
deleted file mode 100644
index f7848c33..0000000
--- a/tools/perf/core/chromium_config.py
+++ /dev/null
@@ -1,38 +0,0 @@
-# Copyright (c) 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 logging
-import os
-import sys
-
-from core import path_util
-
-sys.path.append(path_util.GetTelemetryDir())
-from telemetry import project_config
-
-
-CLIENT_CONFIG_PATH = os.path.join(
-    path_util.GetPerfDir(), 'core', 'binary_dependencies.json')
-
-
-class ChromiumConfig(project_config.ProjectConfig):
-  def __init__(self, top_level_dir=None, benchmark_dirs=None,
-               client_config=CLIENT_CONFIG_PATH,
-               chromium_src_dir=path_util.GetChromiumSrcDir()):
-
-    if not benchmark_dirs:
-      benchmark_dirs = [path_util.GetPerfBenchmarksDir()]
-      logging.info('No benchmark directories specified. Defaulting to %s',
-                   benchmark_dirs)
-    if not top_level_dir:
-      top_level_dir = path_util.GetPerfDir()
-      logging.info('No top level directory specified. Defaulting to %s',
-                   top_level_dir)
-
-    super(ChromiumConfig, self).__init__(
-        top_level_dir=top_level_dir, benchmark_dirs=benchmark_dirs,
-        client_config=client_config)
-
-    self._chromium_src_dir = chromium_src_dir
-
diff --git a/tools/perf/page_sets/memory_health_story.py b/tools/perf/page_sets/memory_health_story.py
index 79e5e6022..668befd 100644
--- a/tools/perf/page_sets/memory_health_story.py
+++ b/tools/perf/page_sets/memory_health_story.py
@@ -39,6 +39,7 @@
     self.archive_data_file = story_set.archive_data_file
 
   def _TakeMemoryMeasurement(self, action_runner, phase):
+    action_runner.Wait(1)  # See crbug.com/540022#c17.
     with action_runner.CreateInteraction(phase):
       action_runner.Wait(DUMP_WAIT_TIME)
       action_runner.ForceGarbageCollection()
diff --git a/tools/perf/page_sets/memory_infra_top_10_mobile_story.py b/tools/perf/page_sets/memory_infra_top_10_mobile_story.py
index e2a8c5fe..52bcf90d 100644
--- a/tools/perf/page_sets/memory_infra_top_10_mobile_story.py
+++ b/tools/perf/page_sets/memory_infra_top_10_mobile_story.py
@@ -15,6 +15,7 @@
 
   def RunPageInteractions(self, action_runner):
     action_runner.tab.WaitForDocumentReadyStateToBeComplete()
+    action_runner.Wait(1)  # See crbug.com/540022#c17.
     with action_runner.CreateInteraction('foreground'):
       action_runner.Wait(DUMP_WAIT_TIME)
       action_runner.ForceGarbageCollection()
diff --git a/tools/perf/page_sets/webrtc_rendering/loopback_peerconnection.html b/tools/perf/page_sets/webrtc_rendering/loopback_peerconnection.html
deleted file mode 100644
index 54ed6788..0000000
--- a/tools/perf/page_sets/webrtc_rendering/loopback_peerconnection.html
+++ /dev/null
@@ -1,128 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head><title>Loopback test</title></head>
-<body>
-  <video id="localVideo" width="1280" height="720" autoplay muted></video>
-  <video id="remoteVideo" width="1280" height="720" autoplay muted></video>
-<script>
-
-"use strict";
-
-var testDone = 0;
-var errors = "";
-
-// Starts the test.
-function testCamera(resolution) {
-  var test = new CameraTest(resolution);
-  test.run();
-}
-
-
-function CameraTest(resolutionArray) {
-  this.resolution = resolutionArray;
-  this.localStream = null;
-  this.remoteStream = null;
-  this.remoteVideo = document.getElementById("remoteVideo");
-  this.localVideo = document.getElementById("localVideo");
-  this.localVideo.width = this.resolution[0].toString();
-  this.localVideo.height = this.resolution[1].toString();
-  this.remoteVideo.width = this.resolution[0].toString();
-  this.remoteVideo.height = this.resolution[1].toString();
-}
-
-
-CameraTest.prototype = {
-  run: function() {
-    this.triggerGetUserMedia(this.resolution);
-  },
-
-  triggerGetUserMedia: function(resolution) {
-    var constraints = {
-      audio: false,
-      video: {
-        mandatory: {
-          minWidth:  resolution[0],
-          minHeight: resolution[1],
-          maxWidth:  resolution[0],
-          maxHeight: resolution[1]
-        }
-      }
-    };
-    try {
-      this.doGetUserMedia(constraints, this.gotLocalStream.bind(this),
-          this.onGetUserMediaError.bind(this));
-    } catch (exception) {
-      console.log('Unexpected exception: ', exception);
-      this.reportError('gUM', 'doGetUserMedia failed: ' + exception);
-    }
-  },
-
-  reportError: function(errorType, message) {
-    console.log(errorType, message);
-    errors = message;
-  },
-
-  doGetUserMedia: function(constraints, onSuccess, onFail) {
-    navigator.getUserMedia = navigator.getUserMedia ||
-      navigator.webkitGetUserMedia;
-    navigator.getUserMedia(constraints, onSuccess, onFail);
-  },
-
-  gotLocalStream: function(stream) {
-    this.localStream = stream;
-    var servers = null;
-
-    this.localPeerConnection = new webkitRTCPeerConnection(servers);
-    this.localPeerConnection.onicecandidate = this.gotLocalIceCandidate.bind(
-        this);
-
-    this.remotePeerConnection = new webkitRTCPeerConnection(servers);
-    this.remotePeerConnection.onicecandidate = this.gotRemoteIceCandidate.bind(
-        this);
-    this.remotePeerConnection.onaddstream = this.gotRemoteStream.bind(this);
-
-    this.localPeerConnection.addStream(this.localStream);
-    this.localPeerConnection.createOffer(this.gotLocalDescription.bind(this));
-    this.localVideo.src = URL.createObjectURL(stream);
-  },
-
-  onGetUserMediaError: function(stream) {
-    this.reportError('gUM', 'gUM call failed');
-  },
-
-  gotRemoteStream: function(event) {
-    this.remoteVideo.src = URL.createObjectURL(event.stream);
-  },
-
-  gotLocalDescription: function(description) {
-    this.localPeerConnection.setLocalDescription(description);
-    this.remotePeerConnection.setRemoteDescription(description);
-    this.remotePeerConnection.createAnswer(this.gotRemoteDescription.bind(
-        this));
-  },
-
-  gotRemoteDescription: function(description) {
-    this.remotePeerConnection.setLocalDescription(description);
-    this.localPeerConnection.setRemoteDescription(description);
-  },
-
-  gotLocalIceCandidate: function(event) {
-    if (event.candidate)
-      this.remotePeerConnection.addIceCandidate(
-        new RTCIceCandidate(event.candidate));
-  },
-
-  gotRemoteIceCandidate: function(event) {
-    if (event.candidate)
-      this.localPeerConnection.addIceCandidate(
-        new RTCIceCandidate(event.candidate));
-  },
-}
-
-window.onerror = function (message, filename, lineno, colno, error) {
-  console.log("Something went wrong, here is the stack trace --> %s",
-    error.stack);
-};
-</script>
-</body>
-</html>
diff --git a/tools/perf/page_sets/webrtc_rendering_measurement.py b/tools/perf/page_sets/webrtc_rendering_measurement.py
deleted file mode 100644
index ea666f4..0000000
--- a/tools/perf/page_sets/webrtc_rendering_measurement.py
+++ /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.
-
-from telemetry.page import page as page_module
-from telemetry.page import page_test as page_test
-from telemetry import story
-
-
-class WebrtcRenderingPage(page_module.Page):
-
-  def __init__(self, url, page_set):
-    super(WebrtcRenderingPage, self).__init__(
-      url=url,
-      page_set=page_set,
-      name='webrtc_rendering_page')
-
-  def RunPageInteractions(self, action_runner):
-    with action_runner.CreateInteraction('Action_Create_PeerConnection',
-                                         repeatable=False):
-      command = 'testCamera([%s, %s]);' % (1280, 720)
-      action_runner.ExecuteJavaScript(command)
-      action_runner.Wait(30)
-      errors = action_runner.EvaluateJavaScript('errors')
-      if errors:
-        raise page_test.Failure('Errors on page: ' + ', '.join(errors))
-
-
-class WebrtcRenderingPageSet(story.StorySet):
-  """ A benchmark of webrtc rendering performance."""
-
-  def __init__(self):
-    super(WebrtcRenderingPageSet, self).__init__()
-
-    url = ('file://webrtc_rendering/loopback_peerconnection.html')
-    self.AddStory(WebrtcRenderingPage(url, self))
diff --git a/tools/perf/run_benchmark b/tools/perf/run_benchmark
index e1a8f1ca..93d1708 100755
--- a/tools/perf/run_benchmark
+++ b/tools/perf/run_benchmark
@@ -6,12 +6,16 @@
 import os
 import sys
 
-sys.path.append(os.path.join(os.path.dirname(__file__), os.pardir, 'telemetry'))
+from core import path_util
+sys.path.append(path_util.GetTelemetryDir())
+
 from telemetry import benchmark_runner
 
-sys.path.append(os.path.join(os.path.dirname(__file__), 'core'))
-from core import chromium_config
+from chrome_telemetry_build import chromium_config
+
+def main():
+  config = chromium_config.ChromiumConfig()
+  return benchmark_runner.main(config)
 
 if __name__ == '__main__':
-  config = chromium_config.ChromiumConfig()
-  sys.exit(benchmark_runner.main(config))
+  sys.exit(main())
diff --git a/tools/perf/run_tests b/tools/perf/run_tests
index a7c89ab..32a2b84 100755
--- a/tools/perf/run_tests
+++ b/tools/perf/run_tests
@@ -12,21 +12,15 @@
 import subprocess
 import sys
 
-from core import chromium_config
+from chrome_telemetry_build import chromium_config
 from core import path_util
 
-if __name__ == '__main__':
+sys.path.append(path_util.GetTelemetryDir())
+from telemetry.testing import unittest_runner
+
+def main():
   project_config = chromium_config.ChromiumConfig()
-  telemetry_dir = path_util.GetTelemetryDir()
+  return unittest_runner.Run(project_config)
 
-  env = os.environ.copy()
-  if 'PYTHONPATH' in env:
-    env['PYTHONPATH'] = os.path.join(env['PYTHONPATH'], telemetry_dir)
-  else:
-    env['PYTHONPATH'] = telemetry_dir
-
-  path_to_run_tests = os.path.join(
-      telemetry_dir, 'telemetry', 'testing', 'run_tests.py')
-  argv = ['--top-level-dir', project_config.top_level_dir,
-          '--client-config', project_config.client_config] + sys.argv[1:]
-  sys.exit(subprocess.call([sys.executable, path_to_run_tests] + argv, env=env))
+if __name__ == '__main__':
+  sys.exit(main())
diff --git a/tools/telemetry/run_tests b/tools/telemetry/run_tests
index dc05043..78be94f 100755
--- a/tools/telemetry/run_tests
+++ b/tools/telemetry/run_tests
@@ -5,19 +5,16 @@
 
 import os
 import sys
-import subprocess
+
+sys.path.append(os.path.abspath(os.path.dirname(__file__)))
+from telemetry import project_config
+from telemetry.testing import unittest_runner
+
+
+def main():
+  config = project_config.ProjectConfig(top_level_dir=os.path.dirname(__file__))
+  return unittest_runner.Run(config)
 
 
 if __name__ == '__main__':
-  telemetry_dir = os.path.dirname(os.path.realpath(__file__))
-
-  env = os.environ.copy()
-  if 'PYTHONPATH' in env:
-    env['PYTHONPATH'] = env['PYTHONPATH'] + os.pathsep + telemetry_dir
-  else:
-    env['PYTHONPATH'] = telemetry_dir
-
-  path_to_run_tests = os.path.join(telemetry_dir, 'telemetry', 'testing',
-                                   'run_tests.py')
-  argv = ['--top-level-dir', telemetry_dir] + sys.argv[1:]
-  sys.exit(subprocess.call([sys.executable, path_to_run_tests] + argv, env=env))
+  sys.exit(main())
diff --git a/tools/telemetry/telemetry/benchmark_runner.py b/tools/telemetry/telemetry/benchmark_runner.py
index df5e4cc6..aa9476b 100644
--- a/tools/telemetry/telemetry/benchmark_runner.py
+++ b/tools/telemetry/telemetry/benchmark_runner.py
@@ -69,6 +69,9 @@
 
   print >> output_pipe, 'Available benchmarks %sare:' % (
       'for %s ' % possible_browser.browser_type if possible_browser else '')
+
+  # Sort the benchmarks by benchmark name.
+  benchmarks = sorted(benchmarks, key=lambda b: b.Name())
   for b in benchmarks:
     if not possible_browser or _IsBenchmarkEnabled(b, possible_browser):
       print >> output_pipe, format_string % (b.Name(), b.Description())
diff --git a/tools/telemetry/telemetry/benchmark_runner_unittest.py b/tools/telemetry/telemetry/benchmark_runner_unittest.py
index 715488e..767484a1 100644
--- a/tools/telemetry/telemetry/benchmark_runner_unittest.py
+++ b/tools/telemetry/telemetry/benchmark_runner_unittest.py
@@ -40,8 +40,8 @@
   def testPrintBenchmarkListWithNoDisabledBenchmark(self):
     expected_printed_stream = (
         'Available benchmarks for TestBrowser are:\n'
-        '  FooBenchmark      Benchmark Foo for testing.\n'
         '  BarBenchmarkkkkk  Benchmark Bar for testing long description line.\n'
+        '  FooBenchmark      Benchmark Foo for testing.\n'
         'Pass --browser to list benchmarks for another browser.\n\n')
     with mock.patch('telemetry.benchmark_runner.decorators') as mock_module:
       mock_module.IsEnabled.return_value = (True, None)
@@ -98,8 +98,8 @@
         'Pass --browser to list benchmarks for another browser.\n\n'
         # Expected output for 'MockBrowser':
         'Available benchmarks for MockBrowser are:\n'
-        '  FooBenchmark      Benchmark Foo for testing.\n'
         '  BarBenchmarkkkkk  Benchmark Bar for testing long description line.\n'
+        '  FooBenchmark      Benchmark Foo for testing.\n'
         'Pass --browser to list benchmarks for another browser.\n\n')
     @classmethod
     def FakeShouldDisable(cls, possible_browser):
diff --git a/tools/telemetry/telemetry/testing/unittest_runner.py b/tools/telemetry/telemetry/testing/unittest_runner.py
new file mode 100644
index 0000000..1bffdc0
--- /dev/null
+++ b/tools/telemetry/telemetry/testing/unittest_runner.py
@@ -0,0 +1,36 @@
+# 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 os
+import subprocess
+import sys
+
+from telemetry.core import util
+
+
+def Run(project_config, no_browser=False, stream=None):
+  args = sys.argv[1:]
+  assert '--top-level-dir' not in args, (
+      'Top level directory for running tests should be specified through '
+      'the instance of telemetry.project_config.ProjectConfig.')
+  assert '--client-config' not in args, (
+      'Client config file to be used for telemetry should be specified through '
+      'the instance of telemetry.project_config.ProjectConfig.')
+  assert project_config.top_level_dir, 'Must specify top level dir for project'
+  args.extend(['--top-level-dir', project_config.top_level_dir])
+  if project_config.client_config:
+    args.extend(['--client-config', project_config.client_config])
+  if no_browser and not '--no-browser' in args:
+    args.extend(['--no-browser'])
+
+  env = os.environ.copy()
+  telemetry_dir = util.GetTelemetryDir()
+  if 'PYTHONPATH' in env:
+    env['PYTHONPATH'] = os.pathsep.join([env['PYTHONPATH'], telemetry_dir])
+  else:
+    env['PYTHONPATH'] = telemetry_dir
+
+  path_to_run_tests = os.path.join(os.path.abspath(os.path.dirname(__file__)),
+                                   'run_tests.py')
+  return subprocess.call([sys.executable, path_to_run_tests] + args, env=env)
diff --git a/tools/telemetry/telemetry/web_perf/metrics/webrtc_rendering_stats.py b/tools/telemetry/telemetry/web_perf/metrics/webrtc_rendering_stats.py
deleted file mode 100644
index 30be6c8..0000000
--- a/tools/telemetry/telemetry/web_perf/metrics/webrtc_rendering_stats.py
+++ /dev/null
@@ -1,360 +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 logging
-
-from telemetry.util import statistics
-
-DISPLAY_HERTZ = 60.0
-VSYNC_DURATION = 1e6 / DISPLAY_HERTZ
-# When to consider a frame frozen (in VSYNC units): meaning 1 initial
-# frame + 5 repeats of that frame.
-FROZEN_THRESHOLD = 6
-# Severity factor.
-SEVERITY = 3
-
-IDEAL_RENDER_INSTANT = 'Ideal Render Instant'
-ACTUAL_RENDER_BEGIN = 'Actual Render Begin'
-ACTUAL_RENDER_END = 'Actual Render End'
-SERIAL = 'Serial'
-
-
-class TimeStats(object):
-  """Stats container for webrtc rendering metrics."""
-
-  def __init__(self, drift_time=None, mean_drift_time=None,
-    std_dev_drift_time=None, percent_badly_out_of_sync=None,
-    percent_out_of_sync=None, smoothness_score=None, freezing_score=None,
-    rendering_length_error=None, fps=None, frame_distribution=None):
-    self.drift_time = drift_time
-    self.mean_drift_time = mean_drift_time
-    self.std_dev_drift_time = std_dev_drift_time
-    self.percent_badly_out_of_sync = percent_badly_out_of_sync
-    self.percent_out_of_sync = percent_out_of_sync
-    self.smoothness_score = smoothness_score
-    self.freezing_score = freezing_score
-    self.rendering_length_error = rendering_length_error
-    self.fps = fps
-    self.frame_distribution = frame_distribution
-
-
-
-class WebMediaPlayerMsRenderingStats(object):
-  """Analyzes events of WebMediaPlayerMs type."""
-
-  def __init__(self, events):
-    """Save relevant events according to their stream."""
-    self.stream_to_events = self._MapEventsToStream(events)
-
-  def _IsEventValid(self, event):
-    """Check that the needed arguments are present in event.
-
-    Args:
-      event: event to check.
-
-    Returns:
-      True is event is valid, false otherwise."""
-    if not event.args:
-      return False
-    mandatory = [ACTUAL_RENDER_BEGIN, ACTUAL_RENDER_END,
-        IDEAL_RENDER_INSTANT, SERIAL]
-    for parameter in mandatory:
-      if not parameter in event.args:
-        return False
-    return True
-
-  def _MapEventsToStream(self, events):
-    """Build a dictionary of events indexed by stream.
-
-    The events of interest have a 'Serial' argument which represents the
-    stream ID. The 'Serial' argument identifies the local or remote nature of
-    the stream with a least significant bit  of 0 or 1 as well as the hash
-    value of the video track's URL. So stream::=hash(0|1} . The method will
-    then list the events of the same stream in a frame_distribution on stream
-    id. Practically speaking remote streams have an odd stream id and local
-    streams have a even stream id.
-    Args:
-      events: Telemetry WebMediaPlayerMs events.
-
-    Returns:
-      A dict of stream IDs mapped to events on that stream.
-    """
-    stream_to_events = {}
-    for event in events:
-      if not self._IsEventValid(event):
-        # This is not a render event, skip it.
-        continue
-      stream = event.args[SERIAL]
-      events_for_stream = stream_to_events.setdefault(stream, [])
-      events_for_stream.append(event)
-
-    return stream_to_events
-
-  def _GetCadence(self, relevant_events):
-    """Calculate the apparent cadence of the rendering.
-
-    In this paragraph I will be using regex notation. What is intended by the
-    word cadence is a sort of extended instantaneous 'Cadence' (thus not
-    necessarily periodic). Just as an example, a normal 'Cadence' could be
-    something like [2 3] which means possibly an observed frame persistance
-    progression of [{2 3}+] for an ideal 20FPS video source. So what we are
-    calculating here is the list of frame persistance, kind of a
-    'Proto-Cadence', but cadence is shorter so we abuse the word.
-
-    Args:
-      relevant_events: list of Telemetry events.
-
-    Returns:
-      a list of frame persistance values.
-    """
-    cadence = []
-    frame_persistence = 0
-    old_ideal_render = 0
-    for event in relevant_events:
-      if not self._IsEventValid(event):
-        # This event is not a render event so skip it.
-        continue
-      if event.args[IDEAL_RENDER_INSTANT] == old_ideal_render:
-        frame_persistence += 1
-      else:
-        cadence.append(frame_persistence)
-        frame_persistence = 1
-        old_ideal_render = event.args[IDEAL_RENDER_INSTANT]
-    cadence.append(frame_persistence)
-    cadence.pop(0)
-    return cadence
-
-  def _GetSourceToOutputDistribution(self, cadence):
-    """Create distribution for the cadence frame display values.
-
-    If the overall display distribution is A1:A2:..:An, this will tell us how
-    many times a frame stays displayed during Ak*VSYNC_DURATION, also known as
-    'source to output' distribution. Or in other terms:
-    a distribution B::= let C be the cadence, B[k]=p with k in Unique(C)
-    and p=Card(k in C).
-
-    Args:
-      cadence: list of frame persistance values.
-
-    Returns:
-      a dictionary containing the distribution
-    """
-    frame_distribution = {}
-    for ticks in cadence:
-      ticks_so_far = frame_distribution.setdefault(ticks, 0)
-      frame_distribution[ticks] = ticks_so_far + 1
-    return frame_distribution
-
-  def _GetFpsFromCadence(self, frame_distribution):
-    """Calculate the apparent FPS from frame distribution.
-
-    Knowing the display frequency and the frame distribution, it is possible to
-    calculate the video apparent frame rate as played by WebMediaPlayerMs
-    module.
-
-    Args:
-      frame_distribution: the source to output distribution.
-
-    Returns:
-      the video apparent frame rate.
-    """
-    number_frames = sum(frame_distribution.values())
-    number_vsyncs = sum([ticks * frame_distribution[ticks]
-       for ticks in frame_distribution])
-    mean_ratio = float(number_vsyncs) / number_frames
-    return DISPLAY_HERTZ / mean_ratio
-
-  def _GetFrozenFramesReports(self, frame_distribution):
-    """Find evidence of frozen frames in distribution.
-
-    For simplicity we count as freezing the frames that appear at least five
-    times in a row counted from 'Ideal Render Instant' perspective. So let's
-    say for 1 source frame, we rendered 6 frames, then we consider 5 of these
-    rendered frames as frozen. But we mitigate this by saying anything under
-    5 frozen frames will not be counted as frozen.
-
-    Args:
-      frame_distribution: the source to output distribution.
-
-    Returns:
-      a list of dicts whose keys are ('frozen_frames', 'occurrences').
-    """
-    frozen_frames = []
-    frozen_frame_vsyncs = [ticks for ticks in frame_distribution if ticks >=
-        FROZEN_THRESHOLD]
-    for frozen_frames_vsync in frozen_frame_vsyncs:
-      logging.debug('%s frames not updated after %s vsyncs',
-          frame_distribution[frozen_frames_vsync], frozen_frames_vsync)
-      frozen_frames.append(
-          {'frozen_frames': frozen_frames_vsync - 1,
-           'occurrences': frame_distribution[frozen_frames_vsync]})
-    return frozen_frames
-
-  def _FrozenPenaltyWeight(self, number_frozen_frames):
-    """Returns the weighted penalty for a number of frozen frames.
-
-    As mentioned earlier, we count for frozen anything above 6 vsync display
-    duration for the same 'Initial Render Instant', which is five frozen
-    frames.
-
-    Args:
-      number_frozen_frames: number of frozen frames.
-
-    Returns:
-      the penalty weight (int) for that number of frozen frames.
-    """
-
-    penalty = {
-      0: 0,
-      1: 0,
-      2: 0,
-      3: 0,
-      4: 0,
-      5: 1,
-      6: 5,
-      7: 15,
-      8: 25
-    }
-    weight = penalty.get(number_frozen_frames, 8 * (number_frozen_frames - 4))
-    return weight
-
-  def _IsRemoteStream(self, stream):
-    """Check if stream is remote."""
-    return stream % 2
-
-  def _GetDrifTimeStats(self, relevant_events, cadence):
-    """Get the drift time statistics.
-
-    This method will calculate drift_time stats, that is to say :
-    drift_time::= list(actual render begin - ideal render).
-    rendering_length error::= the rendering length error.
-
-    Args:
-      relevant_events: events to get drift times stats from.
-      cadence: list of frame persistence values.
-
-    Returns:
-      a tuple of (drift_time, rendering_length_error).
-    """
-    drift_time = []
-    old_ideal_render = 0
-    discrepancy = []
-    index = 0
-    for event in relevant_events:
-      current_ideal_render = event.args[IDEAL_RENDER_INSTANT]
-      if current_ideal_render == old_ideal_render:
-        # Skip to next event because we're looking for a source frame.
-        continue
-      actual_render_begin = event.args[ACTUAL_RENDER_BEGIN]
-      drift_time.append(actual_render_begin - current_ideal_render)
-      discrepancy.append(abs(current_ideal_render - old_ideal_render
-          - VSYNC_DURATION * cadence[index]))
-      old_ideal_render = current_ideal_render
-      index += 1
-    discrepancy.pop(0)
-    last_ideal_render = relevant_events[-1].args[IDEAL_RENDER_INSTANT]
-    first_ideal_render = relevant_events[0].args[IDEAL_RENDER_INSTANT]
-    rendering_length_error = 100.0 * (sum([x for x in discrepancy]) /
-        (last_ideal_render - first_ideal_render))
-
-    return drift_time, rendering_length_error
-
-  def _GetSmoothnessStats(self, norm_drift_time):
-    """Get the smoothness stats from the normalized drift time.
-
-    This method will calculate the smoothness score, along with the percentage
-    of frames badly out of sync and the percentage of frames out of sync. To be
-    considered badly out of sync, a frame has to have missed rendering by at
-    least 2*VSYNC_DURATION. To be considered out of sync, a frame has to have
-    missed rendering by at least one VSYNC_DURATION.
-    The smoothness score is a measure of how out of sync the frames are.
-
-    Args:
-      norm_drift_time: normalized drift time.
-
-    Returns:
-      a tuple of (percent_badly_oos, percent_out_of_sync, smoothness_score)
-    """
-    # How many times is a frame later/earlier than T=2*VSYNC_DURATION. Time is
-    # in microseconds.
-    frames_severely_out_of_sync = len(
-        [x for x in norm_drift_time if abs(x) > 2 * VSYNC_DURATION])
-    percent_badly_oos = (
-        100.0 * frames_severely_out_of_sync / len(norm_drift_time))
-
-    # How many times is a frame later/earlier than VSYNC_DURATION.
-    frames_out_of_sync = len(
-        [x for x in norm_drift_time if abs(x) > VSYNC_DURATION])
-    percent_out_of_sync = (
-        100.0 * frames_out_of_sync / len(norm_drift_time))
-
-    frames_oos_only_once = frames_out_of_sync - frames_severely_out_of_sync
-
-    # Calculate smoothness metric. From the formula, we can see that smoothness
-    # score can be negative.
-    smoothness_score = 100.0 - 100.0 * (frames_oos_only_once +
-        SEVERITY * frames_severely_out_of_sync) / len(norm_drift_time)
-
-    # Minimum smoothness_score value allowed is zero.
-    if smoothness_score < 0:
-      smoothness_score = 0
-
-    return (percent_badly_oos, percent_out_of_sync, smoothness_score)
-
-  def _GetFreezingScore(self, frame_distribution):
-    """Get the freezing score."""
-
-    # The freezing score is based on the source to output distribution.
-    number_vsyncs = sum([n * frame_distribution[n]
-        for n in frame_distribution])
-    frozen_frames = self._GetFrozenFramesReports(frame_distribution)
-
-    # Calculate freezing metric.
-    # Freezing metric can be negative if things are really bad. In that case we
-    # change it to zero as minimum valud.
-    freezing_score = 100.0
-    for frozen_report in frozen_frames:
-      weight = self._FrozenPenaltyWeight(frozen_report['frozen_frames'])
-      freezing_score -= (
-          100.0 * frozen_report['occurrences'] / number_vsyncs * weight)
-    if freezing_score < 0:
-      freezing_score = 0
-
-    return freezing_score
-
-  def GetTimeStats(self):
-    """Calculate time stamp stats for all remote stream events."""
-    stats = {}
-    for stream, relevant_events in self.stream_to_events.iteritems():
-      if len(relevant_events) == 1:
-        logging.debug('Found a stream=%s with just one event', stream)
-        continue
-      if not self._IsRemoteStream(stream):
-        logging.info('Skipping processing of local stream: %s', stream)
-        continue
-
-      cadence = self._GetCadence(relevant_events)
-      frame_distribution = self._GetSourceToOutputDistribution(cadence)
-      fps = self._GetFpsFromCadence(frame_distribution)
-
-      drift_time_stats = self._GetDrifTimeStats(relevant_events, cadence)
-      (drift_time, rendering_length_error) = drift_time_stats
-
-      # Drift time normalization.
-      mean_drift_time = statistics.ArithmeticMean(drift_time)
-      norm_drift_time = [abs(x - mean_drift_time) for x in drift_time]
-
-      smoothness_stats = self._GetSmoothnessStats(norm_drift_time)
-      (percent_badly_oos, percent_out_of_sync,
-          smoothness_score) = smoothness_stats
-
-      freezing_score = self._GetFreezingScore(frame_distribution)
-
-      stats = TimeStats(drift_time=drift_time,
-          percent_badly_out_of_sync=percent_badly_oos,
-          percent_out_of_sync=percent_out_of_sync,
-          smoothness_score=smoothness_score, freezing_score=freezing_score,
-          rendering_length_error=rendering_length_error, fps=fps,
-          frame_distribution=frame_distribution)
-    return stats
diff --git a/tools/telemetry/telemetry/web_perf/metrics/webrtc_rendering_stats_unittest.py b/tools/telemetry/telemetry/web_perf/metrics/webrtc_rendering_stats_unittest.py
deleted file mode 100644
index d3adfc86..0000000
--- a/tools/telemetry/telemetry/web_perf/metrics/webrtc_rendering_stats_unittest.py
+++ /dev/null
@@ -1,258 +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 unittest
-
-import mock
-
-from telemetry.web_perf.metrics import webrtc_rendering_stats as stats_helper
-
-
-class FakeEvent(object):
-  """Fake event class to mock rendering events."""
-
-  def __init__(self, **kwargs):
-    """Initializer for the fake WebMediaPlayerMS::UpdateCurrentFrame events.
-
-    The WebMediaPlayerMsRenderingStats only cares about actual render begin,
-    actual render end, ideal render instant and serial fields of the events.
-    So we only define these four fields here in this fake event class.
-    This method is written so as to take whatever valid parameters from the
-    event definition. It can also be used to craft incomplete events.
-
-    Args:
-      kwargs::= dict('actual_begin', 'actual_end', 'ideal_instant', 'serial').
-    """
-    self.args = {}
-    name_map = {
-        'Actual Render Begin': 'actual_begin',
-        'Actual Render End': 'actual_end',
-        'Ideal Render Instant': 'ideal_instant',
-        'Serial': 'serial'}
-    for internal_name, external_name in name_map.iteritems():
-      if external_name in kwargs:
-        self.args[internal_name] = kwargs[external_name]
-
-
-class WebMediaPlayerMsRenderingStatsTest(unittest.TestCase):
-
-  def setUp(self):
-    # A local stream id always has an even number.
-    # A remote stream id always has an odd number.
-    self.local_stream = 136390988
-    self.remote_stream = 118626165
-
-  def testInitialization(self):
-    event_local_stream = FakeEvent(actual_begin=1655987203306,
-        actual_end=1655987219972, ideal_instant=1655987154324,
-        serial=self.local_stream)
-
-    event_remote_stream = FakeEvent(actual_begin=1655987203306,
-        actual_end=1655987219972, ideal_instant=1655987167999,
-        serial=self.remote_stream)
-
-    stats_parser = stats_helper.WebMediaPlayerMsRenderingStats(
-        [event_local_stream, event_remote_stream])
-
-    self.assertEqual(2, len(stats_parser.stream_to_events))
-
-    self.assertEqual(event_local_stream.args,
-        stats_parser.stream_to_events[self.local_stream][0].args)
-
-    self.assertEqual(event_remote_stream.args,
-        stats_parser.stream_to_events[self.remote_stream][0].args)
-
-  def testInvalidEvents(self):
-    event_missing_serial = FakeEvent(actual_begin=1655987244074,
-        actual_end=1655987260740, ideal_instant=1655987204839)
-
-    event_missing_actual_begin = FakeEvent(actual_end=1655987260740,
-        ideal_instant=1655987217999, serial=self.local_stream)
-
-    event_missing_actual_end = FakeEvent(actual_end=1655987260740,
-        ideal_instant=1655987217999, serial=self.remote_stream)
-
-    event_missing_ideal_instant = FakeEvent(actual_begin=1655987260740,
-        actual_end=1655987277406, serial=self.remote_stream)
-
-    stats_parser = stats_helper.WebMediaPlayerMsRenderingStats(
-        [event_missing_serial, event_missing_actual_begin,
-         event_missing_actual_end, event_missing_ideal_instant])
-
-    self.assertEqual(0, len(stats_parser.stream_to_events))
-
-  def _GetFakeEvents(self):
-    fake_events = [
-        FakeEvent(actual_begin=1663780195583, actual_end=1663780212249,
-            ideal_instant=1663780179998, serial=self.remote_stream),
-        FakeEvent(actual_begin=1663780212249, actual_end=1663780228915,
-            ideal_instant=1663780179998, serial=self.remote_stream),
-        FakeEvent(actual_begin=1663780228915, actual_end=1663780245581,
-            ideal_instant=1663780197998, serial=self.remote_stream),
-        FakeEvent(actual_begin=1663780245581, actual_end=1663780262247,
-            ideal_instant=1663780215998, serial=self.remote_stream),
-        FakeEvent(actual_begin=1663780262247, actual_end=1663780278913,
-            ideal_instant=1663780215998, serial=self.remote_stream),
-        FakeEvent(actual_begin=1663780278913, actual_end=1663780295579,
-            ideal_instant=1663780254998, serial=self.remote_stream),
-        FakeEvent(actual_begin=1663780295579, actual_end=1663780312245,
-            ideal_instant=1663780254998, serial=self.remote_stream),
-        FakeEvent(actual_begin=1663780312245, actual_end=1663780328911,
-           ideal_instant=1663780254998, serial=self.remote_stream),
-        FakeEvent(actual_begin=1663780328911, actual_end=1663780345577,
-           ideal_instant=1663780310998, serial=self.remote_stream),
-        FakeEvent(actual_begin=1663780345577, actual_end=1663780362243,
-            ideal_instant=1663780310998, serial=self.remote_stream),
-        FakeEvent(actual_begin=1663780362243, actual_end=1663780378909,
-            ideal_instant=1663780310998, serial=self.remote_stream),
-        FakeEvent(actual_begin=1663780378909, actual_end=1663780395575,
-            ideal_instant=1663780361998, serial=self.remote_stream),
-        FakeEvent(actual_begin=1663780395575, actual_end=1663780412241,
-            ideal_instant=1663780361998, serial=self.remote_stream),
-        FakeEvent(actual_begin=1663780412241, actual_end=1663780428907,
-            ideal_instant=1663780361998, serial=self.remote_stream),
-        FakeEvent(actual_begin=1663780428907, actual_end=1663780445573,
-            ideal_instant=1663780412998, serial=self.remote_stream)]
-
-    return fake_events
-
-  def testGetCadence(self):
-    fake_events = self._GetFakeEvents()
-    stats_parser = stats_helper.WebMediaPlayerMsRenderingStats(fake_events)
-    # The events defined in _GetFakeEvents above show that the first source
-    # framee of ideal_instant=1663780179998 is rendered twice, then
-    # the second source frame of ideal_instant=1663780197998 is rendered once
-    # the third source frame of  ideal_instant=1663780215998 is rendered twice
-    # and so on. The expected cadence will therefore be [2 1 2 etc..]
-    expected_cadence = [2, 1, 2, 3, 3, 3, 1]
-    self.assertEqual(expected_cadence, stats_parser._GetCadence(fake_events))
-
-  def testGetSourceToOutputDistribution(self):
-    stats_parser = stats_helper.WebMediaPlayerMsRenderingStats([])
-    cadence = [2, 1, 2, 3, 3, 3, 1]
-    expected_frame_distribution = {1: 2, 2: 2, 3: 3}
-    self.assertEqual(expected_frame_distribution,
-        stats_parser._GetSourceToOutputDistribution(cadence))
-
-  def testGetFpsFromCadence(self):
-    frame_distribution = {1: 2, 2: 2, 3: 3}
-    stats_parser = stats_helper.WebMediaPlayerMsRenderingStats([])
-    expected_frame_rate = 28.0
-    self.assertEqual(expected_frame_rate,
-        stats_parser._GetFpsFromCadence(frame_distribution))
-
-  def testGetFrozenFramesReports(self):
-    frame_distribution = {1: 2, 2: 2, 3: 569, 6: 1}
-    expected_frozen_reports = [{'frozen_frames': 5, 'occurrences': 1}]
-    stats_parser = stats_helper.WebMediaPlayerMsRenderingStats([])
-    self.assertEqual(expected_frozen_reports,
-        stats_parser._GetFrozenFramesReports(frame_distribution))
-
-  def testIsRemoteStream(self):
-    stats_parser = stats_helper.WebMediaPlayerMsRenderingStats([])
-    self.assertTrue(stats_parser._IsRemoteStream(self.remote_stream))
-
-  def testGetDrifTimeStats(self):
-    fake_events = self._GetFakeEvents()
-    stats_parser = stats_helper.WebMediaPlayerMsRenderingStats([])
-    cadence = stats_parser._GetCadence(fake_events)
-    expected_drift_time = [15585, 30917, 29583, 23915, 17913, 16911, 15909]
-    expected_rendering_length_error = 29.613733905579398
-
-    self.assertEqual((expected_drift_time, expected_rendering_length_error),
-        stats_parser._GetDrifTimeStats(fake_events, cadence))
-
-  def testGetSmoothnessStats(self):
-    norm_drift_time = [5948.2857142857138, 9383.7142857142862,
-        8049.7142857142862, 2381.7142857142862, 3620.2857142857138,
-        4622.2857142857138, 5624.2857142857138]
-    stats_parser = stats_helper.WebMediaPlayerMsRenderingStats([])
-    expected_percent_badly_oos = 0.0
-    expected_percent_out_of_sync = 0.0
-    expected_smoothness_score = 100.0
-    expected_smoothness_stats = (expected_percent_badly_oos,
-        expected_percent_out_of_sync, expected_smoothness_score)
-
-    self.assertEqual(expected_smoothness_stats,
-        stats_parser._GetSmoothnessStats(norm_drift_time))
-
-  def testNegativeSmoothnessScoreChangedToZero(self):
-    norm_drift_time = [15948.285714285714, 9383.714285714286,
-        28049.714285714286, 72381.71428571429, 3620.2857142857138,
-        4622.285714285714, 35624.28571428572]
-    stats_parser = stats_helper.WebMediaPlayerMsRenderingStats([])
-    expected_percent_badly_oos = 28.571428571428573
-    expected_percent_out_of_sync = 42.857142857142854
-    expected_smoothness_score = 0.0
-    expected_smoothness_stats = (expected_percent_badly_oos,
-        expected_percent_out_of_sync, expected_smoothness_score)
-
-    self.assertEqual(expected_smoothness_stats,
-        stats_parser._GetSmoothnessStats(norm_drift_time))
-
-  def testGetFreezingScore(self):
-    frame_distribution = {1: 2, 2: 2, 3: 569, 6: 1}
-    stats_parser = stats_helper.WebMediaPlayerMsRenderingStats([])
-    expected_freezing_score = 99.94182664339732
-    self.assertEqual(expected_freezing_score,
-        stats_parser._GetFreezingScore(frame_distribution))
-
-  def testNegativeFrezingScoreChangedToZero(self):
-    frame_distribution = {1: 2, 2: 2, 3: 2, 8:100}
-    stats_parser = stats_helper.WebMediaPlayerMsRenderingStats([])
-    self.assertEqual(0.0, stats_parser._GetFreezingScore(frame_distribution))
-
-  def testGetTimeStats(self):
-    fake_events = self._GetFakeEvents()
-    expected_cadence = [2, 1, 2, 3, 3, 3, 1]
-    expected_frame_dist = {1: 2, 2: 2, 3: 569, 6: 1}
-    expected_frame_rate = 28.0
-    expected_drift_time = [15585, 30917, 29583, 23915, 17913, 16911, 15909]
-    expected_rendering_length_error = 29.613733905579398
-    expected_percent_badly_oos = 0.0
-    expected_percent_out_of_sync = 0.0
-    expected_smoothness_score = 100.0
-    expected_freezing_score = 99.94182664339732
-
-    stats_cls = stats_helper.WebMediaPlayerMsRenderingStats
-    stats_cls._GetCadence = mock.Mock()
-    stats_cls._GetCadence.return_value = expected_cadence
-    stats_cls._GetSourceToOutputDistribution = mock.Mock()
-    stats_cls._GetSourceToOutputDistribution.return_value = expected_frame_dist
-    stats_cls._GetFpsFromCadence = mock.Mock()
-    stats_cls._GetFpsFromCadence.return_value = expected_frame_rate
-    stats_cls._GetDrifTimeStats = mock.Mock()
-    stats_cls._GetDrifTimeStats.return_value = (expected_drift_time,
-        expected_rendering_length_error)
-    stats_cls._GetSmoothnessStats = mock.Mock()
-    stats_cls._GetSmoothnessStats.return_value = (expected_percent_badly_oos,
-        expected_percent_out_of_sync, expected_smoothness_score)
-    stats_cls._GetFreezingScore = mock.Mock()
-    stats_cls._GetFreezingScore.return_value = expected_freezing_score
-
-    stats_parser = stats_cls(fake_events)
-
-    expected_stats = stats_helper.TimeStats(
-        drift_time=expected_drift_time,
-        percent_badly_out_of_sync=expected_percent_badly_oos,
-        percent_out_of_sync=expected_percent_out_of_sync,
-        smoothness_score=expected_smoothness_score,
-        freezing_score=expected_freezing_score,
-        rendering_length_error=expected_rendering_length_error,
-        fps=expected_frame_rate,
-        frame_distribution=expected_frame_dist)
-
-    stats = stats_parser.GetTimeStats()
-
-    self.assertEqual(expected_stats.drift_time, stats.drift_time)
-    self.assertEqual(expected_stats.percent_badly_out_of_sync,
-        stats.percent_badly_out_of_sync)
-    self.assertEqual(expected_stats.percent_out_of_sync,
-        stats.percent_out_of_sync)
-    self.assertEqual(expected_stats.smoothness_score, stats.smoothness_score)
-    self.assertEqual(expected_stats.freezing_score, stats.freezing_score)
-    self.assertEqual(expected_stats.rendering_length_error,
-        stats.rendering_length_error)
-    self.assertEqual(expected_stats.fps, stats.fps)
-    self.assertEqual(expected_stats.frame_distribution,
-        stats.frame_distribution)
diff --git a/tools/telemetry/telemetry/web_perf/metrics/webrtc_rendering_timeline.py b/tools/telemetry/telemetry/web_perf/metrics/webrtc_rendering_timeline.py
deleted file mode 100644
index ef7f8b2..0000000
--- a/tools/telemetry/telemetry/web_perf/metrics/webrtc_rendering_timeline.py
+++ /dev/null
@@ -1,122 +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.
-
-from telemetry.value import list_of_scalar_values
-from telemetry.value import scalar
-from telemetry.value import improvement_direction
-from telemetry.web_perf.metrics import timeline_based_metric
-from telemetry.web_perf.metrics import webrtc_rendering_stats as stats_helper
-
-WEB_MEDIA_PLAYER_MS_EVENT = 'WebMediaPlayerMS::UpdateCurrentFrame'
-
-
-class WebRtcRenderingTimelineMetric(timeline_based_metric.TimelineBasedMetric):
-  """WebrtcRenderingTimelineMetric calculates metric for WebMediaPlayerMS.
-
-  The following metrics are added to the results:
-    WebRTCRendering_drift_time us
-    WebRTCRendering_percent_badly_out_of_sync %
-    WebRTCRendering_percent_out_of_sync %
-    WebRTCRendering_fps FPS
-    WebRTCRendering_smoothness_score %
-    WebRTCRendering_freezing_score %
-    WebRTCRendering_rendering_length_error %
-  """
-
-  def __init__(self):
-    super(WebRtcRenderingTimelineMetric, self).__init__()
-
-  @staticmethod
-  def IsMediaPlayerMSEvent(event):
-    """Verify that the event is a webmediaplayerMS event."""
-    return event.name == WEB_MEDIA_PLAYER_MS_EVENT
-
-  def AddResults(self, model, renderer_thread, interactions, results):
-    """Adding metrics to the results."""
-    assert interactions
-    found_events = []
-    for event in renderer_thread.parent.IterAllEvents(
-        event_predicate=self.IsMediaPlayerMSEvent):
-      if timeline_based_metric.IsEventInInteractions(event, interactions):
-        found_events.append(event)
-    stats_parser = stats_helper.WebMediaPlayerMsRenderingStats(found_events)
-    rendering_stats = stats_parser.GetTimeStats()
-    none_reason = None
-    if not rendering_stats:
-      # Create a TimeStats object whose members have None values.
-      rendering_stats = stats_helper.TimeStats()
-      none_reason = 'No WebMediaPlayerMS::UpdateCurrentFrame event found'
-    results.AddValue(list_of_scalar_values.ListOfScalarValues(
-        results.current_page,
-        'WebRTCRendering_drift_time',
-        'us',
-        rendering_stats.drift_time,
-        important=True,
-        description='Drift time for a rendered frame',
-        improvement_direction=improvement_direction.DOWN,
-        none_value_reason=none_reason))
-
-    results.AddValue(scalar.ScalarValue(
-        results.current_page,
-        'WebRTCRendering_percent_badly_out_of_sync',
-        '%',
-        rendering_stats.percent_badly_out_of_sync,
-        important=True,
-        description='Percentage of frame which drifted more than 2 VSYNC',
-        improvement_direction=improvement_direction.DOWN,
-        none_value_reason=none_reason))
-
-    results.AddValue(scalar.ScalarValue(
-        results.current_page,
-        'WebRTCRendering_percent_out_of_sync',
-        '%',
-        rendering_stats.percent_out_of_sync,
-        important=True,
-        description='Percentage of frame which drifted more than 1 VSYNC',
-        improvement_direction=improvement_direction.DOWN,
-        none_value_reason=none_reason))
-
-    # I removed the frame distribution list from stats as it is not a metric,
-    # rather it is the underlying data. Also there is no sense of improvement
-    # direction for frame distribution.
-
-    results.AddValue(scalar.ScalarValue(
-        results.current_page,
-        'WebRTCRendering_fps',
-        'fps',
-        rendering_stats.fps,
-        important=True,
-        description='Calculated Frame Rate of video rendering',
-        improvement_direction=improvement_direction.UP,
-        none_value_reason=none_reason))
-
-    results.AddValue(scalar.ScalarValue(
-        results.current_page,
-        'WebRTCRendering_smoothness_score',
-        '%',
-        rendering_stats.smoothness_score,
-        important=True,
-        description='Smoothness score of rendering',
-        improvement_direction=improvement_direction.UP,
-        none_value_reason=none_reason))
-
-    results.AddValue(scalar.ScalarValue(
-        results.current_page,
-        'WebRTCRendering_freezing_score',
-        '%',
-        rendering_stats.freezing_score,
-        important=True,
-        description='Freezing score of rendering',
-        improvement_direction=improvement_direction.UP,
-        none_value_reason=none_reason))
-
-    results.AddValue(scalar.ScalarValue(
-        results.current_page,
-        'WebRTCRendering_rendering_length_error',
-        '%',
-        rendering_stats.rendering_length_error,
-        important=True,
-        description='Rendering length error rate',
-        improvement_direction=improvement_direction.DOWN,
-        none_value_reason=none_reason))
diff --git a/tools/telemetry/telemetry/web_perf/timeline_based_measurement.py b/tools/telemetry/telemetry/web_perf/timeline_based_measurement.py
index 5be3dea..8644988 100644
--- a/tools/telemetry/telemetry/web_perf/timeline_based_measurement.py
+++ b/tools/telemetry/telemetry/web_perf/timeline_based_measurement.py
@@ -11,7 +11,6 @@
 from telemetry.value import trace
 from telemetry.web_perf.metrics import timeline_based_metric
 from telemetry.web_perf.metrics import blob_timeline
-from telemetry.web_perf.metrics import webrtc_rendering_timeline
 from telemetry.web_perf.metrics import gpu_timeline
 from telemetry.web_perf.metrics import indexeddb_timeline
 from telemetry.web_perf.metrics import layout
@@ -49,8 +48,7 @@
           blob_timeline.BlobTimelineMetric(),
           memory_timeline.MemoryTimelineMetric(),
           text_selection.TextSelectionMetric(),
-          indexeddb_timeline.IndexedDBTimelineMetric(),
-          webrtc_rendering_timeline.WebRtcRenderingTimelineMetric())
+          indexeddb_timeline.IndexedDBTimelineMetric())
 
 
 class InvalidInteractions(Exception):
@@ -255,6 +253,7 @@
     """Configure and start tracing."""
     if not platform.tracing_controller.IsChromeTracingSupported():
       raise Exception('Not supported')
+
     platform.tracing_controller.Start(self._tbm_options.tracing_options,
                                       self._tbm_options.category_filter)
 
diff --git a/tools/valgrind/drmemory/suppressions.txt b/tools/valgrind/drmemory/suppressions.txt
index b7a4cb3e..5808f0c 100644
--- a/tools/valgrind/drmemory/suppressions.txt
+++ b/tools/valgrind/drmemory/suppressions.txt
@@ -232,6 +232,12 @@
 name=::Crasher::Run deliberate crash
 *!base::`anonymous namespace'::Crasher::Run
 
+WARNING
+name=AllocationRegister guard page access deliberate crash
+base.dll!base::trace_event::AllocationRegister::Insert
+*!base::trace_event::AllocationRegisterTest_OverflowDeathTest_Test::TestBody
+*!testing::internal::HandleExceptionsInMethodIfSupported<>
+
 ############################
 # Benign issues in Chromium
 
@@ -749,9 +755,3 @@
 *!blink::SecurityOrigin::addSuborigin
 *!blink::SecurityOriginTest_Suborigins_Test::TestBody
 *!testing::internal::HandleExceptionsInMethodIfSupported<>
-
-WARNING
-name=bug_542501
-base.dll!base::trace_event::AllocationRegister::Insert
-*!base::trace_event::AllocationRegisterTest_OverflowDeathTest_Test::TestBody
-*!testing::internal::HandleExceptionsInMethodIfSupported<>
diff --git a/tools/valgrind/memcheck/suppressions.txt b/tools/valgrind/memcheck/suppressions.txt
index e3b12e3..0a61f5d0 100644
--- a/tools/valgrind/memcheck/suppressions.txt
+++ b/tools/valgrind/memcheck/suppressions.txt
@@ -3335,7 +3335,7 @@
    fun:_ZN5blink17CSSPropertyParser9validUnitEPNS_14CSSParserValueENS0_5UnitsENS0_31ReleaseParsedCalcValueConditionE
    ...
    fun:_ZN5blink17CSSPropertyParser10parseValueENS_13CSSPropertyIDEb
-   fun:_ZN5blink17CSSPropertyParser10parseValueENS_13CSSPropertyIDEbPNS_18CSSParserValueListERKNS_16CSSParserContextERN3WTF6VectorINS_11CSSPropertyELm256ENS7_16DefaultAllocatorEEENS_13StyleRuleBase4TypeE
+   fun:_ZN5blink17CSSPropertyParser10parseValueENS_13CSSPropertyID*
    fun:_ZN5blink13CSSParserImpl23consumeDeclarationValueENS_19CSSParserTokenRangeENS_13CSSPropertyIDEbNS_13StyleRuleBase4TypeE
 }
 {
@@ -3399,6 +3399,18 @@
    fun:_ZN5blink4Heap19processMarkingStackEPNS_7VisitorE
 }
 {
+   bug_521656
+   Memcheck:Uninitialized
+   fun:_ZN5blink10TraceTraitINS_11WebGLObjectEE5traceEPNS_7VisitorEPv
+   fun:_ZN5blink13CallbackStack4Item4callEPNS_7VisitorE
+   fun:_ZN5blink4Heap25popAndInvokeTraceCallbackEPNS_7VisitorE
+   fun:_ZN5blink4Heap19processMarkingStackEPNS_7VisitorE
+   fun:_ZN5blink4Heap14collectGarbageENS_11ThreadState10StackStateENS1_6GCTypeENS0_8GCReasonE
+   fun:_ZN5blink14V8GCController10gcEpilogueEN2v86GCTypeENS1_15GCCallbackFlagsE
+   fun:_ZN2v88internal4Heap23CallGCEpilogueCallbacksENS_6GCTypeENS_15GCCallbackFlagsE
+   fun:_ZN2v88internal4Heap24PerformGarbageCollectionENS0_16GarbageCollectorENS_15GCCallbackFlagsE
+}
+{
    bug_522049
    Memcheck:Unaddressable
    ...
@@ -3511,3 +3523,48 @@
    fun:_ZN7content24NavigationControllerImpl17LoadURLWithParamsERKNS_20NavigationController13LoadURLParamsE
    fun:_ZN7content5Shell15LoadURLForFrameERK4GURLRKSs
 }
+{
+   bug_542543
+   Memcheck:Leak
+   fun:_Znw*
+   fun:_ZN8IOThread34ConstructProxyScriptFetcherContextEPNS_7GlobalsEPN3net6NetLogE
+   fun:_ZN8IOThread4InitEv
+   fun:_ZN7content17BrowserThreadImpl4InitEv
+   fun:_ZN7content21TestBrowserThreadImpl4InitEv
+   fun:_ZN4base6Thread10ThreadMainEv
+   fun:_ZN4base12_GLOBAL__N_110ThreadFuncEPv
+}
+{
+   bug_542563
+   Memcheck:Leak
+   fun:_Znw*
+   ...
+   fun:_ZN7content21RenderProcessHostImpl4InitEv
+   fun:_ZN7content22RenderFrameHostManager14InitRenderViewEPNS_18RenderViewHostImplEi
+   fun:_ZN7content22RenderFrameHostManager8NavigateERK4GURLRKNS_20FrameNavigationEntryERKNS_19NavigationEntryImplE
+   fun:_ZN7content13NavigatorImpl15NavigateToEntryEPNS_13FrameTreeNodeERKNS_20FrameNavigationEntryERKNS_19NavigationEntryImplENS_20NavigationController10ReloadTypeEb
+   fun:_ZN7content13NavigatorImpl22NavigateToPendingEntryEPNS_13FrameTreeNodeERKNS_20FrameNavigationEntryENS_20NavigationController10ReloadTypeEb
+   fun:_ZN7content24NavigationControllerImpl30NavigateToPendingEntryInternalENS_20NavigationController10ReloadTypeE
+}
+{
+   bug_542575
+   Memcheck:Overlap
+   fun:memcpy@@GLIBC_2.14
+   fun:BrotliDecompressStreaming
+   fun:BrotliDecompress
+   fun:BrotliDecompressBuffer
+   fun:_ZN3ots18ConvertWOFF2ToSFNTEPNS_4FontEPhmPKhm
+   fun:_ZN12_GLOBAL__N_112ProcessWOFF2EPN3ots12OpenTypeFileEPNS0_4FontEPNS0_9OTSStreamEPKhm
+   fun:_ZN3ots10OTSContext7ProcessEPNS_9OTSStreamEPKhmj
+   fun:_ZN5blink17OpenTypeSanitizer8sanitizeEv
+}
+{
+   bug_542875
+   Memcheck:Leak
+   fun:malloc
+   fun:_ZN3WTF10fastMallocEm
+   ...
+   fun:_ZN5blink13DOMTypedArrayIN3WTF17Uint8ClampedArrayEN2v817Uint8ClampedArrayEE12createOrNullEj
+   fun:_ZN5blink9ImageData6createERKNS_7IntSizeE
+   fun:_ZNK5blink17HTMLCanvasElement11toImageDataENS_19SourceDrawingBufferE
+}
diff --git a/tools/valgrind/memcheck/suppressions_mac.txt b/tools/valgrind/memcheck/suppressions_mac.txt
index e49bc99..3cbc4cd8 100644
--- a/tools/valgrind/memcheck/suppressions_mac.txt
+++ b/tools/valgrind/memcheck/suppressions_mac.txt
@@ -140,20 +140,24 @@
 {
    nsapplication_does_not_free_everything_when_dealloced_1
    Memcheck:Leak
+   fun:calloc
+   fun:_internal_class_createInstanceFromZone
+   fun:+[NSObject(NSObject) allocWithZone:]
+   fun:+[NSCursor _buildCursor:cursorData:]
+   fun:+[NSCursor _makeCursors]
    fun:-[NSApplication init]
    fun:_ZN12_GLOBAL__N_122ScopedSendingEventTestC2Ev
-   fun:_ZN12_GLOBAL__N_148ScopedSendingEventTest_SetHandlingSendEvent_TestC2Ev
-   fun:_ZN12_GLOBAL__N_148ScopedSendingEventTest_SetHandlingSendEvent_TestC1Ev
-   fun:_ZN7testing8internal15TestFactoryImplIN12_GLOBAL__N_148ScopedSendingEventTest_SetHandlingSendEvent_TestEE10CreateTestEv
+   fun:_ZN12_GLOBAL__N_*ScopedSendingEventTest_*HandlingSendEvent_TestC2Ev
+   fun:_ZN12_GLOBAL__N_*ScopedSendingEventTest_*HandlingSendEvent_TestC1Ev
 }
 {
    nsapplication_does_not_free_everything_when_dealloced_2
    Memcheck:Leak
+   fun:malloc_zone_calloc
    fun:-[NSApplication init]
    fun:_ZN12_GLOBAL__N_122ScopedSendingEventTestC2Ev
-   fun:_ZN12_GLOBAL__N_154ScopedSendingEventTest_NestedSetHandlingSendEvent_TestC2Ev
-   fun:_ZN12_GLOBAL__N_154ScopedSendingEventTest_NestedSetHandlingSendEvent_TestC1Ev
-   fun:_ZN7testing8internal15TestFactoryImplIN12_GLOBAL__N_154ScopedSendingEventTest_NestedSetHandlingSendEvent_TestEE10CreateTestEv
+   fun:_ZN12_GLOBAL__N_*ScopedSendingEventTest_*HandlingSendEvent_TestC2Ev
+   fun:_ZN12_GLOBAL__N_*ScopedSendingEventTest_*HandlingSendEvent_TestC1Ev
 }
 
 # 2. Intentional unit test errors, stuff that is somehow a false positive
@@ -324,25 +328,3 @@
    fun:_ZNK4base8internal12CallbackBase7is_nullEv
    fun:_ZN8remoting8protocol12_GLOBAL__N_110FakeSocket17AppendInputPacketERKSt6vectorIcSaIcEE
 }
-{
-   bug_542502_a
-   Memcheck:Leak
-   fun:calloc
-   fun:_internal_class_createInstanceFromZone
-   fun:+[NSObject(NSObject) allocWithZone:]
-   fun:+[NSCursor _buildCursor:cursorData:]
-   fun:+[NSCursor _makeCursors]
-   fun:-[NSApplication init]
-   fun:_ZN12_GLOBAL__N_122ScopedSendingEventTestC2Ev
-   fun:_ZN12_GLOBAL__N_*ScopedSendingEventTest_*HandlingSendEvent_TestC2Ev
-   fun:_ZN12_GLOBAL__N_*ScopedSendingEventTest_*HandlingSendEvent_TestC1Ev
-}
-{
-   bug_542502_b
-   Memcheck:Leak
-   fun:malloc_zone_calloc
-   fun:-[NSApplication init]
-   fun:_ZN12_GLOBAL__N_122ScopedSendingEventTestC2Ev
-   fun:_ZN12_GLOBAL__N_*ScopedSendingEventTest_*HandlingSendEvent_TestC2Ev
-   fun:_ZN12_GLOBAL__N_*ScopedSendingEventTest_*HandlingSendEvent_TestC1Ev
-}
diff --git a/tools/valgrind/waterfall.sh b/tools/valgrind/waterfall.sh
index 1ae6733..29efe1e 100755
--- a/tools/valgrind/waterfall.sh
+++ b/tools/valgrind/waterfall.sh
@@ -52,8 +52,17 @@
   rm -rf "$LOGS_DIR" # Delete old logs
   mkdir "$LOGS_DIR"
 
+  URL=$1
+  LAYOUT_ONLY=0
+  if [ $# != 0 ]; then
+    shift
+    if [ "$1" = "layout_only" ]; then
+      LAYOUT_ONLY=1
+    fi
+  fi
+
   echo "Fetching the list of builders..."
-  download $1 "$LOGS_DIR/builders"
+  download "$URL" "$LOGS_DIR/builders"
   SLAVES=$(grep "<a href=\"builders\/" "$LOGS_DIR/builders" | \
            grep 'td class="box"' | \
            sed "s/.*<a href=\"builders\///" | sed "s/\".*//" | \
@@ -61,7 +70,13 @@
 
   for S in $SLAVES
   do
-    SLAVE_URL=$1/$S
+    if [ "$LAYOUT_ONLY" = "1" ]; then
+      if [ "$S" != "Webkit%20Linux%20%28valgrind%20layout%29" ]; then
+        continue;
+      fi
+    fi
+
+    SLAVE_URL="$URL/$S"
     SLAVE_NAME=$(echo $S | sed -e "s/%20/ /g" -e "s/%28/(/g" -e "s/%29/)/g")
     echo -n "Fetching builds by slave '${SLAVE_NAME}'"
     download $SLAVE_URL?numbuilds=${NUMBUILDS} "$LOGS_DIR/slave_${S}"
@@ -168,19 +183,23 @@
    -n N    Fetch N builds from each slave.
 
 COMMANDS:
-  fetch    Fetch Valgrind logs from the memory waterfall
-  match    Test the local suppression files against the downloaded logs
+  fetch           Fetch Valgrind logs from the memory waterfall
+  fetch_layout    Fetch many Valgrind logs from the layout test bot only
+  match           Test the local suppression files against the downloaded logs
 
 EOF
 }
 
-NUMBUILDS=3
-
 CMD=$1
 if [ $# != 0 ]; then
   shift
 fi
 
+NUMBUILDS=3
+if [ "$CMD" = "fetch_layout" ]; then
+  NUMBUILDS=30
+fi
+
 # Arguments for "match" are handled in match_suppressions
 if [ "$CMD" != "match" ]; then
   while getopts “hn:” OPTION
@@ -208,8 +227,11 @@
 
 if [ "$CMD" = "fetch" ]; then
   echo "Fetching $NUMBUILDS builds"
-  fetch_logs $WATERFALL_PAGE
-  fetch_logs $WATERFALL_FYI_PAGE
+  fetch_logs "$WATERFALL_PAGE"
+  fetch_logs "$WATERFALL_FYI_PAGE"
+elif [ "$CMD" = "fetch_layout" ]; then
+  echo "Fetching $NUMBUILDS builds"
+  fetch_logs "$WATERFALL_FYI_PAGE" layout_only
 elif [ "$CMD" = "match" ]; then
   match_suppressions $@
   match_gtest_excludes
diff --git a/ui/accessibility/ax_enums.idl b/ui/accessibility/ax_enums.idl
index 17608a0..e178030 100644
--- a/ui/accessibility/ax_enums.idl
+++ b/ui/accessibility/ax_enums.idl
@@ -30,6 +30,7 @@
     blur,                      // Remove: http://crbug.com/392502
     checked_state_changed,     // Implicit
     children_changed,
+    document_selection_changed,
     focus,
     hide,                      // Remove: http://crbug.com/392502
     hover,
diff --git a/ui/android/java/src/org/chromium/ui/widget/TextViewWithClickableSpans.java b/ui/android/java/src/org/chromium/ui/widget/TextViewWithClickableSpans.java
index 6efa876..184172a 100644
--- a/ui/android/java/src/org/chromium/ui/widget/TextViewWithClickableSpans.java
+++ b/ui/android/java/src/org/chromium/ui/widget/TextViewWithClickableSpans.java
@@ -46,6 +46,10 @@
     }
 
     private void init() {
+        // This disables the saving/restoring since the saved text may be in the wrong language
+        // (if the user just changed system language), and restoring spans doesn't work anyway.
+        // See crbug.com/533362
+        setSaveEnabled(false);
         mAccessibilityManager = (AccessibilityManager)
                 getContext().getSystemService(Context.ACCESSIBILITY_SERVICE);
         setOnLongClickListener(new View.OnLongClickListener() {
diff --git a/ui/base/ui_base_tests.gyp b/ui/base/ui_base_tests.gyp
index d47436b..5018384 100644
--- a/ui/base/ui_base_tests.gyp
+++ b/ui/base/ui_base_tests.gyp
@@ -288,8 +288,29 @@
           'includes': [ '../../build/apk_test.gypi' ],
         },
       ],
+      'conditions': [
+        ['test_isolation_mode != "noop"',
+          {
+            'targets': [
+              {
+                'target_name': 'ui_base_unittests_apk_run',
+                'type': 'none',
+                'dependencies': [
+                  'ui_base_unittests_apk',
+                ],
+                'includes': [
+                  '../../build/isolate.gypi',
+                ],
+                'sources': [
+                  'ui_base_unittests_apk.isolate',
+                ],
+              },
+            ],
+          },
+        ],
+      ],
     }],
-    ['test_isolation_mode != "noop"', {
+    ['test_isolation_mode != "noop" and OS != "android"', {
       'targets': [
         {
           'target_name': 'ui_base_unittests_run',
diff --git a/ui/base/ui_base_unittests_apk.isolate b/ui/base/ui_base_unittests_apk.isolate
new file mode 100644
index 0000000..e96e056
--- /dev/null
+++ b/ui/base/ui_base_unittests_apk.isolate
@@ -0,0 +1,20 @@
+# 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.
+{
+  'includes': [
+    '../../build/android/android.isolate',
+    'ui_base_tests.isolate'
+  ],
+  'variables': {
+    'command': [
+      '<(PRODUCT_DIR)/bin/run_ui_base_unittests',
+    ],
+    'files': [
+      '../../third_party/icu/icu.isolate'
+      '<(PRODUCT_DIR)/bin/run_ui_base_unittests',
+      '<(PRODUCT_DIR)/ui_base_unittests_apk/',
+      'ui_base_tests.isolate',
+    ]
+  },
+}
diff --git a/ui/compositor/BUILD.gn b/ui/compositor/BUILD.gn
index e5585d8..1de41c6a 100644
--- a/ui/compositor/BUILD.gn
+++ b/ui/compositor/BUILD.gn
@@ -7,6 +7,8 @@
 
 component("compositor") {
   sources = [
+    "callback_layer_animation_observer.cc",
+    "callback_layer_animation_observer.h",
     "canvas_painter.cc",
     "canvas_painter.h",
     "clip_transform_recorder.cc",
@@ -102,6 +104,8 @@
     "test/in_process_context_factory.h",
     "test/in_process_context_provider.cc",
     "test/in_process_context_provider.h",
+    "test/layer_animation_observer_test_api.cc",
+    "test/layer_animation_observer_test_api.h",
     "test/layer_animator_test_controller.cc",
     "test/layer_animator_test_controller.h",
     "test/test_compositor_host.h",
@@ -164,6 +168,7 @@
 
   test("compositor_unittests") {
     sources = [
+      "callback_layer_animation_observer_unittest.cc",
       "compositor_unittest.cc",
       "layer_animation_element_unittest.cc",
       "layer_animation_sequence_unittest.cc",
diff --git a/ui/compositor/callback_layer_animation_observer.cc b/ui/compositor/callback_layer_animation_observer.cc
new file mode 100644
index 0000000..305bce6
--- /dev/null
+++ b/ui/compositor/callback_layer_animation_observer.cc
@@ -0,0 +1,115 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "ui/compositor/callback_layer_animation_observer.h"
+
+#include "ui/compositor/layer_animation_sequence.h"
+
+namespace ui {
+
+CallbackLayerAnimationObserver::CallbackLayerAnimationObserver(
+    AnimationStartedCallback animation_started_callback,
+    AnimationEndedCallback animation_ended_callback)
+    : active_(false),
+      attached_sequence_count_(0),
+      detached_sequence_count_(0),
+      started_count_(0),
+      aborted_count_(0),
+      successful_count_(0),
+      animation_started_callback_(animation_started_callback),
+      animation_ended_callback_(animation_ended_callback),
+      destroyed_(nullptr) {}
+
+CallbackLayerAnimationObserver::~CallbackLayerAnimationObserver() {
+  if (destroyed_)
+    *destroyed_ = true;
+}
+
+void CallbackLayerAnimationObserver::SetActive() {
+  active_ = true;
+
+  bool destroyed = false;
+  destroyed_ = &destroyed;
+
+  CheckAllSequencesStarted();
+
+  if (destroyed)
+    return;
+  destroyed_ = nullptr;
+
+  CheckAllSequencesCompleted();
+}
+
+void CallbackLayerAnimationObserver::OnLayerAnimationStarted(
+    ui::LayerAnimationSequence* sequence) {
+  CHECK_LT(started_count_, attached_sequence_count_);
+  ++started_count_;
+  CheckAllSequencesStarted();
+}
+
+void CallbackLayerAnimationObserver::OnLayerAnimationEnded(
+    ui::LayerAnimationSequence* sequence) {
+  CHECK_LT(GetNumSequencesCompleted(), attached_sequence_count_);
+  ++successful_count_;
+  CheckAllSequencesCompleted();
+}
+
+void CallbackLayerAnimationObserver::OnLayerAnimationAborted(
+    ui::LayerAnimationSequence* sequence) {
+  CHECK_LT(GetNumSequencesCompleted(), attached_sequence_count_);
+  ++aborted_count_;
+  CheckAllSequencesCompleted();
+}
+
+void CallbackLayerAnimationObserver::OnLayerAnimationScheduled(
+    ui::LayerAnimationSequence* sequence) {}
+
+bool CallbackLayerAnimationObserver::RequiresNotificationWhenAnimatorDestroyed()
+    const {
+  return true;
+}
+
+void CallbackLayerAnimationObserver::OnAttachedToSequence(
+    ui::LayerAnimationSequence* sequence) {
+  ++attached_sequence_count_;
+}
+
+void CallbackLayerAnimationObserver::OnDetachedFromSequence(
+    ui::LayerAnimationSequence* sequence) {
+  CHECK_LT(detached_sequence_count_, attached_sequence_count_);
+  ++detached_sequence_count_;
+}
+
+int CallbackLayerAnimationObserver::GetNumSequencesCompleted() {
+  return aborted_count_ + successful_count_;
+}
+
+void CallbackLayerAnimationObserver::CheckAllSequencesStarted() {
+  if (active_ && attached_sequence_count_ == started_count_)
+    animation_started_callback_.Run(*this);
+}
+
+void CallbackLayerAnimationObserver::CheckAllSequencesCompleted() {
+  if (active_ && GetNumSequencesCompleted() == attached_sequence_count_) {
+    active_ = false;
+    bool destroyed = false;
+    destroyed_ = &destroyed;
+
+    bool should_delete = animation_ended_callback_.Run(*this);
+
+    if (destroyed) {
+      if (should_delete)
+        LOG(WARNING) << "CallbackLayerAnimationObserver was explicitly "
+                        "destroyed AND was requested to be destroyed via the "
+                        "AnimationEndedCallback's return value.";
+      return;
+    }
+    destroyed_ = nullptr;
+
+    if (should_delete)
+      delete this;
+  }
+}
+
+}  // namespace ui
diff --git a/ui/compositor/callback_layer_animation_observer.h b/ui/compositor/callback_layer_animation_observer.h
new file mode 100644
index 0000000..236f1a2
--- /dev/null
+++ b/ui/compositor/callback_layer_animation_observer.h
@@ -0,0 +1,143 @@
+// 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 UI_COMPOSITOR_CALLBACK_LAYER_ANIMATION_OBSERVER_H_
+#define UI_COMPOSITOR_CALLBACK_LAYER_ANIMATION_OBSERVER_H_
+
+#include "base/callback.h"
+#include "ui/compositor/compositor_export.h"
+#include "ui/compositor/layer_animation_observer.h"
+
+namespace ui {
+
+class LayerAnimationSequence;
+
+// A LayerAnimationObserver that invokes a Callback when all observed
+// LayerAnimationSequence's have started and finished.
+//
+// Example usage:
+//  class Foobar {
+//    // The Callback that will be invoked when all the animation sequences have
+//    // started.
+//    void AnimationStartedCallback(
+//        const CallbackLayerAnimationObserver& observer) {
+//      // Do stuff.
+//    }
+//
+//    // The Callback that will be invoked when all the animation sequences have
+//    // finished.
+//    bool AnimationEndedCallback(
+//        const CallbackLayerAnimationObserver& observer) {
+//      // Do stuff.
+//      return true;  // Returns true so that |observer| destroys itself.
+//    }
+//
+//    // Example method that uses the CallbackLayerAnimationObserver.
+//    void Animate() {
+//      ui::LayerAnimator* animator_1 = layer_1->GetAnimator();
+//      ui::LayerAnimator* animator_2 = layer_2->GetAnimator();
+//      CallbackLayerAnimationObserver* observer =
+//          new CallbackLayerAnimationObserver(
+//              base::Bind(&Foobar::AnimationStartedCallback),
+//              base::Unretained(this));
+//              base::Bind(&Foobar::AnimationEndedCallback),
+//              base::Unretained(this));
+//      animator_1->AddObserver(observer);
+//      animator_2->AddObserver(observer);
+//
+//      // Set up animation sequences on |animator_1| and |animator_2|.
+//
+//      // The callback won't be invoked until SetActive() is called.
+//      observer->SetActive();
+//    }
+//  }
+//
+// TODO(bruthig): Unify the CallbackLayerAnimationObserver with the
+// ImplicitAnimationObserver. (See www.crbug.com/542825).
+class COMPOSITOR_EXPORT CallbackLayerAnimationObserver
+    : public ui::LayerAnimationObserver {
+ public:
+  // The Callback type that will be invoked when all animation sequences have
+  // been started.
+  typedef base::Callback<void(const CallbackLayerAnimationObserver&)>
+      AnimationStartedCallback;
+
+  // The Callback type that will be invoked when all animation sequences have
+  // finished. |this| will be destroyed after invoking the Callback if it
+  // returns true.
+  typedef base::Callback<bool(const CallbackLayerAnimationObserver&)>
+      AnimationEndedCallback;
+
+  CallbackLayerAnimationObserver(
+      AnimationStartedCallback animation_started_callback,
+      AnimationEndedCallback animation_ended_callback);
+  ~CallbackLayerAnimationObserver() override;
+
+  bool active() const { return active_; }
+
+  // The callbacks will not be invoked until SetActive() has been called. This
+  // allows each sequence to be attached before checking if the sequences have
+  // finished.
+  void SetActive();
+
+  int aborted_count() const { return aborted_count_; }
+  int successful_count() const { return successful_count_; }
+
+  // ui::LayerAnimationObserver:
+  void OnLayerAnimationStarted(ui::LayerAnimationSequence* sequence) override;
+  void OnLayerAnimationEnded(ui::LayerAnimationSequence* sequence) override;
+  void OnLayerAnimationAborted(ui::LayerAnimationSequence* sequence) override;
+  void OnLayerAnimationScheduled(ui::LayerAnimationSequence* sequence) override;
+
+ protected:
+  // ui::LayerAnimationObserver:
+  bool RequiresNotificationWhenAnimatorDestroyed() const override;
+  void OnAttachedToSequence(ui::LayerAnimationSequence* sequence) override;
+  void OnDetachedFromSequence(ui::LayerAnimationSequence* sequence) override;
+
+ private:
+  int GetNumSequencesCompleted();
+
+  // Checks if all attached sequences have been started and invokes
+  // |animation_started_callback_| if |active_| is true.
+  void CheckAllSequencesStarted();
+
+  // Checks if all attached sequences have completed and invokes
+  // |animation_ended_callback_| if |active_| is true.
+  void CheckAllSequencesCompleted();
+
+  // Allows the callbacks to be invoked when true.
+  bool active_;
+
+  // The total number of animation sequences that have been attached.
+  int attached_sequence_count_;
+
+  // The total number of animation sequences that have been detached.
+  int detached_sequence_count_;
+
+  // The number of animation sequences that have been started.
+  int started_count_;
+
+  // The number of animation sequences that were aborted.
+  int aborted_count_;
+
+  // The number of animation sequences that completed successfully.
+  int successful_count_;
+
+  // The callback to invoke once all the animation sequences have been started.
+  AnimationStartedCallback animation_started_callback_;
+
+  // The callback to invoke once all the animation sequences have finished.
+  AnimationEndedCallback animation_ended_callback_;
+
+  // Set to true in the destructor (if non-NULL). Used to detect deletion while
+  // calling out.
+  bool* destroyed_;
+
+  DISALLOW_COPY_AND_ASSIGN(CallbackLayerAnimationObserver);
+};
+
+}  // namespace ui
+
+#endif  // UI_COMPOSITOR_CALLBACK_LAYER_ANIMATION_OBSERVER_H_
diff --git a/ui/compositor/callback_layer_animation_observer_unittest.cc b/ui/compositor/callback_layer_animation_observer_unittest.cc
new file mode 100644
index 0000000..b5d708fb
--- /dev/null
+++ b/ui/compositor/callback_layer_animation_observer_unittest.cc
@@ -0,0 +1,522 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "ui/compositor/callback_layer_animation_observer.h"
+
+#include "base/bind.h"
+#include "base/macros.h"
+#include "base/memory/scoped_vector.h"
+#include "testing/gtest/include/gtest/gtest.h"
+#include "ui/compositor/layer_animation_sequence.h"
+#include "ui/compositor/test/layer_animation_observer_test_api.h"
+
+namespace ui {
+namespace test {
+
+// Simple class that tracks whether callbacks were invoked and when.
+class TestCallbacks {
+ public:
+  TestCallbacks();
+  virtual ~TestCallbacks();
+
+  void ResetCallbackObservations();
+
+  void set_should_delete_observer_on_animations_ended(
+      bool should_delete_observer_on_animations_ended) {
+    should_delete_observer_on_animations_ended_ =
+        should_delete_observer_on_animations_ended;
+  }
+
+  bool animations_started() const { return animations_started_; }
+
+  bool animations_ended() const { return animations_ended_; }
+
+  virtual void AnimationsStarted(const CallbackLayerAnimationObserver&);
+
+  virtual bool AnimationsEnded(const CallbackLayerAnimationObserver&);
+
+  testing::AssertionResult StartedEpochIsBeforeEndedEpoch();
+
+ private:
+  // Monotonic counter that tracks the next time snapshot.
+  int next_epoch_ = 0;
+
+  // Is true when AnimationsStarted() has been called.
+  bool animations_started_ = false;
+
+  // Relative time snapshot of when AnimationsStarted() was last called.
+  int animations_started_epoch_ = -1;
+
+  // Is true when AnimationsEnded() has been called.
+  bool animations_ended_ = false;
+
+  // Relative time snapshot of when AnimationsEnded() was last called.
+  int animations_ended_epoch_ = -1;
+
+  // The return value for AnimationsEnded().
+  bool should_delete_observer_on_animations_ended_ = false;
+
+  DISALLOW_COPY_AND_ASSIGN(TestCallbacks);
+};
+
+TestCallbacks::TestCallbacks() {}
+
+TestCallbacks::~TestCallbacks() {}
+
+void TestCallbacks::ResetCallbackObservations() {
+  next_epoch_ = 0;
+  animations_started_ = false;
+  animations_started_epoch_ = -1;
+  animations_ended_ = false;
+  animations_ended_epoch_ = -1;
+  should_delete_observer_on_animations_ended_ = false;
+}
+
+void TestCallbacks::AnimationsStarted(const CallbackLayerAnimationObserver&) {
+  animations_started_ = true;
+  animations_started_epoch_ = next_epoch_++;
+}
+
+bool TestCallbacks::AnimationsEnded(const CallbackLayerAnimationObserver&) {
+  animations_ended_ = true;
+  animations_ended_epoch_ = next_epoch_++;
+  return should_delete_observer_on_animations_ended_;
+}
+
+testing::AssertionResult TestCallbacks::StartedEpochIsBeforeEndedEpoch() {
+  if (animations_started_epoch_ < animations_ended_epoch_) {
+    return testing::AssertionSuccess();
+  } else {
+    return testing::AssertionFailure()
+           << "The started epoch=" << animations_started_epoch_
+           << " is NOT before the ended epoch=" << animations_ended_epoch_;
+  }
+}
+
+// A child of TestCallbacks that can explicitly delete a
+// CallbackLayerAnimationObserver in the AnimationsStarted() or
+// AnimationsEnded() callback.
+class TestCallbacksThatExplicitlyDeletesObserver : public TestCallbacks {
+ public:
+  TestCallbacksThatExplicitlyDeletesObserver();
+
+  void set_observer_to_delete_in_animation_started(
+      CallbackLayerAnimationObserver* observer) {
+    observer_to_delete_in_animation_started_ = observer;
+  }
+
+  void set_observer_to_delete_in_animation_ended(
+      CallbackLayerAnimationObserver* observer) {
+    observer_to_delete_in_animation_ended_ = observer;
+  }
+
+  // TestCallbacks:
+  void AnimationsStarted(
+      const CallbackLayerAnimationObserver& observer) override;
+  bool AnimationsEnded(const CallbackLayerAnimationObserver& observer) override;
+
+ private:
+  // The observer to delete, if non-NULL, in AnimationsStarted().
+  CallbackLayerAnimationObserver* observer_to_delete_in_animation_started_ =
+      nullptr;
+
+  // The observer to delete, if non-NULL, in AnimationsEnded().
+  CallbackLayerAnimationObserver* observer_to_delete_in_animation_ended_ =
+      nullptr;
+
+  DISALLOW_COPY_AND_ASSIGN(TestCallbacksThatExplicitlyDeletesObserver);
+};
+
+TestCallbacksThatExplicitlyDeletesObserver::
+    TestCallbacksThatExplicitlyDeletesObserver() {}
+
+void TestCallbacksThatExplicitlyDeletesObserver::AnimationsStarted(
+    const CallbackLayerAnimationObserver& observer) {
+  if (observer_to_delete_in_animation_started_)
+    delete observer_to_delete_in_animation_started_;
+  TestCallbacks::AnimationsStarted(observer);
+}
+
+bool TestCallbacksThatExplicitlyDeletesObserver::AnimationsEnded(
+    const CallbackLayerAnimationObserver& observer) {
+  if (observer_to_delete_in_animation_ended_)
+    delete observer_to_delete_in_animation_ended_;
+  return TestCallbacks::AnimationsEnded(observer);
+}
+
+// A test specific CallbackLayerAnimationObserver that will set a bool when
+// destroyed.
+class TestCallbackLayerAnimationObserver
+    : public CallbackLayerAnimationObserver {
+ public:
+  TestCallbackLayerAnimationObserver(
+      AnimationStartedCallback animation_started_callback,
+      AnimationEndedCallback animation_ended_callback,
+      bool* destroyed);
+  ~TestCallbackLayerAnimationObserver() override;
+
+ private:
+  bool* destroyed_;
+
+  DISALLOW_COPY_AND_ASSIGN(TestCallbackLayerAnimationObserver);
+};
+
+TestCallbackLayerAnimationObserver::TestCallbackLayerAnimationObserver(
+    AnimationStartedCallback animation_started_callback,
+    AnimationEndedCallback animation_ended_callback,
+    bool* destroyed)
+    : CallbackLayerAnimationObserver(animation_started_callback,
+                                     animation_ended_callback),
+      destroyed_(destroyed) {
+  (*destroyed_) = false;
+}
+
+TestCallbackLayerAnimationObserver::~TestCallbackLayerAnimationObserver() {
+  (*destroyed_) = true;
+}
+
+class CallbackLayerAnimationObserverTest : public testing::Test {
+ public:
+  CallbackLayerAnimationObserverTest();
+  ~CallbackLayerAnimationObserverTest() override;
+
+ protected:
+  // Creates a LayerAnimationSequence.  The lifetime of the sequence will be
+  // managed by this.
+  LayerAnimationSequence* CreateLayerAnimationSequence();
+
+  scoped_ptr<TestCallbacks> callbacks_;
+
+  scoped_ptr<CallbackLayerAnimationObserver> observer_;
+
+  scoped_ptr<LayerAnimationObserverTestApi> observer_test_api_;
+
+  // List of managaged sequences created by CreateLayerAnimationSequence() that
+  // need to be destroyed.
+  ScopedVector<LayerAnimationSequence> sequences_;
+
+ private:
+  DISALLOW_COPY_AND_ASSIGN(CallbackLayerAnimationObserverTest);
+};
+
+CallbackLayerAnimationObserverTest::CallbackLayerAnimationObserverTest()
+    : callbacks_(new TestCallbacks()),
+      observer_(new CallbackLayerAnimationObserver(
+          base::Bind(&TestCallbacks::AnimationsStarted,
+                     base::Unretained(callbacks_.get())),
+          base::Bind(&TestCallbacks::AnimationsEnded,
+                     base::Unretained(callbacks_.get())))),
+      observer_test_api_(new LayerAnimationObserverTestApi(observer_.get())) {}
+
+CallbackLayerAnimationObserverTest::~CallbackLayerAnimationObserverTest() {
+  observer_test_api_.reset();
+  // The |observer_| will detach from all attached sequences upon destruction so
+  // we need to explicitly delete the |observer_| before the |sequences_| and
+  // |callbacks_|.
+  observer_.reset();
+}
+
+LayerAnimationSequence*
+CallbackLayerAnimationObserverTest::CreateLayerAnimationSequence() {
+  LayerAnimationSequence* sequence = new LayerAnimationSequence();
+  sequences_.push_back(sequence);
+  return sequence;
+}
+
+TEST_F(CallbackLayerAnimationObserverTest, VerifyInitialState) {
+  EXPECT_FALSE(observer_->active());
+  EXPECT_EQ(0, observer_->aborted_count());
+  EXPECT_EQ(0, observer_->successful_count());
+
+  EXPECT_FALSE(callbacks_->animations_started());
+  EXPECT_FALSE(callbacks_->animations_ended());
+}
+
+TEST(CallbackLayerAnimationObserverDestructionTest,
+     AnimationEndedReturnsFalse) {
+  TestCallbacks callbacks;
+  callbacks.set_should_delete_observer_on_animations_ended(false);
+
+  bool is_destroyed = false;
+
+  TestCallbackLayerAnimationObserver* observer =
+      new TestCallbackLayerAnimationObserver(
+          base::Bind(&TestCallbacks::AnimationsStarted,
+                     base::Unretained(&callbacks)),
+          base::Bind(&TestCallbacks::AnimationsEnded,
+                     base::Unretained(&callbacks)),
+          &is_destroyed);
+  observer->SetActive();
+
+  EXPECT_FALSE(is_destroyed);
+  delete observer;
+}
+
+TEST(CallbackLayerAnimationObserverDestructionTest, AnimationEndedReturnsTrue) {
+  TestCallbacks callbacks;
+  callbacks.set_should_delete_observer_on_animations_ended(true);
+
+  bool is_destroyed = false;
+
+  TestCallbackLayerAnimationObserver* observer =
+      new TestCallbackLayerAnimationObserver(
+          base::Bind(&TestCallbacks::AnimationsStarted,
+                     base::Unretained(&callbacks)),
+          base::Bind(&TestCallbacks::AnimationsEnded,
+                     base::Unretained(&callbacks)),
+          &is_destroyed);
+  observer->SetActive();
+
+  EXPECT_TRUE(is_destroyed);
+}
+
+// Verifies that the CallbackLayerAnimationObserver is robust to explicit
+// deletes caused as a side effect of calling the AnimationsStartedCallback()
+// when there are no animation sequences attached. This test also guards against
+// heap-use-after-free errors.
+TEST_F(
+    CallbackLayerAnimationObserverTest,
+    ExplicitlyDeleteObserverInAnimationStartedCallbackWithNoSequencesAttached) {
+  TestCallbacksThatExplicitlyDeletesObserver callbacks;
+  callbacks.set_should_delete_observer_on_animations_ended(true);
+
+  bool is_destroyed = false;
+
+  TestCallbackLayerAnimationObserver* observer =
+      new TestCallbackLayerAnimationObserver(
+          base::Bind(&TestCallbacks::AnimationsStarted,
+                     base::Unretained(&callbacks)),
+          base::Bind(&TestCallbacks::AnimationsEnded,
+                     base::Unretained(&callbacks)),
+          &is_destroyed);
+
+  callbacks.set_observer_to_delete_in_animation_started(observer);
+
+  observer->SetActive();
+
+  EXPECT_TRUE(is_destroyed);
+}
+
+// Verifies that the CallbackLayerAnimationObserver is robust to explicit
+// deletes caused as a side effect of calling the AnimationsStartedCallback()
+// when there are some animation sequences attached. This test also guards
+// against heap-use-after-free errors.
+TEST_F(
+    CallbackLayerAnimationObserverTest,
+    ExplicitlyDeleteObserverInAnimationStartedCallbackWithSomeSequencesAttached) {
+  LayerAnimationSequence* sequence_1 = CreateLayerAnimationSequence();
+  LayerAnimationSequence* sequence_2 = CreateLayerAnimationSequence();
+
+  TestCallbacksThatExplicitlyDeletesObserver callbacks;
+  callbacks.set_should_delete_observer_on_animations_ended(true);
+
+  bool is_destroyed = false;
+
+  TestCallbackLayerAnimationObserver* observer =
+      new TestCallbackLayerAnimationObserver(
+          base::Bind(&TestCallbacks::AnimationsStarted,
+                     base::Unretained(&callbacks)),
+          base::Bind(&TestCallbacks::AnimationsEnded,
+                     base::Unretained(&callbacks)),
+          &is_destroyed);
+
+  observer_test_api_->AttachedToSequence(sequence_1);
+  observer_test_api_->AttachedToSequence(sequence_2);
+  observer_->OnLayerAnimationStarted(sequence_1);
+  observer_->OnLayerAnimationStarted(sequence_2);
+
+  callbacks.set_observer_to_delete_in_animation_started(observer);
+
+  observer->SetActive();
+
+  EXPECT_TRUE(is_destroyed);
+}
+
+// Verifies that a 'true' return value for AnimationEndedCallback is ignored if
+// the CallbackLayerAnimationObserver is explicitly deleted as a side effect of
+// calling the AnimationEndedCallback. This test also guards against
+// heap-use-after-free errors.
+TEST_F(CallbackLayerAnimationObserverTest,
+       IgnoreTrueReturnValueForAnimationEndedCallbackIfExplicitlyDeleted) {
+  TestCallbacksThatExplicitlyDeletesObserver callbacks;
+  callbacks.set_should_delete_observer_on_animations_ended(true);
+
+  bool is_destroyed = false;
+
+  TestCallbackLayerAnimationObserver* observer =
+      new TestCallbackLayerAnimationObserver(
+          base::Bind(&TestCallbacks::AnimationsStarted,
+                     base::Unretained(&callbacks)),
+          base::Bind(&TestCallbacks::AnimationsEnded,
+                     base::Unretained(&callbacks)),
+          &is_destroyed);
+
+  callbacks.set_observer_to_delete_in_animation_ended(observer);
+
+  observer->SetActive();
+
+  EXPECT_TRUE(is_destroyed);
+}
+
+TEST_F(CallbackLayerAnimationObserverTest,
+       SetActiveWhenNoSequencesWereAttached) {
+  observer_->SetActive();
+
+  EXPECT_FALSE(observer_->active());
+  EXPECT_TRUE(callbacks_->animations_started());
+  EXPECT_TRUE(callbacks_->animations_ended());
+  EXPECT_TRUE(callbacks_->StartedEpochIsBeforeEndedEpoch());
+}
+
+TEST_F(CallbackLayerAnimationObserverTest,
+       SetActiveWhenAllSequencesAreAttachedButNoneWereStarted) {
+  LayerAnimationSequence* sequence_1 = CreateLayerAnimationSequence();
+  LayerAnimationSequence* sequence_2 = CreateLayerAnimationSequence();
+
+  observer_test_api_->AttachedToSequence(sequence_1);
+  observer_test_api_->AttachedToSequence(sequence_2);
+
+  observer_->SetActive();
+
+  EXPECT_TRUE(observer_->active());
+  EXPECT_FALSE(callbacks_->animations_started());
+  EXPECT_FALSE(callbacks_->animations_ended());
+}
+
+TEST_F(CallbackLayerAnimationObserverTest,
+       SetActiveWhenAllSequencesAreAttachedAndOnlySomeWereStarted) {
+  LayerAnimationSequence* sequence_1 = CreateLayerAnimationSequence();
+  LayerAnimationSequence* sequence_2 = CreateLayerAnimationSequence();
+
+  observer_test_api_->AttachedToSequence(sequence_1);
+  observer_test_api_->AttachedToSequence(sequence_2);
+  observer_->OnLayerAnimationStarted(sequence_1);
+
+  observer_->SetActive();
+
+  EXPECT_TRUE(observer_->active());
+  EXPECT_FALSE(callbacks_->animations_started());
+  EXPECT_FALSE(callbacks_->animations_ended());
+}
+
+TEST_F(CallbackLayerAnimationObserverTest,
+       SetActiveWhenAllSequencesAreAttachedAndOnlySomeWereCompleted) {
+  LayerAnimationSequence* sequence_1 = CreateLayerAnimationSequence();
+  LayerAnimationSequence* sequence_2 = CreateLayerAnimationSequence();
+
+  observer_test_api_->AttachedToSequence(sequence_1);
+  observer_test_api_->AttachedToSequence(sequence_2);
+  observer_->OnLayerAnimationStarted(sequence_1);
+  observer_->OnLayerAnimationEnded(sequence_1);
+
+  observer_->SetActive();
+
+  EXPECT_TRUE(observer_->active());
+  EXPECT_FALSE(callbacks_->animations_started());
+  EXPECT_FALSE(callbacks_->animations_ended());
+}
+
+TEST_F(CallbackLayerAnimationObserverTest,
+       SetActiveAfterAllSequencesWereStartedButNoneWereCompleted) {
+  LayerAnimationSequence* sequence_1 = CreateLayerAnimationSequence();
+  LayerAnimationSequence* sequence_2 = CreateLayerAnimationSequence();
+
+  observer_test_api_->AttachedToSequence(sequence_1);
+  observer_test_api_->AttachedToSequence(sequence_2);
+  observer_->OnLayerAnimationStarted(sequence_1);
+  observer_->OnLayerAnimationStarted(sequence_2);
+
+  observer_->SetActive();
+
+  EXPECT_TRUE(observer_->active());
+  EXPECT_TRUE(callbacks_->animations_started());
+  EXPECT_FALSE(callbacks_->animations_ended());
+}
+
+TEST_F(CallbackLayerAnimationObserverTest,
+       SetActiveWhenAllSequencesAreStartedAndOnlySomeWereCompleted) {
+  LayerAnimationSequence* sequence_1 = CreateLayerAnimationSequence();
+  LayerAnimationSequence* sequence_2 = CreateLayerAnimationSequence();
+
+  observer_test_api_->AttachedToSequence(sequence_1);
+  observer_test_api_->AttachedToSequence(sequence_2);
+  observer_->OnLayerAnimationStarted(sequence_1);
+  observer_->OnLayerAnimationStarted(sequence_2);
+  observer_->OnLayerAnimationEnded(sequence_1);
+
+  observer_->SetActive();
+
+  EXPECT_TRUE(observer_->active());
+  EXPECT_TRUE(callbacks_->animations_started());
+  EXPECT_FALSE(callbacks_->animations_ended());
+}
+
+TEST_F(CallbackLayerAnimationObserverTest,
+       SetActiveWhenAllSequencesWereCompleted) {
+  LayerAnimationSequence* sequence_1 = CreateLayerAnimationSequence();
+  LayerAnimationSequence* sequence_2 = CreateLayerAnimationSequence();
+
+  observer_test_api_->AttachedToSequence(sequence_1);
+  observer_test_api_->AttachedToSequence(sequence_2);
+  observer_->OnLayerAnimationStarted(sequence_1);
+  observer_->OnLayerAnimationStarted(sequence_2);
+  observer_->OnLayerAnimationEnded(sequence_1);
+  observer_->OnLayerAnimationEnded(sequence_2);
+
+  observer_->SetActive();
+
+  EXPECT_FALSE(observer_->active());
+  EXPECT_TRUE(callbacks_->animations_started());
+  EXPECT_TRUE(callbacks_->animations_ended());
+}
+
+TEST_F(CallbackLayerAnimationObserverTest,
+       SetActiveAgainAfterAllSequencesWereCompleted) {
+  LayerAnimationSequence* sequence_1 = CreateLayerAnimationSequence();
+  LayerAnimationSequence* sequence_2 = CreateLayerAnimationSequence();
+  LayerAnimationSequence* sequence_3 = CreateLayerAnimationSequence();
+  LayerAnimationSequence* sequence_4 = CreateLayerAnimationSequence();
+
+  observer_test_api_->AttachedToSequence(sequence_1);
+  observer_test_api_->AttachedToSequence(sequence_2);
+  observer_->OnLayerAnimationStarted(sequence_1);
+  observer_->OnLayerAnimationStarted(sequence_2);
+  observer_->OnLayerAnimationEnded(sequence_1);
+  observer_->OnLayerAnimationEnded(sequence_2);
+
+  observer_->SetActive();
+
+  EXPECT_FALSE(observer_->active());
+
+  observer_test_api_->AttachedToSequence(sequence_3);
+  observer_test_api_->AttachedToSequence(sequence_4);
+
+  callbacks_->ResetCallbackObservations();
+
+  observer_->SetActive();
+
+  EXPECT_TRUE(observer_->active());
+  EXPECT_FALSE(callbacks_->animations_started());
+  EXPECT_FALSE(callbacks_->animations_ended());
+  EXPECT_EQ(2, observer_->successful_count());
+
+  observer_->OnLayerAnimationStarted(sequence_3);
+  observer_->OnLayerAnimationStarted(sequence_4);
+
+  EXPECT_TRUE(observer_->active());
+  EXPECT_TRUE(callbacks_->animations_started());
+  EXPECT_FALSE(callbacks_->animations_ended());
+  EXPECT_EQ(2, observer_->successful_count());
+
+  observer_->OnLayerAnimationEnded(sequence_3);
+  observer_->OnLayerAnimationEnded(sequence_4);
+
+  EXPECT_FALSE(observer_->active());
+  EXPECT_TRUE(callbacks_->animations_started());
+  EXPECT_TRUE(callbacks_->animations_ended());
+  EXPECT_EQ(4, observer_->successful_count());
+}
+
+}  // namespace test
+}  // namespace ui
diff --git a/ui/compositor/compositor.gyp b/ui/compositor/compositor.gyp
index c6890f9..ebb71a8 100644
--- a/ui/compositor/compositor.gyp
+++ b/ui/compositor/compositor.gyp
@@ -25,6 +25,8 @@
         'COMPOSITOR_IMPLEMENTATION',
       ],
       'sources': [
+        'callback_layer_animation_observer.cc',
+        'callback_layer_animation_observer.h',
         'canvas_painter.cc',
         'canvas_painter.h',
         'clip_transform_recorder.cc',
@@ -120,6 +122,8 @@
         'test/in_process_context_factory.h',
         'test/in_process_context_provider.cc',
         'test/in_process_context_provider.h',
+        'test/layer_animation_observer_test_api.cc',
+        'test/layer_animation_observer_test_api.h',
         'test/layer_animator_test_controller.cc',
         'test/layer_animator_test_controller.h',
         'test/test_compositor_host.h',
@@ -167,6 +171,7 @@
         'compositor_test_support',
       ],
       'sources': [
+        'callback_layer_animation_observer_unittest.cc',
         'compositor_unittest.cc',
         'layer_animation_element_unittest.cc',
         'layer_animation_sequence_unittest.cc',
diff --git a/ui/compositor/layer_animation_observer.h b/ui/compositor/layer_animation_observer.h
index 26bfdfa..01486cc 100644
--- a/ui/compositor/layer_animation_observer.h
+++ b/ui/compositor/layer_animation_observer.h
@@ -15,6 +15,10 @@
 
 namespace ui {
 
+namespace test {
+class LayerAnimationObserverTestApi;
+}  // namespace test
+
 class LayerAnimationSequence;
 class ScopedLayerAnimationSettings;
 class ImplicitAnimationObserver;
@@ -44,11 +48,23 @@
   LayerAnimationObserver();
   virtual ~LayerAnimationObserver();
 
-  // If the animator is destroyed during an animation, the animations are
+  // If the LayerAnimator is destroyed during an animation, the animations are
   // aborted. The resulting NotifyAborted notifications will NOT be sent to
-  // this observer if this function returns false. NOTE: IF YOU override THIS
-  // FUNCTION TO RETURN TRUE, YOU MUST REMEMBER TO REMOVE YOURSELF AS AN
-  // OBSERVER WHEN YOU ARE DESTROYED.
+  // this observer if this function returns false. An observer who wants to
+  // receive the NotifyAborted notifications during destruction can override
+  // this function to return true.
+  //
+  // *** IMPORTANT ***: If a class overrides this function to return true and
+  // that class is a direct or indirect owner of the LayerAnimationSequence
+  // being observed, then the class must explicitly remove itself as an
+  // observer during destruction of the LayerAnimationObserver! This is to
+  // ensure that a partially destroyed observer isn't notified with an
+  // OnLayerAnimationAborted() call when the LayerAnimator is destroyed.
+  //
+  // This opt-in pattern is used because it is common for a class to be the
+  // observer of a LayerAnimationSequence that it owns indirectly because it
+  // owns the Layer which owns the LayerAnimator which owns the
+  // LayerAnimationSequence.
   virtual bool RequiresNotificationWhenAnimatorDestroyed() const;
 
   // Called when |this| is added to |sequence|'s observer list.
@@ -66,6 +82,7 @@
 
  private:
   friend class LayerAnimationSequence;
+  friend class test::LayerAnimationObserverTestApi;
 
   // Called when |this| is added to |sequence|'s observer list.
   void AttachedToSequence(LayerAnimationSequence* sequence);
@@ -81,6 +98,8 @@
 // An implicit animation observer is intended to be used in conjunction with a
 // ScopedLayerAnimationSettings object in order to receive a notification when
 // all implicit animations complete.
+// TODO(bruthig): Unify the ImplicitAnimationObserver with the
+// CallbackLayerAnimationObserver. (See www.crbug.com/542825).
 class COMPOSITOR_EXPORT ImplicitAnimationObserver
     : public LayerAnimationObserver {
  public:
diff --git a/ui/compositor/test/layer_animation_observer_test_api.cc b/ui/compositor/test/layer_animation_observer_test_api.cc
new file mode 100644
index 0000000..92f87679
--- /dev/null
+++ b/ui/compositor/test/layer_animation_observer_test_api.cc
@@ -0,0 +1,26 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "ui/compositor/test/layer_animation_observer_test_api.h"
+
+namespace ui {
+namespace test {
+
+LayerAnimationObserverTestApi::LayerAnimationObserverTestApi(
+    LayerAnimationObserver* observer)
+    : observer_(observer) {}
+
+void LayerAnimationObserverTestApi::AttachedToSequence(
+    LayerAnimationSequence* sequence) {
+  observer_->AttachedToSequence(sequence);
+}
+
+void LayerAnimationObserverTestApi::DetachedFromSequence(
+    LayerAnimationSequence* sequence,
+    bool send_notification) {
+  observer_->DetachedFromSequence(sequence, send_notification);
+}
+
+}  // namespace test
+}  // namespace ui
diff --git a/ui/compositor/test/layer_animation_observer_test_api.h b/ui/compositor/test/layer_animation_observer_test_api.h
new file mode 100644
index 0000000..7705275
--- /dev/null
+++ b/ui/compositor/test/layer_animation_observer_test_api.h
@@ -0,0 +1,34 @@
+// 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 UI_COMPOSITOR_TEST_LAYER_ANIMATION_OBSERVER_TEST_API_H_
+#define UI_COMPOSITOR_TEST_LAYER_ANIMATION_OBSERVER_TEST_API_H_
+
+#include "base/macros.h"
+#include "ui/compositor/layer_animation_observer.h"
+
+namespace ui {
+namespace test {
+
+// Test API to provide internal access to the LayerAnimationObserver class.
+class LayerAnimationObserverTestApi {
+ public:
+  explicit LayerAnimationObserverTestApi(LayerAnimationObserver* observer);
+
+  // Wrappers for LayerAnimationObserver.
+  void AttachedToSequence(LayerAnimationSequence* sequence);
+  void DetachedFromSequence(LayerAnimationSequence* sequence,
+                            bool send_notification);
+
+ private:
+  // The instance to provide internal access to.
+  LayerAnimationObserver* observer_;
+
+  DISALLOW_COPY_AND_ASSIGN(LayerAnimationObserverTestApi);
+};
+
+}  // namespace test
+}  // namespace ui
+
+#endif  // UI_COMPOSITOR_TEST_LAYER_ANIMATION_OBSERVER_TEST_API_H_
diff --git a/ui/file_manager/file_manager/background/js/test_util_base.js b/ui/file_manager/file_manager/background/js/test_util_base.js
index e2e0c04..2c82140 100644
--- a/ui/file_manager/file_manager/background/js/test_util_base.js
+++ b/ui/file_manager/file_manager/background/js/test_util_base.js
@@ -327,14 +327,19 @@
  * @param {string} targetQuery Query to specify the element.
  * @param {string} keyIdentifier Identifier of the emulated key.
  * @param {boolean} ctrl Whether CTRL should be pressed, or not.
+ * @param {boolean} shift whether SHIFT should be pressed, or not.
  * @param {string=} opt_iframeQuery Optional iframe selector.
  * @return {boolean} True if the event is sent to the target, false otherwise.
  */
 test.util.sync.fakeKeyDown = function(
-    contentWindow, targetQuery, keyIdentifier, ctrl, opt_iframeQuery) {
-  var event = new KeyboardEvent(
-      'keydown',
-      { bubbles: true, keyIdentifier: keyIdentifier, ctrlKey: ctrl });
+    contentWindow, targetQuery, keyIdentifier, ctrl, shift, opt_iframeQuery) {
+  var event = new KeyboardEvent('keydown',
+      {
+        bubbles: true,
+        keyIdentifier: keyIdentifier,
+        ctrlKey: ctrl,
+        shiftKey: shift
+      });
   return test.util.sync.sendEvent(
       contentWindow, targetQuery, event, opt_iframeQuery);
 };
diff --git a/ui/file_manager/file_manager/foreground/css/file_manager.css b/ui/file_manager/file_manager/foreground/css/file_manager.css
index 676430c7..25440c4 100644
--- a/ui/file_manager/file_manager/foreground/css/file_manager.css
+++ b/ui/file_manager/file_manager/foreground/css/file_manager.css
@@ -2305,26 +2305,3 @@
   right: 0;
   top: 0;
 }
-
-#tooltip {
-  opacity: 0;
-  padding: 4px 6px 0;
-  pointer-events: none;
-  position: absolute;
-  transition: opacity 300ms;
-  z-index: 1000;
-}
-
-#tooltip[visible] {
-  opacity: .9;
-}
-
-#tooltip-label {
-  background-color: #323232;
-  border-radius: 2px;
-  color: white;
-  font-size: 12px;
-  line-height: 28px;
-  padding: 0 14px;
-  white-space: nowrap;
-}
diff --git a/ui/file_manager/file_manager/foreground/elements/files_tooltip.html b/ui/file_manager/file_manager/foreground/elements/files_tooltip.html
new file mode 100644
index 0000000..7126931
--- /dev/null
+++ b/ui/file_manager/file_manager/foreground/elements/files_tooltip.html
@@ -0,0 +1,38 @@
+<!-- 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.
+  -->
+
+<link rel="import" href="chrome://resources/polymer/v1_0/polymer/polymer.html">
+
+<dom-module id="files-tooltip">
+  <style>
+    :host {
+      opacity: 0;
+      padding: 4px 6px 0;
+      pointer-events: none;
+      position: absolute;
+      transition: opacity 300ms;
+      z-index: 1000;
+    }
+
+    :host([visible]) {
+      opacity: .9;
+    }
+
+    :host > #label {
+      background-color: #323232;
+      border-radius: 2px;
+      color: white;
+      font-size: 12px;
+      line-height: 28px;
+      padding: 0 14px;
+      white-space: nowrap;
+    }
+  </style>
+  <template>
+    <div id="label"></div>
+  </template>
+</dom-module>
+
+<script src="files_tooltip.js"></script>
diff --git a/ui/file_manager/file_manager/foreground/elements/files_tooltip.js b/ui/file_manager/file_manager/foreground/elements/files_tooltip.js
new file mode 100644
index 0000000..0ef42da
--- /dev/null
+++ b/ui/file_manager/file_manager/foreground/elements/files_tooltip.js
@@ -0,0 +1,226 @@
+// 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.
+
+/**
+ * Files Tooltip.
+ *
+ * Adds target elements with addTarget or addTargets. Value of aria-label is
+ * used as a label of the tooltip.
+ *
+ * Usage:
+ * document.querySelector('files-tooltip').addTargets(
+ *     document.querySelectorAll('[has-tooltip]'))
+ */
+var FilesTooltip = Polymer({
+  is: 'files-tooltip',
+
+  properties: {
+    /**
+     * Delay for showing the tooltip in milliseconds.
+     */
+    'showTimeout': {
+      type: Number,
+      value: 500,  // ms
+      readOnly: true
+    },
+
+    /**
+     * Delay for hiding the tooltip in milliseconds.
+     */
+    'hideTimeout': {
+      type: Number,
+      value: 250,  // ms
+      readOnly: true
+    }
+  },
+
+  /**
+   * Initializes member variables.
+   */
+  created: function() {
+    /**
+     * @private {HTMLElement}
+     */
+    this.visibleTooltipTarget_ = null;
+
+    /**
+     * @private {HTMLElement}
+     */
+    this.upcomingTooltipTarget_ = null;
+
+    /**
+     * @private {number}
+     */
+    this.showTooltipTimerId_ = 0;
+
+    /**
+     * @private {number}
+     */
+    this.hideTooltipTimerId_ = 0;
+  },
+
+  /**
+   * Adds an event listener to the body.
+   */
+  attached: function() {
+    document.body.addEventListener(
+      'mousedown', this.onDocumentMouseDown_.bind(this));
+  },
+
+  /**
+   * Adds targets to tooltip.
+   * @param {!NodeList} targets
+   */
+  addTargets: function(targets) {
+    for (var i = 0; i < targets.length; i++) {
+      this.addTarget(targets[i]);
+    }
+  },
+
+  /**
+   * Adds a target to tooltip.
+   * @param {!HTMLElement} target
+   */
+  addTarget: function(target) {
+    target.addEventListener('mouseover', this.onMouseOver_.bind(this, target));
+    target.addEventListener('mouseout', this.onMouseOut_.bind(this, target));
+    target.addEventListener('focus', this.onFocus_.bind(this, target));
+    target.addEventListener('blur', this.onBlur_.bind(this, target));
+  },
+
+  /**
+   * @param {!HTMLElement} target
+   * @private
+   */
+  initShowingTooltip_: function(target) {
+    // Some tooltip is already visible.
+    if (this.visibleTooltipTarget_) {
+      if (this.hideTooltipTimerId_) {
+        clearTimeout(this.hideTooltipTimerId_);
+        this.hideTooltipTimerId_ = 0;
+      }
+    }
+
+    if (this.visibleTooltipTarget_ === target)
+      return;
+
+    this.upcomingTooltipTarget_ = target;
+    if (this.showTooltipTimerId_)
+      clearTimeout(this.showTooltipTimerId_);
+    this.showTooltipTimerId_ = setTimeout(
+        this.showTooltip_.bind(this, target),
+        this.visibleTooltipTarget_ ? 0 : this.showTimeout);
+  },
+
+  /**
+   * @param {!HTMLElement} target
+   * @private
+   */
+  initHidingTooltip_: function(target) {
+    // The tooltip is not visible.
+    if (this.visibleTooltipTarget_ !== target) {
+      if (this.upcomingTooltipTarget_ === target) {
+        clearTimeout(this.showTooltipTimerId_);
+        this.showTooltipTimerId_ = 0;
+      }
+      return;
+    }
+
+    if (this.hideTooltipTimerId_)
+      clearTimeout(this.hideTooltipTimerId_);
+    this.hideTooltipTimerId_ = setTimeout(
+        this.hideTooltip_.bind(this), this.hideTimeout);
+  },
+
+  /**
+   * @param {!HTMLElement} target
+   * @private
+   */
+  showTooltip_: function(target) {
+    if (this.showTooltipTimerId_) {
+      clearTimeout(this.showTooltipTimerId_);
+      this.showTooltipTimerId_ = 0;
+    }
+
+    this.visibleTooltipTarget_ = target;
+
+    var label = target.getAttribute('aria-label');
+    if (!label)
+      return;
+
+    this.$.label.textContent = label;
+    var rect = target.getBoundingClientRect();
+
+    var top = rect.top + rect.height;
+    if (top + this.offsetHeight > document.body.offsetHeight)
+      top = rect.top - this.offsetHeight;
+    this.style.top = `${Math.round(top)}px`;
+
+    var left = rect.left + rect.width / 2 - this.offsetWidth / 2;
+    if (left + this.offsetWidth > document.body.offsetWidth)
+      left = document.body.offsetWidth - this.offsetWidth;
+    this.style.left = `${Math.round(left)}px`;
+
+    this.setAttribute('visible', true);
+  },
+
+  /**
+   * @private
+   */
+  hideTooltip_: function() {
+    if (this.hideTooltipTimerId_) {
+      clearTimeout(this.hideTooltipTimerId_);
+      this.hideTooltipTimerId_ = 0;
+    }
+
+    this.visibleTooltipTarget_ = null;
+    this.removeAttribute('visible');
+  },
+
+  /**
+   * @param {Event} event
+   * @private
+   */
+  onMouseOver_: function(target, event) {
+    this.initShowingTooltip_(target);
+  },
+
+  /**
+   * @param {Event} event
+   * @private
+   */
+  onMouseOut_: function(target, event) {
+    this.initHidingTooltip_(target);
+  },
+
+  /**
+   * @param {Event} event
+   * @private
+   */
+  onFocus_: function(target, event) {
+    this.initShowingTooltip_(target);
+  },
+
+  /**
+   * @param {Event} event
+   * @private
+   */
+  onBlur_: function(target, event) {
+    this.initHidingTooltip_(target);
+  },
+
+  /**
+   * @param {Event} event
+   * @private
+   */
+  onDocumentMouseDown_: function(event) {
+    this.hideTooltip_();
+
+    // Additionally prevent any scheduled tooltips from showing up.
+    if (this.showTooltipTimerId_) {
+      clearTimeout(this.showTooltipTimerId_);
+      this.showTooltipTimerId_ = 0;
+    }
+  }
+});
diff --git a/ui/file_manager/file_manager/foreground/elements/files_tooltip_unittest.html b/ui/file_manager/file_manager/foreground/elements/files_tooltip_unittest.html
new file mode 100644
index 0000000..35eab5a
--- /dev/null
+++ b/ui/file_manager/file_manager/foreground/elements/files_tooltip_unittest.html
@@ -0,0 +1,47 @@
+<!DOCTYPE html>
+<!-- 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.
+  -->
+
+<!-- Since resources under chrome://resources are not accessible from unittest,
+  -- we need to load them with relative paths. -->
+<link rel="import" href="../../../../../third_party/polymer/v1_0/components-chromium/polymer/polymer.html">
+<link rel="import" href="files_tooltip.html">
+
+<style type="text/css">
+ button {
+   display: flex;
+   height: 32px;
+   margin: 30px;
+   width: 32px;
+ }
+
+ #container {
+   display: flex;
+   justify-content: space-between;
+ }
+
+ files-tooltip {
+   background: yellow;
+   box-sizing: border-box;
+   position: absolute;
+   text-align: center;
+   width: 100px;
+ }
+</style>
+
+<div id="container">
+  <button id="chocolate" aria-label="Chocolate!"></button>
+  <button id="cherries" aria-label="Cherries!"></button>
+</div>
+
+<!-- Button without a tooltip. -->
+<button id="other"></button>
+
+<files-tooltip></files-tooltip>
+
+<script src="../../../../webui/resources/js/assert.js"></script>
+<script src="../../../../webui/resources/js/util.js"></script>
+<script src="../../common/js/unittest_util.js"></script>
+<script src="files_tooltip_unittest.js"></script>
diff --git a/ui/file_manager/file_manager/foreground/elements/files_tooltip_unittest.js b/ui/file_manager/file_manager/foreground/elements/files_tooltip_unittest.js
new file mode 100644
index 0000000..7b25e8e7
--- /dev/null
+++ b/ui/file_manager/file_manager/foreground/elements/files_tooltip_unittest.js
@@ -0,0 +1,98 @@
+// 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.
+
+var chocolateButton;
+var cherriesButton;
+var otherButton;
+var tooltip;
+
+function waitForMutation(target) {
+  return new Promise(function(fulfill, reject) {
+    var observer = new MutationObserver(function(mutations) {
+      observer.disconnect();
+      fulfill();
+    });
+    observer.observe(target, {attributes: true});
+  });
+}
+
+function setUp() {
+  chocolateButton = document.querySelector('#chocolate');
+  cherriesButton = document.querySelector('#cherries');
+  otherButton = document.querySelector('#other');
+  tooltip = document.querySelector('files-tooltip');
+  tooltip.addTargets([chocolateButton, cherriesButton]);
+}
+
+function testFocus(callback) {
+  chocolateButton.focus();
+
+  return reportPromise(
+    waitForMutation(tooltip).then(function() {
+      assertEquals('Chocolate!', tooltip.textContent.trim());
+      assertTrue(!!tooltip.getAttribute('visible'));
+      assertEquals('4px', tooltip.style.left);
+      assertEquals('70px', tooltip.style.top);
+
+      cherriesButton.focus();
+      return waitForMutation(tooltip);
+    }).then(function() {
+      assertEquals('Cherries!', tooltip.textContent.trim());
+      assertTrue(!!tooltip.getAttribute('visible'));
+      var expectedLeft = document.body.offsetWidth - tooltip.offsetWidth + 'px';
+      assertEquals(expectedLeft, tooltip.style.left);
+      assertEquals('70px', tooltip.style.top);
+
+      otherButton.focus();
+      return waitForMutation(tooltip);
+    }).then(function() {
+      assertFalse(!!tooltip.getAttribute('visible'));
+    }), callback);
+}
+
+function testHover(callback) {
+  chocolateButton.dispatchEvent(new MouseEvent('mouseover'));
+
+  return reportPromise(
+    waitForMutation(tooltip).then(function() {
+      assertEquals('Chocolate!', tooltip.textContent.trim());
+      assertTrue(!!tooltip.getAttribute('visible'));
+      assertEquals('4px', tooltip.style.left);
+      assertEquals('70px', tooltip.style.top);
+
+      chocolateButton.dispatchEvent(new MouseEvent('mouseout'));
+      cherriesButton.dispatchEvent(new MouseEvent('mouseover'));
+      return waitForMutation(tooltip);
+    }).then(function() {
+      assertEquals('Cherries!', tooltip.textContent.trim());
+      assertTrue(!!tooltip.getAttribute('visible'));
+      var expectedLeft = document.body.offsetWidth - tooltip.offsetWidth + 'px';
+      assertEquals(expectedLeft, tooltip.style.left);
+      assertEquals('70px', tooltip.style.top);
+
+      cherriesButton.dispatchEvent(new MouseEvent('mouseout'));
+      return waitForMutation(tooltip);
+    }).then(function() {
+      assertFalse(!!tooltip.getAttribute('visible'));
+    }), callback);
+}
+
+function testClickHides(callback) {
+  chocolateButton.dispatchEvent(new MouseEvent('mouseover', {bubbles: true}));
+
+  return reportPromise(
+    waitForMutation(tooltip).then(function() {
+      assertEquals('Chocolate!', tooltip.textContent.trim());
+      assertTrue(!!tooltip.getAttribute('visible'));
+
+      // Hiding here is synchronous. Dispatch the event asynchronously, so the
+      // mutation observer is started before hiding.
+      setTimeout(function() {
+        document.body.dispatchEvent(new MouseEvent('mousedown'));
+      });
+      return waitForMutation(tooltip);
+    }).then(function() {
+      assertFalse(!!tooltip.getAttribute('visible'));
+    }), callback);
+}
diff --git a/ui/file_manager/file_manager/foreground/js/compiled_resources.gyp b/ui/file_manager/file_manager/foreground/js/compiled_resources.gyp
index 425cc695..4038e20 100644
--- a/ui/file_manager/file_manager/foreground/js/compiled_resources.gyp
+++ b/ui/file_manager/file_manager/foreground/js/compiled_resources.gyp
@@ -68,6 +68,7 @@
           '../../background/js/background_base.js',
           '../../background/js/background.js',
           '../../../image_loader/image_loader_client.js',
+          '../elements/files_tooltip.js',
           './metrics_start.js',
           './ui/combobutton.js',
           './ui/commandbutton.js',
@@ -111,7 +112,6 @@
           './share_client.js',
           './task_controller.js',
           './toolbar_controller.js',
-          './tooltip_controller.js',
           './thumbnail_loader.js',
           './list_thumbnail_loader.js',
           './providers_model.js',
diff --git a/ui/file_manager/file_manager/foreground/js/file_manager.js b/ui/file_manager/file_manager/foreground/js/file_manager.js
index a91bf05..f99b4fac 100644
--- a/ui/file_manager/file_manager/foreground/js/file_manager.js
+++ b/ui/file_manager/file_manager/foreground/js/file_manager.js
@@ -206,13 +206,6 @@
   this.toolbarController_ = null;
 
   /**
-   * Tooltip controller.
-   * @type {TooltipController}
-   * @private
-   */
-  this.tooltipController_ = null;
-
-  /**
    * Empty folder controller.
    * @private {EmptyFolderController}
    */
@@ -490,10 +483,6 @@
         assert(this.ui_.locationLine),
         this.selectionHandler_,
         this.directoryModel_);
-    this.tooltipController_ = new TooltipController(
-        queryRequiredElement('#tooltip', this.dialogDom_),
-        Array.prototype.slice.call(
-            this.dialogDom_.querySelectorAll('[has-tooltip]')));
     this.emptyFolderController_ = new EmptyFolderController(
         this.ui_.emptyFolder,
         this.directoryModel_);
@@ -542,6 +531,8 @@
             // Whether to show any welcome banner.
             this.dialogType === DialogType.FULL_PAGE));
 
+    this.ui_.attachFilesTooltip();
+
     this.ui_.decorateFilesMenuItems();
   };
 
diff --git a/ui/file_manager/file_manager/foreground/js/main_scripts.js b/ui/file_manager/file_manager/foreground/js/main_scripts.js
index 4647864..f09a2b4 100644
--- a/ui/file_manager/file_manager/foreground/js/main_scripts.js
+++ b/ui/file_manager/file_manager/foreground/js/main_scripts.js
@@ -132,7 +132,6 @@
 //<include src="spinner_controller.js">
 //<include src="task_controller.js">
 //<include src="toolbar_controller.js">
-//<include src="tooltip_controller.js">
 //<include src="thumbnail_loader.js">
 //<include src="list_thumbnail_loader.js">
 //<include src="providers_model.js">
diff --git a/ui/file_manager/file_manager/foreground/js/tooltip_controller.js b/ui/file_manager/file_manager/foreground/js/tooltip_controller.js
deleted file mode 100644
index d01d8276..0000000
--- a/ui/file_manager/file_manager/foreground/js/tooltip_controller.js
+++ /dev/null
@@ -1,185 +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.
-
-/**
- * Controls showing and hising tooltips when hovering over tooltipable HTML
- * elements.
- * @param {!HTMLElement} tooltip
- * @param {!Array<!HTMLElement>} targets
- * @constructor
- * @struct
- */
-function TooltipController(tooltip, targets) {
-  /** @private {!HTMLElement} */
-  this.tooltip_ = tooltip;
-
-  /** @private {!HTMLElement} */
-  this.tooltipLabel_ = queryRequiredElement('#tooltip-label', tooltip);
-
-  /** @private {!Array<!HTMLElement>} */
-  this.targets_ = targets;
-
-  /** @private {HTMLElement} */
-  this.visibleTooltipTarget_ = null;
-
-  /** @private {HTMLElement} */
-  this.upcomingTooltipTarget_ = null;
-
-  /** @private {number} */
-  this.showTooltipTimerId_ = 0;
-
-  /** @private {number} */
-  this.hideTooltipTimerId_ = 0;
-
-  this.targets_.forEach(function(target) {
-    target.addEventListener('mouseover', this.onMouseOver_.bind(this, target));
-    target.addEventListener('mouseout', this.onMouseOut_.bind(this, target));
-    target.addEventListener('focus', this.onFocus_.bind(this, target));
-    target.addEventListener('blur', this.onBlur_.bind(this, target));
-  }.bind(this));
-
-  document.body.addEventListener(
-      'mousedown', this.onDocumentMouseDown_.bind(this));
-}
-
-/**
- * Delay for showing the tooltip in milliseconds.
- * @const {number}
- */
-TooltipController.SHOW_TIMEOUT = 500;
-
-/**
- * Delay for hiding the tooltip in milliseconds.
- * @const {number}
- */
-TooltipController.HIDE_TIMEOUT = 250;
-
-/**
- * @param {!HTMLElement} target
- * @private
- */
-TooltipController.prototype.initShowingTooltip_ = function(target) {
-  // Some tooltip is already visible.
-  if (this.visibleTooltipTarget_) {
-    if (this.hideTooltipTimerId_) {
-      clearTimeout(this.hideTooltipTimerId_);
-      this.hideTooltipTimerId_ = 0;
-    }
-  }
-
-  if (this.visibleTooltipTarget_ === target)
-    return;
-
-  this.upcomingTooltipTarget_ = target;
-  if (this.showTooltipTimerId_)
-    clearTimeout(this.showTooltipTimerId_);
-  this.showTooltipTimerId_ = setTimeout(
-      this.showTooltip_.bind(this, target),
-      this.visibleTooltipTarget_ ? 0 : TooltipController.SHOW_TIMEOUT);
-};
-
-/**
- * @param {!HTMLElement} target
- * @private
- */
-TooltipController.prototype.initHidingTooltip_ = function(target) {
-  // The tooltip is not visible.
-  if (this.visibleTooltipTarget_ !== target) {
-    if (this.upcomingTooltipTarget_ === target) {
-      clearTimeout(this.showTooltipTimerId_);
-      this.showTooltipTimerId_ = 0;
-    }
-    return;
-  }
-
-  if (this.hideTooltipTimerId_)
-    clearTimeout(this.hideTooltipTimerId_);
-  this.hideTooltipTimerId_ = setTimeout(
-      this.hideTooltip_.bind(this), TooltipController.HIDE_TIMEOUT);
-};
-
-/**
- * @param {!HTMLElement} target
- * @private
- */
-TooltipController.prototype.showTooltip_ = function(target) {
-  if (this.showTooltipTimerId_) {
-    clearTimeout(this.showTooltipTimerId_);
-    this.showTooltipTimerId_ = 0;
-  }
-
-  this.visibleTooltipTarget_ = target;
-
-  var label = target.getAttribute('aria-label');
-  if (!label)
-    return;
-
-  this.tooltipLabel_.textContent = label;
-  var rect = target.getBoundingClientRect();
-  this.tooltip_.style.top = Math.round(rect.top) + rect.height + 'px';
-  var left = rect.left + rect.width / 2 - this.tooltip_.offsetWidth / 2;
-  if (left + this.tooltip_.offsetWidth > document.body.offsetWidth)
-    left = document.body.offsetWidth - this.tooltip_.offsetWidth;
-  this.tooltip_.style.left = Math.round(left) + 'px';
-  this.tooltip_.setAttribute('visible', true);
-};
-
-/**
- * @private
- */
-TooltipController.prototype.hideTooltip_ = function() {
-  if (this.hideTooltipTimerId_) {
-    clearTimeout(this.hideTooltipTimerId_);
-    this.hideTooltipTimerId_ = 0;
-  }
-
-  this.visibleTooltipTarget_ = null;
-  this.tooltip_.removeAttribute('visible');
-};
-
-/**
- * @param {Event} event
- * @private
- */
-TooltipController.prototype.onMouseOver_ = function(target, event) {
-  this.initShowingTooltip_(target);
-};
-
-/**
- * @param {Event} event
- * @private
- */
-TooltipController.prototype.onMouseOut_ = function(target, event) {
-  this.initHidingTooltip_(target);
-};
-
-/**
- * @param {Event} event
- * @private
- */
-TooltipController.prototype.onFocus_ = function(target, event) {
-  this.initShowingTooltip_(target);
-};
-
-/**
- * @param {Event} event
- * @private
- */
-TooltipController.prototype.onBlur_ = function(target, event) {
-  this.initHidingTooltip_(target);
-};
-
-/**
- * @param {Event} event
- * @private
- */
-TooltipController.prototype.onDocumentMouseDown_ = function(event) {
-  this.hideTooltip_();
-
-  // Additionally prevent any scheduled tooltips from showing up.
-  if (this.showTooltipTimerId_) {
-    clearTimeout(this.showTooltipTimerId_);
-    this.showTooltipTimerId_ = 0;
-  }
-};
diff --git a/ui/file_manager/file_manager/foreground/js/tooltip_controller_unittest.html b/ui/file_manager/file_manager/foreground/js/tooltip_controller_unittest.html
deleted file mode 100644
index bb2e208..0000000
--- a/ui/file_manager/file_manager/foreground/js/tooltip_controller_unittest.html
+++ /dev/null
@@ -1,44 +0,0 @@
-<!DOCTYPE html>
-<!-- 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.
-  -->
-
-<style type="text/css">
- button {
-   display: flex;
-   height: 32px;
-   margin: 30px;
-   width: 32px;
- }
-
- #container {
-   display: flex;
-   justify-content: space-between;
- } 
-
- #tooltip {
-   background: yellow;
-   position: absolute;
-   text-align: center;
-   width: 100px;
- }
-</style>
-
-<div id="container">
-  <button id="chocolate" aria-label="Chocolate!"></button>
-  <button id="cherries" aria-label="Cherries!"></button>
-</div>
-
-<!-- Button without a tooltip. -->
-<button id="other"></button>
-
-<div id="tooltip">
-  <div id="tooltip-label"></div>
-</div>
-
-<script src="../../../../webui/resources/js/assert.js"></script>
-<script src="../../../../webui/resources/js/util.js"></script>
-<script src="../../common/js/unittest_util.js"></script>
-<script src="tooltip_controller.js"></script>
-<script src="tooltip_controller_unittest.js"></script>
diff --git a/ui/file_manager/file_manager/foreground/js/tooltip_controller_unittest.js b/ui/file_manager/file_manager/foreground/js/tooltip_controller_unittest.js
deleted file mode 100644
index 573a58de..0000000
--- a/ui/file_manager/file_manager/foreground/js/tooltip_controller_unittest.js
+++ /dev/null
@@ -1,100 +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.
-
-var chocolateButton;
-var cherriesButton;
-var otherButton;
-var tooltip;
-var controller;
-
-function waitForMutation(target) {
-  return new Promise(function(fulfill, reject) {
-    var observer = new MutationObserver(function(mutations) {
-      observer.disconnect();
-      fulfill();
-    });
-    observer.observe(target, {attributes: true});
-  });
-}
-
-function setUp() {
-  chocolateButton = document.querySelector('#chocolate');
-  cherriesButton = document.querySelector('#cherries');
-  otherButton = document.querySelector('#other');
-  tooltip = document.querySelector('#tooltip');
-  controller = new TooltipController(
-      tooltip, [chocolateButton, cherriesButton]);
-}
-
-function testFocus(callback) {
-  chocolateButton.focus();
-
-  return reportPromise(
-    waitForMutation(tooltip).then(function() {
-      assertEquals('Chocolate!', tooltip.textContent.trim());
-      assertTrue(!!tooltip.getAttribute('visible'));
-      assertEquals('4px', tooltip.style.left);
-      assertEquals('70px', tooltip.style.top);
-
-      cherriesButton.focus();
-      return waitForMutation(tooltip);
-    }).then(function() {
-      assertEquals('Cherries!', tooltip.textContent.trim());
-      assertTrue(!!tooltip.getAttribute('visible'));
-      var expectedLeft = document.body.offsetWidth - tooltip.offsetWidth + 'px';
-      assertEquals(expectedLeft, tooltip.style.left);
-      assertEquals('70px', tooltip.style.top);
-
-      otherButton.focus();
-      return waitForMutation(tooltip);
-    }).then(function() {
-      assertFalse(!!tooltip.getAttribute('visible'));
-    }), callback);
-}
-
-function testHover(callback) {
-  chocolateButton.dispatchEvent(new MouseEvent('mouseover'));
-
-  return reportPromise(
-    waitForMutation(tooltip).then(function() {
-      assertEquals('Chocolate!', tooltip.textContent.trim());
-      assertTrue(!!tooltip.getAttribute('visible'));
-      assertEquals('4px', tooltip.style.left);
-      assertEquals('70px', tooltip.style.top);
-
-      chocolateButton.dispatchEvent(new MouseEvent('mouseout'));
-      cherriesButton.dispatchEvent(new MouseEvent('mouseover'));
-      return waitForMutation(tooltip);
-    }).then(function() {
-      assertEquals('Cherries!', tooltip.textContent.trim());
-      assertTrue(!!tooltip.getAttribute('visible'));
-      var expectedLeft = document.body.offsetWidth - tooltip.offsetWidth + 'px';
-      assertEquals(expectedLeft, tooltip.style.left);
-      assertEquals('70px', tooltip.style.top);
-
-      cherriesButton.dispatchEvent(new MouseEvent('mouseout'));
-      return waitForMutation(tooltip);
-    }).then(function() {
-      assertFalse(!!tooltip.getAttribute('visible'));
-    }), callback);
-}
-
-function testClickHides(callback) {
-  chocolateButton.dispatchEvent(new MouseEvent('mouseover', {bubbles: true}));
-
-  return reportPromise(
-    waitForMutation(tooltip).then(function() {
-      assertEquals('Chocolate!', tooltip.textContent.trim());
-      assertTrue(!!tooltip.getAttribute('visible'));
-
-      // Hiding here is synchronous. Dispatch the event asynchronously, so the
-      // mutation observer is started before hiding.
-      setTimeout(function() {
-        document.body.dispatchEvent(new MouseEvent('mousedown'));
-      });
-      return waitForMutation(tooltip);
-    }).then(function() {
-      assertFalse(!!tooltip.getAttribute('visible'));
-    }), callback);
-}
diff --git a/ui/file_manager/file_manager/foreground/js/ui/file_manager_ui.js b/ui/file_manager/file_manager/foreground/js/ui/file_manager_ui.js
index afb83a8..346a995 100644
--- a/ui/file_manager/file_manager/foreground/js/ui/file_manager_ui.js
+++ b/ui/file_manager/file_manager/foreground/js/ui/file_manager_ui.js
@@ -407,6 +407,14 @@
 };
 
 /**
+ * Attaches files tooltip.
+ */
+FileManagerUI.prototype.attachFilesTooltip = function() {
+  assertInstanceof(document.querySelector('files-tooltip'), FilesTooltip)
+      .addTargets(document.querySelectorAll('[has-tooltip]'));
+};
+
+/**
  * Initialize files menu items. This method must be called after all files menu
  * items are decorated as cr.ui.MenuItem.
  */
diff --git a/ui/file_manager/file_manager/main.html b/ui/file_manager/file_manager/main.html
index 781bcb2..7053c75 100644
--- a/ui/file_manager/file_manager/main.html
+++ b/ui/file_manager/file_manager/main.html
@@ -37,6 +37,7 @@
     <link rel="import" href="chrome://resources/polymer/v1_0/paper-progress/paper-progress.html">
     <link rel="import" href="chrome://resources/polymer/v1_0/paper-ripple/paper-ripple.html">
     <link rel="import" href="foreground/elements/files_toggle_ripple.html">
+    <link rel="import" href="foreground/elements/files_tooltip.html">
   </head>
 
   <body tabindex="-1">
@@ -444,9 +445,7 @@
       </div>
     </div>
     <div id="drag-container"></div>
-    <div id="tooltip">
-      <div id="tooltip-label"></div>
-    <div>
+    <files-tooltip></files-tooltip>
     <iframe id="command-dispatcher" hidden aria-hidden="true"></iframe>
 
     <script src="foreground/js/main_scripts.js"></script>
diff --git a/ui/file_manager/file_manager/manifest.json b/ui/file_manager/file_manager/manifest.json
index 6727d5f..b1dfdd0c 100644
--- a/ui/file_manager/file_manager/manifest.json
+++ b/ui/file_manager/file_manager/manifest.json
@@ -162,6 +162,8 @@
     "foreground/elements/files_toast.js",
     "foreground/elements/files_toggle_ripple.html",
     "foreground/elements/files_toggle_ripple.js",
+    "foreground/elements/files_tooltip.html",
+    "foreground/elements/files_tooltip.js",
     "foreground/js/metadata/byte_reader.js",
     "foreground/js/metadata/exif_parser.js",
     "foreground/js/metadata/exif_constants.js",
diff --git a/ui/file_manager/file_manager_resources.grd b/ui/file_manager/file_manager_resources.grd
index c510a79..f22618c 100644
--- a/ui/file_manager/file_manager_resources.grd
+++ b/ui/file_manager/file_manager_resources.grd
@@ -54,6 +54,8 @@
       <include name="IDR_FILE_MANAGER_ELEMENTS_FILES_TOAST_JS" file="file_manager/foreground/elements/files_toast.js" type="BINDATA" />
       <include name="IDR_FILE_MANAGER_ELEMENTS_FILES_TOGGLE_RIPPLE_HTML" file="file_manager/foreground/elements/files_toggle_ripple.html" type="BINDATA" />
       <include name="IDR_FILE_MANAGER_ELEMENTS_FILES_TOGGLE_RIPPLE_JS" file="file_manager/foreground/elements/files_toggle_ripple.js" type="BINDATA" />
+      <include name="IDR_FILE_MANAGER_ELEMENTS_FILES_TOOLTIP_HTML" file="file_manager/foreground/elements/files_tooltip.html" type="BINDATA" />
+      <include name="IDR_FILE_MANAGER_ELEMENTS_FILES_TOOLTIP_JS" file="file_manager/foreground/elements/files_tooltip.js" type="BINDATA" />
 
       <!-- Scripts referred by the gallery app. -->
       <include name="IDR_FILE_MANAGER_FILE_TYPE_JS" file="file_manager/common/js/file_type.js" flattenhtml="false" type="BINDATA" />
diff --git a/ui/file_manager/gallery/gallery.html b/ui/file_manager/gallery/gallery.html
index 54df81ea..b7341efa 100644
--- a/ui/file_manager/gallery/gallery.html
+++ b/ui/file_manager/gallery/gallery.html
@@ -22,6 +22,7 @@
   <link rel="import" href="chrome://resources/polymer/v1_0/paper-slider/paper-slider.html">
   <link rel="import" href="chrome-extension://hhaomjibdihmijegdhdafkllkbggdgoj/foreground/elements/files_toast.html">
   <link rel="import" href="chrome-extension://hhaomjibdihmijegdhdafkllkbggdgoj/foreground/elements/files_toggle_ripple.html">
+  <link rel="import" href="chrome-extension://hhaomjibdihmijegdhdafkllkbggdgoj/foreground/elements/files_tooltip.html">
 
   <script src="js/gallery_scripts.js"></script>
   <style is="custom-style">
@@ -62,30 +63,37 @@
       <div class="button-spacer">
         <!-- Use button element for edit button to implement toggle button with
           -- custom ripple effect. -->
-        <button class="edit icon-button" i18n-values="title:GALLERY_EDIT"
+        <button class="edit icon-button" i18n-values="aria-label:GALLERY_EDIT"
+                has-tooltip
                 disabled>
           <div class="icon"></div>
           <files-toggle-ripple></files-toggle-ripple>
         </button>
         <paper-button class="print icon-button"
-                      i18n-values="title:GALLERY_PRINT"
+                      i18n-values="aria-label:GALLERY_PRINT"
+                      has-tooltip
                       disabled></paper-button>
         <paper-button class="delete icon-button"
-                      i18n-values="title:GALLERY_DELETE"
+                      i18n-values="aria-label:GALLERY_DELETE"
+                      has-tooltip
                       disabled></paper-button>
         <!-- Use button element for mode button to implement toggle switch
           -- button. -->
         <button class="mode icon-button" disabled>
-          <div class="icon slide-mode" i18n-values="title:GALLERY_SLIDE"></div>
+          <div class="icon slide-mode" i18n-values="aria-label:GALLERY_SLIDE"
+               has-tooltip></div>
           <div class="icon thumbnail-mode"
-               i18n-values="title:GALLERY_THUMBNAIL"></div>
+               i18n-values="aria-label:GALLERY_THUMBNAIL"
+               has-tooltip></div>
           <paper-ripple></paper-ripple>
         </button>
         <paper-button class="slideshow icon-button"
-                      i18n-values="title:GALLERY_SLIDESHOW"
+                      i18n-values="aria-label:GALLERY_SLIDESHOW"
+                      has-tooltip
                       disabled></paper-button>
         <paper-button class="share icon-button"
-                      i18n-values="title:GALLERY_SHARE"
+                      i18n-values="aria-label:GALLERY_SHARE"
+                      has-tooltip
                       disabled></paper-button>
       </div>
     </div>
@@ -117,6 +125,7 @@
     <div class="toast-stage">
       <files-toast></files-toast>
     </div>
+    <files-tooltip></files-tooltip>
   </div>
 </body>
 </html>
diff --git a/ui/file_manager/gallery/js/compiled_resources.gyp b/ui/file_manager/gallery/js/compiled_resources.gyp
index dbed061..f0553c38 100644
--- a/ui/file_manager/gallery/js/compiled_resources.gyp
+++ b/ui/file_manager/gallery/js/compiled_resources.gyp
@@ -85,6 +85,7 @@
           '../../file_manager/common/js/metrics_base.js',
           '../../file_manager/common/js/metrics_events.js',
           '../../file_manager/common/js/metrics.js',
+          '../../file_manager/foreground/elements/files_tooltip.js',
           '../../file_manager/foreground/js/metrics_start.js',
           '../../file_manager/foreground/js/metadata/content_metadata_provider.js',
           '../../file_manager/foreground/js/metadata/exif_constants.js',
diff --git a/ui/file_manager/gallery/js/gallery.js b/ui/file_manager/gallery/js/gallery.js
index 32fcad38..e343389d 100644
--- a/ui/file_manager/gallery/js/gallery.js
+++ b/ui/file_manager/gallery/js/gallery.js
@@ -204,6 +204,9 @@
 
   window.addEventListener('resize', this.resizeRenameField_.bind(this));
 
+  assertInstanceof(document.querySelector('files-tooltip'), FilesTooltip)
+      .addTargets(document.querySelectorAll('[has-tooltip]'));
+
   // We must call this method after elements of all tools have been attached to
   // the DOM.
   this.dimmableUIController_.setTools(document.querySelectorAll('.tool'));
diff --git a/ui/file_manager/gallery/js/image_editor/image_editor.js b/ui/file_manager/gallery/js/image_editor/image_editor.js
index b9afe2f..38ab77a 100644
--- a/ui/file_manager/gallery/js/image_editor/image_editor.js
+++ b/ui/file_manager/gallery/js/image_editor/image_editor.js
@@ -1213,6 +1213,11 @@
   if (type === ImageEditor.Toolbar.ButtonType.ICON) {
     var icon = document.createElement('div');
     icon.classList.add('icon');
+
+    // Show tooltip for icon button.
+    assertInstanceof(document.querySelector('files-tooltip'), FilesTooltip)
+        .addTarget(button);
+
     button.appendChild(icon);
   } else if (type === ImageEditor.Toolbar.ButtonType.LABEL ||
       type === ImageEditor.Toolbar.ButtonType.LABEL_UPPER_CASE) {
@@ -1221,6 +1226,7 @@
     label.textContent =
         type === ImageEditor.Toolbar.ButtonType.LABEL_UPPER_CASE ?
         strf(title).toLocaleUpperCase() : strf(title);
+
     button.appendChild(label);
   } else {
     assertNotReached();
@@ -1230,7 +1236,7 @@
   button.appendChild(paperRipple);
 
   button.label = strf(title);
-  button.title = strf(title);
+  button.setAttribute('aria-label', strf(title));
 
   GalleryUtil.decorateMouseFocusHandling(button);
 
diff --git a/ui/file_manager/gallery/js/thumbnail_mode.js b/ui/file_manager/gallery/js/thumbnail_mode.js
index 565c4516c..1c3fb7c 100644
--- a/ui/file_manager/gallery/js/thumbnail_mode.js
+++ b/ui/file_manager/gallery/js/thumbnail_mode.js
@@ -354,8 +354,10 @@
  * Moves selection to specified direction.
  * @param {string} direction Direction. Should be 'Left', 'Right', 'Up', or
  *     'Down'.
+ * @param {boolean} selectRange True to perform range selection.
+ * @private
  */
-ThumbnailView.prototype.moveSelection = function(direction) {
+ThumbnailView.prototype.moveSelection_ = function(direction, selectRange) {
   var step;
   if ((direction === 'Left' && !isRTL()) ||
       (direction === 'Right' && isRTL()) ||
@@ -370,7 +372,7 @@
   }
 
   var vertical = direction === 'Up' || direction === 'Down';
-  var baseIndex = this.selectionModel_.selectedIndex;
+  var baseIndex = this.selectionModel_.leadIndex;
   var baseRect = this.getThumbnailRect(baseIndex);
   var baseCenter = baseRect.left + baseRect.width / 2;
   var minHorizontalGap = Number.MAX_VALUE;
@@ -412,7 +414,17 @@
 
   if (index !== null) {
     // Move selection.
-    this.selectionModel_.selectedIndex = index;
+    if (selectRange && this.selectionModel_.anchorIndex !== -1) {
+      // Since anchorIndex will be set to 0 by unselectAll, copy the value.
+      var anchorIndex = this.selectionModel_.anchorIndex;
+      this.selectionModel_.unselectAll();
+      this.selectionModel_.selectRange(anchorIndex, index);
+      this.selectionModel_.anchorIndex = anchorIndex;
+    } else {
+      this.selectionModel_.selectedIndex = index;
+      this.selectionModel_.anchorIndex = index;
+    }
+
     this.selectionModel_.leadIndex = index;
     this.scrollTo_(index);
   }
@@ -606,6 +618,7 @@
 /**
  * Handles keydown event.
  * @param {!Event} event
+ * @private
  */
 ThumbnailView.prototype.onKeydown_ = function(event) {
   var keyString = util.getKeyModifiers(event) + event.keyIdentifier;
@@ -615,7 +628,11 @@
     case 'Left':
     case 'Up':
     case 'Down':
-      this.moveSelection(event.keyIdentifier);
+    case 'Shift-Right':
+    case 'Shift-Left':
+    case 'Shift-Up':
+    case 'Shift-Down':
+      this.moveSelection_(event.keyIdentifier, event.shiftKey);
       event.stopPropagation();
       break;
     case 'Ctrl-U+0041': // Crtl+A
@@ -638,6 +655,7 @@
   if (selectionMode === ThumbnailView.SelectionMode.SINGLE) {
     this.selectionModel_.unselectAll();
     this.selectionModel_.setIndexSelected(index, true);
+    this.selectionModel_.anchorIndex = index;
   } else if (selectionMode === ThumbnailView.SelectionMode.MULTIPLE) {
     this.selectionModel_.setIndexSelected(index,
         this.selectionModel_.selectedIndexes.indexOf(index) === -1);
diff --git a/ui/file_manager/integration_tests/file_manager/keyboard_operations.js b/ui/file_manager/integration_tests/file_manager/keyboard_operations.js
index 9429bef4..3b64a1c 100644
--- a/ui/file_manager/integration_tests/file_manager/keyboard_operations.js
+++ b/ui/file_manager/integration_tests/file_manager/keyboard_operations.js
@@ -212,7 +212,8 @@
   return remoteCall.callRemoteTestUtil('selectFile', windowId, [oldName]).
     then(function() {
       // Push Ctrl+Enter.
-      return remoteCall.fakeKeyDown(windowId, '#detail-table', 'Enter', true);
+      return remoteCall.fakeKeyDown(
+          windowId, '#detail-table', 'Enter', true, false);
     }).then(function() {
       // Wait for rename text field.
       return remoteCall.waitForElement(windowId, 'input.rename');
@@ -222,7 +223,8 @@
           'inputText', windowId, ['input.rename', newName]);
     }).then(function() {
       // Push Enter.
-      return remoteCall.fakeKeyDown(windowId, 'input.rename', 'Enter', false);
+      return remoteCall.fakeKeyDown(
+          windowId, 'input.rename', 'Enter', false, false);
     });
 }
 
@@ -242,7 +244,7 @@
     var windowId = results.windowId;
     return remoteCall.waitForFiles(windowId, expectedRows).then(function() {
       return remoteCall.fakeKeyDown(
-          windowId, '#list-container', 'U+0045', true);
+          windowId, '#list-container', 'U+0045', true, false);
     }).then(function() {
       // Wait for rename text field.
       return remoteCall.waitForElement(windowId, 'input.rename');
@@ -252,11 +254,12 @@
           'inputText', windowId, ['input.rename', 'foo']);
     }).then(function() {
       // Press Enter.
-      return remoteCall.fakeKeyDown(windowId, 'input.rename', 'Enter', false);
+      return remoteCall.fakeKeyDown(
+          windowId, 'input.rename', 'Enter', false, false);
     }).then(function() {
       // Press Enter again to try to get into the new directory.
-      return remoteCall.fakeKeyDown(windowId, '#list-container', 'Enter',
-          false);
+      return remoteCall.fakeKeyDown(
+          windowId, '#list-container', 'Enter', false, false);
     }).then(function() {
       // Confirm that it doesn't move the directory since it's in renaming
       // process.
@@ -268,7 +271,7 @@
     }).then(function() {
       // Press Enter again.
       return remoteCall.fakeKeyDown(windowId, '#list-container', 'Enter',
-          false);
+          false, false);
     }).then(function() {
       // Confirm that it moves to renamed directory.
       return remoteCall.waitUntilCurrentDirectoryIsChanged(windowId,
diff --git a/ui/file_manager/integration_tests/gallery/photo_editor.js b/ui/file_manager/integration_tests/gallery/photo_editor.js
index 344ca935..c30ea91c 100644
--- a/ui/file_manager/integration_tests/gallery/photo_editor.js
+++ b/ui/file_manager/integration_tests/gallery/photo_editor.js
@@ -93,7 +93,7 @@
           ]);
         }).
         then(function() {
-          return gallery.fakeKeyDown(appId, 'body', 'Enter', false);
+          return gallery.fakeKeyDown(appId, 'body', 'Enter', false, false);
         }).
         then(function(ret) {
           chrome.test.assertTrue(ret);
@@ -158,7 +158,7 @@
       origMetadata = metadata;
 
       // Push the Enter key.
-      return gallery.fakeKeyDown(appId, 'body', 'Enter', false);
+      return gallery.fakeKeyDown(appId, 'body', 'Enter', false, false);
     }).then(function() {
       // Wait until the image is updated.
       return repeatUntil(function() {
diff --git a/ui/file_manager/integration_tests/gallery/thumbnail_mode.js b/ui/file_manager/integration_tests/gallery/thumbnail_mode.js
index 185f317..d1d60c75 100644
--- a/ui/file_manager/integration_tests/gallery/thumbnail_mode.js
+++ b/ui/file_manager/integration_tests/gallery/thumbnail_mode.js
@@ -150,6 +150,88 @@
 }
 
 /**
+ * Selects multiple images with shift key.
+ * @param {string} testVolumeName Test volume name.
+ * @param {VolumeManagerCommon.VolumeType} volumeType Volume type.
+ * @return {!Promise} Promise to be fulfilled with on success.
+ */
+function selectMultipleImagesWithShiftKey(testVolumeName, volumeType) {
+  var image4 = new TestEntryInfo(
+      EntryType.FILE, 'image3.jpg', 'image4.jpg',
+      'image/jpeg', SharedOption.NONE, 'Jan 18, 2038, 1:02 AM',
+      'image3.jpg', '3 KB', 'JPEG image');
+
+  var launchedPromise = launch(testVolumeName, volumeType,
+      [ENTRIES.image3, image4, ENTRIES.desktop], [ENTRIES.image3]);
+  var appId;
+  return launchedPromise.then(function(result) {
+    // Confirm initial state after the launch.
+    appId = result.appId;
+    return gallery.waitForSlideImage(appId, 640, 480, 'image3');
+  }).then(function() {
+    // Swith to thumbnail mode.
+    return gallery.waitAndClickElement(appId, 'button.mode');
+  }).then(function() {
+    // Confirm that image3 is selected first: [1] 2  3
+    return gallery.callRemoteTestUtil('queryAllElements', appId,
+        ['.thumbnail-view > ul > li.selected']);
+  }).then(function(results) {
+    chrome.test.assertEq(1, results.length);
+    chrome.test.assertEq('image3.jpg',
+        results[0].attributes['title']);
+
+    // Press Right key with shift.
+    return gallery.fakeKeyDown(
+        appId, '.thumbnail-view', 'Right', false, true /* Shift */);
+  }).then(function() {
+    // Confirm 2 images are selected: [1][2] 3
+    return gallery.callRemoteTestUtil('queryAllElements', appId,
+        ['.thumbnail-view > ul > li.selected']);
+  }).then(function(results) {
+    chrome.test.assertEq(2, results.length);
+    chrome.test.assertEq('image3.jpg', results[0].attributes['title']);
+    chrome.test.assertEq('image4.jpg', results[1].attributes['title']);
+
+    // Press Right key with shift.
+    return gallery.fakeKeyDown(
+        appId, '.thumbnail-view', 'Right', false, true /* Shift */);
+  }).then(function() {
+    // Confirm 3 images are selected: [1][2][3]
+    return gallery.callRemoteTestUtil('queryAllElements', appId,
+        ['.thumbnail-view > ul > li.selected']);
+  }).then(function(results) {
+    chrome.test.assertEq(3, results.length);
+    chrome.test.assertEq('image3.jpg', results[0].attributes['title']);
+    chrome.test.assertEq('image4.jpg', results[1].attributes['title']);
+    chrome.test.assertEq('My Desktop Background.png',
+        results[2].attributes['title']);
+
+    // Press Left key with shift.
+    return gallery.fakeKeyDown(
+        appId, '.thumbnail-view', 'Left', false, true /* Shift */);
+  }).then(function() {
+    // Confirm 2 images are selected: [1][2] 3
+    return gallery.callRemoteTestUtil('queryAllElements', appId,
+        ['.thumbnail-view > ul > li.selected']);
+  }).then(function(results) {
+    chrome.test.assertEq(2, results.length);
+    chrome.test.assertEq('image3.jpg', results[0].attributes['title']);
+    chrome.test.assertEq('image4.jpg', results[1].attributes['title']);
+
+    // Press Right key without shift.
+    return gallery.fakeKeyDown(appId, '.thumbnail-view', 'Right', false, false);
+  }).then(function() {
+    // Confirm only the last image is selected: 1  2 [3]
+    return gallery.callRemoteTestUtil('queryAllElements', appId,
+        ['.thumbnail-view > ul > li.selected']);
+  }).then(function(results) {
+    chrome.test.assertEq(1, results.length);
+    chrome.test.assertEq('My Desktop Background.png',
+        results[0].attributes['title']);
+  });
+}
+
+/**
  * Rename test in thumbnail mode for Downloads.
  * @return {!Promise} Promise to be fulfilled with on success.
  */
@@ -214,3 +296,11 @@
 testcase.emptySpaceClickUnselectsInThumbnailModeOnDrive = function() {
   return emptySpaceClickUnselectsInThumbnailMode('drive', 'drive');
 };
+
+/**
+ * Selects multiple images with shift key in Downloads.
+ * @return {!Promise} Promise to be fulfilled with on success.
+ */
+testcase.selectMultipleImagesWithShiftKeyOnDownloads = function() {
+  return selectMultipleImagesWithShiftKey('local', 'downloads');
+};
diff --git a/ui/file_manager/integration_tests/remote_call.js b/ui/file_manager/integration_tests/remote_call.js
index 1eb4a6751..a2eddda 100644
--- a/ui/file_manager/integration_tests/remote_call.js
+++ b/ui/file_manager/integration_tests/remote_call.js
@@ -203,13 +203,14 @@
  * @param {string} query Query for the target element.
  * @param {string} keyIdentifer Key identifier.
  * @param {boolean} ctrlKey Control key flag.
+ * @param {boolean} shiftKey Shift key flag.
  * @return {Promise} Promise to be fulfilled or rejected depending on the
  *     result.
  */
 RemoteCall.prototype.fakeKeyDown =
-    function(windowId, query, keyIdentifer, ctrlKey) {
+    function(windowId, query, keyIdentifer, ctrlKey, shiftKey) {
   var resultPromise = this.callRemoteTestUtil(
-      'fakeKeyDown', windowId, [query, keyIdentifer, ctrlKey]);
+      'fakeKeyDown', windowId, [query, keyIdentifer, ctrlKey, shiftKey]);
   return resultPromise.then(function(result) {
     if (result)
       return true;
diff --git a/ui/gfx/canvas.cc b/ui/gfx/canvas.cc
index 49e32350..b40fcda 100644
--- a/ui/gfx/canvas.cc
+++ b/ui/gfx/canvas.cc
@@ -180,6 +180,13 @@
   canvas_->save();
 }
 
+float Canvas::SaveAndUnscale() {
+  Save();
+  SkScalar scale_factor = 1.0f / image_scale_;
+  canvas_->scale(scale_factor, scale_factor);
+  return image_scale_;
+}
+
 void Canvas::SaveLayerAlpha(uint8 alpha) {
   canvas_->saveLayerAlpha(NULL, alpha);
 }
@@ -531,14 +538,6 @@
   canvas_->drawRect(dest_rect, paint);
 }
 
-NativeDrawingContext Canvas::BeginPlatformPaint() {
-  return skia::BeginPlatformPaint(canvas_);
-}
-
-void Canvas::EndPlatformPaint() {
-  skia::EndPlatformPaint(canvas_);
-}
-
 void Canvas::Transform(const gfx::Transform& transform) {
   canvas_->concat(transform.matrix());
 }
diff --git a/ui/gfx/canvas.h b/ui/gfx/canvas.h
index 84a685cf..0c40944 100644
--- a/ui/gfx/canvas.h
+++ b/ui/gfx/canvas.h
@@ -169,6 +169,11 @@
   // until a balanced call to Restore() is made.
   void Save();
 
+  // Saves the drawing state, unscales by the image scale factor, and returns
+  // that factor.  This is useful when callers want to draw directly in the
+  // native scale.
+  float SaveAndUnscale();
+
   // As with Save(), except draws to a layer that is blended with the canvas
   // at the specified alpha once Restore() is called.
   // |layer_bounds| are the bounds of the layer relative to the current
@@ -389,14 +394,6 @@
                     int w,
                     int h);
 
-  // Returns a native drawing context for platform specific drawing routines to
-  // use. Must be balanced by a call to EndPlatformPaint().
-  NativeDrawingContext BeginPlatformPaint();
-
-  // Signifies the end of platform drawing using the native drawing context
-  // returned by BeginPlatformPaint().
-  void EndPlatformPaint();
-
   // Apply transformation on the canvas.
   void Transform(const Transform& transform);
 
diff --git a/ui/gfx/nine_image_painter.cc b/ui/gfx/nine_image_painter.cc
index 42d5cc0..39bfe0e 100644
--- a/ui/gfx/nine_image_painter.cc
+++ b/ui/gfx/nine_image_painter.cc
@@ -96,30 +96,40 @@
     return;
 
   ScopedCanvas scoped_canvas(canvas);
-  canvas->Translate(bounds.OffsetFromOrigin());
 
   // Get the current transform from the canvas and apply it to the logical
   // bounds passed in. This will give us the pixel bounds which can be used
   // to draw the images at the correct locations.
   // We should not scale the bounds by the canvas->image_scale() as that can be
   // different from the real scale in the canvas transform.
-  SkRect bounds_in_pixels_f;
-  if (!canvas->sk_canvas()->getTotalMatrix().mapRect(
-          &bounds_in_pixels_f, RectToSkRect(gfx::Rect(bounds.size()))))
+  SkMatrix matrix = canvas->sk_canvas()->getTotalMatrix();
+  if (!matrix.rectStaysRect())
     return;  // Invalid transform.
 
-  SkIRect bounds_in_pixels;
-  bounds_in_pixels_f.dround(&bounds_in_pixels);
-
-  SkMatrix matrix = canvas->sk_canvas()->getTotalMatrix();
-  matrix.setTranslateX(SkIntToScalar(bounds_in_pixels.x()));
-  matrix.setTranslateY(SkIntToScalar(bounds_in_pixels.y()));
+  // Since the drawing from the following Fill() calls assumes the mapped origin
+  // is at (0,0), we need to translate the canvas to the mapped origin.
+  SkPoint corners_f[2];
+  corners_f[0] = SkPoint::Make(bounds.x(), bounds.y());
+  corners_f[1] = SkPoint::Make(bounds.right(), bounds.bottom());
+  matrix.mapPoints(corners_f, 2);
+  SkIPoint corners_in_pixels[2];
+  corners_in_pixels[0] = SkIPoint::Make(SkDScalarRoundToInt(corners_f[0].x()),
+                                        SkDScalarRoundToInt(corners_f[0].y()));
+  corners_in_pixels[1] = SkIPoint::Make(SkDScalarRoundToInt(corners_f[1].x()),
+                                        SkDScalarRoundToInt(corners_f[1].y()));
+  matrix.setTranslateX(SkIntToScalar(corners_in_pixels[0].x()));
+  matrix.setTranslateY(SkIntToScalar(corners_in_pixels[0].y()));
   canvas->sk_canvas()->setMatrix(matrix);
 
-  const int width_in_pixels = bounds_in_pixels.width();
-  const int height_in_pixels = bounds_in_pixels.height();
-  const float scale_x = matrix.getScaleX();
-  const float scale_y = matrix.getScaleY();
+  // Width and height should always be positive even when corners were flipped.
+  const int width_in_pixels =
+      SkMax32(corners_in_pixels[0].x(), corners_in_pixels[1].x()) -
+      SkMin32(corners_in_pixels[0].x(), corners_in_pixels[1].x());
+  const int height_in_pixels =
+      SkMax32(corners_in_pixels[0].y(), corners_in_pixels[1].y()) -
+      SkMin32(corners_in_pixels[0].y(), corners_in_pixels[1].y());
+  const float scale_x = fabsf(matrix.getScaleX());
+  const float scale_y = fabsf(matrix.getScaleY());
 
   // In case the corners and edges don't all have the same width/height, we draw
   // the center first, and extend it out in all directions to the edges of the
diff --git a/ui/gfx/nine_image_painter_unittest.cc b/ui/gfx/nine_image_painter_unittest.cc
index 6b2f10a..3394c5e 100644
--- a/ui/gfx/nine_image_painter_unittest.cc
+++ b/ui/gfx/nine_image_painter_unittest.cc
@@ -58,9 +58,9 @@
   for (int y = 0; y < 200; y++) {
     for (int x = 0; x < 400; x++) {
       if (green_rect.contains(x, y)) {
-        EXPECT_EQ(SK_ColorGREEN, result.getColor(x, y));
+        ASSERT_EQ(SK_ColorGREEN, result.getColor(x, y));
       } else {
-        EXPECT_EQ(SK_ColorRED, result.getColor(x, y));
+        ASSERT_EQ(SK_ColorRED, result.getColor(x, y));
       }
     }
   }
@@ -103,4 +103,73 @@
   EXPECT_EQ(SK_ColorBLACK, result.getColor(2, 2));
 }
 
+TEST(NineImagePainterTest, PaintWithBoundOffset) {
+  SkBitmap src;
+  src.allocN32Pixels(10, 10);
+  src.eraseColor(SK_ColorRED);
+  src.eraseArea(SkIRect::MakeXYWH(1, 1, 8, 8), SK_ColorGREEN);
+
+  gfx::ImageSkia image(gfx::ImageSkiaRep(src, 0.0f));
+  gfx::Insets insets(1, 1, 1, 1);
+  gfx::NineImagePainter painter(image, insets);
+
+  bool is_opaque = true;
+  gfx::Canvas canvas(gfx::Size(10, 10), 1, is_opaque);
+
+  gfx::Rect bounds(1, 1, 10, 10);
+  painter.Paint(&canvas, bounds);
+
+  SkBitmap result;
+  const SkISize size = canvas.sk_canvas()->getDeviceSize();
+  result.allocN32Pixels(size.width(), size.height());
+  canvas.sk_canvas()->readPixels(&result, 0, 0);
+
+  SkIRect green_rect = SkIRect::MakeLTRB(2, 2, 10, 10);
+  for (int y = 1; y < 10; y++) {
+    for (int x = 1; x < 10; x++) {
+      if (green_rect.contains(x, y)) {
+        ASSERT_EQ(SK_ColorGREEN, result.getColor(x, y));
+      } else {
+        ASSERT_EQ(SK_ColorRED, result.getColor(x, y));
+      }
+    }
+  }
+}
+
+TEST(NineImagePainterTest, PaintWithNagativeScale) {
+  SkBitmap src;
+  src.allocN32Pixels(100, 100);
+  src.eraseColor(SK_ColorRED);
+  src.eraseArea(SkIRect::MakeXYWH(10, 10, 80, 80), SK_ColorGREEN);
+
+  gfx::ImageSkia image(gfx::ImageSkiaRep(src, 0.0f));
+  gfx::Insets insets(10, 10, 10, 10);
+  gfx::NineImagePainter painter(image, insets);
+
+  int image_scale = 2;
+  bool is_opaque = true;
+  gfx::Canvas canvas(gfx::Size(400, 400), image_scale, is_opaque);
+  canvas.Translate(gfx::Vector2d(200, 200));
+  canvas.Scale(-2, -1);
+
+  gfx::Rect bounds(0, 0, 100, 100);
+  painter.Paint(&canvas, bounds);
+
+  SkBitmap result;
+  const SkISize size = canvas.sk_canvas()->getDeviceSize();
+  result.allocN32Pixels(size.width(), size.height());
+  canvas.sk_canvas()->readPixels(&result, 0, 0);
+
+  SkIRect green_rect = SkIRect::MakeLTRB(40, 220, 360, 380);
+  for (int y = 200; y < 400; y++) {
+    for (int x = 0; x < 400; x++) {
+      if (green_rect.contains(x, y)) {
+        ASSERT_EQ(SK_ColorGREEN, result.getColor(x, y));
+      } else {
+        ASSERT_EQ(SK_ColorRED, result.getColor(x, y));
+      }
+    }
+  }
+}
+
 }  // namespace gfx
diff --git a/ui/gl/BUILD.gn b/ui/gl/BUILD.gn
index c63b290..bfd095b 100644
--- a/ui/gl/BUILD.gn
+++ b/ui/gl/BUILD.gn
@@ -157,6 +157,9 @@
   if (is_linux) {
     deps += [ "//third_party/libevent" ]
   }
+  if (!is_android) {  # TODO(GYP) Enable on Android when osmesa links.
+    deps += [ "//third_party/mesa:osmesa" ]
+  }
   if (use_x11) {
     sources += [
       "gl_bindings_autogen_glx.cc",
@@ -285,14 +288,21 @@
 }
 
 source_set("test_support") {
+  testonly = true
   sources = [
+    "test/gl_image_test_support.cc",
+    "test/gl_image_test_support.h",
+    "test/gl_image_test_template.h",
     "test/gl_surface_test_support.cc",
     "test/gl_surface_test_support.h",
+    "test/gl_test_helper.cc",
+    "test/gl_test_helper.h",
   ]
 
   configs += [ "//third_party/khronos:khronos_headers" ]
 
   deps = [
+    "//testing/gtest",
     ":gl",
   ]
 
@@ -317,6 +327,8 @@
 test("gl_unittests") {
   sources = [
     "gl_api_unittest.cc",
+    "gl_image_ref_counted_memory_unittest.cc",
+    "gl_image_shared_memory_unittest.cc",
     "gpu_timing_unittest.cc",
     "test/run_all_unittests.cc",
   ]
@@ -340,8 +352,14 @@
     ":test_support",
     "//base",
     "//base/test:test_support",
+    "//skia",
     "//testing/gmock",
     "//testing/gtest",
+    "//ui/gfx",
+  ]
+
+  data_deps = [
+    "//third_party/mesa:osmesa",
   ]
 }
 
diff --git a/ui/gl/gl.gyp b/ui/gl/gl.gyp
index f0f026a..16e8cc1 100644
--- a/ui/gl/gl.gyp
+++ b/ui/gl/gl.gyp
@@ -298,6 +298,7 @@
       'target_name': 'gl_test_support',
       'type': 'static_library',
       'dependencies': [
+        '<(DEPTH)/testing/gtest.gyp:gtest',
         '../../third_party/khronos/khronos.gyp:khronos_headers',
         'gl',
       ],
@@ -305,8 +306,13 @@
         '../..',
       ],
       'sources': [
+        'test/gl_image_test_support.cc',
+        'test/gl_image_test_support.h',
+        'test/gl_image_test_template.h',
         'test/gl_surface_test_support.cc',
         'test/gl_surface_test_support.h',
+        'test/gl_test_helper.cc',
+        'test/gl_test_helper.h',
       ],
       'conditions': [
         ['use_x11==1', {
diff --git a/ui/gl/gl_api_unittest.cc b/ui/gl/gl_api_unittest.cc
index 66c9380..a5d1a9c1 100644
--- a/ui/gl/gl_api_unittest.cc
+++ b/ui/gl/gl_api_unittest.cc
@@ -40,6 +40,7 @@
     num_fake_extension_strings_ = 0;
     fake_extension_strings_ = nullptr;
 
+    DCHECK(!g_current_gl_context_tls);
     g_current_gl_context_tls = new base::ThreadLocalPointer<GLApi>;
 
     SetGLGetProcAddressProc(
@@ -53,6 +54,7 @@
   void TearDown() override {
     api_.reset(nullptr);
     delete g_current_gl_context_tls;
+    g_current_gl_context_tls = nullptr;
 
     SetGLImplementation(kGLImplementationNone);
     fake_extension_string_ = "";
diff --git a/ui/gl/gl_context.cc b/ui/gl/gl_context.cc
index ada2127..42dadd2 100644
--- a/ui/gl/gl_context.cc
+++ b/ui/gl/gl_context.cc
@@ -206,10 +206,7 @@
 
 bool GLContext::InitializeDynamicBindings() {
   DCHECK(IsCurrent(nullptr));
-  static bool initialized = false;
-  if (initialized)
-    return initialized;
-  initialized = InitializeDynamicGLBindings(GetGLImplementation(), this);
+  bool initialized = InitializeDynamicGLBindings(GetGLImplementation(), this);
   if (!initialized)
     LOG(ERROR) << "Could not initialize dynamic bindings.";
   return initialized;
diff --git a/ui/gl/gl_gl_api_implementation.cc b/ui/gl/gl_gl_api_implementation.cc
index 9ebb3aec..b6d55980 100644
--- a/ui/gl/gl_gl_api_implementation.cc
+++ b/ui/gl/gl_gl_api_implementation.cc
@@ -334,6 +334,8 @@
 }
 
 void InitializeDynamicGLBindingsGL(GLContext* context) {
+  if (g_version_info)
+    return;
   g_real_gl->InitializeFilteredExtensions();
   g_driver_gl.InitializeCustomDynamicBindings(context);
   DCHECK(context && context->IsCurrent(NULL) && !g_version_info);
diff --git a/ui/gl/gl_image_io_surface.h b/ui/gl/gl_image_io_surface.h
index bf65b0f5..56b4478 100644
--- a/ui/gl/gl_image_io_surface.h
+++ b/ui/gl/gl_image_io_surface.h
@@ -22,11 +22,11 @@
 
 class GL_EXPORT GLImageIOSurface : public GLImage {
  public:
-  GLImageIOSurface(gfx::GenericSharedMemoryId io_surface_id,
-                   const gfx::Size& size,
-                   unsigned internalformat);
+  GLImageIOSurface(const gfx::Size& size, unsigned internalformat);
 
-  bool Initialize(IOSurfaceRef io_surface, BufferFormat format);
+  bool Initialize(IOSurfaceRef io_surface,
+                  gfx::GenericSharedMemoryId io_surface_id,
+                  BufferFormat format);
 
   // Overridden from GLImage:
   void Destroy(bool have_context) override;
@@ -59,11 +59,11 @@
   ~GLImageIOSurface() override;
 
  private:
-  gfx::GenericSharedMemoryId io_surface_id_;
   const gfx::Size size_;
   const unsigned internalformat_;
   BufferFormat format_;
   base::ScopedCFTypeRef<IOSurfaceRef> io_surface_;
+  gfx::GenericSharedMemoryId io_surface_id_;
   base::ThreadChecker thread_checker_;
 
   DISALLOW_COPY_AND_ASSIGN(GLImageIOSurface);
diff --git a/ui/gl/gl_image_io_surface.mm b/ui/gl/gl_image_io_surface.mm
index 211226a2..3f4964e 100644
--- a/ui/gl/gl_image_io_surface.mm
+++ b/ui/gl/gl_image_io_surface.mm
@@ -138,11 +138,9 @@
 
 }  // namespace
 
-GLImageIOSurface::GLImageIOSurface(gfx::GenericSharedMemoryId io_surface_id,
-                                   const gfx::Size& size,
+GLImageIOSurface::GLImageIOSurface(const gfx::Size& size,
                                    unsigned internalformat)
-    : io_surface_id_(io_surface_id),
-      size_(size),
+    : size_(size),
       internalformat_(internalformat),
       format_(BufferFormat::RGBA_8888) {}
 
@@ -152,6 +150,7 @@
 }
 
 bool GLImageIOSurface::Initialize(IOSurfaceRef io_surface,
+                                  gfx::GenericSharedMemoryId io_surface_id,
                                   BufferFormat format) {
   DCHECK(thread_checker_.CalledOnValidThread());
   DCHECK(!io_surface_);
@@ -168,6 +167,7 @@
 
   format_ = format;
   io_surface_.reset(io_surface, base::scoped_policy::RETAIN);
+  io_surface_id_ = io_surface_id;
   return true;
 }
 
diff --git a/ui/gl/gl_image_ref_counted_memory_unittest.cc b/ui/gl/gl_image_ref_counted_memory_unittest.cc
new file mode 100644
index 0000000..1edccf2
--- /dev/null
+++ b/ui/gl/gl_image_ref_counted_memory_unittest.cc
@@ -0,0 +1,41 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include <vector>
+
+#include "base/memory/ref_counted_memory.h"
+#include "testing/gtest/include/gtest/gtest.h"
+#include "ui/gl/gl_image_ref_counted_memory.h"
+#include "ui/gl/test/gl_image_test_template.h"
+
+namespace gfx {
+namespace {
+
+class GLImageRefCountedMemoryTestDelegate {
+ public:
+  scoped_refptr<GLImage> CreateSolidColorImage(const Size& size,
+                                               unsigned internalformat,
+                                               BufferFormat format,
+                                               const uint8_t color[4]) const {
+    DCHECK_EQ(NumberOfPlanesForBufferFormat(format), 1u);
+    std::vector<uint8_t> data(BufferSizeForBufferFormat(size, format));
+    scoped_refptr<base::RefCountedBytes> bytes(new base::RefCountedBytes(data));
+    GLImageTestSupport::SetBufferDataToColor(
+        size.width(), size.height(),
+        static_cast<int>(RowSizeForBufferFormat(size.width(), format, 0)),
+        format, color, &bytes->data().front());
+    scoped_refptr<GLImageRefCountedMemory> image(
+        new GLImageRefCountedMemory(size, internalformat));
+    bool rv = image->Initialize(bytes.get(), format);
+    EXPECT_TRUE(rv);
+    return image;
+  }
+};
+
+INSTANTIATE_TYPED_TEST_CASE_P(GLImageRefCountedMemory,
+                              GLImageTest,
+                              GLImageRefCountedMemoryTestDelegate);
+
+}  // namespace
+}  // namespace gfx
diff --git a/ui/gl/gl_image_shared_memory.cc b/ui/gl/gl_image_shared_memory.cc
index 33ba4d1..16ec6cb 100644
--- a/ui/gl/gl_image_shared_memory.cc
+++ b/ui/gl/gl_image_shared_memory.cc
@@ -40,16 +40,18 @@
   DCHECK(!shared_memory_);
 }
 
-bool GLImageSharedMemory::Initialize(const gfx::GpuMemoryBufferHandle& handle,
-                                     gfx::BufferFormat format) {
+bool GLImageSharedMemory::Initialize(
+    const base::SharedMemoryHandle& handle,
+    gfx::GenericSharedMemoryId shared_memory_id,
+    gfx::BufferFormat format) {
   size_t size_in_bytes;
   if (!SizeInBytes(GetSize(), format, &size_in_bytes))
     return false;
 
-  if (!base::SharedMemory::IsHandleValid(handle.handle))
+  if (!base::SharedMemory::IsHandleValid(handle))
     return false;
 
-  base::SharedMemory shared_memory(handle.handle, true);
+  base::SharedMemory shared_memory(handle, true);
 
   // Duplicate the handle.
   base::SharedMemoryHandle duped_shared_memory_handle;
@@ -73,7 +75,7 @@
 
   DCHECK(!shared_memory_);
   shared_memory_ = duped_shared_memory.Pass();
-  shared_memory_id_ = handle.id;
+  shared_memory_id_ = shared_memory_id;
   return true;
 }
 
diff --git a/ui/gl/gl_image_shared_memory.h b/ui/gl/gl_image_shared_memory.h
index d9233cb1..622eb3d 100644
--- a/ui/gl/gl_image_shared_memory.h
+++ b/ui/gl/gl_image_shared_memory.h
@@ -6,7 +6,7 @@
 #define UI_GL_GL_IMAGE_SHARED_MEMORY_H_
 
 #include "base/memory/scoped_ptr.h"
-#include "ui/gfx/gpu_memory_buffer.h"
+#include "base/memory/shared_memory_handle.h"
 #include "ui/gl/gl_image_memory.h"
 
 namespace gfx {
@@ -15,8 +15,9 @@
  public:
   GLImageSharedMemory(const gfx::Size& size, unsigned internalformat);
 
-  bool Initialize(const gfx::GpuMemoryBufferHandle& handle,
-                  gfx::BufferFormat format);
+  bool Initialize(const base::SharedMemoryHandle& handle,
+                  gfx::GenericSharedMemoryId shared_memory_id,
+                  BufferFormat format);
 
   // Overridden from GLImage:
   void Destroy(bool have_context) override;
@@ -29,7 +30,7 @@
 
  private:
   scoped_ptr<base::SharedMemory> shared_memory_;
-  gfx::GenericSharedMemoryId shared_memory_id_;
+  GenericSharedMemoryId shared_memory_id_;
 
   DISALLOW_COPY_AND_ASSIGN(GLImageSharedMemory);
 };
diff --git a/ui/gl/gl_image_shared_memory_unittest.cc b/ui/gl/gl_image_shared_memory_unittest.cc
new file mode 100644
index 0000000..44c8e97
--- /dev/null
+++ b/ui/gl/gl_image_shared_memory_unittest.cc
@@ -0,0 +1,43 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "base/memory/shared_memory.h"
+#include "testing/gtest/include/gtest/gtest.h"
+#include "ui/gl/gl_image_shared_memory.h"
+#include "ui/gl/test/gl_image_test_template.h"
+
+namespace gfx {
+namespace {
+
+class GLImageSharedMemoryTestDelegate {
+ public:
+  scoped_refptr<GLImage> CreateSolidColorImage(const Size& size,
+                                               unsigned internalformat,
+                                               BufferFormat format,
+                                               const uint8_t color[4]) const {
+    DCHECK_EQ(NumberOfPlanesForBufferFormat(format), 1u);
+    base::SharedMemory shared_memory;
+    bool rv = shared_memory.CreateAndMapAnonymous(
+        BufferSizeForBufferFormat(size, format));
+    DCHECK(rv);
+    GLImageTestSupport::SetBufferDataToColor(
+        size.width(), size.height(),
+        static_cast<int>(RowSizeForBufferFormat(size.width(), format, 0)),
+        format, color, reinterpret_cast<uint8_t*>(shared_memory.memory()));
+    scoped_refptr<GLImageSharedMemory> image(
+        new GLImageSharedMemory(size, internalformat));
+    rv = image->Initialize(
+        base::SharedMemory::DuplicateHandle(shared_memory.handle()),
+        GenericSharedMemoryId(0), format);
+    EXPECT_TRUE(rv);
+    return image;
+  }
+};
+
+INSTANTIATE_TYPED_TEST_CASE_P(GLImageSharedMemory,
+                              GLImageTest,
+                              GLImageSharedMemoryTestDelegate);
+
+}  // namespace
+}  // namespace gfx
diff --git a/ui/gl/gl_surface_glx.cc b/ui/gl/gl_surface_glx.cc
index 49ff0411..3f82e271 100644
--- a/ui/gl/gl_surface_glx.cc
+++ b/ui/gl/gl_surface_glx.cc
@@ -34,7 +34,6 @@
 namespace {
 
 Display* g_display = nullptr;
-const char* g_glx_extensions = nullptr;
 bool g_glx_context_create = false;
 bool g_glx_create_context_robustness_supported = false;
 bool g_glx_texture_from_pixmap_supported = false;
@@ -349,7 +348,6 @@
     return false;
   }
 
-  g_glx_extensions = glXQueryExtensionsString(g_display, 0);
   g_glx_context_create =
       HasGLXExtension("GLX_ARB_create_context");
   g_glx_create_context_robustness_supported =
@@ -371,7 +369,7 @@
 
 // static
 const char* GLSurfaceGLX::GetGLXExtensions() {
-  return g_glx_extensions;
+  return glXQueryExtensionsString(g_display, 0);
 }
 
 // static
diff --git a/ui/gl/gl_tests.gyp b/ui/gl/gl_tests.gyp
index 4f7e2dd..09821e7 100644
--- a/ui/gl/gl_tests.gyp
+++ b/ui/gl/gl_tests.gyp
@@ -14,6 +14,8 @@
         'test/run_all_unittests.cc',
         'gpu_timing_unittest.cc',
         'gl_api_unittest.cc',
+        'gl_image_ref_counted_memory_unittest.cc',
+        'gl_image_shared_memory_unittest.cc',
       ],
       'include_dirs': [
         '<(DEPTH)/third_party/khronos',
@@ -21,8 +23,11 @@
       'dependencies': [
         '<(DEPTH)/base/base.gyp:base',
         '<(DEPTH)/base/base.gyp:test_support_base',
+        '<(DEPTH)/skia/skia.gyp:skia',
         '<(DEPTH)/testing/gmock.gyp:gmock',
         '<(DEPTH)/testing/gtest.gyp:gtest',
+        '<(DEPTH)/third_party/mesa/mesa.gyp:osmesa',
+        '<(DEPTH)/ui/gfx/gfx.gyp:gfx',
         '<(DEPTH)/ui/gl/gl.gyp:gl',
         '<(DEPTH)/ui/gl/gl.gyp:gl_test_support',
         '<(DEPTH)/ui/gl/gl.gyp:gl_unittest_utils',
@@ -67,8 +72,29 @@
           'includes': [ '../../build/apk_test.gypi' ],
         },
       ],
+      'conditions': [
+        ['test_isolation_mode != "noop"',
+          {
+            'targets': [
+              {
+                'target_name': 'gl_unittests_apk_run',
+                'type': 'none',
+                'dependencies': [
+                  'gl_unittests_apk',
+                ],
+                'includes': [
+                  '../../build/isolate.gypi',
+                ],
+                'sources': [
+                  'gl_unittests_apk.isolate',
+                ],
+              },
+            ]
+          }
+        ],
+      ],
     }],
-    ['test_isolation_mode != "noop"', {
+    ['test_isolation_mode != "noop" and OS != "android"', {
       'targets': [
         {
           'target_name': 'gl_unittests_run',
diff --git a/ui/gl/gl_unittests_apk.isolate b/ui/gl/gl_unittests_apk.isolate
new file mode 100644
index 0000000..1032ef6
--- /dev/null
+++ b/ui/gl/gl_unittests_apk.isolate
@@ -0,0 +1,17 @@
+# 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.
+{
+  'includes': [
+    '../../build/android/android.isolate',
+  ],
+  'variables': {
+    'command': [
+      '<(PRODUCT_DIR)/bin/run_gl_unittests',
+    ],
+    'files': [
+      '<(PRODUCT_DIR)/bin/run_gl_unittests',
+      '<(PRODUCT_DIR)/gl_unittests_apk/',
+    ]
+  },
+}
diff --git a/ui/gl/test/gl_image_test_support.cc b/ui/gl/test/gl_image_test_support.cc
new file mode 100644
index 0000000..c6f5bf3
--- /dev/null
+++ b/ui/gl/test/gl_image_test_support.cc
@@ -0,0 +1,102 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "ui/gl/test/gl_image_test_support.h"
+
+#include <vector>
+
+#include "third_party/skia/include/core/SkTypes.h"
+#include "ui/gl/gl_context.h"
+#include "ui/gl/gl_implementation.h"
+#include "ui/gl/gl_version_info.h"
+#include "ui/gl/test/gl_surface_test_support.h"
+
+#if defined(USE_OZONE)
+#include "base/message_loop/message_loop.h"
+#endif
+
+namespace gfx {
+
+// static
+void GLImageTestSupport::InitializeGL() {
+#if defined(USE_OZONE)
+  // On Ozone, the backend initializes the event system using a UI thread.
+  base::MessageLoopForUI main_loop;
+#endif
+
+  std::vector<GLImplementation> allowed_impls;
+  GetAllowedGLImplementations(&allowed_impls);
+  DCHECK(!allowed_impls.empty());
+
+  GLImplementation impl = allowed_impls[0];
+  GLSurfaceTestSupport::InitializeOneOffImplementation(impl, true);
+}
+
+// static
+void GLImageTestSupport::CleanupGL() {
+  ClearGLBindings();
+}
+
+// static
+GLenum GLImageTestSupport::GetPreferredInternalFormat() {
+  bool has_texture_format_bgra8888 =
+      GLContext::GetCurrent()->HasExtension(
+          "GL_APPLE_texture_format_BGRA8888") ||
+      GLContext::GetCurrent()->HasExtension("GL_EXT_texture_format_BGRA8888") ||
+      !GLContext::GetCurrent()->GetVersionInfo()->is_es;
+  return (!SK_B32_SHIFT && has_texture_format_bgra8888) ? GL_BGRA_EXT : GL_RGBA;
+}
+
+// static
+BufferFormat GLImageTestSupport::GetPreferredBufferFormat() {
+  return GetPreferredInternalFormat() == GL_BGRA_EXT ? BufferFormat::BGRA_8888
+                                                     : BufferFormat::RGBA_8888;
+}
+
+// static
+void GLImageTestSupport::SetBufferDataToColor(int width,
+                                              int height,
+                                              int stride,
+                                              BufferFormat format,
+                                              const uint8_t color[4],
+                                              uint8_t* data) {
+  switch (format) {
+    case BufferFormat::RGBA_8888:
+      for (int y = 0; y < height; ++y) {
+        for (int x = 0; x < width; ++x) {
+          data[y * stride + x * 4 + 0] = color[0];
+          data[y * stride + x * 4 + 1] = color[1];
+          data[y * stride + x * 4 + 2] = color[2];
+          data[y * stride + x * 4 + 3] = color[3];
+        }
+      }
+      return;
+    case BufferFormat::BGRA_8888:
+      for (int y = 0; y < height; ++y) {
+        for (int x = 0; x < width; ++x) {
+          data[y * stride + x * 4 + 0] = color[2];
+          data[y * stride + x * 4 + 1] = color[1];
+          data[y * stride + x * 4 + 2] = color[0];
+          data[y * stride + x * 4 + 3] = color[3];
+        }
+      }
+      return;
+    case BufferFormat::ATC:
+    case BufferFormat::ATCIA:
+    case BufferFormat::DXT1:
+    case BufferFormat::DXT5:
+    case BufferFormat::ETC1:
+    case BufferFormat::R_8:
+    case BufferFormat::RGBA_4444:
+    case BufferFormat::BGRX_8888:
+    case BufferFormat::UYVY_422:
+    case BufferFormat::YUV_420_BIPLANAR:
+    case BufferFormat::YUV_420:
+      NOTREACHED();
+      return;
+  }
+  NOTREACHED();
+}
+
+}  // namespace gfx
diff --git a/ui/gl/test/gl_image_test_support.h b/ui/gl/test/gl_image_test_support.h
new file mode 100644
index 0000000..782f2075
--- /dev/null
+++ b/ui/gl/test/gl_image_test_support.h
@@ -0,0 +1,38 @@
+// 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 UI_GL_TEST_GL_IMAGE_TEST_SUPPORT_H_
+#define UI_GL_TEST_GL_IMAGE_TEST_SUPPORT_H_
+
+#include "ui/gfx/buffer_types.h"
+#include "ui/gl/gl_bindings.h"
+
+namespace gfx {
+
+class GLImageTestSupport {
+ public:
+  // Initialize GL for image testing.
+  static void InitializeGL();
+
+  // Cleanup GL after being initialized for image testing.
+  static void CleanupGL();
+
+  // Returns the preferred internal format used for images.
+  static GLenum GetPreferredInternalFormat();
+
+  // Returns the preferred buffer format used for images.
+  static BufferFormat GetPreferredBufferFormat();
+
+  // Initialize buffer of a specific |format| to |color|.
+  static void SetBufferDataToColor(int width,
+                                   int height,
+                                   int stride,
+                                   BufferFormat format,
+                                   const uint8_t color[4],
+                                   uint8_t* data);
+};
+
+}  // namespace gfx
+
+#endif  // UI_GL_TEST_GL_IMAGE_TEST_SUPPORT_H_
diff --git a/ui/gl/test/gl_image_test_template.h b/ui/gl/test/gl_image_test_template.h
new file mode 100644
index 0000000..8533ce20
--- /dev/null
+++ b/ui/gl/test/gl_image_test_template.h
@@ -0,0 +1,182 @@
+// 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.
+
+// This file defines tests that implementations of GLImage should pass in order
+// to be conformant.
+
+#ifndef UI_GL_TEST_GL_IMAGE_TEST_TEMPLATE_H_
+#define UI_GL_TEST_GL_IMAGE_TEST_TEMPLATE_H_
+
+#include "base/basictypes.h"
+#include "base/memory/scoped_ptr.h"
+#include "base/strings/stringize_macros.h"
+#include "base/strings/stringprintf.h"
+#include "testing/gtest/include/gtest/gtest.h"
+#include "ui/gfx/buffer_format_util.h"
+#include "ui/gfx/buffer_types.h"
+#include "ui/gl/gl_bindings.h"
+#include "ui/gl/gl_context.h"
+#include "ui/gl/gl_image.h"
+#include "ui/gl/gl_implementation.h"
+#include "ui/gl/gl_surface.h"
+#include "ui/gl/test/gl_image_test_support.h"
+#include "ui/gl/test/gl_test_helper.h"
+
+namespace gfx {
+
+template <typename GLImageTestDelegate>
+class GLImageTest : public testing::Test {
+ protected:
+  // Overridden from testing::Test:
+  void SetUp() override {
+    GLImageTestSupport::InitializeGL();
+    surface_ = GLSurface::CreateOffscreenGLSurface(Size());
+    context_ = GLContext::CreateGLContext(nullptr, surface_.get(),
+                                          PreferIntegratedGpu);
+    context_->MakeCurrent(surface_.get());
+  }
+  void TearDown() override {
+    context_->ReleaseCurrent(surface_.get());
+    context_ = nullptr;
+    surface_ = nullptr;
+    GLImageTestSupport::CleanupGL();
+  }
+
+ protected:
+  scoped_refptr<GLSurface> surface_;
+  scoped_refptr<GLContext> context_;
+  GLImageTestDelegate delegate_;
+};
+
+TYPED_TEST_CASE_P(GLImageTest);
+
+// Copy image to texture. Support is optional. Texels should be updated if
+// supported, and left unchanged if not.
+TYPED_TEST_P(GLImageTest, CopyTexSubImage) {
+  const Size image_size(256, 256);
+  const uint8_t image_color[] = {0, 0xff, 0, 0xff};
+  const uint8_t texture_color[] = {0, 0, 0xff, 0xff};
+
+  GLuint framebuffer =
+      GLTestHelper::SetupFramebuffer(image_size.width(), image_size.height());
+  ASSERT_TRUE(framebuffer);
+  glBindFramebufferEXT(GL_FRAMEBUFFER, framebuffer);
+  glViewport(0, 0, image_size.width(), image_size.height());
+
+  // Create a solid color green image of preferred format. This must succeed
+  // in order for a GLImage to be conformant.
+  scoped_refptr<GLImage> image = this->delegate_.CreateSolidColorImage(
+      image_size, GLImageTestSupport::GetPreferredInternalFormat(),
+      GLImageTestSupport::GetPreferredBufferFormat(), image_color);
+  ASSERT_TRUE(image);
+
+  // Create a solid color blue texture of the same size as |image|.
+  GLuint texture = GLTestHelper::CreateTexture(GL_TEXTURE_2D);
+  scoped_ptr<uint8_t[]> pixels(new uint8_t[BufferSizeForBufferFormat(
+      image_size, GLImageTestSupport::GetPreferredBufferFormat())]);
+  GLImageTestSupport::SetBufferDataToColor(
+      image_size.width(), image_size.height(),
+      static_cast<int>(RowSizeForBufferFormat(
+          image_size.width(), GLImageTestSupport::GetPreferredBufferFormat(),
+          0)),
+      GLImageTestSupport::GetPreferredBufferFormat(), texture_color,
+      pixels.get());
+  // Note: This test assume that |image| can be used with GL_TEXTURE_2D but
+  // that might not be the case for some GLImage implementations.
+  glBindTexture(GL_TEXTURE_2D, texture);
+  glTexImage2D(GL_TEXTURE_2D, 0,
+               GLImageTestSupport::GetPreferredInternalFormat(),
+               image_size.width(), image_size.height(), 0,
+               GLImageTestSupport::GetPreferredInternalFormat(),
+               GL_UNSIGNED_BYTE, pixels.get());
+
+  // Attempt to copy |image| to |texture|.
+  // Returns true on success, false on failure.
+  bool rv = image->CopyTexSubImage(GL_TEXTURE_2D, Point(), Rect(image_size));
+
+  // clang-format off
+  const char kVertexShader[] = STRINGIZE(
+    attribute vec2 a_position;
+    attribute vec2 a_texCoord;
+    varying vec2 v_texCoord;
+    void main() {
+      gl_Position = vec4(a_position.x, a_position.y, 0.0, 1.0);
+      v_texCoord = a_texCoord;
+    }
+  );
+  const char kFragmentShader[] = STRINGIZE(
+    uniform sampler2D a_texture;
+    varying vec2 v_texCoord;
+    void main() {
+      gl_FragColor = texture2D(a_texture, v_texCoord);
+    }
+  );
+  const char kShaderFloatPrecision[] = STRINGIZE(
+    precision mediump float;
+  );
+  // clang-format on
+
+  GLuint vertex_shader =
+      GLTestHelper::LoadShader(GL_VERTEX_SHADER, kVertexShader);
+  bool is_gles = GetGLImplementation() == kGLImplementationEGLGLES2;
+  GLuint fragment_shader = GLTestHelper::LoadShader(
+      GL_FRAGMENT_SHADER,
+      base::StringPrintf("%s%s", is_gles ? kShaderFloatPrecision : "",
+                         kFragmentShader)
+          .c_str());
+  GLuint program = GLTestHelper::SetupProgram(vertex_shader, fragment_shader);
+  EXPECT_NE(program, 0u);
+  glUseProgram(program);
+
+  GLint sampler_location = glGetUniformLocation(program, "a_texture");
+  ASSERT_NE(sampler_location, -1);
+  glUniform1i(sampler_location, 0);
+
+  // clang-format off
+  static GLfloat vertices[] = {
+    -1.f, -1.f, 0.f, 0.f,
+     1.f, -1.f, 1.f, 0.f,
+    -1.f,  1.f, 0.f, 1.f,
+     1.f,  1.f, 1.f, 1.f
+  };
+  // clang-format on
+
+  GLuint vertex_buffer;
+  glGenBuffersARB(1, &vertex_buffer);
+  glBindBuffer(GL_ARRAY_BUFFER, vertex_buffer);
+  glBufferData(GL_ARRAY_BUFFER, sizeof(vertices), vertices, GL_STATIC_DRAW);
+  GLint position_location = glGetAttribLocation(program, "a_position");
+  ASSERT_NE(position_location, -1);
+  glEnableVertexAttribArray(position_location);
+  glVertexAttribPointer(position_location, 2, GL_FLOAT, GL_FALSE,
+                        sizeof(GLfloat) * 4, 0);
+  GLint tex_coord_location = glGetAttribLocation(program, "a_texCoord");
+  EXPECT_NE(tex_coord_location, -1);
+  glEnableVertexAttribArray(tex_coord_location);
+  glVertexAttribPointer(tex_coord_location, 2, GL_FLOAT, GL_FALSE,
+                        sizeof(GLfloat) * 4,
+                        reinterpret_cast<void*>(sizeof(GLfloat) * 2));
+
+  // Draw |texture| to viewport and read back pixels to check expectations.
+  glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
+  GLTestHelper::CheckPixels(0, 0, image_size.width(), image_size.height(),
+                            rv ? image_color : texture_color);
+
+  // Clean up.
+  glDeleteProgram(program);
+  glDeleteShader(vertex_shader);
+  glDeleteShader(fragment_shader);
+  glDeleteBuffersARB(1, &vertex_buffer);
+  glDeleteTextures(1, &texture);
+  glDeleteFramebuffersEXT(1, &framebuffer);
+  image->Destroy(true);
+}
+
+// The GLImageTest test case verifies behaviour that is expected from a
+// GLImage in order to be conformant.
+REGISTER_TYPED_TEST_CASE_P(GLImageTest, CopyTexSubImage);
+
+}  // namespace gfx
+
+#endif  // UI_GL_TEST_GL_IMAGE_TEST_TEMPLATE_H_
diff --git a/ui/gl/test/gl_surface_test_support.cc b/ui/gl/test/gl_surface_test_support.cc
index ecc8015..99ae718 100644
--- a/ui/gl/test/gl_surface_test_support.cc
+++ b/ui/gl/test/gl_surface_test_support.cc
@@ -61,21 +61,26 @@
 }
 
 // static
-void GLSurfaceTestSupport::InitializeOneOffWithMockBindings() {
+void GLSurfaceTestSupport::InitializeOneOffImplementation(
+    GLImplementation impl,
+    bool fallback_to_osmesa) {
   DCHECK(!base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kUseGL))
       << "kUseGL has not effect in tests";
 
   // This method may be called multiple times in the same process to set up
-  // mock bindings in different ways.
+  // bindings in different ways.
   ClearGLBindings();
 
-  bool fallback_to_osmesa = false;
   bool gpu_service_logging = false;
   bool disable_gl_drawing = false;
 
   CHECK(GLSurface::InitializeOneOffImplementation(
-      kGLImplementationMockGL, fallback_to_osmesa, gpu_service_logging,
-      disable_gl_drawing));
+      impl, fallback_to_osmesa, gpu_service_logging, disable_gl_drawing));
+}
+
+// static
+void GLSurfaceTestSupport::InitializeOneOffWithMockBindings() {
+  InitializeOneOffImplementation(kGLImplementationMockGL, false);
 }
 
 // static
diff --git a/ui/gl/test/gl_surface_test_support.h b/ui/gl/test/gl_surface_test_support.h
index 6e53c69..eb70ef05 100644
--- a/ui/gl/test/gl_surface_test_support.h
+++ b/ui/gl/test/gl_surface_test_support.h
@@ -5,6 +5,8 @@
 #ifndef UI_GL_TEST_GL_SURFACE_TEST_SUPPORT_H_
 #define UI_GL_TEST_GL_SURFACE_TEST_SUPPORT_H_
 
+#include "ui/gl/gl_implementation.h"
+
 namespace gfx {
 
 class GLContext;
@@ -12,6 +14,8 @@
 class GLSurfaceTestSupport {
  public:
   static void InitializeOneOff();
+  static void InitializeOneOffImplementation(GLImplementation impl,
+                                             bool fallback_to_osmesa);
   static void InitializeOneOffWithMockBindings();
   static void InitializeDynamicMockBindings(GLContext* context);
 };
diff --git a/ui/gl/test/gl_test_helper.cc b/ui/gl/test/gl_test_helper.cc
new file mode 100644
index 0000000..052a1b9
--- /dev/null
+++ b/ui/gl/test/gl_test_helper.cc
@@ -0,0 +1,141 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "ui/gl/test/gl_test_helper.h"
+
+#include <string>
+
+#include "base/memory/scoped_ptr.h"
+#include "testing/gtest/include/gtest/gtest.h"
+
+namespace gfx {
+
+// static
+GLuint GLTestHelper::CreateTexture(GLenum target) {
+  // Create the texture object.
+  GLuint texture = 0;
+  glGenTextures(1, &texture);
+  glBindTexture(target, texture);
+  glTexParameteri(target, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
+  glTexParameteri(target, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
+  glTexParameteri(target, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
+  glTexParameteri(target, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
+  return texture;
+}
+
+// static
+GLuint GLTestHelper::CompileShader(GLenum type, const char* src) {
+  GLuint shader = glCreateShader(type);
+  // Load the shader source.
+  glShaderSource(shader, 1, &src, nullptr);
+  // Compile the shader.
+  glCompileShader(shader);
+  return shader;
+}
+
+// static
+GLuint GLTestHelper::LoadShader(GLenum type, const char* src) {
+  GLuint shader = CompileShader(type, src);
+
+  // Check the compile status.
+  GLint value = 0;
+  glGetShaderiv(shader, GL_COMPILE_STATUS, &value);
+  if (!value) {
+    char buffer[1024];
+    GLsizei length = 0;
+    glGetShaderInfoLog(shader, sizeof(buffer), &length, buffer);
+    std::string log(buffer, length);
+    EXPECT_EQ(1, value) << "Error compiling shader: " << log;
+    glDeleteShader(shader);
+    shader = 0;
+  }
+  return shader;
+}
+
+// static
+GLuint GLTestHelper::LinkProgram(GLuint vertex_shader, GLuint fragment_shader) {
+  // Create the program object.
+  GLuint program = glCreateProgram();
+  glAttachShader(program, vertex_shader);
+  glAttachShader(program, fragment_shader);
+  // Link the program.
+  glLinkProgram(program);
+  return program;
+}
+
+// static
+GLuint GLTestHelper::SetupProgram(GLuint vertex_shader,
+                                  GLuint fragment_shader) {
+  GLuint program = LinkProgram(vertex_shader, fragment_shader);
+  // Check the link status.
+  GLint linked = 0;
+  glGetProgramiv(program, GL_LINK_STATUS, &linked);
+  if (!linked) {
+    char buffer[1024];
+    GLsizei length = 0;
+    glGetProgramInfoLog(program, sizeof(buffer), &length, buffer);
+    std::string log(buffer, length);
+    EXPECT_EQ(1, linked) << "Error linking program: " << log;
+    glDeleteProgram(program);
+    program = 0;
+  }
+  return program;
+}
+
+// static
+GLuint GLTestHelper::SetupFramebuffer(int width, int height) {
+  GLuint color_buffer_texture = CreateTexture(GL_TEXTURE_2D);
+  glBindTexture(GL_TEXTURE_2D, color_buffer_texture);
+  glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, width, height, 0, GL_RGBA,
+               GL_UNSIGNED_BYTE, nullptr);
+  GLuint framebuffer = 0;
+  glGenFramebuffersEXT(1, &framebuffer);
+  glBindFramebufferEXT(GL_FRAMEBUFFER, framebuffer);
+  glFramebufferTexture2DEXT(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D,
+                            color_buffer_texture, 0);
+  if (glCheckFramebufferStatusEXT(GL_FRAMEBUFFER) != GL_FRAMEBUFFER_COMPLETE) {
+    EXPECT_EQ(static_cast<GLenum>(GL_FRAMEBUFFER_COMPLETE),
+              glCheckFramebufferStatusEXT(GL_FRAMEBUFFER))
+        << "Error setting up framebuffer";
+    glDeleteFramebuffersEXT(1, &framebuffer);
+    framebuffer = 0;
+  }
+  glBindFramebufferEXT(GL_FRAMEBUFFER, 0);
+  glDeleteTextures(1, &color_buffer_texture);
+  return framebuffer;
+}
+
+// static
+bool GLTestHelper::CheckPixels(int x,
+                               int y,
+                               int width,
+                               int height,
+                               const uint8_t expected_color[4]) {
+  int size = width * height * 4;
+  scoped_ptr<uint8_t[]> pixels(new uint8_t[size]);
+  const uint8_t kCheckClearValue = 123u;
+  memset(pixels.get(), kCheckClearValue, size);
+  glReadPixels(x, y, width, height, GL_RGBA, GL_UNSIGNED_BYTE, pixels.get());
+  int bad_count = 0;
+  for (int yy = 0; yy < height; ++yy) {
+    for (int xx = 0; xx < width; ++xx) {
+      int offset = yy * width * 4 + xx * 4;
+      for (int jj = 0; jj < 4; ++jj) {
+        uint8_t actual = pixels[offset + jj];
+        uint8_t expected = expected_color[jj];
+        EXPECT_EQ(expected, actual) << " at " << (xx + x) << ", " << (yy + y)
+                                    << " channel " << jj;
+        bad_count += actual != expected;
+        // Exit early just so we don't spam the log but we print enough to
+        // hopefully make it easy to diagnose the issue.
+        if (bad_count > 16)
+          return false;
+      }
+    }
+  }
+
+  return !bad_count;
+}
+
+}  // namespace gfx
diff --git a/ui/gl/test/gl_test_helper.h b/ui/gl/test/gl_test_helper.h
new file mode 100644
index 0000000..f566525
--- /dev/null
+++ b/ui/gl/test/gl_test_helper.h
@@ -0,0 +1,49 @@
+// 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 UI_GL_TEST_GL_TEST_HELPER_H_
+#define UI_GL_TEST_GL_TEST_HELPER_H_
+
+#include "base/basictypes.h"
+#include "ui/gl/gl_bindings.h"
+
+namespace gfx {
+
+class GLTestHelper {
+ public:
+  // Creates a texture object.
+  // Does not check for errors, always returns texture.
+  static GLuint CreateTexture(GLenum target);
+
+  // Compiles a shader.
+  // Does not check for errors, always returns shader.
+  static GLuint CompileShader(GLenum type, const char* src);
+
+  // Compiles a shader and checks for compilation errors.
+  // Returns shader, 0 on failure.
+  static GLuint LoadShader(GLenum type, const char* src);
+
+  // Attaches 2 shaders and links them to a program.
+  // Does not check for errors, always returns program.
+  static GLuint LinkProgram(GLuint vertex_shader, GLuint fragment_shader);
+
+  // Attaches 2 shaders, links them to a program, and checks for errors.
+  // Returns program, 0 on failure.
+  static GLuint SetupProgram(GLuint vertex_shader, GLuint fragment_shader);
+
+  // Creates a framebuffer, attaches a color buffer, and checks for errors.
+  // Returns framebuffer, 0 on failure.
+  static GLuint SetupFramebuffer(int width, int height);
+
+  // Checks an area of pixels for a color.
+  static bool CheckPixels(GLint x,
+                          GLint y,
+                          GLsizei width,
+                          GLsizei height,
+                          const uint8_t expected_color[4]);
+};
+
+}  // namespace gfx
+
+#endif  // UI_GL_TEST_GL_TEST_HELPER_H_
diff --git a/ui/ozone/platform/drm/BUILD.gn b/ui/ozone/platform/drm/BUILD.gn
index c345691..f4eae52 100644
--- a/ui/ozone/platform/drm/BUILD.gn
+++ b/ui/ozone/platform/drm/BUILD.gn
@@ -45,10 +45,18 @@
     "gpu/drm_gpu_display_manager.h",
     "gpu/drm_gpu_platform_support.cc",
     "gpu/drm_gpu_platform_support.h",
+    "gpu/drm_thread.cc",
+    "gpu/drm_thread.h",
+    "gpu/drm_thread_message_proxy.cc",
+    "gpu/drm_thread_message_proxy.h",
+    "gpu/drm_thread_proxy.cc",
+    "gpu/drm_thread_proxy.h",
     "gpu/drm_vsync_provider.cc",
     "gpu/drm_vsync_provider.h",
     "gpu/drm_window.cc",
     "gpu/drm_window.h",
+    "gpu/drm_window_proxy.cc",
+    "gpu/drm_window_proxy.h",
     "gpu/gbm_buffer.cc",
     "gpu/gbm_buffer.h",
     "gpu/gbm_buffer_base.cc",
@@ -71,6 +79,8 @@
     "gpu/overlay_plane.h",
     "gpu/page_flip_request.cc",
     "gpu/page_flip_request.h",
+    "gpu/proxy_helpers.cc",
+    "gpu/proxy_helpers.h",
     "gpu/scanout_buffer.h",
     "gpu/screen_manager.cc",
     "gpu/screen_manager.h",
diff --git a/ui/ozone/platform/drm/gbm.gypi b/ui/ozone/platform/drm/gbm.gypi
index 102fc09..d454717a 100644
--- a/ui/ozone/platform/drm/gbm.gypi
+++ b/ui/ozone/platform/drm/gbm.gypi
@@ -72,10 +72,18 @@
         'gpu/drm_gpu_display_manager.h',
         'gpu/drm_gpu_platform_support.cc',
         'gpu/drm_gpu_platform_support.h',
+        'gpu/drm_thread.cc',
+        'gpu/drm_thread.h',
+        'gpu/drm_thread_message_proxy.cc',
+        'gpu/drm_thread_message_proxy.h',
+        'gpu/drm_thread_proxy.cc',
+        'gpu/drm_thread_proxy.h',
         'gpu/drm_vsync_provider.cc',
         'gpu/drm_vsync_provider.h',
         'gpu/drm_window.cc',
         'gpu/drm_window.h',
+        'gpu/drm_window_proxy.cc',
+        'gpu/drm_window_proxy.h',
         'gpu/gbm_buffer.cc',
         'gpu/gbm_buffer.h',
         'gpu/gbm_buffer_base.cc',
@@ -98,6 +106,8 @@
         'gpu/overlay_plane.h',
         'gpu/page_flip_request.cc',
         'gpu/page_flip_request.h',
+        'gpu/proxy_helpers.cc',
+        'gpu/proxy_helpers.h',
         'gpu/screen_manager.cc',
         'gpu/screen_manager.h',
         'host/channel_observer.h',
diff --git a/ui/ozone/platform/drm/gpu/drm_device.cc b/ui/ozone/platform/drm/gpu/drm_device.cc
index ba5c539..ad4979c4 100644
--- a/ui/ozone/platform/drm/gpu/drm_device.cc
+++ b/ui/ozone/platform/drm/gpu/drm_device.cc
@@ -114,10 +114,10 @@
 
 }  // namespace
 
-class DrmDevice::PageFlipManager
-    : public base::RefCountedThreadSafe<DrmDevice::PageFlipManager> {
+class DrmDevice::PageFlipManager {
  public:
   PageFlipManager() : next_id_(0) {}
+  ~PageFlipManager() {}
 
   void OnPageFlip(uint32_t frame,
                   uint32_t seconds,
@@ -149,9 +149,6 @@
   }
 
  private:
-  friend class base::RefCountedThreadSafe<DrmDevice::PageFlipManager>;
-  ~PageFlipManager() {}
-
   struct PageFlip {
     uint64_t id;
     uint32_t pending_calls;
@@ -173,68 +170,40 @@
   DISALLOW_COPY_AND_ASSIGN(PageFlipManager);
 };
 
-class DrmDevice::IOWatcher
-    : public base::RefCountedThreadSafe<DrmDevice::IOWatcher>,
-      public base::MessagePumpLibevent::Watcher {
+class DrmDevice::IOWatcher : public base::MessagePumpLibevent::Watcher {
  public:
-  IOWatcher(int fd,
-            const scoped_refptr<base::SingleThreadTaskRunner>& io_task_runner,
-            const scoped_refptr<DrmDevice::PageFlipManager>& page_flip_manager)
-      : main_task_runner_(base::ThreadTaskRunnerHandle::Get()),
-        io_task_runner_(io_task_runner),
-        page_flip_manager_(page_flip_manager),
-        fd_(fd) {
-    io_task_runner_->PostTask(FROM_HERE,
-                              base::Bind(&IOWatcher::RegisterOnIO, this));
+  IOWatcher(int fd, DrmDevice::PageFlipManager* page_flip_manager)
+      : page_flip_manager_(page_flip_manager), fd_(fd) {
+    Register();
   }
 
-  void Shutdown() {
-    io_task_runner_->PostTask(FROM_HERE,
-                              base::Bind(&IOWatcher::UnregisterOnIO, this));
-  }
+  ~IOWatcher() override { Unregister(); }
 
  private:
-  friend class base::RefCountedThreadSafe<IOWatcher>;
-
-  ~IOWatcher() override {}
-
-  void RegisterOnIO() {
+  void Register() {
     DCHECK(base::MessageLoopForIO::IsCurrent());
     base::MessageLoopForIO::current()->WatchFileDescriptor(
         fd_, true, base::MessageLoopForIO::WATCH_READ, &controller_, this);
   }
 
-  void UnregisterOnIO() {
+  void Unregister() {
     DCHECK(base::MessageLoopForIO::IsCurrent());
     controller_.StopWatchingFileDescriptor();
   }
 
-  void OnPageFlipOnIO(uint32_t frame,
-                      uint32_t seconds,
-                      uint32_t useconds,
-                      uint64_t id) {
-    main_task_runner_->PostTask(
-        FROM_HERE,
-        base::Bind(&DrmDevice::PageFlipManager::OnPageFlip, page_flip_manager_,
-                   frame, seconds, useconds, id));
-  }
-
   // base::MessagePumpLibevent::Watcher overrides:
   void OnFileCanReadWithoutBlocking(int fd) override {
     DCHECK(base::MessageLoopForIO::IsCurrent());
     TRACE_EVENT1("drm", "OnDrmEvent", "socket", fd);
 
-    if (!ProcessDrmEvent(
-            fd, base::Bind(&DrmDevice::IOWatcher::OnPageFlipOnIO, this)))
-      UnregisterOnIO();
+    if (!ProcessDrmEvent(fd, base::Bind(&DrmDevice::PageFlipManager::OnPageFlip,
+                                        base::Unretained(page_flip_manager_))))
+      Unregister();
   }
 
   void OnFileCanWriteWithoutBlocking(int fd) override { NOTREACHED(); }
 
-  scoped_refptr<base::SingleThreadTaskRunner> main_task_runner_;
-  scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_;
-
-  scoped_refptr<DrmDevice::PageFlipManager> page_flip_manager_;
+  DrmDevice::PageFlipManager* page_flip_manager_;
 
   base::MessagePumpLibevent::FileDescriptorWatcher controller_;
 
@@ -251,10 +220,7 @@
       page_flip_manager_(new PageFlipManager()),
       is_primary_device_(is_primary_device) {}
 
-DrmDevice::~DrmDevice() {
-  if (watcher_)
-    watcher_->Shutdown();
-}
+DrmDevice::~DrmDevice() {}
 
 bool DrmDevice::Initialize(bool use_atomic) {
   // Ignore devices that cannot perform modesetting.
@@ -279,15 +245,10 @@
     return false;
   }
 
-  return true;
-}
+  watcher_.reset(
+      new IOWatcher(file_.GetPlatformFile(), page_flip_manager_.get()));
 
-void DrmDevice::InitializeTaskRunner(
-    const scoped_refptr<base::SingleThreadTaskRunner>& task_runner) {
-  DCHECK(!task_runner_);
-  task_runner_ = task_runner;
-  watcher_ =
-      new IOWatcher(file_.GetPlatformFile(), task_runner_, page_flip_manager_);
+  return true;
 }
 
 ScopedDrmCrtcPtr DrmDevice::GetCrtc(uint32_t crtc_id) {
diff --git a/ui/ozone/platform/drm/gpu/drm_device.h b/ui/ozone/platform/drm/gpu/drm_device.h
index 8130f54..cadc429 100644
--- a/ui/ozone/platform/drm/gpu/drm_device.h
+++ b/ui/ozone/platform/drm/gpu/drm_device.h
@@ -53,10 +53,6 @@
   // Open device.
   virtual bool Initialize(bool use_atomic);
 
-  // |task_runner| will be used to asynchronously page flip.
-  virtual void InitializeTaskRunner(
-      const scoped_refptr<base::SingleThreadTaskRunner>& task_runner);
-
   // Get the CRTC state. This is generally used to save state before using the
   // CRTC. When the user finishes using the CRTC, the user should restore the
   // CRTC to it's initial state. Use |SetCrtc| to restore the state.
@@ -196,13 +192,10 @@
   // DRM device.
   base::File file_;
 
-  // Helper thread to perform IO listener operations.
-  scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
+  scoped_ptr<PageFlipManager> page_flip_manager_;
 
   // Watcher for |fd_| listening for page flip events.
-  scoped_refptr<IOWatcher> watcher_;
-
-  scoped_refptr<PageFlipManager> page_flip_manager_;
+  scoped_ptr<IOWatcher> watcher_;
 
   bool is_primary_device_;
 
diff --git a/ui/ozone/platform/drm/gpu/drm_device_manager.cc b/ui/ozone/platform/drm/gpu/drm_device_manager.cc
index eece3bb6..c366f65 100644
--- a/ui/ozone/platform/drm/gpu/drm_device_manager.cc
+++ b/ui/ozone/platform/drm/gpu/drm_device_manager.cc
@@ -33,13 +33,11 @@
 }
 
 DrmDeviceManager::~DrmDeviceManager() {
-  DCHECK(thread_checker_.CalledOnValidThread());
   DCHECK(drm_device_map_.empty());
 }
 
 bool DrmDeviceManager::AddDrmDevice(const base::FilePath& path,
                                     const base::FileDescriptor& fd) {
-  DCHECK(thread_checker_.CalledOnValidThread());
   base::File file(fd.fd);
   auto it =
       std::find_if(devices_.begin(), devices_.end(), FindByDevicePath(path));
@@ -55,9 +53,6 @@
     return false;
   }
 
-  if (io_task_runner_)
-    device->InitializeTaskRunner(io_task_runner_);
-
   if (!primary_device_)
     primary_device_ = device;
 
@@ -66,7 +61,6 @@
 }
 
 void DrmDeviceManager::RemoveDrmDevice(const base::FilePath& path) {
-  DCHECK(thread_checker_.CalledOnValidThread());
   auto it =
       std::find_if(devices_.begin(), devices_.end(), FindByDevicePath(path));
   if (it == devices_.end()) {
@@ -78,23 +72,12 @@
   devices_.erase(it);
 }
 
-void DrmDeviceManager::InitializeIOTaskRunner(
-    const scoped_refptr<base::SingleThreadTaskRunner>& task_runner) {
-  DCHECK(thread_checker_.CalledOnValidThread());
-  DCHECK(!io_task_runner_);
-  io_task_runner_ = task_runner;
-  for (const auto& device : devices_)
-    device->InitializeTaskRunner(io_task_runner_);
-}
-
 void DrmDeviceManager::UpdateDrmDevice(gfx::AcceleratedWidget widget,
                                        const scoped_refptr<DrmDevice>& device) {
-  base::AutoLock lock(lock_);
   drm_device_map_[widget] = device;
 }
 
 void DrmDeviceManager::RemoveDrmDevice(gfx::AcceleratedWidget widget) {
-  base::AutoLock lock(lock_);
   auto it = drm_device_map_.find(widget);
   if (it != drm_device_map_.end())
     drm_device_map_.erase(it);
@@ -102,7 +85,6 @@
 
 scoped_refptr<DrmDevice> DrmDeviceManager::GetDrmDevice(
     gfx::AcceleratedWidget widget) {
-  base::AutoLock lock(lock_);
   if (widget == gfx::kNullAcceleratedWidget)
     return primary_device_;
 
@@ -119,7 +101,6 @@
 }
 
 const DrmDeviceVector& DrmDeviceManager::GetDrmDevices() const {
-  DCHECK(thread_checker_.CalledOnValidThread());
   return devices_;
 }
 
diff --git a/ui/ozone/platform/drm/gpu/drm_device_manager.h b/ui/ozone/platform/drm/gpu/drm_device_manager.h
index 34fe613..72b9b9f 100644
--- a/ui/ozone/platform/drm/gpu/drm_device_manager.h
+++ b/ui/ozone/platform/drm/gpu/drm_device_manager.h
@@ -10,15 +10,12 @@
 
 #include "base/memory/ref_counted.h"
 #include "base/memory/scoped_ptr.h"
-#include "base/synchronization/lock.h"
-#include "base/threading/thread_checker.h"
 #include "ui/gfx/native_widget_types.h"
 #include "ui/ozone/ozone_export.h"
 
 namespace base {
 class FilePath;
 struct FileDescriptor;
-class SingleThreadTaskRunner;
 }
 
 namespace ui {
@@ -30,8 +27,6 @@
 
 // Tracks the mapping between widgets and the DRM devices used to allocate
 // buffers for the window represented by the widget.
-// Note: All calls are protected by a lock since
-// GetDrmDevice(gfx::AcceleratedWidget) may be called on the IO thread.
 class OZONE_EXPORT DrmDeviceManager {
  public:
   DrmDeviceManager(scoped_ptr<DrmDeviceGenerator> drm_device_generator);
@@ -41,9 +36,6 @@
   bool AddDrmDevice(const base::FilePath& path, const base::FileDescriptor& fd);
   void RemoveDrmDevice(const base::FilePath& path);
 
-  void InitializeIOTaskRunner(
-      const scoped_refptr<base::SingleThreadTaskRunner>& task_runner);
-
   // Updates the device associated with |widget|.
   void UpdateDrmDevice(gfx::AcceleratedWidget widget,
                        const scoped_refptr<DrmDevice>& device);
@@ -58,14 +50,8 @@
   const DrmDeviceVector& GetDrmDevices() const;
 
  private:
-  // With the exception of GetDrmDevice() all functions must be called on GPU
-  // main.
-  base::ThreadChecker thread_checker_;
-
   scoped_ptr<DrmDeviceGenerator> drm_device_generator_;
 
-  scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_;
-
   DrmDeviceVector devices_;
 
   std::map<gfx::AcceleratedWidget, scoped_refptr<DrmDevice>> drm_device_map_;
@@ -78,10 +64,6 @@
   // display; ie: when in headless mode).
   scoped_refptr<DrmDevice> primary_device_;
 
-  // This class is accessed from the main thread and the IO thread. This lock
-  // protects access to the device map.
-  base::Lock lock_;
-
   DISALLOW_COPY_AND_ASSIGN(DrmDeviceManager);
 };
 
diff --git a/ui/ozone/platform/drm/gpu/drm_gpu_platform_support.cc b/ui/ozone/platform/drm/gpu/drm_gpu_platform_support.cc
index e87bdcd5..44e8134 100644
--- a/ui/ozone/platform/drm/gpu/drm_gpu_platform_support.cc
+++ b/ui/ozone/platform/drm/gpu/drm_gpu_platform_support.cc
@@ -4,320 +4,24 @@
 
 #include "ui/ozone/platform/drm/gpu/drm_gpu_platform_support.h"
 
-#include "base/bind.h"
-#include "base/thread_task_runner_handle.h"
-#include "ipc/ipc_message_macros.h"
-#include "ui/ozone/common/gpu/ozone_gpu_message_params.h"
-#include "ui/ozone/common/gpu/ozone_gpu_messages.h"
-#include "ui/ozone/platform/drm/gpu/drm_device.h"
-#include "ui/ozone/platform/drm/gpu/drm_device_manager.h"
-#include "ui/ozone/platform/drm/gpu/drm_gpu_display_manager.h"
-#include "ui/ozone/platform/drm/gpu/drm_window.h"
-#include "ui/ozone/platform/drm/gpu/scanout_buffer.h"
-#include "ui/ozone/platform/drm/gpu/screen_manager.h"
+#include "ui/ozone/platform/drm/gpu/drm_thread_message_proxy.h"
 
 namespace ui {
 
-namespace {
-
-void MessageProcessedOnMain(
-    scoped_refptr<base::SingleThreadTaskRunner> io_thread_task_runner,
-    const base::Closure& io_thread_task) {
-  io_thread_task_runner->PostTask(FROM_HERE, io_thread_task);
-}
-
-class DrmGpuPlatformSupportMessageFilter : public IPC::MessageFilter {
- public:
-  typedef base::Callback<void(
-      const scoped_refptr<base::SingleThreadTaskRunner>&)>
-      OnFilterAddedCallback;
-
-  DrmGpuPlatformSupportMessageFilter(
-      ScreenManager* screen_manager,
-      const OnFilterAddedCallback& on_filter_added_callback,
-      IPC::Listener* main_thread_listener)
-      : screen_manager_(screen_manager),
-        on_filter_added_callback_(on_filter_added_callback),
-        main_thread_listener_(main_thread_listener),
-        main_thread_task_runner_(base::ThreadTaskRunnerHandle::Get()) {}
-
-  void OnFilterAdded(IPC::Sender* sender) override {
-    io_thread_task_runner_ = base::ThreadTaskRunnerHandle::Get();
-    main_thread_task_runner_->PostTask(
-        FROM_HERE,
-        base::Bind(on_filter_added_callback_, io_thread_task_runner_));
-  }
-
-  // This code is meant to be very temporary and only as a special case to fix
-  // cursor movement jank resulting from slowdowns on the gpu main thread.
-  // It handles cursor movement on IO thread when display config is stable
-  // and returns it to main thread during transitions.
-  bool OnMessageReceived(const IPC::Message& message) override {
-    // If this message affects the state needed to set cursor, handle it on
-    // the main thread. If a cursor move message arrives but we haven't
-    // processed the previous main thread message, keep processing on main
-    // until nothing is pending.
-    bool cursor_position_message = MessageAffectsCursorPosition(message.type());
-    bool cursor_state_message = MessageAffectsCursorState(message.type());
-
-    // Only handle cursor related messages here.
-    if (!cursor_position_message && !cursor_state_message)
-      return false;
-
-    bool cursor_was_animating = cursor_animating_;
-    UpdateAnimationState(message);
-    if (cursor_state_message || pending_main_thread_operations_ ||
-        cursor_animating_ || cursor_was_animating) {
-      pending_main_thread_operations_++;
-
-      base::Closure main_thread_message_handler =
-          base::Bind(base::IgnoreResult(&IPC::Listener::OnMessageReceived),
-                     base::Unretained(main_thread_listener_), message);
-      main_thread_task_runner_->PostTask(FROM_HERE,
-                                         main_thread_message_handler);
-
-      // This is an echo from the main thread to decrement pending ops.
-      // When the main thread is done with the task, it posts back to IO to
-      // signal completion.
-      base::Closure io_thread_task = base::Bind(
-          &DrmGpuPlatformSupportMessageFilter::DecrementPendingOperationsOnIO,
-          this);
-
-      base::Closure message_processed_callback = base::Bind(
-          &MessageProcessedOnMain, io_thread_task_runner_, io_thread_task);
-      main_thread_task_runner_->PostTask(FROM_HERE, message_processed_callback);
-
-      return true;
-    }
-
-    // Otherwise, we are in a steady state and it's safe to move cursor on IO.
-    bool handled = true;
-    IPC_BEGIN_MESSAGE_MAP(DrmGpuPlatformSupportMessageFilter, message)
-    IPC_MESSAGE_HANDLER(OzoneGpuMsg_CursorMove, OnCursorMove)
-    IPC_MESSAGE_HANDLER(OzoneGpuMsg_CursorSet, OnCursorSet)
-    IPC_MESSAGE_UNHANDLED(handled = false);
-    IPC_END_MESSAGE_MAP()
-
-    return handled;
-  }
-
- protected:
-  ~DrmGpuPlatformSupportMessageFilter() override {}
-
-  void OnCursorMove(gfx::AcceleratedWidget widget, const gfx::Point& location) {
-    screen_manager_->GetWindow(widget)->MoveCursor(location);
-  }
-
-  void OnCursorSet(gfx::AcceleratedWidget widget,
-                   const std::vector<SkBitmap>& bitmaps,
-                   const gfx::Point& location,
-                   int frame_delay_ms) {
-    screen_manager_->GetWindow(widget)
-        ->SetCursorWithoutAnimations(bitmaps, location);
-  }
-
-  void DecrementPendingOperationsOnIO() { pending_main_thread_operations_--; }
-
-  bool MessageAffectsCursorState(uint32 message_type) {
-    switch (message_type) {
-      case OzoneGpuMsg_CreateWindow::ID:
-      case OzoneGpuMsg_DestroyWindow::ID:
-      case OzoneGpuMsg_WindowBoundsChanged::ID:
-      case OzoneGpuMsg_ConfigureNativeDisplay::ID:
-      case OzoneGpuMsg_DisableNativeDisplay::ID:
-        return true;
-      default:
-        return false;
-    }
-  }
-
-  bool MessageAffectsCursorPosition(uint32 message_type) {
-    switch (message_type) {
-      case OzoneGpuMsg_CursorMove::ID:
-      case OzoneGpuMsg_CursorSet::ID:
-        return true;
-      default:
-        return false;
-    }
-  }
-
-  void UpdateAnimationState(const IPC::Message& message) {
-    if (message.type() != OzoneGpuMsg_CursorSet::ID)
-      return;
-
-    OzoneGpuMsg_CursorSet::Param param;
-    if (!OzoneGpuMsg_CursorSet::Read(&message, &param))
-      return;
-
-    int frame_delay_ms = base::get<3>(param);
-    cursor_animating_ = frame_delay_ms != 0;
-  }
-
-  ScreenManager* screen_manager_;
-  OnFilterAddedCallback on_filter_added_callback_;
-  IPC::Listener* main_thread_listener_;
-  scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner_;
-  scoped_refptr<base::SingleThreadTaskRunner> io_thread_task_runner_;
-  int32 pending_main_thread_operations_ = 0;
-  bool cursor_animating_ = false;
-};
-}
-
 DrmGpuPlatformSupport::DrmGpuPlatformSupport(
-    DrmDeviceManager* drm_device_manager,
-    ScreenManager* screen_manager,
-    ScanoutBufferGenerator* buffer_generator,
-    scoped_ptr<DrmGpuDisplayManager> display_manager)
-    : drm_device_manager_(drm_device_manager),
-      screen_manager_(screen_manager),
-      buffer_generator_(buffer_generator),
-      display_manager_(display_manager.Pass()) {
-  filter_ = new DrmGpuPlatformSupportMessageFilter(
-      screen_manager, base::Bind(&DrmGpuPlatformSupport::SetIOTaskRunner,
-                                 base::Unretained(this)),
-      this);
-}
+    const scoped_refptr<DrmThreadMessageProxy>& filter)
+    : filter_(filter) {}
 
-DrmGpuPlatformSupport::~DrmGpuPlatformSupport() {
-}
+DrmGpuPlatformSupport::~DrmGpuPlatformSupport() {}
 
-void DrmGpuPlatformSupport::OnChannelEstablished(IPC::Sender* sender) {
-  sender_ = sender;
-}
-
-bool DrmGpuPlatformSupport::OnMessageReceived(const IPC::Message& message) {
-  bool handled = true;
-
-  IPC_BEGIN_MESSAGE_MAP(DrmGpuPlatformSupport, message)
-  IPC_MESSAGE_HANDLER(OzoneGpuMsg_CreateWindow, OnCreateWindow)
-  IPC_MESSAGE_HANDLER(OzoneGpuMsg_DestroyWindow, OnDestroyWindow)
-  IPC_MESSAGE_HANDLER(OzoneGpuMsg_WindowBoundsChanged, OnWindowBoundsChanged)
-
-  IPC_MESSAGE_HANDLER(OzoneGpuMsg_CursorSet, OnCursorSet)
-  IPC_MESSAGE_HANDLER(OzoneGpuMsg_CursorMove, OnCursorMove)
-
-  IPC_MESSAGE_HANDLER(OzoneGpuMsg_RefreshNativeDisplays,
-                      OnRefreshNativeDisplays)
-  IPC_MESSAGE_HANDLER(OzoneGpuMsg_ConfigureNativeDisplay,
-                      OnConfigureNativeDisplay)
-  IPC_MESSAGE_HANDLER(OzoneGpuMsg_DisableNativeDisplay, OnDisableNativeDisplay)
-  IPC_MESSAGE_HANDLER(OzoneGpuMsg_TakeDisplayControl, OnTakeDisplayControl)
-  IPC_MESSAGE_HANDLER(OzoneGpuMsg_RelinquishDisplayControl,
-                      OnRelinquishDisplayControl)
-  IPC_MESSAGE_HANDLER(OzoneGpuMsg_AddGraphicsDevice, OnAddGraphicsDevice)
-  IPC_MESSAGE_HANDLER(OzoneGpuMsg_RemoveGraphicsDevice, OnRemoveGraphicsDevice)
-  IPC_MESSAGE_HANDLER(OzoneGpuMsg_GetHDCPState, OnGetHDCPState)
-  IPC_MESSAGE_HANDLER(OzoneGpuMsg_SetHDCPState, OnSetHDCPState)
-  IPC_MESSAGE_HANDLER(OzoneGpuMsg_SetGammaRamp, OnSetGammaRamp);
-  IPC_MESSAGE_HANDLER(OzoneGpuMsg_CheckOverlayCapabilities,
-                      OnCheckOverlayCapabilities)
-  IPC_MESSAGE_UNHANDLED(handled = false);
-  IPC_END_MESSAGE_MAP()
-
-  return handled;
-}
-
-void DrmGpuPlatformSupport::OnCreateWindow(gfx::AcceleratedWidget widget) {
-  scoped_ptr<DrmWindow> window(
-      new DrmWindow(widget, drm_device_manager_, screen_manager_));
-  window->Initialize();
-  screen_manager_->AddWindow(widget, window.Pass());
-}
-
-void DrmGpuPlatformSupport::OnDestroyWindow(gfx::AcceleratedWidget widget) {
-  scoped_ptr<DrmWindow> window = screen_manager_->RemoveWindow(widget);
-  window->Shutdown();
-}
-
-void DrmGpuPlatformSupport::OnWindowBoundsChanged(gfx::AcceleratedWidget widget,
-                                                  const gfx::Rect& bounds) {
-  screen_manager_->GetWindow(widget)->OnBoundsChanged(bounds);
-}
-
-void DrmGpuPlatformSupport::OnCursorSet(gfx::AcceleratedWidget widget,
-                                        const std::vector<SkBitmap>& bitmaps,
-                                        const gfx::Point& location,
-                                        int frame_delay_ms) {
-  screen_manager_->GetWindow(widget)
-      ->SetCursor(bitmaps, location, frame_delay_ms);
-}
-
-void DrmGpuPlatformSupport::OnCursorMove(gfx::AcceleratedWidget widget,
-                                         const gfx::Point& location) {
-  screen_manager_->GetWindow(widget)->MoveCursor(location);
-}
-
-void DrmGpuPlatformSupport::OnCheckOverlayCapabilities(
-    gfx::AcceleratedWidget widget,
-    const std::vector<OverlayCheck_Params>& overlays) {
-  sender_->Send(new OzoneHostMsg_OverlayCapabilitiesReceived(
-      widget, screen_manager_->GetWindow(widget)
-                  ->TestPageFlip(overlays, buffer_generator_)));
-}
-
-void DrmGpuPlatformSupport::OnRefreshNativeDisplays() {
-  sender_->Send(
-      new OzoneHostMsg_UpdateNativeDisplays(display_manager_->GetDisplays()));
-}
-
-void DrmGpuPlatformSupport::OnConfigureNativeDisplay(
-    int64_t id,
-    const DisplayMode_Params& mode_param,
-    const gfx::Point& origin) {
-  sender_->Send(new OzoneHostMsg_DisplayConfigured(
-      id, display_manager_->ConfigureDisplay(id, mode_param, origin)));
-}
-
-void DrmGpuPlatformSupport::OnDisableNativeDisplay(int64_t id) {
-  sender_->Send(new OzoneHostMsg_DisplayConfigured(
-      id, display_manager_->DisableDisplay(id)));
-}
-
-void DrmGpuPlatformSupport::OnTakeDisplayControl() {
-  sender_->Send(new OzoneHostMsg_DisplayControlTaken(
-      display_manager_->TakeDisplayControl()));
-}
-
-void DrmGpuPlatformSupport::OnRelinquishDisplayControl() {
-  display_manager_->RelinquishDisplayControl();
-  sender_->Send(new OzoneHostMsg_DisplayControlRelinquished(true));
-}
-
-void DrmGpuPlatformSupport::OnAddGraphicsDevice(
-    const base::FilePath& path,
-    const base::FileDescriptor& fd) {
-  drm_device_manager_->AddDrmDevice(path, fd);
-}
-
-void DrmGpuPlatformSupport::OnRemoveGraphicsDevice(const base::FilePath& path) {
-  drm_device_manager_->RemoveDrmDevice(path);
-}
-
-void DrmGpuPlatformSupport::OnSetGammaRamp(
-    int64_t id,
-    const std::vector<GammaRampRGBEntry>& lut) {
-  display_manager_->SetGammaRamp(id, lut);
-}
-
-void DrmGpuPlatformSupport::OnGetHDCPState(int64_t display_id) {
-  HDCPState state = HDCP_STATE_UNDESIRED;
-  bool success = display_manager_->GetHDCPState(display_id, &state);
-  sender_->Send(new OzoneHostMsg_HDCPStateReceived(display_id, success, state));
-}
-
-void DrmGpuPlatformSupport::OnSetHDCPState(int64_t display_id,
-                                           HDCPState state) {
-  sender_->Send(new OzoneHostMsg_HDCPStateUpdated(
-      display_id, display_manager_->SetHDCPState(display_id, state)));
-}
-
-void DrmGpuPlatformSupport::SetIOTaskRunner(
-    const scoped_refptr<base::SingleThreadTaskRunner>& io_task_runner) {
-  drm_device_manager_->InitializeIOTaskRunner(io_task_runner);
-}
+void DrmGpuPlatformSupport::OnChannelEstablished(IPC::Sender* sender) {}
 
 IPC::MessageFilter* DrmGpuPlatformSupport::GetMessageFilter() {
   return filter_.get();
 }
 
+bool DrmGpuPlatformSupport::OnMessageReceived(const IPC::Message& message) {
+  return false;
+}
+
 }  // namespace ui
diff --git a/ui/ozone/platform/drm/gpu/drm_gpu_platform_support.h b/ui/ozone/platform/drm/gpu/drm_gpu_platform_support.h
index 21caf35e..812865c 100644
--- a/ui/ozone/platform/drm/gpu/drm_gpu_platform_support.h
+++ b/ui/ozone/platform/drm/gpu/drm_gpu_platform_support.h
@@ -5,46 +5,18 @@
 #ifndef UI_OZONE_PLATFORM_DRM_GPU_DRM_GPU_PLATFORM_SUPPORT_H_
 #define UI_OZONE_PLATFORM_DRM_GPU_DRM_GPU_PLATFORM_SUPPORT_H_
 
-#include "base/containers/scoped_ptr_hash_map.h"
-#include "base/memory/scoped_ptr.h"
-#include "ipc/message_filter.h"
-#include "ui/display/types/display_constants.h"
-#include "ui/gfx/native_widget_types.h"
+#include "base/memory/ref_counted.h"
 #include "ui/ozone/public/gpu_platform_support.h"
 
-class SkBitmap;
-
-namespace base {
-class FilePath;
-class SingleThreadTaskRunner;
-struct FileDescriptor;
-}
-
-namespace gfx {
-class Point;
-class Rect;
-}
-
 namespace ui {
 
-class DrmDeviceManager;
-class DrmGpuDisplayManager;
-class DrmSurfaceFactory;
-class DrmWindow;
-class ScreenManager;
-class ScanoutBufferGenerator;
-
-struct DisplayMode_Params;
-struct DisplaySnapshot_Params;
-struct OverlayCheck_Params;
-struct GammaRampRGBEntry;
+class DrmThread;
+class DrmThreadMessageProxy;
 
 class DrmGpuPlatformSupport : public GpuPlatformSupport {
  public:
-  DrmGpuPlatformSupport(DrmDeviceManager* drm_device_manager,
-                        ScreenManager* screen_manager,
-                        ScanoutBufferGenerator* buffer_generator,
-                        scoped_ptr<DrmGpuDisplayManager> display_manager);
+  explicit DrmGpuPlatformSupport(
+      const scoped_refptr<DrmThreadMessageProxy>& filter);
   ~DrmGpuPlatformSupport() override;
 
   // GpuPlatformSupport:
@@ -55,44 +27,9 @@
   bool OnMessageReceived(const IPC::Message& message) override;
 
  private:
-  void OnCreateWindow(gfx::AcceleratedWidget widget);
-  void OnDestroyWindow(gfx::AcceleratedWidget widget);
-  void OnWindowBoundsChanged(gfx::AcceleratedWidget widget,
-                             const gfx::Rect& bounds);
-  void OnCursorSet(gfx::AcceleratedWidget widget,
-                   const std::vector<SkBitmap>& bitmaps,
-                   const gfx::Point& location,
-                   int frame_delay_ms);
-  void OnCursorMove(gfx::AcceleratedWidget widget, const gfx::Point& location);
-  void OnCheckOverlayCapabilities(
-      gfx::AcceleratedWidget widget,
-      const std::vector<OverlayCheck_Params>& overlays);
+  scoped_refptr<DrmThreadMessageProxy> filter_;
 
-  // Display related IPC handlers.
-  void OnRefreshNativeDisplays();
-  void OnConfigureNativeDisplay(int64_t id,
-                                const DisplayMode_Params& mode,
-                                const gfx::Point& origin);
-  void OnDisableNativeDisplay(int64_t id);
-  void OnTakeDisplayControl();
-  void OnRelinquishDisplayControl();
-  void OnAddGraphicsDevice(const base::FilePath& path,
-                           const base::FileDescriptor& fd);
-  void OnRemoveGraphicsDevice(const base::FilePath& path);
-  void OnGetHDCPState(int64_t display_id);
-  void OnSetHDCPState(int64_t display_id, HDCPState state);
-  void OnSetGammaRamp(int64_t id, const std::vector<GammaRampRGBEntry>& lut);
-
-  void SetIOTaskRunner(
-      const scoped_refptr<base::SingleThreadTaskRunner>& io_task_runner);
-
-  IPC::Sender* sender_ = nullptr;             // Not owned.
-  DrmDeviceManager* drm_device_manager_;  // Not owned.
-  ScreenManager* screen_manager_;         // Not owned.
-  ScanoutBufferGenerator* buffer_generator_;  // Not owned.
-
-  scoped_ptr<DrmGpuDisplayManager> display_manager_;
-  scoped_refptr<IPC::MessageFilter> filter_;
+  DISALLOW_COPY_AND_ASSIGN(DrmGpuPlatformSupport);
 };
 
 }  // namespace ui
diff --git a/ui/ozone/platform/drm/gpu/drm_thread.cc b/ui/ozone/platform/drm/gpu/drm_thread.cc
new file mode 100644
index 0000000..901dedb0
--- /dev/null
+++ b/ui/ozone/platform/drm/gpu/drm_thread.cc
@@ -0,0 +1,226 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "ui/ozone/platform/drm/gpu/drm_thread.h"
+
+#include "base/command_line.h"
+#include "base/thread_task_runner_handle.h"
+#include "ui/ozone/platform/drm/gpu/drm_buffer.h"
+#include "ui/ozone/platform/drm/gpu/drm_device_generator.h"
+#include "ui/ozone/platform/drm/gpu/drm_device_manager.h"
+#include "ui/ozone/platform/drm/gpu/drm_gpu_display_manager.h"
+#include "ui/ozone/platform/drm/gpu/drm_window.h"
+#include "ui/ozone/platform/drm/gpu/drm_window_proxy.h"
+#include "ui/ozone/platform/drm/gpu/gbm_buffer.h"
+#include "ui/ozone/platform/drm/gpu/gbm_device.h"
+#include "ui/ozone/platform/drm/gpu/gbm_surface_factory.h"
+#include "ui/ozone/platform/drm/gpu/proxy_helpers.h"
+#include "ui/ozone/platform/drm/gpu/screen_manager.h"
+#include "ui/ozone/public/ozone_switches.h"
+
+namespace ui {
+
+namespace {
+
+class GbmBufferGenerator : public ScanoutBufferGenerator {
+ public:
+  GbmBufferGenerator() {}
+  ~GbmBufferGenerator() override {}
+
+  // ScanoutBufferGenerator:
+  scoped_refptr<ScanoutBuffer> Create(const scoped_refptr<DrmDevice>& drm,
+                                      gfx::BufferFormat format,
+                                      const gfx::Size& size) override {
+    scoped_refptr<GbmDevice> gbm(static_cast<GbmDevice*>(drm.get()));
+    return GbmBuffer::CreateBuffer(gbm, format, size,
+                                   gfx::BufferUsage::SCANOUT);
+  }
+
+ protected:
+  DISALLOW_COPY_AND_ASSIGN(GbmBufferGenerator);
+};
+
+class GbmDeviceGenerator : public DrmDeviceGenerator {
+ public:
+  GbmDeviceGenerator(bool use_atomic) : use_atomic_(use_atomic) {}
+  ~GbmDeviceGenerator() override {}
+
+  // DrmDeviceGenerator:
+  scoped_refptr<DrmDevice> CreateDevice(const base::FilePath& path,
+                                        base::File file,
+                                        bool is_primary_device) override {
+    scoped_refptr<DrmDevice> drm =
+        new GbmDevice(path, file.Pass(), is_primary_device);
+    if (drm->Initialize(use_atomic_))
+      return drm;
+
+    return nullptr;
+  }
+
+ private:
+  bool use_atomic_;
+
+  DISALLOW_COPY_AND_ASSIGN(GbmDeviceGenerator);
+};
+
+}  // namespace
+
+DrmThread::DrmThread() : base::Thread("DrmThread") {}
+
+DrmThread::~DrmThread() {
+  Stop();
+}
+
+void DrmThread::Start() {
+  if (!StartWithOptions(base::Thread::Options(base::MessageLoop::TYPE_IO, 0)))
+    LOG(FATAL) << "Failed to create DRM thread";
+}
+
+void DrmThread::Init() {
+  bool use_atomic = false;
+#if defined(USE_DRM_ATOMIC)
+  use_atomic = true;
+#endif
+
+  device_manager_.reset(new DrmDeviceManager(
+      make_scoped_ptr(new GbmDeviceGenerator(use_atomic))));
+  buffer_generator_.reset(new GbmBufferGenerator());
+  screen_manager_.reset(new ScreenManager(buffer_generator_.get()));
+
+  display_manager_.reset(
+      new DrmGpuDisplayManager(screen_manager_.get(), device_manager_.get()));
+}
+
+void DrmThread::CreateBuffer(gfx::AcceleratedWidget widget,
+                             const gfx::Size& size,
+                             gfx::BufferFormat format,
+                             gfx::BufferUsage usage,
+                             scoped_refptr<GbmBuffer>* buffer) {
+  scoped_refptr<GbmDevice> gbm =
+      static_cast<GbmDevice*>(device_manager_->GetDrmDevice(widget).get());
+  DCHECK(gbm);
+  *buffer = GbmBuffer::CreateBuffer(gbm, format, size, usage);
+}
+
+void DrmThread::SchedulePageFlip(gfx::AcceleratedWidget widget,
+                                 const std::vector<OverlayPlane>& planes,
+                                 const SwapCompletionCallback& callback) {
+  DrmWindow* window = screen_manager_->GetWindow(widget);
+  if (window)
+    window->SchedulePageFlip(planes, callback);
+  else
+    callback.Run(gfx::SwapResult::SWAP_ACK);
+}
+
+void DrmThread::GetVSyncParameters(
+    gfx::AcceleratedWidget widget,
+    const gfx::VSyncProvider::UpdateVSyncCallback& callback) {
+  DrmWindow* window = screen_manager_->GetWindow(widget);
+  // No need to call the callback if there isn't a window since the vsync
+  // provider doesn't require the callback to be called if there isn't a vsync
+  // data source.
+  if (window)
+    window->GetVSyncParameters(callback);
+}
+
+void DrmThread::CreateWindow(gfx::AcceleratedWidget widget) {
+  scoped_ptr<DrmWindow> window(
+      new DrmWindow(widget, device_manager_.get(), screen_manager_.get()));
+  window->Initialize();
+  screen_manager_->AddWindow(widget, window.Pass());
+}
+
+void DrmThread::DestroyWindow(gfx::AcceleratedWidget widget) {
+  scoped_ptr<DrmWindow> window = screen_manager_->RemoveWindow(widget);
+  window->Shutdown();
+}
+
+void DrmThread::SetWindowBounds(gfx::AcceleratedWidget widget,
+                                const gfx::Rect& bounds) {
+  screen_manager_->GetWindow(widget)->SetBounds(bounds);
+}
+
+void DrmThread::SetCursor(gfx::AcceleratedWidget widget,
+                          const std::vector<SkBitmap>& bitmaps,
+                          const gfx::Point& location,
+                          int frame_delay_ms) {
+  screen_manager_->GetWindow(widget)
+      ->SetCursor(bitmaps, location, frame_delay_ms);
+}
+
+void DrmThread::MoveCursor(gfx::AcceleratedWidget widget,
+                           const gfx::Point& location) {
+  screen_manager_->GetWindow(widget)->MoveCursor(location);
+}
+
+void DrmThread::CheckOverlayCapabilities(
+    gfx::AcceleratedWidget widget,
+    const std::vector<OverlayCheck_Params>& overlays,
+    const base::Callback<void(gfx::AcceleratedWidget,
+                              const std::vector<OverlayCheck_Params>&)>&
+        callback) {
+  callback.Run(widget, screen_manager_->GetWindow(widget)
+                           ->TestPageFlip(overlays, buffer_generator_.get()));
+}
+
+void DrmThread::RefreshNativeDisplays(
+    const base::Callback<void(const std::vector<DisplaySnapshot_Params>&)>&
+        callback) {
+  callback.Run(display_manager_->GetDisplays());
+}
+
+void DrmThread::ConfigureNativeDisplay(
+    int64_t id,
+    const DisplayMode_Params& mode,
+    const gfx::Point& origin,
+    const base::Callback<void(int64_t, bool)>& callback) {
+  callback.Run(id, display_manager_->ConfigureDisplay(id, mode, origin));
+}
+
+void DrmThread::DisableNativeDisplay(
+    int64_t id,
+    const base::Callback<void(int64_t, bool)>& callback) {
+  callback.Run(id, display_manager_->DisableDisplay(id));
+}
+
+void DrmThread::TakeDisplayControl(const base::Callback<void(bool)>& callback) {
+  callback.Run(display_manager_->TakeDisplayControl());
+}
+
+void DrmThread::RelinquishDisplayControl(
+    const base::Callback<void(bool)>& callback) {
+  display_manager_->RelinquishDisplayControl();
+  callback.Run(true);
+}
+
+void DrmThread::AddGraphicsDevice(const base::FilePath& path,
+                                  const base::FileDescriptor& fd) {
+  device_manager_->AddDrmDevice(path, fd);
+}
+
+void DrmThread::RemoveGraphicsDevice(const base::FilePath& path) {
+  device_manager_->RemoveDrmDevice(path);
+}
+
+void DrmThread::GetHDCPState(
+    int64_t display_id,
+    const base::Callback<void(int64_t, bool, HDCPState)>& callback) {
+  HDCPState state = HDCP_STATE_UNDESIRED;
+  bool success = display_manager_->GetHDCPState(display_id, &state);
+  callback.Run(display_id, success, state);
+}
+
+void DrmThread::SetHDCPState(
+    int64_t display_id,
+    HDCPState state,
+    const base::Callback<void(int64_t, bool)>& callback) {
+  callback.Run(display_id, display_manager_->SetHDCPState(display_id, state));
+}
+
+void DrmThread::SetGammaRamp(int64_t id,
+                             const std::vector<GammaRampRGBEntry>& lut) {
+  display_manager_->SetGammaRamp(id, lut);
+}
+
+}  // namespace ui
diff --git a/ui/ozone/platform/drm/gpu/drm_thread.h b/ui/ozone/platform/drm/gpu/drm_thread.h
new file mode 100644
index 0000000..361fec7d
--- /dev/null
+++ b/ui/ozone/platform/drm/gpu/drm_thread.h
@@ -0,0 +1,118 @@
+// 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 UI_OZONE_PLATFORM_DRM_GPU_DRM_THREAD_H_
+#define UI_OZONE_PLATFORM_DRM_GPU_DRM_THREAD_H_
+
+#include "base/memory/scoped_ptr.h"
+#include "base/memory/weak_ptr.h"
+#include "base/threading/thread.h"
+#include "ui/gfx/native_widget_types.h"
+#include "ui/gfx/vsync_provider.h"
+#include "ui/ozone/common/gpu/ozone_gpu_message_params.h"
+#include "ui/ozone/public/surface_ozone_egl.h"
+
+namespace base {
+struct FileDescriptor;
+}
+
+namespace gfx {
+class Point;
+class Rect;
+}
+
+namespace ui {
+
+class DrmDeviceManager;
+class DrmGpuDisplayManager;
+class DrmWindow;
+class DrmWindowProxy;
+class GbmBuffer;
+class ScanoutBufferGenerator;
+class ScreenManager;
+
+struct GammaRampRGBEntry;
+struct OverlayPlane;
+
+// Holds all the DRM related state and performs all DRM related operations.
+//
+// The DRM thread is used to insulate DRM operations from potential blocking
+// behaviour on the GPU main thread in order to reduce the potential for jank
+// (for example jank in the cursor if the GPU main thread is performing heavy
+// operations). The inverse is also true as blocking operations on the DRM
+// thread (such as modesetting) no longer block the GPU main thread.
+class DrmThread : public base::Thread {
+ public:
+  DrmThread();
+  ~DrmThread() override;
+
+  void Start();
+
+  // Must be called on the DRM thread.
+  void CreateBuffer(gfx::AcceleratedWidget widget,
+                    const gfx::Size& size,
+                    gfx::BufferFormat format,
+                    gfx::BufferUsage usage,
+                    scoped_refptr<GbmBuffer>* buffer);
+
+  void SchedulePageFlip(gfx::AcceleratedWidget widget,
+                        const std::vector<OverlayPlane>& planes,
+                        const SwapCompletionCallback& callback);
+  void GetVSyncParameters(
+      gfx::AcceleratedWidget widget,
+      const gfx::VSyncProvider::UpdateVSyncCallback& callback);
+
+  void CreateWindow(gfx::AcceleratedWidget widget);
+  void DestroyWindow(gfx::AcceleratedWidget widget);
+  void SetWindowBounds(gfx::AcceleratedWidget widget, const gfx::Rect& bounds);
+  void SetCursor(gfx::AcceleratedWidget widget,
+                 const std::vector<SkBitmap>& bitmaps,
+                 const gfx::Point& location,
+                 int frame_delay_ms);
+  void MoveCursor(gfx::AcceleratedWidget widget, const gfx::Point& location);
+  void CheckOverlayCapabilities(
+      gfx::AcceleratedWidget widget,
+      const std::vector<OverlayCheck_Params>& overlays,
+      const base::Callback<void(gfx::AcceleratedWidget,
+                                const std::vector<OverlayCheck_Params>&)>&
+          callback);
+  void RefreshNativeDisplays(
+      const base::Callback<void(const std::vector<DisplaySnapshot_Params>&)>&
+          callback);
+  void ConfigureNativeDisplay(
+      int64_t id,
+      const DisplayMode_Params& mode,
+      const gfx::Point& origin,
+      const base::Callback<void(int64_t, bool)>& callback);
+  void DisableNativeDisplay(
+      int64_t id,
+      const base::Callback<void(int64_t, bool)>& callback);
+  void TakeDisplayControl(const base::Callback<void(bool)>& callback);
+  void RelinquishDisplayControl(const base::Callback<void(bool)>& callback);
+  void AddGraphicsDevice(const base::FilePath& path,
+                         const base::FileDescriptor& fd);
+  void RemoveGraphicsDevice(const base::FilePath& path);
+  void GetHDCPState(
+      int64_t display_id,
+      const base::Callback<void(int64_t, bool, HDCPState)>& callback);
+  void SetHDCPState(int64_t display_id,
+                    HDCPState state,
+                    const base::Callback<void(int64_t, bool)>& callback);
+  void SetGammaRamp(int64_t id, const std::vector<GammaRampRGBEntry>& lut);
+
+  // base::Thread:
+  void Init() override;
+
+ private:
+  scoped_ptr<DrmDeviceManager> device_manager_;
+  scoped_ptr<ScanoutBufferGenerator> buffer_generator_;
+  scoped_ptr<ScreenManager> screen_manager_;
+  scoped_ptr<DrmGpuDisplayManager> display_manager_;
+
+  DISALLOW_COPY_AND_ASSIGN(DrmThread);
+};
+
+}  // namespace ui
+
+#endif  // UI_OZONE_PLATFORM_DRM_GPU_DRM_THREAD_H_
diff --git a/ui/ozone/platform/drm/gpu/drm_thread_message_proxy.cc b/ui/ozone/platform/drm/gpu/drm_thread_message_proxy.cc
new file mode 100644
index 0000000..f0647eb7
--- /dev/null
+++ b/ui/ozone/platform/drm/gpu/drm_thread_message_proxy.cc
@@ -0,0 +1,263 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "ui/ozone/platform/drm/gpu/drm_thread_message_proxy.h"
+
+#include "base/thread_task_runner_handle.h"
+#include "ipc/ipc_message.h"
+#include "ipc/ipc_sender.h"
+#include "ui/ozone/common/gpu/ozone_gpu_messages.h"
+#include "ui/ozone/platform/drm/gpu/drm_thread_proxy.h"
+#include "ui/ozone/platform/drm/gpu/proxy_helpers.h"
+
+namespace ui {
+
+DrmThreadMessageProxy::DrmThreadMessageProxy(DrmThread* drm_thread)
+    : drm_thread_(drm_thread), weak_ptr_factory_(this) {}
+
+DrmThreadMessageProxy::~DrmThreadMessageProxy() {}
+
+void DrmThreadMessageProxy::OnFilterAdded(IPC::Sender* sender) {
+  sender_ = sender;
+
+  // The DRM thread needs to be started late since we need to wait for the
+  // sandbox to start.
+  drm_thread_->Start();
+}
+
+bool DrmThreadMessageProxy::OnMessageReceived(const IPC::Message& message) {
+  bool handled = true;
+
+  IPC_BEGIN_MESSAGE_MAP(DrmThreadMessageProxy, message)
+    IPC_MESSAGE_HANDLER(OzoneGpuMsg_CreateWindow, OnCreateWindow)
+    IPC_MESSAGE_HANDLER(OzoneGpuMsg_DestroyWindow, OnDestroyWindow)
+    IPC_MESSAGE_HANDLER(OzoneGpuMsg_WindowBoundsChanged, OnWindowBoundsChanged)
+
+    IPC_MESSAGE_HANDLER(OzoneGpuMsg_CursorSet, OnCursorSet)
+    IPC_MESSAGE_HANDLER(OzoneGpuMsg_CursorMove, OnCursorMove)
+
+    IPC_MESSAGE_HANDLER(OzoneGpuMsg_RefreshNativeDisplays,
+                        OnRefreshNativeDisplays)
+    IPC_MESSAGE_HANDLER(OzoneGpuMsg_ConfigureNativeDisplay,
+                        OnConfigureNativeDisplay)
+    IPC_MESSAGE_HANDLER(OzoneGpuMsg_DisableNativeDisplay,
+                        OnDisableNativeDisplay)
+    IPC_MESSAGE_HANDLER(OzoneGpuMsg_TakeDisplayControl, OnTakeDisplayControl)
+    IPC_MESSAGE_HANDLER(OzoneGpuMsg_RelinquishDisplayControl,
+                        OnRelinquishDisplayControl)
+    IPC_MESSAGE_HANDLER(OzoneGpuMsg_AddGraphicsDevice, OnAddGraphicsDevice)
+    IPC_MESSAGE_HANDLER(OzoneGpuMsg_RemoveGraphicsDevice,
+                        OnRemoveGraphicsDevice)
+    IPC_MESSAGE_HANDLER(OzoneGpuMsg_GetHDCPState, OnGetHDCPState)
+    IPC_MESSAGE_HANDLER(OzoneGpuMsg_SetHDCPState, OnSetHDCPState)
+    IPC_MESSAGE_HANDLER(OzoneGpuMsg_SetGammaRamp, OnSetGammaRamp);
+    IPC_MESSAGE_HANDLER(OzoneGpuMsg_CheckOverlayCapabilities,
+                        OnCheckOverlayCapabilities)
+    IPC_MESSAGE_UNHANDLED(handled = false);
+  IPC_END_MESSAGE_MAP()
+
+  return handled;
+}
+
+void DrmThreadMessageProxy::OnCreateWindow(gfx::AcceleratedWidget widget) {
+  DCHECK(drm_thread_->IsRunning());
+  drm_thread_->task_runner()->PostTask(
+      FROM_HERE, base::Bind(&DrmThread::CreateWindow,
+                            base::Unretained(drm_thread_), widget));
+}
+
+void DrmThreadMessageProxy::OnDestroyWindow(gfx::AcceleratedWidget widget) {
+  DCHECK(drm_thread_->IsRunning());
+  drm_thread_->task_runner()->PostTask(
+      FROM_HERE, base::Bind(&DrmThread::DestroyWindow,
+                            base::Unretained(drm_thread_), widget));
+}
+
+void DrmThreadMessageProxy::OnWindowBoundsChanged(gfx::AcceleratedWidget widget,
+                                                  const gfx::Rect& bounds) {
+  DCHECK(drm_thread_->IsRunning());
+  drm_thread_->task_runner()->PostTask(
+      FROM_HERE, base::Bind(&DrmThread::SetWindowBounds,
+                            base::Unretained(drm_thread_), widget, bounds));
+}
+
+void DrmThreadMessageProxy::OnCursorSet(gfx::AcceleratedWidget widget,
+                                        const std::vector<SkBitmap>& bitmaps,
+                                        const gfx::Point& location,
+                                        int frame_delay_ms) {
+  DCHECK(drm_thread_->IsRunning());
+  drm_thread_->task_runner()->PostTask(
+      FROM_HERE,
+      base::Bind(&DrmThread::SetCursor, base::Unretained(drm_thread_), widget,
+                 bitmaps, location, frame_delay_ms));
+}
+
+void DrmThreadMessageProxy::OnCursorMove(gfx::AcceleratedWidget widget,
+                                         const gfx::Point& location) {
+  DCHECK(drm_thread_->IsRunning());
+  drm_thread_->task_runner()->PostTask(
+      FROM_HERE, base::Bind(&DrmThread::MoveCursor,
+                            base::Unretained(drm_thread_), widget, location));
+}
+
+void DrmThreadMessageProxy::OnCheckOverlayCapabilities(
+    gfx::AcceleratedWidget widget,
+    const std::vector<OverlayCheck_Params>& overlays) {
+  DCHECK(drm_thread_->IsRunning());
+  auto callback =
+      base::Bind(&DrmThreadMessageProxy::OnCheckOverlayCapabilitiesCallback,
+                 weak_ptr_factory_.GetWeakPtr());
+  drm_thread_->task_runner()->PostTask(
+      FROM_HERE, base::Bind(&DrmThread::CheckOverlayCapabilities,
+                            base::Unretained(drm_thread_), widget, overlays,
+                            CreateSafeCallback(callback)));
+}
+
+void DrmThreadMessageProxy::OnRefreshNativeDisplays() {
+  DCHECK(drm_thread_->IsRunning());
+  auto callback =
+      base::Bind(&DrmThreadMessageProxy::OnRefreshNativeDisplaysCallback,
+                 weak_ptr_factory_.GetWeakPtr());
+  drm_thread_->task_runner()->PostTask(
+      FROM_HERE,
+      base::Bind(&DrmThread::RefreshNativeDisplays,
+                 base::Unretained(drm_thread_), CreateSafeCallback(callback)));
+}
+
+void DrmThreadMessageProxy::OnConfigureNativeDisplay(
+    int64_t id,
+    const DisplayMode_Params& mode,
+    const gfx::Point& origin) {
+  DCHECK(drm_thread_->IsRunning());
+  auto callback =
+      base::Bind(&DrmThreadMessageProxy::OnConfigureNativeDisplayCallback,
+                 weak_ptr_factory_.GetWeakPtr());
+  drm_thread_->task_runner()->PostTask(
+      FROM_HERE, base::Bind(&DrmThread::ConfigureNativeDisplay,
+                            base::Unretained(drm_thread_), id, mode, origin,
+                            CreateSafeCallback(callback)));
+}
+
+void DrmThreadMessageProxy::OnDisableNativeDisplay(int64_t id) {
+  DCHECK(drm_thread_->IsRunning());
+  auto callback =
+      base::Bind(&DrmThreadMessageProxy::OnDisableNativeDisplayCallback,
+                 weak_ptr_factory_.GetWeakPtr());
+  drm_thread_->task_runner()->PostTask(
+      FROM_HERE, base::Bind(&DrmThread::DisableNativeDisplay,
+                            base::Unretained(drm_thread_), id,
+                            CreateSafeCallback(callback)));
+}
+
+void DrmThreadMessageProxy::OnTakeDisplayControl() {
+  DCHECK(drm_thread_->IsRunning());
+  auto callback =
+      base::Bind(&DrmThreadMessageProxy::OnTakeDisplayControlCallback,
+                 weak_ptr_factory_.GetWeakPtr());
+  drm_thread_->task_runner()->PostTask(
+      FROM_HERE,
+      base::Bind(&DrmThread::TakeDisplayControl, base::Unretained(drm_thread_),
+                 CreateSafeCallback(callback)));
+}
+
+void DrmThreadMessageProxy::OnRelinquishDisplayControl() {
+  DCHECK(drm_thread_->IsRunning());
+  auto callback =
+      base::Bind(&DrmThreadMessageProxy::OnRelinquishDisplayControlCallback,
+                 weak_ptr_factory_.GetWeakPtr());
+  drm_thread_->task_runner()->PostTask(
+      FROM_HERE,
+      base::Bind(&DrmThread::RelinquishDisplayControl,
+                 base::Unretained(drm_thread_), CreateSafeCallback(callback)));
+}
+
+void DrmThreadMessageProxy::OnAddGraphicsDevice(
+    const base::FilePath& path,
+    const base::FileDescriptor& fd) {
+  DCHECK(drm_thread_->IsRunning());
+  drm_thread_->task_runner()->PostTask(
+      FROM_HERE, base::Bind(&DrmThread::AddGraphicsDevice,
+                            base::Unretained(drm_thread_), path, fd));
+}
+
+void DrmThreadMessageProxy::OnRemoveGraphicsDevice(const base::FilePath& path) {
+  DCHECK(drm_thread_->IsRunning());
+  drm_thread_->task_runner()->PostTask(
+      FROM_HERE, base::Bind(&DrmThread::RemoveGraphicsDevice,
+                            base::Unretained(drm_thread_), path));
+}
+
+void DrmThreadMessageProxy::OnGetHDCPState(int64_t display_id) {
+  DCHECK(drm_thread_->IsRunning());
+  auto callback = base::Bind(&DrmThreadMessageProxy::OnGetHDCPStateCallback,
+                             weak_ptr_factory_.GetWeakPtr());
+  drm_thread_->task_runner()->PostTask(
+      FROM_HERE,
+      base::Bind(&DrmThread::GetHDCPState, base::Unretained(drm_thread_),
+                 display_id, CreateSafeCallback(callback)));
+}
+
+void DrmThreadMessageProxy::OnSetHDCPState(int64_t display_id,
+                                           HDCPState state) {
+  DCHECK(drm_thread_->IsRunning());
+  auto callback = base::Bind(&DrmThreadMessageProxy::OnSetHDCPStateCallback,
+                             weak_ptr_factory_.GetWeakPtr());
+  drm_thread_->task_runner()->PostTask(
+      FROM_HERE,
+      base::Bind(&DrmThread::SetHDCPState, base::Unretained(drm_thread_),
+                 display_id, state, CreateSafeCallback(callback)));
+}
+
+void DrmThreadMessageProxy::OnSetGammaRamp(
+    int64_t id,
+    const std::vector<GammaRampRGBEntry>& lut) {
+  DCHECK(drm_thread_->IsRunning());
+  drm_thread_->task_runner()->PostTask(
+      FROM_HERE, base::Bind(&DrmThread::SetGammaRamp,
+                            base::Unretained(drm_thread_), id, lut));
+}
+
+void DrmThreadMessageProxy::OnCheckOverlayCapabilitiesCallback(
+    gfx::AcceleratedWidget widget,
+    const std::vector<OverlayCheck_Params>& overlays) const {
+  sender_->Send(new OzoneHostMsg_OverlayCapabilitiesReceived(widget, overlays));
+}
+
+void DrmThreadMessageProxy::OnRefreshNativeDisplaysCallback(
+    const std::vector<DisplaySnapshot_Params>& displays) const {
+  sender_->Send(new OzoneHostMsg_UpdateNativeDisplays(displays));
+}
+
+void DrmThreadMessageProxy::OnConfigureNativeDisplayCallback(
+    int64_t display_id,
+    bool success) const {
+  sender_->Send(new OzoneHostMsg_DisplayConfigured(display_id, success));
+}
+
+void DrmThreadMessageProxy::OnDisableNativeDisplayCallback(int64_t display_id,
+                                                           bool success) const {
+  sender_->Send(new OzoneHostMsg_DisplayConfigured(display_id, success));
+}
+
+void DrmThreadMessageProxy::OnTakeDisplayControlCallback(bool success) const {
+  sender_->Send(new OzoneHostMsg_DisplayControlTaken(success));
+}
+
+void DrmThreadMessageProxy::OnRelinquishDisplayControlCallback(
+    bool success) const {
+  sender_->Send(new OzoneHostMsg_DisplayControlRelinquished(success));
+}
+
+void DrmThreadMessageProxy::OnGetHDCPStateCallback(int64_t display_id,
+                                                   bool success,
+                                                   HDCPState state) const {
+  sender_->Send(new OzoneHostMsg_HDCPStateReceived(display_id, success, state));
+}
+
+void DrmThreadMessageProxy::OnSetHDCPStateCallback(int64_t display_id,
+                                                   bool success) const {
+  sender_->Send(new OzoneHostMsg_HDCPStateUpdated(display_id, success));
+}
+
+}  // namespace ui
diff --git a/ui/ozone/platform/drm/gpu/drm_thread_message_proxy.h b/ui/ozone/platform/drm/gpu/drm_thread_message_proxy.h
new file mode 100644
index 0000000..b07fead
--- /dev/null
+++ b/ui/ozone/platform/drm/gpu/drm_thread_message_proxy.h
@@ -0,0 +1,95 @@
+// 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 UI_OZONE_PLATFORM_DRM_GPU_DRM_THREAD_MESSAGE_PROXY_H_
+#define UI_OZONE_PLATFORM_DRM_GPU_DRM_THREAD_MESSAGE_PROXY_H_
+
+#include "base/memory/weak_ptr.h"
+#include "ipc/message_filter.h"
+#include "ui/display/types/display_constants.h"
+#include "ui/display/types/gamma_ramp_rgb_entry.h"
+#include "ui/gfx/native_widget_types.h"
+
+namespace base {
+struct FileDescriptor;
+class FilePath;
+}
+
+namespace gfx {
+class Point;
+class Rect;
+}
+
+namespace ui {
+
+class DrmThread;
+struct DisplayMode_Params;
+struct DisplaySnapshot_Params;
+struct OverlayCheck_Params;
+
+class DrmThreadMessageProxy : public IPC::MessageFilter {
+ public:
+  DrmThreadMessageProxy(DrmThread* drm_thread);
+
+  // IPC::MessageFilter:
+  void OnFilterAdded(IPC::Sender* sender) override;
+  bool OnMessageReceived(const IPC::Message& message) override;
+
+ private:
+  ~DrmThreadMessageProxy() override;
+
+  void OnCreateWindow(gfx::AcceleratedWidget widget);
+  void OnDestroyWindow(gfx::AcceleratedWidget widget);
+  void OnWindowBoundsChanged(gfx::AcceleratedWidget widget,
+                             const gfx::Rect& bounds);
+  void OnCursorSet(gfx::AcceleratedWidget widget,
+                   const std::vector<SkBitmap>& bitmaps,
+                   const gfx::Point& location,
+                   int frame_delay_ms);
+  void OnCursorMove(gfx::AcceleratedWidget widget, const gfx::Point& location);
+  void OnCheckOverlayCapabilities(
+      gfx::AcceleratedWidget widget,
+      const std::vector<OverlayCheck_Params>& overlays);
+
+  // Display related IPC handlers.
+  void OnRefreshNativeDisplays();
+  void OnConfigureNativeDisplay(int64_t id,
+                                const DisplayMode_Params& mode,
+                                const gfx::Point& origin);
+  void OnDisableNativeDisplay(int64_t id);
+  void OnTakeDisplayControl();
+  void OnRelinquishDisplayControl();
+  void OnAddGraphicsDevice(const base::FilePath& path,
+                           const base::FileDescriptor& fd);
+  void OnRemoveGraphicsDevice(const base::FilePath& path);
+  void OnGetHDCPState(int64_t display_id);
+  void OnSetHDCPState(int64_t display_id, HDCPState state);
+  void OnSetGammaRamp(int64_t id, const std::vector<GammaRampRGBEntry>& lut);
+
+  void OnCheckOverlayCapabilitiesCallback(
+      gfx::AcceleratedWidget widget,
+      const std::vector<OverlayCheck_Params>& overlays) const;
+  void OnRefreshNativeDisplaysCallback(
+      const std::vector<DisplaySnapshot_Params>& displays) const;
+  void OnConfigureNativeDisplayCallback(int64_t display_id, bool success) const;
+  void OnDisableNativeDisplayCallback(int64_t display_id, bool success) const;
+  void OnTakeDisplayControlCallback(bool success) const;
+  void OnRelinquishDisplayControlCallback(bool success) const;
+  void OnGetHDCPStateCallback(int64_t display_id,
+                              bool success,
+                              HDCPState state) const;
+  void OnSetHDCPStateCallback(int64_t display_id, bool success) const;
+
+  DrmThread* drm_thread_;
+
+  IPC::Sender* sender_ = nullptr;
+
+  base::WeakPtrFactory<DrmThreadMessageProxy> weak_ptr_factory_;
+
+  DISALLOW_COPY_AND_ASSIGN(DrmThreadMessageProxy);
+};
+
+}  // namespace ui
+
+#endif  // UI_OZONE_PLATFORM_DRM_GPU_DRM_THREAD_MESSAGE_PROXY_H_
diff --git a/ui/ozone/platform/drm/gpu/drm_thread_proxy.cc b/ui/ozone/platform/drm/gpu/drm_thread_proxy.cc
new file mode 100644
index 0000000..b46e116
--- /dev/null
+++ b/ui/ozone/platform/drm/gpu/drm_thread_proxy.cc
@@ -0,0 +1,42 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "ui/ozone/platform/drm/gpu/drm_thread_proxy.h"
+
+#include "base/bind.h"
+#include "ui/ozone/platform/drm/gpu/drm_thread_message_proxy.h"
+#include "ui/ozone/platform/drm/gpu/drm_window_proxy.h"
+#include "ui/ozone/platform/drm/gpu/gbm_buffer.h"
+#include "ui/ozone/platform/drm/gpu/proxy_helpers.h"
+
+namespace ui {
+
+DrmThreadProxy::DrmThreadProxy() {}
+
+DrmThreadProxy::~DrmThreadProxy() {}
+
+scoped_refptr<DrmThreadMessageProxy>
+DrmThreadProxy::CreateDrmThreadMessageProxy() {
+  return make_scoped_refptr(new DrmThreadMessageProxy(&drm_thread_));
+}
+
+scoped_ptr<DrmWindowProxy> DrmThreadProxy::CreateDrmWindowProxy(
+    gfx::AcceleratedWidget widget) {
+  return make_scoped_ptr(new DrmWindowProxy(widget, &drm_thread_));
+}
+
+scoped_refptr<GbmBuffer> DrmThreadProxy::CreateBuffer(
+    gfx::AcceleratedWidget widget,
+    const gfx::Size& size,
+    gfx::BufferFormat format,
+    gfx::BufferUsage usage) {
+  scoped_refptr<GbmBuffer> buffer;
+  PostSyncTask(
+      drm_thread_.task_runner(),
+      base::Bind(&DrmThread::CreateBuffer, base::Unretained(&drm_thread_),
+                 widget, size, format, usage, &buffer));
+  return buffer;
+}
+
+}  // namespace ui
diff --git a/ui/ozone/platform/drm/gpu/drm_thread_proxy.h b/ui/ozone/platform/drm/gpu/drm_thread_proxy.h
new file mode 100644
index 0000000..fdad1b07
--- /dev/null
+++ b/ui/ozone/platform/drm/gpu/drm_thread_proxy.h
@@ -0,0 +1,43 @@
+// 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 UI_OZONE_PLATFORM_DRM_GPU_DRM_THREAD_PROXY_H_
+#define UI_OZONE_PLATFORM_DRM_GPU_DRM_THREAD_PROXY_H_
+
+#include "base/memory/ref_counted.h"
+#include "base/memory/scoped_ptr.h"
+#include "ui/ozone/platform/drm/gpu/drm_thread.h"
+
+namespace ui {
+
+class DrmThreadMessageProxy;
+class DrmWindowProxy;
+
+// Mediates the communication between GPU main/IO threads and the DRM thread. It
+// serves proxy objects that are safe to call on the GPU threads. The proxy
+// objects then deal with safely posting the messages to the DRM thread.
+class DrmThreadProxy {
+ public:
+  explicit DrmThreadProxy();
+  ~DrmThreadProxy();
+
+  scoped_refptr<DrmThreadMessageProxy> CreateDrmThreadMessageProxy();
+
+  scoped_ptr<DrmWindowProxy> CreateDrmWindowProxy(
+      gfx::AcceleratedWidget widget);
+
+  scoped_refptr<GbmBuffer> CreateBuffer(gfx::AcceleratedWidget widget,
+                                        const gfx::Size& size,
+                                        gfx::BufferFormat format,
+                                        gfx::BufferUsage usage);
+
+ private:
+  DrmThread drm_thread_;
+
+  DISALLOW_COPY_AND_ASSIGN(DrmThreadProxy);
+};
+
+}  // namespace ui
+
+#endif  // UI_OZONE_PLATFORM_DRM_GPU_DRM_THREAD_PROXY_H_
diff --git a/ui/ozone/platform/drm/gpu/drm_vsync_provider.cc b/ui/ozone/platform/drm/gpu/drm_vsync_provider.cc
index a187da5..34cf900 100644
--- a/ui/ozone/platform/drm/gpu/drm_vsync_provider.cc
+++ b/ui/ozone/platform/drm/gpu/drm_vsync_provider.cc
@@ -4,12 +4,11 @@
 
 #include "ui/ozone/platform/drm/gpu/drm_vsync_provider.h"
 
-#include "ui/ozone/platform/drm/gpu/drm_window.h"
+#include "ui/ozone/platform/drm/gpu/drm_window_proxy.h"
 
 namespace ui {
 
-DrmVSyncProvider::DrmVSyncProvider(DrmWindow* window) : window_(window) {
-}
+DrmVSyncProvider::DrmVSyncProvider(DrmWindowProxy* window) : window_(window) {}
 
 DrmVSyncProvider::~DrmVSyncProvider() {
 }
diff --git a/ui/ozone/platform/drm/gpu/drm_vsync_provider.h b/ui/ozone/platform/drm/gpu/drm_vsync_provider.h
index db51f1bd..4fbd181 100644
--- a/ui/ozone/platform/drm/gpu/drm_vsync_provider.h
+++ b/ui/ozone/platform/drm/gpu/drm_vsync_provider.h
@@ -5,21 +5,22 @@
 #ifndef UI_OZONE_PLATFORM_IMPL_DRM_VSYNC_PROVIDER_H_
 #define UI_OZONE_PLATFORM_IMPL_DRM_VSYNC_PROVIDER_H_
 
+#include "ui/gfx/native_widget_types.h"
 #include "ui/gfx/vsync_provider.h"
 
 namespace ui {
 
-class DrmWindow;
+class DrmWindowProxy;
 
 class DrmVSyncProvider : public gfx::VSyncProvider {
  public:
-  DrmVSyncProvider(DrmWindow* window);
+  DrmVSyncProvider(DrmWindowProxy* window);
   ~DrmVSyncProvider() override;
 
   void GetVSyncParameters(const UpdateVSyncCallback& callback) override;
 
  private:
-  DrmWindow* window_;  // Not owned.
+  DrmWindowProxy* window_;
 
   DISALLOW_COPY_AND_ASSIGN(DrmVSyncProvider);
 };
diff --git a/ui/ozone/platform/drm/gpu/drm_window.cc b/ui/ozone/platform/drm/gpu/drm_window.cc
index 969224c4..f0e59f8 100644
--- a/ui/ozone/platform/drm/gpu/drm_window.cc
+++ b/ui/ozone/platform/drm/gpu/drm_window.cc
@@ -82,8 +82,8 @@
   return controller_;
 }
 
-void DrmWindow::OnBoundsChanged(const gfx::Rect& bounds) {
-  TRACE_EVENT2("drm", "DrmWindow::OnBoundsChanged", "widget", widget_, "bounds",
+void DrmWindow::SetBounds(const gfx::Rect& bounds) {
+  TRACE_EVENT2("drm", "DrmWindow::SetBounds", "widget", widget_, "bounds",
                bounds.ToString());
   bounds_ = bounds;
   if (bounds_.size() != bounds.size())
diff --git a/ui/ozone/platform/drm/gpu/drm_window.h b/ui/ozone/platform/drm/gpu/drm_window.h
index a7f4507..629fbdc 100644
--- a/ui/ozone/platform/drm/gpu/drm_window.h
+++ b/ui/ozone/platform/drm/gpu/drm_window.h
@@ -28,6 +28,7 @@
 namespace ui {
 
 class DrmBuffer;
+class DrmDevice;
 class DrmDeviceManager;
 class HardwareDisplayController;
 struct OverlayCheck_Params;
@@ -67,7 +68,7 @@
   void SetController(HardwareDisplayController* controller);
 
   // Called when the window is resized/moved.
-  void OnBoundsChanged(const gfx::Rect& bounds);
+  void SetBounds(const gfx::Rect& bounds);
 
   // Update the HW cursor bitmap & move to specified location. If
   // the bitmap is empty, the cursor is hidden.
diff --git a/ui/ozone/platform/drm/gpu/drm_window_proxy.cc b/ui/ozone/platform/drm/gpu/drm_window_proxy.cc
new file mode 100644
index 0000000..9e2e06f
--- /dev/null
+++ b/ui/ozone/platform/drm/gpu/drm_window_proxy.cc
@@ -0,0 +1,36 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "ui/ozone/platform/drm/gpu/drm_window_proxy.h"
+
+#include "ui/ozone/platform/drm/gpu/drm_thread.h"
+#include "ui/ozone/platform/drm/gpu/overlay_plane.h"
+#include "ui/ozone/platform/drm/gpu/proxy_helpers.h"
+#include "ui/ozone/platform/drm/gpu/scanout_buffer.h"
+
+namespace ui {
+
+DrmWindowProxy::DrmWindowProxy(gfx::AcceleratedWidget widget,
+                               DrmThread* drm_thread)
+    : widget_(widget), drm_thread_(drm_thread) {}
+
+DrmWindowProxy::~DrmWindowProxy() {}
+
+void DrmWindowProxy::SchedulePageFlip(const std::vector<OverlayPlane>& planes,
+                                      const SwapCompletionCallback& callback) {
+  drm_thread_->task_runner()->PostTask(
+      FROM_HERE,
+      base::Bind(&DrmThread::SchedulePageFlip, base::Unretained(drm_thread_),
+                 widget_, planes, CreateSafeCallback(callback)));
+}
+
+void DrmWindowProxy::GetVSyncParameters(
+    const gfx::VSyncProvider::UpdateVSyncCallback& callback) {
+  drm_thread_->task_runner()->PostTask(
+      FROM_HERE,
+      base::Bind(&DrmThread::GetVSyncParameters, base::Unretained(drm_thread_),
+                 widget_, CreateSafeCallback(callback)));
+}
+
+}  // namespace ui
diff --git a/ui/ozone/platform/drm/gpu/drm_window_proxy.h b/ui/ozone/platform/drm/gpu/drm_window_proxy.h
new file mode 100644
index 0000000..87a61b0
--- /dev/null
+++ b/ui/ozone/platform/drm/gpu/drm_window_proxy.h
@@ -0,0 +1,40 @@
+// 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 UI_OZONE_PLATFORM_DRM_GPU_DRM_WINDOW_PROXY_H_
+#define UI_OZONE_PLATFORM_DRM_GPU_DRM_WINDOW_PROXY_H_
+
+#include "ui/gfx/native_widget_types.h"
+#include "ui/gfx/vsync_provider.h"
+#include "ui/ozone/public/surface_ozone_egl.h"
+
+namespace ui {
+
+class DrmThread;
+struct OverlayPlane;
+
+class DrmWindowProxy {
+ public:
+  DrmWindowProxy(gfx::AcceleratedWidget widget, DrmThread* drm_thread);
+  ~DrmWindowProxy();
+
+  gfx::AcceleratedWidget widget() const { return widget_; }
+
+  void SchedulePageFlip(const std::vector<OverlayPlane>& planes,
+                        const SwapCompletionCallback& callback);
+
+  void GetVSyncParameters(
+      const gfx::VSyncProvider::UpdateVSyncCallback& callback);
+
+ private:
+  gfx::AcceleratedWidget widget_;
+
+  DrmThread* drm_thread_;
+
+  DISALLOW_COPY_AND_ASSIGN(DrmWindowProxy);
+};
+
+}  // namespace ui
+
+#endif  // UI_OZONE_PLATFORM_DRM_GPU_DRM_WINDOW_PROXY_H_
diff --git a/ui/ozone/platform/drm/gpu/drm_window_unittest.cc b/ui/ozone/platform/drm/gpu/drm_window_unittest.cc
index a865df38..92d6a3b 100644
--- a/ui/ozone/platform/drm/gpu/drm_window_unittest.cc
+++ b/ui/ozone/platform/drm/gpu/drm_window_unittest.cc
@@ -86,7 +86,7 @@
   scoped_ptr<ui::DrmWindow> window(new ui::DrmWindow(
       kDefaultWidgetHandle, drm_device_manager_.get(), screen_manager_.get()));
   window->Initialize();
-  window->OnBoundsChanged(
+  window->SetBounds(
       gfx::Rect(gfx::Size(kDefaultMode.hdisplay, kDefaultMode.vdisplay)));
   screen_manager_->AddWindow(kDefaultWidgetHandle, window.Pass());
 }
@@ -139,9 +139,8 @@
 
   // Move window to the display on the new device.
   screen_manager_->GetWindow(kDefaultWidgetHandle)
-      ->OnBoundsChanged(gfx::Rect(0, kDefaultMode.vdisplay,
-                                  kDefaultMode.hdisplay,
-                                  kDefaultMode.vdisplay));
+      ->SetBounds(gfx::Rect(0, kDefaultMode.vdisplay, kDefaultMode.hdisplay,
+                            kDefaultMode.vdisplay));
 
   EXPECT_EQ(2u, GetCursorBuffers(drm).size());
   // Make sure the cursor is showing on the new display.
diff --git a/ui/ozone/platform/drm/gpu/gbm_buffer.h b/ui/ozone/platform/drm/gpu/gbm_buffer.h
index 737a9cc0..a8edaad0 100644
--- a/ui/ozone/platform/drm/gpu/gbm_buffer.h
+++ b/ui/ozone/platform/drm/gpu/gbm_buffer.h
@@ -7,7 +7,6 @@
 
 #include "base/files/scoped_file.h"
 #include "base/macros.h"
-#include "base/memory/scoped_ptr.h"
 #include "ui/gfx/buffer_types.h"
 #include "ui/gfx/geometry/size.h"
 #include "ui/ozone/platform/drm/gpu/gbm_buffer_base.h"
diff --git a/ui/ozone/platform/drm/gpu/gbm_surface_factory.cc b/ui/ozone/platform/drm/gpu/gbm_surface_factory.cc
index 32bb918..42be306c4 100644
--- a/ui/ozone/platform/drm/gpu/gbm_surface_factory.cc
+++ b/ui/ozone/platform/drm/gpu/gbm_surface_factory.cc
@@ -9,12 +9,11 @@
 #include "base/files/file_path.h"
 #include "third_party/khronos/EGL/egl.h"
 #include "ui/ozone/common/egl_util.h"
-#include "ui/ozone/platform/drm/gpu/drm_device_manager.h"
-#include "ui/ozone/platform/drm/gpu/drm_window.h"
+#include "ui/ozone/platform/drm/gpu/drm_thread_proxy.h"
+#include "ui/ozone/platform/drm/gpu/drm_window_proxy.h"
 #include "ui/ozone/platform/drm/gpu/gbm_buffer.h"
-#include "ui/ozone/platform/drm/gpu/gbm_device.h"
 #include "ui/ozone/platform/drm/gpu/gbm_surfaceless.h"
-#include "ui/ozone/platform/drm/gpu/hardware_display_controller.h"
+#include "ui/ozone/platform/drm/gpu/proxy_helpers.h"
 #include "ui/ozone/platform/drm/gpu/screen_manager.h"
 #include "ui/ozone/public/native_pixmap.h"
 #include "ui/ozone/public/surface_ozone_canvas.h"
@@ -22,19 +21,13 @@
 
 namespace ui {
 
-GbmSurfaceFactory::GbmSurfaceFactory()
-    : drm_device_manager_(nullptr), screen_manager_(nullptr) {}
+GbmSurfaceFactory::GbmSurfaceFactory(DrmThreadProxy* drm_thread)
+    : drm_thread_(drm_thread) {}
 
 GbmSurfaceFactory::~GbmSurfaceFactory() {
   DCHECK(thread_checker_.CalledOnValidThread());
 }
 
-void GbmSurfaceFactory::InitializeGpu(DrmDeviceManager* drm_device_manager,
-                                      ScreenManager* screen_manager) {
-  drm_device_manager_ = drm_device_manager;
-  screen_manager_ = screen_manager;
-}
-
 void GbmSurfaceFactory::RegisterSurface(gfx::AcceleratedWidget widget,
                                         GbmSurfaceless* surface) {
   DCHECK(thread_checker_.CalledOnValidThread());
@@ -106,7 +99,7 @@
     gfx::AcceleratedWidget widget) {
   DCHECK(thread_checker_.CalledOnValidThread());
   return make_scoped_ptr(
-      new GbmSurfaceless(screen_manager_->GetWindow(widget), this));
+      new GbmSurfaceless(drm_thread_->CreateDrmWindowProxy(widget), this));
 }
 
 scoped_refptr<ui::NativePixmap> GbmSurfaceFactory::CreateNativePixmap(
@@ -120,11 +113,8 @@
   DCHECK(gfx::BufferUsage::SCANOUT == usage);
 #endif
 
-  scoped_refptr<GbmDevice> gbm = GetGbmDevice(widget);
-  DCHECK(gbm);
-
   scoped_refptr<GbmBuffer> buffer =
-      GbmBuffer::CreateBuffer(gbm, format, size, usage);
+      drm_thread_->CreateBuffer(widget, size, format, usage);
   if (!buffer.get())
     return nullptr;
 
@@ -142,10 +132,4 @@
   return pixmap;
 }
 
-scoped_refptr<GbmDevice> GbmSurfaceFactory::GetGbmDevice(
-    gfx::AcceleratedWidget widget) {
-  return static_cast<GbmDevice*>(
-      drm_device_manager_->GetDrmDevice(widget).get());
-}
-
 }  // namespace ui
diff --git a/ui/ozone/platform/drm/gpu/gbm_surface_factory.h b/ui/ozone/platform/drm/gpu/gbm_surface_factory.h
index c67aef5..78a0ce9 100644
--- a/ui/ozone/platform/drm/gpu/gbm_surface_factory.h
+++ b/ui/ozone/platform/drm/gpu/gbm_surface_factory.h
@@ -12,25 +12,20 @@
 
 namespace ui {
 
-class DrmDeviceManager;
-class DrmWindow;
+class DrmThreadProxy;
 class GbmDevice;
 class GbmSurfaceless;
-class ScreenManager;
 
 class GbmSurfaceFactory : public SurfaceFactoryOzone {
  public:
-  GbmSurfaceFactory();
+  GbmSurfaceFactory(DrmThreadProxy* drm_thread);
   ~GbmSurfaceFactory() override;
 
-  void InitializeGpu(DrmDeviceManager* drm_device_manager,
-                     ScreenManager* screen_manager);
-
   void RegisterSurface(gfx::AcceleratedWidget widget, GbmSurfaceless* surface);
   void UnregisterSurface(gfx::AcceleratedWidget widget);
   GbmSurfaceless* GetSurface(gfx::AcceleratedWidget widget) const;
 
-  // DrmSurfaceFactory:
+  // SurfaceFactoryOzone:
   intptr_t GetNativeDisplay() override;
   const int32_t* GetEGLSurfaceProperties(const int32_t* desired_list) override;
   bool LoadEGLGLES2Bindings(
@@ -51,13 +46,10 @@
       const gfx::NativePixmapHandle& handle) override;
 
  private:
-  scoped_refptr<GbmDevice> GetGbmDevice(gfx::AcceleratedWidget widget);
-
-  DrmDeviceManager* drm_device_manager_;  // Not owned.
-  ScreenManager* screen_manager_;         // Not owned.
-
   base::ThreadChecker thread_checker_;
 
+  DrmThreadProxy* drm_thread_;
+
   std::map<gfx::AcceleratedWidget, GbmSurfaceless*> widget_to_surface_map_;
 
   DISALLOW_COPY_AND_ASSIGN(GbmSurfaceFactory);
diff --git a/ui/ozone/platform/drm/gpu/gbm_surfaceless.cc b/ui/ozone/platform/drm/gpu/gbm_surfaceless.cc
index 28b7f21..6b110e9 100644
--- a/ui/ozone/platform/drm/gpu/gbm_surfaceless.cc
+++ b/ui/ozone/platform/drm/gpu/gbm_surfaceless.cc
@@ -4,36 +4,22 @@
 
 #include "ui/ozone/platform/drm/gpu/gbm_surfaceless.h"
 
-#include "base/bind.h"
-#include "base/thread_task_runner_handle.h"
 #include "ui/ozone/platform/drm/gpu/drm_device.h"
 #include "ui/ozone/platform/drm/gpu/drm_vsync_provider.h"
-#include "ui/ozone/platform/drm/gpu/drm_window.h"
-#include "ui/ozone/platform/drm/gpu/gbm_buffer.h"
+#include "ui/ozone/platform/drm/gpu/drm_window_proxy.h"
 #include "ui/ozone/platform/drm/gpu/gbm_surface_factory.h"
-#include "ui/ozone/platform/drm/gpu/hardware_display_controller.h"
+#include "ui/ozone/platform/drm/gpu/scanout_buffer.h"
 
 namespace ui {
 
-namespace {
-
-void PostedSwapResult(const SwapCompletionCallback& callback,
-                      gfx::SwapResult result) {
-  base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE,
-                                                base::Bind(callback, result));
-}
-
-}  // namespace
-
-GbmSurfaceless::GbmSurfaceless(DrmWindow* window,
+GbmSurfaceless::GbmSurfaceless(scoped_ptr<DrmWindowProxy> window,
                                GbmSurfaceFactory* surface_manager)
-    : window_(window),
-      surface_manager_(surface_manager) {
-  surface_manager_->RegisterSurface(window_->GetAcceleratedWidget(), this);
+    : window_(window.Pass()), surface_manager_(surface_manager) {
+  surface_manager_->RegisterSurface(window_->widget(), this);
 }
 
 GbmSurfaceless::~GbmSurfaceless() {
-  surface_manager_->UnregisterSurface(window_->GetAcceleratedWidget());
+  surface_manager_->UnregisterSurface(window_->widget());
 }
 
 void GbmSurfaceless::QueueOverlayPlane(const OverlayPlane& plane) {
@@ -56,15 +42,13 @@
 
 bool GbmSurfaceless::OnSwapBuffersAsync(
     const SwapCompletionCallback& callback) {
-  // Wrap the callback and post the result such that everything using the
-  // callback doesn't need to worry about re-entrancy.
-  window_->SchedulePageFlip(planes_, base::Bind(&PostedSwapResult, callback));
+  window_->SchedulePageFlip(planes_, callback);
   planes_.clear();
   return true;
 }
 
 scoped_ptr<gfx::VSyncProvider> GbmSurfaceless::CreateVSyncProvider() {
-  return make_scoped_ptr(new DrmVSyncProvider(window_));
+  return make_scoped_ptr(new DrmVSyncProvider(window_.get()));
 }
 
 bool GbmSurfaceless::IsUniversalDisplayLinkDevice() {
diff --git a/ui/ozone/platform/drm/gpu/gbm_surfaceless.h b/ui/ozone/platform/drm/gpu/gbm_surfaceless.h
index b56a6eb..54f749e 100644
--- a/ui/ozone/platform/drm/gpu/gbm_surfaceless.h
+++ b/ui/ozone/platform/drm/gpu/gbm_surfaceless.h
@@ -7,16 +7,17 @@
 
 #include <vector>
 
+#include "ui/gfx/native_widget_types.h"
 #include "ui/ozone/platform/drm/gpu/overlay_plane.h"
 #include "ui/ozone/public/surface_ozone_egl.h"
 
 namespace gfx {
 class Size;
-}  // namespace gfx
+}
 
 namespace ui {
 
-class DrmWindow;
+class DrmWindowProxy;
 class GbmSurfaceFactory;
 
 // In surfaceless mode drawing and displaying happens directly through
@@ -25,7 +26,7 @@
 // presentation.
 class GbmSurfaceless : public SurfaceOzoneEGL {
  public:
-  GbmSurfaceless(DrmWindow* window,
+  GbmSurfaceless(scoped_ptr<DrmWindowProxy> window,
                  GbmSurfaceFactory* surface_manager);
   ~GbmSurfaceless() override;
 
@@ -40,8 +41,10 @@
   bool IsUniversalDisplayLinkDevice() override;
 
  protected:
-  DrmWindow* window_;
+  scoped_ptr<DrmWindowProxy> window_;
+
   GbmSurfaceFactory* surface_manager_;
+
   std::vector<OverlayPlane> planes_;
 
   DISALLOW_COPY_AND_ASSIGN(GbmSurfaceless);
diff --git a/ui/ozone/platform/drm/gpu/proxy_helpers.cc b/ui/ozone/platform/drm/gpu/proxy_helpers.cc
new file mode 100644
index 0000000..556280d
--- /dev/null
+++ b/ui/ozone/platform/drm/gpu/proxy_helpers.cc
@@ -0,0 +1,31 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "ui/ozone/platform/drm/gpu/proxy_helpers.h"
+
+#include "base/synchronization/waitable_event.h"
+
+namespace ui {
+
+namespace {
+
+void OnRunPostedTaskAndSignal(const base::Closure& callback,
+                              base::WaitableEvent* wait) {
+  callback.Run();
+  wait->Signal();
+}
+
+}  // namespace
+
+void PostSyncTask(
+    const scoped_refptr<base::SingleThreadTaskRunner>& task_runner,
+    const base::Closure& callback) {
+  base::WaitableEvent wait(false, false);
+  bool success = task_runner->PostTask(
+      FROM_HERE, base::Bind(OnRunPostedTaskAndSignal, callback, &wait));
+  if (success)
+    wait.Wait();
+}
+
+}  // namespace ui
diff --git a/ui/ozone/platform/drm/gpu/proxy_helpers.h b/ui/ozone/platform/drm/gpu/proxy_helpers.h
new file mode 100644
index 0000000..e676c14
--- /dev/null
+++ b/ui/ozone/platform/drm/gpu/proxy_helpers.h
@@ -0,0 +1,45 @@
+// 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 UI_OZONE_PLATFORM_DRM_GPU_PROXY_HELPERS_H_
+#define UI_OZONE_PLATFORM_DRM_GPU_PROXY_HELPERS_H_
+
+#include "base/bind.h"
+#include "base/location.h"
+#include "base/memory/ref_counted.h"
+#include "base/thread_task_runner_handle.h"
+
+namespace ui {
+
+namespace internal {
+
+template <typename... Args>
+void PostAsyncTask(
+    const scoped_refptr<base::SingleThreadTaskRunner>& task_runner,
+    const base::Callback<void(Args...)>& callback,
+    Args... args) {
+  task_runner->PostTask(FROM_HERE, base::Bind(callback, args...));
+}
+
+}  // namespace internal
+
+// Posts a task to a different thread and blocks waiting for the task to finish
+// executing.
+void PostSyncTask(
+    const scoped_refptr<base::SingleThreadTaskRunner>& task_runner,
+    const base::Closure& callback);
+
+// Creates a callback that will run |callback| on the calling thread. Useful
+// when posting a task on a different thread and expecting a callback when the
+// task finished (and the callback needs to run on the original thread).
+template <typename... Args>
+base::Callback<void(Args...)> CreateSafeCallback(
+    const base::Callback<void(Args...)>& callback) {
+  return base::Bind(&internal::PostAsyncTask<Args...>,
+                    base::ThreadTaskRunnerHandle::Get(), callback);
+}
+
+}  // namespace ui
+
+#endif  // UI_OZONE_PLATFORM_DRM_GPU_PROXY_HELPERS_H_
diff --git a/ui/ozone/platform/drm/gpu/screen_manager.cc b/ui/ozone/platform/drm/gpu/screen_manager.cc
index 434f8c4..0fefd4b 100644
--- a/ui/ozone/platform/drm/gpu/screen_manager.cc
+++ b/ui/ozone/platform/drm/gpu/screen_manager.cc
@@ -235,7 +235,6 @@
   if (it != window_map_.end())
     return it->second;
 
-  NOTREACHED() << "Attempting to get non-existing window for " << widget;
   return nullptr;
 }
 
diff --git a/ui/ozone/platform/drm/gpu/screen_manager_unittest.cc b/ui/ozone/platform/drm/gpu/screen_manager_unittest.cc
index dab71fb..ba88b1d 100644
--- a/ui/ozone/platform/drm/gpu/screen_manager_unittest.cc
+++ b/ui/ozone/platform/drm/gpu/screen_manager_unittest.cc
@@ -374,7 +374,7 @@
   scoped_ptr<ui::DrmWindow> window(
       new ui::DrmWindow(1, device_manager_.get(), screen_manager_.get()));
   window->Initialize();
-  window->OnBoundsChanged(GetPrimaryBounds());
+  window->SetBounds(GetPrimaryBounds());
   screen_manager_->AddWindow(1, window.Pass());
 
   screen_manager_->AddDisplayController(drm_, kPrimaryCrtc, kPrimaryConnector);
@@ -394,7 +394,7 @@
   window->Initialize();
   gfx::Rect new_bounds = GetPrimaryBounds();
   new_bounds.Inset(0, 0, 1, 1);
-  window->OnBoundsChanged(new_bounds);
+  window->SetBounds(new_bounds);
   screen_manager_->AddWindow(1, window.Pass());
 
   screen_manager_->AddDisplayController(drm_, kPrimaryCrtc, kPrimaryConnector);
@@ -415,7 +415,7 @@
     scoped_ptr<ui::DrmWindow> window(
         new ui::DrmWindow(i, device_manager_.get(), screen_manager_.get()));
     window->Initialize();
-    window->OnBoundsChanged(GetPrimaryBounds());
+    window->SetBounds(GetPrimaryBounds());
     screen_manager_->AddWindow(i, window.Pass());
   }
 
@@ -440,7 +440,7 @@
   scoped_ptr<ui::DrmWindow> window(new ui::DrmWindow(
       window_id, device_manager_.get(), screen_manager_.get()));
   window->Initialize();
-  window->OnBoundsChanged(GetPrimaryBounds());
+  window->SetBounds(GetPrimaryBounds());
   screen_manager_->AddWindow(window_id, window.Pass());
 
   screen_manager_->AddDisplayController(drm_, kPrimaryCrtc, kPrimaryConnector);
@@ -462,7 +462,7 @@
   scoped_ptr<ui::DrmWindow> window(
       new ui::DrmWindow(1, device_manager_.get(), screen_manager_.get()));
   window->Initialize();
-  window->OnBoundsChanged(GetPrimaryBounds());
+  window->SetBounds(GetPrimaryBounds());
   screen_manager_->AddWindow(1, window.Pass());
 
   screen_manager_->AddDisplayController(drm_, kPrimaryCrtc, kPrimaryConnector);
@@ -491,7 +491,7 @@
   scoped_ptr<ui::DrmWindow> window(
       new ui::DrmWindow(1, device_manager_.get(), screen_manager_.get()));
   window->Initialize();
-  window->OnBoundsChanged(GetPrimaryBounds());
+  window->SetBounds(GetPrimaryBounds());
   scoped_refptr<ui::ScanoutBuffer> buffer = buffer_generator_->Create(
       drm_, gfx::BufferFormat::BGRA_8888, GetPrimaryBounds().size());
   window->SchedulePageFlip(
diff --git a/ui/ozone/platform/drm/host/drm_overlay_candidates_host.cc b/ui/ozone/platform/drm/host/drm_overlay_candidates_host.cc
index 8f6fd92..98f8b47 100644
--- a/ui/ozone/platform/drm/host/drm_overlay_candidates_host.cc
+++ b/ui/ozone/platform/drm/host/drm_overlay_candidates_host.cc
@@ -241,6 +241,11 @@
 
 void DrmOverlayCandidatesHost::ValidateCandidates(
     OverlaySurfaceCandidateList* candidates) {
+  // Make sure params being currently used are in cache. They might have been
+  // removed in case we haven't tried to get them from cache for a while.
+  for (const auto& param : in_use_compatible_params_)
+    cache_.Put(param.first, true);
+
   in_use_compatible_params_.clear();
   typedef std::pair<OverlaySurfaceCandidate*, OverlayCheck_Params>
       CandidatePair;
diff --git a/ui/ozone/platform/drm/ozone_platform_gbm.cc b/ui/ozone/platform/drm/ozone_platform_gbm.cc
index ec4c1b6..5bb3744 100644
--- a/ui/ozone/platform/drm/ozone_platform_gbm.cc
+++ b/ui/ozone/platform/drm/ozone_platform_gbm.cc
@@ -5,8 +5,10 @@
 #include "ui/ozone/platform/drm/ozone_platform_gbm.h"
 
 #include <dlfcn.h>
+#include <fcntl.h>
 #include <gbm.h>
 #include <stdlib.h>
+#include <xf86drm.h>
 
 #include "base/bind.h"
 #include "ui/base/cursor/ozone/bitmap_cursor_factory_ozone.h"
@@ -18,9 +20,10 @@
 #include "ui/ozone/platform/drm/gpu/drm_device_manager.h"
 #include "ui/ozone/platform/drm/gpu/drm_gpu_display_manager.h"
 #include "ui/ozone/platform/drm/gpu/drm_gpu_platform_support.h"
-#include "ui/ozone/platform/drm/gpu/gbm_buffer.h"
-#include "ui/ozone/platform/drm/gpu/gbm_device.h"
+#include "ui/ozone/platform/drm/gpu/drm_thread_message_proxy.h"
+#include "ui/ozone/platform/drm/gpu/drm_thread_proxy.h"
 #include "ui/ozone/platform/drm/gpu/gbm_surface_factory.h"
+#include "ui/ozone/platform/drm/gpu/proxy_helpers.h"
 #include "ui/ozone/platform/drm/gpu/scanout_buffer.h"
 #include "ui/ozone/platform/drm/gpu/screen_manager.h"
 #include "ui/ozone/platform/drm/host/drm_cursor.h"
@@ -43,10 +46,6 @@
 #include "ui/events/ozone/layout/stub/stub_keyboard_layout_engine.h"
 #endif
 
-#if defined(USE_VGEM_MAP)
-#include <fcntl.h>
-#endif
-
 namespace ui {
 
 namespace {
@@ -71,47 +70,6 @@
   DISALLOW_COPY_AND_ASSIGN(GlApiLoader);
 };
 
-class GbmBufferGenerator : public ScanoutBufferGenerator {
- public:
-  GbmBufferGenerator() {}
-  ~GbmBufferGenerator() override {}
-
-  // ScanoutBufferGenerator:
-  scoped_refptr<ScanoutBuffer> Create(const scoped_refptr<DrmDevice>& drm,
-                                      gfx::BufferFormat format,
-                                      const gfx::Size& size) override {
-    scoped_refptr<GbmDevice> gbm(static_cast<GbmDevice*>(drm.get()));
-    return GbmBuffer::CreateBuffer(gbm, format, size,
-                                   gfx::BufferUsage::SCANOUT);
-  }
-
- protected:
-  DISALLOW_COPY_AND_ASSIGN(GbmBufferGenerator);
-};
-
-class GbmDeviceGenerator : public DrmDeviceGenerator {
- public:
-  GbmDeviceGenerator(bool use_atomic) : use_atomic_(use_atomic) {}
-  ~GbmDeviceGenerator() override {}
-
-  // DrmDeviceGenerator:
-  scoped_refptr<DrmDevice> CreateDevice(const base::FilePath& path,
-                                        base::File file,
-                                        bool is_primary_device) override {
-    scoped_refptr<DrmDevice> drm =
-        new GbmDevice(path, file.Pass(), is_primary_device);
-    if (drm->Initialize(use_atomic_))
-      return drm;
-
-    return nullptr;
-  }
-
- private:
-  bool use_atomic_;
-
-  DISALLOW_COPY_AND_ASSIGN(GbmDeviceGenerator);
-};
-
 class OzonePlatformGbm : public OzonePlatform {
  public:
   OzonePlatformGbm() {}
@@ -119,7 +77,7 @@
 
   // OzonePlatform:
   ui::SurfaceFactoryOzone* GetSurfaceFactoryOzone() override {
-    return surface_factory_ozone_.get();
+    return surface_factory_.get();
   }
   OverlayManagerOzone* GetOverlayManager() override {
     return overlay_manager_.get();
@@ -155,11 +113,12 @@
   }
   base::ScopedFD OpenClientNativePixmapDevice() const override {
 #if defined(USE_VGEM_MAP)
-    static const char kVgemPath[] = "/dev/dri/renderD129";
-    base::ScopedFD vgem_fd(open(kVgemPath, O_RDWR | O_CLOEXEC));
-    if (!vgem_fd.is_valid())
-      PLOG(ERROR) << "Failed to open: " << kVgemPath;
-    return vgem_fd;
+    int vgem_fd = drmOpenWithType("vgem", nullptr, DRM_NODE_RENDER);
+    if (vgem_fd < 0) {
+      PLOG(ERROR) << "Failed to find vgem device";
+      vgem_fd = -1;
+    }
+    return base::ScopedFD(vgem_fd);
 #endif
     return base::ScopedFD();
   }
@@ -188,32 +147,21 @@
   }
 
   void InitializeGPU() override {
-    bool use_atomic = false;
-#if defined(USE_DRM_ATOMIC)
-    use_atomic = true;
-#endif
     gl_api_loader_.reset(new GlApiLoader());
-    drm_device_manager_.reset(new DrmDeviceManager(
-        scoped_ptr<DrmDeviceGenerator>(new GbmDeviceGenerator(use_atomic))));
-    buffer_generator_.reset(new GbmBufferGenerator());
-    screen_manager_.reset(new ScreenManager(buffer_generator_.get()));
-    surface_factory_ozone_.reset(new GbmSurfaceFactory());
-    surface_factory_ozone_->InitializeGpu(drm_device_manager_.get(),
-                                          screen_manager_.get());
-    scoped_ptr<DrmGpuDisplayManager> display_manager(new DrmGpuDisplayManager(
-        screen_manager_.get(), drm_device_manager_.get()));
-    gpu_platform_support_.reset(new DrmGpuPlatformSupport(
-        drm_device_manager_.get(), screen_manager_.get(),
-        buffer_generator_.get(), display_manager.Pass()));
+    // NOTE: Can't start the thread here since this is called before sandbox
+    // initialization.
+    drm_thread_.reset(new DrmThreadProxy());
+
+    surface_factory_.reset(new GbmSurfaceFactory(drm_thread_.get()));
+    gpu_platform_support_.reset(
+        new DrmGpuPlatformSupport(drm_thread_->CreateDrmThreadMessageProxy()));
   }
 
  private:
   // Objects in the GPU process.
-  scoped_ptr<GbmSurfaceFactory> surface_factory_ozone_;
+  scoped_ptr<DrmThreadProxy> drm_thread_;
   scoped_ptr<GlApiLoader> gl_api_loader_;
-  scoped_ptr<DrmDeviceManager> drm_device_manager_;
-  scoped_ptr<GbmBufferGenerator> buffer_generator_;
-  scoped_ptr<ScreenManager> screen_manager_;
+  scoped_ptr<GbmSurfaceFactory> surface_factory_;
   scoped_ptr<DrmGpuPlatformSupport> gpu_platform_support_;
 
   // Objects in the Browser process.
diff --git a/ui/ozone/public/ozone_gpu_test_helper.cc b/ui/ozone/public/ozone_gpu_test_helper.cc
index 8490a32..fe5a17b 100644
--- a/ui/ozone/public/ozone_gpu_test_helper.cc
+++ b/ui/ozone/public/ozone_gpu_test_helper.cc
@@ -19,15 +19,36 @@
 
 const int kGpuProcessHostId = 1;
 
-}  // namespace
-
-static void DispatchToGpuPlatformSupportHostTask(IPC::Message* msg) {
+void DispatchToGpuPlatformSupportHostTask(IPC::Message* msg) {
   ui::OzonePlatform::GetInstance()
       ->GetGpuPlatformSupportHost()
       ->OnMessageReceived(*msg);
   delete msg;
 }
 
+void DispatchToGpuPlatformSupportTask(IPC::Message* msg) {
+  ui::OzonePlatform::GetInstance()->GetGpuPlatformSupport()->OnMessageReceived(
+      *msg);
+  delete msg;
+}
+
+void DispatchToGpuPlatformSupportTaskOnIO(
+    const scoped_refptr<base::SingleThreadTaskRunner>& gpu_task_runner,
+    IPC::Message* msg) {
+  IPC::MessageFilter* filter = ui::OzonePlatform::GetInstance()
+                                   ->GetGpuPlatformSupport()
+                                   ->GetMessageFilter();
+  if (filter && filter->OnMessageReceived(*msg)) {
+    delete msg;
+    return;
+  }
+
+  gpu_task_runner->PostTask(FROM_HERE,
+                            base::Bind(DispatchToGpuPlatformSupportTask, msg));
+}
+
+}  // namespace
+
 class FakeGpuProcess : public IPC::Sender {
  public:
   FakeGpuProcess(
@@ -60,30 +81,27 @@
   scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner_;
 };
 
-static void DispatchToGpuPlatformSupportTask(IPC::Message* msg) {
-  ui::OzonePlatform::GetInstance()->GetGpuPlatformSupport()->OnMessageReceived(
-      *msg);
-  delete msg;
-}
-
 class FakeGpuProcessHost {
  public:
   FakeGpuProcessHost(
-      const scoped_refptr<base::SingleThreadTaskRunner>& gpu_task_runner)
-      : gpu_task_runner_(gpu_task_runner) {}
+      const scoped_refptr<base::SingleThreadTaskRunner>& gpu_task_runner,
+      const scoped_refptr<base::SingleThreadTaskRunner>& gpu_io_task_runner)
+      : gpu_task_runner_(gpu_task_runner),
+        gpu_io_task_runner_(gpu_io_task_runner) {}
   ~FakeGpuProcessHost() {}
 
   void Init() {
     base::Callback<void(IPC::Message*)> sender =
-        base::Bind(&DispatchToGpuPlatformSupportTask);
+        base::Bind(&DispatchToGpuPlatformSupportTaskOnIO, gpu_task_runner_);
 
     ui::OzonePlatform::GetInstance()
         ->GetGpuPlatformSupportHost()
-        ->OnChannelEstablished(kGpuProcessHostId, gpu_task_runner_, sender);
+        ->OnChannelEstablished(kGpuProcessHostId, gpu_io_task_runner_, sender);
   }
 
  private:
   scoped_refptr<base::SingleThreadTaskRunner> gpu_task_runner_;
+  scoped_refptr<base::SingleThreadTaskRunner> gpu_io_task_runner_;
 };
 
 OzoneGpuTestHelper::OzoneGpuTestHelper() {
@@ -106,7 +124,8 @@
                             base::Unretained(fake_gpu_process_.get())));
   fake_gpu_process_->Init();
 
-  fake_gpu_process_host_.reset(new FakeGpuProcessHost(gpu_task_runner));
+  fake_gpu_process_host_.reset(new FakeGpuProcessHost(
+      gpu_task_runner, io_helper_thread_->task_runner()));
   fake_gpu_process_host_->Init();
 
   return true;
diff --git a/ui/resources/default_100_percent/common/default_favicon.png b/ui/resources/default_100_percent/common/default_favicon.png
index 0fa4e3b..15ef66e 100644
--- a/ui/resources/default_100_percent/common/default_favicon.png
+++ b/ui/resources/default_100_percent/common/default_favicon.png
Binary files differ
diff --git a/ui/resources/default_100_percent/common/default_favicon_32.png b/ui/resources/default_100_percent/common/default_favicon_32.png
index 57a494c..97edf24 100644
--- a/ui/resources/default_100_percent/common/default_favicon_32.png
+++ b/ui/resources/default_100_percent/common/default_favicon_32.png
Binary files differ
diff --git a/ui/resources/default_100_percent/common/default_favicon_64.png b/ui/resources/default_100_percent/common/default_favicon_64.png
index dcaedeb9..fffae3c4 100644
--- a/ui/resources/default_100_percent/common/default_favicon_64.png
+++ b/ui/resources/default_100_percent/common/default_favicon_64.png
Binary files differ
diff --git a/ui/resources/default_200_percent/common/default_favicon.png b/ui/resources/default_200_percent/common/default_favicon.png
index 2bb6d32..033ea1a 100644
--- a/ui/resources/default_200_percent/common/default_favicon.png
+++ b/ui/resources/default_200_percent/common/default_favicon.png
Binary files differ
diff --git a/ui/resources/default_200_percent/common/default_favicon_32.png b/ui/resources/default_200_percent/common/default_favicon_32.png
index dcaedeb9..fffae3c4 100644
--- a/ui/resources/default_200_percent/common/default_favicon_32.png
+++ b/ui/resources/default_200_percent/common/default_favicon_32.png
Binary files differ
diff --git a/ui/resources/default_200_percent/common/default_favicon_64.png b/ui/resources/default_200_percent/common/default_favicon_64.png
index 3bc0556..9572b29 100644
--- a/ui/resources/default_200_percent/common/default_favicon_64.png
+++ b/ui/resources/default_200_percent/common/default_favicon_64.png
Binary files differ
diff --git a/ui/touch_selection/ui_touch_selection.gyp b/ui/touch_selection/ui_touch_selection.gyp
index 5bb9e2a..e122484e 100644
--- a/ui/touch_selection/ui_touch_selection.gyp
+++ b/ui/touch_selection/ui_touch_selection.gyp
@@ -129,8 +129,27 @@
           'includes': [ '../../build/apk_test.gypi' ],
         },
       ],
+      'conditions': [
+        ['test_isolation_mode != "noop"', {
+          'targets': [
+            {
+              'target_name': 'ui_touch_selection_unittests_apk_run',
+              'type': 'none',
+              'dependencies': [
+                'ui_touch_selection_unittests_apk',
+              ],
+              'includes': [
+                '../../build/isolate.gypi',
+              ],
+              'sources': [
+                'ui_touch_selection_unittests_apk.isolate',
+              ],
+            },
+          ]
+        }],
+      ],
     }],  # OS == "android"
-    ['test_isolation_mode != "noop"', {
+    ['test_isolation_mode != "noop" and OS != "android"', {
       'targets': [
         {
           'target_name': 'ui_touch_selection_unittests_run',
diff --git a/ui/touch_selection/ui_touch_selection_unittests_apk.isolate b/ui/touch_selection/ui_touch_selection_unittests_apk.isolate
new file mode 100644
index 0000000..a2b39ac
--- /dev/null
+++ b/ui/touch_selection/ui_touch_selection_unittests_apk.isolate
@@ -0,0 +1,17 @@
+# 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.
+{
+  'includes': [
+    '../../build/android/android.isolate',
+  ],
+  'variables': {
+    'command': [
+      '<(PRODUCT_DIR)/bin/run_ui_touch_selection_unittests',
+    ],
+    'files': [
+      '<(PRODUCT_DIR)/bin/run_ui_touch_selection_unittests',
+      '<(PRODUCT_DIR)/ui_touch_selection_unittests_apk/',
+    ]
+  },
+}
diff --git a/ui/views/animation/ink_drop_animation.cc b/ui/views/animation/ink_drop_animation.cc
index d5ce3ca9..4826f78a 100644
--- a/ui/views/animation/ink_drop_animation.cc
+++ b/ui/views/animation/ink_drop_animation.cc
@@ -11,13 +11,14 @@
 #include "third_party/skia/include/core/SkColor.h"
 #include "third_party/skia/include/core/SkPaint.h"
 #include "ui/base/ui_base_switches.h"
+#include "ui/compositor/callback_layer_animation_observer.h"
 #include "ui/compositor/layer.h"
-#include "ui/compositor/layer_animation_observer.h"
 #include "ui/compositor/layer_animation_sequence.h"
 #include "ui/compositor/paint_recorder.h"
 #include "ui/compositor/scoped_layer_animation_settings.h"
 #include "ui/gfx/canvas.h"
 #include "ui/gfx/transform_util.h"
+#include "ui/views/animation/ink_drop_animation_observer.h"
 #include "ui/views/view.h"
 
 namespace {
@@ -253,75 +254,108 @@
   root_layer_->SetMasksToBounds(false);
   root_layer_->SetBounds(gfx::Rect(large_size_));
 
-  ResetTransformsToMinSize();
-
-  SetOpacity(kHiddenOpacity);
+  SetStateToHidden();
 }
 
-InkDropAnimation::~InkDropAnimation() {}
+InkDropAnimation::~InkDropAnimation() {
+  // Explicitly aborting all the animations ensures all callbacks are invoked
+  // while this instance still exists.
+  AbortAllAnimations();
+}
+
+void InkDropAnimation::AddObserver(InkDropAnimationObserver* observer) {
+  observers_.AddObserver(observer);
+}
+
+void InkDropAnimation::RemoveObserver(InkDropAnimationObserver* observer) {
+  observers_.RemoveObserver(observer);
+}
 
 void InkDropAnimation::AnimateToState(InkDropState ink_drop_state) {
-  if (ink_drop_state_ == ink_drop_state)
-    return;
+  // |animation_observer| will be deleted when AnimationEndedCallback() returns
+  // true.
+  ui::CallbackLayerAnimationObserver* animation_observer =
+      new ui::CallbackLayerAnimationObserver(
+          base::Bind(&InkDropAnimation::AnimationStartedCallback,
+                     base::Unretained(this), ink_drop_state),
+          base::Bind(&InkDropAnimation::AnimationEndedCallback,
+                     base::Unretained(this), ink_drop_state));
+  AnimateToStateInternal(ink_drop_state, animation_observer);
+  animation_observer->SetActive();
+}
+
+void InkDropAnimation::SetCenterPoint(const gfx::Point& center_point) {
+  gfx::Transform transform;
+  transform.Translate(center_point.x(), center_point.y());
+  root_layer_->SetTransform(transform);
+}
+
+void InkDropAnimation::AnimateToStateInternal(
+    InkDropState ink_drop_state,
+    ui::LayerAnimationObserver* animation_observer) {
+  ink_drop_state_ = ink_drop_state;
 
   if (ink_drop_state_ == InkDropState::HIDDEN) {
-    ResetTransformsToMinSize();
-    SetOpacity(kVisibleOpacity);
+    // Animating to the HIDDEN state doesn't actually use any
+    // LayerAnimationSequences so we need to explicitly abort any running ones
+    // so that observers receive an InkDropAnimationEnded() event for the
+    // running animation prior to receiving an InkDropAnimationStarted() event
+    // for the HIDDEN 'animation'.
+    AbortAllAnimations();
+    root_layer_->SetVisible(false);
+    SetStateToHidden();
+    return;
   }
 
   InkDropTransforms transforms;
-
-  // Must set the |ink_drop_state_| before handling the state change because
-  // some state changes make recursive calls to AnimateToState() and the last
-  // call should 'win'.
-  ink_drop_state_ = ink_drop_state;
+  root_layer_->SetVisible(true);
 
   switch (ink_drop_state_) {
     case InkDropState::HIDDEN:
-      GetCurrentTansforms(&transforms);
-      AnimateToTransforms(transforms, kHiddenOpacity,
-                          GetAnimationDuration(InkDropState::HIDDEN),
-                          ui::LayerAnimator::ENQUEUE_NEW_ANIMATION);
+      // This case is handled above in a short circuit return.
       break;
     case InkDropState::ACTION_PENDING:
       CalculateCircleTransforms(large_size_, &transforms);
       AnimateToTransforms(transforms, kVisibleOpacity,
                           GetAnimationDuration(InkDropState::ACTION_PENDING),
-                          ui::LayerAnimator::IMMEDIATELY_ANIMATE_TO_NEW_TARGET);
+                          ui::LayerAnimator::IMMEDIATELY_ANIMATE_TO_NEW_TARGET,
+                          animation_observer);
       break;
     case InkDropState::QUICK_ACTION:
       CalculateCircleTransforms(large_size_, &transforms);
       AnimateToTransforms(transforms, kHiddenOpacity,
                           GetAnimationDuration(InkDropState::QUICK_ACTION),
-                          ui::LayerAnimator::IMMEDIATELY_ANIMATE_TO_NEW_TARGET);
-      AnimateToState(InkDropState::HIDDEN);
+                          ui::LayerAnimator::IMMEDIATELY_ANIMATE_TO_NEW_TARGET,
+                          animation_observer);
       break;
     case InkDropState::SLOW_ACTION_PENDING:
       CalculateRectTransforms(small_size_, small_corner_radius_, &transforms);
       AnimateToTransforms(
           transforms, kVisibleOpacity,
           GetAnimationDuration(InkDropState::SLOW_ACTION_PENDING),
-          ui::LayerAnimator::IMMEDIATELY_ANIMATE_TO_NEW_TARGET);
+          ui::LayerAnimator::IMMEDIATELY_ANIMATE_TO_NEW_TARGET,
+          animation_observer);
       break;
     case InkDropState::SLOW_ACTION:
       CalculateRectTransforms(large_size_, large_corner_radius_, &transforms);
       AnimateToTransforms(transforms, kHiddenOpacity,
                           GetAnimationDuration(InkDropState::SLOW_ACTION),
-                          ui::LayerAnimator::IMMEDIATELY_ANIMATE_TO_NEW_TARGET);
-      AnimateToState(InkDropState::HIDDEN);
+                          ui::LayerAnimator::IMMEDIATELY_ANIMATE_TO_NEW_TARGET,
+                          animation_observer);
       break;
     case InkDropState::ACTIVATED:
       CalculateRectTransforms(small_size_, small_corner_radius_, &transforms);
       AnimateToTransforms(transforms, kVisibleOpacity,
                           GetAnimationDuration(InkDropState::ACTIVATED),
-                          ui::LayerAnimator::IMMEDIATELY_ANIMATE_TO_NEW_TARGET);
+                          ui::LayerAnimator::IMMEDIATELY_ANIMATE_TO_NEW_TARGET,
+                          animation_observer);
       break;
     case InkDropState::DEACTIVATED:
       CalculateRectTransforms(large_size_, large_corner_radius_, &transforms);
       AnimateToTransforms(transforms, kHiddenOpacity,
                           GetAnimationDuration(InkDropState::DEACTIVATED),
-                          ui::LayerAnimator::IMMEDIATELY_ANIMATE_TO_NEW_TARGET);
-      AnimateToState(InkDropState::HIDDEN);
+                          ui::LayerAnimator::IMMEDIATELY_ANIMATE_TO_NEW_TARGET,
+                          animation_observer);
       break;
   }
 }
@@ -330,7 +364,8 @@
     const InkDropTransforms transforms,
     float opacity,
     base::TimeDelta duration,
-    ui::LayerAnimator::PreemptionStrategy preemption_strategy) {
+    ui::LayerAnimator::PreemptionStrategy preemption_strategy,
+    ui::LayerAnimationObserver* animation_observer) {
   ui::LayerAnimator* root_animator = root_layer_->GetAnimator();
   ui::ScopedLayerAnimationSettings root_animation(root_animator);
   root_animation.SetPreemptionStrategy(preemption_strategy);
@@ -338,6 +373,10 @@
       ui::LayerAnimationElement::CreateOpacityElement(opacity, duration);
   ui::LayerAnimationSequence* root_sequence =
       new ui::LayerAnimationSequence(root_element);
+
+  if (animation_observer)
+    root_sequence->AddObserver(animation_observer);
+
   root_animator->StartAnimation(root_sequence);
 
   for (int i = 0; i < PAINTED_SHAPE_COUNT; ++i) {
@@ -349,15 +388,20 @@
                                                           duration);
     ui::LayerAnimationSequence* sequence =
         new ui::LayerAnimationSequence(element);
+
+    if (animation_observer)
+      sequence->AddObserver(animation_observer);
+
     animator->StartAnimation(sequence);
   }
 }
 
-void InkDropAnimation::ResetTransformsToMinSize() {
+void InkDropAnimation::SetStateToHidden() {
   InkDropTransforms transforms;
   // Using a size of 0x0 creates visual anomalies.
   CalculateCircleTransforms(gfx::Size(1, 1), &transforms);
   SetTransforms(transforms);
+  SetOpacity(kHiddenOpacity);
 }
 
 void InkDropAnimation::SetTransforms(const InkDropTransforms transforms) {
@@ -436,12 +480,6 @@
     (*transforms_out)[i] = painted_layers_[i]->GetTargetTransform();
 }
 
-void InkDropAnimation::SetCenterPoint(const gfx::Point& center_point) {
-  gfx::Transform transform;
-  transform.Translate(center_point.x(), center_point.y());
-  root_layer_->SetTransform(transform);
-}
-
 void InkDropAnimation::AddPaintLayer(PaintedShape painted_shape) {
   ui::LayerDelegate* delegate = nullptr;
   switch (painted_shape) {
@@ -473,4 +511,29 @@
   painted_layers_[painted_shape].reset(layer);
 }
 
+void InkDropAnimation::AbortAllAnimations() {
+  root_layer_->GetAnimator()->AbortAllAnimations();
+  for (int i = 0; i < PAINTED_SHAPE_COUNT; ++i)
+    painted_layers_[i]->GetAnimator()->AbortAllAnimations();
+}
+
+void InkDropAnimation::AnimationStartedCallback(
+    InkDropState ink_drop_state,
+    const ui::CallbackLayerAnimationObserver& observer) {
+  FOR_EACH_OBSERVER(InkDropAnimationObserver, observers_,
+                    InkDropAnimationStarted(ink_drop_state));
+}
+
+bool InkDropAnimation::AnimationEndedCallback(
+    InkDropState ink_drop_state,
+    const ui::CallbackLayerAnimationObserver& observer) {
+  FOR_EACH_OBSERVER(
+      InkDropAnimationObserver, observers_,
+      InkDropAnimationEnded(ink_drop_state,
+                            observer.aborted_count()
+                                ? InkDropAnimationObserver::PRE_EMPTED
+                                : InkDropAnimationObserver::SUCCESS));
+  return true;
+}
+
 }  // namespace views
diff --git a/ui/views/animation/ink_drop_animation.h b/ui/views/animation/ink_drop_animation.h
index dd63bb36..f9e36fd9 100644
--- a/ui/views/animation/ink_drop_animation.h
+++ b/ui/views/animation/ink_drop_animation.h
@@ -7,6 +7,7 @@
 
 #include "base/macros.h"
 #include "base/memory/scoped_ptr.h"
+#include "base/observer_list.h"
 #include "base/time/time.h"
 #include "ui/compositor/layer_animator.h"
 #include "ui/gfx/geometry/size.h"
@@ -16,12 +17,15 @@
 #include "ui/views/views_export.h"
 
 namespace ui {
+class CallbackLayerAnimationObserver;
 class Layer;
+class LayerAnimationObserver;
 class LayerDelegate;
 }  // namespace ui
 
 namespace views {
 class CircleLayerDelegate;
+class InkDropAnimationObserver;
 class RectangleLayerDelegate;
 
 namespace test {
@@ -48,6 +52,9 @@
 
   InkDropState ink_drop_state() const { return ink_drop_state_; }
 
+  void AddObserver(InkDropAnimationObserver* observer);
+  void RemoveObserver(InkDropAnimationObserver* observer);
+
   // Animates from the current |ink_drop_state_| to a new |ink_drop_state|. It
   // is possible to animate from any |ink_drop_state_| to any new
   // |ink_drop_state|. Note that some state transitions will also perform an
@@ -77,16 +84,24 @@
   // ink drop.
   typedef gfx::Transform InkDropTransforms[PAINTED_SHAPE_COUNT];
 
+  // Animates the ripple to |ink_drop_state| and attaches |observer| to all
+  // LayerAnimationSequence's used.
+  void AnimateToStateInternal(InkDropState ink_drop_state,
+                              ui::LayerAnimationObserver* observer);
+
   // Animates all of the painted shape layers to the specified |transforms| and
-  // |opacity|.
+  // |opacity|. The animation will use the given |duration| and
+  // |preemption_strategy|, and |observer| will be added to all
+  // LayerAnimationSequences.
   void AnimateToTransforms(
       const InkDropTransforms transforms,
       float opacity,
       base::TimeDelta duration,
-      ui::LayerAnimator::PreemptionStrategy preemption_strategy);
+      ui::LayerAnimator::PreemptionStrategy preemption_strategy,
+      ui::LayerAnimationObserver* observer);
 
-  // Resets the Transforms on all the owned Layers to a minimum size.
-  void ResetTransformsToMinSize();
+  // Updates the Transforms and opacity to the HIDDEN state.
+  void SetStateToHidden();
 
   // Sets the |transforms| on all of the shape layers. Note that this does not
   // perform any animation.
@@ -113,6 +128,22 @@
   // Adds and configures a new |painted_shape| layer to |painted_layers_|.
   void AddPaintLayer(PaintedShape painted_shape);
 
+  void AbortAllAnimations();
+
+  // The Callback invoked when all of the animation sequences for the specific
+  // |ink_drop_state| animation have started. |observer| is the
+  // ui::CallbackLayerAnimationObserver which is notifying the callback.
+  void AnimationStartedCallback(
+      InkDropState ink_drop_state,
+      const ui::CallbackLayerAnimationObserver& observer);
+
+  // The Callback invoked when all of the animation sequences for the specific
+  // |ink_drop_state| animation have finished. |observer| is the
+  // ui::CallbackLayerAnimationObserver which is notifying the callback.
+  bool AnimationEndedCallback(
+      InkDropState ink_drop_state,
+      const ui::CallbackLayerAnimationObserver& observer);
+
   // Maximum size that an ink drop will be drawn to for any InkDropState whose
   // final frame should be large.
   gfx::Size large_size_;
@@ -146,6 +177,9 @@
   // The current ink drop state.
   InkDropState ink_drop_state_;
 
+  // List of observers to notify when animations have finished.
+  base::ObserverList<InkDropAnimationObserver> observers_;
+
   DISALLOW_COPY_AND_ASSIGN(InkDropAnimation);
 };
 
diff --git a/ui/views/animation/ink_drop_animation_controller.h b/ui/views/animation/ink_drop_animation_controller.h
index 4e1cbd1..77aed3b2 100644
--- a/ui/views/animation/ink_drop_animation_controller.h
+++ b/ui/views/animation/ink_drop_animation_controller.h
@@ -29,8 +29,8 @@
   // Gets the current state of the ink drop.
   virtual InkDropState GetInkDropState() const = 0;
 
-  // Animates from the current InkDropState to |state|.
-  virtual void AnimateToState(InkDropState state) = 0;
+  // Animates from the current InkDropState to |ink_drop_state|.
+  virtual void AnimateToState(InkDropState ink_drop_state) = 0;
 
   virtual gfx::Size GetInkDropLargeSize() const = 0;
 
diff --git a/ui/views/animation/ink_drop_animation_controller_impl.cc b/ui/views/animation/ink_drop_animation_controller_impl.cc
index 0b014bd8b..74d681d8d6 100644
--- a/ui/views/animation/ink_drop_animation_controller_impl.cc
+++ b/ui/views/animation/ink_drop_animation_controller_impl.cc
@@ -14,11 +14,9 @@
     : ink_drop_host_(ink_drop_host) {}
 
 InkDropAnimationControllerImpl::~InkDropAnimationControllerImpl() {
-  if (ink_drop_animation_) {
-    // TODO(bruthig): Change this to be called when the ink drop becomes hidden.
-    // See www.crbug.com/522175.
-    ink_drop_host_->RemoveInkDropLayer(ink_drop_animation_->root_layer());
-  }
+  // Explicitly destroy the InkDropAnimation so that this still exists if
+  // views::InkDropAnimationObserver methods are called on this.
+  DestroyInkDropAnimation();
 }
 
 InkDropState InkDropAnimationControllerImpl::GetInkDropState() const {
@@ -27,10 +25,11 @@
   return ink_drop_animation_->ink_drop_state();
 }
 
-void InkDropAnimationControllerImpl::AnimateToState(InkDropState state) {
+void InkDropAnimationControllerImpl::AnimateToState(
+    InkDropState ink_drop_state) {
   if (!ink_drop_animation_)
     CreateInkDropAnimation();
-  ink_drop_animation_->AnimateToState(state);
+  ink_drop_animation_->AnimateToState(ink_drop_state);
 }
 
 gfx::Size InkDropAnimationControllerImpl::GetInkDropLargeSize() const {
@@ -61,19 +60,48 @@
 }
 
 void InkDropAnimationControllerImpl::CreateInkDropAnimation() {
-  if (ink_drop_animation_)
-    ink_drop_host_->RemoveInkDropLayer(ink_drop_animation_->root_layer());
+  DestroyInkDropAnimation();
 
-  // TODO(bruthig): It will be expensive to maintain InkDropAnimation instances
-  // when they are not actually being used. Consider creating InkDropAnimations
-  // on an as-needed basis and if construction is also expensive then consider
-  // creating an InkDropAnimationPool. See www.crbug.com/522175.
   ink_drop_animation_.reset(new InkDropAnimation(
       ink_drop_large_size_, ink_drop_large_corner_radius_, ink_drop_small_size_,
       ink_drop_small_corner_radius_));
 
+  ink_drop_animation_->AddObserver(this);
   ink_drop_animation_->SetCenterPoint(ink_drop_center_);
   ink_drop_host_->AddInkDropLayer(ink_drop_animation_->root_layer());
 }
 
+void InkDropAnimationControllerImpl::DestroyInkDropAnimation() {
+  if (!ink_drop_animation_)
+    return;
+  ink_drop_host_->RemoveInkDropLayer(ink_drop_animation_->root_layer());
+  ink_drop_animation_->RemoveObserver(this);
+  ink_drop_animation_.reset();
+}
+
+void InkDropAnimationControllerImpl::InkDropAnimationStarted(
+    InkDropState ink_drop_state) {}
+
+void InkDropAnimationControllerImpl::InkDropAnimationEnded(
+    InkDropState ink_drop_state,
+    InkDropAnimationEndedReason reason) {
+  if (reason != SUCCESS)
+    return;
+  switch (ink_drop_state) {
+    case views::InkDropState::QUICK_ACTION:
+    case views::InkDropState::SLOW_ACTION:
+    case views::InkDropState::DEACTIVATED:
+      ink_drop_animation_->AnimateToState(views::InkDropState::HIDDEN);
+      break;
+    case views::InkDropState::HIDDEN:
+      // TODO(bruthig): Investigate whether creating and destroying
+      // InkDropAnimations is expensive and consider creating an
+      // InkDropAnimationPool. See www.crbug.com/522175.
+      DestroyInkDropAnimation();
+      break;
+    default:
+      break;
+  }
+}
+
 }  // namespace views
diff --git a/ui/views/animation/ink_drop_animation_controller_impl.h b/ui/views/animation/ink_drop_animation_controller_impl.h
index 4aede40c..5ca25633 100644
--- a/ui/views/animation/ink_drop_animation_controller_impl.h
+++ b/ui/views/animation/ink_drop_animation_controller_impl.h
@@ -9,6 +9,7 @@
 #include "ui/gfx/geometry/rect.h"
 #include "ui/gfx/geometry/size.h"
 #include "ui/views/animation/ink_drop_animation_controller.h"
+#include "ui/views/animation/ink_drop_animation_observer.h"
 #include "ui/views/views_export.h"
 
 namespace views {
@@ -17,7 +18,8 @@
 
 // A functional implementation of an InkDropAnimationController.
 class VIEWS_EXPORT InkDropAnimationControllerImpl
-    : public InkDropAnimationController {
+    : public InkDropAnimationController,
+      public InkDropAnimationObserver {
  public:
   // Constructs an ink drop controller that will attach the ink drop to the
   // given |ink_drop_host|.
@@ -26,7 +28,7 @@
 
   // InkDropAnimationController:
   InkDropState GetInkDropState() const override;
-  void AnimateToState(InkDropState state) override;
+  void AnimateToState(InkDropState ink_drop_state) override;
   gfx::Size GetInkDropLargeSize() const override;
   void SetInkDropSize(const gfx::Size& large_size,
                       int large_corner_radius,
@@ -36,10 +38,18 @@
 
  private:
   // Creates a new InkDropAnimation and sets it to |ink_drop_animation_|. If
-  // |ink_drop_animation_| wasn't null then it will be removed from the
-  // |ink_drop_host_|.
+  // |ink_drop_animation_| wasn't null then it will be destroyed using
+  // DestroyInkDropAnimation().
   void CreateInkDropAnimation();
 
+  // Destroys the current |ink_drop_animation_|.
+  void DestroyInkDropAnimation();
+
+  // views::InkDropAnimationObserver:
+  void InkDropAnimationStarted(InkDropState ink_drop_state) override;
+  void InkDropAnimationEnded(InkDropState ink_drop_state,
+                             InkDropAnimationEndedReason reason) override;
+
   // The host of the ink drop.
   InkDropHost* ink_drop_host_;
 
diff --git a/ui/views/animation/ink_drop_animation_observer.cc b/ui/views/animation/ink_drop_animation_observer.cc
new file mode 100644
index 0000000..4fac604d
--- /dev/null
+++ b/ui/views/animation/ink_drop_animation_observer.cc
@@ -0,0 +1,27 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "ui/views/animation/ink_drop_animation_observer.h"
+
+#include <iostream>
+#include <string>
+
+#include "base/logging.h"
+
+namespace views {
+
+std::string ToString(
+    InkDropAnimationObserver::InkDropAnimationEndedReason reason) {
+  switch (reason) {
+    case InkDropAnimationObserver::SUCCESS:
+      return std::string("SUCCESS");
+    case InkDropAnimationObserver::PRE_EMPTED:
+      return std::string("PRE_EMPTED");
+  }
+  NOTREACHED()
+      << "Should never be reached but is necessary for some compilers.";
+  return std::string();
+}
+
+}  // namespace views
diff --git a/ui/views/animation/ink_drop_animation_observer.h b/ui/views/animation/ink_drop_animation_observer.h
new file mode 100644
index 0000000..08090f3
--- /dev/null
+++ b/ui/views/animation/ink_drop_animation_observer.h
@@ -0,0 +1,57 @@
+// 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 UI_VIEWS_ANIMATION_INK_DROP_ANIMATION_OBSERVER_H_
+#define UI_VIEWS_ANIMATION_INK_DROP_ANIMATION_OBSERVER_H_
+
+#include <iosfwd>
+#include <string>
+
+#include "base/macros.h"
+#include "ui/views/animation/ink_drop_state.h"
+#include "ui/views/views_export.h"
+
+namespace views {
+
+// Pure-virtual base class of an observer that can be attached to
+// InkDropAnimations.
+class VIEWS_EXPORT InkDropAnimationObserver {
+ public:
+  // Enumeration of the different reasons why an InkDropAnimation has finished.
+  enum InkDropAnimationEndedReason {
+    // The animation was completed successfully.
+    SUCCESS,
+    // The animation was stopped prematurely before reaching its final state.
+    PRE_EMPTED
+  };
+
+  // Notifies the observer that an animation for |ink_drop_state| has started.
+  virtual void InkDropAnimationStarted(InkDropState ink_drop_state) = 0;
+
+  // Notifies the observer that an animation for |ink_drop_state| has finished
+  // and the reason for completion is given by |reason|. If |reason| is SUCCESS
+  // then the animation has progressed to its final frame however if |reason|
+  // is |PRE_EMPTED| then the animation was stopped before its final frame. In
+  // the event that an animation is in progress for ink drop state 's1' and an
+  // animation to a new state 's2' is triggered, then
+  // InkDropAnimationEnded(s1, PRE_EMPTED) will be called before
+  // InkDropAnimationStarted(s2).
+  virtual void InkDropAnimationEnded(InkDropState ink_drop_state,
+                                     InkDropAnimationEndedReason reason) = 0;
+
+ protected:
+  InkDropAnimationObserver() {}
+  virtual ~InkDropAnimationObserver() {}
+
+ private:
+  DISALLOW_COPY_AND_ASSIGN(InkDropAnimationObserver);
+};
+
+// Returns a human readable string for |reason|.  Useful for logging.
+std::string ToString(
+    InkDropAnimationObserver::InkDropAnimationEndedReason reason);
+
+}  // namespace views
+
+#endif  // UI_VIEWS_ANIMATION_INK_DROP_ANIMATION_OBSERVER_H_
diff --git a/ui/views/animation/ink_drop_animation_unittest.cc b/ui/views/animation/ink_drop_animation_unittest.cc
index 68617ce6..91f81434 100644
--- a/ui/views/animation/ink_drop_animation_unittest.cc
+++ b/ui/views/animation/ink_drop_animation_unittest.cc
@@ -63,7 +63,8 @@
 TEST_F(InkDropAnimationTest, AnimateToQuickAction) {
   scoped_ptr<InkDropAnimation> ink_drop_animation = CreateInkDropAnimation();
   ink_drop_animation->AnimateToState(views::InkDropState::QUICK_ACTION);
-  EXPECT_EQ(views::InkDropState::HIDDEN, ink_drop_animation->ink_drop_state());
+  EXPECT_EQ(views::InkDropState::QUICK_ACTION,
+            ink_drop_animation->ink_drop_state());
 }
 
 TEST_F(InkDropAnimationTest, AnimateToSlowActionPending) {
@@ -76,7 +77,8 @@
 TEST_F(InkDropAnimationTest, AnimateToSlowAction) {
   scoped_ptr<InkDropAnimation> ink_drop_animation = CreateInkDropAnimation();
   ink_drop_animation->AnimateToState(views::InkDropState::SLOW_ACTION);
-  EXPECT_EQ(views::InkDropState::HIDDEN, ink_drop_animation->ink_drop_state());
+  EXPECT_EQ(views::InkDropState::SLOW_ACTION,
+            ink_drop_animation->ink_drop_state());
 }
 
 TEST_F(InkDropAnimationTest, AnimateToActivated) {
@@ -89,7 +91,8 @@
 TEST_F(InkDropAnimationTest, AnimateToDeactivated) {
   scoped_ptr<InkDropAnimation> ink_drop_animation = CreateInkDropAnimation();
   ink_drop_animation->AnimateToState(views::InkDropState::DEACTIVATED);
-  EXPECT_EQ(views::InkDropState::HIDDEN, ink_drop_animation->ink_drop_state());
+  EXPECT_EQ(views::InkDropState::DEACTIVATED,
+            ink_drop_animation->ink_drop_state());
 }
 
 TEST_F(InkDropAnimationTest,
diff --git a/ui/views/animation/ink_drop_state.cc b/ui/views/animation/ink_drop_state.cc
new file mode 100644
index 0000000..04b0435
--- /dev/null
+++ b/ui/views/animation/ink_drop_state.cc
@@ -0,0 +1,36 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "ui/views/animation/ink_drop_state.h"
+
+#include <iostream>
+#include <string>
+
+#include "base/logging.h"
+
+namespace views {
+
+std::string ToString(InkDropState state) {
+  switch (state) {
+    case InkDropState::HIDDEN:
+      return std::string("HIDDEN");
+    case InkDropState::ACTION_PENDING:
+      return std::string("ACTION_PENDING");
+    case InkDropState::QUICK_ACTION:
+      return std::string("QUICK_ACTION");
+    case InkDropState::SLOW_ACTION_PENDING:
+      return std::string("SLOW_ACTION_PENDING");
+    case InkDropState::SLOW_ACTION:
+      return std::string("SLOW_ACTION");
+    case InkDropState::ACTIVATED:
+      return std::string("ACTIVATED");
+    case InkDropState::DEACTIVATED:
+      return std::string("DEACTIVATED");
+  }
+  NOTREACHED()
+      << "Should never be reached but is necessary for some compilers.";
+  return std::string("UNKNOWN");
+}
+
+}  // namespace views
diff --git a/ui/views/animation/ink_drop_state.h b/ui/views/animation/ink_drop_state.h
index 2e8cd86..7af5229 100644
--- a/ui/views/animation/ink_drop_state.h
+++ b/ui/views/animation/ink_drop_state.h
@@ -5,6 +5,11 @@
 #ifndef UI_VIEWS_ANIMATION_INK_DROP_STATE_H_
 #define UI_VIEWS_ANIMATION_INK_DROP_STATE_H_
 
+#include <iosfwd>
+#include <string>
+
+#include "ui/views/views_export.h"
+
 namespace views {
 
 // The different states that the ink drop animation can be animated to.
@@ -14,23 +19,26 @@
   // The view is being interacted with but the action to be triggered has not
   // yet been determined.
   ACTION_PENDING,
-  // The quick action for the view has been triggered. e.g. A tap gesture to
+  // The quick action for the view has been triggered. e.g. a tap gesture to
   // click a button.
   QUICK_ACTION,
   // A view is being interacted with and the pending action will be a 'slow'
-  // action. e.g. A long press that is still active before releasing.
+  // action. e.g. a long press that is still active before releasing.
   SLOW_ACTION_PENDING,
-  // The slow action for the view has been triggered. e.g. A long press release
+  // The slow action for the view has been triggered. e.g. a long press release
   // to bring up a menu.
   SLOW_ACTION,
   // An active state for a view that is not currently being interacted with.
-  // e.g. A pressed button that is showing a menu.
+  // e.g. a pressed button that is showing a menu.
   ACTIVATED,
-  // A previously active state has been toggled to inactive. e.g. A drop down
+  // A previously active state has been toggled to inactive. e.g. a drop down
   // menu is closed.
   DEACTIVATED,
 };
 
+// Returns a human readable string for |state|.  Useful for logging.
+std::string ToString(InkDropState state);
+
 }  // namespace views
 
 #endif  // UI_VIEWS_ANIMATION_INK_DROP_STATE_H_
diff --git a/ui/views/border.cc b/ui/views/border.cc
index ed02476..95628735 100644
--- a/ui/views/border.cc
+++ b/ui/views/border.cc
@@ -15,9 +15,9 @@
 namespace {
 
 // A simple border with different thicknesses on each side and single color.
-class SidedSolidBorder : public Border {
+class SolidSidedBorder : public Border {
  public:
-  SidedSolidBorder(int top, int left, int bottom, int right, SkColor color);
+  SolidSidedBorder(const gfx::Insets& insets, SkColor color);
 
   // Overridden from Border:
   void Paint(const View& view, gfx::Canvas* canvas) override;
@@ -25,22 +25,18 @@
   gfx::Size GetMinimumSize() const override;
 
  private:
-  const SkColor color_;
   const gfx::Insets insets_;
+  const SkColor color_;
 
-  DISALLOW_COPY_AND_ASSIGN(SidedSolidBorder);
+  DISALLOW_COPY_AND_ASSIGN(SolidSidedBorder);
 };
 
-SidedSolidBorder::SidedSolidBorder(int top,
-                                   int left,
-                                   int bottom,
-                                   int right,
-                                   SkColor color)
-    : color_(color),
-      insets_(top, left, bottom, right) {
+SolidSidedBorder::SolidSidedBorder(const gfx::Insets& insets, SkColor color)
+    : insets_(insets),
+      color_(color) {
 }
 
-void SidedSolidBorder::Paint(const View& view, gfx::Canvas* canvas) {
+void SolidSidedBorder::Paint(const View& view, gfx::Canvas* canvas) {
   // Top border.
   canvas->FillRect(gfx::Rect(0, 0, view.width(), insets_.top()), color_);
   // Left border.
@@ -55,36 +51,22 @@
                    color_);
 }
 
-gfx::Insets SidedSolidBorder::GetInsets() const {
+gfx::Insets SolidSidedBorder::GetInsets() const {
   return insets_;
 }
 
-gfx::Size SidedSolidBorder::GetMinimumSize() const {
+gfx::Size SolidSidedBorder::GetMinimumSize() const {
   return gfx::Size(insets_.width(), insets_.height());
 }
 
-// A variation of SidedSolidBorder, where each side has the same thickness.
-class SolidBorder : public SidedSolidBorder {
- public:
-  SolidBorder(int thickness, SkColor color)
-      : SidedSolidBorder(thickness, thickness, thickness, thickness, color) {
-  }
-
- private:
-  DISALLOW_COPY_AND_ASSIGN(SolidBorder);
-};
-
 class EmptyBorder : public Border {
  public:
-  EmptyBorder(int top, int left, int bottom, int right)
-      : insets_(top, left, bottom, right) {}
+  explicit EmptyBorder(const gfx::Insets& insets);
 
   // Overridden from Border:
-  void Paint(const View& view, gfx::Canvas* canvas) override {}
-
-  gfx::Insets GetInsets() const override { return insets_; }
-
-  gfx::Size GetMinimumSize() const override { return gfx::Size(); }
+  void Paint(const View& view, gfx::Canvas* canvas) override;
+  gfx::Insets GetInsets() const override ;
+  gfx::Size GetMinimumSize() const override;
 
  private:
   const gfx::Insets insets_;
@@ -92,26 +74,28 @@
   DISALLOW_COPY_AND_ASSIGN(EmptyBorder);
 };
 
+EmptyBorder::EmptyBorder(const gfx::Insets& insets) : insets_(insets) {
+}
+
+void EmptyBorder::Paint(const View& view, gfx::Canvas* canvas) {
+}
+
+gfx::Insets EmptyBorder::GetInsets() const {
+  return insets_;
+}
+
+gfx::Size EmptyBorder::GetMinimumSize() const {
+  return gfx::Size();
+}
+
 class BorderPainter : public Border {
  public:
-  explicit BorderPainter(Painter* painter, const gfx::Insets& insets)
-      : painter_(painter),
-        insets_(insets) {
-    DCHECK(painter);
-  }
-
-  ~BorderPainter() override {}
+  BorderPainter(Painter* painter, const gfx::Insets& insets);
 
   // Overridden from Border:
-  void Paint(const View& view, gfx::Canvas* canvas) override {
-    Painter::PaintPainterAt(canvas, painter_.get(), view.GetLocalBounds());
-  }
-
-  gfx::Insets GetInsets() const override { return insets_; }
-
-  gfx::Size GetMinimumSize() const override {
-    return painter_->GetMinimumSize();
-  }
+  void Paint(const View& view, gfx::Canvas* canvas) override;
+  gfx::Insets GetInsets() const override;
+  gfx::Size GetMinimumSize() const override;
 
  private:
   scoped_ptr<Painter> painter_;
@@ -120,6 +104,24 @@
   DISALLOW_COPY_AND_ASSIGN(BorderPainter);
 };
 
+BorderPainter::BorderPainter(Painter* painter, const gfx::Insets& insets)
+    : painter_(painter),
+      insets_(insets) {
+  DCHECK(painter);
+}
+
+void BorderPainter::Paint(const View& view, gfx::Canvas* canvas) {
+  Painter::PaintPainterAt(canvas, painter_.get(), view.GetLocalBounds());
+}
+
+gfx::Insets BorderPainter::GetInsets() const {
+  return insets_;
+}
+
+gfx::Size BorderPainter::GetMinimumSize() const {
+  return painter_->GetMinimumSize();
+}
+
 }  // namespace
 
 Border::Border() {
@@ -135,7 +137,13 @@
 
 // static
 scoped_ptr<Border> Border::CreateSolidBorder(int thickness, SkColor color) {
-  return make_scoped_ptr(new SolidBorder(thickness, color));
+  return make_scoped_ptr(new SolidSidedBorder(
+      gfx::Insets(thickness, thickness, thickness, thickness), color));
+}
+
+// static
+scoped_ptr<Border> Border::CreateEmptyBorder(const gfx::Insets& insets) {
+  return make_scoped_ptr(new EmptyBorder(insets));
 }
 
 // static
@@ -143,7 +151,7 @@
                                              int left,
                                              int bottom,
                                              int right) {
-  return make_scoped_ptr(new EmptyBorder(top, left, bottom, right));
+  return CreateEmptyBorder(gfx::Insets(top, left, bottom, right));
 }
 
 // static
@@ -152,7 +160,8 @@
                                                   int bottom,
                                                   int right,
                                                   SkColor color) {
-  return make_scoped_ptr(new SidedSolidBorder(top, left, bottom, right, color));
+  return make_scoped_ptr(new SolidSidedBorder(
+      gfx::Insets(top, left, bottom, right), color));
 }
 
 // static
diff --git a/ui/views/border.h b/ui/views/border.h
index ebd291c..e2f7be6 100644
--- a/ui/views/border.h
+++ b/ui/views/border.h
@@ -51,6 +51,7 @@
 
   // Creates a border for reserving space. The returned border does not
   // paint anything.
+  static scoped_ptr<Border> CreateEmptyBorder(const gfx::Insets& insets);
   static scoped_ptr<Border> CreateEmptyBorder(int top,
                                               int left,
                                               int bottom,
diff --git a/ui/views/controls/textfield/textfield.cc b/ui/views/controls/textfield/textfield.cc
index 56f77b4..e11410b 100644
--- a/ui/views/controls/textfield/textfield.cc
+++ b/ui/views/controls/textfield/textfield.cc
@@ -950,6 +950,8 @@
   state->name = accessible_name_;
   if (read_only())
     state->AddStateFlag(ui::AX_STATE_READ_ONLY);
+  else
+    state->AddStateFlag(ui::AX_STATE_EDITABLE);
   if (text_input_type_ == ui::TEXT_INPUT_TYPE_PASSWORD) {
     state->AddStateFlag(ui::AX_STATE_PROTECTED);
     state->value = base::string16(text().size(), '*');
diff --git a/ui/views/views.gyp b/ui/views/views.gyp
index f1d71a7..152488d 100644
--- a/ui/views/views.gyp
+++ b/ui/views/views.gyp
@@ -21,7 +21,10 @@
       'animation/ink_drop_animation_controller_factory.h',
       'animation/ink_drop_animation_controller_impl.cc',
       'animation/ink_drop_animation_controller_impl.h',
+      'animation/ink_drop_animation_observer.cc',
+      'animation/ink_drop_animation_observer.h',
       'animation/ink_drop_host.h',
+      'animation/ink_drop_state.cc',
       'animation/ink_drop_state.h',
       'animation/scroll_animator.cc',
       'animation/scroll_animator.h',
diff --git a/ui/webui/resources/js/webui_resource_test.js b/ui/webui/resources/js/webui_resource_test.js
index 5b2f3ebac..16d2298 100644
--- a/ui/webui/resources/js/webui_resource_test.js
+++ b/ui/webui/resources/js/webui_resource_test.js
@@ -143,17 +143,9 @@
    */
   function runTests() {
     for (var name in window) {
-      try {
-        if (typeof window[name] == 'function' && /^test/.test(name))
-          testCases.push(name);
-      } catch(e) {
-        if (location.protocol == 'data:' && e.name == 'SecurityError') {
-          // Sometimes this file gets loaded as a data: URI. That causes issues
-          // when it touches window.caches or window.cookie.
-        } else {
-          throw e;
-        }
-      }
+      // To avoid unnecessary getting properties, test name first.
+      if (/^test/.test(name) && typeof window[name] == 'function')
+        testCases.push(name);
     }
     if (!testCases.length) {
       console.error('Failed to find test cases.');