diff --git a/chrome/browser/chromeos/file_manager/file_manager_browsertest.cc b/chrome/browser/chromeos/file_manager/file_manager_browsertest.cc
index 31d00e9..e8e378db 100644
--- a/chrome/browser/chromeos/file_manager/file_manager_browsertest.cc
+++ b/chrome/browser/chromeos/file_manager/file_manager_browsertest.cc
@@ -366,8 +366,9 @@
 #else
 #define MAYBE_ExecuteDefaultTaskOnDrive ExecuteDefaultTaskOnDrive
 #endif
+// Flaky: crbug.com/699978
 WRAPPED_INSTANTIATE_TEST_CASE_P(
-    MAYBE_ExecuteDefaultTaskOnDrive,
+    DISABLED_ExecuteDefaultTaskOnDrive,
     FileManagerBrowserTest,
     ::testing::Values(TestParameter(NOT_IN_GUEST_MODE,
                                     "executeDefaultTaskOnDrive")));
diff --git a/chrome/browser/search_engines/template_url_service_sync_unittest.cc b/chrome/browser/search_engines/template_url_service_sync_unittest.cc
index 016e962..6568303 100644
--- a/chrome/browser/search_engines/template_url_service_sync_unittest.cc
+++ b/chrome/browser/search_engines/template_url_service_sync_unittest.cc
@@ -444,10 +444,7 @@
       GenerateDummyTemplateURLData("extension");
   auto ext_dse = base::MakeUnique<TemplateURL>(
       *extension, TemplateURL::NORMAL_CONTROLLED_BY_EXTENSION);
-  auto ext_info = base::MakeUnique<TemplateURL::AssociatedExtensionInfo>("ext");
-  ext_info->wants_to_be_default_engine = true;
-  test_util_a_->AddExtensionControlledTURL(std::move(ext_dse),
-                                           std::move(ext_info));
+  test_util_a_->AddExtensionControlledTURL(std::move(ext_dse), "ext", true);
 
   const TemplateURL* ext_turl = model()->GetDefaultSearchProvider();
   EXPECT_TRUE(model()->IsExtensionControlledDefaultSearch());
@@ -1764,10 +1761,7 @@
       GenerateDummyTemplateURLData("extensiondefault");
   auto ext_dse = base::MakeUnique<TemplateURL>(
       *extension, TemplateURL::NORMAL_CONTROLLED_BY_EXTENSION);
-  auto ext_info = base::MakeUnique<TemplateURL::AssociatedExtensionInfo>("ext");
-  ext_info->wants_to_be_default_engine = true;
-  test_util_a_->AddExtensionControlledTURL(std::move(ext_dse),
-                                           std::move(ext_info));
+  test_util_a_->AddExtensionControlledTURL(std::move(ext_dse), "ext", true);
 
   const TemplateURL* dsp_turl = model()->GetDefaultSearchProvider();
   EXPECT_TRUE(model()->IsExtensionControlledDefaultSearch());
@@ -1819,10 +1813,8 @@
       GenerateDummyTemplateURLData("common_keyword");
   auto ext_dse = base::MakeUnique<TemplateURL>(
       *extension, TemplateURL::NORMAL_CONTROLLED_BY_EXTENSION);
-  auto ext_info = base::MakeUnique<TemplateURL::AssociatedExtensionInfo>("ext");
-  ext_info->wants_to_be_default_engine = true;
-  const TemplateURL* extension_turl = test_util_a_->AddExtensionControlledTURL(
-      std::move(ext_dse), std::move(ext_info));
+  const TemplateURL* extension_turl =
+      test_util_a_->AddExtensionControlledTURL(std::move(ext_dse), "ext", true);
   EXPECT_TRUE(model()->IsExtensionControlledDefaultSearch());
   EXPECT_EQ(extension_turl, model()->GetTemplateURLForKeyword(kCommonKeyword));
 
diff --git a/chrome/browser/search_engines/template_url_service_test_util.cc b/chrome/browser/search_engines/template_url_service_test_util.cc
index ea4971a9..37f6429 100644
--- a/chrome/browser/search_engines/template_url_service_test_util.cc
+++ b/chrome/browser/search_engines/template_url_service_test_util.cc
@@ -158,10 +158,16 @@
 
 TemplateURL* TemplateURLServiceTestUtil::AddExtensionControlledTURL(
     std::unique_ptr<TemplateURL> extension_turl,
-    std::unique_ptr<TemplateURL::AssociatedExtensionInfo> info) {
-  bool wants_to_be_default = info->wants_to_be_default_engine;
+    const std::string& extension_id,
+    bool wants_to_be_default,
+    base::Time install_time) {
+  auto extension_info =
+      base::MakeUnique<TemplateURL::AssociatedExtensionInfo>(extension_id);
+  extension_info->wants_to_be_default_engine = wants_to_be_default;
+  extension_info->install_time = install_time;
+
   TemplateURL* result = model()->AddExtensionControlledTURL(
-      std::move(extension_turl), std::move(info));
+      std::move(extension_turl), std::move(extension_info));
   if (wants_to_be_default && result) {
     SetExtensionDefaultSearchInPrefs(profile()->GetTestingPrefService(),
                                      result->data());
diff --git a/chrome/browser/search_engines/template_url_service_test_util.h b/chrome/browser/search_engines/template_url_service_test_util.h
index 6dc86c99..072478a 100644
--- a/chrome/browser/search_engines/template_url_service_test_util.h
+++ b/chrome/browser/search_engines/template_url_service_test_util.h
@@ -71,7 +71,9 @@
   // be default.
   TemplateURL* AddExtensionControlledTURL(
       std::unique_ptr<TemplateURL> extension_turl,
-      std::unique_ptr<TemplateURL::AssociatedExtensionInfo> info);
+      const std::string& extension_id,
+      bool wants_to_be_default,
+      base::Time install_time = base::Time());
 
   // Removes a TemplateURL controlled by |extension_id| from the model, and,
   // if necessary, from the extension-controlled default search preference.
diff --git a/chrome/browser/search_engines/template_url_service_unittest.cc b/chrome/browser/search_engines/template_url_service_unittest.cc
index 77dd088..a255503 100644
--- a/chrome/browser/search_engines/template_url_service_unittest.cc
+++ b/chrome/browser/search_engines/template_url_service_unittest.cc
@@ -78,10 +78,10 @@
     const std::string& favicon_url,
     bool safe_for_autoreplace,
     int prepopulate_id,
-    const std::string& encodings,
-    Time date_created,
-    Time last_modified,
-    Time last_visited,
+    const std::string& encodings = "UTF-8",
+    Time date_created = Time(),
+    Time last_modified = Time(),
+    Time last_visited = Time(),
     TemplateURL::Type type = TemplateURL::NORMAL) {
   TemplateURLData data;
   data.SetShortName(base::UTF8ToUTF16(short_name));
@@ -126,16 +126,7 @@
 void ExpectSimilar(const TemplateURL* expected, const TemplateURL* actual) {
   ASSERT_TRUE(expected != NULL);
   ASSERT_TRUE(actual != NULL);
-  EXPECT_EQ(expected->short_name(), actual->short_name());
-  EXPECT_EQ(expected->keyword(), actual->keyword());
-  EXPECT_EQ(expected->url(), actual->url());
-  EXPECT_EQ(expected->suggestions_url(), actual->suggestions_url());
-  EXPECT_EQ(expected->favicon_url(), actual->favicon_url());
-  EXPECT_EQ(expected->alternate_urls(), actual->alternate_urls());
-  EXPECT_EQ(expected->safe_for_autoreplace(), actual->safe_for_autoreplace());
-  EXPECT_EQ(expected->input_encodings(), actual->input_encodings());
-  EXPECT_EQ(expected->search_terms_replacement_key(),
-            actual->search_terms_replacement_key());
+  ExpectSimilar(&expected->data(), &actual->data());
 }
 
 std::unique_ptr<TemplateURLData> CreateTestSearchEngine() {
@@ -180,14 +171,14 @@
   TemplateURL* AddExtensionSearchEngine(const std::string& keyword,
                                         const std::string& extension_name,
                                         bool wants_to_be_default_engine,
-                                        const base::Time& install_time);
+                                        const Time& install_time = Time());
 
   // Verifies the two TemplateURLs are equal.
   void AssertEquals(const TemplateURL& expected, const TemplateURL& actual);
 
   // Verifies the two timestamps are equal, within the expected degree of
   // precision.
-  void AssertTimesEqual(const base::Time& expected, const base::Time& actual);
+  void AssertTimesEqual(const Time& expected, const Time& actual);
 
   // Create an URL that appears to have been prepopulated, but won't be in the
   // current data.
@@ -263,20 +254,16 @@
     const std::string& keyword,
     const std::string& extension_name,
     bool wants_to_be_default_engine,
-    const base::Time& install_time) {
+    const Time& install_time) {
   std::unique_ptr<TemplateURLData> turl_data =
       GenerateDummyTemplateURLData(keyword);
   turl_data->safe_for_autoreplace = false;
 
   auto ext_dse = base::MakeUnique<TemplateURL>(
       *turl_data, TemplateURL::NORMAL_CONTROLLED_BY_EXTENSION);
-  auto extension_info =
-      base::MakeUnique<TemplateURL::AssociatedExtensionInfo>(extension_name);
-  extension_info->wants_to_be_default_engine = wants_to_be_default_engine;
-  extension_info->install_time = install_time;
-
-  return test_util()->AddExtensionControlledTURL(std::move(ext_dse),
-                                                 std::move(extension_info));
+  return test_util()->AddExtensionControlledTURL(
+      std::move(ext_dse), extension_name, wants_to_be_default_engine,
+      install_time);
 }
 
 void TemplateURLServiceTest::AssertEquals(const TemplateURL& expected,
@@ -299,12 +286,12 @@
             actual.search_terms_replacement_key());
 }
 
-void TemplateURLServiceTest::AssertTimesEqual(const base::Time& expected,
-                                              const base::Time& actual) {
+void TemplateURLServiceTest::AssertTimesEqual(const Time& expected,
+                                              const Time& actual) {
   // Because times are stored with a granularity of one second, there is a loss
   // of precision when serializing and deserializing the timestamps. Hence, only
   // expect timestamps to be equal to within one second of one another.
-  ASSERT_LT((expected - actual).magnitude(), base::TimeDelta::FromSeconds(1));
+  ASSERT_LT((expected - actual).magnitude(), TimeDelta::FromSeconds(1));
 }
 
 std::unique_ptr<TemplateURL> TemplateURLServiceTest::CreatePreloadedTemplateURL(
@@ -404,7 +391,7 @@
 
   // We expect the last_modified time to be updated to the present time on an
   // explicit reset.
-  base::Time now = base::Time::Now();
+  Time now = Time::Now();
   std::unique_ptr<base::SimpleTestClock> clock(new base::SimpleTestClock);
   clock->SetNow(now);
   model()->set_clock(std::move(clock));
@@ -443,8 +430,7 @@
   test_util()->VerifyLoad();
 
   AddKeywordWithDate("first", "keyword", "http://test1", std::string(),
-                     std::string(), std::string(), true, "UTF-8", Time(),
-                     Time(), Time());
+                     std::string(), std::string(), true);
   VerifyObserverCount(1);
 
   // Test what happens when we try to add a TemplateURL with the same keyword as
@@ -494,11 +480,9 @@
   test_util()->VerifyLoad();
 
   AddKeywordWithDate("replaceable", "keyword1", "http://test1", std::string(),
-                     std::string(), std::string(), true, "UTF-8", Time(),
-                     Time(), Time());
+                     std::string(), std::string(), true);
   AddKeywordWithDate("nonreplaceable", "keyword2", "http://test2",
-                     std::string(), std::string(), std::string(), false,
-                     "UTF-8", Time(), Time(), Time());
+                     std::string(), std::string(), std::string(), false);
   model()->RegisterOmniboxKeyword("test3", "extension", "keyword3",
                                   "http://test3", Time::FromDoubleT(1));
   TemplateURL* original3 =
@@ -546,8 +530,7 @@
   ASSERT_TRUE(extension);
   // Adding a keyword that matches the extension.
   AddKeywordWithDate("replaceable", "keyword", "http://test1", std::string(),
-                     std::string(), std::string(), true, "UTF-8", Time(),
-                     Time(), Time());
+                     std::string(), std::string(), true);
 
   // Adding another replaceable keyword should remove the existing one, but
   // leave the extension as is.
@@ -732,7 +715,7 @@
   VerifyObserverCount(1);
   base::RunLoop().RunUntilIdle();
 
-  base::Time now = base::Time::Now();
+  Time now = Time::Now();
   std::unique_ptr<base::SimpleTestClock> clock(new base::SimpleTestClock);
   clock->SetNow(now);
   model()->set_clock(std::move(clock));
@@ -767,10 +750,9 @@
   // Add a new TemplateURL.
   test_util()->VerifyLoad();
   const size_t initial_count = model()->GetTemplateURLs().size();
-  TemplateURL* t_url =
-      AddKeywordWithDate("name1", "key1", "http://foo1/{searchTerms}",
-                         "http://sugg1", std::string(), "http://icon1", true,
-                         "UTF-8;UTF-16", Time(), Time(), Time());
+  TemplateURL* t_url = AddKeywordWithDate(
+      "name1", "key1", "http://foo1/{searchTerms}", "http://sugg1",
+      std::string(), "http://icon1", true, "UTF-8;UTF-16");
   test_util()->ResetObserverCount();
 
   model()->SetUserSelectedDefaultSearchProvider(t_url);
@@ -796,9 +778,9 @@
   test_util()->ChangeModelToLoadState();
   ASSERT_TRUE(model()->CanAddAutogeneratedKeyword(ASCIIToUTF16("foo"), GURL(),
                                                   NULL));
-  TemplateURL* t_url = AddKeywordWithDate(
-      "name1", "foo", "http://foo1", "http://sugg1", std::string(),
-      "http://icon1", true, "UTF-8;UTF-16", Time(), Time(), Time());
+  TemplateURL* t_url =
+      AddKeywordWithDate("name1", "foo", "http://foo1", "http://sugg1",
+                         std::string(), "http://icon1", true, "UTF-8;UTF-16");
 
   // Can still replace, newly added template url is marked safe to replace.
   ASSERT_TRUE(model()->CanAddAutogeneratedKeyword(ASCIIToUTF16("foo"),
@@ -817,9 +799,9 @@
   test_util()->ChangeModelToLoadState();
   ASSERT_TRUE(model()->CanAddAutogeneratedKeyword(ASCIIToUTF16("foo"),
                                          GURL("http://foo.com"), NULL));
-  TemplateURL* t_url = AddKeywordWithDate(
-      "name1", "foo", "http://foo.com", "http://sugg1", std::string(),
-      "http://icon1", true, "UTF-8;UTF-16", Time(), Time(), Time());
+  TemplateURL* t_url =
+      AddKeywordWithDate("name1", "foo", "http://foo.com", "http://sugg1",
+                         std::string(), "http://icon1", true, "UTF-8;UTF-16");
 
   // Can still replace, newly added template url is marked safe to replace.
   ASSERT_TRUE(model()->CanAddAutogeneratedKeyword(ASCIIToUTF16("bar"),
@@ -900,8 +882,7 @@
   // Add third-party default search engine.
   TemplateURL* user_dse = AddKeywordWithDate(
       "malware", "google.com", "http://www.goo.com/s?q={searchTerms}",
-      std::string(), std::string(), std::string(), true, "UTF-8", Time(),
-      Time(), Time());
+      std::string(), std::string(), std::string(), true);
   model()->SetUserSelectedDefaultSearchProvider(user_dse);
   EXPECT_EQ(user_dse, model()->GetDefaultSearchProvider());
 
@@ -979,8 +960,7 @@
   // Add user provided default search engine.
   TemplateURL* user_dse = AddKeywordWithDate(
       "user_dse", "user_dse.com", "http://www.user_dse.com/s?q={searchTerms}",
-      std::string(), std::string(), std::string(), true, "UTF-8", Time(),
-      Time(), Time());
+      std::string(), std::string(), std::string(), true);
   model()->SetUserSelectedDefaultSearchProvider(user_dse);
   EXPECT_EQ(user_dse, model()->GetDefaultSearchProvider());
   // Check that user dse is different from initial.
@@ -1028,8 +1008,7 @@
   // Add user provided default search engine.
   TemplateURL* user_dse = AddKeywordWithDate(
       "user_dse", "user_dse.com", "http://www.user_dse.com/s?q={searchTerms}",
-      std::string(), std::string(), std::string(), true, "UTF-8", Time(),
-      Time(), Time());
+      std::string(), std::string(), std::string(), true);
   model()->SetUserSelectedDefaultSearchProvider(user_dse);
   EXPECT_EQ(user_dse, model()->GetDefaultSearchProvider());
 
@@ -1083,7 +1062,7 @@
 
   // Add extension controlled default search engine.
   TemplateURL* extension_dse =
-      AddExtensionSearchEngine("extension_dse", "extension_id", true, Time());
+      AddExtensionSearchEngine("extension_dse", "extension_id", true);
   EXPECT_EQ(extension_dse, model()->GetDefaultSearchProvider());
   // Check that user DSE guid is still stored in
   // kSyncedDefaultSearchProviderGUID.
@@ -1121,8 +1100,7 @@
   test_util()->ChangeModelToLoadState();
   AddKeywordWithDate("name", "x", "http://x/foo?q={searchTerms}",
                      "http://sugg1", "http://x/foo#query={searchTerms}",
-                     "http://icon1", false, "UTF-8;UTF-16", Time(), Time(),
-                     Time());
+                     "http://icon1", false, "UTF-8;UTF-16");
 
   for (size_t i = 0; i < arraysize(data); ++i) {
     TemplateURLService::URLVisitedDetails details = {
@@ -1144,8 +1122,7 @@
 
   test_util()->ChangeModelToLoadState();
   AddKeywordWithDate("name", "x", "http://x/foo", "http://sugg1", std::string(),
-                     "http://icon1", false, "UTF-8;UTF-16", Time(), Time(),
-                     Time());
+                     "http://icon1", false, "UTF-8;UTF-16");
 
   for (size_t i = 0; i < arraysize(data); ++i) {
     TemplateURLService::URLVisitedDetails details = {
@@ -1164,8 +1141,7 @@
   test_util()->SetGoogleBaseURL(GURL("http://google.com/"));
   const TemplateURL* t_url = AddKeywordWithDate(
       "name", "google.com", "{google:baseURL}?q={searchTerms}", "http://sugg1",
-      std::string(), "http://icon1", false, "UTF-8;UTF-16", Time(), Time(),
-      Time());
+      std::string(), "http://icon1", false, "UTF-8;UTF-16");
   ASSERT_EQ(t_url, model()->GetTemplateURLForHost("google.com"));
   EXPECT_EQ("google.com", t_url->url_ref().GetHost(search_terms_data()));
   EXPECT_EQ(ASCIIToUTF16("google.com"), t_url->keyword());
@@ -1187,8 +1163,7 @@
   // autogenerated Google search keyword would conflict.
   TemplateURL* manual = AddKeywordWithDate(
       "manual", "google.de", "http://google.de/search?q={searchTerms}",
-      std::string(), std::string(), std::string(), false, "UTF-8", Time(),
-      Time(), Time());
+      std::string(), std::string(), std::string(), false);
   test_util()->SetGoogleBaseURL(GURL("http://google.de"));
 
   // Verify that the manual entry is untouched, and the autogenerated keyword
@@ -1217,8 +1192,7 @@
   // autogenerated Google search keyword would conflict.
   TemplateURL* osdd = AddKeywordWithDate(
       "osdd", "google.it", "http://google.it/search?q={searchTerms}",
-      std::string(), std::string(), std::string(), true, "UTF-8", Time(),
-      Time(), Time());
+      std::string(), std::string(), std::string(), true);
   ASSERT_EQ(osdd,
             model()->GetTemplateURLForKeyword(ASCIIToUTF16("google.it")));
   EXPECT_EQ(ASCIIToUTF16("google.it"), osdd->keyword());
@@ -1254,17 +1228,16 @@
   TemplateURL* t_url = AddKeywordWithDate(
       "keyword", "keyword", "http://foo.com/foo?query={searchTerms}",
       "http://sugg1", std::string(), "http://icon1", true, "UTF-8;UTF-16",
-      base::Time::Now(), base::Time::Now(), base::Time());
+      Time::Now(), Time::Now(), Time());
 
   // Add a visit that matches the url of the keyword.
   history::HistoryService* history = HistoryServiceFactory::GetForProfile(
       test_util()->profile(), ServiceAccessType::EXPLICIT_ACCESS);
-  history->AddPage(
-      GURL(t_url->url_ref().ReplaceSearchTerms(
-          TemplateURLRef::SearchTermsArgs(ASCIIToUTF16("blah")),
-          search_terms_data())),
-      base::Time::Now(), NULL, 0, GURL(), history::RedirectList(),
-      ui::PAGE_TRANSITION_KEYWORD, history::SOURCE_BROWSED, false);
+  history->AddPage(GURL(t_url->url_ref().ReplaceSearchTerms(
+                       TemplateURLRef::SearchTermsArgs(ASCIIToUTF16("blah")),
+                       search_terms_data())),
+                   Time::Now(), NULL, 0, GURL(), history::RedirectList(),
+                   ui::PAGE_TRANSITION_KEYWORD, history::SOURCE_BROWSED, false);
 
   // Wait for history to finish processing the request.
   test_util()->profile()->BlockUntilHistoryProcessesPendingRequests();
@@ -1463,10 +1436,9 @@
   test_util()->ResetObserverCount();
 
   // Set a regular default search provider.
-  TemplateURL* regular_default =
-      AddKeywordWithDate("name1", "key1", "http://foo1/{searchTerms}",
-                         "http://sugg1", std::string(), "http://icon1", true,
-                         "UTF-8;UTF-16", Time(), Time(), Time());
+  TemplateURL* regular_default = AddKeywordWithDate(
+      "name1", "key1", "http://foo1/{searchTerms}", "http://sugg1",
+      std::string(), "http://icon1", true, "UTF-8;UTF-16");
   VerifyObserverCount(1);
   model()->SetUserSelectedDefaultSearchProvider(regular_default);
   // Adding the URL and setting the default search provider should have caused
@@ -1627,94 +1599,63 @@
 TEST_F(TemplateURLServiceTest, DefaultExtensionEngine) {
   test_util()->VerifyLoad();
   // Add third-party default search engine.
-  TemplateURL* user_dse = AddKeywordWithDate(
-      "user", "user", "http://www.goo.com/s?q={searchTerms}", std::string(),
-      std::string(), std::string(), true, "UTF-8", Time(), Time(), Time());
+  TemplateURL* user_dse =
+      AddKeywordWithDate("user", "user", "http://www.goo.com/s?q={searchTerms}",
+                         std::string(), std::string(), std::string(), true);
   model()->SetUserSelectedDefaultSearchProvider(user_dse);
   EXPECT_EQ(user_dse, model()->GetDefaultSearchProvider());
 
-  std::unique_ptr<TemplateURL> ext_dse = CreateKeywordWithDate(
-      model(), "ext", "ext", "http://www.search.com/s?q={searchTerms}",
-      std::string(), std::string(), std::string(), true, kPrepopulatedId,
-      "UTF-8", Time(), Time(), Time(),
-      TemplateURL::NORMAL_CONTROLLED_BY_EXTENSION);
-  std::unique_ptr<TemplateURL::AssociatedExtensionInfo> extension_info(
-      new TemplateURL::AssociatedExtensionInfo("ext"));
-  extension_info->wants_to_be_default_engine = true;
-  TemplateURL* ext_dse_ptr = test_util()->AddExtensionControlledTURL(
-      std::move(ext_dse), std::move(extension_info));
+  TemplateURL* ext_dse_ptr =
+      AddExtensionSearchEngine("extension_keyword", "extension_id", true);
   EXPECT_EQ(ext_dse_ptr, model()->GetDefaultSearchProvider());
 
-  test_util()->RemoveExtensionControlledTURL("ext");
+  test_util()->RemoveExtensionControlledTURL("extension_id");
   ExpectSimilar(user_dse, model()->GetDefaultSearchProvider());
 }
 
 TEST_F(TemplateURLServiceTest, DefaultExtensionEnginePersist) {
   test_util()->VerifyLoad();
   // Add third-party default search engine.
-  TemplateURL* user_dse = AddKeywordWithDate(
-      "user", "user", "http://www.goo.com/s?q={searchTerms}", std::string(),
-      std::string(), std::string(), true, "UTF-8", Time(), Time(), Time());
+  TemplateURL* user_dse =
+      AddKeywordWithDate("user", "user", "http://www.goo.com/s?q={searchTerms}",
+                         std::string(), std::string(), std::string(), true);
   model()->SetUserSelectedDefaultSearchProvider(user_dse);
   EXPECT_EQ(user_dse, model()->GetDefaultSearchProvider());
 
   // Create non-default extension search engine.
-  std::unique_ptr<TemplateURL> ext_dse = CreateKeywordWithDate(
-      model(), "ext1", "ext1", "http://www.ext1.com/s?q={searchTerms}",
-      std::string(), std::string(), std::string(), true, 0, "UTF-8", Time(),
-      Time(), Time(), TemplateURL::NORMAL_CONTROLLED_BY_EXTENSION);
-  std::unique_ptr<TemplateURL::AssociatedExtensionInfo> extension_info(
-      new TemplateURL::AssociatedExtensionInfo("ext1"));
-  extension_info->wants_to_be_default_engine = false;
-
-  test_util()->AddExtensionControlledTURL(std::move(ext_dse),
-                                          std::move(extension_info));
+  AddExtensionSearchEngine("extension1_keyword", "extension1_id", false);
   EXPECT_EQ(user_dse, model()->GetDefaultSearchProvider());
 
   // Create default extension search engine.
-  ext_dse = CreateKeywordWithDate(
-      model(), "ext2", "ext2", "http://www.ext2.com/s?q={searchTerms}",
-      std::string(), std::string(), std::string(), true, kPrepopulatedId,
-      "UTF-8", Time(), Time(), Time(),
-      TemplateURL::NORMAL_CONTROLLED_BY_EXTENSION);
-  extension_info.reset(new TemplateURL::AssociatedExtensionInfo("ext2"));
-  extension_info->wants_to_be_default_engine = true;
-
-  auto cloned_ext_dse = base::MakeUnique<TemplateURL>(ext_dse->data());
-  TemplateURL* ext_dse_ptr = test_util()->AddExtensionControlledTURL(
-      std::move(ext_dse), std::move(extension_info));
+  TemplateURL* ext_dse_ptr =
+      AddExtensionSearchEngine("extension2_keyword", "extension2_id", true);
   EXPECT_EQ(ext_dse_ptr, model()->GetDefaultSearchProvider());
+  auto cloned_ext_dse = base::MakeUnique<TemplateURL>(ext_dse_ptr->data());
 
   // A default search engine set by an extension must be persisted across
   // browser restarts, until the extension is unloaded/disabled.
   test_util()->ResetModel(false);
-  EXPECT_TRUE(model()->GetTemplateURLForKeyword(ASCIIToUTF16("ext2")));
+  EXPECT_TRUE(
+      model()->GetTemplateURLForKeyword(ASCIIToUTF16("extension2_keyword")));
   ExpectSimilar(cloned_ext_dse.get(), model()->GetDefaultSearchProvider());
 
   // Non-default extension engines are not persisted across restarts.
-  EXPECT_FALSE(model()->GetTemplateURLForKeyword(ASCIIToUTF16("ext1")));
+  EXPECT_FALSE(
+      model()->GetTemplateURLForKeyword(ASCIIToUTF16("extension1_keyword")));
 }
 
 TEST_F(TemplateURLServiceTest, DefaultExtensionEnginePersistsBeforeLoad) {
   // Chrome will load the extension system before the TemplateURLService, so
   // extensions controlling the default search engine may be registered before
   // the service has loaded.
-  std::unique_ptr<TemplateURL> ext_dse = CreateKeywordWithDate(
-      model(), "ext2", "ext2", "http://www.ext2.com/s?q={searchTerms}",
-      std::string(), std::string(), std::string(), true, kPrepopulatedId,
-      "UTF-8", Time(), Time(), Time(),
-      TemplateURL::NORMAL_CONTROLLED_BY_EXTENSION);
-  auto extension_info =
-      base::MakeUnique<TemplateURL::AssociatedExtensionInfo>("ext2");
-  extension_info->wants_to_be_default_engine = true;
-
+  const TemplateURL* ext_dse =
+      AddExtensionSearchEngine("extension1_keyword", "extension1_id", true);
   auto cloned_ext_dse = base::MakeUnique<TemplateURL>(ext_dse->data());
-  test_util()->AddExtensionControlledTURL(std::move(ext_dse),
-                                          std::move(extension_info));
 
   // Default search engine from extension must be persisted between browser
   // restarts, and should be available before the TemplateURLService is loaded.
-  EXPECT_TRUE(model()->GetTemplateURLForKeyword(ASCIIToUTF16("ext2")));
+  EXPECT_TRUE(
+      model()->GetTemplateURLForKeyword(ASCIIToUTF16("extension1_keyword")));
   ExpectSimilar(cloned_ext_dse.get(), model()->GetDefaultSearchProvider());
 
   // Check extension DSE is the same after service load.
@@ -1954,11 +1895,8 @@
       std::string(), std::string(), std::string(), true, kPrepopulatedId,
       "UTF-8", Time(), Time(), Time(),
       TemplateURL::NORMAL_CONTROLLED_BY_EXTENSION);
-  auto extension_info =
-      base::MakeUnique<TemplateURL::AssociatedExtensionInfo>("ext1");
-  extension_info->wants_to_be_default_engine = true;
-  TemplateURL* ext_dse_ptr = test_util()->AddExtensionControlledTURL(
-      std::move(ext_dse), std::move(extension_info));
+  TemplateURL* ext_dse_ptr =
+      test_util()->AddExtensionControlledTURL(std::move(ext_dse), "ext1", true);
   EXPECT_EQ(ext_dse_ptr,
             model()->GetTemplateURLForKeyword(ASCIIToUTF16("ext1")));
   EXPECT_TRUE(model()->is_default_search_managed());
@@ -1968,14 +1906,14 @@
 
 TEST_F(TemplateURLServiceTest, LastVisitedTimeUpdate) {
   test_util()->VerifyLoad();
-  TemplateURL* original_url = AddKeywordWithDate(
-      "name1", "key1", "http://foo1", "http://suggest1", std::string(),
-      "http://icon1", true, "UTF-8;UTF-16", Time(), Time(), Time());
-  const base::Time original_last_visited = original_url->last_visited();
+  TemplateURL* original_url =
+      AddKeywordWithDate("name1", "key1", "http://foo1", "http://suggest1",
+                         std::string(), "http://icon1", true, "UTF-8;UTF-16");
+  const Time original_last_visited = original_url->last_visited();
   model()->UpdateTemplateURLVisitTime(original_url);
   TemplateURL* modified_url =
       model()->GetTemplateURLForKeyword(ASCIIToUTF16("key1"));
-  const base::Time modified_last_visited = modified_url->last_visited();
+  const Time modified_last_visited = modified_url->last_visited();
   EXPECT_NE(original_last_visited, modified_last_visited);
   test_util()->ResetModel(true);
   TemplateURL* reloaded_url =
@@ -1991,17 +1929,17 @@
   data.SetURL("http://test_engine");
   data.safe_for_autoreplace = true;
   TemplateURL* original_url = model()->Add(base::MakeUnique<TemplateURL>(data));
-  const base::Time original_last_modified = original_url->last_modified();
+  const Time original_last_modified = original_url->last_modified();
   model()->ResetTemplateURL(original_url, ASCIIToUTF16("test_engine2"),
                             ASCIIToUTF16("engine_keyword"),
                             "http://test_engine");
   TemplateURL* update_url =
       model()->GetTemplateURLForKeyword(ASCIIToUTF16("engine_keyword"));
-  const base::Time update_last_modified = update_url->last_modified();
+  const Time update_last_modified = update_url->last_modified();
   model()->SetUserSelectedDefaultSearchProvider(update_url);
   TemplateURL* reloaded_url =
       model()->GetTemplateURLForKeyword(ASCIIToUTF16("engine_keyword"));
-  const base::Time reloaded_last_modified = reloaded_url->last_modified();
+  const Time reloaded_last_modified = reloaded_url->last_modified();
   EXPECT_NE(original_last_modified, reloaded_last_modified);
   EXPECT_EQ(update_last_modified, reloaded_last_modified);
 }
diff --git a/components/doodle/doodle_fetcher_impl.cc b/components/doodle/doodle_fetcher_impl.cc
index 2d37cf5a..05990c9 100644
--- a/components/doodle/doodle_fetcher_impl.cc
+++ b/components/doodle/doodle_fetcher_impl.cc
@@ -38,40 +38,8 @@
   return json_sp.as_string();
 }
 
-DoodleType ParseDoodleType(const base::DictionaryValue& ddljson) {
-  std::string type_str;
-  ddljson.GetString("doodle_type", &type_str);
-  if (type_str == "SIMPLE") {
-    return DoodleType::SIMPLE;
-  }
-  if (type_str == "RANDOM") {
-    return DoodleType::RANDOM;
-  }
-  if (type_str == "VIDEO") {
-    return DoodleType::VIDEO;
-  }
-  if (type_str == "INTERACTIVE") {
-    return DoodleType::INTERACTIVE;
-  }
-  if (type_str == "INLINE_INTERACTIVE") {
-    return DoodleType::INLINE_INTERACTIVE;
-  }
-  if (type_str == "SLIDESHOW") {
-    return DoodleType::SLIDESHOW;
-  }
-  return DoodleType::UNKNOWN;
-}
-
 }  // namespace
 
-DoodleImage::DoodleImage()
-    : height(0), width(0), is_animated_gif(false), is_cta(false) {}
-DoodleImage::~DoodleImage() = default;
-
-DoodleConfig::DoodleConfig() : doodle_type(DoodleType::UNKNOWN) {}
-DoodleConfig::DoodleConfig(const DoodleConfig& config) = default;
-DoodleConfig::~DoodleConfig() = default;
-
 DoodleFetcherImpl::DoodleFetcherImpl(
     scoped_refptr<net::URLRequestContextGetter> download_context,
     GoogleURLTracker* google_url_tracker,
@@ -164,51 +132,8 @@
 base::Optional<DoodleConfig> DoodleFetcherImpl::ParseDoodleConfigAndTimeToLive(
     const base::DictionaryValue& ddljson,
     base::TimeDelta* time_to_live) const {
-  DoodleConfig doodle;
-  // The |large_image| field is required (it's the "default" representation for
-  // the doodle).
-  if (!ParseImage(ddljson, "large_image", &doodle.large_image)) {
-    return base::nullopt;
-  }
-  ParseBaseInformation(ddljson, &doodle, time_to_live);
-  ParseImage(ddljson, "transparent_large_image",
-             &doodle.transparent_large_image);
-  ParseImage(ddljson, "large_cta_image", &doodle.large_cta_image);
-  return doodle;
-}
-
-bool DoodleFetcherImpl::ParseImage(const base::DictionaryValue& image_parent,
-                                   const std::string& image_name,
-                                   DoodleImage* image) const {
-  DCHECK(image);
-  const base::DictionaryValue* image_dict = nullptr;
-  if (!image_parent.GetDictionary(image_name, &image_dict)) {
-    return false;
-  }
-  image->url = ParseRelativeUrl(*image_dict, "url");
-  if (!image->url.is_valid()) {
-    DLOG(WARNING) << "Image URL for \"" << image_name << "\" is invalid.";
-    return false;
-  }
-  image_dict->GetInteger("height", &image->height);
-  image_dict->GetInteger("width", &image->width);
-  image_dict->GetBoolean("is_animated_gif", &image->is_animated_gif);
-  image_dict->GetBoolean("is_cta", &image->is_cta);
-  return true;
-}
-
-void DoodleFetcherImpl::ParseBaseInformation(
-    const base::DictionaryValue& ddljson,
-    DoodleConfig* config,
-    base::TimeDelta* time_to_live) const {
-  config->search_url = ParseRelativeUrl(ddljson, "search_url");
-  config->target_url = ParseRelativeUrl(ddljson, "target_url");
-  config->fullpage_interactive_url =
-      ParseRelativeUrl(ddljson, "fullpage_interactive_url");
-
-  config->doodle_type = ParseDoodleType(ddljson);
-  ddljson.GetString("alt_text", &config->alt_text);
-  ddljson.GetString("interactive_html", &config->interactive_html);
+  base::Optional<DoodleConfig> doodle =
+      DoodleConfig::FromDictionary(ddljson, GetGoogleBaseUrl());
 
   // The JSON doesn't guarantee the number to fit into an int.
   double ttl = 0;  // Expires immediately if the parameter is missing.
@@ -222,17 +147,8 @@
     DLOG(WARNING) << "Clamping Doodle TTL to 30 days!";
   }
   *time_to_live = base::TimeDelta::FromMillisecondsD(ttl);
-}
 
-GURL DoodleFetcherImpl::ParseRelativeUrl(
-    const base::DictionaryValue& dict_value,
-    const std::string& key) const {
-  std::string str_url;
-  dict_value.GetString(key, &str_url);
-  if (str_url.empty()) {
-    return GURL();
-  }
-  return GetGoogleBaseUrl().Resolve(str_url);
+  return doodle;
 }
 
 void DoodleFetcherImpl::RespondToAllCallbacks(
diff --git a/components/doodle/doodle_fetcher_impl.h b/components/doodle/doodle_fetcher_impl.h
index ad38992..d0d3861 100644
--- a/components/doodle/doodle_fetcher_impl.h
+++ b/components/doodle/doodle_fetcher_impl.h
@@ -67,15 +67,6 @@
       const base::DictionaryValue& ddljson,
       base::TimeDelta* time_to_live) const;
 
-  bool ParseImage(const base::DictionaryValue& image_dict,
-                  const std::string& image_name,
-                  DoodleImage* image) const;
-  void ParseBaseInformation(const base::DictionaryValue& ddljson,
-                            DoodleConfig* config,
-                            base::TimeDelta* time_to_live) const;
-  GURL ParseRelativeUrl(const base::DictionaryValue& dict_value,
-                        const std::string& key) const;
-
   void RespondToAllCallbacks(DoodleState state,
                              base::TimeDelta time_to_live,
                              const base::Optional<DoodleConfig>& config);
diff --git a/components/doodle/doodle_types.cc b/components/doodle/doodle_types.cc
index d88221fc..0829ff7a 100644
--- a/components/doodle/doodle_types.cc
+++ b/components/doodle/doodle_types.cc
@@ -4,8 +4,88 @@
 
 #include "components/doodle/doodle_types.h"
 
+#include "base/values.h"
+
 namespace doodle {
 
+namespace {
+
+DoodleType DoodleTypeFromString(const std::string& type_str) {
+  if (type_str == "SIMPLE") {
+    return DoodleType::SIMPLE;
+  }
+  if (type_str == "RANDOM") {
+    return DoodleType::RANDOM;
+  }
+  if (type_str == "VIDEO") {
+    return DoodleType::VIDEO;
+  }
+  if (type_str == "INTERACTIVE") {
+    return DoodleType::INTERACTIVE;
+  }
+  if (type_str == "INLINE_INTERACTIVE") {
+    return DoodleType::INLINE_INTERACTIVE;
+  }
+  if (type_str == "SLIDESHOW") {
+    return DoodleType::SLIDESHOW;
+  }
+  return DoodleType::UNKNOWN;
+}
+
+GURL ResolvePossiblyRelativeUrl(const std::string& url_str,
+                                const base::Optional<GURL>& base_url) {
+  if (!base_url.has_value()) {
+    return GURL(url_str);
+  }
+  return base_url->Resolve(url_str);
+}
+
+GURL ParseUrl(const base::DictionaryValue& parent_dict,
+              const std::string& key,
+              const base::Optional<GURL>& base_url) {
+  std::string url_str;
+  if (!parent_dict.GetString(key, &url_str) || url_str.empty()) {
+    return GURL();
+  }
+  return ResolvePossiblyRelativeUrl(url_str, base_url);
+}
+
+base::Optional<DoodleImage> ParseImage(const base::DictionaryValue& parent_dict,
+                                       const std::string& key,
+                                       const base::Optional<GURL>& base_url) {
+  const base::DictionaryValue* image_dict = nullptr;
+  if (!parent_dict.GetDictionary(key, &image_dict)) {
+    return base::nullopt;
+  }
+  return DoodleImage::FromDictionary(*image_dict, base_url);
+}
+
+}  // namespace
+
+// static
+base::Optional<DoodleImage> DoodleImage::FromDictionary(
+    const base::DictionaryValue& dict,
+    const base::Optional<GURL>& base_url) {
+  DoodleImage image;
+
+  // The URL is the only required field.
+  image.url = ParseUrl(dict, "url", base_url);
+  if (!image.url.is_valid()) {
+    return base::nullopt;
+  }
+
+  dict.GetInteger("height", &image.height);
+  dict.GetInteger("width", &image.width);
+  dict.GetBoolean("is_animated_gif", &image.is_animated_gif);
+  dict.GetBoolean("is_cta", &image.is_cta);
+
+  return image;
+}
+
+DoodleImage::DoodleImage()
+    : height(0), width(0), is_animated_gif(false), is_cta(false) {}
+DoodleImage::~DoodleImage() = default;
+
 bool DoodleImage::operator==(const DoodleImage& other) const {
   return url == other.url && height == other.height && width == other.width &&
          is_animated_gif == other.is_animated_gif && is_cta == other.is_cta;
@@ -15,6 +95,51 @@
   return !(*this == other);
 }
 
+DoodleConfig::DoodleConfig() : doodle_type(DoodleType::UNKNOWN) {}
+DoodleConfig::DoodleConfig(const DoodleConfig& config) = default;
+DoodleConfig::~DoodleConfig() = default;
+
+// static
+base::Optional<DoodleConfig> DoodleConfig::FromDictionary(
+    const base::DictionaryValue& dict,
+    const base::Optional<GURL>& base_url) {
+  DoodleConfig doodle;
+
+  // The |large_image| field is required (it's the "default" representation for
+  // the doodle).
+  base::Optional<DoodleImage> large_image =
+      ParseImage(dict, "large_image", base_url);
+  if (!large_image.has_value()) {
+    return base::nullopt;
+  }
+  doodle.large_image = large_image.value();
+
+  std::string type_str;
+  dict.GetString("doodle_type", &type_str);
+  doodle.doodle_type = DoodleTypeFromString(type_str);
+
+  dict.GetString("alt_text", &doodle.alt_text);
+
+  dict.GetString("interactive_html", &doodle.interactive_html);
+
+  doodle.search_url = ParseUrl(dict, "search_url", base_url);
+  doodle.target_url = ParseUrl(dict, "target_url", base_url);
+  doodle.fullpage_interactive_url =
+      ParseUrl(dict, "fullpage_interactive_url", base_url);
+
+  auto large_cta_image = ParseImage(dict, "large_cta_image", base_url);
+  if (large_cta_image.has_value()) {
+    doodle.large_cta_image = large_cta_image.value();
+  }
+  auto transparent_large_image =
+      ParseImage(dict, "transparent_large_image", base_url);
+  if (transparent_large_image.has_value()) {
+    doodle.transparent_large_image = transparent_large_image.value();
+  }
+
+  return doodle;
+}
+
 bool DoodleConfig::operator==(const DoodleConfig& other) const {
   return doodle_type == other.doodle_type && alt_text == other.alt_text &&
          interactive_html == other.interactive_html &&
diff --git a/components/doodle/doodle_types.h b/components/doodle/doodle_types.h
index d97b50b..058aa10 100644
--- a/components/doodle/doodle_types.h
+++ b/components/doodle/doodle_types.h
@@ -5,8 +5,13 @@
 #ifndef COMPONENTS_DOODLE_DOODLE_TYPES_H_
 #define COMPONENTS_DOODLE_DOODLE_TYPES_H_
 
+#include "base/optional.h"
 #include "url/gurl.h"
 
+namespace base {
+class DictionaryValue;
+}
+
 namespace doodle {
 
 enum class DoodleState {
@@ -32,6 +37,10 @@
   DoodleImage();
   ~DoodleImage();
 
+  static base::Optional<DoodleImage> FromDictionary(
+      const base::DictionaryValue& dict,
+      const base::Optional<GURL>& base_url);
+
   bool operator==(const DoodleImage& other) const;
   bool operator!=(const DoodleImage& other) const;
 
@@ -51,6 +60,10 @@
   DoodleConfig(const DoodleConfig& config);  // = default;
   ~DoodleConfig();
 
+  static base::Optional<DoodleConfig> FromDictionary(
+      const base::DictionaryValue& dict,
+      const base::Optional<GURL>& base_url);
+
   bool operator==(const DoodleConfig& other) const;
   bool operator!=(const DoodleConfig& other) const;
 
diff --git a/content/renderer/media_recorder/media_recorder_handler.cc b/content/renderer/media_recorder/media_recorder_handler.cc
index 1055b153..9cc45602 100644
--- a/content/renderer/media_recorder/media_recorder_handler.cc
+++ b/content/renderer/media_recorder/media_recorder_handler.cc
@@ -270,6 +270,7 @@
 void MediaRecorderHandler::OnEncodedVideo(
     const media::WebmMuxer::VideoParameters& params,
     std::unique_ptr<std::string> encoded_data,
+    std::unique_ptr<std::string> encoded_alpha,
     TimeTicks timestamp,
     bool is_key_frame) {
   DCHECK(main_render_thread_checker_.CalledOnValidThread());
@@ -280,7 +281,8 @@
   }
   if (!webm_muxer_)
     return;
-  if (!webm_muxer_->OnEncodedVideo(params, std::move(encoded_data), timestamp,
+  if (!webm_muxer_->OnEncodedVideo(params, std::move(encoded_data),
+                                   std::move(encoded_alpha), timestamp,
                                    is_key_frame)) {
     DLOG(ERROR) << "Error muxing video data";
     client_->onError("Error muxing video data");
diff --git a/content/renderer/media_recorder/media_recorder_handler.h b/content/renderer/media_recorder/media_recorder_handler.h
index 30a7637..0347125d 100644
--- a/content/renderer/media_recorder/media_recorder_handler.h
+++ b/content/renderer/media_recorder/media_recorder_handler.h
@@ -65,8 +65,12 @@
  private:
   friend class MediaRecorderHandlerTest;
 
+  // Called to indicate there is encoded video data available. |encoded_alpha|
+  // represents the encode output of alpha channel when available, can be
+  // nullptr otherwise.
   void OnEncodedVideo(const media::WebmMuxer::VideoParameters& params,
                       std::unique_ptr<std::string> encoded_data,
+                      std::unique_ptr<std::string> encoded_alpha,
                       base::TimeTicks timestamp,
                       bool is_key_frame);
   void OnEncodedAudio(const media::AudioParameters& params,
diff --git a/content/renderer/media_recorder/media_recorder_handler_unittest.cc b/content/renderer/media_recorder/media_recorder_handler_unittest.cc
index f0be4d1..c4217e5 100644
--- a/content/renderer/media_recorder/media_recorder_handler_unittest.cc
+++ b/content/renderer/media_recorder/media_recorder_handler_unittest.cc
@@ -55,17 +55,18 @@
   const bool has_audio;
   const char* const mime_type;
   const char* const codecs;
+  const bool encoder_supports_alpha;
 };
 
 // Array of valid combinations of video/audio/codecs and expected collected
 // encoded sizes to use for parameterizing MediaRecorderHandlerTest.
 static const MediaRecorderTestParams kMediaRecorderTestParams[] = {
-    {true, false, "video/webm", "vp8"},
-    {true, false, "video/webm", "vp9"},
+    {true, false, "video/webm", "vp8", true},
+    {true, false, "video/webm", "vp9", true},
 #if BUILDFLAG(RTC_USE_H264)
-    {true, false, "video/webm", "h264"},
+    {true, false, "video/webm", "h264", false},
 #endif
-    {false, true, "video/webm", "vp8"}};
+    {false, true, "video/webm", "vp8", true}};
 
 class MediaRecorderHandlerTest : public TestWithParam<MediaRecorderTestParams>,
                                  public blink::WebMediaRecorderHandlerClient {
@@ -217,7 +218,8 @@
   media_recorder_handler_.reset();
 }
 
-// Sends 2 frames and expect them as WebM contained encoded data in writeData().
+// Sends 2 opaque frames and 1 transparent frame and expects them as WebM
+// contained encoded data in writeData().
 TEST_P(MediaRecorderHandlerTest, EncodeVideoFrames) {
   // Video-only test.
   if (GetParam().has_audio)
@@ -267,6 +269,33 @@
     OnVideoFrameForTesting(video_frame);
     run_loop.Run();
   }
+  Mock::VerifyAndClearExpectations(this);
+
+  {
+    const scoped_refptr<media::VideoFrame> alpha_frame =
+        media::VideoFrame::CreateTransparentFrame(gfx::Size(160, 80));
+    const size_t kEncodedSizeThreshold = 16;
+    EXPECT_EQ(4u, media::VideoFrame::NumPlanes(alpha_frame->format()));
+    base::RunLoop run_loop;
+    base::Closure quit_closure = run_loop.QuitClosure();
+    // The second time around writeData() is called a number of times to write
+    // the WebM frame header, and then is pinged with the encoded data.
+    EXPECT_CALL(*this, writeData(_, Lt(kEncodedSizeThreshold), _, _))
+        .Times(AtLeast(1));
+    EXPECT_CALL(*this, writeData(_, Gt(kEncodedSizeThreshold), _, _))
+        .Times(1)
+        .WillOnce(RunClosure(quit_closure));
+    if (GetParam().encoder_supports_alpha) {
+      EXPECT_CALL(*this, writeData(_, Lt(kEncodedSizeThreshold), _, _))
+          .Times(AtLeast(1));
+      EXPECT_CALL(*this, writeData(_, Gt(kEncodedSizeThreshold), _, _))
+          .Times(1)
+          .WillOnce(RunClosure(quit_closure));
+    }
+
+    OnVideoFrameForTesting(alpha_frame);
+    run_loop.Run();
+  }
 
   media_recorder_handler_->stop();
 
diff --git a/content/renderer/media_recorder/video_track_recorder.cc b/content/renderer/media_recorder/video_track_recorder.cc
index d77d300..1c0e4149 100644
--- a/content/renderer/media_recorder/video_track_recorder.cc
+++ b/content/renderer/media_recorder/video_track_recorder.cc
@@ -205,17 +205,18 @@
   }
 
   // Start encoding |frame|, returning via |on_encoded_video_callback_|. This
-  // call will also trigger a ConfigureEncoderOnEncodingTaskRunner() upon first
-  // frame arrival or parameter change, and an EncodeOnEncodingTaskRunner() to
-  // actually encode the frame. If the |frame|'s data is not directly available
-  // (e.g. it's a texture) then RetrieveFrameOnMainThread() is called, and if
-  // even that fails, black frames are sent instead.
+  // call will also trigger an encode configuration upon first frame arrival
+  // or parameter change, and an EncodeOnEncodingTaskRunner() to actually
+  // encode the frame. If the |frame|'s data is not directly available (e.g.
+  // it's a texture) then RetrieveFrameOnMainThread() is called, and if even
+  // that fails, black frames are sent instead.
   void StartFrameEncode(const scoped_refptr<VideoFrame>& frame,
                         base::TimeTicks capture_timestamp);
   void RetrieveFrameOnMainThread(const scoped_refptr<VideoFrame>& video_frame,
                                  base::TimeTicks capture_timestamp);
 
   void SetPaused(bool paused);
+  virtual bool CanEncodeAlphaChannel() { return false; }
 
  protected:
   friend class base::RefCountedThreadSafe<Encoder>;
@@ -226,7 +227,6 @@
   virtual void EncodeOnEncodingTaskRunner(
       scoped_refptr<VideoFrame> frame,
       base::TimeTicks capture_timestamp) = 0;
-  virtual void ConfigureEncoderOnEncodingTaskRunner(const gfx::Size& size) = 0;
 
   // Used to shutdown properly on the same thread we were created.
   const scoped_refptr<base::SingleThreadTaskRunner> main_task_runner_;
@@ -283,8 +283,8 @@
   }
 
   scoped_refptr<media::VideoFrame> frame = video_frame;
-  // Drop alpha channel since we do not support it yet.
-  if (frame->format() == media::PIXEL_FORMAT_YV12A)
+  // Drop alpha channel if the encoder does not support it yet.
+  if (!CanEncodeAlphaChannel() && frame->format() == media::PIXEL_FORMAT_YV12A)
     frame = media::WrapAsI420VideoFrame(video_frame);
 
   encoding_task_runner_->PostTask(
@@ -398,11 +398,13 @@
     const VideoTrackRecorder::OnEncodedVideoCB& on_encoded_video_cb,
     const media::WebmMuxer::VideoParameters& params,
     std::unique_ptr<std::string> data,
+    std::unique_ptr<std::string> alpha_data,
     base::TimeTicks capture_timestamp,
     bool keyframe) {
   DVLOG(1) << (keyframe ? "" : "non ") << "keyframe "<< data->length() << "B, "
            << capture_timestamp << " ms";
-  on_encoded_video_cb.Run(params, std::move(data), capture_timestamp, keyframe);
+  on_encoded_video_cb.Run(params, std::move(data), std::move(alpha_data),
+                          capture_timestamp, keyframe);
 }
 
 static int GetNumberOfThreadsForEncoding() {
@@ -447,7 +449,8 @@
   ~VEAEncoder() override;
   void EncodeOnEncodingTaskRunner(scoped_refptr<VideoFrame> frame,
                                   base::TimeTicks capture_timestamp) override;
-  void ConfigureEncoderOnEncodingTaskRunner(const gfx::Size& size) override;
+
+  void ConfigureEncoderOnEncodingTaskRunner(const gfx::Size& size);
 
   media::GpuVideoAcceleratorFactories* const gpu_factories_;
 
@@ -494,10 +497,27 @@
   ~VpxEncoder() override;
   void EncodeOnEncodingTaskRunner(scoped_refptr<VideoFrame> frame,
                                   base::TimeTicks capture_timestamp) override;
-  void ConfigureEncoderOnEncodingTaskRunner(const gfx::Size& size) override;
+  bool CanEncodeAlphaChannel() override { return true; }
 
-  // Returns true if |codec_config_| has been filled in at least once.
-  bool IsInitialized() const;
+  void ConfigureEncoderOnEncodingTaskRunner(const gfx::Size& size,
+                                            vpx_codec_enc_cfg_t* codec_config,
+                                            ScopedVpxCodecCtxPtr* encoder);
+  void DoEncode(vpx_codec_ctx_t* const encoder,
+                const gfx::Size& frame_size,
+                uint8_t* const data,
+                uint8_t* const y_plane,
+                int y_stride,
+                uint8_t* const u_plane,
+                int u_stride,
+                uint8_t* const v_plane,
+                int v_stride,
+                const base::TimeDelta& duration,
+                bool force_keyframe,
+                std::string* const output_data,
+                bool* const keyframe);
+
+  // Returns true if |codec_config| has been filled in at least once.
+  bool IsInitialized(const vpx_codec_enc_cfg_t& codec_config) const;
 
   // Estimate the frame duration from |frame| and |last_frame_timestamp_|.
   base::TimeDelta EstimateFrameDuration(const scoped_refptr<VideoFrame>& frame);
@@ -511,6 +531,15 @@
   vpx_codec_enc_cfg_t codec_config_;
   ScopedVpxCodecCtxPtr encoder_;
 
+  vpx_codec_enc_cfg_t alpha_codec_config_;
+  ScopedVpxCodecCtxPtr alpha_encoder_;
+
+  std::vector<uint8_t> alpha_dummy_planes_;
+  size_t v_plane_offset_;
+  size_t u_plane_stride_;
+  size_t v_plane_stride_;
+  bool last_frame_had_alpha_ = false;
+
   // The |VideoFrame::timestamp()| of the last encoded frame.  This is used to
   // predict the duration of the next frame. Only used on |encoding_thread_|.
   base::TimeDelta last_frame_timestamp_;
@@ -546,7 +575,8 @@
   ~H264Encoder() override;
   void EncodeOnEncodingTaskRunner(scoped_refptr<VideoFrame> frame,
                               base::TimeTicks capture_timestamp) override;
-  void ConfigureEncoderOnEncodingTaskRunner(const gfx::Size& size) override;
+
+  void ConfigureEncoderOnEncodingTaskRunner(const gfx::Size& size);
 
   // |openh264_encoder_| is a special scoped pointer to guarantee proper
   // destruction, also when reconfiguring due to parameters change. Only used on
@@ -628,7 +658,7 @@
   frames_in_encode_.pop();
   origin_task_runner_->PostTask(
       FROM_HERE, base::Bind(OnFrameEncodeCompleted, on_encoded_video_callback_,
-                            front_frame.first, base::Passed(&data),
+                            front_frame.first, base::Passed(&data), nullptr,
                             front_frame.second, keyframe));
   UseOutputBitstreamBufferId(bitstream_buffer_id);
 }
@@ -797,116 +827,176 @@
   DCHECK(encoding_task_runner_->BelongsToCurrentThread());
 
   const gfx::Size frame_size = frame->visible_rect().size();
-  if (!IsInitialized() ||
+  const base::TimeDelta duration = EstimateFrameDuration(frame);
+  const media::WebmMuxer::VideoParameters video_params(frame);
+
+  if (!IsInitialized(codec_config_) ||
       gfx::Size(codec_config_.g_w, codec_config_.g_h) != frame_size) {
-    ConfigureEncoderOnEncodingTaskRunner(frame_size);
+    ConfigureEncoderOnEncodingTaskRunner(frame_size, &codec_config_, &encoder_);
   }
 
-  vpx_image_t vpx_image;
-  vpx_image_t* const result = vpx_img_wrap(&vpx_image,
-                                           VPX_IMG_FMT_I420,
-                                           frame_size.width(),
-                                           frame_size.height(),
-                                           1  /* align */,
-                                           frame->data(VideoFrame::kYPlane));
-  DCHECK_EQ(result, &vpx_image);
-  vpx_image.planes[VPX_PLANE_Y] = frame->visible_data(VideoFrame::kYPlane);
-  vpx_image.planes[VPX_PLANE_U] = frame->visible_data(VideoFrame::kUPlane);
-  vpx_image.planes[VPX_PLANE_V] = frame->visible_data(VideoFrame::kVPlane);
-  vpx_image.stride[VPX_PLANE_Y] = frame->stride(VideoFrame::kYPlane);
-  vpx_image.stride[VPX_PLANE_U] = frame->stride(VideoFrame::kUPlane);
-  vpx_image.stride[VPX_PLANE_V] = frame->stride(VideoFrame::kVPlane);
-
-  const base::TimeDelta duration = EstimateFrameDuration(frame);
-  // Encode the frame.  The presentation time stamp argument here is fixed to
-  // zero to force the encoder to base its single-frame bandwidth calculations
-  // entirely on |predicted_frame_duration|.
-  const vpx_codec_err_t ret = vpx_codec_encode(encoder_.get(),
-                                               &vpx_image,
-                                               0  /* pts */,
-                                               duration.InMicroseconds(),
-                                               0 /* flags */,
-                                               VPX_DL_REALTIME);
-  DCHECK_EQ(ret, VPX_CODEC_OK) << vpx_codec_err_to_string(ret) << ", #"
-                               << vpx_codec_error(encoder_.get()) << " -"
-                               << vpx_codec_error_detail(encoder_.get());
-
-  const media::WebmMuxer::VideoParameters video_params(frame);
-  frame = nullptr;
+  const bool frame_has_alpha = frame->format() == media::PIXEL_FORMAT_YV12A;
+  if (frame_has_alpha && (!IsInitialized(alpha_codec_config_) ||
+                          gfx::Size(alpha_codec_config_.g_w,
+                                    alpha_codec_config_.g_h) != frame_size)) {
+    ConfigureEncoderOnEncodingTaskRunner(frame_size, &alpha_codec_config_,
+                                         &alpha_encoder_);
+    u_plane_stride_ = media::VideoFrame::RowBytes(
+        VideoFrame::kUPlane, frame->format(), frame_size.width());
+    v_plane_stride_ = media::VideoFrame::RowBytes(
+        VideoFrame::kVPlane, frame->format(), frame_size.width());
+    v_plane_offset_ = media::VideoFrame::PlaneSize(
+                          frame->format(), VideoFrame::kUPlane, frame_size)
+                          .GetArea();
+    alpha_dummy_planes_.resize(
+        v_plane_offset_ + media::VideoFrame::PlaneSize(
+                              frame->format(), VideoFrame::kVPlane, frame_size)
+                              .GetArea());
+    // It is more expensive to encode 0x00, so use 0x80 instead.
+    std::fill(alpha_dummy_planes_.begin(), alpha_dummy_planes_.end(), 0x80);
+  }
+  // If we introduced a new alpha frame, force keyframe.
+  const bool force_keyframe = frame_has_alpha && !last_frame_had_alpha_;
+  last_frame_had_alpha_ = frame_has_alpha;
 
   std::unique_ptr<std::string> data(new std::string);
   bool keyframe = false;
-  vpx_codec_iter_t iter = NULL;
-  const vpx_codec_cx_pkt_t* pkt = NULL;
-  while ((pkt = vpx_codec_get_cx_data(encoder_.get(), &iter)) != NULL) {
-    if (pkt->kind != VPX_CODEC_CX_FRAME_PKT)
-      continue;
-    data->assign(static_cast<char*>(pkt->data.frame.buf), pkt->data.frame.sz);
-    keyframe = (pkt->data.frame.flags & VPX_FRAME_IS_KEY) != 0;
-    break;
+  DoEncode(encoder_.get(), frame_size, frame->data(VideoFrame::kYPlane),
+           frame->visible_data(VideoFrame::kYPlane),
+           frame->stride(VideoFrame::kYPlane),
+           frame->visible_data(VideoFrame::kUPlane),
+           frame->stride(VideoFrame::kUPlane),
+           frame->visible_data(VideoFrame::kVPlane),
+           frame->stride(VideoFrame::kVPlane), duration, force_keyframe,
+           data.get(), &keyframe);
+
+  std::unique_ptr<std::string> alpha_data(new std::string);
+  if (frame_has_alpha) {
+    bool alpha_keyframe = false;
+    DoEncode(alpha_encoder_.get(), frame_size, frame->data(VideoFrame::kAPlane),
+             frame->visible_data(VideoFrame::kAPlane),
+             frame->stride(VideoFrame::kAPlane), alpha_dummy_planes_.data(),
+             u_plane_stride_, alpha_dummy_planes_.data() + v_plane_offset_,
+             v_plane_stride_, duration, keyframe, alpha_data.get(),
+             &alpha_keyframe);
+    DCHECK_EQ(keyframe, alpha_keyframe);
   }
-  origin_task_runner_->PostTask(FROM_HERE,
-      base::Bind(OnFrameEncodeCompleted,
-                 on_encoded_video_callback_,
-                 video_params,
-                 base::Passed(&data),
-                 capture_timestamp,
-                 keyframe));
+  frame = nullptr;
+
+  origin_task_runner_->PostTask(
+      FROM_HERE,
+      base::Bind(OnFrameEncodeCompleted, on_encoded_video_callback_,
+                 video_params, base::Passed(&data), base::Passed(&alpha_data),
+                 capture_timestamp, keyframe));
 }
 
-void VpxEncoder::ConfigureEncoderOnEncodingTaskRunner(const gfx::Size& size) {
+void VpxEncoder::DoEncode(vpx_codec_ctx_t* const encoder,
+                          const gfx::Size& frame_size,
+                          uint8_t* const data,
+                          uint8_t* const y_plane,
+                          int y_stride,
+                          uint8_t* const u_plane,
+                          int u_stride,
+                          uint8_t* const v_plane,
+                          int v_stride,
+                          const base::TimeDelta& duration,
+                          bool force_keyframe,
+                          std::string* const output_data,
+                          bool* const keyframe) {
   DCHECK(encoding_task_runner_->BelongsToCurrentThread());
-  if (IsInitialized()) {
+
+  vpx_image_t vpx_image;
+  vpx_image_t* const result =
+      vpx_img_wrap(&vpx_image, VPX_IMG_FMT_I420, frame_size.width(),
+                   frame_size.height(), 1 /* align */, data);
+  DCHECK_EQ(result, &vpx_image);
+  vpx_image.planes[VPX_PLANE_Y] = y_plane;
+  vpx_image.planes[VPX_PLANE_U] = u_plane;
+  vpx_image.planes[VPX_PLANE_V] = v_plane;
+  vpx_image.stride[VPX_PLANE_Y] = y_stride;
+  vpx_image.stride[VPX_PLANE_U] = u_stride;
+  vpx_image.stride[VPX_PLANE_V] = v_stride;
+
+  const vpx_codec_flags_t flags = force_keyframe ? VPX_EFLAG_FORCE_KF : 0;
+  // Encode the frame.  The presentation time stamp argument here is fixed to
+  // zero to force the encoder to base its single-frame bandwidth calculations
+  // entirely on |predicted_frame_duration|.
+  const vpx_codec_err_t ret =
+      vpx_codec_encode(encoder, &vpx_image, 0 /* pts */,
+                       duration.InMicroseconds(), flags, VPX_DL_REALTIME);
+  DCHECK_EQ(ret, VPX_CODEC_OK)
+      << vpx_codec_err_to_string(ret) << ", #" << vpx_codec_error(encoder)
+      << " -" << vpx_codec_error_detail(encoder);
+
+  *keyframe = false;
+  vpx_codec_iter_t iter = NULL;
+  const vpx_codec_cx_pkt_t* pkt = NULL;
+  while ((pkt = vpx_codec_get_cx_data(encoder, &iter)) != NULL) {
+    if (pkt->kind != VPX_CODEC_CX_FRAME_PKT)
+      continue;
+    output_data->assign(static_cast<char*>(pkt->data.frame.buf),
+                        pkt->data.frame.sz);
+    *keyframe = (pkt->data.frame.flags & VPX_FRAME_IS_KEY) != 0;
+    break;
+  }
+}
+
+void VpxEncoder::ConfigureEncoderOnEncodingTaskRunner(
+    const gfx::Size& size,
+    vpx_codec_enc_cfg_t* codec_config,
+    ScopedVpxCodecCtxPtr* encoder) {
+  DCHECK(encoding_task_runner_->BelongsToCurrentThread());
+  if (IsInitialized(*codec_config)) {
     // TODO(mcasas) VP8 quirk/optimisation: If the new |size| is strictly less-
     // than-or-equal than the old size, in terms of area, the existing encoder
-    // instance could be reused after changing |codec_config_.{g_w,g_h}|.
+    // instance could be reused after changing |codec_config->{g_w,g_h}|.
     DVLOG(1) << "Destroying/Re-Creating encoder for new frame size: "
-             << gfx::Size(codec_config_.g_w, codec_config_.g_h).ToString()
+             << gfx::Size(codec_config->g_w, codec_config->g_h).ToString()
              << " --> " << size.ToString() << (use_vp9_ ? " vp9" : " vp8");
-    encoder_.reset();
+    encoder->reset();
   }
 
   const vpx_codec_iface_t* codec_interface =
       use_vp9_ ? vpx_codec_vp9_cx() : vpx_codec_vp8_cx();
   vpx_codec_err_t result = vpx_codec_enc_config_default(
-      codec_interface, &codec_config_, 0 /* reserved */);
+      codec_interface, codec_config, 0 /* reserved */);
   DCHECK_EQ(VPX_CODEC_OK, result);
 
-  DCHECK_EQ(320u, codec_config_.g_w);
-  DCHECK_EQ(240u, codec_config_.g_h);
-  DCHECK_EQ(256u, codec_config_.rc_target_bitrate);
+  DCHECK_EQ(320u, codec_config->g_w);
+  DCHECK_EQ(240u, codec_config->g_h);
+  DCHECK_EQ(256u, codec_config->rc_target_bitrate);
   // Use the selected bitrate or adjust default bit rate to account for the
   // actual size.  Note: |rc_target_bitrate| units are kbit per second.
   if (bits_per_second_ > 0) {
-    codec_config_.rc_target_bitrate = bits_per_second_ / 1000;
+    codec_config->rc_target_bitrate = bits_per_second_ / 1000;
   } else {
-    codec_config_.rc_target_bitrate = size.GetArea() *
-                                      codec_config_.rc_target_bitrate /
-                                      codec_config_.g_w / codec_config_.g_h;
+    codec_config->rc_target_bitrate = size.GetArea() *
+                                      codec_config->rc_target_bitrate /
+                                      codec_config->g_w / codec_config->g_h;
   }
   // Both VP8/VP9 configuration should be Variable BitRate by default.
-  DCHECK_EQ(VPX_VBR, codec_config_.rc_end_usage);
+  DCHECK_EQ(VPX_VBR, codec_config->rc_end_usage);
   if (use_vp9_) {
     // Number of frames to consume before producing output.
-    codec_config_.g_lag_in_frames = 0;
+    codec_config->g_lag_in_frames = 0;
 
     // DCHECK that the profile selected by default is I420 (magic number 0).
-    DCHECK_EQ(0u, codec_config_.g_profile);
+    DCHECK_EQ(0u, codec_config->g_profile);
   } else {
     // VP8 always produces frames instantaneously.
-    DCHECK_EQ(0u, codec_config_.g_lag_in_frames);
+    DCHECK_EQ(0u, codec_config->g_lag_in_frames);
   }
 
   DCHECK(size.width());
   DCHECK(size.height());
-  codec_config_.g_w = size.width();
-  codec_config_.g_h = size.height();
-  codec_config_.g_pass = VPX_RC_ONE_PASS;
+  codec_config->g_w = size.width();
+  codec_config->g_h = size.height();
+  codec_config->g_pass = VPX_RC_ONE_PASS;
 
   // Timebase is the smallest interval used by the stream, can be set to the
   // frame rate or to e.g. microseconds.
-  codec_config_.g_timebase.num = 1;
-  codec_config_.g_timebase.den = base::Time::kMicrosecondsPerSecond;
+  codec_config->g_timebase.num = 1;
+  codec_config->g_timebase.den = base::Time::kMicrosecondsPerSecond;
 
   // Let the encoder decide where to place the Keyframes, between min and max.
   // In VPX_KF_AUTO mode libvpx will sometimes emit keyframes regardless of min/
@@ -916,19 +1006,18 @@
   // frames.
   // Forcing a keyframe in regular intervals also allows seeking in the
   // resulting recording with decent performance.
-  codec_config_.kf_mode = VPX_KF_AUTO;
-  codec_config_.kf_min_dist = 0;
-  codec_config_.kf_max_dist = 100;
+  codec_config->kf_mode = VPX_KF_AUTO;
+  codec_config->kf_min_dist = 0;
+  codec_config->kf_max_dist = 100;
 
-  codec_config_.g_threads = GetNumberOfThreadsForEncoding();
+  codec_config->g_threads = GetNumberOfThreadsForEncoding();
 
   // Number of frames to consume before producing output.
-  codec_config_.g_lag_in_frames = 0;
+  codec_config->g_lag_in_frames = 0;
 
-  DCHECK(!encoder_);
-  encoder_.reset(new vpx_codec_ctx_t);
+  encoder->reset(new vpx_codec_ctx_t);
   const vpx_codec_err_t ret = vpx_codec_enc_init(
-      encoder_.get(), codec_interface, &codec_config_, 0 /* flags */);
+      encoder->get(), codec_interface, codec_config, 0 /* flags */);
   DCHECK_EQ(VPX_CODEC_OK, ret);
 
   if (use_vp9_) {
@@ -938,14 +1027,14 @@
     // time encoding) depending on the amount of cores available in the system.
     const int kCpuUsed =
         std::max(5, 8 - base::SysInfo::NumberOfProcessors() / 2);
-    result = vpx_codec_control(encoder_.get(), VP8E_SET_CPUUSED, kCpuUsed);
+    result = vpx_codec_control(encoder->get(), VP8E_SET_CPUUSED, kCpuUsed);
     DLOG_IF(WARNING, VPX_CODEC_OK != result) << "VP8E_SET_CPUUSED failed";
   }
 }
 
-bool VpxEncoder::IsInitialized() const {
+bool VpxEncoder::IsInitialized(const vpx_codec_enc_cfg_t& codec_config) const {
   DCHECK(encoding_task_runner_->BelongsToCurrentThread());
-  return codec_config_.g_timebase.den != 0;
+  return codec_config.g_timebase.den != 0;
 }
 
 base::TimeDelta VpxEncoder::EstimateFrameDuration(
@@ -1053,7 +1142,7 @@
   const bool is_key_frame = info.eFrameType == videoFrameTypeIDR;
   origin_task_runner_->PostTask(
       FROM_HERE, base::Bind(OnFrameEncodeCompleted, on_encoded_video_callback_,
-                            video_params, base::Passed(&data),
+                            video_params, base::Passed(&data), nullptr,
                             capture_timestamp, is_key_frame));
 }
 
@@ -1236,4 +1325,9 @@
       false);
 }
 
+bool VideoTrackRecorder::CanEncodeAlphaChannelForTesting() {
+  DCHECK(encoder_);
+  return encoder_->CanEncodeAlphaChannel();
+}
+
 }  // namespace content
diff --git a/content/renderer/media_recorder/video_track_recorder.h b/content/renderer/media_recorder/video_track_recorder.h
index 895523d..1b62378 100644
--- a/content/renderer/media_recorder/video_track_recorder.h
+++ b/content/renderer/media_recorder/video_track_recorder.h
@@ -51,6 +51,7 @@
   using OnEncodedVideoCB =
       base::Callback<void(const media::WebmMuxer::VideoParameters& params,
                           std::unique_ptr<std::string> encoded_data,
+                          std::unique_ptr<std::string> encoded_alpha,
                           base::TimeTicks capture_timestamp,
                           bool is_key_frame)>;
 
@@ -76,6 +77,9 @@
                          const scoped_refptr<media::VideoFrame>& frame,
                          base::TimeTicks capture_time);
 
+  // TODO(emircan): Remove after refactor, see http://crbug.com/700433.
+  bool CanEncodeAlphaChannelForTesting();
+
   // Used to check that we are destroyed on the same thread we were created.
   base::ThreadChecker main_render_thread_checker_;
 
diff --git a/content/renderer/media_recorder/video_track_recorder_unittest.cc b/content/renderer/media_recorder/video_track_recorder_unittest.cc
index 3440bd7d..615dcad 100644
--- a/content/renderer/media_recorder/video_track_recorder_unittest.cc
+++ b/content/renderer/media_recorder/video_track_recorder_unittest.cc
@@ -57,7 +57,7 @@
 
 class VideoTrackRecorderTest
     : public TestWithParam<
-          testing::tuple<VideoTrackRecorder::CodecId, gfx::Size>> {
+          testing::tuple<VideoTrackRecorder::CodecId, gfx::Size, bool>> {
  public:
   VideoTrackRecorderTest()
       : mock_source_(new MockMediaStreamVideoSource(false)) {
@@ -76,11 +76,6 @@
                                        true /* enabled */);
     blink_track_.setTrackData(track_);
 
-    video_track_recorder_.reset(new VideoTrackRecorder(
-        testing::get<0>(GetParam()) /* codec */, blink_track_,
-        base::Bind(&VideoTrackRecorderTest::OnEncodedVideo,
-                   base::Unretained(this)),
-        0 /* bits_per_second */));
     // Paranoia checks.
     EXPECT_EQ(blink_track_.source().getExtraData(),
               blink_source_.getExtraData());
@@ -94,16 +89,28 @@
     blink::WebHeap::collectAllGarbageForTesting();
   }
 
-  MOCK_METHOD4(DoOnEncodedVideo,
+  void InitializeRecorder(VideoTrackRecorder::CodecId codec) {
+    video_track_recorder_.reset(new VideoTrackRecorder(
+        codec, blink_track_,
+        base::Bind(&VideoTrackRecorderTest::OnEncodedVideo,
+                   base::Unretained(this)),
+        0 /* bits_per_second */));
+  }
+
+  MOCK_METHOD5(DoOnEncodedVideo,
                void(const media::WebmMuxer::VideoParameters& params,
                     std::string encoded_data,
+                    std::string encoded_alpha,
                     base::TimeTicks timestamp,
                     bool keyframe));
   void OnEncodedVideo(const media::WebmMuxer::VideoParameters& params,
                       std::unique_ptr<std::string> encoded_data,
+                      std::unique_ptr<std::string> encoded_alpha,
                       base::TimeTicks timestamp,
                       bool is_key_frame) {
-    DoOnEncodedVideo(params, *encoded_data, timestamp, is_key_frame);
+    DoOnEncodedVideo(params, *encoded_data,
+                     encoded_alpha ? *encoded_alpha : std::string(), timestamp,
+                     is_key_frame);
   }
 
   void Encode(const scoped_refptr<VideoFrame>& frame,
@@ -112,6 +119,10 @@
     video_track_recorder_->OnVideoFrameForTesting(frame, capture_time);
   }
 
+  bool CanEncodeAlphaChannel() {
+    return video_track_recorder_->CanEncodeAlphaChannelForTesting();
+  }
+
   // A ChildProcess and a MessageLoopForUI are both needed to fool the Tracks
   // and Sources below into believing they are on the right threads.
   const base::MessageLoopForUI message_loop_;
@@ -132,16 +143,24 @@
 
 // Construct and destruct all objects, in particular |video_track_recorder_| and
 // its inner object(s). This is a non trivial sequence.
-TEST_P(VideoTrackRecorderTest, ConstructAndDestruct) {}
+TEST_P(VideoTrackRecorderTest, ConstructAndDestruct) {
+  InitializeRecorder(testing::get<0>(GetParam()));
+}
 
-// Creates the encoder and encodes 2 frames of the same size; the encoder should
-// be initialised and produce a keyframe, then a non-keyframe. Finally a frame
-// of larger size is sent and is expected to be encoded as a keyframe.
+// Creates the encoder and encodes 2 frames of the same size; the encoder
+// should be initialised and produce a keyframe, then a non-keyframe. Finally
+// a frame of larger size is sent and is expected to be encoded as a keyframe.
+// If |encode_alpha_channel| is enabled, encoder is expected to return a
+// second output with encoded alpha data.
 TEST_P(VideoTrackRecorderTest, VideoEncoding) {
+  InitializeRecorder(testing::get<0>(GetParam()));
+
+  const bool encode_alpha_channel = testing::get<2>(GetParam());
   // |frame_size| cannot be arbitrarily small, should be reasonable.
   const gfx::Size& frame_size = testing::get<1>(GetParam());
   const scoped_refptr<VideoFrame> video_frame =
-      VideoFrame::CreateBlackFrame(frame_size);
+      encode_alpha_channel ? VideoFrame::CreateTransparentFrame(frame_size)
+                           : VideoFrame::CreateBlackFrame(frame_size);
   const double kFrameRate = 60.0f;
   video_frame->metadata()->SetDouble(media::VideoFrameMetadata::FRAME_RATE,
                                      kFrameRate);
@@ -149,33 +168,40 @@
   InSequence s;
   const base::TimeTicks timeticks_now = base::TimeTicks::Now();
   base::StringPiece first_frame_encoded_data;
-  EXPECT_CALL(*this, DoOnEncodedVideo(_, _, timeticks_now, true))
+  base::StringPiece first_frame_encoded_alpha;
+  EXPECT_CALL(*this, DoOnEncodedVideo(_, _, _, timeticks_now, true))
       .Times(1)
-      .WillOnce(SaveArg<1>(&first_frame_encoded_data));
+      .WillOnce(DoAll(SaveArg<1>(&first_frame_encoded_data),
+                      SaveArg<2>(&first_frame_encoded_alpha)));
   Encode(video_frame, timeticks_now);
 
   // Send another Video Frame.
   const base::TimeTicks timeticks_later = base::TimeTicks::Now();
   base::StringPiece second_frame_encoded_data;
-  EXPECT_CALL(*this, DoOnEncodedVideo(_, _, timeticks_later, false))
+  base::StringPiece second_frame_encoded_alpha;
+  EXPECT_CALL(*this, DoOnEncodedVideo(_, _, _, timeticks_later, false))
       .Times(1)
-      .WillOnce(SaveArg<1>(&second_frame_encoded_data));
+      .WillOnce(DoAll(SaveArg<1>(&second_frame_encoded_data),
+                      SaveArg<2>(&second_frame_encoded_alpha)));
   Encode(video_frame, timeticks_later);
 
   // Send another Video Frame and expect only an DoOnEncodedVideo() callback.
   const gfx::Size frame_size2(frame_size.width() + kTrackRecorderTestSizeDiff,
                               frame_size.height());
   const scoped_refptr<VideoFrame> video_frame2 =
-      VideoFrame::CreateBlackFrame(frame_size2);
+      encode_alpha_channel ? VideoFrame::CreateTransparentFrame(frame_size2)
+                           : VideoFrame::CreateBlackFrame(frame_size2);
 
   base::RunLoop run_loop;
   base::Closure quit_closure = run_loop.QuitClosure();
 
   base::StringPiece third_frame_encoded_data;
-  EXPECT_CALL(*this, DoOnEncodedVideo(_, _, _, true))
+  base::StringPiece third_frame_encoded_alpha;
+  EXPECT_CALL(*this, DoOnEncodedVideo(_, _, _, _, true))
       .Times(1)
       .WillOnce(DoAll(SaveArg<1>(&third_frame_encoded_data),
-                RunClosure(quit_closure)));
+                      SaveArg<2>(&third_frame_encoded_alpha),
+                      RunClosure(quit_closure)));
   Encode(video_frame2, base::TimeTicks::Now());
 
   run_loop.Run();
@@ -185,12 +211,66 @@
   EXPECT_GE(second_frame_encoded_data.size(), kEncodedSizeThreshold);
   EXPECT_GE(third_frame_encoded_data.size(), kEncodedSizeThreshold);
 
+  if (encode_alpha_channel && CanEncodeAlphaChannel()) {
+    EXPECT_GE(first_frame_encoded_alpha.size(), kEncodedSizeThreshold);
+    EXPECT_GE(second_frame_encoded_alpha.size(), kEncodedSizeThreshold);
+    EXPECT_GE(third_frame_encoded_alpha.size(), kEncodedSizeThreshold);
+  } else {
+    const size_t kEmptySize = 0;
+    EXPECT_EQ(first_frame_encoded_alpha.size(), kEmptySize);
+    EXPECT_EQ(second_frame_encoded_alpha.size(), kEmptySize);
+    EXPECT_EQ(third_frame_encoded_alpha.size(), kEmptySize);
+  }
+
+  Mock::VerifyAndClearExpectations(this);
+}
+
+// Inserts an opaque frame followed by two transparent frames and expects the
+// newly introduced transparent frame to force keyframe output.
+TEST_F(VideoTrackRecorderTest, ForceKeyframeOnAlphaSwitch) {
+  InitializeRecorder(VideoTrackRecorder::CodecId::VP8);
+
+  const gfx::Size& frame_size = kTrackRecorderTestSize[0];
+  const scoped_refptr<VideoFrame> opaque_frame =
+      VideoFrame::CreateBlackFrame(frame_size);
+
+  InSequence s;
+  base::StringPiece first_frame_encoded_alpha;
+  EXPECT_CALL(*this, DoOnEncodedVideo(_, _, _, _, true))
+      .Times(1)
+      .WillOnce(SaveArg<2>(&first_frame_encoded_alpha));
+  Encode(opaque_frame, base::TimeTicks::Now());
+
+  const scoped_refptr<VideoFrame> alpha_frame =
+      VideoFrame::CreateTransparentFrame(frame_size);
+  base::StringPiece second_frame_encoded_alpha;
+  EXPECT_CALL(*this, DoOnEncodedVideo(_, _, _, _, true))
+      .Times(1)
+      .WillOnce(SaveArg<2>(&second_frame_encoded_alpha));
+  Encode(alpha_frame, base::TimeTicks::Now());
+
+  base::RunLoop run_loop;
+  base::Closure quit_closure = run_loop.QuitClosure();
+  base::StringPiece third_frame_encoded_alpha;
+  EXPECT_CALL(*this, DoOnEncodedVideo(_, _, _, _, false))
+      .Times(1)
+      .WillOnce(DoAll(SaveArg<2>(&third_frame_encoded_alpha),
+                      RunClosure(quit_closure)));
+  Encode(alpha_frame, base::TimeTicks::Now());
+  run_loop.Run();
+
+  const size_t kEmptySize = 0;
+  EXPECT_EQ(first_frame_encoded_alpha.size(), kEmptySize);
+  EXPECT_GT(second_frame_encoded_alpha.size(), kEmptySize);
+  EXPECT_GT(third_frame_encoded_alpha.size(), kEmptySize);
+
   Mock::VerifyAndClearExpectations(this);
 }
 
 INSTANTIATE_TEST_CASE_P(,
                         VideoTrackRecorderTest,
                         ::testing::Combine(ValuesIn(kTrackRecorderTestCodec),
-                                           ValuesIn(kTrackRecorderTestSize)));
+                                           ValuesIn(kTrackRecorderTestSize),
+                                           ::testing::Bool()));
 
 }  // namespace content
diff --git a/ios/chrome/browser/ui/history/history_entry_inserter_unittest.mm b/ios/chrome/browser/ui/history/history_entry_inserter_unittest.mm
index 2ae31774..80ab2e77 100644
--- a/ios/chrome/browser/ui/history/history_entry_inserter_unittest.mm
+++ b/ios/chrome/browser/ui/history/history_entry_inserter_unittest.mm
@@ -94,7 +94,8 @@
 
 // Tests that items from different dates are added in correctly ordered
 // sections.
-TEST_F(HistoryEntryInserterTest, AddSections) {
+// TODO(crbug.com/700814): Reneable it.
+TEST_F(HistoryEntryInserterTest, DISABLED_AddSections) {
   base::Time today =
       base::Time::Now().LocalMidnight() + base::TimeDelta::FromHours(1);
   base::TimeDelta day = base::TimeDelta::FromDays(1);
diff --git a/media/muxers/webm_muxer.cc b/media/muxers/webm_muxer.cc
index 02a4ca9..5b98472f 100644
--- a/media/muxers/webm_muxer.cc
+++ b/media/muxers/webm_muxer.cc
@@ -134,6 +134,7 @@
 
 bool WebmMuxer::OnEncodedVideo(const VideoParameters& params,
                                std::unique_ptr<std::string> encoded_data,
+                               std::unique_ptr<std::string> encoded_alpha,
                                base::TimeTicks timestamp,
                                bool is_key_frame) {
   DVLOG(1) << __func__ << " - " << encoded_data->size() << "B";
@@ -154,15 +155,17 @@
       encoded_frames_queue_.clear();
 
     encoded_frames_queue_.push_back(base::MakeUnique<EncodedVideoFrame>(
-        std::move(encoded_data), timestamp, is_key_frame));
+        std::move(encoded_data), std::move(encoded_alpha), timestamp,
+        is_key_frame));
     return true;
   }
 
   // Any saved encoded video frames must have been dumped in OnEncodedAudio();
   DCHECK(encoded_frames_queue_.empty());
 
-  return AddFrame(std::move(encoded_data), video_track_index_,
-                  timestamp - first_frame_timestamp_video_, is_key_frame);
+  return AddFrame(std::move(encoded_data), std::move(encoded_alpha),
+                  video_track_index_, timestamp - first_frame_timestamp_video_,
+                  is_key_frame);
 }
 
 bool WebmMuxer::OnEncodedAudio(const media::AudioParameters& params,
@@ -188,6 +191,10 @@
   while (!encoded_frames_queue_.empty()) {
     const bool res = AddFrame(
         base::MakeUnique<std::string>(*encoded_frames_queue_.front()->data),
+        encoded_frames_queue_.front()->alpha_data
+            ? base::MakeUnique<std::string>(
+                  *encoded_frames_queue_.front()->alpha_data)
+            : nullptr,
         video_track_index_,
         encoded_frames_queue_.front()->timestamp - first_frame_timestamp_video_,
         encoded_frames_queue_.front()->is_keyframe);
@@ -195,8 +202,7 @@
       return false;
     encoded_frames_queue_.pop_front();
   }
-
-  return AddFrame(std::move(encoded_data), audio_track_index_,
+  return AddFrame(std::move(encoded_data), nullptr, audio_track_index_,
                   timestamp - first_frame_timestamp_audio_,
                   true /* is_key_frame -- always true for audio */);
 }
@@ -240,6 +246,14 @@
   DCHECK_EQ(0ull, video_track->crop_bottom());
   DCHECK_EQ(0.0f, video_track->frame_rate());
 
+  video_track->SetAlphaMode(mkvmuxer::VideoTrack::kAlpha);
+  // Alpha channel, if present, is stored in a BlockAdditional next to the
+  // associated opaque Block, see
+  // https://matroska.org/technical/specs/index.html#BlockAdditional.
+  // This follows Method 1 for VP8 encoding of A-channel described on
+  // http://wiki.webmproject.org/alpha-channel.
+  video_track->set_max_block_additional_id(1);
+
   // Segment's timestamps should be in milliseconds, DCHECK it. See
   // http://www.webmproject.org/docs/container/#muxer-guidelines
   DCHECK_EQ(1000000ull, segment_.GetSegmentInfo()->timecode_scale());
@@ -308,6 +322,7 @@
 }
 
 bool WebmMuxer::AddFrame(std::unique_ptr<std::string> encoded_data,
+                         std::unique_ptr<std::string> encoded_alpha,
                          uint8_t track_index,
                          base::TimeDelta timestamp,
                          bool is_key_frame) {
@@ -325,9 +340,21 @@
   }
 
   DCHECK(encoded_data->data());
-  return segment_.AddFrame(
+  if (!encoded_alpha || encoded_alpha->empty()) {
+    return segment_.AddFrame(
+        reinterpret_cast<const uint8_t*>(encoded_data->data()),
+        encoded_data->size(), track_index,
+        most_recent_timestamp_.InMicroseconds() *
+            base::Time::kNanosecondsPerMicrosecond,
+        is_key_frame);
+  }
+
+  DCHECK(encoded_alpha->data());
+  return segment_.AddFrameWithAdditional(
       reinterpret_cast<const uint8_t*>(encoded_data->data()),
-      encoded_data->size(), track_index,
+      encoded_data->size(),
+      reinterpret_cast<const uint8_t*>(encoded_alpha->data()),
+      encoded_alpha->size(), 1 /* add_id */, track_index,
       most_recent_timestamp_.InMicroseconds() *
           base::Time::kNanosecondsPerMicrosecond,
       is_key_frame);
@@ -335,9 +362,13 @@
 
 WebmMuxer::EncodedVideoFrame::EncodedVideoFrame(
     std::unique_ptr<std::string> data,
+    std::unique_ptr<std::string> alpha_data,
     base::TimeTicks timestamp,
     bool is_keyframe)
-    : data(std::move(data)), timestamp(timestamp), is_keyframe(is_keyframe) {}
+    : data(std::move(data)),
+      alpha_data(std::move(alpha_data)),
+      timestamp(timestamp),
+      is_keyframe(is_keyframe) {}
 
 WebmMuxer::EncodedVideoFrame::~EncodedVideoFrame() {}
 
diff --git a/media/muxers/webm_muxer.h b/media/muxers/webm_muxer.h
index e8ac3a4..7066890 100644
--- a/media/muxers/webm_muxer.h
+++ b/media/muxers/webm_muxer.h
@@ -67,8 +67,11 @@
 
   // Functions to add video and audio frames with |encoded_data.data()|
   // to WebM Segment. Either one returns true on success.
+  // |encoded_alpha| represents the encode output of alpha channel when
+  // available, can be nullptr otherwise.
   bool OnEncodedVideo(const VideoParameters& params,
                       std::unique_ptr<std::string> encoded_data,
+                      std::unique_ptr<std::string> encoded_alpha,
                       base::TimeTicks timestamp,
                       bool is_key_frame);
   bool OnEncodedAudio(const media::AudioParameters& params,
@@ -101,6 +104,7 @@
 
   // Helper to simplify saving frames. Returns true on success.
   bool AddFrame(std::unique_ptr<std::string> encoded_data,
+                std::unique_ptr<std::string> encoded_alpha_data,
                 uint8_t track_index,
                 base::TimeDelta timestamp,
                 bool is_key_frame);
@@ -145,11 +149,13 @@
   // received, if expected, since WebM headers can only be written once.
   struct EncodedVideoFrame {
     EncodedVideoFrame(std::unique_ptr<std::string> data,
+                      std::unique_ptr<std::string> alpha_data,
                       base::TimeTicks timestamp,
                       bool is_keyframe);
     ~EncodedVideoFrame();
 
     std::unique_ptr<std::string> data;
+    std::unique_ptr<std::string> alpha_data;
     base::TimeTicks timestamp;
     bool is_keyframe;
 
diff --git a/media/muxers/webm_muxer_fuzzertest.cc b/media/muxers/webm_muxer_fuzzertest.cc
index 6193f3ad..dd68c69 100644
--- a/media/muxers/webm_muxer_fuzzertest.cc
+++ b/media/muxers/webm_muxer_fuzzertest.cc
@@ -65,9 +65,12 @@
         const auto visible_rect = gfx::Size(16 + rng() % 128, 16 + rng() % 128);
         const auto video_frame = VideoFrame::CreateBlackFrame(visible_rect);
         const auto is_key_frame = rng() % 2;
-        muxer.OnEncodedVideo(WebmMuxer::VideoParameters(video_frame),
-                             base::MakeUnique<std::string>(str),
-                             base::TimeTicks(), is_key_frame);
+        const auto has_alpha_frame = rng() % 4;
+        muxer.OnEncodedVideo(
+            WebmMuxer::VideoParameters(video_frame),
+            base::MakeUnique<std::string>(str),
+            has_alpha_frame ? base::MakeUnique<std::string>(str) : nullptr,
+            base::TimeTicks(), is_key_frame);
         base::RunLoop run_loop;
         run_loop.RunUntilIdle();
       }
diff --git a/media/muxers/webm_muxer_unittest.cc b/media/muxers/webm_muxer_unittest.cc
index 8dcceb8..139092f 100644
--- a/media/muxers/webm_muxer_unittest.cc
+++ b/media/muxers/webm_muxer_unittest.cc
@@ -111,8 +111,8 @@
           WithArgs<0>(Invoke(this, &WebmMuxerTest::SaveEncodedDataLen)));
   EXPECT_TRUE(webm_muxer_.OnEncodedVideo(
       WebmMuxer::VideoParameters(video_frame),
-      base::WrapUnique(new std::string(encoded_data)), base::TimeTicks::Now(),
-      false /* keyframe */));
+      base::WrapUnique(new std::string(encoded_data)), nullptr,
+      base::TimeTicks::Now(), false /* keyframe */));
 
   // First time around WriteCallback() is pinged a number of times to write the
   // Matroska header, but at the end it dumps |encoded_data|.
@@ -127,7 +127,7 @@
       .WillRepeatedly(
           WithArgs<0>(Invoke(this, &WebmMuxerTest::SaveEncodedDataLen)));
   EXPECT_TRUE(webm_muxer_.OnEncodedVideo(
-      video_frame, base::WrapUnique(new std::string(encoded_data)),
+      video_frame, base::WrapUnique(new std::string(encoded_data)), nullptr,
       base::TimeTicks::Now(), false /* keyframe */));
 
   // The second time around the callbacks should include a SimpleBlock header,
@@ -141,10 +141,66 @@
 
   // Force an error in libwebm and expect OnEncodedVideo to fail.
   webm_muxer_.ForceOneLibWebmErrorForTesting();
-  EXPECT_FALSE(
-      webm_muxer_.OnEncodedVideo(WebmMuxer::VideoParameters(video_frame),
-                                 base::MakeUnique<std::string>(encoded_data),
-                                 base::TimeTicks::Now(), true /* keyframe */));
+  EXPECT_FALSE(webm_muxer_.OnEncodedVideo(
+      WebmMuxer::VideoParameters(video_frame),
+      base::MakeUnique<std::string>(encoded_data), nullptr,
+      base::TimeTicks::Now(), true /* keyframe */));
+}
+
+// This test sends two transparent frames and checks that the WriteCallback is
+// called with appropriate params in both cases.
+TEST_P(WebmMuxerTest, OnEncodedVideoTwoAlphaFrames) {
+  if (GetParam().num_audio_tracks > 0)
+    return;
+
+  const gfx::Size frame_size(160, 80);
+  const scoped_refptr<VideoFrame> video_frame =
+      VideoFrame::CreateTransparentFrame(frame_size);
+  const std::string encoded_data("abcdefghijklmnopqrstuvwxyz");
+  const std::string alpha_encoded_data("ijklmnopqrstuvwxyz");
+
+  InSequence s;
+  EXPECT_CALL(*this, WriteCallback(_))
+      .Times(AtLeast(1))
+      .WillRepeatedly(
+          WithArgs<0>(Invoke(this, &WebmMuxerTest::SaveEncodedDataLen)));
+  EXPECT_TRUE(webm_muxer_.OnEncodedVideo(
+      WebmMuxer::VideoParameters(video_frame),
+      base::WrapUnique(new std::string(encoded_data)),
+      base::WrapUnique(new std::string(alpha_encoded_data)),
+      base::TimeTicks::Now(), true /* keyframe */));
+
+  EXPECT_EQ(GetWebmMuxerPosition(), accumulated_position_);
+  EXPECT_GE(GetWebmMuxerPosition(), static_cast<int64_t>(last_encoded_length_));
+  EXPECT_EQ(GetWebmSegmentMode(), mkvmuxer::Segment::kLive);
+
+  const int64_t begin_of_second_block = accumulated_position_;
+  EXPECT_CALL(*this, WriteCallback(_))
+      .Times(AtLeast(1))
+      .WillRepeatedly(
+          WithArgs<0>(Invoke(this, &WebmMuxerTest::SaveEncodedDataLen)));
+  EXPECT_TRUE(webm_muxer_.OnEncodedVideo(
+      video_frame, base::WrapUnique(new std::string(encoded_data)),
+      base::WrapUnique(new std::string(alpha_encoded_data)),
+      base::TimeTicks::Now(), false /* keyframe */));
+
+  EXPECT_EQ(GetWebmMuxerPosition(), accumulated_position_);
+  // Alpha introduces additional elements to be written, see
+  // mkvmuxer::WriteBlock().
+  const uint32_t kBlockGroupSize = 2u;
+  const uint32_t kSimpleBlockSize = 6u;
+  const uint32_t kAdditionsSize = 13u;
+  EXPECT_EQ(static_cast<int64_t>(begin_of_second_block + kBlockGroupSize +
+                                 kSimpleBlockSize + encoded_data.size() +
+                                 kAdditionsSize + alpha_encoded_data.size()),
+            accumulated_position_);
+
+  // Force an error in libwebm and expect OnEncodedVideo to fail.
+  webm_muxer_.ForceOneLibWebmErrorForTesting();
+  EXPECT_FALSE(webm_muxer_.OnEncodedVideo(
+      WebmMuxer::VideoParameters(video_frame),
+      base::MakeUnique<std::string>(encoded_data), nullptr,
+      base::TimeTicks::Now(), true /* keyframe */));
 }
 
 TEST_P(WebmMuxerTest, OnEncodedAudioTwoFrames) {
@@ -215,14 +271,14 @@
   const std::string encoded_video("thisisanencodedvideopacket");
   EXPECT_TRUE(webm_muxer_.OnEncodedVideo(
       WebmMuxer::VideoParameters(video_frame),
-      base::WrapUnique(new std::string(encoded_video)), base::TimeTicks::Now(),
-      true /* keyframe */));
+      base::WrapUnique(new std::string(encoded_video)), nullptr,
+      base::TimeTicks::Now(), true /* keyframe */));
   // A few encoded non key frames.
   const int kNumNonKeyFrames = 2;
   for (int i = 0; i < kNumNonKeyFrames; ++i) {
     EXPECT_TRUE(webm_muxer_.OnEncodedVideo(
         WebmMuxer::VideoParameters(video_frame),
-        base::WrapUnique(new std::string(encoded_video)),
+        base::WrapUnique(new std::string(encoded_video)), nullptr,
         base::TimeTicks::Now(), false /* keyframe */));
   }
 
diff --git a/third_party/WebKit/LayoutTests/ASANExpectations b/third_party/WebKit/LayoutTests/ASANExpectations
index ab85cb0..021eb38 100644
--- a/third_party/WebKit/LayoutTests/ASANExpectations
+++ b/third_party/WebKit/LayoutTests/ASANExpectations
@@ -89,6 +89,7 @@
 
 # Flakily timeout on Linux ASAN bots.
 crbug.com/243871 [ Linux ] virtual/threaded/fast/scroll-behavior/ [ Skip ]
+crbug.com/700795 [ Linux ] inspector/animation/animation-transition-setTiming-crash.html [ Skip ]
 
 # Reliably timeout on Linux ASAN bots.
 crbug.com/248938 [ Linux ] virtual/threaded/animations/transition-and-animation-2.html [ Skip ]
diff --git a/third_party/WebKit/LayoutTests/MSANExpectations b/third_party/WebKit/LayoutTests/MSANExpectations
index 4752f735..b54417b4 100644
--- a/third_party/WebKit/LayoutTests/MSANExpectations
+++ b/third_party/WebKit/LayoutTests/MSANExpectations
@@ -23,6 +23,7 @@
 
 crbug.com/450639 [ Linux ] inspector/tracing/animations.html [ Timeout ]
 crbug.com/450639 [ Linux ] virtual/deferred/inspector/tracing/animations.html [ Timeout ]
+crbug.com/700795 [ Linux ] inspector/animation/animation-transition-setTiming-crash.html [ Skip ]
 
 crbug.com/454267 [ Linux ] virtual/gpu/fast/canvas/canvas-arc-360-winding.html [ Crash ]
 crbug.com/454267 [ Linux ] virtual/gpu/fast/canvas/canvas-ellipse-360-winding.html [ Crash ]
diff --git a/third_party/WebKit/LayoutTests/TestExpectations b/third_party/WebKit/LayoutTests/TestExpectations
index 36e9fe2..db9fe02c 100644
--- a/third_party/WebKit/LayoutTests/TestExpectations
+++ b/third_party/WebKit/LayoutTests/TestExpectations
@@ -106,17 +106,6 @@
 
 crbug.com/644433 virtual/gpu/fast/canvas/OffscreenCanvas-2d-pattern-in-worker.html [ Failure ]
 
-crbug.com/688647 paint/invalidation/transform-inline-layered-child.html [ NeedsRebaseline ]
-crbug.com/688647 paint/invalidation/create-layer-repaint.html [ NeedsRebaseline ]
-crbug.com/688647 paint/invalidation/scroll-descendant-with-cached-cliprects.html [ NeedsRebaseline ]
-crbug.com/688647 paint/invalidation/svg/tabgroup.svg [ NeedsRebaseline ]
-crbug.com/688647 paint/invalidation/svg/text-repaint-including-stroke.svg [ NeedsRebaseline ]
-crbug.com/688647 virtual/disable-spinvalidation/paint/invalidation/transform-inline-layered-child.html [ NeedsRebaseline ]
-crbug.com/688647 virtual/disable-spinvalidation/paint/invalidation/create-layer-repaint.html [ NeedsRebaseline ]
-crbug.com/688647 virtual/disable-spinvalidation/paint/invalidation/scroll-descendant-with-cached-cliprects.html [ NeedsRebaseline ]
-crbug.com/688647 virtual/disable-spinvalidation/paint/invalidation/svg/tabgroup.svg [ NeedsRebaseline ]
-crbug.com/688647 virtual/disable-spinvalidation/paint/invalidation/svg/text-repaint-including-stroke.svg [ NeedsRebaseline ]
-
 
 crbug.com/645389 [ Win ] virtual/gpu/fast/canvas/canvas-hit-regions-fallback-element-test.html [ Timeout ]
 crbug.com/645389 [ Win ] virtual/gpu/fast/canvas/canvas-hit-regions-event-test.html [ Timeout ]
@@ -651,6 +640,150 @@
 crbug.com/635619 virtual/layout_ng/fast/block/float/line-break-after-white-space-crash.html [ Skip ]
 crbug.com/635619 virtual/layout_ng/fast/block/float/max-width-clear-float-with-overflow-hidden.html [ Skip ]
 crbug.com/635619 virtual/layout_ng/fast/block/float/trailing-float-with-content.html [ Skip ]
+
+#### external/csswg-test/css21/linebox
+#### Passed: 39
+#### Skipped: 138
+# Crashes
+crbug.com/636993 virtual/layout_ng/external/csswg-test/css21/linebox/inline-formatting-context-011.xht [ Skip ]
+crbug.com/636993 virtual/layout_ng/external/csswg-test/css21/linebox/line-height-applies-to-012.xht [ Skip ]
+crbug.com/636993 virtual/layout_ng/external/csswg-test/css21/linebox/line-height-applies-to-014.xht [ Skip ]
+crbug.com/636993 virtual/layout_ng/external/csswg-test/css21/linebox/vertical-align-applies-to-012.xht [ Skip ]
+crbug.com/636993 virtual/layout_ng/external/csswg-test/css21/linebox/vertical-align-applies-to-014.xht [ Skip ]
+crbug.com/636993 virtual/layout_ng/external/csswg-test/css21/linebox/vertical-align-baseline-003.xht [ Skip ]
+crbug.com/636993 virtual/layout_ng/external/csswg-test/css21/linebox/vertical-align-baseline-005a.xht [ Skip ]
+# Image failures
+crbug.com/636993 virtual/layout_ng/external/csswg-test/css21/linebox/border-padding-bleed-001.xht [ Skip ]
+crbug.com/636993 virtual/layout_ng/external/csswg-test/css21/linebox/border-padding-bleed-002.xht [ Skip ]
+crbug.com/636993 virtual/layout_ng/external/csswg-test/css21/linebox/border-padding-bleed-003.xht [ Skip ]
+crbug.com/636993 virtual/layout_ng/external/csswg-test/css21/linebox/empty-inline-002.xht [ Skip ]
+crbug.com/636993 virtual/layout_ng/external/csswg-test/css21/linebox/empty-inline-003.xht [ Skip ]
+crbug.com/636993 virtual/layout_ng/external/csswg-test/css21/linebox/inline-formatting-context-001.xht [ Skip ]
+crbug.com/636993 virtual/layout_ng/external/csswg-test/css21/linebox/inline-formatting-context-002.xht [ Skip ]
+crbug.com/636993 virtual/layout_ng/external/csswg-test/css21/linebox/inline-formatting-context-003.xht [ Skip ]
+crbug.com/636993 virtual/layout_ng/external/csswg-test/css21/linebox/inline-formatting-context-004.xht [ Skip ]
+crbug.com/636993 virtual/layout_ng/external/csswg-test/css21/linebox/inline-formatting-context-005.xht [ Skip ]
+crbug.com/636993 virtual/layout_ng/external/csswg-test/css21/linebox/inline-formatting-context-006.xht [ Skip ]
+crbug.com/636993 virtual/layout_ng/external/csswg-test/css21/linebox/inline-formatting-context-007.xht [ Skip ]
+crbug.com/636993 virtual/layout_ng/external/csswg-test/css21/linebox/inline-formatting-context-012.xht [ Skip ]
+crbug.com/636993 virtual/layout_ng/external/csswg-test/css21/linebox/inline-formatting-context-013.xht [ Skip ]
+crbug.com/636993 virtual/layout_ng/external/csswg-test/css21/linebox/inline-formatting-context-015.xht [ Skip ]
+crbug.com/636993 virtual/layout_ng/external/csswg-test/css21/linebox/inline-formatting-context-022.xht [ Skip ]
+crbug.com/636993 virtual/layout_ng/external/csswg-test/css21/linebox/inline-formatting-context-023.xht [ Skip ]
+crbug.com/636993 virtual/layout_ng/external/csswg-test/css21/linebox/line-box-height-002.xht [ Skip ]
+crbug.com/636993 virtual/layout_ng/external/csswg-test/css21/linebox/line-height-002.xht [ Skip ]
+crbug.com/636993 virtual/layout_ng/external/csswg-test/css21/linebox/line-height-004.xht [ Skip ]
+crbug.com/636993 virtual/layout_ng/external/csswg-test/css21/linebox/line-height-005.xht [ Skip ]
+crbug.com/636993 virtual/layout_ng/external/csswg-test/css21/linebox/line-height-006.xht [ Skip ]
+crbug.com/636993 virtual/layout_ng/external/csswg-test/css21/linebox/line-height-007.xht [ Skip ]
+crbug.com/636993 virtual/layout_ng/external/csswg-test/css21/linebox/line-height-013.xht [ Skip ]
+crbug.com/636993 virtual/layout_ng/external/csswg-test/css21/linebox/line-height-015.xht [ Skip ]
+crbug.com/636993 virtual/layout_ng/external/csswg-test/css21/linebox/line-height-016.xht [ Skip ]
+crbug.com/636993 virtual/layout_ng/external/csswg-test/css21/linebox/line-height-017.xht [ Skip ]
+crbug.com/636993 virtual/layout_ng/external/csswg-test/css21/linebox/line-height-018.xht [ Skip ]
+crbug.com/636993 virtual/layout_ng/external/csswg-test/css21/linebox/line-height-024.xht [ Skip ]
+crbug.com/636993 virtual/layout_ng/external/csswg-test/css21/linebox/line-height-025.xht [ Skip ]
+crbug.com/636993 virtual/layout_ng/external/csswg-test/css21/linebox/line-height-026.xht [ Skip ]
+crbug.com/636993 virtual/layout_ng/external/csswg-test/css21/linebox/line-height-027.xht [ Skip ]
+crbug.com/636993 virtual/layout_ng/external/csswg-test/css21/linebox/line-height-028.xht [ Skip ]
+crbug.com/636993 virtual/layout_ng/external/csswg-test/css21/linebox/line-height-029.xht [ Skip ]
+crbug.com/636993 virtual/layout_ng/external/csswg-test/css21/linebox/line-height-035.xht [ Skip ]
+crbug.com/636993 virtual/layout_ng/external/csswg-test/css21/linebox/line-height-037.xht [ Skip ]
+crbug.com/636993 virtual/layout_ng/external/csswg-test/css21/linebox/line-height-038.xht [ Skip ]
+crbug.com/636993 virtual/layout_ng/external/csswg-test/css21/linebox/line-height-039.xht [ Skip ]
+crbug.com/636993 virtual/layout_ng/external/csswg-test/css21/linebox/line-height-040.xht [ Skip ]
+crbug.com/636993 virtual/layout_ng/external/csswg-test/css21/linebox/line-height-046.xht [ Skip ]
+crbug.com/636993 virtual/layout_ng/external/csswg-test/css21/linebox/line-height-048.xht [ Skip ]
+crbug.com/636993 virtual/layout_ng/external/csswg-test/css21/linebox/line-height-049.xht [ Skip ]
+crbug.com/636993 virtual/layout_ng/external/csswg-test/css21/linebox/line-height-050.xht [ Skip ]
+crbug.com/636993 virtual/layout_ng/external/csswg-test/css21/linebox/line-height-051.xht [ Skip ]
+crbug.com/636993 virtual/layout_ng/external/csswg-test/css21/linebox/line-height-057.xht [ Skip ]
+crbug.com/636993 virtual/layout_ng/external/csswg-test/css21/linebox/line-height-058.xht [ Skip ]
+crbug.com/636993 virtual/layout_ng/external/csswg-test/css21/linebox/line-height-059.xht [ Skip ]
+crbug.com/636993 virtual/layout_ng/external/csswg-test/css21/linebox/line-height-060.xht [ Skip ]
+crbug.com/636993 virtual/layout_ng/external/csswg-test/css21/linebox/line-height-061.xht [ Skip ]
+crbug.com/636993 virtual/layout_ng/external/csswg-test/css21/linebox/line-height-062.xht [ Skip ]
+crbug.com/636993 virtual/layout_ng/external/csswg-test/css21/linebox/line-height-068.xht [ Skip ]
+crbug.com/636993 virtual/layout_ng/external/csswg-test/css21/linebox/line-height-069.xht [ Skip ]
+crbug.com/636993 virtual/layout_ng/external/csswg-test/css21/linebox/line-height-070.xht [ Skip ]
+crbug.com/636993 virtual/layout_ng/external/csswg-test/css21/linebox/line-height-071.xht [ Skip ]
+crbug.com/636993 virtual/layout_ng/external/csswg-test/css21/linebox/line-height-072.xht [ Skip ]
+crbug.com/636993 virtual/layout_ng/external/csswg-test/css21/linebox/line-height-073.xht [ Skip ]
+crbug.com/636993 virtual/layout_ng/external/csswg-test/css21/linebox/line-height-079.xht [ Skip ]
+crbug.com/636993 virtual/layout_ng/external/csswg-test/css21/linebox/line-height-080.xht [ Skip ]
+crbug.com/636993 virtual/layout_ng/external/csswg-test/css21/linebox/line-height-081.xht [ Skip ]
+crbug.com/636993 virtual/layout_ng/external/csswg-test/css21/linebox/line-height-082.xht [ Skip ]
+crbug.com/636993 virtual/layout_ng/external/csswg-test/css21/linebox/line-height-083.xht [ Skip ]
+crbug.com/636993 virtual/layout_ng/external/csswg-test/css21/linebox/line-height-084.xht [ Skip ]
+crbug.com/636993 virtual/layout_ng/external/csswg-test/css21/linebox/line-height-090.xht [ Skip ]
+crbug.com/636993 virtual/layout_ng/external/csswg-test/css21/linebox/line-height-092.xht [ Skip ]
+crbug.com/636993 virtual/layout_ng/external/csswg-test/css21/linebox/line-height-093.xht [ Skip ]
+crbug.com/636993 virtual/layout_ng/external/csswg-test/css21/linebox/line-height-094.xht [ Skip ]
+crbug.com/636993 virtual/layout_ng/external/csswg-test/css21/linebox/line-height-095.xht [ Skip ]
+crbug.com/636993 virtual/layout_ng/external/csswg-test/css21/linebox/line-height-101.xht [ Skip ]
+crbug.com/636993 virtual/layout_ng/external/csswg-test/css21/linebox/line-height-102.xht [ Skip ]
+crbug.com/636993 virtual/layout_ng/external/csswg-test/css21/linebox/line-height-103.xht [ Skip ]
+crbug.com/636993 virtual/layout_ng/external/csswg-test/css21/linebox/line-height-104.xht [ Skip ]
+crbug.com/636993 virtual/layout_ng/external/csswg-test/css21/linebox/line-height-105.xht [ Skip ]
+crbug.com/636993 virtual/layout_ng/external/csswg-test/css21/linebox/line-height-106.xht [ Skip ]
+crbug.com/636993 virtual/layout_ng/external/csswg-test/css21/linebox/line-height-112.xht [ Skip ]
+crbug.com/636993 virtual/layout_ng/external/csswg-test/css21/linebox/line-height-121.xht [ Skip ]
+crbug.com/636993 virtual/layout_ng/external/csswg-test/css21/linebox/line-height-125.xht [ Skip ]
+crbug.com/636993 virtual/layout_ng/external/csswg-test/css21/linebox/line-height-126.xht [ Skip ]
+crbug.com/636993 virtual/layout_ng/external/csswg-test/css21/linebox/line-height-127.xht [ Skip ]
+crbug.com/636993 virtual/layout_ng/external/csswg-test/css21/linebox/line-height-128.xht [ Skip ]
+crbug.com/636993 virtual/layout_ng/external/csswg-test/css21/linebox/line-height-129.xht [ Skip ]
+crbug.com/636993 virtual/layout_ng/external/csswg-test/css21/linebox/line-height-applies-to-001.xht [ Skip ]
+crbug.com/636993 virtual/layout_ng/external/csswg-test/css21/linebox/line-height-applies-to-002.xht [ Skip ]
+crbug.com/636993 virtual/layout_ng/external/csswg-test/css21/linebox/line-height-applies-to-003.xht [ Skip ]
+crbug.com/636993 virtual/layout_ng/external/csswg-test/css21/linebox/line-height-applies-to-004.xht [ Skip ]
+crbug.com/636993 virtual/layout_ng/external/csswg-test/css21/linebox/line-height-applies-to-005.xht [ Skip ]
+crbug.com/636993 virtual/layout_ng/external/csswg-test/css21/linebox/line-height-applies-to-006.xht [ Skip ]
+crbug.com/636993 virtual/layout_ng/external/csswg-test/css21/linebox/line-height-applies-to-007.xht [ Skip ]
+crbug.com/636993 virtual/layout_ng/external/csswg-test/css21/linebox/line-height-applies-to-008.xht [ Skip ]
+crbug.com/636993 virtual/layout_ng/external/csswg-test/css21/linebox/line-height-applies-to-009.xht [ Skip ]
+crbug.com/636993 virtual/layout_ng/external/csswg-test/css21/linebox/line-height-applies-to-013.xht [ Skip ]
+crbug.com/636993 virtual/layout_ng/external/csswg-test/css21/linebox/line-height-applies-to-015.xht [ Skip ]
+crbug.com/636993 virtual/layout_ng/external/csswg-test/css21/linebox/line-height-applies-to-016.xht [ Skip ]
+crbug.com/636993 virtual/layout_ng/external/csswg-test/css21/linebox/line-height-bleed-001.xht [ Skip ]
+crbug.com/636993 virtual/layout_ng/external/csswg-test/css21/linebox/line-height-bleed-002.xht [ Skip ]
+crbug.com/636993 virtual/layout_ng/external/csswg-test/css21/linebox/vertical-align-007.xht [ Skip ]
+crbug.com/636993 virtual/layout_ng/external/csswg-test/css21/linebox/vertical-align-008.xht [ Skip ]
+crbug.com/636993 virtual/layout_ng/external/csswg-test/css21/linebox/vertical-align-019.xht [ Skip ]
+crbug.com/636993 virtual/layout_ng/external/csswg-test/css21/linebox/vertical-align-020.xht [ Skip ]
+crbug.com/636993 virtual/layout_ng/external/csswg-test/css21/linebox/vertical-align-031.xht [ Skip ]
+crbug.com/636993 virtual/layout_ng/external/csswg-test/css21/linebox/vertical-align-032.xht [ Skip ]
+crbug.com/636993 virtual/layout_ng/external/csswg-test/css21/linebox/vertical-align-043.xht [ Skip ]
+crbug.com/636993 virtual/layout_ng/external/csswg-test/css21/linebox/vertical-align-044.xht [ Skip ]
+crbug.com/636993 virtual/layout_ng/external/csswg-test/css21/linebox/vertical-align-055.xht [ Skip ]
+crbug.com/636993 virtual/layout_ng/external/csswg-test/css21/linebox/vertical-align-056.xht [ Skip ]
+crbug.com/636993 virtual/layout_ng/external/csswg-test/css21/linebox/vertical-align-067.xht [ Skip ]
+crbug.com/636993 virtual/layout_ng/external/csswg-test/css21/linebox/vertical-align-068.xht [ Skip ]
+crbug.com/636993 virtual/layout_ng/external/csswg-test/css21/linebox/vertical-align-079.xht [ Skip ]
+crbug.com/636993 virtual/layout_ng/external/csswg-test/css21/linebox/vertical-align-080.xht [ Skip ]
+crbug.com/636993 virtual/layout_ng/external/csswg-test/css21/linebox/vertical-align-091.xht [ Skip ]
+crbug.com/636993 virtual/layout_ng/external/csswg-test/css21/linebox/vertical-align-092.xht [ Skip ]
+crbug.com/636993 virtual/layout_ng/external/csswg-test/css21/linebox/vertical-align-103.xht [ Skip ]
+crbug.com/636993 virtual/layout_ng/external/csswg-test/css21/linebox/vertical-align-104.xht [ Skip ]
+crbug.com/636993 virtual/layout_ng/external/csswg-test/css21/linebox/vertical-align-117a.xht [ Skip ]
+crbug.com/636993 virtual/layout_ng/external/csswg-test/css21/linebox/vertical-align-118a.xht [ Skip ]
+crbug.com/636993 virtual/layout_ng/external/csswg-test/css21/linebox/vertical-align-121.xht [ Skip ]
+crbug.com/636993 virtual/layout_ng/external/csswg-test/css21/linebox/vertical-align-applies-to-001.xht [ Skip ]
+crbug.com/636993 virtual/layout_ng/external/csswg-test/css21/linebox/vertical-align-applies-to-002.xht [ Skip ]
+crbug.com/636993 virtual/layout_ng/external/csswg-test/css21/linebox/vertical-align-applies-to-003.xht [ Skip ]
+crbug.com/636993 virtual/layout_ng/external/csswg-test/css21/linebox/vertical-align-applies-to-004.xht [ Skip ]
+crbug.com/636993 virtual/layout_ng/external/csswg-test/css21/linebox/vertical-align-applies-to-005.xht [ Skip ]
+crbug.com/636993 virtual/layout_ng/external/csswg-test/css21/linebox/vertical-align-applies-to-006.xht [ Skip ]
+crbug.com/636993 virtual/layout_ng/external/csswg-test/css21/linebox/vertical-align-applies-to-007.xht [ Skip ]
+crbug.com/636993 virtual/layout_ng/external/csswg-test/css21/linebox/vertical-align-applies-to-008.xht [ Skip ]
+crbug.com/636993 virtual/layout_ng/external/csswg-test/css21/linebox/vertical-align-applies-to-009.xht [ Skip ]
+crbug.com/636993 virtual/layout_ng/external/csswg-test/css21/linebox/vertical-align-applies-to-013.xht [ Skip ]
+crbug.com/636993 virtual/layout_ng/external/csswg-test/css21/linebox/vertical-align-applies-to-015.xht [ Skip ]
+crbug.com/636993 virtual/layout_ng/external/csswg-test/css21/linebox/vertical-align-baseline-001.xht [ Skip ]
+crbug.com/636993 virtual/layout_ng/external/csswg-test/css21/linebox/vertical-align-baseline-002.xht [ Skip ]
+crbug.com/636993 virtual/layout_ng/external/csswg-test/css21/linebox/vertical-align-baseline-004a.xht [ Skip ]
+crbug.com/636993 virtual/layout_ng/external/csswg-test/css21/linebox/vertical-align-sub-001.xht [ Skip ]
+crbug.com/636993 virtual/layout_ng/external/csswg-test/css21/linebox/vertical-align-super-001.xht [ Skip ]
 # ====== LayoutNG-only failures until here ======
 
 # Requires ServiceWorkerNavigationPreload feature enabled. Run under
@@ -1280,6 +1413,8 @@
 crbug.com/472330 fast/writing-mode/box-shadow-vertical-lr.html [ Failure ]
 crbug.com/472330 fast/writing-mode/box-shadow-vertical-rl.html [ Failure ]
 
+crbug.com/700795 [ Mac ] inspector/animation/animation-transition-setTiming-crash.html [ Timeout Pass ]
+
 # Flaky on Win10 and Win7
 crbug.com/619539 [ Win ] http/tests/workers/terminate-during-sync-operation-file.html [ Pass Timeout ]
 crbug.com/619539 [ Win ] virtual/mojo-loading/http/tests/workers/terminate-during-sync-operation-file.html [ Pass Timeout ]
@@ -1559,18 +1694,6 @@
 
 crbug.com/474759 fast/writing-mode/vertical-rl-replaced-selection.html [ Failure ]
 
-# Cleanup after http://crrev.com/2731393002
-crbug.com/696216 fast/table/backgr_border-table-row-group.html [ NeedsRebaseline ]
-crbug.com/696216 fast/table/backgr_position-table-row-group.html [ NeedsRebaseline ]
-crbug.com/696216 fast/table/backgr_simple-table.html [ NeedsRebaseline ]
-crbug.com/696216 svg/batik/text/textAnchor3.svg [ NeedsRebaseline ]
-crbug.com/696216 svg/wicd/test-scalable-background-image2.xhtml [ NeedsRebaseline ]
-crbug.com/696216 svg/W3C-SVG-1.1/animate-elem-02-t.svg [ NeedsRebaseline ]
-crbug.com/696216 svg/W3C-SVG-1.1/fonts-elem-07-b.svg [ NeedsRebaseline ]
-crbug.com/696216 svg/W3C-SVG-1.1-SE/coords-dom-02-f.svg [ NeedsRebaseline ]
-crbug.com/696216 virtual/mojo-loading/http/tests/webfont/popup-menu-load-webfont-after-open.html [ NeedsRebaseline ]
-crbug.com/696216 fast/forms/select/menulist-appearance-rtl.html [ NeedsRebaseline ]
-
 crbug.com/353746 virtual/android/fullscreen/video-specified-size.html [ Failure Pass ]
 
 crbug.com/527270 accessibility/name-calc-img.html [ Failure Pass Timeout ]
diff --git a/third_party/WebKit/LayoutTests/VirtualTestSuites b/third_party/WebKit/LayoutTests/VirtualTestSuites
index 5cf81b26..ee2cf64 100644
--- a/third_party/WebKit/LayoutTests/VirtualTestSuites
+++ b/third_party/WebKit/LayoutTests/VirtualTestSuites
@@ -346,6 +346,11 @@
     "args": ["--enable-blink-features=LayoutNG, LayoutNGInline"]
   },
   {
+    "prefix": "layout_ng",
+    "base": "external/csswg-test/css21/linebox",
+    "args": ["--enable-blink-features=LayoutNG, LayoutNGInline"]
+  },
+  {
     "prefix": "feature-policy",
     "base": "http/tests/feature-policy",
     "args": ["--enable-blink-features=FeaturePolicy"]
diff --git a/third_party/WebKit/LayoutTests/W3CImportExpectations b/third_party/WebKit/LayoutTests/W3CImportExpectations
index b164493..f17bbf5 100644
--- a/third_party/WebKit/LayoutTests/W3CImportExpectations
+++ b/third_party/WebKit/LayoutTests/W3CImportExpectations
@@ -465,28 +465,6 @@
 external/wpt/html/semantics/embedded-content/the-video-element/video_initially_paused.html [ Skip ]
 
 # crbug.com/493537: Need to support SVG reference tests
-external/wpt/dom/nodes/Document-createElement-namespace-tests/bare_mathml.svg [ Skip ]
-external/wpt/dom/nodes/Document-createElement-namespace-tests/bare_svg.svg [ Skip ]
-external/wpt/dom/nodes/Document-createElement-namespace-tests/bare_xhtml.svg [ Skip ]
-external/wpt/dom/nodes/Document-createElement-namespace-tests/empty.svg [ Skip ]
-external/wpt/dom/nodes/Document-createElement-namespace-tests/mathml.svg [ Skip ]
-external/wpt/dom/nodes/Document-createElement-namespace-tests/minimal_html.svg [ Skip ]
-external/wpt/dom/nodes/Document-createElement-namespace-tests/svg.svg [ Skip ]
-external/wpt/dom/nodes/Document-createElement-namespace-tests/xhtml.svg [ Skip ]
-external/wpt/dom/nodes/Document-createElement-namespace-tests/xhtml_ns_changed.svg [ Skip ]
-external/wpt/dom/nodes/Document-createElement-namespace-tests/xhtml_ns_removed.svg [ Skip ]
-external/wpt/dom/nodes/Element-childElement-null-svg.svg [ Skip ]
-external/wpt/dom/nodes/Element-childElementCount-dynamic-add-svg.svg [ Skip ]
-external/wpt/dom/nodes/Element-childElementCount-dynamic-remove-svg.svg [ Skip ]
-external/wpt/dom/nodes/Element-childElementCount-nochild-svg.svg [ Skip ]
-external/wpt/dom/nodes/Element-childElementCount-svg.svg [ Skip ]
-external/wpt/dom/nodes/Element-firstElementChild-entity.svg [ Skip ]
-external/wpt/dom/nodes/Element-firstElementChild-namespace-svg.svg [ Skip ]
-external/wpt/dom/nodes/Element-firstElementChild-svg.svg [ Skip ]
-external/wpt/dom/nodes/Element-lastElementChild-svg.svg [ Skip ]
-external/wpt/dom/nodes/Element-nextElementSibling-svg.svg [ Skip ]
-external/wpt/dom/nodes/Element-previousElementSibling-svg.svg [ Skip ]
-external/wpt/dom/nodes/Element-siblingElement-null-svg.svg [ Skip ]
 external/wpt/html/editing/the-hidden-attribute/hidden-2.svg [ Skip ]
 external/wpt/svg/shapes/rect-01.svg [ Skip ]
 external/wpt/svg/shapes/rect-02.svg [ Skip ]
diff --git a/third_party/WebKit/LayoutTests/external/wpt/domparsing/innerhtml-01-expected.txt b/third_party/WebKit/LayoutTests/external/wpt/domparsing/innerhtml-01-expected.txt
index 1c27e5c7..ee21362 100644
--- a/third_party/WebKit/LayoutTests/external/wpt/domparsing/innerhtml-01-expected.txt
+++ b/third_party/WebKit/LayoutTests/external/wpt/domparsing/innerhtml-01-expected.txt
@@ -1,4 +1,4 @@
- This is a testharness.js-based test.
+This is a testharness.js-based test.
 FAIL innerHTML in XHTML: getting while the document is in an invalid state assert_throws: getting element with ":" in its local name function "function () {
     document.documentElement.innerHTML;
   }" did not throw
diff --git a/third_party/WebKit/LayoutTests/fast/dom/getElementsByClassName/001-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/getElementsByClassName/001-expected.txt
deleted file mode 100644
index 7ef22e9..0000000
--- a/third_party/WebKit/LayoutTests/fast/dom/getElementsByClassName/001-expected.txt
+++ /dev/null
@@ -1 +0,0 @@
-PASS
diff --git a/third_party/WebKit/LayoutTests/fast/dom/getElementsByClassName/001.html b/third_party/WebKit/LayoutTests/fast/dom/getElementsByClassName/001.html
deleted file mode 100644
index 930aae5..0000000
--- a/third_party/WebKit/LayoutTests/fast/dom/getElementsByClassName/001.html
+++ /dev/null
@@ -1,11 +0,0 @@
-<!doctype html>
-<html class="a">
- <head>
-  <title>document.getElementsByClassName(): simple</title>
-  <script src="resources/common.js"></script>
- </head>
- <body class="a">
-  <p id="r">FAIL (script did not run)</p>
-  <script> t(document.getElementsByClassName("\ta\n"), [document.documentElement, document.body]) </script>
- </body>
-</html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/getElementsByClassName/002-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/getElementsByClassName/002-expected.txt
deleted file mode 100644
index 7ef22e9..0000000
--- a/third_party/WebKit/LayoutTests/fast/dom/getElementsByClassName/002-expected.txt
+++ /dev/null
@@ -1 +0,0 @@
-PASS
diff --git a/third_party/WebKit/LayoutTests/fast/dom/getElementsByClassName/002.html b/third_party/WebKit/LayoutTests/fast/dom/getElementsByClassName/002.html
deleted file mode 100644
index d91b0ac..0000000
--- a/third_party/WebKit/LayoutTests/fast/dom/getElementsByClassName/002.html
+++ /dev/null
@@ -1,13 +0,0 @@
-<!doctype html>
-<html class="a
-b">
- <head>
-  <title>document.getElementsByClassName(): also simple</title>
-  <script src="resources/common.js"></script>
- </head>
- <body class="a
-">
-  <p id="r">FAIL (script did not run)</p>
-  <script> t(document.getElementsByClassName("a\n"), [document.documentElement, document.body]) </script>
- </body>
-</html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/getElementsByClassName/003-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/getElementsByClassName/003-expected.txt
deleted file mode 100644
index 7ef22e9..0000000
--- a/third_party/WebKit/LayoutTests/fast/dom/getElementsByClassName/003-expected.txt
+++ /dev/null
@@ -1 +0,0 @@
-PASS
diff --git a/third_party/WebKit/LayoutTests/fast/dom/getElementsByClassName/003.html b/third_party/WebKit/LayoutTests/fast/dom/getElementsByClassName/003.html
deleted file mode 100644
index 661dbba..0000000
--- a/third_party/WebKit/LayoutTests/fast/dom/getElementsByClassName/003.html
+++ /dev/null
@@ -1,15 +0,0 @@
-<!doctype html>
-<html class="a">
- <head>
-  <title>document.getElementsByClassName(): changing classes</title>
-  <script src="resources/common.js"></script>
- </head>
- <body class="a">
-  <p id="r">FAIL (script did not run)</p>
-  <script>
-   var collection = document.getElementsByClassName("a")
-   document.body.className = "b"
-   t(collection, [document.documentElement])
-  </script>
- </body>
-</html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/getElementsByClassName/004-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/getElementsByClassName/004-expected.txt
deleted file mode 100644
index 7ef22e9..0000000
--- a/third_party/WebKit/LayoutTests/fast/dom/getElementsByClassName/004-expected.txt
+++ /dev/null
@@ -1 +0,0 @@
-PASS
diff --git a/third_party/WebKit/LayoutTests/fast/dom/getElementsByClassName/004.html b/third_party/WebKit/LayoutTests/fast/dom/getElementsByClassName/004.html
deleted file mode 100644
index a932dd11..0000000
--- a/third_party/WebKit/LayoutTests/fast/dom/getElementsByClassName/004.html
+++ /dev/null
@@ -1,15 +0,0 @@
-<!doctype html>
-<html class="a">
- <head>
-  <title>document.getElementsByClassName(): changing classes</title>
-  <script src="resources/common.js"></script>
- </head>
- <body class="a">
-  <p id="r">FAIL (script did not run)</p>
-  <script>
-   var collection = document.getElementsByClassName("a")
-   document.body.className += "\tb"
-   t(collection, [document.documentElement, document.body])
-  </script>
- </body>
-</html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/getElementsByClassName/005-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/getElementsByClassName/005-expected.txt
deleted file mode 100644
index 7ef22e9..0000000
--- a/third_party/WebKit/LayoutTests/fast/dom/getElementsByClassName/005-expected.txt
+++ /dev/null
@@ -1 +0,0 @@
-PASS
diff --git a/third_party/WebKit/LayoutTests/fast/dom/getElementsByClassName/005.html b/third_party/WebKit/LayoutTests/fast/dom/getElementsByClassName/005.html
deleted file mode 100644
index 5a609db..0000000
--- a/third_party/WebKit/LayoutTests/fast/dom/getElementsByClassName/005.html
+++ /dev/null
@@ -1,15 +0,0 @@
-<!doctype html>
-<html class="a">
- <head>
-  <title>document.getElementsByClassName(): changing classes</title>
-  <script src="resources/common.js"></script>
- </head>
- <body class="a">
-  <p id="r">FAIL (script did not run)</p>
-  <script>
-   var collection = document.getElementsByClassName("a")
-   document.body.removeAttribute("class")
-   t(collection, [document.documentElement])
-  </script>
- </body>
-</html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/getElementsByClassName/006-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/getElementsByClassName/006-expected.txt
deleted file mode 100644
index 9976b120..0000000
--- a/third_party/WebKit/LayoutTests/fast/dom/getElementsByClassName/006-expected.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-PASS
-
-
diff --git a/third_party/WebKit/LayoutTests/fast/dom/getElementsByClassName/006.html b/third_party/WebKit/LayoutTests/fast/dom/getElementsByClassName/006.html
deleted file mode 100644
index 89be60bb..0000000
--- a/third_party/WebKit/LayoutTests/fast/dom/getElementsByClassName/006.html
+++ /dev/null
@@ -1,17 +0,0 @@
-<!doctype html>
-<html>
- <head>
-  <title>document.getElementsByClassName(): adding element with class</title>
-  <script src="resources/common.js"></script>
- </head>
- <body class="a">
-  <p id="r">FAIL (script did not run)</p>
-  <script>
-   var collection = document.getElementsByClassName("a"),
-       ele = document.createElement("foo");
-   ele.setAttribute("class", "a");
-   document.body.appendChild(ele)
-   t(collection, [document.body, ele])
-  </script>
- </body>
-</html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/getElementsByClassName/007-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/getElementsByClassName/007-expected.txt
deleted file mode 100644
index 7ef22e9..0000000
--- a/third_party/WebKit/LayoutTests/fast/dom/getElementsByClassName/007-expected.txt
+++ /dev/null
@@ -1 +0,0 @@
-PASS
diff --git a/third_party/WebKit/LayoutTests/fast/dom/getElementsByClassName/007.html b/third_party/WebKit/LayoutTests/fast/dom/getElementsByClassName/007.html
deleted file mode 100644
index bb013df..0000000
--- a/third_party/WebKit/LayoutTests/fast/dom/getElementsByClassName/007.html
+++ /dev/null
@@ -1,11 +0,0 @@
-<!doctype html>
-<html>
- <head>
-  <title>document.getElementsByClassName(): multiple classes</title>
-  <script src="resources/common.js"></script>
- </head>
- <body class="a b">
-  <p id="r">FAIL (script did not run)</p>
-  <script> t(document.getElementsByClassName("b\t\f\n\na\rb"), [document.body]) </script>
- </body>
-</html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/getElementsByClassName/008-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/getElementsByClassName/008-expected.txt
deleted file mode 100644
index 7ef22e9..0000000
--- a/third_party/WebKit/LayoutTests/fast/dom/getElementsByClassName/008-expected.txt
+++ /dev/null
@@ -1 +0,0 @@
-PASS
diff --git a/third_party/WebKit/LayoutTests/fast/dom/getElementsByClassName/008.html b/third_party/WebKit/LayoutTests/fast/dom/getElementsByClassName/008.html
deleted file mode 100644
index b60129d..0000000
--- a/third_party/WebKit/LayoutTests/fast/dom/getElementsByClassName/008.html
+++ /dev/null
@@ -1,11 +0,0 @@
-<!doctype html>
-<html>
- <head>
-  <title>document.getElementsByClassName(): multiple classes</title>
-  <script src="resources/common.js"></script>
- </head>
- <body class="a">
-  <p id="r">FAIL (script did not run)</p>
-  <script> t(document.getElementsByClassName("a\fa"), [document.body]) </script>
- </body>
-</html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/getElementsByClassName/009-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/getElementsByClassName/009-expected.txt
deleted file mode 100644
index 7ef22e9..0000000
--- a/third_party/WebKit/LayoutTests/fast/dom/getElementsByClassName/009-expected.txt
+++ /dev/null
@@ -1 +0,0 @@
-PASS
diff --git a/third_party/WebKit/LayoutTests/fast/dom/getElementsByClassName/009.html b/third_party/WebKit/LayoutTests/fast/dom/getElementsByClassName/009.html
deleted file mode 100644
index ce52987..0000000
--- a/third_party/WebKit/LayoutTests/fast/dom/getElementsByClassName/009.html
+++ /dev/null
@@ -1,11 +0,0 @@
-<!doctype html>
-<html class="a A">
- <head>
-  <title>document.getElementsByClassName(): case sensitive</title>
-  <script src="resources/common.js"></script>
- </head>
- <body class="a a">
-  <p id="r">FAIL (script did not run)</p>
-  <script> t(document.getElementsByClassName("A a"), [document.documentElement]) </script>
- </body>
-</html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/getElementsByClassName/010-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/getElementsByClassName/010-expected.txt
deleted file mode 100644
index 9976b120..0000000
--- a/third_party/WebKit/LayoutTests/fast/dom/getElementsByClassName/010-expected.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-PASS
-
-
diff --git a/third_party/WebKit/LayoutTests/fast/dom/getElementsByClassName/010.xml b/third_party/WebKit/LayoutTests/fast/dom/getElementsByClassName/010.xml
deleted file mode 100644
index 44f8474b..0000000
--- a/third_party/WebKit/LayoutTests/fast/dom/getElementsByClassName/010.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-<html xmlns="http://www.w3.org/1999/xhtml" xmlns:g="http://www.w3.org/2000/svg">
- <head>
-  <title>document.getElementsByClassName(): compound</title>
-  <script src="resources/common.js"></script>
- </head>
- <body>
-  <p id="r">FAIL (script did not run)</p>  
-  <x class="a"/>
-  <g:x class="a"/>
-  <script> t(document.getElementsByClassName("a"), document.getElementsByTagName("x")) </script>
- </body>
-</html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/getElementsByClassName/011-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/getElementsByClassName/011-expected.txt
deleted file mode 100644
index 9976b120..0000000
--- a/third_party/WebKit/LayoutTests/fast/dom/getElementsByClassName/011-expected.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-PASS
-
-
diff --git a/third_party/WebKit/LayoutTests/fast/dom/getElementsByClassName/011.xml b/third_party/WebKit/LayoutTests/fast/dom/getElementsByClassName/011.xml
deleted file mode 100644
index 4ace9f5..0000000
--- a/third_party/WebKit/LayoutTests/fast/dom/getElementsByClassName/011.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-<html xmlns="http://www.w3.org/1999/xhtml" xmlns:g="http://www.w3.org/2000/svg" xmlns:h="http://www.w3.org/1999/xhtml" xmlns:t="http://tc.labs.opera.com/#test">
- <head>
-  <title>document.getElementsByClassName(): "tricky" compound</title>
-  <script src="resources/common.js"></script>
- </head>
- <body>
-  <p id="r">FAIL (script did not run)</p>  
-  <x class="a"/>
-  <g:x class="a"/>
-  <x t:class="a" h:class="a" g:class="a"/>
-  <g:x t:class="a" h:class="a" g:class="a"/>
-  <t:x class="a" t:class="a" h:class="a" g:class="a"/>
-  <script>
-   var collection = document.getElementsByClassName("a"),
-       test = document.getElementsByTagNameNS("*", "x")
-   t(collection, [test[0], test[1], test[4]])
-  </script>
- </body>
-</html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/getElementsByClassName/012-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/getElementsByClassName/012-expected.txt
deleted file mode 100644
index 7ef22e9..0000000
--- a/third_party/WebKit/LayoutTests/fast/dom/getElementsByClassName/012-expected.txt
+++ /dev/null
@@ -1 +0,0 @@
-PASS
diff --git a/third_party/WebKit/LayoutTests/fast/dom/getElementsByClassName/012.html b/third_party/WebKit/LayoutTests/fast/dom/getElementsByClassName/012.html
deleted file mode 100644
index ed933449..0000000
--- a/third_party/WebKit/LayoutTests/fast/dom/getElementsByClassName/012.html
+++ /dev/null
@@ -1,11 +0,0 @@
-<!doctype html>
-<html class="a">
- <head>
-  <title>element.getElementsByClassName(): simple</title>
-  <script src="resources/common.js"></script>
- </head>
- <body class="a">
-  <p id="r">FAIL (script did not run)</p>
-  <script> t(document.body.getElementsByClassName("a"), []) </script>
- </body>
-</html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/getElementsByClassName/013-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/getElementsByClassName/013-expected.txt
deleted file mode 100644
index 9976b120..0000000
--- a/third_party/WebKit/LayoutTests/fast/dom/getElementsByClassName/013-expected.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-PASS
-
-
diff --git a/third_party/WebKit/LayoutTests/fast/dom/getElementsByClassName/013.html b/third_party/WebKit/LayoutTests/fast/dom/getElementsByClassName/013.html
deleted file mode 100644
index 7c8c232..0000000
--- a/third_party/WebKit/LayoutTests/fast/dom/getElementsByClassName/013.html
+++ /dev/null
@@ -1,17 +0,0 @@
-<!doctype html>
-<html class="a">
- <head>
-  <title>element.getElementsByClassName(): adding an element</title>
-  <script src="resources/common.js"></script>
- </head>
- <body class="a">
-  <p id="r">FAIL (script did not run)</p>
-  <script>
-   var collection = document.body.getElementsByClassName("a"),
-       ele = document.createElement("x-y-z")
-   ele.className = "a"
-   document.body.appendChild(ele) 
-   t(collection, [ele])
-  </script>
- </body>
-</html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/getElementsByClassName/014-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/getElementsByClassName/014-expected.txt
deleted file mode 100644
index 7ef22e9..0000000
--- a/third_party/WebKit/LayoutTests/fast/dom/getElementsByClassName/014-expected.txt
+++ /dev/null
@@ -1 +0,0 @@
-PASS
diff --git a/third_party/WebKit/LayoutTests/fast/dom/getElementsByClassName/014.html b/third_party/WebKit/LayoutTests/fast/dom/getElementsByClassName/014.html
deleted file mode 100644
index 29dff66..0000000
--- a/third_party/WebKit/LayoutTests/fast/dom/getElementsByClassName/014.html
+++ /dev/null
@@ -1,14 +0,0 @@
-<html class="a A">
- <head>
-  <title>document.getElementsByClassName(): case sensitive (quirks mode)</title>
-  <script src="resources/common.js"></script>
- </head>
- <body class="a a">
-  <p id="r">FAIL (script did not run)</p>
-  <script>
-    // We differ from Opera's implementation here.  We are case-insensitive in quirks mode.
-    // t(document.getElementsByClassName("A a"), [document.documentElement])
-    t(document.getElementsByClassName("A a"), [document.documentElement, document.body])
-  </script>
- </body>
-</html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/getElementsByClassName/array/001-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/getElementsByClassName/array/001-expected.txt
deleted file mode 100644
index 7ef22e9..0000000
--- a/third_party/WebKit/LayoutTests/fast/dom/getElementsByClassName/array/001-expected.txt
+++ /dev/null
@@ -1 +0,0 @@
-PASS
diff --git a/third_party/WebKit/LayoutTests/fast/dom/getElementsByClassName/array/001.html b/third_party/WebKit/LayoutTests/fast/dom/getElementsByClassName/array/001.html
deleted file mode 100644
index d002002..0000000
--- a/third_party/WebKit/LayoutTests/fast/dom/getElementsByClassName/array/001.html
+++ /dev/null
@@ -1,13 +0,0 @@
-<!doctype html>
-<html class="a
-b">
- <head>
-  <title>document.getElementsByClassName(array): "a\n"</title>
-  <script src="../resources/common.js"></script>
- </head>
- <body class="a
-">
-  <p id="r">FAIL (script did not run)</p>
-  <script> t(document.getElementsByClassName(["a\n"]), [document.documentElement, document.body]) </script>
- </body>
-</html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/getElementsByClassName/array/002-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/getElementsByClassName/array/002-expected.txt
deleted file mode 100644
index 7ef22e9..0000000
--- a/third_party/WebKit/LayoutTests/fast/dom/getElementsByClassName/array/002-expected.txt
+++ /dev/null
@@ -1 +0,0 @@
-PASS
diff --git a/third_party/WebKit/LayoutTests/fast/dom/getElementsByClassName/array/002.html b/third_party/WebKit/LayoutTests/fast/dom/getElementsByClassName/array/002.html
deleted file mode 100644
index 2148e5e7..0000000
--- a/third_party/WebKit/LayoutTests/fast/dom/getElementsByClassName/array/002.html
+++ /dev/null
@@ -1,12 +0,0 @@
-<!doctype html>
-<html class="a
-b">
- <head>
-  <title>document.getElementsByClassName(array): "b","a"</title>
-  <script src="../resources/common.js"></script>
- </head>
- <body class="b,a">
-  <p id="r">FAIL (script did not run)</p>
-  <script> t(document.getElementsByClassName(["b", "a"]), [document.body]) </script>
- </body>
-</html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/getElementsByClassName/array/003-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/getElementsByClassName/array/003-expected.txt
deleted file mode 100644
index 7ef22e9..0000000
--- a/third_party/WebKit/LayoutTests/fast/dom/getElementsByClassName/array/003-expected.txt
+++ /dev/null
@@ -1 +0,0 @@
-PASS
diff --git a/third_party/WebKit/LayoutTests/fast/dom/getElementsByClassName/array/003.html b/third_party/WebKit/LayoutTests/fast/dom/getElementsByClassName/array/003.html
deleted file mode 100644
index e110dc9..0000000
--- a/third_party/WebKit/LayoutTests/fast/dom/getElementsByClassName/array/003.html
+++ /dev/null
@@ -1,11 +0,0 @@
-<!doctype html>
-<html>
- <head>
-  <title>document.getElementsByClassName(array): "b a"</title>
-  <script src="../resources/common.js"></script>
- </head>
- <body class="a b">
-  <p id="r">FAIL (script did not run)</p>
-  <script> t(document.getElementsByClassName(["b a"]), [document.body]) </script>
- </body>
-</html>
diff --git a/third_party/WebKit/LayoutTests/fast/dom/getElementsByClassName/array/004-expected.txt b/third_party/WebKit/LayoutTests/fast/dom/getElementsByClassName/array/004-expected.txt
deleted file mode 100644
index 7ef22e9..0000000
--- a/third_party/WebKit/LayoutTests/fast/dom/getElementsByClassName/array/004-expected.txt
+++ /dev/null
@@ -1 +0,0 @@
-PASS
diff --git a/third_party/WebKit/LayoutTests/fast/dom/getElementsByClassName/array/004.html b/third_party/WebKit/LayoutTests/fast/dom/getElementsByClassName/array/004.html
deleted file mode 100644
index 37405095..0000000
--- a/third_party/WebKit/LayoutTests/fast/dom/getElementsByClassName/array/004.html
+++ /dev/null
@@ -1,11 +0,0 @@
-<!doctype html>
-<html class="a,b">
- <head>
-  <title>element.getElementsByClassName(array): "a", "b"</title>
-  <script src="../resources/common.js"></script>
- </head>
- <body class="a,b x">
-  <p id="r" class="a,bx">FAIL (script did not run)</p>
-  <script class="xa,b"> t(document.documentElement.getElementsByClassName(["\fa","b\n"]), [document.body]) </script>
- </body>
-</html>
diff --git a/third_party/WebKit/LayoutTests/inspector/animation/animation-transition-setTiming-crash-expected.txt b/third_party/WebKit/LayoutTests/inspector/animation/animation-transition-setTiming-crash-expected.txt
new file mode 100644
index 0000000..4900486
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/inspector/animation/animation-transition-setTiming-crash-expected.txt
@@ -0,0 +1,3 @@
+This test passes if it does not crash.
+
+
diff --git a/third_party/WebKit/LayoutTests/inspector/animation/animation-transition-setTiming-crash.html b/third_party/WebKit/LayoutTests/inspector/animation/animation-transition-setTiming-crash.html
new file mode 100644
index 0000000..88f3a898
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/inspector/animation/animation-transition-setTiming-crash.html
@@ -0,0 +1,45 @@
+<html>
+<head>
+<style>
+#node {
+    transition: left 100s;
+    left: 0px;
+}
+</style>
+<script src="../../http/tests/inspector/inspector-test.js"></script>
+<script src="../../http/tests/inspector/elements-test.js"></script>
+<script>
+function startCSSTransition() {
+    // Force style recalcs that will trigger a transition.
+    getComputedStyle(node).left;
+    node.style.left = "100px";
+    getComputedStyle(node).left;
+}
+
+var initialize_Animations = function() {
+    InspectorTest.preloadModule("animation");
+}
+
+function test() {
+    UI.viewManager.showView("animations");
+    var timeline = self.runtime.sharedInstance(Animation.AnimationTimeline);
+    InspectorTest.evaluateInPage("startCSSTransition()");
+    InspectorTest.waitForAnimationAdded(animationAdded);
+    function animationAdded(group) {
+        group.animations()[0].setTiming(1, 0);
+        InspectorTest.completeTest();
+    }
+}
+
+</script>
+</head>
+
+<body onload="runTest()">
+<p>
+This test passes if it does not crash.
+</p>
+
+<div id="node"></div>
+
+</body>
+</html>
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/create-layer-repaint-expected.txt b/third_party/WebKit/LayoutTests/paint/invalidation/create-layer-repaint-expected.txt
index abb2baf2..866d316 100644
--- a/third_party/WebKit/LayoutTests/paint/invalidation/create-layer-repaint-expected.txt
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/create-layer-repaint-expected.txt
@@ -10,6 +10,11 @@
           "object": "LayoutBlockFlow DIV id='test' class='stretchy'",
           "rect": [28, 54, 500, 50],
           "reason": "subtree"
+        },
+        {
+          "object": "LayoutBlockFlow DIV id='test' class='stretchy'",
+          "rect": [28, 54, 250, 50],
+          "reason": "subtree"
         }
       ]
     }
@@ -18,6 +23,10 @@
     {
       "object": "LayoutBlockFlow DIV id='test' class='stretchy'",
       "reason": "subtree"
+    },
+    {
+      "object": "LayoutBlockFlow DIV id='test' class='stretchy'",
+      "reason": "subtree"
     }
   ]
 }
diff --git a/third_party/WebKit/LayoutTests/paint/invalidation/scroll-descendant-with-cached-cliprects-expected.txt b/third_party/WebKit/LayoutTests/paint/invalidation/scroll-descendant-with-cached-cliprects-expected.txt
index d8ca61c4..3774d52 100644
--- a/third_party/WebKit/LayoutTests/paint/invalidation/scroll-descendant-with-cached-cliprects-expected.txt
+++ b/third_party/WebKit/LayoutTests/paint/invalidation/scroll-descendant-with-cached-cliprects-expected.txt
@@ -12,17 +12,7 @@
           "reason": "subtree"
         },
         {
-          "object": "LayoutBlockFlow (relative positioned) DIV id='ul'",
-          "rect": [677, 250, 100, 100],
-          "reason": "subtree"
-        },
-        {
-          "object": "LayoutBlockFlow DIV",
-          "rect": [677, 250, 100, 100],
-          "reason": "subtree"
-        },
-        {
-          "object": "LayoutBlockFlow (positioned) DIV id='scrollpanel'",
+          "object": "LayoutBlockFlow (relative positioned) DIV class='container'",
           "rect": [677, 50, 100, 100],
           "reason": "subtree"
         },
@@ -35,12 +25,33 @@
           "object": "LayoutBlockFlow DIV",
           "rect": [677, 50, 100, 100],
           "reason": "subtree"
+        },
+        {
+          "object": "LayoutBlockFlow DIV id='scrollpanel'",
+          "rect": [677, 50, 100, 100],
+          "reason": "subtree"
         }
       ]
     }
   ],
   "objectPaintInvalidations": [
     {
+      "object": "LayoutBlockFlow DIV id='scrollpanel'",
+      "reason": "subtree"
+    },
+    {
+      "object": "LayoutBlockFlow (relative positioned) DIV class='container'",
+      "reason": "subtree"
+    },
+    {
+      "object": "LayoutBlockFlow (relative positioned) DIV id='ul'",
+      "reason": "subtree"
+    },
+    {
+      "object": "LayoutBlockFlow DIV",
+      "reason": "subtree"
+    },
+    {
       "object": "LayoutBlockFlow (positioned) DIV id='scrollpanel'",
       "reason": "style change"
     },
diff --git a/third_party/WebKit/LayoutTests/platform/android/svg/W3C-SVG-1.1-SE/coords-dom-02-f-expected.png b/third_party/WebKit/LayoutTests/platform/android/svg/W3C-SVG-1.1-SE/coords-dom-02-f-expected.png
index a7d53706..78a7c6f 100644
--- a/third_party/WebKit/LayoutTests/platform/android/svg/W3C-SVG-1.1-SE/coords-dom-02-f-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/android/svg/W3C-SVG-1.1-SE/coords-dom-02-f-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/android/svg/batik/text/textAnchor3-expected.png b/third_party/WebKit/LayoutTests/platform/android/svg/batik/text/textAnchor3-expected.png
index 5d64869..12c999a 100644
--- a/third_party/WebKit/LayoutTests/platform/android/svg/batik/text/textAnchor3-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/android/svg/batik/text/textAnchor3-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/paint/invalidation/svg/tabgroup-expected.png b/third_party/WebKit/LayoutTests/platform/linux/paint/invalidation/svg/tabgroup-expected.png
index 6d8d89f..47485d6 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/paint/invalidation/svg/tabgroup-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/paint/invalidation/svg/tabgroup-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/svg/W3C-SVG-1.1/animate-elem-02-t-expected.png b/third_party/WebKit/LayoutTests/platform/linux/svg/W3C-SVG-1.1/animate-elem-02-t-expected.png
index 986e71f..04351345 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/svg/W3C-SVG-1.1/animate-elem-02-t-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/svg/W3C-SVG-1.1/animate-elem-02-t-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/virtual/disable-spinvalidation/paint/invalidation/create-layer-repaint-expected.txt b/third_party/WebKit/LayoutTests/platform/linux/virtual/disable-spinvalidation/paint/invalidation/create-layer-repaint-expected.txt
new file mode 100644
index 0000000..4c352c66
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/linux/virtual/disable-spinvalidation/paint/invalidation/create-layer-repaint-expected.txt
@@ -0,0 +1,33 @@
+{
+  "layers": [
+    {
+      "name": "LayoutView #document",
+      "bounds": [800, 600],
+      "contentsOpaque": true,
+      "drawsContent": true,
+      "paintInvalidations": [
+        {
+          "object": "LayoutBlockFlow DIV id='test' class='stretchy'",
+          "rect": [28, 56, 500, 50],
+          "reason": "subtree"
+        },
+        {
+          "object": "LayoutBlockFlow DIV id='test' class='stretchy'",
+          "rect": [28, 56, 250, 50],
+          "reason": "subtree"
+        }
+      ]
+    }
+  ],
+  "objectPaintInvalidations": [
+    {
+      "object": "LayoutBlockFlow DIV id='test' class='stretchy'",
+      "reason": "subtree"
+    },
+    {
+      "object": "LayoutBlockFlow DIV id='test' class='stretchy'",
+      "reason": "subtree"
+    }
+  ]
+}
+
diff --git a/third_party/WebKit/LayoutTests/platform/linux/virtual/disable-spinvalidation/paint/invalidation/svg/tabgroup-expected.png b/third_party/WebKit/LayoutTests/platform/linux/virtual/disable-spinvalidation/paint/invalidation/svg/tabgroup-expected.png
index 6d8d89f..47485d6 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/virtual/disable-spinvalidation/paint/invalidation/svg/tabgroup-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/virtual/disable-spinvalidation/paint/invalidation/svg/tabgroup-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/linux/virtual/mojo-loading/http/tests/webfont/popup-menu-load-webfont-after-open-expected.png b/third_party/WebKit/LayoutTests/platform/linux/virtual/mojo-loading/http/tests/webfont/popup-menu-load-webfont-after-open-expected.png
index 886d17d5..ac1d868e 100644
--- a/third_party/WebKit/LayoutTests/platform/linux/virtual/mojo-loading/http/tests/webfont/popup-menu-load-webfont-after-open-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/linux/virtual/mojo-loading/http/tests/webfont/popup-menu-load-webfont-after-open-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/svg/W3C-SVG-1.1/fonts-elem-07-b-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mac10.10/svg/W3C-SVG-1.1/fonts-elem-07-b-expected.png
deleted file mode 100644
index a1c4be7..0000000
--- a/third_party/WebKit/LayoutTests/platform/mac-mac10.10/svg/W3C-SVG-1.1/fonts-elem-07-b-expected.png
+++ /dev/null
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.11/fast/forms/select/menulist-appearance-rtl-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mac10.11/fast/forms/select/menulist-appearance-rtl-expected.png
index 5e52617..99ecea45 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-mac10.11/fast/forms/select/menulist-appearance-rtl-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.11/fast/forms/select/menulist-appearance-rtl-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.11/fast/forms/select/menulist-appearance-rtl-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-mac10.11/fast/forms/select/menulist-appearance-rtl-expected.txt
deleted file mode 100644
index 0123fdf..0000000
--- a/third_party/WebKit/LayoutTests/platform/mac-mac10.11/fast/forms/select/menulist-appearance-rtl-expected.txt
+++ /dev/null
@@ -1,168 +0,0 @@
-layer at (0,0) size 800x600
-  LayoutView at (0,0) size 800x600
-layer at (0,0) size 800x549
-  LayoutBlockFlow {HTML} at (0,0) size 800x549
-    LayoutBlockFlow {BODY} at (8,16) size 784x525
-      LayoutBlockFlow {P} at (0,0) size 784x36
-        LayoutText {#text} at (0,0) size 758x36
-          text run at (0,0) width 758: "This tests that bidirectional text is correctly rendered in popup controls. The order of the text below each popup button"
-          text run at (0,18) width 600: "should match the order of the select's option text, and the order of the text in the popup menu."
-      LayoutBlockFlow {DL} at (0,52) size 784x168
-        LayoutBlockFlow {DT} at (0,0) size 784x18
-          LayoutText {#text} at (0,0) size 286x18
-            text run at (0,0) width 286: "1) direction: rtl; -webkit-rtl-ordering: logical"
-        LayoutBlockFlow {DD} at (40,18) size 744x38
-          LayoutBlockFlow (anonymous) at (0,0) size 744x19
-            LayoutMenuList {SELECT} at (0,1) size 100x18 [bgcolor=#F8F8F8]
-              LayoutBlockFlow (anonymous) at (0,0) size 100x18
-                LayoutText (anonymous) at (31,2) size 61x13
-                  text run at (31,2) width 43 RTL: "\x{5D0}\x{5E4}\x{5E8}\x{5E1}\x{5DE}\x{5D5}\x{5DF}"
-                  text run at (73,2) width 19: "abc"
-            LayoutText {#text} at (0,0) size 0x0
-          LayoutBlockFlow {DIV} at (0,19) size 100x19
-            LayoutText {#text} at (18,1) size 82x18
-              text run at (18,1) width 60 RTL: "\x{5D0}\x{5E4}\x{5E8}\x{5E1}\x{5DE}\x{5D5}\x{5DF}"
-              text run at (77,1) width 23: "abc"
-        LayoutBlockFlow {DT} at (0,56) size 784x18
-          LayoutText {#text} at (0,0) size 118x18
-            text run at (0,0) width 118: "2) text-align: right"
-        LayoutBlockFlow {DD} at (40,74) size 744x38
-          LayoutBlockFlow (anonymous) at (0,0) size 744x19
-            LayoutMenuList {SELECT} at (0,1) size 200x18 [bgcolor=#F8F8F8]
-              LayoutBlockFlow (anonymous) at (0,0) size 200x18
-                LayoutText (anonymous) at (8,2) size 61x13
-                  text run at (8,2) width 19: "abc"
-                  text run at (26,2) width 43 RTL: "\x{5D0}\x{5E4}\x{5E8}\x{5E1}\x{5DE}\x{5D5}\x{5DF}"
-            LayoutText {#text} at (0,0) size 0x0
-          LayoutBlockFlow {DIV} at (0,19) size 200x19
-            LayoutText {#text} at (0,1) size 82x18
-              text run at (0,1) width 23: "abc"
-              text run at (22,1) width 60 RTL: "\x{5D0}\x{5E4}\x{5E8}\x{5E1}\x{5DE}\x{5D5}\x{5DF}"
-        LayoutBlockFlow {DT} at (0,112) size 784x18
-          LayoutText {#text} at (0,0) size 72x18
-            text run at (0,0) width 72: "3) No style"
-        LayoutBlockFlow {DD} at (40,130) size 744x38
-          LayoutBlockFlow (anonymous) at (0,0) size 744x19
-            LayoutMenuList {SELECT} at (0,1) size 100x18 [bgcolor=#F8F8F8]
-              LayoutBlockFlow (anonymous) at (0,0) size 100x18
-                LayoutText (anonymous) at (8,2) size 61x13
-                  text run at (8,2) width 19: "abc"
-                  text run at (26,2) width 43 RTL: "\x{5D0}\x{5E4}\x{5E8}\x{5E1}\x{5DE}\x{5D5}\x{5DF}"
-            LayoutText {#text} at (0,0) size 0x0
-          LayoutBlockFlow {DIV} at (0,19) size 100x19
-            LayoutText {#text} at (0,1) size 82x18
-              text run at (0,1) width 23: "abc"
-              text run at (22,1) width 60 RTL: "\x{5D0}\x{5E4}\x{5E8}\x{5E1}\x{5DE}\x{5D5}\x{5DF}"
-      LayoutBlockFlow {HR} at (0,236) size 784x2 [border: (1px inset #EEEEEE)]
-      LayoutBlockFlow {DIV} at (0,246) size 784x55
-        LayoutBlockFlow (anonymous) at (0,0) size 784x18
-          LayoutText {#text} at (0,0) size 632x18
-            text run at (0,0) width 632: "The following line and the SELECT element should have same text, and no characters are lacking."
-        LayoutBlockFlow {DIV} at (0,18) size 784x18
-          LayoutText {#text} at (0,0) size 99x16
-            text run at (0,0) width 99 RTL: "\x{627}\x{644}\x{627}\x{642}\x{62A}\x{631}\x{627}\x{62D}\x{627}\x{62A} / \x{627}\x{644}\x{634}\x{643}\x{627}\x{648}\x{64A}"
-        LayoutBlockFlow (anonymous) at (0,36) size 784x19
-          LayoutMenuList {SELECT} at (0,1) size 115x18 [bgcolor=#F8F8F8]
-            LayoutBlockFlow (anonymous) at (0,0) size 115x21
-              LayoutText (anonymous) at (8,2) size 84x13
-                text run at (8,2) width 84 RTL: "\x{627}\x{644}\x{627}\x{642}\x{62A}\x{631}\x{627}\x{62D}\x{627}\x{62A} / \x{627}\x{644}\x{634}\x{643}\x{627}\x{648}\x{64A}"
-          LayoutText {#text} at (0,0) size 0x0
-      LayoutBlockFlow {HR} at (0,309) size 784x2 [border: (1px inset #EEEEEE)]
-      LayoutBlockFlow {P} at (0,327) size 784x18
-        LayoutText {#text} at (0,0) size 709x18
-          text run at (0,0) width 709: "Verify that the alignment and writing direction of each selected item matches the one below the pop-up button."
-layer at (8,377) size 784x164
-  LayoutBlockFlow {DIV} at (0,361) size 784x164
-    LayoutMultiColumnSet (anonymous) at (0,0) size 784x164
-layer at (8,377) size 384x328 backgroundClip at (0,0) size 800x600 clip at (0,0) size 800x600
-  LayoutMultiColumnFlowThread (anonymous) at (0,0) size 384x328
-    LayoutBlockFlow {DIV} at (0,0) size 384x164
-      LayoutMenuList {SELECT} at (0,0) size 350x23 [bgcolor=#F8F8F8] [border: (1px solid #A6A6A6)]
-        LayoutBlockFlow (anonymous) at (1,1) size 348x21
-          LayoutText (anonymous) at (8,1) size 198x18
-            text run at (8,1) width 38: "First "
-            text run at (45,1) width 61 RTL: ") \x{5E8}\x{5D1}\x{5D9}\x{5E2}\x{5D9}\x{5EA}"
-            text run at (105,1) width 21: "03"
-            text run at (125,1) width 46 RTL: "\x{5E9}\x{5E0}\x{5D9}\x{5D4} ("
-            text run at (170,1) width 36: " fifth"
-      LayoutBlockFlow {DIV} at (0,23) size 352x18
-        LayoutText {#text} at (1,1) size 163x16
-          text run at (1,1) width 32: "First "
-          text run at (32,1) width 48 RTL: ") \x{5E8}\x{5D1}\x{5D9}\x{5E2}\x{5D9}\x{5EA}"
-          text run at (80,1) width 17: "03"
-          text run at (96,1) width 37 RTL: "\x{5E9}\x{5E0}\x{5D9}\x{5D4} ("
-          text run at (132,1) width 32: " fifth"
-      LayoutMenuList {SELECT} at (0,41) size 350x23 [bgcolor=#F8F8F8] [border: (1px solid #A6A6A6)]
-        LayoutBlockFlow (anonymous) at (1,1) size 348x21
-          LayoutText (anonymous) at (8,1) size 198x18
-            text run at (8,1) width 31: "fifth"
-            text run at (38,1) width 65 RTL: ") \x{5E8}\x{5D1}\x{5D9}\x{5E2}\x{5D9}\x{5EA} "
-            text run at (103,1) width 21: "03"
-            text run at (123,1) width 50 RTL: " \x{5E9}\x{5E0}\x{5D9}\x{5D4} ("
-            text run at (172,1) width 34: "First"
-      LayoutBlockFlow {DIV} at (0,64) size 352x18
-        LayoutText {#text} at (1,1) size 163x16
-          text run at (1,1) width 27: "fifth"
-          text run at (27,1) width 52 RTL: ") \x{5E8}\x{5D1}\x{5D9}\x{5E2}\x{5D9}\x{5EA} "
-          text run at (78,1) width 17: "03"
-          text run at (94,1) width 42 RTL: " \x{5E9}\x{5E0}\x{5D9}\x{5D4} ("
-          text run at (135,1) width 29: "First"
-      LayoutMenuList {SELECT} at (0,82) size 350x23 [bgcolor=#F8F8F8] [border: (1px solid #A6A6A6)]
-        LayoutBlockFlow (anonymous) at (1,1) size 348x21
-          LayoutText (anonymous) at (8,1) size 198x18
-            text run at (8,1) width 198 LTR override: "First \x{5E9}\x{5E0}\x{5D9}\x{5D4} (03) \x{5E8}\x{5D1}\x{5D9}\x{5E2}\x{5D9}\x{5EA} fifth"
-      LayoutBlockFlow {DIV} at (0,105) size 352x18
-        LayoutText {#text} at (1,1) size 163x16
-          text run at (1,1) width 163 LTR override: "First \x{5E9}\x{5E0}\x{5D9}\x{5D4} (03) \x{5E8}\x{5D1}\x{5D9}\x{5E2}\x{5D9}\x{5EA} fifth"
-      LayoutMenuList {SELECT} at (0,123) size 350x23 [bgcolor=#F8F8F8] [border: (1px solid #A6A6A6)]
-        LayoutBlockFlow (anonymous) at (1,1) size 348x21
-          LayoutText (anonymous) at (8,1) size 198x18
-            text run at (8,1) width 198 RTL override: "First \x{5E9}\x{5E0}\x{5D9}\x{5D4} (03) \x{5E8}\x{5D1}\x{5D9}\x{5E2}\x{5D9}\x{5EA} fifth"
-      LayoutBlockFlow {DIV} at (0,146) size 352x18
-        LayoutText {#text} at (1,1) size 163x16
-          text run at (1,1) width 163 RTL override: "First \x{5E9}\x{5E0}\x{5D9}\x{5D4} (03) \x{5E8}\x{5D1}\x{5D9}\x{5E2}\x{5D9}\x{5EA} fifth"
-    LayoutBlockFlow {DIV} at (0,164) size 384x164
-      LayoutMenuList {SELECT} at (0,0) size 350x23 [bgcolor=#F8F8F8] [border: (1px solid #A6A6A6)]
-        LayoutBlockFlow (anonymous) at (1,1) size 348x21
-          LayoutText (anonymous) at (142,1) size 198x18
-            text run at (142,1) width 39: "First "
-            text run at (180,1) width 60 RTL: ") \x{5E8}\x{5D1}\x{5D9}\x{5E2}\x{5D9}\x{5EA}"
-            text run at (239,1) width 21: "03"
-            text run at (259,1) width 46 RTL: "\x{5E9}\x{5E0}\x{5D9}\x{5D4} ("
-            text run at (304,1) width 36: " fifth"
-      LayoutBlockFlow {DIV} at (0,23) size 352x18
-        LayoutText {#text} at (188,1) size 163x16
-          text run at (188,1) width 33: "First "
-          text run at (220,1) width 48 RTL: ") \x{5E8}\x{5D1}\x{5D9}\x{5E2}\x{5D9}\x{5EA}"
-          text run at (267,1) width 18: "03"
-          text run at (284,1) width 37 RTL: "\x{5E9}\x{5E0}\x{5D9}\x{5D4} ("
-          text run at (320,1) width 31: " fifth"
-      LayoutMenuList {SELECT} at (0,41) size 350x23 [bgcolor=#F8F8F8] [border: (1px solid #A6A6A6)]
-        LayoutBlockFlow (anonymous) at (1,1) size 348x21
-          LayoutText (anonymous) at (142,1) size 198x18
-            text run at (142,1) width 32: "fifth"
-            text run at (173,1) width 65 RTL: ") \x{5E8}\x{5D1}\x{5D9}\x{5E2}\x{5D9}\x{5EA} "
-            text run at (237,1) width 21: "03"
-            text run at (257,1) width 50 RTL: " \x{5E9}\x{5E0}\x{5D9}\x{5D4} ("
-            text run at (306,1) width 34: "First"
-      LayoutBlockFlow {DIV} at (0,64) size 352x18
-        LayoutText {#text} at (188,1) size 163x16
-          text run at (188,1) width 28: "fifth"
-          text run at (215,1) width 52 RTL: ") \x{5E8}\x{5D1}\x{5D9}\x{5E2}\x{5D9}\x{5EA} "
-          text run at (266,1) width 17: "03"
-          text run at (282,1) width 42 RTL: " \x{5E9}\x{5E0}\x{5D9}\x{5D4} ("
-          text run at (323,1) width 28: "First"
-      LayoutMenuList {SELECT} at (0,82) size 350x23 [bgcolor=#F8F8F8] [border: (1px solid #A6A6A6)]
-        LayoutBlockFlow (anonymous) at (1,1) size 348x21
-          LayoutText (anonymous) at (142,1) size 198x18
-            text run at (142,1) width 198 LTR override: "First \x{5E9}\x{5E0}\x{5D9}\x{5D4} (03) \x{5E8}\x{5D1}\x{5D9}\x{5E2}\x{5D9}\x{5EA} fifth"
-      LayoutBlockFlow {DIV} at (0,105) size 352x18
-        LayoutText {#text} at (188,1) size 163x16
-          text run at (188,1) width 163 LTR override: "First \x{5E9}\x{5E0}\x{5D9}\x{5D4} (03) \x{5E8}\x{5D1}\x{5D9}\x{5E2}\x{5D9}\x{5EA} fifth"
-      LayoutMenuList {SELECT} at (0,123) size 350x23 [bgcolor=#F8F8F8] [border: (1px solid #A6A6A6)]
-        LayoutBlockFlow (anonymous) at (1,1) size 348x21
-          LayoutText (anonymous) at (142,1) size 198x18
-            text run at (142,1) width 198 RTL override: "First \x{5E9}\x{5E0}\x{5D9}\x{5D4} (03) \x{5E8}\x{5D1}\x{5D9}\x{5E2}\x{5D9}\x{5EA} fifth"
-      LayoutBlockFlow {DIV} at (0,146) size 352x18
-        LayoutText {#text} at (188,1) size 163x16
-          text run at (188,1) width 163 RTL override: "First \x{5E9}\x{5E0}\x{5D9}\x{5D4} (03) \x{5E8}\x{5D1}\x{5D9}\x{5E2}\x{5D9}\x{5EA} fifth"
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.11/virtual/mojo-loading/http/tests/webfont/popup-menu-load-webfont-after-open-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mac10.11/virtual/mojo-loading/http/tests/webfont/popup-menu-load-webfont-after-open-expected.png
new file mode 100644
index 0000000..78a716d
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.11/virtual/mojo-loading/http/tests/webfont/popup-menu-load-webfont-after-open-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/table/backgr_border-table-row-group-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/table/backgr_border-table-row-group-expected.png
index 755b24e..e05d6619 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/table/backgr_border-table-row-group-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/table/backgr_border-table-row-group-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/table/backgr_position-table-row-group-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/table/backgr_position-table-row-group-expected.png
index 84fb4b66..ff3dd4a 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/table/backgr_position-table-row-group-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/table/backgr_position-table-row-group-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/table/backgr_simple-table-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/table/backgr_simple-table-expected.png
index 5ffd7b8..62973a5 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/table/backgr_simple-table-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/table/backgr_simple-table-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/svg/W3C-SVG-1.1/fonts-elem-07-b-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/svg/W3C-SVG-1.1/fonts-elem-07-b-expected.png
deleted file mode 100644
index 64b2ad4..0000000
--- a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/svg/W3C-SVG-1.1/fonts-elem-07-b-expected.png
+++ /dev/null
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/svg/wicd/test-scalable-background-image2-expected.png b/third_party/WebKit/LayoutTests/platform/mac-mac10.9/svg/wicd/test-scalable-background-image2-expected.png
deleted file mode 100644
index 6ed6365..0000000
--- a/third_party/WebKit/LayoutTests/platform/mac-mac10.9/svg/wicd/test-scalable-background-image2-expected.png
+++ /dev/null
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-retina/fast/forms/select/menulist-appearance-rtl-expected.png b/third_party/WebKit/LayoutTests/platform/mac-retina/fast/forms/select/menulist-appearance-rtl-expected.png
index 5e52617..99ecea45 100644
--- a/third_party/WebKit/LayoutTests/platform/mac-retina/fast/forms/select/menulist-appearance-rtl-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac-retina/fast/forms/select/menulist-appearance-rtl-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac-retina/fast/forms/select/menulist-appearance-rtl-expected.txt b/third_party/WebKit/LayoutTests/platform/mac-retina/fast/forms/select/menulist-appearance-rtl-expected.txt
deleted file mode 100644
index 0123fdf..0000000
--- a/third_party/WebKit/LayoutTests/platform/mac-retina/fast/forms/select/menulist-appearance-rtl-expected.txt
+++ /dev/null
@@ -1,168 +0,0 @@
-layer at (0,0) size 800x600
-  LayoutView at (0,0) size 800x600
-layer at (0,0) size 800x549
-  LayoutBlockFlow {HTML} at (0,0) size 800x549
-    LayoutBlockFlow {BODY} at (8,16) size 784x525
-      LayoutBlockFlow {P} at (0,0) size 784x36
-        LayoutText {#text} at (0,0) size 758x36
-          text run at (0,0) width 758: "This tests that bidirectional text is correctly rendered in popup controls. The order of the text below each popup button"
-          text run at (0,18) width 600: "should match the order of the select's option text, and the order of the text in the popup menu."
-      LayoutBlockFlow {DL} at (0,52) size 784x168
-        LayoutBlockFlow {DT} at (0,0) size 784x18
-          LayoutText {#text} at (0,0) size 286x18
-            text run at (0,0) width 286: "1) direction: rtl; -webkit-rtl-ordering: logical"
-        LayoutBlockFlow {DD} at (40,18) size 744x38
-          LayoutBlockFlow (anonymous) at (0,0) size 744x19
-            LayoutMenuList {SELECT} at (0,1) size 100x18 [bgcolor=#F8F8F8]
-              LayoutBlockFlow (anonymous) at (0,0) size 100x18
-                LayoutText (anonymous) at (31,2) size 61x13
-                  text run at (31,2) width 43 RTL: "\x{5D0}\x{5E4}\x{5E8}\x{5E1}\x{5DE}\x{5D5}\x{5DF}"
-                  text run at (73,2) width 19: "abc"
-            LayoutText {#text} at (0,0) size 0x0
-          LayoutBlockFlow {DIV} at (0,19) size 100x19
-            LayoutText {#text} at (18,1) size 82x18
-              text run at (18,1) width 60 RTL: "\x{5D0}\x{5E4}\x{5E8}\x{5E1}\x{5DE}\x{5D5}\x{5DF}"
-              text run at (77,1) width 23: "abc"
-        LayoutBlockFlow {DT} at (0,56) size 784x18
-          LayoutText {#text} at (0,0) size 118x18
-            text run at (0,0) width 118: "2) text-align: right"
-        LayoutBlockFlow {DD} at (40,74) size 744x38
-          LayoutBlockFlow (anonymous) at (0,0) size 744x19
-            LayoutMenuList {SELECT} at (0,1) size 200x18 [bgcolor=#F8F8F8]
-              LayoutBlockFlow (anonymous) at (0,0) size 200x18
-                LayoutText (anonymous) at (8,2) size 61x13
-                  text run at (8,2) width 19: "abc"
-                  text run at (26,2) width 43 RTL: "\x{5D0}\x{5E4}\x{5E8}\x{5E1}\x{5DE}\x{5D5}\x{5DF}"
-            LayoutText {#text} at (0,0) size 0x0
-          LayoutBlockFlow {DIV} at (0,19) size 200x19
-            LayoutText {#text} at (0,1) size 82x18
-              text run at (0,1) width 23: "abc"
-              text run at (22,1) width 60 RTL: "\x{5D0}\x{5E4}\x{5E8}\x{5E1}\x{5DE}\x{5D5}\x{5DF}"
-        LayoutBlockFlow {DT} at (0,112) size 784x18
-          LayoutText {#text} at (0,0) size 72x18
-            text run at (0,0) width 72: "3) No style"
-        LayoutBlockFlow {DD} at (40,130) size 744x38
-          LayoutBlockFlow (anonymous) at (0,0) size 744x19
-            LayoutMenuList {SELECT} at (0,1) size 100x18 [bgcolor=#F8F8F8]
-              LayoutBlockFlow (anonymous) at (0,0) size 100x18
-                LayoutText (anonymous) at (8,2) size 61x13
-                  text run at (8,2) width 19: "abc"
-                  text run at (26,2) width 43 RTL: "\x{5D0}\x{5E4}\x{5E8}\x{5E1}\x{5DE}\x{5D5}\x{5DF}"
-            LayoutText {#text} at (0,0) size 0x0
-          LayoutBlockFlow {DIV} at (0,19) size 100x19
-            LayoutText {#text} at (0,1) size 82x18
-              text run at (0,1) width 23: "abc"
-              text run at (22,1) width 60 RTL: "\x{5D0}\x{5E4}\x{5E8}\x{5E1}\x{5DE}\x{5D5}\x{5DF}"
-      LayoutBlockFlow {HR} at (0,236) size 784x2 [border: (1px inset #EEEEEE)]
-      LayoutBlockFlow {DIV} at (0,246) size 784x55
-        LayoutBlockFlow (anonymous) at (0,0) size 784x18
-          LayoutText {#text} at (0,0) size 632x18
-            text run at (0,0) width 632: "The following line and the SELECT element should have same text, and no characters are lacking."
-        LayoutBlockFlow {DIV} at (0,18) size 784x18
-          LayoutText {#text} at (0,0) size 99x16
-            text run at (0,0) width 99 RTL: "\x{627}\x{644}\x{627}\x{642}\x{62A}\x{631}\x{627}\x{62D}\x{627}\x{62A} / \x{627}\x{644}\x{634}\x{643}\x{627}\x{648}\x{64A}"
-        LayoutBlockFlow (anonymous) at (0,36) size 784x19
-          LayoutMenuList {SELECT} at (0,1) size 115x18 [bgcolor=#F8F8F8]
-            LayoutBlockFlow (anonymous) at (0,0) size 115x21
-              LayoutText (anonymous) at (8,2) size 84x13
-                text run at (8,2) width 84 RTL: "\x{627}\x{644}\x{627}\x{642}\x{62A}\x{631}\x{627}\x{62D}\x{627}\x{62A} / \x{627}\x{644}\x{634}\x{643}\x{627}\x{648}\x{64A}"
-          LayoutText {#text} at (0,0) size 0x0
-      LayoutBlockFlow {HR} at (0,309) size 784x2 [border: (1px inset #EEEEEE)]
-      LayoutBlockFlow {P} at (0,327) size 784x18
-        LayoutText {#text} at (0,0) size 709x18
-          text run at (0,0) width 709: "Verify that the alignment and writing direction of each selected item matches the one below the pop-up button."
-layer at (8,377) size 784x164
-  LayoutBlockFlow {DIV} at (0,361) size 784x164
-    LayoutMultiColumnSet (anonymous) at (0,0) size 784x164
-layer at (8,377) size 384x328 backgroundClip at (0,0) size 800x600 clip at (0,0) size 800x600
-  LayoutMultiColumnFlowThread (anonymous) at (0,0) size 384x328
-    LayoutBlockFlow {DIV} at (0,0) size 384x164
-      LayoutMenuList {SELECT} at (0,0) size 350x23 [bgcolor=#F8F8F8] [border: (1px solid #A6A6A6)]
-        LayoutBlockFlow (anonymous) at (1,1) size 348x21
-          LayoutText (anonymous) at (8,1) size 198x18
-            text run at (8,1) width 38: "First "
-            text run at (45,1) width 61 RTL: ") \x{5E8}\x{5D1}\x{5D9}\x{5E2}\x{5D9}\x{5EA}"
-            text run at (105,1) width 21: "03"
-            text run at (125,1) width 46 RTL: "\x{5E9}\x{5E0}\x{5D9}\x{5D4} ("
-            text run at (170,1) width 36: " fifth"
-      LayoutBlockFlow {DIV} at (0,23) size 352x18
-        LayoutText {#text} at (1,1) size 163x16
-          text run at (1,1) width 32: "First "
-          text run at (32,1) width 48 RTL: ") \x{5E8}\x{5D1}\x{5D9}\x{5E2}\x{5D9}\x{5EA}"
-          text run at (80,1) width 17: "03"
-          text run at (96,1) width 37 RTL: "\x{5E9}\x{5E0}\x{5D9}\x{5D4} ("
-          text run at (132,1) width 32: " fifth"
-      LayoutMenuList {SELECT} at (0,41) size 350x23 [bgcolor=#F8F8F8] [border: (1px solid #A6A6A6)]
-        LayoutBlockFlow (anonymous) at (1,1) size 348x21
-          LayoutText (anonymous) at (8,1) size 198x18
-            text run at (8,1) width 31: "fifth"
-            text run at (38,1) width 65 RTL: ") \x{5E8}\x{5D1}\x{5D9}\x{5E2}\x{5D9}\x{5EA} "
-            text run at (103,1) width 21: "03"
-            text run at (123,1) width 50 RTL: " \x{5E9}\x{5E0}\x{5D9}\x{5D4} ("
-            text run at (172,1) width 34: "First"
-      LayoutBlockFlow {DIV} at (0,64) size 352x18
-        LayoutText {#text} at (1,1) size 163x16
-          text run at (1,1) width 27: "fifth"
-          text run at (27,1) width 52 RTL: ") \x{5E8}\x{5D1}\x{5D9}\x{5E2}\x{5D9}\x{5EA} "
-          text run at (78,1) width 17: "03"
-          text run at (94,1) width 42 RTL: " \x{5E9}\x{5E0}\x{5D9}\x{5D4} ("
-          text run at (135,1) width 29: "First"
-      LayoutMenuList {SELECT} at (0,82) size 350x23 [bgcolor=#F8F8F8] [border: (1px solid #A6A6A6)]
-        LayoutBlockFlow (anonymous) at (1,1) size 348x21
-          LayoutText (anonymous) at (8,1) size 198x18
-            text run at (8,1) width 198 LTR override: "First \x{5E9}\x{5E0}\x{5D9}\x{5D4} (03) \x{5E8}\x{5D1}\x{5D9}\x{5E2}\x{5D9}\x{5EA} fifth"
-      LayoutBlockFlow {DIV} at (0,105) size 352x18
-        LayoutText {#text} at (1,1) size 163x16
-          text run at (1,1) width 163 LTR override: "First \x{5E9}\x{5E0}\x{5D9}\x{5D4} (03) \x{5E8}\x{5D1}\x{5D9}\x{5E2}\x{5D9}\x{5EA} fifth"
-      LayoutMenuList {SELECT} at (0,123) size 350x23 [bgcolor=#F8F8F8] [border: (1px solid #A6A6A6)]
-        LayoutBlockFlow (anonymous) at (1,1) size 348x21
-          LayoutText (anonymous) at (8,1) size 198x18
-            text run at (8,1) width 198 RTL override: "First \x{5E9}\x{5E0}\x{5D9}\x{5D4} (03) \x{5E8}\x{5D1}\x{5D9}\x{5E2}\x{5D9}\x{5EA} fifth"
-      LayoutBlockFlow {DIV} at (0,146) size 352x18
-        LayoutText {#text} at (1,1) size 163x16
-          text run at (1,1) width 163 RTL override: "First \x{5E9}\x{5E0}\x{5D9}\x{5D4} (03) \x{5E8}\x{5D1}\x{5D9}\x{5E2}\x{5D9}\x{5EA} fifth"
-    LayoutBlockFlow {DIV} at (0,164) size 384x164
-      LayoutMenuList {SELECT} at (0,0) size 350x23 [bgcolor=#F8F8F8] [border: (1px solid #A6A6A6)]
-        LayoutBlockFlow (anonymous) at (1,1) size 348x21
-          LayoutText (anonymous) at (142,1) size 198x18
-            text run at (142,1) width 39: "First "
-            text run at (180,1) width 60 RTL: ") \x{5E8}\x{5D1}\x{5D9}\x{5E2}\x{5D9}\x{5EA}"
-            text run at (239,1) width 21: "03"
-            text run at (259,1) width 46 RTL: "\x{5E9}\x{5E0}\x{5D9}\x{5D4} ("
-            text run at (304,1) width 36: " fifth"
-      LayoutBlockFlow {DIV} at (0,23) size 352x18
-        LayoutText {#text} at (188,1) size 163x16
-          text run at (188,1) width 33: "First "
-          text run at (220,1) width 48 RTL: ") \x{5E8}\x{5D1}\x{5D9}\x{5E2}\x{5D9}\x{5EA}"
-          text run at (267,1) width 18: "03"
-          text run at (284,1) width 37 RTL: "\x{5E9}\x{5E0}\x{5D9}\x{5D4} ("
-          text run at (320,1) width 31: " fifth"
-      LayoutMenuList {SELECT} at (0,41) size 350x23 [bgcolor=#F8F8F8] [border: (1px solid #A6A6A6)]
-        LayoutBlockFlow (anonymous) at (1,1) size 348x21
-          LayoutText (anonymous) at (142,1) size 198x18
-            text run at (142,1) width 32: "fifth"
-            text run at (173,1) width 65 RTL: ") \x{5E8}\x{5D1}\x{5D9}\x{5E2}\x{5D9}\x{5EA} "
-            text run at (237,1) width 21: "03"
-            text run at (257,1) width 50 RTL: " \x{5E9}\x{5E0}\x{5D9}\x{5D4} ("
-            text run at (306,1) width 34: "First"
-      LayoutBlockFlow {DIV} at (0,64) size 352x18
-        LayoutText {#text} at (188,1) size 163x16
-          text run at (188,1) width 28: "fifth"
-          text run at (215,1) width 52 RTL: ") \x{5E8}\x{5D1}\x{5D9}\x{5E2}\x{5D9}\x{5EA} "
-          text run at (266,1) width 17: "03"
-          text run at (282,1) width 42 RTL: " \x{5E9}\x{5E0}\x{5D9}\x{5D4} ("
-          text run at (323,1) width 28: "First"
-      LayoutMenuList {SELECT} at (0,82) size 350x23 [bgcolor=#F8F8F8] [border: (1px solid #A6A6A6)]
-        LayoutBlockFlow (anonymous) at (1,1) size 348x21
-          LayoutText (anonymous) at (142,1) size 198x18
-            text run at (142,1) width 198 LTR override: "First \x{5E9}\x{5E0}\x{5D9}\x{5D4} (03) \x{5E8}\x{5D1}\x{5D9}\x{5E2}\x{5D9}\x{5EA} fifth"
-      LayoutBlockFlow {DIV} at (0,105) size 352x18
-        LayoutText {#text} at (188,1) size 163x16
-          text run at (188,1) width 163 LTR override: "First \x{5E9}\x{5E0}\x{5D9}\x{5D4} (03) \x{5E8}\x{5D1}\x{5D9}\x{5E2}\x{5D9}\x{5EA} fifth"
-      LayoutMenuList {SELECT} at (0,123) size 350x23 [bgcolor=#F8F8F8] [border: (1px solid #A6A6A6)]
-        LayoutBlockFlow (anonymous) at (1,1) size 348x21
-          LayoutText (anonymous) at (142,1) size 198x18
-            text run at (142,1) width 198 RTL override: "First \x{5E9}\x{5E0}\x{5D9}\x{5D4} (03) \x{5E8}\x{5D1}\x{5D9}\x{5E2}\x{5D9}\x{5EA} fifth"
-      LayoutBlockFlow {DIV} at (0,146) size 352x18
-        LayoutText {#text} at (188,1) size 163x16
-          text run at (188,1) width 163 RTL override: "First \x{5E9}\x{5E0}\x{5D9}\x{5D4} (03) \x{5E8}\x{5D1}\x{5D9}\x{5E2}\x{5D9}\x{5EA} fifth"
diff --git a/third_party/WebKit/LayoutTests/platform/mac-retina/virtual/mojo-loading/http/tests/webfont/popup-menu-load-webfont-after-open-expected.png b/third_party/WebKit/LayoutTests/platform/mac-retina/virtual/mojo-loading/http/tests/webfont/popup-menu-load-webfont-after-open-expected.png
new file mode 100644
index 0000000..78a716d
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/mac-retina/virtual/mojo-loading/http/tests/webfont/popup-menu-load-webfont-after-open-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/forms/select/menulist-appearance-rtl-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/forms/select/menulist-appearance-rtl-expected.png
index 40ca0fb..a3485a3 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/forms/select/menulist-appearance-rtl-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/forms/select/menulist-appearance-rtl-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/forms/select/menulist-appearance-rtl-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/fast/forms/select/menulist-appearance-rtl-expected.txt
index ed835d3f..0123fdf 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/forms/select/menulist-appearance-rtl-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/forms/select/menulist-appearance-rtl-expected.txt
@@ -64,8 +64,8 @@
         LayoutBlockFlow (anonymous) at (0,36) size 784x19
           LayoutMenuList {SELECT} at (0,1) size 115x18 [bgcolor=#F8F8F8]
             LayoutBlockFlow (anonymous) at (0,0) size 115x21
-              LayoutText (anonymous) at (8,2) size 76x13
-                text run at (8,2) width 76 RTL: "\x{627}\x{644}\x{627}\x{642}\x{62A}\x{631}\x{627}\x{62D}\x{627}\x{62A} / \x{627}\x{644}\x{634}\x{643}\x{627}\x{648}\x{64A}"
+              LayoutText (anonymous) at (8,2) size 84x13
+                text run at (8,2) width 84 RTL: "\x{627}\x{644}\x{627}\x{642}\x{62A}\x{631}\x{627}\x{62D}\x{627}\x{62A} / \x{627}\x{644}\x{634}\x{643}\x{627}\x{648}\x{64A}"
           LayoutText {#text} at (0,0) size 0x0
       LayoutBlockFlow {HR} at (0,309) size 784x2 [border: (1px inset #EEEEEE)]
       LayoutBlockFlow {P} at (0,327) size 784x18
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/table/backgr_border-table-row-group-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/table/backgr_border-table-row-group-expected.png
index d8eb459..0a0bd2d2 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/table/backgr_border-table-row-group-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/table/backgr_border-table-row-group-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/table/backgr_position-table-row-group-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/table/backgr_position-table-row-group-expected.png
index f99d7c0..de1b9a6b 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/table/backgr_position-table-row-group-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/table/backgr_position-table-row-group-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/fast/table/backgr_simple-table-expected.png b/third_party/WebKit/LayoutTests/platform/mac/fast/table/backgr_simple-table-expected.png
index 96f9663..785e807b 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/fast/table/backgr_simple-table-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/fast/table/backgr_simple-table-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/paint/invalidation/svg/tabgroup-expected.png b/third_party/WebKit/LayoutTests/platform/mac/paint/invalidation/svg/tabgroup-expected.png
index 8cdbb94d..300a55b1 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/paint/invalidation/svg/tabgroup-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/paint/invalidation/svg/tabgroup-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/paint/invalidation/svg/tabgroup-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/paint/invalidation/svg/tabgroup-expected.txt
index b6a148c..bc2e775 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/paint/invalidation/svg/tabgroup-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/paint/invalidation/svg/tabgroup-expected.txt
@@ -329,6 +329,126 @@
       "reason": "layoutObject removal"
     },
     {
+      "object": "LayoutSVGText text",
+      "reason": "subtree"
+    },
+    {
+      "object": "RootInlineBox",
+      "reason": "subtree"
+    },
+    {
+      "object": "LayoutSVGTSpan tspan",
+      "reason": "subtree"
+    },
+    {
+      "object": "InlineFlowBox",
+      "reason": "subtree"
+    },
+    {
+      "object": "LayoutSVGInlineText #text",
+      "reason": "subtree"
+    },
+    {
+      "object": "InlineTextBox 'Geodata'",
+      "reason": "subtree"
+    },
+    {
+      "object": "LayoutSVGTSpan tspan",
+      "reason": "subtree"
+    },
+    {
+      "object": "InlineFlowBox",
+      "reason": "subtree"
+    },
+    {
+      "object": "LayoutSVGInlineText #text",
+      "reason": "subtree"
+    },
+    {
+      "object": "InlineTextBox 'Browser'",
+      "reason": "subtree"
+    },
+    {
+      "object": "LayoutSVGText text",
+      "reason": "subtree"
+    },
+    {
+      "object": "RootInlineBox",
+      "reason": "subtree"
+    },
+    {
+      "object": "LayoutSVGTSpan tspan",
+      "reason": "subtree"
+    },
+    {
+      "object": "InlineFlowBox",
+      "reason": "subtree"
+    },
+    {
+      "object": "LayoutSVGInlineText #text",
+      "reason": "subtree"
+    },
+    {
+      "object": "InlineTextBox 'Download'",
+      "reason": "subtree"
+    },
+    {
+      "object": "LayoutSVGTSpan tspan",
+      "reason": "subtree"
+    },
+    {
+      "object": "InlineFlowBox",
+      "reason": "subtree"
+    },
+    {
+      "object": "LayoutSVGInlineText #text",
+      "reason": "subtree"
+    },
+    {
+      "object": "InlineTextBox 'Folder'",
+      "reason": "subtree"
+    },
+    {
+      "object": "LayoutSVGText text",
+      "reason": "subtree"
+    },
+    {
+      "object": "RootInlineBox",
+      "reason": "subtree"
+    },
+    {
+      "object": "LayoutSVGTSpan tspan",
+      "reason": "subtree"
+    },
+    {
+      "object": "InlineFlowBox",
+      "reason": "subtree"
+    },
+    {
+      "object": "LayoutSVGInlineText #text",
+      "reason": "subtree"
+    },
+    {
+      "object": "InlineTextBox 'Your'",
+      "reason": "subtree"
+    },
+    {
+      "object": "LayoutSVGTSpan tspan",
+      "reason": "subtree"
+    },
+    {
+      "object": "InlineFlowBox",
+      "reason": "subtree"
+    },
+    {
+      "object": "LayoutSVGInlineText #text",
+      "reason": "subtree"
+    },
+    {
+      "object": "InlineTextBox 'Account'",
+      "reason": "subtree"
+    },
+    {
       "object": "LayoutSVGPath path",
       "reason": "layoutObject removal"
     },
@@ -365,6 +485,46 @@
       "reason": "layoutObject removal"
     },
     {
+      "object": "LayoutSVGText text",
+      "reason": "subtree"
+    },
+    {
+      "object": "RootInlineBox",
+      "reason": "subtree"
+    },
+    {
+      "object": "LayoutSVGTSpan tspan",
+      "reason": "subtree"
+    },
+    {
+      "object": "InlineFlowBox",
+      "reason": "subtree"
+    },
+    {
+      "object": "LayoutSVGInlineText #text",
+      "reason": "subtree"
+    },
+    {
+      "object": "InlineTextBox 'Help'",
+      "reason": "subtree"
+    },
+    {
+      "object": "LayoutSVGTSpan tspan",
+      "reason": "subtree"
+    },
+    {
+      "object": "InlineFlowBox",
+      "reason": "subtree"
+    },
+    {
+      "object": "LayoutSVGInlineText #text",
+      "reason": "subtree"
+    },
+    {
+      "object": "InlineTextBox '& Info'",
+      "reason": "subtree"
+    },
+    {
       "object": "LayoutSVGPath path",
       "reason": "layoutObject removal"
     },
diff --git a/third_party/WebKit/LayoutTests/platform/mac/paint/invalidation/svg/text-repaint-including-stroke-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/paint/invalidation/svg/text-repaint-including-stroke-expected.txt
index 8e67475..4dbee85 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/paint/invalidation/svg/text-repaint-including-stroke-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/paint/invalidation/svg/text-repaint-including-stroke-expected.txt
@@ -12,6 +12,11 @@
           "reason": "subtree"
         },
         {
+          "object": "LayoutSVGInlineText #text",
+          "rect": [30, 0, 404, 60],
+          "reason": "subtree"
+        },
+        {
           "object": "LayoutSVGText text id='bounce'",
           "rect": [30, 0, 404, 60],
           "reason": "subtree"
@@ -35,6 +40,22 @@
     {
       "object": "InlineTextBox 'Repaint me!'",
       "reason": "subtree"
+    },
+    {
+      "object": "LayoutSVGText text id='bounce'",
+      "reason": "subtree"
+    },
+    {
+      "object": "RootInlineBox",
+      "reason": "subtree"
+    },
+    {
+      "object": "LayoutSVGInlineText #text",
+      "reason": "subtree"
+    },
+    {
+      "object": "InlineTextBox 'Repaint me!'",
+      "reason": "subtree"
     }
   ]
 }
diff --git a/third_party/WebKit/LayoutTests/platform/mac/paint/invalidation/transform-inline-layered-child-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/paint/invalidation/transform-inline-layered-child-expected.txt
index b15fac01..1b44de8 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/paint/invalidation/transform-inline-layered-child-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/paint/invalidation/transform-inline-layered-child-expected.txt
@@ -22,6 +22,11 @@
           "reason": "subtree"
         },
         {
+          "object": "LayoutBlockFlow (positioned) DIV id='box'",
+          "rect": [100, 100, 100, 162],
+          "reason": "subtree"
+        },
+        {
           "object": "LayoutInline (relative positioned) SPAN id='child'",
           "rect": [300, 300, 80, 162],
           "reason": "subtree"
@@ -126,6 +131,98 @@
     {
       "object": "LayoutText #text",
       "reason": "subtree"
+    },
+    {
+      "object": "LayoutBlockFlow (positioned) DIV id='box'",
+      "reason": "subtree"
+    },
+    {
+      "object": "RootInlineBox",
+      "reason": "subtree"
+    },
+    {
+      "object": "LayoutInline (relative positioned) SPAN id='child'",
+      "reason": "subtree"
+    },
+    {
+      "object": "InlineFlowBox",
+      "reason": "subtree"
+    },
+    {
+      "object": "InlineFlowBox",
+      "reason": "subtree"
+    },
+    {
+      "object": "InlineFlowBox",
+      "reason": "subtree"
+    },
+    {
+      "object": "InlineFlowBox",
+      "reason": "subtree"
+    },
+    {
+      "object": "InlineFlowBox",
+      "reason": "subtree"
+    },
+    {
+      "object": "InlineFlowBox",
+      "reason": "subtree"
+    },
+    {
+      "object": "InlineFlowBox",
+      "reason": "subtree"
+    },
+    {
+      "object": "InlineFlowBox",
+      "reason": "subtree"
+    },
+    {
+      "object": "InlineFlowBox",
+      "reason": "subtree"
+    },
+    {
+      "object": "LayoutText #text",
+      "reason": "subtree"
+    },
+    {
+      "object": "InlineTextBox 'A B C'",
+      "reason": "subtree"
+    },
+    {
+      "object": "InlineTextBox 'D E F'",
+      "reason": "subtree"
+    },
+    {
+      "object": "InlineTextBox 'G H I'",
+      "reason": "subtree"
+    },
+    {
+      "object": "InlineTextBox 'J K L'",
+      "reason": "subtree"
+    },
+    {
+      "object": "InlineTextBox 'M N O'",
+      "reason": "subtree"
+    },
+    {
+      "object": "InlineTextBox 'P Q R'",
+      "reason": "subtree"
+    },
+    {
+      "object": "InlineTextBox 'S T U'",
+      "reason": "subtree"
+    },
+    {
+      "object": "InlineTextBox 'V W X'",
+      "reason": "subtree"
+    },
+    {
+      "object": "InlineTextBox 'Y Z'",
+      "reason": "subtree"
+    },
+    {
+      "object": "LayoutText #text",
+      "reason": "subtree"
     }
   ]
 }
diff --git a/third_party/WebKit/LayoutTests/platform/mac/virtual/disable-spinvalidation/paint/invalidation/svg/tabgroup-expected.png b/third_party/WebKit/LayoutTests/platform/mac/virtual/disable-spinvalidation/paint/invalidation/svg/tabgroup-expected.png
index 8cdbb94d..300a55b1 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/virtual/disable-spinvalidation/paint/invalidation/svg/tabgroup-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/mac/virtual/disable-spinvalidation/paint/invalidation/svg/tabgroup-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/mac/virtual/disable-spinvalidation/paint/invalidation/svg/tabgroup-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/virtual/disable-spinvalidation/paint/invalidation/svg/tabgroup-expected.txt
index 4b082a1..3b3189bc 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/virtual/disable-spinvalidation/paint/invalidation/svg/tabgroup-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/virtual/disable-spinvalidation/paint/invalidation/svg/tabgroup-expected.txt
@@ -834,6 +834,126 @@
       "reason": "layoutObject removal"
     },
     {
+      "object": "LayoutSVGText text",
+      "reason": "subtree"
+    },
+    {
+      "object": "RootInlineBox",
+      "reason": "subtree"
+    },
+    {
+      "object": "LayoutSVGTSpan tspan",
+      "reason": "subtree"
+    },
+    {
+      "object": "InlineFlowBox",
+      "reason": "subtree"
+    },
+    {
+      "object": "LayoutSVGInlineText #text",
+      "reason": "subtree"
+    },
+    {
+      "object": "InlineTextBox 'Geodata'",
+      "reason": "subtree"
+    },
+    {
+      "object": "LayoutSVGTSpan tspan",
+      "reason": "subtree"
+    },
+    {
+      "object": "InlineFlowBox",
+      "reason": "subtree"
+    },
+    {
+      "object": "LayoutSVGInlineText #text",
+      "reason": "subtree"
+    },
+    {
+      "object": "InlineTextBox 'Browser'",
+      "reason": "subtree"
+    },
+    {
+      "object": "LayoutSVGText text",
+      "reason": "subtree"
+    },
+    {
+      "object": "RootInlineBox",
+      "reason": "subtree"
+    },
+    {
+      "object": "LayoutSVGTSpan tspan",
+      "reason": "subtree"
+    },
+    {
+      "object": "InlineFlowBox",
+      "reason": "subtree"
+    },
+    {
+      "object": "LayoutSVGInlineText #text",
+      "reason": "subtree"
+    },
+    {
+      "object": "InlineTextBox 'Download'",
+      "reason": "subtree"
+    },
+    {
+      "object": "LayoutSVGTSpan tspan",
+      "reason": "subtree"
+    },
+    {
+      "object": "InlineFlowBox",
+      "reason": "subtree"
+    },
+    {
+      "object": "LayoutSVGInlineText #text",
+      "reason": "subtree"
+    },
+    {
+      "object": "InlineTextBox 'Folder'",
+      "reason": "subtree"
+    },
+    {
+      "object": "LayoutSVGText text",
+      "reason": "subtree"
+    },
+    {
+      "object": "RootInlineBox",
+      "reason": "subtree"
+    },
+    {
+      "object": "LayoutSVGTSpan tspan",
+      "reason": "subtree"
+    },
+    {
+      "object": "InlineFlowBox",
+      "reason": "subtree"
+    },
+    {
+      "object": "LayoutSVGInlineText #text",
+      "reason": "subtree"
+    },
+    {
+      "object": "InlineTextBox 'Your'",
+      "reason": "subtree"
+    },
+    {
+      "object": "LayoutSVGTSpan tspan",
+      "reason": "subtree"
+    },
+    {
+      "object": "InlineFlowBox",
+      "reason": "subtree"
+    },
+    {
+      "object": "LayoutSVGInlineText #text",
+      "reason": "subtree"
+    },
+    {
+      "object": "InlineTextBox 'Account'",
+      "reason": "subtree"
+    },
+    {
       "object": "LayoutSVGPath path",
       "reason": "layoutObject removal"
     },
@@ -870,6 +990,46 @@
       "reason": "layoutObject removal"
     },
     {
+      "object": "LayoutSVGText text",
+      "reason": "subtree"
+    },
+    {
+      "object": "RootInlineBox",
+      "reason": "subtree"
+    },
+    {
+      "object": "LayoutSVGTSpan tspan",
+      "reason": "subtree"
+    },
+    {
+      "object": "InlineFlowBox",
+      "reason": "subtree"
+    },
+    {
+      "object": "LayoutSVGInlineText #text",
+      "reason": "subtree"
+    },
+    {
+      "object": "InlineTextBox 'Help'",
+      "reason": "subtree"
+    },
+    {
+      "object": "LayoutSVGTSpan tspan",
+      "reason": "subtree"
+    },
+    {
+      "object": "InlineFlowBox",
+      "reason": "subtree"
+    },
+    {
+      "object": "LayoutSVGInlineText #text",
+      "reason": "subtree"
+    },
+    {
+      "object": "InlineTextBox '& Info'",
+      "reason": "subtree"
+    },
+    {
       "object": "LayoutSVGPath path",
       "reason": "layoutObject removal"
     },
diff --git a/third_party/WebKit/LayoutTests/platform/mac/virtual/disable-spinvalidation/paint/invalidation/svg/text-repaint-including-stroke-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/virtual/disable-spinvalidation/paint/invalidation/svg/text-repaint-including-stroke-expected.txt
index 1ce4c0ab..0da7d71 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/virtual/disable-spinvalidation/paint/invalidation/svg/text-repaint-including-stroke-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/virtual/disable-spinvalidation/paint/invalidation/svg/text-repaint-including-stroke-expected.txt
@@ -45,6 +45,22 @@
     {
       "object": "InlineTextBox 'Repaint me!'",
       "reason": "subtree"
+    },
+    {
+      "object": "LayoutSVGText text id='bounce'",
+      "reason": "subtree"
+    },
+    {
+      "object": "RootInlineBox",
+      "reason": "subtree"
+    },
+    {
+      "object": "LayoutSVGInlineText #text",
+      "reason": "subtree"
+    },
+    {
+      "object": "InlineTextBox 'Repaint me!'",
+      "reason": "subtree"
     }
   ]
 }
diff --git a/third_party/WebKit/LayoutTests/platform/mac/virtual/disable-spinvalidation/paint/invalidation/transform-inline-layered-child-expected.txt b/third_party/WebKit/LayoutTests/platform/mac/virtual/disable-spinvalidation/paint/invalidation/transform-inline-layered-child-expected.txt
index 04c2773..202cf0b 100644
--- a/third_party/WebKit/LayoutTests/platform/mac/virtual/disable-spinvalidation/paint/invalidation/transform-inline-layered-child-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/mac/virtual/disable-spinvalidation/paint/invalidation/transform-inline-layered-child-expected.txt
@@ -22,6 +22,11 @@
           "reason": "subtree"
         },
         {
+          "object": "LayoutBlockFlow (positioned) DIV id='box'",
+          "rect": [100, 100, 100, 162],
+          "reason": "subtree"
+        },
+        {
           "object": "LayoutInline (relative positioned) SPAN id='child'",
           "rect": [300, 300, 80, 162],
           "reason": "subtree"
@@ -131,6 +136,98 @@
     {
       "object": "LayoutText #text",
       "reason": "subtree"
+    },
+    {
+      "object": "LayoutBlockFlow (positioned) DIV id='box'",
+      "reason": "subtree"
+    },
+    {
+      "object": "RootInlineBox",
+      "reason": "subtree"
+    },
+    {
+      "object": "LayoutInline (relative positioned) SPAN id='child'",
+      "reason": "subtree"
+    },
+    {
+      "object": "InlineFlowBox",
+      "reason": "subtree"
+    },
+    {
+      "object": "InlineFlowBox",
+      "reason": "subtree"
+    },
+    {
+      "object": "InlineFlowBox",
+      "reason": "subtree"
+    },
+    {
+      "object": "InlineFlowBox",
+      "reason": "subtree"
+    },
+    {
+      "object": "InlineFlowBox",
+      "reason": "subtree"
+    },
+    {
+      "object": "InlineFlowBox",
+      "reason": "subtree"
+    },
+    {
+      "object": "InlineFlowBox",
+      "reason": "subtree"
+    },
+    {
+      "object": "InlineFlowBox",
+      "reason": "subtree"
+    },
+    {
+      "object": "InlineFlowBox",
+      "reason": "subtree"
+    },
+    {
+      "object": "LayoutText #text",
+      "reason": "subtree"
+    },
+    {
+      "object": "InlineTextBox 'A B C'",
+      "reason": "subtree"
+    },
+    {
+      "object": "InlineTextBox 'D E F'",
+      "reason": "subtree"
+    },
+    {
+      "object": "InlineTextBox 'G H I'",
+      "reason": "subtree"
+    },
+    {
+      "object": "InlineTextBox 'J K L'",
+      "reason": "subtree"
+    },
+    {
+      "object": "InlineTextBox 'M N O'",
+      "reason": "subtree"
+    },
+    {
+      "object": "InlineTextBox 'P Q R'",
+      "reason": "subtree"
+    },
+    {
+      "object": "InlineTextBox 'S T U'",
+      "reason": "subtree"
+    },
+    {
+      "object": "InlineTextBox 'V W X'",
+      "reason": "subtree"
+    },
+    {
+      "object": "InlineTextBox 'Y Z'",
+      "reason": "subtree"
+    },
+    {
+      "object": "LayoutText #text",
+      "reason": "subtree"
     }
   ]
 }
diff --git a/third_party/WebKit/LayoutTests/platform/mac/virtual/mojo-loading/http/tests/webfont/popup-menu-load-webfont-after-open-expected.png b/third_party/WebKit/LayoutTests/platform/mac/virtual/mojo-loading/http/tests/webfont/popup-menu-load-webfont-after-open-expected.png
new file mode 100644
index 0000000..6189e35e
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/platform/mac/virtual/mojo-loading/http/tests/webfont/popup-menu-load-webfont-after-open-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/forms/select/menulist-appearance-rtl-expected.png b/third_party/WebKit/LayoutTests/platform/win/fast/forms/select/menulist-appearance-rtl-expected.png
index bdce1b9..4438df52 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/forms/select/menulist-appearance-rtl-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/forms/select/menulist-appearance-rtl-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/fast/forms/select/menulist-appearance-rtl-expected.txt b/third_party/WebKit/LayoutTests/platform/win/fast/forms/select/menulist-appearance-rtl-expected.txt
index 87b2f45..220575e 100644
--- a/third_party/WebKit/LayoutTests/platform/win/fast/forms/select/menulist-appearance-rtl-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win/fast/forms/select/menulist-appearance-rtl-expected.txt
@@ -1,8 +1,8 @@
 layer at (0,0) size 800x600
   LayoutView at (0,0) size 800x600
-layer at (0,0) size 800x539
-  LayoutBlockFlow {HTML} at (0,0) size 800x539
-    LayoutBlockFlow {BODY} at (8,16) size 784x515
+layer at (0,0) size 800x540
+  LayoutBlockFlow {HTML} at (0,0) size 800x540
+    LayoutBlockFlow {BODY} at (8,16) size 784x516
       LayoutBlockFlow {P} at (0,0) size 784x36
         LayoutText {#text} at (0,0) size 758x35
           text run at (0,0) width 758: "This tests that bidirectional text is correctly rendered in popup controls. The order of the text below each popup button"
@@ -54,27 +54,27 @@
               text run at (0,0) width 23: "abc"
               text run at (22,0) width 47 RTL: "\x{5D0}\x{5E4}\x{5E8}\x{5E1}\x{5DE}\x{5D5}\x{5DF}"
       LayoutBlockFlow {HR} at (0,236) size 784x2 [border: (1px inset #EEEEEE)]
-      LayoutBlockFlow {DIV} at (0,246) size 784x53
+      LayoutBlockFlow {DIV} at (0,246) size 784x54
         LayoutBlockFlow (anonymous) at (0,0) size 784x18
           LayoutText {#text} at (0,0) size 632x17
             text run at (0,0) width 632: "The following line and the SELECT element should have same text, and no characters are lacking."
-        LayoutBlockFlow {DIV} at (0,18) size 784x15
-          LayoutText {#text} at (0,0) size 100x15
-            text run at (0,0) width 100 RTL: "\x{627}\x{644}\x{627}\x{642}\x{62A}\x{631}\x{627}\x{62D}\x{627}\x{62A} / \x{627}\x{644}\x{634}\x{643}\x{627}\x{648}\x{64A}"
-        LayoutBlockFlow (anonymous) at (0,33) size 784x20
+        LayoutBlockFlow {DIV} at (0,18) size 784x16
+          LayoutText {#text} at (0,0) size 101x16
+            text run at (0,0) width 101 RTL: "\x{627}\x{644}\x{627}\x{642}\x{62A}\x{631}\x{627}\x{62D}\x{627}\x{62A} / \x{627}\x{644}\x{634}\x{643}\x{627}\x{648}\x{64A}"
+        LayoutBlockFlow (anonymous) at (0,34) size 784x20
           LayoutMenuList {SELECT} at (0,0) size 113x20 [bgcolor=#FFFFFF] [border: (1px solid #A9A9A9)]
             LayoutBlockFlow (anonymous) at (1,1) size 111x18
-              LayoutText (anonymous) at (4,1) size 82x16
-                text run at (4,1) width 82 RTL: "\x{627}\x{644}\x{627}\x{642}\x{62A}\x{631}\x{627}\x{62D}\x{627}\x{62A} / \x{627}\x{644}\x{634}\x{643}\x{627}\x{648}\x{64A}"
+              LayoutText (anonymous) at (4,1) size 91x16
+                text run at (4,1) width 91 RTL: "\x{627}\x{644}\x{627}\x{642}\x{62A}\x{631}\x{627}\x{62D}\x{627}\x{62A} / \x{627}\x{644}\x{634}\x{643}\x{627}\x{648}\x{64A}"
           LayoutText {#text} at (0,0) size 0x0
-      LayoutBlockFlow {HR} at (0,307) size 784x2 [border: (1px inset #EEEEEE)]
-      LayoutBlockFlow {P} at (0,325) size 784x18
+      LayoutBlockFlow {HR} at (0,308) size 784x2 [border: (1px inset #EEEEEE)]
+      LayoutBlockFlow {P} at (0,326) size 784x18
         LayoutText {#text} at (0,0) size 709x17
           text run at (0,0) width 709: "Verify that the alignment and writing direction of each selected item matches the one below the pop-up button."
-layer at (8,375) size 784x156
-  LayoutBlockFlow {DIV} at (0,359) size 784x156
+layer at (8,376) size 784x156
+  LayoutBlockFlow {DIV} at (0,360) size 784x156
     LayoutMultiColumnSet (anonymous) at (0,0) size 784x156
-layer at (8,375) size 384x312 backgroundClip at (0,0) size 800x600 clip at (0,0) size 800x600
+layer at (8,376) size 384x312 backgroundClip at (0,0) size 800x600 clip at (0,0) size 800x600
   LayoutMultiColumnFlowThread (anonymous) at (0,0) size 384x312
     LayoutBlockFlow {DIV} at (0,0) size 384x156
       LayoutMenuList {SELECT} at (0,0) size 350x21 [bgcolor=#FFFFFF] [border: (1px solid #A9A9A9)]
diff --git a/third_party/WebKit/LayoutTests/platform/win/paint/invalidation/svg/tabgroup-expected.png b/third_party/WebKit/LayoutTests/platform/win/paint/invalidation/svg/tabgroup-expected.png
index cebff5a..a281c42 100644
--- a/third_party/WebKit/LayoutTests/platform/win/paint/invalidation/svg/tabgroup-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/paint/invalidation/svg/tabgroup-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/paint/invalidation/svg/tabgroup-expected.txt b/third_party/WebKit/LayoutTests/platform/win/paint/invalidation/svg/tabgroup-expected.txt
index 2782f28..696521b3 100644
--- a/third_party/WebKit/LayoutTests/platform/win/paint/invalidation/svg/tabgroup-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win/paint/invalidation/svg/tabgroup-expected.txt
@@ -329,6 +329,126 @@
       "reason": "layoutObject removal"
     },
     {
+      "object": "LayoutSVGText text",
+      "reason": "subtree"
+    },
+    {
+      "object": "RootInlineBox",
+      "reason": "subtree"
+    },
+    {
+      "object": "LayoutSVGTSpan tspan",
+      "reason": "subtree"
+    },
+    {
+      "object": "InlineFlowBox",
+      "reason": "subtree"
+    },
+    {
+      "object": "LayoutSVGInlineText #text",
+      "reason": "subtree"
+    },
+    {
+      "object": "InlineTextBox 'Geodata'",
+      "reason": "subtree"
+    },
+    {
+      "object": "LayoutSVGTSpan tspan",
+      "reason": "subtree"
+    },
+    {
+      "object": "InlineFlowBox",
+      "reason": "subtree"
+    },
+    {
+      "object": "LayoutSVGInlineText #text",
+      "reason": "subtree"
+    },
+    {
+      "object": "InlineTextBox 'Browser'",
+      "reason": "subtree"
+    },
+    {
+      "object": "LayoutSVGText text",
+      "reason": "subtree"
+    },
+    {
+      "object": "RootInlineBox",
+      "reason": "subtree"
+    },
+    {
+      "object": "LayoutSVGTSpan tspan",
+      "reason": "subtree"
+    },
+    {
+      "object": "InlineFlowBox",
+      "reason": "subtree"
+    },
+    {
+      "object": "LayoutSVGInlineText #text",
+      "reason": "subtree"
+    },
+    {
+      "object": "InlineTextBox 'Download'",
+      "reason": "subtree"
+    },
+    {
+      "object": "LayoutSVGTSpan tspan",
+      "reason": "subtree"
+    },
+    {
+      "object": "InlineFlowBox",
+      "reason": "subtree"
+    },
+    {
+      "object": "LayoutSVGInlineText #text",
+      "reason": "subtree"
+    },
+    {
+      "object": "InlineTextBox 'Folder'",
+      "reason": "subtree"
+    },
+    {
+      "object": "LayoutSVGText text",
+      "reason": "subtree"
+    },
+    {
+      "object": "RootInlineBox",
+      "reason": "subtree"
+    },
+    {
+      "object": "LayoutSVGTSpan tspan",
+      "reason": "subtree"
+    },
+    {
+      "object": "InlineFlowBox",
+      "reason": "subtree"
+    },
+    {
+      "object": "LayoutSVGInlineText #text",
+      "reason": "subtree"
+    },
+    {
+      "object": "InlineTextBox 'Your'",
+      "reason": "subtree"
+    },
+    {
+      "object": "LayoutSVGTSpan tspan",
+      "reason": "subtree"
+    },
+    {
+      "object": "InlineFlowBox",
+      "reason": "subtree"
+    },
+    {
+      "object": "LayoutSVGInlineText #text",
+      "reason": "subtree"
+    },
+    {
+      "object": "InlineTextBox 'Account'",
+      "reason": "subtree"
+    },
+    {
       "object": "LayoutSVGPath path",
       "reason": "layoutObject removal"
     },
@@ -365,6 +485,46 @@
       "reason": "layoutObject removal"
     },
     {
+      "object": "LayoutSVGText text",
+      "reason": "subtree"
+    },
+    {
+      "object": "RootInlineBox",
+      "reason": "subtree"
+    },
+    {
+      "object": "LayoutSVGTSpan tspan",
+      "reason": "subtree"
+    },
+    {
+      "object": "InlineFlowBox",
+      "reason": "subtree"
+    },
+    {
+      "object": "LayoutSVGInlineText #text",
+      "reason": "subtree"
+    },
+    {
+      "object": "InlineTextBox 'Help'",
+      "reason": "subtree"
+    },
+    {
+      "object": "LayoutSVGTSpan tspan",
+      "reason": "subtree"
+    },
+    {
+      "object": "InlineFlowBox",
+      "reason": "subtree"
+    },
+    {
+      "object": "LayoutSVGInlineText #text",
+      "reason": "subtree"
+    },
+    {
+      "object": "InlineTextBox '& Info'",
+      "reason": "subtree"
+    },
+    {
       "object": "LayoutSVGPath path",
       "reason": "layoutObject removal"
     },
diff --git a/third_party/WebKit/LayoutTests/platform/win/paint/invalidation/svg/text-repaint-including-stroke-expected.txt b/third_party/WebKit/LayoutTests/platform/win/paint/invalidation/svg/text-repaint-including-stroke-expected.txt
index ecd4537..006dd7f 100644
--- a/third_party/WebKit/LayoutTests/platform/win/paint/invalidation/svg/text-repaint-including-stroke-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win/paint/invalidation/svg/text-repaint-including-stroke-expected.txt
@@ -12,6 +12,11 @@
           "reason": "subtree"
         },
         {
+          "object": "LayoutSVGInlineText #text",
+          "rect": [30, 0, 404, 57],
+          "reason": "subtree"
+        },
+        {
           "object": "LayoutSVGText text id='bounce'",
           "rect": [30, 0, 404, 57],
           "reason": "subtree"
@@ -35,6 +40,22 @@
     {
       "object": "InlineTextBox 'Repaint me!'",
       "reason": "subtree"
+    },
+    {
+      "object": "LayoutSVGText text id='bounce'",
+      "reason": "subtree"
+    },
+    {
+      "object": "RootInlineBox",
+      "reason": "subtree"
+    },
+    {
+      "object": "LayoutSVGInlineText #text",
+      "reason": "subtree"
+    },
+    {
+      "object": "InlineTextBox 'Repaint me!'",
+      "reason": "subtree"
     }
   ]
 }
diff --git a/third_party/WebKit/LayoutTests/platform/win/paint/invalidation/transform-inline-layered-child-expected.txt b/third_party/WebKit/LayoutTests/platform/win/paint/invalidation/transform-inline-layered-child-expected.txt
index 1b971517..27bc48f 100644
--- a/third_party/WebKit/LayoutTests/platform/win/paint/invalidation/transform-inline-layered-child-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win/paint/invalidation/transform-inline-layered-child-expected.txt
@@ -22,6 +22,11 @@
           "reason": "subtree"
         },
         {
+          "object": "LayoutBlockFlow (positioned) DIV id='box'",
+          "rect": [100, 100, 100, 162],
+          "reason": "subtree"
+        },
+        {
           "object": "LayoutInline (relative positioned) SPAN id='child'",
           "rect": [300, 300, 80, 161],
           "reason": "subtree"
@@ -126,6 +131,98 @@
     {
       "object": "LayoutText #text",
       "reason": "subtree"
+    },
+    {
+      "object": "LayoutBlockFlow (positioned) DIV id='box'",
+      "reason": "subtree"
+    },
+    {
+      "object": "RootInlineBox",
+      "reason": "subtree"
+    },
+    {
+      "object": "LayoutInline (relative positioned) SPAN id='child'",
+      "reason": "subtree"
+    },
+    {
+      "object": "InlineFlowBox",
+      "reason": "subtree"
+    },
+    {
+      "object": "InlineFlowBox",
+      "reason": "subtree"
+    },
+    {
+      "object": "InlineFlowBox",
+      "reason": "subtree"
+    },
+    {
+      "object": "InlineFlowBox",
+      "reason": "subtree"
+    },
+    {
+      "object": "InlineFlowBox",
+      "reason": "subtree"
+    },
+    {
+      "object": "InlineFlowBox",
+      "reason": "subtree"
+    },
+    {
+      "object": "InlineFlowBox",
+      "reason": "subtree"
+    },
+    {
+      "object": "InlineFlowBox",
+      "reason": "subtree"
+    },
+    {
+      "object": "InlineFlowBox",
+      "reason": "subtree"
+    },
+    {
+      "object": "LayoutText #text",
+      "reason": "subtree"
+    },
+    {
+      "object": "InlineTextBox 'A B C'",
+      "reason": "subtree"
+    },
+    {
+      "object": "InlineTextBox 'D E F'",
+      "reason": "subtree"
+    },
+    {
+      "object": "InlineTextBox 'G H I'",
+      "reason": "subtree"
+    },
+    {
+      "object": "InlineTextBox 'J K L'",
+      "reason": "subtree"
+    },
+    {
+      "object": "InlineTextBox 'M N O'",
+      "reason": "subtree"
+    },
+    {
+      "object": "InlineTextBox 'P Q R'",
+      "reason": "subtree"
+    },
+    {
+      "object": "InlineTextBox 'S T U'",
+      "reason": "subtree"
+    },
+    {
+      "object": "InlineTextBox 'V W X'",
+      "reason": "subtree"
+    },
+    {
+      "object": "InlineTextBox 'Y Z'",
+      "reason": "subtree"
+    },
+    {
+      "object": "LayoutText #text",
+      "reason": "subtree"
     }
   ]
 }
diff --git a/third_party/WebKit/LayoutTests/platform/win/virtual/disable-spinvalidation/paint/invalidation/svg/tabgroup-expected.png b/third_party/WebKit/LayoutTests/platform/win/virtual/disable-spinvalidation/paint/invalidation/svg/tabgroup-expected.png
index cebff5a..a281c42 100644
--- a/third_party/WebKit/LayoutTests/platform/win/virtual/disable-spinvalidation/paint/invalidation/svg/tabgroup-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win/virtual/disable-spinvalidation/paint/invalidation/svg/tabgroup-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/platform/win/virtual/disable-spinvalidation/paint/invalidation/svg/tabgroup-expected.txt b/third_party/WebKit/LayoutTests/platform/win/virtual/disable-spinvalidation/paint/invalidation/svg/tabgroup-expected.txt
index db52fc8..9d4b3024 100644
--- a/third_party/WebKit/LayoutTests/platform/win/virtual/disable-spinvalidation/paint/invalidation/svg/tabgroup-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win/virtual/disable-spinvalidation/paint/invalidation/svg/tabgroup-expected.txt
@@ -834,6 +834,126 @@
       "reason": "layoutObject removal"
     },
     {
+      "object": "LayoutSVGText text",
+      "reason": "subtree"
+    },
+    {
+      "object": "RootInlineBox",
+      "reason": "subtree"
+    },
+    {
+      "object": "LayoutSVGTSpan tspan",
+      "reason": "subtree"
+    },
+    {
+      "object": "InlineFlowBox",
+      "reason": "subtree"
+    },
+    {
+      "object": "LayoutSVGInlineText #text",
+      "reason": "subtree"
+    },
+    {
+      "object": "InlineTextBox 'Geodata'",
+      "reason": "subtree"
+    },
+    {
+      "object": "LayoutSVGTSpan tspan",
+      "reason": "subtree"
+    },
+    {
+      "object": "InlineFlowBox",
+      "reason": "subtree"
+    },
+    {
+      "object": "LayoutSVGInlineText #text",
+      "reason": "subtree"
+    },
+    {
+      "object": "InlineTextBox 'Browser'",
+      "reason": "subtree"
+    },
+    {
+      "object": "LayoutSVGText text",
+      "reason": "subtree"
+    },
+    {
+      "object": "RootInlineBox",
+      "reason": "subtree"
+    },
+    {
+      "object": "LayoutSVGTSpan tspan",
+      "reason": "subtree"
+    },
+    {
+      "object": "InlineFlowBox",
+      "reason": "subtree"
+    },
+    {
+      "object": "LayoutSVGInlineText #text",
+      "reason": "subtree"
+    },
+    {
+      "object": "InlineTextBox 'Download'",
+      "reason": "subtree"
+    },
+    {
+      "object": "LayoutSVGTSpan tspan",
+      "reason": "subtree"
+    },
+    {
+      "object": "InlineFlowBox",
+      "reason": "subtree"
+    },
+    {
+      "object": "LayoutSVGInlineText #text",
+      "reason": "subtree"
+    },
+    {
+      "object": "InlineTextBox 'Folder'",
+      "reason": "subtree"
+    },
+    {
+      "object": "LayoutSVGText text",
+      "reason": "subtree"
+    },
+    {
+      "object": "RootInlineBox",
+      "reason": "subtree"
+    },
+    {
+      "object": "LayoutSVGTSpan tspan",
+      "reason": "subtree"
+    },
+    {
+      "object": "InlineFlowBox",
+      "reason": "subtree"
+    },
+    {
+      "object": "LayoutSVGInlineText #text",
+      "reason": "subtree"
+    },
+    {
+      "object": "InlineTextBox 'Your'",
+      "reason": "subtree"
+    },
+    {
+      "object": "LayoutSVGTSpan tspan",
+      "reason": "subtree"
+    },
+    {
+      "object": "InlineFlowBox",
+      "reason": "subtree"
+    },
+    {
+      "object": "LayoutSVGInlineText #text",
+      "reason": "subtree"
+    },
+    {
+      "object": "InlineTextBox 'Account'",
+      "reason": "subtree"
+    },
+    {
       "object": "LayoutSVGPath path",
       "reason": "layoutObject removal"
     },
@@ -870,6 +990,46 @@
       "reason": "layoutObject removal"
     },
     {
+      "object": "LayoutSVGText text",
+      "reason": "subtree"
+    },
+    {
+      "object": "RootInlineBox",
+      "reason": "subtree"
+    },
+    {
+      "object": "LayoutSVGTSpan tspan",
+      "reason": "subtree"
+    },
+    {
+      "object": "InlineFlowBox",
+      "reason": "subtree"
+    },
+    {
+      "object": "LayoutSVGInlineText #text",
+      "reason": "subtree"
+    },
+    {
+      "object": "InlineTextBox 'Help'",
+      "reason": "subtree"
+    },
+    {
+      "object": "LayoutSVGTSpan tspan",
+      "reason": "subtree"
+    },
+    {
+      "object": "InlineFlowBox",
+      "reason": "subtree"
+    },
+    {
+      "object": "LayoutSVGInlineText #text",
+      "reason": "subtree"
+    },
+    {
+      "object": "InlineTextBox '& Info'",
+      "reason": "subtree"
+    },
+    {
       "object": "LayoutSVGPath path",
       "reason": "layoutObject removal"
     },
diff --git a/third_party/WebKit/LayoutTests/platform/win/virtual/disable-spinvalidation/paint/invalidation/svg/text-repaint-including-stroke-expected.txt b/third_party/WebKit/LayoutTests/platform/win/virtual/disable-spinvalidation/paint/invalidation/svg/text-repaint-including-stroke-expected.txt
index 236a782..6ccfbb61 100644
--- a/third_party/WebKit/LayoutTests/platform/win/virtual/disable-spinvalidation/paint/invalidation/svg/text-repaint-including-stroke-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win/virtual/disable-spinvalidation/paint/invalidation/svg/text-repaint-including-stroke-expected.txt
@@ -45,6 +45,22 @@
     {
       "object": "InlineTextBox 'Repaint me!'",
       "reason": "subtree"
+    },
+    {
+      "object": "LayoutSVGText text id='bounce'",
+      "reason": "subtree"
+    },
+    {
+      "object": "RootInlineBox",
+      "reason": "subtree"
+    },
+    {
+      "object": "LayoutSVGInlineText #text",
+      "reason": "subtree"
+    },
+    {
+      "object": "InlineTextBox 'Repaint me!'",
+      "reason": "subtree"
     }
   ]
 }
diff --git a/third_party/WebKit/LayoutTests/platform/win/virtual/disable-spinvalidation/paint/invalidation/transform-inline-layered-child-expected.txt b/third_party/WebKit/LayoutTests/platform/win/virtual/disable-spinvalidation/paint/invalidation/transform-inline-layered-child-expected.txt
index 564b65f..822fdbbc 100644
--- a/third_party/WebKit/LayoutTests/platform/win/virtual/disable-spinvalidation/paint/invalidation/transform-inline-layered-child-expected.txt
+++ b/third_party/WebKit/LayoutTests/platform/win/virtual/disable-spinvalidation/paint/invalidation/transform-inline-layered-child-expected.txt
@@ -22,6 +22,11 @@
           "reason": "subtree"
         },
         {
+          "object": "LayoutBlockFlow (positioned) DIV id='box'",
+          "rect": [100, 100, 100, 162],
+          "reason": "subtree"
+        },
+        {
           "object": "LayoutInline (relative positioned) SPAN id='child'",
           "rect": [300, 300, 80, 161],
           "reason": "subtree"
@@ -131,6 +136,98 @@
     {
       "object": "LayoutText #text",
       "reason": "subtree"
+    },
+    {
+      "object": "LayoutBlockFlow (positioned) DIV id='box'",
+      "reason": "subtree"
+    },
+    {
+      "object": "RootInlineBox",
+      "reason": "subtree"
+    },
+    {
+      "object": "LayoutInline (relative positioned) SPAN id='child'",
+      "reason": "subtree"
+    },
+    {
+      "object": "InlineFlowBox",
+      "reason": "subtree"
+    },
+    {
+      "object": "InlineFlowBox",
+      "reason": "subtree"
+    },
+    {
+      "object": "InlineFlowBox",
+      "reason": "subtree"
+    },
+    {
+      "object": "InlineFlowBox",
+      "reason": "subtree"
+    },
+    {
+      "object": "InlineFlowBox",
+      "reason": "subtree"
+    },
+    {
+      "object": "InlineFlowBox",
+      "reason": "subtree"
+    },
+    {
+      "object": "InlineFlowBox",
+      "reason": "subtree"
+    },
+    {
+      "object": "InlineFlowBox",
+      "reason": "subtree"
+    },
+    {
+      "object": "InlineFlowBox",
+      "reason": "subtree"
+    },
+    {
+      "object": "LayoutText #text",
+      "reason": "subtree"
+    },
+    {
+      "object": "InlineTextBox 'A B C'",
+      "reason": "subtree"
+    },
+    {
+      "object": "InlineTextBox 'D E F'",
+      "reason": "subtree"
+    },
+    {
+      "object": "InlineTextBox 'G H I'",
+      "reason": "subtree"
+    },
+    {
+      "object": "InlineTextBox 'J K L'",
+      "reason": "subtree"
+    },
+    {
+      "object": "InlineTextBox 'M N O'",
+      "reason": "subtree"
+    },
+    {
+      "object": "InlineTextBox 'P Q R'",
+      "reason": "subtree"
+    },
+    {
+      "object": "InlineTextBox 'S T U'",
+      "reason": "subtree"
+    },
+    {
+      "object": "InlineTextBox 'V W X'",
+      "reason": "subtree"
+    },
+    {
+      "object": "InlineTextBox 'Y Z'",
+      "reason": "subtree"
+    },
+    {
+      "object": "LayoutText #text",
+      "reason": "subtree"
     }
   ]
 }
diff --git a/third_party/WebKit/LayoutTests/platform/win7/fast/table/backgr_border-table-row-group-expected.png b/third_party/WebKit/LayoutTests/platform/win7/fast/table/backgr_border-table-row-group-expected.png
index 5b12c37..d18d304 100644
--- a/third_party/WebKit/LayoutTests/platform/win7/fast/table/backgr_border-table-row-group-expected.png
+++ b/third_party/WebKit/LayoutTests/platform/win7/fast/table/backgr_border-table-row-group-expected.png
Binary files differ
diff --git a/third_party/WebKit/LayoutTests/resources/testharnessreport.js b/third_party/WebKit/LayoutTests/resources/testharnessreport.js
index 96f2dd2..cbcfbe2 100644
--- a/third_party/WebKit/LayoutTests/resources/testharnessreport.js
+++ b/third_party/WebKit/LayoutTests/resources/testharnessreport.js
@@ -214,6 +214,10 @@
         results.textContent = resultStr;
 
         function done() {
+            let xhtmlNS = 'http://www.w3.org/1999/xhtml';
+            var body = null;
+            if (output_document.body && output_document.body.tagName == 'BODY' && output_document.body.namespaceURI == xhtmlNS)
+                body = output_document.body;
             // A temporary workaround since |window.self| property lookup starts
             // failing if the frame is detached. |output_document| may be an
             // ancestor of |self| so clearing |textContent| may detach |self|.
@@ -230,17 +234,20 @@
 
                 // Anything isn't material to the testrunner output, so should
                 // be hidden from the text dump.
-                if (output_document.body && output_document.body.tagName == 'BODY')
-                    output_document.body.textContent = '';
+                if (body)
+                    body.textContent = '';
             }
 
             // Add results element to output_document.
-            if (!output_document.body || output_document.body.tagName != 'BODY') {
-                if (!output_document.documentElement)
-                    output_document.appendChild(output_document.createElement('html'));
-                else if (output_document.body) // output_document.body is <frameset>.
-                    output_document.body.remove();
-                output_document.documentElement.appendChild(output_document.createElement("body"));
+            if (!body) {
+                // output_document might be an SVG document.
+                if (output_document.documentElement)
+                    output_document.documentElement.remove();
+                let html = output_document.createElementNS(xhtmlNS, 'html');
+                output_document.appendChild(html);
+                body = output_document.createElementNS(xhtmlNS, 'body');
+                body.setAttribute('style', 'white-space:pre;');
+                html.appendChild(body);
             }
             output_document.body.appendChild(results);
 
diff --git a/third_party/WebKit/LayoutTests/virtual/disable-spinvalidation/paint/invalidation/create-layer-repaint-expected.txt b/third_party/WebKit/LayoutTests/virtual/disable-spinvalidation/paint/invalidation/create-layer-repaint-expected.txt
new file mode 100644
index 0000000..866d316
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/virtual/disable-spinvalidation/paint/invalidation/create-layer-repaint-expected.txt
@@ -0,0 +1,33 @@
+{
+  "layers": [
+    {
+      "name": "LayoutView #document",
+      "bounds": [800, 600],
+      "contentsOpaque": true,
+      "drawsContent": true,
+      "paintInvalidations": [
+        {
+          "object": "LayoutBlockFlow DIV id='test' class='stretchy'",
+          "rect": [28, 54, 500, 50],
+          "reason": "subtree"
+        },
+        {
+          "object": "LayoutBlockFlow DIV id='test' class='stretchy'",
+          "rect": [28, 54, 250, 50],
+          "reason": "subtree"
+        }
+      ]
+    }
+  ],
+  "objectPaintInvalidations": [
+    {
+      "object": "LayoutBlockFlow DIV id='test' class='stretchy'",
+      "reason": "subtree"
+    },
+    {
+      "object": "LayoutBlockFlow DIV id='test' class='stretchy'",
+      "reason": "subtree"
+    }
+  ]
+}
+
diff --git a/third_party/WebKit/LayoutTests/virtual/disable-spinvalidation/paint/invalidation/scroll-descendant-with-cached-cliprects-expected.txt b/third_party/WebKit/LayoutTests/virtual/disable-spinvalidation/paint/invalidation/scroll-descendant-with-cached-cliprects-expected.txt
index a9df748..18a5be6a 100644
--- a/third_party/WebKit/LayoutTests/virtual/disable-spinvalidation/paint/invalidation/scroll-descendant-with-cached-cliprects-expected.txt
+++ b/third_party/WebKit/LayoutTests/virtual/disable-spinvalidation/paint/invalidation/scroll-descendant-with-cached-cliprects-expected.txt
@@ -27,11 +27,6 @@
           "reason": "subtree"
         },
         {
-          "object": "LayoutBlockFlow (positioned) DIV id='scrollpanel'",
-          "rect": [677, 50, 100, 100],
-          "reason": "subtree"
-        },
-        {
           "object": "LayoutBlockFlow (relative positioned) DIV class='container'",
           "rect": [677, 50, 100, 100],
           "reason": "subtree"
@@ -45,12 +40,33 @@
           "object": "LayoutBlockFlow DIV",
           "rect": [677, 50, 100, 100],
           "reason": "subtree"
+        },
+        {
+          "object": "LayoutBlockFlow DIV id='scrollpanel'",
+          "rect": [677, 50, 100, 100],
+          "reason": "subtree"
         }
       ]
     }
   ],
   "objectPaintInvalidations": [
     {
+      "object": "LayoutBlockFlow DIV id='scrollpanel'",
+      "reason": "subtree"
+    },
+    {
+      "object": "LayoutBlockFlow (relative positioned) DIV class='container'",
+      "reason": "subtree"
+    },
+    {
+      "object": "LayoutBlockFlow (relative positioned) DIV id='ul'",
+      "reason": "subtree"
+    },
+    {
+      "object": "LayoutBlockFlow DIV",
+      "reason": "subtree"
+    },
+    {
       "object": "LayoutBlockFlow (positioned) DIV id='scrollpanel'",
       "reason": "style change"
     },
diff --git a/third_party/WebKit/LayoutTests/virtual/layout_ng/external/csswg-test/css21/linebox/README.txt b/third_party/WebKit/LayoutTests/virtual/layout_ng/external/csswg-test/css21/linebox/README.txt
new file mode 100644
index 0000000..fb847d5
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/virtual/layout_ng/external/csswg-test/css21/linebox/README.txt
@@ -0,0 +1,3 @@
+# This suite runs the tests in external/csswg-test/css21/linebox with
+# --enable-blink-features=LayoutNG,LayoutNGInline.
+# The LayoutNG project is described here: http://goo.gl/1hwhfX
diff --git a/third_party/WebKit/Source/bindings/scripts/v8_union.py b/third_party/WebKit/Source/bindings/scripts/v8_union.py
index bed82625..e1464a49 100644
--- a/third_party/WebKit/Source/bindings/scripts/v8_union.py
+++ b/third_party/WebKit/Source/bindings/scripts/v8_union.py
@@ -54,7 +54,7 @@
     object_type = None
     record_type = None
     string_type = None
-    for member in union_type.member_types:
+    for member in sorted(union_type.member_types, key=lambda m: m.name):
         context = member_context(member, interfaces_info)
         members.append(context)
         if member.base_type == 'ArrayBuffer':
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/ByteStringSequenceSequenceOrByteStringByteStringRecord.cpp b/third_party/WebKit/Source/bindings/tests/results/core/ByteStringSequenceSequenceOrByteStringByteStringRecord.cpp
index e44c4e3..bba8217 100644
--- a/third_party/WebKit/Source/bindings/tests/results/core/ByteStringSequenceSequenceOrByteStringByteStringRecord.cpp
+++ b/third_party/WebKit/Source/bindings/tests/results/core/ByteStringSequenceSequenceOrByteStringByteStringRecord.cpp
@@ -19,23 +19,6 @@
 
 ByteStringSequenceSequenceOrByteStringByteStringRecord::ByteStringSequenceSequenceOrByteStringByteStringRecord() : m_type(SpecificTypeNone) {}
 
-const Vector<Vector<String>>& ByteStringSequenceSequenceOrByteStringByteStringRecord::getAsByteStringSequenceSequence() const {
-  DCHECK(isByteStringSequenceSequence());
-  return m_byteStringSequenceSequence;
-}
-
-void ByteStringSequenceSequenceOrByteStringByteStringRecord::setByteStringSequenceSequence(const Vector<Vector<String>>& value) {
-  DCHECK(isNull());
-  m_byteStringSequenceSequence = value;
-  m_type = SpecificTypeByteStringSequenceSequence;
-}
-
-ByteStringSequenceSequenceOrByteStringByteStringRecord ByteStringSequenceSequenceOrByteStringByteStringRecord::fromByteStringSequenceSequence(const Vector<Vector<String>>& value) {
-  ByteStringSequenceSequenceOrByteStringByteStringRecord container;
-  container.setByteStringSequenceSequence(value);
-  return container;
-}
-
 const Vector<std::pair<String, String>>& ByteStringSequenceSequenceOrByteStringByteStringRecord::getAsByteStringByteStringRecord() const {
   DCHECK(isByteStringByteStringRecord());
   return m_byteStringByteStringRecord;
@@ -53,6 +36,23 @@
   return container;
 }
 
+const Vector<Vector<String>>& ByteStringSequenceSequenceOrByteStringByteStringRecord::getAsByteStringSequenceSequence() const {
+  DCHECK(isByteStringSequenceSequence());
+  return m_byteStringSequenceSequence;
+}
+
+void ByteStringSequenceSequenceOrByteStringByteStringRecord::setByteStringSequenceSequence(const Vector<Vector<String>>& value) {
+  DCHECK(isNull());
+  m_byteStringSequenceSequence = value;
+  m_type = SpecificTypeByteStringSequenceSequence;
+}
+
+ByteStringSequenceSequenceOrByteStringByteStringRecord ByteStringSequenceSequenceOrByteStringByteStringRecord::fromByteStringSequenceSequence(const Vector<Vector<String>>& value) {
+  ByteStringSequenceSequenceOrByteStringByteStringRecord container;
+  container.setByteStringSequenceSequence(value);
+  return container;
+}
+
 ByteStringSequenceSequenceOrByteStringByteStringRecord::ByteStringSequenceSequenceOrByteStringByteStringRecord(const ByteStringSequenceSequenceOrByteStringByteStringRecord&) = default;
 ByteStringSequenceSequenceOrByteStringByteStringRecord::~ByteStringSequenceSequenceOrByteStringByteStringRecord() = default;
 ByteStringSequenceSequenceOrByteStringByteStringRecord& ByteStringSequenceSequenceOrByteStringByteStringRecord::operator=(const ByteStringSequenceSequenceOrByteStringByteStringRecord&) = default;
@@ -90,10 +90,10 @@
   switch (impl.m_type) {
     case ByteStringSequenceSequenceOrByteStringByteStringRecord::SpecificTypeNone:
       return v8::Null(isolate);
-    case ByteStringSequenceSequenceOrByteStringByteStringRecord::SpecificTypeByteStringSequenceSequence:
-      return ToV8(impl.getAsByteStringSequenceSequence(), creationContext, isolate);
     case ByteStringSequenceSequenceOrByteStringByteStringRecord::SpecificTypeByteStringByteStringRecord:
       return ToV8(impl.getAsByteStringByteStringRecord(), creationContext, isolate);
+    case ByteStringSequenceSequenceOrByteStringByteStringRecord::SpecificTypeByteStringSequenceSequence:
+      return ToV8(impl.getAsByteStringSequenceSequence(), creationContext, isolate);
     default:
       NOTREACHED();
   }
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/ByteStringSequenceSequenceOrByteStringByteStringRecord.h b/third_party/WebKit/Source/bindings/tests/results/core/ByteStringSequenceSequenceOrByteStringByteStringRecord.h
index a2e89d8..009bd64 100644
--- a/third_party/WebKit/Source/bindings/tests/results/core/ByteStringSequenceSequenceOrByteStringByteStringRecord.h
+++ b/third_party/WebKit/Source/bindings/tests/results/core/ByteStringSequenceSequenceOrByteStringByteStringRecord.h
@@ -29,16 +29,16 @@
   ByteStringSequenceSequenceOrByteStringByteStringRecord();
   bool isNull() const { return m_type == SpecificTypeNone; }
 
-  bool isByteStringSequenceSequence() const { return m_type == SpecificTypeByteStringSequenceSequence; }
-  const Vector<Vector<String>>& getAsByteStringSequenceSequence() const;
-  void setByteStringSequenceSequence(const Vector<Vector<String>>&);
-  static ByteStringSequenceSequenceOrByteStringByteStringRecord fromByteStringSequenceSequence(const Vector<Vector<String>>&);
-
   bool isByteStringByteStringRecord() const { return m_type == SpecificTypeByteStringByteStringRecord; }
   const Vector<std::pair<String, String>>& getAsByteStringByteStringRecord() const;
   void setByteStringByteStringRecord(const Vector<std::pair<String, String>>&);
   static ByteStringSequenceSequenceOrByteStringByteStringRecord fromByteStringByteStringRecord(const Vector<std::pair<String, String>>&);
 
+  bool isByteStringSequenceSequence() const { return m_type == SpecificTypeByteStringSequenceSequence; }
+  const Vector<Vector<String>>& getAsByteStringSequenceSequence() const;
+  void setByteStringSequenceSequence(const Vector<Vector<String>>&);
+  static ByteStringSequenceSequenceOrByteStringByteStringRecord fromByteStringSequenceSequence(const Vector<Vector<String>>&);
+
   ByteStringSequenceSequenceOrByteStringByteStringRecord(const ByteStringSequenceSequenceOrByteStringByteStringRecord&);
   ~ByteStringSequenceSequenceOrByteStringByteStringRecord();
   ByteStringSequenceSequenceOrByteStringByteStringRecord& operator=(const ByteStringSequenceSequenceOrByteStringByteStringRecord&);
@@ -47,13 +47,13 @@
  private:
   enum SpecificTypes {
     SpecificTypeNone,
-    SpecificTypeByteStringSequenceSequence,
     SpecificTypeByteStringByteStringRecord,
+    SpecificTypeByteStringSequenceSequence,
   };
   SpecificTypes m_type;
 
-  Vector<Vector<String>> m_byteStringSequenceSequence;
   Vector<std::pair<String, String>> m_byteStringByteStringRecord;
+  Vector<Vector<String>> m_byteStringSequenceSequence;
 
   friend CORE_EXPORT v8::Local<v8::Value> ToV8(const ByteStringSequenceSequenceOrByteStringByteStringRecord&, v8::Local<v8::Object>, v8::Isolate*);
 };
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/StringOrArrayBufferOrArrayBufferView.cpp b/third_party/WebKit/Source/bindings/tests/results/core/StringOrArrayBufferOrArrayBufferView.cpp
index c9c8bdd..56335f52 100644
--- a/third_party/WebKit/Source/bindings/tests/results/core/StringOrArrayBufferOrArrayBufferView.cpp
+++ b/third_party/WebKit/Source/bindings/tests/results/core/StringOrArrayBufferOrArrayBufferView.cpp
@@ -22,23 +22,6 @@
 
 StringOrArrayBufferOrArrayBufferView::StringOrArrayBufferOrArrayBufferView() : m_type(SpecificTypeNone) {}
 
-String StringOrArrayBufferOrArrayBufferView::getAsString() const {
-  DCHECK(isString());
-  return m_string;
-}
-
-void StringOrArrayBufferOrArrayBufferView::setString(String value) {
-  DCHECK(isNull());
-  m_string = value;
-  m_type = SpecificTypeString;
-}
-
-StringOrArrayBufferOrArrayBufferView StringOrArrayBufferOrArrayBufferView::fromString(String value) {
-  StringOrArrayBufferOrArrayBufferView container;
-  container.setString(value);
-  return container;
-}
-
 TestArrayBuffer* StringOrArrayBufferOrArrayBufferView::getAsArrayBuffer() const {
   DCHECK(isArrayBuffer());
   return m_arrayBuffer;
@@ -73,6 +56,23 @@
   return container;
 }
 
+String StringOrArrayBufferOrArrayBufferView::getAsString() const {
+  DCHECK(isString());
+  return m_string;
+}
+
+void StringOrArrayBufferOrArrayBufferView::setString(String value) {
+  DCHECK(isNull());
+  m_string = value;
+  m_type = SpecificTypeString;
+}
+
+StringOrArrayBufferOrArrayBufferView StringOrArrayBufferOrArrayBufferView::fromString(String value) {
+  StringOrArrayBufferOrArrayBufferView container;
+  container.setString(value);
+  return container;
+}
+
 StringOrArrayBufferOrArrayBufferView::StringOrArrayBufferOrArrayBufferView(const StringOrArrayBufferOrArrayBufferView&) = default;
 StringOrArrayBufferOrArrayBufferView::~StringOrArrayBufferOrArrayBufferView() = default;
 StringOrArrayBufferOrArrayBufferView& StringOrArrayBufferOrArrayBufferView::operator=(const StringOrArrayBufferOrArrayBufferView&) = default;
@@ -114,12 +114,12 @@
   switch (impl.m_type) {
     case StringOrArrayBufferOrArrayBufferView::SpecificTypeNone:
       return v8::Null(isolate);
-    case StringOrArrayBufferOrArrayBufferView::SpecificTypeString:
-      return v8String(isolate, impl.getAsString());
     case StringOrArrayBufferOrArrayBufferView::SpecificTypeArrayBuffer:
       return ToV8(impl.getAsArrayBuffer(), creationContext, isolate);
     case StringOrArrayBufferOrArrayBufferView::SpecificTypeArrayBufferView:
       return ToV8(impl.getAsArrayBufferView(), creationContext, isolate);
+    case StringOrArrayBufferOrArrayBufferView::SpecificTypeString:
+      return v8String(isolate, impl.getAsString());
     default:
       NOTREACHED();
   }
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/StringOrArrayBufferOrArrayBufferView.h b/third_party/WebKit/Source/bindings/tests/results/core/StringOrArrayBufferOrArrayBufferView.h
index 9b39fc0..94461f4 100644
--- a/third_party/WebKit/Source/bindings/tests/results/core/StringOrArrayBufferOrArrayBufferView.h
+++ b/third_party/WebKit/Source/bindings/tests/results/core/StringOrArrayBufferOrArrayBufferView.h
@@ -30,11 +30,6 @@
   StringOrArrayBufferOrArrayBufferView();
   bool isNull() const { return m_type == SpecificTypeNone; }
 
-  bool isString() const { return m_type == SpecificTypeString; }
-  String getAsString() const;
-  void setString(String);
-  static StringOrArrayBufferOrArrayBufferView fromString(String);
-
   bool isArrayBuffer() const { return m_type == SpecificTypeArrayBuffer; }
   TestArrayBuffer* getAsArrayBuffer() const;
   void setArrayBuffer(TestArrayBuffer*);
@@ -45,6 +40,11 @@
   void setArrayBufferView(TestArrayBufferView*);
   static StringOrArrayBufferOrArrayBufferView fromArrayBufferView(TestArrayBufferView*);
 
+  bool isString() const { return m_type == SpecificTypeString; }
+  String getAsString() const;
+  void setString(String);
+  static StringOrArrayBufferOrArrayBufferView fromString(String);
+
   StringOrArrayBufferOrArrayBufferView(const StringOrArrayBufferOrArrayBufferView&);
   ~StringOrArrayBufferOrArrayBufferView();
   StringOrArrayBufferOrArrayBufferView& operator=(const StringOrArrayBufferOrArrayBufferView&);
@@ -53,15 +53,15 @@
  private:
   enum SpecificTypes {
     SpecificTypeNone,
-    SpecificTypeString,
     SpecificTypeArrayBuffer,
     SpecificTypeArrayBufferView,
+    SpecificTypeString,
   };
   SpecificTypes m_type;
 
-  String m_string;
   Member<TestArrayBuffer> m_arrayBuffer;
   Member<TestArrayBufferView> m_arrayBufferView;
+  String m_string;
 
   friend CORE_EXPORT v8::Local<v8::Value> ToV8(const StringOrArrayBufferOrArrayBufferView&, v8::Local<v8::Object>, v8::Isolate*);
 };
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/StringOrDouble.cpp b/third_party/WebKit/Source/bindings/tests/results/core/StringOrDouble.cpp
index cdd8166..38311294 100644
--- a/third_party/WebKit/Source/bindings/tests/results/core/StringOrDouble.cpp
+++ b/third_party/WebKit/Source/bindings/tests/results/core/StringOrDouble.cpp
@@ -19,23 +19,6 @@
 
 StringOrDouble::StringOrDouble() : m_type(SpecificTypeNone) {}
 
-String StringOrDouble::getAsString() const {
-  DCHECK(isString());
-  return m_string;
-}
-
-void StringOrDouble::setString(String value) {
-  DCHECK(isNull());
-  m_string = value;
-  m_type = SpecificTypeString;
-}
-
-StringOrDouble StringOrDouble::fromString(String value) {
-  StringOrDouble container;
-  container.setString(value);
-  return container;
-}
-
 double StringOrDouble::getAsDouble() const {
   DCHECK(isDouble());
   return m_double;
@@ -53,6 +36,23 @@
   return container;
 }
 
+String StringOrDouble::getAsString() const {
+  DCHECK(isString());
+  return m_string;
+}
+
+void StringOrDouble::setString(String value) {
+  DCHECK(isNull());
+  m_string = value;
+  m_type = SpecificTypeString;
+}
+
+StringOrDouble StringOrDouble::fromString(String value) {
+  StringOrDouble container;
+  container.setString(value);
+  return container;
+}
+
 StringOrDouble::StringOrDouble(const StringOrDouble&) = default;
 StringOrDouble::~StringOrDouble() = default;
 StringOrDouble& StringOrDouble::operator=(const StringOrDouble&) = default;
@@ -88,10 +88,10 @@
   switch (impl.m_type) {
     case StringOrDouble::SpecificTypeNone:
       return v8::Null(isolate);
-    case StringOrDouble::SpecificTypeString:
-      return v8String(isolate, impl.getAsString());
     case StringOrDouble::SpecificTypeDouble:
       return v8::Number::New(isolate, impl.getAsDouble());
+    case StringOrDouble::SpecificTypeString:
+      return v8String(isolate, impl.getAsString());
     default:
       NOTREACHED();
   }
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/StringOrDouble.h b/third_party/WebKit/Source/bindings/tests/results/core/StringOrDouble.h
index 570ebe3..0d2d147f 100644
--- a/third_party/WebKit/Source/bindings/tests/results/core/StringOrDouble.h
+++ b/third_party/WebKit/Source/bindings/tests/results/core/StringOrDouble.h
@@ -27,16 +27,16 @@
   StringOrDouble();
   bool isNull() const { return m_type == SpecificTypeNone; }
 
-  bool isString() const { return m_type == SpecificTypeString; }
-  String getAsString() const;
-  void setString(String);
-  static StringOrDouble fromString(String);
-
   bool isDouble() const { return m_type == SpecificTypeDouble; }
   double getAsDouble() const;
   void setDouble(double);
   static StringOrDouble fromDouble(double);
 
+  bool isString() const { return m_type == SpecificTypeString; }
+  String getAsString() const;
+  void setString(String);
+  static StringOrDouble fromString(String);
+
   StringOrDouble(const StringOrDouble&);
   ~StringOrDouble();
   StringOrDouble& operator=(const StringOrDouble&);
@@ -45,13 +45,13 @@
  private:
   enum SpecificTypes {
     SpecificTypeNone,
-    SpecificTypeString,
     SpecificTypeDouble,
+    SpecificTypeString,
   };
   SpecificTypes m_type;
 
-  String m_string;
   double m_double;
+  String m_string;
 
   friend CORE_EXPORT v8::Local<v8::Value> ToV8(const StringOrDouble&, v8::Local<v8::Object>, v8::Isolate*);
 };
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/TestEnumOrDouble.cpp b/third_party/WebKit/Source/bindings/tests/results/core/TestEnumOrDouble.cpp
index 4b4423e9..47733ef 100644
--- a/third_party/WebKit/Source/bindings/tests/results/core/TestEnumOrDouble.cpp
+++ b/third_party/WebKit/Source/bindings/tests/results/core/TestEnumOrDouble.cpp
@@ -19,6 +19,23 @@
 
 TestEnumOrDouble::TestEnumOrDouble() : m_type(SpecificTypeNone) {}
 
+double TestEnumOrDouble::getAsDouble() const {
+  DCHECK(isDouble());
+  return m_double;
+}
+
+void TestEnumOrDouble::setDouble(double value) {
+  DCHECK(isNull());
+  m_double = value;
+  m_type = SpecificTypeDouble;
+}
+
+TestEnumOrDouble TestEnumOrDouble::fromDouble(double value) {
+  TestEnumOrDouble container;
+  container.setDouble(value);
+  return container;
+}
+
 String TestEnumOrDouble::getAsTestEnum() const {
   DCHECK(isTestEnum());
   return m_testEnum;
@@ -47,23 +64,6 @@
   return container;
 }
 
-double TestEnumOrDouble::getAsDouble() const {
-  DCHECK(isDouble());
-  return m_double;
-}
-
-void TestEnumOrDouble::setDouble(double value) {
-  DCHECK(isNull());
-  m_double = value;
-  m_type = SpecificTypeDouble;
-}
-
-TestEnumOrDouble TestEnumOrDouble::fromDouble(double value) {
-  TestEnumOrDouble container;
-  container.setDouble(value);
-  return container;
-}
-
 TestEnumOrDouble::TestEnumOrDouble(const TestEnumOrDouble&) = default;
 TestEnumOrDouble::~TestEnumOrDouble() = default;
 TestEnumOrDouble& TestEnumOrDouble::operator=(const TestEnumOrDouble&) = default;
@@ -107,10 +107,10 @@
   switch (impl.m_type) {
     case TestEnumOrDouble::SpecificTypeNone:
       return v8::Null(isolate);
-    case TestEnumOrDouble::SpecificTypeTestEnum:
-      return v8String(isolate, impl.getAsTestEnum());
     case TestEnumOrDouble::SpecificTypeDouble:
       return v8::Number::New(isolate, impl.getAsDouble());
+    case TestEnumOrDouble::SpecificTypeTestEnum:
+      return v8String(isolate, impl.getAsTestEnum());
     default:
       NOTREACHED();
   }
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/TestEnumOrDouble.h b/third_party/WebKit/Source/bindings/tests/results/core/TestEnumOrDouble.h
index c52d2576..65c9d05 100644
--- a/third_party/WebKit/Source/bindings/tests/results/core/TestEnumOrDouble.h
+++ b/third_party/WebKit/Source/bindings/tests/results/core/TestEnumOrDouble.h
@@ -27,16 +27,16 @@
   TestEnumOrDouble();
   bool isNull() const { return m_type == SpecificTypeNone; }
 
-  bool isTestEnum() const { return m_type == SpecificTypeTestEnum; }
-  String getAsTestEnum() const;
-  void setTestEnum(String);
-  static TestEnumOrDouble fromTestEnum(String);
-
   bool isDouble() const { return m_type == SpecificTypeDouble; }
   double getAsDouble() const;
   void setDouble(double);
   static TestEnumOrDouble fromDouble(double);
 
+  bool isTestEnum() const { return m_type == SpecificTypeTestEnum; }
+  String getAsTestEnum() const;
+  void setTestEnum(String);
+  static TestEnumOrDouble fromTestEnum(String);
+
   TestEnumOrDouble(const TestEnumOrDouble&);
   ~TestEnumOrDouble();
   TestEnumOrDouble& operator=(const TestEnumOrDouble&);
@@ -45,13 +45,13 @@
  private:
   enum SpecificTypes {
     SpecificTypeNone,
-    SpecificTypeTestEnum,
     SpecificTypeDouble,
+    SpecificTypeTestEnum,
   };
   SpecificTypes m_type;
 
-  String m_testEnum;
   double m_double;
+  String m_testEnum;
 
   friend CORE_EXPORT v8::Local<v8::Value> ToV8(const TestEnumOrDouble&, v8::Local<v8::Object>, v8::Isolate*);
 };
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/TestInterfaceGarbageCollectedOrString.cpp b/third_party/WebKit/Source/bindings/tests/results/core/TestInterfaceGarbageCollectedOrString.cpp
index fa7107f4..bfe5b9f 100644
--- a/third_party/WebKit/Source/bindings/tests/results/core/TestInterfaceGarbageCollectedOrString.cpp
+++ b/third_party/WebKit/Source/bindings/tests/results/core/TestInterfaceGarbageCollectedOrString.cpp
@@ -20,23 +20,6 @@
 
 TestInterfaceGarbageCollectedOrString::TestInterfaceGarbageCollectedOrString() : m_type(SpecificTypeNone) {}
 
-TestInterfaceGarbageCollected* TestInterfaceGarbageCollectedOrString::getAsTestInterfaceGarbageCollected() const {
-  DCHECK(isTestInterfaceGarbageCollected());
-  return m_testInterfaceGarbageCollected;
-}
-
-void TestInterfaceGarbageCollectedOrString::setTestInterfaceGarbageCollected(TestInterfaceGarbageCollected* value) {
-  DCHECK(isNull());
-  m_testInterfaceGarbageCollected = value;
-  m_type = SpecificTypeTestInterfaceGarbageCollected;
-}
-
-TestInterfaceGarbageCollectedOrString TestInterfaceGarbageCollectedOrString::fromTestInterfaceGarbageCollected(TestInterfaceGarbageCollected* value) {
-  TestInterfaceGarbageCollectedOrString container;
-  container.setTestInterfaceGarbageCollected(value);
-  return container;
-}
-
 String TestInterfaceGarbageCollectedOrString::getAsString() const {
   DCHECK(isString());
   return m_string;
@@ -54,6 +37,23 @@
   return container;
 }
 
+TestInterfaceGarbageCollected* TestInterfaceGarbageCollectedOrString::getAsTestInterfaceGarbageCollected() const {
+  DCHECK(isTestInterfaceGarbageCollected());
+  return m_testInterfaceGarbageCollected;
+}
+
+void TestInterfaceGarbageCollectedOrString::setTestInterfaceGarbageCollected(TestInterfaceGarbageCollected* value) {
+  DCHECK(isNull());
+  m_testInterfaceGarbageCollected = value;
+  m_type = SpecificTypeTestInterfaceGarbageCollected;
+}
+
+TestInterfaceGarbageCollectedOrString TestInterfaceGarbageCollectedOrString::fromTestInterfaceGarbageCollected(TestInterfaceGarbageCollected* value) {
+  TestInterfaceGarbageCollectedOrString container;
+  container.setTestInterfaceGarbageCollected(value);
+  return container;
+}
+
 TestInterfaceGarbageCollectedOrString::TestInterfaceGarbageCollectedOrString(const TestInterfaceGarbageCollectedOrString&) = default;
 TestInterfaceGarbageCollectedOrString::~TestInterfaceGarbageCollectedOrString() = default;
 TestInterfaceGarbageCollectedOrString& TestInterfaceGarbageCollectedOrString::operator=(const TestInterfaceGarbageCollectedOrString&) = default;
@@ -88,10 +88,10 @@
   switch (impl.m_type) {
     case TestInterfaceGarbageCollectedOrString::SpecificTypeNone:
       return v8::Null(isolate);
-    case TestInterfaceGarbageCollectedOrString::SpecificTypeTestInterfaceGarbageCollected:
-      return ToV8(impl.getAsTestInterfaceGarbageCollected(), creationContext, isolate);
     case TestInterfaceGarbageCollectedOrString::SpecificTypeString:
       return v8String(isolate, impl.getAsString());
+    case TestInterfaceGarbageCollectedOrString::SpecificTypeTestInterfaceGarbageCollected:
+      return ToV8(impl.getAsTestInterfaceGarbageCollected(), creationContext, isolate);
     default:
       NOTREACHED();
   }
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/TestInterfaceGarbageCollectedOrString.h b/third_party/WebKit/Source/bindings/tests/results/core/TestInterfaceGarbageCollectedOrString.h
index eafa3d08..a7f8e5c 100644
--- a/third_party/WebKit/Source/bindings/tests/results/core/TestInterfaceGarbageCollectedOrString.h
+++ b/third_party/WebKit/Source/bindings/tests/results/core/TestInterfaceGarbageCollectedOrString.h
@@ -29,16 +29,16 @@
   TestInterfaceGarbageCollectedOrString();
   bool isNull() const { return m_type == SpecificTypeNone; }
 
-  bool isTestInterfaceGarbageCollected() const { return m_type == SpecificTypeTestInterfaceGarbageCollected; }
-  TestInterfaceGarbageCollected* getAsTestInterfaceGarbageCollected() const;
-  void setTestInterfaceGarbageCollected(TestInterfaceGarbageCollected*);
-  static TestInterfaceGarbageCollectedOrString fromTestInterfaceGarbageCollected(TestInterfaceGarbageCollected*);
-
   bool isString() const { return m_type == SpecificTypeString; }
   String getAsString() const;
   void setString(String);
   static TestInterfaceGarbageCollectedOrString fromString(String);
 
+  bool isTestInterfaceGarbageCollected() const { return m_type == SpecificTypeTestInterfaceGarbageCollected; }
+  TestInterfaceGarbageCollected* getAsTestInterfaceGarbageCollected() const;
+  void setTestInterfaceGarbageCollected(TestInterfaceGarbageCollected*);
+  static TestInterfaceGarbageCollectedOrString fromTestInterfaceGarbageCollected(TestInterfaceGarbageCollected*);
+
   TestInterfaceGarbageCollectedOrString(const TestInterfaceGarbageCollectedOrString&);
   ~TestInterfaceGarbageCollectedOrString();
   TestInterfaceGarbageCollectedOrString& operator=(const TestInterfaceGarbageCollectedOrString&);
@@ -47,13 +47,13 @@
  private:
   enum SpecificTypes {
     SpecificTypeNone,
-    SpecificTypeTestInterfaceGarbageCollected,
     SpecificTypeString,
+    SpecificTypeTestInterfaceGarbageCollected,
   };
   SpecificTypes m_type;
 
-  Member<TestInterfaceGarbageCollected> m_testInterfaceGarbageCollected;
   String m_string;
+  Member<TestInterfaceGarbageCollected> m_testInterfaceGarbageCollected;
 
   friend CORE_EXPORT v8::Local<v8::Value> ToV8(const TestInterfaceGarbageCollectedOrString&, v8::Local<v8::Object>, v8::Isolate*);
 };
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/TestInterfaceOrLong.cpp b/third_party/WebKit/Source/bindings/tests/results/core/TestInterfaceOrLong.cpp
index 8dd9929a..af1125c 100644
--- a/third_party/WebKit/Source/bindings/tests/results/core/TestInterfaceOrLong.cpp
+++ b/third_party/WebKit/Source/bindings/tests/results/core/TestInterfaceOrLong.cpp
@@ -25,23 +25,6 @@
 
 TestInterfaceOrLong::TestInterfaceOrLong() : m_type(SpecificTypeNone) {}
 
-TestInterfaceImplementation* TestInterfaceOrLong::getAsTestInterface() const {
-  DCHECK(isTestInterface());
-  return m_testInterface;
-}
-
-void TestInterfaceOrLong::setTestInterface(TestInterfaceImplementation* value) {
-  DCHECK(isNull());
-  m_testInterface = value;
-  m_type = SpecificTypeTestInterface;
-}
-
-TestInterfaceOrLong TestInterfaceOrLong::fromTestInterface(TestInterfaceImplementation* value) {
-  TestInterfaceOrLong container;
-  container.setTestInterface(value);
-  return container;
-}
-
 int32_t TestInterfaceOrLong::getAsLong() const {
   DCHECK(isLong());
   return m_long;
@@ -59,6 +42,23 @@
   return container;
 }
 
+TestInterfaceImplementation* TestInterfaceOrLong::getAsTestInterface() const {
+  DCHECK(isTestInterface());
+  return m_testInterface;
+}
+
+void TestInterfaceOrLong::setTestInterface(TestInterfaceImplementation* value) {
+  DCHECK(isNull());
+  m_testInterface = value;
+  m_type = SpecificTypeTestInterface;
+}
+
+TestInterfaceOrLong TestInterfaceOrLong::fromTestInterface(TestInterfaceImplementation* value) {
+  TestInterfaceOrLong container;
+  container.setTestInterface(value);
+  return container;
+}
+
 TestInterfaceOrLong::TestInterfaceOrLong(const TestInterfaceOrLong&) = default;
 TestInterfaceOrLong::~TestInterfaceOrLong() = default;
 TestInterfaceOrLong& TestInterfaceOrLong::operator=(const TestInterfaceOrLong&) = default;
@@ -101,10 +101,10 @@
   switch (impl.m_type) {
     case TestInterfaceOrLong::SpecificTypeNone:
       return v8::Null(isolate);
-    case TestInterfaceOrLong::SpecificTypeTestInterface:
-      return ToV8(impl.getAsTestInterface(), creationContext, isolate);
     case TestInterfaceOrLong::SpecificTypeLong:
       return v8::Integer::New(isolate, impl.getAsLong());
+    case TestInterfaceOrLong::SpecificTypeTestInterface:
+      return ToV8(impl.getAsTestInterface(), creationContext, isolate);
     default:
       NOTREACHED();
   }
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/TestInterfaceOrLong.h b/third_party/WebKit/Source/bindings/tests/results/core/TestInterfaceOrLong.h
index 9c53173..66ddb463 100644
--- a/third_party/WebKit/Source/bindings/tests/results/core/TestInterfaceOrLong.h
+++ b/third_party/WebKit/Source/bindings/tests/results/core/TestInterfaceOrLong.h
@@ -29,16 +29,16 @@
   TestInterfaceOrLong();
   bool isNull() const { return m_type == SpecificTypeNone; }
 
-  bool isTestInterface() const { return m_type == SpecificTypeTestInterface; }
-  TestInterfaceImplementation* getAsTestInterface() const;
-  void setTestInterface(TestInterfaceImplementation*);
-  static TestInterfaceOrLong fromTestInterface(TestInterfaceImplementation*);
-
   bool isLong() const { return m_type == SpecificTypeLong; }
   int32_t getAsLong() const;
   void setLong(int32_t);
   static TestInterfaceOrLong fromLong(int32_t);
 
+  bool isTestInterface() const { return m_type == SpecificTypeTestInterface; }
+  TestInterfaceImplementation* getAsTestInterface() const;
+  void setTestInterface(TestInterfaceImplementation*);
+  static TestInterfaceOrLong fromTestInterface(TestInterfaceImplementation*);
+
   TestInterfaceOrLong(const TestInterfaceOrLong&);
   ~TestInterfaceOrLong();
   TestInterfaceOrLong& operator=(const TestInterfaceOrLong&);
@@ -47,13 +47,13 @@
  private:
   enum SpecificTypes {
     SpecificTypeNone,
-    SpecificTypeTestInterface,
     SpecificTypeLong,
+    SpecificTypeTestInterface,
   };
   SpecificTypes m_type;
 
-  Member<TestInterfaceImplementation> m_testInterface;
   int32_t m_long;
+  Member<TestInterfaceImplementation> m_testInterface;
 
   friend CORE_EXPORT v8::Local<v8::Value> ToV8(const TestInterfaceOrLong&, v8::Local<v8::Object>, v8::Isolate*);
 };
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/UnrestrictedDoubleOrString.cpp b/third_party/WebKit/Source/bindings/tests/results/core/UnrestrictedDoubleOrString.cpp
index c11c3db..421329c 100644
--- a/third_party/WebKit/Source/bindings/tests/results/core/UnrestrictedDoubleOrString.cpp
+++ b/third_party/WebKit/Source/bindings/tests/results/core/UnrestrictedDoubleOrString.cpp
@@ -19,23 +19,6 @@
 
 UnrestrictedDoubleOrString::UnrestrictedDoubleOrString() : m_type(SpecificTypeNone) {}
 
-double UnrestrictedDoubleOrString::getAsUnrestrictedDouble() const {
-  DCHECK(isUnrestrictedDouble());
-  return m_unrestrictedDouble;
-}
-
-void UnrestrictedDoubleOrString::setUnrestrictedDouble(double value) {
-  DCHECK(isNull());
-  m_unrestrictedDouble = value;
-  m_type = SpecificTypeUnrestrictedDouble;
-}
-
-UnrestrictedDoubleOrString UnrestrictedDoubleOrString::fromUnrestrictedDouble(double value) {
-  UnrestrictedDoubleOrString container;
-  container.setUnrestrictedDouble(value);
-  return container;
-}
-
 String UnrestrictedDoubleOrString::getAsString() const {
   DCHECK(isString());
   return m_string;
@@ -53,6 +36,23 @@
   return container;
 }
 
+double UnrestrictedDoubleOrString::getAsUnrestrictedDouble() const {
+  DCHECK(isUnrestrictedDouble());
+  return m_unrestrictedDouble;
+}
+
+void UnrestrictedDoubleOrString::setUnrestrictedDouble(double value) {
+  DCHECK(isNull());
+  m_unrestrictedDouble = value;
+  m_type = SpecificTypeUnrestrictedDouble;
+}
+
+UnrestrictedDoubleOrString UnrestrictedDoubleOrString::fromUnrestrictedDouble(double value) {
+  UnrestrictedDoubleOrString container;
+  container.setUnrestrictedDouble(value);
+  return container;
+}
+
 UnrestrictedDoubleOrString::UnrestrictedDoubleOrString(const UnrestrictedDoubleOrString&) = default;
 UnrestrictedDoubleOrString::~UnrestrictedDoubleOrString() = default;
 UnrestrictedDoubleOrString& UnrestrictedDoubleOrString::operator=(const UnrestrictedDoubleOrString&) = default;
@@ -88,10 +88,10 @@
   switch (impl.m_type) {
     case UnrestrictedDoubleOrString::SpecificTypeNone:
       return v8::Null(isolate);
-    case UnrestrictedDoubleOrString::SpecificTypeUnrestrictedDouble:
-      return v8::Number::New(isolate, impl.getAsUnrestrictedDouble());
     case UnrestrictedDoubleOrString::SpecificTypeString:
       return v8String(isolate, impl.getAsString());
+    case UnrestrictedDoubleOrString::SpecificTypeUnrestrictedDouble:
+      return v8::Number::New(isolate, impl.getAsUnrestrictedDouble());
     default:
       NOTREACHED();
   }
diff --git a/third_party/WebKit/Source/bindings/tests/results/core/UnrestrictedDoubleOrString.h b/third_party/WebKit/Source/bindings/tests/results/core/UnrestrictedDoubleOrString.h
index fc252e4..99315ea 100644
--- a/third_party/WebKit/Source/bindings/tests/results/core/UnrestrictedDoubleOrString.h
+++ b/third_party/WebKit/Source/bindings/tests/results/core/UnrestrictedDoubleOrString.h
@@ -27,16 +27,16 @@
   UnrestrictedDoubleOrString();
   bool isNull() const { return m_type == SpecificTypeNone; }
 
-  bool isUnrestrictedDouble() const { return m_type == SpecificTypeUnrestrictedDouble; }
-  double getAsUnrestrictedDouble() const;
-  void setUnrestrictedDouble(double);
-  static UnrestrictedDoubleOrString fromUnrestrictedDouble(double);
-
   bool isString() const { return m_type == SpecificTypeString; }
   String getAsString() const;
   void setString(String);
   static UnrestrictedDoubleOrString fromString(String);
 
+  bool isUnrestrictedDouble() const { return m_type == SpecificTypeUnrestrictedDouble; }
+  double getAsUnrestrictedDouble() const;
+  void setUnrestrictedDouble(double);
+  static UnrestrictedDoubleOrString fromUnrestrictedDouble(double);
+
   UnrestrictedDoubleOrString(const UnrestrictedDoubleOrString&);
   ~UnrestrictedDoubleOrString();
   UnrestrictedDoubleOrString& operator=(const UnrestrictedDoubleOrString&);
@@ -45,13 +45,13 @@
  private:
   enum SpecificTypes {
     SpecificTypeNone,
-    SpecificTypeUnrestrictedDouble,
     SpecificTypeString,
+    SpecificTypeUnrestrictedDouble,
   };
   SpecificTypes m_type;
 
-  double m_unrestrictedDouble;
   String m_string;
+  double m_unrestrictedDouble;
 
   friend CORE_EXPORT v8::Local<v8::Value> ToV8(const UnrestrictedDoubleOrString&, v8::Local<v8::Object>, v8::Isolate*);
 };
diff --git a/third_party/WebKit/Source/build/scripts/css_properties.py b/third_party/WebKit/Source/build/scripts/css_properties.py
index 9c149799..78b4d7a 100755
--- a/third_party/WebKit/Source/build/scripts/css_properties.py
+++ b/third_party/WebKit/Source/build/scripts/css_properties.py
@@ -51,13 +51,24 @@
         self._properties_including_aliases = properties
         self._properties = {property['property_id']: property for property in properties}
 
-        # The generated code will only work with at most one alias per property
+        # The generated code will only work with at most one alias per property.
         assert len({property['alias_for'] for property in self._aliases}) == len(self._aliases)
 
-        for property in self._aliases:
-            property['property_id'] = name_utilities.enum_for_css_property_alias(property['name'])
-            aliased_property = self._properties[name_utilities.enum_for_css_property(property['alias_for'])]
-            property['enum_value'] = aliased_property['enum_value'] + 512
+        # Update property aliases to include the fields of the property being aliased.
+        for i, alias in enumerate(self._aliases):
+            aliased_property = self._properties[
+                name_utilities.enum_for_css_property(alias['alias_for'])]
+            updated_alias = aliased_property.copy()
+            updated_alias['name'] = alias['name']
+            updated_alias['alias_for'] = alias['alias_for']
+            updated_alias['property_id'] = \
+                name_utilities.enum_for_css_property_alias(alias['name'])
+            updated_alias['enum_value'] = aliased_property['enum_value'] + 512
+            updated_alias['upper_camel_name'] = \
+                name_utilities.camel_case(alias['name'])
+            updated_alias['lower_camel_name'] = \
+                name_utilities.lower_first(updated_alias['upper_camel_name'])
+            self._aliases[i] = updated_alias
         self._properties_including_aliases += self._aliases
 
     def properties(self):
diff --git a/third_party/WebKit/Source/build/scripts/make_css_property_metadata.py b/third_party/WebKit/Source/build/scripts/make_css_property_metadata.py
index 022e19cd..97937fa 100755
--- a/third_party/WebKit/Source/build/scripts/make_css_property_metadata.py
+++ b/third_party/WebKit/Source/build/scripts/make_css_property_metadata.py
@@ -23,7 +23,7 @@
     @template_expander.use_jinja('CSSPropertyMetadata.cpp.tmpl', filters=filters)
     def generate_css_property_metadata_cpp(self):
         return {
-            'properties': self._properties,
+            'properties_including_aliases': self._properties_including_aliases,
             'switches': [('descriptor_only', 'isDescriptorOnly'),
                          ('interpolable', 'isInterpolableProperty'),
                          ('inherited', 'isInheritedProperty'),
diff --git a/third_party/WebKit/Source/build/scripts/templates/CSSPropertyMetadata.cpp.tmpl b/third_party/WebKit/Source/build/scripts/templates/CSSPropertyMetadata.cpp.tmpl
index 3b2ae3d..299bbcd 100644
--- a/third_party/WebKit/Source/build/scripts/templates/CSSPropertyMetadata.cpp.tmpl
+++ b/third_party/WebKit/Source/build/scripts/templates/CSSPropertyMetadata.cpp.tmpl
@@ -9,13 +9,13 @@
 namespace blink {
 {% for flag, function_name in switches %}
 
-bool CSSPropertyMetadata::{{function_name}}(CSSPropertyID property) {
-  switch (property) {
+bool CSSPropertyMetadata::{{function_name}}(CSSPropertyID unresolvedProperty) {
+  switch (unresolvedProperty) {
     case CSSPropertyInvalid:
       NOTREACHED();
       return false;
-    {% for property_id, property in properties.items() if property[flag] %}
-    case {{property_id}}:
+    {% for property in properties_including_aliases if property[flag] %}
+    case {{property.property_id}}:
     {% endfor %}
     {% if function_name == "isInheritedProperty" %}
     case CSSPropertyVariable:
@@ -27,10 +27,10 @@
 }
 {% endfor %}
 
-char CSSPropertyMetadata::repetitionSeparator(CSSPropertyID property) {
-  switch (property) {
-  {% for property_id, property in properties.items() if property.separator %}
-  case {{property_id}}:
+char CSSPropertyMetadata::repetitionSeparator(CSSPropertyID unresolvedProperty) {
+  switch (unresolvedProperty) {
+  {% for property in properties_including_aliases if property.separator %}
+  case {{property.property_id}}:
     return '{{property.separator}}';
   {% endfor %}
   default:
@@ -38,8 +38,8 @@
   }
 }
 
-bool CSSPropertyMetadata::propertyIsRepeated(CSSPropertyID property) {
-  return repetitionSeparator(property) != 0;
+bool CSSPropertyMetadata::propertyIsRepeated(CSSPropertyID unresolvedProperty) {
+  return repetitionSeparator(unresolvedProperty) != 0;
 }
 
 bool CSSPropertyMetadata::isEnabledProperty(CSSPropertyID unresolvedProperty) {
@@ -48,12 +48,12 @@
   if (!enabledProperties) {
     enabledProperties = new std::bitset<numCSSProperties>();
     enabledProperties->set(); // All bits sets to 1.
-    {% for property_id, property in properties.items() if property.runtime_flag %}
+    {% for property in properties_including_aliases if property.runtime_flag %}
     if (!RuntimeEnabledFeatures::{{property.runtime_flag|lower_first}}Enabled())
-      enabledProperties->reset({{property_id}} - {{first_enum_value}});
+      enabledProperties->reset({{property.property_id}} - {{first_enum_value}});
     {% endfor %}
-    {% for property_id, property in properties.items() if property.is_internal %}
-    enabledProperties->reset({{property_id}} - {{first_enum_value}});
+    {% for property in properties_including_aliases if property.is_internal %}
+    enabledProperties->reset({{property.property_id}} - {{first_enum_value}});
     {% endfor %}
   }
 
diff --git a/third_party/WebKit/Source/core/css/CSSPropertyMetadata.h b/third_party/WebKit/Source/core/css/CSSPropertyMetadata.h
index 31b30bd6a..c41b661 100644
--- a/third_party/WebKit/Source/core/css/CSSPropertyMetadata.h
+++ b/third_party/WebKit/Source/core/css/CSSPropertyMetadata.h
@@ -16,13 +16,13 @@
   STATIC_ONLY(CSSPropertyMetadata);
 
  public:
-  static bool isEnabledProperty(CSSPropertyID);
-  static bool isInterpolableProperty(CSSPropertyID);
-  static bool isInheritedProperty(CSSPropertyID);
-  static bool propertySupportsPercentage(CSSPropertyID);
-  static bool propertyIsRepeated(CSSPropertyID);
-  static char repetitionSeparator(CSSPropertyID);
-  static bool isDescriptorOnly(CSSPropertyID);
+  static bool isEnabledProperty(CSSPropertyID unresolvedProperty);
+  static bool isInterpolableProperty(CSSPropertyID unresolvedProperty);
+  static bool isInheritedProperty(CSSPropertyID unresolvedProperty);
+  static bool propertySupportsPercentage(CSSPropertyID unresolvedProperty);
+  static bool propertyIsRepeated(CSSPropertyID unresolvedProperty);
+  static char repetitionSeparator(CSSPropertyID unresolvedProperty);
+  static bool isDescriptorOnly(CSSPropertyID unresolvedProperty);
 
   static void filterEnabledCSSPropertiesIntoVector(const CSSPropertyID*,
                                                    size_t length,
diff --git a/third_party/WebKit/Source/core/dom/NodeRareData.cpp b/third_party/WebKit/Source/core/dom/NodeRareData.cpp
index 1bedf95..9343fd3 100644
--- a/third_party/WebKit/Source/core/dom/NodeRareData.cpp
+++ b/third_party/WebKit/Source/core/dom/NodeRareData.cpp
@@ -33,7 +33,7 @@
 #include "bindings/core/v8/ScriptWrappableVisitor.h"
 #include "core/dom/Element.h"
 #include "core/dom/ElementRareData.h"
-#include "core/page/Page.h"
+#include "core/frame/FrameHost.h"
 #include "platform/heap/Handle.h"
 
 namespace blink {
@@ -85,12 +85,12 @@
 }
 
 void NodeRareData::incrementConnectedSubframeCount() {
-  SECURITY_CHECK((m_connectedFrameCount + 1) <= Page::maxNumberOfFrames);
+  SECURITY_CHECK((m_connectedFrameCount + 1) <= FrameHost::maxNumberOfFrames);
   ++m_connectedFrameCount;
 }
 
 // Ensure the 10 bits reserved for the m_connectedFrameCount cannot overflow
-static_assert(Page::maxNumberOfFrames <
+static_assert(FrameHost::maxNumberOfFrames <
                   (1 << NodeRareData::ConnectedFrameCountBits),
               "Frame limit should fit in rare data count");
 
diff --git a/third_party/WebKit/Source/core/frame/FrameHost.cpp b/third_party/WebKit/Source/core/frame/FrameHost.cpp
index 8b6d9e3..43b2738 100644
--- a/third_party/WebKit/Source/core/frame/FrameHost.cpp
+++ b/third_party/WebKit/Source/core/frame/FrameHost.cpp
@@ -51,7 +51,8 @@
                                        m_page->chromeClient())),
       m_consoleMessageStorage(new ConsoleMessageStorage()),
       m_globalRootScrollerController(
-          TopDocumentRootScrollerController::create(page)) {}
+          TopDocumentRootScrollerController::create(page)),
+      m_subframeCount(0) {}
 
 // Explicitly in the .cpp to avoid default constructor in .h
 FrameHost::~FrameHost() {}
@@ -100,16 +101,23 @@
   visitor->trace(m_globalRootScrollerController);
 }
 
-void FrameHost::incrementSubframeCount() {
-  page().incrementSubframeCount();
-}
+#if DCHECK_IS_ON()
+void checkFrameCountConsistency(int expectedFrameCount, Frame* frame) {
+  ASSERT(expectedFrameCount >= 0);
 
-void FrameHost::decrementSubframeCount() {
-  page().decrementSubframeCount();
+  int actualFrameCount = 0;
+  for (; frame; frame = frame->tree().traverseNext())
+    ++actualFrameCount;
+
+  ASSERT(expectedFrameCount == actualFrameCount);
 }
+#endif
 
 int FrameHost::subframeCount() const {
-  return page().subframeCount();
+#if DCHECK_IS_ON()
+  checkFrameCountConsistency(m_subframeCount + 1, m_page->mainFrame());
+#endif
+  return m_subframeCount;
 }
 
 }  // namespace blink
diff --git a/third_party/WebKit/Source/core/frame/FrameHost.h b/third_party/WebKit/Source/core/frame/FrameHost.h
index 73ac6cd..1d94ec7 100644
--- a/third_party/WebKit/Source/core/frame/FrameHost.h
+++ b/third_party/WebKit/Source/core/frame/FrameHost.h
@@ -80,8 +80,16 @@
 
   DECLARE_TRACE();
 
-  void incrementSubframeCount();
-  void decrementSubframeCount();
+  // Don't allow more than a certain number of frames in a page.
+  // This seems like a reasonable upper bound, and otherwise mutually
+  // recursive frameset pages can quickly bring the program to its knees
+  // with exponential growth in the number of frames.
+  static const int maxNumberOfFrames = 1000;
+  void incrementSubframeCount() { ++m_subframeCount; }
+  void decrementSubframeCount() {
+    ASSERT(m_subframeCount);
+    --m_subframeCount;
+  }
   int subframeCount() const;
 
  private:
@@ -92,6 +100,8 @@
   const Member<ConsoleMessageStorage> m_consoleMessageStorage;
   const Member<TopDocumentRootScrollerController>
       m_globalRootScrollerController;
+
+  int m_subframeCount;
 };
 
 }  // namespace blink
diff --git a/third_party/WebKit/Source/core/html/HTMLFrameOwnerElement.cpp b/third_party/WebKit/Source/core/html/HTMLFrameOwnerElement.cpp
index 9aaebf4..0efebb76 100644
--- a/third_party/WebKit/Source/core/html/HTMLFrameOwnerElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLFrameOwnerElement.cpp
@@ -33,7 +33,6 @@
 #include "core/layout/api/LayoutPartItem.h"
 #include "core/loader/FrameLoadRequest.h"
 #include "core/loader/FrameLoader.h"
-#include "core/page/Page.h"
 #include "core/plugins/PluginView.h"
 #include "platform/weborigin/SecurityOrigin.h"
 
@@ -313,7 +312,8 @@
   if (!SubframeLoadingDisabler::canLoadFrame(*this))
     return false;
 
-  if (document().frame()->host()->subframeCount() >= Page::maxNumberOfFrames)
+  if (document().frame()->host()->subframeCount() >=
+      FrameHost::maxNumberOfFrames)
     return false;
 
   FrameLoadRequest frameLoadRequest(&document(), url, "_self",
diff --git a/third_party/WebKit/Source/core/inspector/InspectorAnimationAgent.cpp b/third_party/WebKit/Source/core/inspector/InspectorAnimationAgent.cpp
index e0568b3..1dc5cab 100644
--- a/third_party/WebKit/Source/core/inspector/InspectorAnimationAgent.cpp
+++ b/third_party/WebKit/Source/core/inspector/InspectorAnimationAgent.cpp
@@ -302,6 +302,14 @@
       for (auto& oldKeyframe : oldKeyframes)
         newKeyframes.push_back(toAnimatableValueKeyframe(oldKeyframe.get()));
       newModel = AnimatableValueKeyframeEffectModel::create(newKeyframes);
+    } else if (oldModel->isTransitionKeyframeEffectModel()) {
+      TransitionKeyframeEffectModel* oldTransitionKeyframeModel =
+          toTransitionKeyframeEffectModel(oldModel);
+      KeyframeVector oldKeyframes = oldTransitionKeyframeModel->getFrames();
+      TransitionKeyframeVector newKeyframes;
+      for (auto& oldKeyframe : oldKeyframes)
+        newKeyframes.push_back(toTransitionKeyframe(oldKeyframe.get()));
+      newModel = TransitionKeyframeEffectModel::create(newKeyframes);
     }
 
     KeyframeEffect* newEffect = KeyframeEffect::create(
@@ -372,15 +380,15 @@
   if (type == AnimationType::CSSTransition) {
     KeyframeEffect* effect = toKeyframeEffect(animation->effect());
     KeyframeEffectModelBase* model = toKeyframeEffectModelBase(effect->model());
-    const AnimatableValueKeyframeEffectModel* oldModel =
-        toAnimatableValueKeyframeEffectModel(model);
+    const TransitionKeyframeEffectModel* oldModel =
+        toTransitionKeyframeEffectModel(model);
     // Refer to CSSAnimations::calculateTransitionUpdateForProperty() for the
     // structure of transitions.
     const KeyframeVector& frames = oldModel->getFrames();
     ASSERT(frames.size() == 3);
     KeyframeVector newFrames;
     for (int i = 0; i < 3; i++)
-      newFrames.push_back(toAnimatableValueKeyframe(frames[i]->clone().get()));
+      newFrames.push_back(toTransitionKeyframe(frames[i]->clone().get()));
     // Update delay, represented by the distance between the first two
     // keyframes.
     newFrames[1]->setOffset(delay / (delay + duration));
diff --git a/third_party/WebKit/Source/core/layout/LayoutBox.cpp b/third_party/WebKit/Source/core/layout/LayoutBox.cpp
index 2d85a29..07ed841b 100644
--- a/third_party/WebKit/Source/core/layout/LayoutBox.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutBox.cpp
@@ -2401,7 +2401,7 @@
     containerOffset.move(layer()->offsetForInFlowPosition());
   }
 
-  bool preserve3D = container->style()->preserves3D();
+  bool preserve3D = container->style()->preserves3D() || style()->preserves3D();
 
   TransformState::TransformAccumulation accumulation =
       preserve3D ? TransformState::AccumulateTransform
diff --git a/third_party/WebKit/Source/core/layout/LayoutInline.cpp b/third_party/WebKit/Source/core/layout/LayoutInline.cpp
index 4a8cf22..6992af87 100644
--- a/third_party/WebKit/Source/core/layout/LayoutInline.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutInline.cpp
@@ -1211,7 +1211,7 @@
   if (!container)
     return true;
 
-  bool preserve3D = container->style()->preserves3D();
+  bool preserve3D = container->style()->preserves3D() || style()->preserves3D();
 
   TransformState::TransformAccumulation accumulation =
       preserve3D ? TransformState::AccumulateTransform
diff --git a/third_party/WebKit/Source/core/layout/LayoutObject.cpp b/third_party/WebKit/Source/core/layout/LayoutObject.cpp
index 077c6726..baecf0e 100644
--- a/third_party/WebKit/Source/core/layout/LayoutObject.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutObject.cpp
@@ -1306,7 +1306,8 @@
         transformState.setQuad(FloatQuad(FloatRect(rect)));
       }
 
-      bool preserve3D = parent->style()->preserves3D() && !parent->isText();
+      bool preserve3D = (parent->style()->preserves3D() && !parent->isText()) ||
+                        (style()->preserves3D() && !isText());
 
       TransformState::TransformAccumulation accumulation =
           preserve3D ? TransformState::AccumulateTransform
diff --git a/third_party/WebKit/Source/core/layout/VisualRectMappingTest.cpp b/third_party/WebKit/Source/core/layout/VisualRectMappingTest.cpp
index a4b9c5d..4020dfa 100644
--- a/third_party/WebKit/Source/core/layout/VisualRectMappingTest.cpp
+++ b/third_party/WebKit/Source/core/layout/VisualRectMappingTest.cpp
@@ -6,7 +6,6 @@
 #include "core/layout/LayoutView.h"
 #include "core/layout/PaintInvalidationState.h"
 #include "core/paint/PaintLayer.h"
-#include "core/paint/PaintPropertyTreePrinter.h"
 #include "testing/gtest/include/gtest/gtest.h"
 
 namespace blink {
@@ -25,47 +24,16 @@
       toLayoutBox(object).flipForWritingMode(rect);
     const LayoutBoxModelObject& paintInvalidationContainer =
         object.containerForPaintInvalidation();
-
-    checkVisualRect(object, paintInvalidationContainer, rect,
-                    object.visualRect(), true);
-  }
-
-  void checkVisualRect(const LayoutObject& object,
-                       const LayoutBoxModelObject& ancestor,
-                       const LayoutRect& localRect,
-                       const LayoutRect& expectedVisualRect,
-                       bool adjustForBacking = false) {
-    LayoutRect slowMapRect = localRect;
-    object.mapToVisualRectInAncestorSpace(&ancestor, slowMapRect);
-    if (slowMapRect.isEmpty() && object.visualRect().isEmpty())
+    object.mapToVisualRectInAncestorSpace(&paintInvalidationContainer, rect);
+    if (rect.isEmpty() && object.visualRect().isEmpty())
       return;
-
-    FloatRect geometryMapperRect(localRect);
-    if (object.paintProperties()) {
-      geometryMapperRect.moveBy(FloatPoint(object.paintOffset()));
-      document().view()->geometryMapper().sourceToDestinationVisualRect(
-          *object.paintProperties()->localBorderBoxProperties(),
-          *ancestor.paintProperties()->contentsProperties(),
-          geometryMapperRect);
-      geometryMapperRect.moveBy(-FloatPoint(ancestor.paintOffset()));
-    }
-
     // The following condition can be false if paintInvalidationContainer is
     // a LayoutView and compositing is not enabled.
-    if (adjustForBacking && ancestor.isPaintInvalidationContainer()) {
-      PaintLayer::mapRectInPaintInvalidationContainerToBacking(ancestor,
-                                                               slowMapRect);
-      LayoutRect temp(geometryMapperRect);
-      PaintLayer::mapRectInPaintInvalidationContainerToBacking(ancestor, temp);
-      geometryMapperRect = FloatRect(temp);
+    if (paintInvalidationContainer.isPaintInvalidationContainer()) {
+      PaintLayer::mapRectInPaintInvalidationContainerToBacking(
+          paintInvalidationContainer, rect);
     }
-    EXPECT_TRUE(enclosingIntRect(slowMapRect)
-                    .contains(enclosingIntRect(expectedVisualRect)));
-
-    if (object.paintProperties()) {
-      EXPECT_EQ(enclosingIntRect(expectedVisualRect),
-                enclosingIntRect(geometryMapperRect));
-    }
+    EXPECT_EQ(enclosingIntRect(rect), enclosingIntRect(object.visualRect()));
   }
 };
 
@@ -273,8 +241,11 @@
   // This rect is in physical coordinates of target.
   EXPECT_EQ(LayoutRect(0, 0, 140, 70), rect);
 
-  checkPaintInvalidationVisualRect(*target);
-  EXPECT_EQ(LayoutRect(222, 111, 140, 70), target->visualRect());
+  rect = localVisualRect;
+  target->flipForWritingMode(rect);
+  EXPECT_TRUE(target->mapToVisualRectInAncestorSpace(&layoutView(), rect));
+  EXPECT_EQ(LayoutRect(222, 111, 140, 70), rect);
+  EXPECT_EQ(rect, target->visualRect());
 }
 
 TEST_F(VisualRectMappingTest, ContainerFlippedWritingMode) {
@@ -307,11 +278,11 @@
   EXPECT_TRUE(target->mapToVisualRectInAncestorSpace(container, rect));
   // 100 is the physical x location of target in container.
   EXPECT_EQ(LayoutRect(100, 0, 140, 110), rect);
-
   rect = targetLocalVisualRect;
   target->flipForWritingMode(rect);
-  checkPaintInvalidationVisualRect(*target);
-  EXPECT_EQ(LayoutRect(322, 111, 140, 110), target->visualRect());
+  EXPECT_TRUE(target->mapToVisualRectInAncestorSpace(&layoutView(), rect));
+  EXPECT_EQ(LayoutRect(322, 111, 140, 110), rect);
+  EXPECT_EQ(rect, target->visualRect());
 
   LayoutRect containerLocalVisualRect = container->localVisualRect();
   EXPECT_EQ(LayoutRect(0, 0, 200, 100), containerLocalVisualRect);
@@ -361,11 +332,13 @@
   // overflow:scroll.
   EXPECT_EQ(LayoutRect(2, 3, 140, 110), rect);
 
-  checkPaintInvalidationVisualRect(*target);
+  rect = targetLocalVisualRect;
+  EXPECT_TRUE(target->mapToVisualRectInAncestorSpace(&layoutView(), rect));
   // (2, 3, 140, 100) is first clipped by container's overflow clip, to
   // (10, 10, 50, 80), then is by added container's offset in LayoutView
   // (111, 222).
-  EXPECT_EQ(LayoutRect(232, 121, 50, 80), target->visualRect());
+  EXPECT_EQ(LayoutRect(232, 121, 50, 80), rect);
+  EXPECT_EQ(rect, target->visualRect());
 
   LayoutRect containerLocalVisualRect = container->localVisualRect();
   // Because container has overflow clip, its visual overflow doesn't include
@@ -378,8 +351,10 @@
   // Container should not apply overflow clip on its own overflow rect.
   EXPECT_EQ(LayoutRect(0, 0, 70, 100), rect);
 
-  checkPaintInvalidationVisualRect(*container);
-  EXPECT_EQ(LayoutRect(222, 111, 70, 100), container->visualRect());
+  rect = containerLocalVisualRect;
+  EXPECT_TRUE(container->mapToVisualRectInAncestorSpace(&layoutView(), rect));
+  EXPECT_EQ(LayoutRect(222, 111, 70, 100), rect);
+  EXPECT_EQ(rect, container->visualRect());
 }
 
 TEST_F(VisualRectMappingTest, ContainerFlippedWritingModeAndOverflowScroll) {
@@ -428,14 +403,17 @@
   // Rect is clipped by container's overflow clip because of overflow:scroll.
   EXPECT_EQ(LayoutRect(-2, 3, 140, 110), rect);
 
-  checkPaintInvalidationVisualRect(*target);
+  rect = targetLocalVisualRect;
+  target->flipForWritingMode(rect);
+  EXPECT_TRUE(target->mapToVisualRectInAncestorSpace(&layoutView(), rect));
   // (-2, 3, 140, 100) is first clipped by container's overflow clip, to
   // (40, 10, 50, 80), then is added by container's offset in LayoutView
   // (111, 222).
   // TODO(crbug.com/600039): rect.x() should be 262 (left + border-left), but is
   // offset
   // by extra horizontal border-widths because of layout error.
-  EXPECT_EQ(LayoutRect(322, 121, 50, 80), target->visualRect());
+  EXPECT_EQ(LayoutRect(322, 121, 50, 80), rect);
+  EXPECT_EQ(rect, target->visualRect());
 
   LayoutRect containerLocalVisualRect = container->localVisualRect();
   // Because container has overflow clip, its visual overflow doesn't include
@@ -449,11 +427,14 @@
   EXPECT_TRUE(container->mapToVisualRectInAncestorSpace(container, rect));
   EXPECT_EQ(LayoutRect(0, 0, 110, 120), rect);
 
+  rect = containerLocalVisualRect;
+  container->flipForWritingMode(rect);
+  EXPECT_TRUE(container->mapToVisualRectInAncestorSpace(&layoutView(), rect));
   // TODO(crbug.com/600039): rect.x() should be 222 (left), but is offset by
   // extra horizontal
   // border-widths because of layout error.
-  checkPaintInvalidationVisualRect(*container);
-  EXPECT_EQ(LayoutRect(282, 111, 110, 120), container->visualRect());
+  EXPECT_EQ(LayoutRect(282, 111, 110, 120), rect);
+  EXPECT_EQ(rect, container->visualRect());
 }
 
 TEST_F(VisualRectMappingTest, ContainerOverflowHidden) {
@@ -483,8 +464,9 @@
   EXPECT_EQ(LayoutRect(0, 0, 140, 110), rect);
 
   rect = targetLocalVisualRect;
+  EXPECT_TRUE(target->mapToVisualRectInAncestorSpace(container, rect));
   // Rect is not clipped by container's overflow clip.
-  checkVisualRect(*target, *container, rect, LayoutRect(10, 10, 140, 110));
+  EXPECT_EQ(LayoutRect(10, 10, 140, 110), rect);
 }
 
 TEST_F(VisualRectMappingTest, ContainerFlippedWritingModeAndOverflowHidden) {
@@ -525,9 +507,9 @@
 
   rect = targetLocalVisualRect;
   target->flipForWritingMode(rect);
-  // 58 = target_physical_x(100) + container_border_left(40) - scroll_left(58)
-  checkVisualRect(*target, *container, rect, LayoutRect(-10, 10, 140, 110));
   EXPECT_TRUE(target->mapToVisualRectInAncestorSpace(container, rect));
+  // 58 = target_physical_x(100) + container_border_left(40) - scroll_left(58)
+  EXPECT_EQ(LayoutRect(-10, 10, 140, 110), rect);
 }
 
 TEST_F(VisualRectMappingTest, ContainerAndTargetDifferentFlippedWritingMode) {
@@ -613,9 +595,12 @@
   EXPECT_EQ(stackingContext, &absolute->containerForPaintInvalidation());
   EXPECT_EQ(stackingContext, absolute->container());
 
-  EXPECT_EQ(LayoutRect(0, 0, 50, 50), absolute->localVisualRect());
-  checkPaintInvalidationVisualRect(*absolute);
-  EXPECT_EQ(LayoutRect(222, 111, 50, 50), absolute->visualRect());
+  LayoutRect absoluteVisualRect = absolute->localVisualRect();
+  EXPECT_EQ(LayoutRect(0, 0, 50, 50), absoluteVisualRect);
+  rect = absoluteVisualRect;
+  EXPECT_TRUE(absolute->mapToVisualRectInAncestorSpace(stackingContext, rect));
+  EXPECT_EQ(LayoutRect(222, 111, 50, 50), rect);
+  EXPECT_EQ(rect, absolute->visualRect());
 }
 
 TEST_F(VisualRectMappingTest,
@@ -664,9 +649,12 @@
 
   LayoutBox* target = toLayoutBox(getLayoutObjectByElementId("target"));
 
-  EXPECT_EQ(LayoutRect(0, 0, 400, 400), target->localVisualRect());
-  checkPaintInvalidationVisualRect(*target);
-  EXPECT_EQ(LayoutRect(0, 0, 200, 200), target->visualRect());
+  LayoutRect targetLocalVisualRect = target->localVisualRect();
+  EXPECT_EQ(LayoutRect(0, 0, 400, 400), targetLocalVisualRect);
+  LayoutRect rect = targetLocalVisualRect;
+  EXPECT_TRUE(target->mapToVisualRectInAncestorSpace(&layoutView(), rect));
+  EXPECT_EQ(LayoutRect(0, 0, 200, 200), rect);
+  EXPECT_EQ(rect, target->visualRect());
 }
 
 TEST_F(VisualRectMappingTest, ContainPaint) {
@@ -678,9 +666,12 @@
 
   LayoutBox* target = toLayoutBox(getLayoutObjectByElementId("target"));
 
-  EXPECT_EQ(LayoutRect(0, 0, 400, 400), target->localVisualRect());
-  checkPaintInvalidationVisualRect(*target);
-  EXPECT_EQ(LayoutRect(0, 0, 200, 200), target->visualRect());
+  LayoutRect targetLocalVisualRect = target->localVisualRect();
+  EXPECT_EQ(LayoutRect(0, 0, 400, 400), targetLocalVisualRect);
+  LayoutRect rect = targetLocalVisualRect;
+  EXPECT_TRUE(target->mapToVisualRectInAncestorSpace(&layoutView(), rect));
+  EXPECT_EQ(LayoutRect(0, 0, 200, 200), rect);
+  EXPECT_EQ(rect, target->visualRect());
 }
 
 TEST_F(VisualRectMappingTest, FloatUnderInline) {
@@ -705,8 +696,8 @@
   EXPECT_EQ(rect, target->visualRect());
 
   rect = targetVisualRect;
-
-  checkVisualRect(*target, *span, rect, LayoutRect(-200, -100, 33, 44));
+  EXPECT_TRUE(target->mapToVisualRectInAncestorSpace(span, rect));
+  EXPECT_EQ(LayoutRect(-200, -100, 33, 44), rect);
 }
 
 TEST_F(VisualRectMappingTest, ShouldAccountForPreserve3d) {
@@ -731,40 +722,13 @@
   LayoutRect originalRect(0, 0, 100, 100);
   // Multiply both matrices together before flattening.
   TransformationMatrix matrix = container->layer()->currentTransform();
+  matrix *= target->layer()->currentTransform();
   matrix.flattenTo2d();
-  matrix *= target->layer()->currentTransform();
-  LayoutRect output(matrix.mapRect(FloatRect(originalRect)));
+  FloatRect output = matrix.mapRect(FloatRect(originalRect));
 
-  checkVisualRect(*target, *target->view(), originalRect, output);
-}
-
-TEST_F(VisualRectMappingTest, ShouldAccountForPreserve3dNested) {
-  enableCompositing();
-  setBodyInnerHTML(
-      "<style>"
-      "* { margin: 0; }"
-      "#container {"
-      "  transform-style: preserve-3d;"
-      "  transform: rotateX(-45deg);"
-      "  width: 100px; height: 100px;"
-      "}"
-      "#target {"
-      "  transform-style: preserve-3d; transform: rotateX(45deg);"
-      "  background: lightblue;"
-      "  width: 100px; height: 100px;"
-      "}"
-      "</style>"
-      "<div id='container'><div id='target'></div></div>");
-  LayoutBlock* container =
-      toLayoutBlock(getLayoutObjectByElementId("container"));
-  LayoutBlock* target = toLayoutBlock(getLayoutObjectByElementId("target"));
-  LayoutRect originalRect(0, 0, 100, 100);
-  // Multiply both matrices together before flattening.
-  TransformationMatrix matrix = container->layer()->currentTransform();
-  matrix *= target->layer()->currentTransform();
-  LayoutRect output(matrix.mapRect(FloatRect(originalRect)));
-
-  checkVisualRect(*target, *target->view(), originalRect, output);
+  EXPECT_TRUE(
+      target->mapToVisualRectInAncestorSpace(target->view(), originalRect));
+  EXPECT_EQ(LayoutRect(enclosingIntRect(output)), originalRect);
 }
 
 TEST_F(VisualRectMappingTest, ShouldAccountForPerspective) {
@@ -788,47 +752,17 @@
   LayoutBlock* target = toLayoutBlock(getLayoutObjectByElementId("target"));
   LayoutRect originalRect(0, 0, 100, 100);
   TransformationMatrix matrix = container->layer()->currentTransform();
+  TransformationMatrix targetMatrix;
+  // getTransformfromContainter includes transform and perspective matrix
+  // of the container.
+  target->getTransformFromContainer(container, LayoutSize(), targetMatrix);
+  matrix *= targetMatrix;
   matrix.flattenTo2d();
-  TransformationMatrix targetMatrix;
-  // getTransformfromContainter includes transform and perspective matrix
-  // of the container.
-  target->getTransformFromContainer(container, LayoutSize(), targetMatrix);
-  matrix *= targetMatrix;
-  LayoutRect output(matrix.mapRect(FloatRect(originalRect)));
+  FloatRect output = matrix.mapRect(FloatRect(originalRect));
 
-  checkVisualRect(*target, *target->view(), originalRect, output);
-}
-
-TEST_F(VisualRectMappingTest, ShouldAccountForPerspectiveNested) {
-  enableCompositing();
-  setBodyInnerHTML(
-      "<style>"
-      "* { margin: 0; }"
-      "#container {"
-      "  transform-style: preserve-3d;"
-      "  transform: rotateX(-45deg); perspective: 100px;"
-      "  width: 100px; height: 100px;"
-      "}"
-      "#target {"
-      "  transform-style: preserve-3d; transform: rotateX(45deg);"
-      "  background: lightblue;"
-      "  width: 100px; height: 100px;"
-      "}"
-      "</style>"
-      "<div id='container'><div id='target'></div></div>");
-  LayoutBlock* container =
-      toLayoutBlock(getLayoutObjectByElementId("container"));
-  LayoutBlock* target = toLayoutBlock(getLayoutObjectByElementId("target"));
-  LayoutRect originalRect(0, 0, 100, 100);
-  TransformationMatrix matrix = container->layer()->currentTransform();
-  TransformationMatrix targetMatrix;
-  // getTransformfromContainter includes transform and perspective matrix
-  // of the container.
-  target->getTransformFromContainer(container, LayoutSize(), targetMatrix);
-  matrix *= targetMatrix;
-  LayoutRect output(matrix.mapRect(FloatRect(originalRect)));
-
-  checkVisualRect(*target, *target->view(), originalRect, output);
+  EXPECT_TRUE(
+      target->mapToVisualRectInAncestorSpace(target->view(), originalRect));
+  EXPECT_EQ(LayoutRect(enclosingIntRect(output)), originalRect);
 }
 
 }  // namespace blink
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_line_builder.cc b/third_party/WebKit/Source/core/layout/ng/ng_line_builder.cc
index 198796b..ec66339 100644
--- a/third_party/WebKit/Source/core/layout/ng/ng_line_builder.cc
+++ b/third_party/WebKit/Source/core/layout/ng/ng_line_builder.cc
@@ -199,14 +199,18 @@
   line_box_data_list_.grow(line_box_data_list_.size() + 1);
   LineBoxData& line_box_data = line_box_data_list_.back();
 
+  // Accumulate a "strut"; a zero-width inline box with the element's font and
+  // line height properties. https://drafts.csswg.org/css2/visudet.html#strut
+  const ComputedStyle* block_style = inline_box_->BlockStyle();
+  InlineItemMetrics block_metrics(*block_style, baseline_type_);
+  line_box_data.UpdateMaxAscentAndDescent(block_metrics);
+
   // Use the block style to compute the estimated baseline position because the
   // baseline position is not known until we know the maximum ascent and leading
   // of the line. Items are placed on this baseline, then adjusted later if the
   // estimation turned out to be different.
-  const ComputedStyle* block_style = inline_box_->BlockStyle();
-  InlineItemMetrics estimated_metrics(*block_style, baseline_type_);
   LayoutUnit estimated_baseline =
-      content_size_ + LayoutUnit(estimated_metrics.ascent_and_leading);
+      content_size_ + LayoutUnit(block_metrics.ascent_and_leading);
 
   for (const auto& line_item_chunk : line_item_chunks) {
     const NGLayoutInlineItem& item = items[line_item_chunk.index];
@@ -277,10 +281,10 @@
 
   // If the estimated baseline position was not the actual position, move all
   // fragments in the block direction.
-  if (estimated_metrics.ascent_and_leading !=
+  if (block_metrics.ascent_and_leading !=
       line_box_data.max_ascent_and_leading) {
     LayoutUnit adjust_top(line_box_data.max_ascent_and_leading -
-                          estimated_metrics.ascent_and_leading);
+                          block_metrics.ascent_and_leading);
     for (unsigned i = fragment_start_index; i < offsets_.size(); i++)
       offsets_[i].block_offset += adjust_top;
   }
diff --git a/third_party/WebKit/Source/core/page/Page.cpp b/third_party/WebKit/Source/core/page/Page.cpp
index efc3d59..a0d2e37a 100644
--- a/third_party/WebKit/Source/core/page/Page.cpp
+++ b/third_party/WebKit/Source/core/page/Page.cpp
@@ -121,7 +121,6 @@
       m_deviceScaleFactor(1),
       m_visibilityState(PageVisibilityStateVisible),
       m_isCursorVisible(true),
-      m_subframeCount(0),
       m_frameHost(FrameHost::create(*this)) {
   ASSERT(m_editorClient);
 
@@ -398,25 +397,6 @@
   return m_isCursorVisible;
 }
 
-#if DCHECK_IS_ON()
-void checkFrameCountConsistency(int expectedFrameCount, Frame* frame) {
-  DCHECK_GE(expectedFrameCount, 0);
-
-  int actualFrameCount = 0;
-  for (; frame; frame = frame->tree().traverseNext())
-    ++actualFrameCount;
-
-  DCHECK_EQ(expectedFrameCount, actualFrameCount);
-}
-#endif
-
-int Page::subframeCount() const {
-#if DCHECK_IS_ON()
-  checkFrameCountConsistency(m_subframeCount + 1, mainFrame());
-#endif
-  return m_subframeCount;
-}
-
 void Page::settingsChanged(SettingsDelegate::ChangeType changeType) {
   switch (changeType) {
     case SettingsDelegate::StyleChange:
diff --git a/third_party/WebKit/Source/core/page/Page.h b/third_party/WebKit/Source/core/page/Page.h
index 7ead68b..7ff4642 100644
--- a/third_party/WebKit/Source/core/page/Page.h
+++ b/third_party/WebKit/Source/core/page/Page.h
@@ -239,18 +239,6 @@
   bool isCursorVisible() const;
   void setIsCursorVisible(bool isVisible) { m_isCursorVisible = isVisible; }
 
-  // Don't allow more than a certain number of frames in a page.
-  // This seems like a reasonable upper bound, and otherwise mutually
-  // recursive frameset pages can quickly bring the program to its knees
-  // with exponential growth in the number of frames.
-  static const int maxNumberOfFrames = 1000;
-  void incrementSubframeCount() { ++m_subframeCount; }
-  void decrementSubframeCount() {
-    DCHECK_GT(m_subframeCount, 0);
-    --m_subframeCount;
-  }
-  int subframeCount() const;
-
   void setDefaultPageScaleLimits(float minScale, float maxScale);
   void setUserAgentPageScaleConstraints(
       const PageScaleConstraints& newConstraints);
@@ -343,8 +331,6 @@
   bool m_isPainting = false;
 #endif
 
-  int m_subframeCount;
-
   // A pointer to all the interfaces provided to in-process Frames for this
   // Page.
   // FIXME: Most of the members of Page should move onto FrameHost.
diff --git a/third_party/WebKit/Source/core/workers/WorkerEventQueue.cpp b/third_party/WebKit/Source/core/workers/WorkerEventQueue.cpp
index c35f6ce..8d57619 100644
--- a/third_party/WebKit/Source/core/workers/WorkerEventQueue.cpp
+++ b/third_party/WebKit/Source/core/workers/WorkerEventQueue.cpp
@@ -26,11 +26,10 @@
 
 #include "core/workers/WorkerEventQueue.h"
 
-#include "core/dom/ExecutionContextTask.h"
-#include "core/dom/TaskRunnerHelper.h"
 #include "core/events/Event.h"
 #include "core/inspector/InspectorInstrumentation.h"
 #include "core/workers/WorkerGlobalScope.h"
+#include "core/workers/WorkerThread.h"
 
 namespace blink {
 
@@ -58,10 +57,10 @@
   probe::asyncTaskScheduled(event->target()->getExecutionContext(),
                             event->type(), event);
   m_pendingEvents.insert(event);
-  m_workerGlobalScope->postTask(
-      TaskType::UnspecedTimer, BLINK_FROM_HERE,
-      createSameThreadTask(&WorkerEventQueue::dispatchEvent,
-                           wrapPersistent(this), wrapWeakPersistent(event)));
+  m_workerGlobalScope->thread()->postTask(
+      BLINK_FROM_HERE,
+      WTF::bind(&WorkerEventQueue::dispatchEvent, wrapPersistent(this),
+                wrapWeakPersistent(event)));
   return true;
 }
 
diff --git a/third_party/WebKit/Source/core/workers/WorkerThread.cpp b/third_party/WebKit/Source/core/workers/WorkerThread.cpp
index e76c01f..071f7d15 100644
--- a/third_party/WebKit/Source/core/workers/WorkerThread.cpp
+++ b/third_party/WebKit/Source/core/workers/WorkerThread.cpp
@@ -26,6 +26,8 @@
 
 #include "core/workers/WorkerThread.h"
 
+#include <limits.h>
+#include <memory>
 #include "bindings/core/v8/Microtask.h"
 #include "bindings/core/v8/ScriptSourceCode.h"
 #include "bindings/core/v8/WorkerOrWorkletScriptController.h"
@@ -53,8 +55,6 @@
 #include "wtf/PtrUtil.h"
 #include "wtf/Threading.h"
 #include "wtf/text/WTFString.h"
-#include <limits.h>
-#include <memory>
 
 namespace blink {
 
@@ -191,13 +191,26 @@
 }
 
 void WorkerThread::postTask(const WebTraceLocation& location,
+                            std::unique_ptr<WTF::Closure> task) {
+  DCHECK(isCurrentThread());
+  if (isInShutdown())
+    return;
+  workerBackingThread().backingThread().postTask(
+      location,
+      WTF::bind(
+          &WorkerThread::performTaskOnWorkerThread<WTF::SameThreadAffinity>,
+          WTF::unretained(this), WTF::passed(std::move(task))));
+}
+
+void WorkerThread::postTask(const WebTraceLocation& location,
                             std::unique_ptr<WTF::CrossThreadClosure> task) {
   if (isInShutdown())
     return;
   workerBackingThread().backingThread().postTask(
-      location, crossThreadBind(&WorkerThread::performTaskOnWorkerThread,
-                                crossThreadUnretained(this),
-                                WTF::passed(std::move(task))));
+      location,
+      crossThreadBind(
+          &WorkerThread::performTaskOnWorkerThread<WTF::CrossThreadAffinity>,
+          crossThreadUnretained(this), WTF::passed(std::move(task))));
 }
 
 void WorkerThread::appendDebuggerTask(
@@ -550,8 +563,9 @@
   m_shutdownEvent->signal();
 }
 
+template <WTF::FunctionThreadAffinity threadAffinity>
 void WorkerThread::performTaskOnWorkerThread(
-    std::unique_ptr<WTF::CrossThreadClosure> task) {
+    std::unique_ptr<Function<void(), threadAffinity>> task) {
   DCHECK(isCurrentThread());
   if (m_threadState != ThreadState::Running)
     return;
diff --git a/third_party/WebKit/Source/core/workers/WorkerThread.h b/third_party/WebKit/Source/core/workers/WorkerThread.h
index 6c27763..8239c85 100644
--- a/third_party/WebKit/Source/core/workers/WorkerThread.h
+++ b/third_party/WebKit/Source/core/workers/WorkerThread.h
@@ -137,6 +137,7 @@
     return m_workerReportingProxy;
   }
 
+  void postTask(const WebTraceLocation&, std::unique_ptr<WTF::Closure>);
   void postTask(const WebTraceLocation&,
                 std::unique_ptr<WTF::CrossThreadClosure>);
   void appendDebuggerTask(std::unique_ptr<CrossThreadClosure>);
@@ -251,7 +252,9 @@
   void initializeOnWorkerThread(std::unique_ptr<WorkerThreadStartupData>);
   void prepareForShutdownOnWorkerThread();
   void performShutdownOnWorkerThread();
-  void performTaskOnWorkerThread(std::unique_ptr<CrossThreadClosure>);
+  template <WTF::FunctionThreadAffinity threadAffinity>
+  void performTaskOnWorkerThread(
+      std::unique_ptr<Function<void(), threadAffinity>> task);
   void performDebuggerTaskOnWorkerThread(std::unique_ptr<CrossThreadClosure>);
   void performDebuggerTaskDontWaitOnWorkerThread();
 
diff --git a/third_party/WebKit/Source/platform/graphics/paint/GeometryMapper.cpp b/third_party/WebKit/Source/platform/graphics/paint/GeometryMapper.cpp
index 55f018c..6258d642 100644
--- a/third_party/WebKit/Source/platform/graphics/paint/GeometryMapper.cpp
+++ b/third_party/WebKit/Source/platform/graphics/paint/GeometryMapper.cpp
@@ -373,14 +373,6 @@
        it++) {
     TransformationMatrix localTransformMatrix = (*it)->matrix();
     localTransformMatrix.applyTransformOrigin((*it)->origin());
-
-    // Flattening Lemma: flatten(A * flatten(B)) = flatten(flatten(A) * B).
-    // goo.gl/DNKyOc. Thus we can flatten transformMatrix rather than
-    // localTransformMatrix, because GeometryMapper only supports transforms
-    // into a flattened destination space.
-    if ((*it)->flattensInheritedTransform())
-      transformMatrix.flattenTo2d();
-
     transformMatrix = transformMatrix * localTransformMatrix;
     (*it)->getTransformCache().setCachedTransform(ancestorTransformNode,
                                                   transformMatrix);
diff --git a/third_party/WebKit/Source/platform/graphics/paint/GeometryMapper.h b/third_party/WebKit/Source/platform/graphics/paint/GeometryMapper.h
index 0b414c5e..c5a8ec36 100644
--- a/third_party/WebKit/Source/platform/graphics/paint/GeometryMapper.h
+++ b/third_party/WebKit/Source/platform/graphics/paint/GeometryMapper.h
@@ -113,10 +113,6 @@
   // Returns the matrix used in |LocalToAncestorRect|. DCHECK fails iff
   // |localTransformNode| is not equal to or a descendant of
   // |ancestorTransformNode|.
-  // This matrix may not be flattened. Since GeometryMapper only supports
-  // flattened ancestor spaces, the returned matrix must be flattened to have
-  // the correct semantics (calling mapRect() on it implicitly applies
-  // flattening to the input; flattenTo2d() does it explicitly to tme matrix).
   const TransformationMatrix& localToAncestorMatrix(
       const TransformPaintPropertyNode* localTransformNode,
       const TransformPaintPropertyNode* ancestorTransformNode);
diff --git a/third_party/WebKit/Source/platform/graphics/paint/GeometryMapperTest.cpp b/third_party/WebKit/Source/platform/graphics/paint/GeometryMapperTest.cpp
index cdda820d..7c44f7b1 100644
--- a/third_party/WebKit/Source/platform/graphics/paint/GeometryMapperTest.cpp
+++ b/third_party/WebKit/Source/platform/graphics/paint/GeometryMapperTest.cpp
@@ -276,32 +276,6 @@
       *getTransform(transform1.get(), rootPropertyTreeState().transform()));
 }
 
-TEST_F(GeometryMapperTest, NestedTransformsFlattening) {
-  TransformationMatrix rotateTransform;
-  rotateTransform.rotate3d(45, 0, 0);
-  RefPtr<TransformPaintPropertyNode> transform1 =
-      TransformPaintPropertyNode::create(rootPropertyTreeState().transform(),
-                                         rotateTransform, FloatPoint3D());
-
-  TransformationMatrix inverseRotateTransform;
-  inverseRotateTransform.rotate3d(-45, 0, 0);
-  RefPtr<TransformPaintPropertyNode> transform2 =
-      TransformPaintPropertyNode::create(transform1, inverseRotateTransform,
-                                         FloatPoint3D(),
-                                         true);  // Flattens
-
-  PropertyTreeState localState = rootPropertyTreeState();
-  localState.setTransform(transform2.get());
-
-  FloatRect input(0, 0, 100, 100);
-  rotateTransform.flattenTo2d();
-  TransformationMatrix final = rotateTransform * inverseRotateTransform;
-  FloatRect output = final.mapRect(input);
-  bool hasRadius = false;
-  CHECK_MAPPINGS(input, output, output, final, FloatClipRect(), localState,
-                 rootPropertyTreeState(), hasRadius);
-}
-
 TEST_F(GeometryMapperTest, NestedTransformsScaleAndTranslation) {
   TransformationMatrix scaleTransform;
   scaleTransform.scale(2);
@@ -845,11 +819,11 @@
   EXPECT_EQ(FloatRect(-150, -150, 450, 450), output);
 
   bool hasRadius = false;
-  TransformationMatrix combinedTransform =
-      transformAboveEffect->matrix() * transformBelowEffect->matrix();
-  CHECK_MAPPINGS(input, output, FloatRect(0, 0, 300, 300), combinedTransform,
-                 FloatClipRect(FloatRect(30, 30, 270, 270)), localState,
-                 rootPropertyTreeState(), hasRadius);
+  CHECK_MAPPINGS(
+      input, output, FloatRect(0, 0, 300, 300),
+      transformAboveEffect->matrix() * transformBelowEffect->matrix(),
+      FloatClipRect(FloatRect(30, 30, 270, 270)), localState,
+      rootPropertyTreeState(), hasRadius);
 }
 
 TEST_F(GeometryMapperTest, ReflectionWithPaintOffset) {
diff --git a/third_party/WebKit/Source/platform/graphics/paint/GeometryMapperTransformCache.h b/third_party/WebKit/Source/platform/graphics/paint/GeometryMapperTransformCache.h
index 7b82beca..9d08f72 100644
--- a/third_party/WebKit/Source/platform/graphics/paint/GeometryMapperTransformCache.h
+++ b/third_party/WebKit/Source/platform/graphics/paint/GeometryMapperTransformCache.h
@@ -24,8 +24,6 @@
   // Returns the transformed rect (see GeometryMapper.h) of |this| in the
   // space of |ancestorTransform|, if there is one cached. Otherwise returns
   // null.
-  //
-  // These transforms are not flattened to 2d.
   const TransformationMatrix* getCachedTransform(
       const TransformPaintPropertyNode* ancestorTransform);
 
diff --git a/tools/gn/xcode_writer.cc b/tools/gn/xcode_writer.cc
index 41af6289b..8b96db4 100644
--- a/tools/gn/xcode_writer.cc
+++ b/tools/gn/xcode_writer.cc
@@ -404,7 +404,7 @@
       new PBXProject("products", config_name, source_path, attributes));
   SourceDir source_dir("//");
 
-  // Add all source files for indexing.
+  // Add all source files for indexing, both private and public.
   std::vector<SourceFile> sources;
   for (const Target* target : all_targets) {
     for (const SourceFile& source : target->sources()) {
@@ -413,6 +413,16 @@
 
       sources.push_back(source);
     }
+
+    if (target->all_headers_public())
+      continue;
+
+    for (const SourceFile& source : target->public_headers()) {
+      if (IsStringInOutputDir(build_settings->build_dir(), source.value()))
+        continue;
+
+      sources.push_back(source);
+    }
   }
 
   // Sort sources to ensure determinisn of the project file generation and