diff --git a/base/BUILD.gn b/base/BUILD.gn
index be5d5ef..833d611 100644
--- a/base/BUILD.gn
+++ b/base/BUILD.gn
@@ -38,9 +38,9 @@
   override_build_date = "N/A"
 
   # Turn on memory profiling in the task profiler when the heap shim is
-  # available, except for official builds for now.
-  enable_memory_task_profiler =
-      use_experimental_allocator_shim && (!is_official_build || is_syzyasan)
+  # available. Profiling can then be enabled at runtime by passing the command
+  # line flag --enable-heap-profiling=task-profiler.
+  enable_memory_task_profiler = use_experimental_allocator_shim
 
   # Partition alloc is included by default except iOS.
   use_partition_alloc = !is_ios
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/webapps/FullScreenActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/webapps/FullScreenActivity.java
index fc86d8d..f020212 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/webapps/FullScreenActivity.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/webapps/FullScreenActivity.java
@@ -200,6 +200,9 @@
     @Override
     protected boolean handleBackPressed() {
         if (mTab == null) return false;
+
+        if (exitFullscreenIfShowing()) return true;
+
         if (mTab.canGoBack()) {
             mTab.goBack();
             return true;
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 4a36b3d..2bdb9a1 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
@@ -9,12 +9,14 @@
 import android.graphics.Color;
 import android.graphics.drawable.Drawable;
 import android.net.Uri;
+import android.os.Build;
 import android.os.Bundle;
 import android.os.StrictMode;
 import android.os.SystemClock;
 import android.text.TextUtils;
 import android.view.LayoutInflater;
 import android.view.View;
+import android.view.View.OnSystemUiVisibilityChangeListener;
 import android.view.ViewGroup;
 import android.widget.FrameLayout;
 import android.widget.ImageView;
@@ -30,6 +32,7 @@
 import org.chromium.chrome.R;
 import org.chromium.chrome.browser.TabState;
 import org.chromium.chrome.browser.document.DocumentUtils;
+import org.chromium.chrome.browser.fullscreen.ChromeFullscreenManager;
 import org.chromium.chrome.browser.metrics.WebappUma;
 import org.chromium.chrome.browser.tab.EmptyTabObserver;
 import org.chromium.chrome.browser.tab.Tab;
@@ -54,6 +57,16 @@
     private static final String TAG = "WebappActivity";
     private static final long MS_BEFORE_NAVIGATING_BACK_FROM_INTERSTITIAL = 1000;
 
+    private static final int ENTER_IMMERSIVE_MODE_DELAY_MILLIS = 300;
+    private static final int RESTORE_IMMERSIVE_MODE_DELAY_MILLIS = 3000;
+    private static final int IMMERSIVE_MODE_UI_FLAGS = View.SYSTEM_UI_FLAG_LAYOUT_STABLE
+            | View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
+            | View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
+            | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION // hide nav bar
+            | View.SYSTEM_UI_FLAG_FULLSCREEN // hide status bar
+            | View.SYSTEM_UI_FLAG_LOW_PROFILE
+            | View.SYSTEM_UI_FLAG_IMMERSIVE;
+
     private final WebappDirectoryManager mDirectoryManager;
 
     protected WebappInfo mWebappInfo;
@@ -68,6 +81,8 @@
 
     private Bitmap mLargestFavicon;
 
+    private Runnable mSetImmersiveRunnable;
+
     /**
      * Construct all the variables that shouldn't change.  We do it here both to clarify when the
      * objects are created and to ensure that they exist throughout the parallelized initialization
@@ -92,8 +107,6 @@
             mWebappInfo = newWebappInfo;
             resetSavedInstanceState();
             if (mIsInitialized) initializeUI(null);
-            // TODO(dominickn): send the web app into fullscreen if mDisplayMode is
-            // WebDisplayMode.Fullscreen. See crbug.com/581522
         }
     }
 
@@ -118,9 +131,10 @@
 
         getActivityTab().addObserver(createTabObserver());
         getActivityTab().getTabWebContentsDelegateAndroid().setDisplayMode(
-                WebDisplayMode.Standalone);
-        // TODO(dominickn): send the web app into fullscreen if mDisplayMode is
-        // WebDisplayMode.Fullscreen. See crbug.com/581522
+                mWebappInfo.displayMode());
+        if (mWebappInfo.displayMode() == WebDisplayMode.Fullscreen) {
+            enterImmersiveMode();
+        }
     }
 
     @Override
@@ -203,6 +217,65 @@
     }
 
     @Override
+    public void onWindowFocusChanged(boolean hasFocus) {
+        super.onWindowFocusChanged(hasFocus);
+
+        // Re-enter immersive mode after users switch back to this Activity.
+        if (hasFocus) {
+            asyncSetImmersive(ENTER_IMMERSIVE_MODE_DELAY_MILLIS);
+        }
+    }
+
+    /**
+     * Sets activity's decor view into an immersive mode.
+     * If immersive mode is not supported, this method no-ops.
+     */
+    private void enterImmersiveMode() {
+        // Immersive mode is only supported in API 19+.
+        if (Build.VERSION.SDK_INT < Build.VERSION_CODES.KITKAT) return;
+
+        if (mSetImmersiveRunnable == null) {
+
+            final View decor = getWindow().getDecorView();
+
+            mSetImmersiveRunnable = new Runnable() {
+                @Override
+                public void run() {
+                    int currentFlags = decor.getSystemUiVisibility();
+                    int desiredFlags = currentFlags | IMMERSIVE_MODE_UI_FLAGS;
+                    if (currentFlags != desiredFlags) {
+                        decor.setSystemUiVisibility(desiredFlags);
+                    }
+                }
+            };
+
+            // When we enter immersive mode for the first time, register a
+            // SystemUiVisibilityChangeListener that restores immersive mode. This is necessary
+            // because user actions like focusing a keyboard will break out of immersive mode.
+            decor.setOnSystemUiVisibilityChangeListener(new OnSystemUiVisibilityChangeListener() {
+                @Override
+                public void onSystemUiVisibilityChange(int newFlags) {
+                    if ((newFlags & View.SYSTEM_UI_FLAG_FULLSCREEN) == 0) {
+                        asyncSetImmersive(RESTORE_IMMERSIVE_MODE_DELAY_MILLIS);
+                    }
+                }
+            });
+        }
+
+        asyncSetImmersive(ENTER_IMMERSIVE_MODE_DELAY_MILLIS);
+    }
+
+    /**
+     * This method no-ops before {@link enterImmersiveMode()) is called explicitly.
+     */
+    private void asyncSetImmersive(int delayInMills) {
+        if (mSetImmersiveRunnable == null) return;
+
+        mHandler.removeCallbacks(mSetImmersiveRunnable);
+        mHandler.postDelayed(mSetImmersiveRunnable, delayInMills);
+    }
+
+    @Override
     public void onResume() {
         if (!isFinishing()) {
             if (getIntent() != null) {
@@ -372,6 +445,24 @@
                 getActivityTab().getUrl(), getWebappInfo().uri().toString(), true);
     }
 
+    @Override
+    protected ChromeFullscreenManager createFullscreenManager() {
+        // Disable HTML5 fullscreen in PWA fullscreen mode.
+        return new ChromeFullscreenManager(this, false) {
+            @Override
+            public void setPersistentFullscreenMode(boolean enabled) {
+                if (mWebappInfo.displayMode() == WebDisplayMode.Fullscreen) return;
+                super.setPersistentFullscreenMode(enabled);
+            }
+
+            @Override
+            public boolean getPersistentFullscreenMode() {
+                if (mWebappInfo.displayMode() == WebDisplayMode.Fullscreen) return false;
+                return super.getPersistentFullscreenMode();
+            }
+        };
+    }
+
     protected TabObserver createTabObserver() {
         return new EmptyTabObserver() {
 
diff --git a/net/nqe/network_quality_estimator.cc b/net/nqe/network_quality_estimator.cc
index 7adb2ac2..aacd7e9 100644
--- a/net/nqe/network_quality_estimator.cc
+++ b/net/nqe/network_quality_estimator.cc
@@ -411,7 +411,7 @@
     base::TimeTicks now = tick_clock_->NowTicks();
     last_main_frame_request_ = now;
 
-    ComputeEffectiveConnectionType();
+    MaybeComputeEffectiveConnectionType();
     effective_connection_type_at_last_main_frame_ = effective_connection_type_;
     estimated_quality_at_last_main_frame_ = network_quality_;
 
@@ -443,6 +443,7 @@
   }
 
   if (request.load_flags() & LOAD_MAIN_FRAME_DEPRECATED) {
+    ComputeEffectiveConnectionType();
     RecordMetricsOnMainFrameRequest();
     MaybeQueryExternalEstimateProvider();
   }
diff --git a/third_party/WebKit/LayoutTests/TestExpectations b/third_party/WebKit/LayoutTests/TestExpectations
index 29fb06f..0b8ce17 100644
--- a/third_party/WebKit/LayoutTests/TestExpectations
+++ b/third_party/WebKit/LayoutTests/TestExpectations
@@ -118,17 +118,6 @@
 crbug.com/683339 paint/invalidation/paged-with-overflowing-block-rl.html [ Failure ]
 crbug.com/683339 virtual/disable-spinvalidation/paint/invalidation/paged-with-overflowing-block-rl.html [ Failure ]
 
-
-crbug.com/693510 compositing/overlap-blending/reflection-opacity-huge.html [ NeedsManualRebaseline ]
-crbug.com/693510 compositing/reflections/animation-inside-reflection.html [ NeedsManualRebaseline ]
-crbug.com/693510 compositing/reflections/deeply-nested-reflections.html [ NeedsManualRebaseline ]
-crbug.com/693510 compositing/reflections/load-video-in-reflection.html [ NeedsManualRebaseline ]
-crbug.com/693510 compositing/reflections/nested-reflection-anchor-point.html [ NeedsManualRebaseline ]
-crbug.com/693510 compositing/reflections/nested-reflection-animated.html [ NeedsManualRebaseline ]
-crbug.com/693510 compositing/reflections/nested-reflection-mask-change.html [ NeedsManualRebaseline ]
-crbug.com/693510 compositing/reflections/nested-reflection-opacity.html [ NeedsManualRebaseline ]
-crbug.com/693510 media/video-layer-crash.html [ NeedsManualRebaseline ]
-
 crbug.com/646010 paint/selection/text-selection-newline-rtl-double-linebreak.html [ Failure ]
 crbug.com/646015 paint/invalidation/hover-invalidation-table.html [ Failure ]
 crbug.com/646015 virtual/disable-spinvalidation/paint/invalidation/hover-invalidation-table.html [ Failure ]
diff --git a/third_party/WebKit/LayoutTests/external/csswg-test/css-writing-modes-3/float-lft-orthog-htb-in-vlr-002-expected.xht b/third_party/WebKit/LayoutTests/external/csswg-test/css-writing-modes-3/float-lft-orthog-htb-in-vlr-002-expected.xht
new file mode 100644
index 0000000..5735d65
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/external/csswg-test/css-writing-modes-3/float-lft-orthog-htb-in-vlr-002-expected.xht
@@ -0,0 +1,55 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+
+ <head>
+
+  <title>CSS Reftest Reference</title>
+
+  <meta name="DC.date.created" content="2017-02-17T09:54:03+11:00" scheme="W3CDTF" />
+  <meta name="DC.date.modified" content="2017-02-17T09:54:03+11:00" scheme="W3CDTF" />
+
+  <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
+
+  <meta content="" name="flags" />
+
+  <style type="text/css"><![CDATA[
+  html
+    {
+      writing-mode: vertical-lr;
+    }
+
+  div#vertical-parent
+    {
+      border: orange solid 8px;
+      font-size: 32px;
+      line-height: 1.25; /* computes to 40px */
+    }
+
+  div#orthog-horiz
+    {
+      background-color: blue;
+      color: white;
+      left: 16px;
+      position: absolute;
+      writing-mode: horizontal-tb;
+    }
+
+  span
+    {
+      position: relative;
+      top: 40px;
+    }
+  ]]></style>
+
+ </head>
+
+ <body>
+
+  <div id="vertical-parent">
+    <div id="orthog-horiz">HTB floated left</div>
+    <span>VLR parent</span>
+  </div>
+
+ </body>
+</html>
diff --git a/third_party/WebKit/LayoutTests/external/csswg-test/css-writing-modes-3/float-lft-orthog-htb-in-vlr-002.xht b/third_party/WebKit/LayoutTests/external/csswg-test/css-writing-modes-3/float-lft-orthog-htb-in-vlr-002.xht
new file mode 100644
index 0000000..690dc78
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/external/csswg-test/css-writing-modes-3/float-lft-orthog-htb-in-vlr-002.xht
@@ -0,0 +1,55 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+
+ <head>
+
+  <title>CSS Writing Modes Test: orthogonal floated left in vertical-lr context</title>
+
+  <meta name="DC.date.created" content="2017-02-17T09:54:03+11:00" scheme="W3CDTF" />
+  <meta name="DC.date.modified" content="2017-02-17T09:54:03+11:00" scheme="W3CDTF" />
+
+  <!--
+  Inspired by the test in
+  http://lists.w3.org/Archives/Public/www-style/2016Nov/0044.html
+  -->
+
+  <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
+  <link rel="help" href="https://drafts.csswg.org/css-writing-modes-3/#auto-multicol" title="7.3.2 Auto-sizing Block Containers in Orthogonal Flows" />
+  <link rel="match" href="float-lft-orthog-htb-in-vlr-002-ref.xht" />
+
+  <meta content="" name="flags" />
+  <meta content="This test checks the horizontal position of an orthogonal floated left block box inside a vertical-lr parent. The orthogonal floated left block box must be put as far to the left as possible inside the vertical-lr line box." name="assert" />
+
+  <style type="text/css"><![CDATA[
+  html
+    {
+      writing-mode: vertical-lr;
+    }
+
+  div#vertical-parent
+    {
+      border: orange solid 8px;
+      font-size: 32px;
+      line-height: 1.25; /* computes to 40px */
+    }
+
+  div#orthog-htb-float-left
+    {
+      background-color: blue;
+      color: white;
+      float: left;
+      writing-mode: horizontal-tb;
+    }
+  ]]></style>
+
+ </head>
+
+ <body>
+
+  <div id="vertical-parent">VLR parent
+    <div id="orthog-htb-float-left">HTB floated left</div>
+  </div>
+
+ </body>
+</html>
diff --git a/third_party/WebKit/LayoutTests/external/csswg-test/css-writing-modes-3/float-lft-orthog-htb-in-vrl-002-expected.xht b/third_party/WebKit/LayoutTests/external/csswg-test/css-writing-modes-3/float-lft-orthog-htb-in-vrl-002-expected.xht
new file mode 100644
index 0000000..7147ad1
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/external/csswg-test/css-writing-modes-3/float-lft-orthog-htb-in-vrl-002-expected.xht
@@ -0,0 +1,55 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+
+ <head>
+
+  <title>CSS Reftest Reference</title>
+
+  <meta name="DC.date.created" content="2017-02-17T09:54:03+11:00" scheme="W3CDTF" />
+  <meta name="DC.date.modified" content="2017-02-17T09:54:03+11:00" scheme="W3CDTF" />
+
+  <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
+
+  <meta content="" name="flags" />
+
+  <style type="text/css"><![CDATA[
+  html
+    {
+      writing-mode: vertical-rl;
+    }
+
+  div#vertical-parent
+    {
+      border: orange solid 8px;
+      font-size: 32px;
+      line-height: 1.25; /* computes to 40px */
+    }
+
+  div#orthog-horiz
+    {
+      background-color: blue;
+      color: white;
+      right: 16px;
+      position: absolute;
+      writing-mode: horizontal-tb;
+    }
+
+  span
+    {
+      position: relative;
+      top: 40px;
+    }
+  ]]></style>
+
+ </head>
+
+ <body>
+
+  <div id="vertical-parent">
+    <div id="orthog-horiz">HTB floated left</div>
+    <span>VRL parent</span>
+  </div>
+
+ </body>
+</html>
diff --git a/third_party/WebKit/LayoutTests/external/csswg-test/css-writing-modes-3/float-lft-orthog-htb-in-vrl-002.xht b/third_party/WebKit/LayoutTests/external/csswg-test/css-writing-modes-3/float-lft-orthog-htb-in-vrl-002.xht
new file mode 100644
index 0000000..d11a2f9
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/external/csswg-test/css-writing-modes-3/float-lft-orthog-htb-in-vrl-002.xht
@@ -0,0 +1,55 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+
+ <head>
+
+  <title>CSS Writing Modes Test: orthogonal floated left in vertical-rl context</title>
+
+  <meta name="DC.date.created" content="2017-02-17T09:54:03+11:00" scheme="W3CDTF" />
+  <meta name="DC.date.modified" content="2017-02-17T09:54:03+11:00" scheme="W3CDTF" />
+
+  <!--
+  Inspired by the test in
+  http://lists.w3.org/Archives/Public/www-style/2016Nov/0044.html
+  -->
+
+  <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
+  <link rel="help" href="https://drafts.csswg.org/css-writing-modes-3/#auto-multicol" title="7.3.2 Auto-sizing Block Containers in Orthogonal Flows" />
+  <link rel="match" href="float-lft-orthog-htb-in-vrl-002-ref.xht" />
+
+  <meta content="" name="flags" />
+  <meta content="This test checks the horizontal position of an orthogonal floated left block box inside an vertical-rl parent. The orthogonal floated left block box must be put as far to the right as possible inside the vertical-rl line box." name="assert" />
+
+  <style type="text/css"><![CDATA[
+  html
+    {
+      writing-mode: vertical-rl;
+    }
+
+  div#vertical-parent
+    {
+      border: orange solid 8px;
+      font-size: 32px;
+      line-height: 1.25; /* computes to 40px */
+    }
+
+  div#orthog-htb-float-left
+    {
+      background-color: blue;
+      color: white;
+      float: left;
+      writing-mode: horizontal-tb;
+    }
+  ]]></style>
+
+ </head>
+
+ <body>
+
+  <div id="vertical-parent">VRL parent
+    <div id="orthog-htb-float-left">HTB floated left</div>
+  </div>
+
+ </body>
+</html>
diff --git a/third_party/WebKit/LayoutTests/external/csswg-test/css-writing-modes-3/float-lft-orthog-vrl-002-expected.xht b/third_party/WebKit/LayoutTests/external/csswg-test/css-writing-modes-3/float-lft-orthog-vlr-in-htb-002-expected.xht
similarity index 61%
copy from third_party/WebKit/LayoutTests/external/csswg-test/css-writing-modes-3/float-lft-orthog-vrl-002-expected.xht
copy to third_party/WebKit/LayoutTests/external/csswg-test/css-writing-modes-3/float-lft-orthog-vlr-in-htb-002-expected.xht
index 3fbf2e1..f6776a0 100644
--- a/third_party/WebKit/LayoutTests/external/csswg-test/css-writing-modes-3/float-lft-orthog-vrl-002-expected.xht
+++ b/third_party/WebKit/LayoutTests/external/csswg-test/css-writing-modes-3/float-lft-orthog-vlr-in-htb-002-expected.xht
@@ -6,10 +6,8 @@
 
   <title>CSS Reftest Reference</title>
 
-  <meta name="DC.date.created" content="2016-12-14T09:54:03+11:00" scheme=
-  "W3CDTF" />
-  <meta name="DC.date.modified" content="2017-02-04T09:54:03+11:00" scheme=
-  "W3CDTF" />
+  <meta name="DC.date.created" content="2017-02-17T09:54:03+11:00" scheme="W3CDTF" />
+  <meta name="DC.date.modified" content="2017-02-17T09:54:03+11:00" scheme="W3CDTF" />
 
   <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
 
@@ -18,23 +16,23 @@
   <style type="text/css"><![CDATA[
   div#horiz-parent
     {
-      border: orange solid 3px;
-      font-size: 16px;
-      line-height: 1.25;
+      border: orange solid 8px;
+      font-size: 32px;
+      line-height: 1.25; /* computes to 40px */
     }
 
   div#orthog-vert
     {
       background-color: blue;
       color: white;
-      left: 11px;
+      left: 16px;
       position: absolute;
-      writing-mode: vertical-rl;
+      writing-mode: vertical-lr;
     }
 
   span
     {
-      left: 20px;
+      left: 40px;
       position: relative;
     }
   ]]></style>
@@ -44,8 +42,8 @@
  <body>
 
   <div id="horiz-parent">
-    <div id="orthog-vert">vertical-rl floated left</div>
-    <span>horizontal-tb parent</span>
+    <div id="orthog-vert">VLR floated left</div>
+    <span>HTB parent</span>
   </div>
 
  </body>
diff --git a/third_party/WebKit/LayoutTests/external/csswg-test/css-writing-modes-3/float-lft-orthog-vlr-in-htb-002.xht b/third_party/WebKit/LayoutTests/external/csswg-test/css-writing-modes-3/float-lft-orthog-vlr-in-htb-002.xht
new file mode 100644
index 0000000..d760b49
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/external/csswg-test/css-writing-modes-3/float-lft-orthog-vlr-in-htb-002.xht
@@ -0,0 +1,50 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+
+ <head>
+
+  <title>CSS Writing Modes Test: orthogonal floated left in horizontal-tb context</title>
+
+  <meta name="DC.date.created" content="2017-02-17T09:54:03+11:00" scheme="W3CDTF" />
+  <meta name="DC.date.modified" content="2017-02-17T09:54:03+11:00" scheme="W3CDTF" />
+
+  <!--
+  Inspired by the test in
+  http://lists.w3.org/Archives/Public/www-style/2016Nov/0044.html
+  -->
+
+  <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
+  <link rel="help" href="https://drafts.csswg.org/css-writing-modes-3/#auto-multicol" title="7.3.2 Auto-sizing Block Containers in Orthogonal Flows" />
+  <link rel="match" href="float-lft-orthog-vlr-in-htb-002-ref.xht" />
+
+  <meta content="" name="flags" />
+  <meta content="This test checks the vertical position of an orthogonal floated left block box inside an horizontal-tb parent. The orthogonal floated left block box must be put as high as possible inside the horizontal-tb line box." name="assert" />
+
+  <style type="text/css"><![CDATA[
+  div#horiz-parent
+    {
+      border: orange solid 8px;
+      font-size: 32px;
+      line-height: 1.25; /* computes to 40px */
+    }
+
+  div#orthog-vlr-float-left
+    {
+      background-color: blue;
+      color: white;
+      float: left;
+      writing-mode: vertical-lr;
+    }
+  ]]></style>
+
+ </head>
+
+ <body>
+
+  <div id="horiz-parent">HTB parent
+    <div id="orthog-vlr-float-left">VLR floated left</div>
+  </div>
+
+ </body>
+</html>
diff --git a/third_party/WebKit/LayoutTests/external/csswg-test/css-writing-modes-3/float-lft-orthog-vrl-002.xht b/third_party/WebKit/LayoutTests/external/csswg-test/css-writing-modes-3/float-lft-orthog-vrl-002.xht
deleted file mode 100644
index ccc62af..0000000
--- a/third_party/WebKit/LayoutTests/external/csswg-test/css-writing-modes-3/float-lft-orthog-vrl-002.xht
+++ /dev/null
@@ -1,52 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-
-<html xmlns="http://www.w3.org/1999/xhtml">
-
- <head>
-
-  <title>CSS Writing Modes Test: floated left in vertical-rl orthogonal context</title>
-
-  <meta name="DC.date.created" content="2016-11-08T09:54:03+11:00" scheme=
-  "W3CDTF" />
-  <meta name="DC.date.modified" content="2017-02-04T09:54:03+11:00" scheme=
-  "W3CDTF" />
-
-  <!--
-  Inspired by the test in
-  http://lists.w3.org/Archives/Public/www-style/2016Nov/0044.html
-  -->
-
-  <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
-  <link rel="help" href="https://drafts.csswg.org/css-writing-modes-3/#auto-multicol" title="7.3.2 Auto-sizing Block Containers in Orthogonal Flows" />
-  <link rel="match" href="float-lft-orthog-vrl-002-ref.xht" />
-
-  <meta content="" name="flags" />
-  <meta content="This test checks that the vertical placement of an orthogonal floated left block box inside an horizontal-tb parent. The orthogonal floated left block box should be located as high as possible inside the horizontal-tb line box." name="assert" />
-
-  <style type="text/css"><![CDATA[
-  div#horiz-parent
-    {
-      border: orange solid 3px;
-      font-size: 16px;
-      line-height: 1.25;
-    }
-
-  div#orthog-vrl-float-left
-    {
-      background-color: blue;
-      color: white;
-      float: left;
-      writing-mode: vertical-rl;
-    }
-  ]]></style>
-
- </head>
-
- <body>
-
-  <div id="horiz-parent">horizontal-tb parent
-    <div id="orthog-vrl-float-left">vertical-rl floated left</div>
-  </div>
-
- </body>
-</html>
diff --git a/third_party/WebKit/LayoutTests/external/csswg-test/css-writing-modes-3/float-lft-orthog-vrl-002-expected.xht b/third_party/WebKit/LayoutTests/external/csswg-test/css-writing-modes-3/float-lft-orthog-vrl-in-htb-002-expected.xht
similarity index 69%
rename from third_party/WebKit/LayoutTests/external/csswg-test/css-writing-modes-3/float-lft-orthog-vrl-002-expected.xht
rename to third_party/WebKit/LayoutTests/external/csswg-test/css-writing-modes-3/float-lft-orthog-vrl-in-htb-002-expected.xht
index 3fbf2e1..5b305e8 100644
--- a/third_party/WebKit/LayoutTests/external/csswg-test/css-writing-modes-3/float-lft-orthog-vrl-002-expected.xht
+++ b/third_party/WebKit/LayoutTests/external/csswg-test/css-writing-modes-3/float-lft-orthog-vrl-in-htb-002-expected.xht
@@ -6,10 +6,8 @@
 
   <title>CSS Reftest Reference</title>
 
-  <meta name="DC.date.created" content="2016-12-14T09:54:03+11:00" scheme=
-  "W3CDTF" />
-  <meta name="DC.date.modified" content="2017-02-04T09:54:03+11:00" scheme=
-  "W3CDTF" />
+  <meta name="DC.date.created" content="2016-12-14T09:54:03+11:00" scheme="W3CDTF" />
+  <meta name="DC.date.modified" content="2017-02-17T09:54:03+11:00" scheme="W3CDTF" />
 
   <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
 
@@ -18,23 +16,23 @@
   <style type="text/css"><![CDATA[
   div#horiz-parent
     {
-      border: orange solid 3px;
-      font-size: 16px;
-      line-height: 1.25;
+      border: orange solid 8px;
+      font-size: 32px;
+      line-height: 1.25; /* computes to 40px */
     }
 
   div#orthog-vert
     {
       background-color: blue;
       color: white;
-      left: 11px;
+      left: 16px;
       position: absolute;
       writing-mode: vertical-rl;
     }
 
   span
     {
-      left: 20px;
+      left: 40px;
       position: relative;
     }
   ]]></style>
@@ -44,8 +42,8 @@
  <body>
 
   <div id="horiz-parent">
-    <div id="orthog-vert">vertical-rl floated left</div>
-    <span>horizontal-tb parent</span>
+    <div id="orthog-vert">VRL floated left</div>
+    <span>HTB parent</span>
   </div>
 
  </body>
diff --git a/third_party/WebKit/LayoutTests/external/csswg-test/css-writing-modes-3/float-lft-orthog-vrl-in-htb-002.xht b/third_party/WebKit/LayoutTests/external/csswg-test/css-writing-modes-3/float-lft-orthog-vrl-in-htb-002.xht
new file mode 100644
index 0000000..ac4462c
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/external/csswg-test/css-writing-modes-3/float-lft-orthog-vrl-in-htb-002.xht
@@ -0,0 +1,50 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+
+ <head>
+
+  <title>CSS Writing Modes Test: orthogonal floated left in horizontal-tb context</title>
+
+  <meta name="DC.date.created" content="2016-11-08T09:54:03+11:00" scheme="W3CDTF" />
+  <meta name="DC.date.modified" content="2017-02-17T09:54:03+11:00" scheme="W3CDTF" />
+
+  <!--
+  Inspired by the test in
+  http://lists.w3.org/Archives/Public/www-style/2016Nov/0044.html
+  -->
+
+  <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
+  <link rel="help" href="https://drafts.csswg.org/css-writing-modes-3/#auto-multicol" title="7.3.2 Auto-sizing Block Containers in Orthogonal Flows" />
+  <link rel="match" href="float-lft-orthog-vrl-in-htb-002-ref.xht" />
+
+  <meta content="" name="flags" />
+  <meta content="This test checks the vertical position of an orthogonal floated left block box inside an horizontal-tb parent. The orthogonal floated left block box must be put as high as possible inside the horizontal-tb line box." name="assert" />
+
+  <style type="text/css"><![CDATA[
+  div#horiz-parent
+    {
+      border: orange solid 8px;
+      font-size: 32px;
+      line-height: 1.25; /* computes to 40px */
+    }
+
+  div#orthog-vrl-float-left
+    {
+      background-color: blue;
+      color: white;
+      float: left;
+      writing-mode: vertical-rl;
+    }
+  ]]></style>
+
+ </head>
+
+ <body>
+
+  <div id="horiz-parent">HTB parent
+    <div id="orthog-vrl-float-left">VRL floated left</div>
+  </div>
+
+ </body>
+</html>
diff --git a/third_party/WebKit/LayoutTests/external/csswg-test/css-writing-modes-3/float-rgt-orthog-htb-in-vlr-003-expected.xht b/third_party/WebKit/LayoutTests/external/csswg-test/css-writing-modes-3/float-rgt-orthog-htb-in-vlr-003-expected.xht
new file mode 100644
index 0000000..1a27722b
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/external/csswg-test/css-writing-modes-3/float-rgt-orthog-htb-in-vlr-003-expected.xht
@@ -0,0 +1,50 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+
+ <head>
+
+  <title>CSS Reftest Reference</title>
+
+  <meta name="DC.date.created" content="2017-02-17T09:54:03+11:00" scheme="W3CDTF" />
+  <meta name="DC.date.modified" content="2017-02-17T09:54:03+11:00" scheme="W3CDTF" />
+
+  <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
+
+  <meta content="" name="flags" />
+
+  <style type="text/css"><![CDATA[
+  html
+    {
+      writing-mode: vertical-lr;
+    }
+
+  div#vertical-parent
+    {
+      border: orange solid 8px;
+      font-size: 32px;
+      line-height: 1.25; /* computes to 40px */
+    }
+
+  div#orthog-horiz
+    {
+      background-color: blue;
+      bottom: 16px;
+      color: white;
+      left: 16px;
+      position: absolute;
+      writing-mode: horizontal-tb;
+    }
+  ]]></style>
+
+ </head>
+
+ <body>
+
+  <div id="vertical-parent">
+    <div id="orthog-horiz">HTB floated right</div>
+    <span>VLR parent</span>
+  </div>
+
+ </body>
+</html>
diff --git a/third_party/WebKit/LayoutTests/external/csswg-test/css-writing-modes-3/float-rgt-orthog-htb-in-vlr-003.xht b/third_party/WebKit/LayoutTests/external/csswg-test/css-writing-modes-3/float-rgt-orthog-htb-in-vlr-003.xht
new file mode 100644
index 0000000..e11aad4
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/external/csswg-test/css-writing-modes-3/float-rgt-orthog-htb-in-vlr-003.xht
@@ -0,0 +1,55 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+
+ <head>
+
+  <title>CSS Writing Modes Test: orthogonal floated right in vertical-lr context</title>
+
+  <meta name="DC.date.created" content="2017-02-17T09:54:03+11:00" scheme="W3CDTF" />
+  <meta name="DC.date.modified" content="2017-02-17T09:54:03+11:00" scheme="W3CDTF" />
+
+  <!--
+  Inspired by the test in
+  http://lists.w3.org/Archives/Public/www-style/2016Nov/0044.html
+  -->
+
+  <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
+  <link rel="help" href="https://drafts.csswg.org/css-writing-modes-3/#auto-multicol" title="7.3.2 Auto-sizing Block Containers in Orthogonal Flows" />
+  <link rel="match" href="float-rgt-orthog-htb-in-vlr-003-ref.xht" />
+
+  <meta content="" name="flags" />
+  <meta content="This test checks the horizontal position of an orthogonal floated right block box inside a vertical-lr parent. The orthogonal floated right block box must be put as far to the left as possible inside the vertical-lr line box." name="assert" />
+
+  <style type="text/css"><![CDATA[
+  html
+    {
+      writing-mode: vertical-lr;
+    }
+
+  div#vertical-parent
+    {
+      border: orange solid 8px;
+      font-size: 32px;
+      line-height: 1.25; /* computes to 40px */
+    }
+
+  div#orthog-htb-float-right
+    {
+      background-color: blue;
+      color: white;
+      float: right;
+      writing-mode: horizontal-tb;
+    }
+  ]]></style>
+
+ </head>
+
+ <body>
+
+  <div id="vertical-parent">VLR parent
+    <div id="orthog-htb-float-right">HTB floated right</div>
+  </div>
+
+ </body>
+</html>
diff --git a/third_party/WebKit/LayoutTests/external/csswg-test/css-writing-modes-3/float-rgt-orthog-htb-in-vrl-003-expected.xht b/third_party/WebKit/LayoutTests/external/csswg-test/css-writing-modes-3/float-rgt-orthog-htb-in-vrl-003-expected.xht
new file mode 100644
index 0000000..76563a57
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/external/csswg-test/css-writing-modes-3/float-rgt-orthog-htb-in-vrl-003-expected.xht
@@ -0,0 +1,50 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+
+ <head>
+
+  <title>CSS Reftest Reference</title>
+
+  <meta name="DC.date.created" content="2017-02-17T09:54:03+11:00" scheme="W3CDTF" />
+  <meta name="DC.date.modified" content="2017-02-17T09:54:03+11:00" scheme="W3CDTF" />
+
+  <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
+
+  <meta content="" name="flags" />
+
+  <style type="text/css"><![CDATA[
+  html
+    {
+      writing-mode: vertical-rl;
+    }
+
+  div#vertical-parent
+    {
+      border: orange solid 8px;
+      font-size: 32px;
+      line-height: 1.25; /* computes to 40px */
+    }
+
+  div#orthog-horiz
+    {
+      background-color: blue;
+      bottom: 16px;
+      color: white;
+      position: absolute;
+      right: 16px;
+      writing-mode: horizontal-tb;
+    }
+  ]]></style>
+
+ </head>
+
+ <body>
+
+  <div id="vertical-parent">
+    <div id="orthog-horiz">HTB floated right</div>
+    <span>VRL parent</span>
+  </div>
+
+ </body>
+</html>
diff --git a/third_party/WebKit/LayoutTests/external/csswg-test/css-writing-modes-3/float-rgt-orthog-htb-in-vrl-003.xht b/third_party/WebKit/LayoutTests/external/csswg-test/css-writing-modes-3/float-rgt-orthog-htb-in-vrl-003.xht
new file mode 100644
index 0000000..89cde7b4
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/external/csswg-test/css-writing-modes-3/float-rgt-orthog-htb-in-vrl-003.xht
@@ -0,0 +1,55 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+
+ <head>
+
+  <title>CSS Writing Modes Test: orthogonal floated right in vertical-rl context</title>
+
+  <meta name="DC.date.created" content="2017-02-17T09:54:03+11:00" scheme="W3CDTF" />
+  <meta name="DC.date.modified" content="2017-02-17T09:54:03+11:00" scheme="W3CDTF" />
+
+  <!--
+  Inspired by the test in
+  http://lists.w3.org/Archives/Public/www-style/2016Nov/0044.html
+  -->
+
+  <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
+  <link rel="help" href="https://drafts.csswg.org/css-writing-modes-3/#auto-multicol" title="7.3.2 Auto-sizing Block Containers in Orthogonal Flows" />
+  <link rel="match" href="float-rgt-orthog-htb-in-vrl-003-ref.xht" />
+
+  <meta content="" name="flags" />
+  <meta content="This test checks the horizontal position of an orthogonal floated right block box inside a vertical-rl parent. The orthogonal floated right block box must be put as far to the right as possible inside the vertical-rl line box." name="assert" />
+
+  <style type="text/css"><![CDATA[
+  html
+    {
+      writing-mode: vertical-rl;
+    }
+
+  div#vertical-parent
+    {
+      border: orange solid 8px;
+      font-size: 32px;
+      line-height: 1.25; /* computes to 40px */
+    }
+
+  div#orthog-htb-float-right
+    {
+      background-color: blue;
+      color: white;
+      float: right;
+      writing-mode: horizontal-tb;
+    }
+  ]]></style>
+
+ </head>
+
+ <body>
+
+  <div id="vertical-parent">VRL parent
+    <div id="orthog-htb-float-right">HTB floated right</div>
+  </div>
+
+ </body>
+</html>
diff --git a/third_party/WebKit/LayoutTests/external/csswg-test/css-writing-modes-3/float-rgt-orthog-vrl-003-expected.xht b/third_party/WebKit/LayoutTests/external/csswg-test/css-writing-modes-3/float-rgt-orthog-vlr-in-htb-003-expected.xht
similarity index 61%
copy from third_party/WebKit/LayoutTests/external/csswg-test/css-writing-modes-3/float-rgt-orthog-vrl-003-expected.xht
copy to third_party/WebKit/LayoutTests/external/csswg-test/css-writing-modes-3/float-rgt-orthog-vlr-in-htb-003-expected.xht
index ade372a..e690a816 100644
--- a/third_party/WebKit/LayoutTests/external/csswg-test/css-writing-modes-3/float-rgt-orthog-vrl-003-expected.xht
+++ b/third_party/WebKit/LayoutTests/external/csswg-test/css-writing-modes-3/float-rgt-orthog-vlr-in-htb-003-expected.xht
@@ -6,10 +6,8 @@
 
   <title>CSS Reftest Reference</title>
 
-  <meta name="DC.date.created" content="2016-12-14T09:54:03+11:00" scheme=
-  "W3CDTF" />
-  <meta name="DC.date.modified" content="2017-02-04T09:54:03+11:00" scheme=
-  "W3CDTF" />
+  <meta name="DC.date.created" content="2017-02-17T09:54:03+11:00" scheme="W3CDTF" />
+  <meta name="DC.date.modified" content="2017-02-17T09:54:03+11:00" scheme="W3CDTF" />
 
   <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
 
@@ -18,18 +16,18 @@
   <style type="text/css"><![CDATA[
   div#horiz-parent
     {
-      border: orange solid 3px;
-      font-size: 16px;
-      line-height: 1.25;
+      border: orange solid 8px;
+      font-size: 32px;
+      line-height: 1.25; /* computes to 40px */
     }
 
   div#orthog-vert
     {
       background-color: blue;
       color: white;
-      right: 11px;
+      right: 16px;
       position: absolute;
-      writing-mode: vertical-rl;
+      writing-mode: vertical-lr;
     }
   ]]></style>
 
@@ -38,8 +36,8 @@
  <body>
 
   <div id="horiz-parent">
-    <div id="orthog-vert">vertical-rl floated right</div>
-    horizontal-tb parent
+    <div id="orthog-vert">VLR floated right</div>
+    HTB parent
   </div>
 
  </body>
diff --git a/third_party/WebKit/LayoutTests/external/csswg-test/css-writing-modes-3/float-rgt-orthog-vlr-in-htb-003.xht b/third_party/WebKit/LayoutTests/external/csswg-test/css-writing-modes-3/float-rgt-orthog-vlr-in-htb-003.xht
new file mode 100644
index 0000000..09e5979
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/external/csswg-test/css-writing-modes-3/float-rgt-orthog-vlr-in-htb-003.xht
@@ -0,0 +1,50 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+
+ <head>
+
+  <title>CSS Writing Modes Test: orthogonal floated right in horizontal-tb context</title>
+
+  <meta name="DC.date.created" content="2017-02-17T09:54:03+11:00" scheme="W3CDTF" />
+  <meta name="DC.date.modified" content="2017-02-17T09:54:03+11:00" scheme="W3CDTF" />
+
+  <!--
+  Inspired by the test in
+  http://lists.w3.org/Archives/Public/www-style/2016Nov/0044.html
+  -->
+
+  <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
+  <link rel="help" href="https://drafts.csswg.org/css-writing-modes-3/#auto-multicol" title="7.3.2 Auto-sizing Block Containers in Orthogonal Flows" />
+  <link rel="match" href="float-rgt-orthog-vlr-in-htb-003-ref.xht" />
+
+  <meta content="" name="flags" />
+  <meta content="This test checks the vertical position of an orthogonal floated right block box inside an horizontal-tb parent. The orthogonal floated right block box must be put as high as possible inside the horizontal-tb line box." name="assert" />
+
+  <style type="text/css"><![CDATA[
+  div#horiz-parent
+    {
+      border: orange solid 8px;
+      font-size: 32px;
+      line-height: 1.25; /* computes to 40px */
+    }
+
+  div#orthog-vlr-float-right
+    {
+      background-color: blue;
+      color: white;
+      float: right;
+      writing-mode: vertical-lr;
+    }
+  ]]></style>
+
+ </head>
+
+ <body>
+
+  <div id="horiz-parent">HTB parent
+    <div id="orthog-vlr-float-right">VLR floated right</div>
+  </div>
+
+ </body>
+</html>
diff --git a/third_party/WebKit/LayoutTests/external/csswg-test/css-writing-modes-3/float-rgt-orthog-vrl-003.xht b/third_party/WebKit/LayoutTests/external/csswg-test/css-writing-modes-3/float-rgt-orthog-vrl-003.xht
deleted file mode 100644
index 77461fc..0000000
--- a/third_party/WebKit/LayoutTests/external/csswg-test/css-writing-modes-3/float-rgt-orthog-vrl-003.xht
+++ /dev/null
@@ -1,52 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-
-<html xmlns="http://www.w3.org/1999/xhtml">
-
- <head>
-
-  <title>CSS Writing Modes Test: floated right in vertical-rl orthogonal context</title>
-
-  <meta name="DC.date.created" content="2016-11-08T09:54:03+11:00" scheme=
-  "W3CDTF" />
-  <meta name="DC.date.modified" content="2017-02-04T09:54:03+11:00" scheme=
-  "W3CDTF" />
-
-  <!--
-  Inspired by the test in
-  http://lists.w3.org/Archives/Public/www-style/2016Nov/0044.html
-  -->
-
-  <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
-  <link rel="help" href="https://drafts.csswg.org/css-writing-modes-3/#auto-multicol" title="7.3.2 Auto-sizing Block Containers in Orthogonal Flows" />
-  <link rel="match" href="float-rgt-orthog-vrl-003-ref.xht" />
-
-  <meta content="" name="flags" />
-  <meta content="This test checks that the vertical placement of an orthogonal floated right block box inside an horizontal-tb parent. The orthogonal floated right block box should be located as high as possible inside the horizontal-tb line box." name="assert" />
-
-  <style type="text/css"><![CDATA[
-  div#horiz-parent
-    {
-      border: orange solid 3px;
-      font-size: 16px;
-      line-height: 1.25;
-    }
-
-  div#orthog-vrl-float-right
-    {
-      background-color: blue;
-      color: white;
-      float: right;
-      writing-mode: vertical-rl;
-    }
-  ]]></style>
-
- </head>
-
- <body>
-
-  <div id="horiz-parent">horizontal-tb parent
-    <div id="orthog-vrl-float-right">vertical-rl floated right</div>
-  </div>
-
- </body>
-</html>
diff --git a/third_party/WebKit/LayoutTests/external/csswg-test/css-writing-modes-3/float-rgt-orthog-vrl-003-expected.xht b/third_party/WebKit/LayoutTests/external/csswg-test/css-writing-modes-3/float-rgt-orthog-vrl-in-htb-003-expected.xht
similarity index 70%
rename from third_party/WebKit/LayoutTests/external/csswg-test/css-writing-modes-3/float-rgt-orthog-vrl-003-expected.xht
rename to third_party/WebKit/LayoutTests/external/csswg-test/css-writing-modes-3/float-rgt-orthog-vrl-in-htb-003-expected.xht
index ade372a..d22bed1 100644
--- a/third_party/WebKit/LayoutTests/external/csswg-test/css-writing-modes-3/float-rgt-orthog-vrl-003-expected.xht
+++ b/third_party/WebKit/LayoutTests/external/csswg-test/css-writing-modes-3/float-rgt-orthog-vrl-in-htb-003-expected.xht
@@ -6,10 +6,8 @@
 
   <title>CSS Reftest Reference</title>
 
-  <meta name="DC.date.created" content="2016-12-14T09:54:03+11:00" scheme=
-  "W3CDTF" />
-  <meta name="DC.date.modified" content="2017-02-04T09:54:03+11:00" scheme=
-  "W3CDTF" />
+  <meta name="DC.date.created" content="2016-12-14T09:54:03+11:00" scheme="W3CDTF" />
+  <meta name="DC.date.modified" content="2017-02-17T09:54:03+11:00" scheme="W3CDTF" />
 
   <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
 
@@ -18,16 +16,16 @@
   <style type="text/css"><![CDATA[
   div#horiz-parent
     {
-      border: orange solid 3px;
-      font-size: 16px;
-      line-height: 1.25;
+      border: orange solid 8px;
+      font-size: 32px;
+      line-height: 1.25; /* computes to 40px */
     }
 
   div#orthog-vert
     {
       background-color: blue;
       color: white;
-      right: 11px;
+      right: 16px;
       position: absolute;
       writing-mode: vertical-rl;
     }
@@ -38,8 +36,8 @@
  <body>
 
   <div id="horiz-parent">
-    <div id="orthog-vert">vertical-rl floated right</div>
-    horizontal-tb parent
+    <div id="orthog-vert">VRL floated right</div>
+    HTB parent
   </div>
 
  </body>
diff --git a/third_party/WebKit/LayoutTests/external/csswg-test/css-writing-modes-3/float-rgt-orthog-vrl-in-htb-003.xht b/third_party/WebKit/LayoutTests/external/csswg-test/css-writing-modes-3/float-rgt-orthog-vrl-in-htb-003.xht
new file mode 100644
index 0000000..203c16e
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/external/csswg-test/css-writing-modes-3/float-rgt-orthog-vrl-in-htb-003.xht
@@ -0,0 +1,50 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml">
+
+ <head>
+
+  <title>CSS Writing Modes Test: orthogonal floated right in horizontal-tb context</title>
+
+  <meta name="DC.date.created" content="2016-11-08T09:54:03+11:00" scheme="W3CDTF" />
+  <meta name="DC.date.modified" content="2017-02-17T09:54:03+11:00" scheme="W3CDTF" />
+
+  <!--
+  Inspired by the test in
+  http://lists.w3.org/Archives/Public/www-style/2016Nov/0044.html
+  -->
+
+  <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
+  <link rel="help" href="https://drafts.csswg.org/css-writing-modes-3/#auto-multicol" title="7.3.2 Auto-sizing Block Containers in Orthogonal Flows" />
+  <link rel="match" href="float-rgt-orthog-vrl-in-htb-003-ref.xht" />
+
+  <meta content="" name="flags" />
+  <meta content="This test checks the vertical position of an orthogonal floated right block box inside an horizontal-tb parent. The orthogonal floated right block box must be put as high as possible inside the horizontal-tb line box." name="assert" />
+
+  <style type="text/css"><![CDATA[
+  div#horiz-parent
+    {
+      border: orange solid 8px;
+      font-size: 32px;
+      line-height: 1.25; /* computes to 40px */
+    }
+
+  div#orthog-vrl-float-right
+    {
+      background-color: blue;
+      color: white;
+      float: right;
+      writing-mode: vertical-rl;
+    }
+  ]]></style>
+
+ </head>
+
+ <body>
+
+  <div id="horiz-parent">HTB parent
+    <div id="orthog-vrl-float-right">VRL floated right</div>
+  </div>
+
+ </body>
+</html>
diff --git a/third_party/WebKit/LayoutTests/inspector-protocol/accessibility/accessibility-ignoredNodes-expected.txt b/third_party/WebKit/LayoutTests/inspector-protocol/accessibility/accessibility-ignoredNodes-expected.txt
index b932ae56..3414b09 100644
--- a/third_party/WebKit/LayoutTests/inspector-protocol/accessibility/accessibility-ignoredNodes-expected.txt
+++ b/third_party/WebKit/LayoutTests/inspector-protocol/accessibility/accessibility-ignoredNodes-expected.txt
@@ -178,8 +178,17 @@
 }
 
 WebArea
+  Div
+  tree
+  img
+  button "Buttons are leaf nodes"
+  text "List item also presentational"
   *Div
     text "Div in list isn't presentational"
+  checkbox "Content within label refers to label container"
+  Div
+  combobox
+  Div
 {
   "nodeId": "<string>",
   "ignored": false,
@@ -357,11 +366,17 @@
 }
 
 WebArea
+  Div
+  tree
+  img
+  button "Buttons are leaf nodes"
+  text "List item also presentational"
+  Div
+  checkbox "Content within label refers to label container"
+  Div
   *combobox
     MenuListPopup
-      menuitem "Options should be"
-      menuitem "sent down even though"
-      menuitem "they are grandchildren"
+  Div
 {
   "nodeId": "<string>",
   "ignored": false,
@@ -414,3 +429,36 @@
   "domNode": "select"
 }
 
+*menuitem "Options should be"
+{
+  "nodeId": "<string>",
+  "ignored": false,
+  "role": {
+    "type": "role",
+    "value": "menuitem"
+  },
+  "name": {
+    "type": "computedString",
+    "value": "Options should be",
+    "sources": [
+      {
+        "type": "relatedElement",
+        "attribute": "aria-labelledby"
+      },
+      {
+        "type": "attribute",
+        "attribute": "aria-label"
+      },
+      {
+        "type": "contents",
+        "value": {
+          "type": "computedString",
+          "value": "Options should be"
+        }
+      }
+    ]
+  },
+  "properties": [],
+  "domNode": "option"
+}
+
diff --git a/third_party/WebKit/LayoutTests/inspector-protocol/accessibility/accessibility-ignoredNodes.html b/third_party/WebKit/LayoutTests/inspector-protocol/accessibility/accessibility-ignoredNodes.html
index 05d3896..c64e219 100644
--- a/third_party/WebKit/LayoutTests/inspector-protocol/accessibility/accessibility-ignoredNodes.html
+++ b/third_party/WebKit/LayoutTests/inspector-protocol/accessibility/accessibility-ignoredNodes.html
@@ -51,7 +51,7 @@
     <canvas role="presentation" data-dump><div>Canvas fallback content</div></canvas>
 
     <select data-dump>
-      <option>Options should be</option>
+      <option data-dump>Options should be</option>
       <option>sent down even though</option>
       <option>they are grandchildren</option>
     </select>
diff --git a/third_party/WebKit/LayoutTests/platform/linux/compositing/overlap-blending/reflection-opacity-huge-expected.png b/third_party/WebKit/LayoutTests/platform/linux/compositing/overlap-blending/reflection-opacity-huge-expected.png
index aadf63d..4209878 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/compositing/overlap-blending/reflection-opacity-huge-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/compositing/overlap-blending/reflection-opacity-huge-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/compositing/reflections/animation-inside-reflection-expected.png b/third_party/WebKit/LayoutTests/platform/linux/compositing/reflections/animation-inside-reflection-expected.png
index 9cb6b770..11043490 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/compositing/reflections/animation-inside-reflection-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/compositing/reflections/animation-inside-reflection-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/compositing/reflections/deeply-nested-reflections-expected.png b/third_party/WebKit/LayoutTests/platform/linux/compositing/reflections/deeply-nested-reflections-expected.png
index a53a7233..7c52e2e 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/compositing/reflections/deeply-nested-reflections-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/compositing/reflections/deeply-nested-reflections-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/compositing/reflections/load-video-in-reflection-expected.png b/third_party/WebKit/LayoutTests/platform/linux/compositing/reflections/load-video-in-reflection-expected.png
index 953b1554..b5e3db3 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/compositing/reflections/load-video-in-reflection-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/compositing/reflections/load-video-in-reflection-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/compositing/reflections/nested-reflection-anchor-point-expected.png b/third_party/WebKit/LayoutTests/platform/linux/compositing/reflections/nested-reflection-anchor-point-expected.png
index a3cf5845..38b08b1 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/compositing/reflections/nested-reflection-anchor-point-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/compositing/reflections/nested-reflection-anchor-point-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/compositing/reflections/nested-reflection-animated-expected.png b/third_party/WebKit/LayoutTests/platform/linux/compositing/reflections/nested-reflection-animated-expected.png
index 67040e01..41cf685 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/compositing/reflections/nested-reflection-animated-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/compositing/reflections/nested-reflection-animated-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/compositing/reflections/nested-reflection-mask-change-expected.png b/third_party/WebKit/LayoutTests/platform/linux/compositing/reflections/nested-reflection-mask-change-expected.png
index d287837..db7e3d9 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/compositing/reflections/nested-reflection-mask-change-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/compositing/reflections/nested-reflection-mask-change-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/compositing/reflections/nested-reflection-opacity-expected.png b/third_party/WebKit/LayoutTests/platform/linux/compositing/reflections/nested-reflection-opacity-expected.png
index 70eca18..a47b812 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/compositing/reflections/nested-reflection-opacity-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/compositing/reflections/nested-reflection-opacity-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/inspector-protocol/accessibility/accessibility-ignoredNodes-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/inspector-protocol/accessibility/accessibility-ignoredNodes-expected.txt
index 43cf62d..e1d2375 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/inspector-protocol/accessibility/accessibility-ignoredNodes-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/linux/inspector-protocol/accessibility/accessibility-ignoredNodes-expected.txt
@@ -178,8 +178,17 @@
 }
 
 WebArea
+  Div
+  tree
+  img
+  button "Buttons are leaf nodes"
+  text "List item also presentational"
   *Div
     text "Div in list isn't presentational"
+  checkbox "Content within label refers to label container"
+  Div
+  combobox
+  Div
 {
   "nodeId": "<string>",
   "ignored": false,
@@ -357,11 +366,17 @@
 }
 
 WebArea
+  Div
+  tree
+  img
+  button "Buttons are leaf nodes"
+  text "List item also presentational"
+  Div
+  checkbox "Content within label refers to label container"
+  Div
   *combobox
     MenuListPopup
-      menuitem "Options should be"
-      menuitem "sent down even though"
-      menuitem "they are grandchildren"
+  Div
 {
   "nodeId": "<string>",
   "ignored": false,
@@ -414,3 +429,36 @@
   "domNode": "select"
 }
 
+*menuitem "Options should be"
+{
+  "nodeId": "<string>",
+  "ignored": false,
+  "role": {
+    "type": "role",
+    "value": "menuitem"
+  },
+  "name": {
+    "type": "computedString",
+    "value": "Options should be",
+    "sources": [
+      {
+        "type": "relatedElement",
+        "attribute": "aria-labelledby"
+      },
+      {
+        "type": "attribute",
+        "attribute": "aria-label"
+      },
+      {
+        "type": "contents",
+        "value": {
+          "type": "computedString",
+          "value": "Options should be"
+        }
+      }
+    ]
+  },
+  "properties": [],
+  "domNode": "option"
+}
+
diff --git a/third_party/WebKit/LayoutTests/platform/linux/media/video-layer-crash-expected.png b/third_party/WebKit/LayoutTests/platform/linux/media/video-layer-crash-expected.png
index 226d7e7f..a90bca1 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/media/video-layer-crash-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/media/video-layer-crash-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/compositing/reflections/animation-inside-reflection-expected.png b/third_party/WebKit/LayoutTests/platform/mac/compositing/reflections/animation-inside-reflection-expected.png
index aa2e6b1..0f14a06 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/compositing/reflections/animation-inside-reflection-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/compositing/reflections/animation-inside-reflection-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/compositing/reflections/deeply-nested-reflections-expected.png b/third_party/WebKit/LayoutTests/platform/mac/compositing/reflections/deeply-nested-reflections-expected.png
index a7dd35c..9409676 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/compositing/reflections/deeply-nested-reflections-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/compositing/reflections/deeply-nested-reflections-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/compositing/reflections/nested-reflection-anchor-point-expected.png b/third_party/WebKit/LayoutTests/platform/mac/compositing/reflections/nested-reflection-anchor-point-expected.png
index 76eeaa4..1ae5cb4 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/compositing/reflections/nested-reflection-anchor-point-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/compositing/reflections/nested-reflection-anchor-point-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/compositing/reflections/nested-reflection-animated-expected.png b/third_party/WebKit/LayoutTests/platform/mac/compositing/reflections/nested-reflection-animated-expected.png
index f109e14..b4c025af 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/compositing/reflections/nested-reflection-animated-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/compositing/reflections/nested-reflection-animated-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/compositing/reflections/nested-reflection-mask-change-expected.png b/third_party/WebKit/LayoutTests/platform/mac/compositing/reflections/nested-reflection-mask-change-expected.png
index 0f88eafb..731e47e 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/compositing/reflections/nested-reflection-mask-change-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/compositing/reflections/nested-reflection-mask-change-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/media/video-layer-crash-expected.png b/third_party/WebKit/LayoutTests/platform/mac/media/video-layer-crash-expected.png
index 908effe..6c84ef55 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/media/video-layer-crash-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/media/video-layer-crash-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/compositing/reflections/animation-inside-reflection-expected.png b/third_party/WebKit/LayoutTests/platform/win/compositing/reflections/animation-inside-reflection-expected.png
index b215d73..4b0a476 100644
--- a/third_party/WebKit/LayoutTests/platform/win/compositing/reflections/animation-inside-reflection-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/compositing/reflections/animation-inside-reflection-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/compositing/reflections/deeply-nested-reflections-expected.png b/third_party/WebKit/LayoutTests/platform/win/compositing/reflections/deeply-nested-reflections-expected.png
index ca279d0..dd7b705 100644
--- a/third_party/WebKit/LayoutTests/platform/win/compositing/reflections/deeply-nested-reflections-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/compositing/reflections/deeply-nested-reflections-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/compositing/reflections/nested-reflection-anchor-point-expected.png b/third_party/WebKit/LayoutTests/platform/win/compositing/reflections/nested-reflection-anchor-point-expected.png
index f4b023b..9a16aac 100644
--- a/third_party/WebKit/LayoutTests/platform/win/compositing/reflections/nested-reflection-anchor-point-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/compositing/reflections/nested-reflection-anchor-point-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/compositing/reflections/nested-reflection-animated-expected.png b/third_party/WebKit/LayoutTests/platform/win/compositing/reflections/nested-reflection-animated-expected.png
index bfea399..e1c9563 100644
--- a/third_party/WebKit/LayoutTests/platform/win/compositing/reflections/nested-reflection-animated-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/compositing/reflections/nested-reflection-animated-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/compositing/reflections/nested-reflection-mask-change-expected.png b/third_party/WebKit/LayoutTests/platform/win/compositing/reflections/nested-reflection-mask-change-expected.png
index 97c9f788..d746a2e 100644
--- a/third_party/WebKit/LayoutTests/platform/win/compositing/reflections/nested-reflection-mask-change-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/compositing/reflections/nested-reflection-mask-change-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/media/video-layer-crash-expected.png b/third_party/WebKit/LayoutTests/platform/win/media/video-layer-crash-expected.png
index b80c50a..35554a8 100644
--- a/third_party/WebKit/LayoutTests/platform/win/media/video-layer-crash-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/media/video-layer-crash-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win7/media/video-layer-crash-expected.png b/third_party/WebKit/LayoutTests/platform/win7/media/video-layer-crash-expected.png
deleted file mode 100644
index 9c6758e9..0000000
--- a/third_party/WebKit/LayoutTests/platform/win7/media/video-layer-crash-expected.png
+++ /dev/null
Binary files differ
diff --git a/third_party/WebKit/Source/build/scripts/make_computed_style_base.py b/third_party/WebKit/Source/build/scripts/make_computed_style_base.py
index af01def..a24ebf7 100755
--- a/third_party/WebKit/Source/build/scripts/make_computed_style_base.py
+++ b/third_party/WebKit/Source/build/scripts/make_computed_style_base.py
@@ -31,23 +31,28 @@
     regular member variables, or more complex storage like vectors or hashmaps.
     Almost all properties will have at least one Field, often more than one.
 
-    Fields also fall into various families, which determine the logic that is
-    used to generate them. The available field families are:
+    Fields also fall into various roles, which determine the logic that is
+    used to generate them. The available field roles are:
       - 'property', for fields that store CSS properties
       - 'inherited_flag', for single-bit flags that store whether a property is
                           inherited by this style or set explicitly
+      - 'nonproperty', for fields that are not CSS properties
     """
 
     # List of required attributes for a field which need to be passed in by
-    # keyword arguments
+    # keyword arguments. See CSSProperties.json5 for an explanation of each
+    # attribute.
     REQUIRED_ATTRIBUTES = set([
         # Name of field
         'name',
         # Name of property field is for
         'property_name',
-        # Internal field storage type (storage_type_path can be None)
-        'storage_type',
-        'storage_type_path',
+        # Name of the type (e.g. EClear, int)
+        'type_name',
+        # Path to predefined class for overriding generated types.
+        'field_type_path',
+        # Affects how the field is generated (keyword, flag)
+        'field_template',
         # Bits needed for storage
         'size',
         # Default value for field
@@ -59,18 +64,18 @@
         'resetter_method_name',
     ])
 
-    def __init__(self, field_family, **kwargs):
+    def __init__(self, field_role, **kwargs):
         # Values common to all fields
         # Set attributes from the keyword arguments
         for attrib in Field.REQUIRED_ATTRIBUTES:
             setattr(self, attrib, kwargs.pop(attrib))
 
-        # Field family: one of these must be true
-        self.is_property = field_family == 'property'
-        self.is_inherited_flag = field_family == 'inherited_flag'
-        self.is_nonproperty = field_family == 'nonproperty'
+        # Field role: one of these must be true
+        self.is_property = field_role == 'property'
+        self.is_inherited_flag = field_role == 'inherited_flag'
+        self.is_nonproperty = field_role == 'nonproperty'
         assert (self.is_property, self.is_inherited_flag, self.is_nonproperty).count(True) == 1, \
-            'Field family has to be exactly one of: property, inherited_flag, nonproperty'
+            'Field role has to be exactly one of: property, inherited_flag, nonproperty'
 
         if self.is_property:
             self.is_inherited = kwargs.pop('inherited')
@@ -91,8 +96,8 @@
     """
     enums = {}
     for property_ in properties:
-        # Only generate enums for keyword properties that use the default field_storage_type.
-        if property_['keyword_only'] and property_['field_storage_type'] is None:
+        # Only generate enums for keyword properties that use the default field_type_path.
+        if property_['field_template'] == 'keyword' and property_['field_type_path'] is None:
             enum_name = property_['type_name']
             # From the Blink style guide: Enum members should use InterCaps with an initial capital letter. [names-enum-members]
             enum_values = [('k' + camel_case(k)) for k in property_['keywords']]
@@ -118,15 +123,15 @@
 
     # From the Blink style guide: Other data members should be prefixed by "m_". [names-data-members]
     field_name = 'm_' + property_name_lower
-    bits_needed = math.log(len(property_['keywords']), 2)
+    bits_needed = math.log(len(property_['keywords']), 2)  # TODO: implement for non-enums
 
     # Separate the type path from the type name, if specified.
-    if property_['field_storage_type']:
-        type_path = property_['field_storage_type']
-        type_name = type_path.split('/')[-1]
+    if property_['field_type_path']:
+        field_type_path = property_['field_type_path']
+        type_name = field_type_path.split('/')[-1]
     else:
+        field_type_path = None
         type_name = property_['type_name']
-        type_path = None
 
     # For now, the getter name should match the field name. Later, getter names
     # will start with an uppercase letter, so if they conflict with the type name,
@@ -136,19 +141,19 @@
         getter_method_name = 'get' + property_name
 
     assert property_['initial_keyword'] is not None, \
-        ('MakeComputedStyleBase requires an initial keyword for keyword_only values, none specified '
+        ('MakeComputedStyleBase requires an initial keyword for keyword fields, none specified '
          'for property ' + property_['name'])
     default_value = type_name + '::k' + camel_case(property_['initial_keyword'])
 
-    # Add the property itself as a member variable.
     return Field(
         'property',
         name=field_name,
         property_name=property_['name'],
         inherited=property_['inherited'],
         independent=property_['independent'],
-        storage_type=type_name,
-        storage_type_path=type_path,
+        type_name=type_name,
+        field_type_path=field_type_path,
+        field_template=property_['field_template'],
         size=int(math.ceil(bits_needed)),
         default_value=default_value,
         getter_method_name=getter_method_name,
@@ -174,8 +179,9 @@
         'inherited_flag',
         name='m_' + field_name_suffix_lower,
         property_name=property_['name'],
-        storage_type='bool',
-        storage_type_path=None,
+        type_name='bool',
+        field_type_path=None,
+        field_template='flag',
         size=1,
         default_value='true',
         getter_method_name=field_name_suffix_lower,
@@ -196,8 +202,9 @@
         'nonproperty',
         name=member_name,
         property_name=field_name,
-        storage_type='bool',
-        storage_type_path=None,
+        type_name='bool',
+        field_type_path=None,
+        field_template='flag',
         size=1,
         default_value='false',
         getter_method_name=field_name,
@@ -213,8 +220,8 @@
     """
     fields = []
     for property_ in properties:
-        # Keywords only means we generate an enum field.
-        if property_['keyword_only']:
+        # Only generate properties that have a field template
+        if property_['field_template'] is not None:
             # If the property is independent, add the single-bit sized isInherited flag
             # to the list of Fields as well.
             if property_['independent']:
diff --git a/third_party/WebKit/Source/build/scripts/templates/ComputedStyleBase.h.tmpl b/third_party/WebKit/Source/build/scripts/templates/ComputedStyleBase.h.tmpl
index b89cff5..738b7249 100644
--- a/third_party/WebKit/Source/build/scripts/templates/ComputedStyleBase.h.tmpl
+++ b/third_party/WebKit/Source/build/scripts/templates/ComputedStyleBase.h.tmpl
@@ -6,8 +6,8 @@
 
 #include "core/ComputedStyleBaseConstants.h"
 #include "core/CoreExport.h"
-{% for field in fields if field.storage_type_path != None %}
-#include "{{field.storage_type_path}}.h"
+{% for field in fields if field.field_type_path != None %}
+#include "{{field.field_type_path}}.h"
 {% endfor %}
 
 {# Returns the default value for the field, converted to fit in the storage container. #}
@@ -100,22 +100,33 @@
   // Fields.
   // TODO(sashab): Remove initialFoo() static methods and update callers to
   // use resetFoo(), which can be more efficient.
+
   {% for field in fields %}
   // {{field.property_name}}
-  inline static {{field.storage_type}} {{field.initial_method_name}}() { return {{field.default_value}}; }
-  {{field.storage_type}} {{field.getter_method_name}}() const { return static_cast<{{field.storage_type}}>({{field.name}}); }
+  inline static {{field.type_name}} {{field.initial_method_name}}() {
+    return {{field.default_value}};
+  }
+  {{field.type_name}} {{field.getter_method_name}}() const {
+    return static_cast<{{field.type_name}}>({{field.name}});
+  }
   {% if field.is_nonproperty %}
-  void {{field.setter_method_name}}() { {{field.name}} = static_cast<unsigned>(true); }
+  void {{field.setter_method_name}}() {
+    {{field.name}} = static_cast<unsigned>(true);
+  }
   {% else %}
-  void {{field.setter_method_name}}({{field.storage_type}} v) { {{field.name}} = static_cast<unsigned>(v); }
+  void {{field.setter_method_name}}({{field.type_name}} v) {
+    {{field.name}} = static_cast<unsigned>(v);
+  }
   {% endif %}
-  inline void {{field.resetter_method_name}}() { {{field.name}} = {{default_value(field)}}; }
+  inline void {{field.resetter_method_name}}() {
+    {{field.name}} = {{default_value(field)}};
+  }
 
   {% endfor %}
  protected:
   // Storage.
   {% for field in fields %}
-  unsigned {{field.name}} : {{field.size}}; // {{field.storage_type}}
+  unsigned {{field.name}} : {{field.size}}; // {{field.type_name}}
   {% endfor %}
 };
 
diff --git a/third_party/WebKit/Source/core/css/CSSProperties.json5 b/third_party/WebKit/Source/core/css/CSSProperties.json5
index 35ca028..15f86228 100644
--- a/third_party/WebKit/Source/core/css/CSSProperties.json5
+++ b/third_party/WebKit/Source/core/css/CSSProperties.json5
@@ -55,28 +55,28 @@
       valid_values: ["parseSingleValue", "parseShorthand"],
     },
 
-    // - keyword_only
-    // These properties only store keyword values. This is used when
-    // generating the ComputedStyle storage for the property. The initial
-    // value for this property on a ComputedStyle is specified with the
-    // initial_keyword flag below.
-    // TODO(sashab): Rename this to field_type=keyword once we support
-    // multiple types of generatable fields in ComputedStyle
+    // - field_template
+    // Affects how the interface to this field is generated.
     // TODO(sashab, meade): Remove this once TypedOM types are specified for
     // every property, since this value can be inferred from that.
-    keyword_only: {
-      default: false,
-      valid_type: "bool",
+    field_template: {
+      valid_values: [
+        // Field is stored as an enum and has a initial/getter/setter/resetter.
+        "keyword",
+        // Field is stored a packed boolean flag and has a initial/getter/setter/resetter.
+        // TODO(shend): generalise this to "primitive"
+        "flag",
+      ],
     },
 
-    // - field_storage_type: "path/to/Type"
+    // - field_type_path: "path/to/Type"
     // For properties that have generated field storage in ComputedStyle,
     // this optional argument will override the field's generated type with
     // an external one specified at the given path. The type must be defined
     // in a header file at that path, and have the same name as the file.
     // Currently, only enum types are supported, and the enum's only values
     // must be CamelCase values of the keywords of the property.
-    field_storage_type: {
+    field_type_path: {
     },
 
     // - keywords: ["keyword1", "keyword2"]
@@ -88,8 +88,7 @@
     },
 
     // - initial_keyword: "keyword-value"
-    // This specifies the initial keyword value for the keyword_only
-    // property.
+    // This specifies the initial keyword value for the keyword fields.
     initial_keyword: {
     },
 
@@ -328,10 +327,10 @@
     {
       name: "direction",
       custom_value: true,
-      field_storage_type: "platform/text/TextDirection",
+      field_type_path: "platform/text/TextDirection",
       inherited: true,
       initial_keyword: "ltr",
-      keyword_only: true,
+      field_template: "keyword",
       keywords: ["ltr", "rtl"],
       priority: "High",
     },
@@ -481,10 +480,10 @@
     {
       name: "writing-mode",
       custom_value: true,
-      field_storage_type: "platform/text/WritingMode",
+      field_type_path: "platform/text/WritingMode",
       inherited: true,
       initial_keyword: "horizontal-tb",
-      keyword_only: true,
+      field_template: "keyword",
       keywords: ["horizontal-tb", "vertical-rl", "vertical-lr"],
       priority: "High",
       type_name: "WritingMode",
@@ -641,7 +640,7 @@
       independent: true,
       inherited: true,
       initial_keyword: "separate",
-      keyword_only: true,
+      field_template: "keyword",
       keywords: ["separate", "collapse"],
     },
     {
@@ -768,7 +767,7 @@
       // Storage for this property also covers these legacy properties:
       // page-break-after, -webkit-column-break-after
       initial_keyword: "auto",
-      keyword_only: true,
+      field_template: "keyword",
       keywords: [
         "auto", "avoid", "avoid-column", "avoid-page", "column", "left", "page", "recto", "right", "verso"
       ],
@@ -779,7 +778,7 @@
       // Storage for this property also covers these legacy properties:
       // page-break-before, -webkit-column-break-before
       initial_keyword: "auto",
-      keyword_only: true,
+      field_template: "keyword",
       keywords: [
         "auto", "avoid", "avoid-column", "avoid-page", "column", "left", "page", "recto", "right", "verso"
       ],
@@ -790,7 +789,7 @@
       // Storage for this property also covers these legacy properties:
       // page-break-inside, -webkit-column-break-inside
       initial_keyword: "auto",
-      keyword_only: true,
+      field_template: "keyword",
       keywords: ["auto", "avoid", "avoid-column", "avoid-page"],
     },
     {
@@ -802,7 +801,7 @@
       independent: true,
       inherited: true,
       initial_keyword: "top",
-      keyword_only: true,
+      field_template: "keyword",
       keywords: ["top", "bottom", "left", "right"],
     },
     {
@@ -816,7 +815,7 @@
     {
       name: "clear",
       initial_keyword: "none",
-      keyword_only: true,
+      field_template: "keyword",
       keywords: ["none", "left", "right", "both"],
     },
     {
@@ -923,7 +922,7 @@
       independent: true,
       inherited: true,
       initial_keyword: "show",
-      keyword_only: true,
+      field_template: "keyword",
       keywords: ["show", "hide"],
       type_name: "EEmptyCells",
     },
@@ -982,7 +981,7 @@
     {
       name: "float",
       initial_keyword: "none",
-      keyword_only: true,
+      field_template: "keyword",
       keywords: ["none", "left", "right"],
       name_for_methods: "Floating",
       type_name: "EFloat",
@@ -1176,14 +1175,14 @@
       independent: true,
       inherited: true,
       initial_keyword: "outside",
-      keyword_only: true,
+      field_template: "keyword",
       keywords: ["outside", "inside"],
     },
     {
       name: "list-style-type",
       inherited: true,
       initial_keyword: "disc",
-      keyword_only: true,
+      field_template: "keyword",
       keywords: [
         "disc", "circle", "square", "decimal", "decimal-leading-zero", "arabic-indic", "bengali", "cambodian", "khmer", "devanagari", "gujarati", "gurmukhi", "kannada", "lao", "malayalam", "mongolian", "myanmar", "oriya", "persian", "urdu", "telugu", "tibetan", "thai", "lower-roman", "upper-roman", "lower-greek", "lower-alpha", "lower-latin", "upper-alpha", "upper-latin", "cjk-earthly-branch", "cjk-heavenly-stem", "ethiopic-halehame", "ethiopic-halehame-am", "ethiopic-halehame-ti-er", "ethiopic-halehame-ti-et", "hangul", "hangul-consonant", "korean-hangul-formal", "korean-hanja-formal", "korean-hanja-informal", "hebrew", "armenian", "lower-armenian", "upper-armenian", "georgian", "cjk-ideographic", "simp-chinese-formal", "simp-chinese-informal", "trad-chinese-formal", "trad-chinese-informal", "hiragana", "katakana", "hiragana-iroha", "katakana-iroha", "none",
       ],
@@ -1400,7 +1399,7 @@
       runtime_flag: "ScrollAnchoring",
       inherited: false,
       initial_keyword: "auto",
-      keyword_only: true,
+      field_template: "keyword",
       keywords: [
         "visible", "none", "auto",
       ],
@@ -1412,7 +1411,7 @@
     {
       name: "overflow-x",
       initial_keyword: "visible",
-      keyword_only: true,
+      field_template: "keyword",
       keywords: [
         "visible", "hidden", "scroll", "auto", "overlay", "-webkit-paged-x", "-webkit-paged-y",
       ],
@@ -1421,7 +1420,7 @@
     {
       name: "overflow-y",
       initial_keyword: "visible",
-      keyword_only: true,
+      field_template: "keyword",
       keywords: [
         "visible", "hidden", "scroll", "auto", "overlay", "-webkit-paged-x", "-webkit-paged-y",
       ],
@@ -1483,7 +1482,7 @@
       independent: true,
       inherited: true,
       initial_keyword: "auto",
-      keyword_only: true,
+      field_template: "keyword",
       keywords: [
         "none", "auto", "stroke", "fill", "painted", "visible", "visibleStroke", "visibleFill", "visiblePainted", "bounding-box", "all",
       ],
@@ -1492,7 +1491,7 @@
       name: "position",
       custom_inherit: true,
       initial_keyword: "static",
-      keyword_only: true,
+      field_template: "keyword",
       keywords: [
         "static", "relative", "absolute", "fixed", "sticky",
       ],
@@ -1708,7 +1707,7 @@
     {
       name: "table-layout",
       initial_keyword: "auto",
-      keyword_only: true,
+      field_template: "keyword",
       keywords: [
         "auto", "fixed"
       ]
@@ -1726,7 +1725,7 @@
       custom_value: true,
       inherited: true,
       initial_keyword: "start",
-      keyword_only: true,
+      field_template: "keyword",
       keywords: [
         "left", "right", "center", "justify", "webkitLeft", "webkitRight", "webkitCenter", "start", "end",
       ],
@@ -1822,7 +1821,7 @@
       independent: true,
       inherited: true,
       initial_keyword: "none",
-      keyword_only: true,
+      field_template: "keyword",
       keywords: ["capitalize", "uppercase", "lowercase", "none"],
     },
     {
@@ -1895,9 +1894,9 @@
     },
     {
       name: "unicode-bidi",
-      field_storage_type: "platform/text/UnicodeBidi",
+      field_type_path: "platform/text/UnicodeBidi",
       initial_keyword: "normal",
-      keyword_only: true,
+      field_template: "keyword",
       keywords: [
         "normal", "embed", "bidi-override", "isolate", "plaintext", "isolate-override",
       ],
@@ -1921,7 +1920,7 @@
       inherited: true,
       initial_keyword: "visible",
       interpolable: true,
-      keyword_only: true,
+      field_template: "keyword",
       keywords: ["visible", "hidden", "collapse"],
     },
     {
@@ -1986,7 +1985,7 @@
       independent: true,
       inherited: true,
       initial_keyword: "normal",
-      keyword_only: true,
+      field_template: "keyword",
       keywords: ["normal", "reverse"],
     },
     {
@@ -2191,7 +2190,7 @@
       independent: true,
       inherited: true,
       initial_keyword: "economy",
-      keyword_only: true,
+      field_template: "keyword",
       keywords: ["economy", "exact"],
     },
     {
@@ -2200,7 +2199,7 @@
       inherited: true,
       initial: "initialRtlOrdering",
       initial_keyword: "logical",
-      keyword_only: true,
+      field_template: "keyword",
       keywords: ["logical", "visual"],
       setter: "setRtlOrdering",
       type_name: "EOrder",
@@ -2301,7 +2300,7 @@
       independent: true,
       inherited: true,
       initial_keyword: "normal",
-      keyword_only: true,
+      field_template: "keyword",
       keywords: ["normal", "pre", "pre-wrap", "pre-line", "nowrap", "-webkit-nowrap"],
     },
     {
diff --git a/third_party/WebKit/Source/modules/accessibility/AXMenuListOption.cpp b/third_party/WebKit/Source/modules/accessibility/AXMenuListOption.cpp
index db27248..c59a31d 100644
--- a/third_party/WebKit/Source/modules/accessibility/AXMenuListOption.cpp
+++ b/third_party/WebKit/Source/modules/accessibility/AXMenuListOption.cpp
@@ -26,6 +26,7 @@
 #include "modules/accessibility/AXMenuListOption.h"
 
 #include "SkMatrix44.h"
+#include "core/html/HTMLSelectElement.h"
 #include "modules/accessibility/AXMenuListPopup.h"
 #include "modules/accessibility/AXObjectCacheImpl.h"
 
@@ -38,7 +39,7 @@
     : AXMockObject(axObjectCache), m_element(element) {}
 
 AXMenuListOption::~AXMenuListOption() {
-  ASSERT(!m_element);
+  DCHECK(!m_element);
 }
 
 void AXMenuListOption::detach() {
@@ -57,6 +58,26 @@
   return MenuListOptionRole;
 }
 
+AXObject* AXMenuListOption::computeParent() const {
+  Node* node = getNode();
+  if (!node)
+    return nullptr;
+  Node* select = toHTMLOptionElement(node)->ownerSelectElement();
+  if (!select)
+    return nullptr;
+  AXObject* selectAXObject = axObjectCache().getOrCreate(select);
+  if (selectAXObject->hasChildren()) {
+    const auto& childObjects = selectAXObject->children();
+    DCHECK(!childObjects.isEmpty());
+    DCHECK_EQ(childObjects.size(), 1UL);
+    DCHECK(childObjects[0]->isMenuListPopup());
+    toAXMenuListPopup(childObjects[0].get())->updateChildrenIfNecessary();
+  } else {
+    selectAXObject->updateChildrenIfNecessary();
+  }
+  return m_parent.get();
+}
+
 Element* AXMenuListOption::actionElement() const {
   return m_element;
 }
@@ -115,12 +136,12 @@
   AXObject* parent = parentObject();
   if (!parent)
     return;
-  ASSERT(parent->isMenuListPopup());
+  DCHECK(parent->isMenuListPopup());
 
   AXObject* grandparent = parent->parentObject();
   if (!grandparent)
     return;
-  ASSERT(grandparent->isMenuList());
+  DCHECK(grandparent->isMenuList());
   grandparent->getRelativeBounds(outContainer, outBoundsInContainer,
                                  outContainerTransform);
 }
@@ -134,7 +155,7 @@
   // If nameSources is non-null, relatedObjects is used in filling it in, so it
   // must be non-null as well.
   if (nameSources)
-    ASSERT(relatedObjects);
+    DCHECK(relatedObjects);
 
   if (!getNode())
     return String();
diff --git a/third_party/WebKit/Source/modules/accessibility/AXMenuListOption.h b/third_party/WebKit/Source/modules/accessibility/AXMenuListOption.h
index 7e19f75..3bb86cc 100644
--- a/third_party/WebKit/Source/modules/accessibility/AXMenuListOption.h
+++ b/third_party/WebKit/Source/modules/accessibility/AXMenuListOption.h
@@ -54,6 +54,7 @@
   bool isDetached() const override { return !m_element; }
   AccessibilityRole roleValue() const override;
   bool canHaveChildren() const override { return false; }
+  AXObject* computeParent() const override;
 
   Element* actionElement() const override;
   bool isEnabled() const override;
diff --git a/third_party/WebKit/Source/modules/accessibility/AXMenuListPopup.h b/third_party/WebKit/Source/modules/accessibility/AXMenuListPopup.h
index c284ab0..93ec8a5 100644
--- a/third_party/WebKit/Source/modules/accessibility/AXMenuListPopup.h
+++ b/third_party/WebKit/Source/modules/accessibility/AXMenuListPopup.h
@@ -49,6 +49,7 @@
   void didShow();
   void didHide();
   AXObject* activeDescendant() final;
+  void updateChildrenIfNecessary() override;
 
  private:
   explicit AXMenuListPopup(AXObjectCacheImpl&);
@@ -60,7 +61,6 @@
   bool isVisible() const override;
   bool press() const override;
   void addChildren() override;
-  void updateChildrenIfNecessary() override;
   bool computeAccessibilityIsIgnored(IgnoredReasons* = nullptr) const override;
 
   AXMenuListOption* menuListOptionAXObject(HTMLElement*) const;
diff --git a/third_party/WebKit/Source/modules/accessibility/InspectorAccessibilityAgent.cpp b/third_party/WebKit/Source/modules/accessibility/InspectorAccessibilityAgent.cpp
index 7e91b0f..4ef4a5f 100644
--- a/third_party/WebKit/Source/modules/accessibility/InspectorAccessibilityAgent.cpp
+++ b/third_party/WebKit/Source/modules/accessibility/InspectorAccessibilityAgent.cpp
@@ -470,14 +470,13 @@
     (*nodes)->addItem(buildObjectForIgnoredNode(domNode, inspectedAXObject,
                                                 fetchRelatives.fromMaybe(true),
                                                 *nodes, *cache));
-    return Response::OK();
   } else {
     (*nodes)->addItem(
         buildProtocolAXObject(*inspectedAXObject, inspectedAXObject,
                               fetchRelatives.fromMaybe(true), *nodes, *cache));
   }
 
-  if (!inspectedAXObject)
+  if (!inspectedAXObject || !inspectedAXObject->isAXLayoutObject())
     return Response::OK();
 
   AXObject* parent = inspectedAXObject->parentObjectUnignored();
@@ -698,6 +697,19 @@
   nodeObject.setChildIds(std::move(childIds));
 }
 
+void InspectorAccessibilityAgent::addChild(
+    std::unique_ptr<protocol::Array<AXNodeId>>& childIds,
+    AXObject& childAXObject,
+    AXObject* inspectedAXObject,
+    std::unique_ptr<protocol::Array<AXNode>>& nodes,
+    AXObjectCacheImpl& cache) const {
+  childIds->addItem(String::number(childAXObject.axObjectID()));
+  if (&childAXObject == inspectedAXObject)
+    return;
+  nodes->addItem(buildProtocolAXObject(childAXObject, inspectedAXObject, true,
+                                       nodes, cache));
+}
+
 void InspectorAccessibilityAgent::addChildren(
     AXObject& axObject,
     AXObject* inspectedAXObject,
@@ -716,14 +728,14 @@
     childIds->addItem(String::number(childAXObject.axObjectID()));
     if (&childAXObject == inspectedAXObject)
       continue;
-    if (&axObject != inspectedAXObject &&
-        (axObject.getNode() ||
-         axObject.parentObjectUnignored() != inspectedAXObject)) {
-      continue;
+    if (&axObject != inspectedAXObject) {
+      if (!inspectedAXObject)
+        continue;
+      if (&axObject != inspectedAXObject->parentObjectUnignored())
+        continue;
     }
 
-    // Only add children of inspected node (or un-inspectable children of
-    // inspected node) to returned nodes.
+    // Only add children/siblings of inspected node to returned nodes.
     std::unique_ptr<AXNode> childNode = buildProtocolAXObject(
         childAXObject, inspectedAXObject, true, nodes, cache);
     nodes->addItem(std::move(childNode));
diff --git a/third_party/WebKit/Source/modules/accessibility/InspectorAccessibilityAgent.h b/third_party/WebKit/Source/modules/accessibility/InspectorAccessibilityAgent.h
index 3ed5d138..9965532 100644
--- a/third_party/WebKit/Source/modules/accessibility/InspectorAccessibilityAgent.h
+++ b/third_party/WebKit/Source/modules/accessibility/InspectorAccessibilityAgent.h
@@ -74,6 +74,11 @@
       AXObject* inspectedAXObject,
       std::unique_ptr<protocol::Array<AXNode>>& nodes,
       AXObjectCacheImpl&) const;
+  void addChild(std::unique_ptr<protocol::Array<AXNodeId>>& childIds,
+                AXObject& childAXObject,
+                AXObject* inspectedAXObject,
+                std::unique_ptr<protocol::Array<AXNode>>& nodes,
+                AXObjectCacheImpl&) const;
   void addChildren(AXObject&,
                    AXObject* inspectedAXObject,
                    std::unique_ptr<protocol::Array<AXNodeId>>& childIds,
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/common/net/buildbot.py b/third_party/WebKit/Tools/Scripts/webkitpy/common/net/buildbot.py
index bab2b1c..b83c2f3 100644
--- a/third_party/WebKit/Tools/Scripts/webkitpy/common/net/buildbot.py
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/common/net/buildbot.py
@@ -130,3 +130,23 @@
     if not (master_name and builder_name and build_number):
         return None
     return 'https://build.chromium.org/p/%s/builders/%s/builds/%s' % (master_name, builder_name, build_number)
+
+
+def filter_latest_builds(builds):
+    """Filters Build objects to include only the latest for each builder.
+
+    Args:
+        builds: A collection of Build objects.
+
+    Returns:
+        A list of Build objects; only one Build object per builder name. If
+        there are only Builds with no build number, then one is kept; if there
+        are Builds with build numbers, then the one with the highest build
+        number is kept.
+    """
+    latest_builds = {}
+    for build in builds:
+        builder = build.builder_name
+        if builder not in latest_builds or build.build_number > latest_builds[builder].build_number:
+            latest_builds[builder] = build
+    return sorted(latest_builds.values())
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/common/net/buildbot_unittest.py b/third_party/WebKit/Tools/Scripts/webkitpy/common/net/buildbot_unittest.py
index 13ec00c..a98e89d 100644
--- a/third_party/WebKit/Tools/Scripts/webkitpy/common/net/buildbot_unittest.py
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/common/net/buildbot_unittest.py
@@ -28,7 +28,7 @@
 
 import unittest
 
-from webkitpy.common.net.buildbot import BuildBot
+from webkitpy.common.net.buildbot import BuildBot, Build, filter_latest_builds
 
 
 class BuilderTest(unittest.TestCase):
@@ -57,3 +57,24 @@
         buildbot = BuildBot()
         buildbot._fetch_file = lambda: None  # pylint: disable=protected-access
         self.assertIsNone(buildbot.fetch_layout_test_results(buildbot.results_url('Builder')))
+
+
+class BuildBotHelperFunctionTest(unittest.TestCase):
+
+    def test_filter_latest_jobs_empty(self):
+        self.assertEqual(filter_latest_builds([]), [])
+
+    def test_filter_latest_jobs_higher_build_first(self):
+        self.assertEqual(
+            filter_latest_builds([Build('foo', 5), Build('foo', 3), Build('bar', 5)]),
+            [Build('bar', 5), Build('foo', 5)])
+
+    def test_filter_latest_jobs_higher_build_last(self):
+        self.assertEqual(
+            filter_latest_builds([Build('foo', 3), Build('bar', 5), Build('foo', 5)]),
+            [Build('bar', 5), Build('foo', 5)])
+
+    def test_filter_latest_jobs_no_build_number(self):
+        self.assertEqual(
+            filter_latest_builds([Build('foo', 3), Build('bar'), Build('bar')]),
+            [Build('bar'), Build('foo', 3)])
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/common/net/git_cl.py b/third_party/WebKit/Tools/Scripts/webkitpy/common/net/git_cl.py
index a47a9381..0dce4c6 100644
--- a/third_party/WebKit/Tools/Scripts/webkitpy/common/net/git_cl.py
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/common/net/git_cl.py
@@ -10,6 +10,9 @@
 
 import json
 import logging
+import re
+
+from webkitpy.common.net.buildbot import Build, filter_latest_builds
 
 _log = logging.getLogger(__name__)
 
@@ -18,6 +21,7 @@
     'presubmit', 'set-close', 'set-commit', 'status', 'try-results', 'try', 'upload',
 )
 
+
 class GitCL(object):
 
     def __init__(self, host, auth_refresh_token_json=None, cwd=None):
@@ -59,8 +63,15 @@
         self._host.print_('Timed out waiting for try results.')
         return None
 
+    def latest_try_jobs(self, builder_names=None):
+        """Returns a list of Builds for the latest jobs for the given builders."""
+        try_results = self.fetch_try_results()
+        if builder_names:
+            try_results = [r for r in try_results if r['builder_name'] in builder_names]
+        return filter_latest_builds(self._try_result_to_build(r) for r in try_results)
+
     def fetch_try_results(self):
-        """Requests results of try jobs for the current CL."""
+        """Requests results f try jobs for the current CL."""
         with self._host.filesystem.mkdtemp() as temp_directory:
             results_path = self._host.filesystem.join(temp_directory, 'try-results.json')
             self.run(['try-results', '--json', results_path])
@@ -70,6 +81,18 @@
         return json.loads(contents)
 
     @staticmethod
+    def _try_result_to_build(try_result):
+        """Converts a parsed try result dict to a Build object."""
+        builder_name = try_result['builder_name']
+        url = try_result['url']
+        if url is None:
+            return Build(builder_name, None)
+        match = re.match(r'.*/builds/(\d+)?$', url)
+        build_number = match.group(1)
+        assert build_number and build_number.isdigit()
+        return Build(builder_name, int(build_number))
+
+    @staticmethod
     def all_jobs_finished(try_results):
         return all(r.get('status') == 'COMPLETED' for r in try_results)
 
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/common/net/git_cl_unittest.py b/third_party/WebKit/Tools/Scripts/webkitpy/common/net/git_cl_unittest.py
index 7c47ebc..c67909e 100644
--- a/third_party/WebKit/Tools/Scripts/webkitpy/common/net/git_cl_unittest.py
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/common/net/git_cl_unittest.py
@@ -4,9 +4,10 @@
 
 import unittest
 
+from webkitpy.common.host_mock import MockHost
+from webkitpy.common.net.buildbot import Build
 from webkitpy.common.net.git_cl import GitCL
 from webkitpy.common.system.executive_mock import MockExecutive
-from webkitpy.common.host_mock import MockHost
 
 
 class GitCLTest(unittest.TestCase):
@@ -94,11 +95,13 @@
                 'builder_name': 'some-builder',
                 'status': 'COMPLETED',
                 'result': 'FAILURE',
+                'url': 'http://build.chromium.org/p/master/builders/some-builder/builds/90',
             },
             {
                 'builder_name': 'some-builder',
                 'status': 'STARTED',
                 'result': None,
+                'url': 'http://build.chromium.org/p/master/builders/some-builder/builds/100',
             },
         ]))
 
@@ -108,11 +111,13 @@
                 'builder_name': 'some-builder',
                 'status': 'COMPLETED',
                 'result': 'FAILURE',
+                'url': 'http://build.chromium.org/p/master/builders/some-builder/builds/90',
             },
             {
                 'builder_name': 'some-builder',
                 'status': 'COMPLETED',
                 'result': 'SUCCESS',
+                'url': 'http://build.chromium.org/p/master/builders/some-builder/builds/100',
             },
         ]))
 
@@ -125,11 +130,13 @@
                 'builder_name': 'some-builder',
                 'status': 'COMPLETED',
                 'result': 'SUCCESS',
+                'url': 'http://build.chromium.org/p/master/builders/some-builder/builds/90',
             },
             {
                 'builder_name': 'some-builder',
                 'status': 'STARTED',
                 'result': None,
+                'url': 'http://build.chromium.org/p/master/builders/some-builder/builds/100',
             },
         ]))
 
@@ -141,3 +148,35 @@
                 'result': 'FAILURE',
             },
         ]))
+
+    def test_latest_try_builds(self):
+        git_cl = GitCL(MockHost())
+        git_cl.fetch_try_results = lambda: [
+            {
+                'builder_name': 'builder-b',
+                'status': 'COMPLETED',
+                'result': 'SUCCESS',
+                'url': 'http://build.chromium.org/p/master/builders/some-builder/builds/100',
+            },
+            {
+                'builder_name': 'builder-b',
+                'status': 'COMPLETED',
+                'result': 'SUCCESS',
+                'url': 'http://build.chromium.org/p/master/builders/some-builder/builds/90',
+            },
+            {
+                'builder_name': 'builder-a',
+                'status': 'SCHEDULED',
+                'result': None,
+                'url': None,
+            },
+            {
+                'builder_name': 'builder-c',
+                'status': 'COMPLETED',
+                'result': 'SUCCESS',
+                'url': 'http://build.chromium.org/p/master/builders/some-builder/builds/123',
+            },
+        ]
+        self.assertEqual(
+            git_cl.latest_try_jobs(['builder-a', 'builder-b']),
+            [Build('builder-a'), Build('builder-b', 100)])
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/common/net/rietveld.py b/third_party/WebKit/Tools/Scripts/webkitpy/common/net/rietveld.py
index abc9c5d6..c1438fa 100644
--- a/third_party/WebKit/Tools/Scripts/webkitpy/common/net/rietveld.py
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/common/net/rietveld.py
@@ -8,7 +8,7 @@
 import logging
 import urllib2
 
-from webkitpy.common.net.buildbot import Build
+from webkitpy.common.net.buildbot import Build, filter_latest_builds
 
 _log = logging.getLogger(__name__)
 
@@ -55,26 +55,7 @@
         if builder_names is not None:
             builds = [b for b in builds if b.builder_name in builder_names]
 
-        return self._filter_latest_builds(builds)
-
-    def _filter_latest_builds(self, builds):
-        """Filters out a collection of Build objects to include only the latest for each builder.
-
-        Args:
-            jobs: A list of Build objects.
-
-        Returns:
-            A list of Build objects; only one Build object per builder name. If there are only
-            Builds with no build number, then one is kept; if there are Builds with build numbers,
-            then the one with the highest build number is kept.
-        """
-        builder_to_latest_build = {}
-        for build in builds:
-            if build.builder_name not in builder_to_latest_build:
-                builder_to_latest_build[build.builder_name] = build
-            elif build.build_number > builder_to_latest_build[build.builder_name].build_number:
-                builder_to_latest_build[build.builder_name] = build
-        return sorted(builder_to_latest_build.values())
+        return filter_latest_builds(builds)
 
     def changed_files(self, issue_number):
         """Lists the files included in a CL that are changed but not deleted.
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/common/net/rietveld_unittest.py b/third_party/WebKit/Tools/Scripts/webkitpy/common/net/rietveld_unittest.py
index 2755169..8f39a5b 100644
--- a/third_party/WebKit/Tools/Scripts/webkitpy/common/net/rietveld_unittest.py
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/common/net/rietveld_unittest.py
@@ -93,27 +93,3 @@
     def test_changed_files_no_results(self):
         rietveld = Rietveld(self.mock_web())
         self.assertIsNone(rietveld.changed_files(11113333))
-
-    # Testing protected methods - pylint: disable=protected-access
-
-    def test_filter_latest_jobs_empty(self):
-        rietveld = Rietveld(self.mock_web())
-        self.assertEqual(rietveld._filter_latest_builds([]), [])
-
-    def test_filter_latest_jobs_higher_build_first(self):
-        rietveld = Rietveld(self.mock_web())
-        self.assertEqual(
-            rietveld._filter_latest_builds([Build('foo', 5), Build('foo', 3), Build('bar', 5)]),
-            [Build('bar', 5), Build('foo', 5)])
-
-    def test_filter_latest_jobs_higher_build_last(self):
-        rietveld = Rietveld(self.mock_web())
-        self.assertEqual(
-            rietveld._filter_latest_builds([Build('foo', 3), Build('bar', 5), Build('foo', 5)]),
-            [Build('bar', 5), Build('foo', 5)])
-
-    def test_filter_latest_jobs_no_build_number(self):
-        rietveld = Rietveld(self.mock_web())
-        self.assertEqual(
-            rietveld._filter_latest_builds([Build('foo', 3), Build('bar'), Build('bar')]),
-            [Build('bar'), Build('foo', 3)])
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/rebaseline_cl.py b/third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/rebaseline_cl.py
index 8a1401aa..e536cea 100644
--- a/third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/rebaseline_cl.py
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/rebaseline_cl.py
@@ -64,9 +64,11 @@
         if not issue_number:
             return 1
 
-        # TODO(qyearsley): Replace this with git cl try-results to remove
-        # dependency on Rietveld. See crbug.com/671684.
-        builds = self.rietveld.latest_try_jobs(issue_number, self._try_bots())
+        # TODO(qyearsley): Remove dependency on Rietveld. See crbug.com/671684.
+        if options.issue:
+            builds = self.rietveld.latest_try_jobs(issue_number, self._try_bots())
+        else:
+            builds = self.git_cl().latest_try_jobs(self._try_bots())
 
         if options.trigger_jobs:
             if self.trigger_jobs_for_missing_builds(builds):
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/rebaseline_cl_unittest.py b/third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/rebaseline_cl_unittest.py
index 6c9b3d7..df60e54 100644
--- a/third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/rebaseline_cl_unittest.py
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/rebaseline_cl_unittest.py
@@ -176,6 +176,7 @@
     def test_execute_with_issue_number_from_branch(self):
         git_cl = GitCL(self.tool)
         git_cl.get_issue_number = lambda: '11112222'
+        git_cl.latest_try_jobs = lambda _: [Build('MOCK Try Win', 5000)]
         self.command.git_cl = lambda: git_cl
         return_code = self.command.execute(self.command_options(), [], self.tool)
         self.assertEqual(return_code, 0)
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/w3c/wpt_expectations_updater.py b/third_party/WebKit/Tools/Scripts/webkitpy/w3c/wpt_expectations_updater.py
index 9d1c26a..c495301 100644
--- a/third_party/WebKit/Tools/Scripts/webkitpy/w3c/wpt_expectations_updater.py
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/w3c/wpt_expectations_updater.py
@@ -250,7 +250,7 @@
             ['BUG_URL [PLATFORM(S)] TEST_NAME [EXPECTATION(S)]']
         """
         line_list = []
-        for test_name, port_results in merged_results.iteritems():
+        for test_name, port_results in sorted(merged_results.iteritems()):
             for port_names in sorted(port_results):
                 if test_name.startswith('external'):
                     line_parts = [port_results[port_names]['bug']]
@@ -333,7 +333,7 @@
             if version_specifiers.issubset(specifiers):
                 specifiers -= version_specifiers
                 specifiers.add(macro_specifier)
-        if specifiers == set(configuration_specifier_macros):
+        if specifiers == {macro.lower() for macro in configuration_specifier_macros.keys()}:
             return []
         return sorted(specifier.capitalize() for specifier in specifiers)
 
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/w3c/wpt_expectations_updater_unittest.py b/third_party/WebKit/Tools/Scripts/webkitpy/w3c/wpt_expectations_updater_unittest.py
index b859ae1..80e88220 100644
--- a/third_party/WebKit/Tools/Scripts/webkitpy/w3c/wpt_expectations_updater_unittest.py
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/w3c/wpt_expectations_updater_unittest.py
@@ -150,21 +150,24 @@
         self.assertEqual(updater.create_line_list(results), [])
 
     def test_create_line_list_new_tests(self):
-        # In this example, there are unexpected non-fail results in w3c tests.
+        # In this example, there are three unexpected results. The new
+        # test expectation lines are sorted by test, and then specifier.
         updater = WPTExpectationsUpdater(self.mock_host())
         results = {
+            'external/fake/test/zzzz.html': {
+                'test-mac-mac10.10': {'expected': 'PASS', 'actual': 'FAIL', 'bug': 'crbug.com/test'},
+            },
             'external/fake/test/path.html': {
                 'test-linux-trusty': {'expected': 'FAIL', 'actual': 'PASS', 'bug': 'crbug.com/test'},
-                'test-mac-mac10.10': {'expected': 'FAIL', 'actual': 'PASS', 'bug': 'crbug.com/test'},
                 'test-mac-mac10.11': {'expected': 'FAIL', 'actual': 'TIMEOUT', 'bug': 'crbug.com/test'},
-            }
+            },
         }
         self.assertEqual(
             updater.create_line_list(results),
             [
                 'crbug.com/test [ Linux ] external/fake/test/path.html [ Pass ]',
-                'crbug.com/test [ Mac10.10 ] external/fake/test/path.html [ Pass ]',
                 'crbug.com/test [ Mac10.11 ] external/fake/test/path.html [ Timeout ]',
+                'crbug.com/test [ Mac10.10 ] external/fake/test/zzzz.html [ Failure ]',
             ])
 
     def test_specifier_part(self):
@@ -183,13 +186,14 @@
         macros = {
             'mac': ['Mac10.10', 'mac10.11'],
             'win': ['Win7', 'win10'],
-            'linux': ['Trusty'],
+            'Linux': ['TRUSTY'],
         }
         self.assertEqual(WPTExpectationsUpdater.simplify_specifiers(['mac10.10', 'mac10.11'], macros), ['Mac'])
         self.assertEqual(WPTExpectationsUpdater.simplify_specifiers(['Mac10.10', 'Mac10.11', 'Trusty'], macros), ['Linux', 'Mac'])
         self.assertEqual(
             WPTExpectationsUpdater.simplify_specifiers(['Mac10.10', 'Mac10.11', 'Trusty', 'Win7', 'Win10'], macros), [])
         self.assertEqual(WPTExpectationsUpdater.simplify_specifiers(['a', 'b', 'c'], {}), ['A', 'B', 'C'])
+        self.assertEqual(WPTExpectationsUpdater.simplify_specifiers(['Mac', 'Win', 'Linux'], macros), [])
 
     def test_merge_dicts_with_conflict_raise_exception(self):
         updater = WPTExpectationsUpdater(self.mock_host())
diff --git a/ui/views/widget/widget.cc b/ui/views/widget/widget.cc
index 7e9fdb64..6b0ecae 100644
--- a/ui/views/widget/widget.cc
+++ b/ui/views/widget/widget.cc
@@ -1309,10 +1309,13 @@
   }
   if (v) {
     v->RequestFocus();
-    // If the request for focus was unsuccessful, fall back to using the first
+    // If the Widget is active (thus allowing its child Views to receive focus),
+    // but the request for focus was unsuccessful, fall back to using the first
     // focusable View instead.
-    if (focus_manager && focus_manager->GetFocusedView() == nullptr)
+    if (focus_manager && focus_manager->GetFocusedView() == nullptr &&
+        IsActive()) {
       focus_manager->AdvanceFocus(false);
+    }
   }
   return !!focus_manager->GetFocusedView();
 }
diff --git a/ui/views/window/dialog_delegate_unittest.cc b/ui/views/window/dialog_delegate_unittest.cc
index bf2a32e..d11cfddd 100644
--- a/ui/views/window/dialog_delegate_unittest.cc
+++ b/ui/views/window/dialog_delegate_unittest.cc
@@ -277,6 +277,44 @@
   EXPECT_EQ(dialog()->input(), dialog()->GetFocusManager()->GetFocusedView());
 }
 
+// A dialog for testing initial focus with only an OK button.
+class InitialFocusTestDialog : public DialogDelegateView {
+ public:
+  InitialFocusTestDialog() {}
+  ~InitialFocusTestDialog() override {}
+
+  views::View* OkButton() { return GetDialogClientView()->ok_button(); }
+
+  // DialogDelegateView overrides:
+  int GetDialogButtons() const override { return ui::DIALOG_BUTTON_OK; }
+
+ private:
+  DISALLOW_COPY_AND_ASSIGN(InitialFocusTestDialog);
+};
+
+// If the Widget can't be activated while the initial focus View is requesting
+// focus, test it is still able to receive focus once the Widget is activated.
+TEST_F(DialogTest, InitialFocusWithDeactivatedWidget) {
+  InitialFocusTestDialog* dialog = new InitialFocusTestDialog();
+  Widget* dialog_widget =
+      DialogDelegate::CreateDialogWidget(dialog, GetContext(), nullptr);
+  // Set the initial focus while the Widget is unactivated to prevent the
+  // initially focused View from receiving focus. Use a minimised state here to
+  // prevent the Widget from being activated while this happens.
+  dialog_widget->SetInitialFocus(ui::WindowShowState::SHOW_STATE_MINIMIZED);
+
+  // Nothing should be focused, because the Widget is still deactivated.
+  EXPECT_EQ(nullptr, dialog_widget->GetFocusManager()->GetFocusedView());
+  EXPECT_EQ(dialog->OkButton(),
+            dialog_widget->GetFocusManager()->GetStoredFocusView());
+  dialog_widget->Show();
+  // After activation, the initially focused View should have focus as intended.
+  EXPECT_EQ(dialog->OkButton(),
+            dialog_widget->GetFocusManager()->GetFocusedView());
+  EXPECT_TRUE(dialog->OkButton()->HasFocus());
+  dialog_widget->CloseNow();
+}
+
 // If the initially focused View provided is unfocusable, check the next
 // available focusable View is focused.
 TEST_F(DialogTest, UnfocusableInitialFocus) {
@@ -308,7 +346,7 @@
   dialog_widget->Show();
   EXPECT_TRUE(textfield->HasFocus());
   EXPECT_EQ(textfield, dialog->GetFocusManager()->GetFocusedView());
-  dialog_widget->Close();
+  dialog_widget->CloseNow();
 }
 
 }  // namespace views