diff --git a/BUILD.gn b/BUILD.gn index 31363a0..95f4b6514 100644 --- a/BUILD.gn +++ b/BUILD.gn
@@ -1039,13 +1039,6 @@ } } - group("devtools_web_tests") { - testonly = true - deps = [ ":blink_web_tests" ] - data_deps = [ ":blink_web_tests" ] - data = [ "//third_party/devtools-frontend/src/test/webtests/" ] - } - group("blink_web_tests_support_data") { testonly = true data_deps = [ @@ -1145,38 +1138,41 @@ } } + _common_web_test_script = "//testing/scripts/run_isolated_script_test.py" + + _common_web_test_args = [ "@WrappedPath(" + rebase_path( + "//third_party/blink/tools/run_web_tests.py", + root_build_dir) + ")" ] + if (is_debug) { + _common_web_test_args += [ "--debug" ] + } else { + _common_web_test_args += [ "--release" ] + } + + if (is_android) { + _common_web_test_args += [ + "--platform", + "android", + ] + } + + _common_web_test_args += [ + "--seed", + "4", + "--no-show-results", + "--zero-tests-executed-ok", + "--clobber-old-results", + "--exit-after-n-failures", + "5000", + "--exit-after-n-crashes-or-timeouts", + "100", + ] + # https://chromium.googlesource.com/chromium/src/+/master/docs/testing/web_tests.md script_test("blink_web_tests") { - script = "//testing/scripts/run_isolated_script_test.py" + script = _common_web_test_script - args = [ "@WrappedPath(" + - rebase_path("//third_party/blink/tools/run_web_tests.py", - root_build_dir) + ")" ] - - if (is_debug) { - args += [ "--debug" ] - } else { - args += [ "--release" ] - } - - if (is_android) { - args += [ - "--platform", - "android", - ] - } - - args += [ - "--seed", - "4", - "--no-show-results", - "--zero-tests-executed-ok", - "--clobber-old-results", - "--exit-after-n-failures", - "5000", - "--exit-after-n-crashes-or-timeouts", - "100", - ] + args = _common_web_test_args data_deps = [ ":blink_web_tests_support_data" ] data = [ @@ -1185,30 +1181,37 @@ ] } - generate_wrapper("webgpu_blink_web_tests") { - testonly = true - wrapper_script = "${root_build_dir}/bin/run_webgpu_blink_web_tests" - executable = "//third_party/blink/tools/run_web_tests.py" - executable_args = [ - "--additional-driver-flag=--enable-unsafe-webgpu", - "--ignore-default-expectations", - "--additional-expectations", - "@WrappedPath(../../third_party/blink/web_tests/WebGPUExpectations)", - "--isolated-script-test-filter=wpt_internal/webgpu/*", - ] + script_test("devtools_web_tests") { + # This target differs from :blink_web_tests in that it uses the + # same test harness but runs an entirely different set of tests + # and doesn't have a dependency on the web_test directory at all. + script = _common_web_test_script - if (is_debug) { - executable_args += [ "--debug" ] - } else { - executable_args += [ "--release" ] - } + args = _common_web_test_args + [ + "--layout-test-directory=@WrappedPath(" + rebase_path( + "//third_party/devtools-frontend/src/test/webtests", + root_out_dir) + ")", + "http/tests/devtools", + ] - if (is_android) { - executable_args += [ - "--platform", - "android", - ] - } + data_deps = [ ":blink_web_tests_support_data" ] + data = [ "//third_party/devtools-frontend/src/test/webtests/" ] + } + + script_test("webgpu_blink_web_tests") { + # This target differs from :blink_web_tests in that it uses the same + # test harness and a few additional flags but, more importantly, only runs + # the web_tests/wpt_internal/webgpu tests, so it doesn't have a data + # dependency on the whole web_test directory. + script = _common_web_test_script + args = + _common_web_test_args + [ + "--additional-driver-flag=--enable-unsafe-webgpu", + "--ignore-default-expectations", + "--additional-expectations", + "@WrappedPath(../../third_party/blink/web_tests/WebGPUExpectations)", + "--isolated-script-test-filter=wpt_internal/webgpu/*", + ] data_deps = [ ":blink_web_tests_support_data" ] data = [
diff --git a/DEPS b/DEPS index bb970847..becc2c44 100644 --- a/DEPS +++ b/DEPS
@@ -195,11 +195,11 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling Skia # and whatever else without interference from each other. - 'skia_revision': 'aa8c4617869e54cc6015b1b2d7a7bf5f512689b8', + 'skia_revision': '658ae8fc6aba3e987cf3b4cf711ba308435a3f64', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling V8 # and whatever else without interference from each other. - 'v8_revision': '07b0b1dcde4a99294b8028d83f4ea244885cc091', + 'v8_revision': 'e4ed803f4c09ff72bb1eaadf59ec31facf507368', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling swarming_client # and whatever else without interference from each other. @@ -207,7 +207,7 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling ANGLE # and whatever else without interference from each other. - 'angle_revision': '5291cbadc02e4473701f540e656f29c3ded7b387', + 'angle_revision': 'b2ff69f856d98312bbfe14f80d084b7d8795281f', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling SwiftShader # and whatever else without interference from each other. @@ -258,7 +258,7 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling catapult # and whatever else without interference from each other. - 'catapult_revision': 'e611beb1834069d510f53a5f436b31e9241b9993', + 'catapult_revision': 'e9879d106b95b2c9f0b0fd6efe8f1e5186f64ada', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling libFuzzer # and whatever else without interference from each other. @@ -266,7 +266,7 @@ # Three lines of non-changing comments so that # the commit queue can handle CLs rolling devtools-frontend # and whatever else without interference from each other. - 'devtools_frontend_revision': '58919b4db13b56b5b43b46fd793a5c71ddcb89bd', + 'devtools_frontend_revision': '5a23b943626939e5bcc6c1dfddbbebd2c531e151', # Three lines of non-changing comments so that # the commit queue can handle CLs rolling libprotobuf-mutator # and whatever else without interference from each other. @@ -881,7 +881,7 @@ # Tools used when building Chrome for Chrome OS. This affects both the Simple # Chrome workflow, as well as the chromeos-chrome ebuild. 'src/third_party/chromite': { - 'url': Var('chromium_git') + '/chromiumos/chromite.git' + '@' + '8ce5f5261ab7a2434295dee3f744e155c2abc9b2', + 'url': Var('chromium_git') + '/chromiumos/chromite.git' + '@' + '84bd221ed748e1d0a3155c8a9a210d4802f94678', 'condition': 'checkout_chromeos', }, @@ -1254,7 +1254,7 @@ }, 'src/third_party/perfetto': - Var('android_git') + '/platform/external/perfetto.git' + '@' + 'c251d370b65ed2b50c02e89c8d8852026c2fda24', + Var('android_git') + '/platform/external/perfetto.git' + '@' + '815983783a765fa04e31bb514020fd1c55291a71', 'src/third_party/perl': { 'url': Var('chromium_git') + '/chromium/deps/perl.git' + '@' + '6f3e5028eb65d0b4c5fdd792106ac4c84eee1eb3', @@ -1332,7 +1332,7 @@ 'packages': [ { 'package': 'fuchsia/third_party/aemu/linux-amd64', - 'version': 'lqz1nnbJiv6AkXiCEbZ8QbFCNIqL__If5b9sY15RbfUC' + 'version': 'sc_IY63udetl6YG0-ExCPBOGDcD1JagmZiWBkq2mBl0C' }, ], 'condition': 'host_os == "linux" and checkout_fuchsia', @@ -1351,7 +1351,7 @@ }, 'src/third_party/re2/src': - Var('chromium_git') + '/external/github.com/google/re2.git' + '@' + '7c2e104ffbe4383a9d2933428d4bc104ff16cdb2', + Var('chromium_git') + '/external/github.com/google/re2.git' + '@' + 'a84f9718f35f62ae2a7a32abb016a1fa9862346a', 'src/third_party/r8': { 'packages': [ @@ -1558,7 +1558,7 @@ Var('chromium_git') + '/v8/v8.git' + '@' + Var('v8_revision'), 'src-internal': { - 'url': 'https://chrome-internal.googlesource.com/chrome/src-internal.git@09f602317f2b34453f03037d745ed29b0c06b1ff', + 'url': 'https://chrome-internal.googlesource.com/chrome/src-internal.git@99db0de96759bae0298c1f5e81498e48b7f219f5', 'condition': 'checkout_src_internal', }, @@ -1566,7 +1566,7 @@ 'packages': [ { 'package': 'chromeos_internal/apps/help_app/app', - 'version': 'ccPNzyZsy8IYqEUjkXTCupUsZ6yj49ysyBQKh1jDG28C', + 'version': 'P-2JwDZls8V1LNOlmHoxgPlVs68icpTYuJyIwCQQ-okC', }, ], 'condition': 'checkout_chromeos and checkout_src_internal', @@ -1577,7 +1577,7 @@ 'packages': [ { 'package': 'chromeos_internal/apps/media_app/app', - 'version': 'BzVQGnSCwNeprjjkFkqzj_GZUxAVI1K5DBja9inASBwC', + 'version': 'TGyqQ0i-VwfJWUWkmWGzsrQ0c-MmVg_nP2-LKMWnCQYC', }, ], 'condition': 'checkout_chromeos and checkout_src_internal', @@ -4632,7 +4632,7 @@ # Download Telemetry's benchmark binary dependencies via conditionals { 'name': 'checkout_telemetry_benchmark_deps', - 'condition': 'checkout_telemetry_dependencies and checkout_linux', + 'condition': 'checkout_telemetry_dependencies and checkout_linux and not checkout_android', 'pattern': '.', 'action': [ 'vpython', 'src/tools/perf/fetch_benchmark_deps.py',
diff --git a/WATCHLISTS b/WATCHLISTS index 3f514dff..8bad9be 100644 --- a/WATCHLISTS +++ b/WATCHLISTS
@@ -1646,6 +1646,9 @@ '|components/metrics/*call_stack*'\ '|components/metrics/public/mojom/call_stack*', }, + 'scanning': { + 'filepath': 'chromeos/components/scanning/', + }, 'screen_orientation': { 'filepath': 'screen_orientation', }, @@ -2719,6 +2722,9 @@ 'xinghuilu+watch@chromium.org'], 'safety_tips': ['jdeblasio+watch@chromium.org'], 'sampling_profiler': ['wittman+watch@chromium.org'], + 'scanning': ['gavinwill+scanning-watch@chromium.org', + 'jschettler+scanning-watch@chromium.org', + 'zentaro+scanning-watch@chromium.org'], 'screen_orientation': ['mlamouri+watch-screen-orientation@chromium.org'], 'security': ['security-watchlist@chromium.org'], 'select_to_speak': ['katie+watch@chromium.org',
diff --git a/ash/app_list/app_list_color_provider_impl.cc b/ash/app_list/app_list_color_provider_impl.cc index 767b1e8..7969e6b 100644 --- a/ash/app_list/app_list_color_provider_impl.cc +++ b/ash/app_list/app_list_color_provider_impl.cc
@@ -100,24 +100,28 @@ ripple_attributes.highlight_opacity * 255); } -SkColor AppListColorProviderImpl::GetSearchBoxIconColor() const { - return ash_color_provider_->GetContentLayerColor( - AshColorProvider::ContentLayerType::kButtonIconColor); +SkColor AppListColorProviderImpl::GetSearchBoxIconColor( + SkColor default_color) const { + return DeprecatedGetContentLayerColor( + AshColorProvider::ContentLayerType::kButtonIconColor, default_color); } -SkColor AppListColorProviderImpl::GetFolderBackgroundColor() const { - return ash_color_provider_->GetBaseLayerColor( - AshColorProvider::BaseLayerType::kTransparent80); +SkColor AppListColorProviderImpl::GetFolderBackgroundColor( + SkColor default_color) const { + return DeprecatedGetBaseLayerColor( + AshColorProvider::BaseLayerType::kTransparent80, default_color); } -SkColor AppListColorProviderImpl::GetFolderTitleTextColor() const { - return ash_color_provider_->GetContentLayerColor( - AshColorProvider::ContentLayerType::kTextColorPrimary); +SkColor AppListColorProviderImpl::GetFolderTitleTextColor( + SkColor default_color) const { + return DeprecatedGetContentLayerColor( + AshColorProvider::ContentLayerType::kTextColorPrimary, default_color); } SkColor AppListColorProviderImpl::GetFolderHintTextColor() const { - return ash_color_provider_->GetContentLayerColor( - AshColorProvider::ContentLayerType::kTextColorSecondary); + return DeprecatedGetContentLayerColor( + AshColorProvider::ContentLayerType::kTextColorSecondary, + gfx::kGoogleGrey600); } SkColor AppListColorProviderImpl::GetFolderNameBackgroundColor(
diff --git a/ash/app_list/app_list_color_provider_impl.h b/ash/app_list/app_list_color_provider_impl.h index 4828b27e..e2d779e4f 100644 --- a/ash/app_list/app_list_color_provider_impl.h +++ b/ash/app_list/app_list_color_provider_impl.h
@@ -30,10 +30,10 @@ SkColor GetPageSwitcherButtonColor() const override; SkColor GetPageSwitcherInkDropBaseColor() const override; SkColor GetPageSwitcherInkDropHighlightColor() const override; - SkColor GetSearchBoxIconColor() const override; + SkColor GetSearchBoxIconColor(SkColor default_color) const override; SkColor GetSearchBoxCardBackgroundColor() const override; - SkColor GetFolderBackgroundColor() const override; - SkColor GetFolderTitleTextColor() const override; + SkColor GetFolderBackgroundColor(SkColor default_color) const override; + SkColor GetFolderTitleTextColor(SkColor default_color) const override; SkColor GetFolderHintTextColor() const override; SkColor GetFolderNameBackgroundColor(bool active) const override; SkColor GetFolderNameBorderColor(bool active) const override;
diff --git a/ash/app_list/test/test_app_list_color_provider.cc b/ash/app_list/test/test_app_list_color_provider.cc index f3b00a4..4551a27 100644 --- a/ash/app_list/test/test_app_list_color_provider.cc +++ b/ash/app_list/test/test_app_list_color_provider.cc
@@ -56,7 +56,8 @@ return gfx::kGoogleGrey200; } -SkColor TestAppListColorProvider::GetFolderBackgroundColor() const { +SkColor TestAppListColorProvider::GetFolderBackgroundColor( + SkColor default_color) const { return gfx::kGoogleGrey900; } @@ -72,11 +73,13 @@ return SkColorSetA(SK_ColorBLACK, 0x0F); } -SkColor TestAppListColorProvider::GetSearchBoxIconColor() const { +SkColor TestAppListColorProvider::GetSearchBoxIconColor( + SkColor default_color) const { return gfx::kGoogleGrey200; } -SkColor TestAppListColorProvider::GetFolderTitleTextColor() const { +SkColor TestAppListColorProvider::GetFolderTitleTextColor( + SkColor default_color) const { return gfx::kGoogleGrey200; }
diff --git a/ash/app_list/test/test_app_list_color_provider.h b/ash/app_list/test/test_app_list_color_provider.h index dfb5e12..0345d81 100644 --- a/ash/app_list/test/test_app_list_color_provider.h +++ b/ash/app_list/test/test_app_list_color_provider.h
@@ -30,10 +30,10 @@ SkColor GetPageSwitcherButtonColor() const override; SkColor GetPageSwitcherInkDropBaseColor() const override; SkColor GetPageSwitcherInkDropHighlightColor() const override; - SkColor GetSearchBoxIconColor() const override; + SkColor GetSearchBoxIconColor(SkColor default_color) const override; SkColor GetSearchBoxCardBackgroundColor() const override; - SkColor GetFolderBackgroundColor() const override; - SkColor GetFolderTitleTextColor() const override; + SkColor GetFolderBackgroundColor(SkColor default_color) const override; + SkColor GetFolderTitleTextColor(SkColor default_color) const override; SkColor GetFolderHintTextColor() const override; SkColor GetFolderNameBackgroundColor(bool active) const override; SkColor GetFolderNameBorderColor(bool active) const override;
diff --git a/ash/app_list/views/app_list_folder_view.cc b/ash/app_list/views/app_list_folder_view.cc index e957e85..6687d6f 100644 --- a/ash/app_list/views/app_list_folder_view.cc +++ b/ash/app_list/views/app_list_folder_view.cc
@@ -92,7 +92,8 @@ : folder_view_->folder_item_icon_bounds(); to_rect -= background_view_->bounds().OffsetFromOrigin(); const SkColor background_color = - AppListColorProvider::Get()->GetFolderBackgroundColor(); + AppListColorProvider::Get()->GetFolderBackgroundColor( + folder_view_->GetAppListConfig().folder_background_color()); const SkColor from_color = show_ ? folder_view_->GetAppListConfig().folder_bubble_color() : background_color; @@ -150,10 +151,14 @@ animation_(this), folder_view_(folder_view) { // Calculate the source and target states. - from_color_ = show_ ? AppListColorProvider::Get()->GetFolderTitleTextColor() - : SK_ColorTRANSPARENT; - to_color_ = show_ ? SK_ColorTRANSPARENT - : AppListColorProvider::Get()->GetFolderTitleTextColor(); + from_color_ = show_ + ? AppListColorProvider::Get()->GetFolderTitleTextColor( + folder_view_->GetAppListConfig().grid_title_color()) + : SK_ColorTRANSPARENT; + to_color_ = show_ + ? SK_ColorTRANSPARENT + : AppListColorProvider::Get()->GetFolderTitleTextColor( + folder_view_->GetAppListConfig().grid_title_color()); animation_.SetTweenType(gfx::Tween::FAST_OUT_SLOW_IN); animation_.SetSlideDuration( @@ -827,7 +832,8 @@ if (activated_folder_item_view) { activated_folder_item_view->SetIconVisible(true); activated_folder_item_view->title()->SetEnabledColor( - AppListColorProvider::Get()->GetFolderTitleTextColor()); + AppListColorProvider::Get()->GetFolderTitleTextColor( + GetAppListConfig().grid_title_color())); activated_folder_item_view->title()->SetVisible(true); } }
diff --git a/ash/app_list/views/folder_header_view.cc b/ash/app_list/views/folder_header_view.cc index f3d070b..0205817 100644 --- a/ash/app_list/views/folder_header_view.cc +++ b/ash/app_list/views/folder_header_view.cc
@@ -61,7 +61,8 @@ color_provider->GetFolderNameBackgroundColor(is_active), AppListConfig::instance().folder_name_border_radius())); - const SkColor text_color = color_provider->GetFolderTitleTextColor(); + const SkColor text_color = + color_provider->GetFolderTitleTextColor(gfx::kGoogleGrey700); SetTextColor(text_color); SetSelectionTextColor(text_color); SetSelectionBackgroundColor(color_provider->GetFolderNameSelectionColor());
diff --git a/ash/app_list/views/search_box_view.cc b/ash/app_list/views/search_box_view.cc index cfb63bd..f4c3567 100644 --- a/ash/app_list/views/search_box_view.cc +++ b/ash/app_list/views/search_box_view.cc
@@ -197,9 +197,10 @@ const gfx::VectorIcon& icon = search_model_->search_engine_is_google() ? google_icon : kSearchEngineNotGoogleIcon; - SetSearchIconImage(gfx::CreateVectorIcon( - icon, kSearchBoxIconSize, - AppListColorProvider::Get()->GetSearchBoxIconColor())); + SetSearchIconImage( + gfx::CreateVectorIcon(icon, kSearchBoxIconSize, + AppListColorProvider::Get()->GetSearchBoxIconColor( + SkColorSetARGB(0xDE, 0x00, 0x00, 0x00)))); } void SearchBoxView::UpdateSearchBoxBorder() { @@ -233,10 +234,11 @@ void SearchBoxView::SetupCloseButton() { views::ImageButton* close = close_button(); - close->SetImage(views::ImageButton::STATE_NORMAL, - gfx::CreateVectorIcon( - views::kIcCloseIcon, kSearchBoxIconSize, - AppListColorProvider::Get()->GetSearchBoxIconColor())); + close->SetImage( + views::ImageButton::STATE_NORMAL, + gfx::CreateVectorIcon(views::kIcCloseIcon, kSearchBoxIconSize, + AppListColorProvider::Get()->GetSearchBoxIconColor( + gfx::kGoogleGrey700))); close->SetVisible(false); base::string16 close_button_label( l10n_util::GetStringUTF16(IDS_APP_LIST_CLEAR_SEARCHBOX)); @@ -796,9 +798,9 @@ views::ImageButton* assistant = assistant_button(); assistant->SetImage( views::ImageButton::STATE_NORMAL, - gfx::CreateVectorIcon( - chromeos::kAssistantIcon, kSearchBoxIconSize, - AppListColorProvider::Get()->GetSearchBoxIconColor())); + gfx::CreateVectorIcon(chromeos::kAssistantIcon, kSearchBoxIconSize, + AppListColorProvider::Get()->GetSearchBoxIconColor( + gfx::kGoogleGrey700))); base::string16 assistant_button_label( l10n_util::GetStringUTF16(IDS_APP_LIST_START_ASSISTANT)); assistant->SetAccessibleName(assistant_button_label);
diff --git a/ash/ash_strings.grd b/ash/ash_strings.grd index 726d6d16..2930b89 100644 --- a/ash/ash_strings.grd +++ b/ash/ash_strings.grd
@@ -1425,9 +1425,6 @@ <message name="IDS_ASH_STATUS_TRAY_OTHER_WIFI" desc="The label used for the item to display other Wi-Fi networks."> Join other Wi-Fi networks </message> - <message name="IDS_ASH_STATUS_TRAY_EXTENSION_CONTROLLED_WIFI" desc="The accessible text for the badge in the detailed network list indicating that the respective network's configuration may be controlled by an extension."> - The extension "<ph name="EXTENSION_NAME">$1<ex>Nexus S</ex></ph>" can help connect to this network. - </message> <message name="IDS_ASH_STATUS_TRAY_BLUETOOTH_DISCOVERABLE" desc="Notification shown when a Bluetooth adapter is discoverable."> Your computer is discoverable to nearby Bluetooth devices and will appear as "<ph name="NAME">$1<ex>Chromebook</ex></ph>" with address <ph name="ADDRESS">$2<ex>01:23:45:67:89:0A</ex></ph> </message>
diff --git a/ash/public/cpp/app_list/app_list_color_provider.h b/ash/public/cpp/app_list/app_list_color_provider.h index 1dab62b..18c7a09 100644 --- a/ash/public/cpp/app_list/app_list_color_provider.h +++ b/ash/public/cpp/app_list/app_list_color_provider.h
@@ -29,10 +29,10 @@ virtual SkColor GetPageSwitcherButtonColor() const = 0; virtual SkColor GetPageSwitcherInkDropBaseColor() const = 0; virtual SkColor GetPageSwitcherInkDropHighlightColor() const = 0; - virtual SkColor GetSearchBoxIconColor() const = 0; + virtual SkColor GetSearchBoxIconColor(SkColor default_color) const = 0; virtual SkColor GetSearchBoxCardBackgroundColor() const = 0; - virtual SkColor GetFolderBackgroundColor() const = 0; - virtual SkColor GetFolderTitleTextColor() const = 0; + virtual SkColor GetFolderBackgroundColor(SkColor default_color) const = 0; + virtual SkColor GetFolderTitleTextColor(SkColor default_color) const = 0; virtual SkColor GetFolderHintTextColor() const = 0; virtual SkColor GetFolderNameBackgroundColor(bool active) const = 0; virtual SkColor GetFolderNameBorderColor(bool active) const = 0;
diff --git a/ash/public/cpp/ash_view_ids.h b/ash/public/cpp/ash_view_ids.h index 8dce819..e482f0d 100644 --- a/ash/public/cpp/ash_view_ids.h +++ b/ash/public/cpp/ash_view_ids.h
@@ -27,8 +27,6 @@ VIEW_ID_CAST_CAST_VIEW_LABEL, VIEW_ID_CAST_MAIN_VIEW, VIEW_ID_CAST_SELECT_VIEW, - // System tray network submenu item for extension-controlled networks. - VIEW_ID_EXTENSION_CONTROLLED_WIFI, VIEW_ID_MEDIA_TRAY_VIEW, // Power button in system tray. VIEW_ID_POWER_BUTTON,
diff --git a/ash/resources/vector_icons/BUILD.gn b/ash/resources/vector_icons/BUILD.gn index 4bf613d..4cddaa4 100644 --- a/ash/resources/vector_icons/BUILD.gn +++ b/ash/resources/vector_icons/BUILD.gn
@@ -28,7 +28,6 @@ "autoclick_scroll_right.icon", "autoclick_scroll_up.icon", "battery.icon", - "captive_portal.icon", "capture_mode.icon", "capture_mode_circle_stop.icon", "capture_mode_fullscreen.icon", @@ -79,7 +78,6 @@ "mic.icon", "music_note.icon", "muted_microphone.icon", - "network_badge_captive_portal.icon", "network_badge_off.icon", "network_badge_roaming.icon", "network_badge_secure.icon",
diff --git a/ash/resources/vector_icons/captive_portal.icon b/ash/resources/vector_icons/captive_portal.icon deleted file mode 100644 index ffff1b6..0000000 --- a/ash/resources/vector_icons/captive_portal.icon +++ /dev/null
@@ -1,117 +0,0 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -CANVAS_DIMENSIONS, 40, -MOVE_TO, 19, 26, -R_V_LINE_TO, -3, -R_H_LINE_TO, -3, -R_CUBIC_TO, 0.12f, -0.85f, 0.01f, -1.9f, 0, -3, -R_CUBIC_TO, 0.01f, -1.08f, -0.04f, -2.17f, 0, -3, -R_H_LINE_TO, 8, -R_CUBIC_TO, -0.25f, 0.83f, -0.09f, 1.92f, 0, 3, -R_CUBIC_TO, -0.09f, 0.01f, 3, 0, 3, 0, -R_CUBIC_TO, 0.21f, -1.23f, 0.01f, -2.14f, 0, -3, -R_H_LINE_TO, 5, -R_CUBIC_TO, 0.55f, 0.83f, 0.73f, 2.17f, 1, 3, -R_CUBIC_TO, -0.21f, -0.06f, 3, 0, 3, 0, -R_CUBIC_TO, 0, -8.68f, -7.15f, -16, -16, -16, -R_CUBIC_TO, -8.84f, 0, -16, 7.17f, -16, 16, -R_CUBIC_TO, 0, 8.72f, 6.78f, 15.8f, 15, 16, -R_V_LINE_TO, -4, -R_CUBIC_TO, -0.69f, -1.62f, -1.43f, -3.54f, -2, -6, -R_H_LINE_TO, 2, -CLOSE, -R_MOVE_TO, 4, -12, -R_H_LINE_TO, -6, -R_CUBIC_TO, 0.65f, -2.21f, 1.68f, -5.2f, 3, -7, -R_CUBIC_TO, 1.3f, 1.8f, 2.32f, 4.79f, 3, 7, -CLOSE, -R_MOVE_TO, -9, 12, -R_CUBIC_TO, 0.38f, 2.02f, 1.04f, 4.2f, 2, 6, -R_CUBIC_TO, -2.95f, -1.02f, -5.4f, -3.09f, -7, -6, -R_H_LINE_TO, 5, -CLOSE, -R_MOVE_TO, -7, -3, -R_CUBIC_TO, 0.17f, -0.96f, 0, -1.96f, 0, -3, -R_CUBIC_TO, 0, -1.04f, 0.17f, -2.04f, 0, -3, -R_H_LINE_TO, 6, -R_CUBIC_TO, -0.13f, 0.99f, -0.23f, 1.98f, 0, 3, -R_CUBIC_TO, -0.23f, 1.02f, -0.13f, 2.01f, 0, 3, -H_LINE_TO, 7, -CLOSE, -R_MOVE_TO, 2, -9, -R_CUBIC_TO, 1.55f, -2.8f, 4.03f, -4.94f, 7, -6, -R_CUBIC_TO, -0.97f, 1.87f, -1.71f, 3.89f, -2, 6, -H_LINE_TO, 9, -CLOSE, -R_MOVE_TO, 17, 0, -R_CUBIC_TO, -0.29f, -2.11f, -1.03f, -4.13f, -2, -6, -R_CUBIC_TO, 2.98f, 1.06f, 5.45f, 3.22f, 7, 6, -R_H_LINE_TO, -5, -CLOSE, -MOVE_TO, 29.8f, 35, -R_LINE_TO, -4.38f, -4.41f, -LINE_TO, 22, 34.03f, -V_LINE_TO, 23, -R_H_LINE_TO, 10.9f, -R_LINE_TO, -3.29f, 3.31f, -LINE_TO, 34, 30.72f, -CLOSE - -CANVAS_DIMENSIONS, 20, -MOVE_TO, 10, 13, -R_V_LINE_TO, -1.5f, -H_LINE_TO, 8, -R_CUBIC_TO, 0.06f, -0.42f, 0, -0.95f, 0, -1.5f, -R_CUBIC_TO, 0, -0.54f, -0.02f, -0.58f, 0, -1, -R_H_LINE_TO, 4, -R_CUBIC_TO, -0.13f, 0.42f, -0.05f, 0.46f, 0, 1, -R_CUBIC_TO, -0.05f, 0.01f, 1.5f, 0, 1.5f, 0, -R_CUBIC_TO, 0.11f, -0.61f, 0, -0.57f, 0, -1, -H_LINE_TO, 16, -R_CUBIC_TO, 0.27f, 0.42f, -0.14f, 0.58f, 0, 1, -R_CUBIC_TO, -0.11f, -0.03f, 2, 0, 2, 0, -R_CUBIC_TO, 0, -4.34f, -3.58f, -8, -8, -8, -R_CUBIC_TO, -4.42f, 0, -8, 3.59f, -8, 8, -R_CUBIC_TO, 0, 4.36f, 3.5f, 8, 8, 8, -R_V_LINE_TO, -2, -R_CUBIC_TO, -0.35f, -0.81f, -0.72f, -1.77f, -1, -3, -R_H_LINE_TO, 1, -CLOSE, -R_MOVE_TO, 2, -5.5f, -H_LINE_TO, 9, -R_CUBIC_TO, 0.32f, -1.26f, 0.84f, -2.47f, 1.5f, -3.5f, -R_CUBIC_TO, 0.65f, 1.03f, 1.16f, 2.24f, 1.5f, 3.5f, -CLOSE, -MOVE_TO, 7.86f, 13, -R_CUBIC_TO, 0.22f, 1.01f, 0.59f, 2.1f, 1.14f, 3, -R_CUBIC_TO, -1.68f, -0.51f, -3.09f, -1.54f, -4, -3, -R_H_LINE_TO, 2.86f, -CLOSE, -MOVE_TO, 4, 11.5f, -R_CUBIC_TO, 0.08f, -0.48f, 0, -0.48f, 0, -1, -CUBIC_TO, 4, 9.98f, 4.08f, 9.48f, 4, 9, -R_H_LINE_TO, 3, -R_CUBIC_TO, -0.07f, 0.5f, -0.11f, 0.99f, 0, 1.5f, -R_CUBIC_TO, -0.11f, 0.51f, -0.07f, 0.51f, 0, 1, -H_LINE_TO, 4, -CLOSE, -R_MOVE_TO, 1, -4, -CUBIC_TO, 5.89f, 6.1f, 7.3f, 4.53f, 9, 4, -R_CUBIC_TO, -0.55f, 0.94f, -0.84f, 2.45f, -1, 3.5f, -H_LINE_TO, 5, -CLOSE, -R_MOVE_TO, 8.5f, 0, -R_CUBIC_TO, -0.16f, -1.05f, -0.94f, -2.56f, -1.5f, -3.5f, -R_CUBIC_TO, 1.7f, 0.53f, 3.11f, 2.11f, 4, 3.5f, -R_H_LINE_TO, -2.5f, -CLOSE, -MOVE_TO, 16, 18, -R_LINE_TO, -2.5f, -2.5f, -R_LINE_TO, -1.5f, 2, -V_LINE_TO, 12, -R_H_LINE_TO, 5.5f, -R_LINE_TO, -2, 1.5f, -LINE_TO, 18, 16, -CLOSE
diff --git a/ash/resources/vector_icons/network_badge_captive_portal.icon b/ash/resources/vector_icons/network_badge_captive_portal.icon deleted file mode 100644 index 2ebf1bf1..0000000 --- a/ash/resources/vector_icons/network_badge_captive_portal.icon +++ /dev/null
@@ -1,43 +0,0 @@ -// Copyright 2016 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -CANVAS_DIMENSIONS, 16, -MOVE_TO, 2, 2, -R_H_LINE_TO, 12, -R_V_LINE_TO, 12, -H_LINE_TO, 2, -V_LINE_TO, 2, -CLOSE, -R_MOVE_TO, 5, 2, -R_H_LINE_TO, 2, -R_V_LINE_TO, 4, -H_LINE_TO, 7, -V_LINE_TO, 4, -CLOSE, -R_MOVE_TO, 0, 6, -R_H_LINE_TO, 2, -R_V_LINE_TO, 2, -H_LINE_TO, 7, -R_V_LINE_TO, -2, -CLOSE - -CANVAS_DIMENSIONS, 8, -MOVE_TO, 1, 1, -R_H_LINE_TO, 7, -R_V_LINE_TO, 7, -H_LINE_TO, 1, -V_LINE_TO, 1, -CLOSE, -R_MOVE_TO, 3, 1, -R_H_LINE_TO, 1, -R_V_LINE_TO, 3, -H_LINE_TO, 4, -V_LINE_TO, 2, -CLOSE, -R_MOVE_TO, 0, 4, -R_H_LINE_TO, 1, -R_V_LINE_TO, 1, -H_LINE_TO, 4, -V_LINE_TO, 6, -CLOSE
diff --git a/ash/shelf/login_shelf_view.cc b/ash/shelf/login_shelf_view.cc index 4a2a3a98..614ed16 100644 --- a/ash/shelf/login_shelf_view.cc +++ b/ash/shelf/login_shelf_view.cc
@@ -304,10 +304,10 @@ SetFocusPainter(nullptr); SetInkDropMode(InkDropMode::ON); SetHasInkDropActionOnClick(true); - AshColorProvider::RippleAttributes ripple_attributes = - AshColorProvider::Get()->GetRippleAttributes(); - SetInkDropBaseColor(ripple_attributes.base_color); - SetInkDropVisibleOpacity(ripple_attributes.inkdrop_opacity); + SetInkDropBaseColor( + DeprecatedGetShelfInkDropBaseColor(kDefaultShelfInkDropColor)); + SetInkDropVisibleOpacity( + DeprecatedGetShelfInkDropOpacity(kDefaultShelfInkDropOpacity)); // Layer rendering is required when the shelf background is visible, which // happens when the wallpaper is not blurred.
diff --git a/ash/style/default_color_constants.h b/ash/style/default_color_constants.h index 1b5e00b..c637e30 100644 --- a/ash/style/default_color_constants.h +++ b/ash/style/default_color_constants.h
@@ -27,4 +27,10 @@ constexpr SkColor kIndicatorColorActive = SK_ColorWHITE; constexpr SkColor kInicatorColorRunning = SkColorSetA(SK_ColorWHITE, 0x7F); +// Colors for back gesture. +constexpr SkColor kArrowColorBeforeActivated = gfx::kGoogleBlue600; +constexpr SkColor kArrowColorAfterActivated = gfx::kGoogleGrey100; +const SkColor kBackgroundColorBeforeActivated = SK_ColorWHITE; +const SkColor kBackgroundColorAfterActivated = gfx::kGoogleBlue600; + #endif // ASH_STYLE_DEFAULT_COLOR_CONSTANTS_H_
diff --git a/ash/system/network/network_info.cc b/ash/system/network/network_info.cc index c6e7350..fe2edea 100644 --- a/ash/system/network/network_info.cc +++ b/ash/system/network/network_info.cc
@@ -24,8 +24,7 @@ tooltip == other.tooltip && image.BackedBySameObjectAs(other.image) && type == other.type && disable == other.disable && connection_state == other.connection_state && source == other.source && - battery_percentage == other.battery_percentage && - captive_portal_provider_name == other.captive_portal_provider_name; + battery_percentage == other.battery_percentage; } } // namespace ash
diff --git a/ash/system/network/network_info.h b/ash/system/network/network_info.h index b6dc4aa..18480a1d 100644 --- a/ash/system/network/network_info.h +++ b/ash/system/network/network_info.h
@@ -41,7 +41,6 @@ chromeos::network_config::mojom::OncSource source; int battery_percentage = 0; int signal_strength = 0; - std::string captive_portal_provider_name; }; } // namespace ash
diff --git a/ash/system/network/network_list_view.cc b/ash/system/network/network_list_view.cc index 59c389a..9c43a46 100644 --- a/ash/system/network/network_list_view.cc +++ b/ash/system/network/network_list_view.cc
@@ -185,11 +185,6 @@ info->signal_strength = chromeos::network_config::GetWirelessSignalStrength(network.get()); - if (network->captive_portal_provider) { - info->captive_portal_provider_name = - network->captive_portal_provider->name; - } - info->type = network->type; info->source = network->source; @@ -393,8 +388,6 @@ kPowerStatusPaddingRight))); } else { icon = CreatePolicyView(info); - if (!icon) - icon = CreateControlledByExtensionView(info); if (icon) view->AddRightView(icon); } @@ -540,21 +533,6 @@ return controlled_icon; } -views::View* NetworkListView::CreateControlledByExtensionView( - const NetworkInfo& info) { - if (info.captive_portal_provider_name.empty()) - return nullptr; - - views::ImageView* controlled_icon = TrayPopupUtils::CreateMainImageView(); - controlled_icon->SetImage( - gfx::CreateVectorIcon(kCaptivePortalIcon, GetIconColor())); - controlled_icon->SetTooltipText(l10n_util::GetStringFUTF16( - IDS_ASH_STATUS_TRAY_EXTENSION_CONTROLLED_WIFI, - base::UTF8ToUTF16(info.captive_portal_provider_name))); - controlled_icon->SetID(VIEW_ID_EXTENSION_CONTROLLED_WIFI); - return controlled_icon; -} - std::unique_ptr<std::set<std::string>> NetworkListView::UpdateNetworkChildren( NetworkType type, int index) {
diff --git a/ash/system/network/network_list_view.h b/ash/system/network/network_list_view.h index 0e48c18..c56e49a 100644 --- a/ash/system/network/network_list_view.h +++ b/ash/system/network/network_list_view.h
@@ -83,11 +83,6 @@ // not managed by policy. views::View* CreatePolicyView(const NetworkInfo& info); - // Creates the view of an extra icon appearing next to the network name - // indicating that the network is controlled by an extension. If no extension - // is registered for this network, returns |nullptr|. - views::View* CreateControlledByExtensionView(const NetworkInfo& info); - // Adds or updates child views representing the network connections when // |is_wifi| is matching the attribute of a network connection starting at // |child_index|. Returns a set of guids for the added network
diff --git a/ash/wm/gestures/back_gesture/back_gesture_affordance.cc b/ash/wm/gestures/back_gesture/back_gesture_affordance.cc index 7db50b18..626854a 100644 --- a/ash/wm/gestures/back_gesture/back_gesture_affordance.cc +++ b/ash/wm/gestures/back_gesture/back_gesture_affordance.cc
@@ -6,6 +6,10 @@ #include "ash/display/screen_orientation_controller.h" #include "ash/public/cpp/shell_window_ids.h" +#include "ash/style/ash_color_provider.h" +#include "ash/style/default_color_constants.h" +#include "ash/style/default_colors.h" +#include "ash/style/scoped_light_mode_as_default.h" #include "ash/window_factory.h" #include "ash/wm/splitview/split_view_controller.h" #include "ash/wm/splitview/split_view_divider.h" @@ -34,15 +38,8 @@ // is outside of the display. constexpr int kDistanceFromArrowToTouchPoint = 64; -// Parameters defining the arrow of the affordance. constexpr int kArrowSize = 20; -constexpr SkColor kArrowColorBeforeActivated = gfx::kGoogleBlue600; -constexpr SkColor kArrowColorAfterActivated = gfx::kGoogleGrey100; - -// Parameters defining the background circle of the affordance. constexpr int kBackgroundRadius = 20; -const SkColor kBackgroundColorBeforeActivated = SK_ColorWHITE; -const SkColor kBackgroundColorAfterActivated = gfx::kGoogleBlue600; // The background shadow for the circle. constexpr int kBackNudgeShadowOffsetY1 = 1; constexpr int kBackNudgeShadowBlurRadius1 = 2; @@ -79,8 +76,6 @@ constexpr base::TimeDelta kCompleteAnimationTimeout = base::TimeDelta::FromMilliseconds(200); -constexpr SkColor kRippleColor = SkColorSetA(gfx::kGoogleBlue600, 0x4C); // 30% - // Y-axis drag distance to achieve full y drag progress. constexpr float kDistanceForFullYProgress = 80.f; @@ -126,7 +121,11 @@ cc::PaintFlags ripple_flags; ripple_flags.setAntiAlias(true); ripple_flags.setStyle(cc::PaintFlags::kFill_Style); - ripple_flags.setColor(kRippleColor); + ScopedLightModeAsDefault scoped_light_mode_as_default; + ripple_flags.setColor(AshColorProvider::GetSecondToneColor( + AshColorProvider::Get()->GetControlsLayerColor( + AshColorProvider::ControlsLayerType:: + kControlBackgroundColorActive))); float ripple_radius = 0.f; if (state_ == BackGestureAffordance::State::COMPLETING) { @@ -162,8 +161,14 @@ gfx::ShadowValue(gfx::Vector2d(0, kBackNudgeShadowOffsetY2), kBackNudgeShadowBlurRadius2, kBackNudgeShadowColor2)); bg_flags.setLooper(gfx::CreateShadowDrawLooper(shadows)); - bg_flags.setColor(is_activated ? kBackgroundColorAfterActivated - : kBackgroundColorBeforeActivated); + bg_flags.setColor(is_activated + ? DeprecatedGetControlsLayerColor( + AshColorProvider::ControlsLayerType:: + kControlBackgroundColorActive, + kBackgroundColorAfterActivated) + : DeprecatedGetBaseLayerColor( + AshColorProvider::BaseLayerType::kTransparent80, + kBackgroundColorBeforeActivated)); canvas->DrawCircle(center_point, kBackgroundRadius, bg_flags); // Draw the arrow. @@ -172,15 +177,23 @@ const bool is_rtl = base::i18n::IsRTL(); if (is_activated) { canvas->DrawImageInt( - gfx::CreateVectorIcon(is_rtl ? vector_icons::kForwardArrowIcon - : vector_icons::kBackArrowIcon, - kArrowSize, kArrowColorAfterActivated), + gfx::CreateVectorIcon( + is_rtl ? vector_icons::kForwardArrowIcon + : vector_icons::kBackArrowIcon, + kArrowSize, + DeprecatedGetContentLayerColor( + AshColorProvider::ContentLayerType::kButtonIconColorPrimary, + kArrowColorAfterActivated)), static_cast<int>(arrow_x), static_cast<int>(arrow_y)); } else { canvas->DrawImageInt( - gfx::CreateVectorIcon(is_rtl ? vector_icons::kForwardArrowIcon - : vector_icons::kBackArrowIcon, - kArrowSize, kArrowColorBeforeActivated), + gfx::CreateVectorIcon( + is_rtl ? vector_icons::kForwardArrowIcon + : vector_icons::kBackArrowIcon, + kArrowSize, + DeprecatedGetContentLayerColor( + AshColorProvider::ContentLayerType::kButtonIconColor, + kArrowColorBeforeActivated)), static_cast<int>(arrow_x), static_cast<int>(arrow_y)); } }
diff --git a/ash/wm/native_cursor_manager_ash.cc b/ash/wm/native_cursor_manager_ash.cc index d13de94d..f437b9c 100644 --- a/ash/wm/native_cursor_manager_ash.cc +++ b/ash/wm/native_cursor_manager_ash.cc
@@ -12,7 +12,7 @@ #include "ui/aura/window_event_dispatcher.h" #include "ui/aura/window_tree_host.h" #include "ui/base/cursor/cursor.h" -#include "ui/base/cursor/image_cursors.h" +#include "ui/base/cursor/cursor_loader.h" #include "ui/base/cursor/mojom/cursor_type.mojom-shared.h" #include "ui/base/layout.h" #include "ui/wm/core/native_cursor_manager_delegate.h" @@ -55,7 +55,9 @@ } // namespace NativeCursorManagerAsh::NativeCursorManagerAsh() - : native_cursor_enabled_(true), image_cursors_(new ui::ImageCursors) {} + : native_cursor_enabled_(true), + cursor_loader_(ui::CursorLoader::Create(/*use_platform_cursors=*/false)) { +} NativeCursorManagerAsh::~NativeCursorManagerAsh() = default; @@ -67,11 +69,11 @@ } float NativeCursorManagerAsh::GetScale() const { - return image_cursors_->GetScale(); + return cursor_loader_->scale(); } display::Display::Rotation NativeCursorManagerAsh::GetRotation() const { - return image_cursors_->GetRotation(); + return cursor_loader_->rotation(); } void NativeCursorManagerAsh::SetDisplay( @@ -84,7 +86,7 @@ const float cursor_scale = ui::GetScaleForScaleFactor(ui::GetSupportedScaleFactor(original_scale)); - if (image_cursors_->SetDisplay(display, cursor_scale)) + if (cursor_loader_->SetDisplayData(display.panel_rotation(), cursor_scale)) SetCursor(delegate->GetCursor(), delegate); Shell::Get() @@ -97,13 +99,13 @@ gfx::NativeCursor cursor, ::wm::NativeCursorManagerDelegate* delegate) { if (native_cursor_enabled_) { - image_cursors_->SetPlatformCursor(&cursor); + cursor_loader_->SetPlatformCursor(&cursor); } else { gfx::NativeCursor invisible_cursor(ui::mojom::CursorType::kNone); - image_cursors_->SetPlatformCursor(&invisible_cursor); + cursor_loader_->SetPlatformCursor(&invisible_cursor); cursor.SetPlatformCursor(invisible_cursor.platform()); } - cursor.set_image_scale_factor(image_cursors_->GetScale()); + cursor.set_image_scale_factor(cursor_loader_->scale()); delegate->CommitCursor(cursor); @@ -114,7 +116,7 @@ void NativeCursorManagerAsh::SetCursorSize( ui::CursorSize cursor_size, ::wm::NativeCursorManagerDelegate* delegate) { - image_cursors_->SetCursorSize(cursor_size); + cursor_loader_->set_size(cursor_size); delegate->CommitCursorSize(cursor_size); // Sets the cursor to reflect the scale change immediately. @@ -136,7 +138,7 @@ SetCursor(delegate->GetCursor(), delegate); } else { gfx::NativeCursor invisible_cursor(ui::mojom::CursorType::kNone); - image_cursors_->SetPlatformCursor(&invisible_cursor); + cursor_loader_->SetPlatformCursor(&invisible_cursor); SetCursorOnAllRootWindows(invisible_cursor); }
diff --git a/ash/wm/native_cursor_manager_ash.h b/ash/wm/native_cursor_manager_ash.h index 1df0f7b..fe1450e 100644 --- a/ash/wm/native_cursor_manager_ash.h +++ b/ash/wm/native_cursor_manager_ash.h
@@ -11,7 +11,7 @@ #include "ui/wm/core/native_cursor_manager.h" namespace ui { -class ImageCursors; +class CursorLoader; } namespace ash { @@ -56,7 +56,7 @@ bool native_cursor_enabled_; - std::unique_ptr<ui::ImageCursors> image_cursors_; + std::unique_ptr<ui::CursorLoader> cursor_loader_; DISALLOW_COPY_AND_ASSIGN(NativeCursorManagerAsh); };
diff --git a/base/allocator/allocator.gni b/base/allocator/allocator.gni index 9d91b17..c8964b0 100644 --- a/base/allocator/allocator.gni +++ b/base/allocator/allocator.gni
@@ -5,16 +5,6 @@ import("//build/config/chromecast_build.gni") import("//build/config/sanitizers/sanitizers.gni") -# Temporarily disable tcmalloc on arm64 linux to get rid of compilation errors. -if (is_android || is_apple || is_asan || is_lsan || is_tsan || is_msan || - is_win || is_fuchsia || - ((is_linux || is_chromeos) && target_cpu == "arm64") || - (is_cast_audio_only && target_cpu == "arm")) { - _default_allocator = "none" -} else { - _default_allocator = "tcmalloc" -} - # The debug CRT on Windows has some debug features that are incompatible with # the shim. NaCl in particular does seem to link some binaries statically # against the debug CRT with "is_nacl=false". @@ -26,7 +16,20 @@ _default_use_allocator_shim = false } +# Temporarily disable tcmalloc on arm64 linux to get rid of compilation errors. +if (is_android || is_apple || is_asan || is_lsan || is_tsan || is_msan || + is_win || is_fuchsia || + ((is_linux || is_chromeos) && target_cpu == "arm64") || + (is_cast_audio_only && target_cpu == "arm")) { + _default_allocator = "none" +} else { + _default_allocator = "tcmalloc" +} + declare_args() { + # Don't ship this configuration, not ready yet. + assert(_default_allocator != "partition") + # Memory allocator to use. Set to "none" to use default allocator. use_allocator = _default_allocator @@ -57,9 +60,6 @@ assert(use_allocator == "none" || use_allocator == "tcmalloc" || use_allocator == "partition") -# Don't ship this configuration, not ready yet. -assert(!(use_allocator == "partition" && is_official_build)) - assert(!is_win || use_allocator != "tcmalloc", "Tcmalloc doesn't work on Windows.") assert(!is_mac || use_allocator != "tcmalloc",
diff --git a/build/fuchsia/net_test_server.py b/build/fuchsia/net_test_server.py index 60ad78f6..56005cf 100644 --- a/build/fuchsia/net_test_server.py +++ b/build/fuchsia/net_test_server.py
@@ -56,7 +56,7 @@ raise Exception('Unmap called for unknown port: %d' % device_port) -def SetupTestServer(target, test_concurrency, for_package): +def SetupTestServer(target, test_concurrency, for_package, for_realms=[]): """Provisions a forwarding test server and configures |target| to use it. Returns a Popen object for the test server process.""" @@ -82,7 +82,9 @@ })) config_file.flush() - target.PutFile(config_file.name, '/tmp/net-test-server-config', - for_package=for_package) + target.PutFile(config_file.name, + '/tmp/net-test-server-config', + for_package=for_package, + for_realms=for_realms) return spawning_server
diff --git a/build/fuchsia/run_package.py b/build/fuchsia/run_package.py deleted file mode 100644 index 2070f2c..0000000 --- a/build/fuchsia/run_package.py +++ /dev/null
@@ -1,251 +0,0 @@ -# Copyright 2018 The Chromium Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. -"""Contains a helper function for deploying and executing a packaged -executable on a Target.""" - -from __future__ import print_function - -import common -import hashlib -import logging -import multiprocessing -import os -import re -import select -import subprocess -import sys -import threading -import uuid - -from symbolizer import BuildIdsPaths, RunSymbolizer, SymbolizerFilter - -FAR = common.GetHostToolPathFromPlatform('far') - -# Amount of time to wait for the termination of the system log output thread. -_JOIN_TIMEOUT_SECS = 5 - - -def _AttachKernelLogReader(target): - """Attaches a kernel log reader as a long-running SSH task.""" - - logging.info('Attaching kernel logger.') - return target.RunCommandPiped(['dlog', '-f'], - stdin=open(os.devnull, 'r'), - stdout=subprocess.PIPE, - stderr=subprocess.STDOUT) - - -class SystemLogReader(object): - """Collects and symbolizes Fuchsia system log to a file.""" - - def __init__(self): - self._listener_proc = None - self._symbolizer_proc = None - self._system_log = None - - def __enter__(self): - return self - - def __exit__(self, exc_type, exc_val, exc_tb): - """Stops the system logging processes and closes the output file.""" - if self._symbolizer_proc: - self._symbolizer_proc.kill() - if self._listener_proc: - self._listener_proc.kill() - if self._system_log: - self._system_log.close() - - def Start(self, target, package_paths, system_log_file): - """Start a system log reader as a long-running SSH task.""" - logging.debug('Writing fuchsia system log to %s' % system_log_file) - - self._listener_proc = target.RunCommandPiped(['log_listener'], - stdout=subprocess.PIPE, - stderr=subprocess.STDOUT) - - self._system_log = open(system_log_file, 'w', buffering=1) - self._symbolizer_proc = RunSymbolizer(self._listener_proc.stdout, - self._system_log, - BuildIdsPaths(package_paths)) - - -class MergedInputStream(object): - """Merges a number of input streams into a UNIX pipe on a dedicated thread. - Terminates when the file descriptor of the primary stream (the first in - the sequence) is closed.""" - - def __init__(self, streams): - assert len(streams) > 0 - self._streams = streams - self._output_stream = None - self._thread = None - - def Start(self): - """Returns a pipe to the merged output stream.""" - - read_pipe, write_pipe = os.pipe() - - # Disable buffering for the stream to make sure there is no delay in logs. - self._output_stream = os.fdopen(write_pipe, 'w', 0) - self._thread = threading.Thread(target=self._Run) - self._thread.start() - - return os.fdopen(read_pipe, 'r') - - def _Run(self): - streams_by_fd = {} - primary_fd = self._streams[0].fileno() - for s in self._streams: - streams_by_fd[s.fileno()] = s - - # Set when the primary FD is closed. Input from other FDs will continue to - # be processed until select() runs dry. - flush = False - - # The lifetime of the MergedInputStream is bound to the lifetime of - # |primary_fd|. - while primary_fd: - # When not flushing: block until data is read or an exception occurs. - rlist, _, xlist = select.select(streams_by_fd, [], streams_by_fd) - - if len(rlist) == 0 and flush: - break - - for fileno in xlist: - del streams_by_fd[fileno] - if fileno == primary_fd: - primary_fd = None - - for fileno in rlist: - line = streams_by_fd[fileno].readline() - if line: - self._output_stream.write(line + '\n') - else: - del streams_by_fd[fileno] - if fileno == primary_fd: - primary_fd = None - - # Flush the streams by executing nonblocking reads from the input file - # descriptors until no more data is available, or all the streams are - # closed. - while streams_by_fd: - rlist, _, _ = select.select(streams_by_fd, [], [], 0) - - if not rlist: - break - - for fileno in rlist: - line = streams_by_fd[fileno].readline() - if line: - self._output_stream.write(line + '\n') - else: - del streams_by_fd[fileno] - - -def _GetComponentUri(package_name): - return 'fuchsia-pkg://fuchsia.com/%s#meta/%s.cmx' % (package_name, - package_name) - - -class RunPackageArgs: - """RunPackage() configuration arguments structure. - - symbolizer_config: A newline delimited list of source files contained - in the package. Omitting this parameter will disable symbolization. - system_logging: If set, connects a system log reader to the target. - """ - - def __init__(self): - self.symbolizer_config = None - self.system_logging = False - - @staticmethod - def FromCommonArgs(args): - run_package_args = RunPackageArgs() - run_package_args.system_logging = args.include_system_logs - return run_package_args - - -def _DrainStreamToStdout(stream, quit_event): - """Outputs the contents of |stream| until |quit_event| is set.""" - - while not quit_event.is_set(): - rlist, _, _ = select.select([stream], [], [], 0.1) - if rlist: - line = rlist[0].readline() - if not line: - return - print(line.rstrip()) - - -def RunPackage(output_dir, target, package_paths, package_name, package_args, - args): - """Installs the Fuchsia package at |package_path| on the target, - executes it with |package_args|, and symbolizes its output. - - output_dir: The path containing the build output files. - target: The deployment Target object that will run the package. - package_paths: The paths to the .far packages to be installed. - package_name: The name of the primary package to run. - package_args: The arguments which will be passed to the Fuchsia process. - args: Structure of arguments to configure how the package will be run. - - Returns the exit code of the remote package process.""" - - system_logger = (_AttachKernelLogReader(target) - if args.system_logging else None) - try: - if system_logger: - # Spin up a thread to asynchronously dump the system log to stdout - # for easier diagnoses of early, pre-execution failures. - log_output_quit_event = multiprocessing.Event() - log_output_thread = threading.Thread(target=lambda: _DrainStreamToStdout( - system_logger.stdout, log_output_quit_event)) - log_output_thread.daemon = True - log_output_thread.start() - - with target.GetAmberRepo(): - target.InstallPackage(package_paths) - - if system_logger: - log_output_quit_event.set() - log_output_thread.join(timeout=_JOIN_TIMEOUT_SECS) - - logging.info('Running application.') - command = ['run', _GetComponentUri(package_name)] + package_args - process = target.RunCommandPiped(command, - stdin=open(os.devnull, 'r'), - stdout=subprocess.PIPE, - stderr=subprocess.STDOUT) - - if system_logger: - output_stream = MergedInputStream( - [process.stdout, system_logger.stdout]).Start() - else: - output_stream = process.stdout - - # Run the log data through the symbolizer process. - output_stream = SymbolizerFilter(output_stream, - BuildIdsPaths(package_paths)) - - for next_line in output_stream: - print(next_line.rstrip()) - - process.wait() - if process.returncode == 0: - logging.info('Process exited normally with status code 0.') - else: - # The test runner returns an error status code if *any* tests fail, - # so we should proceed anyway. - logging.warning('Process exited with status code %d.' % - process.returncode) - - finally: - if system_logger: - logging.info('Terminating kernel log reader.') - log_output_quit_event.set() - log_output_thread.join() - system_logger.kill() - - return process.returncode
diff --git a/build/fuchsia/run_test_package.py b/build/fuchsia/run_test_package.py new file mode 100644 index 0000000..e78f6f2 --- /dev/null +++ b/build/fuchsia/run_test_package.py
@@ -0,0 +1,262 @@ +# Copyright 2018 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. +"""Contains a helper function for deploying and executing a packaged +executable on a Target.""" + +from __future__ import print_function + +import common +import hashlib +import logging +import multiprocessing +import os +import re +import select +import subprocess +import sys +import threading +import uuid + +from symbolizer import BuildIdsPaths, RunSymbolizer, SymbolizerFilter + +FAR = common.GetHostToolPathFromPlatform('far') + +# Amount of time to wait for the termination of the system log output thread. +_JOIN_TIMEOUT_SECS = 5 + + +def _AttachKernelLogReader(target): + """Attaches a kernel log reader as a long-running SSH task.""" + + logging.info('Attaching kernel logger.') + return target.RunCommandPiped(['dlog', '-f'], + stdin=open(os.devnull, 'r'), + stdout=subprocess.PIPE, + stderr=subprocess.STDOUT) + + +class SystemLogReader(object): + """Collects and symbolizes Fuchsia system log to a file.""" + + def __init__(self): + self._listener_proc = None + self._symbolizer_proc = None + self._system_log = None + + def __enter__(self): + return self + + def __exit__(self, exc_type, exc_val, exc_tb): + """Stops the system logging processes and closes the output file.""" + if self._symbolizer_proc: + self._symbolizer_proc.kill() + if self._listener_proc: + self._listener_proc.kill() + if self._system_log: + self._system_log.close() + + def Start(self, target, package_paths, system_log_file): + """Start a system log reader as a long-running SSH task.""" + logging.debug('Writing fuchsia system log to %s' % system_log_file) + + self._listener_proc = target.RunCommandPiped(['log_listener'], + stdout=subprocess.PIPE, + stderr=subprocess.STDOUT) + + self._system_log = open(system_log_file, 'w', buffering=1) + self._symbolizer_proc = RunSymbolizer(self._listener_proc.stdout, + self._system_log, + BuildIdsPaths(package_paths)) + + +class MergedInputStream(object): + """Merges a number of input streams into a UNIX pipe on a dedicated thread. + Terminates when the file descriptor of the primary stream (the first in + the sequence) is closed.""" + + def __init__(self, streams): + assert len(streams) > 0 + self._streams = streams + self._output_stream = None + self._thread = None + + def Start(self): + """Returns a pipe to the merged output stream.""" + + read_pipe, write_pipe = os.pipe() + + # Disable buffering for the stream to make sure there is no delay in logs. + self._output_stream = os.fdopen(write_pipe, 'w', 0) + self._thread = threading.Thread(target=self._Run) + self._thread.start() + + return os.fdopen(read_pipe, 'r') + + def _Run(self): + streams_by_fd = {} + primary_fd = self._streams[0].fileno() + for s in self._streams: + streams_by_fd[s.fileno()] = s + + # Set when the primary FD is closed. Input from other FDs will continue to + # be processed until select() runs dry. + flush = False + + # The lifetime of the MergedInputStream is bound to the lifetime of + # |primary_fd|. + while primary_fd: + # When not flushing: block until data is read or an exception occurs. + rlist, _, xlist = select.select(streams_by_fd, [], streams_by_fd) + + if len(rlist) == 0 and flush: + break + + for fileno in xlist: + del streams_by_fd[fileno] + if fileno == primary_fd: + primary_fd = None + + for fileno in rlist: + line = streams_by_fd[fileno].readline() + if line: + self._output_stream.write(line + '\n') + else: + del streams_by_fd[fileno] + if fileno == primary_fd: + primary_fd = None + + # Flush the streams by executing nonblocking reads from the input file + # descriptors until no more data is available, or all the streams are + # closed. + while streams_by_fd: + rlist, _, _ = select.select(streams_by_fd, [], [], 0) + + if not rlist: + break + + for fileno in rlist: + line = streams_by_fd[fileno].readline() + if line: + self._output_stream.write(line + '\n') + else: + del streams_by_fd[fileno] + + +def _GetComponentUri(package_name): + return 'fuchsia-pkg://fuchsia.com/%s#meta/%s.cmx' % (package_name, + package_name) + + +class RunTestPackageArgs: + """RunTestPackage() configuration arguments structure. + + system_logging: If set, connects a system log reader to the target. + test_realm_label: Specifies the realm name that run-test-component should use. + This must be specified if a filter file is to be set, or a results summary + file fetched after the test suite has run. + use_run_test_component: If True then the test package will be run hermetically + via 'run-test-component', rather than using 'run'. + """ + + def __init__(self): + self.system_logging = False + self.test_realm_label = None + self.use_run_test_component = False + + @staticmethod + def FromCommonArgs(args): + run_test_package_args = RunTestPackageArgs() + run_test_package_args.system_logging = args.include_system_logs + return run_test_package_args + + +def _DrainStreamToStdout(stream, quit_event): + """Outputs the contents of |stream| until |quit_event| is set.""" + + while not quit_event.is_set(): + rlist, _, _ = select.select([stream], [], [], 0.1) + if rlist: + line = rlist[0].readline() + if not line: + return + print(line.rstrip()) + + +def RunTestPackage(output_dir, target, package_paths, package_name, + package_args, args): + """Installs the Fuchsia package at |package_path| on the target, + executes it with |package_args|, and symbolizes its output. + + output_dir: The path containing the build output files. + target: The deployment Target object that will run the package. + package_paths: The paths to the .far packages to be installed. + package_name: The name of the primary package to run. + package_args: The arguments which will be passed to the Fuchsia process. + args: RunTestPackageArgs instance configuring how the package will be run. + + Returns the exit code of the remote package process.""" + + system_logger = (_AttachKernelLogReader(target) + if args.system_logging else None) + try: + if system_logger: + # Spin up a thread to asynchronously dump the system log to stdout + # for easier diagnoses of early, pre-execution failures. + log_output_quit_event = multiprocessing.Event() + log_output_thread = threading.Thread(target=lambda: _DrainStreamToStdout( + system_logger.stdout, log_output_quit_event)) + log_output_thread.daemon = True + log_output_thread.start() + + with target.GetAmberRepo(): + target.InstallPackage(package_paths) + + if system_logger: + log_output_quit_event.set() + log_output_thread.join(timeout=_JOIN_TIMEOUT_SECS) + + logging.info('Running application.') + if args.use_run_test_component: + command = ['run-test-component'] + if args.test_realm_label: + command += ['--realm-label=%s' % args.test_realm_label] + else: + command = ['run'] + command += [_GetComponentUri(package_name)] + package_args + + process = target.RunCommandPiped(command, + stdin=open(os.devnull, 'r'), + stdout=subprocess.PIPE, + stderr=subprocess.STDOUT) + + if system_logger: + output_stream = MergedInputStream( + [process.stdout, system_logger.stdout]).Start() + else: + output_stream = process.stdout + + # Run the log data through the symbolizer process. + output_stream = SymbolizerFilter(output_stream, + BuildIdsPaths(package_paths)) + + for next_line in output_stream: + print(next_line.rstrip()) + + process.wait() + if process.returncode == 0: + logging.info('Process exited normally with status code 0.') + else: + # The test runner returns an error status code if *any* tests fail, + # so we should proceed anyway. + logging.warning('Process exited with status code %d.' % + process.returncode) + + finally: + if system_logger: + logging.info('Terminating kernel log reader.') + log_output_quit_event.set() + log_output_thread.join() + system_logger.kill() + + return process.returncode
diff --git a/build/fuchsia/target.py b/build/fuchsia/target.py index c2a21e2..6dfcc7e 100644 --- a/build/fuchsia/target.py +++ b/build/fuchsia/target.py
@@ -36,12 +36,13 @@ class _MapIsolatedPathsForPackage: - """Callable object which remaps /data and /tmp paths to their package-specific - locations.""" + """Callable object which remaps /data and /tmp paths to their component- + specific locations, based on the package name and test realm path.""" - def __init__(self, package_name, package_version): - package_sub_path = 'r/sys/fuchsia.com:{0}:{1}#meta:{0}.cmx/'.format( - package_name, package_version) + def __init__(self, package_name, package_version, realms): + realms_path_fragment = '/r/'.join(['r/sys'] + realms) + package_sub_path = '{2}/fuchsia.com:{0}:{1}#meta:{0}.cmx/'.format( + package_name, package_version, realms_path_fragment) self.isolated_format = '{0}' + package_sub_path + '{1}' def __call__(self, path): @@ -142,14 +143,21 @@ return self.GetCommandRunner().RunCommand(command, silent, timeout_secs=timeout_secs) - def EnsureIsolatedPathsExist(self, for_package): + def EnsureIsolatedPathsExist(self, for_package, for_realms): """Ensures that the package's isolated /data and /tmp exist.""" for isolated_directory in ['/data', '/tmp']: - self.RunCommand( - ['mkdir','-p', - _MapIsolatedPathsForPackage(for_package, 0)(isolated_directory)]) + self.RunCommand([ + 'mkdir', '-p', + _MapIsolatedPathsForPackage(for_package, 0, + for_realms)(isolated_directory) + ]) - def PutFile(self, source, dest, recursive=False, for_package=None): + def PutFile(self, + source, + dest, + recursive=False, + for_package=None, + for_realms=[]): """Copies a file from the local filesystem to the target filesystem. source: The path of the file being copied. @@ -158,12 +166,19 @@ for_package: If specified, isolated paths in the |dest| are mapped to their obsolute paths for the package, on the target. This currently affects the /data and /tmp directories. + for_realms: If specified, identifies the sub-realm of 'sys' under which + isolated paths (see |for_package|) are stored. """ assert type(source) is str - self.PutFiles([source], dest, recursive, for_package) + self.PutFiles([source], dest, recursive, for_package, for_realms) - def PutFiles(self, sources, dest, recursive=False, for_package=None): + def PutFiles(self, + sources, + dest, + recursive=False, + for_package=None, + for_realms=[]): """Copies files from the local filesystem to the target filesystem. sources: List of local file paths to copy from, or a single path. @@ -171,39 +186,46 @@ recursive: If true, performs a recursive copy. for_package: If specified, /data in the |dest| is mapped to the package's isolated /data location. + for_realms: If specified, identifies the sub-realm of 'sys' under which + isolated paths (see |for_package|) are stored. """ assert type(sources) is tuple or type(sources) is list if for_package: - self.EnsureIsolatedPathsExist(for_package) - dest = _MapIsolatedPathsForPackage(for_package, 0)(dest) + self.EnsureIsolatedPathsExist(for_package, for_realms) + dest = _MapIsolatedPathsForPackage(for_package, 0, for_realms)(dest) logging.debug('copy local:%s => remote:%s' % (sources, dest)) self.GetCommandRunner().RunScp(sources, dest, remote_cmd.COPY_TO_TARGET, recursive) - def GetFile(self, source, dest, for_package=None): + def GetFile(self, source, dest, for_package=None, for_realms=[]): """Copies a file from the target filesystem to the local filesystem. source: The path of the file being copied. dest: The path on the local filesystem which will be copied to. for_package: If specified, /data in paths in |sources| is mapped to the package's isolated /data location. + for_realms: If specified, identifies the sub-realm of 'sys' under which + isolated paths (see |for_package|) are stored. """ assert type(source) is str - self.GetFiles([source], dest, for_package) + self.GetFiles([source], dest, for_package, for_realms) - def GetFiles(self, sources, dest, for_package=None): + def GetFiles(self, sources, dest, for_package=None, for_realms=[]): """Copies files from the target filesystem to the local filesystem. sources: List of remote file paths to copy. dest: The path on the local filesystem which will be copied to. for_package: If specified, /data in paths in |sources| is mapped to the package's isolated /data location. + for_realms: If specified, identifies the sub-realm of 'sys' under which + isolated paths (see |for_package|) are stored. """ assert type(sources) is tuple or type(sources) is list self._AssertIsStarted() if for_package: - sources = map(_MapIsolatedPathsForPackage(for_package, 0), sources) + sources = map(_MapIsolatedPathsForPackage(for_package, 0, for_realms), + sources) logging.debug('copy remote:%s => local:%s' % (sources, dest)) return self.GetCommandRunner().RunScp(sources, dest, remote_cmd.COPY_FROM_TARGET)
diff --git a/build/fuchsia/test_runner.py b/build/fuchsia/test_runner.py index b47483d..34c4b6f 100755 --- a/build/fuchsia/test_runner.py +++ b/build/fuchsia/test_runner.py
@@ -13,7 +13,7 @@ from common_args import AddCommonArgs, ConfigureLogging, GetDeploymentTargetForArgs from net_test_server import SetupTestServer -from run_package import RunPackage, RunPackageArgs, SystemLogReader +from run_test_package import RunTestPackage, RunTestPackageArgs, SystemLogReader from runner_exceptions import HandleExceptionAndReturnExitCode from runner_logs import RunnerLogManager from symbolizer import BuildIdsPaths @@ -24,6 +24,9 @@ TEST_PERF_RESULT_PATH = '/data/test_perf_summary.json' TEST_FILTER_PATH = '/data/test_filter.txt' +TEST_REALM_NAME = 'chromium_tests' + + def main(): parser = argparse.ArgumentParser() AddCommonArgs(parser) @@ -84,6 +87,11 @@ help='If present, store test results on this path.') parser.add_argument('--isolated-script-test-perf-output', help='If present, store chartjson results on this path.') + parser.add_argument('--use-run-test-component', + default=False, + action='store_true', + help='Run the test package hermetically using ' + 'run-test-component, rather than run.') args = parser.parse_args() # Flag out_dir is required for tests launched with this script. @@ -146,6 +154,10 @@ if args.child_args: child_args.extend(args.child_args) + test_realms = [] + if args.use_run_test_component: + test_realms = [TEST_REALM_NAME] + try: with GetDeploymentTargetForArgs() as target, \ SystemLogReader() as system_logger, \ @@ -156,36 +168,46 @@ system_logger.Start(target, args.package, args.system_log_file) if args.test_launcher_filter_file: - target.PutFile(args.test_launcher_filter_file, TEST_FILTER_PATH, - for_package=args.package_name) + target.PutFile(args.test_launcher_filter_file, + TEST_FILTER_PATH, + for_package=args.package_name, + for_realms=test_realms) child_args.append('--test-launcher-filter-file=' + TEST_FILTER_PATH) test_server = None if args.enable_test_server: assert test_concurrency test_server = SetupTestServer(target, test_concurrency, - args.package_name) + args.package_name, test_realms) - run_package_args = RunPackageArgs.FromCommonArgs(args) - returncode = RunPackage(args.out_dir, target, args.package, - args.package_name, child_args, run_package_args) + run_package_args = RunTestPackageArgs.FromCommonArgs(args) + if args.use_run_test_component: + run_package_args.test_realm_label = TEST_REALM_NAME + run_package_args.use_run_test_component = True + returncode = RunTestPackage(args.out_dir, target, args.package, + args.package_name, child_args, + run_package_args) if test_server: test_server.Stop() if args.test_launcher_summary_output: - target.GetFile(TEST_RESULT_PATH, args.test_launcher_summary_output, - for_package=args.package_name) + target.GetFile(TEST_RESULT_PATH, + args.test_launcher_summary_output, + for_package=args.package_name, + for_realms=test_realms) if args.isolated_script_test_output: target.GetFile(TEST_RESULT_PATH, args.isolated_script_test_output, - for_package=args.package_name) + for_package=args.package_name, + for_realms=test_realms) if args.isolated_script_test_perf_output: target.GetFile(TEST_PERF_RESULT_PATH, args.isolated_script_test_perf_output, - for_package=args.package_name) + for_package=args.package_name, + for_realms=test_realms) return returncode
diff --git a/cc/BUILD.gn b/cc/BUILD.gn index 2cd18df..5218d41 100644 --- a/cc/BUILD.gn +++ b/cc/BUILD.gn
@@ -29,6 +29,7 @@ "benchmarks/unittest_only_benchmark.h", "benchmarks/unittest_only_benchmark_impl.cc", "benchmarks/unittest_only_benchmark_impl.h", + "input/actively_scrolling_type.h", "input/browser_controls_offset_manager.cc", "input/browser_controls_offset_manager.h", "input/browser_controls_offset_manager_client.h",
diff --git a/cc/base/features.cc b/cc/base/features.cc index ed6f2f6..b1823b2 100644 --- a/cc/base/features.cc +++ b/cc/base/features.cc
@@ -55,4 +55,7 @@ const base::Feature kScrollUnification{"ScrollUnification", base::FEATURE_DISABLED_BY_DEFAULT}; +const base::Feature kSchedulerSmoothnessForAnimatedScrolls{ + "SmoothnessModeForAnimatedScrolls", base::FEATURE_DISABLED_BY_DEFAULT}; + } // namespace features
diff --git a/cc/base/features.h b/cc/base/features.h index f4ba786..85b2e1b 100644 --- a/cc/base/features.h +++ b/cc/base/features.h
@@ -30,6 +30,12 @@ // https://docs.google.com/document/d/1smLAXs-DSLLmkEt4FIPP7PVglJXOcwRc7A5G0SEwxaY/edit CC_BASE_EXPORT extern const base::Feature kScrollUnification; +// When enabled, wheel scrolls trigger smoothness mode. When disabled, +// smoothness mode is limited to non-animated (precision) scrolls, such as +// touch scrolling. +CC_BASE_EXPORT extern const base::Feature + kSchedulerSmoothnessForAnimatedScrolls; + } // namespace features #endif // CC_BASE_FEATURES_H_
diff --git a/cc/input/actively_scrolling_type.h b/cc/input/actively_scrolling_type.h new file mode 100644 index 0000000..f2d49a0 --- /dev/null +++ b/cc/input/actively_scrolling_type.h
@@ -0,0 +1,18 @@ +// Copyright 2020 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CC_INPUT_ACTIVELY_SCROLLING_TYPE_H_ +#define CC_INPUT_ACTIVELY_SCROLLING_TYPE_H_ + +namespace cc { + +enum class ActivelyScrollingType { + kNone, + kPrecise, + kAnimated, +}; + +} // namespace cc + +#endif // CC_INPUT_ACTIVELY_SCROLLING_TYPE_H_
diff --git a/cc/input/compositor_input_interfaces.h b/cc/input/compositor_input_interfaces.h index 35c7bce2..b20b270 100644 --- a/cc/input/compositor_input_interfaces.h +++ b/cc/input/compositor_input_interfaces.h
@@ -8,6 +8,7 @@ #include <memory> #include "base/time/time.h" +#include "cc/input/actively_scrolling_type.h" #include "cc/paint/element_id.h" namespace viz { @@ -70,18 +71,14 @@ // finger from the touchscreen but we're scroll snapping). virtual bool IsCurrentlyScrolling() const = 0; - // Returns true if there is an active scroll in progress. "Active" here - // means that it's been latched (i.e. we have a CurrentlyScrollingNode()) but - // also that some ScrollUpdates have been received and their delta consumed - // for scrolling. These can differ significantly e.g. the page allows the - // touchstart but preventDefaults all the touchmoves. In that case, we latch - // and have a CurrentlyScrollingNode() but will never receive a ScrollUpdate. - // - // "Precision" means it's a non-animated scroll like a touchscreen or - // high-precision touchpad. The latter distinction is important for things - // like scheduling decisions which might schedule a wheel and a touch - // scrolling differently due to user perception. - virtual bool IsActivelyPrecisionScrolling() const = 0; + // Indicates the type (Animated or Precise) of an active scroll, if there is + // one, in progress. "Active" here means that it's been latched (i.e. we have + // a CurrentlyScrollingNode()) but also that some ScrollUpdates have been + // received and their delta consumed for scrolling. These can differ + // significantly e.g. the page allows the touchstart but preventDefaults all + // the touchmoves. In that case, we latch and have a CurrentlyScrollingNode() + // but will never receive a ScrollUpdate. + virtual ActivelyScrollingType GetActivelyScrollingType() const = 0; }; // This is the interface that's exposed by the LayerTreeHostImpl to the input
diff --git a/cc/input/threaded_input_handler.cc b/cc/input/threaded_input_handler.cc index 7f37693..761fd49 100644 --- a/cc/input/threaded_input_handler.cc +++ b/cc/input/threaded_input_handler.cc
@@ -1070,17 +1070,23 @@ return CurrentlyScrollingNode(); } -bool ThreadedInputHandler::IsActivelyPrecisionScrolling() const { +ActivelyScrollingType ThreadedInputHandler::GetActivelyScrollingType() const { if (!CurrentlyScrollingNode()) - return false; + return ActivelyScrollingType::kNone; if (!last_scroll_update_state_) - return false; + return ActivelyScrollingType::kNone; bool did_scroll_content = did_scroll_x_for_scroll_gesture_ || did_scroll_y_for_scroll_gesture_; - return !ShouldAnimateScroll(last_scroll_update_state_.value()) && - did_scroll_content; + + if (!did_scroll_content) + return ActivelyScrollingType::kNone; + + if (ShouldAnimateScroll(last_scroll_update_state_.value())) + return ActivelyScrollingType::kAnimated; + + return ActivelyScrollingType::kPrecise; } ScrollNode* ThreadedInputHandler::CurrentlyScrollingNode() {
diff --git a/cc/input/threaded_input_handler.h b/cc/input/threaded_input_handler.h index 1c88b095..e4f7bd3 100644 --- a/cc/input/threaded_input_handler.h +++ b/cc/input/threaded_input_handler.h
@@ -117,7 +117,7 @@ ScrollbarOrientation orientation) override; void ScrollOffsetAnimationFinished() override; bool IsCurrentlyScrolling() const override; - bool IsActivelyPrecisionScrolling() const override; + ActivelyScrollingType GetActivelyScrollingType() const override; // =========== Public Interface
diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc index 4cffa16..7218773 100644 --- a/cc/trees/layer_tree_host_impl.cc +++ b/cc/trees/layer_tree_host_impl.cc
@@ -2145,8 +2145,11 @@ } if (GetDrawMode() == DRAW_MODE_RESOURCELESS_SOFTWARE) { + // TODO(savella) : Change to check for ActivelyScrollingType::kNone + const bool actively_scrolling = + GetActivelyScrollingType() == ActivelyScrollingType::kPrecise; metadata.is_resourceless_software_draw_with_scroll_or_animation = - IsActivelyPrecisionScrolling() || mutator_host_->NeedsTickAnimations(); + actively_scrolling || mutator_host_->NeedsTickAnimations(); } const base::flat_set<viz::SurfaceRange>& referenced_surfaces = @@ -2998,10 +3001,10 @@ return GetInputHandler().pinch_gesture_active(); } -bool LayerTreeHostImpl::IsActivelyPrecisionScrolling() const { +ActivelyScrollingType LayerTreeHostImpl::GetActivelyScrollingType() const { if (!input_delegate_) - return false; - return input_delegate_->IsActivelyPrecisionScrolling(); + return ActivelyScrollingType::kNone; + return input_delegate_->GetActivelyScrollingType(); } bool LayerTreeHostImpl::ScrollAffectsScrollHandler() const {
diff --git a/cc/trees/layer_tree_host_impl.h b/cc/trees/layer_tree_host_impl.h index e8c2983..95161be 100644 --- a/cc/trees/layer_tree_host_impl.h +++ b/cc/trees/layer_tree_host_impl.h
@@ -25,6 +25,7 @@ #include "cc/base/synced_property.h" #include "cc/benchmarks/micro_benchmark_controller_impl.h" #include "cc/cc_export.h" +#include "cc/input/actively_scrolling_type.h" #include "cc/input/browser_controls_offset_manager_client.h" #include "cc/input/input_handler.h" #include "cc/input/scrollbar_animation_controller.h" @@ -84,6 +85,7 @@ namespace cc { +enum class ActivelyScrollingType; class BrowserControlsOffsetManager; class CompositorFrameReportingController; class DebugRectHistory; @@ -612,7 +614,7 @@ // LayerTreeHostImpl's interface. bool IsPinchGestureActive() const; // See comment in equivalent ThreadedInputHandler method for what this means. - bool IsActivelyPrecisionScrolling() const; + ActivelyScrollingType GetActivelyScrollingType() const; bool ScrollAffectsScrollHandler() const; void SetExternalPinchGestureActive(bool active); void set_force_smooth_wheel_scrolling_for_testing(bool enabled) {
diff --git a/cc/trees/layer_tree_host_impl_unittest.cc b/cc/trees/layer_tree_host_impl_unittest.cc index 12026591..3cdf22a 100644 --- a/cc/trees/layer_tree_host_impl_unittest.cc +++ b/cc/trees/layer_tree_host_impl_unittest.cc
@@ -1262,16 +1262,12 @@ EXPECT_TRUE(did_request_commit_); } -// Ensure correct semantics for the IsActivelyPrecisionScrolling method. This +// Ensure correct semantics for the GetActivelyScrollingType method. This // method is used to determine scheduler policy so it wants to report true only // when real scrolling is occurring (i.e. the compositor is consuming scroll -// delta, the page isn't handling the events itself). We also only consider -// this signal for non-animated scrolls. This is partially historical but also -// makes some sense since touchscreen/high-precision touchpad scrolling has a -// physical metaphor (movement sticks to finger) so smoothness should be -// prioritized. +// delta, the page isn't handling the events itself). TEST_P(ScrollUnifiedLayerTreeHostImplTest, - ActivelyTouchScrollingOnlyAfterScrollMovement) { + ActivelyScrollingOnlyAfterScrollMovement) { SetupViewportLayersOuterScrolls(gfx::Size(50, 50), gfx::Size(100, 100)); DrawFrame(); @@ -1286,29 +1282,33 @@ EXPECT_EQ(ScrollThread::SCROLL_ON_IMPL_THREAD, status.thread); EXPECT_EQ(MainThreadScrollingReason::kNotScrollingOnMain, status.main_thread_scrolling_reasons); - EXPECT_FALSE(host_impl_->IsActivelyPrecisionScrolling()); + EXPECT_EQ(host_impl_->GetActivelyScrollingType(), + ActivelyScrollingType::kNone); // There is no extent upwards so the scroll won't consume any delta. GetInputHandler().ScrollUpdate( UpdateState(gfx::Point(), gfx::Vector2d(0, -10), ui::ScrollInputType::kTouchscreen) .get()); - EXPECT_FALSE(host_impl_->IsActivelyPrecisionScrolling()); + EXPECT_EQ(host_impl_->GetActivelyScrollingType(), + ActivelyScrollingType::kNone); // This should scroll so ensure the bit flips to true. GetInputHandler().ScrollUpdate( UpdateState(gfx::Point(), gfx::Vector2d(0, 10), ui::ScrollInputType::kTouchscreen) .get()); - EXPECT_TRUE(host_impl_->IsActivelyPrecisionScrolling()); + EXPECT_EQ(host_impl_->GetActivelyScrollingType(), + ActivelyScrollingType::kPrecise); GetInputHandler().ScrollEnd(); - EXPECT_FALSE(host_impl_->IsActivelyPrecisionScrolling()); + EXPECT_EQ(host_impl_->GetActivelyScrollingType(), + ActivelyScrollingType::kNone); } ASSERT_EQ(10, CurrentScrollOffset(OuterViewportScrollLayer()).y()); - // Ensure an animated wheel scroll doesn't cause the bit to flip even when - // scrolling occurs. + // Ensure an animated wheel scroll only causes the bit to flip when enabling + // smoothness mode (i.e. the value of GetParam().animate); { InputHandler::ScrollStatus status = GetInputHandler().ScrollBegin( BeginState(gfx::Point(), gfx::Vector2dF(0, 10), @@ -1316,11 +1316,13 @@ .get(), ui::ScrollInputType::kWheel); EXPECT_EQ(ScrollThread::SCROLL_ON_IMPL_THREAD, status.thread); - EXPECT_FALSE(host_impl_->IsActivelyPrecisionScrolling()); + EXPECT_EQ(host_impl_->GetActivelyScrollingType(), + ActivelyScrollingType::kNone); GetInputHandler().ScrollUpdate( AnimatedUpdateState(gfx::Point(), gfx::Vector2dF(0, 10)).get()); - EXPECT_FALSE(host_impl_->IsActivelyPrecisionScrolling()); + EXPECT_EQ(host_impl_->GetActivelyScrollingType(), + ActivelyScrollingType::kAnimated); base::TimeTicks cur_time = base::TimeTicks() + base::TimeDelta::FromMilliseconds(100); @@ -1339,18 +1341,22 @@ // The animation is setup in the first frame so tick at least twice to // actually animate it. ANIMATE(0); - EXPECT_FALSE(host_impl_->IsActivelyPrecisionScrolling()); + EXPECT_EQ(host_impl_->GetActivelyScrollingType(), + ActivelyScrollingType::kAnimated); ANIMATE(200); - EXPECT_FALSE(host_impl_->IsActivelyPrecisionScrolling()); + EXPECT_EQ(host_impl_->GetActivelyScrollingType(), + ActivelyScrollingType::kAnimated); ANIMATE(1000); - EXPECT_FALSE(host_impl_->IsActivelyPrecisionScrolling()); + EXPECT_EQ(host_impl_->GetActivelyScrollingType(), + ActivelyScrollingType::kAnimated); #undef ANIMATE ASSERT_EQ(20, CurrentScrollOffset(OuterViewportScrollLayer()).y()); GetInputHandler().ScrollEnd(); - EXPECT_FALSE(host_impl_->IsActivelyPrecisionScrolling()); + EXPECT_EQ(host_impl_->GetActivelyScrollingType(), + ActivelyScrollingType::kNone); } }
diff --git a/cc/trees/proxy_impl.cc b/cc/trees/proxy_impl.cc index 57c688ef..5db51a55 100644 --- a/cc/trees/proxy_impl.cc +++ b/cc/trees/proxy_impl.cc
@@ -16,6 +16,7 @@ #include "base/trace_event/trace_event.h" #include "base/trace_event/traced_value.h" #include "cc/base/devtools_instrumentation.h" +#include "cc/base/features.h" #include "cc/benchmarks/benchmark_instrumentation.h" #include "cc/input/browser_controls_offset_manager.h" #include "cc/metrics/compositor_timing_history.h" @@ -78,6 +79,7 @@ host_impl_ = layer_tree_host->CreateLayerTreeHostImpl(this); const LayerTreeSettings& settings = layer_tree_host->GetSettings(); send_compositor_frame_ack_ = settings.send_compositor_frame_ack; + last_raster_priority_ = SAME_PRIORITY_FOR_BOTH_TREES; SchedulerSettings scheduler_settings(settings.ToSchedulerSettings()); @@ -385,10 +387,28 @@ void ProxyImpl::RenewTreePriority() { DCHECK(IsImplThread()); - const bool user_interaction_in_progress = + + bool scroll_type_considered_interaction = false; + bool non_scroll_interaction_in_progress = host_impl_->IsPinchGestureActive() || - host_impl_->page_scale_animation_active() || - host_impl_->IsActivelyPrecisionScrolling(); + host_impl_->page_scale_animation_active(); + + ActivelyScrollingType actively_scrolling_type = + host_impl_->GetActivelyScrollingType(); + + switch (actively_scrolling_type) { + case ActivelyScrollingType::kNone: + break; + case ActivelyScrollingType::kPrecise: + scroll_type_considered_interaction = true; + break; + case ActivelyScrollingType::kAnimated: + scroll_type_considered_interaction = base::FeatureList::IsEnabled( + features::kSchedulerSmoothnessForAnimatedScrolls); + } + + bool user_interaction_in_progress = + non_scroll_interaction_in_progress || scroll_type_considered_interaction; if (host_impl_->ukm_manager()) { host_impl_->ukm_manager()->SetUserInteractionInProgress( @@ -400,11 +420,19 @@ smoothness_priority_expiration_notifier_.Schedule(); // We use the same priority for both trees by default. - TreePriority tree_priority = SAME_PRIORITY_FOR_BOTH_TREES; + TreePriority scheduler_tree_priority = SAME_PRIORITY_FOR_BOTH_TREES; + TreePriority raster_tree_priority = SAME_PRIORITY_FOR_BOTH_TREES; // Smoothness takes priority if we have an expiration for it scheduled. - if (smoothness_priority_expiration_notifier_.HasPendingNotification()) - tree_priority = SMOOTHNESS_TAKES_PRIORITY; + if (smoothness_priority_expiration_notifier_.HasPendingNotification()) { + scheduler_tree_priority = SMOOTHNESS_TAKES_PRIORITY; + if (non_scroll_interaction_in_progress || + actively_scrolling_type == ActivelyScrollingType::kPrecise || + last_raster_priority_ == SMOOTHNESS_TAKES_PRIORITY) + raster_tree_priority = SMOOTHNESS_TAKES_PRIORITY; + } + + last_raster_priority_ = raster_tree_priority; // New content always takes priority when ui resources have been evicted. if (host_impl_->active_tree()->GetDeviceViewport().size().IsEmpty() || @@ -413,10 +441,10 @@ // tree might be freed. We need to set RequiresHighResToDraw to ensure that // high res tiles will be required to activate pending tree. host_impl_->SetRequiresHighResToDraw(); - tree_priority = NEW_CONTENT_TAKES_PRIORITY; + scheduler_tree_priority = raster_tree_priority = NEW_CONTENT_TAKES_PRIORITY; } - host_impl_->SetTreePriority(tree_priority); + host_impl_->SetTreePriority(raster_tree_priority); // Only put the scheduler in impl latency prioritization mode if we don't // have a scroll listener. This gives the scroll listener a better chance of @@ -426,7 +454,7 @@ host_impl_->ScrollAffectsScrollHandler() ? ScrollHandlerState::SCROLL_AFFECTS_SCROLL_HANDLER : ScrollHandlerState::SCROLL_DOES_NOT_AFFECT_SCROLL_HANDLER; - scheduler_->SetTreePrioritiesAndScrollState(tree_priority, + scheduler_->SetTreePrioritiesAndScrollState(scheduler_tree_priority, scroll_handler_state); }
diff --git a/cc/trees/proxy_impl.h b/cc/trees/proxy_impl.h index 5bc001a..5811436 100644 --- a/cc/trees/proxy_impl.h +++ b/cc/trees/proxy_impl.h
@@ -176,6 +176,8 @@ bool send_compositor_frame_ack_; + TreePriority last_raster_priority_; + TaskRunnerProvider* task_runner_provider_; DelayedUniqueNotifier smoothness_priority_expiration_notifier_;
diff --git a/chrome/android/BUILD.gn b/chrome/android/BUILD.gn index 238060d0..461a445e 100644 --- a/chrome/android/BUILD.gn +++ b/chrome/android/BUILD.gn
@@ -1117,6 +1117,7 @@ "//components/omnibox/browser:browser_java", "//components/page_info/android:java", "//components/page_info/android:page_info_action_enum_java", + "//components/paint_preview/player/android:java", "//components/paint_preview/player/android:javatests", "//components/password_manager/core/browser:password_manager_java_enums", "//components/payments/content/android:java",
diff --git a/chrome/android/chrome_public_apk_tmpl.gni b/chrome/android/chrome_public_apk_tmpl.gni index 6631173..3a01f19 100644 --- a/chrome/android/chrome_public_apk_tmpl.gni +++ b/chrome/android/chrome_public_apk_tmpl.gni
@@ -534,6 +534,7 @@ } else { deps += [ "//chrome/android:base_module_java" ] } + deps += [ ":${target_name}__all_chrome_resources" ] deps += _chrome_module_shared_lib_deps _loadable_modules_32_bit = [] _loadable_modules_64_bit = []
diff --git a/chrome/android/chrome_test_java_sources.gni b/chrome/android/chrome_test_java_sources.gni index 6591c6f..730a988 100644 --- a/chrome/android/chrome_test_java_sources.gni +++ b/chrome/android/chrome_test_java_sources.gni
@@ -352,6 +352,9 @@ "javatests/src/org/chromium/chrome/browser/page_info/CookieControlsViewTest.java", "javatests/src/org/chromium/chrome/browser/page_info/PageInfoControllerTest.java", "javatests/src/org/chromium/chrome/browser/page_info/PageInfoViewTest.java", + "javatests/src/org/chromium/chrome/browser/paint_preview/DemoPaintPreviewTest.java", + "javatests/src/org/chromium/chrome/browser/paint_preview/StartupPaintPreviewTest.java", + "javatests/src/org/chromium/chrome/browser/paint_preview/TabbedPaintPreviewTest.java", "javatests/src/org/chromium/chrome/browser/paint_preview/services/PaintPreviewTabServiceTest.java", "javatests/src/org/chromium/chrome/browser/partnercustomizations/BasePartnerBrowserCustomizationIntegrationTestRule.java", "javatests/src/org/chromium/chrome/browser/partnercustomizations/BasePartnerBrowserCustomizationUnitTestRule.java",
diff --git a/chrome/android/feed/core/javatests/src/org/chromium/chrome/browser/feed/v1/FeedNewTabPageTest.java b/chrome/android/feed/core/javatests/src/org/chromium/chrome/browser/feed/v1/FeedNewTabPageTest.java index c84d11d8..84081363 100644 --- a/chrome/android/feed/core/javatests/src/org/chromium/chrome/browser/feed/v1/FeedNewTabPageTest.java +++ b/chrome/android/feed/core/javatests/src/org/chromium/chrome/browser/feed/v1/FeedNewTabPageTest.java
@@ -193,6 +193,7 @@ @MediumTest @Feature({"FeedNewTabPage"}) @Features.DisableFeatures(ChromeFeatureList.INTEREST_FEED_V2) + @DisabledTest(message = "Flaky -- crbug.com/1136923") public void testSignInPromo() { openNewTabPage(); SignInPromo.SigninObserver signinObserver = mNtp.getCoordinatorForTesting()
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java index d08acfa..0e9764c 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/ChromeTabbedActivity.java
@@ -108,7 +108,6 @@ import org.chromium.chrome.browser.ntp.cards.promo.HomepagePromoVariationManager; import org.chromium.chrome.browser.omnibox.LocationBar; import org.chromium.chrome.browser.paint_preview.PaintPreviewHelper; -import org.chromium.chrome.browser.paint_preview.PaintPreviewTabHelper; import org.chromium.chrome.browser.partnercustomizations.PartnerBrowserCustomizations; import org.chromium.chrome.browser.preferences.ChromePreferenceKeys; import org.chromium.chrome.browser.profiles.Profile; @@ -1793,13 +1792,6 @@ if (getManualFillingComponent().handleBackPress()) return true; - final Tab currentTab = getActivityTab(); - - if (currentTab != null - && PaintPreviewTabHelper.get(currentTab).removePaintPreviewDemoIfShowing()) { - return true; - } - if (exitFullscreenIfShowing()) { return true; } @@ -1809,6 +1801,7 @@ if (mTabModalHandler.handleBackPress()) return true; + final Tab currentTab = getActivityTab(); if (currentTab == null) { moveTaskToBack(true); return true;
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/browserservices/QualityEnforcer.java b/chrome/android/java/src/org/chromium/chrome/browser/browserservices/QualityEnforcer.java index 22d6ea4..dc5e762 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/browserservices/QualityEnforcer.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/browserservices/QualityEnforcer.java
@@ -157,10 +157,7 @@ // Do not crash on assetlink failures if the client app does not have installer package // name. - if (type == ViolationType.DIGITAL_ASSETLINKS - && ContextUtils.getApplicationContext().getPackageManager().getInstallerPackageName( - mClientPackageNameProvider.get()) - == null) { + if (type == ViolationType.DIGITAL_ASSETLINKS && !isDebugInstall()) { return; } @@ -177,7 +174,7 @@ PackageManager pm = context.getPackageManager(); // Only shows the toast when the TWA client app does not have installer info, i.e. install // via adb instead of a store. - if (pm.getInstallerPackageName(mClientPackageNameProvider.get()) == null) { + if (!isDebugInstall()) { Toast.makeText(context, message, Toast.LENGTH_LONG).show(); } } @@ -229,4 +226,13 @@ return ""; } } + + private boolean isDebugInstall() { + // TODO(crbug.com/1136153) Need to figure out why the client package name can be null. + if (mClientPackageNameProvider.get() == null) return false; + + return ContextUtils.getApplicationContext().getPackageManager().getInstallerPackageName( + mClientPackageNameProvider.get()) + != null; + } }
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/paint_preview/PaintPreviewHelper.java b/chrome/android/java/src/org/chromium/chrome/browser/paint_preview/PaintPreviewHelper.java index 26d8e4d..b0d2985 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/paint_preview/PaintPreviewHelper.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/paint_preview/PaintPreviewHelper.java
@@ -9,6 +9,7 @@ import org.chromium.base.ActivityState; import org.chromium.base.ApplicationStatus; +import org.chromium.base.Callback; import org.chromium.base.supplier.Supplier; import org.chromium.chrome.browser.app.ChromeActivity; import org.chromium.chrome.browser.flags.CachedFeatureFlags; @@ -108,37 +109,31 @@ if (windowAndroidHelper == null) return; sShouldShowOnRestore = false; - TabbedPaintPreviewPlayer player = TabbedPaintPreviewPlayer.get(tab); - player.setBrowserVisibilityDelegate( - windowAndroidHelper.getBrowserControlsManager().getBrowserVisibilityDelegate()); - player.setProgressSimulatorNeededCallback( - () -> { - if (windowAndroidHelper.getLoadProgressCoordinator() == null) return; - windowAndroidHelper.getLoadProgressCoordinator() - .simulateLoadProgressCompletion(); - }); - player.setProgressbarUpdatePreventionCallback( - (preventProgressbar) -> { - if (windowAndroidHelper.getLoadProgressCoordinator() == null) return; - windowAndroidHelper.getLoadProgressCoordinator().setPreventUpdates( - preventProgressbar); - }); + Runnable progressSimulatorCallback = () -> { + if (windowAndroidHelper.getLoadProgressCoordinator() == null) return; + windowAndroidHelper.getLoadProgressCoordinator().simulateLoadProgressCompletion(); + }; + Callback<Boolean> progressPreventionCallback = (preventProgressbar) -> { + if (windowAndroidHelper.getLoadProgressCoordinator() == null) return; + windowAndroidHelper.getLoadProgressCoordinator().setPreventUpdates(preventProgressbar); + }; + + StartupPaintPreview startupPaintPreview = new StartupPaintPreview(tab, + windowAndroidHelper.getBrowserControlsManager().getBrowserVisibilityDelegate(), + progressSimulatorCallback, progressPreventionCallback); + startupPaintPreview.setActivityCreationTimestampMs( + windowAndroidHelper.getActivityCreationTime()); + startupPaintPreview.setShouldRecordFirstPaint( + () -> UmaUtils.hasComeToForeground() && !UmaUtils.hasComeToBackground()); PageLoadMetrics.Observer observer = new PageLoadMetrics.Observer() { @Override public void onFirstMeaningfulPaint(WebContents webContents, long navigationId, long navigationStartTick, long firstMeaningfulPaintMs) { - player.onFirstMeaningfulPaint(webContents); + startupPaintPreview.onWebContentsFirstMeaningfulPaint(webContents); } }; - - if (!player.maybeShow(() - -> PageLoadMetrics.removeObserver(observer), - windowAndroidHelper.getActivityCreationTime(), - () -> UmaUtils.hasComeToForeground() && !UmaUtils.hasComeToBackground())) { - return; - } - PageLoadMetrics.addObserver(observer); + startupPaintPreview.show(() -> PageLoadMetrics.removeObserver(observer)); } /**
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/signin/SigninUtils.java b/chrome/android/java/src/org/chromium/chrome/browser/signin/SigninUtils.java index f24b064..3113f73 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/signin/SigninUtils.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/signin/SigninUtils.java
@@ -28,6 +28,7 @@ import org.chromium.chrome.browser.sync.settings.AccountManagementFragment; import org.chromium.chrome.browser.tabmodel.TabCreator; import org.chromium.chrome.browser.tabmodel.TabModel; +import org.chromium.components.browser_ui.bottomsheet.BottomSheetController; import org.chromium.components.browser_ui.bottomsheet.BottomSheetControllerProvider; import org.chromium.components.browser_ui.settings.ManagedPreferencesUtils; import org.chromium.components.signin.AccountManagerFacadeProvider; @@ -97,8 +98,16 @@ AccountConsistencyPromoAction.SUPPRESSED_NO_ACCOUNTS); return; } - ChromeActivity activity = (ChromeActivity) windowAndroid.getActivity().get(); + BottomSheetController bottomSheetController = + BottomSheetControllerProvider.from(windowAndroid); + if (bottomSheetController == null) { + // The bottomSheetController can be null when google.com is just opened inside a + // bottom sheet for example. In this case, it's better to disable the account picker + // bottom sheet. + return; + } + ChromeActivity activity = (ChromeActivity) windowAndroid.getActivity().get(); // To close the current regular tab after the user clicks on "Continue" in the incognito // interstitial. TabModel regularTabModel = activity.getTabModelSelector().getModel(/*incognito=*/false); @@ -110,7 +119,7 @@ HelpAndFeedbackLauncherImpl.getInstance()); AccountPickerBottomSheetCoordinator coordinator = new AccountPickerBottomSheetCoordinator( - windowAndroid.getContext().get(), BottomSheetControllerProvider.from(windowAndroid), + windowAndroid.getContext().get(), bottomSheetController, new AccountPickerDelegate(windowAndroid, activity.getActivityTab(), new WebSigninBridge.Factory(), continueUrl), incognitoInterstitialDelegate);
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/signin/account_picker/AccountPickerMediator.java b/chrome/android/java/src/org/chromium/chrome/browser/signin/account_picker/AccountPickerMediator.java index 246ab9e2..8ca4802 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/signin/account_picker/AccountPickerMediator.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/signin/account_picker/AccountPickerMediator.java
@@ -12,6 +12,7 @@ import org.chromium.base.Callback; import org.chromium.chrome.R; +import org.chromium.chrome.browser.incognito.IncognitoUtils; import org.chromium.chrome.browser.signin.DisplayableProfileData; import org.chromium.chrome.browser.signin.ProfileDataCache; import org.chromium.chrome.browser.signin.account_picker.AccountPickerCoordinator.AccountPickerAccessPoint; @@ -104,7 +105,10 @@ mListModel.add(new MVCListAdapter.ListItem(ItemType.ADD_ACCOUNT_ROW, model)); // Add a "Go incognito mode" row - if (mAccessPoint == AccountPickerAccessPoint.WEB) { + // TODO(https://crbug.com/1136802): Let ctor receive a boolean directly to control + // the visibility of the incognito row. + if (mAccessPoint == AccountPickerAccessPoint.WEB + && IncognitoUtils.isIncognitoModeEnabled()) { PropertyModel incognitoModel = IncognitoAccountRowProperties.createModel( mAccountPickerListener::goIncognitoMode); mListModel.add(
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/tab/TabHelpers.java b/chrome/android/java/src/org/chromium/chrome/browser/tab/TabHelpers.java index b4f6b972..9b170ac 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/tab/TabHelpers.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/tab/TabHelpers.java
@@ -12,7 +12,6 @@ import org.chromium.chrome.browser.dom_distiller.TabDistillabilityProvider; import org.chromium.chrome.browser.infobar.InfoBarContainer; import org.chromium.chrome.browser.media.ui.MediaSessionTabHelper; -import org.chromium.chrome.browser.paint_preview.PaintPreviewTabHelper; /** * Helper class that initializes various tab UserData objects. @@ -34,7 +33,6 @@ MediaSessionTabHelper.createForTab(tab); TaskTabHelper.createForTab(tab, parentTab); TabBrowserControlsConstraintsHelper.createForTab(tab); - PaintPreviewTabHelper.createForTab(tab); if (ReaderModeManager.isEnabled()) ReaderModeManager.createForTab(tab); // TODO(jinsukkim): Do this by having something observe new tab creation.
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/toolbar/LocationBarModel.java b/chrome/android/java/src/org/chromium/chrome/browser/toolbar/LocationBarModel.java index 4412be55..21af6226 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/toolbar/LocationBarModel.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/toolbar/LocationBarModel.java
@@ -26,7 +26,7 @@ import org.chromium.chrome.browser.omnibox.ChromeAutocompleteSchemeClassifier; import org.chromium.chrome.browser.omnibox.SearchEngineLogoUtils; import org.chromium.chrome.browser.omnibox.UrlBarData; -import org.chromium.chrome.browser.paint_preview.TabbedPaintPreviewPlayer; +import org.chromium.chrome.browser.paint_preview.TabbedPaintPreview; import org.chromium.chrome.browser.previews.Previews; import org.chromium.chrome.browser.profiles.Profile; import org.chromium.chrome.browser.tab.Tab; @@ -345,7 +345,7 @@ @Override public boolean isPaintPreview() { - return hasTab() && TabbedPaintPreviewPlayer.get(mTab).isShowingAndNeedsBadge(); + return hasTab() && TabbedPaintPreview.get(mTab).isShowing(); } @Override
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ui/RootUiCoordinator.java b/chrome/android/java/src/org/chromium/chrome/browser/ui/RootUiCoordinator.java index c14c1f6d2..a70a738 100644 --- a/chrome/android/java/src/org/chromium/chrome/browser/ui/RootUiCoordinator.java +++ b/chrome/android/java/src/org/chromium/chrome/browser/ui/RootUiCoordinator.java
@@ -52,7 +52,7 @@ import org.chromium.chrome.browser.metrics.UkmRecorder; import org.chromium.chrome.browser.omnibox.LocationBar.OmniboxFocusReason; import org.chromium.chrome.browser.omnibox.geo.GeolocationHeader; -import org.chromium.chrome.browser.paint_preview.PaintPreviewTabHelper; +import org.chromium.chrome.browser.paint_preview.DemoPaintPreview; import org.chromium.chrome.browser.profiles.Profile; import org.chromium.chrome.browser.search_engines.TemplateUrlServiceFactory; import org.chromium.chrome.browser.share.ShareButtonController; @@ -422,9 +422,7 @@ onShareMenuItemSelected(id == R.id.direct_share_menu_id, mTabModelSelectorSupplier.get().isIncognitoSelected()); } else if (id == R.id.paint_preview_show_id) { - Tab tab = mActivityTabProvider.get(); - PaintPreviewTabHelper paintPreviewTabHelper = PaintPreviewTabHelper.get(tab); - paintPreviewTabHelper.showPaintPreviewDemo(); + DemoPaintPreview.showForTab(mActivityTabProvider.get()); } else if (id == R.id.get_image_descriptions_id) { ImageDescriptionsController.getInstance().onImageDescriptionsMenuItemSelected( mActivity, mActivity.getModalDialogManager());
diff --git a/chrome/android/javatests/DEPS b/chrome/android/javatests/DEPS index c02d868..e063dd7 100644 --- a/chrome/android/javatests/DEPS +++ b/chrome/android/javatests/DEPS
@@ -3,6 +3,7 @@ "+chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActivity.java", "+chrome/browser/android/lifecycle", "+chrome/browser/image_fetcher", + "+chrome/browser/paint_preview/android", "+chrome/browser/password_check/android", "+chrome/browser/profiles/android/java", "+chrome/browser/share/android/java", @@ -34,6 +35,8 @@ "+components/navigation_interception", "+components/offline_items_collection/core/android/java", "+components/omnibox/browser/android/java/src/org/chromium/components/omnibox", + "+components/paint_preview/browser/android", + "+components/paint_preview/player/android", "+components/payments/content/android/java/src/org/chromium/components/payments", "+components/permissions/android/java/src/org/chromium/components/permissions", "+components/safe_browsing/android/java/src/org/chromium/components/safe_browsing",
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/paint_preview/DemoPaintPreviewTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/paint_preview/DemoPaintPreviewTest.java new file mode 100644 index 0000000..7b882803 --- /dev/null +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/paint_preview/DemoPaintPreviewTest.java
@@ -0,0 +1,127 @@ +// Copyright 2020 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +package org.chromium.chrome.browser.paint_preview; + +import static org.chromium.base.test.util.Batch.PER_CLASS; +import static org.chromium.chrome.browser.paint_preview.TabbedPaintPreviewTest.assertAttachedAndShown; + +import android.support.test.InstrumentationRegistry; +import android.support.test.uiautomator.UiDevice; +import android.support.test.uiautomator.UiObjectNotFoundException; +import android.support.test.uiautomator.UiSelector; + +import androidx.test.filters.MediumTest; + +import org.junit.AfterClass; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.ClassRule; +import org.junit.Rule; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.ArgumentCaptor; +import org.mockito.Mockito; + +import org.chromium.base.Callback; +import org.chromium.base.test.util.Batch; +import org.chromium.chrome.browser.ChromeTabbedActivity; +import org.chromium.chrome.browser.flags.ChromeFeatureList; +import org.chromium.chrome.browser.paint_preview.services.PaintPreviewTabService; +import org.chromium.chrome.browser.tab.Tab; +import org.chromium.chrome.test.ChromeJUnit4ClassRunner; +import org.chromium.chrome.test.ChromeTabbedActivityTestRule; +import org.chromium.chrome.test.batch.BlankCTATabInitialStateRule; +import org.chromium.chrome.test.util.browser.Features; +import org.chromium.components.paintpreview.player.PlayerManager; +import org.chromium.content_public.browser.test.util.TestThreadUtils; + +import java.util.concurrent.ExecutionException; + +/** + * Tests for the {@link DemoPaintPreview} class. + */ +@RunWith(ChromeJUnit4ClassRunner.class) +@Features.EnableFeatures({ChromeFeatureList.PAINT_PREVIEW_DEMO}) +@Batch(PER_CLASS) +public class DemoPaintPreviewTest { + @ClassRule + public static ChromeTabbedActivityTestRule sActivityTestRule = + new ChromeTabbedActivityTestRule(); + @Rule + public final BlankCTATabInitialStateRule<ChromeTabbedActivity> mInitialStateRule = + new BlankCTATabInitialStateRule<>(sActivityTestRule, true); + + private static final String TEST_URL = "/chrome/test/data/android/about.html"; + private static PaintPreviewTabService sMockService; + + @BeforeClass + public static void setUp() { + sMockService = Mockito.mock(PaintPreviewTabService.class); + TabbedPaintPreview.overridePaintPreviewTabServiceForTesting(sMockService); + PlayerManager.overrideCompositorDelegateFactoryForTesting( + TabbedPaintPreviewTest.TestCompositorDelegate::new); + } + + @AfterClass + public static void tearDown() { + PlayerManager.overrideCompositorDelegateFactoryForTesting(null); + TabbedPaintPreview.overridePaintPreviewTabServiceForTesting(null); + } + + @Before + public void setup() { + sActivityTestRule.loadUrl(sActivityTestRule.getTestServer().getURL(TEST_URL)); + } + + /** + * Tests the demo mode is accessible from app menu and works successfully when the page has been + * captured before. + */ + @Test + @MediumTest + public void testWithExistingCapture() throws UiObjectNotFoundException, ExecutionException { + Mockito.doReturn(true).when(sMockService).hasCaptureForTab(Mockito.anyInt()); + + UiDevice uiDevice = UiDevice.getInstance(InstrumentationRegistry.getInstrumentation()); + uiDevice.pressMenu(); + uiDevice.findObject(new UiSelector().text("Show Paint Preview")).click(); + + Tab tab = sActivityTestRule.getActivity().getActivityTab(); + TabbedPaintPreview tabbedPaintPreview = + TestThreadUtils.runOnUiThreadBlocking(() -> TabbedPaintPreview.get(tab)); + assertAttachedAndShown(tabbedPaintPreview, true, true); + } + + /** + * Tests the demo mode is accessible from app menu and works successfully when the page has not + * been captured before. + */ + @Test + @MediumTest + public void testWithNoExistingCapture() throws UiObjectNotFoundException, ExecutionException { + // Return false for PaintPreviewTabService#hasCaptureForTab initially. + Mockito.doReturn(false).when(sMockService).hasCaptureForTab(Mockito.anyInt()); + + // When PaintPreviewTabService#captureTab is called, return true for future calls to + // PaintPreviewTabService#hasCaptureForTab and call the success callback with true. + ArgumentCaptor<Callback<Boolean>> mCallbackCaptor = ArgumentCaptor.forClass(Callback.class); + Mockito.doAnswer(invocation -> { + Mockito.doReturn(true).when(sMockService).hasCaptureForTab(Mockito.anyInt()); + mCallbackCaptor.getValue().onResult(true); + return null; + }) + .when(sMockService) + .captureTab(Mockito.any(Tab.class), mCallbackCaptor.capture()); + + UiDevice uiDevice = UiDevice.getInstance(InstrumentationRegistry.getInstrumentation()); + uiDevice.pressMenu(); + uiDevice.findObject(new UiSelector().text("Show Paint Preview")).click(); + + Tab tab = sActivityTestRule.getActivity().getActivityTab(); + TabbedPaintPreview tabbedPaintPreview = + TestThreadUtils.runOnUiThreadBlocking(() -> TabbedPaintPreview.get(tab)); + assertAttachedAndShown(tabbedPaintPreview, true, true); + } +}
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/paint_preview/StartupPaintPreviewTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/paint_preview/StartupPaintPreviewTest.java new file mode 100644 index 0000000..ad9cb2d --- /dev/null +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/paint_preview/StartupPaintPreviewTest.java
@@ -0,0 +1,219 @@ +// Copyright 2020 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +package org.chromium.chrome.browser.paint_preview; + +import static org.chromium.base.test.util.Batch.PER_CLASS; +import static org.chromium.chrome.browser.paint_preview.TabbedPaintPreviewTest.assertAttachedAndShown; + +import android.support.test.InstrumentationRegistry; +import android.support.test.uiautomator.UiDevice; +import android.support.test.uiautomator.UiObjectNotFoundException; +import android.support.test.uiautomator.UiSelector; +import android.view.ViewGroup; + +import androidx.test.filters.MediumTest; + +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.ClassRule; +import org.junit.Rule; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.Mockito; + +import org.chromium.base.test.util.Batch; +import org.chromium.base.test.util.CallbackHelper; +import org.chromium.chrome.browser.ChromeTabbedActivity; +import org.chromium.chrome.browser.paint_preview.services.PaintPreviewTabService; +import org.chromium.chrome.browser.tab.Tab; +import org.chromium.chrome.browser.ui.messages.snackbar.SnackbarManager; +import org.chromium.chrome.test.ChromeJUnit4ClassRunner; +import org.chromium.chrome.test.ChromeTabbedActivityTestRule; +import org.chromium.chrome.test.batch.BlankCTATabInitialStateRule; +import org.chromium.components.paintpreview.player.PlayerManager; +import org.chromium.content_public.browser.test.util.CriteriaHelper; +import org.chromium.content_public.browser.test.util.TestThreadUtils; + +import java.util.concurrent.ExecutionException; + +/** + * Tests for the {@link TabbedPaintPreview} class. + */ +@RunWith(ChromeJUnit4ClassRunner.class) +@Batch(PER_CLASS) +public class StartupPaintPreviewTest { + @ClassRule + public static ChromeTabbedActivityTestRule sActivityTestRule = + new ChromeTabbedActivityTestRule(); + @Rule + public final BlankCTATabInitialStateRule<ChromeTabbedActivity> mInitialStateRule = + new BlankCTATabInitialStateRule<>(sActivityTestRule, true); + + private static final String TEST_URL = "/chrome/test/data/android/about.html"; + + @BeforeClass + public static void setUp() { + PaintPreviewTabService mockService = Mockito.mock(PaintPreviewTabService.class); + Mockito.doReturn(true).when(mockService).hasCaptureForTab(Mockito.anyInt()); + TabbedPaintPreview.overridePaintPreviewTabServiceForTesting(mockService); + PlayerManager.overrideCompositorDelegateFactoryForTesting( + TabbedPaintPreviewTest.TestCompositorDelegate::new); + } + + @AfterClass + public static void tearDown() { + PlayerManager.overrideCompositorDelegateFactoryForTesting(null); + TabbedPaintPreview.overridePaintPreviewTabServiceForTesting(null); + } + + @Before + public void setup() { + sActivityTestRule.loadUrl(sActivityTestRule.getTestServer().getURL(TEST_URL)); + } + + /** + * Tests that StartupPaintPreview is displayed correctly if a paint preview for the current tab + * has been captured before. + */ + @Test + @MediumTest + public void testDisplayedCorrectly() throws ExecutionException { + Tab tab = sActivityTestRule.getActivity().getActivityTab(); + StartupPaintPreview startupPaintPreview = TestThreadUtils.runOnUiThreadBlocking( + () -> new StartupPaintPreview(tab, null, null, null)); + TestThreadUtils.runOnUiThreadBlocking(() -> startupPaintPreview.show(null)); + TabbedPaintPreview tabbedPaintPreview = + TestThreadUtils.runOnUiThreadBlocking(() -> TabbedPaintPreview.get(tab)); + showAndWaitForInflation(startupPaintPreview, tabbedPaintPreview, null); + } + + @Test + @MediumTest + public void testSnackbarShow() throws ExecutionException { + Tab tab = sActivityTestRule.getActivity().getActivityTab(); + StartupPaintPreview startupPaintPreview = TestThreadUtils.runOnUiThreadBlocking( + () -> new StartupPaintPreview(tab, null, null, null)); + TabbedPaintPreview tabbedPaintPreview = + TestThreadUtils.runOnUiThreadBlocking(() -> TabbedPaintPreview.get(tab)); + showAndWaitForInflation(startupPaintPreview, tabbedPaintPreview, null); + + // Snackbar should appear on user frustration. It currently happens when users taps 3 times, + // or when users longpress. + SnackbarManager snackbarManager = sActivityTestRule.getActivity().getSnackbarManager(); + assertSnackbarVisibility(snackbarManager, false); + UiDevice uiDevice = UiDevice.getInstance(InstrumentationRegistry.getInstrumentation()); + int centerX = uiDevice.getDisplayWidth() / 2; + int centerY = uiDevice.getDisplayHeight() / 2; + // First tap. + uiDevice.click(centerX, centerY); + assertSnackbarVisibility(snackbarManager, false); + // Second tap. + uiDevice.click(centerX, centerY); + assertSnackbarVisibility(snackbarManager, false); + // Third tap. + uiDevice.click(centerX, centerY); + assertSnackbarVisibility(snackbarManager, true); + + TestThreadUtils.runOnUiThreadBlocking(snackbarManager::dismissAllSnackbars); + assertSnackbarVisibility(snackbarManager, false); + + // Simulate long press. + uiDevice.swipe(centerX, centerY, centerX, centerY, 400); + assertSnackbarVisibility(snackbarManager, true); + } + + /** + * Tests that the paint preview is removed when certain conditions are met. + */ + @Test + @MediumTest + public void testRemoveOnFirstMeaningfulPaint() + throws ExecutionException, UiObjectNotFoundException { + Tab tab = sActivityTestRule.getActivity().getActivityTab(); + StartupPaintPreview startupPaintPreview = TestThreadUtils.runOnUiThreadBlocking( + () -> new StartupPaintPreview(tab, null, null, null)); + TabbedPaintPreview tabbedPaintPreview = + TestThreadUtils.runOnUiThreadBlocking(() -> TabbedPaintPreview.get(tab)); + CallbackHelper dismissCallback = new CallbackHelper(); + + // Should be removed on FMP signal. + showAndWaitForInflation(startupPaintPreview, tabbedPaintPreview, dismissCallback); + TestThreadUtils.runOnUiThreadBlocking( + () -> startupPaintPreview.onWebContentsFirstMeaningfulPaint(tab.getWebContents())); + assertAttachedAndShown(tabbedPaintPreview, false, false); + Assert.assertEquals( + "Dismiss callback should have been called.", 1, dismissCallback.getCallCount()); + } + + /** + * Tests that the paint preview is removed when certain conditions are met. + */ + @Test + @MediumTest + public void testRemoveOnActionbarClick() throws ExecutionException, UiObjectNotFoundException { + Tab tab = sActivityTestRule.getActivity().getActivityTab(); + StartupPaintPreview startupPaintPreview = TestThreadUtils.runOnUiThreadBlocking( + () -> new StartupPaintPreview(tab, null, null, null)); + TabbedPaintPreview tabbedPaintPreview = + TestThreadUtils.runOnUiThreadBlocking(() -> TabbedPaintPreview.get(tab)); + CallbackHelper dismissCallback = new CallbackHelper(); + UiDevice uiDevice = UiDevice.getInstance(InstrumentationRegistry.getInstrumentation()); + + // Should be removed on actionbar click. + showAndWaitForInflation(startupPaintPreview, tabbedPaintPreview, dismissCallback); + SnackbarManager snackbarManager = sActivityTestRule.getActivity().getSnackbarManager(); + int centerX = uiDevice.getDisplayWidth() / 2; + int centerY = uiDevice.getDisplayHeight() / 2; + uiDevice.swipe(centerX, centerY, centerX, centerY, 400); + assertSnackbarVisibility(snackbarManager, true); + uiDevice.findObject(new UiSelector().text("Reload")).click(); + assertAttachedAndShown(tabbedPaintPreview, false, false); + Assert.assertEquals( + "Dismiss callback should have been called.", 1, dismissCallback.getCallCount()); + } + + /** + * Tests that the paint preview is removed when certain conditions are met. + */ + @Test + @MediumTest + public void testRemoveOnNavigation() throws ExecutionException, UiObjectNotFoundException { + Tab tab = sActivityTestRule.getActivity().getActivityTab(); + StartupPaintPreview startupPaintPreview = TestThreadUtils.runOnUiThreadBlocking( + () -> new StartupPaintPreview(tab, null, null, null)); + TabbedPaintPreview tabbedPaintPreview = + TestThreadUtils.runOnUiThreadBlocking(() -> TabbedPaintPreview.get(tab)); + CallbackHelper dismissCallback = new CallbackHelper(); + + // Should be removed on navigation start. + showAndWaitForInflation(startupPaintPreview, tabbedPaintPreview, dismissCallback); + startupPaintPreview.getTabObserverForTesting().onRestoreStarted(tab); + TestThreadUtils.runOnUiThreadBlocking(tab::reload); + assertAttachedAndShown(tabbedPaintPreview, false, false); + Assert.assertEquals( + "Dismiss callback should have been called.", 1, dismissCallback.getCallCount()); + } + + private void assertSnackbarVisibility(SnackbarManager snackbarManager, boolean visible) { + String message = + visible ? "Snackbar should be visible." : "Snackbar should not be visible."; + CriteriaHelper.pollUiThread(() -> snackbarManager.isShowing() == visible, message); + } + + private void showAndWaitForInflation(StartupPaintPreview startupPaintPreview, + TabbedPaintPreview tabbedPaintPreview, CallbackHelper dismissCallback) { + TestThreadUtils.runOnUiThreadBlocking( + () + -> startupPaintPreview.show( + dismissCallback == null ? null : dismissCallback::notifyCalled)); + assertAttachedAndShown(tabbedPaintPreview, true, true); + CriteriaHelper.pollUiThread(() + -> tabbedPaintPreview.getViewForTesting() != null + && ((ViewGroup) tabbedPaintPreview.getViewForTesting()).getChildCount() > 0, + "TabbedPaintPreview either doesn't have a view or a view with 0 children."); + } +}
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/paint_preview/TabbedPaintPreviewTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/paint_preview/TabbedPaintPreviewTest.java new file mode 100644 index 0000000..41a35ee --- /dev/null +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/paint_preview/TabbedPaintPreviewTest.java
@@ -0,0 +1,362 @@ +// Copyright 2020 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +package org.chromium.chrome.browser.paint_preview; + +import static org.chromium.base.test.util.Batch.PER_CLASS; + +import android.graphics.Bitmap; +import android.graphics.Rect; +import android.os.Handler; +import android.os.Parcel; + +import androidx.annotation.NonNull; +import androidx.test.filters.MediumTest; + +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.ClassRule; +import org.junit.Rule; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.mockito.Mockito; + +import org.chromium.base.Callback; +import org.chromium.base.UnguessableToken; +import org.chromium.base.supplier.ObservableSupplier; +import org.chromium.base.test.util.Batch; +import org.chromium.base.test.util.CallbackHelper; +import org.chromium.chrome.browser.ChromeTabbedActivity; +import org.chromium.chrome.browser.browser_controls.BrowserStateBrowserControlsVisibilityDelegate; +import org.chromium.chrome.browser.paint_preview.services.PaintPreviewTabService; +import org.chromium.chrome.browser.tab.Tab; +import org.chromium.chrome.test.ChromeJUnit4ClassRunner; +import org.chromium.chrome.test.ChromeTabbedActivityTestRule; +import org.chromium.chrome.test.batch.BlankCTATabInitialStateRule; +import org.chromium.components.paintpreview.browser.NativePaintPreviewServiceProvider; +import org.chromium.components.paintpreview.player.PlayerCompositorDelegate; +import org.chromium.components.paintpreview.player.PlayerManager; +import org.chromium.content_public.browser.test.util.CriteriaHelper; +import org.chromium.content_public.browser.test.util.TestThreadUtils; +import org.chromium.ui.util.TokenHolder; +import org.chromium.url.GURL; + +import java.util.concurrent.ExecutionException; +import java.util.concurrent.TimeoutException; + +/** + * Tests for the {@link TabbedPaintPreview} class. + */ +@RunWith(ChromeJUnit4ClassRunner.class) +@Batch(PER_CLASS) +public class TabbedPaintPreviewTest { + @ClassRule + public static ChromeTabbedActivityTestRule sActivityTestRule = + new ChromeTabbedActivityTestRule(); + @Rule + public final BlankCTATabInitialStateRule<ChromeTabbedActivity> mInitialStateRule = + new BlankCTATabInitialStateRule<>(sActivityTestRule, true); + + private static final String TEST_URL = "/chrome/test/data/android/about.html"; + + @BeforeClass + public static void setUp() { + PaintPreviewTabService mockService = Mockito.mock(PaintPreviewTabService.class); + Mockito.doReturn(true).when(mockService).hasCaptureForTab(Mockito.anyInt()); + TabbedPaintPreview.overridePaintPreviewTabServiceForTesting(mockService); + PlayerManager.overrideCompositorDelegateFactoryForTesting(TestCompositorDelegate::new); + } + + @AfterClass + public static void tearDown() { + PlayerManager.overrideCompositorDelegateFactoryForTesting(null); + TabbedPaintPreview.overridePaintPreviewTabServiceForTesting(null); + } + + @Before + public void setup() { + sActivityTestRule.loadUrl(sActivityTestRule.getTestServer().getURL(TEST_URL)); + } + + /** + * Tests that TabbedPaintPreview is displayed correctly if a paint preview for the current tab + * has been captured before. + */ + @Test + @MediumTest + public void testDisplayedCorrectly() throws ExecutionException, TimeoutException { + Tab tab = sActivityTestRule.getActivity().getActivityTab(); + TabbedPaintPreview tabbedPaintPreview = + TestThreadUtils.runOnUiThreadBlocking(() -> TabbedPaintPreview.get(tab)); + CallbackHelper viewReadyCallback = new CallbackHelper(); + CallbackHelper firstPaintCallback = new CallbackHelper(); + PlayerManager.Listener listener = new EmptyPlayerListener() { + @Override + public void onCompositorError(int status) { + Assert.fail("Paint Preview should have been displayed successfully" + + "with no errors."); + } + + @Override + public void onViewReady() { + viewReadyCallback.notifyCalled(); + } + + @Override + public void onFirstPaint() { + firstPaintCallback.notifyCalled(); + } + }; + + boolean showed = + TestThreadUtils.runOnUiThreadBlocking(() -> tabbedPaintPreview.maybeShow(listener)); + Assert.assertTrue("Paint Preview failed to display.", showed); + Assert.assertTrue("Paint Preview was not displayed.", tabbedPaintPreview.isShowing()); + Assert.assertTrue( + "Paint Preview was not attached to tab.", tabbedPaintPreview.isAttached()); + viewReadyCallback.waitForFirst("Paint preview view ready never happened."); + firstPaintCallback.waitForFirst("Paint preview first paint never happened."); + TestThreadUtils.runOnUiThreadBlocking(() -> tabbedPaintPreview.remove(false, false)); + } + + /** + * Tests that we correctly make the browser controls persistent and non-persistent on showing + * and hiding the paint preview, or the tab. + */ + @Test + @MediumTest + public void testBrowserControlsPersistent() throws ExecutionException { + TestControlsVisibilityDelegate visibilityDelegate = + TestThreadUtils.runOnUiThreadBlocking(TestControlsVisibilityDelegate::new); + Tab tab = sActivityTestRule.getActivity().getActivityTab(); + TabbedPaintPreview tabbedPaintPreview = + TestThreadUtils.runOnUiThreadBlocking(() -> TabbedPaintPreview.get(tab)); + tabbedPaintPreview.setBrowserVisibilityDelegate(visibilityDelegate); + PlayerManager.Listener emptyListener = new EmptyPlayerListener(); + + // Assert toolbar persistence is changed based on paint preview visibility. + assertToolbarPersistence(false, visibilityDelegate); + boolean showed = TestThreadUtils.runOnUiThreadBlocking( + () -> tabbedPaintPreview.maybeShow(emptyListener)); + Assert.assertTrue("Paint Preview failed to display.", showed); + assertToolbarPersistence(true, visibilityDelegate); + TestThreadUtils.runOnUiThreadBlocking(() -> tabbedPaintPreview.remove(false, false)); + assertToolbarPersistence(false, visibilityDelegate); + + // Assert toolbar persistence is changed based visibility of the tab that is showing the + // paint preview. + showed = TestThreadUtils.runOnUiThreadBlocking( + () -> tabbedPaintPreview.maybeShow(emptyListener)); + Assert.assertTrue("Paint Preview failed to display.", showed); + assertToolbarPersistence(true, visibilityDelegate); + Tab newTab = sActivityTestRule.loadUrlInNewTab( + sActivityTestRule.getTestServer().getURL(TEST_URL)); + assertToolbarPersistence(false, visibilityDelegate); + TestThreadUtils.runOnUiThreadBlocking(() + -> sActivityTestRule.getActivity() + .getTabModelSelector() + .getCurrentModel() + .closeTab(newTab)); + assertToolbarPersistence(true, visibilityDelegate); + } + + /** + * Tests that the progressbar behaves as expected when TabbedPaintPreview is showing. + * Progressbar updates should be prevented when the current tab is showing a paint preview. A + * progressbar fill simulation should be requested when paint preview is removed. + */ + @Test + @MediumTest + public void testProgressbar() throws ExecutionException { + Tab tab = sActivityTestRule.getActivity().getActivityTab(); + TabbedPaintPreview tabbedPaintPreview = + TestThreadUtils.runOnUiThreadBlocking(() -> TabbedPaintPreview.get(tab)); + + CallbackHelper simulateCallback = new CallbackHelper(); + BooleanCallbackHelper preventionCallback = new BooleanCallbackHelper(); + tabbedPaintPreview.setProgressSimulatorNeededCallback(simulateCallback::notifyCalled); + tabbedPaintPreview.setProgressbarUpdatePreventionCallback(preventionCallback::set); + PlayerManager.Listener emptyListener = new EmptyPlayerListener(); + + // Paint Preview not showing. + Assert.assertEquals("Progressbar simulate callback shouldn't have been called.", 0, + simulateCallback.getCallCount()); + assertProgressbarUpdatePreventionCallback(false, preventionCallback); + + // Paint Preview showing in the current tab. + TestThreadUtils.runOnUiThreadBlocking(() -> tabbedPaintPreview.maybeShow(emptyListener)); + assertProgressbarUpdatePreventionCallback(true, preventionCallback); + + // Switch to a new tab that doesn't show paint preview. + Tab newTab = sActivityTestRule.loadUrlInNewTab( + sActivityTestRule.getTestServer().getURL(TEST_URL)); + assertProgressbarUpdatePreventionCallback(false, preventionCallback); + + // Close the new tab, we should be back at the old tab with the paint preview showing. + TestThreadUtils.runOnUiThreadBlocking(() + -> sActivityTestRule.getActivity() + .getTabModelSelector() + .getCurrentModel() + .closeTab(newTab)); + assertProgressbarUpdatePreventionCallback(true, preventionCallback); + + // Remove paint preview. + Assert.assertEquals("Should have not requested progressbar fill simulation.", 0, + simulateCallback.getCallCount()); + TestThreadUtils.runOnUiThreadBlocking(() -> tabbedPaintPreview.remove(false, false)); + Assert.assertEquals("Should have requested progressbar fill simulation.", 1, + simulateCallback.getCallCount()); + assertProgressbarUpdatePreventionCallback(false, preventionCallback); + } + + private static class BooleanCallbackHelper { + private boolean mLastResult; + + public boolean get() { + return mLastResult; + } + + public void set(boolean lastResult) { + this.mLastResult = lastResult; + } + } + + private void assertProgressbarUpdatePreventionCallback( + boolean expected, BooleanCallbackHelper callbackHelper) { + String message = expected ? "Progressbar updates should be prevented." + : "Progressbar updates should not be prevented."; + CriteriaHelper.pollInstrumentationThread(() -> expected == callbackHelper.get(), message); + } + + private void assertToolbarPersistence( + boolean expected, TestControlsVisibilityDelegate visibilityDelegate) { + String message = + expected ? "Toolbar should be persistent." : "Toolbar should not be persistent."; + CriteriaHelper.pollInstrumentationThread( + () -> expected == visibilityDelegate.isPersistent(), message); + } + + public static void assertAttachedAndShown( + TabbedPaintPreview tabbedPaintPreview, boolean attached, boolean shown) { + String attachedMessage = attached ? "Paint Preview should be attached." + : "Paint Preview should not be attached."; + String shownMessage = + shown ? "Paint Preview should be shown." : "Paint Preview should not be shown."; + CriteriaHelper.pollUiThread( + () -> tabbedPaintPreview.isAttached() == attached, attachedMessage); + CriteriaHelper.pollUiThread(() -> tabbedPaintPreview.isShowing() == shown, shownMessage); + } + + private static class TestControlsVisibilityDelegate + extends BrowserStateBrowserControlsVisibilityDelegate { + private int mLastToken = TokenHolder.INVALID_TOKEN; + + public TestControlsVisibilityDelegate() { + super(new ObservableSupplier<Boolean>() { + @Override + public Boolean addObserver(Callback<Boolean> obs) { + return false; + } + + @Override + public void removeObserver(Callback<Boolean> obs) {} + + @Override + public Boolean get() { + return false; + } + }); + } + + public boolean isPersistent() { + return mLastToken != TokenHolder.INVALID_TOKEN; + } + + @Override + public int showControlsPersistent() { + Assert.assertEquals("Lock toolbar persistence is called before releasing a " + + "previous token.", + mLastToken, TokenHolder.INVALID_TOKEN); + mLastToken = super.showControlsPersistent(); + return mLastToken; + } + + @Override + public void releasePersistentShowingToken(int token) { + Assert.assertEquals("Release toolbar persistence is called with the wrong" + + "token.", + mLastToken, token); + super.releasePersistentShowingToken(token); + mLastToken = TokenHolder.INVALID_TOKEN; + } + } + + /** + * Dummy implementation of {@link PlayerCompositorDelegate}. + */ + public static class TestCompositorDelegate implements PlayerCompositorDelegate { + TestCompositorDelegate(NativePaintPreviewServiceProvider service, GURL url, + String directoryKey, @NonNull CompositorListener compositorListener, + Callback<Integer> compositorErrorCallback) { + new Handler().postDelayed(() -> { + Parcel parcel = Parcel.obtain(); + parcel.writeLong(4577L); + parcel.writeLong(23L); + parcel.setDataPosition(0); + UnguessableToken token = UnguessableToken.CREATOR.createFromParcel(parcel); + compositorListener.onCompositorReady(token, new UnguessableToken[] {token}, + new int[] {500, 500}, new int[] {0, 0}, new int[] {0}, null, null); + }, 50); + } + + @Override + public void requestBitmap(UnguessableToken frameGuid, Rect clipRect, float scaleFactor, + Callback<Bitmap> bitmapCallback, Runnable errorCallback) { + new Handler().postDelayed(() -> { + Bitmap emptyBitmap = Bitmap.createBitmap( + clipRect.width(), clipRect.height(), Bitmap.Config.ARGB_4444); + bitmapCallback.onResult(emptyBitmap); + }, 100); + } + + @Override + public GURL onClick(UnguessableToken frameGuid, int x, int y) { + return null; + } + + @Override + public void setCompressOnClose(boolean compressOnClose) {} + + @Override + public void destroy() {} + } + + /** + * Blank implementation of {@link PlayerManager.Listener}. + */ + public static class EmptyPlayerListener implements PlayerManager.Listener { + @Override + public void onCompositorError(int status) {} + + @Override + public void onViewReady() {} + + @Override + public void onFirstPaint() {} + + @Override + public void onUserInteraction() {} + + @Override + public void onUserFrustration() {} + + @Override + public void onPullToRefresh() {} + + @Override + public void onLinkClick(GURL url) {} + } +}
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/signin/AccountPickerBottomSheetRenderTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/signin/AccountPickerBottomSheetRenderTest.java index b3f61b6..b18d229 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/signin/AccountPickerBottomSheetRenderTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/signin/AccountPickerBottomSheetRenderTest.java
@@ -39,6 +39,7 @@ import org.chromium.chrome.R; import org.chromium.chrome.browser.flags.ChromeFeatureList; import org.chromium.chrome.browser.flags.ChromeSwitches; +import org.chromium.chrome.browser.incognito.IncognitoUtils; import org.chromium.chrome.browser.incognito.interstitial.IncognitoInterstitialDelegate; import org.chromium.chrome.browser.night_mode.ChromeNightModeTestUtils; import org.chromium.chrome.browser.signin.account_picker.AccountPickerBottomSheetCoordinator; @@ -114,6 +115,7 @@ @Before public void setUp() { initMocks(this); + IncognitoUtils.setEnabledForTesting(true); mActivityTestRule.startMainActivityOnBlankPage(); }
diff --git a/chrome/android/javatests/src/org/chromium/chrome/browser/signin/AccountPickerBottomSheetTest.java b/chrome/android/javatests/src/org/chromium/chrome/browser/signin/AccountPickerBottomSheetTest.java index a75ee5e..400ac809 100644 --- a/chrome/android/javatests/src/org/chromium/chrome/browser/signin/AccountPickerBottomSheetTest.java +++ b/chrome/android/javatests/src/org/chromium/chrome/browser/signin/AccountPickerBottomSheetTest.java
@@ -48,6 +48,7 @@ import org.chromium.chrome.R; import org.chromium.chrome.browser.flags.ChromeFeatureList; import org.chromium.chrome.browser.flags.ChromeSwitches; +import org.chromium.chrome.browser.incognito.IncognitoUtils; import org.chromium.chrome.browser.incognito.interstitial.IncognitoInterstitialDelegate; import org.chromium.chrome.browser.signin.account_picker.AccountPickerBottomSheetCoordinator; import org.chromium.chrome.browser.signin.account_picker.AccountPickerDelegate; @@ -125,6 +126,7 @@ @Before public void setUp() { initMocks(this); + IncognitoUtils.setEnabledForTesting(true); mAccountManagerTestRule.addAccount(PROFILE_DATA1); mAccountManagerTestRule.addAccount(PROFILE_DATA2); } @@ -140,6 +142,27 @@ @MediumTest public void testExpandedSheet() { buildAndShowExpandedBottomSheet(); + // Since PROFILE_DATA1 exists also in the hidden view of the selected account, + // withEffectiveVisibility(VISIBLE) is needed here + onView(allOf(withText(PROFILE_DATA1.getAccountName()), withEffectiveVisibility(VISIBLE))) + .check(matches(isDisplayed())); + onView(allOf(withText(PROFILE_DATA1.getFullName()), withEffectiveVisibility(VISIBLE))) + .check(matches(isDisplayed())); + onView(withText(PROFILE_DATA2.getAccountName())).check(matches(isDisplayed())); + onView(withText(R.string.signin_add_account_to_device)).check(matches(isDisplayed())); + onView(withText(R.string.signin_incognito_button)).check(matches(isDisplayed())); + + onView(withId(R.id.account_picker_selected_account)).check(matches(not(isDisplayed()))); + onView(withId(R.id.account_picker_continue_as_button)).check(matches(not(isDisplayed()))); + } + + @Test + @MediumTest + public void testExpandedSheetWithIncognitoModeDisabled() { + IncognitoUtils.setEnabledForTesting(false); + buildAndShowExpandedBottomSheet(); + // Since PROFILE_DATA1 exists also in the hidden view of the selected account, + // withEffectiveVisibility(VISIBLE) is needed here onView(allOf(withText(PROFILE_DATA1.getAccountName()), withEffectiveVisibility(VISIBLE))) .check(matches(isDisplayed())); onView(allOf(withText(PROFILE_DATA1.getFullName()), withEffectiveVisibility(VISIBLE))) @@ -149,6 +172,7 @@ onView(withId(R.id.account_picker_selected_account)).check(matches(not(isDisplayed()))); onView(withId(R.id.account_picker_continue_as_button)).check(matches(not(isDisplayed()))); + onView(withText(R.string.signin_incognito_button)).check(doesNotExist()); } @Test
diff --git a/chrome/android/junit/src/org/chromium/chrome/browser/signin/account_picker/AccountPickerMediatorTest.java b/chrome/android/junit/src/org/chromium/chrome/browser/signin/account_picker/AccountPickerMediatorTest.java index 19aa68d..71638ec 100644 --- a/chrome/android/junit/src/org/chromium/chrome/browser/signin/account_picker/AccountPickerMediatorTest.java +++ b/chrome/android/junit/src/org/chromium/chrome/browser/signin/account_picker/AccountPickerMediatorTest.java
@@ -20,6 +20,7 @@ import org.robolectric.RuntimeEnvironment; import org.chromium.base.test.BaseRobolectricTestRunner; +import org.chromium.chrome.browser.incognito.IncognitoUtils; import org.chromium.chrome.browser.profiles.Profile; import org.chromium.chrome.browser.signin.DisplayableProfileData; import org.chromium.chrome.browser.signin.IdentityServicesProvider; @@ -70,6 +71,7 @@ .findExtendedAccountInfoForAccountWithRefreshTokenByEmailAddress( anyString())) .thenReturn(null); + IncognitoUtils.setEnabledForTesting(true); } @After @@ -77,6 +79,7 @@ if (mMediator != null) { mMediator.destroy(); } + IncognitoUtils.setEnabledForTesting(null); IdentityServicesProvider.setInstanceForTests(null); Profile.setLastUsedProfileForTesting(null); }
diff --git a/chrome/android/modules/chrome_bundle_tmpl.gni b/chrome/android/modules/chrome_bundle_tmpl.gni index bb25249..48fcb8c 100644 --- a/chrome/android/modules/chrome_bundle_tmpl.gni +++ b/chrome/android/modules/chrome_bundle_tmpl.gni
@@ -41,6 +41,7 @@ # - All //chrome-specific manifest definitions (e.g. activities, services) # will be moved to the chrome DFM AndroidManifest.xml. if (_enable_chrome_module) { + _base_target_name = get_label_info(invoker.base_module_target, "name") _base_target_gen_dir = get_label_info(invoker.base_module_target, "target_gen_dir") _base_name = get_label_info(invoker.base_module_target, "name") @@ -91,6 +92,13 @@ load_native_on_get_impl = false } _module_descs += [ chrome_module_desc ] + + # TODO(crbug.com/1126301): Isolated splits cause various bugs with resource + # access. For now, move all resources to the base module. + android_resources("${_base_target_name}__all_chrome_resources") { + recursive_resource_deps = true + deps = chrome_module_desc.java_deps + } } else { _module_descs = invoker.module_descs }
diff --git a/chrome/app/vector_icons/BUILD.gn b/chrome/app/vector_icons/BUILD.gn index 86dc8e1..a86330a 100644 --- a/chrome/app/vector_icons/BUILD.gn +++ b/chrome/app/vector_icons/BUILD.gn
@@ -32,6 +32,7 @@ "caret_down.icon", "caret_up.icon", "cast_for_education.icon", + "chevron_right.icon", "click_to_call_illustration.icon", "click_to_call_illustration_dark.icon", "close_all.icon",
diff --git a/chrome/app/vector_icons/chevron_right.icon b/chrome/app/vector_icons/chevron_right.icon new file mode 100644 index 0000000..76286a2 --- /dev/null +++ b/chrome/app/vector_icons/chevron_right.icon
@@ -0,0 +1,12 @@ +// Copyright 2020 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +CANVAS_DIMENSIONS, 24, +MOVE_TO, 7.59f, 18.59f, +LINE_TO, 9, 20, +R_LINE_TO, 8, -8, +R_LINE_TO, -8, -8, +R_LINE_TO, -1.41f, 1.41f, +LINE_TO, 14.17f, 12, +CLOSE
diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn index 3694307..eab74c78 100644 --- a/chrome/browser/BUILD.gn +++ b/chrome/browser/BUILD.gn
@@ -4469,8 +4469,6 @@ "net/net_error_diagnostics_dialog_win.cc", "net/service_providers_win.cc", "net/service_providers_win.h", - "notifications/win/notification_image_retainer.cc", - "notifications/win/notification_image_retainer.h", "notifications/win/notification_template_builder.cc", "notifications/win/notification_template_builder.h", "obsolete_system/obsolete_system_win.cc", @@ -4498,6 +4496,8 @@ "themes/theme_helper_win.cc", "themes/theme_helper_win.h", "upgrade_detector/get_installed_version_win.cc", + "webshare/win/share_operation.cc", + "webshare/win/share_operation.h", "webshare/win/show_share_ui_for_window_operation.cc", "webshare/win/show_share_ui_for_window_operation.h", "win/app_icon.cc", @@ -4863,6 +4863,8 @@ if (is_win || is_mac) { # Sources(generally "desktop OS importers") used only on Mac & Windows. sources += [ + "notifications/notification_image_retainer.cc", + "notifications/notification_image_retainer.h", "recovery/recovery_install_global_error.cc", "recovery/recovery_install_global_error.h", "recovery/recovery_install_global_error_factory.cc",
diff --git a/chrome/browser/about_flags.cc b/chrome/browser/about_flags.cc index 1669202..88fd57ee 100644 --- a/chrome/browser/about_flags.cc +++ b/chrome/browser/about_flags.cc
@@ -6623,6 +6623,10 @@ "SCTAuditingVariations")}, #endif // !defined(OS_ANDROID) + {"kaleidoscope-ntp-module", flag_descriptions::kKaleidoscopeModuleName, + flag_descriptions::kKaleidoscopeModuleDescription, kOsDesktop, + FEATURE_VALUE_TYPE(media::kKaleidoscopeModule)}, + // NOTE: Adding a new flag requires adding a corresponding entry to enum // "LoginCustomFlags" in tools/metrics/histograms/enums.xml. See "Flag // Histograms" in tools/metrics/histograms/README.md (run the
diff --git a/chrome/browser/chromeos/net/network_diagnostics/README.md b/chrome/browser/chromeos/net/network_diagnostics/README.md index bf4df48..8d82f7f 100644 --- a/chrome/browser/chromeos/net/network_diagnostics/README.md +++ b/chrome/browser/chromeos/net/network_diagnostics/README.md
@@ -156,9 +156,9 @@ Problems: * `kFailedDnsResolutions`: One or more DNS resolutions resulted in a failure. -* `kFailedHttpRequests`: One or more HTTPS requests resulted in a failure. -* `kSlightlyAboveThreshold`: Average HTTPS request latency is slightly above the expected threshold. -* `kSignificantlyAboveThreshold`: Average HTTPS request latency is significantly above the expected threshold. +* `kFailedHttpsRequests`: One or more HTTPS requests resulted in a failure. +* `kHighLatency`: HTTPS request latency is high. +* `kVeryHighLatency`: HTTPS request latency is very high. [Network Health and Configuration]: https://docs.google.com/document/d/10DSy-jZXaRo9I9aq1UqERy76t7HkgGvInWk57pHEkzg [network_diagnostics.mojom]: https://source.chromium.org/chromium/chromium/src/+/master:chromeos/services/network_health/public/mojom/network_diagnostics.mojom?originalUrl=https:%2F%2Fcs.chromium.org%2F
diff --git a/chrome/browser/devtools/devtools_contents_resizing_strategy.cc b/chrome/browser/devtools/devtools_contents_resizing_strategy.cc index 707921e7..b11cd814 100644 --- a/chrome/browser/devtools/devtools_contents_resizing_strategy.cc +++ b/chrome/browser/devtools/devtools_contents_resizing_strategy.cc
@@ -6,30 +6,28 @@ #include <algorithm> -#include "base/check_op.h" - -DevToolsContentsResizingStrategy::DevToolsContentsResizingStrategy() = default; +DevToolsContentsResizingStrategy::DevToolsContentsResizingStrategy() + : hide_inspected_contents_(false) { +} DevToolsContentsResizingStrategy::DevToolsContentsResizingStrategy( - const gfx::Rect& bounds, - bool is_docked) + const gfx::Rect& bounds) : bounds_(bounds), hide_inspected_contents_(bounds_.IsEmpty() && !bounds_.x() && - !bounds_.y()), - is_docked_(is_docked) {} + !bounds_.y()) { +} + void DevToolsContentsResizingStrategy::CopyFrom( const DevToolsContentsResizingStrategy& strategy) { bounds_ = strategy.bounds(); hide_inspected_contents_ = strategy.hide_inspected_contents(); - is_docked_ = strategy.is_docked(); } bool DevToolsContentsResizingStrategy::Equals( const DevToolsContentsResizingStrategy& strategy) { return bounds_ == strategy.bounds() && - hide_inspected_contents_ == strategy.hide_inspected_contents() && - is_docked_ == strategy.is_docked(); + hide_inspected_contents_ == strategy.hide_inspected_contents(); } void ApplyDevToolsContentsResizingStrategy( @@ -41,7 +39,6 @@ 0, 0, container_size.width(), container_size.height()); const gfx::Rect& bounds = strategy.bounds(); - if (bounds.size().IsEmpty() && !strategy.hide_inspected_contents()) { new_contents_bounds->SetRect( 0, 0, container_size.width(), container_size.height()); @@ -52,17 +49,5 @@ int top = std::min(bounds.y(), container_size.height()); int width = std::min(bounds.width(), container_size.width() - left); int height = std::min(bounds.height(), container_size.height() - top); - - if (strategy.is_docked()) { - // Devtools console requires at least 240 pixels when docked. - // https://cs.chromium.org/chromium/src/third_party/blink/renderer/devtools/front_end/ui/InspectorView.js?l=38&rcl=f8763532a3fe4f7d028f4cb23f56b289efbb70c0 - constexpr int kDevtoolsMinWidth = 240; - const int available_width = container_size.width() - left - width; - DCHECK_GE(available_width, 0); - if (available_width < kDevtoolsMinWidth) { - const int width_adjustment = kDevtoolsMinWidth - available_width; - width -= width_adjustment; - } - } new_contents_bounds->SetRect(left, top, width, height); }
diff --git a/chrome/browser/devtools/devtools_contents_resizing_strategy.h b/chrome/browser/devtools/devtools_contents_resizing_strategy.h index b472df7f..9a8d22c 100644 --- a/chrome/browser/devtools/devtools_contents_resizing_strategy.h +++ b/chrome/browser/devtools/devtools_contents_resizing_strategy.h
@@ -15,24 +15,21 @@ class DevToolsContentsResizingStrategy { public: DevToolsContentsResizingStrategy(); - DevToolsContentsResizingStrategy(const gfx::Rect& bounds, bool is_docked); + explicit DevToolsContentsResizingStrategy( + const gfx::Rect& bounds); void CopyFrom(const DevToolsContentsResizingStrategy& strategy); bool Equals(const DevToolsContentsResizingStrategy& strategy); const gfx::Rect& bounds() const { return bounds_; } bool hide_inspected_contents() const { return hide_inspected_contents_; } - bool is_docked() const { return is_docked_; } private: // Contents bounds. When non-empty, used instead of insets. gfx::Rect bounds_; - // Whether inspected contents is hidden. - bool hide_inspected_contents_ = false; - - // Whether devtools is docked. - bool is_docked_ = false; + // Determines whether inspected contents is visible. + bool hide_inspected_contents_; DISALLOW_COPY_AND_ASSIGN(DevToolsContentsResizingStrategy); };
diff --git a/chrome/browser/devtools/devtools_window.cc b/chrome/browser/devtools/devtools_window.cc index 3e85ed10..d6c3737 100644 --- a/chrome/browser/devtools/devtools_window.cc +++ b/chrome/browser/devtools/devtools_window.cc
@@ -1360,7 +1360,7 @@ } void DevToolsWindow::SetInspectedPageBounds(const gfx::Rect& rect) { - DevToolsContentsResizingStrategy strategy(rect, is_docked_); + DevToolsContentsResizingStrategy strategy(rect); if (contents_resizing_strategy_.Equals(strategy)) return;
diff --git a/chrome/browser/extensions/api/networking_config_chromeos_apitest_chromeos.cc b/chrome/browser/extensions/api/networking_config_chromeos_apitest_chromeos.cc index 18f851d..835c27f8 100644 --- a/chrome/browser/extensions/api/networking_config_chromeos_apitest_chromeos.cc +++ b/chrome/browser/extensions/api/networking_config_chromeos_apitest_chromeos.cc
@@ -142,12 +142,6 @@ << message_; } -IN_PROC_BROWSER_TEST_F(NetworkingConfigTest, RegisterNetworks) { - ASSERT_TRUE( - RunExtensionSubtest("networking_config", "register_networks.html")) - << message_; -} - // Test the full, positive flow starting with the extension registration and // ending with the captive portal being authenticated. IN_PROC_BROWSER_TEST_F(NetworkingConfigTest, FullTest) {
diff --git a/chrome/browser/flag-metadata.json b/chrome/browser/flag-metadata.json index 6b0099f..3785512 100644 --- a/chrome/browser/flag-metadata.json +++ b/chrome/browser/flag-metadata.json
@@ -2954,6 +2954,11 @@ "expiry_milestone": 90 }, { + "name": "kaleidoscope-ntp-module", + "owners": [ "beccahughes", "media-dev" ], + "expiry_milestone": 92 + }, + { "name": "lacros-support", "owners": [ "jamescook", "erikchen", "lacros-team@google.com" ], "expiry_milestone": 92
diff --git a/chrome/browser/flag_descriptions.cc b/chrome/browser/flag_descriptions.cc index dbef393..9c11055 100644 --- a/chrome/browser/flag_descriptions.cc +++ b/chrome/browser/flag_descriptions.cc
@@ -1307,6 +1307,11 @@ "conflict with the latest JavaScript features. This flag allows disabling " "support of those features for compatibility with such pages."; +const char kKaleidoscopeModuleName[] = "Enforce Kaleidoscope NTP module"; +const char kKaleidoscopeModuleDescription[] = + "Enable the Kaleidoscope NTP module to display Kaleidoscope content on the " + " New Tab Page."; + const char kLauncherSettingsSearchName[] = "Launcher settings search"; const char kLauncherSettingsSearchDescription[] = "Enable search results for OS settings in the launcher.";
diff --git a/chrome/browser/flag_descriptions.h b/chrome/browser/flag_descriptions.h index 0d76462..8235995 100644 --- a/chrome/browser/flag_descriptions.h +++ b/chrome/browser/flag_descriptions.h
@@ -764,6 +764,9 @@ extern const char kJavascriptHarmonyShippingName[]; extern const char kJavascriptHarmonyShippingDescription[]; +extern const char kKaleidoscopeModuleName[]; +extern const char kKaleidoscopeModuleDescription[]; + extern const char kLauncherSettingsSearchName[]; extern const char kLauncherSettingsSearchDescription[];
diff --git a/chrome/browser/loader/url_loader_factory_proxy_impl.cc b/chrome/browser/loader/url_loader_factory_proxy_impl.cc index c79f702..7ed7969e 100644 --- a/chrome/browser/loader/url_loader_factory_proxy_impl.cc +++ b/chrome/browser/loader/url_loader_factory_proxy_impl.cc
@@ -45,7 +45,7 @@ /*navigation_id=*/base::nullopt, base::UkmSourceId::FromInt64(frame_host->GetPageUkmSourceId()), &proxied_factory, - /*headber_client=*/nullptr); + /*header_client=*/nullptr); mojo::FusePipes(std::move(proxied_factory), std::move(original_factory)); }
diff --git a/chrome/browser/media/kaleidoscope/kaleidoscope_service.cc b/chrome/browser/media/kaleidoscope/kaleidoscope_service.cc index 0137554..04eab8f 100644 --- a/chrome/browser/media/kaleidoscope/kaleidoscope_service.cc +++ b/chrome/browser/media/kaleidoscope/kaleidoscope_service.cc
@@ -17,6 +17,7 @@ #include "chrome/browser/media/kaleidoscope/kaleidoscope_switches.h" #include "chrome/browser/profiles/profile.h" #include "components/prefs/pref_service.h" +#include "components/variations/net/variations_http_headers.h" #include "content/public/browser/storage_partition.h" #include "media/base/media_switches.h" #include "net/base/load_flags.h" @@ -95,6 +96,12 @@ resource_request->headers.SetHeader("X-Goog-Encode-Response-If-Executable", "base64"); + variations::AppendVariationsHeader( + resource_request->url, variations::InIncognito::kNo, + credentials->access_token.has_value() ? variations::SignedIn::kYes + : variations::SignedIn::kNo, + resource_request.get()); + resource_request->headers.SetHeader(net::HttpRequestHeaders::kContentType, kRequestContentType); pending_request_ = network::SimpleURLLoader::Create(
diff --git a/chrome/browser/notifications/notification_image_retainer.cc b/chrome/browser/notifications/notification_image_retainer.cc new file mode 100644 index 0000000..8bc3d6d --- /dev/null +++ b/chrome/browser/notifications/notification_image_retainer.cc
@@ -0,0 +1,198 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/browser/notifications/notification_image_retainer.h" + +#include <algorithm> +#include <set> + +#include "base/bind.h" +#include "base/files/file_enumerator.h" +#include "base/files/file_util.h" +#include "base/memory/ref_counted_memory.h" +#include "base/numerics/safe_conversions.h" +#include "base/path_service.h" +#include "base/stl_util.h" +#include "base/task/post_task.h" +#include "base/task/thread_pool.h" +#include "base/time/default_tick_clock.h" +#include "chrome/common/chrome_paths.h" +#include "ui/gfx/image/image.h" + +namespace { + +constexpr base::FilePath::CharType kImageRoot[] = + FILE_PATH_LITERAL("Notification Resources"); + +// How long to keep the temp files before deleting them. The formula for picking +// the delay is t * (n + 1), where t is the default on-screen display time for +// an Action Center notification (6 seconds) and n is the number of +// notifications that can be shown on-screen at once (1). +constexpr base::TimeDelta kDeletionDelay = base::TimeDelta::FromSeconds(12); + +// Returns the temporary directory within the user data directory. The regular +// temporary directory is not used to minimize the risk of files getting deleted +// by accident. It is also not profile-bound because the notification bridge +// is profile-agnostic. +base::FilePath DetermineImageDirectory() { + base::FilePath data_dir; + bool success = base::PathService::Get(chrome::DIR_USER_DATA, &data_dir); + DCHECK(success); + return data_dir.Append(kImageRoot); +} + +// Returns the full paths to all immediate file and directory children of |dir|, +// excluding those present in |registered_names|. +std::vector<base::FilePath> GetFilesFromPrevSessions( + const base::FilePath& dir, + const std::set<base::FilePath>& registered_names) { + // |dir| may have sub-dirs, created by the old implementation. + base::FileEnumerator file_enumerator( + dir, /*recursive=*/false, + base::FileEnumerator::FILES | base::FileEnumerator::DIRECTORIES, + FILE_PATH_LITERAL("*")); + std::vector<base::FilePath> files; + + for (base::FilePath current = file_enumerator.Next(); !current.empty(); + current = file_enumerator.Next()) { + // Exclude any new file created in this session. + if (!base::Contains(registered_names, current.BaseName())) + files.push_back(std::move(current)); + } + + return files; +} + +// Deletes files in |paths|. +void DeleteFiles(std::vector<base::FilePath> paths) { + // |file_path| can be a directory, created by the old implementation, so + // delete it recursively. + for (const auto& file_path : paths) + base::DeletePathRecursively(file_path); +} + +} // namespace + +NotificationImageRetainer::NotificationImageRetainer( + scoped_refptr<base::SequencedTaskRunner> deletion_task_runner, + const base::TickClock* tick_clock) + : deletion_task_runner_(std::move(deletion_task_runner)), + image_dir_(DetermineImageDirectory()), + tick_clock_(tick_clock), + deletion_timer_(tick_clock) { + DCHECK(deletion_task_runner_); + DCHECK(tick_clock); + + DETACH_FROM_SEQUENCE(sequence_checker_); +} + +NotificationImageRetainer::NotificationImageRetainer() + : NotificationImageRetainer( + base::ThreadPool::CreateSequencedTaskRunner( + {base::MayBlock(), base::TaskPriority::BEST_EFFORT, + base::TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN}), + base::DefaultTickClock::GetInstance()) {} + +NotificationImageRetainer::~NotificationImageRetainer() { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); +} + +void NotificationImageRetainer::CleanupFilesFromPrevSessions() { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + + // Store all file names from registered_images in an ordered set for quick + // search. + std::set<base::FilePath> registered_names; + for (const auto& pair : registered_images_) + registered_names.insert(pair.first); + + std::vector<base::FilePath> files = + GetFilesFromPrevSessions(image_dir_, registered_names); + + // This method is run in an "after startup" task, so it is fine to directly + // post the DeleteFiles task to the runner. + if (!files.empty()) { + deletion_task_runner_->PostTask( + FROM_HERE, base::BindOnce(&DeleteFiles, std::move(files))); + } +} + +base::FilePath NotificationImageRetainer::RegisterTemporaryImage( + const gfx::Image& image) { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + + scoped_refptr<base::RefCountedMemory> data = image.As1xPNGBytes(); + if (data->size() == 0) + return base::FilePath(); + + // Create the image directory. Since Chrome doesn't delete this directory + // after showing notifications, this directory creation should happen exactly + // once until Chrome is re-installed. + if (!base::CreateDirectory(image_dir_)) + return base::FilePath(); + + base::FilePath temp_file; + if (!base::CreateTemporaryFileInDir(image_dir_, &temp_file)) + return base::FilePath(); + + const base::TimeTicks now = tick_clock_->NowTicks(); + DCHECK(registered_images_.empty() || now >= registered_images_.back().second); + registered_images_.emplace_back(temp_file.BaseName(), now); + + // At this point, a temp file is already created. We need to clean it up even + // if it fails to write the image data to this file. + int data_len = base::checked_cast<int>(data->size()); + bool data_write_success = (base::WriteFile(temp_file, data->front_as<char>(), + data_len) == data_len); + + // Start the timer if it hasn't to delete the expired files in batch. This + // avoids creating a deletion task for each file, otherwise the overhead can + // be large when there is a steady stream of notifications coming rapidly. + if (!deletion_timer_.IsRunning()) { + deletion_timer_.Start( + FROM_HERE, kDeletionDelay, + base::BindRepeating(&NotificationImageRetainer::DeleteExpiredFiles, + weak_ptr_factory_.GetWeakPtr())); + } + + return data_write_success ? temp_file : base::FilePath(); +} + +base::OnceClosure NotificationImageRetainer::GetCleanupTask() { + return base::BindOnce( + &NotificationImageRetainer::CleanupFilesFromPrevSessions, + weak_ptr_factory_.GetWeakPtr()); +} + +void NotificationImageRetainer::DeleteExpiredFiles() { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + DCHECK(!registered_images_.empty()); + + // Find the first file that should not be deleted. + const base::TimeTicks then = tick_clock_->NowTicks() - kDeletionDelay; + const auto end = + std::upper_bound(registered_images_.begin(), registered_images_.end(), + std::make_pair(base::FilePath(), then), + [](const NameAndTime& a, const NameAndTime& b) { + return a.second < b.second; + }); + if (end == registered_images_.begin()) + return; // Nothing to delete yet. + + // Ship the files to be deleted off to the deletion task runner. + std::vector<base::FilePath> files_to_delete; + files_to_delete.reserve(end - registered_images_.begin()); + for (auto iter = registered_images_.begin(); iter < end; ++iter) + files_to_delete.push_back(image_dir_.Append(iter->first)); + + deletion_task_runner_->PostTask( + FROM_HERE, base::BindOnce(&DeleteFiles, std::move(files_to_delete))); + + // Erase the items to be deleted from registered_images_. + registered_images_.erase(registered_images_.begin(), end); + + // Stop the recurring timer if all files have been deleted. + if (registered_images_.empty()) + deletion_timer_.Stop(); +}
diff --git a/chrome/browser/notifications/notification_image_retainer.h b/chrome/browser/notifications/notification_image_retainer.h new file mode 100644 index 0000000..d16c352 --- /dev/null +++ b/chrome/browser/notifications/notification_image_retainer.h
@@ -0,0 +1,98 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_IMAGE_RETAINER_H_ +#define CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_IMAGE_RETAINER_H_ + +#include <memory> +#include <utility> +#include <vector> + +#include "base/callback.h" +#include "base/files/file_path.h" +#include "base/memory/scoped_refptr.h" +#include "base/memory/weak_ptr.h" +#include "base/sequence_checker.h" +#include "base/sequenced_task_runner.h" +#include "base/time/tick_clock.h" +#include "base/time/time.h" +#include "base/timer/timer.h" + +namespace gfx { +class Image; +} // namespace gfx + +// The purpose of this class is to take data from memory, store it to disk as +// temp files and keep them alive long enough to hand over to external entities, +// such as the Action Center on Windows. The Action Center will read the files +// at some point in the future, which is why we can't do: +// [write file] -> [show notification] -> [delete file]. +// +// Also, on Windows, temp file deletion is not guaranteed and, since the images +// can potentially be large, this presents a problem because Chrome might then +// be leaving chunks of dead bits lying around on users' computers during +// unclean shutdowns. +class NotificationImageRetainer { + public: + NotificationImageRetainer( + scoped_refptr<base::SequencedTaskRunner> deletion_task_runner, + const base::TickClock* tick_clock); + + NotificationImageRetainer(const NotificationImageRetainer&) = delete; + NotificationImageRetainer& operator=(const NotificationImageRetainer&) = + delete; + NotificationImageRetainer(); + virtual ~NotificationImageRetainer(); + + // Deletes all the remaining files in image_dir_ due to previous unclean + // shutdowns. + virtual void CleanupFilesFromPrevSessions(); + + // Stores an |image| on disk in a temporary (short-lived) file. Returns the + // path to the file created, which will be valid for a few seconds only. It + // will be deleted either after a short timeout or after a restart of Chrome. + // The function returns an empty FilePath if file creation fails. + virtual base::FilePath RegisterTemporaryImage(const gfx::Image& image); + + // Returns a closure that, when run, performs cleanup operations. This closure + // must be run on the notification sequence. + base::OnceClosure GetCleanupTask(); + + const base::FilePath& image_dir() { return image_dir_; } + + private: + using NameAndTime = std::pair<base::FilePath, base::TimeTicks>; + using NamesAndTimes = std::vector<NameAndTime>; + + // Deletes expired (older than a pre-defined threshold) files. + void DeleteExpiredFiles(); + + // A collection of names (note: not full paths) to registered image files + // in image_dir_, each of which must stay valid for a short time while the + // Notification Center processes them. Each file has a corresponding + // registration timestamp. Files in this collection that have outlived the + // required minimum lifespan are scheduled for deletion periodically by + // |deletion_timer_|. The items in this collection are sorted by increasing + // registration time. + NamesAndTimes registered_images_; + + // The task runner used to handle file deletion. + scoped_refptr<base::SequencedTaskRunner> deletion_task_runner_; + + // The path to where to store the temporary files. + const base::FilePath image_dir_; + + // Not owned. + const base::TickClock* const tick_clock_; + + // A timer used to handle deleting files in batch. + base::RepeatingTimer deletion_timer_; + + SEQUENCE_CHECKER(sequence_checker_); + + // For callbacks may run after destruction. + base::WeakPtrFactory<NotificationImageRetainer> weak_ptr_factory_{this}; +}; + +#endif // CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_IMAGE_RETAINER_H_
diff --git a/chrome/browser/notifications/notification_image_retainer_unittest.cc b/chrome/browser/notifications/notification_image_retainer_unittest.cc new file mode 100644 index 0000000..7a18263 --- /dev/null +++ b/chrome/browser/notifications/notification_image_retainer_unittest.cc
@@ -0,0 +1,167 @@ +// Copyright 2017 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/browser/notifications/notification_image_retainer.h" + +#include "base/files/file_path.h" +#include "base/files/file_util.h" +#include "base/run_loop.h" +#include "base/test/scoped_path_override.h" +#include "base/test/task_environment.h" +#include "chrome/common/chrome_paths.h" +#include "testing/gtest/include/gtest/gtest.h" +#include "third_party/skia/include/core/SkBitmap.h" +#include "ui/gfx/image/image.h" + +namespace { + +// This value has to stay in sync with that in notification_image_retainer.cc. +constexpr base::TimeDelta kDeletionDelay = base::TimeDelta::FromSeconds(12); + +} // namespace + +class NotificationImageRetainerTest : public ::testing::Test { + public: + NotificationImageRetainerTest() + : task_environment_(base::test::TaskEnvironment::TimeSource::MOCK_TIME), + user_data_dir_override_(chrome::DIR_USER_DATA) {} + + NotificationImageRetainerTest(const NotificationImageRetainerTest&) = delete; + NotificationImageRetainerTest& operator=( + const NotificationImageRetainerTest&) = delete; + ~NotificationImageRetainerTest() override = default; + + protected: + base::test::TaskEnvironment task_environment_; + + private: + base::ScopedPathOverride user_data_dir_override_; +}; + +TEST_F(NotificationImageRetainerTest, RegisterTemporaryImage) { + auto image_retainer = std::make_unique<NotificationImageRetainer>( + task_environment_.GetMainThreadTaskRunner(), + task_environment_.GetMockTickClock()); + + SkBitmap icon; + icon.allocN32Pixels(64, 64); + icon.eraseARGB(255, 100, 150, 200); + gfx::Image image = gfx::Image::CreateFrom1xBitmap(icon); + + base::FilePath temp_file = image_retainer->RegisterTemporaryImage(image); + ASSERT_FALSE(temp_file.empty()); + ASSERT_TRUE(base::PathExists(temp_file)); + + // Fast-forward the task runner so that the file deletion task posted in + // RegisterTemporaryImage() finishes running. + task_environment_.FastForwardBy(kDeletionDelay); + + // The temp file should be deleted now. + ASSERT_FALSE(base::PathExists(temp_file)); + + // The destruction of the image retainer object won't delete the image + // directory. + image_retainer.reset(); + ASSERT_TRUE(base::PathExists(temp_file.DirName())); +} + +TEST_F(NotificationImageRetainerTest, DeleteFilesInBatch) { + auto image_retainer = std::make_unique<NotificationImageRetainer>( + task_environment_.GetMainThreadTaskRunner(), + task_environment_.GetMockTickClock()); + + SkBitmap icon; + icon.allocN32Pixels(64, 64); + icon.eraseARGB(255, 100, 150, 200); + gfx::Image image = gfx::Image::CreateFrom1xBitmap(icon); + + // Create 1st image file on disk. + base::FilePath temp_file1 = image_retainer->RegisterTemporaryImage(image); + ASSERT_FALSE(temp_file1.empty()); + ASSERT_TRUE(base::PathExists(temp_file1)); + + // Simulate ticking of the clock so that the next image file has a different + // registration time. + task_environment_.FastForwardBy(base::TimeDelta::FromSeconds(1)); + + // Create 2nd image file on disk. + base::FilePath temp_file2 = image_retainer->RegisterTemporaryImage(image); + ASSERT_FALSE(temp_file2.empty()); + ASSERT_TRUE(base::PathExists(temp_file2)); + + // Simulate ticking of the clock so that the next image file has a different + // registration time. + task_environment_.FastForwardBy(base::TimeDelta::FromSeconds(1)); + + // Create 3rd image file on disk. + base::FilePath temp_file3 = image_retainer->RegisterTemporaryImage(image); + ASSERT_FALSE(temp_file3.empty()); + ASSERT_TRUE(base::PathExists(temp_file3)); + + // Fast-forward the task runner by kDeletionDelay. The first temp file should + // be deleted now, while the other two should still be around. + task_environment_.FastForwardBy(kDeletionDelay); + ASSERT_FALSE(base::PathExists(temp_file1)); + ASSERT_TRUE(base::PathExists(temp_file2)); + ASSERT_TRUE(base::PathExists(temp_file3)); + + // Fast-forward the task runner again. The second and the third temp files + // are deleted simultaneously. + task_environment_.FastForwardBy(kDeletionDelay); + ASSERT_FALSE(base::PathExists(temp_file2)); + ASSERT_FALSE(base::PathExists(temp_file3)); +} + +TEST_F(NotificationImageRetainerTest, CleanupFilesFromPrevSessions) { + auto image_retainer = std::make_unique<NotificationImageRetainer>( + task_environment_.GetMainThreadTaskRunner(), + task_environment_.GetMockTickClock()); + + const base::FilePath& image_dir = image_retainer->image_dir(); + ASSERT_TRUE(base::CreateDirectory(image_dir)); + + // Create two temp files as if they were created in previous sessions. + base::FilePath temp_file1; + ASSERT_TRUE(base::CreateTemporaryFileInDir(image_dir, &temp_file1)); + + base::FilePath temp_file2; + ASSERT_TRUE(base::CreateTemporaryFileInDir(image_dir, &temp_file2)); + + ASSERT_TRUE(base::PathExists(temp_file1)); + ASSERT_TRUE(base::PathExists(temp_file2)); + + // Create a new temp file in the current session. This file will be scheduled + // to delete after kDeletionDelay seconds. + SkBitmap icon; + icon.allocN32Pixels(64, 64); + icon.eraseARGB(255, 100, 150, 200); + gfx::Image image = gfx::Image::CreateFrom1xBitmap(icon); + + base::FilePath temp_file3 = image_retainer->RegisterTemporaryImage(image); + ASSERT_FALSE(temp_file3.empty()); + ASSERT_TRUE(base::PathExists(temp_file3)); + + // Schedule a file cleanup task. + image_retainer->CleanupFilesFromPrevSessions(); + + // Now the file cleanup task finishes running. + task_environment_.RunUntilIdle(); + + // The two temp files from previous sessions should be deleted now. + ASSERT_FALSE(base::PathExists(temp_file1)); + ASSERT_FALSE(base::PathExists(temp_file2)); + + // The temp file created in this session should still be around. + ASSERT_TRUE(base::PathExists(temp_file3)); + + // Fast-forward the task runner so that the file deletion task posted in + // RegisterTemporaryImage() finishes running. + task_environment_.FastForwardBy(kDeletionDelay); + + // The temp file created in this session should be deleted now. + ASSERT_FALSE(base::PathExists(temp_file3)); + + // The image directory should still be around. + ASSERT_TRUE(base::PathExists(image_dir)); +}
diff --git a/chrome/browser/notifications/notification_platform_bridge_win.cc b/chrome/browser/notifications/notification_platform_bridge_win.cc index 69ecf8d..765b2ab 100644 --- a/chrome/browser/notifications/notification_platform_bridge_win.cc +++ b/chrome/browser/notifications/notification_platform_bridge_win.cc
@@ -32,7 +32,7 @@ #include "chrome/browser/notifications/notification_common.h" #include "chrome/browser/notifications/notification_display_service_impl.h" #include "chrome/browser/notifications/notification_handler.h" -#include "chrome/browser/notifications/win/notification_image_retainer.h" +#include "chrome/browser/notifications/notification_image_retainer.h" #include "chrome/browser/notifications/win/notification_metrics.h" #include "chrome/browser/notifications/win/notification_template_builder.h" #include "chrome/browser/notifications/win/notification_util.h"
diff --git a/chrome/browser/notifications/win/fake_notification_image_retainer.h b/chrome/browser/notifications/win/fake_notification_image_retainer.h index 824b210d..5ec97fa 100644 --- a/chrome/browser/notifications/win/fake_notification_image_retainer.h +++ b/chrome/browser/notifications/win/fake_notification_image_retainer.h
@@ -5,7 +5,7 @@ #ifndef CHROME_BROWSER_NOTIFICATIONS_WIN_FAKE_NOTIFICATION_IMAGE_RETAINER_H_ #define CHROME_BROWSER_NOTIFICATIONS_WIN_FAKE_NOTIFICATION_IMAGE_RETAINER_H_ -#include "chrome/browser/notifications/win/notification_image_retainer.h" +#include "chrome/browser/notifications/notification_image_retainer.h" namespace gfx { class Image;
diff --git a/chrome/browser/notifications/win/notification_image_retainer.cc b/chrome/browser/notifications/win/notification_image_retainer.cc deleted file mode 100644 index 00ed20ff..0000000 --- a/chrome/browser/notifications/win/notification_image_retainer.cc +++ /dev/null
@@ -1,198 +0,0 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "chrome/browser/notifications/win/notification_image_retainer.h" - -#include <algorithm> -#include <set> - -#include "base/bind.h" -#include "base/files/file_enumerator.h" -#include "base/files/file_util.h" -#include "base/memory/ref_counted_memory.h" -#include "base/numerics/safe_conversions.h" -#include "base/path_service.h" -#include "base/stl_util.h" -#include "base/task/post_task.h" -#include "base/task/thread_pool.h" -#include "base/time/default_tick_clock.h" -#include "chrome/common/chrome_paths.h" -#include "ui/gfx/image/image.h" - -namespace { - -constexpr base::FilePath::CharType kImageRoot[] = - FILE_PATH_LITERAL("Notification Resources"); - -// How long to keep the temp files before deleting them. The formula for picking -// the delay is t * (n + 1), where t is the default on-screen display time for -// an Action Center notification (6 seconds) and n is the number of -// notifications that can be shown on-screen at once (1). -constexpr base::TimeDelta kDeletionDelay = base::TimeDelta::FromSeconds(12); - -// Returns the temporary directory within the user data directory. The regular -// temporary directory is not used to minimize the risk of files getting deleted -// by accident. It is also not profile-bound because the notification bridge -// is profile-agnostic. -base::FilePath DetermineImageDirectory() { - base::FilePath data_dir; - bool success = base::PathService::Get(chrome::DIR_USER_DATA, &data_dir); - DCHECK(success); - return data_dir.Append(kImageRoot); -} - -// Returns the full paths to all immediate file and directory children of |dir|, -// excluding those present in |registered_names|. -std::vector<base::FilePath> GetFilesFromPrevSessions( - const base::FilePath& dir, - const std::set<base::FilePath>& registered_names) { - // |dir| may have sub-dirs, created by the old implementation. - base::FileEnumerator file_enumerator( - dir, /*recursive=*/false, - base::FileEnumerator::FILES | base::FileEnumerator::DIRECTORIES, - FILE_PATH_LITERAL("*")); - std::vector<base::FilePath> files; - - for (base::FilePath current = file_enumerator.Next(); !current.empty(); - current = file_enumerator.Next()) { - // Exclude any new file created in this session. - if (!base::Contains(registered_names, current.BaseName())) - files.push_back(std::move(current)); - } - - return files; -} - -// Deletes files in |paths|. -void DeleteFiles(std::vector<base::FilePath> paths) { - // |file_path| can be a directory, created by the old implementation, so - // delete it recursively. - for (const auto& file_path : paths) - base::DeletePathRecursively(file_path); -} - -} // namespace - -NotificationImageRetainer::NotificationImageRetainer( - scoped_refptr<base::SequencedTaskRunner> deletion_task_runner, - const base::TickClock* tick_clock) - : deletion_task_runner_(std::move(deletion_task_runner)), - image_dir_(DetermineImageDirectory()), - tick_clock_(tick_clock), - deletion_timer_(tick_clock) { - DCHECK(deletion_task_runner_); - DCHECK(tick_clock); - - DETACH_FROM_SEQUENCE(sequence_checker_); -} - -NotificationImageRetainer::NotificationImageRetainer() - : NotificationImageRetainer( - base::ThreadPool::CreateSequencedTaskRunner( - {base::MayBlock(), base::TaskPriority::BEST_EFFORT, - base::TaskShutdownBehavior::CONTINUE_ON_SHUTDOWN}), - base::DefaultTickClock::GetInstance()) {} - -NotificationImageRetainer::~NotificationImageRetainer() { - DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); -} - -void NotificationImageRetainer::CleanupFilesFromPrevSessions() { - DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - - // Store all file names from registered_images in an ordered set for quick - // search. - std::set<base::FilePath> registered_names; - for (const auto& pair : registered_images_) - registered_names.insert(pair.first); - - std::vector<base::FilePath> files = - GetFilesFromPrevSessions(image_dir_, registered_names); - - // This method is run in an "after startup" task, so it is fine to directly - // post the DeleteFiles task to the runner. - if (!files.empty()) { - deletion_task_runner_->PostTask( - FROM_HERE, base::BindOnce(&DeleteFiles, std::move(files))); - } -} - -base::FilePath NotificationImageRetainer::RegisterTemporaryImage( - const gfx::Image& image) { - DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - - scoped_refptr<base::RefCountedMemory> data = image.As1xPNGBytes(); - if (data->size() == 0) - return base::FilePath(); - - // Create the image directory. Since Chrome doesn't delete this directory - // after showing notifications, this directory creation should happen exactly - // once until Chrome is re-installed. - if (!base::CreateDirectory(image_dir_)) - return base::FilePath(); - - base::FilePath temp_file; - if (!base::CreateTemporaryFileInDir(image_dir_, &temp_file)) - return base::FilePath(); - - const base::TimeTicks now = tick_clock_->NowTicks(); - DCHECK(registered_images_.empty() || now >= registered_images_.back().second); - registered_images_.emplace_back(temp_file.BaseName(), now); - - // At this point, a temp file is already created. We need to clean it up even - // if it fails to write the image data to this file. - int data_len = base::checked_cast<int>(data->size()); - bool data_write_success = (base::WriteFile(temp_file, data->front_as<char>(), - data_len) == data_len); - - // Start the timer if it hasn't to delete the expired files in batch. This - // avoids creating a deletion task for each file, otherwise the overhead can - // be large when there is a steady stream of notifications coming rapidly. - if (!deletion_timer_.IsRunning()) { - deletion_timer_.Start( - FROM_HERE, kDeletionDelay, - base::BindRepeating(&NotificationImageRetainer::DeleteExpiredFiles, - weak_ptr_factory_.GetWeakPtr())); - } - - return data_write_success ? temp_file : base::FilePath(); -} - -base::OnceClosure NotificationImageRetainer::GetCleanupTask() { - return base::BindOnce( - &NotificationImageRetainer::CleanupFilesFromPrevSessions, - weak_ptr_factory_.GetWeakPtr()); -} - -void NotificationImageRetainer::DeleteExpiredFiles() { - DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - DCHECK(!registered_images_.empty()); - - // Find the first file that should not be deleted. - const base::TimeTicks then = tick_clock_->NowTicks() - kDeletionDelay; - const auto end = - std::upper_bound(registered_images_.begin(), registered_images_.end(), - std::make_pair(base::FilePath(), then), - [](const NameAndTime& a, const NameAndTime& b) { - return a.second < b.second; - }); - if (end == registered_images_.begin()) - return; // Nothing to delete yet. - - // Ship the files to be deleted off to the deletion task runner. - std::vector<base::FilePath> files_to_delete; - files_to_delete.reserve(end - registered_images_.begin()); - for (auto iter = registered_images_.begin(); iter < end; ++iter) - files_to_delete.push_back(image_dir_.Append(iter->first)); - - deletion_task_runner_->PostTask( - FROM_HERE, base::BindOnce(&DeleteFiles, std::move(files_to_delete))); - - // Erase the items to be deleted from registered_images_. - registered_images_.erase(registered_images_.begin(), end); - - // Stop the recurring timer if all files have been deleted. - if (registered_images_.empty()) - deletion_timer_.Stop(); -}
diff --git a/chrome/browser/notifications/win/notification_image_retainer.h b/chrome/browser/notifications/win/notification_image_retainer.h deleted file mode 100644 index 5bf298b..0000000 --- a/chrome/browser/notifications/win/notification_image_retainer.h +++ /dev/null
@@ -1,98 +0,0 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef CHROME_BROWSER_NOTIFICATIONS_WIN_NOTIFICATION_IMAGE_RETAINER_H_ -#define CHROME_BROWSER_NOTIFICATIONS_WIN_NOTIFICATION_IMAGE_RETAINER_H_ - -#include <memory> -#include <utility> -#include <vector> - -#include "base/callback.h" -#include "base/files/file_path.h" -#include "base/memory/scoped_refptr.h" -#include "base/memory/weak_ptr.h" -#include "base/sequence_checker.h" -#include "base/sequenced_task_runner.h" -#include "base/time/tick_clock.h" -#include "base/time/time.h" -#include "base/timer/timer.h" - -namespace gfx { -class Image; -} // namespace gfx - -// The purpose of this class is to take data from memory, store it to disk as -// temp files and keep them alive long enough to hand over to external entities, -// such as the Action Center on Windows. The Action Center will read the files -// at some point in the future, which is why we can't do: -// [write file] -> [show notification] -> [delete file]. -// -// Also, on Windows, temp file deletion is not guaranteed and, since the images -// can potentially be large, this presents a problem because Chrome might then -// be leaving chunks of dead bits lying around on users' computers during -// unclean shutdowns. -class NotificationImageRetainer { - public: - NotificationImageRetainer( - scoped_refptr<base::SequencedTaskRunner> deletion_task_runner, - const base::TickClock* tick_clock); - - NotificationImageRetainer(const NotificationImageRetainer&) = delete; - NotificationImageRetainer& operator=(const NotificationImageRetainer&) = - delete; - NotificationImageRetainer(); - virtual ~NotificationImageRetainer(); - - // Deletes all the remaining files in image_dir_ due to previous unclean - // shutdowns. - virtual void CleanupFilesFromPrevSessions(); - - // Stores an |image| on disk in a temporary (short-lived) file. Returns the - // path to the file created, which will be valid for a few seconds only. It - // will be deleted either after a short timeout or after a restart of Chrome. - // The function returns an empty FilePath if file creation fails. - virtual base::FilePath RegisterTemporaryImage(const gfx::Image& image); - - // Returns a closure that, when run, performs cleanup operations. This closure - // must be run on the notification sequence. - base::OnceClosure GetCleanupTask(); - - const base::FilePath& image_dir() { return image_dir_; } - - private: - using NameAndTime = std::pair<base::FilePath, base::TimeTicks>; - using NamesAndTimes = std::vector<NameAndTime>; - - // Deletes expired (older than a pre-defined threshold) files. - void DeleteExpiredFiles(); - - // A collection of names (note: not full paths) to registered image files - // in image_dir_, each of which must stay valid for a short time while the - // Notification Center processes them. Each file has a corresponding - // registration timestamp. Files in this collection that have outlived the - // required minimum lifespan are scheduled for deletion periodically by - // |deletion_timer_|. The items in this collection are sorted by increasing - // registration time. - NamesAndTimes registered_images_; - - // The task runner used to handle file deletion. - scoped_refptr<base::SequencedTaskRunner> deletion_task_runner_; - - // The path to where to store the temporary files. - const base::FilePath image_dir_; - - // Not owned. - const base::TickClock* const tick_clock_; - - // A timer used to handle deleting files in batch. - base::RepeatingTimer deletion_timer_; - - SEQUENCE_CHECKER(sequence_checker_); - - // For callbacks may run after destruction. - base::WeakPtrFactory<NotificationImageRetainer> weak_ptr_factory_{this}; -}; - -#endif // CHROME_BROWSER_NOTIFICATIONS_WIN_NOTIFICATION_IMAGE_RETAINER_H_
diff --git a/chrome/browser/notifications/win/notification_image_retainer_unittest.cc b/chrome/browser/notifications/win/notification_image_retainer_unittest.cc deleted file mode 100644 index cc038ce..0000000 --- a/chrome/browser/notifications/win/notification_image_retainer_unittest.cc +++ /dev/null
@@ -1,167 +0,0 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "chrome/browser/notifications/win/notification_image_retainer.h" - -#include "base/files/file_path.h" -#include "base/files/file_util.h" -#include "base/run_loop.h" -#include "base/test/scoped_path_override.h" -#include "base/test/task_environment.h" -#include "chrome/common/chrome_paths.h" -#include "testing/gtest/include/gtest/gtest.h" -#include "third_party/skia/include/core/SkBitmap.h" -#include "ui/gfx/image/image.h" - -namespace { - -// This value has to stay in sync with that in notification_image_retainer.cc. -constexpr base::TimeDelta kDeletionDelay = base::TimeDelta::FromSeconds(12); - -} // namespace - -class NotificationImageRetainerTest : public ::testing::Test { - public: - NotificationImageRetainerTest() - : task_environment_(base::test::TaskEnvironment::TimeSource::MOCK_TIME), - user_data_dir_override_(chrome::DIR_USER_DATA) {} - - NotificationImageRetainerTest(const NotificationImageRetainerTest&) = delete; - NotificationImageRetainerTest& operator=( - const NotificationImageRetainerTest&) = delete; - ~NotificationImageRetainerTest() override = default; - - protected: - base::test::TaskEnvironment task_environment_; - - private: - base::ScopedPathOverride user_data_dir_override_; -}; - -TEST_F(NotificationImageRetainerTest, RegisterTemporaryImage) { - auto image_retainer = std::make_unique<NotificationImageRetainer>( - task_environment_.GetMainThreadTaskRunner(), - task_environment_.GetMockTickClock()); - - SkBitmap icon; - icon.allocN32Pixels(64, 64); - icon.eraseARGB(255, 100, 150, 200); - gfx::Image image = gfx::Image::CreateFrom1xBitmap(icon); - - base::FilePath temp_file = image_retainer->RegisterTemporaryImage(image); - ASSERT_FALSE(temp_file.empty()); - ASSERT_TRUE(base::PathExists(temp_file)); - - // Fast-forward the task runner so that the file deletion task posted in - // RegisterTemporaryImage() finishes running. - task_environment_.FastForwardBy(kDeletionDelay); - - // The temp file should be deleted now. - ASSERT_FALSE(base::PathExists(temp_file)); - - // The destruction of the image retainer object won't delete the image - // directory. - image_retainer.reset(); - ASSERT_TRUE(base::PathExists(temp_file.DirName())); -} - -TEST_F(NotificationImageRetainerTest, DeleteFilesInBatch) { - auto image_retainer = std::make_unique<NotificationImageRetainer>( - task_environment_.GetMainThreadTaskRunner(), - task_environment_.GetMockTickClock()); - - SkBitmap icon; - icon.allocN32Pixels(64, 64); - icon.eraseARGB(255, 100, 150, 200); - gfx::Image image = gfx::Image::CreateFrom1xBitmap(icon); - - // Create 1st image file on disk. - base::FilePath temp_file1 = image_retainer->RegisterTemporaryImage(image); - ASSERT_FALSE(temp_file1.empty()); - ASSERT_TRUE(base::PathExists(temp_file1)); - - // Simulate ticking of the clock so that the next image file has a different - // registration time. - task_environment_.FastForwardBy(base::TimeDelta::FromSeconds(1)); - - // Create 2nd image file on disk. - base::FilePath temp_file2 = image_retainer->RegisterTemporaryImage(image); - ASSERT_FALSE(temp_file2.empty()); - ASSERT_TRUE(base::PathExists(temp_file2)); - - // Simulate ticking of the clock so that the next image file has a different - // registration time. - task_environment_.FastForwardBy(base::TimeDelta::FromSeconds(1)); - - // Create 3rd image file on disk. - base::FilePath temp_file3 = image_retainer->RegisterTemporaryImage(image); - ASSERT_FALSE(temp_file3.empty()); - ASSERT_TRUE(base::PathExists(temp_file3)); - - // Fast-forward the task runner by kDeletionDelay. The first temp file should - // be deleted now, while the other two should still be around. - task_environment_.FastForwardBy(kDeletionDelay); - ASSERT_FALSE(base::PathExists(temp_file1)); - ASSERT_TRUE(base::PathExists(temp_file2)); - ASSERT_TRUE(base::PathExists(temp_file3)); - - // Fast-forward the task runner again. The second and the third temp files - // are deleted simultaneously. - task_environment_.FastForwardBy(kDeletionDelay); - ASSERT_FALSE(base::PathExists(temp_file2)); - ASSERT_FALSE(base::PathExists(temp_file3)); -} - -TEST_F(NotificationImageRetainerTest, CleanupFilesFromPrevSessions) { - auto image_retainer = std::make_unique<NotificationImageRetainer>( - task_environment_.GetMainThreadTaskRunner(), - task_environment_.GetMockTickClock()); - - const base::FilePath& image_dir = image_retainer->image_dir(); - ASSERT_TRUE(base::CreateDirectory(image_dir)); - - // Create two temp files as if they were created in previous sessions. - base::FilePath temp_file1; - ASSERT_TRUE(base::CreateTemporaryFileInDir(image_dir, &temp_file1)); - - base::FilePath temp_file2; - ASSERT_TRUE(base::CreateTemporaryFileInDir(image_dir, &temp_file2)); - - ASSERT_TRUE(base::PathExists(temp_file1)); - ASSERT_TRUE(base::PathExists(temp_file2)); - - // Create a new temp file in the current session. This file will be scheduled - // to delete after kDeletionDelay seconds. - SkBitmap icon; - icon.allocN32Pixels(64, 64); - icon.eraseARGB(255, 100, 150, 200); - gfx::Image image = gfx::Image::CreateFrom1xBitmap(icon); - - base::FilePath temp_file3 = image_retainer->RegisterTemporaryImage(image); - ASSERT_FALSE(temp_file3.empty()); - ASSERT_TRUE(base::PathExists(temp_file3)); - - // Schedule a file cleanup task. - image_retainer->CleanupFilesFromPrevSessions(); - - // Now the file cleanup task finishes running. - task_environment_.RunUntilIdle(); - - // The two temp files from previous sessions should be deleted now. - ASSERT_FALSE(base::PathExists(temp_file1)); - ASSERT_FALSE(base::PathExists(temp_file2)); - - // The temp file created in this session should still be around. - ASSERT_TRUE(base::PathExists(temp_file3)); - - // Fast-forward the task runner so that the file deletion task posted in - // RegisterTemporaryImage() finishes running. - task_environment_.FastForwardBy(kDeletionDelay); - - // The temp file created in this session should be deleted now. - ASSERT_FALSE(base::PathExists(temp_file3)); - - // The image directory should still be around. - ASSERT_TRUE(base::PathExists(image_dir)); -}
diff --git a/chrome/browser/notifications/win/notification_template_builder.cc b/chrome/browser/notifications/win/notification_template_builder.cc index cc0fc7a9..1728a1c 100644 --- a/chrome/browser/notifications/win/notification_template_builder.cc +++ b/chrome/browser/notifications/win/notification_template_builder.cc
@@ -17,7 +17,7 @@ #include "base/strings/stringprintf.h" #include "base/strings/utf_string_conversions.h" #include "base/time/time.h" -#include "chrome/browser/notifications/win/notification_image_retainer.h" +#include "chrome/browser/notifications/notification_image_retainer.h" #include "chrome/browser/notifications/win/notification_launch_id.h" #include "chrome/common/chrome_features.h" #include "chrome/grit/chromium_strings.h"
diff --git a/chrome/browser/paint_preview/BUILD.gn b/chrome/browser/paint_preview/BUILD.gn index c83f8b3..ef93b54 100644 --- a/chrome/browser/paint_preview/BUILD.gn +++ b/chrome/browser/paint_preview/BUILD.gn
@@ -4,10 +4,6 @@ source_set("services") { sources = [ - "services/paint_preview_demo_service.cc", - "services/paint_preview_demo_service.h", - "services/paint_preview_demo_service_factory.cc", - "services/paint_preview_demo_service_factory.h", "services/paint_preview_tab_service.cc", "services/paint_preview_tab_service.h", "services/paint_preview_tab_service_factory.cc",
diff --git a/chrome/browser/paint_preview/android/BUILD.gn b/chrome/browser/paint_preview/android/BUILD.gn index 6c1a6e0..b3eb9829 100644 --- a/chrome/browser/paint_preview/android/BUILD.gn +++ b/chrome/browser/paint_preview/android/BUILD.gn
@@ -7,8 +7,6 @@ generate_jni("jni_headers") { sources = [ "java/src/org/chromium/chrome/browser/paint_preview/PaintPreviewCompositorUtils.java", - "java/src/org/chromium/chrome/browser/paint_preview/services/PaintPreviewDemoService.java", - "java/src/org/chromium/chrome/browser/paint_preview/services/PaintPreviewDemoServiceFactory.java", "java/src/org/chromium/chrome/browser/paint_preview/services/PaintPreviewTabService.java", "java/src/org/chromium/chrome/browser/paint_preview/services/PaintPreviewTabServiceFactory.java", ] @@ -18,13 +16,11 @@ annotation_processor_deps = [ "//base/android/jni_generator:jni_processor" ] sources = [ + "java/src/org/chromium/chrome/browser/paint_preview/DemoPaintPreview.java", "java/src/org/chromium/chrome/browser/paint_preview/PaintPreviewCompositorUtils.java", - "java/src/org/chromium/chrome/browser/paint_preview/PaintPreviewDemoManager.java", - "java/src/org/chromium/chrome/browser/paint_preview/PaintPreviewTabHelper.java", - "java/src/org/chromium/chrome/browser/paint_preview/TabbedPaintPreviewMetricsHelper.java", - "java/src/org/chromium/chrome/browser/paint_preview/TabbedPaintPreviewPlayer.java", - "java/src/org/chromium/chrome/browser/paint_preview/services/PaintPreviewDemoService.java", - "java/src/org/chromium/chrome/browser/paint_preview/services/PaintPreviewDemoServiceFactory.java", + "java/src/org/chromium/chrome/browser/paint_preview/StartupPaintPreview.java", + "java/src/org/chromium/chrome/browser/paint_preview/StartupPaintPreviewMetrics.java", + "java/src/org/chromium/chrome/browser/paint_preview/TabbedPaintPreview.java", "java/src/org/chromium/chrome/browser/paint_preview/services/PaintPreviewTabService.java", "java/src/org/chromium/chrome/browser/paint_preview/services/PaintPreviewTabServiceFactory.java", ]
diff --git a/chrome/browser/paint_preview/android/java/src/org/chromium/chrome/browser/paint_preview/DemoPaintPreview.java b/chrome/browser/paint_preview/android/java/src/org/chromium/chrome/browser/paint_preview/DemoPaintPreview.java new file mode 100644 index 0000000..6e2413fc --- /dev/null +++ b/chrome/browser/paint_preview/android/java/src/org/chromium/chrome/browser/paint_preview/DemoPaintPreview.java
@@ -0,0 +1,122 @@ +// Copyright 2020 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +package org.chromium.chrome.browser.paint_preview; + +import org.chromium.base.task.PostTask; +import org.chromium.chrome.browser.tab.EmptyTabObserver; +import org.chromium.chrome.browser.tab.Tab; +import org.chromium.components.paintpreview.player.PlayerManager; +import org.chromium.content_public.browser.LoadUrlParams; +import org.chromium.content_public.browser.NavigationHandle; +import org.chromium.content_public.browser.UiThreadTaskTraits; +import org.chromium.ui.widget.Toast; +import org.chromium.url.GURL; + +/** + * Responsible for displaying the Paint Preview demo. When displaying, the Paint Preview will + * overlay the associated {@link Tab}'s content view. + */ +public class DemoPaintPreview implements PlayerManager.Listener { + private Tab mTab; + private TabbedPaintPreview mTabbedPaintPreview; + private DemoPaintPreviewTabObserver mTabObserver; + + public static void showForTab(Tab tab) { + if (tab == null) return; + + new DemoPaintPreview(tab).show(); + } + + private DemoPaintPreview(Tab tab) { + mTab = tab; + mTabbedPaintPreview = TabbedPaintPreview.get(mTab); + mTabObserver = new DemoPaintPreviewTabObserver(); + mTab.addObserver(mTabObserver); + } + + private void show() { + if (mTabbedPaintPreview.maybeShow(this)) return; + + PaintPreviewCompositorUtils.warmupCompositor(); + mTabbedPaintPreview.capture(success + -> PostTask.runOrPostTask( + UiThreadTaskTraits.USER_VISIBLE, () -> onCapturedPaintPreview(success))); + } + + private void onCapturedPaintPreview(boolean captureSuccess) { + boolean shown = false; + if (captureSuccess) shown = mTabbedPaintPreview.maybeShow(this); + int toastStringRes = shown ? R.string.paint_preview_demo_capture_success + : R.string.paint_preview_demo_capture_failure; + Toast.makeText(mTab.getContext(), toastStringRes, Toast.LENGTH_LONG).show(); + if (!captureSuccess || !shown) { + PaintPreviewCompositorUtils.stopWarmCompositor(); + destroy(); + } + } + + private void removePaintPreviewDemo() { + if (mTab == null) return; + + mTabbedPaintPreview.remove(false); + destroy(); + } + + private void destroy() { + mTab.removeObserver(mTabObserver); + mTab = null; + mTabbedPaintPreview = null; + } + + @Override + public void onCompositorError(int status) { + Toast.makeText(mTab.getContext(), R.string.paint_preview_demo_playback_failure, + Toast.LENGTH_LONG) + .show(); + removePaintPreviewDemo(); + } + + @Override + public void onViewReady() { + Toast.makeText(mTab.getContext(), R.string.paint_preview_demo_playback_start, + Toast.LENGTH_LONG) + .show(); + } + + @Override + public void onFirstPaint() {} + + @Override + public void onUserInteraction() {} + + @Override + public void onUserFrustration() {} + + @Override + public void onPullToRefresh() { + removePaintPreviewDemo(); + } + + @Override + public void onLinkClick(GURL url) { + if (mTab == null || !url.isValid() || url.isEmpty()) return; + + mTab.loadUrl(new LoadUrlParams(url.getSpec())); + removePaintPreviewDemo(); + } + + private class DemoPaintPreviewTabObserver extends EmptyTabObserver { + @Override + public void onDidStartNavigation(Tab tab, NavigationHandle navigationHandle) { + if (!mTabbedPaintPreview.isAttached()) return; + + // Ignore navigations from subframes. We should only remove the paint preview + // player when the user navigates to a new page. + if (!navigationHandle.isInMainFrame()) return; + + removePaintPreviewDemo(); + } + } +}
diff --git a/chrome/browser/paint_preview/android/java/src/org/chromium/chrome/browser/paint_preview/PaintPreviewDemoManager.java b/chrome/browser/paint_preview/android/java/src/org/chromium/chrome/browser/paint_preview/PaintPreviewDemoManager.java deleted file mode 100644 index f0265ba5..0000000 --- a/chrome/browser/paint_preview/android/java/src/org/chromium/chrome/browser/paint_preview/PaintPreviewDemoManager.java +++ /dev/null
@@ -1,127 +0,0 @@ -// Copyright 2020 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -package org.chromium.chrome.browser.paint_preview; - -import android.view.View; - -import org.chromium.base.task.PostTask; -import org.chromium.chrome.browser.paint_preview.services.PaintPreviewDemoService; -import org.chromium.chrome.browser.paint_preview.services.PaintPreviewDemoServiceFactory; -import org.chromium.chrome.browser.tab.Tab; -import org.chromium.chrome.browser.tab.TabViewProvider; -import org.chromium.components.browser_ui.styles.ChromeColors; -import org.chromium.components.paintpreview.player.PlayerManager; -import org.chromium.content_public.browser.LoadUrlParams; -import org.chromium.content_public.browser.UiThreadTaskTraits; -import org.chromium.ui.widget.Toast; -import org.chromium.url.GURL; - -/** - * Responsible for displaying the Paint Preview demo. When displaying, the Paint Preview will - * overlay the associated {@link Tab}'s content view. - */ -public class PaintPreviewDemoManager implements TabViewProvider { - private Tab mTab; - private PaintPreviewDemoService mPaintPreviewDemoService; - private PlayerManager mPlayerManager; - - /** - * This is called on all tab creations. We don't initialize the PaintPreviewDemoService here to - * reduce overhead. - */ - public PaintPreviewDemoManager(Tab tab) { - mTab = tab; - } - - public void showPaintPreviewDemo() { - if (isShowingPaintPreviewDemo()) return; - - if (mPaintPreviewDemoService == null) { - mPaintPreviewDemoService = PaintPreviewDemoServiceFactory.getServiceInstance(); - } - mPaintPreviewDemoService.capturePaintPreview(mTab.getWebContents(), mTab.getId(), - success - -> PostTask.runOrPostTask( - UiThreadTaskTraits.USER_VISIBLE, () -> onCapturedPaintPreview(success))); - } - - private void onCapturedPaintPreview(boolean success) { - if (success) { - mPlayerManager = new PlayerManager(mTab.getUrl(), mTab.getContext(), - mPaintPreviewDemoService, String.valueOf(mTab.getId()), - PaintPreviewDemoManager.this::onLinkClicked, - PaintPreviewDemoManager.this::removePaintPreviewDemo, - PaintPreviewDemoManager.this::addPlayerView, null, null, - ChromeColors.getPrimaryBackgroundColor(mTab.getContext().getResources(), false), - (status) -> { - Toast.makeText(mTab.getContext(), - R.string.paint_preview_demo_playback_failure, - Toast.LENGTH_LONG) - .show(); - removePaintPreviewDemo(); - }, - /*ignoreInitialScrollOffset=*/false); - } - int toastStringRes = success ? R.string.paint_preview_demo_capture_success - : R.string.paint_preview_demo_capture_failure; - Toast.makeText(mTab.getContext(), toastStringRes, Toast.LENGTH_LONG).show(); - } - - private void addPlayerView() { - mTab.getTabViewManager().addTabViewProvider(this); - } - - void removePaintPreviewDemo() { - PaintPreviewCompositorUtils.stopWarmCompositor(); - if (mTab == null || mPlayerManager == null) { - return; - } - - mTab.getTabViewManager().removeTabViewProvider(this); - mPaintPreviewDemoService.cleanUpForTabId(mTab.getId()); - mPlayerManager.destroy(); - mPlayerManager = null; - } - - boolean isShowingPaintPreviewDemo() { - return mPlayerManager != null && mTab.getTabViewManager().isShowing(this); - } - - private void onLinkClicked(GURL url) { - if (mTab == null || !url.isValid() || url.isEmpty()) return; - - mTab.loadUrl(new LoadUrlParams(url.getSpec())); - } - - public void destroy() { - if (mPaintPreviewDemoService != null) { - mPaintPreviewDemoService.cleanUpForTabId(mTab.getId()); - } - } - - @Override - public int getTabViewProviderType() { - return Type.PAINT_PREVIEW; - } - - @Override - public View getView() { - return mPlayerManager == null ? null : mPlayerManager.getView(); - } - - @Override - public void onShown() { - Toast.makeText(mTab.getContext(), R.string.paint_preview_demo_playback_start, - Toast.LENGTH_LONG) - .show(); - } - - @Override - public void onHidden() { - Toast.makeText( - mTab.getContext(), R.string.paint_preview_demo_playback_end, Toast.LENGTH_LONG) - .show(); - } -}
diff --git a/chrome/browser/paint_preview/android/java/src/org/chromium/chrome/browser/paint_preview/PaintPreviewTabHelper.java b/chrome/browser/paint_preview/android/java/src/org/chromium/chrome/browser/paint_preview/PaintPreviewTabHelper.java deleted file mode 100644 index 3d609e1..0000000 --- a/chrome/browser/paint_preview/android/java/src/org/chromium/chrome/browser/paint_preview/PaintPreviewTabHelper.java +++ /dev/null
@@ -1,88 +0,0 @@ -// Copyright 2020 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -package org.chromium.chrome.browser.paint_preview; - -import org.chromium.base.UserData; -import org.chromium.chrome.browser.tab.EmptyTabObserver; -import org.chromium.chrome.browser.tab.Tab; - -/** - * Manages the Paint Preview component for a given {@link Tab}. Destroyed together with the tab. - */ -public class PaintPreviewTabHelper extends EmptyTabObserver implements UserData { - public static final Class<PaintPreviewTabHelper> USER_DATA_KEY = PaintPreviewTabHelper.class; - - private Tab mTab; - private PaintPreviewDemoManager mPaintPreviewDemoManager; - - public static void createForTab(Tab tab) { - tab.getUserDataHost().setUserData(USER_DATA_KEY, new PaintPreviewTabHelper(tab)); - } - - public static PaintPreviewTabHelper get(Tab tab) { - return tab.getUserDataHost().getUserData(USER_DATA_KEY); - } - - private PaintPreviewTabHelper(Tab tab) { - mTab = tab; - mTab.addObserver(this); - mPaintPreviewDemoManager = new PaintPreviewDemoManager(tab); - } - - /** - * Attempts to capture the current tab as a Paint Preview and displays it. This is only - * accessible from a menu item that is guarded behind an about:flag. - */ - public void showPaintPreviewDemo() { - if (mTab == null || !qualifiesForCapture(mTab)) { - return; - } - - PaintPreviewCompositorUtils.warmupCompositor(); - mPaintPreviewDemoManager.showPaintPreviewDemo(); - } - - /** - * Removes the Paint Preview demo view if it's being displayed. Paint Preview demo is only - * accessible from a menu item that is guarded behind an about:flag. - * @return Whether the Paint Preview demo was showing. - */ - public boolean removePaintPreviewDemoIfShowing() { - if (mPaintPreviewDemoManager.isShowingPaintPreviewDemo()) { - mPaintPreviewDemoManager.removePaintPreviewDemo(); - return true; - } - - return false; - } - - @Override - public void onLoadStarted(Tab tab, boolean toDifferentDocument) { - // Note this doesn't apply to forced reloads, which is desirable in this case. - if (!toDifferentDocument) return; - - removePaintPreviewDemoIfShowing(); - } - - @Override - public void onDestroyed(Tab tab) { - assert mTab == tab; - tab.removeObserver(this); - mTab = null; - } - - @Override - public void destroy() { - mPaintPreviewDemoManager.destroy(); - } - - /** - * Checks whether a given {@link Tab} qualifies for Paint Preview capture. - */ - private boolean qualifiesForCapture(Tab tab) { - return !tab.isIncognito() && !tab.isNativePage() && !tab.isShowingErrorPage() - && tab.getWebContents() != null; - } -}
diff --git a/chrome/browser/paint_preview/android/java/src/org/chromium/chrome/browser/paint_preview/StartupPaintPreview.java b/chrome/browser/paint_preview/android/java/src/org/chromium/chrome/browser/paint_preview/StartupPaintPreview.java new file mode 100644 index 0000000..d2b15195 --- /dev/null +++ b/chrome/browser/paint_preview/android/java/src/org/chromium/chrome/browser/paint_preview/StartupPaintPreview.java
@@ -0,0 +1,270 @@ +// Copyright 2020 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +package org.chromium.chrome.browser.paint_preview; + +import android.content.res.Resources; +import android.os.Handler; + +import androidx.annotation.Nullable; +import androidx.annotation.VisibleForTesting; + +import org.chromium.base.Callback; +import org.chromium.chrome.browser.browser_controls.BrowserStateBrowserControlsVisibilityDelegate; +import org.chromium.chrome.browser.flags.ChromeFeatureList; +import org.chromium.chrome.browser.paint_preview.StartupPaintPreviewMetrics.ExitCause; +import org.chromium.chrome.browser.tab.EmptyTabObserver; +import org.chromium.chrome.browser.tab.Tab; +import org.chromium.chrome.browser.tab.TabHidingType; +import org.chromium.chrome.browser.tab.TabObserver; +import org.chromium.chrome.browser.ui.messages.snackbar.Snackbar; +import org.chromium.chrome.browser.ui.messages.snackbar.SnackbarManager; +import org.chromium.chrome.browser.ui.messages.snackbar.SnackbarManagerProvider; +import org.chromium.components.paintpreview.player.PlayerManager; +import org.chromium.content_public.browser.LoadUrlParams; +import org.chromium.content_public.browser.NavigationHandle; +import org.chromium.content_public.browser.WebContents; +import org.chromium.ui.widget.Toast; +import org.chromium.url.GURL; + +import java.util.concurrent.Callable; + +/** + * Used for displaying a paint preview representation of a tab on startup. + */ +public class StartupPaintPreview implements PlayerManager.Listener { + private Tab mTab; + private StartupPaintPreviewMetrics mMetricsHelper; + private TabbedPaintPreview mTabbedPaintPreview; + private Runnable mOnDismissed; + private SnackbarManager.SnackbarController mSnackbarController; + private TabObserver mStartupTabObserver; + + private boolean mFirstMeaningfulPaintHappened; + private boolean mDidStartRestore; + private int mSnackbarShownCount; + private boolean mShowingSnackbar; + private long mActivityCreationTimestampMs; + private Callable<Boolean> mShouldRecordFirstPaint; + + private static final int DEFAULT_INITIAL_REMOVE_DELAY_MS = 0; + private static final String INITIAL_REMOVE_DELAY_PARAM = "initial_remove_delay_ms"; + private static final int SNACKBAR_DURATION_MS = 8 * 1000; + + public StartupPaintPreview(Tab tab, + BrowserStateBrowserControlsVisibilityDelegate visibilityDelegate, + Runnable progressSimulatorCallback, Callback<Boolean> progressPreventionCallback) { + mTab = tab; + mMetricsHelper = new StartupPaintPreviewMetrics(); + mTabbedPaintPreview = TabbedPaintPreview.get(mTab); + mTabbedPaintPreview.setBrowserVisibilityDelegate(visibilityDelegate); + mTabbedPaintPreview.setProgressbarUpdatePreventionCallback(progressPreventionCallback); + mTabbedPaintPreview.setProgressSimulatorNeededCallback(progressSimulatorCallback); + mStartupTabObserver = new StartupPaintPreviewTabObserver(); + mTab.addObserver(mStartupTabObserver); + } + + /** + * Shows a Paint Preview for the provided tab if it exists. + * @param onDismissed The callback for when the Paint Preview is dismissed. + */ + public void show(@Nullable Runnable onDismissed) { + mOnDismissed = onDismissed; + boolean hasCapture = mTabbedPaintPreview.maybeShow(this); + mMetricsHelper.recordHadCapture(hasCapture); + if (!hasCapture && mOnDismissed != null) { + mOnDismissed.run(); + mOnDismissed = null; + } + } + + public void setActivityCreationTimestampMs(long activityCreationTimestampMs) { + mActivityCreationTimestampMs = activityCreationTimestampMs; + } + + public void setShouldRecordFirstPaint(Callable<Boolean> shouldRecordFirstPaint) { + mShouldRecordFirstPaint = shouldRecordFirstPaint; + } + + private void remove(@ExitCause int exitCause) { + if (mOnDismissed != null) mOnDismissed.run(); + mOnDismissed = null; + + boolean needsAnimation = exitCause == ExitCause.TAB_FINISHED_LOADING + || exitCause == ExitCause.SNACK_BAR_ACTION + || exitCause == ExitCause.PULL_TO_REFRESH; + mTabbedPaintPreview.remove(needsAnimation); + if (exitCause == ExitCause.TAB_FINISHED_LOADING) showUpgradeToast(); + dismissSnackbar(); + mMetricsHelper.recordExitMetrics(exitCause, mSnackbarShownCount); + } + + private void showSnackbar() { + if (mTab == null || mTab.getWindowAndroid() == null || mShowingSnackbar) return; + + SnackbarManager snackbarManager = SnackbarManagerProvider.from(mTab.getWindowAndroid()); + if (snackbarManager == null) return; + + if (mSnackbarController == null) { + mSnackbarController = new SnackbarManager.SnackbarController() { + @Override + public void onAction(Object actionData) { + mShowingSnackbar = false; + remove(ExitCause.SNACK_BAR_ACTION); + } + + @Override + public void onDismissNoAction(Object actionData) { + mShowingSnackbar = false; + } + }; + } + + Resources resources = mTab.getContext().getResources(); + Snackbar snackbar = Snackbar.make( + resources.getString(R.string.paint_preview_startup_upgrade_snackbar_message), + mSnackbarController, Snackbar.TYPE_NOTIFICATION, + Snackbar.UMA_PAINT_PREVIEW_UPGRADE_NOTIFICATION); + snackbar.setAction( + resources.getString(R.string.paint_preview_startup_upgrade_snackbar_action), null); + snackbar.setDuration(SNACKBAR_DURATION_MS); + SnackbarManagerProvider.from(mTab.getWindowAndroid()).showSnackbar(snackbar); + mShowingSnackbar = true; + mSnackbarShownCount++; + } + + private void dismissSnackbar() { + if (mSnackbarController == null || mTab == null || mTab.getWindowAndroid() == null) return; + + SnackbarManager snackbarManager = SnackbarManagerProvider.from(mTab.getWindowAndroid()); + if (snackbarManager == null) return; + + snackbarManager.dismissSnackbars(mSnackbarController); + } + + private void showUpgradeToast() { + if (mTab == null) return; + + Toast.makeText(mTab.getContext(), R.string.paint_preview_startup_auto_upgrade_toast, + Toast.LENGTH_SHORT) + .show(); + } + + /** + * Triggered via {@link PageLoadMetrics.Observer} when First Meaningful Paint happens. + * @param webContents the webContents that triggered the event. + * @return Whether the event was handled for the provided webContents. + */ + public void onWebContentsFirstMeaningfulPaint(WebContents webContents) { + // If there is no observer or tab this will never handle the event so it should be + // treated as a success. + if (mTab == null || mTab.getWebContents() != webContents) return; + + mFirstMeaningfulPaintHappened = true; + mMetricsHelper.onTabLoadFinished(); + + if (!mTabbedPaintPreview.isAttached()) return; + + long delayMs = ChromeFeatureList.getFieldTrialParamByFeatureAsInt( + ChromeFeatureList.PAINT_PREVIEW_SHOW_ON_STARTUP, INITIAL_REMOVE_DELAY_PARAM, + DEFAULT_INITIAL_REMOVE_DELAY_MS); + // Delay removing paint preview after didFirstVisuallyNonEmptyPaint and no user + // interaction by |delayMs|. This is to account for 'heavy' pages that take a while + // to finish painting and avoid having flickers when switching from paint preview + // to the live page. + new Handler().postDelayed(() -> { + if (!mTabbedPaintPreview.isAttached()) return; + + remove(ExitCause.TAB_FINISHED_LOADING); + }, delayMs); + } + + @Override + public void onCompositorError(int status) { + mMetricsHelper.onCompositorFailure(status); + remove(ExitCause.COMPOSITOR_FAILURE); + } + + @Override + public void onViewReady() { + if (mFirstMeaningfulPaintHappened) { + remove(ExitCause.TAB_FINISHED_LOADING); + return; + } + mMetricsHelper.onShown(); + } + + @Override + public void onFirstPaint() { + if (!mTabbedPaintPreview.isAttached()) return; + + mMetricsHelper.onFirstPaint(mActivityCreationTimestampMs, mShouldRecordFirstPaint); + } + + @Override + public void onUserInteraction() {} + + @Override + public void onUserFrustration() { + showSnackbar(); + } + + @Override + public void onPullToRefresh() { + remove(ExitCause.PULL_TO_REFRESH); + } + + @Override + public void onLinkClick(GURL url) { + if (mTab == null || !url.isValid() || url.isEmpty()) return; + + mTab.loadUrl(new LoadUrlParams(url.getSpec())); + remove(ExitCause.LINK_CLICKED); + } + + @VisibleForTesting + TabObserver getTabObserverForTesting() { + return mStartupTabObserver; + } + + private class StartupPaintPreviewTabObserver extends EmptyTabObserver { + @Override + public void onRestoreStarted(Tab tab) { + mDidStartRestore = true; + } + + @Override + public void onDidStartNavigation(Tab tab, NavigationHandle navigationHandle) { + if (!mTabbedPaintPreview.isAttached()) return; + + // Ignore navigations from subframes. We should only remove the paint preview + // player when the user navigates to a new page. + if (!navigationHandle.isInMainFrame()) return; + + // If we haven't started to restore, this is the navigation call to start the + // restoration. We shouldn't remove the paint preview player. + if (!mDidStartRestore) return; + + remove(ExitCause.NAVIGATION_STARTED); + } + + @Override + public void onHidden(Tab tab, @TabHidingType int hidingType) { + dismissSnackbar(); + + if (!mTabbedPaintPreview.isAttached()) return; + + // If the tab is hidden as a result of pausing the activity we shouldn't remove it. + if (hidingType == TabHidingType.ACTIVITY_HIDDEN) return; + + remove(StartupPaintPreviewMetrics.ExitCause.TAB_HIDDEN); + } + + @Override + public void onDestroyed(Tab tab) { + remove(ExitCause.TAB_DESTROYED); + tab.removeObserver(this); + } + } +}
diff --git a/chrome/browser/paint_preview/android/java/src/org/chromium/chrome/browser/paint_preview/StartupPaintPreviewMetrics.java b/chrome/browser/paint_preview/android/java/src/org/chromium/chrome/browser/paint_preview/StartupPaintPreviewMetrics.java new file mode 100644 index 0000000..842c0c5 --- /dev/null +++ b/chrome/browser/paint_preview/android/java/src/org/chromium/chrome/browser/paint_preview/StartupPaintPreviewMetrics.java
@@ -0,0 +1,110 @@ +// Copyright 2020 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +package org.chromium.chrome.browser.paint_preview; + +import android.os.SystemClock; + +import androidx.annotation.IntDef; + +import org.chromium.base.metrics.RecordHistogram; +import org.chromium.base.metrics.RecordUserAction; +import org.chromium.components.paintpreview.player.CompositorStatus; + +import java.util.HashMap; +import java.util.Map; +import java.util.concurrent.Callable; + +/** Helper class for recording metrics related to TabbedPaintPreview. */ +public class StartupPaintPreviewMetrics { + /** Used for recording the cause for exiting the Paint Preview player. */ + @IntDef({ExitCause.PULL_TO_REFRESH, ExitCause.SNACK_BAR_ACTION, ExitCause.COMPOSITOR_FAILURE, + ExitCause.TAB_FINISHED_LOADING, ExitCause.LINK_CLICKED, ExitCause.NAVIGATION_STARTED, + ExitCause.TAB_DESTROYED, ExitCause.TAB_HIDDEN}) + @interface ExitCause { + int PULL_TO_REFRESH = 0; + int SNACK_BAR_ACTION = 1; + int COMPOSITOR_FAILURE = 2; + int TAB_FINISHED_LOADING = 3; + int LINK_CLICKED = 4; + int NAVIGATION_STARTED = 5; + int TAB_DESTROYED = 6; + int TAB_HIDDEN = 7; + int COUNT = 8; + } + + private static final Map<Integer, String> UPTIME_HISTOGRAM_MAP = new HashMap<>(); + static { + UPTIME_HISTOGRAM_MAP.put(ExitCause.PULL_TO_REFRESH, + "Browser.PaintPreview.TabbedPlayer.UpTime.RemovedByPullToRefresh"); + UPTIME_HISTOGRAM_MAP.put(ExitCause.SNACK_BAR_ACTION, + "Browser.PaintPreview.TabbedPlayer.UpTime.RemovedBySnackBar"); + UPTIME_HISTOGRAM_MAP.put(ExitCause.COMPOSITOR_FAILURE, + "Browser.PaintPreview.TabbedPlayer.UpTime.RemovedByCompositorFailure"); + UPTIME_HISTOGRAM_MAP.put(ExitCause.TAB_FINISHED_LOADING, + "Browser.PaintPreview.TabbedPlayer.UpTime.RemovedOnLoad"); + UPTIME_HISTOGRAM_MAP.put(ExitCause.LINK_CLICKED, + "Browser.PaintPreview.TabbedPlayer.UpTime.RemovedByLinkClick"); + UPTIME_HISTOGRAM_MAP.put(ExitCause.NAVIGATION_STARTED, + "Browser.PaintPreview.TabbedPlayer.UpTime.RemovedByNavigation"); + UPTIME_HISTOGRAM_MAP.put(ExitCause.TAB_DESTROYED, + "Browser.PaintPreview.TabbedPlayer.UpTime.RemovedOnTabDestroy"); + UPTIME_HISTOGRAM_MAP.put(ExitCause.TAB_HIDDEN, + "Browser.PaintPreview.TabbedPlayer.UpTime.RemovedOnTabHidden"); + } + + private long mShownTime; + private boolean mFirstPaintHappened; + + void onShown() { + mShownTime = System.currentTimeMillis(); + } + + void onFirstPaint(long activityOnCreateTimestamp, Callable<Boolean> shouldRecordFirstPaint) { + mFirstPaintHappened = true; + boolean shouldRecordHistogram = false; + try { + shouldRecordHistogram = shouldRecordFirstPaint.call(); + } catch (Exception e) { + // no-op just proceed. + } + if (shouldRecordHistogram) { + RecordHistogram.recordLongTimesHistogram( + "Browser.PaintPreview.TabbedPlayer.TimeToFirstBitmap", + SystemClock.elapsedRealtime() - activityOnCreateTimestamp); + } + } + + void onTabLoadFinished() { + RecordHistogram.recordBooleanHistogram( + "Browser.PaintPreview.TabbedPlayer.FirstPaintBeforeTabLoad", mFirstPaintHappened); + } + + void onCompositorFailure(@CompositorStatus int status) { + RecordHistogram.recordEnumeratedHistogram( + "Browser.PaintPreview.TabbedPlayer.CompositorFailureReason", status, + CompositorStatus.COUNT); + } + + void recordHadCapture(boolean hadCapture) { + RecordHistogram.recordBooleanHistogram( + "Browser.PaintPreview.TabbedPlayer.HadCapture", hadCapture); + } + + void recordExitMetrics(int exitCause, int snackbarShownCount) { + if (exitCause == ExitCause.SNACK_BAR_ACTION) { + RecordUserAction.record("PaintPreview.TabbedPlayer.Actionbar.Action"); + } + + RecordUserAction.record("PaintPreview.TabbedPlayer.Removed"); + RecordHistogram.recordCountHistogram( + "Browser.PaintPreview.TabbedPlayer.SnackbarCount", snackbarShownCount); + RecordHistogram.recordEnumeratedHistogram( + "Browser.PaintPreview.TabbedPlayer.ExitCause", exitCause, ExitCause.COUNT); + if (mShownTime == 0 || !UPTIME_HISTOGRAM_MAP.containsKey(exitCause)) return; + + long upTime = System.currentTimeMillis() - mShownTime; + RecordHistogram.recordLongTimesHistogram(UPTIME_HISTOGRAM_MAP.get(exitCause), upTime); + } +}
diff --git a/chrome/browser/paint_preview/android/java/src/org/chromium/chrome/browser/paint_preview/TabbedPaintPreview.java b/chrome/browser/paint_preview/android/java/src/org/chromium/chrome/browser/paint_preview/TabbedPaintPreview.java new file mode 100644 index 0000000..e519366d --- /dev/null +++ b/chrome/browser/paint_preview/android/java/src/org/chromium/chrome/browser/paint_preview/TabbedPaintPreview.java
@@ -0,0 +1,247 @@ +// Copyright 2020 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +package org.chromium.chrome.browser.paint_preview; + +import android.animation.Animator; +import android.animation.AnimatorListenerAdapter; +import android.graphics.Point; +import android.view.View; + +import androidx.annotation.NonNull; +import androidx.annotation.VisibleForTesting; + +import org.chromium.base.Callback; +import org.chromium.base.UserData; +import org.chromium.chrome.browser.browser_controls.BrowserStateBrowserControlsVisibilityDelegate; +import org.chromium.chrome.browser.paint_preview.services.PaintPreviewTabService; +import org.chromium.chrome.browser.paint_preview.services.PaintPreviewTabServiceFactory; +import org.chromium.chrome.browser.tab.EmptyTabObserver; +import org.chromium.chrome.browser.tab.Tab; +import org.chromium.chrome.browser.tab.TabHidingType; +import org.chromium.chrome.browser.tab.TabObserver; +import org.chromium.chrome.browser.tab.TabViewProvider; +import org.chromium.components.browser_ui.styles.ChromeColors; +import org.chromium.components.paintpreview.player.PlayerManager; +import org.chromium.ui.util.TokenHolder; + +/** + * Responsible for checking for and displaying Paint Previews that are associated with a + * {@link Tab} by overlaying the content view. + */ +public class TabbedPaintPreview implements UserData { + public static final Class<TabbedPaintPreview> USER_DATA_KEY = TabbedPaintPreview.class; + private static final int CROSS_FADE_DURATION_MS = 500; + + private Tab mTab; + private TabObserver mTabObserver; + private TabViewProvider mTabbedPainPreviewViewProvider; + private PaintPreviewTabService mPaintPreviewTabService; + private PlayerManager mPlayerManager; + private BrowserStateBrowserControlsVisibilityDelegate mBrowserVisibilityDelegate; + private Runnable mProgressSimulatorNeededCallback; + private Callback<Boolean> mProgressPreventionCallback; + + private boolean mIsAttachedToTab; + private boolean mFadingOut; + private int mPersistentToolbarToken = TokenHolder.INVALID_TOKEN; + + private static PaintPreviewTabService sPaintPreviewTabServiceForTesting; + + public static TabbedPaintPreview get(Tab tab) { + if (tab.getUserDataHost().getUserData(USER_DATA_KEY) == null) { + tab.getUserDataHost().setUserData(USER_DATA_KEY, new TabbedPaintPreview(tab)); + } + return tab.getUserDataHost().getUserData(USER_DATA_KEY); + } + + private TabbedPaintPreview(Tab tab) { + mTab = tab; + mTabbedPainPreviewViewProvider = new TabbedPaintPreviewViewProvider(); + mPaintPreviewTabService = PaintPreviewTabServiceFactory.getServiceInstance(); + mTabObserver = new EmptyTabObserver() { + @Override + public void onHidden(Tab tab, @TabHidingType int hidingType) { + releasePersistentToolbar(); + setProgressPreventionNeeded(false); + } + + @Override + public void onShown(Tab tab, int type) { + if (!isShowing()) return; + + showToolbarPersistent(); + setProgressPreventionNeeded(true); + } + }; + mTab.addObserver(mTabObserver); + } + + public void setBrowserVisibilityDelegate( + BrowserStateBrowserControlsVisibilityDelegate browserVisibilityDelegate) { + mBrowserVisibilityDelegate = browserVisibilityDelegate; + } + + public void setProgressSimulatorNeededCallback(Runnable callback) { + mProgressSimulatorNeededCallback = callback; + } + + public void setProgressbarUpdatePreventionCallback(Callback<Boolean> callback) { + mProgressPreventionCallback = callback; + } + + void capture(Callback<Boolean> successCallback) { + getService().captureTab(mTab, successCallback); + } + + /** + * Shows a Paint Preview for the provided tab if it exists. + * @param listener An interface used for notifying events originated from the player. + * @return Whether a capture for this tab exists and an attempt for displaying it has started. + */ + public boolean maybeShow(@NonNull PlayerManager.Listener listener) { + if (mIsAttachedToTab) return true; + + // Check if a capture exists. This is a quick check using a cache. + boolean hasCapture = getService().hasCaptureForTab(mTab.getId()); + if (!hasCapture) return false; + + PaintPreviewCompositorUtils.warmupCompositor(); + mPlayerManager = new PlayerManager(mTab.getUrl(), mTab.getContext(), getService(), + String.valueOf(mTab.getId()), listener, + ChromeColors.getPrimaryBackgroundColor(mTab.getContext().getResources(), false), + /*ignoreInitialScrollOffset=*/false); + mTab.getTabViewManager().addTabViewProvider(mTabbedPainPreviewViewProvider); + mIsAttachedToTab = true; + return true; + } + + public void remove(boolean animate) { + remove(true, animate); + } + + /** + * Removes the view containing the Paint Preview from the most recently shown {@link Tab}. Does + * nothing if there is no view showing. + */ + public void remove(boolean matchScroll, boolean animate) { + PaintPreviewCompositorUtils.stopWarmCompositor(); + if (mTab == null || mPlayerManager == null || mFadingOut) return; + + mFadingOut = true; + if (matchScroll) { + Point scrollPosition = mPlayerManager.getScrollPosition(); + if (mTab.getWebContents() != null && scrollPosition != null) { + mTab.getWebContents().getEventForwarder().scrollTo( + scrollPosition.x, scrollPosition.y); + } + } + mPlayerManager.setAcceptUserInput(false); + mTabbedPainPreviewViewProvider.getView() + .animate() + .alpha(0f) + .setDuration(animate ? CROSS_FADE_DURATION_MS : 0) + .setListener(new AnimatorListenerAdapter() { + @Override + public void onAnimationEnd(Animator animation) { + if (mTab != null) { + mTab.getTabViewManager().removeTabViewProvider( + mTabbedPainPreviewViewProvider); + } + if (mPlayerManager != null) { + mPlayerManager.destroy(); + mPlayerManager = null; + } + mIsAttachedToTab = false; + mFadingOut = false; + } + }); + if (mProgressSimulatorNeededCallback != null) mProgressSimulatorNeededCallback.run(); + } + + public boolean isShowing() { + if (mTab == null) return false; + + return mTab.getTabViewManager().isShowing(mTabbedPainPreviewViewProvider); + } + + public boolean isAttached() { + return mIsAttachedToTab; + } + + /** + * Persistently shows the toolbar and avoids hiding it on scrolling down. + */ + private void showToolbarPersistent() { + if (mBrowserVisibilityDelegate == null + || mPersistentToolbarToken != TokenHolder.INVALID_TOKEN) { + return; + } + + mPersistentToolbarToken = mBrowserVisibilityDelegate.showControlsPersistent(); + } + + private void releasePersistentToolbar() { + if (mBrowserVisibilityDelegate == null) return; + + mBrowserVisibilityDelegate.releasePersistentShowingToken(mPersistentToolbarToken); + mPersistentToolbarToken = TokenHolder.INVALID_TOKEN; + } + + /** + * @param progressPrevention Whether progress updates shown in the progress bar should be + * suppressed. + */ + private void setProgressPreventionNeeded(boolean progressPrevention) { + if (mProgressPreventionCallback == null) return; + + mProgressPreventionCallback.onResult(progressPrevention); + } + + @Override + public void destroy() { + mTab.removeObserver(mTabObserver); + mTab = null; + } + + private PaintPreviewTabService getService() { + if (sPaintPreviewTabServiceForTesting == null) return mPaintPreviewTabService; + + return sPaintPreviewTabServiceForTesting; + } + + @VisibleForTesting + static void overridePaintPreviewTabServiceForTesting(PaintPreviewTabService service) { + sPaintPreviewTabServiceForTesting = service; + } + + @VisibleForTesting + View getViewForTesting() { + return mTabbedPainPreviewViewProvider.getView(); + } + + private class TabbedPaintPreviewViewProvider implements TabViewProvider { + @Override + public int getTabViewProviderType() { + return Type.PAINT_PREVIEW; + } + + @Override + public View getView() { + return mPlayerManager == null ? null : mPlayerManager.getView(); + } + + @Override + public void onShown() { + showToolbarPersistent(); + setProgressPreventionNeeded(true); + } + + @Override + public void onHidden() { + releasePersistentToolbar(); + setProgressPreventionNeeded(false); + } + } +}
diff --git a/chrome/browser/paint_preview/android/java/src/org/chromium/chrome/browser/paint_preview/TabbedPaintPreviewMetricsHelper.java b/chrome/browser/paint_preview/android/java/src/org/chromium/chrome/browser/paint_preview/TabbedPaintPreviewMetricsHelper.java deleted file mode 100644 index 0b04b03..0000000 --- a/chrome/browser/paint_preview/android/java/src/org/chromium/chrome/browser/paint_preview/TabbedPaintPreviewMetricsHelper.java +++ /dev/null
@@ -1,110 +0,0 @@ -// Copyright 2020 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -package org.chromium.chrome.browser.paint_preview; - -import android.os.SystemClock; - -import androidx.annotation.IntDef; - -import org.chromium.base.metrics.RecordHistogram; -import org.chromium.base.metrics.RecordUserAction; -import org.chromium.components.paintpreview.player.CompositorStatus; - -import java.util.HashMap; -import java.util.Map; -import java.util.concurrent.Callable; - -/** Helper class for recording metrics related to TabbedPaintPreview. */ -public class TabbedPaintPreviewMetricsHelper { - /** Used for recording the cause for exiting the Paint Preview player. */ - @IntDef({ExitCause.PULL_TO_REFRESH, ExitCause.SNACK_BAR_ACTION, ExitCause.COMPOSITOR_FAILURE, - ExitCause.TAB_FINISHED_LOADING, ExitCause.LINK_CLICKED, ExitCause.NAVIGATION_STARTED, - ExitCause.TAB_DESTROYED, ExitCause.TAB_HIDDEN}) - @interface ExitCause { - int PULL_TO_REFRESH = 0; - int SNACK_BAR_ACTION = 1; - int COMPOSITOR_FAILURE = 2; - int TAB_FINISHED_LOADING = 3; - int LINK_CLICKED = 4; - int NAVIGATION_STARTED = 5; - int TAB_DESTROYED = 6; - int TAB_HIDDEN = 7; - int COUNT = 8; - } - - private static final Map<Integer, String> UPTIME_HISTOGRAM_MAP = new HashMap<>(); - static { - UPTIME_HISTOGRAM_MAP.put(ExitCause.PULL_TO_REFRESH, - "Browser.PaintPreview.TabbedPlayer.UpTime.RemovedByPullToRefresh"); - UPTIME_HISTOGRAM_MAP.put(ExitCause.SNACK_BAR_ACTION, - "Browser.PaintPreview.TabbedPlayer.UpTime.RemovedBySnackBar"); - UPTIME_HISTOGRAM_MAP.put(ExitCause.COMPOSITOR_FAILURE, - "Browser.PaintPreview.TabbedPlayer.UpTime.RemovedByCompositorFailure"); - UPTIME_HISTOGRAM_MAP.put(ExitCause.TAB_FINISHED_LOADING, - "Browser.PaintPreview.TabbedPlayer.UpTime.RemovedOnLoad"); - UPTIME_HISTOGRAM_MAP.put(ExitCause.LINK_CLICKED, - "Browser.PaintPreview.TabbedPlayer.UpTime.RemovedByLinkClick"); - UPTIME_HISTOGRAM_MAP.put(ExitCause.NAVIGATION_STARTED, - "Browser.PaintPreview.TabbedPlayer.UpTime.RemovedByNavigation"); - UPTIME_HISTOGRAM_MAP.put(ExitCause.TAB_DESTROYED, - "Browser.PaintPreview.TabbedPlayer.UpTime.RemovedOnTabDestroy"); - UPTIME_HISTOGRAM_MAP.put(ExitCause.TAB_HIDDEN, - "Browser.PaintPreview.TabbedPlayer.UpTime.RemovedOnTabHidden"); - } - - private long mShownTime; - private boolean mFirstPaintHappened; - - void onShown() { - mShownTime = System.currentTimeMillis(); - } - - void onFirstPaint(long activityOnCreateTimestamp, Callable<Boolean> recordFirstPaint) { - mFirstPaintHappened = true; - boolean shouldRecordHistogram = false; - try { - shouldRecordHistogram = recordFirstPaint.call(); - } catch (Exception e) { - // no-op just proceed. - } - if (shouldRecordHistogram) { - RecordHistogram.recordLongTimesHistogram( - "Browser.PaintPreview.TabbedPlayer.TimeToFirstBitmap", - SystemClock.elapsedRealtime() - activityOnCreateTimestamp); - } - } - - void onTabLoadFinished() { - RecordHistogram.recordBooleanHistogram( - "Browser.PaintPreview.TabbedPlayer.FirstPaintBeforeTabLoad", mFirstPaintHappened); - } - - void onCompositorFailure(@CompositorStatus int status) { - RecordHistogram.recordEnumeratedHistogram( - "Browser.PaintPreview.TabbedPlayer.CompositorFailureReason", status, - CompositorStatus.COUNT); - } - - void recordHadCapture(boolean hadCapture) { - RecordHistogram.recordBooleanHistogram( - "Browser.PaintPreview.TabbedPlayer.HadCapture", hadCapture); - } - - void recordExitMetrics(int exitCause, int snackbarShownCount) { - if (exitCause == ExitCause.SNACK_BAR_ACTION) { - RecordUserAction.record("PaintPreview.TabbedPlayer.Actionbar.Action"); - } - - RecordUserAction.record("PaintPreview.TabbedPlayer.Removed"); - RecordHistogram.recordCountHistogram( - "Browser.PaintPreview.TabbedPlayer.SnackbarCount", snackbarShownCount); - RecordHistogram.recordEnumeratedHistogram( - "Browser.PaintPreview.TabbedPlayer.ExitCause", exitCause, ExitCause.COUNT); - if (mShownTime == 0 || !UPTIME_HISTOGRAM_MAP.containsKey(exitCause)) return; - - long upTime = System.currentTimeMillis() - mShownTime; - RecordHistogram.recordLongTimesHistogram(UPTIME_HISTOGRAM_MAP.get(exitCause), upTime); - } -}
diff --git a/chrome/browser/paint_preview/android/java/src/org/chromium/chrome/browser/paint_preview/TabbedPaintPreviewPlayer.java b/chrome/browser/paint_preview/android/java/src/org/chromium/chrome/browser/paint_preview/TabbedPaintPreviewPlayer.java deleted file mode 100644 index 3105bb4..0000000 --- a/chrome/browser/paint_preview/android/java/src/org/chromium/chrome/browser/paint_preview/TabbedPaintPreviewPlayer.java +++ /dev/null
@@ -1,385 +0,0 @@ -// Copyright 2020 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -package org.chromium.chrome.browser.paint_preview; - -import android.animation.Animator; -import android.animation.AnimatorListenerAdapter; -import android.content.res.Resources; -import android.graphics.Point; -import android.os.Handler; -import android.os.SystemClock; -import android.view.View; - -import androidx.annotation.Nullable; - -import org.chromium.base.Callback; -import org.chromium.base.UserData; -import org.chromium.chrome.browser.browser_controls.BrowserStateBrowserControlsVisibilityDelegate; -import org.chromium.chrome.browser.flags.ChromeFeatureList; -import org.chromium.chrome.browser.paint_preview.TabbedPaintPreviewMetricsHelper.ExitCause; -import org.chromium.chrome.browser.paint_preview.services.PaintPreviewTabService; -import org.chromium.chrome.browser.paint_preview.services.PaintPreviewTabServiceFactory; -import org.chromium.chrome.browser.tab.EmptyTabObserver; -import org.chromium.chrome.browser.tab.Tab; -import org.chromium.chrome.browser.tab.TabHidingType; -import org.chromium.chrome.browser.tab.TabViewProvider; -import org.chromium.chrome.browser.ui.messages.snackbar.Snackbar; -import org.chromium.chrome.browser.ui.messages.snackbar.SnackbarManager; -import org.chromium.chrome.browser.ui.messages.snackbar.SnackbarManagerProvider; -import org.chromium.components.browser_ui.styles.ChromeColors; -import org.chromium.components.paintpreview.player.PlayerManager; -import org.chromium.content_public.browser.LoadUrlParams; -import org.chromium.content_public.browser.NavigationHandle; -import org.chromium.content_public.browser.WebContents; -import org.chromium.ui.util.TokenHolder; -import org.chromium.ui.widget.Toast; -import org.chromium.url.GURL; - -import java.util.concurrent.Callable; - -/** - * Responsible for checking for and displaying Paint Previews that are associated with a - * {@link Tab} by overlaying the content view. - */ -public class TabbedPaintPreviewPlayer implements TabViewProvider, UserData { - public static final Class<TabbedPaintPreviewPlayer> USER_DATA_KEY = - TabbedPaintPreviewPlayer.class; - - private static final int SNACKBAR_DURATION_MS = 8 * 1000; - private static final int CROSS_FADE_DURATION_MS = 500; - private static final int DEFAULT_INITIAL_REMOVE_DELAY_MS = 0; - private static final String INITIAL_REMOVE_DELAY_PARAM = "initial_remove_delay_ms"; - - private Tab mTab; - private PaintPreviewTabService mPaintPreviewTabService; - private PlayerManager mPlayerManager; - private Runnable mOnDismissed; - private Boolean mInitializing; - private boolean mFirstMeaningfulPaintHappened; - private TabbedPaintPreviewObserver mObserver; - private long mLastShownSnackBarTime; - private boolean mDidStartRestore; - private boolean mFadingOut; - private int mSnackbarShownCount; - private TabbedPaintPreviewMetricsHelper mMetricsHelper; - private BrowserStateBrowserControlsVisibilityDelegate mBrowserVisibilityDelegate; - private int mPersistentToolbarToken = TokenHolder.INVALID_TOKEN; - private SnackbarManager.SnackbarController mSnackbarController; - private Runnable mProgressSimulatorNeededCallback; - private Callback<Boolean> mProgressPreventionCallback; - - public static TabbedPaintPreviewPlayer get(Tab tab) { - if (tab.getUserDataHost().getUserData(USER_DATA_KEY) == null) { - tab.getUserDataHost().setUserData(USER_DATA_KEY, new TabbedPaintPreviewPlayer(tab)); - } - return tab.getUserDataHost().getUserData(USER_DATA_KEY); - } - - class TabbedPaintPreviewObserver extends EmptyTabObserver { - public void onFirstMeaningfulPaint() { - mMetricsHelper.onTabLoadFinished(); - - if (!isShowingAndNeedsBadge()) return; - - long delayMs = ChromeFeatureList.getFieldTrialParamByFeatureAsInt( - ChromeFeatureList.PAINT_PREVIEW_SHOW_ON_STARTUP, INITIAL_REMOVE_DELAY_PARAM, - DEFAULT_INITIAL_REMOVE_DELAY_MS); - // Delay removing paint preview after didFirstVisuallyNonEmptyPaint and no user - // interaction by |delayMs|. This is to account for 'heavy' pages that take a while - // to finish painting and avoid having flickers when switching from paint preview - // to the live page. - new Handler().postDelayed(() -> { - if (!isShowingAndNeedsBadge()) return; - - removePaintPreview(ExitCause.TAB_FINISHED_LOADING); - }, delayMs); - } - - @Override - public void onRestoreStarted(Tab tab) { - mDidStartRestore = true; - } - - @Override - public void onDidStartNavigation(Tab tab, NavigationHandle navigationHandle) { - if (mPlayerManager == null || !isShowingAndNeedsBadge()) return; - - // Ignore navigations from subframes. We should only remove the paint preview - // player when the user navigates to a new page. - if (!navigationHandle.isInMainFrame()) return; - - // If we haven't started to restore, this is the navigation call to start the - // restoration. We shouldn't remove the paint preview player. - if (!mDidStartRestore) return; - - removePaintPreview(ExitCause.NAVIGATION_STARTED); - } - - @Override - public void onHidden(Tab tab, @TabHidingType int hidingType) { - releasePersistentToolbar(); - dismissSnackbar(); - setProgressPreventionNeeded(false); - - if (mPlayerManager == null || !isShowingAndNeedsBadge()) return; - - // If the tab is hidden as a result of pausing the activity we shouldn't remove it. - if (hidingType == TabHidingType.ACTIVITY_HIDDEN) return; - - removePaintPreview(ExitCause.TAB_HIDDEN); - } - - @Override - public void onShown(Tab tab, int type) { - if (!isShowingAndNeedsBadge()) return; - - showToolbarPersistent(); - setProgressPreventionNeeded(true); - } - } - - private TabbedPaintPreviewPlayer(Tab tab) { - mTab = tab; - mPaintPreviewTabService = PaintPreviewTabServiceFactory.getServiceInstance(); - mMetricsHelper = new TabbedPaintPreviewMetricsHelper(); - mObserver = new TabbedPaintPreviewObserver(); - mTab.addObserver(mObserver); - } - - public void setBrowserVisibilityDelegate( - BrowserStateBrowserControlsVisibilityDelegate browserVisibilityDelegate) { - mBrowserVisibilityDelegate = browserVisibilityDelegate; - } - - public void setProgressSimulatorNeededCallback(Runnable callback) { - mProgressSimulatorNeededCallback = callback; - } - - public void setProgressbarUpdatePreventionCallback(Callback<Boolean> callback) { - mProgressPreventionCallback = callback; - } - - /** - * Triggered via {@link PageLoadMetrics.Observer} when First Meaningful Paint happens. - * @param webContents the webContents that triggered the event. - * @return Whether the event was handled for the provided webContents. - */ - public void onFirstMeaningfulPaint(WebContents webContents) { - // If there is no observer or tab this will never handle the event so it should be - // treated as a success. - if (mObserver == null || mTab == null) return; - - if (mTab.getWebContents() != webContents) return; - - mFirstMeaningfulPaintHappened = true; - mObserver.onFirstMeaningfulPaint(); - } - - /** - * Shows a Paint Preview for the provided tab if it exists and has not been displayed for this - * Tab before. - * @param onDismissed The callback for when the Paint Preview is dismissed. - * @param activityCreationTimestampMs The hosting activity's creation time in ms from - * @param recordFirstPaint Callable to determine if first paint should be recorded. - * {@link SystemClock#elapsedRealtime}. - * @return Whether the Paint Preview started to initialize or is already initializating. - * Note that if the Paint Preview is already showing, this will return false. - */ - public boolean maybeShow(@Nullable Runnable onDismissed, long activityCreationTimestampMs, - Callable<Boolean> recordFirstPaint) { - if (mInitializing != null) return mInitializing; - - // Check if a capture exists. This is a quick check using a cache. - boolean hasCapture = mPaintPreviewTabService.hasCaptureForTab(mTab.getId()); - mInitializing = hasCapture; - mMetricsHelper.recordHadCapture(hasCapture); - if (!hasCapture) return false; - - PaintPreviewCompositorUtils.warmupCompositor(); - mFirstMeaningfulPaintHappened = false; - - mPlayerManager = new PlayerManager(mTab.getUrl(), mTab.getContext(), - mPaintPreviewTabService, String.valueOf(mTab.getId()), this::onLinkClicked, - () -> removePaintPreview(ExitCause.PULL_TO_REFRESH), - () -> { - mInitializing = false; - if (mFirstMeaningfulPaintHappened) { - removePaintPreview(ExitCause.TAB_FINISHED_LOADING); - return; - } - mMetricsHelper.onShown(); - }, - () -> { - if (!isShowingAndNeedsBadge()) return; - - mMetricsHelper.onFirstPaint(activityCreationTimestampMs, recordFirstPaint); - }, - null, - ChromeColors.getPrimaryBackgroundColor(mTab.getContext().getResources(), false), - (status) -> { - mMetricsHelper.onCompositorFailure(status); - removePaintPreview(ExitCause.COMPOSITOR_FAILURE); - }, - /*ignoreInitialScrollOffset=*/false); - mPlayerManager.setUserFrustrationCallback(this::showSnackbar); - mOnDismissed = onDismissed; - mTab.getTabViewManager().addTabViewProvider(this); - return true; - } - - /** - * Removes the view containing the Paint Preview from the most recently shown {@link Tab}. Does - * nothing if there is no view showing. - */ - private void removePaintPreview(@ExitCause int exitCause) { - PaintPreviewCompositorUtils.stopWarmCompositor(); - mInitializing = false; - if (mTab == null || mPlayerManager == null || mFadingOut) return; - - mFadingOut = true; - if (mOnDismissed != null) mOnDismissed.run(); - mOnDismissed = null; - Point scrollPosition = mPlayerManager.getScrollPosition(); - if (mTab.getWebContents() != null && scrollPosition != null) { - mTab.getWebContents().getEventForwarder().scrollTo(scrollPosition.x, scrollPosition.y); - } - mPlayerManager.setAcceptUserInput(false); - boolean needsAnimation = exitCause == ExitCause.TAB_FINISHED_LOADING - || exitCause == ExitCause.SNACK_BAR_ACTION - || exitCause == ExitCause.PULL_TO_REFRESH; - getView() - .animate() - .alpha(0f) - .setDuration(needsAnimation ? CROSS_FADE_DURATION_MS : 0) - .setListener(new AnimatorListenerAdapter() { - @Override - public void onAnimationEnd(Animator animation) { - if (mTab != null) { - mTab.getTabViewManager().removeTabViewProvider( - TabbedPaintPreviewPlayer.this); - } - if (mPlayerManager != null) { - mPlayerManager.destroy(); - mPlayerManager = null; - } - mFadingOut = false; - } - }); - if (exitCause == ExitCause.TAB_FINISHED_LOADING) showUpgradeToast(); - if (mProgressSimulatorNeededCallback != null) mProgressSimulatorNeededCallback.run(); - mMetricsHelper.recordExitMetrics(exitCause, mSnackbarShownCount); - } - - private void showUpgradeToast() { - if (mTab == null) return; - - Toast.makeText(mTab.getContext(), R.string.paint_preview_startup_auto_upgrade_toast, - Toast.LENGTH_SHORT).show(); - } - - private void showSnackbar() { - if (mTab == null || mTab.getWindowAndroid() == null) return; - - // If the Snackbar is already being displayed, return. - if (System.currentTimeMillis() - mLastShownSnackBarTime < SNACKBAR_DURATION_MS) return; - - if (mSnackbarController == null) { - mSnackbarController = new SnackbarManager.SnackbarController() { - @Override - public void onAction(Object actionData) { - removePaintPreview(ExitCause.SNACK_BAR_ACTION); - } - - @Override - public void onDismissNoAction(Object actionData) {} - }; - } - Resources resources = mTab.getContext().getResources(); - Snackbar snackbar = Snackbar.make( - resources.getString(R.string.paint_preview_startup_upgrade_snackbar_message), - mSnackbarController, Snackbar.TYPE_NOTIFICATION, - Snackbar.UMA_PAINT_PREVIEW_UPGRADE_NOTIFICATION); - snackbar.setAction( - resources.getString(R.string.paint_preview_startup_upgrade_snackbar_action), null); - snackbar.setDuration(SNACKBAR_DURATION_MS); - SnackbarManagerProvider.from(mTab.getWindowAndroid()).showSnackbar(snackbar); - mLastShownSnackBarTime = System.currentTimeMillis(); - mSnackbarShownCount++; - } - - private void dismissSnackbar() { - if (mSnackbarController == null || mTab == null || mTab.getWindowAndroid() == null) return; - - SnackbarManagerProvider.from(mTab.getWindowAndroid()).dismissSnackbars(mSnackbarController); - } - - private void setProgressPreventionNeeded(boolean progressPrevention) { - if (mProgressPreventionCallback == null) return; - - mProgressPreventionCallback.onResult(progressPrevention); - } - - public boolean isShowingAndNeedsBadge() { - if (mTab == null) return false; - - return mTab.getTabViewManager().isShowing(this); - } - - private void onLinkClicked(GURL url) { - if (mTab == null || !url.isValid() || url.isEmpty()) return; - - removePaintPreview(ExitCause.LINK_CLICKED); - mTab.loadUrl(new LoadUrlParams(url.getSpec())); - } - - /** - * Persistently shows the toolbar and avoids hiding it on scrolling down. - */ - private void showToolbarPersistent() { - if (mBrowserVisibilityDelegate == null - || mPersistentToolbarToken != TokenHolder.INVALID_TOKEN) { - return; - } - - mPersistentToolbarToken = mBrowserVisibilityDelegate.showControlsPersistent(); - } - - private void releasePersistentToolbar() { - if (mBrowserVisibilityDelegate == null) return; - - mBrowserVisibilityDelegate.releasePersistentShowingToken(mPersistentToolbarToken); - mPersistentToolbarToken = TokenHolder.INVALID_TOKEN; - } - - @Override - public int getTabViewProviderType() { - return Type.PAINT_PREVIEW; - } - - @Override - public View getView() { - return mPlayerManager == null ? null : mPlayerManager.getView(); - } - - @Override - public void onShown() { - showToolbarPersistent(); - setProgressPreventionNeeded(true); - } - - @Override - public void onHidden() { - releasePersistentToolbar(); - dismissSnackbar(); - setProgressPreventionNeeded(false); - } - - @Override - public void destroy() { - removePaintPreview(ExitCause.TAB_DESTROYED); - mTab.removeObserver(mObserver); - mTab = null; - } -}
diff --git a/chrome/browser/paint_preview/android/java/src/org/chromium/chrome/browser/paint_preview/services/PaintPreviewDemoService.java b/chrome/browser/paint_preview/android/java/src/org/chromium/chrome/browser/paint_preview/services/PaintPreviewDemoService.java deleted file mode 100644 index 347b0af..0000000 --- a/chrome/browser/paint_preview/android/java/src/org/chromium/chrome/browser/paint_preview/services/PaintPreviewDemoService.java +++ /dev/null
@@ -1,64 +0,0 @@ -// Copyright 2020 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -package org.chromium.chrome.browser.paint_preview.services; - -import org.chromium.base.Callback; -import org.chromium.base.annotations.CalledByNative; -import org.chromium.base.annotations.JNINamespace; -import org.chromium.base.annotations.NativeMethods; -import org.chromium.components.paintpreview.browser.NativePaintPreviewServiceProvider; -import org.chromium.content_public.browser.WebContents; - -/** - * The Java-side implementations of paint_preview_demo_service.cc. The C++ side owns and controls - * the lifecycle of the Java implementation. - * This class provides the required functionalities for capturing and playing back the Paint Preview - * representation of tab for the purpose of a demoing the Paint Preview component. - */ -@JNINamespace("paint_preview") -public class PaintPreviewDemoService implements NativePaintPreviewServiceProvider { - private long mNativePaintPreviewDemoService; - - @CalledByNative - private PaintPreviewDemoService(long nativePaintPreviewDemoService) { - mNativePaintPreviewDemoService = nativePaintPreviewDemoService; - } - - @CalledByNative - private void destroy() { - mNativePaintPreviewDemoService = 0; - } - - @Override - public long getNativeService() { - return mNativePaintPreviewDemoService; - } - - public void capturePaintPreview( - WebContents webContents, int tabId, Callback<Boolean> successCallback) { - if (mNativePaintPreviewDemoService == 0) { - successCallback.onResult(false); - return; - } - - PaintPreviewDemoServiceJni.get().capturePaintPreviewJni( - mNativePaintPreviewDemoService, webContents, tabId, successCallback); - } - - public void cleanUpForTabId(int tabId) { - if (mNativePaintPreviewDemoService == 0) { - return; - } - - PaintPreviewDemoServiceJni.get().cleanUpForTabId(mNativePaintPreviewDemoService, tabId); - } - - @NativeMethods - interface Natives { - void capturePaintPreviewJni(long nativePaintPreviewDemoService, WebContents webContents, - int tabId, Callback<Boolean> successCallback); - void cleanUpForTabId(long nativePaintPreviewDemoService, int tabId); - } -}
diff --git a/chrome/browser/paint_preview/android/java/src/org/chromium/chrome/browser/paint_preview/services/PaintPreviewDemoServiceFactory.java b/chrome/browser/paint_preview/android/java/src/org/chromium/chrome/browser/paint_preview/services/PaintPreviewDemoServiceFactory.java deleted file mode 100644 index a13f24b..0000000 --- a/chrome/browser/paint_preview/android/java/src/org/chromium/chrome/browser/paint_preview/services/PaintPreviewDemoServiceFactory.java +++ /dev/null
@@ -1,24 +0,0 @@ -// Copyright 2020 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -package org.chromium.chrome.browser.paint_preview.services; - -import org.chromium.base.annotations.JNINamespace; -import org.chromium.base.annotations.NativeMethods; - -/** - * The Java-side implementations of paint_preview_demo_service_factory.cc. Provides an instance of - * {@link PaintPreviewDemoService}. - */ -@JNINamespace("paint_preview") -public class PaintPreviewDemoServiceFactory { - public static PaintPreviewDemoService getServiceInstance() { - return PaintPreviewDemoServiceFactoryJni.get().getServiceInstanceForCurrentProfile(); - } - - @NativeMethods - interface Natives { - PaintPreviewDemoService getServiceInstanceForCurrentProfile(); - } -}
diff --git a/chrome/browser/paint_preview/android/java/src/org/chromium/chrome/browser/paint_preview/services/PaintPreviewTabService.java b/chrome/browser/paint_preview/android/java/src/org/chromium/chrome/browser/paint_preview/services/PaintPreviewTabService.java index a4ffdebd..3f4c653d5 100644 --- a/chrome/browser/paint_preview/android/java/src/org/chromium/chrome/browser/paint_preview/services/PaintPreviewTabService.java +++ b/chrome/browser/paint_preview/android/java/src/org/chromium/chrome/browser/paint_preview/services/PaintPreviewTabService.java
@@ -193,7 +193,7 @@ } } - private void captureTab(Tab tab, Callback<Boolean> successCallback) { + public void captureTab(Tab tab, Callback<Boolean> successCallback) { if (mNativePaintPreviewTabService == 0) { successCallback.onResult(false); return;
diff --git a/chrome/browser/paint_preview/services/paint_preview_demo_service.cc b/chrome/browser/paint_preview/services/paint_preview_demo_service.cc deleted file mode 100644 index cb788d02..0000000 --- a/chrome/browser/paint_preview/services/paint_preview_demo_service.cc +++ /dev/null
@@ -1,135 +0,0 @@ -// Copyright 2020 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "chrome/browser/paint_preview/services/paint_preview_demo_service.h" - -#include <memory> - -#include "base/files/file_path.h" -#include "base/strings/string_util.h" -#include "base/task/post_task.h" -#include "base/task/thread_pool.h" -#include "build/build_config.h" -#include "components/paint_preview/browser/file_manager.h" -#include "components/paint_preview/browser/paint_preview_base_service.h" -#include "components/paint_preview/browser/paint_preview_policy.h" -#include "content/public/browser/web_contents.h" -#include "ui/gfx/geometry/rect.h" -#if defined(OS_ANDROID) -#include "base/android/callback_android.h" -#include "base/android/jni_string.h" -#include "chrome/browser/paint_preview/android/jni_headers/PaintPreviewDemoService_jni.h" - -using base::android::JavaParamRef; -using base::android::ScopedJavaGlobalRef; -#endif // defined(OS_ANDROID) - -namespace paint_preview { - -PaintPreviewDemoService::PaintPreviewDemoService( - const base::FilePath& profile_path, - bool is_off_the_record) - : PaintPreviewBaseService(profile_path, - "PaintPreviewDemoService", - nullptr, - is_off_the_record) { -#if defined(OS_ANDROID) - JNIEnv* env = base::android::AttachCurrentThread(); - java_ref_.Reset(Java_PaintPreviewDemoService_Constructor( - env, reinterpret_cast<intptr_t>(this))); -#endif // defined(OS_ANDROID) -} - -PaintPreviewDemoService::~PaintPreviewDemoService() { -#if defined(OS_ANDROID) - JNIEnv* env = base::android::AttachCurrentThread(); - Java_PaintPreviewDemoService_destroy(env, java_ref_); - java_ref_.Reset(); -#endif // defined(OS_ANDROID) -} - -#if defined(OS_ANDROID) -void PaintPreviewDemoService::CleanUpForTabId(JNIEnv* env, jint tab_id) { - auto file_manager = GetFileManager(); - GetTaskRunner()->PostTask( - FROM_HERE, base::BindOnce(&FileManager::DeleteArtifactSet, file_manager, - file_manager->CreateKey(tab_id))); -} - -void PaintPreviewDemoService::CapturePaintPreviewJni( - JNIEnv* env, - const JavaParamRef<jobject>& j_web_contents, - int tab_id, - const JavaParamRef<jobject>& j_callback) { - content::WebContents* web_contents = - content::WebContents::FromJavaWebContents(j_web_contents); - CapturePaintPreview( - web_contents, tab_id, - base::BindOnce( - [](const ScopedJavaGlobalRef<jobject>& java_callback, bool success) { - base::android::RunBooleanCallbackAndroid(java_callback, success); - }, - ScopedJavaGlobalRef<jobject>(j_callback))); -} -#endif // defined(OS_ANDROID) - -void PaintPreviewDemoService::CapturePaintPreview( - content::WebContents* web_contents, - int tab_id, - FinishedSuccessfullyCallback callback) { - DirectoryKey key = GetFileManager()->CreateKey(tab_id); - GetTaskRunner()->PostTaskAndReplyWithResult( - FROM_HERE, - base::BindOnce(&FileManager::CreateOrGetDirectory, GetFileManager(), key, - true), - base::BindOnce(&PaintPreviewDemoService::CaptureTabInternal, - weak_ptr_factory_.GetWeakPtr(), - web_contents->GetMainFrame()->GetFrameTreeNodeId(), key, - std::move(callback))); -} - -void PaintPreviewDemoService::CaptureTabInternal( - int main_frame_tree_no_id, - const DirectoryKey& key, - FinishedSuccessfullyCallback callback, - const base::Optional<base::FilePath>& file_path) { - content::WebContents* web_contents = - content::WebContents::FromFrameTreeNodeId(main_frame_tree_no_id); - if (!file_path.has_value() || !web_contents) { - std::move(callback).Run(false); - return; - } - - PaintPreviewBaseService::CapturePaintPreview( - web_contents, file_path.value(), gfx::Rect(), /*capture_links=*/true, - /*max_per_capture_size=*/0, - base::BindOnce(&PaintPreviewDemoService::OnCaptured, - weak_ptr_factory_.GetWeakPtr(), std::move(callback), key)); -} - -void PaintPreviewDemoService::OnCaptured( - FinishedSuccessfullyCallback callback, - const DirectoryKey& key, - PaintPreviewBaseService::CaptureStatus status, - std::unique_ptr<CaptureResult> result) { - if (status != PaintPreviewBaseService::CaptureStatus::kOk || - !result->capture_success) { - std::move(callback).Run(false); - return; - } - - GetTaskRunner()->PostTaskAndReplyWithResult( - FROM_HERE, - base::BindOnce(&FileManager::SerializePaintPreviewProto, GetFileManager(), - key, result->proto, true), - base::BindOnce(&PaintPreviewDemoService::OnSerializationFinished, - weak_ptr_factory_.GetWeakPtr(), std::move(callback))); -} - -void PaintPreviewDemoService::OnSerializationFinished( - FinishedSuccessfullyCallback callback, - bool success) { - std::move(callback).Run(success); -} -} // namespace paint_preview
diff --git a/chrome/browser/paint_preview/services/paint_preview_demo_service.h b/chrome/browser/paint_preview/services/paint_preview_demo_service.h deleted file mode 100644 index 1d46937..0000000 --- a/chrome/browser/paint_preview/services/paint_preview_demo_service.h +++ /dev/null
@@ -1,77 +0,0 @@ -// Copyright 2020 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef CHROME_BROWSER_PAINT_PREVIEW_SERVICES_PAINT_PREVIEW_DEMO_SERVICE_H_ -#define CHROME_BROWSER_PAINT_PREVIEW_SERVICES_PAINT_PREVIEW_DEMO_SERVICE_H_ - -#include <memory> - -#include "base/files/file_path.h" -#include "base/memory/scoped_refptr.h" -#include "base/memory/weak_ptr.h" -#include "build/build_config.h" -#include "components/paint_preview/browser/paint_preview_base_service.h" -#include "components/paint_preview/browser/paint_preview_policy.h" -#if defined(OS_ANDROID) -#include "base/android/jni_android.h" -#include "base/android/scoped_java_ref.h" -#endif // defined(OS_ANDROID) - -namespace content { -class WebContents; -} // namespace content - -namespace paint_preview { - -// A PaintPreviewBaseService used for demoing the paint preview -// component. -class PaintPreviewDemoService : public PaintPreviewBaseService { - public: - PaintPreviewDemoService(const base::FilePath& profile_dir, - bool is_off_the_record); - ~PaintPreviewDemoService() override; - PaintPreviewDemoService(const PaintPreviewDemoService&) = delete; - PaintPreviewDemoService& operator=(const PaintPreviewDemoService&) = delete; - -#if defined(OS_ANDROID) - base::android::ScopedJavaGlobalRef<jobject> GetJavaRef() { return java_ref_; } - - void CleanUpForTabId(JNIEnv* env, jint tab_id); - - void CapturePaintPreviewJni( - JNIEnv* env, - const base::android::JavaParamRef<jobject>& j_web_contents, - jint tab_id, - const base::android::JavaParamRef<jobject>& j_callback); -#endif // defined(OS_ANDROID) - - using FinishedSuccessfullyCallback = base::OnceCallback<void(bool)>; - void CapturePaintPreview(content::WebContents* web_contents, - int tab_id, - FinishedSuccessfullyCallback callback); - - private: - void CaptureTabInternal(int main_frame_tree_no_id, - const DirectoryKey& key, - FinishedSuccessfullyCallback callback, - const base::Optional<base::FilePath>& file_path); - - void OnCaptured(FinishedSuccessfullyCallback callback, - const DirectoryKey& key, - PaintPreviewBaseService::CaptureStatus status, - std::unique_ptr<CaptureResult> result); - - void OnSerializationFinished(FinishedSuccessfullyCallback callback, - bool success); - -#if defined(OS_ANDROID) - // The java side PaintPreviewDemoService. - base::android::ScopedJavaGlobalRef<jobject> java_ref_; -#endif // defined(OS_ANDROID) - base::WeakPtrFactory<PaintPreviewDemoService> weak_ptr_factory_{this}; -}; - -} // namespace paint_preview - -#endif // CHROME_BROWSER_PAINT_PREVIEW_SERVICES_PAINT_PREVIEW_DEMO_SERVICE_H_
diff --git a/chrome/browser/paint_preview/services/paint_preview_demo_service_factory.cc b/chrome/browser/paint_preview/services/paint_preview_demo_service_factory.cc deleted file mode 100644 index bc0a3e8c..0000000 --- a/chrome/browser/paint_preview/services/paint_preview_demo_service_factory.cc +++ /dev/null
@@ -1,71 +0,0 @@ -// Copyright 2020 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "chrome/browser/paint_preview/services/paint_preview_demo_service_factory.h" - -#include <memory> - -#include "base/files/file_path.h" -#include "base/memory/singleton.h" -#include "build/build_config.h" -#include "chrome/browser/paint_preview/services/paint_preview_demo_service.h" -#include "components/keyed_service/core/keyed_service.h" -#include "components/keyed_service/core/simple_dependency_manager.h" -#include "components/keyed_service/core/simple_factory_key.h" -#include "components/keyed_service/core/simple_keyed_service_factory.h" -#if defined(OS_ANDROID) -#include "base/android/jni_android.h" -#include "base/android/scoped_java_ref.h" -#include "chrome/browser/paint_preview/android/jni_headers/PaintPreviewDemoServiceFactory_jni.h" -#include "chrome/browser/profiles/profile_key.h" -#include "chrome/browser/profiles/profile_manager.h" -#endif // defined(OS_ANDROID) - -namespace paint_preview { - -#if defined(OS_ANDROID) -base::android::ScopedJavaLocalRef<jobject> -JNI_PaintPreviewDemoServiceFactory_GetServiceInstanceForCurrentProfile( - JNIEnv* env) { - ProfileKey* profile_key = - ProfileManager::GetLastUsedProfile()->GetProfileKey(); - base::android::ScopedJavaGlobalRef<jobject> java_ref = - PaintPreviewDemoServiceFactory::GetForKey(profile_key)->GetJavaRef(); - return base::android::ScopedJavaLocalRef<jobject>(java_ref); -} -#endif // defined(OS_ANDROID) - -// static -PaintPreviewDemoServiceFactory* PaintPreviewDemoServiceFactory::GetInstance() { - return base::Singleton<PaintPreviewDemoServiceFactory>::get(); -} - -// static -PaintPreviewDemoService* PaintPreviewDemoServiceFactory::GetForKey( - SimpleFactoryKey* key) { - return static_cast<PaintPreviewDemoService*>( - GetInstance()->GetServiceForKey(key, true)); -} - -PaintPreviewDemoServiceFactory::PaintPreviewDemoServiceFactory() - : SimpleKeyedServiceFactory("paint_preview::PaintPreviewDemoService", - SimpleDependencyManager::GetInstance()) {} -PaintPreviewDemoServiceFactory::~PaintPreviewDemoServiceFactory() = default; - -std::unique_ptr<KeyedService> -PaintPreviewDemoServiceFactory::BuildServiceInstanceFor( - SimpleFactoryKey* key) const { - if (key->IsOffTheRecord()) - return nullptr; - - return std::make_unique<PaintPreviewDemoService>(key->GetPath(), - key->IsOffTheRecord()); -} - -SimpleFactoryKey* PaintPreviewDemoServiceFactory::GetKeyToUse( - SimpleFactoryKey* key) const { - return key; -} - -} // namespace paint_preview
diff --git a/chrome/browser/paint_preview/services/paint_preview_demo_service_factory.h b/chrome/browser/paint_preview/services/paint_preview_demo_service_factory.h deleted file mode 100644 index c88a73a..0000000 --- a/chrome/browser/paint_preview/services/paint_preview_demo_service_factory.h +++ /dev/null
@@ -1,44 +0,0 @@ -// Copyright 2020 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef CHROME_BROWSER_PAINT_PREVIEW_SERVICES_PAINT_PREVIEW_DEMO_SERVICE_FACTORY_H_ -#define CHROME_BROWSER_PAINT_PREVIEW_SERVICES_PAINT_PREVIEW_DEMO_SERVICE_FACTORY_H_ - -#include <memory> - -#include "base/memory/singleton.h" -#include "chrome/browser/paint_preview/services/paint_preview_demo_service.h" -#include "components/keyed_service/core/keyed_service.h" -#include "components/keyed_service/core/simple_factory_key.h" -#include "components/keyed_service/core/simple_keyed_service_factory.h" - -namespace paint_preview { - -class PaintPreviewDemoServiceFactory : public SimpleKeyedServiceFactory { - public: - static PaintPreviewDemoServiceFactory* GetInstance(); - static PaintPreviewDemoService* GetForKey(SimpleFactoryKey* key); - - PaintPreviewDemoServiceFactory(const PaintPreviewDemoServiceFactory&) = - delete; - PaintPreviewDemoServiceFactory& operator=( - const PaintPreviewDemoServiceFactory&) = delete; - - private: - friend struct base::DefaultSingletonTraits<PaintPreviewDemoServiceFactory>; - - PaintPreviewDemoServiceFactory(); - - ~PaintPreviewDemoServiceFactory() override; - - // SimpleKeyedServiceFactory - std::unique_ptr<KeyedService> BuildServiceInstanceFor( - SimpleFactoryKey* key) const override; - - SimpleFactoryKey* GetKeyToUse(SimpleFactoryKey* key) const override; -}; - -} // namespace paint_preview - -#endif // CHROME_BROWSER_PAINT_PREVIEW_SERVICES_PAINT_PREVIEW_DEMO_SERVICE_FACTORY_H_
diff --git a/chrome/browser/paint_preview/services/paint_preview_demo_service_unittest.cc b/chrome/browser/paint_preview/services/paint_preview_demo_service_unittest.cc deleted file mode 100644 index 53d16b2..0000000 --- a/chrome/browser/paint_preview/services/paint_preview_demo_service_unittest.cc +++ /dev/null
@@ -1,146 +0,0 @@ -// Copyright 2020 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "chrome/browser/paint_preview/services/paint_preview_demo_service.h" - -#include <memory> -#include <utility> -#include <vector> - -#include "base/files/file_enumerator.h" -#include "base/files/scoped_temp_dir.h" -#include "base/run_loop.h" -#include "chrome/test/base/chrome_render_view_host_test_harness.h" -#include "components/paint_preview/common/mojom/paint_preview_recorder.mojom.h" -#include "content/public/test/navigation_simulator.h" -#include "content/public/test/test_utils.h" -#include "mojo/public/cpp/bindings/associated_receiver.h" -#include "testing/gtest/include/gtest/gtest.h" -#include "third_party/blink/public/common/associated_interfaces/associated_interface_provider.h" - -namespace paint_preview { - -namespace { - -class MockPaintPreviewRecorder : public mojom::PaintPreviewRecorder { - public: - MockPaintPreviewRecorder() = default; - ~MockPaintPreviewRecorder() override = default; - - MockPaintPreviewRecorder(const MockPaintPreviewRecorder&) = delete; - MockPaintPreviewRecorder& operator=(const MockPaintPreviewRecorder&) = delete; - - void CapturePaintPreview( - mojom::PaintPreviewCaptureParamsPtr params, - mojom::PaintPreviewRecorder::CapturePaintPreviewCallback callback) - override { - std::move(callback).Run(status_, mojom::PaintPreviewCaptureResponse::New()); - } - - void SetResponse(mojom::PaintPreviewStatus status) { status_ = status; } - - void BindRequest(mojo::ScopedInterfaceEndpointHandle handle) { - binding_.Bind(mojo::PendingAssociatedReceiver<mojom::PaintPreviewRecorder>( - std::move(handle))); - } - - private: - mojom::PaintPreviewStatus status_; - mojo::AssociatedReceiver<mojom::PaintPreviewRecorder> binding_{this}; -}; - -} // namespace - -class PaintPreviewDemoServiceTest : public ChromeRenderViewHostTestHarness { - public: - PaintPreviewDemoServiceTest() = default; - ~PaintPreviewDemoServiceTest() override = default; - - PaintPreviewDemoServiceTest(const PaintPreviewDemoServiceTest&) = delete; - PaintPreviewDemoServiceTest& operator=(const PaintPreviewDemoServiceTest&) = - delete; - - protected: - void SetUp() override { - ChromeRenderViewHostTestHarness::SetUp(); - EXPECT_TRUE(temp_dir_.CreateUniqueTempDir()); - service_ = - std::make_unique<PaintPreviewDemoService>(temp_dir_.GetPath(), false); - } - - PaintPreviewDemoService* GetService() { return service_.get(); } - - void OverrideInterface(MockPaintPreviewRecorder* recorder) { - blink::AssociatedInterfaceProvider* remote_interfaces = - web_contents()->GetMainFrame()->GetRemoteAssociatedInterfaces(); - remote_interfaces->OverrideBinderForTesting( - mojom::PaintPreviewRecorder::Name_, - base::BindRepeating(&MockPaintPreviewRecorder::BindRequest, - base::Unretained(recorder))); - } - - private: - std::unique_ptr<PaintPreviewDemoService> service_; - base::ScopedTempDir temp_dir_; -}; - -TEST_F(PaintPreviewDemoServiceTest, CapturePaintPreview) { - content::NavigationSimulator::NavigateAndCommitFromBrowser( - web_contents(), GURL("http://www.example.com")); - const int kTabId = 12U; - - MockPaintPreviewRecorder recorder; - recorder.SetResponse(mojom::PaintPreviewStatus::kOk); - OverrideInterface(&recorder); - - auto* service = GetService(); - base::RunLoop loop; - service->CapturePaintPreview(web_contents(), kTabId, - base::BindOnce( - [](base::OnceClosure quit, bool success) { - EXPECT_TRUE(success); - std::move(quit).Run(); - }, - loop.QuitClosure())); - loop.Run(); - - auto file_manager = service->GetFileManager(); - const DirectoryKey key = file_manager->CreateKey(kTabId); - service->GetTaskRunner()->PostTaskAndReplyWithResult( - FROM_HERE, - base::BindOnce(&FileManager::DirectoryExists, file_manager, key), - base::BindOnce([](bool exists) { EXPECT_TRUE(exists); })); - content::RunAllTasksUntilIdle(); -} - -TEST_F(PaintPreviewDemoServiceTest, CapturePaintPreviewFailed) { - content::NavigationSimulator::NavigateAndCommitFromBrowser( - web_contents(), GURL("http://www.example.com")); - const int kTabId = 12U; - - MockPaintPreviewRecorder recorder; - recorder.SetResponse(mojom::PaintPreviewStatus::kFailed); - OverrideInterface(&recorder); - - auto* service = GetService(); - base::RunLoop loop; - service->CapturePaintPreview(web_contents(), kTabId, - base::BindOnce( - [](base::OnceClosure quit, bool success) { - EXPECT_FALSE(success); - std::move(quit).Run(); - }, - loop.QuitClosure())); - loop.Run(); - - auto file_manager = service->GetFileManager(); - auto key = file_manager->CreateKey(kTabId); - service->GetTaskRunner()->PostTaskAndReplyWithResult( - FROM_HERE, - base::BindOnce(&FileManager::DirectoryExists, file_manager, key), - base::BindOnce([](bool exists) { EXPECT_TRUE(exists); })); - content::RunAllTasksUntilIdle(); -} - -} // namespace paint_preview
diff --git a/chrome/browser/profiles/profile_attributes_entry.cc b/chrome/browser/profiles/profile_attributes_entry.cc index c18ba90..1131cc3 100644 --- a/chrome/browser/profiles/profile_attributes_entry.cc +++ b/chrome/browser/profiles/profile_attributes_entry.cc
@@ -97,6 +97,11 @@ return base::PersistentHash(value) % kNumberOfLowEntropyHashValues; } +bool ShouldShowGenericColoredAvatar(size_t avatar_icon_index) { + return base::FeatureList::IsEnabled(features::kNewProfilePicker) && + avatar_icon_index == profiles::GetPlaceholderAvatarIndex(); +} + } // namespace bool ProfileThemeColors::operator==(const ProfileThemeColors& other) const { @@ -300,8 +305,7 @@ // TODO(crbug.com/1100835): After launch, remove the treatment of placeholder // avatars from GetHighResAvatar() and from any other places. - if (base::FeatureList::IsEnabled(features::kNewProfilePicker) && - GetAvatarIconIndex() == profiles::GetPlaceholderAvatarIndex()) { + if (ShouldShowGenericColoredAvatar(GetAvatarIconIndex())) { return GetPlaceholderAvatarIcon(size_for_placeholder_avatar); } @@ -615,16 +619,22 @@ void ProfileAttributesEntry::SetProfileThemeColors( const base::Optional<ProfileThemeColors>& colors) { + bool changed = false; if (colors.has_value()) { - SetInteger(kProfileHighlightColorKey, colors->profile_highlight_color); - SetInteger(kDefaultAvatarFillColorKey, colors->default_avatar_fill_color); - SetInteger(kDefaultAvatarStrokeColorKey, - colors->default_avatar_stroke_color); + changed |= + SetInteger(kProfileHighlightColorKey, colors->profile_highlight_color); + changed |= SetInteger(kDefaultAvatarFillColorKey, + colors->default_avatar_fill_color); + changed |= SetInteger(kDefaultAvatarStrokeColorKey, + colors->default_avatar_stroke_color); } else { - ClearValue(kProfileHighlightColorKey); - ClearValue(kDefaultAvatarFillColorKey); - ClearValue(kDefaultAvatarStrokeColorKey); + changed |= ClearValue(kProfileHighlightColorKey); + changed |= ClearValue(kDefaultAvatarFillColorKey); + changed |= ClearValue(kDefaultAvatarStrokeColorKey); } + + if (changed && ShouldShowGenericColoredAvatar(GetAvatarIconIndex())) + profile_info_cache_->NotifyOnProfileAvatarChanged(GetPath()); } void ProfileAttributesEntry::SetHostedDomain(std::string hosted_domain) {
diff --git a/chrome/browser/profiles/profile_attributes_storage.cc b/chrome/browser/profiles/profile_attributes_storage.cc index e260fa61..a520ff8a 100644 --- a/chrome/browser/profiles/profile_attributes_storage.cc +++ b/chrome/browser/profiles/profile_attributes_storage.cc
@@ -19,7 +19,6 @@ #include "base/task/thread_pool.h" #include "base/task_runner_util.h" #include "base/threading/scoped_blocking_call.h" -#include "build/build_config.h" #include "chrome/browser/profiles/profile_avatar_downloader.h" #include "chrome/browser/profiles/profile_avatar_icon_util.h" #include "chrome/browser/profiles/profile_metrics.h" @@ -32,6 +31,10 @@ #include "ui/base/l10n/l10n_util.h" #include "ui/gfx/image/image.h" +#if !defined(OS_ANDROID) +#include "chrome/browser/ui/browser_list.h" +#endif + namespace { using ImageData = std::vector<unsigned char>; @@ -387,6 +390,20 @@ observer_list_.RemoveObserver(obs); } +#if !defined(OS_ANDROID) +void ProfileAttributesStorage::RecordDeletedProfileState( + ProfileAttributesEntry* entry) { + DCHECK(entry); + RecordProfileState(entry, profile_metrics::StateSuffix::kUponDeletion); + bool is_last_profile = GetNumberOfProfiles() <= 1u; + // If the profile has windows opened, they are still open at this moment. + // Thus, this really means that only the profile manager is open. + bool no_browser_windows = BrowserList::GetInstance()->empty(); + profile_metrics::LogProfileDeletionContext(is_last_profile, + no_browser_windows); +} +#endif + void ProfileAttributesStorage::RecordProfilesState() { std::vector<ProfileAttributesEntry*> entries = GetAllProfilesAttributes(); if (entries.size() == 0)
diff --git a/chrome/browser/profiles/profile_attributes_storage.h b/chrome/browser/profiles/profile_attributes_storage.h index 63c42928..feb07458 100644 --- a/chrome/browser/profiles/profile_attributes_storage.h +++ b/chrome/browser/profiles/profile_attributes_storage.h
@@ -18,6 +18,7 @@ #include "base/memory/weak_ptr.h" #include "base/observer_list.h" #include "base/strings/string16.h" +#include "build/build_config.h" #include "chrome/browser/profiles/profile_attributes_entry.h" #include "chrome/browser/profiles/profile_info_cache_observer.h" @@ -96,6 +97,13 @@ bool IsDefaultProfileName(const base::string16& name, bool include_check_for_legacy_profile_name) const; +#if !defined(OS_ANDROID) + // Records statistics about a profile `entry` that is being deleted. If the + // profile has opened browser window(s) in the moment of deletion, this + // function must be called before these windows get closed. + void RecordDeletedProfileState(ProfileAttributesEntry* entry); +#endif + // Records statistics about profiles as would be visible in the profile picker // (if we would display it in this moment). void RecordProfilesState();
diff --git a/chrome/browser/profiles/profile_attributes_storage_unittest.cc b/chrome/browser/profiles/profile_attributes_storage_unittest.cc index 1c25453..dc034451 100644 --- a/chrome/browser/profiles/profile_attributes_storage_unittest.cc +++ b/chrome/browser/profiles/profile_attributes_storage_unittest.cc
@@ -12,6 +12,7 @@ #include "base/strings/stringprintf.h" #include "base/strings/utf_string_conversions.h" #include "base/test/metrics/histogram_tester.h" +#include "base/test/scoped_feature_list.h" #include "build/build_config.h" #include "chrome/browser/profiles/profile_attributes_entry.h" #include "chrome/browser/profiles/profile_avatar_downloader.h" @@ -20,6 +21,7 @@ #include "chrome/browser/profiles/profile_manager.h" #include "chrome/browser/signin/signin_util.h" #include "chrome/browser/supervised_user/supervised_user_constants.h" +#include "chrome/browser/ui/ui_features.h" #include "chrome/test/base/testing_browser_process.h" #include "chrome/test/base/testing_profile_manager.h" #include "components/account_id/account_id.h" @@ -922,13 +924,17 @@ // Themes aren't used on Android #if !defined(OS_ANDROID) TEST_F(ProfileAttributesStorageTest, ProfileThemeColors) { + base::test::ScopedFeatureList feature_list; + feature_list.InitAndEnableFeature(features::kNewProfilePicker); AddTestingProfile(); base::FilePath profile_path = GetProfilePath("testing_profile_path0"); - DisableObserver(); // No need to test observers in this test. - ProfileAttributesEntry* entry; ASSERT_TRUE(storage()->GetProfileAttributesWithPath(profile_path, &entry)); + EXPECT_CALL(observer(), OnProfileAvatarChanged(profile_path)).Times(1); + entry->SetAvatarIconIndex(profiles::GetPlaceholderAvatarIndex()); + VerifyAndResetCallExpectations(); + EXPECT_EQ(entry->GetProfileThemeColors(), ProfileAttributesEntry::GetDefaultProfileThemeColors(false)); @@ -940,16 +946,20 @@ ProfileThemeColors colors = {SK_ColorTRANSPARENT, SK_ColorBLACK, SK_ColorWHITE}; + EXPECT_CALL(observer(), OnProfileAvatarChanged(profile_path)).Times(1); entry->SetProfileThemeColors(colors); EXPECT_EQ(entry->GetProfileThemeColors(), colors); + VerifyAndResetCallExpectations(); // Colors shouldn't change after switching back to the light mode. ui::NativeTheme::GetInstanceForNativeUi()->set_use_dark_colors(false); EXPECT_EQ(entry->GetProfileThemeColors(), colors); // base::nullopt resets the colors to default. + EXPECT_CALL(observer(), OnProfileAvatarChanged(profile_path)).Times(1); entry->SetProfileThemeColors(base::nullopt); EXPECT_EQ(entry->GetProfileThemeColors(), ProfileAttributesEntry::GetDefaultProfileThemeColors(false)); + VerifyAndResetCallExpectations(); } #endif
diff --git a/chrome/browser/profiles/profile_manager.cc b/chrome/browser/profiles/profile_manager.cc index 7292864..274489b 100644 --- a/chrome/browser/profiles/profile_manager.cc +++ b/chrome/browser/profiles/profile_manager.cc
@@ -859,7 +859,14 @@ ProfileMetrics::ProfileDelete deletion_source) { if (!ScheduleProfileDirectoryForDeletion(profile_dir)) return; + + ProfileAttributesStorage& storage = GetProfileAttributesStorage(); + ProfileAttributesEntry* entry; + if (storage.GetProfileAttributesWithPath(profile_dir, &entry)) { + storage.RecordDeletedProfileState(entry); + } ProfileMetrics::LogProfileDeleteUser(deletion_source); + ScheduleProfileForDeletion(profile_dir, std::move(callback)); }
diff --git a/chrome/browser/resources/kaleidoscope/toolbar.html b/chrome/browser/resources/kaleidoscope/toolbar.html index ba8cd61..e549f44e 100644 --- a/chrome/browser/resources/kaleidoscope/toolbar.html +++ b/chrome/browser/resources/kaleidoscope/toolbar.html
@@ -8,4 +8,4 @@ z-index: 99; } </style> -<cr-toolbar id="toolbar" show-menu show-search="[[showSearch]]" menu-label="[[menuLabel]]" page-name="[[pageName]]"></cr-toolbar> +<cr-toolbar id="toolbar" show-menu on-search-changed="onSearchChanged_" menu-label="[[menuLabel]]" page-name="[[pageName]]"></cr-toolbar>
diff --git a/chrome/browser/resources/kaleidoscope/toolbar.js b/chrome/browser/resources/kaleidoscope/toolbar.js index d0fc8be..08dadde 100644 --- a/chrome/browser/resources/kaleidoscope/toolbar.js +++ b/chrome/browser/resources/kaleidoscope/toolbar.js
@@ -17,9 +17,6 @@ static get properties() { return { - // Controls whether the search field is shown. - showSearch: {type: Boolean, value: false}, - // Sets the tooltip text displayed on the menu button. menuLabel: {type: String, value: ''}, @@ -27,6 +24,27 @@ pageName: {type: String, value: ''}, }; } + + constructor() { + super(); + + this.timeoutInterval_ = null; + } + + /** + * @param {!CustomEvent<string>} e + * @private + */ + onSearchChanged_(e) { + clearInterval(this.timeoutInterval_); + + // Add a 300ms debounce so we don't fire for every character but should not + // be noticeable to the user. + this.timeoutInterval_ = setTimeout(() => { + const event = new CustomEvent('ks-search-updated', {detail: e.detail}); + this.dispatchEvent(event); + }, 300); + } } customElements.define(
diff --git a/chrome/browser/sync/test/integration/encryption_helper.cc b/chrome/browser/sync/test/integration/encryption_helper.cc index 92bf824..da1f902 100644 --- a/chrome/browser/sync/test/integration/encryption_helper.cc +++ b/chrome/browser/sync/test/integration/encryption_helper.cc
@@ -89,18 +89,14 @@ TrustedVaultKeysChangedStateChecker::TrustedVaultKeysChangedStateChecker( syncer::ProfileSyncService* service) - : keys_changed_(false) { - // base::Unretained() is safe here, because callback won't be called once - // |subscription_| is destroyed. - subscription_ = service->GetSyncClientForTest() - ->GetTrustedVaultClient() - ->AddKeysChangedObserver(base::BindRepeating( - &TrustedVaultKeysChangedStateChecker::OnKeysChanged, - base::Unretained(this))); + : service_(service), keys_changed_(false) { + service->GetSyncClientForTest()->GetTrustedVaultClient()->AddObserver(this); } -TrustedVaultKeysChangedStateChecker::~TrustedVaultKeysChangedStateChecker() = - default; +TrustedVaultKeysChangedStateChecker::~TrustedVaultKeysChangedStateChecker() { + service_->GetSyncClientForTest()->GetTrustedVaultClient()->RemoveObserver( + this); +} bool TrustedVaultKeysChangedStateChecker::IsExitConditionSatisfied( std::ostream* os) { @@ -108,10 +104,14 @@ return keys_changed_; } -void TrustedVaultKeysChangedStateChecker::OnKeysChanged() { +void TrustedVaultKeysChangedStateChecker::OnTrustedVaultKeysChanged() { keys_changed_ = true; + CheckExitCondition(); } +void TrustedVaultKeysChangedStateChecker:: + OnTrustedVaultRecoverabilityChanged() {} + ScopedScryptFeatureToggler::ScopedScryptFeatureToggler( bool force_disabled, bool use_for_new_passphrases) {
diff --git a/chrome/browser/sync/test/integration/encryption_helper.h b/chrome/browser/sync/test/integration/encryption_helper.h index 1e54cd876..1865432 100644 --- a/chrome/browser/sync/test/integration/encryption_helper.h +++ b/chrome/browser/sync/test/integration/encryption_helper.h
@@ -72,19 +72,24 @@ }; // Checker used to block until trusted vault keys are changed. -class TrustedVaultKeysChangedStateChecker : public StatusChangeChecker { +class TrustedVaultKeysChangedStateChecker + : public StatusChangeChecker, + syncer::TrustedVaultClient::Observer { public: explicit TrustedVaultKeysChangedStateChecker( syncer::ProfileSyncService* service); ~TrustedVaultKeysChangedStateChecker() override; + // StatusChangeChecker overrides. bool IsExitConditionSatisfied(std::ostream* os) override; - private: - void OnKeysChanged(); + // TrustedVaultClient::Observer overrides. + void OnTrustedVaultKeysChanged() override; + void OnTrustedVaultRecoverabilityChanged() override; + private: + syncer::ProfileSyncService* const service_; bool keys_changed_; - std::unique_ptr<syncer::TrustedVaultClient::Subscription> subscription_; }; // Helper for setting scrypt-related feature flags.
diff --git a/chrome/browser/sync/test/integration/two_client_custom_passphrase_sync_test.cc b/chrome/browser/sync/test/integration/two_client_custom_passphrase_sync_test.cc index e193774..792aeb7 100644 --- a/chrome/browser/sync/test/integration/two_client_custom_passphrase_sync_test.cc +++ b/chrome/browser/sync/test/integration/two_client_custom_passphrase_sync_test.cc
@@ -62,13 +62,14 @@ TwoClientCustomPassphraseSyncTestScryptEnabledInPreTest() { if (content::IsPreTest()) { override_features_.InitWithFeatures( - /*enable_features=*/{switches::kSyncUseScryptForNewCustomPassphrases}, - /*disable_features=*/{ + /*enabled_features=*/{switches:: + kSyncUseScryptForNewCustomPassphrases}, + /*disabled_features=*/{ switches::kSyncForceDisableScryptForCustomPassphrase}); } else { override_features_.InitWithFeatures( - /*enable_features=*/{}, - /*disable_features=*/{ + /*enabled_features=*/{}, + /*disabled_features=*/{ switches::kSyncUseScryptForNewCustomPassphrases, switches::kSyncForceDisableScryptForCustomPassphrase}); }
diff --git a/chrome/browser/sync/trusted_vault_client_android.cc b/chrome/browser/sync/trusted_vault_client_android.cc index 2c9bce4..d7efbc4 100644 --- a/chrome/browser/sync/trusted_vault_client_android.cc +++ b/chrome/browser/sync/trusted_vault_client_android.cc
@@ -64,13 +64,17 @@ } void TrustedVaultClientAndroid::NotifyKeysChanged(JNIEnv* env) { - observer_list_.Notify(); + for (Observer& observer : observer_list_) { + observer.OnTrustedVaultKeysChanged(); + } } -std::unique_ptr<TrustedVaultClientAndroid::Subscription> -TrustedVaultClientAndroid::AddKeysChangedObserver( - const base::RepeatingClosure& cb) { - return observer_list_.Add(cb); +void TrustedVaultClientAndroid::AddObserver(Observer* observer) { + observer_list_.AddObserver(observer); +} + +void TrustedVaultClientAndroid::RemoveObserver(Observer* observer) { + observer_list_.RemoveObserver(observer); } void TrustedVaultClientAndroid::FetchKeys( @@ -138,14 +142,6 @@ std::move(cb).Run(false); } -std::unique_ptr<TrustedVaultClientAndroid::Subscription> -TrustedVaultClientAndroid::AddRecoverabilityObserver( - const base::RepeatingClosure& cb) { - // TODO(crbug.com/1100279): Needs implementation. - NOTIMPLEMENTED(); - return nullptr; -} - void TrustedVaultClientAndroid::AddTrustedRecoveryMethod( const std::string& gaia_id, const std::vector<uint8_t>& public_key,
diff --git a/chrome/browser/sync/trusted_vault_client_android.h b/chrome/browser/sync/trusted_vault_client_android.h index aae1504..b7f22118 100644 --- a/chrome/browser/sync/trusted_vault_client_android.h +++ b/chrome/browser/sync/trusted_vault_client_android.h
@@ -13,6 +13,7 @@ #include "base/android/jni_string.h" #include "base/android/scoped_java_ref.h" #include "base/callback.h" +#include "base/observer_list.h" #include "components/signin/public/identity_manager/account_info.h" #include "components/sync/driver/trusted_vault_client.h" @@ -46,8 +47,8 @@ void NotifyKeysChanged(JNIEnv* env); // TrustedVaultClient implementation. - std::unique_ptr<Subscription> AddKeysChangedObserver( - const base::RepeatingClosure& cb) override; + void AddObserver(Observer* observer) override; + void RemoveObserver(Observer* observer) override; void FetchKeys( const CoreAccountInfo& account_info, base::OnceCallback<void(const std::vector<std::vector<uint8_t>>&)> cb) @@ -60,8 +61,6 @@ base::OnceCallback<void(bool)> cb) override; void GetIsRecoverabilityDegraded(const CoreAccountInfo& account_info, base::OnceCallback<void(bool)> cb) override; - std::unique_ptr<Subscription> AddRecoverabilityObserver( - const base::RepeatingClosure& cb) override; void AddTrustedRecoveryMethod(const std::string& gaia_id, const std::vector<uint8_t>& public_key, base::OnceClosure cb) override; @@ -86,7 +85,7 @@ // C++. base::OnceCallback<void(bool)> ongoing_mark_keys_as_stale_; - CallbackList observer_list_; + base::ObserverList<Observer> observer_list_; }; #endif // CHROME_BROWSER_SYNC_TRUSTED_VAULT_CLIENT_ANDROID_H_
diff --git a/chrome/browser/ui/BUILD.gn b/chrome/browser/ui/BUILD.gn index 03e991ee..80bd202 100644 --- a/chrome/browser/ui/BUILD.gn +++ b/chrome/browser/ui/BUILD.gn
@@ -1256,6 +1256,8 @@ "thumbnails/thumbnail_scheduler.h", "thumbnails/thumbnail_scheduler_impl.cc", "thumbnails/thumbnail_scheduler_impl.h", + "thumbnails/thumbnail_stats_tracker.cc", + "thumbnails/thumbnail_stats_tracker.h", "thumbnails/thumbnail_tab_helper.cc", "thumbnails/thumbnail_tab_helper.h", "toolbar/app_menu_icon_controller.cc",
diff --git a/chrome/browser/ui/android/strings/android_chrome_strings.grd b/chrome/browser/ui/android/strings/android_chrome_strings.grd index 32e278e..ec9b211f 100644 --- a/chrome/browser/ui/android/strings/android_chrome_strings.grd +++ b/chrome/browser/ui/android/strings/android_chrome_strings.grd
@@ -4113,9 +4113,6 @@ <message name="IDS_PAINT_PREVIEW_DEMO_PLAYBACK_START" desc="Toast message displayed when paint preview starts displaying. Used in paint preview demo mode." translateable="false"> Displaying Paint Preview. Press back to exit the Paint Preview demo. </message> - <message name="IDS_PAINT_PREVIEW_DEMO_PLAYBACK_END" desc="Toast message displayed when the user exits paint preview demo. Used in paint preview demo mode." translateable="false"> - Exited Paint Preview demo. - </message> <message name="IDS_PAINT_PREVIEW_DEMO_PLAYBACK_FAILURE" desc="Toast message displayed when there is a failure in playing back a paint preview for the demo. Used in paint preview demo mode." translateable="false"> Paint Preview playback failed. </message>
diff --git a/chrome/browser/ui/ash/network/networking_config_chromeos_browsertest.cc b/chrome/browser/ui/ash/network/networking_config_chromeos_browsertest.cc deleted file mode 100644 index 3590099..0000000 --- a/chrome/browser/ui/ash/network/networking_config_chromeos_browsertest.cc +++ /dev/null
@@ -1,42 +0,0 @@ -// Copyright 2016 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "ash/public/cpp/ash_view_ids.h" -#include "ash/public/cpp/system_tray_test_api.h" -#include "base/run_loop.h" -#include "base/strings/string16.h" -#include "base/strings/utf_string_conversions.h" -#include "chrome/browser/extensions/extension_browsertest.h" -#include "content/public/test/browser_test.h" -#include "content/public/test/test_utils.h" -#include "extensions/test/extension_test_message_listener.h" - -namespace { - -using NetworkingConfigChromeosTest = extensions::ExtensionBrowserTest; - -// Tests that an extension registering itself as handling a Wi-Fi SSID updates -// the ash system tray network item. -IN_PROC_BROWSER_TEST_F(NetworkingConfigChromeosTest, SystemTrayItem) { - // Load the extension and wait for the background page script to run. This - // registers the extension as the network config handler for wifi1. - ExtensionTestMessageListener listener("done", false); - ASSERT_TRUE(LoadExtension(test_data_dir_.AppendASCII("networking_config"))); - ASSERT_TRUE(listener.WaitUntilSatisfied()); - - // Show the network detail view. - auto tray_test_api = ash::SystemTrayTestApi::Create(); - tray_test_api->ShowNetworkDetailedView(); - base::RunLoop().RunUntilIdle(); - - // Expect that the extension-controlled item appears. - base::string16 expected_tooltip = base::UTF8ToUTF16( - "The extension \"NetworkingConfig test extension\" can help connect to " - "this network."); - base::string16 tooltip = tray_test_api->GetBubbleViewTooltip( - ash::VIEW_ID_EXTENSION_CONTROLLED_WIFI); - EXPECT_EQ(expected_tooltip, tooltip); -} - -} // namespace
diff --git a/chrome/browser/ui/extensions/hosted_app_browsertest.cc b/chrome/browser/ui/extensions/hosted_app_browsertest.cc index 64d0f37..940dd34 100644 --- a/chrome/browser/ui/extensions/hosted_app_browsertest.cc +++ b/chrome/browser/ui/extensions/hosted_app_browsertest.cc
@@ -115,7 +115,6 @@ enum class AppType { HOSTED_APP, // Using HostedAppBrowserController - BOOKMARK_APP, // Using WebAppBrowserController, BookmarkAppRegistrar WEB_APP, // Using WebAppBrowserController, WebAppRegistrar }; @@ -124,8 +123,6 @@ switch (app_type.param) { case AppType::HOSTED_APP: return "HostedApp"; - case AppType::BOOKMARK_APP: - return "BookmarkApp"; case AppType::WEB_APP: return "WebApp"; } @@ -168,25 +165,15 @@ } // namespace // Parameters are {app_type, desktop_pwa_flag}. |app_type| controls whether it -// is a Hosted or Bookmark or Web app. +// is a Hosted or Web app. class HostedOrWebAppTest : public extensions::ExtensionBrowserTest, public ::testing::WithParamInterface<AppType> { public: HostedOrWebAppTest() : app_browser_(nullptr), https_server_(net::EmbeddedTestServer::TYPE_HTTPS) { - if (GetParam() == AppType::HOSTED_APP) { - scoped_feature_list_.InitWithFeatures( - {}, {predictors::kSpeculativePreconnectFeature}); - } else if (GetParam() == AppType::BOOKMARK_APP) { - scoped_feature_list_.InitWithFeatures( - {}, {features::kDesktopPWAsWithoutExtensions, - predictors::kSpeculativePreconnectFeature}); - } else { - scoped_feature_list_.InitWithFeatures( - {features::kDesktopPWAsWithoutExtensions}, - {predictors::kSpeculativePreconnectFeature}); - } + scoped_feature_list_.InitAndDisableFeature( + predictors::kSpeculativePreconnectFeature); } ~HostedOrWebAppTest() override = default; @@ -679,36 +666,6 @@ EXPECT_TRUE(app_browser_->app_controller()->CanUninstall()); } -using BookmarkAppTest = HostedOrWebAppTest; - -IN_PROC_BROWSER_TEST_P(BookmarkAppTest, InstallFromSync) { - ASSERT_TRUE(https_server()->Start()); - - const GURL app_url = - https_server()->GetURL("/banners/manifest_test_page.html"); - const web_app::AppId app_id = web_app::GenerateAppIdFromURL(app_url); - - auto web_app_info = std::make_unique<WebApplicationInfo>(); - web_app_info->start_url = app_url; - web_app_info->scope = app_url.GetWithoutFilename(); - - base::RunLoop run_loop; - web_app::WebAppProviderBase* const provider = - web_app::WebAppProviderBase::GetProviderBase(profile()); - DCHECK(provider); - provider->install_manager().InstallBookmarkAppFromSync( - app_id, std::move(web_app_info), - base::BindLambdaForTesting([&](const web_app::AppId& installed_app_id, - web_app::InstallResultCode code) { - EXPECT_EQ(web_app::InstallResultCode::kSuccessNewInstall, code); - EXPECT_EQ(app_id, installed_app_id); - run_loop.Quit(); - })); - run_loop.Run(); - EXPECT_EQ(web_app::DisplayMode::kStandalone, - provider->registrar().GetAppDisplayMode(app_id)); -} - // Tests that platform apps can still load mixed content. IN_PROC_BROWSER_TEST_P(HostedAppTestWithAutoupgradesDisabled, MixedContentInPlatformApp) { @@ -1857,7 +1814,6 @@ INSTANTIATE_TEST_SUITE_P(All, HostedOrWebAppTest, ::testing::Values(AppType::HOSTED_APP, - AppType::BOOKMARK_APP, AppType::WEB_APP), AppTypeParamToString); @@ -1866,10 +1822,6 @@ ::testing::Values(AppType::HOSTED_APP)); INSTANTIATE_TEST_SUITE_P(All, - BookmarkAppTest, - ::testing::Values(AppType::BOOKMARK_APP)); - -INSTANTIATE_TEST_SUITE_P(All, HostedAppTestWithAutoupgradesDisabled, ::testing::Values(AppType::HOSTED_APP));
diff --git a/chrome/browser/ui/thumbnails/thumbnail_image.cc b/chrome/browser/ui/thumbnails/thumbnail_image.cc index 9297ca9..daf248f 100644 --- a/chrome/browser/ui/thumbnails/thumbnail_image.cc +++ b/chrome/browser/ui/thumbnails/thumbnail_image.cc
@@ -11,6 +11,7 @@ #include "base/task/task_traits.h" #include "base/task/thread_pool.h" #include "base/time/time.h" +#include "chrome/browser/ui/thumbnails/thumbnail_stats_tracker.h" #include "ui/gfx/codec/jpeg_codec.h" #include "ui/gfx/skia_util.h" @@ -35,10 +36,12 @@ DCHECK(delegate_); DCHECK(!delegate_->thumbnail_); delegate_->thumbnail_ = this; + ThumbnailStatsTracker::GetInstance().AddThumbnail(this); } ThumbnailImage::~ThumbnailImage() { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + ThumbnailStatsTracker::GetInstance().RemoveThumbnail(this); if (delegate_) delegate_->thumbnail_ = nullptr; }
diff --git a/chrome/browser/ui/thumbnails/thumbnail_image.h b/chrome/browser/ui/thumbnails/thumbnail_image.h index 00ff714..ffe352c 100644 --- a/chrome/browser/ui/thumbnails/thumbnail_image.h +++ b/chrome/browser/ui/thumbnails/thumbnail_image.h
@@ -94,6 +94,12 @@ // Observer::OnCompressedThumbnailDataAvailable(). void RequestCompressedThumbnailData(); + // Returns the size of the compressed data backing this thumbnail. + // This size can be 0. Additionally, since this data is refcounted, + // it's possible this returns 0 even if the data is still allocated. A + // client can hold a reference to it after |this| drops its reference. + size_t GetCompressedDataSizeInBytes() { return data_->data.size(); } + void set_async_operation_finished_callback_for_testing( base::RepeatingClosure callback) { async_operation_finished_callback_ = std::move(callback);
diff --git a/chrome/browser/ui/thumbnails/thumbnail_stats_tracker.cc b/chrome/browser/ui/thumbnails/thumbnail_stats_tracker.cc new file mode 100644 index 0000000..73da496 --- /dev/null +++ b/chrome/browser/ui/thumbnails/thumbnail_stats_tracker.cc
@@ -0,0 +1,76 @@ +// Copyright 2020 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/browser/ui/thumbnails/thumbnail_stats_tracker.h" + +#include "base/bind.h" +#include "base/location.h" +#include "base/metrics/histogram_macros.h" +#include "base/no_destructor.h" +#include "base/time/time.h" +#include "chrome/browser/ui/thumbnails/thumbnail_image.h" + +namespace { + +// Global instance. Only set once, except in tests which can reset the +// instance and create a new one. +ThumbnailStatsTracker* g_instance = nullptr; + +} // namespace + +// static +constexpr base::TimeDelta ThumbnailStatsTracker::kReportingInterval; + +// static +ThumbnailStatsTracker& ThumbnailStatsTracker::GetInstance() { + if (!g_instance) + g_instance = new ThumbnailStatsTracker; + return *g_instance; +} + +// static +void ThumbnailStatsTracker::ResetInstanceForTesting() { + delete g_instance; + g_instance = nullptr; +} + +ThumbnailStatsTracker::ThumbnailStatsTracker() { + heartbeat_timer_.Start( + FROM_HERE, kReportingInterval, + base::BindRepeating(&ThumbnailStatsTracker::RecordMetrics, + base::Unretained(this))); +} + +ThumbnailStatsTracker::~ThumbnailStatsTracker() { + // This is only called from tests. Make sure there are no thumbnails left. + DCHECK_EQ(thumbnails_.size(), 0u); +} + +void ThumbnailStatsTracker::AddThumbnail(ThumbnailImage* thumbnail) { + auto result = thumbnails_.insert(thumbnail); + DCHECK(result.second) << "Thumbnail already added"; +} + +void ThumbnailStatsTracker::RemoveThumbnail(ThumbnailImage* thumbnail) { + int removed = thumbnails_.erase(thumbnail); + DCHECK_EQ(removed, 1) << "Thumbnail not added"; +} + +void ThumbnailStatsTracker::RecordMetrics() { + size_t total_size_bytes = 0; + + for (ThumbnailImage* thumbnail : thumbnails_) { + size_t thumbnail_size_bytes = thumbnail->GetCompressedDataSizeInBytes(); + total_size_bytes += thumbnail_size_bytes; + + size_t thumbnail_size_kb = thumbnail_size_bytes / 1024; + UMA_HISTOGRAM_COUNTS_100( + "Tab.Preview.MemoryUsage.CompressedData.PerThumbnailKiB", + thumbnail_size_kb); + } + + size_t total_size_kb = total_size_bytes / 1024; + UMA_HISTOGRAM_CUSTOM_COUNTS("Tab.Preview.MemoryUsage.CompressedData.TotalKiB", + total_size_kb, 32, 8192, 100); +}
diff --git a/chrome/browser/ui/thumbnails/thumbnail_stats_tracker.h b/chrome/browser/ui/thumbnails/thumbnail_stats_tracker.h new file mode 100644 index 0000000..044a3b0 --- /dev/null +++ b/chrome/browser/ui/thumbnails/thumbnail_stats_tracker.h
@@ -0,0 +1,56 @@ +// Copyright 2020 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef CHROME_BROWSER_UI_THUMBNAILS_THUMBNAIL_STATS_TRACKER_H_ +#define CHROME_BROWSER_UI_THUMBNAILS_THUMBNAIL_STATS_TRACKER_H_ + +#include <set> + +#include "base/time/time.h" +#include "base/timer/timer.h" + +namespace base { +template <typename T> +class NoDestructor; +} // namespace base + +class ThumbnailImage; + +// Records memory metrics across all thumbnails in a browser process. +class ThumbnailStatsTracker { + private: + friend class ThumbnailImage; + friend class base::NoDestructor<ThumbnailStatsTracker>; + + friend class ThumbnailStatsTrackerTest; + + static constexpr base::TimeDelta kReportingInterval = + base::TimeDelta::FromMinutes(5); + + // Gets the global instance for this process. + static ThumbnailStatsTracker& GetInstance(); + + // This must only be called if all registered thumbnails have been + // removed. + static void ResetInstanceForTesting(); + + ThumbnailStatsTracker(); + + // Exists only for ResetInstanceForTesting(). + ~ThumbnailStatsTracker(); + + // Called from our friend, ThumbnailImage. + void AddThumbnail(ThumbnailImage* thumbnail); + void RemoveThumbnail(ThumbnailImage* thumbnail); + + // Called by |heartbeat_timer_| to record metrics at a regular + // interval. + void RecordMetrics(); + + base::RepeatingTimer heartbeat_timer_; + + std::set<ThumbnailImage*> thumbnails_; +}; + +#endif // CHROME_BROWSER_UI_THUMBNAILS_THUMBNAIL_STATS_TRACKER_H_
diff --git a/chrome/browser/ui/thumbnails/thumbnail_stats_tracker_unittest.cc b/chrome/browser/ui/thumbnails/thumbnail_stats_tracker_unittest.cc new file mode 100644 index 0000000..586dad8 --- /dev/null +++ b/chrome/browser/ui/thumbnails/thumbnail_stats_tracker_unittest.cc
@@ -0,0 +1,165 @@ +// Copyright 2020 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/browser/ui/thumbnails/thumbnail_stats_tracker.h" + +#include "base/logging.h" +#include "base/memory/scoped_refptr.h" +#include "base/rand_util.h" +#include "base/run_loop.h" +#include "base/test/metrics/histogram_tester.h" +#include "base/test/task_environment.h" +#include "base/time/time.h" +#include "chrome/browser/ui/thumbnails/thumbnail_image.h" +#include "testing/gtest/include/gtest/gtest.h" +#include "third_party/skia/include/core/SkBitmap.h" + +namespace { + +constexpr char kPerThumbnailMemoryUsageHistogram[] = + "Tab.Preview.MemoryUsage.CompressedData.PerThumbnailKiB"; +constexpr char kTotalMemoryUsageHistogram[] = + "Tab.Preview.MemoryUsage.CompressedData.TotalKiB"; + +class StubThumbnailImageDelegate : public ThumbnailImage::Delegate { + public: + StubThumbnailImageDelegate() = default; + ~StubThumbnailImageDelegate() override = default; + + // ThumbnailImage::Delegate: + void ThumbnailImageBeingObservedChanged(bool is_being_observed) override {} +}; + +class ThumbnailOwner : public ThumbnailImage::Delegate { + public: + ThumbnailOwner() = default; + ~ThumbnailOwner() override = default; + + ThumbnailImage* Get() { return thumbnail_.get(); } + + // ThumbnailImage::Delegate: + void ThumbnailImageBeingObservedChanged(bool is_being_observed) override {} + + private: + scoped_refptr<ThumbnailImage> thumbnail_{ + base::MakeRefCounted<ThumbnailImage>(this)}; +}; + +} // namespace + +class ThumbnailStatsTrackerTest : public ::testing::Test { + protected: + void SetUp() override { + // Delete previous instance and create new one to start the timer. + ThumbnailStatsTracker::ResetInstanceForTesting(); + ThumbnailStatsTracker::GetInstance(); + } + + // A random bitmap will have roughly the same size, or even greater + // size, after compression. + SkBitmap CreateRandomBitmapOfSize(unsigned int width, unsigned int height) { + SkBitmap bitmap; + bitmap.allocN32Pixels(width, height); + for (unsigned int x = 0; x < width; ++x) { + for (unsigned int y = 0; y < height; ++y) { + *bitmap.getAddr32(x, y) = static_cast<uint32_t>(base::RandUint64()); + } + } + return bitmap; + } + + void AssignThumbnailBitmapAndWait(ThumbnailImage* thumbnail, + SkBitmap bitmap) { + base::RunLoop run_loop; + thumbnail->set_async_operation_finished_callback_for_testing( + run_loop.QuitClosure()); + thumbnail->AssignSkBitmap(bitmap); + run_loop.Run(); + + // Clear the callback since the old one will be invalid. + thumbnail->set_async_operation_finished_callback_for_testing( + base::RepeatingClosure()); + } + + void AdvanceToNextReport() { + task_environment_.FastForwardBy(ThumbnailStatsTracker::kReportingInterval); + } + + base::test::TaskEnvironment task_environment_{ + base::test::TaskEnvironment::TimeSource::MOCK_TIME}; + + base::HistogramTester histogram_tester_; + + private: + StubThumbnailImageDelegate stub_thumbnail_image_delegate_; +}; + +TEST_F(ThumbnailStatsTrackerTest, LogsMemoryMetricsAtHeartbeat) { + ThumbnailOwner thumbnail_1; + ThumbnailOwner thumbnail_2; + + AssignThumbnailBitmapAndWait(thumbnail_1.Get(), + CreateRandomBitmapOfSize(2, 2)); + AssignThumbnailBitmapAndWait(thumbnail_2.Get(), + CreateRandomBitmapOfSize(2, 2)); + + histogram_tester_.ExpectTotalCount(kPerThumbnailMemoryUsageHistogram, 0); + histogram_tester_.ExpectTotalCount(kTotalMemoryUsageHistogram, 0); + + AdvanceToNextReport(); + histogram_tester_.ExpectTotalCount(kPerThumbnailMemoryUsageHistogram, 2); + histogram_tester_.ExpectTotalCount(kTotalMemoryUsageHistogram, 1); + + AdvanceToNextReport(); + histogram_tester_.ExpectTotalCount(kPerThumbnailMemoryUsageHistogram, 4); + histogram_tester_.ExpectTotalCount(kTotalMemoryUsageHistogram, 2); +} + +TEST_F(ThumbnailStatsTrackerTest, AlwaysLogsTotal) { + histogram_tester_.ExpectTotalCount(kPerThumbnailMemoryUsageHistogram, 0); + histogram_tester_.ExpectUniqueSample(kTotalMemoryUsageHistogram, 0, 0); + + AdvanceToNextReport(); + histogram_tester_.ExpectTotalCount(kPerThumbnailMemoryUsageHistogram, 0); + histogram_tester_.ExpectUniqueSample(kTotalMemoryUsageHistogram, 0, 1); + + AdvanceToNextReport(); + histogram_tester_.ExpectTotalCount(kPerThumbnailMemoryUsageHistogram, 0); + histogram_tester_.ExpectUniqueSample(kTotalMemoryUsageHistogram, 0, 2); +} + +TEST_F(ThumbnailStatsTrackerTest, RecordedMemoryUsageIsCorrect) { + ThumbnailOwner thumbnail_1; + AssignThumbnailBitmapAndWait(thumbnail_1.Get(), + CreateRandomBitmapOfSize(200, 150)); + size_t thumbnail_1_size_kb = + thumbnail_1.Get()->GetCompressedDataSizeInBytes() / 1024; + + AdvanceToNextReport(); + histogram_tester_.ExpectBucketCount(kPerThumbnailMemoryUsageHistogram, + thumbnail_1_size_kb, 1); + histogram_tester_.ExpectBucketCount(kTotalMemoryUsageHistogram, + thumbnail_1_size_kb, 1); + + ThumbnailOwner thumbnail_2; + AssignThumbnailBitmapAndWait(thumbnail_2.Get(), + CreateRandomBitmapOfSize(100, 100)); + size_t thumbnail_2_size_kb = + thumbnail_2.Get()->GetCompressedDataSizeInBytes() / 1024; + + // This test won't work if the sizes are the same. While it's possible + // that the two randomly generated bitmaps will compress to the same + // size, the odds are astronomically low. + ASSERT_NE(thumbnail_1_size_kb, thumbnail_2_size_kb); + + AdvanceToNextReport(); + histogram_tester_.ExpectBucketCount(kPerThumbnailMemoryUsageHistogram, + thumbnail_1_size_kb, 2); + histogram_tester_.ExpectBucketCount(kPerThumbnailMemoryUsageHistogram, + thumbnail_2_size_kb, 1); + histogram_tester_.ExpectBucketCount(kTotalMemoryUsageHistogram, + thumbnail_1_size_kb, 1); + histogram_tester_.ExpectBucketCount( + kTotalMemoryUsageHistogram, thumbnail_1_size_kb + thumbnail_2_size_kb, 1); +}
diff --git a/chrome/browser/ui/toolbar/app_menu_model.cc b/chrome/browser/ui/toolbar/app_menu_model.cc index 971b503..d951d80 100644 --- a/chrome/browser/ui/toolbar/app_menu_model.cc +++ b/chrome/browser/ui/toolbar/app_menu_model.cc
@@ -778,7 +778,8 @@ sub_menus_.back().get()); } AddItemWithStringId(IDC_SHOW_DOWNLOADS, IDS_SHOW_DOWNLOADS); - if (!browser_->profile()->IsGuestSession()) { + if (!browser_->profile()->IsGuestSession() && + !browser_->profile()->IsEphemeralGuestProfile()) { bookmark_sub_menu_model_ = std::make_unique<BookmarkSubMenuModel>(this, browser_); AddSubMenuWithStringId(IDC_BOOKMARKS_MENU, IDS_BOOKMARKS_MENU, @@ -939,7 +940,8 @@ } bool AppMenuModel::ShouldShowNewIncognitoWindowMenuItem() { - if (browser_->profile()->IsGuestSession()) + if (browser_->profile()->IsGuestSession() || + browser_->profile()->IsEphemeralGuestProfile()) return false; return IncognitoModePrefs::GetAvailability(browser_->profile()->GetPrefs()) !=
diff --git a/chrome/browser/ui/views/find_bar_view.cc b/chrome/browser/ui/views/find_bar_view.cc index 2443614..b2fb889 100644 --- a/chrome/browser/ui/views/find_bar_view.cc +++ b/chrome/browser/ui/views/find_bar_view.cc
@@ -61,8 +61,10 @@ class FindBarMatchCountLabel : public views::Label { public: - FindBarMatchCountLabel() {} - ~FindBarMatchCountLabel() override {} + METADATA_HEADER(FindBarMatchCountLabel); + + FindBarMatchCountLabel() = default; + ~FindBarMatchCountLabel() override = default; gfx::Size CalculatePreferredSize() const override { // We need to return at least 1dip so that box layout adds padding on either @@ -118,10 +120,13 @@ BEGIN_VIEW_BUILDER(/* No Export */, FindBarMatchCountLabel, views::Label) END_VIEW_BUILDER(/* No Export */, FindBarMatchCountLabel) +BEGIN_METADATA(FindBarMatchCountLabel, views::Label) +END_METADATA + //////////////////////////////////////////////////////////////////////////////// // FindBarView, public: -FindBarView::FindBarView(FindBarHost* host) : find_bar_host_(host) { +FindBarView::FindBarView(FindBarHost* host) { auto find_text = std::make_unique<views::Textfield>(); find_text->SetID(VIEW_ID_FIND_IN_PAGE_TEXT_FIELD); find_text->SetDefaultWidthInChars(30); @@ -129,10 +134,10 @@ find_text->set_controller(this); find_text->SetAccessibleName(l10n_util::GetStringUTF16(IDS_ACCNAME_FIND)); find_text->SetTextInputFlags(ui::TEXT_INPUT_FLAG_AUTOCORRECT_OFF); - find_text->SetShouldDoLearning( - !host->browser_view()->GetProfile()->IsOffTheRecord()); find_text_ = AddChildView(std::move(find_text)); + SetHost(host); + auto match_count_text = std::make_unique<FindBarMatchCountLabel>(); match_count_text->SetCanProcessEventsWithinSubtree(false); match_count_text_ = AddChildView(std::move(match_count_text)); @@ -222,6 +227,12 @@ FindBarView::~FindBarView() { } +void FindBarView::SetHost(FindBarHost* host) { + find_bar_host_ = host; + find_text_->SetShouldDoLearning( + host && !host->browser_view()->GetProfile()->IsOffTheRecord()); +} + void FindBarView::SetFindTextAndSelectedRange( const base::string16& find_text, const gfx::Range& selected_range) { @@ -260,7 +271,8 @@ // find text contents after clearing the find results as the normal // prepopulation code does not run. if (find_text_->GetText() != find_text && !find_text_->IsIMEComposing() && - (!find_bar_host_->HasGlobalFindPasteboard() || !find_text.empty())) { + (!find_bar_host_ || !find_bar_host_->HasGlobalFindPasteboard() || + !find_text.empty())) { find_text_->SetText(find_text); find_text_->SelectAll(true); } @@ -336,6 +348,9 @@ void FindBarView::ButtonPressed( views::Button* sender, const ui::Event& event) { + if (!find_bar_host_) + return; + switch (sender->GetID()) { case VIEW_ID_FIND_IN_PAGE_PREVIOUS_BUTTON: case VIEW_ID_FIND_IN_PAGE_NEXT_BUTTON: @@ -368,7 +383,7 @@ bool FindBarView::HandleKeyEvent(views::Textfield* sender, const ui::KeyEvent& key_event) { // If the dialog is not visible, there is no reason to process keyboard input. - if (!find_bar_host_->IsVisible()) + if (!find_bar_host_ || !find_bar_host_->IsVisible()) return false; if (find_bar_host_->MaybeForwardKeyEventToWebpage(key_event)) @@ -410,6 +425,7 @@ } void FindBarView::Find(const base::string16& search_text) { + DCHECK(find_bar_host_); FindBarController* controller = find_bar_host_->GetFindBarController(); DCHECK(controller); content::WebContents* web_contents = controller->web_contents(); @@ -454,10 +470,6 @@ find_next_button_->SetEnabled(enable_buttons); } -const char* FindBarView::GetClassName() const { - return "FindBarView"; -} - void FindBarView::OnThemeChanged() { views::View::OnThemeChanged(); ui::NativeTheme* theme = GetNativeTheme(); @@ -494,3 +506,6 @@ views::SetImageFromVectorIcon(close_button_, vector_icons::kCloseRoundedIcon, base_foreground_color); } + +BEGIN_METADATA(FindBarView, views::View) +END_METADATA
diff --git a/chrome/browser/ui/views/find_bar_view.h b/chrome/browser/ui/views/find_bar_view.h index 264afea2..7d53239b 100644 --- a/chrome/browser/ui/views/find_bar_view.h +++ b/chrome/browser/ui/views/find_bar_view.h
@@ -10,6 +10,7 @@ #include "base/compiler_specific.h" #include "base/macros.h" #include "base/strings/string16.h" +#include "chrome/browser/ui/views/chrome_views_export.h" #include "chrome/browser/ui/views/dropdown_bar_host_delegate.h" #include "ui/views/controls/button/button.h" #include "ui/views/controls/button/image_button.h" @@ -45,9 +46,13 @@ public views::ButtonListener, public views::TextfieldController { public: - explicit FindBarView(FindBarHost* host); + METADATA_HEADER(FindBarView); + + explicit FindBarView(FindBarHost* host = nullptr); ~FindBarView() override; + void SetHost(FindBarHost* host); + // Accessors for the text and selection displayed in the text box. void SetFindTextAndSelectedRange(const base::string16& find_text, const gfx::Range& selected_range); @@ -69,7 +74,6 @@ void ClearMatchCount(); // views::View: - const char* GetClassName() const override; bool OnMousePressed(const ui::MouseEvent& event) override; gfx::Size CalculatePreferredSize() const override; void OnThemeChanged() override; @@ -116,4 +120,8 @@ DISALLOW_COPY_AND_ASSIGN(FindBarView); }; +BEGIN_VIEW_BUILDER(/* no export */, FindBarView, views::View) +VIEW_BUILDER_PROPERTY(FindBarHost*, Host) +END_VIEW_BUILDER(/* no export */, FindBarView) + #endif // CHROME_BROWSER_UI_VIEWS_FIND_BAR_VIEW_H_
diff --git a/chrome/browser/ui/views/frame/browser_view.cc b/chrome/browser/ui/views/frame/browser_view.cc index 3b8a6b8..cd12f4c 100644 --- a/chrome/browser/ui/views/frame/browser_view.cc +++ b/chrome/browser/ui/views/frame/browser_view.cc
@@ -771,7 +771,8 @@ } bool BrowserView::IsGuestSession() const { - return browser_->profile()->IsGuestSession(); + return browser_->profile()->IsGuestSession() || + browser_->profile()->IsEphemeralGuestProfile(); } bool BrowserView::IsRegularOrGuestSession() const { @@ -2252,7 +2253,7 @@ // Finally annotate with the user - add Incognito or guest if it's an // incognito or guest window, otherwise use the avatar name. ProfileManager* profile_manager = g_browser_process->profile_manager(); - if (profile->IsGuestSession()) { + if (profile->IsGuestSession() || profile->IsEphemeralGuestProfile()) { title = l10n_util::GetStringFUTF16(IDS_ACCESSIBLE_GUEST_WINDOW_TITLE_FORMAT, title); } else if (profile->IsIncognitoProfile()) {
diff --git a/chrome/browser/ui/views/native_file_system/native_file_system_usage_bubble_view.cc b/chrome/browser/ui/views/native_file_system/native_file_system_usage_bubble_view.cc index 263c344..a4b5846 100644 --- a/chrome/browser/ui/views/native_file_system/native_file_system_usage_bubble_view.cc +++ b/chrome/browser/ui/views/native_file_system/native_file_system_usage_bubble_view.cc
@@ -120,7 +120,7 @@ // Displays a (one-column) table model as a one-line summary showing the // first few items, with a toggle button to expand a table below to contain the // full list of items. -class CollapsibleListView : public views::View, public views::ButtonListener { +class CollapsibleListView : public views::View { public: // How many rows to show in the expanded table without having to scroll. static constexpr int kExpandedTableRowCount = 3; @@ -161,7 +161,8 @@ views::style::STYLE_PRIMARY)); label->SetHorizontalAlignment(gfx::ALIGN_LEFT); label_layout->SetFlexForView(label, 1); - auto button = views::CreateVectorToggleImageButton(this); + auto button = views::CreateVectorToggleImageButton(base::BindRepeating( + &CollapsibleListView::ButtonPressed, base::Unretained(this))); button->SetTooltipText( l10n_util::GetStringUTF16(IDS_NATIVE_FILE_SYSTEM_USAGE_EXPAND)); button->SetToggledTooltipText( @@ -209,15 +210,14 @@ icon_color, disabled_icon_color); } - // views::ButtonListener: - void ButtonPressed(views::Button* sender, const ui::Event& event) override { + private: + void ButtonPressed() { table_is_expanded_ = !table_is_expanded_; expand_collapse_button_->SetToggled(table_is_expanded_); table_view_parent_->SetVisible(table_is_expanded_); PreferredSizeChanged(); } - private: bool table_is_expanded_ = false; views::ScrollView* table_view_parent_; views::ToggleImageButton* expand_collapse_button_;
diff --git a/chrome/browser/ui/views/passwords/move_to_account_store_bubble_view.cc b/chrome/browser/ui/views/passwords/move_to_account_store_bubble_view.cc index 29874aa8..288d9f5 100644 --- a/chrome/browser/ui/views/passwords/move_to_account_store_bubble_view.cc +++ b/chrome/browser/ui/views/passwords/move_to_account_store_bubble_view.cc
@@ -25,6 +25,7 @@ #include "ui/gfx/paint_vector_icon.h" #include "ui/gfx/text_constants.h" #include "ui/views/bubble/bubble_frame_view.h" +#include "ui/views/controls/color_tracking_icon_view.h" #include "ui/views/controls/label.h" #include "ui/views/layout/flex_layout.h" #include "ui/views/layout/layout_provider.h" @@ -186,12 +187,18 @@ SetLayoutManager(std::make_unique<views::FlexLayout>()) ->SetOrientation(views::LayoutOrientation::kHorizontal) .SetMainAxisAlignment(views::LayoutAlignment::kCenter) - .SetCrossAxisAlignment(views::LayoutAlignment::kCenter); + .SetCrossAxisAlignment(views::LayoutAlignment::kCenter) + .SetDefault( + views::kMarginsKey, + gfx::Insets( + /*vertical=*/0, + /*horizontal=*/ChromeLayoutProvider::Get()->GetDistanceMetric( + views::DISTANCE_RELATED_BUTTON_HORIZONTAL))); from_view = AddChildView(std::move(from_image)); - auto arrow_view = std::make_unique<VectorIconView>( - kBookmarkbarTouchOverflowIcon, kImageSize); + auto arrow_view = std::make_unique<views::ColorTrackingIconView>( + kChevronRightIcon, gfx::kFaviconSize); arrow_view->EnableCanvasFlippingForRTLUI(true); AddChildView(std::move(arrow_view));
diff --git a/chrome/browser/ui/views/sync/dice_bubble_sync_promo_view.cc b/chrome/browser/ui/views/sync/dice_bubble_sync_promo_view.cc index 90923e1..9589488 100644 --- a/chrome/browser/ui/views/sync/dice_bubble_sync_promo_view.cc +++ b/chrome/browser/ui/views/sync/dice_bubble_sync_promo_view.cc
@@ -29,7 +29,7 @@ bool signin_button_prominent, int text_style) : delegate_(delegate) { - DCHECK(!profile->IsGuestSession()); + DCHECK(!profile->IsGuestSession() && !profile->IsEphemeralGuestProfile()); AccountInfo account; // Signin promos can be shown in incognito, they use an empty account list. if (profile->IsRegularProfile())
diff --git a/chrome/browser/ui/views/tabs/tab_strip.cc b/chrome/browser/ui/views/tabs/tab_strip.cc index 07028a0..88114a5 100644 --- a/chrome/browser/ui/views/tabs/tab_strip.cc +++ b/chrome/browser/ui/views/tabs/tab_strip.cc
@@ -1269,7 +1269,7 @@ Profile* profile = controller()->GetProfile(); if (profile) { - if (profile->IsGuestSession()) + if (profile->IsGuestSession() || profile->IsEphemeralGuestProfile()) base::UmaHistogramCounts100("Tab.Count.Guest", tab_count()); else if (profile->IsIncognitoProfile()) base::UmaHistogramCounts100("Tab.Count.Incognito", tab_count());
diff --git a/chrome/browser/ui/views/webauthn/hover_list_view.cc b/chrome/browser/ui/views/webauthn/hover_list_view.cc index df3176c9..a3b45cac 100644 --- a/chrome/browser/ui/views/webauthn/hover_list_view.cc +++ b/chrome/browser/ui/views/webauthn/hover_list_view.cc
@@ -186,7 +186,7 @@ auto placeholder_item = CreateHoverButtonForListItem( model_->GetPlaceholderIcon(), model_->GetPlaceholderText(), base::string16(), views::Button::PressedCallback(), - /*is_two_line_list=*/false, ItemType::kPlaceholder); + /*is_two_line_item=*/false, ItemType::kPlaceholder); item_container_->AddChildView(placeholder_item.get()); auto* separator = AddSeparatorAsChild(item_container_); placeholder_list_item_view_.emplace(
diff --git a/chrome/browser/web_applications/components/os_integration_manager.cc b/chrome/browser/web_applications/components/os_integration_manager.cc index 385410d0..5ffd855 100644 --- a/chrome/browser/web_applications/components/os_integration_manager.cc +++ b/chrome/browser/web_applications/components/os_integration_manager.cc
@@ -187,6 +187,9 @@ } else { barrier.Run(OsHookType::kShortcuts, /*completed=*/true); } + } else { + barrier.Run(OsHookType::kShortcuts, /*completed=*/true); + barrier.Run(OsHookType::kRunOnOsLogin, /*completed=*/true); } // TODO(https://crbug.com/1108109) we should return the result of file handler
diff --git a/chrome/browser/webshare/share_service_browsertest.cc b/chrome/browser/webshare/share_service_browsertest.cc index ff77ffe7..36069f3 100644 --- a/chrome/browser/webshare/share_service_browsertest.cc +++ b/chrome/browser/webshare/share_service_browsertest.cc
@@ -13,17 +13,48 @@ #include "content/public/test/browser_test_utils.h" #include "net/test/embedded_test_server/embedded_test_server.h" +#if defined(OS_WIN) +#include "chrome/browser/webshare/win/scoped_fake_data_transfer_manager_interop.h" +#endif + class ShareServiceBrowserTest : public InProcessBrowserTest { public: ShareServiceBrowserTest() { feature_list_.InitAndEnableFeature(features::kWebShare); } +#if defined(OS_WIN) + void SetUpOnMainThread() override { + InProcessBrowserTest::SetUpOnMainThread(); + if (IsSupportedEnvironment()) { + scoped_interop_ = + std::make_unique<webshare::ScopedFakeDataTransferManagerInterop>(); + } + } +#endif + + protected: +#if defined(OS_WIN) + bool IsSupportedEnvironment() { + return webshare::ScopedFakeDataTransferManagerInterop:: + IsSupportedEnvironment(); + } +#endif + private: base::test::ScopedFeatureList feature_list_; +#if defined(OS_WIN) + std::unique_ptr<webshare::ScopedFakeDataTransferManagerInterop> + scoped_interop_; +#endif }; IN_PROC_BROWSER_TEST_F(ShareServiceBrowserTest, Text) { +#if defined(OS_WIN) + if (!IsSupportedEnvironment()) + return; +#endif + ASSERT_TRUE(embedded_test_server()->Start()); ui_test_utils::NavigateToURL( browser(), embedded_test_server()->GetURL("/webshare/index.html"));
diff --git a/chrome/browser/webshare/share_service_impl.cc b/chrome/browser/webshare/share_service_impl.cc index bf2a4ff..fbbcaad6 100644 --- a/chrome/browser/webshare/share_service_impl.cc +++ b/chrome/browser/webshare/share_service_impl.cc
@@ -5,6 +5,7 @@ #include "chrome/browser/webshare/share_service_impl.h" #include <algorithm> +#include <memory> #include "base/feature_list.h" #include "base/strings/string_piece.h" @@ -13,6 +14,10 @@ #include "content/public/browser/web_contents.h" #include "mojo/public/cpp/bindings/self_owned_receiver.h" +#if defined(OS_WIN) +#include "chrome/browser/webshare/win/share_operation.h" +#endif + // IsDangerousFilename() and IsDangerousMimeType() should be kept in sync with // //third_party/blink/renderer/modules/webshare/FILE_TYPES.md // //components/browser_ui/webshare/android/java/src/org/chromium/components/browser_ui/webshare/ShareServiceImpl.java @@ -165,10 +170,17 @@ #if defined(OS_CHROMEOS) sharesheet_client_.Share(title, text, share_url, std::move(files), std::move(callback)); +#elif defined(OS_WIN) + auto share_operation = std::make_unique<webshare::ShareOperation>( + title, text, share_url, std::move(files), web_contents); + share_operation->Run(base::BindOnce( + [](std::unique_ptr<webshare::ShareOperation> share_operation, + ShareCallback callback, + blink::mojom::ShareError result) { std::move(callback).Run(result); }, + std::move(share_operation), std::move(callback))); #else - // TODO(crbug.com/1035527): Add implementation for OS_WIN - NOTIMPLEMENTED(); - std::move(callback).Run(blink::mojom::ShareError::OK); + NOTREACHED(); + std::move(callback).Run(blink::mojom::ShareError::INTERNAL_ERROR); #endif }
diff --git a/chrome/browser/webshare/share_service_unittest.cc b/chrome/browser/webshare/share_service_unittest.cc index 4b909d2..1877fc7 100644 --- a/chrome/browser/webshare/share_service_unittest.cc +++ b/chrome/browser/webshare/share_service_unittest.cc
@@ -29,6 +29,9 @@ #include "chrome/browser/sharesheet/sharesheet_types.h" #include "chrome/browser/webshare/chromeos/sharesheet_client.h" #endif +#if defined(OS_WIN) +#include "chrome/browser/webshare/win/scoped_fake_data_transfer_manager_interop.h" +#endif class ShareServiceUnitTest : public ChromeRenderViewHostTestHarness { public: @@ -45,8 +48,21 @@ webshare::SharesheetClient::SetSharesheetCallbackForTesting( base::BindRepeating(&ShareServiceUnitTest::AcceptShareRequest)); #endif +#if defined(OS_WIN) + if (IsSupportedEnvironment()) { + scoped_interop_ = + std::make_unique<webshare::ScopedFakeDataTransferManagerInterop>(); + } +#endif } +#if defined(OS_WIN) + bool IsSupportedEnvironment() { + return webshare::ScopedFakeDataTransferManagerInterop:: + IsSupportedEnvironment(); + } +#endif + ShareError ShareGeneratedFileData(const std::string& extension, const std::string& content_type, unsigned file_length = 100, @@ -123,11 +139,20 @@ } #endif +#if defined(OS_WIN) + std::unique_ptr<webshare::ScopedFakeDataTransferManagerInterop> + scoped_interop_; +#endif base::test::ScopedFeatureList feature_list_; std::unique_ptr<ShareServiceImpl> share_service_; }; TEST_F(ShareServiceUnitTest, FileCount) { +#if defined(OS_WIN) + if (!IsSupportedEnvironment()) + return; +#endif + EXPECT_EQ(ShareError::OK, ShareGeneratedFileData(".txt", "text/plain", 1234, kMaxSharedFileCount)); EXPECT_EQ(ShareError::PERMISSION_DENIED, @@ -172,6 +197,11 @@ } TEST_F(ShareServiceUnitTest, PortableDocumentFormat) { +#if defined(OS_WIN) + if (!IsSupportedEnvironment()) + return; +#endif + // TODO(crbug.com/1006055): Support sharing of pdf files. // The URL will be checked using Safe Browsing. EXPECT_EQ(ShareError::PERMISSION_DENIED,
diff --git a/chrome/browser/webshare/win/fake_data_transfer_manager.cc b/chrome/browser/webshare/win/fake_data_transfer_manager.cc index b038bd29..aa28deb 100644 --- a/chrome/browser/webshare/win/fake_data_transfer_manager.cc +++ b/chrome/browser/webshare/win/fake_data_transfer_manager.cc
@@ -8,6 +8,7 @@ #include "base/bind.h" #include "base/bind_helpers.h" +#include "base/win/scoped_hstring.h" #include "testing/gtest/include/gtest/gtest.h" namespace webshare { @@ -25,6 +26,8 @@ using ABI::Windows::ApplicationModel::DataTransfer::IDataTransferManager; using ABI::Windows::Foundation::DateTime; using ABI::Windows::Foundation::IUriRuntimeClass; +using ABI::Windows::Storage::IStorageFile; +using ABI::Windows::Storage::IStorageItem; using ABI::Windows::Storage::Streams::IRandomAccessStreamReference; using Microsoft::WRL::ActivationFactory; using Microsoft::WRL::ComPtr; @@ -52,7 +55,9 @@ IDataPackagePropertySet, IDataPackagePropertySet3> { public: - FakeDataPackagePropertySet() = default; + FakeDataPackagePropertySet( + FakeDataTransferManager::DataRequestedContent& data_requested_content) + : data_requested_content_(data_requested_content) {} FakeDataPackagePropertySet(const FakeDataPackagePropertySet&) = delete; FakeDataPackagePropertySet& operator=(const FakeDataPackagePropertySet&) = delete; @@ -90,7 +95,11 @@ IFACEMETHODIMP put_Thumbnail(IRandomAccessStreamReference* value) override { return S_OK; } - IFACEMETHODIMP put_Title(HSTRING value) override { return S_OK; } + IFACEMETHODIMP put_Title(HSTRING value) override { + base::win::ScopedHString wrapped_value(value); + data_requested_content_.title = wrapped_value.GetAsUTF8(); + return S_OK; + } // IDataPackagePropertySet3 IFACEMETHODIMP get_EnterpriseId(HSTRING* value) override { @@ -98,6 +107,9 @@ return E_NOTIMPL; } IFACEMETHODIMP put_EnterpriseId(HSTRING value) override { return S_OK; } + + private: + FakeDataTransferManager::DataRequestedContent& data_requested_content_; }; class FakeDataPackage @@ -105,7 +117,9 @@ IDataPackage, IDataPackage2> { public: - FakeDataPackage() = default; + FakeDataPackage( + FakeDataTransferManager::DataRequestedContent& data_requested_content) + : data_requested_content_(data_requested_content) {} FakeDataPackage(const FakeDataPackage&) = delete; FakeDataPackage& operator=(const FakeDataPackage&) = delete; ~FakeDataPackage() override { @@ -135,7 +149,7 @@ } IFACEMETHODIMP get_Properties(IDataPackagePropertySet** value) override { if (!properties_) - properties_ = Make<FakeDataPackagePropertySet>(); + properties_ = Make<FakeDataPackagePropertySet>(data_requested_content_); *value = properties_.Get(); properties_->AddRef(); return S_OK; @@ -172,15 +186,61 @@ } IFACEMETHODIMP SetHtmlFormat(HSTRING value) override { return S_OK; } IFACEMETHODIMP SetRtf(HSTRING value) override { return S_OK; } - IFACEMETHODIMP SetText(HSTRING value) override { return S_OK; } + IFACEMETHODIMP SetText(HSTRING value) override { + base::win::ScopedHString wrapped_value(value); + data_requested_content_.text = wrapped_value.GetAsUTF8(); + return S_OK; + } IFACEMETHODIMP SetStorageItems(StorageItems* value, boolean readOnly) override { - return S_OK; + EXPECT_TRUE(readOnly); + return SetStorageItemsReadOnly(value); } IFACEMETHODIMP SetStorageItemsReadOnly(StorageItems* value) override { + ComPtr<ABI::Windows::Foundation::Collections::IIterator<IStorageItem*>> + iterator; + HRESULT hr = value->First(&iterator); + if (FAILED(hr)) + return hr; + boolean has_current; + hr = iterator->get_HasCurrent(&has_current); + if (FAILED(hr)) + return hr; + while (has_current == TRUE) { + ComPtr<IStorageItem> storage_item; + hr = iterator->get_Current(&storage_item); + if (FAILED(hr)) + return hr; + + HSTRING name; + hr = storage_item->get_Name(&name); + base::win::ScopedHString wrapped_name(name); + if (FAILED(hr)) + return hr; + + ComPtr<IStorageFile> storage_file; + hr = storage_item.As(&storage_file); + if (FAILED(hr)) + return hr; + + FakeDataTransferManager::DataRequestedFile file; + file.name = wrapped_name.GetAsUTF8(); + file.file = storage_file; + data_requested_content_.files.push_back(std::move(file)); + + hr = iterator->MoveNext(&has_current); + if (FAILED(hr)) + return hr; + } return S_OK; } - IFACEMETHODIMP SetUri(IUriRuntimeClass* value) override { return S_OK; } + IFACEMETHODIMP SetUri(IUriRuntimeClass* value) override { + HSTRING raw_uri; + value->get_RawUri(&raw_uri); + base::win::ScopedHString wrapped_value(raw_uri); + data_requested_content_.uri = wrapped_value.GetAsUTF8(); + return S_OK; + } // IDataPackage2 IFACEMETHODIMP SetApplicationLink(IUriRuntimeClass* value) override { @@ -189,23 +249,37 @@ IFACEMETHODIMP SetWebLink(IUriRuntimeClass* value) override { return S_OK; } private: + FakeDataTransferManager::DataRequestedContent& data_requested_content_; ComPtr<IDataPackagePropertySet> properties_; }; class FakeDataRequest : public RuntimeClass<RuntimeClassFlags<WinRtClassicComMix>, IDataRequest> { public: - FakeDataRequest() = default; + struct FakeDataRequestDeferral + : public RuntimeClass<RuntimeClassFlags<WinRtClassicComMix>, + IDataRequestDeferral> { + public: + explicit FakeDataRequestDeferral(FakeDataRequest* data_request) + : data_request_(data_request) {} + FakeDataRequestDeferral(const FakeDataRequestDeferral&) = delete; + FakeDataRequestDeferral& operator=(const FakeDataRequestDeferral&) = delete; + + // IDataRequestDeferral + IFACEMETHODIMP Complete() override { + data_request_->RunPostDataRequestedCallbackImpl(); + return S_OK; + } + + private: + ComPtr<FakeDataRequest> data_request_; + }; + + FakeDataRequest(FakeDataTransferManager::PostDataRequestedCallback + post_data_requested_callback) + : post_data_requested_callback_(post_data_requested_callback) {} FakeDataRequest(const FakeDataRequest&) = delete; FakeDataRequest& operator=(const FakeDataRequest&) = delete; - ~FakeDataRequest() override { - // Though it is technically legal for consuming code to hold on to the - // DataPackage past the lifetime of the DataRequest, there is no good - // reason to do so, so any lingering references presumably point to a - // coding error. - if (data_package_) - EXPECT_EQ(0u, data_package_.Reset()); - } // IDataRequest IFACEMETHODIMP FailWithDisplayText(HSTRING value) override { @@ -214,7 +288,7 @@ } IFACEMETHODIMP get_Data(IDataPackage** value) override { if (!data_package_) - data_package_ = Make<FakeDataPackage>(); + data_package_ = Make<FakeDataPackage>(data_requested_content_); *value = data_package_.Get(); data_package_->AddRef(); return S_OK; @@ -225,53 +299,83 @@ return E_NOTIMPL; } IFACEMETHODIMP GetDeferral(IDataRequestDeferral** value) override { - NOTREACHED(); - return E_NOTIMPL; + if (!data_request_deferral_) + data_request_deferral_ = Make<FakeDataRequestDeferral>(this); + *value = data_request_deferral_.Get(); + data_request_deferral_->AddRef(); + return S_OK; } IFACEMETHODIMP put_Data(IDataPackage* value) override { data_package_ = value; return S_OK; } + void RunPostDataRequestedCallback() { + // If there is not a deferral trigger the callback right away, otherwise it + // will be triggered when the deferral is complete + if (!data_request_deferral_) + RunPostDataRequestedCallbackImpl(); + } + private: + void RunPostDataRequestedCallbackImpl() { + post_data_requested_callback_.Run(data_requested_content_); + } + ComPtr<IDataPackage> data_package_; + ComPtr<FakeDataRequestDeferral> data_request_deferral_; + FakeDataTransferManager::DataRequestedContent data_requested_content_; + FakeDataTransferManager::PostDataRequestedCallback + post_data_requested_callback_; }; class FakeDataRequestedEventArgs : public RuntimeClass<RuntimeClassFlags<WinRtClassicComMix>, IDataRequestedEventArgs> { public: - FakeDataRequestedEventArgs() = default; + FakeDataRequestedEventArgs(FakeDataTransferManager::PostDataRequestedCallback + post_data_requested_callback) + : post_data_requested_callback_(post_data_requested_callback) {} FakeDataRequestedEventArgs(const FakeDataRequestedEventArgs&) = delete; FakeDataRequestedEventArgs& operator=(const FakeDataRequestedEventArgs&) = delete; - ~FakeDataRequestedEventArgs() override { - // Though it is technically legal for consuming code to hold on to the - // DataRequest past the lifetime of the DataRequestedEventArgs, there is - // no good reason to do so, so any lingering references presumably point - // to a coding error. - if (data_request_) - EXPECT_EQ(0u, data_request_.Reset()); - } // IDataRequestedEventArgs IFACEMETHODIMP get_Request(IDataRequest** value) override { if (!data_request_) - data_request_ = Make<FakeDataRequest>(); + data_request_ = Make<FakeDataRequest>(post_data_requested_callback_); *value = data_request_.Get(); data_request_->AddRef(); return S_OK; } + void RunPostDataRequestedCallback() { + if (data_request_) + data_request_->RunPostDataRequestedCallback(); + } + private: - ComPtr<IDataRequest> data_request_; + ComPtr<FakeDataRequest> data_request_; + FakeDataTransferManager::PostDataRequestedCallback + post_data_requested_callback_; }; } // namespace -FakeDataTransferManager::FakeDataTransferManager() = default; +FakeDataTransferManager::FakeDataTransferManager() { + post_data_requested_callback_ = base::DoNothing(); +} FakeDataTransferManager::~FakeDataTransferManager() = default; +FakeDataTransferManager::DataRequestedFile::DataRequestedFile() = default; +FakeDataTransferManager::DataRequestedFile::DataRequestedFile( + FakeDataTransferManager::DataRequestedFile&&) = default; +FakeDataTransferManager::DataRequestedFile::~DataRequestedFile() = default; + +FakeDataTransferManager::DataRequestedContent::DataRequestedContent() = default; +FakeDataTransferManager::DataRequestedContent::~DataRequestedContent() = + default; + IFACEMETHODIMP FakeDataTransferManager::add_DataRequested( DataRequestedEventHandler* event_handler, @@ -323,13 +427,14 @@ // Though multiple handlers may be registered for this event, only the // latest is invoked by the OS and then the event is considered handled. auto handler = data_requested_event_handlers_.back().event_handler_; - ComPtr<IDataTransferManager> self = this; + ComPtr<FakeDataTransferManager> self = this; return base::BindOnce( - [](ComPtr<IDataTransferManager> self, + [](ComPtr<FakeDataTransferManager> self, ComPtr<DataRequestedEventHandler> handler) { - ComPtr<IDataRequestedEventArgs> event_args = - Make<FakeDataRequestedEventArgs>(); + auto event_args = Make<FakeDataRequestedEventArgs>( + self->post_data_requested_callback_); handler->Invoke(self.Get(), event_args.Get()); + event_args->RunPostDataRequestedCallback(); }, self, handler); } @@ -338,6 +443,11 @@ return !data_requested_event_handlers_.empty(); } +void FakeDataTransferManager::SetPostDataRequestedCallback( + PostDataRequestedCallback post_data_requested_callback) { + post_data_requested_callback_ = std::move(post_data_requested_callback); +} + FakeDataTransferManager::DataRequestedHandlerEntry:: DataRequestedHandlerEntry() = default; FakeDataTransferManager::DataRequestedHandlerEntry::DataRequestedHandlerEntry(
diff --git a/chrome/browser/webshare/win/fake_data_transfer_manager.h b/chrome/browser/webshare/win/fake_data_transfer_manager.h index 08526a47..fc82453 100644 --- a/chrome/browser/webshare/win/fake_data_transfer_manager.h +++ b/chrome/browser/webshare/win/fake_data_transfer_manager.h
@@ -9,16 +9,45 @@ #include <wrl/implements.h> #include <vector> -#include "base/callback_forward.h" +#include "base/callback.h" namespace webshare { // Provides an implementation of IDataTransferManager for use in GTests. -class FakeDataTransferManager +class __declspec(uuid("53CA4C00-6F19-40C1-A740-F66510E2DB40")) + FakeDataTransferManager : public Microsoft::WRL::RuntimeClass< Microsoft::WRL::RuntimeClassFlags<Microsoft::WRL::WinRtClassicComMix>, ABI::Windows::ApplicationModel::DataTransfer::IDataTransferManager> { public: + // Represents a file surfaced to a DataRequested event + struct DataRequestedFile { + DataRequestedFile(); + DataRequestedFile(const DataRequestedFile&) = delete; + DataRequestedFile& operator=(const DataRequestedFile&) = delete; + DataRequestedFile(DataRequestedFile&&); + ~DataRequestedFile(); + + std::string name; + Microsoft::WRL::ComPtr<ABI::Windows::Storage::IStorageFile> file; + }; + + // Represents the content surfaced to a DataRequested event + struct DataRequestedContent { + DataRequestedContent(); + DataRequestedContent(const DataRequestedContent&) = delete; + DataRequestedContent& operator=(const DataRequestedContent&) = delete; + ~DataRequestedContent(); + + std::string text; + std::string title; + std::string uri; + std::vector<DataRequestedFile> files; + }; + + using PostDataRequestedCallback = + base::RepeatingCallback<void(const DataRequestedContent&)>; + FakeDataTransferManager(); FakeDataTransferManager(const FakeDataTransferManager&) = delete; FakeDataTransferManager& operator=(const FakeDataTransferManager&) = delete; @@ -47,6 +76,11 @@ bool HasDataRequestedListener(); + // Sets a callback that will be invoked after any DataRequested event is + // triggered and passed the content supplied by the DataRequested handler + void SetPostDataRequestedCallback( + PostDataRequestedCallback post_data_requested_callback); + private: struct DataRequestedHandlerEntry { DataRequestedHandlerEntry(); @@ -61,6 +95,7 @@ std::vector<DataRequestedHandlerEntry> data_requested_event_handlers_; int64_t latest_token_value_ = 0; + PostDataRequestedCallback post_data_requested_callback_; }; } // namespace webshare
diff --git a/chrome/browser/webshare/win/scoped_fake_data_transfer_manager_interop.cc b/chrome/browser/webshare/win/scoped_fake_data_transfer_manager_interop.cc index 7dadf63..805a543 100644 --- a/chrome/browser/webshare/win/scoped_fake_data_transfer_manager_interop.cc +++ b/chrome/browser/webshare/win/scoped_fake_data_transfer_manager_interop.cc
@@ -11,6 +11,7 @@ #include "base/win/com_init_util.h" #include "base/win/core_winrt_util.h" #include "base/win/win_util.h" +#include "base/win/windows_version.h" #include "chrome/browser/webshare/win/fake_data_transfer_manager_interop.h" #include "chrome/browser/webshare/win/show_share_ui_for_window_operation.h" #include "testing/gtest/include/gtest/gtest.h" @@ -38,6 +39,15 @@ } // namespace +// static +bool ScopedFakeDataTransferManagerInterop::IsSupportedEnvironment() { + if (base::win::ResolveCoreWinRTDelayload() && + base::win::ScopedHString::ResolveCoreWinRTStringDelayload()) + return true; + EXPECT_LT(base::win::GetVersion(), base::win::Version::WIN8); + return false; +} + ScopedFakeDataTransferManagerInterop::ScopedFakeDataTransferManagerInterop() { // Initialization work is done in an independent function so that the // various test macros can be used. @@ -56,8 +66,7 @@ } void ScopedFakeDataTransferManagerInterop::Initialize() { - ASSERT_TRUE(base::win::ResolveCoreWinRTDelayload()); - ASSERT_TRUE(base::win::ScopedHString::ResolveCoreWinRTStringDelayload()); + ASSERT_TRUE(IsSupportedEnvironment()); base::win::AssertComInitialized(); instance_ = Microsoft::WRL::Make<FakeDataTransferManagerInterop>();
diff --git a/chrome/browser/webshare/win/scoped_fake_data_transfer_manager_interop.h b/chrome/browser/webshare/win/scoped_fake_data_transfer_manager_interop.h index b5468b6..ef0d924b 100644 --- a/chrome/browser/webshare/win/scoped_fake_data_transfer_manager_interop.h +++ b/chrome/browser/webshare/win/scoped_fake_data_transfer_manager_interop.h
@@ -16,6 +16,8 @@ // for the Share contract. class ScopedFakeDataTransferManagerInterop { public: + static bool IsSupportedEnvironment(); + ScopedFakeDataTransferManagerInterop(); ScopedFakeDataTransferManagerInterop( const ScopedFakeDataTransferManagerInterop&) = delete;
diff --git a/chrome/browser/webshare/win/share_operation.cc b/chrome/browser/webshare/win/share_operation.cc new file mode 100644 index 0000000..8f78f409 --- /dev/null +++ b/chrome/browser/webshare/win/share_operation.cc
@@ -0,0 +1,607 @@ +// Copyright 2020 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/browser/webshare/win/share_operation.h" + +#include "base/bind.h" +#include "base/strings/utf_string_conversions.h" +#include "base/task/post_task.h" +#include "base/win/core_winrt_util.h" +#include "base/win/post_async_results.h" +#include "base/win/scoped_hstring.h" +#include "base/win/vector.h" +#include "chrome/browser/profiles/profile.h" +#include "chrome/browser/webshare/share_service_impl.h" +#include "chrome/browser/webshare/win/show_share_ui_for_window_operation.h" +#include "content/public/browser/browser_task_traits.h" +#include "content/public/browser/web_contents.h" +#include "net/base/net_errors.h" +#include "storage/browser/blob/blob_data_handle.h" +#include "storage/browser/blob/blob_storage_context.h" +#include "storage/browser/file_system/file_stream_writer.h" +#include "storage/browser/file_system/file_writer_delegate.h" +#include "storage/common/file_system/file_system_mount_option.h" +#include "ui/views/win/hwnd_util.h" +#include "url/gurl.h" + +#include <shlobj.h> +#include <windows.applicationmodel.datatransfer.h> +#include <windows.foundation.collections.h> +#include <windows.foundation.h> +#include <windows.storage.h> +#include <windows.storage.streams.h> +#include <wininet.h> +#include <wrl/client.h> +#include <wrl/event.h> + +using ABI::Windows::ApplicationModel::DataTransfer::IDataPackage; +using ABI::Windows::ApplicationModel::DataTransfer::IDataPackagePropertySet; +using ABI::Windows::ApplicationModel::DataTransfer::IDataRequest; +using ABI::Windows::ApplicationModel::DataTransfer::IDataRequestDeferral; +using ABI::Windows::ApplicationModel::DataTransfer::IDataRequestedEventArgs; +using ABI::Windows::Foundation::AsyncStatus; +using ABI::Windows::Foundation::IAsyncOperation; +using ABI::Windows::Foundation::IAsyncOperationCompletedHandler; +using ABI::Windows::Foundation::IClosable; +using ABI::Windows::Foundation::IUriRuntimeClass; +using ABI::Windows::Foundation::IUriRuntimeClassFactory; +using ABI::Windows::Storage::IStorageFile; +using ABI::Windows::Storage::IStorageFileStatics; +using ABI::Windows::Storage::IStorageItem; +using ABI::Windows::Storage::IStreamedFileDataRequestedHandler; +using ABI::Windows::Storage::StorageFile; +using ABI::Windows::Storage::Streams::IDataWriter; +using ABI::Windows::Storage::Streams::IDataWriterFactory; +using ABI::Windows::Storage::Streams::IOutputStream; +using Microsoft::WRL::Callback; +using Microsoft::WRL::ComPtr; +using Microsoft::WRL::Make; + +namespace ABI { +namespace Windows { +namespace Foundation { +namespace Collections { + +// Define template specializations for the types used. These uuids were randomly +// generated. +template <> +struct __declspec(uuid("CBE31E85-DEC8-4227-987F-9C63D6AA1A2E")) + IObservableVector<IStorageItem*> : IObservableVector_impl<IStorageItem*> {}; + +template <> +struct __declspec(uuid("30BE4864-5EE5-4111-916E-15126649F3C9")) + VectorChangedEventHandler<IStorageItem*> + : VectorChangedEventHandler_impl<IStorageItem*> {}; + +} // namespace Collections +} // namespace Foundation +} // namespace Windows +} // namespace ABI + +namespace webshare { +namespace { + +uint64_t g_max_file_bytes = kMaxSharedFileBytes; + +// Implements FileStreamWriter for an IDataWriter. +class DataWriterFileStreamWriter : public storage::FileStreamWriter { + public: + explicit DataWriterFileStreamWriter( + ComPtr<IDataWriter> data_writer, + scoped_refptr<base::RefCountedData<uint64_t>> file_bytes_shared) + : data_writer_(data_writer), file_bytes_shared_(file_bytes_shared) {} + + int Cancel(net::CompletionOnceCallback callback) override { + DCHECK_CURRENTLY_ON(content::BrowserThread::IO); + // If there is no async operation in progress, Cancel() should + // return net::ERR_UNEXPECTED per file_stream_header.h + if (!flush_operation_ && !write_operation_) + return net::ERR_UNEXPECTED; + + if (flush_operation_) { + flush_callback_.Reset(); + ComPtr<IAsyncInfo> async_info; + auto hr = flush_operation_.As(&async_info); + if (FAILED(hr)) + return net::ERR_UNEXPECTED; + + hr = async_info->Cancel(); + if (FAILED(hr)) + return net::ERR_UNEXPECTED; + + flush_operation_.Reset(); + } + + if (write_operation_) { + write_callback_.Reset(); + ComPtr<IAsyncInfo> async_info; + auto hr = write_operation_.As(&async_info); + if (FAILED(hr)) + return net::ERR_UNEXPECTED; + + hr = async_info->Cancel(); + if (FAILED(hr)) + return net::ERR_UNEXPECTED; + + write_operation_.Reset(); + } + return net::OK; + } + + int Flush(net::CompletionOnceCallback callback) override { + DCHECK_CURRENTLY_ON(content::BrowserThread::IO); + DCHECK(flush_callback_.is_null()); + DCHECK_EQ(flush_operation_, nullptr); + DCHECK(write_callback_.is_null()); + DCHECK_EQ(write_operation_, nullptr); + + auto hr = data_writer_->FlushAsync(&flush_operation_); + if (FAILED(hr)) + return net::ERR_UNEXPECTED; + + flush_callback_ = std::move(callback); + base::win::PostAsyncResults( + flush_operation_, + base::BindOnce(&DataWriterFileStreamWriter::OnFlushCompleted, + weak_factory_.GetWeakPtr())); + return net::ERR_IO_PENDING; + } + + int Write(net::IOBuffer* buf, + int buf_len, + net::CompletionOnceCallback callback) override { + DCHECK_CURRENTLY_ON(content::BrowserThread::IO); + DCHECK(flush_callback_.is_null()); + DCHECK_EQ(flush_operation_, nullptr); + DCHECK(write_callback_.is_null()); + DCHECK_EQ(write_operation_, nullptr); + + // Before processing the Write request, increment the total number of file + // bytes shared as part of the overall Share operation this belongs to, and + // if it has exceeded the maximum allowed, abort writing to the streamed + // file. + file_bytes_shared_->data += buf_len; + if (file_bytes_shared_->data > g_max_file_bytes) + return net::ERR_UNEXPECTED; + + auto hr = + data_writer_->WriteBytes(buf_len, reinterpret_cast<BYTE*>(buf->data())); + if (FAILED(hr)) + return net::ERR_UNEXPECTED; + + hr = data_writer_->StoreAsync(&write_operation_); + if (FAILED(hr)) + return net::ERR_UNEXPECTED; + + write_callback_ = std::move(callback); + base::win::PostAsyncResults( + write_operation_, + base::BindOnce(&DataWriterFileStreamWriter::OnWriteCompleted, + weak_factory_.GetWeakPtr())); + return net::ERR_IO_PENDING; + } + + private: + void OnFlushCompleted(boolean operation_result) { + DCHECK_CURRENTLY_ON(content::BrowserThread::IO); + DCHECK(!flush_callback_.is_null()); + DCHECK_NE(flush_operation_, nullptr); + DCHECK(write_callback_.is_null()); + DCHECK_EQ(write_operation_, nullptr); + + flush_operation_.Reset(); + int result = operation_result == TRUE ? net::OK : net::ERR_UNEXPECTED; + std::move(flush_callback_).Run(result); + } + + void OnWriteCompleted(UINT32 operation_result) { + DCHECK_CURRENTLY_ON(content::BrowserThread::IO); + DCHECK(flush_callback_.is_null()); + DCHECK_EQ(flush_operation_, nullptr); + DCHECK(!write_callback_.is_null()); + DCHECK_NE(write_operation_, nullptr); + + write_operation_.Reset(); + std::move(write_callback_).Run(operation_result); + } + + ComPtr<IDataWriter> data_writer_; + scoped_refptr<base::RefCountedData<uint64_t>> file_bytes_shared_; + net::CompletionOnceCallback flush_callback_; + ComPtr<IAsyncOperation<bool>> flush_operation_; + net::CompletionOnceCallback write_callback_; + ComPtr<IAsyncOperation<UINT32>> write_operation_; + base::WeakPtrFactory<DataWriterFileStreamWriter> weak_factory_{this}; +}; + +// Represents an ongoing operation of writing to an IOutputStream. +class OutputStreamWriteOperation + : public base::RefCounted<OutputStreamWriteOperation> { + public: + OutputStreamWriteOperation( + content::BrowserContext::BlobContextGetter blob_context_getter, + scoped_refptr<base::RefCountedData<uint64_t>> file_bytes_shared, + std::string uuid) + : blob_context_getter_(blob_context_getter), + file_bytes_shared_(file_bytes_shared), + uuid_(uuid) {} + + // Begins the write operation on the |stream|, maintaining a reference to the + // |stream| until the operation is completed, at which point it will be closed + // (if possible) and the |on_complete| callback will be invoked. The caller + // is still responsible for the lifetime of this object, but not of the + // |stream|. + void WriteStream(IOutputStream* stream, + base::OnceCallback<void()> on_complete) { + stream_ = ComPtr<IOutputStream>(stream); + on_complete_ = std::move(on_complete); + if (!base::PostTask( + FROM_HERE, {content::BrowserThread::IO}, + base::BindOnce(&OutputStreamWriteOperation::WriteStreamOnIOThread, + weak_factory_.GetWeakPtr()))) + Complete(); + } + + private: + friend class base::RefCounted<OutputStreamWriteOperation>; + + ~OutputStreamWriteOperation() = default; + + void WriteStreamOnIOThread() { + DCHECK_CURRENTLY_ON(content::BrowserThread::IO); + + storage::BlobStorageContext* blob_storage_context = + blob_context_getter_.Run().get(); + if (!blob_storage_context) { + Complete(); + return; + } + + blob_handle_ = blob_storage_context->GetBlobDataFromUUID(uuid_); + + ComPtr<IDataWriterFactory> data_writer_factory; + auto hr = base::win::GetActivationFactory< + IDataWriterFactory, RuntimeClass_Windows_Storage_Streams_DataWriter>( + &data_writer_factory); + if (FAILED(hr)) { + Complete(); + return; + } + + ComPtr<IDataWriter> data_writer; + hr = data_writer_factory->CreateDataWriter(stream_.Get(), &data_writer); + if (FAILED(hr)) { + Complete(); + return; + } + + writer_delegate_ = std::make_unique<storage::FileWriterDelegate>( + std::make_unique<DataWriterFileStreamWriter>(std::move(data_writer), + file_bytes_shared_), + storage::FlushPolicy::FLUSH_ON_COMPLETION); + writer_delegate_->Start( + blob_handle_->CreateReader(), + base::BindRepeating(&OutputStreamWriteOperation::OnFileWritten, + weak_factory_.GetWeakPtr())); + } + + void OnFileWritten( + base::File::Error error, + int64_t bytes_wrriten, + storage::FileWriterDelegate::WriteProgressStatus write_status) { + DCHECK_CURRENTLY_ON(content::BrowserThread::IO); + // Any status other than SUCCESS_IO_PENDING indicates completion. + if (write_status != + storage::FileWriterDelegate::WriteProgressStatus::SUCCESS_IO_PENDING) { + Complete(); + } + } + + void Complete() { + // If the IOutputStream implements IClosable (e.g. the OutputStream class), + // close the stream whenever we are done with this operation, regardless of + // the outcome. + if (stream_) { + ComPtr<IClosable> closable; + if (SUCCEEDED(stream_.As(&closable))) + closable->Close(); + } + + std::move(on_complete_).Run(); + } + + content::BrowserContext::BlobContextGetter blob_context_getter_; + std::unique_ptr<storage::BlobDataHandle> blob_handle_; + scoped_refptr<base::RefCountedData<uint64_t>> file_bytes_shared_; + base::OnceCallback<void()> on_complete_; + ComPtr<IOutputStream> stream_; + const std::string uuid_; + std::unique_ptr<storage::FileWriterDelegate> writer_delegate_; + base::WeakPtrFactory<OutputStreamWriteOperation> weak_factory_{this}; +}; +} // namespace + +// static +void ShareOperation::SetMaxFileBytesForTesting(uint64_t max_file_bytes) { + g_max_file_bytes = max_file_bytes; +} + +ShareOperation::ShareOperation(const std::string& title, + const std::string& text, + const GURL& url, + std::vector<blink::mojom::SharedFilePtr> files, + content::WebContents* web_contents) + : content::WebContentsObserver(web_contents), + title_(std::move(title)), + text_(std::move(text)), + url_(std::move(url)), + files_(std::move(files)) {} + +ShareOperation::~ShareOperation() { + if (callback_) + Complete(blink::mojom::ShareError::CANCELED); +} + +base::WeakPtr<ShareOperation> ShareOperation::AsWeakPtr() { + return weak_factory_.GetWeakPtr(); +} + +void ShareOperation::Run(blink::mojom::ShareService::ShareCallback callback) { + DCHECK(!callback_); + callback_ = std::move(callback); + + // If the required WinRT functionality is not available, or the corresponding + // web_contents have already been cleaned up, cancel the operation + const bool winrt_environment_ok = + base::win::ResolveCoreWinRTDelayload() && + base::win::ScopedHString::ResolveCoreWinRTStringDelayload(); + if (!winrt_environment_ok || !web_contents()) { + Complete(blink::mojom::ShareError::CANCELED); + return; + } + + if (files_.size() > 0) { + // Determine the source for use with the OS IAttachmentExecute. + // If the source cannot be determined, does not appear to be valid, + // or is longer than the max length supported by the IAttachmentExecute + // service, use a generic value that reliably maps to the Internet zone. + GURL source_url = web_contents()->GetLastCommittedURL(); + base::string16 source = + (source_url.is_valid() && + source_url.spec().size() <= INTERNET_MAX_URL_LENGTH) + ? base::UTF8ToUTF16(source_url.spec()) + : L"about:internet"; + + // For each "file", check against the OS that it is allowed + // The same instance cannot be used to check multiple files, so this + // makes a new one per-file. For more details on this functionality, see + // https://docs.microsoft.com/en-us/windows/win32/api/shobjidl_core/nf-shobjidl_core-iattachmentexecute-checkpolicy + for (auto& file : files_) { + ComPtr<IAttachmentExecute> attachment_services; + if (FAILED(CoCreateInstance(CLSID_AttachmentServices, nullptr, CLSCTX_ALL, + IID_PPV_ARGS(&attachment_services)))) { + Complete(blink::mojom::ShareError::INTERNAL_ERROR); + return; + } + if (FAILED(attachment_services->SetSource(source.c_str()))) { + Complete(blink::mojom::ShareError::INTERNAL_ERROR); + return; + } + if (FAILED(attachment_services->SetFileName( + base::UTF8ToWide(file->name).c_str()))) { + Complete(blink::mojom::ShareError::INTERNAL_ERROR); + return; + } + if (FAILED(attachment_services->CheckPolicy())) { + Complete(blink::mojom::ShareError::PERMISSION_DENIED); + return; + } + } + } + + HWND hwnd = + views::HWNDForNativeWindow(web_contents()->GetTopLevelNativeWindow()); + show_share_ui_for_window_operation_ = + std::make_unique<ShowShareUIForWindowOperation>(hwnd); + show_share_ui_for_window_operation_->Run(base::BindOnce( + &ShareOperation::OnDataRequested, weak_factory_.GetWeakPtr())); +} + +void ShareOperation::OnDataRequested(IDataRequestedEventArgs* event_args) { + DCHECK_CURRENTLY_ON(content::BrowserThread::UI); + + blink::mojom::ShareError share_result; + if (!event_args || !web_contents()) { + share_result = blink::mojom::ShareError::CANCELED; + } else { + if (PutShareContentInEventArgs(event_args)) { + share_result = blink::mojom::ShareError::OK; + } else { + share_result = blink::mojom::ShareError::INTERNAL_ERROR; + } + } + + // If the share operation failed or is not being deferred, mark it as complete + if (share_result != blink::mojom::ShareError::OK || !data_request_deferral_) + Complete(share_result); +} + +bool ShareOperation::PutShareContentInEventArgs( + IDataRequestedEventArgs* event_args) { + DCHECK_CURRENTLY_ON(content::BrowserThread::UI); + + ComPtr<IDataRequest> data_request; + if (FAILED(event_args->get_Request(&data_request))) + return false; + + if (FAILED(data_request->get_Data(&data_package_))) + return false; + + ComPtr<IDataPackagePropertySet> data_prop_sets; + if (FAILED(data_package_->get_Properties(&data_prop_sets))) + return false; + + // Title is a required property for the UWP Share contract, so + // if the provided title is empty we instead use a blank value. + // https://docs.microsoft.com/en-us/windows/uwp/app-to-app/share-data + base::win::ScopedHString title_h = + base::win::ScopedHString::Create(title_.empty() ? " " : title_.c_str()); + if (FAILED(data_prop_sets->put_Title(title_h.get()))) + return false; + + return PutShareContentInDataPackage(data_request.Get()); +} + +bool ShareOperation::PutShareContentInDataPackage(IDataRequest* data_request) { + DCHECK_CURRENTLY_ON(content::BrowserThread::UI); + + if (!text_.empty()) { + auto text_h = base::win::ScopedHString::Create(text_); + if (FAILED(data_package_->SetText(text_h.get()))) + return false; + } + + if (!url_.spec().empty()) { + ComPtr<IUriRuntimeClassFactory> uri_factory; + auto hr = + base::win::GetActivationFactory<IUriRuntimeClassFactory, + RuntimeClass_Windows_Foundation_Uri>( + &uri_factory); + if (FAILED(hr)) + return hr; + + auto url_h = base::win::ScopedHString::Create(url_.spec().c_str()); + ComPtr<IUriRuntimeClass> uri; + if (FAILED(uri_factory->CreateUri(url_h.get(), &uri))) + return false; + + if (FAILED(data_package_->SetUri(uri.Get()))) + return false; + } + + if (!files_.empty()) { + // Fetch a deferral to allow for async operations + if (FAILED(data_request->GetDeferral(&data_request_deferral_))) + return false; + + // Initialize the output collection for the async operation(s) + storage_items_ = Make<base::win::Vector<IStorageItem*>>(); + + // Create a variable to be shared between all the operations processing the + // blobs to streams. This will be used to keep a running count of total file + // bytes shared as part of this Share operation so that if the maximum + // allowed is exceeded the processing can be halted. Currently the + // ShareOperation class is not guaranteed to outlive these operations, but + // if that changes in the future it may be appropriate to make this a member + // of the ShareOperation that is shared only be reference. + auto file_bytes_shared = + base::MakeRefCounted<base::RefCountedData<uint64_t>>(0); + + ComPtr<IStorageFileStatics> storage_statics; + auto hr = base::win::GetActivationFactory< + IStorageFileStatics, RuntimeClass_Windows_Storage_StorageFile>( + &storage_statics); + if (FAILED(hr)) + return false; + + for (auto& file : files_) { + // This operation for converting the corresponding blob to a stream is + // maintained as a scoped_refptr because it may out live this + // ShareOperation instance. It is only invoked when the user has chosen a + // Share target and that target decides to start reading the contents of + // the corresponding IStorageFile. See + // https://docs.microsoft.com/en-us/uwp/api/windows.storage.storagefile.createstreamedfileasync + // If in the future the ShareOperation class is changed to live until the + // target app has finished fully processing the shared content this could + // be updated to be owned/maintained by this ShareOperation instance. + auto operation = base::MakeRefCounted<OutputStreamWriteOperation>( + content::BrowserContext::GetBlobStorageContext( + web_contents()->GetBrowserContext()), + file_bytes_shared, file->blob->uuid); + auto name_h = base::win::ScopedHString::Create(file->name); + auto raw_data_requested_callback = + Callback<IStreamedFileDataRequestedHandler>( + [operation](IOutputStream* stream) -> HRESULT { + // No additional work is needed when the write has been + // completed, but a callback is created to hold a reference + // to the |operation| until the operation has completed. + operation->WriteStream( + stream, + base::BindOnce( + base::DoNothing::Once< + scoped_refptr<OutputStreamWriteOperation>>(), + operation)); + return S_OK; + }); + // The Callback function may return null in the E_OUTOFMEMORY case + if (!raw_data_requested_callback) + return false; + ComPtr<IAsyncOperation<StorageFile*>> async_operation; + if (FAILED(storage_statics->CreateStreamedFileAsync( + name_h.get(), raw_data_requested_callback.Get(), + /*thumbnail*/ nullptr, &async_operation))) { + return false; + } + + if (FAILED(base::win::PostAsyncResults( + async_operation, + base::BindOnce(&ShareOperation::OnStreamedFileCreated, + weak_factory_.GetWeakPtr())))) + return false; + } + } + + return true; +} + +void ShareOperation::OnStreamedFileCreated(ComPtr<IStorageFile> storage_file) { + DCHECK_CURRENTLY_ON(content::BrowserThread::UI); + + // If there is no callback this ShareOperation already completed due to an + // error, so work can be halted early. + if (!callback_) + return; + + if (!storage_file) { + Complete(blink::mojom::ShareError::INTERNAL_ERROR); + return; + } + + ComPtr<IStorageItem> storage_item; + if (FAILED(storage_file.As(&storage_item))) { + Complete(blink::mojom::ShareError::INTERNAL_ERROR); + return; + } + + if (FAILED(storage_items_->Append(storage_item.Get()))) { + Complete(blink::mojom::ShareError::INTERNAL_ERROR); + return; + } + + unsigned int size; + if (FAILED(storage_items_->get_Size(&size))) { + Complete(blink::mojom::ShareError::INTERNAL_ERROR); + return; + } + + // If this is not the final file, no more work to do + if (size != files_.size()) + return; + + if (FAILED(data_package_->SetStorageItems(storage_items_.Get(), + true /*readonly*/))) { + Complete(blink::mojom::ShareError::INTERNAL_ERROR); + return; + } + + data_request_deferral_->Complete(); + Complete(blink::mojom::ShareError::OK); + return; +} + +void ShareOperation::Complete(const blink::mojom::ShareError share_result) { + std::move(callback_).Run(share_result); +} + +} // namespace webshare
diff --git a/chrome/browser/webshare/win/share_operation.h b/chrome/browser/webshare/win/share_operation.h new file mode 100644 index 0000000..2ea87d3c --- /dev/null +++ b/chrome/browser/webshare/win/share_operation.h
@@ -0,0 +1,105 @@ +// Copyright 2020 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. +#ifndef CHROME_BROWSER_WEBSHARE_WIN_SHARE_OPERATION_H_ +#define CHROME_BROWSER_WEBSHARE_WIN_SHARE_OPERATION_H_ + +#include <memory> +#include <string> +#include <vector> + +#include "base/memory/weak_ptr.h" +#include "content/public/browser/web_contents_observer.h" +#include "third_party/blink/public/mojom/webshare/webshare.mojom.h" +#include "url/gurl.h" + +#include <wrl/client.h> + +namespace ABI { +namespace Windows { +namespace ApplicationModel { +namespace DataTransfer { +struct IDataPackage; +class IDataRequest; +class IDataRequestDeferral; +class IDataRequestedEventArgs; +} // namespace DataTransfer +} // namespace ApplicationModel +namespace Storage { +class IStorageFile; +class IStorageItem; +} // namespace Storage +} // namespace Windows +} // namespace ABI + +namespace base { +namespace win { +template <typename T> +class Vector; +} // namespace win +} // namespace base + +namespace webshare { + +class ShowShareUIForWindowOperation; + +class ShareOperation : content::WebContentsObserver { + public: + static void SetMaxFileBytesForTesting(uint64_t max_file_bytes); + + ShareOperation(const std::string& title, + const std::string& text, + const GURL& url, + std::vector<blink::mojom::SharedFilePtr> files, + content::WebContents* web_contents); + ShareOperation(const ShareOperation&) = delete; + ShareOperation& operator=(const ShareOperation&) = delete; + ~ShareOperation() override; + + base::WeakPtr<ShareOperation> AsWeakPtr(); + + // Starts this Windows Share operation for the previously provided content. + // The |callback| will be invoked upon completion of the operation with a + // value indicating the success of the operation, or if the returned instance + // is destroyed before the operation is completed the |callback| will be + // invoked with a CANCELLED value and the underlying Windows operation will be + // aborted. + void Run(blink::mojom::ShareService::ShareCallback callback); + + private: + void OnDataRequested( + ABI::Windows::ApplicationModel::DataTransfer::IDataRequestedEventArgs* e); + bool PutShareContentInDataPackage( + ABI::Windows::ApplicationModel::DataTransfer::IDataRequest* data_request); + bool PutShareContentInEventArgs( + ABI::Windows::ApplicationModel::DataTransfer::IDataRequestedEventArgs* e); + void OnStreamedFileCreated( + Microsoft::WRL::ComPtr<ABI::Windows::Storage::IStorageFile> storage_file); + void Complete(const blink::mojom::ShareError share_error); + + const std::string title_; + const std::string text_; + const GURL url_; + const std::vector<blink::mojom::SharedFilePtr> files_; + + blink::mojom::ShareService::ShareCallback callback_; + Microsoft::WRL::ComPtr< + ABI::Windows::ApplicationModel::DataTransfer::IDataPackage> + data_package_; + Microsoft::WRL::ComPtr< + ABI::Windows::ApplicationModel::DataTransfer::IDataRequestDeferral> + data_request_deferral_; + std::unique_ptr<ShowShareUIForWindowOperation> + show_share_ui_for_window_operation_; + // Though this Vector is declared as using a raw IStorageItem*, because + // IStorageItem implements IUnknown it will be stored internally with + // ComPtrs, so does not need to be specially handled. + Microsoft::WRL::ComPtr< + base::win::Vector<ABI::Windows::Storage::IStorageItem*>> + storage_items_; + base::WeakPtrFactory<ShareOperation> weak_factory_{this}; +}; + +} // namespace webshare + +#endif // CHROME_BROWSER_WEBSHARE_WIN_SHARE_OPERATION_H_
diff --git a/chrome/browser/webshare/win/share_operation_unittest.cc b/chrome/browser/webshare/win/share_operation_unittest.cc new file mode 100644 index 0000000..1f675a8 --- /dev/null +++ b/chrome/browser/webshare/win/share_operation_unittest.cc
@@ -0,0 +1,446 @@ +// Copyright 2020 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "chrome/browser/webshare/win/share_operation.h" + +#include "base/guid.h" +#include "base/run_loop.h" +#include "base/synchronization/waitable_event.h" +#include "base/test/bind_test_util.h" +#include "base/test/scoped_feature_list.h" +#include "base/win/core_winrt_util.h" +#include "base/win/post_async_results.h" +#include "chrome/browser/webshare/share_service_impl.h" +#include "chrome/browser/webshare/win/fake_data_transfer_manager.h" +#include "chrome/browser/webshare/win/fake_data_transfer_manager_interop.h" +#include "chrome/browser/webshare/win/scoped_fake_data_transfer_manager_interop.h" +#include "chrome/common/chrome_features.h" +#include "chrome/test/base/chrome_render_view_host_test_harness.h" +#include "content/public/browser/browser_task_traits.h" +#include "storage/browser/blob/blob_data_builder.h" +#include "storage/browser/blob/blob_impl.h" +#include "storage/browser/blob/blob_storage_context.h" +#include "ui/views/win/hwnd_util.h" +#include "url/gurl.h" + +#include <wrl/event.h> + +using ABI::Windows::ApplicationModel::DataTransfer::IDataPackage; +using ABI::Windows::ApplicationModel::DataTransfer::IDataPackagePropertySet; +using ABI::Windows::ApplicationModel::DataTransfer::IDataRequest; +using ABI::Windows::ApplicationModel::DataTransfer::IDataRequestedEventArgs; +using ABI::Windows::Foundation::IAsyncOperation; +using ABI::Windows::Foundation::IAsyncOperationCompletedHandler; +using ABI::Windows::Storage::FileAccessMode; +using ABI::Windows::Storage::IStorageFile; +using ABI::Windows::Storage::Streams::IDataReader; +using ABI::Windows::Storage::Streams::IDataReaderFactory; +using ABI::Windows::Storage::Streams::IInputStream; +using ABI::Windows::Storage::Streams::IRandomAccessStream; +using Microsoft::WRL::Callback; +using Microsoft::WRL::ComPtr; + +namespace webshare { +namespace { +constexpr base::TimeDelta kOperationWaitIncrement = + base::TimeDelta::FromMilliseconds(100); +constexpr base::TimeDelta kMaxOperationWait = base::TimeDelta::FromSeconds(10); +constexpr uint64_t kMaxSharedFileBytesForTest = 1024 * 100; +} // namespace + +class ShareOperationUnitTest : public ChromeRenderViewHostTestHarness { + public: + ShareOperationUnitTest() { + feature_list_.InitAndEnableFeature(features::kWebShare); + } + ~ShareOperationUnitTest() override = default; + + void SetUp() override { + ChromeRenderViewHostTestHarness::SetUp(); + + if (!IsSupportedEnvironment()) + return; + + scoped_interop_ = std::make_unique<ScopedFakeDataTransferManagerInterop>(); + ShareOperation::SetMaxFileBytesForTesting(kMaxSharedFileBytesForTest); + } + + void TearDown() override { + ChromeRenderViewHostTestHarness::TearDown(); + ShareOperation::SetMaxFileBytesForTesting(kMaxSharedFileBytes); + } + + protected: + // Waits/blocks for an operation to complete that involves code from the + // system and our own internal code. + template <typename T, typename TResult> + void WaitForAsyncOperationWithSystemAndInternalCode( + ComPtr<IAsyncOperation<T>>& operation, + TResult& result) { + base::WaitableEvent waitable_event; + ASSERT_HRESULT_SUCCEEDED(base::win::PostAsyncResults( + operation, base::BindLambdaForTesting( + [&result, &waitable_event](TResult returned_result) { + result = returned_result; + waitable_event.Signal(); + }))); + + base::TimeDelta time_waited; + while (!waitable_event.IsSignaled() && time_waited < kMaxOperationWait) { + task_environment()->RunUntilIdle(); + waitable_event.TimedWait(kOperationWaitIncrement); + time_waited += kOperationWaitIncrement; + } + + ASSERT_TRUE(waitable_event.IsSignaled()); + } + + void ReadFile(IStorageFile* file, std::string& result) { + ComPtr<IAsyncOperation<IRandomAccessStream*>> open_operation; + ASSERT_HRESULT_SUCCEEDED( + file->OpenAsync(FileAccessMode::FileAccessMode_Read, &open_operation)); + + ComPtr<IRandomAccessStream> stream; + ASSERT_NO_FATAL_FAILURE( + WaitForAsyncOperationWithSystemAndInternalCode(open_operation, stream)); + ASSERT_TRUE(stream); + + UINT64 size; + ASSERT_HRESULT_SUCCEEDED(stream->get_Size(&size)); + + ComPtr<IInputStream> input_stream; + ASSERT_HRESULT_SUCCEEDED(stream->GetInputStreamAt(0, &input_stream)); + + ComPtr<IDataReaderFactory> data_reader_factory; + HRESULT hr = base::win::GetActivationFactory< + IDataReaderFactory, RuntimeClass_Windows_Storage_Streams_DataReader>( + &data_reader_factory); + ASSERT_HRESULT_SUCCEEDED(hr); + + ComPtr<IDataReader> data_reader; + ASSERT_HRESULT_SUCCEEDED(data_reader_factory->CreateDataReader( + input_stream.Get(), &data_reader)); + + ComPtr<IAsyncOperation<UINT32>> load_operation; + ASSERT_HRESULT_SUCCEEDED(data_reader->LoadAsync(size, &load_operation)); + + UINT32 bytes_loaded; + ASSERT_NO_FATAL_FAILURE(WaitForAsyncOperationWithSystemAndInternalCode( + load_operation, bytes_loaded)); + ASSERT_NE(bytes_loaded, 0u); + + std::vector<unsigned char> bytes(bytes_loaded); + ASSERT_HRESULT_SUCCEEDED( + data_reader->ReadBytes(bytes_loaded, bytes.data())); + + result = std::string(bytes.begin(), bytes.end()); + } + + blink::mojom::SharedFilePtr CreateSharedFile(const std::string& name, + const std::string& content_type, + const std::string& contents) { + auto blob = blink::mojom::SerializedBlob::New(); + const std::string uuid = base::GenerateGUID(); + blob->uuid = uuid; + blob->content_type = content_type; + blob->size = contents.size(); + + base::RunLoop run_loop; + auto blob_context_getter = + content::BrowserContext::GetBlobStorageContext(browser_context()); + content::GetIOThreadTaskRunner({})->PostTaskAndReply( + FROM_HERE, + base::BindLambdaForTesting([&blob_context_getter, &blob, &uuid, + &content_type, &contents]() { + auto builder = std::make_unique<storage::BlobDataBuilder>(uuid); + builder->set_content_type(content_type); + builder->AppendData(contents); + storage::BlobImpl::Create( + blob_context_getter.Run()->AddFinishedBlob(std::move(builder)), + blob->blob.InitWithNewPipeAndPassReceiver()); + }), + base::BindLambdaForTesting([&run_loop]() { run_loop.Quit(); })); + run_loop.Run(); + return blink::mojom::SharedFile::New(name, std::move(blob)); + } + + bool IsSupportedEnvironment() { + return ScopedFakeDataTransferManagerInterop::IsSupportedEnvironment(); + } + + // Fetches the FakeDataTransferManager associated with the current context. + // Returns a non-ref-counted pointer, as the lifetime is already maintained by + // the scoped_interop_. + FakeDataTransferManager* fake_data_transfer_manager() { + if (!fake_data_transfer_manager_) { + HWND hwnd = + views::HWNDForNativeWindow(web_contents()->GetTopLevelNativeWindow()); + ComPtr<FakeDataTransferManager> fake_data_transfer_manager; + EXPECT_HRESULT_SUCCEEDED(scoped_interop_->instance().GetForWindow( + hwnd, IID_PPV_ARGS(&fake_data_transfer_manager))); + fake_data_transfer_manager_ = fake_data_transfer_manager.Get(); + } + return fake_data_transfer_manager_; + } + + private: + FakeDataTransferManager* fake_data_transfer_manager_ = nullptr; + base::test::ScopedFeatureList feature_list_; + std::unique_ptr<ScopedFakeDataTransferManagerInterop> scoped_interop_; +}; + +TEST_F(ShareOperationUnitTest, WithoutTitle) { + if (!IsSupportedEnvironment()) + return; + + bool post_data_requested_callback_invoked = false; + fake_data_transfer_manager()->SetPostDataRequestedCallback( + base::BindLambdaForTesting( + [&post_data_requested_callback_invoked]( + const FakeDataTransferManager::DataRequestedContent& + data_requested_content) { + ASSERT_FALSE(post_data_requested_callback_invoked); + post_data_requested_callback_invoked = true; + ASSERT_EQ(data_requested_content.title, " "); + ASSERT_EQ(data_requested_content.text, "shared Text"); + })); + + base::RunLoop run_loop; + std::vector<blink::mojom::SharedFilePtr> files; + ShareOperation operation{"", "shared Text", GURL::EmptyGURL(), + std::move(files), web_contents()}; + operation.Run( + base::BindLambdaForTesting([&run_loop](blink::mojom::ShareError error) { + ASSERT_EQ(error, blink::mojom::ShareError::OK); + run_loop.Quit(); + })); + run_loop.Run(); + + ASSERT_TRUE(post_data_requested_callback_invoked); +} + +TEST_F(ShareOperationUnitTest, BasicFields) { + if (!IsSupportedEnvironment()) + return; + + bool post_data_requested_callback_invoked = false; + fake_data_transfer_manager()->SetPostDataRequestedCallback( + base::BindLambdaForTesting( + [&post_data_requested_callback_invoked]( + const FakeDataTransferManager::DataRequestedContent& + data_requested_content) { + ASSERT_FALSE(post_data_requested_callback_invoked); + post_data_requested_callback_invoked = true; + ASSERT_EQ(data_requested_content.title, "shared title"); + ASSERT_EQ(data_requested_content.text, "shared text"); + ASSERT_EQ(GURL(data_requested_content.uri), + GURL("https://www.contoso.com")); + })); + + base::RunLoop run_loop; + std::vector<blink::mojom::SharedFilePtr> files; + ShareOperation operation{"shared title", "shared text", + GURL("https://www.contoso.com"), std::move(files), + web_contents()}; + operation.Run( + base::BindLambdaForTesting([&run_loop](blink::mojom::ShareError error) { + ASSERT_EQ(error, blink::mojom::ShareError::OK); + run_loop.Quit(); + })); + run_loop.Run(); + + ASSERT_TRUE(post_data_requested_callback_invoked); +} + +TEST_F(ShareOperationUnitTest, BasicFile) { + if (!IsSupportedEnvironment()) + return; + + bool post_data_requested_callback_invoked = false; + fake_data_transfer_manager()->SetPostDataRequestedCallback( + base::BindLambdaForTesting( + [&](const FakeDataTransferManager::DataRequestedContent& + data_requested_content) { + ASSERT_FALSE(post_data_requested_callback_invoked); + post_data_requested_callback_invoked = true; + ASSERT_EQ(data_requested_content.title, "shared title"); + ASSERT_EQ(data_requested_content.files.size(), 1ull); + ASSERT_EQ(data_requested_content.files[0].name, "MyFile.txt"); + std::string file_contents; + ASSERT_NO_FATAL_FAILURE(ReadFile( + data_requested_content.files[0].file.Get(), file_contents)); + ASSERT_EQ(file_contents, "Contents of the file"); + })); + + base::RunLoop run_loop; + std::vector<blink::mojom::SharedFilePtr> files; + files.push_back( + CreateSharedFile("MyFile.txt", "text/plain", "Contents of the file")); + ShareOperation operation{"shared title", "", GURL::EmptyGURL(), + std::move(files), web_contents()}; + operation.Run( + base::BindLambdaForTesting([&run_loop](blink::mojom::ShareError error) { + ASSERT_EQ(error, blink::mojom::ShareError::OK); + run_loop.Quit(); + })); + run_loop.Run(); + + ASSERT_TRUE(post_data_requested_callback_invoked); +} + +TEST_F(ShareOperationUnitTest, SingleFileAtSizeLimit) { + if (!IsSupportedEnvironment()) + return; + + bool post_data_requested_callback_invoked = false; + fake_data_transfer_manager()->SetPostDataRequestedCallback( + base::BindLambdaForTesting( + [&](const FakeDataTransferManager::DataRequestedContent& + data_requested_content) { + ASSERT_FALSE(post_data_requested_callback_invoked); + post_data_requested_callback_invoked = true; + ASSERT_EQ(data_requested_content.files.size(), 1ull); + std::string file_contents; + ASSERT_NO_FATAL_FAILURE(ReadFile( + data_requested_content.files[0].file.Get(), file_contents)); + ASSERT_EQ(file_contents.length(), kMaxSharedFileBytesForTest); + })); + + base::RunLoop run_loop; + std::vector<blink::mojom::SharedFilePtr> files; + files.push_back( + CreateSharedFile("MyFile.txt", "text/plain", + std::string(kMaxSharedFileBytesForTest, '*'))); + ShareOperation operation{"", "", GURL::EmptyGURL(), std::move(files), + web_contents()}; + operation.Run( + base::BindLambdaForTesting([&run_loop](blink::mojom::ShareError error) { + ASSERT_EQ(error, blink::mojom::ShareError::OK); + run_loop.Quit(); + })); + run_loop.Run(); + + ASSERT_TRUE(post_data_requested_callback_invoked); +} + +TEST_F(ShareOperationUnitTest, SingleFileLargerThanSizeLimit) { + if (!IsSupportedEnvironment()) + return; + + bool post_data_requested_callback_invoked = false; + fake_data_transfer_manager()->SetPostDataRequestedCallback( + base::BindLambdaForTesting( + [&](const FakeDataTransferManager::DataRequestedContent& + data_requested_content) { + ASSERT_FALSE(post_data_requested_callback_invoked); + post_data_requested_callback_invoked = true; + ASSERT_EQ(data_requested_content.files.size(), 1ull); + std::string file_contents; + ASSERT_NO_FATAL_FAILURE(ReadFile( + data_requested_content.files[0].file.Get(), file_contents)); + ASSERT_LT(file_contents.length(), kMaxSharedFileBytesForTest + 1); + })); + + base::RunLoop run_loop; + std::vector<blink::mojom::SharedFilePtr> files; + files.push_back( + CreateSharedFile("MyFile.txt", "text/plain", + std::string(kMaxSharedFileBytesForTest + 1, '*'))); + ShareOperation operation{"", "", GURL::EmptyGURL(), std::move(files), + web_contents()}; + operation.Run( + base::BindLambdaForTesting([&run_loop](blink::mojom::ShareError error) { + ASSERT_EQ(error, blink::mojom::ShareError::OK); + run_loop.Quit(); + })); + run_loop.Run(); + + ASSERT_TRUE(post_data_requested_callback_invoked); +} + +TEST_F(ShareOperationUnitTest, FilesTotallingSizeLimit) { + if (!IsSupportedEnvironment()) + return; + + bool post_data_requested_callback_invoked = false; + fake_data_transfer_manager()->SetPostDataRequestedCallback( + base::BindLambdaForTesting( + [&](const FakeDataTransferManager::DataRequestedContent& + data_requested_content) { + ASSERT_FALSE(post_data_requested_callback_invoked); + post_data_requested_callback_invoked = true; + ASSERT_EQ(data_requested_content.files.size(), 2ull); + std::string file1_contents; + ASSERT_NO_FATAL_FAILURE(ReadFile( + data_requested_content.files[0].file.Get(), file1_contents)); + std::string file2_contents; + ASSERT_NO_FATAL_FAILURE(ReadFile( + data_requested_content.files[0].file.Get(), file2_contents)); + ASSERT_EQ(file1_contents.length() + file2_contents.length(), + kMaxSharedFileBytesForTest); + })); + + base::RunLoop run_loop; + std::vector<blink::mojom::SharedFilePtr> files; + files.push_back( + CreateSharedFile("File1.txt", "text/plain", + std::string(kMaxSharedFileBytesForTest / 2, '*'))); + files.push_back( + CreateSharedFile("File2.txt", "text/plain", + std::string(kMaxSharedFileBytesForTest / 2, '*'))); + ShareOperation operation{"", "", GURL::EmptyGURL(), std::move(files), + web_contents()}; + operation.Run( + base::BindLambdaForTesting([&run_loop](blink::mojom::ShareError error) { + ASSERT_EQ(error, blink::mojom::ShareError::OK); + run_loop.Quit(); + })); + run_loop.Run(); + + ASSERT_TRUE(post_data_requested_callback_invoked); +} + +TEST_F(ShareOperationUnitTest, FilesTotallingLargerThanSizeLimit) { + if (!IsSupportedEnvironment()) + return; + + bool post_data_requested_callback_invoked = false; + fake_data_transfer_manager()->SetPostDataRequestedCallback( + base::BindLambdaForTesting( + [&](const FakeDataTransferManager::DataRequestedContent& + data_requested_content) { + ASSERT_FALSE(post_data_requested_callback_invoked); + post_data_requested_callback_invoked = true; + ASSERT_EQ(data_requested_content.files.size(), 2ull); + std::string file1_contents; + ASSERT_NO_FATAL_FAILURE(ReadFile( + data_requested_content.files[0].file.Get(), file1_contents)); + std::string file2_contents; + ASSERT_NO_FATAL_FAILURE(ReadFile( + data_requested_content.files[1].file.Get(), file2_contents)); + ASSERT_LT(file1_contents.length() + file2_contents.length(), + kMaxSharedFileBytesForTest + 1); + })); + + base::RunLoop run_loop; + std::vector<blink::mojom::SharedFilePtr> files; + files.push_back( + CreateSharedFile("File1.txt", "text/plain", + std::string(kMaxSharedFileBytesForTest / 2, '*'))); + files.push_back( + CreateSharedFile("File2.txt", "text/plain", + std::string((kMaxSharedFileBytesForTest / 2) + 1, '*'))); + ShareOperation operation{"", "", GURL::EmptyGURL(), std::move(files), + web_contents()}; + operation.Run( + base::BindLambdaForTesting([&run_loop](blink::mojom::ShareError error) { + ASSERT_EQ(error, blink::mojom::ShareError::OK); + run_loop.Quit(); + })); + run_loop.Run(); + + ASSERT_TRUE(post_data_requested_callback_invoked); +} + +} // namespace webshare
diff --git a/chrome/browser/webshare/win/show_share_ui_for_window_operation_unittest.cc b/chrome/browser/webshare/win/show_share_ui_for_window_operation_unittest.cc index cd79303b..8dc7937 100644 --- a/chrome/browser/webshare/win/show_share_ui_for_window_operation_unittest.cc +++ b/chrome/browser/webshare/win/show_share_ui_for_window_operation_unittest.cc
@@ -40,8 +40,7 @@ enum TestCallbackState { NotRun = 0, RunWithoutValue, RunWithValue }; bool IsSupportedEnvironment() { - return base::win::ResolveCoreWinRTDelayload() && - base::win::ScopedHString::ResolveCoreWinRTStringDelayload(); + return ScopedFakeDataTransferManagerInterop::IsSupportedEnvironment(); } void SetUp() override {
diff --git a/chrome/build/win64.pgo.txt b/chrome/build/win64.pgo.txt index 519d88a..5734b6b8 100644 --- a/chrome/build/win64.pgo.txt +++ b/chrome/build/win64.pgo.txt
@@ -1 +1 @@ -chrome-win64-master-1602212356-910f3b9c14ad8fb9eb002bc49aff02d2bc68cf6f.profdata +chrome-win64-master-1602244639-9ed9777b412f549b6770ee430e4768c83e1e2c1e.profdata
diff --git a/chrome/test/BUILD.gn b/chrome/test/BUILD.gn index 3a22f380..0118af1 100644 --- a/chrome/test/BUILD.gn +++ b/chrome/test/BUILD.gn
@@ -334,6 +334,7 @@ "//components/crash/core/app", "//third_party/wtl", ] + libs = [ "runtimeobject.lib" ] } if (is_chromeos) { @@ -2694,7 +2695,6 @@ "../browser/ui/ash/launcher/chrome_launcher_controller_test_util.h", "../browser/ui/ash/multi_user/test_multi_user_window_manager.cc", "../browser/ui/ash/multi_user/test_multi_user_window_manager.h", - "../browser/ui/ash/network/networking_config_chromeos_browsertest.cc", "../browser/ui/ash/screen_orientation_delegate_chromeos_browsertest.cc", "../browser/ui/ash/shelf_browsertest.cc", "../browser/ui/ash/system_tray_client_browsertest.cc", @@ -3497,7 +3497,6 @@ "../browser/page_load_metrics/observers/tab_restore_page_load_metrics_observer_unittest.cc", "../browser/page_load_metrics/observers/third_party_metrics_observer_unittest.cc", "../browser/page_load_metrics/observers/translate_page_load_metrics_observer_unittest.cc", - "../browser/paint_preview/services/paint_preview_demo_service_unittest.cc", "../browser/paint_preview/services/paint_preview_tab_service_unittest.cc", "../browser/password_manager/chrome_password_manager_client_unittest.cc", "../browser/password_manager/password_store_x_unittest.cc", @@ -4547,6 +4546,7 @@ "../browser/ui/thumbnails/thumbnail_capture_driver_unittest.cc", "../browser/ui/thumbnails/thumbnail_image_unittest.cc", "../browser/ui/thumbnails/thumbnail_scheduler_impl_unittest.cc", + "../browser/ui/thumbnails/thumbnail_stats_tracker_unittest.cc", "../browser/ui/toolbar/app_menu_model_unittest.cc", "../browser/ui/toolbar/back_forward_menu_model_unittest.cc", "../browser/ui/toolbar/location_bar_model_unittest.cc", @@ -5787,6 +5787,10 @@ data_deps += [ "//chrome:packed_resources" ] } } + if (is_win || is_mac) { + sources += + [ "../browser/notifications/notification_image_retainer_unittest.cc" ] + } if (is_win || is_mac || is_chromeos) { sources += [ "../browser/extensions/api/networking_private/networking_private_crypto_unittest.cc" ] } @@ -5796,11 +5800,11 @@ } if (is_win) { sources += [ - "../browser/notifications/win/notification_image_retainer_unittest.cc", "../browser/notifications/win/notification_template_builder_unittest.cc", "../browser/ui/views/uninstall_view_unittest.cc", "../browser/webshare/win/fake_data_transfer_manager_interop_unittest.cc", "../browser/webshare/win/fake_data_transfer_manager_unittest.cc", + "../browser/webshare/win/share_operation_unittest.cc", "../browser/webshare/win/show_share_ui_for_window_operation_unittest.cc", ] deps += [
diff --git a/chrome/test/data/webui/chromeos/diagnostics/diagnostics_browsertest.js b/chrome/test/data/webui/chromeos/diagnostics/diagnostics_browsertest.js index 117ef4842..377ffac 100644 --- a/chrome/test/data/webui/chromeos/diagnostics/diagnostics_browsertest.js +++ b/chrome/test/data/webui/chromeos/diagnostics/diagnostics_browsertest.js
@@ -23,6 +23,7 @@ ['FakeMethodProvider', 'diagnostics/fake_method_provider_test.js'], ['RoutineResultEntry', 'diagnostics/routine_result_entry_test.js'], ['RoutineResultList', 'diagnostics/routine_result_list_test.js'], + ['RoutineSection', 'diagnostics/routine_section_test.js'], ['PercentBarChart', 'diagnostics/percent_bar_chart_test.js'], [ 'FakeSystemRoutineController', 'diagnostics/fake_system_routine_controller_test.js'
diff --git a/chrome/test/data/webui/chromeos/diagnostics/routine_section_test.js b/chrome/test/data/webui/chromeos/diagnostics/routine_section_test.js new file mode 100644 index 0000000..d9701ac --- /dev/null +++ b/chrome/test/data/webui/chromeos/diagnostics/routine_section_test.js
@@ -0,0 +1,42 @@ +// Copyright 2020 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// TODO(jimmyxgong): Use es6 module for mojo binding (crbug/1004256). +import 'chrome://resources/mojo/mojo/public/js/mojo_bindings_lite.js'; +import 'chrome://diagnostics/routine_section.js'; +import {flushTasks} from 'chrome://test/test_util.m.js'; + +suite('RoutineSectionTest', () => { + /** @type {?HTMLElement} */ + let routineSectionElement = null; + + setup(function() { + PolymerTest.clearBody(); + }); + + teardown(function() { + if (routineSectionElement) { + routineSectionElement.remove(); + } + routineSectionElement = null; + }); + + function initializeRoutineSection() { + assertFalse(!!routineSectionElement); + + // Add the entry to the DOM. + routineSectionElement = document.createElement('routine-section'); + assertTrue(!!routineSectionElement); + document.body.appendChild(routineSectionElement); + + return flushTasks(); + } + + test('ElementRenders', () => { + return initializeRoutineSection().then(() => { + // Verify the element rendered. + assertTrue(!!routineSectionElement.$$('#routineSection')); + }); + }); +});
diff --git a/chrome/tools/build/linux/FILES.cfg b/chrome/tools/build/linux/FILES.cfg index 204419e1..54b6b6a 100644 --- a/chrome/tools/build/linux/FILES.cfg +++ b/chrome/tools/build/linux/FILES.cfg
@@ -154,6 +154,20 @@ 'buildtype': ['official'], 'archive': 'remoting-me2me-host-linux.zip', }, + # Remoting symbols: + { + 'filename': 'remote_assistance_host.debug', + 'arch': ['64bit'], + 'buildtype': ['dev', 'official'], + 'archive': 'remoting-debug-info.zip', + }, + { + # Include all debug symbols that start with `remoting`. + 'filename': 'remoting*.debug', + 'arch': ['64bit'], + 'buildtype': ['dev', 'official'], + 'archive': 'remoting-debug-info.zip', + }, # Breakpad symbols: { 'filename': 'chrome.breakpad.x64',
diff --git a/chromeos/components/diagnostics_ui/resources/BUILD.gn b/chromeos/components/diagnostics_ui/resources/BUILD.gn index 8d4784a..9a2f480 100644 --- a/chromeos/components/diagnostics_ui/resources/BUILD.gn +++ b/chromeos/components/diagnostics_ui/resources/BUILD.gn
@@ -28,6 +28,7 @@ ":realtime_cpu_chart", ":routine_result_entry", ":routine_result_list", + ":routine_section", ] } @@ -147,6 +148,12 @@ ] } +js_library("routine_section") { + deps = [ + "//third_party/polymer/v3_0/components-chromium/polymer:polymer_bundled", + ] +} + html_to_js("web_components") { js_files = [ "battery_status_card.js", @@ -162,5 +169,6 @@ "realtime_cpu_chart.js", "routine_result_entry.js", "routine_result_list.js", + "routine_section.js", ] }
diff --git a/chromeos/components/diagnostics_ui/resources/diagnostics_app_resources.grd b/chromeos/components/diagnostics_ui/resources/diagnostics_app_resources.grd index 612ed83..76978d01 100644 --- a/chromeos/components/diagnostics_ui/resources/diagnostics_app_resources.grd +++ b/chromeos/components/diagnostics_ui/resources/diagnostics_app_resources.grd
@@ -33,6 +33,7 @@ <include name="IDR_DIAGNOSTICS_REALTIME_CPU_CHART_JS" file="${root_gen_dir}/chromeos/components/diagnostics_ui/resources/realtime_cpu_chart.js" use_base_dir="false" type="BINDATA"/> <include name="IDR_DIAGNOSTICS_ROUTINE_RESULT_ENTRY_JS" file="${root_gen_dir}/chromeos/components/diagnostics_ui/resources/routine_result_entry.js" use_base_dir="false" type="BINDATA"/> <include name="IDR_DIAGNOSTICS_ROUTINE_RESULT_LIST_JS" file="${root_gen_dir}/chromeos/components/diagnostics_ui/resources/routine_result_list.js" use_base_dir="false" type="BINDATA"/> + <include name="IDR_DIAGNOSTICS_ROUTINE_SECTION_JS" file="${root_gen_dir}/chromeos/components/diagnostics_ui/resources/routine_section.js" use_base_dir="false" type="BINDATA"/> <include name="IDR_DIAGNOSTICS_SHARED_CSS_JS" file="${root_gen_dir}/chromeos/components/diagnostics_ui/resources/diagnostics_shared_css.js" use_base_dir="false" type="BINDDATA"/> <include name="IDR_DIAGNOSTICS_TYPES_JS" file="diagnostics_types.js" type="BINDATA"/> </includes>
diff --git a/chromeos/components/diagnostics_ui/resources/routine_section.html b/chromeos/components/diagnostics_ui/resources/routine_section.html new file mode 100644 index 0000000..4c59ff8 --- /dev/null +++ b/chromeos/components/diagnostics_ui/resources/routine_section.html
@@ -0,0 +1,5 @@ +<style include="diagnostics-shared"> +</style> + +<div id="routineSection"> +</div>
diff --git a/chromeos/components/diagnostics_ui/resources/routine_section.js b/chromeos/components/diagnostics_ui/resources/routine_section.js new file mode 100644 index 0000000..4982c8e --- /dev/null +++ b/chromeos/components/diagnostics_ui/resources/routine_section.js
@@ -0,0 +1,23 @@ +// Copyright 2020 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import './diagnostics_card.js'; +import './diagnostics_shared_css.js'; + +import {html, Polymer} from 'chrome://resources/polymer/v3_0/polymer/polymer_bundled.min.js'; + +/** + * @fileoverview + * 'routine-section' has a button to run tests and displays their results. + */ +Polymer({ + is: 'routine-section', + + _template: html`{__html_template__}`, + + properties: {}, + + /** @override */ + created() {}, +});
diff --git a/chromeos/components/phonehub/notification_access_setup_operation.h b/chromeos/components/phonehub/notification_access_setup_operation.h index d211fff..b55e68f 100644 --- a/chromeos/components/phonehub/notification_access_setup_operation.h +++ b/chromeos/components/phonehub/notification_access_setup_operation.h
@@ -27,26 +27,27 @@ class NotificationAccessSetupOperation { public: // Note: Numerical values should not be changed because they must stay in - // sync with multidevice_notification_access_setup_dialog.js. + // sync with multidevice_notification_access_setup_dialog.js, with the + // exception of NOT_STARTED, which has a value of 0. enum class Status { // Connecting to the phone in order to set up notification access. - kConnecting = 0, + kConnecting = 1, // No connection was able to be made to the phone within the expected time // period. - kTimedOutConnecting = 1, + kTimedOutConnecting = 2, // A connection to the phone was successful, but it unexpectedly became // disconnected before the setup flow could complete. - kConnectionDisconnected = 2, + kConnectionDisconnected = 3, // A connection to the phone has succeeded, and a message has been sent to // the phone to start the notification access opt-in flow. However, the user // has not yet completed the flow phone-side. - kSentMessageToPhoneAndWaitingForResponse = 3, + kSentMessageToPhoneAndWaitingForResponse = 4, // The user has completed the phone-side opt-in flow. - kCompletedSuccessfully = 4, + kCompletedSuccessfully = 5, }; // Returns true if the provided status is the final one for this operation,
diff --git a/chromeos/lacros/lacros_chrome_service_impl.cc b/chromeos/lacros/lacros_chrome_service_impl.cc index 023b37b..2ad5623 100644 --- a/chromeos/lacros/lacros_chrome_service_impl.cc +++ b/chromeos/lacros/lacros_chrome_service_impl.cc
@@ -197,6 +197,12 @@ std::unique_ptr<LacrosChromeServiceDelegate> delegate) : delegate_(std::move(delegate)), sequenced_state_(nullptr, base::OnTaskRunnerDeleter(nullptr)) { + if (g_disable_all_crosapi_for_tests) { + // Tests don't call LacrosChromeService::Init(), so provide LacrosInitParams + // with default values. + init_params_ = crosapi::mojom::LacrosInitParams::New(); + } + // The sequence on which this object was constructed, and thus affine to. scoped_refptr<base::SequencedTaskRunner> affine_sequence = base::SequencedTaskRunnerHandle::Get(); @@ -316,6 +322,7 @@ } } +// static void LacrosChromeServiceImpl::DisableCrosapiForTests() { g_disable_all_crosapi_for_tests = true; }
diff --git a/chromeos/network/network_state.cc b/chromeos/network/network_state.cc index 90a2b97..5aaeae0 100644 --- a/chromeos/network/network_state.cc +++ b/chromeos/network/network_state.cc
@@ -369,18 +369,6 @@ return gurl; } -void NetworkState::SetCaptivePortalProvider(const std::string& id, - const std::string& name) { - if (id.empty()) { - captive_portal_provider_ = nullptr; - return; - } - if (!captive_portal_provider_) - captive_portal_provider_ = std::make_unique<CaptivePortalProviderInfo>(); - captive_portal_provider_->id = id; - captive_portal_provider_->name = name; -} - std::string NetworkState::GetVpnProviderType() const { return vpn_provider_ ? vpn_provider_->type : std::string(); }
diff --git a/chromeos/network/network_state.h b/chromeos/network/network_state.h index e096dd0..9a6ef7e 100644 --- a/chromeos/network/network_state.h +++ b/chromeos/network/network_state.h
@@ -40,13 +40,6 @@ explicit NetworkState(const std::string& path); ~NetworkState() override; - struct CaptivePortalProviderInfo { - // The id used by chrome to identify the provider (i.e. an extension id). - std::string id; - // The display name for the captive portal provider (i.e. extension name). - std::string name; - }; - struct VpnProviderInfo { // The id used by chrome to identify the provider (i.e. an extension id). std::string id; @@ -110,10 +103,6 @@ bool connectable() const { return connectable_; } void set_connectable(bool connectable) { connectable_ = connectable; } bool is_captive_portal() const { return is_captive_portal_; } - const CaptivePortalProviderInfo* captive_portal_provider() const { - return captive_portal_provider_.get(); - } - void SetCaptivePortalProvider(const std::string& id, const std::string& name); int signal_strength() const { return signal_strength_; } void set_signal_strength(int signal_strength) { signal_strength_ = signal_strength; @@ -306,7 +295,6 @@ // Wireless properties, used for icons and Connect logic. bool connectable_ = false; bool is_captive_portal_ = false; - std::unique_ptr<CaptivePortalProviderInfo> captive_portal_provider_; int signal_strength_ = 0; std::string bssid_; int frequency_ = 0;
diff --git a/chromeos/network/network_state_handler.cc b/chromeos/network/network_state_handler.cc index 88d6b16b62..03da5c95 100644 --- a/chromeos/network/network_state_handler.cc +++ b/chromeos/network/network_state_handler.cc
@@ -1111,38 +1111,6 @@ shill_property_handler_->SetCheckPortalList(check_portal_list); } -void NetworkStateHandler::SetCaptivePortalProviderForHexSsid( - const std::string& hex_ssid, - const std::string& provider_id, - const std::string& provider_name) { - NET_LOG(EVENT) << "SetCaptivePortalProviderForHexSsid: " << hex_ssid - << " -> (" << provider_id << ", " << provider_name << ")"; - // NetworkState hex SSIDs are always uppercase. - std::string hex_ssid_uc = hex_ssid; - transform(hex_ssid_uc.begin(), hex_ssid_uc.end(), hex_ssid_uc.begin(), - toupper); - if (provider_id.empty()) { - hex_ssid_to_captive_portal_provider_map_.erase(hex_ssid_uc); - } else { - NetworkState::CaptivePortalProviderInfo provider_info; - provider_info.id = provider_id; - provider_info.name = provider_name; - hex_ssid_to_captive_portal_provider_map_[hex_ssid_uc] = - std::move(provider_info); - } - // When a new entry is added or removed from the map, check all networks - // for a matching hex SSID and update the provider info. (This should occur - // infrequently). New networks will be updated when added. - for (auto& managed : network_list_) { - NetworkState* network = managed->AsNetworkState(); - if (network->GetHexSsid() == hex_ssid_uc) { - NET_LOG(EVENT) << "Setting captive portal provider for network: " - << NetworkId(network) << " = " << provider_id; - network->SetCaptivePortalProvider(provider_id, provider_name); - } - } -} - void NetworkStateHandler::SetWakeOnLanEnabled(bool enabled) { NET_LOG(EVENT) << "SetWakeOnLanEnabled: " << enabled; shill_property_handler_->SetWakeOnLanEnabled(enabled); @@ -1372,7 +1340,6 @@ network_property_updated |= network->InitialPropertiesReceived(properties); UpdateGuid(network); - UpdateCaptivePortalProvider(network); if (network->Matches(NetworkTypePattern::Cellular())) UpdateCellularStateFromDevice(network); @@ -1797,19 +1764,6 @@ network->SetGuid(guid); } -void NetworkStateHandler::UpdateCaptivePortalProvider(NetworkState* network) { - auto portal_iter = - hex_ssid_to_captive_portal_provider_map_.find(network->GetHexSsid()); - if (portal_iter == hex_ssid_to_captive_portal_provider_map_.end()) { - network->SetCaptivePortalProvider("", ""); - return; - } - NET_LOG(EVENT) << "Setting captive portal provider for network: " - << NetworkId(network) << " = " << portal_iter->second.id; - network->SetCaptivePortalProvider(portal_iter->second.id, - portal_iter->second.name); -} - void NetworkStateHandler::UpdateCellularStateFromDevice(NetworkState* network) { const DeviceState* device = GetDeviceState(network->device_path()); if (!device)
diff --git a/chromeos/network/network_state_handler.h b/chromeos/network/network_state_handler.h index e820332..d86e394 100644 --- a/chromeos/network/network_state_handler.h +++ b/chromeos/network/network_state_handler.h
@@ -340,12 +340,6 @@ // Sets the list of devices on which portal check is enabled. void SetCheckPortalList(const std::string& check_portal_list); - // Sets a provider id (e.g. extension id) for a hex encoded SSID. If - // |provider_id| is empty the entry will be erased. - void SetCaptivePortalProviderForHexSsid(const std::string& hex_ssid, - const std::string& provider_id, - const std::string& provider_name); - // Sets the Manager.WakeOnLan property. Note: we do not track this state, we // only set it. void SetWakeOnLanEnabled(bool enabled); @@ -514,10 +508,6 @@ // Ensure a valid GUID for NetworkState. void UpdateGuid(NetworkState* network); - // Look for a matching captive portal provider in - // |hex_ssid_to_captive_portal_provider_map_|. - void UpdateCaptivePortalProvider(NetworkState* network); - // Update networkState properties from the associated DeviceState. void UpdateCellularStateFromDevice(NetworkState* network); @@ -678,11 +668,6 @@ // NetworkState that is not saved in a profile. SpecifierGuidMap specifier_guid_map_; - // Map of hex SSIDs to captive portal provider info. - // Used to set NetworkState::captive_portal_provider_. - std::map<std::string, NetworkState::CaptivePortalProviderInfo> - hex_ssid_to_captive_portal_provider_map_; - // The state corresponding to the Tether device type. This value is managed by // the Tether component. TechnologyState tether_technology_state_ =
diff --git a/chromeos/network/network_state_handler_unittest.cc b/chromeos/network/network_state_handler_unittest.cc index f244157..62e2af9 100644 --- a/chromeos/network/network_state_handler_unittest.cc +++ b/chromeos/network/network_state_handler_unittest.cc
@@ -2062,48 +2062,6 @@ EXPECT_EQ(0u, cellular_networks.size()); } -TEST_F(NetworkStateHandlerTest, UpdateCaptivePortalProvider) { - constexpr char kProviderId[] = "TestProviderId"; - constexpr char kProviderName[] = "TestProviderName"; - - // Verify initial state. - const NetworkState* wifi1 = network_state_handler_->GetNetworkState( - kShillManagerClientStubDefaultWifi); - ASSERT_TRUE(wifi1); - const NetworkState::CaptivePortalProviderInfo* info = - wifi1->captive_portal_provider(); - EXPECT_EQ(nullptr, info); - - // Verify that setting a captive portal provider applies to existing networks. - std::string hex_ssid = wifi1->GetHexSsid(); - ASSERT_FALSE(hex_ssid.empty()); - network_state_handler_->SetCaptivePortalProviderForHexSsid( - hex_ssid, kProviderId, kProviderName); - base::RunLoop().RunUntilIdle(); - - info = wifi1->captive_portal_provider(); - ASSERT_NE(nullptr, info); - EXPECT_EQ(kProviderId, info->id); - EXPECT_EQ(kProviderName, info->name); - - // Verify that adding a new network sets its captive portal provider. - constexpr char kNewSsid[] = "new_wifi"; - std::string new_hex_ssid = base::HexEncode(kNewSsid, strlen(kNewSsid)); - network_state_handler_->SetCaptivePortalProviderForHexSsid( - new_hex_ssid, kProviderId, kProviderName); - AddService("/service/new_wifi", "new_wifi_guid", kNewSsid, shill::kTypeWifi, - shill::kStateOnline); - base::RunLoop().RunUntilIdle(); - - const NetworkState* new_wifi = - network_state_handler_->GetNetworkState("/service/new_wifi"); - ASSERT_TRUE(new_wifi); - info = new_wifi->captive_portal_provider(); - ASSERT_NE(nullptr, info); - EXPECT_EQ(kProviderId, info->id); - EXPECT_EQ(kProviderName, info->name); -} - TEST_F(NetworkStateHandlerTest, BlockedByPolicyBlocked) { NetworkState* wifi1 = network_state_handler_->GetModifiableNetworkState( kShillManagerClientStubDefaultWifi);
diff --git a/chromeos/profiles/airmont.afdo.newest.txt b/chromeos/profiles/airmont.afdo.newest.txt index 7100799..26353ef 100644 --- a/chromeos/profiles/airmont.afdo.newest.txt +++ b/chromeos/profiles/airmont.afdo.newest.txt
@@ -1 +1 @@ -chromeos-chrome-amd64-airmont-87-4265.0-1601895675-benchmark-87.0.4280.14-r1-redacted.afdo.xz +chromeos-chrome-amd64-airmont-87-4265.0-1601895675-benchmark-88.0.4285.0-r1-redacted.afdo.xz
diff --git a/chromeos/profiles/broadwell.afdo.newest.txt b/chromeos/profiles/broadwell.afdo.newest.txt index 1d3db2b..59f044d 100644 --- a/chromeos/profiles/broadwell.afdo.newest.txt +++ b/chromeos/profiles/broadwell.afdo.newest.txt
@@ -1 +1 @@ -chromeos-chrome-amd64-broadwell-87-4265.0-1601892862-benchmark-87.0.4280.14-r1-redacted.afdo.xz +chromeos-chrome-amd64-broadwell-87-4265.0-1601892862-benchmark-88.0.4285.0-r1-redacted.afdo.xz
diff --git a/chromeos/profiles/silvermont.afdo.newest.txt b/chromeos/profiles/silvermont.afdo.newest.txt index a40a982..d6ca71d 100644 --- a/chromeos/profiles/silvermont.afdo.newest.txt +++ b/chromeos/profiles/silvermont.afdo.newest.txt
@@ -1 +1 @@ -chromeos-chrome-amd64-silvermont-87-4265.0-1601890590-benchmark-87.0.4280.14-r1-redacted.afdo.xz +chromeos-chrome-amd64-silvermont-87-4265.0-1601890590-benchmark-88.0.4285.0-r1-redacted.afdo.xz
diff --git a/chromeos/services/network_config/cros_network_config.cc b/chromeos/services/network_config/cros_network_config.cc index 0e7849f8..f62e250 100644 --- a/chromeos/services/network_config/cros_network_config.cc +++ b/chromeos/services/network_config/cros_network_config.cc
@@ -320,15 +320,6 @@ network)) : mojom::ProxyMode::kDirect; - const NetworkState::CaptivePortalProviderInfo* captive_portal_provider = - network->captive_portal_provider(); - if (captive_portal_provider) { - auto mojo_captive_portal_provider = mojom::CaptivePortalProvider::New(); - mojo_captive_portal_provider->id = captive_portal_provider->id; - mojo_captive_portal_provider->name = captive_portal_provider->name; - result->captive_portal_provider = std::move(mojo_captive_portal_provider); - } - switch (type) { case mojom::NetworkType::kCellular: { auto cellular = mojom::CellularStateProperties::New();
diff --git a/chromeos/services/network_config/public/mojom/cros_network_config.mojom b/chromeos/services/network_config/public/mojom/cros_network_config.mojom index 593bb9c7..ea380bdb 100644 --- a/chromeos/services/network_config/public/mojom/cros_network_config.mojom +++ b/chromeos/services/network_config/public/mojom/cros_network_config.mojom
@@ -104,13 +104,6 @@ kUserCert, }; -struct CaptivePortalProvider { - // Id used to identify the captive portal provider (i.e. an extension id). - string id; - // Display name for the captive portal provider (i.e. extension name). - string name; -}; - // The SIM card lock status for Cellular networks. struct SIMLockStatus { // The status of SIM lock. Possible values are 'sim-pin', 'sim-puk' or empty. @@ -182,7 +175,6 @@ }; struct NetworkStateProperties { - CaptivePortalProvider? captive_portal_provider; // True if the network is configured and may be connectable. bool connectable = false; // True if an explicit connect was requested. The network state may not be
diff --git a/components/autofill/android/provider/java/src/org/chromium/components/autofill/AutofillProvider.java b/components/autofill/android/provider/java/src/org/chromium/components/autofill/AutofillProvider.java index 3b7c63a..1546b3d 100644 --- a/components/autofill/android/provider/java/src/org/chromium/components/autofill/AutofillProvider.java +++ b/components/autofill/android/provider/java/src/org/chromium/components/autofill/AutofillProvider.java
@@ -262,6 +262,7 @@ private long mAutofillTriggeredTimeMillis; private Context mContext; private AutofillPopup mDatalistPopup; + private AutofillSuggestion[] mDatalistSuggestions; private WebContentsAccessibility mWebContentsAccessibility; private View mAnchorView; @@ -533,6 +534,7 @@ if (mDatalistPopup != null) { mDatalistPopup.dismiss(); mDatalistPopup = null; + mDatalistSuggestions = null; } if (mWebContentsAccessibility != null) { mWebContentsAccessibility.onAutofillPopupDismissed(); @@ -600,9 +602,9 @@ */ private void showDatalistPopup( String[] datalistValues, String[] datalistLabels, RectF bounds, boolean isRtl) { - final AutofillSuggestion[] suggestions = new AutofillSuggestion[datalistValues.length]; - for (int i = 0; i < suggestions.length; i++) { - suggestions[i] = new AutofillSuggestion(datalistValues[i], datalistLabels[i], + mDatalistSuggestions = new AutofillSuggestion[datalistValues.length]; + for (int i = 0; i < mDatalistSuggestions.length; i++) { + mDatalistSuggestions[i] = new AutofillSuggestion(datalistValues[i], datalistLabels[i], /* itemTag= */ "", DropdownItem.NO_ICON, false /* isIconAtLeft */, i, false /* isDeletable */, false /* isMultilineLabel */, false /* isBoldLabel */); } @@ -623,7 +625,7 @@ @Override public void suggestionSelected(int listIndex) { - onSuggestionSelected(suggestions[listIndex].getLabel()); + onSuggestionSelected(mDatalistSuggestions[listIndex].getLabel()); } @Override @@ -641,7 +643,7 @@ return; } } - mDatalistPopup.filterAndShow(suggestions, isRtl, false); + mDatalistPopup.filterAndShow(mDatalistSuggestions, isRtl, false); if (mWebContentsAccessibility != null) { mWebContentsAccessibility.onAutofillPopupDisplayed(mDatalistPopup.getListView()); }
diff --git a/components/cronet/native/runnables_unittest.cc b/components/cronet/native/runnables_unittest.cc index 6455e12..ed1732a 100644 --- a/components/cronet/native/runnables_unittest.cc +++ b/components/cronet/native/runnables_unittest.cc
@@ -60,7 +60,7 @@ void Run() override { Cronet_UrlRequestCallback_OnRedirectReceived( - callback_, /* request = */ nullptr, /* response_info = */ nullptr, + callback_, /* request = */ nullptr, /* info = */ nullptr, new_location_url_.c_str()); } @@ -160,7 +160,7 @@ // Invoke Cronet_UrlRequestCallback_OnResponseStarted using OnceClosure Cronet_RunnablePtr runnable = new cronet::OnceClosureRunnable( base::BindOnce(Cronet_UrlRequestCallback_OnResponseStarted, callback, - /* request = */ nullptr, /* response_info = */ nullptr)); + /* request = */ nullptr, /* info = */ nullptr)); Cronet_UrlRequestCallback_SetClientContext(callback, this); Cronet_Executor_Execute(executor, runnable); base::RunLoop().RunUntilIdle(); @@ -189,7 +189,7 @@ Cronet_RunnablePtr runnable = new cronet::OnceClosureRunnable(base::BindOnce( RunnablesTest::UrlRequestCallback_OnReadCompleted, callback, /* request = */ nullptr, - /* response_info = */ nullptr, buffer, /* bytes_read = */ 0)); + /* info = */ nullptr, buffer, /* bytes_read = */ 0)); Cronet_UrlRequestCallback_SetClientContext(callback, this); Cronet_Executor_Execute(executor, runnable); base::RunLoop().RunUntilIdle();
diff --git a/components/feed/core/v2/feed_store.cc b/components/feed/core/v2/feed_store.cc index bb0add4..ef5a8e4 100644 --- a/components/feed/core/v2/feed_store.cc +++ b/components/feed/core/v2/feed_store.cc
@@ -501,7 +501,7 @@ database_->UpdateEntries( /*entries_to_save=*/std::make_unique< std::vector<std::pair<std::string, feedstore::Record>>>(), - /*key_to_remove=*/std::move(keys), std::move(callback)); + /*keys_to_remove=*/std::move(keys), std::move(callback)); } void FeedStore::Write(std::vector<feedstore::Record> records,
diff --git a/components/net_log/chrome_net_log.cc b/components/net_log/chrome_net_log.cc index 5a902747..b0cdd069 100644 --- a/components/net_log/chrome_net_log.cc +++ b/components/net_log/chrome_net_log.cc
@@ -4,27 +4,16 @@ #include "components/net_log/chrome_net_log.h" +#include <utility> + #include "base/command_line.h" #include "base/strings/stringprintf.h" #include "base/system/sys_info.h" #include "base/values.h" #include "components/version_info/version_info.h" -#include "net/log/net_log_util.h" namespace net_log { -base::Value GetConstantsForNetLog( - const base::CommandLine::StringType& command_line_string, - const std::string& channel_string) { - base::Value constants_dict = net::GetNetConstants(); - - auto platform_dict = - GetPlatformConstantsForNetLog(command_line_string, channel_string); - if (platform_dict) - constants_dict.MergeDictionary(platform_dict.get()); - return constants_dict; -} - std::unique_ptr<base::DictionaryValue> GetPlatformConstantsForNetLog( const base::CommandLine::StringType& command_line_string, const std::string& channel_string) {
diff --git a/components/net_log/chrome_net_log.h b/components/net_log/chrome_net_log.h index 5b5a93eea..cb5a56e 100644 --- a/components/net_log/chrome_net_log.h +++ b/components/net_log/chrome_net_log.h
@@ -13,23 +13,11 @@ namespace base { class DictionaryValue; -class Value; } namespace net_log { -// Returns all the constants to include in NetLog files. This includes both -// platform-specific details (GetPlatformConstantsForNetLog()) as well as the -// basic src/net constants (net::GetNetConstants()) for things like symbolic -// names of error codes. -// -// Safe to call on any thread. -base::Value GetConstantsForNetLog( - const base::CommandLine::StringType& command_line_string, - const std::string& channel_string); - -// Returns constants to include in NetLog files for debugging purposes, which -// includes information such as: +// Returns constants to include in NetLog files including information such as: // // * The version and build of Chrome // * The command line arguments Chrome was launched with
diff --git a/components/page_load_metrics/browser/observers/use_counter/ukm_features.cc b/components/page_load_metrics/browser/observers/use_counter/ukm_features.cc index 3e6b31c5..a1f7cf9d 100644 --- a/components/page_load_metrics/browser/observers/use_counter/ukm_features.cc +++ b/components/page_load_metrics/browser/observers/use_counter/ukm_features.cc
@@ -47,11 +47,8 @@ WebFeature::kPaymentHandler, WebFeature::kPaymentRequestShowWithoutGesture, WebFeature::kHTMLImports, - WebFeature::kHTMLImportsOnReverseOriginTrials, WebFeature::kElementCreateShadowRoot, - WebFeature::kElementCreateShadowRootOnReverseOriginTrials, WebFeature::kDocumentRegisterElement, - WebFeature::kDocumentRegisterElementOnReverseOriginTrials, WebFeature::kCredentialManagerCreatePublicKeyCredential, WebFeature::kCredentialManagerGetPublicKeyCredential, WebFeature::kCredentialManagerMakePublicKeyCredentialSuccess,
diff --git a/components/paint_preview/player/android/java/src/org/chromium/components/paintpreview/player/PlayerCompositorDelegate.java b/components/paint_preview/player/android/java/src/org/chromium/components/paintpreview/player/PlayerCompositorDelegate.java index fe73924..c43113a 100644 --- a/components/paint_preview/player/android/java/src/org/chromium/components/paintpreview/player/PlayerCompositorDelegate.java +++ b/components/paint_preview/player/android/java/src/org/chromium/components/paintpreview/player/PlayerCompositorDelegate.java
@@ -7,8 +7,11 @@ import android.graphics.Bitmap; import android.graphics.Rect; +import androidx.annotation.NonNull; + import org.chromium.base.Callback; import org.chromium.base.UnguessableToken; +import org.chromium.components.paintpreview.browser.NativePaintPreviewServiceProvider; import org.chromium.url.GURL; /** @@ -16,6 +19,49 @@ * click events. */ public interface PlayerCompositorDelegate { + /** An interface that creates an instance of {@link PlayerCompositorDelegate}. */ + interface Factory { + PlayerCompositorDelegate create(NativePaintPreviewServiceProvider service, GURL url, + String directoryKey, @NonNull CompositorListener compositorListener, + Callback<Integer> compositorErrorCallback); + } + + /** Contains a callback for communication from native. */ + interface CompositorListener { + /** + * Called when the Paint Preview compositor is ready. + * + * @param rootFrameGuid The GUID for the root frame. + * @param frameGuids Contains all frame GUIDs that are in this hierarchy. + * @param frameContentSize Contains the content size for each frame. In native, this is + * called + * scroll extent. The order corresponds to {@code frameGuids}. The content width and height + * for the ith frame in {@code frameGuids} are respectively in the {@code 2*i} and {@code + * 2*i+1} indices of {@code frameContentSize}. + * @param scrollOffsets Contains the initial scroll offsets for each frame. The order + * corresponds to {@code frameGuids}. The offset in x and y for the ith frame in + * {@code frameGuids} are respectively in the {@code 2*i} and {@code 2*i+1} indices of + * {@code scrollOffsets}. + * @param subFramesCount Contains the number of sub-frames for each frame. The order + * corresponds + * to {@code frameGuids}. The number of sub-frames for the {@code i}th frame in {@code + * frameGuids} is {@code subFramesCount[i]}. + * @param subFrameGuids Contains the GUIDs of all sub-frames. The GUID for the {@code j}th + * sub-frame of {@code frameGuids[i]} will be at {@code subFrameGuids[k]}, where {@code k} + * is: <pre> int k = j; for (int s = 0; s < i; s++) k += subFramesCount[s]; + * </pre> + * @param subFrameClipRects Contains clip rect values for each sub-frame. Each clip rect + * value + * comes in a series of four consecutive integers that represent x, y, width, and height. + * The clip rect values for the {@code j}th sub-frame of {@code frameGuids[i]} will be at + * {@code subFrameGuids[4*k]}, {@code subFrameGuids[4*k+1]} , {@code subFrameGuids[4*k+2]}, + * and {@code subFrameGuids[4*k+3]}, where {@code k} has the same value as above. + */ + void onCompositorReady(UnguessableToken rootFrameGuid, UnguessableToken[] frameGuids, + int[] frameContentSize, int[] scrollOffsets, int[] subFramesCount, + UnguessableToken[] subFrameGuids, int[] subFrameClipRects); + } + /** * Requests a new bitmap for a frame from the Paint Preview compositor. * @param frameGuid The GUID of the frame. @@ -42,4 +88,9 @@ * @param compressOnClose Whether to compress the directory when closing. */ default void setCompressOnClose(boolean compressOnClose) {} + + /** + * Called when PlayerCompositorDelegate needs to be destroyed. + */ + default void destroy() {} }
diff --git a/components/paint_preview/player/android/java/src/org/chromium/components/paintpreview/player/PlayerCompositorDelegateImpl.java b/components/paint_preview/player/android/java/src/org/chromium/components/paintpreview/player/PlayerCompositorDelegateImpl.java index d9a5647..1dcb072 100644 --- a/components/paint_preview/player/android/java/src/org/chromium/components/paintpreview/player/PlayerCompositorDelegateImpl.java +++ b/components/paint_preview/player/android/java/src/org/chromium/components/paintpreview/player/PlayerCompositorDelegateImpl.java
@@ -24,14 +24,7 @@ */ @JNINamespace("paint_preview") class PlayerCompositorDelegateImpl implements PlayerCompositorDelegate { - interface CompositorListener { - void onCompositorReady(UnguessableToken rootFrameGuid, UnguessableToken[] frameGuids, - int[] frameContentSize, int[] scrollOffsets, int[] subFramesCount, - UnguessableToken[] subFrameGuids, int[] subFrameClipRects); - } - private CompositorListener mCompositorListener; - private LinkClickHandler mLinkClickHandler; private long mNativePlayerCompositorDelegate; PlayerCompositorDelegateImpl(NativePaintPreviewServiceProvider service, GURL url, @@ -47,34 +40,6 @@ // mNativePlayerCompositorDelegate == 0. } - /** - * Called by native when the Paint Preview compositor is ready. - * - * @param rootFrameGuid The GUID for the root frame. - * @param frameGuids Contains all frame GUIDs that are in this hierarchy. - * @param frameContentSize Contains the content size for each frame. In native, this is called - * scroll extent. The order corresponds to {@code frameGuids}. The content width and height for - * the ith frame in {@code frameGuids} are respectively in the {@code 2*i} and {@code 2*i+1} - * indices of {@code frameContentSize}. - * @param scrollOffsets Contains the initial scroll offsets for each frame. The order - * corresponds to {@code frameGuids}. The offset in x and y for the ith frame in - * {@code frameGuids} are respectively in the {@code 2*i} and {@code 2*i+1} indices of - * {@code scrollOffsets}. - * @param subFramesCount Contains the number of sub-frames for each frame. The order corresponds - * to {@code frameGuids}. The number of sub-frames for the {@code i}th frame in {@code - * frameGuids} is {@code subFramesCount[i]}. - * @param subFrameGuids Contains the GUIDs of all sub-frames. The GUID for the {@code j}th - * sub-frame of {@code frameGuids[i]} will be at {@code subFrameGuids[k]}, where {@code k} is: - * <pre> - * int k = j; - * for (int s = 0; s < i; s++) k += subFramesCount[s]; - * </pre> - * @param subFrameClipRects Contains clip rect values for each sub-frame. Each clip rect value - * comes in a series of four consecutive integers that represent x, y, width, and height. The - * clip rect values for the {@code j}th sub-frame of {@code frameGuids[i]} will be at {@code - * subFrameGuids[4*k]}, {@code subFrameGuids[4*k+1]} , {@code subFrameGuids[4*k+2]}, and {@code - * subFrameGuids[4*k+3]}, where {@code k} has the same value as above. - */ @CalledByNative void onCompositorReady(UnguessableToken rootFrameGuid, UnguessableToken[] frameGuids, int[] frameContentSize, int[] scrollOffsets, int[] subFramesCount, @@ -118,7 +83,8 @@ mNativePlayerCompositorDelegate, compressOnClose); } - void destroy() { + @Override + public void destroy() { if (mNativePlayerCompositorDelegate == 0) { return; }
diff --git a/components/paint_preview/player/android/java/src/org/chromium/components/paintpreview/player/PlayerGestureListener.java b/components/paint_preview/player/android/java/src/org/chromium/components/paintpreview/player/PlayerGestureListener.java index 50aa36f..434dda1 100644 --- a/components/paint_preview/player/android/java/src/org/chromium/components/paintpreview/player/PlayerGestureListener.java +++ b/components/paint_preview/player/android/java/src/org/chromium/components/paintpreview/player/PlayerGestureListener.java
@@ -15,10 +15,13 @@ private LinkClickHandler mLinkClickHandler; private PlayerUserFrustrationDetector mUserFrustrationDetector; - public PlayerGestureListener( - LinkClickHandler linkClickHandler, Runnable userInteractionCallback) { + public PlayerGestureListener(LinkClickHandler linkClickHandler, + Runnable userInteractionCallback, Runnable userFrustrationCallback) { mLinkClickHandler = linkClickHandler; mUserInteractionCallback = userInteractionCallback; + if (userFrustrationCallback == null) return; + + mUserFrustrationDetector = new PlayerUserFrustrationDetector(userFrustrationCallback); } /** @@ -56,8 +59,4 @@ if (mUserInteractionCallback != null) mUserInteractionCallback.run(); if (didFinish) PlayerUserActionRecorder.recordZoom(); } - - public void setUserFrustrationDetector(PlayerUserFrustrationDetector userFrustrationDetector) { - mUserFrustrationDetector = userFrustrationDetector; - } }
diff --git a/components/paint_preview/player/android/java/src/org/chromium/components/paintpreview/player/PlayerManager.java b/components/paint_preview/player/android/java/src/org/chromium/components/paintpreview/player/PlayerManager.java index 71358f2e..79adcb3 100644 --- a/components/paint_preview/player/android/java/src/org/chromium/components/paintpreview/player/PlayerManager.java +++ b/components/paint_preview/player/android/java/src/org/chromium/components/paintpreview/player/PlayerManager.java
@@ -13,10 +13,8 @@ import android.widget.FrameLayout; import androidx.annotation.NonNull; -import androidx.annotation.Nullable; import androidx.annotation.VisibleForTesting; -import org.chromium.base.Callback; import org.chromium.base.TraceEvent; import org.chromium.base.UnguessableToken; import org.chromium.components.paintpreview.browser.NativePaintPreviewServiceProvider; @@ -31,66 +29,92 @@ * the outer world. Users should call {@link #destroy()} to ensure the native part is destroyed. */ public class PlayerManager { + /** + * Users of the {@link PlayerManager} class have to implement and pass this interface in the + * constructor. + */ + public interface Listener { + /** + * Called when the compositor cannot be successfully initialized. + */ + void onCompositorError(@CompositorStatus int status); + + /** + * Called when the view is ready. Will not be called if onCompositorError is called prior to + * the view being ready. + */ + void onViewReady(); + + /** + * Called when the first paint event happens. + */ + void onFirstPaint(); + + /** + * Called when the use interacts with the paint preview. + */ + void onUserInteraction(); + + /** + * Called when a frustrated behavior is detected. + */ + void onUserFrustration(); + + /** + * Called when the a pull to refresh gesture is performed. + */ + void onPullToRefresh(); + + /** + * Called with a url to trigger a navigation. + */ + void onLinkClick(GURL url); + } + + private static PlayerCompositorDelegate.Factory sCompositorDelegateFactoryForTesting; + private Context mContext; - private PlayerCompositorDelegateImpl mDelegate; + private PlayerCompositorDelegate mDelegate; private PlayerFrameCoordinator mRootFrameCoordinator; private FrameLayout mHostView; - private Runnable mViewReadyCallback; - private Runnable mFirstPaintListener; private static final String sInitEvent = "paint_preview PlayerManager init"; private PlayerSwipeRefreshHandler mPlayerSwipeRefreshHandler; private PlayerGestureListener mPlayerGestureListener; private boolean mIgnoreInitialScrollOffset; + private Listener mListener; /** * Creates a new {@link PlayerManager}. - * @param url The url for the stored content that should be shown. - * @param context An instance of current Android {@link Context}. + * + * @param url The url for the stored content that should be + * shown. + * @param context An instance of current Android {@link Context}. * @param nativePaintPreviewServiceProvider The native paint preview service. - * @param directoryKey The key for the directory storing the data. - * @param linkClickHandler Called with a url to trigger a navigation. - * @param refreshCallback Called when the paint preview should be refreshed. - * @param viewReadyCallback Called when the view is ready. Will not be called if compositorError - * is called prior to the view being ready. - * @param firstPaintListener Called when the first paint event happens. - * @param userInteractionCallback Called when the use interacts with the paint preview. - * @param backgroundColor The color used for the background. - * @param compositorErrorCallback Called when the compositor has had an error (either during - * initialization or due to a disconnect). - * @param ignoreInitialScrollOffset If true the initial scroll state that is recorded at capture - * time is ignored. + * @param directoryKey The key for the directory storing the data. + * @param listener Interface that includes a number of callbacks. + * @param ignoreInitialScrollOffset If true the initial scroll state that is recorded at + * capture time is ignored. */ public PlayerManager(GURL url, Context context, NativePaintPreviewServiceProvider nativePaintPreviewServiceProvider, - String directoryKey, @NonNull LinkClickHandler linkClickHandler, - @Nullable Runnable refreshCallback, Runnable viewReadyCallback, - @Nullable Runnable firstPaintListener, Runnable userInteractionCallback, - int backgroundColor, Callback<Integer> compositorErrorCallback, + String directoryKey, @NonNull Listener listener, int backgroundColor, boolean ignoreInitialScrollOffset) { TraceEvent.startAsync(sInitEvent, hashCode()); mContext = context; - mDelegate = new PlayerCompositorDelegateImpl(nativePaintPreviewServiceProvider, url, - directoryKey, this::onCompositorReady, compositorErrorCallback); + mListener = listener; + mDelegate = getCompositorDelegateFactory().create(nativePaintPreviewServiceProvider, url, + directoryKey, this::onCompositorReady, mListener::onCompositorError); mHostView = new FrameLayout(mContext); - if (refreshCallback != null) { - mPlayerSwipeRefreshHandler = new PlayerSwipeRefreshHandler(mContext, refreshCallback); - } - mPlayerGestureListener = - new PlayerGestureListener(linkClickHandler, userInteractionCallback); + mPlayerSwipeRefreshHandler = + new PlayerSwipeRefreshHandler(mContext, mListener::onPullToRefresh); + mPlayerGestureListener = new PlayerGestureListener( + mListener::onLinkClick, mListener::onUserInteraction, mListener::onUserFrustration); mHostView.setLayoutParams( new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT)); mHostView.setBackgroundColor(backgroundColor); - mViewReadyCallback = viewReadyCallback; - mFirstPaintListener = firstPaintListener; mIgnoreInitialScrollOffset = ignoreInitialScrollOffset; } - public void setUserFrustrationCallback(Runnable userFrustrationCallback) { - PlayerUserFrustrationDetector userFrustrationDetector = - new PlayerUserFrustrationDetector(userFrustrationCallback); - mPlayerGestureListener.setUserFrustrationDetector(userFrustrationDetector); - } - public void setAcceptUserInput(boolean acceptUserInput) { if (mRootFrameCoordinator == null) return; @@ -98,8 +122,7 @@ } /** - * @return Current scroll position of the main frame. null if the player is not - * initialized. + * @return Current scroll position of the main frame. null if the player is not initialized. */ public Point getScrollPosition() { if (mRootFrameCoordinator == null) return null; @@ -122,7 +145,7 @@ mRootFrameCoordinator = new PlayerFrameCoordinator(mContext, mDelegate, rootFrame.getGuid(), rootFrame.getContentWidth(), rootFrame.getContentHeight(), rootFrame.getInitialScrollX(), rootFrame.getInitialScrollY(), true, - mPlayerSwipeRefreshHandler, mPlayerGestureListener, mFirstPaintListener); + mPlayerSwipeRefreshHandler, mPlayerGestureListener, mListener::onFirstPaint); buildSubFrameCoordinators(mRootFrameCoordinator, rootFrame); mHostView.addView(mRootFrameCoordinator.getView(), new FrameLayout.LayoutParams( @@ -131,7 +154,7 @@ mHostView.addView(mPlayerSwipeRefreshHandler.getView()); } TraceEvent.finishAsync(sInitEvent, hashCode()); - mViewReadyCallback.run(); + mListener.onViewReady(); } /** @@ -214,8 +237,19 @@ return mHostView; } + private PlayerCompositorDelegate.Factory getCompositorDelegateFactory() { + return (sCompositorDelegateFactoryForTesting != null) ? sCompositorDelegateFactoryForTesting + : PlayerCompositorDelegateImpl::new; + } + @VisibleForTesting public boolean checkRequiredBitmapsLoadedForTest() { return mRootFrameCoordinator.checkRequiredBitmapsLoadedForTest(); } + + @VisibleForTesting + public static void overrideCompositorDelegateFactoryForTesting( + PlayerCompositorDelegate.Factory factory) { + sCompositorDelegateFactoryForTesting = factory; + } }
diff --git a/components/paint_preview/player/android/java/src/org/chromium/components/paintpreview/player/frame/CompressibleBitmap.java b/components/paint_preview/player/android/java/src/org/chromium/components/paintpreview/player/frame/CompressibleBitmap.java index 38dad36d..57c195d 100644 --- a/components/paint_preview/player/android/java/src/org/chromium/components/paintpreview/player/frame/CompressibleBitmap.java +++ b/components/paint_preview/player/android/java/src/org/chromium/components/paintpreview/player/frame/CompressibleBitmap.java
@@ -8,7 +8,6 @@ import android.graphics.BitmapFactory; import org.chromium.base.Callback; -import org.chromium.base.ThreadUtils; import org.chromium.base.task.SequencedTaskRunner; import java.io.ByteArrayOutputStream; @@ -27,7 +26,6 @@ private byte[] mCompressedData; private SequencedTaskRunner mTaskRunner; private AtomicBoolean mInUse = new AtomicBoolean(); - private ThreadUtils.ThreadChecker mThreadChecker; /** * Creates a new compressible bitmap which starts to compress immediately. @@ -39,7 +37,6 @@ CompressibleBitmap(Bitmap bitmap, SequencedTaskRunner taskRunner, boolean visible) { mBitmap = bitmap; mTaskRunner = taskRunner; - mTaskRunner.postTask(() -> { mThreadChecker = new ThreadUtils.ThreadChecker(); }); compressInBackground(visible); } @@ -95,7 +92,6 @@ } private boolean inflate() { - mThreadChecker.assertOnValidThread(); if (mBitmap != null) return true; if (mCompressedData == null) return false; @@ -105,7 +101,6 @@ } private void compress() { - mThreadChecker.assertOnValidThread(); if (mBitmap == null) return; ByteArrayOutputStream byteArrayStream = new ByteArrayOutputStream(); @@ -125,7 +120,6 @@ } private void discardBitmapInternal() { - mThreadChecker.assertOnValidThread(); if (!lock()) { mTaskRunner.postDelayedTask(this::discardBitmapInternal, IN_USE_BACKOFF_MS); return; @@ -139,7 +133,6 @@ } private void destroyInternal() { - mThreadChecker.assertOnValidThread(); if (!lock()) { mTaskRunner.postDelayedTask(this::destroyInternal, IN_USE_BACKOFF_MS); return;
diff --git a/components/paint_preview/player/android/javatests/src/org/chromium/components/paintpreview/player/PaintPreviewPlayerTest.java b/components/paint_preview/player/android/javatests/src/org/chromium/components/paintpreview/player/PaintPreviewPlayerTest.java index 12df1a7..12a1e78 100644 --- a/components/paint_preview/player/android/javatests/src/org/chromium/components/paintpreview/player/PaintPreviewPlayerTest.java +++ b/components/paint_preview/player/android/javatests/src/org/chromium/components/paintpreview/player/PaintPreviewPlayerTest.java
@@ -198,13 +198,36 @@ new PaintPreviewTestService(mTempFolder.getRoot().getPath()); // Use the wrong URL to simulate a failure. mPlayerManager = new PlayerManager(new GURL("about:blank"), getActivity(), service, - TEST_DIRECTORY_KEY, mLinkClickHandler, - () -> { Assert.fail("Unexpected overscroll refresh attempted."); }, - () -> { - Assert.fail("View Ready callback occurred, but expected a failure."); - }, - null, null, 0xffffffff, - (status) -> { compositorErrorCallback.notifyCalled(); }, false); + TEST_DIRECTORY_KEY, new PlayerManager.Listener() { + @Override + public void onCompositorError(int status) { + compositorErrorCallback.notifyCalled(); + } + + @Override + public void onViewReady() { + Assert.fail("View Ready callback occurred, but expected a failure."); + } + + @Override + public void onFirstPaint() {} + + @Override + public void onUserInteraction() {} + + @Override + public void onUserFrustration() {} + + @Override + public void onPullToRefresh() { + Assert.fail("Unexpected overscroll refresh attempted."); + } + + @Override + public void onLinkClick(GURL url) { + mLinkClickHandler.onLinkClicked(url); + } + }, 0xffffffff, false); mPlayerManager.setCompressOnClose(false); }); compositorErrorCallback.waitForFirst(); @@ -354,9 +377,36 @@ } mPlayerManager = new PlayerManager(new GURL(TEST_URL), getActivity(), service, - TEST_DIRECTORY_KEY, mLinkClickHandler, mRefreshedCallback::notifyCalled, - viewReady::notifyCalled, null, null, 0xffffffff, - (status) -> { mInitializationFailed = true; }, false); + TEST_DIRECTORY_KEY, new PlayerManager.Listener() { + @Override + public void onCompositorError(int status) { + mInitializationFailed = true; + } + + @Override + public void onViewReady() { + viewReady.notifyCalled(); + } + + @Override + public void onFirstPaint() {} + + @Override + public void onUserInteraction() {} + + @Override + public void onUserFrustration() {} + + @Override + public void onPullToRefresh() { + mRefreshedCallback.notifyCalled(); + } + + @Override + public void onLinkClick(GURL url) { + mLinkClickHandler.onLinkClicked(url); + } + }, 0xffffffff, false); mPlayerManager.setCompressOnClose(false); getActivity().setContentView(mPlayerManager.getView()); });
diff --git a/components/paint_preview/player/android/junit/src/org/chromium/components/paintpreview/player/frame/PlayerFrameMediatorTest.java b/components/paint_preview/player/android/junit/src/org/chromium/components/paintpreview/player/frame/PlayerFrameMediatorTest.java index 5fb2c6d..63a9341 100644 --- a/components/paint_preview/player/android/junit/src/org/chromium/components/paintpreview/player/frame/PlayerFrameMediatorTest.java +++ b/components/paint_preview/player/android/junit/src/org/chromium/components/paintpreview/player/frame/PlayerFrameMediatorTest.java
@@ -209,7 +209,7 @@ mModel = new PropertyModel.Builder(PlayerFrameProperties.ALL_KEYS).build(); mCompositorDelegate = new TestPlayerCompositorDelegate(); mScroller = new OverScroller(ContextUtils.getApplicationContext()); - mGestureListener = new PlayerGestureListener(null, () -> mHasUserInteraction = true); + mGestureListener = new PlayerGestureListener(null, () -> mHasUserInteraction = true, null); Size contentSize = new Size(CONTENT_WIDTH, CONTENT_HEIGHT); mMediator = new PlayerFrameMediator(mModel, mCompositorDelegate, mGestureListener, mFrameGuid, contentSize, 0, 0);
diff --git a/components/payments/core/journey_logger.h b/components/payments/core/journey_logger.h index 4b026212..b5718b20 100644 --- a/components/payments/core/journey_logger.h +++ b/components/payments/core/journey_logger.h
@@ -187,7 +187,7 @@ // Sets the number of suggestions shown for the specified section. void SetNumberOfSuggestionsShown(Section section, int number, - bool has_valid_suggestion); + bool has_complete_suggestion); // Records the fact that the merchant called CanMakePayment and records its // return value.
diff --git a/components/profile_metrics/state.cc b/components/profile_metrics/state.cc index 4f1b666..f65c801 100644 --- a/components/profile_metrics/state.cc +++ b/components/profile_metrics/state.cc
@@ -24,9 +24,22 @@ return "_LatentMultiProfileOthers"; case StateSuffix::kSingleProfile: return "_SingleProfile"; + case StateSuffix::kUponDeletion: + return "_UponDeletion"; } } +// Context for profile deletion. +// These values are persisted to logs. Entries should not be renumbered and +// numeric values should never be reused. +enum class DeleteProfileContext { + kWithoutBrowserLastProfile = 0, + kWithoutBrowserAdditionalProfile = 1, + kWithBrowserLastProfile = 2, + kWithBrowserAdditionalProfile = 3, + kMaxValue = kWithBrowserAdditionalProfile +}; + } // namespace void LogProfileAvatar(AvatarState avatar_state, StateSuffix suffix) { @@ -56,6 +69,24 @@ "Profile.State.LastUsed" + GetStateSuffix(suffix), days_since_last_use); } +void LogProfileDeletionContext(bool is_last_profile, bool no_browser_windows) { + DeleteProfileContext context; + if (no_browser_windows) { + if (is_last_profile) { + context = DeleteProfileContext::kWithoutBrowserLastProfile; + } else { + context = DeleteProfileContext::kWithoutBrowserAdditionalProfile; + } + } else { + if (is_last_profile) { + context = DeleteProfileContext::kWithBrowserLastProfile; + } else { + context = DeleteProfileContext::kWithBrowserAdditionalProfile; + } + } + base::UmaHistogramEnumeration("Profile.DeleteProfileContext", context); +} + void LogProfileAllAccountsNames(AllAccountsNames names) { base::UmaHistogramEnumeration("Profile.AllAccounts.Names", names); }
diff --git a/components/profile_metrics/state.h b/components/profile_metrics/state.h index efccc5a8..0b6e364 100644 --- a/components/profile_metrics/state.h +++ b/components/profile_metrics/state.h
@@ -90,7 +90,9 @@ kLatentMultiProfileOthers, // Recorded for multi-profile users with one // active profile, only for the non-active // profiles. - kSingleProfile // Recorded for single-profile users for their single profile. + kSingleProfile, // Recorded for single-profile users for their single + // profile. + kUponDeletion // Recorded whenever a profile gets deleted. }; // Records the state of profile's avatar. @@ -109,6 +111,10 @@ // Records the days since last use of a profile. void LogProfileDaysSinceLastUse(int days_since_last_use, StateSuffix suffix); +// Records the context of a profile deletion, whether it is the last profile and +// whether it happens while no browser windows are opened. +void LogProfileDeletionContext(bool is_last_profile, bool no_browser_windows); + // Records the state of account names used in multi-login. void LogProfileAllAccountsNames(AllAccountsNames names);
diff --git a/components/services/font/public/mojom/font_service.mojom b/components/services/font/public/mojom/font_service.mojom index e49aa398..42c9666 100644 --- a/components/services/font/public/mojom/font_service.mojom +++ b/components/services/font/public/mojom/font_service.mojom
@@ -4,8 +4,8 @@ module font_service.mojom; -import "mojo/public/mojom/base/file.mojom"; import "mojo/public/mojom/base/file_path.mojom"; +import "mojo/public/mojom/base/read_only_file.mojom"; enum TypefaceSlant { ROMAN = 0, @@ -63,7 +63,7 @@ (FontIdentity? identity, string family_name, TypefaceStyle style); // Returns a handle to the raw font specified by |id_number|. - OpenStream(uint32 id_number) => (mojo_base.mojom.File? font_handle); + OpenStream(uint32 id_number) => (mojo_base.mojom.ReadOnlyFile? font_handle); // Returns a fallback FontIdentity and Typeface style for the given character // and locale. If no fallback font can be found, returns a null identity. @@ -93,5 +93,5 @@ // PPAPI Specific font call to match a font family and charset. MatchFontWithFallback(string family, bool is_bold, bool is_italic, uint32 charset, uint32 fallback_family_type) => - (mojo_base.mojom.File? font_file_handle); + (mojo_base.mojom.ReadOnlyFile? font_file_handle); };
diff --git a/components/services/paint_preview_compositor/paint_preview_compositor_impl.cc b/components/services/paint_preview_compositor/paint_preview_compositor_impl.cc index 0598a77..9d9fc332 100644 --- a/components/services/paint_preview_compositor/paint_preview_compositor_impl.cc +++ b/components/services/paint_preview_compositor/paint_preview_compositor_impl.cc
@@ -81,13 +81,15 @@ return frame; } -SkBitmap CreateBitmap(sk_sp<SkPicture> skp, - const gfx::Rect& clip_rect, - float scale_factor) { +base::Optional<SkBitmap> CreateBitmap(sk_sp<SkPicture> skp, + const gfx::Rect& clip_rect, + float scale_factor) { TRACE_EVENT0("paint_preview", "PaintPreviewCompositorImpl::CreateBitmap"); SkBitmap bitmap; - bitmap.allocPixels( - SkImageInfo::MakeN32Premul(clip_rect.width(), clip_rect.height())); + if (!bitmap.tryAllocPixels( + SkImageInfo::MakeN32Premul(clip_rect.width(), clip_rect.height()))) { + return base::nullopt; + } SkCanvas canvas(bitmap); SkMatrix matrix; matrix.setScaleTranslate(scale_factor, scale_factor, -clip_rect.x(), @@ -178,12 +180,11 @@ BitmapForSeparatedFrameCallback callback) { TRACE_EVENT0("paint_preview", "PaintPreviewCompositorImpl::BitmapForSeparatedFrame"); - SkBitmap bitmap; auto frame_it = frames_.find(frame_guid); if (frame_it == frames_.end()) { DVLOG(1) << "Frame not found for " << frame_guid.ToString(); std::move(callback).Run( - mojom::PaintPreviewCompositor::BitmapStatus::kMissingFrame, bitmap); + mojom::PaintPreviewCompositor::BitmapStatus::kMissingFrame, SkBitmap()); return; } @@ -192,8 +193,20 @@ {base::TaskPriority::USER_VISIBLE, base::WithBaseSyncPrimitives()}, base::BindOnce(&CreateBitmap, frame_it->second.skp, clip_rect, scale_factor), - base::BindOnce(std::move(callback), - mojom::PaintPreviewCompositor::BitmapStatus::kSuccess)); + base::BindOnce( + [](BitmapForSeparatedFrameCallback callback, + const base::Optional<SkBitmap>& maybe_bitmap) { + if (!maybe_bitmap.has_value()) { + std::move(callback).Run( + mojom::PaintPreviewCompositor::BitmapStatus::kAllocFailed, + SkBitmap()); + return; + } + std::move(callback).Run( + mojom::PaintPreviewCompositor::BitmapStatus::kSuccess, + maybe_bitmap.value()); + }, + std::move(callback))); } void PaintPreviewCompositorImpl::BeginMainFrameComposite( @@ -256,8 +269,20 @@ FROM_HERE, {base::TaskPriority::USER_VISIBLE, base::WithBaseSyncPrimitives()}, base::BindOnce(&CreateBitmap, root_frame_, clip_rect, scale_factor), - base::BindOnce(std::move(callback), - mojom::PaintPreviewCompositor::BitmapStatus::kSuccess)); + base::BindOnce( + [](BitmapForMainFrameCallback callback, + const base::Optional<SkBitmap>& maybe_bitmap) { + if (!maybe_bitmap.has_value()) { + std::move(callback).Run( + mojom::PaintPreviewCompositor::BitmapStatus::kAllocFailed, + SkBitmap()); + return; + } + std::move(callback).Run( + mojom::PaintPreviewCompositor::BitmapStatus::kSuccess, + maybe_bitmap.value()); + }, + std::move(callback))); } void PaintPreviewCompositorImpl::SetRootFrameUrl(const GURL& url) {
diff --git a/components/services/paint_preview_compositor/public/mojom/paint_preview_compositor.mojom b/components/services/paint_preview_compositor/public/mojom/paint_preview_compositor.mojom index 423f0cb..88869089 100644 --- a/components/services/paint_preview_compositor/public/mojom/paint_preview_compositor.mojom +++ b/components/services/paint_preview_compositor/public/mojom/paint_preview_compositor.mojom
@@ -89,6 +89,9 @@ // that the associated |BeginSeparatedFrameComposite| or // |BeginMainFrameComposite| method has not been called yet. kMissingFrame = 1, + + // Indicates that memory allocation for the bitmap failed. + kAllocFailed = 2, }; // Starts the compositing process for |BitmapForSeparatedFrame| calls using
diff --git a/components/signin/internal/identity_manager/account_fetcher_service.cc b/components/signin/internal/identity_manager/account_fetcher_service.cc index 39dbbb3..0f8e86b 100644 --- a/components/signin/internal/identity_manager/account_fetcher_service.cc +++ b/components/signin/internal/identity_manager/account_fetcher_service.cc
@@ -79,7 +79,7 @@ signin_client_->GetPrefs(), AccountFetcherService::kLastUpdatePref, kRefreshFromTokenServiceDelay, base::Bind(&AccountFetcherService::RefreshAllAccountInfo, - base::Unretained(this), false)); + base::Unretained(this), /*only_fetch_if_invalid=*/false)); // Tokens may have already been loaded and we will not receive a // notification-on-registration for |token_service_->AddObserver(this)| few @@ -105,7 +105,7 @@ void AccountFetcherService::ForceRefreshOfAccountInfo( const CoreAccountId& account_id) { DCHECK(network_fetches_enabled_); - RefreshAccountInfo(account_id, false); + RefreshAccountInfo(account_id, /*only_fetch_if_invalid=*/false); } void AccountFetcherService::OnNetworkInitialized() { @@ -167,7 +167,7 @@ network_fetches_enabled_ = true; repeating_timer_->Start(); } - RefreshAllAccountInfo(true); + RefreshAllAccountInfo(/*only_fetch_if_invalid=*/true); #if defined(OS_ANDROID) UpdateChildInfo(); #endif @@ -221,15 +221,21 @@ const AccountInfo& info = account_tracker_service_->GetAccountInfo(account_id); -// |only_fetch_if_invalid| is false when the service is due for a timed update. -#if defined(OS_ANDROID) - // TODO(mlerman): Change this condition back to info.IsValid() and ensure the - // Fetch doesn't occur until after ProfileImpl::OnPrefsLoaded(). - if (!only_fetch_if_invalid || info.gaia.empty()) -#else - if (!only_fetch_if_invalid || !info.IsValid()) -#endif + // |only_fetch_if_invalid| is false when the service is due for a timed + // update. + if (!only_fetch_if_invalid || !info.IsValid()) { + // Fetching the user info will also fetch the account image. StartFetchingUserInfo(account_id); + return; + } + + // User info is already valid and does not need to be downloaded again. + // Fetch the account image in case it was not fetched previously. + // + // Note: |FetchAccountImage()| does not fetch the account image if the + // account image was already downloaded. So it is fine to call this method + // even when |only_fetch_if_invalid| is true. + FetchAccountImage(account_id); } void AccountFetcherService::OnUserInfoFetchSuccess( @@ -323,7 +329,7 @@ if (!network_fetches_enabled_) return; - RefreshAccountInfo(account_id, true); + RefreshAccountInfo(account_id, /*only_fetch_if_invalid=*/true); #if defined(OS_ANDROID) UpdateChildInfo(); #endif
diff --git a/components/signin/internal/identity_manager/account_tracker_service_unittest.cc b/components/signin/internal/identity_manager/account_tracker_service_unittest.cc index 839d6023..9de5ed5 100644 --- a/components/signin/internal/identity_manager/account_tracker_service_unittest.cc +++ b/components/signin/internal/identity_manager/account_tracker_service_unittest.cc
@@ -107,11 +107,10 @@ account_key.value); } -std::string AccountKeyToPictureURLWithSize(AccountKey account_key) { +GURL AccountKeyToPictureURLWithSize(AccountKey account_key) { return signin::GetAvatarImageURLWithOptions( - GURL(AccountKeyToPictureURL(account_key)), - signin::kAccountInfoImageSize, true /* no_silhouette */) - .spec(); + GURL(AccountKeyToPictureURL(account_key)), signin::kAccountInfoImageSize, + true /* no_silhouette */); } class TrackingEvent { @@ -315,7 +314,8 @@ } protected: - void ReturnFetchResults(net::HttpStatusCode response_code, + void ReturnFetchResults(const GURL& url, + net::HttpStatusCode response_code, const std::string& response_string); base::test::TaskEnvironment task_environment_; @@ -371,9 +371,9 @@ }; void AccountTrackerServiceTest::ReturnFetchResults( + const GURL& url, net::HttpStatusCode response_code, const std::string& response_string) { - GURL url = GaiaUrls::GetInstance()->oauth_user_info_url(); EXPECT_TRUE(GetTestURLLoaderFactory()->IsPending(url.spec())); // It's possible for multiple requests to be pending. Respond to all of them. @@ -388,35 +388,35 @@ void AccountTrackerServiceTest::ReturnAccountInfoFetchSuccess( AccountKey account_key) { IssueAccessToken(account_key); - ReturnFetchResults(net::HTTP_OK, GenerateValidTokenInfoResponse(account_key)); + ReturnFetchResults(GaiaUrls::GetInstance()->oauth_user_info_url(), + net::HTTP_OK, GenerateValidTokenInfoResponse(account_key)); } void AccountTrackerServiceTest::ReturnAccountInfoFetchSuccessIncomplete( AccountKey account_key) { IssueAccessToken(account_key); - ReturnFetchResults(net::HTTP_OK, + ReturnFetchResults(GaiaUrls::GetInstance()->oauth_user_info_url(), + net::HTTP_OK, GenerateIncompleteTokenInfoResponse(account_key)); } void AccountTrackerServiceTest::ReturnAccountInfoFetchFailure( AccountKey account_key) { IssueAccessToken(account_key); - ReturnFetchResults(net::HTTP_BAD_REQUEST, std::string()); + ReturnFetchResults(GaiaUrls::GetInstance()->oauth_user_info_url(), + net::HTTP_BAD_REQUEST, std::string()); } void AccountTrackerServiceTest::ReturnAccountImageFetchSuccess( AccountKey account_key) { - GetTestURLLoaderFactory()->AddResponse( - AccountKeyToPictureURLWithSize(account_key), "image data"); - task_environment_.RunUntilIdle(); + ReturnFetchResults(AccountKeyToPictureURLWithSize(account_key), net::HTTP_OK, + "image data"); } void AccountTrackerServiceTest::ReturnAccountImageFetchFailure( AccountKey account_key) { - GetTestURLLoaderFactory()->AddResponse( - AccountKeyToPictureURLWithSize(account_key), std::string(), - net::HTTP_BAD_REQUEST); - task_environment_.RunUntilIdle(); + ReturnFetchResults(AccountKeyToPictureURLWithSize(account_key), + net::HTTP_BAD_REQUEST, "image data"); } TEST_F(AccountTrackerServiceTest, Basic) {} @@ -563,6 +563,44 @@ })); } +// Regression test for http://crbug.com/1135958 +TEST_F(AccountTrackerServiceTest, + AccountSeeded_TokenAvailable_UserInfoSuccess) { + // Setup: Seed the account before simulating that the refresh token is + // available. + account_tracker()->SeedAccountInfo(AccountKeyToGaiaId(kAccountKeyAlpha), + AccountKeyToEmail(kAccountKeyAlpha)); + + // Account fetcher service should fetch user info for accounts that were + // seeded. + SimulateTokenAvailable(kAccountKeyAlpha); + ReturnAccountInfoFetchSuccess(kAccountKeyAlpha); + EXPECT_TRUE(account_fetcher()->IsAllUserInfoFetched()); +} + +// Regression test for http://crbug.com/1135958 +TEST_F(AccountTrackerServiceTest, RefreshAccount_FetchImageSuccess) { + CoreAccountId account_id = AccountKeyToAccountId(kAccountKeyAlpha); + + // Setup: User info fetched successfully, but missing the account image. + SimulateTokenAvailable(kAccountKeyAlpha); + ReturnAccountInfoFetchSuccess(kAccountKeyAlpha); + ReturnAccountImageFetchFailure(kAccountKeyAlpha); + ASSERT_TRUE(account_tracker()->GetAccountInfo(account_id).IsValid()); + ASSERT_TRUE( + account_tracker()->GetAccountInfo(account_id).account_image.IsEmpty()); + + // Account fetcher should fetch the account image even when user info if + // the account image was not fetched before. + SimulateTokenAvailable(kAccountKeyAlpha); + ReturnAccountImageFetchSuccess(kAccountKeyAlpha); + AccountInfo account_info = account_tracker()->GetAccountInfo( + AccountKeyToAccountId(kAccountKeyAlpha)); + EXPECT_FALSE(account_info.account_image.IsEmpty()); + EXPECT_EQ(account_info.last_downloaded_image_url_with_size, + AccountKeyToPictureURLWithSize(kAccountKeyAlpha)); +} + TEST_F(AccountTrackerServiceTest, GetAccounts) { SimulateTokenAvailable(kAccountKeyAlpha); SimulateTokenAvailable(kAccountKeyBeta); @@ -1139,7 +1177,8 @@ account_tracker()->SetIsChildAccount(AccountKeyToAccountId(kAccountKeyChild), false); #endif - ReturnFetchResults(net::HTTP_OK, + ReturnFetchResults(GaiaUrls::GetInstance()->oauth_user_info_url(), + net::HTTP_OK, GenerateValidTokenInfoResponse(kAccountKeyChild)); EXPECT_TRUE(CheckAccountTrackerEvents({ TrackingEvent(UPDATED, AccountKeyToAccountId(kAccountKeyChild), @@ -1167,7 +1206,8 @@ account_tracker()->SetIsChildAccount(AccountKeyToAccountId(kAccountKeyChild), true); #endif - ReturnFetchResults(net::HTTP_OK, + ReturnFetchResults(GaiaUrls::GetInstance()->oauth_user_info_url(), + net::HTTP_OK, GenerateValidTokenInfoResponse(kAccountKeyChild)); EXPECT_TRUE(CheckAccountTrackerEvents({ TrackingEvent(UPDATED, AccountKeyToAccountId(kAccountKeyChild), @@ -1253,7 +1293,8 @@ AccountInfo info = account_tracker()->GetAccountInfo( AccountKeyToAccountId(kAccountKeyChild)); EXPECT_TRUE(info.is_child_account); - ReturnFetchResults(net::HTTP_OK, + ReturnFetchResults(GaiaUrls::GetInstance()->oauth_user_info_url(), + net::HTTP_OK, GenerateValidTokenInfoResponse(kAccountKeyChild)); EXPECT_TRUE(CheckAccountTrackerEvents({ TrackingEvent(UPDATED, AccountKeyToAccountId(kAccountKeyChild),
diff --git a/components/sync/driver/sync_service_crypto.cc b/components/sync/driver/sync_service_crypto.cc index 1b278734..872ff6b 100644 --- a/components/sync/driver/sync_service_crypto.cc +++ b/components/sync/driver/sync_service_crypto.cc
@@ -38,10 +38,9 @@ ~EmptyTrustedVaultClient() override = default; // TrustedVaultClient implementation. - std::unique_ptr<Subscription> AddKeysChangedObserver( - const base::RepeatingClosure& cb) override { - return nullptr; - } + void AddObserver(Observer* observer) override {} + + void RemoveObserver(Observer* observer) override {} void FetchKeys( const CoreAccountInfo& account_info, @@ -72,11 +71,6 @@ std::move(cb).Run(false); } - std::unique_ptr<Subscription> AddRecoverabilityObserver( - const base::RepeatingClosure& cb) override { - return nullptr; - } - void AddTrustedRecoveryMethod(const std::string& gaia_id, const std::vector<uint8_t>& public_key, base::OnceClosure cb) override { @@ -232,18 +226,12 @@ DCHECK(sync_prefs_); DCHECK(trusted_vault_client_); - trusted_vault_client_keys_subscription_ = - trusted_vault_client_->AddKeysChangedObserver(base::BindRepeating( - &SyncServiceCrypto::OnTrustedVaultClientKeysChanged, - weak_factory_.GetWeakPtr())); - - trusted_vault_client_recoverability_subscription_ = - trusted_vault_client_->AddRecoverabilityObserver(base::BindRepeating( - &SyncServiceCrypto::OnTrustedVaultClientRecoverabilityChanged, - weak_factory_.GetWeakPtr())); + trusted_vault_client_->AddObserver(this); } -SyncServiceCrypto::~SyncServiceCrypto() = default; +SyncServiceCrypto::~SyncServiceCrypto() { + trusted_vault_client_->RemoveObserver(this); +} void SyncServiceCrypto::Reset() { state_ = State(); @@ -414,6 +402,34 @@ return state_.cached_passphrase_type; } +void SyncServiceCrypto::SetSyncEngine(const CoreAccountInfo& account_info, + SyncEngine* engine) { + DCHECK(engine); + state_.account_info = account_info; + state_.engine = engine; + + // Since there was no state changes during engine initialization, now the + // state is known and no user action required. + if (state_.required_user_action == + RequiredUserAction::kUnknownDuringInitialization) { + UpdateRequiredUserActionAndNotify(RequiredUserAction::kNone); + } + + // This indicates OnTrustedVaultKeyRequired() was called as part of the + // engine's initialization. + if (state_.required_user_action == + RequiredUserAction::kFetchingTrustedVaultKeys) { + FetchTrustedVaultKeys(/*is_second_fetch_attempt=*/false); + } +} + +std::unique_ptr<SyncEncryptionHandler::Observer> +SyncServiceCrypto::GetEncryptionObserverProxy() { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + return std::make_unique<SyncEncryptionObserverProxy>( + weak_factory_.GetWeakPtr(), base::SequencedTaskRunnerHandle::Get()); +} + ModelTypeSet SyncServiceCrypto::GetEncryptedDataTypes() const { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); DCHECK(state_.encrypted_types.Has(PASSWORDS)); @@ -606,35 +622,7 @@ notify_observers_.Run(); } -void SyncServiceCrypto::SetSyncEngine(const CoreAccountInfo& account_info, - SyncEngine* engine) { - DCHECK(engine); - state_.account_info = account_info; - state_.engine = engine; - - // Since there was no state changes during engine initialization, now the - // state is known and no user action required. - if (state_.required_user_action == - RequiredUserAction::kUnknownDuringInitialization) { - UpdateRequiredUserActionAndNotify(RequiredUserAction::kNone); - } - - // This indicates OnTrustedVaultKeyRequired() was called as part of the - // engine's initialization. - if (state_.required_user_action == - RequiredUserAction::kFetchingTrustedVaultKeys) { - FetchTrustedVaultKeys(/*is_second_fetch_attempt=*/false); - } -} - -std::unique_ptr<SyncEncryptionHandler::Observer> -SyncServiceCrypto::GetEncryptionObserverProxy() { - DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - return std::make_unique<SyncEncryptionObserverProxy>( - weak_factory_.GetWeakPtr(), base::SequencedTaskRunnerHandle::Get()); -} - -void SyncServiceCrypto::OnTrustedVaultClientKeysChanged() { +void SyncServiceCrypto::OnTrustedVaultKeysChanged() { switch (state_.required_user_action) { case RequiredUserAction::kUnknownDuringInitialization: case RequiredUserAction::kNone: @@ -662,7 +650,7 @@ FetchTrustedVaultKeys(/*is_second_fetch_attempt=*/false); } -void SyncServiceCrypto::OnTrustedVaultClientRecoverabilityChanged() { +void SyncServiceCrypto::OnTrustedVaultRecoverabilityChanged() { RefreshIsRecoverabilityDegraded(); }
diff --git a/components/sync/driver/sync_service_crypto.h b/components/sync/driver/sync_service_crypto.h index f335baf..dc1a50a 100644 --- a/components/sync/driver/sync_service_crypto.h +++ b/components/sync/driver/sync_service_crypto.h
@@ -28,7 +28,8 @@ // handles things related to encryption, including holding lots of state and // encryption communications with the sync thread. class SyncServiceCrypto : public SyncEncryptionHandler::Observer, - public DataTypeEncryptionHandler { + public DataTypeEncryptionHandler, + public TrustedVaultClient::Observer { public: // |sync_prefs| must not be null and must outlive this object. // |trusted_vault_client| may be null, but if non-null, the pointee must @@ -62,6 +63,12 @@ // Returns the actual passphrase type being used for encryption. PassphraseType GetPassphraseType() const; + // Used to provide the engine when it is initialized. + void SetSyncEngine(const CoreAccountInfo& account_info, SyncEngine* engine); + + // Creates a proxy observer object that will post calls to this thread. + std::unique_ptr<SyncEncryptionHandler::Observer> GetEncryptionObserverProxy(); + // SyncEncryptionHandler::Observer implementation. void OnPassphraseRequired( PassphraseRequiredReason reason, @@ -84,11 +91,9 @@ bool HasCryptoError() const override; ModelTypeSet GetEncryptedDataTypes() const override; - // Used to provide the engine when it is initialized. - void SetSyncEngine(const CoreAccountInfo& account_info, SyncEngine* engine); - - // Creates a proxy observer object that will post calls to this thread. - std::unique_ptr<SyncEncryptionHandler::Observer> GetEncryptionObserverProxy(); + // TrustedVaultClient::Observer implementation. + void OnTrustedVaultKeysChanged() override; + void OnTrustedVaultRecoverabilityChanged() override; bool encryption_pending() const { return state_.encryption_pending; } @@ -113,10 +118,6 @@ kTrustedVaultRecoverabilityDegraded, }; - // Observer methods invoked by TrustedVaultClient when its content changes. - void OnTrustedVaultClientKeysChanged(); - void OnTrustedVaultClientRecoverabilityChanged(); - // Reads trusted vault keys from the client and feeds them to the sync engine. void FetchTrustedVaultKeys(bool is_second_fetch_attempt); @@ -157,12 +158,6 @@ // Never null and guaranteed to outlive us. TrustedVaultClient* const trusted_vault_client_; - // Subscriptions to observe changes in |*trusted_vault_client_|. - std::unique_ptr<TrustedVaultClient::Subscription> - trusted_vault_client_keys_subscription_; - std::unique_ptr<TrustedVaultClient::Subscription> - trusted_vault_client_recoverability_subscription_; - // All the mutable state is wrapped in a struct so that it can be easily // reset to its default values. struct State {
diff --git a/components/sync/driver/sync_service_crypto_unittest.cc b/components/sync/driver/sync_service_crypto_unittest.cc index e97a528..a25bc2670 100644 --- a/components/sync/driver/sync_service_crypto_unittest.cc +++ b/components/sync/driver/sync_service_crypto_unittest.cc
@@ -9,6 +9,7 @@ #include <utility> #include "base/bind_helpers.h" +#include "base/observer_list.h" #include "base/optional.h" #include "base/run_loop.h" #include "base/test/mock_callback.h" @@ -151,13 +152,18 @@ void SetIsRecoverabilityDegraded(bool is_recoverability_degraded) { is_recoverability_degraded_ = is_recoverability_degraded; - recoverability_observer_list_.Notify(); + for (Observer& observer : observer_list_) { + observer.OnTrustedVaultRecoverabilityChanged(); + } } // TrustedVaultClient implementation. - std::unique_ptr<Subscription> AddKeysChangedObserver( - const base::RepeatingClosure& cb) override { - return keys_observer_list_.Add(cb); + void AddObserver(Observer* observer) override { + observer_list_.AddObserver(observer); + } + + void RemoveObserver(Observer* observer) override { + observer_list_.RemoveObserver(observer); } void FetchKeys( @@ -203,12 +209,16 @@ CachedKeysPerUser& cached_keys = gaia_id_to_cached_keys_[gaia_id]; cached_keys.keys = keys; cached_keys.marked_as_stale = false; - keys_observer_list_.Notify(); + for (Observer& observer : observer_list_) { + observer.OnTrustedVaultKeysChanged(); + } } void RemoveAllStoredKeys() override { gaia_id_to_cached_keys_.clear(); - keys_observer_list_.Notify(); + for (Observer& observer : observer_list_) { + observer.OnTrustedVaultKeysChanged(); + } } void MarkKeysAsStale(const CoreAccountInfo& account_info, @@ -237,11 +247,6 @@ std::move(cb).Run(is_recoverability_degraded_); } - std::unique_ptr<Subscription> AddRecoverabilityObserver( - const base::RepeatingClosure& cb) override { - return recoverability_observer_list_.Add(cb); - } - void AddTrustedRecoveryMethod(const std::string& gaia_id, const std::vector<uint8_t>& public_key, base::OnceClosure cb) override { @@ -258,8 +263,7 @@ const TestTrustedVaultServer* const server_; std::map<std::string, CachedKeysPerUser> gaia_id_to_cached_keys_; - CallbackList keys_observer_list_; - CallbackList recoverability_observer_list_; + base::ObserverList<Observer> observer_list_; int fetch_count_ = 0; int keys_marked_as_stale_count_ = 0; int get_is_recoverablity_degraded_call_count_ = 0; @@ -294,7 +298,7 @@ bool VerifyAndClearExpectations() { return testing::Mock::VerifyAndClearExpectations(¬ify_observers_cb_) && - testing::Mock::VerifyAndClearExpectations(¬ify_observers_cb_) && + testing::Mock::VerifyAndClearExpectations(&reconfigure_cb_) && testing::Mock::VerifyAndClearExpectations(&trusted_vault_client_) && testing::Mock::VerifyAndClearExpectations(&engine_); }
diff --git a/components/sync/driver/trusted_vault_client.h b/components/sync/driver/trusted_vault_client.h index 03189641..f452277d 100644 --- a/components/sync/driver/trusted_vault_client.h +++ b/components/sync/driver/trusted_vault_client.h
@@ -10,8 +10,9 @@ #include <vector> #include "base/callback_forward.h" -#include "base/callback_list.h" #include "base/macros.h" +#include "base/observer_list.h" +#include "base/observer_list_types.h" struct CoreAccountInfo; @@ -21,17 +22,26 @@ // available trusted vault encryption keys. class TrustedVaultClient { public: + class Observer : public base::CheckedObserver { + public: + Observer() = default; + Observer(const Observer&) = delete; + Observer& operator=(const Observer&) = delete; + ~Observer() override = default; + + // Invoked when the keys inside the vault have changed. + virtual void OnTrustedVaultKeysChanged() = 0; + + // Invoked when the recoverability of the keys has changed. + virtual void OnTrustedVaultRecoverabilityChanged() = 0; + }; + TrustedVaultClient() = default; virtual ~TrustedVaultClient() = default; - using CallbackList = base::CallbackList<void()>; - using Subscription = CallbackList::Subscription; - - // Registers an observer-like callback that will be invoked when the content - // of the vault has changed (e.g. new keys added). The subscription must not - // outlive |*this|. - virtual std::unique_ptr<Subscription> AddKeysChangedObserver( - const base::RepeatingClosure& cb) = 0; + // Adds/removes an observer. + virtual void AddObserver(Observer* observer) = 0; + virtual void RemoveObserver(Observer* observer) = 0; // Attempts to fetch decryption keys, required by sync to resume. // Implementations are expected to NOT prompt the user for actions. |cb| is @@ -74,14 +84,6 @@ const CoreAccountInfo& account_info, base::OnceCallback<void(bool)> cb) = 0; - // Registers an observer-like callback that will be invoked when the - // recoverability of the keys has changed. The subscription must not outlive - // |*this|. - // TODO(crbug.com/1081649): Unify with AddKeysChangedObserver() by introducing - // an observer interface instead. - virtual std::unique_ptr<Subscription> AddRecoverabilityObserver( - const base::RepeatingClosure& cb) = 0; - // Registers a new trusted recovery method that can be used to retrieve keys, // usually for the purpose of resolving a recoverability-degraded case // surfaced by GetIsRecoverabilityDegraded().
diff --git a/components/sync/trusted_vault/standalone_trusted_vault_client.cc b/components/sync/trusted_vault/standalone_trusted_vault_client.cc index 89ec7c1..f23bb11a 100644 --- a/components/sync/trusted_vault/standalone_trusted_vault_client.cc +++ b/components/sync/trusted_vault/standalone_trusted_vault_client.cc
@@ -163,11 +163,14 @@ StandaloneTrustedVaultClient::~StandaloneTrustedVaultClient() = default; -std::unique_ptr<StandaloneTrustedVaultClient::Subscription> -StandaloneTrustedVaultClient::AddKeysChangedObserver( - const base::RepeatingClosure& cb) { +void StandaloneTrustedVaultClient::AddObserver(Observer* observer) { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - return keys_observer_list_.Add(cb); + observer_list_.AddObserver(observer); +} + +void StandaloneTrustedVaultClient::RemoveObserver(Observer* observer) { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); + observer_list_.RemoveObserver(observer); } void StandaloneTrustedVaultClient::FetchKeys( @@ -190,7 +193,9 @@ backend_task_runner_->PostTask( FROM_HERE, base::BindOnce(&StandaloneTrustedVaultBackend::StoreKeys, backend_, gaia_id, keys, last_key_version)); - keys_observer_list_.Notify(); + for (Observer& observer : observer_list_) { + observer.OnTrustedVaultKeysChanged(); + } } void StandaloneTrustedVaultClient::RemoveAllStoredKeys() { @@ -200,7 +205,9 @@ FROM_HERE, base::BindOnce(&StandaloneTrustedVaultBackend::RemoveAllStoredKeys, backend_)); - keys_observer_list_.Notify(); + for (Observer& observer : observer_list_) { + observer.OnTrustedVaultKeysChanged(); + } } void StandaloneTrustedVaultClient::MarkKeysAsStale( @@ -227,13 +234,6 @@ account_info, BindToCurrentSequence(std::move(cb)))); } -std::unique_ptr<StandaloneTrustedVaultClient::Subscription> -StandaloneTrustedVaultClient::AddRecoverabilityObserver( - const base::RepeatingClosure& cb) { - DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - return recoverability_observer_list_.Add(cb); -} - void StandaloneTrustedVaultClient::AddTrustedRecoveryMethod( const std::string& gaia_id, const std::vector<uint8_t>& public_key, @@ -278,7 +278,9 @@ void StandaloneTrustedVaultClient::NotifyRecoverabilityDegradedChanged() { DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); - recoverability_observer_list_.Notify(); + for (Observer& observer : observer_list_) { + observer.OnTrustedVaultRecoverabilityChanged(); + } } } // namespace syncer
diff --git a/components/sync/trusted_vault/standalone_trusted_vault_client.h b/components/sync/trusted_vault/standalone_trusted_vault_client.h index 1c10255..2c3314a 100644 --- a/components/sync/trusted_vault/standalone_trusted_vault_client.h +++ b/components/sync/trusted_vault/standalone_trusted_vault_client.h
@@ -13,6 +13,7 @@ #include "base/files/file_path.h" #include "base/memory/scoped_refptr.h" #include "base/memory/weak_ptr.h" +#include "base/observer_list.h" #include "base/sequence_checker.h" #include "base/sequenced_task_runner.h" #include "components/signin/public/identity_manager/identity_manager.h" @@ -50,8 +51,8 @@ ~StandaloneTrustedVaultClient() override; // TrustedVaultClient implementation. - std::unique_ptr<Subscription> AddKeysChangedObserver( - const base::RepeatingClosure& cb) override; + void AddObserver(Observer* observer) override; + void RemoveObserver(Observer* observer) override; void FetchKeys( const CoreAccountInfo& account_info, base::OnceCallback<void(const std::vector<std::vector<uint8_t>>&)> cb) @@ -64,8 +65,6 @@ base::OnceCallback<void(bool)> cb) override; void GetIsRecoverabilityDegraded(const CoreAccountInfo& account_info, base::OnceCallback<void(bool)> cb) override; - std::unique_ptr<Subscription> AddRecoverabilityObserver( - const base::RepeatingClosure& cb) override; void AddTrustedRecoveryMethod(const std::string& gaia_id, const std::vector<uint8_t>& public_key, base::OnceClosure cb) override; @@ -84,8 +83,7 @@ SEQUENCE_CHECKER(sequence_checker_); - CallbackList keys_observer_list_; - CallbackList recoverability_observer_list_; + base::ObserverList<Observer> observer_list_; // Allows access token fetching for primary account on the ui thread. Passed // as WeakPtr to TrustedVaultAccessTokenFetcherImpl.
diff --git a/components/sync_bookmarks/bookmark_remote_updates_handler_unittest.cc b/components/sync_bookmarks/bookmark_remote_updates_handler_unittest.cc index 3da13ba..ac4ea32 100644 --- a/components/sync_bookmarks/bookmark_remote_updates_handler_unittest.cc +++ b/components/sync_bookmarks/bookmark_remote_updates_handler_unittest.cc
@@ -586,7 +586,7 @@ histogram_tester.ExpectBucketCount( "Sync.ProblematicServerSideBookmarks", /*sample=*/ExpectedRemoteBookmarkUpdateError::kInvalidSpecifics, - /*count=*/1); + /*expected_count=*/1); } TEST_F(BookmarkRemoteUpdatesHandlerWithInitialMergeTest, @@ -620,7 +620,7 @@ histogram_tester.ExpectBucketCount( "Sync.ProblematicServerSideBookmarks", /*sample=*/ExpectedRemoteBookmarkUpdateError::kUnexpectedGuid, - /*count=*/1); + /*expected_count=*/1); } TEST_F(BookmarkRemoteUpdatesHandlerWithInitialMergeTest, @@ -675,7 +675,7 @@ histogram_tester.ExpectBucketCount( "Sync.ProblematicServerSideBookmarks", /*sample=*/ExpectedRemoteBookmarkUpdateError::kUnexpectedGuid, - /*count=*/0); + /*expected_count=*/0); } TEST_F(BookmarkRemoteUpdatesHandlerWithInitialMergeTest, @@ -1015,7 +1015,7 @@ histogram_tester.ExpectBucketCount( "Sync.ProblematicServerSideBookmarks", /*sample=*/ExpectedRemoteBookmarkUpdateError::kParentNotFolder, - /*count=*/1); + /*expected_count=*/1); } TEST_F(BookmarkRemoteUpdatesHandlerWithInitialMergeTest, @@ -1896,7 +1896,7 @@ /*sample=*/ BookmarkRemoteUpdatesHandler:: DuplicateBookmarkEntityOnRemoteUpdateCondition::kServerIdTombstone, - /*count=*/1); + /*expected_count=*/1); } TEST_F(BookmarkRemoteUpdatesHandlerWithInitialMergeTest,
diff --git a/content/browser/accessibility/ax_platform_node_textrangeprovider_win_browsertest.cc b/content/browser/accessibility/ax_platform_node_textrangeprovider_win_browsertest.cc index cdfcfce..13c12b0 100644 --- a/content/browser/accessibility/ax_platform_node_textrangeprovider_win_browsertest.cc +++ b/content/browser/accessibility/ax_platform_node_textrangeprovider_win_browsertest.cc
@@ -2596,7 +2596,7 @@ /*expected_text*/ L"Text in iframe\nAfter frame", /*expected_count*/ 1); - // Validiate this selection with a waiter. + // Validate this selection with a waiter. AccessibilityNotificationWaiter waiter( shell()->web_contents(), ui::kAXModeComplete, ax::mojom::Event::kDocumentSelectionChanged); @@ -2626,4 +2626,97 @@ EXPECT_HRESULT_SUCCEEDED(text_range_provider->Select()); } +IN_PROC_BROWSER_TEST_F(AXPlatformNodeTextRangeProviderWinBrowserTest, + ReplaceStartAndEndEndpointNodeInMultipleTrees) { + LoadInitialAccessibilityTreeFromHtmlFilePath( + "/accessibility/html/replaced-node-across-trees.html"); + auto* web_contents = static_cast<WebContentsImpl*>(shell()->web_contents()); + WaitForAccessibilityTreeToContainNodeWithName(web_contents, "Text in iframe"); + + auto* before_frame_node = + FindNode(ax::mojom::Role::kStaticText, "Before frame"); + ASSERT_NE(nullptr, before_frame_node); + + // 1. Test when |start_| and |end_| are both not in the iframe. + { + ComPtr<ITextRangeProvider> text_range_provider; + GetTextRangeProviderFromTextNode(*before_frame_node, &text_range_provider); + ASSERT_NE(nullptr, text_range_provider.Get()); + EXPECT_UIA_TEXTRANGE_EQ(text_range_provider, L"Before frame"); + + AccessibilityNotificationWaiter waiter(web_contents, ui::kAXModeComplete, + ax::mojom::Event::kChildrenChanged); + + // Updating the style on that particular node is going to invalidate the + // leaf text node and will replace it with a new one with the updated style. + // We don't care about the style - we use it to trigger a node replacement. + EXPECT_TRUE(ExecuteScript( + web_contents, + "document.getElementById('s1').style.outline = '1px solid black';")); + + waiter.WaitForNotification(); + EXPECT_UIA_TEXTRANGE_EQ(text_range_provider, L"Before frame"); + } + + // 1. Test when |start_| is not in the iframe but |end_| is. + { + ComPtr<ITextRangeProvider> text_range_provider; + GetTextRangeProviderFromTextNode(*before_frame_node, &text_range_provider); + ASSERT_NE(nullptr, text_range_provider.Get()); + EXPECT_UIA_TEXTRANGE_EQ(text_range_provider, L"Before frame"); + + // Move the range from "<B>efore frame<>" to "<B>efore frame/nText< >" + EXPECT_UIA_MOVE_ENDPOINT_BY_UNIT( + text_range_provider, TextPatternRangeEndpoint_End, TextUnit_Word, + /*count*/ 1, + /*expected_text*/ L"Before frame\nText ", + /*expected_count*/ 1); + + AccessibilityNotificationWaiter waiter(web_contents, ui::kAXModeComplete, + ax::mojom::Event::kChildrenChanged); + + // Updating the style on that particular node is going to invalidate the + // leaf text node and will replace it with a new one with the updated style. + // We don't care about the style - we use it to trigger a node replacement. + EXPECT_TRUE(ExecuteScript( + web_contents, + "document.getElementsByTagName('iframe')[0].contentWindow.document." + "getElementById('s1').style.outline = '1px solid black';")); + + waiter.WaitForNotification(); + EXPECT_UIA_TEXTRANGE_EQ(text_range_provider, L"Before frame\nText "); + } + + // 1. Test when |start_| is in the iframe but |end_| is not. + { + ComPtr<ITextRangeProvider> text_range_provider; + auto* after_frame_node = + FindNode(ax::mojom::Role::kStaticText, "After frame"); + ASSERT_NE(nullptr, after_frame_node); + GetTextRangeProviderFromTextNode(*after_frame_node, &text_range_provider); + ASSERT_NE(nullptr, text_range_provider.Get()); + EXPECT_UIA_TEXTRANGE_EQ(text_range_provider, L"After frame"); + + // Move the range from "<B>efore frame<>" to "<B>efore frame/nText< >" + EXPECT_UIA_MOVE_ENDPOINT_BY_UNIT( + text_range_provider, TextPatternRangeEndpoint_Start, TextUnit_Word, + /*count*/ -1, + /*expected_text*/ L"iframe\nAfter frame", + /*expected_count*/ -1); + + AccessibilityNotificationWaiter waiter(web_contents, ui::kAXModeComplete, + ax::mojom::Event::kChildrenChanged); + + // Updating the style on that particular node is going to invalidate the + // leaf text node and will replace it with a new one with the updated style. + // We don't care about the style - we use it to trigger a node replacement. + EXPECT_TRUE(ExecuteScript( + web_contents, + "document.getElementById('s2').style.outline = '1px solid black';")); + + waiter.WaitForNotification(); + EXPECT_UIA_TEXTRANGE_EQ(text_range_provider, L"iframe\nAfter frame"); + } +} + } // namespace content
diff --git a/content/browser/accessibility/browser_accessibility_manager.cc b/content/browser/accessibility/browser_accessibility_manager.cc index cb1c6e75..33afdfd0 100644 --- a/content/browser/accessibility/browser_accessibility_manager.cc +++ b/content/browser/accessibility/browser_accessibility_manager.cc
@@ -1427,6 +1427,14 @@ return wrapper ? wrapper->node() : nullptr; } +void BrowserAccessibilityManager::AddObserver(ui::AXTreeObserver* observer) { + ax_tree()->AddObserver(observer); +} + +void BrowserAccessibilityManager::RemoveObserver(ui::AXTreeObserver* observer) { + ax_tree()->RemoveObserver(observer); +} + AXTreeID BrowserAccessibilityManager::GetTreeID() const { return ax_tree_id(); }
diff --git a/content/browser/accessibility/browser_accessibility_manager.h b/content/browser/accessibility/browser_accessibility_manager.h index ec263568..1e9e6be 100644 --- a/content/browser/accessibility/browser_accessibility_manager.h +++ b/content/browser/accessibility/browser_accessibility_manager.h
@@ -447,6 +447,8 @@ ui::AXNode* GetNodeFromTree(ui::AXTreeID tree_id, ui::AXNode::AXID node_id) const override; ui::AXNode* GetNodeFromTree(ui::AXNode::AXID node_id) const override; + void AddObserver(ui::AXTreeObserver* observer) override; + void RemoveObserver(ui::AXTreeObserver* observer) override; AXTreeID GetTreeID() const override; AXTreeID GetParentTreeID() const override; ui::AXNode* GetRootAsAXNode() const override;
diff --git a/content/browser/keyboard_lock_browsertest.cc b/content/browser/keyboard_lock_browsertest.cc index 5282d9b..94119c1 100644 --- a/content/browser/keyboard_lock_browsertest.cc +++ b/content/browser/keyboard_lock_browsertest.cc
@@ -649,7 +649,7 @@ // The first child has the same origin as the top-level domain. RenderFrameHost* child_frame = ChildFrameAt(web_contents()->GetMainFrame(), - /*child_index=*/0); + /*index=*/0); ASSERT_TRUE(child_frame); bool api_exists = false; @@ -671,7 +671,7 @@ // The second child has a different origin as the top-level domain. RenderFrameHost* child_frame = ChildFrameAt(web_contents()->GetMainFrame(), - /*child_index=*/1); + /*index=*/1); ASSERT_TRUE(child_frame); bool api_exists = false;
diff --git a/content/shell/fuchsia/content_shell.cmx b/content/shell/fuchsia/content_shell.cmx index 57b1ccd..52b93fa 100644 --- a/content/shell/fuchsia/content_shell.cmx +++ b/content/shell/fuchsia/content_shell.cmx
@@ -4,6 +4,7 @@ "deprecated-ambient-replace-as-executable", "isolated-persistent-storage", "isolated-temp", + "root-ssl-certificates", "vulkan" ], "services": [
diff --git a/content/test/data/accessibility/html/frame/static_text_2.html b/content/test/data/accessibility/html/frame/static_text_2.html new file mode 100644 index 0000000..1618ba9 --- /dev/null +++ b/content/test/data/accessibility/html/frame/static_text_2.html
@@ -0,0 +1,6 @@ +<!DOCTYPE html> +<html> + +<body><span id="s1">Text in iframe</span></body> + +</html> \ No newline at end of file
diff --git a/content/test/data/accessibility/html/replaced-node-across-trees.html b/content/test/data/accessibility/html/replaced-node-across-trees.html new file mode 100644 index 0000000..7f1a44ed --- /dev/null +++ b/content/test/data/accessibility/html/replaced-node-across-trees.html
@@ -0,0 +1,13 @@ +<!DOCTYPE html> +<html> + +<body> + <span id="s1">Before frame</span> + <div> + <iframe aria-label="Cross-process iframe" src="frame/static_text_2.html"> + </iframe> + </div> + <span id="s2">After frame</span> +</body> + +</html> \ No newline at end of file
diff --git a/device/fido/pin.cc b/device/fido/pin.cc index 6075fab9..a8c6aa4 100644 --- a/device/fido/pin.cc +++ b/device/fido/pin.cc
@@ -264,8 +264,28 @@ return base::nullopt; } + std::vector<uint8_t> token = + ProtocolVersion(protocol).Decrypt(shared_key, encrypted_token); + + // The token must have the correct size for the given protocol. + switch (protocol) { + case PINUVAuthProtocol::kV1: + // In CTAP2.1, V1 tokens are fixed at 16 or 32 bytes. But in CTAP2.0 they + // may be any multiple of 16 bytes. We don't know the CTAP version, so + // only enforce the latter. + if (token.empty() || token.size() % AES_BLOCK_SIZE != 0) { + return base::nullopt; + } + break; + case PINUVAuthProtocol::kV2: + if (token.size() != 32u) { + return base::nullopt; + } + break; + } + TokenResponse ret(protocol); - ret.token_ = ProtocolVersion(protocol).Decrypt(shared_key, encrypted_token); + ret.token_ = std::move(token); return ret; }
diff --git a/device/fido/pin_internal.cc b/device/fido/pin_internal.cc index 369fa35..d5cc2820 100644 --- a/device/fido/pin_internal.cc +++ b/device/fido/pin_internal.cc
@@ -114,7 +114,12 @@ std::vector<uint8_t> Authenticate( base::span<const uint8_t> key, base::span<const uint8_t> data) const override { - DCHECK_EQ(key.size(), kSharedKeySize); + // Authenticate can be invoked with the shared secret or with a PIN/UV Auth + // Token. In CTAP2.1, V1 tokens are fixed at 16 or 32 bytes. But in CTAP2.0 + // they may be any multiple of 16 bytes. We don't know the CTAP version, so + // only enforce the latter. + static_assert(kSharedKeySize == 32u, ""); + DCHECK_EQ(key.size() % AES_BLOCK_SIZE, 0u); std::vector<uint8_t> pin_auth(SHA256_DIGEST_LENGTH); unsigned hmac_bytes; @@ -165,6 +170,7 @@ static constexpr size_t kAESKeyLength = 32; static constexpr size_t kHMACKeyLength = 32; static constexpr size_t kSharedKeyLength = kAESKeyLength + kHMACKeyLength; + static constexpr size_t kPINUVAuthTokenLength = 32; static constexpr size_t kSignatureSize = SHA256_DIGEST_LENGTH; // GetHMACSubKey returns the HMAC-key portion of the shared secret. @@ -236,12 +242,13 @@ base::span<const uint8_t> key, base::span<const uint8_t> data) const override { // Authenticate can be invoked with the shared secret or with a PIN/UV Auth - // Token, which is fixed at 32 bytes in this protocol version. - CHECK(key.size() == kSharedKeyLength || key.size() == kHMACKeyLength); + // Token, which is fixed at 32 bytes in V2. + DCHECK(key.size() == kSharedKeyLength || + key.size() == kPINUVAuthTokenLength); const base::span<const uint8_t, kHMACKeyLength> hmac_key = (key.size() == kSharedKeyLength ? GetHMACSubKey(base::make_span<kSharedKeyLength>(key)) - : base::make_span<kHMACKeyLength>(key)); + : base::make_span<kPINUVAuthTokenLength>(key)); std::vector<uint8_t> pin_auth(SHA256_DIGEST_LENGTH); unsigned hmac_bytes;
diff --git a/extensions/browser/api/networking_config/networking_config_service.cc b/extensions/browser/api/networking_config/networking_config_service.cc index 025f907..f18c29fe 100644 --- a/extensions/browser/api/networking_config/networking_config_service.cc +++ b/extensions/browser/api/networking_config/networking_config_service.cc
@@ -35,18 +35,6 @@ return true; } -std::string LookUpExtensionName(content::BrowserContext* context, - std::string extension_id) { - extensions::ExtensionRegistry* extension_registry = - extensions::ExtensionRegistry::Get(context); - DCHECK(extension_registry); - const extensions::Extension* extension = extension_registry->GetExtensionById( - extension_id, extensions::ExtensionRegistry::ENABLED); - if (extension == nullptr) - return std::string(); - return extension->name(); -} - } // namespace NetworkingConfigService::AuthenticationResult::AuthenticationResult() @@ -115,27 +103,15 @@ return false; } - chromeos::NetworkHandler::Get() - ->network_state_handler() - ->SetCaptivePortalProviderForHexSsid( - hex_ssid, extension_id, - LookUpExtensionName(browser_context_, extension_id)); + // This method no longer actually does anything. TODO(1124419) Remove the + // networking.config API entirely in a follow-up. return true; } void NetworkingConfigService::UnregisterExtension( const std::string& extension_id) { - for (auto it = hex_ssid_to_extension_id_.begin(); - it != hex_ssid_to_extension_id_.end();) { - if (it->second == extension_id) { - chromeos::NetworkHandler::Get() - ->network_state_handler() - ->SetCaptivePortalProviderForHexSsid(it->first, "", ""); - it = hex_ssid_to_extension_id_.erase(it); - } else { - ++it; - } - } + // This method no longer actually does anything. TODO(1124419) Remove the + // networking.config API entirely in a follow-up. } const NetworkingConfigService::AuthenticationResult&
diff --git a/extensions/shell/browser/shell_desktop_controller_aura.cc b/extensions/shell/browser/shell_desktop_controller_aura.cc index ea1f2bcc..58a660ef9 100644 --- a/extensions/shell/browser/shell_desktop_controller_aura.cc +++ b/extensions/shell/browser/shell_desktop_controller_aura.cc
@@ -17,7 +17,7 @@ #include "ui/aura/window.h" #include "ui/aura/window_tree_host.h" #include "ui/base/cursor/cursor.h" -#include "ui/base/cursor/image_cursors.h" +#include "ui/base/cursor/cursor_loader.h" #include "ui/base/cursor/mojom/cursor_type.mojom-shared.h" #include "ui/base/ime/init/input_method_factory.h" #include "ui/base/ime/input_method.h" @@ -57,21 +57,21 @@ public: explicit ShellNativeCursorManager( ShellDesktopControllerAura* desktop_controller) - : desktop_controller_(desktop_controller), - image_cursors_(new ui::ImageCursors) {} + : desktop_controller_(desktop_controller) {} ~ShellNativeCursorManager() override {} // wm::NativeCursorManager overrides. void SetDisplay(const display::Display& display, wm::NativeCursorManagerDelegate* delegate) override { - if (image_cursors_->SetDisplay(display, display.device_scale_factor())) + if (cursor_loader_->SetDisplayData(display.panel_rotation(), + display.device_scale_factor())) SetCursor(delegate->GetCursor(), delegate); } void SetCursor(gfx::NativeCursor cursor, wm::NativeCursorManagerDelegate* delegate) override { - image_cursors_->SetPlatformCursor(&cursor); - cursor.set_image_scale_factor(image_cursors_->GetScale()); + cursor_loader_->SetPlatformCursor(&cursor); + cursor.set_image_scale_factor(cursor_loader_->scale()); delegate->CommitCursor(cursor); if (delegate->IsCursorVisible()) @@ -86,14 +86,14 @@ SetCursor(delegate->GetCursor(), delegate); } else { gfx::NativeCursor invisible_cursor(ui::mojom::CursorType::kNone); - image_cursors_->SetPlatformCursor(&invisible_cursor); + cursor_loader_->SetPlatformCursor(&invisible_cursor); SetCursorOnAllRootWindows(invisible_cursor); } } void SetCursorSize(ui::CursorSize cursor_size, wm::NativeCursorManagerDelegate* delegate) override { - image_cursors_->SetCursorSize(cursor_size); + cursor_loader_->set_size(cursor_size); delegate->CommitCursorSize(cursor_size); if (delegate->IsCursorVisible()) SetCursor(delegate->GetCursor(), delegate); @@ -115,7 +115,8 @@ ShellDesktopControllerAura* desktop_controller_; // Not owned. - std::unique_ptr<ui::ImageCursors> image_cursors_; + std::unique_ptr<ui::CursorLoader> cursor_loader_ = + ui::CursorLoader::Create(/*use_platform_cursors=*/false); DISALLOW_COPY_AND_ASSIGN(ShellNativeCursorManager); };
diff --git a/infra/config/generated/commit-queue.cfg b/infra/config/generated/commit-queue.cfg index 464297f..18a7f3d 100644 --- a/infra/config/generated/commit-queue.cfg +++ b/infra/config/generated/commit-queue.cfg
@@ -295,7 +295,6 @@ } builders { name: "chromium/try/android-pie-arm64-rel" - experiment_percentage: 100 location_regexp: ".*" location_regexp_exclude: ".+/[+]/docs/.+" location_regexp_exclude: ".+/[+]/infra/config/.+"
diff --git a/infra/config/generated/cq-builders.md b/infra/config/generated/cq-builders.md index bb33903..b65ff58 100644 --- a/infra/config/generated/cq-builders.md +++ b/infra/config/generated/cq-builders.md
@@ -23,6 +23,8 @@ * [android-marshmallow-arm64-rel](https://ci.chromium.org/p/chromium/builders/try/android-marshmallow-arm64-rel) ([definition](https://cs.chromium.org/search?q=package:%5Echromium$+file:/cq.star$+-file:/beta/+-file:/stable/+android-marshmallow-arm64-rel)) ([matching builders](https://cs.chromium.org/search?q=+file:trybots.py+android-marshmallow-arm64-rel)) +* [android-pie-arm64-rel](https://ci.chromium.org/p/chromium/builders/try/android-pie-arm64-rel) ([definition](https://cs.chromium.org/search?q=package:%5Echromium$+file:/cq.star$+-file:/beta/+-file:/stable/+android-pie-arm64-rel)) ([matching builders](https://cs.chromium.org/search?q=+file:trybots.py+android-pie-arm64-rel)) + * [android_compile_dbg](https://ci.chromium.org/p/chromium/builders/try/android_compile_dbg) ([definition](https://cs.chromium.org/search?q=package:%5Echromium$+file:/cq.star$+-file:/beta/+-file:/stable/+android_compile_dbg)) ([matching builders](https://cs.chromium.org/search?q=+file:trybots.py+android_compile_dbg)) * [android_cronet](https://ci.chromium.org/p/chromium/builders/try/android_cronet) ([definition](https://cs.chromium.org/search?q=package:%5Echromium$+file:/cq.star$+-file:/beta/+-file:/stable/+android_cronet)) ([matching builders](https://cs.chromium.org/search?q=+file:trybots.py+android_cronet)) @@ -345,9 +347,6 @@ * [android-marshmallow-x86-rel](https://ci.chromium.org/p/chromium/builders/try/android-marshmallow-x86-rel) ([definition](https://cs.chromium.org/search?q=package:%5Echromium$+file:/cq.star$+-file:/beta/+-file:/stable/+android-marshmallow-x86-rel)) ([matching builders](https://cs.chromium.org/search?q=+file:trybots.py+android-marshmallow-x86-rel)) * Experiment percentage: 100 -* [android-pie-arm64-rel](https://ci.chromium.org/p/chromium/builders/try/android-pie-arm64-rel) ([definition](https://cs.chromium.org/search?q=package:%5Echromium$+file:/cq.star$+-file:/beta/+-file:/stable/+android-pie-arm64-rel)) ([matching builders](https://cs.chromium.org/search?q=+file:trybots.py+android-pie-arm64-rel)) - * Experiment percentage: 100 - * [fuchsia-compile-x64-dbg](https://ci.chromium.org/p/chromium/builders/try/fuchsia-compile-x64-dbg) ([definition](https://cs.chromium.org/search?q=package:%5Echromium$+file:/cq.star$+-file:/beta/+-file:/stable/+fuchsia-compile-x64-dbg)) ([matching builders](https://cs.chromium.org/search?q=+file:trybots.py+fuchsia-compile-x64-dbg)) * Experiment percentage: 50
diff --git a/infra/config/lib/branches.star b/infra/config/lib/branches.star index e459129..16730a8 100644 --- a/infra/config/lib/branches.star +++ b/infra/config/lib/branches.star
@@ -9,16 +9,28 @@ that controls what branches the definition is actually executed for. If `branch_selector` doesn't match the current branch as determined by values on the `settings` struct in '//project.star', then the resource is not defined. The -`branch_selector argument` can be one of the following constants: -* MAIN_ONLY - The resource is defined only for main/master/trunk +`branch_selector` argument can be one of the following constants referring to +the category of the branch: +* MAIN - The resource is defined only for main/master/trunk [`settings.is_master`] -* STANDARD_RELEASES - The resource is defined for main/master/trunk and beta and - stable branches - [`settings.is_master and not settings.is_lts_branch`] -* ALL_RELEASES - The resource is defined for main/master/trunk, beta and stable - branches and LTC/LTS branches - [`True`] -The constants are also accessible via the `branches` struct. +* STANDARD_BRANCHES - The resource is defined only for the beta and stable + branches. + [`not settings.is_master and not settings.is_lts_branch`] +* LTS_BRANCHES - The resource is defined only for the long-term support branches + (LTC and LTR). + [`not settings.is_master and settings.is_lts_branch`] + +The `branch_selector` argument can also be one of the following constants +composing multiple categories: +* STANDARD_MILESTONES - The resource is defined for a branch as it moves through + the standad release channels: trunk -> beta -> stable. +* LTS_MILESTONES - The resource is defined for a branch as it move through the + long-term suport release channels: trunk -> beta -> stable -> LTC -> LTR. +* ALL_BRANCHES - The resource is defined for all branches and main/master/trunk. +* NOT_MAIN - The resource is defined for all branches, but not for + main/master/trunk. + +The `branch_selector` constants are also accessible via the `branches` struct. For other uses cases where execution needs to vary by branch, the following are also accessible via the `branches` struct: @@ -34,21 +46,32 @@ def _branch_selector(tag): return struct(__branch_selector__ = tag) -MAIN_ONLY = _branch_selector("MAIN_ONLY") -STANDARD_RELEASES = _branch_selector("STANDARD_RELEASES") -ALL_RELEASES = _branch_selector("ALL_RELEASES") +MAIN = _branch_selector("MAIN") +STANDARD_BRANCHES = _branch_selector("STANDARD_BRANCHES") +LTS_BRANCHES = _branch_selector("LTS_BRANCHES") -_BRANCH_SELECTORS = (MAIN_ONLY, STANDARD_RELEASES, ALL_RELEASES) +_BRANCH_SELECTORS = (MAIN, STANDARD_BRANCHES, LTS_BRANCHES) def _matches(branch_selector): """Returns whether `branch_selector` matches the project settings.""" - if branch_selector == MAIN_ONLY: - return settings.is_master - if branch_selector == STANDARD_RELEASES: - return settings.is_master or not settings.is_lts_branch - if branch_selector == ALL_RELEASES: - return True - fail("branch_selector must be one of {}, got {!r}".format(_BRANCH_SELECTORS, branch_selector)) + if type(branch_selector) == type(struct()): + branch_selectors = [branch_selector] + else: + branch_selectors = branch_selector + for b in branch_selectors: + if b == MAIN: + if settings.is_master: + return True + elif b == STANDARD_BRANCHES: + if not settings.is_master and not settings.is_lts_branch: + return True + elif b == LTS_BRANCHES: + if settings.is_lts_branch: + return True + else: + fail("elements of branch_selectors must be one of {}, got {!r}" + .format(_BRANCH_SELECTORS, b)) + return False def _value(*, for_main = None, for_branches = None): """Provide a value that varies between main/master/trunk and branches. @@ -59,14 +82,14 @@ """ return for_main if settings.is_master else for_branches -def _exec(module, *, branch_selector = MAIN_ONLY): +def _exec(module, *, branch_selector = MAIN): """Execute `module` if `branch_selector` matches the project settings.""" if not _matches(branch_selector): return exec(module) def _make_branch_conditional(fn): - def conditional_fn(*args, branch_selector = MAIN_ONLY, **kwargs): + def conditional_fn(*args, branch_selector = MAIN, **kwargs): if not _matches(branch_selector): return fn(*args, **kwargs) @@ -74,9 +97,20 @@ return conditional_fn branches = struct( - MAIN_ONLY = MAIN_ONLY, - STANDARD_RELEASES = STANDARD_RELEASES, - ALL_RELEASES = ALL_RELEASES, + # Basic branch selectors + MAIN = MAIN, + STANDARD_BRANCHES = STANDARD_BRANCHES, + LTS_BRANCHES = LTS_BRANCHES, + + # Branch selectors for tracking milestones through release channels + STANDARD_MILESTONE = [MAIN, STANDARD_BRANCHES], + LTS_MILESTONE = [MAIN, STANDARD_BRANCHES, LTS_BRANCHES], + + # Branch selectors to apply widely to branches + ALL_BRANCHES = _BRANCH_SELECTORS, + NOT_MAIN = [b for b in _BRANCH_SELECTORS if b != MAIN], + + # Branch functions matches = _matches, exec = _exec, value = _value,
diff --git a/infra/config/lib/builders.star b/infra/config/lib/builders.star index 0817e3f..16bdf56 100644 --- a/infra/config/lib/builders.star +++ b/infra/config/lib/builders.star
@@ -282,7 +282,7 @@ def builder( *, name, - branch_selector = branches.MAIN_ONLY, + branch_selector = branches.MAIN, bucket = args.DEFAULT, executable = args.DEFAULT, triggered_by = args.DEFAULT,
diff --git a/infra/config/lib/ci.star b/infra/config/lib/ci.star index 123f149..1ebbb4d 100644 --- a/infra/config/lib/ci.star +++ b/infra/config/lib/ci.star
@@ -31,7 +31,7 @@ refs = None, ) -def declare_bucket(milestone_vars, *, branch_selector = branches.MAIN_ONLY): +def declare_bucket(milestone_vars, *, branch_selector = branches.MAIN): if not branches.matches(branch_selector): return @@ -318,7 +318,7 @@ categories = categories or [], ) -def console_view(*, name, branch_selector = branches.MAIN_ONLY, ordering = None, **kwargs): +def console_view(*, name, branch_selector = branches.MAIN, ordering = None, **kwargs): """Create a console view, optionally providing an entry ordering. Args: @@ -365,7 +365,7 @@ ordering = ordering or {}, ) -def overview_console_view(*, name, top_level_ordering, branch_selector = branches.MAIN_ONLY, **kwargs): +def overview_console_view(*, name, top_level_ordering, branch_selector = branches.MAIN, **kwargs): """Create an overview console view. An overview console view is a console view that contains a subset of @@ -418,7 +418,7 @@ def ci_builder( *, name, - branch_selector = branches.MAIN_ONLY, + branch_selector = branches.MAIN, add_to_console_view = args.DEFAULT, console_view = args.DEFAULT, main_console_view = args.DEFAULT,
diff --git a/infra/config/lib/swarming.star b/infra/config/lib/swarming.star index 7477a7f..1e5c796 100644 --- a/infra/config/lib/swarming.star +++ b/infra/config/lib/swarming.star
@@ -12,7 +12,7 @@ Noop on a non-main branch, since Swarming pools are owned by the primary Chromium project defined on the main branch. """ - if not branches.matches(branches.MAIN_ONLY): + if not branches.matches(branches.MAIN): return # Allow admins to cancel any task, delete bots, etc. in any Chromium pool. @@ -41,7 +41,7 @@ Pools are owned by the main Chromium project and it makes sense to defined them only on the main branch. This declaration is noop on a non-main branch. """ - if not branches.matches(branches.MAIN_ONLY): + if not branches.matches(branches.MAIN): return if not name.startswith("pools/"): fail("By convention Swarming pool realm name should start with pools/") @@ -89,7 +89,7 @@ """ # Permission to submit tasks to Swarming at all. - if branches.matches(branches.MAIN_ONLY): + if branches.matches(branches.MAIN): luci.binding( realm = pool_realm, roles = "role/swarming.poolUser",
diff --git a/infra/config/lib/try.star b/infra/config/lib/try.star index d004597..e0ce1e36 100644 --- a/infra/config/lib/try.star +++ b/infra/config/lib/try.star
@@ -39,7 +39,7 @@ subproject_list_view = None, ) -def declare_bucket(milestone_vars, *, branch_selector = branches.MAIN_ONLY): +def declare_bucket(milestone_vars, *, branch_selector = branches.MAIN): if not branches.matches(branch_selector): return @@ -152,7 +152,7 @@ lucicfg.generator(_sort_console_entries) -def list_view(*, name, branch_selector = branches.MAIN_ONLY, **kwargs): +def list_view(*, name, branch_selector = branches.MAIN, **kwargs): if not branches.matches(branch_selector): return @@ -201,7 +201,7 @@ def try_builder( *, name, - branch_selector = branches.MAIN_ONLY, + branch_selector = branches.MAIN, add_to_list_view = args.DEFAULT, cq_group = args.DEFAULT, list_view = args.DEFAULT,
diff --git a/infra/config/notifiers.star b/infra/config/notifiers.star index 25788c7..46b1dfb 100644 --- a/infra/config/notifiers.star +++ b/infra/config/notifiers.star
@@ -63,7 +63,7 @@ ) def tree_closer(*, name, tree_status_host, **kwargs): - if branches.matches(branches.MAIN_ONLY): + if branches.matches(branches.MAIN): luci.tree_closer( name = name, tree_status_host = tree_status_host, @@ -84,7 +84,7 @@ ) def tree_closure_notifier(*, name, **kwargs): - if branches.matches(branches.MAIN_ONLY): + if branches.matches(branches.MAIN): luci.notifier( name = name, on_occurrence = ["FAILURE"],
diff --git a/infra/config/project.star b/infra/config/project.star index cbeb279..7ff3b9f7 100644 --- a/infra/config/project.star +++ b/infra/config/project.star
@@ -25,6 +25,12 @@ tree_status_host = "chromium-status.appspot.com/", ) +def _validate_settings(): + if settings.is_master and settings.is_lts_branch: + fail("is_master and is_lts_branch can't both be True") + +_validate_settings() + def _generate_project_pyl(ctx): ctx.output["project.pyl"] = "\n".join([ "# This is a non-LUCI generated file",
diff --git a/infra/config/subprojects/chromium/ci.star b/infra/config/subprojects/chromium/ci.star index 31edec9..a6baf65 100644 --- a/infra/config/subprojects/chromium/ci.star +++ b/infra/config/subprojects/chromium/ci.star
@@ -15,13 +15,13 @@ add_to_console_view = True, ) -ci.declare_bucket(settings, branch_selector = branches.ALL_RELEASES) +ci.declare_bucket(settings, branch_selector = branches.ALL_BRANCHES) # Automatically maintained consoles ci.console_view( name = "chromium", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, include_experimental_builds = True, ordering = { "*type*": ci.ordering(short_names = ["dbg", "rel", "off"]), @@ -35,7 +35,7 @@ ci.console_view( name = "chromium.android", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, ordering = { None: ["cronet", "builder", "tester"], "*cpu*": ["arm", "arm64", "x86"], @@ -56,7 +56,7 @@ ci.console_view( name = "chromium.chromiumos", - branch_selector = branches.ALL_RELEASES, + branch_selector = branches.ALL_BRANCHES, ordering = { None: ["default"], "default": ci.ordering(short_names = ["ful", "rel"]), @@ -92,7 +92,7 @@ ci.console_view( name = "chromium.dawn", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, ordering = { None: ["ToT"], "*builder*": ["Builder"], @@ -110,7 +110,7 @@ ci.console_view( name = "chromium.fyi", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, ordering = { None: [ "code_coverage", @@ -173,7 +173,7 @@ ci.console_view( name = "chromium.gpu", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, ordering = { None: ["Windows", "Mac", "Linux"], }, @@ -212,7 +212,7 @@ ci.console_view( name = "chromium.linux", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, ordering = { None: ["release", "debug"], "release": ci.ordering(short_names = ["bld", "tst", "nsl", "gcc"]), @@ -222,7 +222,7 @@ ci.console_view( name = "chromium.mac", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, ordering = { None: ["release"], "release": ci.ordering(short_names = ["bld"]), @@ -233,7 +233,7 @@ ci.console_view( name = "chromium.memory", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, ordering = { None: ["win", "mac", "linux", "cros"], "*build-or-test*": ci.ordering(short_names = ["bld", "tst"]), @@ -268,7 +268,7 @@ ci.console_view( name = "chromium.win", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, ordering = { None: ["release", "debug"], "debug|builder": ci.ordering(short_names = ["64", "32"]), @@ -436,7 +436,7 @@ ci.android_builder( name = "Android WebView M (dbg)", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, console_view_entry = ci.console_view_entry( category = "tester|webview", short_name = "M", @@ -448,7 +448,7 @@ ci.android_builder( name = "Android WebView N (dbg)", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, console_view_entry = ci.console_view_entry( category = "tester|webview", short_name = "N", @@ -460,7 +460,7 @@ ci.android_builder( name = "Android WebView O (dbg)", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, console_view_entry = ci.console_view_entry( category = "tester|webview", short_name = "O", @@ -472,7 +472,7 @@ ci.android_builder( name = "Android WebView P (dbg)", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, console_view_entry = ci.console_view_entry( category = "tester|webview", short_name = "P", @@ -484,7 +484,7 @@ ci.android_builder( name = "Android arm Builder (dbg)", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, console_view_entry = ci.console_view_entry( category = "builder|arm", short_name = "32", @@ -497,7 +497,7 @@ ci.android_builder( name = "Android arm64 Builder (dbg)", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, console_view_entry = ci.console_view_entry( category = "builder|arm", short_name = "64", @@ -511,7 +511,7 @@ ci.android_builder( name = "Android x64 Builder (dbg)", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, console_view_entry = ci.console_view_entry( category = "builder|x86", short_name = "64", @@ -523,7 +523,7 @@ ci.android_builder( name = "Android x86 Builder (dbg)", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, console_view_entry = ci.console_view_entry( category = "builder|x86", short_name = "32", @@ -535,7 +535,7 @@ ci.android_builder( name = "Cast Android (dbg)", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, console_view_entry = ci.console_view_entry( category = "on_cq", short_name = "cst", @@ -595,7 +595,7 @@ ci.android_builder( name = "Marshmallow 64 bit Tester", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, console_view_entry = ci.console_view_entry( category = "tester|phone", short_name = "M", @@ -619,7 +619,7 @@ ci.android_builder( name = "Nougat Phone Tester", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, console_view_entry = ci.console_view_entry( category = "tester|phone", short_name = "N", @@ -631,7 +631,7 @@ ci.android_builder( name = "Oreo Phone Tester", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, console_view_entry = ci.console_view_entry( category = "tester|phone", short_name = "O", @@ -678,7 +678,7 @@ ci.android_builder( name = "android-cronet-arm-dbg", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, console_view_entry = ci.console_view_entry( category = "cronet|arm", short_name = "dbg", @@ -690,7 +690,7 @@ ci.android_builder( name = "android-cronet-arm-rel", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, console_view_entry = ci.console_view_entry( category = "cronet|arm", short_name = "rel", @@ -728,7 +728,7 @@ ci.android_builder( name = "android-cronet-arm-rel-kitkat-tests", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, console_view_entry = ci.console_view_entry( category = "cronet|test", short_name = "k", @@ -741,7 +741,7 @@ ci.android_builder( name = "android-cronet-arm-rel-lollipop-tests", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, console_view_entry = ci.console_view_entry( category = "cronet|test", short_name = "l", @@ -803,7 +803,7 @@ ci.android_builder( name = "android-lollipop-arm-rel", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, console_view_entry = ci.console_view_entry( category = "on_cq", short_name = "L", @@ -815,7 +815,7 @@ ci.android_builder( name = "android-marshmallow-arm64-rel", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, console_view_entry = ci.console_view_entry( category = "on_cq", short_name = "M", @@ -827,7 +827,7 @@ ci.android_builder( name = "android-marshmallow-x86-rel", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, console_view_entry = ci.console_view_entry( category = "builder_tester|x86", short_name = "M", @@ -846,7 +846,7 @@ ci.android_builder( name = "android-nougat-arm64-rel", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, console_view_entry = ci.console_view_entry( category = "builder_tester|arm64", short_name = "N", @@ -857,7 +857,7 @@ ci.android_builder( name = "android-pie-arm64-dbg", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, console_view_entry = ci.console_view_entry( category = "tester|phone", short_name = "P", @@ -869,7 +869,7 @@ ci.android_builder( name = "android-pie-arm64-rel", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, console_view_entry = ci.console_view_entry( category = "on_cq", short_name = "P", @@ -953,7 +953,7 @@ ci.chromium_builder( name = "android-official", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, main_console_view = settings.main_console_name, console_view_entry = ci.console_view_entry( category = "android", @@ -965,7 +965,7 @@ ci.chromium_builder( name = "fuchsia-official", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, main_console_view = settings.main_console_name, console_view_entry = ci.console_view_entry( category = "fuchsia", @@ -1002,7 +1002,7 @@ ci.chromium_builder( name = "linux-official", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, builderless = False, # TODO(https://crbug.com/1072012) Use the default console view and add # main_console_view = settings.main_console_name once the build is green @@ -1085,7 +1085,7 @@ ci.chromium_builder( name = "win-official", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, main_console_view = settings.main_console_name, console_view_entry = ci.console_view_entry( category = "win|off", @@ -1122,7 +1122,7 @@ ci.chromium_builder( name = "win32-official", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, main_console_view = settings.main_console_name, console_view_entry = ci.console_view_entry( category = "win|off", @@ -1163,7 +1163,7 @@ ci.chromiumos_builder( name = "chromeos-amd64-generic-dbg", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, console_view_entry = ci.console_view_entry( category = "simple|debug|x64", short_name = "dbg", @@ -1174,7 +1174,7 @@ ci.chromiumos_builder( name = "chromeos-amd64-generic-lacros-dbg", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, console_view_entry = ci.console_view_entry( category = "lacros|x64", short_name = "dbg", @@ -1185,7 +1185,7 @@ ci.chromiumos_builder( name = "chromeos-amd64-generic-rel", - branch_selector = branches.ALL_RELEASES, + branch_selector = branches.ALL_BRANCHES, console_view_entry = ci.console_view_entry( category = "simple|release|x64", short_name = "rel", @@ -1205,7 +1205,7 @@ ci.chromiumos_builder( name = "chromeos-arm-generic-rel", - branch_selector = branches.ALL_RELEASES, + branch_selector = branches.ALL_BRANCHES, console_view_entry = ci.console_view_entry( category = "simple|release", short_name = "arm", @@ -1216,7 +1216,7 @@ ci.chromiumos_builder( name = "chromeos-kevin-rel", - branch_selector = branches.ALL_RELEASES, + branch_selector = branches.ALL_BRANCHES, console_view_entry = ci.console_view_entry( category = "simple|release", short_name = "kvn", @@ -1226,7 +1226,7 @@ ci.chromiumos_builder( name = "linux-chromeos-dbg", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, console_view_entry = ci.console_view_entry( category = "default", short_name = "dbg", @@ -1237,7 +1237,7 @@ ci.chromiumos_builder( name = "linux-chromeos-rel", - branch_selector = branches.ALL_RELEASES, + branch_selector = branches.ALL_BRANCHES, console_view_entry = ci.console_view_entry( category = "default", short_name = "rel", @@ -1248,7 +1248,7 @@ ci.chromiumos_builder( name = "linux-lacros-builder-rel", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, console_view_entry = ci.console_view_entry( category = "default", short_name = "lcr", @@ -1259,7 +1259,7 @@ ci.chromiumos_builder( name = "linux-lacros-tester-rel", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, console_view_entry = ci.console_view_entry( category = "default", short_name = "lcr", @@ -1580,7 +1580,7 @@ ci.dawn_linux_builder( name = "Dawn Linux x64 DEPS Builder", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, console_view_entry = ci.console_view_entry( category = "DEPS|Linux|Builder", short_name = "x64", @@ -1591,7 +1591,7 @@ ci.dawn_thin_tester( name = "Dawn Linux x64 DEPS Release (Intel HD 630)", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, console_view_entry = ci.console_view_entry( category = "DEPS|Linux|Intel", short_name = "x64", @@ -1603,7 +1603,7 @@ ci.dawn_thin_tester( name = "Dawn Linux x64 DEPS Release (NVIDIA)", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, console_view_entry = ci.console_view_entry( category = "DEPS|Linux|Nvidia", short_name = "x64", @@ -1641,7 +1641,7 @@ ci.dawn_mac_builder( name = "Dawn Mac x64 DEPS Builder", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, console_view_entry = ci.console_view_entry( category = "DEPS|Mac|Builder", short_name = "x64", @@ -1654,7 +1654,7 @@ # physical Mac hardware in the Swarming pool which is why they run on linux ci.dawn_thin_tester( name = "Dawn Mac x64 DEPS Release (AMD)", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, console_view_entry = ci.console_view_entry( category = "DEPS|Mac|AMD", short_name = "x64", @@ -1666,7 +1666,7 @@ ci.dawn_thin_tester( name = "Dawn Mac x64 DEPS Release (Intel)", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, console_view_entry = ci.console_view_entry( category = "DEPS|Mac|Intel", short_name = "x64", @@ -1712,7 +1712,7 @@ ci.dawn_windows_builder( name = "Dawn Win10 x64 DEPS Builder", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, console_view_entry = ci.console_view_entry( category = "DEPS|Windows|Builder", short_name = "x64", @@ -1725,7 +1725,7 @@ # physical Win hardware in the Swarming pool, which is why they run on linux ci.dawn_thin_tester( name = "Dawn Win10 x64 DEPS Release (Intel HD 630)", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, console_view_entry = ci.console_view_entry( category = "DEPS|Windows|Intel", short_name = "x64", @@ -1737,7 +1737,7 @@ ci.dawn_thin_tester( name = "Dawn Win10 x64 DEPS Release (NVIDIA)", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, console_view_entry = ci.console_view_entry( category = "DEPS|Windows|Nvidia", short_name = "x64", @@ -1775,7 +1775,7 @@ ci.dawn_windows_builder( name = "Dawn Win10 x86 DEPS Builder", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, console_view_entry = ci.console_view_entry( category = "DEPS|Windows|Builder", short_name = "x86", @@ -1788,7 +1788,7 @@ # physical Win hardware in the Swarming pool, which is why they run on linux ci.dawn_thin_tester( name = "Dawn Win10 x86 DEPS Release (Intel HD 630)", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, console_view_entry = ci.console_view_entry( category = "DEPS|Windows|Intel", short_name = "x86", @@ -1800,7 +1800,7 @@ ci.dawn_thin_tester( name = "Dawn Win10 x86 DEPS Release (NVIDIA)", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, console_view_entry = ci.console_view_entry( category = "DEPS|Windows|Nvidia", short_name = "x86", @@ -2215,7 +2215,7 @@ ci.fyi_builder( name = "VR Linux", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, console_view_entry = ci.console_view_entry( category = "linux", ), @@ -2759,7 +2759,7 @@ ci.fyi_ios_builder( name = "ios-simulator-cronet", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, caches = [xcode_cache.x11e146], console_view_entry = ci.console_view_entry( category = "cronet", @@ -2947,7 +2947,7 @@ ci.gpu_linux_builder( name = "Android Release (Nexus 5X)", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, console_view_entry = ci.console_view_entry( category = "Android", ), @@ -2957,7 +2957,7 @@ ci.gpu_linux_builder( name = "GPU Linux Builder", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, console_view_entry = ci.console_view_entry( category = "Linux", ), @@ -2975,7 +2975,7 @@ ci.gpu_mac_builder( name = "GPU Mac Builder", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, console_view_entry = ci.console_view_entry( category = "Mac", ), @@ -2993,7 +2993,7 @@ ci.gpu_windows_builder( name = "GPU Win x64 Builder", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, console_view_entry = ci.console_view_entry( category = "Windows", ), @@ -3020,7 +3020,7 @@ ci.gpu_thin_tester( name = "Linux Release (NVIDIA)", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, cq_mirrors_console_view = settings.cq_mirrors_console_name, console_view_entry = ci.console_view_entry( category = "Linux", @@ -3040,7 +3040,7 @@ ci.gpu_thin_tester( name = "Mac Release (Intel)", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, console_view_entry = ci.console_view_entry( category = "Mac", ), @@ -3060,7 +3060,7 @@ ci.gpu_thin_tester( name = "Mac Retina Release (AMD)", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, console_view_entry = ci.console_view_entry( category = "Mac", ), @@ -3080,7 +3080,7 @@ ci.gpu_thin_tester( name = "Win10 x64 Release (NVIDIA)", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, console_view_entry = ci.console_view_entry( category = "Windows", ), @@ -3823,7 +3823,7 @@ ci.linux_builder( name = "Cast Linux", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, console_view_entry = ci.console_view_entry( category = "cast", short_name = "vid", @@ -3875,7 +3875,7 @@ ci.linux_builder( name = "Fuchsia ARM64", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, console_view_entry = ci.console_view_entry( category = "fuchsia|a64", short_name = "rel", @@ -3887,7 +3887,7 @@ ci.linux_builder( name = "Fuchsia x64", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, console_view_entry = ci.console_view_entry( category = "fuchsia|x64", short_name = "rel", @@ -3910,7 +3910,7 @@ ci.linux_builder( name = "Linux Builder", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, console_view_entry = ci.console_view_entry( category = "release", short_name = "bld", @@ -3921,7 +3921,7 @@ ci.linux_builder( name = "Linux Builder (dbg)", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, console_view_entry = ci.console_view_entry( category = "debug|builder", short_name = "64", @@ -3941,7 +3941,7 @@ ci.linux_builder( name = "Linux Tests", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, console_view_entry = ci.console_view_entry( category = "release", short_name = "tst", @@ -3954,7 +3954,7 @@ ci.linux_builder( name = "Linux Tests (dbg)(1)", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, console_view_entry = ci.console_view_entry( category = "debug|tester", short_name = "64", @@ -3966,7 +3966,7 @@ ci.linux_builder( name = "fuchsia-arm64-cast", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, console_view_entry = ci.console_view_entry( category = "fuchsia|cast", short_name = "a64", @@ -3991,7 +3991,7 @@ ci.linux_builder( name = "fuchsia-x64-cast", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, console_view_entry = ci.console_view_entry( category = "fuchsia|cast", short_name = "x64", @@ -4036,7 +4036,7 @@ ci.linux_builder( name = "linux-ozone-rel", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, console_view_entry = ci.console_view_entry( category = "release", short_name = "ozo", @@ -4052,7 +4052,7 @@ ci.linux_builder( name = "Linux Ozone Tester (Headless)", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, console_view = "chromium.fyi", console_view_entry = ci.console_view_entry( category = "linux", @@ -4065,7 +4065,7 @@ ci.linux_builder( name = "Linux Ozone Tester (Wayland)", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, console_view = "chromium.fyi", console_view_entry = ci.console_view_entry( category = "linux", @@ -4078,7 +4078,7 @@ ci.linux_builder( name = "Linux Ozone Tester (X11)", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, console_view = "chromium.fyi", console_view_entry = ci.console_view_entry( category = "linux", @@ -4109,7 +4109,7 @@ ci.mac_builder( name = "Mac Builder", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, console_view_entry = ci.console_view_entry( category = "release", short_name = "bld", @@ -4121,7 +4121,7 @@ ci.mac_builder( name = "Mac Builder (dbg)", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, console_view_entry = ci.console_view_entry( category = "debug", short_name = "bld", @@ -4133,7 +4133,7 @@ ci.mac_builder( name = "mac-arm64-rel", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, console_view_entry = ci.console_view_entry( category = "release|arm64", short_name = "bld", @@ -4159,7 +4159,7 @@ ci.thin_tester( name = "Mac10.10 Tests", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, builder_group = "chromium.mac", console_view_entry = ci.console_view_entry( category = "release", @@ -4172,7 +4172,7 @@ ci.thin_tester( name = "Mac10.11 Tests", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, builder_group = "chromium.mac", console_view_entry = ci.console_view_entry( category = "release", @@ -4185,7 +4185,7 @@ ci.thin_tester( name = "Mac10.12 Tests", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, builder_group = "chromium.mac", console_view_entry = ci.console_view_entry( category = "release", @@ -4198,7 +4198,7 @@ ci.thin_tester( name = "Mac10.13 Tests", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, builder_group = "chromium.mac", console_view_entry = ci.console_view_entry( category = "release", @@ -4211,7 +4211,7 @@ ci.thin_tester( name = "Mac10.14 Tests", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, builder_group = "chromium.mac", console_view_entry = ci.console_view_entry( category = "release", @@ -4224,7 +4224,7 @@ ci.thin_tester( name = "Mac10.15 Tests", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, builder_group = "chromium.mac", console_view_entry = ci.console_view_entry( category = "release", @@ -4237,7 +4237,7 @@ ci.thin_tester( name = "Mac10.13 Tests (dbg)", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, builder_group = "chromium.mac", console_view_entry = ci.console_view_entry( category = "debug", @@ -4261,7 +4261,7 @@ ci.mac_ios_builder( name = "ios-simulator", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, console_view_entry = ci.console_view_entry( category = "ios|default", short_name = "sim", @@ -4272,7 +4272,7 @@ ci.mac_ios_builder( name = "ios-simulator-full-configs", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, console_view_entry = ci.console_view_entry( category = "ios|default", short_name = "ful", @@ -4310,7 +4310,7 @@ ci.memory_builder( name = "Linux ASan LSan Builder", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, console_view_entry = ci.console_view_entry( category = "linux|asan lsan", short_name = "bld", @@ -4322,7 +4322,7 @@ ci.memory_builder( name = "Linux ASan LSan Tests (1)", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, console_view_entry = ci.console_view_entry( category = "linux|asan lsan", short_name = "tst", @@ -4334,7 +4334,7 @@ ci.memory_builder( name = "Linux ASan Tests (sandboxed)", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, console_view_entry = ci.console_view_entry( category = "linux|asan lsan", short_name = "sbx", @@ -4346,7 +4346,7 @@ ci.memory_builder( name = "Linux TSan Builder", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, console_view_entry = ci.console_view_entry( category = "linux|TSan v2", short_name = "bld", @@ -4448,7 +4448,7 @@ ci.memory_builder( name = "Linux TSan Tests", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, console_view_entry = ci.console_view_entry( category = "linux|TSan v2", short_name = "tst", @@ -4761,7 +4761,7 @@ ci.win_builder( name = "Win7 Tests (dbg)(1)", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, console_view_entry = ci.console_view_entry( category = "debug|tester", short_name = "7", @@ -4774,7 +4774,7 @@ ci.win_builder( name = "Win 7 Tests x64 (1)", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, console_view_entry = ci.console_view_entry( category = "release|tester", short_name = "64", @@ -4787,7 +4787,7 @@ ci.win_builder( name = "Win Builder (dbg)", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, console_view_entry = ci.console_view_entry( category = "debug|builder", short_name = "32", @@ -4800,7 +4800,7 @@ ci.win_builder( name = "Win x64 Builder", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, console_view_entry = ci.console_view_entry( category = "release|builder", short_name = "64", @@ -4813,7 +4813,7 @@ ci.win_builder( name = "Win10 Tests x64", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, console_view_entry = ci.console_view_entry( category = "release|tester", short_name = "w10",
diff --git a/infra/config/subprojects/chromium/try.star b/infra/config/subprojects/chromium/try.star index 42cd7c4..65f69fe 100644 --- a/infra/config/subprojects/chromium/try.star +++ b/infra/config/subprojects/chromium/try.star
@@ -7,7 +7,7 @@ load("//lib/try.star", "try_") load("//project.star", "settings") -try_.declare_bucket(settings, branch_selector = branches.ALL_RELEASES) +try_.declare_bucket(settings, branch_selector = branches.ALL_BRANCHES) try_.set_defaults( settings, @@ -19,22 +19,22 @@ try_.list_view( name = "luci.chromium.try", - branch_selector = branches.ALL_RELEASES, + branch_selector = branches.ALL_BRANCHES, ) try_.list_view( name = "tryserver.blink", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, ) try_.list_view( name = "tryserver.chromium", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, ) try_.list_view( name = "tryserver.chromium.android", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, ) try_.list_view( @@ -43,7 +43,7 @@ try_.list_view( name = "tryserver.chromium.chromiumos", - branch_selector = branches.ALL_RELEASES, + branch_selector = branches.ALL_BRANCHES, ) try_.list_view( @@ -52,17 +52,17 @@ try_.list_view( name = "tryserver.chromium.dawn", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, ) try_.list_view( name = "tryserver.chromium.linux", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, ) try_.list_view( name = "tryserver.chromium.mac", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, ) try_.list_view( @@ -71,7 +71,7 @@ try_.list_view( name = "tryserver.chromium.win", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, ) # Builders are sorted first lexicographically by the function used to define @@ -84,7 +84,7 @@ try_.blink_builder( name = "linux-blink-rel", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, goma_backend = goma.backend.RBE_PROD, main_list_view = settings.main_list_view_name, tryjob = try_.job( @@ -134,39 +134,39 @@ try_.chromium_builder( name = "android-official", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, cores = 32, ) try_.chromium_builder( name = "fuchsia-official", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, cores = 32, ) try_.chromium_builder( name = "linux-official", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, cores = 32, ) try_.chromium_builder( name = "mac-official", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, cores = None, os = os.MAC_ANY, ) try_.chromium_builder( name = "win-official", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, os = os.WINDOWS_DEFAULT, cores = 32, ) try_.chromium_builder( name = "win32-official", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, os = os.WINDOWS_DEFAULT, cores = 32, ) @@ -185,7 +185,7 @@ try_.chromium_android_builder( name = "android-binary-size", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, executable = "recipe:binary_size_trybot", goma_jobs = goma.jobs.J150, main_list_view = settings.main_list_view_name, @@ -208,7 +208,7 @@ try_.chromium_android_builder( name = "android-cronet-arm-dbg", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, main_list_view = settings.main_list_view_name, tryjob = try_.job( location_regexp = [ @@ -245,7 +245,7 @@ try_.chromium_android_builder( name = "android-lollipop-arm-rel", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, goma_jobs = goma.jobs.J150, main_list_view = settings.main_list_view_name, tryjob = try_.job(), @@ -253,7 +253,7 @@ try_.chromium_android_builder( name = "android-marshmallow-arm64-rel", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, cores = 16, goma_jobs = goma.jobs.J300, main_list_view = settings.main_list_view_name, @@ -264,7 +264,7 @@ try_.chromium_android_builder( name = "android-marshmallow-x86-rel", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, cores = 16, goma_jobs = goma.jobs.J300, ssd = True, @@ -281,7 +281,7 @@ # back to NJH47F #try_.chromium_android_builder( # name = "android-nougat-arm64-rel", -# branch_selector = branches.STANDARD_RELEASES, +# branch_selector = branches.STANDARD_MILESTONE, # goma_jobs = goma.jobs.J150, # main_list_view = settings.main_list_view_name, #) @@ -300,7 +300,7 @@ try_.chromium_android_builder( name = "android-pie-arm64-dbg", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, goma_jobs = goma.jobs.J300, main_list_view = settings.main_list_view_name, tryjob = try_.job( @@ -321,15 +321,12 @@ try_.chromium_android_builder( name = "android-pie-arm64-rel", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, cores = 16, goma_jobs = goma.jobs.J300, ssd = True, - # TODO(crbug.com/1111436): Enable on CQ fully once the tests run fine. main_list_view = settings.main_list_view_name, - tryjob = try_.job( - experiment_percentage = 100, - ), + tryjob = try_.job(), ) try_.chromium_android_builder( @@ -398,7 +395,7 @@ try_.chromium_android_builder( name = "android_compile_dbg", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, goma_jobs = goma.jobs.J150, main_list_view = settings.main_list_view_name, tryjob = try_.job(), @@ -406,7 +403,7 @@ try_.chromium_android_builder( name = "android_compile_x64_dbg", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, main_list_view = settings.main_list_view_name, tryjob = try_.job( location_regexp = [ @@ -424,7 +421,7 @@ try_.chromium_android_builder( name = "android_compile_x86_dbg", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, main_list_view = settings.main_list_view_name, tryjob = try_.job( location_regexp = [ @@ -442,7 +439,7 @@ try_.chromium_android_builder( name = "android_cronet", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, main_list_view = settings.main_list_view_name, tryjob = try_.job(), ) @@ -461,7 +458,7 @@ try_.chromium_android_builder( name = "cast_shell_android", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, main_list_view = settings.main_list_view_name, tryjob = try_.job(), ) @@ -546,7 +543,7 @@ try_.chromium_chromiumos_builder( name = "chromeos-amd64-generic-dbg", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, main_list_view = settings.main_list_view_name, tryjob = try_.job( location_regexp = [ @@ -558,7 +555,7 @@ try_.chromium_chromiumos_builder( name = "chromeos-amd64-generic-rel", - branch_selector = branches.ALL_RELEASES, + branch_selector = branches.ALL_BRANCHES, main_list_view = settings.main_list_view_name, tryjob = try_.job(), ) @@ -569,14 +566,14 @@ try_.chromium_chromiumos_builder( name = "chromeos-arm-generic-rel", - branch_selector = branches.ALL_RELEASES, + branch_selector = branches.ALL_BRANCHES, main_list_view = settings.main_list_view_name, tryjob = try_.job(), ) try_.chromium_chromiumos_builder( name = "linux-chromeos-compile-dbg", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, main_list_view = settings.main_list_view_name, tryjob = try_.job(), ) @@ -587,7 +584,7 @@ try_.chromium_chromiumos_builder( name = "chromeos-kevin-rel", - branch_selector = branches.ALL_RELEASES, + branch_selector = branches.ALL_BRANCHES, main_list_view = settings.main_list_view_name, tryjob = try_.job( location_regexp = [ @@ -600,7 +597,7 @@ try_.chromium_chromiumos_builder( name = "linux-chromeos-rel", - branch_selector = branches.ALL_RELEASES, + branch_selector = branches.ALL_BRANCHES, goma_jobs = goma.jobs.J150, main_list_view = settings.main_list_view_name, tryjob = try_.job(cancel_stale = False), @@ -619,7 +616,7 @@ try_.chromium_dawn_builder( name = "dawn-linux-x64-deps-rel", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, main_list_view = settings.main_list_view_name, tryjob = try_.job( location_regexp = [ @@ -638,7 +635,7 @@ try_.chromium_dawn_builder( name = "dawn-mac-x64-deps-rel", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, main_list_view = settings.main_list_view_name, os = os.MAC_ANY, tryjob = try_.job( @@ -658,7 +655,7 @@ try_.chromium_dawn_builder( name = "dawn-win10-x64-deps-rel", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, main_list_view = settings.main_list_view_name, os = os.WINDOWS_ANY, tryjob = try_.job( @@ -678,7 +675,7 @@ try_.chromium_dawn_builder( name = "dawn-win10-x86-deps-rel", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, main_list_view = settings.main_list_view_name, os = os.WINDOWS_ANY, tryjob = try_.job( @@ -726,14 +723,14 @@ try_.chromium_linux_builder( name = "cast_shell_linux", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, main_list_view = settings.main_list_view_name, tryjob = try_.job(), ) try_.chromium_linux_builder( name = "chromium_presubmit", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, executable = "recipe:presubmit", goma_backend = None, main_list_view = settings.main_list_view_name, @@ -752,7 +749,7 @@ try_.chromium_linux_builder( name = "fuchsia-arm64-cast", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, main_list_view = settings.main_list_view_name, tryjob = try_.job( location_regexp = [ @@ -786,21 +783,21 @@ try_.chromium_linux_builder( name = "fuchsia-x64-cast", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, main_list_view = settings.main_list_view_name, tryjob = try_.job(), ) try_.chromium_linux_builder( name = "fuchsia_arm64", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, main_list_view = settings.main_list_view_name, tryjob = try_.job(), ) try_.chromium_linux_builder( name = "fuchsia_x64", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, main_list_view = settings.main_list_view_name, tryjob = try_.job(), ) @@ -876,7 +873,7 @@ try_.chromium_linux_builder( name = "linux-libfuzzer-asan-rel", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, executable = "recipe:chromium_libfuzzer_trybot", main_list_view = settings.main_list_view_name, tryjob = try_.job(), @@ -884,7 +881,7 @@ try_.chromium_linux_builder( name = "linux-ozone-rel", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, main_list_view = settings.main_list_view_name, tryjob = try_.job(), ) @@ -905,7 +902,7 @@ try_.chromium_linux_builder( name = "linux-rel", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, goma_jobs = goma.jobs.J150, main_list_view = settings.main_list_view_name, tryjob = try_.job(), @@ -956,7 +953,7 @@ try_.chromium_linux_builder( name = "linux_chromium_asan_rel_ng", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, goma_jobs = goma.jobs.J150, ssd = True, main_list_view = settings.main_list_view_name, @@ -994,7 +991,7 @@ try_.chromium_linux_builder( name = "linux_chromium_compile_dbg_ng", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, caches = [ swarming.cache( name = "builder", @@ -1012,7 +1009,7 @@ try_.chromium_linux_builder( name = "linux_chromium_dbg_ng", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, caches = [ swarming.cache( name = "builder", @@ -1034,7 +1031,7 @@ try_.chromium_linux_builder( name = "linux_chromium_tsan_rel_ng", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, goma_jobs = goma.jobs.J150, main_list_view = settings.main_list_view_name, tryjob = try_.job(), @@ -1046,7 +1043,7 @@ try_.chromium_linux_builder( name = "linux_layout_tests_composite_after_paint", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, main_list_view = settings.main_list_view_name, tryjob = try_.job( location_regexp = [ @@ -1060,7 +1057,7 @@ try_.chromium_linux_builder( name = "linux_layout_tests_layout_ng_disabled", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, main_list_view = settings.main_list_view_name, tryjob = try_.job( location_regexp = [ @@ -1095,7 +1092,7 @@ try_.chromium_linux_builder( name = "linux_vr", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, main_list_view = settings.main_list_view_name, tryjob = try_.job( location_regexp = [ @@ -1129,7 +1126,7 @@ try_.chromium_mac_builder( name = "mac-rel", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, use_clang_coverage = True, goma_jobs = goma.jobs.J150, main_list_view = settings.main_list_view_name, @@ -1139,7 +1136,7 @@ try_.chromium_mac_builder( name = "mac-arm64-rel", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, goma_jobs = goma.jobs.J150, os = os.MAC_10_15, ) @@ -1183,7 +1180,7 @@ try_.chromium_mac_builder( name = "mac_chromium_compile_dbg_ng", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, goma_jobs = goma.jobs.J150, os = os.MAC_DEFAULT, main_list_view = settings.main_list_view_name, @@ -1223,7 +1220,7 @@ try_.chromium_mac_ios_builder( name = "ios-simulator", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, main_list_view = settings.main_list_view_name, tryjob = try_.job(), ) @@ -1243,7 +1240,7 @@ try_.chromium_mac_ios_builder( name = "ios-simulator-cronet", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, caches = [xcode_cache.x11e146], main_list_view = settings.main_list_view_name, properties = { @@ -1263,7 +1260,7 @@ try_.chromium_mac_ios_builder( name = "ios-simulator-full-configs", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, main_list_view = settings.main_list_view_name, tryjob = try_.job( location_regexp = [ @@ -1322,7 +1319,7 @@ try_.chromium_win_builder( name = "win-libfuzzer-asan-rel", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, builderless = False, executable = "recipe:chromium_libfuzzer_trybot", main_list_view = settings.main_list_view_name, @@ -1336,7 +1333,7 @@ try_.chromium_win_builder( name = "win_chromium_compile_dbg_ng", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, goma_jobs = goma.jobs.J150, main_list_view = settings.main_list_view_name, tryjob = try_.job(cancel_stale = False), @@ -1384,7 +1381,7 @@ try_.chromium_win_builder( name = "win10_chromium_x64_rel_ng", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, goma_jobs = goma.jobs.J150, os = os.WINDOWS_10, ssd = True, @@ -1401,7 +1398,7 @@ try_.chromium_win_builder( name = "win7-rel", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, execution_timeout = 4 * time.hour + 30 * time.minute, goma_jobs = goma.jobs.J300, main_list_view = settings.main_list_view_name, @@ -1415,7 +1412,7 @@ try_.gpu_chromium_android_builder( name = "android_optional_gpu_tests_rel", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, main_list_view = settings.main_list_view_name, tryjob = try_.job( location_regexp = [ @@ -1441,7 +1438,7 @@ try_.gpu_chromium_linux_builder( name = "linux_optional_gpu_tests_rel", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, main_list_view = settings.main_list_view_name, tryjob = try_.job( location_regexp = [ @@ -1465,7 +1462,7 @@ try_.gpu_chromium_mac_builder( name = "mac_optional_gpu_tests_rel", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, main_list_view = settings.main_list_view_name, tryjob = try_.job( location_regexp = [ @@ -1490,7 +1487,7 @@ try_.gpu_chromium_win_builder( name = "win_optional_gpu_tests_rel", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, builderless = True, main_list_view = settings.main_list_view_name, os = os.WINDOWS_DEFAULT, @@ -1577,12 +1574,12 @@ chrome_internal_verifier( builder = "linux-chrome-beta", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, ) chrome_internal_verifier( builder = "linux-chrome-stable", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, ) chrome_internal_verifier( @@ -1599,12 +1596,12 @@ chrome_internal_verifier( builder = "mac-chrome-beta", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, ) chrome_internal_verifier( builder = "mac-chrome-stable", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, ) chrome_internal_verifier( @@ -1613,12 +1610,12 @@ chrome_internal_verifier( builder = "win-chrome-beta", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, ) chrome_internal_verifier( builder = "win-chrome-stable", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, ) chrome_internal_verifier( @@ -1627,10 +1624,10 @@ chrome_internal_verifier( builder = "win64-chrome-beta", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, ) chrome_internal_verifier( builder = "win64-chrome-stable", - branch_selector = branches.STANDARD_RELEASES, + branch_selector = branches.STANDARD_MILESTONE, )
diff --git a/ios/chrome/app/application_delegate/user_activity_handler.mm b/ios/chrome/app/application_delegate/user_activity_handler.mm index adcdc90..dab5e68 100644 --- a/ios/chrome/app/application_delegate/user_activity_handler.mm +++ b/ios/chrome/app/application_delegate/user_activity_handler.mm
@@ -170,10 +170,15 @@ base::mac::ObjCCastStrict<SearchInChromeIntent>( userActivity.interaction.intent); - if (intent && - [intent respondsToSelector:NSSelectorFromString(@"searchPhrase")] && - intent.searchPhrase && [intent.searchPhrase length]) { - startupParams.textQuery = intent.searchPhrase; + if (!intent) { + return NO; + } + + id searchPhrase = [intent valueForKey:@"searchPhrase"]; + + if ([searchPhrase isKindOfClass:[NSString class]] && + [searchPhrase length]) { + startupParams.textQuery = searchPhrase; } else { startupParams.postOpeningAction = FOCUS_OMNIBOX; }
diff --git a/ios/chrome/browser/prerender/preload_controller.mm b/ios/chrome/browser/prerender/preload_controller.mm index 60b1ae7..d9dccad7 100644 --- a/ios/chrome/browser/prerender/preload_controller.mm +++ b/ios/chrome/browser/prerender/preload_controller.mm
@@ -140,6 +140,14 @@ private: __weak id<PreloadCancelling> cancel_handler_ = nil; }; + +// Maximum time to let a cancelled webState attempt to finish restore. +static const size_t kMaximumCancelledWebStateDelay = 2; + +// Used to enable the workaround for a WebKit crash, see crbug.com/1032928. +const base::Feature kPreloadDelayWebStateReset{ + "PreloadDelayWebStateReset", base::FEATURE_DISABLED_BY_DEFAULT}; + } // namespace @interface PreloadController () <CRConnectionTypeObserverBridge, @@ -631,8 +639,49 @@ _webState->RemoveObserver(_webStateObserver.get()); breakpad::StopMonitoringURLsForPreloadWebState(_webState.get()); _webState->SetDelegate(nullptr); - _webState.reset(); + // Preload appears to trigger an edge-case crash in WebKit when a restore is + // triggered and cancelled before it can complete. This isn't specific to + // preload, but is very easy to trigger in preload. As a speculative fix, if + // a preload is in restore, don't destroy it until after restore is complete. + // This logic should really belong in WebState itself, so any attempt to + // destroy a WebState during restore will trigger this logic. Even better, + // this edge case crash should be fixed in WebKit: + // https://bugs.webkit.org/show_bug.cgi?id=217440. + // The crash in WebKit appears to be related to IPC throttling. Session + // restore can create a large number of IPC calls, which can then be + // throttled. It seems if the WKWebView is destroyed with this backlog of + // IPC calls, sometimes WebKit crashes. + // See crbug.com/1032928 for an explanation for how to trigger this crash. + // Note the timer should only be called if for some reason session restoration + // fails to complete -- thus preventing a WebState leak. + static bool delayPreloadDestroyWebState = + base::FeatureList::IsEnabled(kPreloadDelayWebStateReset); + if (delayPreloadDestroyWebState && + _webState->GetNavigationManager()->IsRestoreSessionInProgress()) { + __block std::unique_ptr<web::WebState> webState = std::move(_webState); + __block std::unique_ptr<base::OneShotTimer> resetTimer( + new base::OneShotTimer()); + auto reset_block = ^{ + if (webState) { + webState.reset(); + } + + if (resetTimer) { + resetTimer->Stop(); + resetTimer.reset(); + } + }; + resetTimer->Start( + FROM_HERE, base::TimeDelta::FromSeconds(kMaximumCancelledWebStateDelay), + base::BindOnce(reset_block)); + webState->GetNavigationManager()->AddRestoreCompletionCallback( + base::BindOnce(^{ + dispatch_async(dispatch_get_main_queue(), reset_block); + })); + } else { + _webState.reset(); + } self.prerenderedURL = GURL(); self.startTime = base::TimeTicks(); self.loadCompleted = NO;
diff --git a/ios/chrome/browser/sync/ios_trusted_vault_client.h b/ios/chrome/browser/sync/ios_trusted_vault_client.h index a45e36ba..60da0dd 100644 --- a/ios/chrome/browser/sync/ios_trusted_vault_client.h +++ b/ios/chrome/browser/sync/ios_trusted_vault_client.h
@@ -15,8 +15,8 @@ ~IOSTrustedVaultClient() override; // TrustedVaultClient implementation. - std::unique_ptr<Subscription> AddKeysChangedObserver( - const base::RepeatingClosure& closure) override; + void AddObserver(Observer* observer) override; + void RemoveObserver(Observer* observer) override; void FetchKeys( const CoreAccountInfo& account_info, base::OnceCallback<void(const std::vector<std::vector<uint8_t>>&)> @@ -30,8 +30,6 @@ void GetIsRecoverabilityDegraded( const CoreAccountInfo& account_info, base::OnceCallback<void(bool)> callback) override; - std::unique_ptr<Subscription> AddRecoverabilityObserver( - const base::RepeatingClosure& callback) override; void AddTrustedRecoveryMethod(const std::string& gaia_id, const std::vector<uint8_t>& public_key, base::OnceClosure callback) override;
diff --git a/ios/chrome/browser/sync/ios_trusted_vault_client.mm b/ios/chrome/browser/sync/ios_trusted_vault_client.mm index d72bc10..de85b1e 100644 --- a/ios/chrome/browser/sync/ios_trusted_vault_client.mm +++ b/ios/chrome/browser/sync/ios_trusted_vault_client.mm
@@ -17,17 +17,24 @@ IOSTrustedVaultClient::~IOSTrustedVaultClient() = default; -std::unique_ptr<IOSTrustedVaultClient::Subscription> -IOSTrustedVaultClient::AddKeysChangedObserver( - const base::RepeatingClosure& closure) { +void IOSTrustedVaultClient::AddObserver(Observer* observer) { ios::ChromeBrowserProvider* browser_provider = ios::GetChromeBrowserProvider(); ios::ChromeTrustedVaultService* trusted_vault_service = browser_provider->GetChromeTrustedVaultService(); - if (!trusted_vault_service) { - return nullptr; + if (trusted_vault_service) { + trusted_vault_service->AddObserver(observer); } - return trusted_vault_service->AddKeysChangedObserver(closure); +} + +void IOSTrustedVaultClient::RemoveObserver(Observer* observer) { + ios::ChromeBrowserProvider* browser_provider = + ios::GetChromeBrowserProvider(); + ios::ChromeTrustedVaultService* trusted_vault_service = + browser_provider->GetChromeTrustedVaultService(); + if (trusted_vault_service) { + trusted_vault_service->RemoveObserver(observer); + } } void IOSTrustedVaultClient::FetchKeys( @@ -73,13 +80,6 @@ std::move(callback).Run(false); } -std::unique_ptr<IOSTrustedVaultClient::Subscription> -IOSTrustedVaultClient::AddRecoverabilityObserver( - const base::RepeatingClosure& callback) { - // TODO(crbug.com/1100278): Needs implementation. - return nullptr; -} - void IOSTrustedVaultClient::AddTrustedRecoveryMethod( const std::string& gaia_id, const std::vector<uint8_t>& public_key,
diff --git a/ios/chrome/browser/ui/tab_grid/grid/BUILD.gn b/ios/chrome/browser/ui/tab_grid/grid/BUILD.gn index b261c4ae..2b4af22bc 100644 --- a/ios/chrome/browser/ui/tab_grid/grid/BUILD.gn +++ b/ios/chrome/browser/ui/tab_grid/grid/BUILD.gn
@@ -14,6 +14,8 @@ source_set("grid_ui") { sources = [ + "flow_layout.h", + "flow_layout.mm", "grid_cell.h", "grid_cell.mm", "grid_commands.h", @@ -30,8 +32,6 @@ "grid_view_controller.mm", "horizontal_layout.h", "horizontal_layout.mm", - "tab_switcher_layout.h", - "tab_switcher_layout.mm", ] configs += [ "//build/config/compiler:enable_arc" ]
diff --git a/ios/chrome/browser/ui/tab_grid/grid/flow_layout.h b/ios/chrome/browser/ui/tab_grid/grid/flow_layout.h new file mode 100644 index 0000000..cd252f9 --- /dev/null +++ b/ios/chrome/browser/ui/tab_grid/grid/flow_layout.h
@@ -0,0 +1,20 @@ +// Copyright 2020 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef IOS_CHROME_BROWSER_UI_TAB_GRID_GRID_FLOW_LAYOUT_H_ +#define IOS_CHROME_BROWSER_UI_TAB_GRID_GRID_FLOW_LAYOUT_H_ + +#import <UIKit/UIKit.h> + +// Collection view flow layout that displays items in a grid or horizontally. +// Items are square-ish. Item sizes adapt to the size classes they are shown in. +// Item deletions are animated. +@interface FlowLayout : UICollectionViewFlowLayout + +// Whether to animate item insertions and deletions. +@property(nonatomic, assign) BOOL animatesItemUpdates; + +@end + +#endif // IOS_CHROME_BROWSER_UI_TAB_GRID_GRID_FLOW_LAYOUT_H_
diff --git a/ios/chrome/browser/ui/tab_grid/grid/flow_layout.mm b/ios/chrome/browser/ui/tab_grid/grid/flow_layout.mm new file mode 100644 index 0000000..83d668c --- /dev/null +++ b/ios/chrome/browser/ui/tab_grid/grid/flow_layout.mm
@@ -0,0 +1,123 @@ +// Copyright 2020 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#import "ios/chrome/browser/ui/tab_grid/grid/flow_layout.h" + +#import "ios/chrome/browser/ui/tab_grid/grid/grid_constants.h" + +#if !defined(__has_feature) || !__has_feature(objc_arc) +#error "This file requires ARC support." +#endif + +@interface FlowLayout () +@property(nonatomic, strong) NSArray<NSIndexPath*>* indexPathsOfDeletingItems; +@property(nonatomic, strong) NSArray<NSIndexPath*>* indexPathsOfInsertingItems; +@end + +@implementation FlowLayout + +- (instancetype)init { + if (self = [super init]) { + _animatesItemUpdates = YES; + } + return self; +} + +#pragma mark - UICollectionViewLayout + +- (void)prepareForCollectionViewUpdates: + (NSArray<UICollectionViewUpdateItem*>*)updateItems { + [super prepareForCollectionViewUpdates:updateItems]; + // Track which items in this update are explicitly being deleted or inserted. + NSMutableArray<NSIndexPath*>* deletingItems = + [NSMutableArray arrayWithCapacity:updateItems.count]; + NSMutableArray<NSIndexPath*>* insertingItems = + [NSMutableArray arrayWithCapacity:updateItems.count]; + for (UICollectionViewUpdateItem* item in updateItems) { + switch (item.updateAction) { + case UICollectionUpdateActionDelete: + [deletingItems addObject:item.indexPathBeforeUpdate]; + break; + case UICollectionUpdateActionInsert: + [insertingItems addObject:item.indexPathAfterUpdate]; + break; + default: + break; + } + } + self.indexPathsOfDeletingItems = [deletingItems copy]; + self.indexPathsOfInsertingItems = [insertingItems copy]; +} + +- (UICollectionViewLayoutAttributes*) + finalLayoutAttributesForDisappearingItemAtIndexPath: + (NSIndexPath*)itemIndexPath { + // Return initial layout if animations are disabled. + if (!self.animatesItemUpdates) { + return [self layoutAttributesForItemAtIndexPath:itemIndexPath]; + } + // Note that this method is called for any item whose index path changing from + // |itemIndexPath|, which includes any items that were in the layout and whose + // index path is changing. For an item whose index path is changing, this + // method is called before + // -initialLayoutAttributesForAppearingItemAtIndexPath: + UICollectionViewLayoutAttributes* attributes = [[super + finalLayoutAttributesForDisappearingItemAtIndexPath:itemIndexPath] copy]; + // Disappearing items that aren't being deleted just use the default + // attributes. + if (![self.indexPathsOfDeletingItems containsObject:itemIndexPath]) { + return attributes; + } + // Cells being deleted scale to 0, and are z-positioned behind all others. + // (Note that setting the zIndex here actually has no effect, despite what is + // implied in the UIKit documentation). + attributes.zIndex = -10; + // Scaled down to 0% (or near enough). + CGAffineTransform transform = + CGAffineTransformScale(attributes.transform, /*sx=*/0.01, /*sy=*/0.01); + attributes.transform = transform; + // Fade out. + attributes.alpha = 0.0; + return attributes; +} + +- (UICollectionViewLayoutAttributes*) + initialLayoutAttributesForAppearingItemAtIndexPath: + (NSIndexPath*)itemIndexPath { + // Return final layout if animations are disabled. + if (!self.animatesItemUpdates) { + return [self layoutAttributesForItemAtIndexPath:itemIndexPath]; + } + // Note that this method is called for any item whose index path is becoming + // |itemIndexPath|, which includes any items that were in the layout but whose + // index path is changing. For an item whose index path is changing, this + // method is called after + // -finalLayoutAttributesForDisappearingItemAtIndexPath: + UICollectionViewLayoutAttributes* attributes = [[super + initialLayoutAttributesForAppearingItemAtIndexPath:itemIndexPath] copy]; + // Appearing items that aren't being inserted just use the default + // attributes. + if (![self.indexPathsOfInsertingItems containsObject:itemIndexPath]) { + return attributes; + } + // TODO(crbug.com/820410) : Polish the animation, and put constants where they + // belong. + // Cells being inserted start faded out, scaled down, and drop downwards + // slightly. + attributes.alpha = 0.0; + CGAffineTransform transform = + CGAffineTransformScale(attributes.transform, /*sx=*/0.9, /*sy=*/0.9); + transform = CGAffineTransformTranslate(transform, /*tx=*/0, + /*ty=*/attributes.size.height * 0.1); + attributes.transform = transform; + return attributes; +} + +- (void)finalizeCollectionViewUpdates { + self.indexPathsOfDeletingItems = @[]; + self.indexPathsOfInsertingItems = @[]; + [super finalizeCollectionViewUpdates]; +} + +@end
diff --git a/ios/chrome/browser/ui/tab_grid/grid/grid_layout.h b/ios/chrome/browser/ui/tab_grid/grid/grid_layout.h index d4c2253..e6657a2 100644 --- a/ios/chrome/browser/ui/tab_grid/grid/grid_layout.h +++ b/ios/chrome/browser/ui/tab_grid/grid/grid_layout.h
@@ -5,10 +5,10 @@ #ifndef IOS_CHROME_BROWSER_UI_TAB_GRID_GRID_GRID_LAYOUT_H_ #define IOS_CHROME_BROWSER_UI_TAB_GRID_GRID_GRID_LAYOUT_H_ -#import "ios/chrome/browser/ui/tab_grid/grid/tab_switcher_layout.h" +#import "ios/chrome/browser/ui/tab_grid/grid/flow_layout.h" -// A specialization of TabSwitcherLayout that displays items in a grid. -@interface GridLayout : TabSwitcherLayout +// A specialization of FlowLayout that displays items in a grid. +@interface GridLayout : FlowLayout @end // A specialization of GridLayout that shows the UI in its "reordering" state,
diff --git a/ios/chrome/browser/ui/tab_grid/grid/grid_view_controller.mm b/ios/chrome/browser/ui/tab_grid/grid/grid_view_controller.mm index e552872..0566b78 100644 --- a/ios/chrome/browser/ui/tab_grid/grid/grid_view_controller.mm +++ b/ios/chrome/browser/ui/tab_grid/grid/grid_view_controller.mm
@@ -74,7 +74,7 @@ // Animator to show or hide the empty state. @property(nonatomic, strong) UIViewPropertyAnimator* emptyStateAnimator; // The default layout for the tab switcher. -@property(nonatomic, strong) TabSwitcherLayout* defaultLayout; +@property(nonatomic, strong) FlowLayout* defaultLayout; // The layout for the tab grid. @property(nonatomic, strong) GridLayout* gridLayout; // The layout for the thumb strip. @@ -697,7 +697,7 @@ - (void)willTransitionToLayout:(LayoutSwitcherState)nextState completion: (void (^)(BOOL completed, BOOL finished))completion { - TabSwitcherLayout* nextLayout; + FlowLayout* nextLayout; switch (nextState) { case LayoutSwitcherState::Horizontal: nextLayout = self.horizontalLayout;
diff --git a/ios/chrome/browser/ui/tab_grid/grid/horizontal_layout.h b/ios/chrome/browser/ui/tab_grid/grid/horizontal_layout.h index 5566d90f..a9c6103 100644 --- a/ios/chrome/browser/ui/tab_grid/grid/horizontal_layout.h +++ b/ios/chrome/browser/ui/tab_grid/grid/horizontal_layout.h
@@ -5,10 +5,10 @@ #ifndef IOS_CHROME_BROWSER_UI_TAB_GRID_GRID_HORIZONTAL_LAYOUT_H_ #define IOS_CHROME_BROWSER_UI_TAB_GRID_GRID_HORIZONTAL_LAYOUT_H_ -#import "ios/chrome/browser/ui/tab_grid/grid/tab_switcher_layout.h" +#import "ios/chrome/browser/ui/tab_grid/grid/flow_layout.h" -// A specialization of TabSwitcherLayout that displays items horizontally. -@interface HorizontalLayout : TabSwitcherLayout +// A specialization of FlowLayout that displays items horizontally. +@interface HorizontalLayout : FlowLayout @end #endif // IOS_CHROME_BROWSER_UI_TAB_GRID_GRID_HORIZONTAL_LAYOUT_H_
diff --git a/ios/chrome/browser/ui/tab_grid/grid/tab_switcher_layout.h b/ios/chrome/browser/ui/tab_grid/grid/tab_switcher_layout.h deleted file mode 100644 index f5d491b..0000000 --- a/ios/chrome/browser/ui/tab_grid/grid/tab_switcher_layout.h +++ /dev/null
@@ -1,20 +0,0 @@ -// Copyright 2020 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef IOS_CHROME_BROWSER_UI_TAB_GRID_GRID_TAB_SWITCHER_LAYOUT_H_ -#define IOS_CHROME_BROWSER_UI_TAB_GRID_GRID_TAB_SWITCHER_LAYOUT_H_ - -#import <UIKit/UIKit.h> - -// Collection view flow layout that displays items in a grid or horizontally. -// Items are square-ish. Item sizes adapt to the size classes they are shown in. -// Item deletions are animated. -@interface TabSwitcherLayout : UICollectionViewFlowLayout - -// Whether to animate item insertions and deletions. -@property(nonatomic, assign) BOOL animatesItemUpdates; - -@end - -#endif // IOS_CHROME_BROWSER_UI_TAB_GRID_GRID_TAB_SWITCHER_LAYOUT_H_
diff --git a/ios/chrome/browser/ui/tab_grid/grid/tab_switcher_layout.mm b/ios/chrome/browser/ui/tab_grid/grid/tab_switcher_layout.mm deleted file mode 100644 index f7f5a2c..0000000 --- a/ios/chrome/browser/ui/tab_grid/grid/tab_switcher_layout.mm +++ /dev/null
@@ -1,123 +0,0 @@ -// Copyright 2020 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#import "ios/chrome/browser/ui/tab_grid/grid/tab_switcher_layout.h" - -#import "ios/chrome/browser/ui/tab_grid/grid/grid_constants.h" - -#if !defined(__has_feature) || !__has_feature(objc_arc) -#error "This file requires ARC support." -#endif - -@interface TabSwitcherLayout () -@property(nonatomic, strong) NSArray<NSIndexPath*>* indexPathsOfDeletingItems; -@property(nonatomic, strong) NSArray<NSIndexPath*>* indexPathsOfInsertingItems; -@end - -@implementation TabSwitcherLayout - -- (instancetype)init { - if (self = [super init]) { - _animatesItemUpdates = YES; - } - return self; -} - -#pragma mark - UICollectionViewLayout - -- (void)prepareForCollectionViewUpdates: - (NSArray<UICollectionViewUpdateItem*>*)updateItems { - [super prepareForCollectionViewUpdates:updateItems]; - // Track which items in this update are explicitly being deleted or inserted. - NSMutableArray<NSIndexPath*>* deletingItems = - [NSMutableArray arrayWithCapacity:updateItems.count]; - NSMutableArray<NSIndexPath*>* insertingItems = - [NSMutableArray arrayWithCapacity:updateItems.count]; - for (UICollectionViewUpdateItem* item in updateItems) { - switch (item.updateAction) { - case UICollectionUpdateActionDelete: - [deletingItems addObject:item.indexPathBeforeUpdate]; - break; - case UICollectionUpdateActionInsert: - [insertingItems addObject:item.indexPathAfterUpdate]; - break; - default: - break; - } - } - self.indexPathsOfDeletingItems = [deletingItems copy]; - self.indexPathsOfInsertingItems = [insertingItems copy]; -} - -- (UICollectionViewLayoutAttributes*) - finalLayoutAttributesForDisappearingItemAtIndexPath: - (NSIndexPath*)itemIndexPath { - // Return initial layout if animations are disabled. - if (!self.animatesItemUpdates) { - return [self layoutAttributesForItemAtIndexPath:itemIndexPath]; - } - // Note that this method is called for any item whose index path changing from - // |itemIndexPath|, which includes any items that were in the layout and whose - // index path is changing. For an item whose index path is changing, this - // method is called before - // -initialLayoutAttributesForAppearingItemAtIndexPath: - UICollectionViewLayoutAttributes* attributes = [[super - finalLayoutAttributesForDisappearingItemAtIndexPath:itemIndexPath] copy]; - // Disappearing items that aren't being deleted just use the default - // attributes. - if (![self.indexPathsOfDeletingItems containsObject:itemIndexPath]) { - return attributes; - } - // Cells being deleted scale to 0, and are z-positioned behind all others. - // (Note that setting the zIndex here actually has no effect, despite what is - // implied in the UIKit documentation). - attributes.zIndex = -10; - // Scaled down to 0% (or near enough). - CGAffineTransform transform = - CGAffineTransformScale(attributes.transform, /*sx=*/0.01, /*sy=*/0.01); - attributes.transform = transform; - // Fade out. - attributes.alpha = 0.0; - return attributes; -} - -- (UICollectionViewLayoutAttributes*) - initialLayoutAttributesForAppearingItemAtIndexPath: - (NSIndexPath*)itemIndexPath { - // Return final layout if animations are disabled. - if (!self.animatesItemUpdates) { - return [self layoutAttributesForItemAtIndexPath:itemIndexPath]; - } - // Note that this method is called for any item whose index path is becoming - // |itemIndexPath|, which includes any items that were in the layout but whose - // index path is changing. For an item whose index path is changing, this - // method is called after - // -finalLayoutAttributesForDisappearingItemAtIndexPath: - UICollectionViewLayoutAttributes* attributes = [[super - initialLayoutAttributesForAppearingItemAtIndexPath:itemIndexPath] copy]; - // Appearing items that aren't being inserted just use the default - // attributes. - if (![self.indexPathsOfInsertingItems containsObject:itemIndexPath]) { - return attributes; - } - // TODO(crbug.com/820410) : Polish the animation, and put constants where they - // belong. - // Cells being inserted start faded out, scaled down, and drop downwards - // slightly. - attributes.alpha = 0.0; - CGAffineTransform transform = - CGAffineTransformScale(attributes.transform, /*sx=*/0.9, /*sy=*/0.9); - transform = CGAffineTransformTranslate(transform, /*tx=*/0, - /*ty=*/attributes.size.height * 0.1); - attributes.transform = transform; - return attributes; -} - -- (void)finalizeCollectionViewUpdates { - self.indexPathsOfDeletingItems = @[]; - self.indexPathsOfInsertingItems = @[]; - [super finalizeCollectionViewUpdates]; -} - -@end
diff --git a/ios/chrome/browser/ui/util/keyboard_observer_helper.mm b/ios/chrome/browser/ui/util/keyboard_observer_helper.mm index 694e287..5deb1b8 100644 --- a/ios/chrome/browser/ui/util/keyboard_observer_helper.mm +++ b/ios/chrome/browser/ui/util/keyboard_observer_helper.mm
@@ -24,6 +24,10 @@ @property(nonatomic, readwrite, getter=getKeyboardState) KeyboardState keyboardState; +// The last known keyboard view. If this changes, it probably means that the +// application lost focus in multiwindow mode. +@property(nonatomic, weak) UIView* keyboardView; + @end @implementation KeyboardObserverHelper @@ -172,8 +176,10 @@ isUndocked != self.keyboardState.isUndocked || isSplit != self.keyboardState.isSplit || isHardware != self.keyboardState.isHardware || - isPicker != self.keyboardState.isPicker) { + isPicker != self.keyboardState.isPicker || + keyboardView != self.keyboardView) { self.keyboardState = {isVisible, isUndocked, isSplit, isHardware, isPicker}; + self.keyboardView = keyboardView; dispatch_async(dispatch_get_main_queue(), ^{ [self.consumer keyboardWillChangeToState:self.keyboardState]; });
diff --git a/ios/chrome/test/BUILD.gn b/ios/chrome/test/BUILD.gn index 4c7ba28..5eeb481 100644 --- a/ios/chrome/test/BUILD.gn +++ b/ios/chrome/test/BUILD.gn
@@ -338,6 +338,7 @@ "//ios/chrome/content_widget_extension:unit_tests", "//ios/chrome/credential_provider_extension:unit_tests", "//ios/chrome/search_widget_extension:unit_tests", + "//ios/public/provider/chrome/browser/signin:unit_tests", "//ios/testing:http_server_bundle_data", ]
diff --git a/ios/public/provider/chrome/browser/signin/BUILD.gn b/ios/public/provider/chrome/browser/signin/BUILD.gn index afdd9fe..b5a012e9 100644 --- a/ios/public/provider/chrome/browser/signin/BUILD.gn +++ b/ios/public/provider/chrome/browser/signin/BUILD.gn
@@ -22,6 +22,7 @@ ] deps = [ "//base", + "//components/sync/driver", "//google_apis", ] } @@ -74,3 +75,15 @@ ] deps = [ "//base" ] } + +source_set("unit_tests") { + configs += [ "//build/config/compiler:enable_arc" ] + testonly = true + sources = [ "chrome_trusted_vault_service_unittest.mm" ] + deps = [ + ":signin", + "//base", + "//testing/gmock", + "//testing/gtest", + ] +}
diff --git a/ios/public/provider/chrome/browser/signin/DEPS b/ios/public/provider/chrome/browser/signin/DEPS index a812063..c0eb56f 100644 --- a/ios/public/provider/chrome/browser/signin/DEPS +++ b/ios/public/provider/chrome/browser/signin/DEPS
@@ -1,3 +1,7 @@ +include_rules = [ + "+components/sync/driver/trusted_vault_client.h", +] + specific_include_rules = { "test_signin_resources_provider\.mm": [ "+ui/base/test/ios/ui_image_test_utils.h",
diff --git a/ios/public/provider/chrome/browser/signin/chrome_trusted_vault_service.h b/ios/public/provider/chrome/browser/signin/chrome_trusted_vault_service.h index ac2bcb9..120a00b 100644 --- a/ios/public/provider/chrome/browser/signin/chrome_trusted_vault_service.h +++ b/ios/public/provider/chrome/browser/signin/chrome_trusted_vault_service.h
@@ -5,10 +5,13 @@ #ifndef IOS_PUBLIC_PROVIDER_CHROME_BROWSER_SIGNIN_CHROME_TRUSTED_VAULT_SERVICE_H_ #define IOS_PUBLIC_PROVIDER_CHROME_BROWSER_SIGNIN_CHROME_TRUSTED_VAULT_SERVICE_H_ +#include <memory> #include <vector> #include "base/callback.h" #include "base/callback_list.h" +#include "base/observer_list.h" +#include "components/sync/driver/trusted_vault_client.h" @class ChromeIdentity; @class UIViewController; @@ -27,9 +30,14 @@ ChromeTrustedVaultService& operator=(const ChromeTrustedVaultService&) = delete; + using Observer = syncer::TrustedVaultClient::Observer; using CallbackList = base::CallbackList<void()>; using Subscription = CallbackList::Subscription; + // Adds/removes observers. + void AddObserver(Observer* observer); + void RemoveObserver(Observer* observer); + // Asynchronously fetch the shared keys for |identity| // and returns them by calling |callback|. virtual void FetchKeys( @@ -48,8 +56,20 @@ // synchronously. virtual void CancelReauthentication(BOOL animated, void (^callback)(void)) = 0; + // TODO(crbug.com/1100278): Delete this deprecated function. virtual std::unique_ptr<Subscription> AddKeysChangedObserver( - const base::RepeatingClosure& cb) = 0; + const base::RepeatingClosure& cb); + + protected: + // Functions to notify observers. + void NotifyKeysChanged(); + void NotifyRecoverabilityChanged(); + + private: + base::ObserverList<Observer> observer_list_; + // TODO(crbug.com/1100278): Delete this field onceAddKeysChangedObserver() is + // cleaned up. + std::unique_ptr<Subscription> deprecated_keys_changed_subscription_; }; } // namespace ios
diff --git a/ios/public/provider/chrome/browser/signin/chrome_trusted_vault_service.mm b/ios/public/provider/chrome/browser/signin/chrome_trusted_vault_service.mm index 4bd1f52..790236c 100644 --- a/ios/public/provider/chrome/browser/signin/chrome_trusted_vault_service.mm +++ b/ios/public/provider/chrome/browser/signin/chrome_trusted_vault_service.mm
@@ -14,4 +14,38 @@ ChromeTrustedVaultService::~ChromeTrustedVaultService() {} +void ChromeTrustedVaultService::AddObserver(Observer* observer) { + observer_list_.AddObserver(observer); + + if (!deprecated_keys_changed_subscription_) { + // base::Unretained() is safe because the subscription is stored in a member + // field and hence cannot outlive |this|. + deprecated_keys_changed_subscription_ = AddKeysChangedObserver( + base::BindRepeating(&ChromeTrustedVaultService::NotifyKeysChanged, + base::Unretained(this))); + } +} + +void ChromeTrustedVaultService::RemoveObserver(Observer* observer) { + observer_list_.RemoveObserver(observer); +} + +std::unique_ptr<ChromeTrustedVaultService::Subscription> +ChromeTrustedVaultService::AddKeysChangedObserver( + const base::RepeatingClosure& cb) { + return nullptr; +} + +void ChromeTrustedVaultService::NotifyKeysChanged() { + for (Observer& observer : observer_list_) { + observer.OnTrustedVaultKeysChanged(); + } +} + +void ChromeTrustedVaultService::NotifyRecoverabilityChanged() { + for (Observer& observer : observer_list_) { + observer.OnTrustedVaultRecoverabilityChanged(); + } +} + } // namespace ios
diff --git a/ios/public/provider/chrome/browser/signin/chrome_trusted_vault_service_unittest.mm b/ios/public/provider/chrome/browser/signin/chrome_trusted_vault_service_unittest.mm new file mode 100644 index 0000000..6d17f635 --- /dev/null +++ b/ios/public/provider/chrome/browser/signin/chrome_trusted_vault_service_unittest.mm
@@ -0,0 +1,80 @@ +// Copyright 2020 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#import "ios/public/provider/chrome/browser/signin/chrome_trusted_vault_service.h" + +#import "testing/gmock/include/gmock/gmock.h" +#import "testing/gtest/include/gtest/gtest.h" +#import "testing/platform_test.h" + +#if !defined(__has_feature) || !__has_feature(objc_arc) +#error "This file requires ARC support." +#endif + +namespace ios { + +namespace { + +class TestChromeTrustedVaultService : public ChromeTrustedVaultService { + public: + TestChromeTrustedVaultService() = default; + ~TestChromeTrustedVaultService() override = default; + + // Expose publicly for testing. + using ChromeTrustedVaultService::NotifyKeysChanged; + using ChromeTrustedVaultService::NotifyRecoverabilityChanged; + + // ChromeTrustedVaultService overrides. + void FetchKeys(ChromeIdentity* chrome_identity, + base::OnceCallback<void(const TrustedVaultSharedKeyList&)> + callback) override {} + void Reauthentication(ChromeIdentity* chrome_identity, + UIViewController* presentingViewController, + void (^callback)(BOOL success, + NSError* error)) override {} + void CancelReauthentication(BOOL animated, void (^callback)(void)) override {} +}; + +class MockObserver : public syncer::TrustedVaultClient::Observer { + public: + MockObserver() = default; + ~MockObserver() override = default; + + MOCK_METHOD0(OnTrustedVaultKeysChanged, void()); + MOCK_METHOD0(OnTrustedVaultRecoverabilityChanged, void()); +}; + +using ChromeTrustedVaultServiceTest = PlatformTest; + +TEST_F(ChromeTrustedVaultServiceTest, ShouldNotifyKeysChanged) { + testing::NiceMock<MockObserver> observer; + TestChromeTrustedVaultService service; + service.AddObserver(&observer); + + EXPECT_CALL(observer, OnTrustedVaultKeysChanged()); + service.NotifyKeysChanged(); +} + +TEST_F(ChromeTrustedVaultServiceTest, ShouldNotifyRecoverabilityChanged) { + testing::NiceMock<MockObserver> observer; + TestChromeTrustedVaultService service; + service.AddObserver(&observer); + + EXPECT_CALL(observer, OnTrustedVaultRecoverabilityChanged()); + service.NotifyRecoverabilityChanged(); +} + +TEST_F(ChromeTrustedVaultServiceTest, ShouldRemoveObserver) { + testing::NiceMock<MockObserver> observer; + TestChromeTrustedVaultService service; + service.AddObserver(&observer); + service.RemoveObserver(&observer); + + EXPECT_CALL(observer, OnTrustedVaultKeysChanged()).Times(0); + service.NotifyKeysChanged(); +} + +} // namespace + +} // namespace ios
diff --git a/media/base/media_switches.cc b/media/base/media_switches.cc index 104d51d..3f33a1e 100644 --- a/media/base/media_switches.cc +++ b/media/base/media_switches.cc
@@ -805,7 +805,7 @@ base::FEATURE_DISABLED_BY_DEFAULT}; const base::Feature kKaleidoscopeModule{"KaleidoscopeModule", - base::FEATURE_ENABLED_BY_DEFAULT}; + base::FEATURE_DISABLED_BY_DEFAULT}; const base::Feature kKaleidoscopeModuleCacheOnly{ "KaleidoscopeModuleCacheOnly", base::FEATURE_ENABLED_BY_DEFAULT};
diff --git a/mojo/public/cpp/bindings/tests/BUILD.gn b/mojo/public/cpp/bindings/tests/BUILD.gn index fec6e6b..459a4dc 100644 --- a/mojo/public/cpp/bindings/tests/BUILD.gn +++ b/mojo/public/cpp/bindings/tests/BUILD.gn
@@ -28,6 +28,7 @@ "handle_passing_unittest.cc", "hash_unittest.cc", "idle_tracking_unittest.cc", + "interface_unittest.cc", "lazy_serialization_unittest.cc", "map_unittest.cc", "message_queue.cc", @@ -154,6 +155,7 @@ "enum_headers_unittest.test-mojom", "flush_async_unittest.test-mojom", "idle_tracking_unittest.test-mojom", + "interface_unittest.test-mojom", "receiver_unittest.test-mojom", "remote_unittest.test-mojom", "service_factory_unittest.test-mojom",
diff --git a/mojo/public/cpp/bindings/tests/interface_unittest.cc b/mojo/public/cpp/bindings/tests/interface_unittest.cc new file mode 100644 index 0000000..35425e2b --- /dev/null +++ b/mojo/public/cpp/bindings/tests/interface_unittest.cc
@@ -0,0 +1,24 @@ +// Copyright 2020 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#include "mojo/public/cpp/bindings/tests/interface_unittest.test-mojom.h" +#include "testing/gtest/include/gtest/gtest.h" + +namespace mojo { +namespace test { +namespace interface_unittest { +namespace { + +using InterfaceTest = ::testing::Test; + +TEST(InterfaceTest, Uuid) { + constexpr base::Token kExpectedId{0x51e24935100f474eULL, + 0x90f155354bf92a00ULL}; + EXPECT_EQ(kExpectedId, mojom::VeryCoolInterface::Uuid_); +} + +} // namespace +} // namespace interface_unittest +} // namespace test +} // namespace mojo
diff --git a/mojo/public/cpp/bindings/tests/interface_unittest.test-mojom b/mojo/public/cpp/bindings/tests/interface_unittest.test-mojom new file mode 100644 index 0000000..82c3bd5 --- /dev/null +++ b/mojo/public/cpp/bindings/tests/interface_unittest.test-mojom
@@ -0,0 +1,11 @@ +// Copyright 2020 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +module mojo.test.interface_unittest.mojom; + +[Uuid="51e24935-100f-474e-90f1-55354bf92a00"] +interface VeryCoolInterface { + DoesNotMatter(); +}; +
diff --git a/mojo/public/js/lib/interface_endpoint_client.js b/mojo/public/js/lib/interface_endpoint_client.js index 9b45b69..392cb59 100644 --- a/mojo/public/js/lib/interface_endpoint_client.js +++ b/mojo/public/js/lib/interface_endpoint_client.js
@@ -33,12 +33,17 @@ } InterfaceEndpointClient.prototype.initControllerIfNecessary_ = function() { + if (!this.handle_) { + return false; + } + if (this.controller_ || this.handle_.pendingAssociation()) { - return; + return true; } this.controller_ = this.handle_.groupController().attachEndpointClient( this.handle_, this); + return true; }; InterfaceEndpointClient.prototype.onAssociationEvent = function( @@ -84,7 +89,9 @@ return false; } - this.initControllerIfNecessary_(); + if (!this.initControllerIfNecessary_()) { + return false; + } return this.controller_.sendMessage(message); }; @@ -99,7 +106,9 @@ return Promise.reject(); } - this.initControllerIfNecessary_(); + if (!this.initControllerIfNecessary_()) { + return Promise.reject(Error('Endpoint has been closed')); + } // Reserve 0 in case we want it to convey special meaning in the future. var requestID = this.nextRequestID_++;
diff --git a/mojo/public/tools/bindings/README.md b/mojo/public/tools/bindings/README.md index 14eff32..7ddbb79a 100644 --- a/mojo/public/tools/bindings/README.md +++ b/mojo/public/tools/bindings/README.md
@@ -418,6 +418,13 @@ strict presubmit check. See [Versioning](#Versioning) for more details on backward-compatibility constraints. +**`[Uuid=<UUID>]`** +: Specifies a UUID to be associated with a given interface. The UUID is + intended to remain stable across all changes to the interface definition, + including name changes. The value given for this attribute should be a + standard UUID string representation as specified by RFC 4122. New UUIDs can + be generated with common tools such as `uuidgen`. + **`[EnableIf=value]`** : The `EnableIf` attribute is used to conditionally enable definitions when the mojom is parsed. If the `mojom` target in the GN file does not include
diff --git a/mojo/public/tools/bindings/generators/cpp_templates/interface_declaration.tmpl b/mojo/public/tools/bindings/generators/cpp_templates/interface_declaration.tmpl index f8b28e7..a1a87fb1 100644 --- a/mojo/public/tools/bindings/generators/cpp_templates/interface_declaration.tmpl +++ b/mojo/public/tools/bindings/generators/cpp_templates/interface_declaration.tmpl
@@ -16,6 +16,10 @@ : public {{interface.name}}InterfaceBase { public: static const char Name_[]; +{%- if interface.uuid %} + static constexpr base::Token Uuid_{ {{interface.uuid[0]}}ULL, + {{interface.uuid[1]}}ULL }; +{%- endif %} static constexpr uint32_t Version_ = {{interface.version}}; static constexpr bool PassesAssociatedKinds_ = {% if interface|passes_associated_kinds %}true{% else %}false{% endif %}; static constexpr bool HasSyncMethods_ = {% if interface|has_sync_methods %}true{% else %}false{% endif %};
diff --git a/mojo/public/tools/bindings/generators/cpp_templates/interface_definition.tmpl b/mojo/public/tools/bindings/generators/cpp_templates/interface_definition.tmpl index d8d10b3..c3ca850 100644 --- a/mojo/public/tools/bindings/generators/cpp_templates/interface_definition.tmpl +++ b/mojo/public/tools/bindings/generators/cpp_templates/interface_definition.tmpl
@@ -32,6 +32,9 @@ {#--- Begin #} const char {{class_name}}::Name_[] = "{{module_namespace}}.{{class_name}}"; +{%- if interface.uuid %} +constexpr base::Token {{class_name}}::Uuid_; +{%- endif %} {#--- Constants #} {%- for constant in interface.constants %}
diff --git a/mojo/public/tools/bindings/generators/mojom_cpp_generator.py b/mojo/public/tools/bindings/generators/mojom_cpp_generator.py index d73b3f48..fc7728a 100644 --- a/mojo/public/tools/bindings/generators/mojom_cpp_generator.py +++ b/mojo/public/tools/bindings/generators/mojom_cpp_generator.py
@@ -35,8 +35,6 @@ } - - class _NameFormatter(object): """A formatter for the names of kinds or values.""" @@ -268,16 +266,19 @@ return used_typemaps def _GetExtraPublicHeaders(self): + headers = set() + all_enums = list(self.module.enums) for struct in self.module.structs: all_enums.extend(struct.enums) for interface in self.module.interfaces: all_enums.extend(interface.enums) + if interface.uuid: + headers.add('base/token.h') types = set(self._GetFullMojomNameForKind(typename) for typename in self.module.structs + all_enums + self.module.unions) - headers = set() for typename, typemap in self.typemap.items(): if typename in types: headers.update(typemap.get("public_headers", []))
diff --git a/mojo/public/tools/mojom/mojom/generate/module.py b/mojo/public/tools/mojom/mojom/generate/module.py index ebbc9b3..d2aedeb8 100644 --- a/mojo/public/tools/mojom/mojom/generate/module.py +++ b/mojo/public/tools/mojom/mojom/generate/module.py
@@ -13,6 +13,7 @@ # method.AddParameter('baz', 0, mojom.INT32) import pickle +from uuid import UUID class BackwardCompatibilityChecker(object): @@ -286,6 +287,7 @@ ATTRIBUTE_STABLE = 'Stable' ATTRIBUTE_SYNC = 'Sync' ATTRIBUTE_UNLIMITED_SIZE = 'UnlimitedSize' +ATTRIBUTE_UUID = 'Uuid' class NamedValue(object): @@ -1188,6 +1190,20 @@ self.attributes) == (rhs.mojom_name, rhs.methods, rhs.enums, rhs.constants, rhs.attributes)) + @property + def uuid(self): + uuid_str = self.attributes.get(ATTRIBUTE_UUID) if self.attributes else None + if uuid_str is None: + return None + + try: + u = UUID(uuid_str) + except: + raise ValueError('Invalid format for Uuid attribute on interface {}. ' + 'Expected standard RFC 4122 string representation of ' + 'a UUID.'.format(self.mojom_name)) + return (int(u.hex[:16], 16), int(u.hex[16:], 16)) + def __hash__(self): return id(self)
diff --git a/net/disk_cache/entry_unittest.cc b/net/disk_cache/entry_unittest.cc index 6030b792..54c6780 100644 --- a/net/disk_cache/entry_unittest.cc +++ b/net/disk_cache/entry_unittest.cc
@@ -3719,9 +3719,9 @@ base::MakeRefCounted<net::IOBuffer>(kSize); CacheTestFillBuffer(buf_1->data(), kSize, false); - EXPECT_EQ(kSize, WriteData(entry2, /* stream_index = */ 1, /* offset = */ 0, + EXPECT_EQ(kSize, WriteData(entry2, /* index = */ 1, /* offset = */ 0, buf_1.get(), kSize, /* truncate = */ false)); - EXPECT_EQ(kSize, ReadData(entry2, /* stream_index = */ 1, /* offset = */ 0, + EXPECT_EQ(kSize, ReadData(entry2, /* index = */ 1, /* offset = */ 0, buf_2.get(), kSize)); doom_callback.WaitForResult(); @@ -5288,24 +5288,24 @@ scoped_refptr<net::IOBuffer> read_buf = base::MakeRefCounted<net::IOBuffer>(kBigSize); - ASSERT_EQ(kSmallSize, WriteData(entry, /* stream_index = */ 0, + ASSERT_EQ(kSmallSize, WriteData(entry, /* index = */ 0, /* offset = */ kBigSize, buffer.get(), /* size = */ kSmallSize, /* truncate = */ false)); memset(read_buf->data(), 0, kBigSize); - ASSERT_EQ(kSmallSize, ReadData(entry, /* stream_index = */ 0, + ASSERT_EQ(kSmallSize, ReadData(entry, /* index = */ 0, /* offset = */ kBigSize, read_buf.get(), /* size = */ kSmallSize)); EXPECT_EQ(0, memcmp(read_buf->data(), buffer->data(), kSmallSize)); // A partly overlapping truncate before the previous write. ASSERT_EQ(kBigSize, - WriteData(entry, /* stream_index = */ 0, + WriteData(entry, /* index = */ 0, /* offset = */ 3, buffer.get(), /* size = */ kBigSize, /* truncate = */ true)); memset(read_buf->data(), 0, kBigSize); ASSERT_EQ(kBigSize, - ReadData(entry, /* stream_index = */ 0, + ReadData(entry, /* index = */ 0, /* offset = */ 3, read_buf.get(), /* size = */ kBigSize)); EXPECT_EQ(0, memcmp(read_buf->data(), buffer->data(), kBigSize)); EXPECT_EQ(kBigSize + 3, entry->GetDataSize(0)); @@ -5345,15 +5345,15 @@ // Offset here needs to be > blockfile's kMaxBlockSize to hit // https://crbug.com/946538, as writes close to beginning are handled // specially. - EXPECT_EQ(0, WriteData(entry, /* stream_index = */ 0, + EXPECT_EQ(0, WriteData(entry, /* index = */ 0, /* offset = */ 17000, buffer.get(), /* size = */ 0, /* truncate = */ true)); - EXPECT_EQ(0, WriteData(entry, /* stream_index = */ 0, + EXPECT_EQ(0, WriteData(entry, /* index = */ 0, /* offset = */ 0, buffer.get(), /* size = */ 0, /* truncate = */ false)); - EXPECT_EQ(kSize, ReadData(entry, /* stream_index = */ 0, + EXPECT_EQ(kSize, ReadData(entry, /* index = */ 0, /* offset = */ 0, buffer.get(), /* size = */ kSize)); for (int i = 0; i < kSize; ++i) {
diff --git a/pdf/out_of_process_instance.cc b/pdf/out_of_process_instance.cc index bb40e91..fb68ee68 100644 --- a/pdf/out_of_process_instance.cc +++ b/pdf/out_of_process_instance.cc
@@ -2254,8 +2254,9 @@ metadata_message.Set(pp::Var(kJSAttachments), GetDocumentAttachments()); - pp::VarArray bookmarks = engine()->GetBookmarks(); - metadata_message.Set(pp::Var(kJSBookmarks), bookmarks); + base::Value bookmarks = engine()->GetBookmarks(); + DCHECK(bookmarks.is_list()); + metadata_message.Set(pp::Var(kJSBookmarks), VarFromValue(bookmarks)); metadata_message.Set( pp::Var(kJSCanSerializeDocument),
diff --git a/pdf/out_of_process_instance.h b/pdf/out_of_process_instance.h index 2dd5128..f1869af5 100644 --- a/pdf/out_of_process_instance.h +++ b/pdf/out_of_process_instance.h
@@ -36,6 +36,8 @@ namespace pp { class Size; class TextInput_Dev; +class VarArray; +class VarDictionary; } // namespace pp namespace chrome_pdf {
diff --git a/pdf/pdf_engine.h b/pdf/pdf_engine.h index 2c5aab0f..4a3ad41 100644 --- a/pdf/pdf_engine.h +++ b/pdf/pdf_engine.h
@@ -24,7 +24,6 @@ #include "ppapi/cpp/completion_callback.h" #include "ppapi/cpp/private/pdf.h" #include "ppapi/cpp/url_loader.h" -#include "ppapi/cpp/var_array.h" #include "ui/base/window_open_disposition.h" #include "ui/gfx/geometry/point_f.h" #include "ui/gfx/geometry/rect.h" @@ -52,10 +51,6 @@ class Vector2d; } // namespace gfx -namespace pp { -class VarDictionary; -} // namespace pp - namespace chrome_pdf { class InputEvent; @@ -457,13 +452,13 @@ // Returns true if all the pages are the same size. virtual bool GetPageSizeAndUniformity(gfx::Size* size) = 0; - // Returns a VarArray of Bookmarks. Each Bookmark is a VarDictionary + // Returns a list of Values of Bookmarks. Each Bookmark is a dictionary Value // which contains the following key/values: - // - "title" - a string Var. - // - "page" - an int Var. - // - "children" - a VarArray(), with each entry containing a VarDictionary of - // the same structure. - virtual pp::VarArray GetBookmarks() = 0; + // - "title" - a string Value. + // - "page" - an int Value. + // - "children" - a list of Values, with each entry containing + // a dictionary Value of the same structure. + virtual base::Value GetBookmarks() = 0; // Append blank pages to make a 1-page document to a |num_pages| document. // Always retain the first page data.
diff --git a/pdf/pdfium/pdfium_engine.cc b/pdf/pdfium/pdfium_engine.cc index e3f6e6fa..5126f64d 100644 --- a/pdf/pdfium/pdfium_engine.cc +++ b/pdf/pdfium/pdfium_engine.cc
@@ -49,7 +49,6 @@ #include "pdf/url_loader_wrapper_impl.h" #include "ppapi/cpp/instance.h" #include "ppapi/cpp/private/pdf.h" -#include "ppapi/cpp/var_dictionary.h" #include "printing/units.h" #include "third_party/pdfium/public/cpp/fpdf_scopers.h" #include "third_party/pdfium/public/fpdf_annot.h" @@ -2279,36 +2278,39 @@ return pages_.size(); } -pp::VarArray PDFiumEngine::GetBookmarks() { - pp::VarDictionary dict = TraverseBookmarks(nullptr, 0); +base::Value PDFiumEngine::GetBookmarks() { + base::Value dict = TraverseBookmarks(nullptr, 0); + DCHECK(dict.is_dict()); // The root bookmark contains no useful information. - return pp::VarArray(dict.Get(pp::Var("children"))); + base::Value* children = dict.FindListKey("children"); + DCHECK(children); + return std::move(*children); } -pp::VarDictionary PDFiumEngine::TraverseBookmarks(FPDF_BOOKMARK bookmark, - unsigned int depth) { - pp::VarDictionary dict; +base::Value PDFiumEngine::TraverseBookmarks(FPDF_BOOKMARK bookmark, + unsigned int depth) { + base::Value dict(base::Value::Type::DICTIONARY); base::string16 title = CallPDFiumWideStringBufferApi( base::BindRepeating(&FPDFBookmark_GetTitle, bookmark), /*check_expected_size=*/true); - dict.Set(pp::Var("title"), pp::Var(base::UTF16ToUTF8(title))); + dict.SetStringKey("title", title); FPDF_DEST dest = FPDFBookmark_GetDest(doc(), bookmark); // Some bookmarks don't have a page to select. if (dest) { int page_index = FPDFDest_GetDestPageIndex(doc(), dest); if (PageIndexInBounds(page_index)) { - dict.Set(pp::Var("page"), pp::Var(page_index)); + dict.SetIntKey("page", page_index); base::Optional<gfx::PointF> xy; base::Optional<float> zoom; pages_[page_index]->GetPageDestinationTarget(dest, &xy, &zoom); if (xy) { - dict.Set(pp::Var("x"), pp::Var(static_cast<int>(xy.value().x()))); - dict.Set(pp::Var("y"), pp::Var(static_cast<int>(xy.value().y()))); + dict.SetIntKey("x", static_cast<int>(xy.value().x())); + dict.SetIntKey("y", static_cast<int>(xy.value().y())); } if (zoom) { - dict.Set(pp::Var("zoom"), pp::Var(zoom.value())); + dict.SetDoubleKey("zoom", zoom.value()); } } } else { @@ -2318,15 +2320,14 @@ base::BindRepeating(&FPDFAction_GetURIPath, doc(), action), /*check_expected_size=*/true); if (!uri.empty()) - dict.Set(pp::Var("uri"), pp::Var(uri)); + dict.SetStringKey("uri", uri); } - pp::VarArray children; + base::Value children(base::Value::Type::LIST); // Don't trust PDFium to handle circular bookmarks. constexpr unsigned int kMaxDepth = 128; if (depth < kMaxDepth) { - int child_index = 0; std::set<FPDF_BOOKMARK> seen_bookmarks; for (FPDF_BOOKMARK child_bookmark = FPDFBookmark_GetFirstChild(doc(), bookmark); @@ -2336,11 +2337,10 @@ break; seen_bookmarks.insert(child_bookmark); - children.Set(child_index, TraverseBookmarks(child_bookmark, depth + 1)); - child_index++; + children.Append(TraverseBookmarks(child_bookmark, depth + 1)); } } - dict.Set(pp::Var("children"), children); + dict.SetKey("children", std::move(children)); return dict; }
diff --git a/pdf/pdfium/pdfium_engine.h b/pdf/pdfium/pdfium_engine.h index dc2a985..b4e3199 100644 --- a/pdf/pdfium/pdfium_engine.h +++ b/pdf/pdfium/pdfium_engine.h
@@ -17,6 +17,7 @@ #include "base/optional.h" #include "base/time/time.h" #include "base/timer/timer.h" +#include "base/values.h" #include "pdf/document_attachment_info.h" #include "pdf/document_layout.h" #include "pdf/document_loader.h" @@ -28,7 +29,6 @@ #include "pdf/pdfium/pdfium_range.h" #include "ppapi/c/private/ppp_pdf.h" #include "ppapi/cpp/dev/buffer_dev.h" -#include "ppapi/cpp/var_array.h" #include "third_party/pdfium/public/cpp/fpdf_scopers.h" #include "third_party/pdfium/public/fpdf_formfill.h" #include "third_party/pdfium/public/fpdf_progressive.h" @@ -133,7 +133,7 @@ std::vector<uint8_t> GetAttachmentData(size_t index) override; const DocumentMetadata& GetDocumentMetadata() const override; int GetNumberOfPages() const override; - pp::VarArray GetBookmarks() override; + base::Value GetBookmarks() override; base::Optional<PDFEngine::NamedDestination> GetNamedDestination( const std::string& destination) override; int GetMostVisiblePage() override; @@ -564,12 +564,11 @@ void KillTouchTimer(); void HandleLongPress(const TouchInputEvent& event); - // Returns a VarDictionary (representing a bookmark), which in turn contains - // child VarDictionaries (representing the child bookmarks). + // Returns a base::Value (representing a bookmark), which in turn contains + // child base::Value dictionaries (representing the child bookmarks). // If nullptr is passed in as the bookmark then we traverse from the "root". // Note that the "root" bookmark contains no useful information. - pp::VarDictionary TraverseBookmarks(FPDF_BOOKMARK bookmark, - unsigned int depth); + base::Value TraverseBookmarks(FPDF_BOOKMARK bookmark, unsigned int depth); void ScrollBasedOnScrollAlignment( const gfx::Rect& scroll_rect,
diff --git a/testing/buildbot/chromium.mac.json b/testing/buildbot/chromium.mac.json index 9624615..7b80fb4 100644 --- a/testing/buildbot/chromium.mac.json +++ b/testing/buildbot/chromium.mac.json
@@ -5272,6 +5272,7 @@ "Mac10.13 Tests": { "gtest_tests": [ { + "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -5290,6 +5291,7 @@ "test_id_prefix": "ninja://third_party/abseil-cpp:absl_hardening_tests/" }, { + "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -5308,6 +5310,7 @@ "test_id_prefix": "ninja://ui/accessibility:accessibility_unittests/" }, { + "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -5326,6 +5329,7 @@ "test_id_prefix": "ninja://extensions/shell:app_shell_unittests/" }, { + "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -5344,6 +5348,7 @@ "test_id_prefix": "ninja://base:base_unittests/" }, { + "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -5362,6 +5367,7 @@ "test_id_prefix": "ninja://base/util:base_util_unittests/" }, { + "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -5380,6 +5386,7 @@ "test_id_prefix": "ninja://third_party/blink/common:blink_common_unittests/" }, { + "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -5398,6 +5405,7 @@ "test_id_prefix": "ninja://third_party/blink/renderer/platform:blink_fuzzer_unittests/" }, { + "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -5416,6 +5424,7 @@ "test_id_prefix": "ninja://third_party/blink/renderer/platform/heap:blink_heap_unittests/" }, { + "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -5434,6 +5443,7 @@ "test_id_prefix": "ninja://third_party/blink/renderer/platform:blink_platform_unittests/" }, { + "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -5453,6 +5463,7 @@ "test_id_prefix": "ninja://third_party/blink/renderer/controller:blink_unittests/" }, { + "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -5471,6 +5482,7 @@ "test_id_prefix": "ninja://third_party/boringssl:boringssl_crypto_tests/" }, { + "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -5492,6 +5504,7 @@ "args": [ "--gtest_filter=-*UsingRealWebcam*" ], + "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -5510,6 +5523,7 @@ "test_id_prefix": "ninja://media/capture:capture_unittests/" }, { + "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -5528,6 +5542,7 @@ "test_id_prefix": "ninja://media/cast:cast_unittests/" }, { + "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -5546,6 +5561,7 @@ "test_id_prefix": "ninja://cc:cc_unittests/" }, { + "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -5564,6 +5580,7 @@ "test_id_prefix": "ninja://chrome/test:chrome_app_unittests/" }, { + "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -5582,6 +5599,7 @@ "test_id_prefix": "ninja://chrome/test/chromedriver:chromedriver_unittests/" }, { + "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -5600,6 +5618,7 @@ "test_id_prefix": "ninja://components:components_browsertests/" }, { + "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -5618,6 +5637,7 @@ "test_id_prefix": "ninja://components:components_unittests/" }, { + "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -5637,6 +5657,7 @@ "test_id_prefix": "ninja://content/test:content_browsertests/" }, { + "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -5655,6 +5676,7 @@ "test_id_prefix": "ninja://content/test:content_nocompile_tests/" }, { + "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -5673,6 +5695,7 @@ "test_id_prefix": "ninja://content/test:content_unittests/" }, { + "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -5691,6 +5714,7 @@ "test_id_prefix": "ninja://third_party/crashpad/crashpad:crashpad_tests/" }, { + "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -5709,6 +5733,7 @@ "test_id_prefix": "ninja://components/cronet:cronet_tests/" }, { + "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -5727,6 +5752,7 @@ "test_id_prefix": "ninja://components/cronet:cronet_unittests/" }, { + "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -5745,6 +5771,7 @@ "test_id_prefix": "ninja://crypto:crypto_unittests/" }, { + "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -5763,6 +5790,7 @@ "test_id_prefix": "ninja://device:device_unittests/" }, { + "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -5781,6 +5809,7 @@ "test_id_prefix": "ninja://ui/display:display_unittests/" }, { + "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -5799,6 +5828,7 @@ "test_id_prefix": "ninja://ui/events:events_unittests/" }, { + "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -5817,6 +5847,7 @@ "test_id_prefix": "ninja://extensions:extensions_browsertests/" }, { + "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -5835,6 +5866,7 @@ "test_id_prefix": "ninja://extensions:extensions_unittests/" }, { + "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -5853,6 +5885,7 @@ "test_id_prefix": "ninja://components/services/filesystem:filesystem_service_unittests/" }, { + "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -5871,6 +5904,7 @@ "test_id_prefix": "ninja://google_apis/gcm:gcm_unit_tests/" }, { + "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -5889,6 +5923,7 @@ "test_id_prefix": "ninja://ui/gfx:gfx_unittests/" }, { + "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -5907,6 +5942,7 @@ "test_id_prefix": "ninja://gin:gin_unittests/" }, { + "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -5925,6 +5961,7 @@ "test_id_prefix": "ninja://google_apis:google_apis_unittests/" }, { + "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -5943,6 +5980,7 @@ "test_id_prefix": "ninja://gpu:gpu_unittests/" }, { + "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -5961,6 +5999,7 @@ "test_id_prefix": "ninja://components/gwp_asan:gwp_asan_unittests/" }, { + "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -5979,6 +6018,7 @@ "test_id_prefix": "ninja://headless:headless_browsertests/" }, { + "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -5997,6 +6037,7 @@ "test_id_prefix": "ninja://headless:headless_unittests/" }, { + "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -6016,6 +6057,7 @@ "test_id_prefix": "ninja://chrome/test:interactive_ui_tests/" }, { + "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -6034,6 +6076,7 @@ "test_id_prefix": "ninja://ipc:ipc_tests/" }, { + "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -6052,6 +6095,7 @@ "test_id_prefix": "ninja://jingle:jingle_unittests/" }, { + "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -6070,6 +6114,7 @@ "test_id_prefix": "ninja://ui/latency:latency_unittests/" }, { + "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -6088,6 +6133,7 @@ "test_id_prefix": "ninja://third_party/libjingle_xmpp:libjingle_xmpp_unittests/" }, { + "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -6106,6 +6152,7 @@ "test_id_prefix": "ninja://media/blink:media_blink_unittests/" }, { + "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -6124,6 +6171,7 @@ "test_id_prefix": "ninja://media:media_unittests/" }, { + "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -6142,6 +6190,7 @@ "test_id_prefix": "ninja://ui/message_center:message_center_unittests/" }, { + "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -6160,6 +6209,7 @@ "test_id_prefix": "ninja://media/midi:midi_unittests/" }, { + "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -6178,6 +6228,7 @@ "test_id_prefix": "ninja://mojo:mojo_unittests/" }, { + "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -6196,6 +6247,7 @@ "test_id_prefix": "ninja://ui/native_theme:native_theme_unittests/" }, { + "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -6214,6 +6266,7 @@ "test_id_prefix": "ninja://net:net_unittests/" }, { + "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -6232,6 +6285,7 @@ "test_id_prefix": "ninja://chrome/browser/media/router:openscreen_unittests/" }, { + "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -6250,6 +6304,7 @@ "test_id_prefix": "ninja://pdf:pdf_unittests/" }, { + "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -6268,6 +6323,7 @@ "test_id_prefix": "ninja://third_party/perfetto:perfetto_unittests/" }, { + "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -6286,6 +6342,7 @@ "test_id_prefix": "ninja://ppapi:ppapi_unittests/" }, { + "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -6304,6 +6361,7 @@ "test_id_prefix": "ninja://printing:printing_unittests/" }, { + "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -6322,6 +6380,7 @@ "test_id_prefix": "ninja://remoting:remoting_unittests/" }, { + "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -6340,6 +6399,7 @@ "test_id_prefix": "ninja://sandbox/mac:sandbox_mac_unittests/" }, { + "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -6358,6 +6418,7 @@ "test_id_prefix": "ninja://services/service_manager/tests:service_manager_unittests/" }, { + "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -6376,6 +6437,7 @@ "test_id_prefix": "ninja://services:services_unittests/" }, { + "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -6394,6 +6456,7 @@ "test_id_prefix": "ninja://ui/shell_dialogs:shell_dialogs_unittests/" }, { + "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -6412,6 +6475,7 @@ "test_id_prefix": "ninja://skia:skia_unittests/" }, { + "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -6430,6 +6494,7 @@ "test_id_prefix": "ninja://ui/snapshot:snapshot_unittests/" }, { + "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -6451,6 +6516,7 @@ "args": [ "standalone_angle_unittests" ], + "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_isolated_script_merge.py" @@ -6470,6 +6536,7 @@ "use_isolated_scripts_api": true }, { + "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -6488,6 +6555,7 @@ "test_id_prefix": "ninja://storage:storage_unittests/" }, { + "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -6506,6 +6574,7 @@ "test_id_prefix": "ninja://chrome/test:sync_integration_tests/" }, { + "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -6524,6 +6593,7 @@ "test_id_prefix": "ninja://ui/base:ui_base_unittests/" }, { + "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -6542,6 +6612,7 @@ "test_id_prefix": "ninja://ui/touch_selection:ui_touch_selection_unittests/" }, { + "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -6560,6 +6631,7 @@ "test_id_prefix": "ninja://chrome/test:unit_tests/" }, { + "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -6578,6 +6650,7 @@ "test_id_prefix": "ninja://chrome/updater:updater_tests/" }, { + "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -6596,6 +6669,7 @@ "test_id_prefix": "ninja://url:url_unittests/" }, { + "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -6614,6 +6688,7 @@ "test_id_prefix": "ninja://ui/views:views_unittests/" }, { + "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -6632,6 +6707,7 @@ "test_id_prefix": "ninja://components/viz:viz_unittests/" }, { + "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -6650,6 +6726,7 @@ "test_id_prefix": "ninja://third_party/blink/renderer/platform/wtf:wtf_unittests/" }, { + "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -6669,6 +6746,7 @@ "test_id_prefix": "ninja://chrome/test:xr_browser_tests/" }, { + "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_gtest_merge.py" @@ -6690,6 +6768,7 @@ "isolated_scripts": [ { "isolate_name": "blink_python_tests", + "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_isolated_script_merge.py" @@ -6712,6 +6791,7 @@ "--num-retries=3" ], "isolate_name": "blink_web_tests", + "isolate_profile_data": true, "merge": { "args": [ "--verbose" @@ -6740,6 +6820,7 @@ "--test-type=integration" ], "isolate_name": "chromedriver_py_tests", + "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_isolated_script_merge.py" @@ -6759,6 +6840,7 @@ }, { "isolate_name": "chromedriver_replay_unittests", + "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_isolated_script_merge.py" @@ -6781,6 +6863,7 @@ "--gtest-benchmark-name=components_perftests" ], "isolate_name": "components_perftests", + "isolate_profile_data": true, "merge": { "args": [ "--smoke-test-mode" @@ -6802,6 +6885,7 @@ }, { "isolate_name": "content_shell_crash_test", + "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_isolated_script_merge.py" @@ -6824,6 +6908,7 @@ }, { "isolate_name": "extension_docserver_python_unittests", + "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_isolated_script_merge.py" @@ -6843,6 +6928,7 @@ }, { "isolate_name": "flatbuffers_unittests", + "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_isolated_script_merge.py" @@ -6865,6 +6951,7 @@ }, { "isolate_name": "grit_python_unittests", + "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_isolated_script_merge.py" @@ -6884,6 +6971,7 @@ }, { "isolate_name": "mac_signing_tests", + "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_isolated_script_merge.py" @@ -6903,6 +6991,7 @@ }, { "isolate_name": "metrics_python_tests", + "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_isolated_script_merge.py" @@ -6922,6 +7011,7 @@ }, { "isolate_name": "mojo_python_unittests", + "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_isolated_script_merge.py" @@ -6941,6 +7031,7 @@ }, { "isolate_name": "telemetry_gpu_unittests", + "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_isolated_script_merge.py" @@ -6965,6 +7056,7 @@ "--extra-browser-args=--disable-gpu" ], "isolate_name": "telemetry_unittests", + "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_isolated_script_merge.py" @@ -6986,6 +7078,7 @@ }, { "isolate_name": "updater_integration_tests", + "isolate_profile_data": true, "merge": { "args": [], "script": "//testing/merge_scripts/standard_isolated_script_merge.py" @@ -7008,6 +7101,7 @@ "--gtest-benchmark-name=views_perftests" ], "isolate_name": "views_perftests", + "isolate_profile_data": true, "merge": { "args": [ "--smoke-test-mode"
diff --git a/testing/buildbot/gn_isolate_map.pyl b/testing/buildbot/gn_isolate_map.pyl index db58a33..b46f67f 100644 --- a/testing/buildbot/gn_isolate_map.pyl +++ b/testing/buildbot/gn_isolate_map.pyl
@@ -269,23 +269,12 @@ "type": "additional_compile_target", }, "devtools_web_tests": { + "label": "//:devtools_web_tests", + "type": "generated_script", "args": [ - "../../third_party/blink/tools/run_web_tests.py", - "--seed", - "4", - "--no-show-results", - "--zero-tests-executed-ok", - "--clobber-old-results", - "--exit-after-n-failures", - "5000", - "--exit-after-n-crashes-or-timeouts", - "100", "--results-directory", "${ISOLATED_OUTDIR}", ], - "label": "//:devtools_web_tests", - "script": "//testing/scripts/run_isolated_script_test.py", - "type": "script", }, "boringssl_crypto_tests": { "label": "//third_party/boringssl:boringssl_crypto_tests", @@ -1854,28 +1843,12 @@ "type": "junit_test", }, "webgpu_blink_web_tests": { + "label": "//:webgpu_blink_web_tests", + "type": "generated_script", "args": [ - "../../third_party/blink/tools/run_web_tests.py", - "--seed", - "4", - "--no-show-results", - "--zero-tests-executed-ok", - "--clobber-old-results", - "--exit-after-n-failures", - "5000", - "--exit-after-n-crashes-or-timeouts", - "100", "--results-directory", "${ISOLATED_OUTDIR}", - # WebGPU specific - "--additional-driver-flag=--enable-unsafe-webgpu", - "--ignore-default-expectations", - "--additional-expectations=../../third_party/blink/web_tests/WebGPUExpectations", - "--isolated-script-test-filter=wpt_internal/webgpu/*", ], - "label": "//:webgpu_blink_web_tests", - "script": "//testing/scripts/run_isolated_script_test.py", - "type": "script", }, "weblayer_browsertests": { "label": "//weblayer/test:weblayer_browsertests",
diff --git a/testing/buildbot/test_suites.pyl b/testing/buildbot/test_suites.pyl index d60ea60..4c49f63 100644 --- a/testing/buildbot/test_suites.pyl +++ b/testing/buildbot/test_suites.pyl
@@ -1250,6 +1250,7 @@ } }, 'webkit_layout_from_devtools': { + # TODO(crbug.com/816629) - Move these args into //BUILD.gn . # layout test failures are retried 3 times when '--test-list' is not # passed, but 0 times when '--test-list' is passed. We want to always # retry 3 times, so we explicitly specify it. @@ -3121,6 +3122,7 @@ 'gpu_webgpu_integration_extra_isolated_scripts': { 'webgpu_blink_web_tests_with_backend_validation': { + # TODO(crbug.com/816629) - Move these args into //BUILD.gn. 'name': 'webgpu_blink_web_tests_with_backend_validation', 'args': [ '--driver-logging', @@ -3161,6 +3163,7 @@ 'gpu_webgpu_integration_isolated_scripts': { 'webgpu_blink_web_tests': { + # TODO(crbug.com/816629) - Move these args into //BUILD.gn. 'name': 'webgpu_blink_web_tests', 'args': [ '--driver-logging',
diff --git a/testing/buildbot/waterfalls.pyl b/testing/buildbot/waterfalls.pyl index e61c348..aaccc53 100644 --- a/testing/buildbot/waterfalls.pyl +++ b/testing/buildbot/waterfalls.pyl
@@ -4658,6 +4658,7 @@ }, 'Mac10.13 Tests': { 'mixins': [ + 'isolate_profile_data', 'mac_10.13', 'no_gpu', ],
diff --git a/testing/variations/fieldtrial_testing_config.json b/testing/variations/fieldtrial_testing_config.json index 4c97575..3a8ea96 100644 --- a/testing/variations/fieldtrial_testing_config.json +++ b/testing/variations/fieldtrial_testing_config.json
@@ -3414,6 +3414,21 @@ ] } ], + "IOSPreloadDelayWebStateReset": [ + { + "platforms": [ + "ios" + ], + "experiments": [ + { + "name": "Enabled", + "enable_features": [ + "PreloadDelayWebStateReset" + ] + } + ] + } + ], "IOSRequestDesktopByDefault": [ { "platforms": [
diff --git a/third_party/blink/public/mojom/web_feature/web_feature.mojom b/third_party/blink/public/mojom/web_feature/web_feature.mojom index ce656e6..3259e61 100644 --- a/third_party/blink/public/mojom/web_feature/web_feature.mojom +++ b/third_party/blink/public/mojom/web_feature/web_feature.mojom
@@ -9,6 +9,10 @@ // Do not change assigned numbers of existing items: add new features // to the end of the list. // +// If you want to mark an item as no-longer-used, simply rename it, prefixing +// "kOBSOLETE_" before the existing name. +// E.g. kFrobulate becomes kOBSOLETE_Frobulate. +// // A WebFeature conceptually represents some particular web-exposed API // or code path which can be used/triggered by a web page. // TODO(rbyers): Add CSS and animated CSS feature types by making this a @@ -406,9 +410,9 @@ kGetUserMediaSecureOrigin = 667, // The above items are available in M41 branch. - kDeviceMotionInsecureOrigin_Obsolete = 668, + kOBSOLETE_DeviceMotionInsecureOrigin = 668, kDeviceMotionSecureOrigin = 669, - kDeviceOrientationInsecureOrigin_Obsolete = 670, + kOBSOLETE_DeviceOrientationInsecureOrigin = 670, kDeviceOrientationSecureOrigin = 671, kSandboxViaIFrame = 672, kSandboxViaCSP = 673, @@ -466,7 +470,7 @@ kCryptoAlgorithmPbkdf2 = 738, kDocumentSetDomain = 739, kUpgradeInsecureRequestsEnabled = 740, - kUpgradeInsecureRequestsUpgradedRequest_Obsolete = 741, + kOBSOLETE_UpgradeInsecureRequestsUpgradedRequest = 741, kDocumentDesignMode = 742, kGlobalCacheStorage = 743, kNetInfo = 744, @@ -604,7 +608,7 @@ kFlexboxIntrinsicSizeAlgorithmIsDifferent = 939, // The above items are available in M46 branch. - kHTMLImportsHasStyleSheets_Obsolete = 940, + kOBSOLETE_HTMLImportsHasStyleSheets = 940, kNetInfoType = 946, kNetInfoDownlinkMax = 947, kNetInfoOnChange = 948, @@ -638,7 +642,7 @@ kExternalAddSearchProvider = 981, kExternalIsSearchProviderInstalled = 982, kV8Permissions_RequestAll_Method = 983, - kDeviceOrientationAbsoluteInsecureOrigin_Obsolete = 987, + kOBSOLETE_DeviceOrientationAbsoluteInsecureOrigin = 987, kDeviceOrientationAbsoluteSecureOrigin = 988, kFontFaceConstructor = 989, kServiceWorkerControlledPage = 990, @@ -2174,9 +2178,9 @@ kCSSStyleSheetReplace = 2844, kCSSStyleSheetReplaceSync = 2845, kAdoptedStyleSheets = 2846, - kHTMLImportsOnReverseOriginTrials = 2847, - kElementCreateShadowRootOnReverseOriginTrials = 2848, - kDocumentRegisterElementOnReverseOriginTrials = 2849, + kOBSOLETE_HTMLImportsOnReverseOriginTrials = 2847, + kOBSOLETE_ElementCreateShadowRootOnReverseOriginTrials = 2848, + kOBSOLETE_DocumentRegisterElementOnReverseOriginTrials = 2849, kInputTypeRadio = 2850, kInputTypeCheckbox = 2851, kInputTypeImage = 2852, @@ -2443,8 +2447,8 @@ kLongTaskBufferFull = 3118, kHTMLMetaElementMonetization = 3119, kHTMLLinkElementMonetization = 3120, - kInputTypeCheckboxRenderedNonSquare_Obsolete = 3121, - kInputTypeRadioRenderedNonSquare_Obsolete = 3122, + kOBSOLETE_InputTypeCheckboxRenderedNonSquare = 3121, + kOBSOLETE_InputTypeRadioRenderedNonSquare = 3122, kWebkitBoxPackJustifyDoesSomething = 3123, kWebkitBoxPackCenterDoesSomething = 3124, kWebkitBoxPackEndDoesSomething = 3125,
diff --git a/third_party/blink/renderer/core/css/parser/css_parser_context.cc b/third_party/blink/renderer/core/css/parser/css_parser_context.cc index c0ad6ec..8ddafa7 100644 --- a/third_party/blink/renderer/core/css/parser/css_parser_context.cc +++ b/third_party/blink/renderer/core/css/parser/css_parser_context.cc
@@ -282,11 +282,7 @@ } bool CSSParserContext::CustomElementsV0Enabled() const { - // Support features conservatively. - if (!document_) - return true; - return RuntimeEnabledFeatures::CustomElementsV0Enabled( - document_->GetExecutionContext()); + return RuntimeEnabledFeatures::CustomElementsV0Enabled(); } bool CSSParserContext::IsForMarkupSanitization() const {
diff --git a/third_party/blink/renderer/core/css/style_engine.cc b/third_party/blink/renderer/core/css/style_engine.cc index a1d53ece..6daa6a2 100644 --- a/third_party/blink/renderer/core/css/style_engine.cc +++ b/third_party/blink/renderer/core/css/style_engine.cc
@@ -511,8 +511,7 @@ void StyleEngine::UpdateActiveStyleSheetsInImport( StyleEngine& root_engine, DocumentStyleSheetCollector& parent_collector) { - DCHECK(RuntimeEnabledFeatures::HTMLImportsEnabled( - GetDocument().GetExecutionContext())); + DCHECK(RuntimeEnabledFeatures::HTMLImportsEnabled()); DCHECK(IsHTMLImport()); HeapVector<Member<StyleSheet>> sheets_for_list; ImportedDocumentStyleSheetCollector subcollector(parent_collector,
diff --git a/third_party/blink/renderer/core/dom/BUILD.gn b/third_party/blink/renderer/core/dom/BUILD.gn index bd022753..13b08b8 100644 --- a/third_party/blink/renderer/core/dom/BUILD.gn +++ b/third_party/blink/renderer/core/dom/BUILD.gn
@@ -27,6 +27,8 @@ # -O2 optimiziation. If there is common inlined implementations, put this in # foo-inl.h and include that in both foo.cc and foo-hot.cc. blink_core_sources("dom_hotpath") { + configs += [ "//build/config/compiler:noshadowing" ] + sources = [ "element-hot.cc", "element-inl.h", @@ -41,6 +43,8 @@ } blink_core_sources("dom") { + configs += [ "//build/config/compiler:noshadowing" ] + sources = [ "abort_controller.cc", "abort_controller.h",
diff --git a/third_party/blink/renderer/core/dom/document.cc b/third_party/blink/renderer/core/dom/document.cc index 158b12f..37754b14 100644 --- a/third_party/blink/renderer/core/dom/document.cc +++ b/third_party/blink/renderer/core/dom/document.cc
@@ -1144,8 +1144,7 @@ bool is_v1 = string_or_options.IsElementCreationOptions() || !RegistrationContext(); // V0 is only allowed with the flag. - DCHECK(is_v1 || RuntimeEnabledFeatures::CustomElementsV0Enabled( - GetExecutionContext())); + DCHECK(is_v1 || RuntimeEnabledFeatures::CustomElementsV0Enabled()); bool create_v1_builtin = string_or_options.IsElementCreationOptions(); bool should_create_builtin = create_v1_builtin || string_or_options.IsString(); @@ -1223,8 +1222,7 @@ bool is_v1 = string_or_options.IsElementCreationOptions() || !RegistrationContext(); // V0 is only allowed with the flag. - DCHECK(is_v1 || RuntimeEnabledFeatures::CustomElementsV0Enabled( - GetExecutionContext())); + DCHECK(is_v1 || RuntimeEnabledFeatures::CustomElementsV0Enabled()); bool create_v1_builtin = string_or_options.IsElementCreationOptions(); bool should_create_builtin = create_v1_builtin || string_or_options.IsString(); @@ -1306,7 +1304,7 @@ } V0CustomElementRegistrationContext* Document::RegistrationContext() const { - if (RuntimeEnabledFeatures::CustomElementsV0Enabled(GetExecutionContext())) + if (RuntimeEnabledFeatures::CustomElementsV0Enabled()) return registration_context_.Get(); return nullptr; } @@ -3877,8 +3875,8 @@ return false; } for (PortalContents* portal : DocumentPortals::From(*document).GetPortals()) { - auto* frame = portal->GetFrame(); - if (frame && frame->IsLoading()) + auto* portal_frame = portal->GetFrame(); + if (portal_frame && portal_frame->IsLoading()) return false; } return true; @@ -5337,13 +5335,13 @@ if (type == mojom::blink::FocusType::kForward) { Node* previous = FlatTreeTraversal::Previous(*next_node); for (; previous; previous = FlatTreeTraversal::Previous(*previous)) { - if (auto* element = DynamicTo<Element>(previous)) - return element; + if (auto* previous_element = DynamicTo<Element>(previous)) + return previous_element; } } for (Node* next = next_node; next; next = FlatTreeTraversal::Next(*next)) { - if (auto* element = DynamicTo<Element>(next)) - return element; + if (auto* next_element = DynamicTo<Element>(next)) + return next_element; } } return nullptr;
diff --git a/third_party/blink/renderer/core/dom/element.cc b/third_party/blink/renderer/core/dom/element.cc index fd58b64..384f5dad 100644 --- a/third_party/blink/renderer/core/dom/element.cc +++ b/third_party/blink/renderer/core/dom/element.cc
@@ -3337,7 +3337,7 @@ // now-removed Shadow DOM v0 API. DCHECK(false) << "Shadow DOM v0 has been removed."; - DCHECK(RuntimeEnabledFeatures::ShadowDOMV0Enabled(GetExecutionContext())); + DCHECK(RuntimeEnabledFeatures::ShadowDOMV0Enabled()); if (ShadowRoot* root = GetShadowRoot()) { if (root->IsUserAgent()) { exception_state.ThrowDOMException( @@ -3372,7 +3372,7 @@ } ShadowRoot& Element::CreateShadowRootInternal() { - DCHECK(RuntimeEnabledFeatures::ShadowDOMV0Enabled(GetExecutionContext())); + DCHECK(RuntimeEnabledFeatures::ShadowDOMV0Enabled()); DCHECK(!ClosedShadowRoot()); DCHECK(AreAuthorShadowsAllowed()); DCHECK(!AlwaysCreateUserAgentShadowRoot());
diff --git a/third_party/blink/renderer/core/dom/node.cc b/third_party/blink/renderer/core/dom/node.cc index 48a67caa..9fa54b2 100644 --- a/third_party/blink/renderer/core/dom/node.cc +++ b/third_party/blink/renderer/core/dom/node.cc
@@ -3262,14 +3262,13 @@ if (element->IsDefined() != was_defined) { element->PseudoStateChanged(CSSSelector::kPseudoDefined); - if (RuntimeEnabledFeatures::CustomElementsV0Enabled(GetExecutionContext())) + if (RuntimeEnabledFeatures::CustomElementsV0Enabled()) element->PseudoStateChanged(CSSSelector::kPseudoUnresolved); } } void Node::SetV0CustomElementState(V0CustomElementState new_state) { - DCHECK( - RuntimeEnabledFeatures::CustomElementsV0Enabled(GetExecutionContext())); + DCHECK(RuntimeEnabledFeatures::CustomElementsV0Enabled()); V0CustomElementState old_state = GetV0CustomElementState(); switch (new_state) {
diff --git a/third_party/blink/renderer/core/exported/BUILD.gn b/third_party/blink/renderer/core/exported/BUILD.gn index 500bedd..6c808d0b 100644 --- a/third_party/blink/renderer/core/exported/BUILD.gn +++ b/third_party/blink/renderer/core/exported/BUILD.gn
@@ -5,6 +5,8 @@ import("//third_party/blink/renderer/core/core.gni") blink_core_sources("exported") { + configs += [ "//build/config/compiler:noshadowing" ] + sources = [ "local_frame_client_impl.cc", "local_frame_client_impl.h",
diff --git a/third_party/blink/renderer/core/exported/local_frame_client_impl.cc b/third_party/blink/renderer/core/exported/local_frame_client_impl.cc index 893ccce..f46bec18 100644 --- a/third_party/blink/renderer/core/exported/local_frame_client_impl.cc +++ b/third_party/blink/renderer/core/exported/local_frame_client_impl.cc
@@ -598,9 +598,9 @@ } else { navigation_info->initiator_frame = nullptr; } - for (auto& policy : initiator_csp) { + for (auto& csp_policy : initiator_csp) { navigation_info->initiator_csp.emplace_back( - ConvertToPublic(std::move(policy))); + ConvertToPublic(std::move(csp_policy))); } if (initiator_self_source) { navigation_info->initiator_self_source =
diff --git a/third_party/blink/renderer/core/frame/deprecation.cc b/third_party/blink/renderer/core/frame/deprecation.cc index 49991d5..2c05ee0 100644 --- a/third_party/blink/renderer/core/frame/deprecation.cc +++ b/third_party/blink/renderer/core/frame/deprecation.cc
@@ -395,23 +395,23 @@ "web-components-time-to-upgrade" case WebFeature::kHTMLImports: - return {"HTMLImports", kM80, - ReplacedWillBeRemoved( - "HTML Imports", "ES modules", kM80, - "5144752345317376 and " kWebComponentsV0DeprecationPost)}; + return {"HTMLImports", kUnknown, + "The HTML Imports feature has been removed. See " + "https://www.chromestatus.com/feature/5144752345317376 for more " + "details."}; case WebFeature::kElementCreateShadowRoot: - return {"ElementCreateShadowRoot", kM80, - ReplacedWillBeRemoved( - "Element.createShadowRoot", "Element.attachShadow", kM80, - "4507242028072960 and " kWebComponentsV0DeprecationPost)}; + return {"ElementCreateShadowRoot", kUnknown, + "The Shadow DOM v0 API has been removed. See " + "https://www.chromestatus.com/feature/4507242028072960 for more " + "details."}; case WebFeature::kDocumentRegisterElement: - return { - "DocumentRegisterElement", kM80, - ReplacedWillBeRemoved( - "document.registerElement", "window.customElements.define", kM80, - "4642138092470272 and " kWebComponentsV0DeprecationPost)}; + return {"DocumentRegisterElement", kUnknown, + "The Custom Elements v0 API has been removed. See " + "https://www.chromestatus.com/feature/4642138092470272 for more " + "details."}; + case WebFeature::kCSSSelectorPseudoUnresolved: return {"CSSSelectorPseudoUnresolved", kM80, ReplacedWillBeRemoved( @@ -689,24 +689,6 @@ } deprecation->SetReported(feature); - // TODO(yoichio): We should remove these counters when v0 APIs are removed. - // crbug.com/946875. - if (feature == WebFeature::kHTMLImports && - context->GetOriginTrialContext()->IsFeatureEnabled( - OriginTrialFeature::kHTMLImports)) { - context->CountUse(WebFeature::kHTMLImportsOnReverseOriginTrials); - } else if (feature == WebFeature::kElementCreateShadowRoot && - context->GetOriginTrialContext()->IsFeatureEnabled( - OriginTrialFeature::kShadowDOMV0)) { - context->CountUse( - WebFeature::kElementCreateShadowRootOnReverseOriginTrials); - } else if (feature == WebFeature::kDocumentRegisterElement && - context->GetOriginTrialContext()->IsFeatureEnabled( - OriginTrialFeature::kCustomElementsV0)) { - context->CountUse( - WebFeature::kDocumentRegisterElementOnReverseOriginTrials); - } - // Don't count usage of WebComponentsV0 for chrome:// URLs, but still report // the deprecation messages. bool count_usage = true;
diff --git a/third_party/blink/renderer/core/html/BUILD.gn b/third_party/blink/renderer/core/html/BUILD.gn index efc6690..02c69a4 100644 --- a/third_party/blink/renderer/core/html/BUILD.gn +++ b/third_party/blink/renderer/core/html/BUILD.gn
@@ -5,6 +5,8 @@ import("//third_party/blink/renderer/core/core.gni") blink_core_sources("html") { + configs += [ "//build/config/compiler:noshadowing" ] + sources = [ "anchor_element_metrics.cc", "anchor_element_metrics.h",
diff --git a/third_party/blink/renderer/core/html/canvas/text_metrics.cc b/third_party/blink/renderer/core/html/canvas/text_metrics.cc index 382fe25..5e9db95 100644 --- a/third_party/blink/renderer/core/html/canvas/text_metrics.cc +++ b/third_party/blink/renderer/core/html/canvas/text_metrics.cc
@@ -64,14 +64,16 @@ if (!font_data) return; - // TODO(kojii): Need to figure out the desired behavior of |advances| when - // bidi reorder occurs. - TextRun text_run( - text, /* xpos */ 0, /* expansion */ 0, - TextRun::kAllowTrailingExpansion | TextRun::kForbidLeadingExpansion, - direction, false); - text_run.SetNormalizeSpace(true); - advances_ = font.IndividualCharacterAdvances(text_run); + { + // TODO(kojii): Need to figure out the desired behavior of |advances| when + // bidi reorder occurs. + TextRun text_run( + text, /* xpos */ 0, /* expansion */ 0, + TextRun::kAllowTrailingExpansion | TextRun::kForbidLeadingExpansion, + direction, false); + text_run.SetNormalizeSpace(true); + advances_ = font.IndividualCharacterAdvances(text_run); + } // x direction // Run bidi algorithm on the given text. Step 5 of:
diff --git a/third_party/blink/renderer/core/html/custom/custom_element.cc b/third_party/blink/renderer/core/html/custom/custom_element.cc index 4992ea2..7e121c6 100644 --- a/third_party/blink/renderer/core/html/custom/custom_element.cc +++ b/third_party/blink/renderer/core/html/custom/custom_element.cc
@@ -158,8 +158,7 @@ } Element* element; - if (RuntimeEnabledFeatures::CustomElementsV0Enabled( - document.GetExecutionContext())) { + if (RuntimeEnabledFeatures::CustomElementsV0Enabled()) { if (V0CustomElement::IsValidName(tag_name.LocalName()) && document.RegistrationContext()) { element = document.RegistrationContext()->CreateCustomTagElement(
diff --git a/third_party/blink/renderer/core/html/forms/html_select_element.cc b/third_party/blink/renderer/core/html/forms/html_select_element.cc index 5e27466..87e0b39 100644 --- a/third_party/blink/renderer/core/html/forms/html_select_element.cc +++ b/third_party/blink/renderer/core/html/forms/html_select_element.cc
@@ -695,16 +695,18 @@ OptionInserted(*option, option->Selected()); } else if (auto* optgroup = DynamicTo<HTMLOptGroupElement>(change.sibling_changed)) { - for (auto& option : Traversal<HTMLOptionElement>::ChildrenOf(*optgroup)) - OptionInserted(option, option.Selected()); + for (auto& child_option : + Traversal<HTMLOptionElement>::ChildrenOf(*optgroup)) + OptionInserted(child_option, child_option.Selected()); } } else if (change.type == ChildrenChangeType::kElementRemoved) { if (auto* option = DynamicTo<HTMLOptionElement>(change.sibling_changed)) { OptionRemoved(*option); } else if (auto* optgroup = DynamicTo<HTMLOptGroupElement>(change.sibling_changed)) { - for (auto& option : Traversal<HTMLOptionElement>::ChildrenOf(*optgroup)) - OptionRemoved(option); + for (auto& child_option : + Traversal<HTMLOptionElement>::ChildrenOf(*optgroup)) + OptionRemoved(child_option); } } else if (change.type == ChildrenChangeType::kAllChildrenRemoved) { DCHECK(change.removed_nodes); @@ -712,8 +714,9 @@ if (auto* option = DynamicTo<HTMLOptionElement>(node)) { OptionRemoved(*option); } else if (auto* optgroup = DynamicTo<HTMLOptGroupElement>(node)) { - for (auto& option : Traversal<HTMLOptionElement>::ChildrenOf(*optgroup)) - OptionRemoved(option); + for (auto& child_option : + Traversal<HTMLOptionElement>::ChildrenOf(*optgroup)) + OptionRemoved(child_option); } } } @@ -922,10 +925,11 @@ } else { wtf_size_t found_index = SearchOptionsForValue(state[0], 0, items_size); if (found_index != kNotFound) { - auto* option_element = To<HTMLOptionElement>(items[found_index].Get()); - option_element->SetSelectedState(true); - option_element->SetDirty(true); - last_on_change_option_ = option_element; + auto* found_option_element = + To<HTMLOptionElement>(items[found_index].Get()); + found_option_element->SetSelectedState(true); + found_option_element->SetDirty(true); + last_on_change_option_ = found_option_element; } } } else { @@ -947,9 +951,10 @@ found_index = SearchOptionsForValue(value, 0, start_index); if (found_index == kNotFound) continue; - auto* option_element = To<HTMLOptionElement>(items[found_index].Get()); - option_element->SetSelectedState(true); - option_element->SetDirty(true); + auto* found_option_element = + To<HTMLOptionElement>(items[found_index].Get()); + found_option_element->SetSelectedState(true); + found_option_element->SetDirty(true); start_index = found_index + 1; } }
diff --git a/third_party/blink/renderer/core/html/forms/select_type.cc b/third_party/blink/renderer/core/html/forms/select_type.cc index afd45fd..2197db3 100644 --- a/third_party/blink/renderer/core/html/forms/select_type.cc +++ b/third_party/blink/renderer/core/html/forms/select_type.cc
@@ -449,7 +449,7 @@ } String MenuListSelectType::UpdateTextStyleInternal() { - HTMLOptionElement* option = OptionToBeShown(); + HTMLOptionElement* option_to_be_shown = OptionToBeShown(); String text = g_empty_string; const ComputedStyle* option_style = nullptr; @@ -475,9 +475,9 @@ DCHECK(!option_style); } } else { - if (option) { - text = option->TextIndentedToRespectGroupLabel(); - option_style = option->GetComputedStyle(); + if (option_to_be_shown) { + text = option_to_be_shown->TextIndentedToRespectGroupLabel(); + option_style = option_to_be_shown->GetComputedStyle(); } } option_style_ = option_style; @@ -499,7 +499,7 @@ } } if (select_->GetLayoutObject()) - DidUpdateActiveOption(option); + DidUpdateActiveOption(option_to_be_shown); return text.StripWhiteSpace(); }
diff --git a/third_party/blink/renderer/core/html/html_details_element.cc b/third_party/blink/renderer/core/html/html_details_element.cc index 13ab1f9..42c8395e 100644 --- a/third_party/blink/renderer/core/html/html_details_element.cc +++ b/third_party/blink/renderer/core/html/html_details_element.cc
@@ -89,12 +89,12 @@ summary_slot->AppendChild(default_summary); root.AppendChild(summary_slot); - auto* content = MakeGarbageCollected<HTMLDivElement>(GetDocument()); - content->SetIdAttribute(shadow_element_names::kIdDetailsContent); - content->AppendChild( - HTMLSlotElement::CreateUserAgentDefaultSlot(GetDocument())); - content->SetInlineStyleProperty(CSSPropertyID::kDisplay, CSSValueID::kNone); - root.AppendChild(content); + HTMLSlotElement* content_slot = + HTMLSlotElement::CreateUserAgentDefaultSlot(GetDocument()); + content_slot->SetIdAttribute(shadow_element_names::kIdDetailsContent); + content_slot->SetInlineStyleProperty(CSSPropertyID::kDisplay, + CSSValueID::kNone); + root.AppendChild(content_slot); } Element* HTMLDetailsElement::FindMainSummary() const {
diff --git a/third_party/blink/renderer/core/html/html_link_element.cc b/third_party/blink/renderer/core/html/html_link_element.cc index dcc516b8..9aee0c7 100644 --- a/third_party/blink/renderer/core/html/html_link_element.cc +++ b/third_party/blink/renderer/core/html/html_link_element.cc
@@ -75,7 +75,7 @@ if (name == html_names::kRelAttr) { rel_attribute_ = LinkRelAttribute(value); if (rel_attribute_.IsImport()) { - if (RuntimeEnabledFeatures::HTMLImportsEnabled(GetExecutionContext())) { + if (RuntimeEnabledFeatures::HTMLImportsEnabled()) { Deprecation::CountDeprecation(GetExecutionContext(), WebFeature::kHTMLImports); } else { @@ -240,7 +240,7 @@ if (!link_) { if (rel_attribute_.IsImport()) { // Only create an import link when HTML imports are enabled. - if (!RuntimeEnabledFeatures::HTMLImportsEnabled(GetExecutionContext())) + if (!RuntimeEnabledFeatures::HTMLImportsEnabled()) return nullptr; link_ = MakeGarbageCollected<LinkImport>(this); } else if (rel_attribute_.IsWebBundle()) {
diff --git a/third_party/blink/renderer/core/layout/flexible_box_algorithm.cc b/third_party/blink/renderer/core/layout/flexible_box_algorithm.cc index d1dcb28..22e0810 100644 --- a/third_party/blink/renderer/core/layout/flexible_box_algorithm.cc +++ b/third_party/blink/renderer/core/layout/flexible_box_algorithm.cc
@@ -164,8 +164,7 @@ DCHECK(layout_result_); return FlowAwareMarginBefore() + NGBoxFragment( - algorithm_->StyleRef().GetWritingMode(), - algorithm_->StyleRef().Direction(), + algorithm_->StyleRef().GetWritingDirection(), To<NGPhysicalBoxFragment>(layout_result_->PhysicalFragment())) .BaselineOrSynthesize(); } @@ -1082,7 +1081,7 @@ LayoutUnit item_main_size = flex_item.FlexedBorderBoxSize(); NGBoxStrut margins = flex_item.physical_margins_.ConvertToLogical( - Style()->GetWritingMode(), Style()->Direction()); + Style()->GetWritingDirection()); // We passed 0 as the initial main_axis offset to ComputeLineItemsPosition // for ColumnReverse containers so here we have to add the
diff --git a/third_party/blink/renderer/core/layout/layout_block_flow.cc b/third_party/blink/renderer/core/layout/layout_block_flow.cc index d4eb7c8..ca8a5da 100644 --- a/third_party/blink/renderer/core/layout/layout_block_flow.cc +++ b/third_party/blink/renderer/core/layout/layout_block_flow.cc
@@ -2625,7 +2625,7 @@ if (RuntimeEnabledFeatures::LayoutNGEnabled()) { if (const NGPaintFragment* paint_fragment = PaintFragment()) { NGBoxFragment box_fragment( - StyleRef().GetWritingMode(), StyleRef().Direction(), + StyleRef().GetWritingDirection(), To<NGPhysicalBoxFragment>(paint_fragment->PhysicalFragment())); if (const base::Optional<LayoutUnit> baseline = box_fragment.Baseline()) return *baseline;
diff --git a/third_party/blink/renderer/core/layout/layout_box.h b/third_party/blink/renderer/core/layout/layout_box.h index 13f6f34..ef1a269 100644 --- a/third_party/blink/renderer/core/layout/layout_box.h +++ b/third_party/blink/renderer/core/layout/layout_box.h
@@ -1472,7 +1472,7 @@ return NGBoxStrut(); } else { return ComputeScrollbarsInternal().ConvertToLogical( - StyleRef().GetWritingMode(), StyleRef().Direction()); + StyleRef().GetWritingDirection()); } }
diff --git a/third_party/blink/renderer/core/layout/layout_object.cc b/third_party/blink/renderer/core/layout/layout_object.cc index 607a77f..c5e0693c 100644 --- a/third_party/blink/renderer/core/layout/layout_object.cc +++ b/third_party/blink/renderer/core/layout/layout_object.cc
@@ -2326,7 +2326,9 @@ } if (diff.NeedsRecomputeVisualOverflow()) { - if (!IsLayoutNGObject() && !IsLayoutBlock() && !NeedsLayout()) { + if (!(IsInLayoutNGInlineFormattingContext() && + RuntimeEnabledFeatures::LayoutNGFragmentItemEnabled()) && + !IsLayoutNGObject() && !IsLayoutBlock() && !NeedsLayout()) { // TODO(crbug.com/1128199): This is still needed because // RecalcVisualOverflow() does not actually compute the visual overflow // for inline elements (legacy layout). However in LayoutNG
diff --git a/third_party/blink/renderer/core/layout/layout_tree_as_text.cc b/third_party/blink/renderer/core/layout/layout_tree_as_text.cc index 7683837..16abdf8 100644 --- a/third_party/blink/renderer/core/layout/layout_tree_as_text.cc +++ b/third_party/blink/renderer/core/layout/layout_tree_as_text.cc
@@ -452,7 +452,7 @@ DynamicTo<NGPhysicalTextFragment>(paint_fragment->PhysicalFragment()); if (!physical_text_fragment) return; - const NGFragment fragment(paint_fragment->Style().GetWritingMode(), + const NGFragment fragment(paint_fragment->Style().GetWritingDirection(), *physical_text_fragment); WriteTextFragment(ts, paint_fragment->GetLayoutObject(), paint_fragment->RectInContainerBlock(),
diff --git a/third_party/blink/renderer/core/layout/ng/custom/custom_layout_work_task.cc b/third_party/blink/renderer/core/layout/ng/custom/custom_layout_work_task.cc index 4c204bef..4bc3297 100644 --- a/third_party/blink/renderer/core/layout/ng/custom/custom_layout_work_task.cc +++ b/third_party/blink/renderer/core/layout/ng/custom/custom_layout_work_task.cc
@@ -140,8 +140,7 @@ auto space = builder.ToConstraintSpace(); auto result = To<NGBlockNode>(child).Layout(space, nullptr /* break_token */); - NGBoxFragment fragment(parent_space.GetWritingMode(), - parent_space.Direction(), + NGBoxFragment fragment(parent_space.GetWritingDirection(), To<NGPhysicalBoxFragment>(result->PhysicalFragment())); resolver_->Resolve(MakeGarbageCollected<CustomLayoutFragment>(
diff --git a/third_party/blink/renderer/core/layout/ng/flex/ng_flex_layout_algorithm.cc b/third_party/blink/renderer/core/layout/ng/flex/ng_flex_layout_algorithm.cc index f75d4c224..70d4302 100644 --- a/third_party/blink/renderer/core/layout/ng/flex/ng_flex_layout_algorithm.cc +++ b/third_party/blink/renderer/core/layout/ng/flex/ng_flex_layout_algorithm.cc
@@ -355,7 +355,7 @@ space_builder.SetIsPaintedAtomically(true); NGBoxStrut margins = physical_margins.ConvertToLogical( - ConstraintSpace().GetWritingMode(), Style().Direction()); + ConstraintSpace().GetWritingDirection()); LogicalSize child_available_size = ChildAvailableSize(); if (ShouldItemShrinkToFit(flex_item)) { space_builder.SetIsShrinkToFit(true); @@ -553,7 +553,7 @@ NGPhysicalBoxStrut physical_border_padding( border_padding_in_child_writing_mode.ConvertToPhysical( - child_style.GetWritingMode(), child_style.Direction())); + child_style.GetWritingDirection())); LayoutUnit main_axis_border_padding = is_horizontal_flow_ ? physical_border_padding.HorizontalSum() @@ -664,7 +664,7 @@ LayoutUnit cross_size; if (use_container_cross_size_for_aspect_ratio) { NGBoxStrut margins = physical_child_margins.ConvertToLogical( - ConstraintSpace().GetWritingMode(), Style().Direction()); + ConstraintSpace().GetWritingDirection()); cross_size = CalculateFixedCrossSize( min_max_sizes_in_cross_axis_direction, margins); } else if (MainAxisIsInlineAxis(child)) { @@ -1012,7 +1012,7 @@ LogicalSize available_size; NGBoxStrut margins = flex_item.physical_margins_.ConvertToLogical( - ConstraintSpace().GetWritingMode(), Style().Direction()); + ConstraintSpace().GetWritingDirection()); LayoutUnit fixed_aspect_ratio_cross_size = kIndefiniteSize; if (RuntimeEnabledFeatures::FlexAspectRatioEnabled() && flex_item.ng_input_node_.HasAspectRatio() && @@ -1248,8 +1248,8 @@ ? flex_item.desired_location_.TransposedPoint() : flex_item.desired_location_; - NGBoxFragment fragment(ConstraintSpace().GetWritingMode(), - ConstraintSpace().Direction(), physical_fragment); + NGBoxFragment fragment(ConstraintSpace().GetWritingDirection(), + physical_fragment); // Only propagate baselines from children on the first flex-line. if (&line_context == line_contexts.begin()) { PropagateBaselineFromChild(flex_item, fragment, location.Y(), @@ -1263,8 +1263,7 @@ LayoutUnit margin_block_end = flex_item.physical_margins_ - .ConvertToLogical(ConstraintSpace().GetWritingMode(), - ConstraintSpace().Direction()) + .ConvertToLogical(ConstraintSpace().GetWritingDirection()) .block_end; overflow_block_size = std::max(overflow_block_size, @@ -1352,7 +1351,7 @@ const NGContainerFragmentBuilder::ChildWithOffset& child = children[0]; DCHECK(!child.fragment->IsLineBox()); const NGConstraintSpace& space = ConstraintSpace(); - NGBoxFragment fragment(space.GetWritingMode(), space.Direction(), + NGBoxFragment fragment(space.GetWritingDirection(), To<NGPhysicalBoxFragment>(*child.fragment)); base::Optional<LayoutUnit> child_baseline = space.BaselineAlgorithmType() == NGBaselineAlgorithmType::kFirstLine
diff --git a/third_party/blink/renderer/core/layout/ng/geometry/ng_box_strut.h b/third_party/blink/renderer/core/layout/ng/geometry/ng_box_strut.h index f4795b5..c6163b6 100644 --- a/third_party/blink/renderer/core/layout/ng/geometry/ng_box_strut.h +++ b/third_party/blink/renderer/core/layout/ng/geometry/ng_box_strut.h
@@ -54,7 +54,7 @@ block_end = block_end.ClampNegativeToZero(); } - inline NGPhysicalBoxStrut ConvertToPhysical(WritingMode, TextDirection) const; + inline NGPhysicalBoxStrut ConvertToPhysical(WritingDirectionMode) const; // The following two operators exist primarily to have an easy way to access // the sum of border and padding. @@ -167,10 +167,9 @@ // Converts physical dimensions to logical ones per // https://drafts.csswg.org/css-writing-modes-3/#logical-to-physical - NGBoxStrut ConvertToLogical(WritingMode writing_mode, - TextDirection direction) const { + NGBoxStrut ConvertToLogical(WritingDirectionMode writing_direction) const { NGBoxStrut strut; - switch (writing_mode) { + switch (writing_direction.GetWritingMode()) { case WritingMode::kHorizontalTb: strut = {left, right, top, bottom}; break; @@ -185,17 +184,17 @@ strut = {bottom, top, left, right}; break; } - if (direction == TextDirection::kRtl) + if (writing_direction.IsRtl()) std::swap(strut.inline_start, strut.inline_end); return strut; } // Converts physical dimensions to line-relative logical ones per // https://drafts.csswg.org/css-writing-modes-3/#line-directions - NGLineBoxStrut ConvertToLineLogical(WritingMode writing_mode, - TextDirection direction) const { - return NGLineBoxStrut(ConvertToLogical(writing_mode, direction), - IsFlippedLinesWritingMode(writing_mode)); + NGLineBoxStrut ConvertToLineLogical( + WritingDirectionMode writing_direction) const { + return NGLineBoxStrut(ConvertToLogical(writing_direction), + writing_direction.IsFlippedLines()); } NGPixelSnappedPhysicalBoxStrut SnapToDevicePixels() const { @@ -238,13 +237,12 @@ }; inline NGPhysicalBoxStrut NGBoxStrut::ConvertToPhysical( - WritingMode writing_mode, - TextDirection direction) const { + WritingDirectionMode writing_direction) const { LayoutUnit direction_start = inline_start; LayoutUnit direction_end = inline_end; - if (direction == TextDirection::kRtl) + if (writing_direction.IsRtl()) std::swap(direction_start, direction_end); - switch (writing_mode) { + switch (writing_direction.GetWritingMode()) { case WritingMode::kHorizontalTb: return NGPhysicalBoxStrut(block_start, direction_end, block_end, direction_start);
diff --git a/third_party/blink/renderer/core/layout/ng/geometry/ng_box_strut_test.cc b/third_party/blink/renderer/core/layout/ng/geometry/ng_box_strut_test.cc index 4f43da0..89b40c1 100644 --- a/third_party/blink/renderer/core/layout/ng/geometry/ng_box_strut_test.cc +++ b/third_party/blink/renderer/core/layout/ng/geometry/ng_box_strut_test.cc
@@ -16,33 +16,33 @@ LayoutUnit left{5}, right{10}, top{15}, bottom{20}; NGPhysicalBoxStrut physical{top, right, bottom, left}; - NGBoxStrut logical = physical.ConvertToLogical(WritingMode::kHorizontalTb, - TextDirection::kLtr); + NGBoxStrut logical = physical.ConvertToLogical( + {WritingMode::kHorizontalTb, TextDirection::kLtr}); EXPECT_EQ(left, logical.inline_start); EXPECT_EQ(top, logical.block_start); - logical = physical.ConvertToLogical(WritingMode::kHorizontalTb, - TextDirection::kRtl); + logical = physical.ConvertToLogical( + {WritingMode::kHorizontalTb, TextDirection::kRtl}); EXPECT_EQ(right, logical.inline_start); EXPECT_EQ(top, logical.block_start); - logical = - physical.ConvertToLogical(WritingMode::kVerticalLr, TextDirection::kLtr); + logical = physical.ConvertToLogical( + {WritingMode::kVerticalLr, TextDirection::kLtr}); EXPECT_EQ(top, logical.inline_start); EXPECT_EQ(left, logical.block_start); - logical = - physical.ConvertToLogical(WritingMode::kVerticalLr, TextDirection::kRtl); + logical = physical.ConvertToLogical( + {WritingMode::kVerticalLr, TextDirection::kRtl}); EXPECT_EQ(bottom, logical.inline_start); EXPECT_EQ(left, logical.block_start); - logical = - physical.ConvertToLogical(WritingMode::kVerticalRl, TextDirection::kLtr); + logical = physical.ConvertToLogical( + {WritingMode::kVerticalRl, TextDirection::kLtr}); EXPECT_EQ(top, logical.inline_start); EXPECT_EQ(right, logical.block_start); - logical = - physical.ConvertToLogical(WritingMode::kVerticalRl, TextDirection::kRtl); + logical = physical.ConvertToLogical( + {WritingMode::kVerticalRl, TextDirection::kRtl}); EXPECT_EQ(bottom, logical.inline_start); EXPECT_EQ(right, logical.block_start); } @@ -51,44 +51,46 @@ LayoutUnit left{5}, right{10}, top{15}, bottom{20}; NGBoxStrut logical(left, right, top, bottom); NGBoxStrut converted = - logical.ConvertToPhysical(WritingMode::kHorizontalTb, TextDirection::kLtr) - .ConvertToLogical(WritingMode::kHorizontalTb, TextDirection::kLtr); + logical + .ConvertToPhysical({WritingMode::kHorizontalTb, TextDirection::kLtr}) + .ConvertToLogical({WritingMode::kHorizontalTb, TextDirection::kLtr}); EXPECT_EQ(logical, converted); converted = - logical.ConvertToPhysical(WritingMode::kHorizontalTb, TextDirection::kRtl) - .ConvertToLogical(WritingMode::kHorizontalTb, TextDirection::kRtl); + logical + .ConvertToPhysical({WritingMode::kHorizontalTb, TextDirection::kRtl}) + .ConvertToLogical({WritingMode::kHorizontalTb, TextDirection::kRtl}); EXPECT_EQ(logical, converted); converted = - logical.ConvertToPhysical(WritingMode::kVerticalLr, TextDirection::kLtr) - .ConvertToLogical(WritingMode::kVerticalLr, TextDirection::kLtr); + logical.ConvertToPhysical({WritingMode::kVerticalLr, TextDirection::kLtr}) + .ConvertToLogical({WritingMode::kVerticalLr, TextDirection::kLtr}); EXPECT_EQ(logical, converted); converted = - logical.ConvertToPhysical(WritingMode::kVerticalLr, TextDirection::kRtl) - .ConvertToLogical(WritingMode::kVerticalLr, TextDirection::kRtl); + logical.ConvertToPhysical({WritingMode::kVerticalLr, TextDirection::kRtl}) + .ConvertToLogical({WritingMode::kVerticalLr, TextDirection::kRtl}); EXPECT_EQ(logical, converted); converted = - logical.ConvertToPhysical(WritingMode::kVerticalRl, TextDirection::kLtr) - .ConvertToLogical(WritingMode::kVerticalRl, TextDirection::kLtr); + logical.ConvertToPhysical({WritingMode::kVerticalRl, TextDirection::kLtr}) + .ConvertToLogical({WritingMode::kVerticalRl, TextDirection::kLtr}); EXPECT_EQ(logical, converted); converted = - logical.ConvertToPhysical(WritingMode::kVerticalRl, TextDirection::kRtl) - .ConvertToLogical(WritingMode::kVerticalRl, TextDirection::kRtl); + logical.ConvertToPhysical({WritingMode::kVerticalRl, TextDirection::kRtl}) + .ConvertToLogical({WritingMode::kVerticalRl, TextDirection::kRtl}); EXPECT_EQ(logical, converted); converted = - logical.ConvertToPhysical(WritingMode::kSidewaysRl, TextDirection::kLtr) - .ConvertToLogical(WritingMode::kSidewaysRl, TextDirection::kLtr); + logical.ConvertToPhysical({WritingMode::kSidewaysRl, TextDirection::kLtr}) + .ConvertToLogical({WritingMode::kSidewaysRl, TextDirection::kLtr}); EXPECT_EQ(logical, converted); converted = - logical.ConvertToPhysical(WritingMode::kSidewaysRl, TextDirection::kRtl) - .ConvertToLogical(WritingMode::kSidewaysRl, TextDirection::kRtl); + logical.ConvertToPhysical({WritingMode::kSidewaysRl, TextDirection::kRtl}) + .ConvertToLogical({WritingMode::kSidewaysRl, TextDirection::kRtl}); EXPECT_EQ(logical, converted); converted = - logical.ConvertToPhysical(WritingMode::kSidewaysLr, TextDirection::kLtr) - .ConvertToLogical(WritingMode::kSidewaysLr, TextDirection::kLtr); + logical.ConvertToPhysical({WritingMode::kSidewaysLr, TextDirection::kLtr}) + .ConvertToLogical({WritingMode::kSidewaysLr, TextDirection::kLtr}); EXPECT_EQ(logical, converted); converted = - logical.ConvertToPhysical(WritingMode::kSidewaysLr, TextDirection::kRtl) - .ConvertToLogical(WritingMode::kSidewaysLr, TextDirection::kRtl); + logical.ConvertToPhysical({WritingMode::kSidewaysLr, TextDirection::kRtl}) + .ConvertToLogical({WritingMode::kSidewaysLr, TextDirection::kRtl}); EXPECT_EQ(logical, converted); }
diff --git a/third_party/blink/renderer/core/layout/ng/grid/ng_grid_layout_algorithm.cc b/third_party/blink/renderer/core/layout/ng/grid/ng_grid_layout_algorithm.cc index 15061bdc..e909331e 100644 --- a/third_party/blink/renderer/core/layout/ng/grid/ng_grid_layout_algorithm.cc +++ b/third_party/blink/renderer/core/layout/ng/grid/ng_grid_layout_algorithm.cc
@@ -250,7 +250,7 @@ // determine inline size. if (is_orthogonal_flow_root) { scoped_refptr<const NGLayoutResult> result = node.Layout(constraint_space); - grid_item.inline_size = NGFragment(ConstraintSpace().GetWritingMode(), + grid_item.inline_size = NGFragment(ConstraintSpace().GetWritingDirection(), result->PhysicalFragment()) .InlineSize(); } else {
diff --git a/third_party/blink/renderer/core/layout/ng/inline/ng_inline_layout_algorithm.cc b/third_party/blink/renderer/core/layout/ng/inline/ng_inline_layout_algorithm.cc index 3ced3c7..92004458 100644 --- a/third_party/blink/renderer/core/layout/ng/inline/ng_inline_layout_algorithm.cc +++ b/third_party/blink/renderer/core/layout/ng/inline/ng_inline_layout_algorithm.cc
@@ -571,8 +571,7 @@ const NGInlineItem& item = *item_result->item; DCHECK(item.Style()); FontHeight metrics = - NGBoxFragment(ConstraintSpace().GetWritingMode(), - ConstraintSpace().Direction(), + NGBoxFragment(ConstraintSpace().GetWritingDirection(), To<NGPhysicalBoxFragment>( item_result->layout_result->PhysicalFragment())) .BaselineMetrics(item_result->margins, baseline_type_); @@ -748,7 +747,7 @@ // We need to manually account for the flipped-lines writing mode here :(. if (IsFlippedLinesWritingMode(ConstraintSpace().GetWritingMode())) { - NGFragment fragment(ConstraintSpace().GetWritingMode(), + NGFragment fragment(ConstraintSpace().GetWritingDirection(), child.layout_result->PhysicalFragment()); block_offset = -fragment.BlockSize() - block_offset;
diff --git a/third_party/blink/renderer/core/layout/ng/inline/ng_inline_node_test.cc b/third_party/blink/renderer/core/layout/ng/inline/ng_inline_node_test.cc index 4a06769e..1ec7748 100644 --- a/third_party/blink/renderer/core/layout/ng/inline/ng_inline_node_test.cc +++ b/third_party/blink/renderer/core/layout/ng/inline/ng_inline_node_test.cc
@@ -598,18 +598,16 @@ }; unsigned needs_collect_inlines; base::Optional<bool> is_line_dirty; - bool invalidate_ink_overflow = false; + base::Optional<bool> invalidate_ink_overflow; } style_change_data[] = { // Changing color, text-decoration, outline, etc. should not re-run // |CollectInlines()|. {"#parent.after { color: red; }", StyleChangeData::kNone, false}, - // TODO(crbug.com/1128199): text-decorations, outline, etc. should not - // require layout, only ink overflow, but they currently do. {"#parent.after { text-decoration-line: underline; }", - StyleChangeData::kNone, true, true}, + StyleChangeData::kNone, false, true}, {"#parent { background: orange; }" // Make sure it's not culled. "#parent.after { outline: auto; }", - StyleChangeData::kNone, true}, + StyleChangeData::kNone, false, false}, // Changing fonts should re-run |CollectInlines()|. {"#parent.after { font-size: 200%; }", StyleChangeData::kAll, true}, // Changing from/to out-of-flow should re-rerun |CollectInlines()|. @@ -702,7 +700,8 @@ for (cursor.MoveTo(*child); cursor; cursor.MoveToNextForSameLayoutObject()) { const NGFragmentItem* item = cursor.CurrentItem(); - EXPECT_FALSE(item->IsInkOverflowComputed()); + EXPECT_EQ(item->IsInkOverflowComputed(), + !*data.invalidate_ink_overflow); } } }
diff --git a/third_party/blink/renderer/core/layout/ng/inline/ng_line_breaker.cc b/third_party/blink/renderer/core/layout/ng/inline/ng_line_breaker.cc index ced4cc00e..d9c90fd 100644 --- a/third_party/blink/renderer/core/layout/ng/inline/ng_line_breaker.cc +++ b/third_party/blink/renderer/core/layout/ng/inline/ng_line_breaker.cc
@@ -1474,7 +1474,7 @@ .LayoutAtomicInline(constraint_space_, node_.Style(), line_info->UseFirstLineStyle()); item_result->inline_size = - NGFragment(constraint_space_.GetWritingMode(), + NGFragment(constraint_space_.GetWritingDirection(), item_result->layout_result->PhysicalFragment()) .InlineSize(); item_result->inline_size += inline_margins;
diff --git a/third_party/blink/renderer/core/layout/ng/inline/ng_ruby_utils.cc b/third_party/blink/renderer/core/layout/ng/inline/ng_ruby_utils.cc index 12cae18fd..b298a885 100644 --- a/third_party/blink/renderer/core/layout/ng/inline/ng_ruby_utils.cc +++ b/third_party/blink/renderer/core/layout/ng/inline/ng_ruby_utils.cc
@@ -120,9 +120,9 @@ } if (layout_object->IsRubyBase()) { const ComputedStyle& base_style = child_fragment.Style(); - const WritingMode writing_mode = base_style.GetWritingMode(); + const auto writing_direction = base_style.GetWritingDirection(); const LayoutUnit base_inline_size = - NGFragment(writing_mode, child_fragment).InlineSize(); + NGFragment(writing_direction, child_fragment).InlineSize(); // RubyBase's inline_size is always same as RubyRun's inline_size. // Overhang values are offsets from RubyBase's inline edges to // the outmost text. @@ -130,13 +130,14 @@ To<NGPhysicalContainerFragment>(child_fragment) .PostLayoutChildren()) { const LayoutUnit line_inline_size = - NGFragment(writing_mode, *base_child_link).InlineSize(); + NGFragment(writing_direction, *base_child_link).InlineSize(); if (line_inline_size == LayoutUnit()) continue; found_line = true; const LayoutUnit start = base_child_link.offset - .ConvertToLogical(writing_mode, base_style.Direction(), + .ConvertToLogical(writing_direction.GetWritingMode(), + writing_direction.Direction(), child_fragment.Size(), base_child_link.get()->Size()) .inline_offset;
diff --git a/third_party/blink/renderer/core/layout/ng/layout_ng_block_flow_mixin.cc b/third_party/blink/renderer/core/layout/ng/layout_ng_block_flow_mixin.cc index 5ead821b..265b7949 100644 --- a/third_party/blink/renderer/core/layout/ng/layout_ng_block_flow_mixin.cc +++ b/third_party/blink/renderer/core/layout/ng/layout_ng_block_flow_mixin.cc
@@ -353,15 +353,14 @@ // on ourselves, since that's what the legacy container expects. const ComputedStyle& style = Base::StyleRef(); const ComputedStyle& cb_style = containing_block->StyleRef(); - const auto writing_mode = cb_style.GetWritingMode(); - const auto direction = cb_style.Direction(); + const auto writing_direction = cb_style.GetWritingDirection(); LayoutUnit available_logical_width = LayoutBoxUtils::AvailableLogicalWidth(*this, containing_block); NGBoxStrut margins = ComputePhysicalMargins(style, available_logical_width) - .ConvertToLogical(writing_mode, direction); + .ConvertToLogical(writing_direction); ResolveInlineMargins(style, cb_style, available_logical_width, Base::LogicalWidth(), &margins); - Base::SetMargin(margins.ConvertToPhysical(writing_mode, direction)); + Base::SetMargin(margins.ConvertToPhysical(writing_direction)); } template class CORE_TEMPLATE_EXPORT LayoutNGBlockFlowMixin<LayoutBlockFlow>;
diff --git a/third_party/blink/renderer/core/layout/ng/list/ng_unpositioned_list_marker.cc b/third_party/blink/renderer/core/layout/ng/list/ng_unpositioned_list_marker.cc index 6f0f8ad..04c1cc9 100644 --- a/third_party/blink/renderer/core/layout/ng/list/ng_unpositioned_list_marker.cc +++ b/third_party/blink/renderer/core/layout/ng/list/ng_unpositioned_list_marker.cc
@@ -74,7 +74,7 @@ // If this child content does not have any line boxes, the list marker // should be aligned to the first line box of next child. // https://github.com/w3c/csswg-drafts/issues/2417 - return NGBoxFragment(space.GetWritingMode(), space.Direction(), + return NGBoxFragment(space.GetWritingDirection(), To<NGPhysicalBoxFragment>(content)) .FirstBaseline(); } @@ -92,7 +92,7 @@ To<NGPhysicalBoxFragment>(marker_layout_result.PhysicalFragment()); // Compute the inline offset of the marker. - NGBoxFragment marker_fragment(space.GetWritingMode(), space.Direction(), + NGBoxFragment marker_fragment(space.GetWritingDirection(), marker_physical_fragment); LogicalOffset marker_offset(InlineOffset(marker_fragment.Size().inline_size), content_offset->block_offset);
diff --git a/third_party/blink/renderer/core/layout/ng/mathml/ng_math_fraction_layout_algorithm.cc b/third_party/blink/renderer/core/layout/ng/mathml/ng_math_fraction_layout_algorithm.cc index 9a621e3..fb8c3661 100644 --- a/third_party/blink/renderer/core/layout/ng/mathml/ng_math_fraction_layout_algorithm.cc +++ b/third_party/blink/renderer/core/layout/ng/mathml/ng_math_fraction_layout_algorithm.cc
@@ -172,10 +172,10 @@ denominator_space, denominator.Style(), ConstraintSpace()); NGBoxFragment numerator_fragment( - ConstraintSpace().GetWritingMode(), ConstraintSpace().Direction(), + ConstraintSpace().GetWritingDirection(), To<NGPhysicalBoxFragment>(numerator_layout_result->PhysicalFragment())); NGBoxFragment denominator_fragment( - ConstraintSpace().GetWritingMode(), ConstraintSpace().Direction(), + ConstraintSpace().GetWritingDirection(), To<NGPhysicalBoxFragment>(denominator_layout_result->PhysicalFragment())); LayoutUnit numerator_ascent =
diff --git a/third_party/blink/renderer/core/layout/ng/mathml/ng_math_padded_layout_algorithm.cc b/third_party/blink/renderer/core/layout/ng/mathml/ng_math_padded_layout_algorithm.cc index 2d3ee55a..5a2a022 100644 --- a/third_party/blink/renderer/core/layout/ng/mathml/ng_math_padded_layout_algorithm.cc +++ b/third_party/blink/renderer/core/layout/ng/mathml/ng_math_padded_layout_algorithm.cc
@@ -82,8 +82,8 @@ &To<NGPhysicalBoxFragment>(content_layout_result->PhysicalFragment()); content_margins = ComputeMarginsFor(constraint_space, content.Style(), ConstraintSpace()); - NGBoxFragment fragment(ConstraintSpace().GetWritingMode(), - ConstraintSpace().Direction(), *content_fragment); + NGBoxFragment fragment(ConstraintSpace().GetWritingDirection(), + *content_fragment); content_ascent = content_margins.block_start + fragment.Baseline().value_or(fragment.BlockSize()); content_descent =
diff --git a/third_party/blink/renderer/core/layout/ng/mathml/ng_math_radical_layout_algorithm.cc b/third_party/blink/renderer/core/layout/ng/mathml/ng_math_radical_layout_algorithm.cc index d1a871e..a0a993b 100644 --- a/third_party/blink/renderer/core/layout/ng/mathml/ng_math_radical_layout_algorithm.cc +++ b/third_party/blink/renderer/core/layout/ng/mathml/ng_math_radical_layout_algorithm.cc
@@ -86,8 +86,8 @@ &To<NGPhysicalBoxFragment>(base_layout_result->PhysicalFragment()); base_margins = ComputeMarginsFor(constraint_space, base.Style(), ConstraintSpace()); - NGBoxFragment fragment(ConstraintSpace().GetWritingMode(), - ConstraintSpace().Direction(), *base_fragment); + NGBoxFragment fragment(ConstraintSpace().GetWritingDirection(), + *base_fragment); base_ascent = base_margins.block_start + fragment.BaselineOrSynthesize(); base_descent = fragment.BlockSize() + base_margins.BlockSum() - base_ascent; } @@ -102,8 +102,8 @@ &To<NGPhysicalBoxFragment>(index_layout_result->PhysicalFragment()); index_margins = ComputeMarginsFor(constraint_space, index.Style(), ConstraintSpace()); - NGBoxFragment fragment(ConstraintSpace().GetWritingMode(), - ConstraintSpace().Direction(), *index_fragment); + NGBoxFragment fragment(ConstraintSpace().GetWritingDirection(), + *index_fragment); index_inline_size = fragment.InlineSize() + index_margins.InlineSum(); index_ascent = index_margins.block_start + fragment.BaselineOrSynthesize(); index_descent =
diff --git a/third_party/blink/renderer/core/layout/ng/mathml/ng_math_row_layout_algorithm.cc b/third_party/blink/renderer/core/layout/ng/mathml/ng_math_row_layout_algorithm.cc index feb07c5..7b2427d 100644 --- a/third_party/blink/renderer/core/layout/ng/mathml/ng_math_row_layout_algorithm.cc +++ b/third_party/blink/renderer/core/layout/ng/mathml/ng_math_row_layout_algorithm.cc
@@ -79,8 +79,7 @@ To<NGBlockNode>(child).Layout(child_space, nullptr /* break token */); const NGPhysicalContainerFragment& physical_fragment = result->PhysicalFragment(); - NGBoxFragment fragment(ConstraintSpace().GetWritingMode(), - ConstraintSpace().Direction(), + NGBoxFragment fragment(ConstraintSpace().GetWritingDirection(), To<NGPhysicalBoxFragment>(physical_fragment)); NGBoxStrut margins =
diff --git a/third_party/blink/renderer/core/layout/ng/mathml/ng_math_scripts_layout_algorithm.cc b/third_party/blink/renderer/core/layout/ng/mathml/ng_math_scripts_layout_algorithm.cc index a98207bd..9ff68b81 100644 --- a/third_party/blink/renderer/core/layout/ng/mathml/ng_math_scripts_layout_algorithm.cc +++ b/third_party/blink/renderer/core/layout/ng/mathml/ng_math_scripts_layout_algorithm.cc
@@ -273,7 +273,7 @@ child_and_metrics.result = child.Layout(constraint_space, nullptr /*break_token*/); NGBoxFragment fragment( - ConstraintSpace().GetWritingMode(), ConstraintSpace().Direction(), + ConstraintSpace().GetWritingDirection(), To<NGPhysicalBoxFragment>(child_and_metrics.result->PhysicalFragment())); child_and_metrics.inline_size = fragment.InlineSize(); child_and_metrics.margins =
diff --git a/third_party/blink/renderer/core/layout/ng/mathml/ng_math_under_over_layout_algorithm.cc b/third_party/blink/renderer/core/layout/ng/mathml/ng_math_under_over_layout_algorithm.cc index 96059bb..7e78c350 100644 --- a/third_party/blink/renderer/core/layout/ng/mathml/ng_math_under_over_layout_algorithm.cc +++ b/third_party/blink/renderer/core/layout/ng/mathml/ng_math_under_over_layout_algorithm.cc
@@ -221,7 +221,7 @@ ComputeMarginsFor(base_space, base.Style(), ConstraintSpace()); NGBoxFragment base_fragment( - ConstraintSpace().GetWritingMode(), ConstraintSpace().Direction(), + ConstraintSpace().GetWritingDirection(), To<NGPhysicalBoxFragment>(base_layout_result->PhysicalFragment())); LayoutUnit base_ascent = base_fragment.BaselineOrSynthesize(); @@ -235,7 +235,7 @@ NGBoxStrut over_margins = ComputeMarginsFor(over_space, over.Style(), ConstraintSpace()); NGBoxFragment over_fragment( - ConstraintSpace().GetWritingMode(), ConstraintSpace().Direction(), + ConstraintSpace().GetWritingDirection(), To<NGPhysicalBoxFragment>(over_layout_result->PhysicalFragment())); block_offset += parameters.over_extra_ascender + over_margins.block_start; LogicalOffset over_offset = { @@ -284,7 +284,7 @@ NGBoxStrut under_margins = ComputeMarginsFor(under_space, under.Style(), ConstraintSpace()); NGBoxFragment under_fragment( - ConstraintSpace().GetWritingMode(), ConstraintSpace().Direction(), + ConstraintSpace().GetWritingDirection(), To<NGPhysicalBoxFragment>(under_layout_result->PhysicalFragment())); block_offset += under_margins.block_start; if (parameters.use_under_over_bar_fallback) {
diff --git a/third_party/blink/renderer/core/layout/ng/ng_block_layout_algorithm.cc b/third_party/blink/renderer/core/layout/ng/ng_block_layout_algorithm.cc index ded9c0f2..d7baf0e 100644 --- a/third_party/blink/renderer/core/layout/ng/ng_block_layout_algorithm.cc +++ b/third_party/blink/renderer/core/layout/ng/ng_block_layout_algorithm.cc
@@ -1122,7 +1122,7 @@ const NGPhysicalFragment& physical_fragment = positioned_float.layout_result->PhysicalFragment(); LayoutUnit float_inline_size = - NGFragment(ConstraintSpace().GetWritingMode(), physical_fragment) + NGFragment(ConstraintSpace().GetWritingDirection(), physical_fragment) .InlineSize(); NGBfcOffset bfc_offset = {ConstraintSpace().BfcOffset().line_offset, @@ -1324,7 +1324,8 @@ } const auto& physical_fragment = layout_result->PhysicalFragment(); - NGFragment fragment(ConstraintSpace().GetWritingMode(), physical_fragment); + NGFragment fragment(ConstraintSpace().GetWritingDirection(), + physical_fragment); LogicalOffset logical_offset = LogicalFromBfcOffsets( child_bfc_offset, ContainerBfcOffset(), fragment.InlineSize(), @@ -1362,7 +1363,7 @@ NGBfcOffset* out_child_bfc_offset) { const ComputedStyle& child_style = child.Style(); const TextDirection direction = ConstraintSpace().Direction(); - const WritingMode writing_mode = ConstraintSpace().GetWritingMode(); + const auto writing_direction = ConstraintSpace().GetWritingDirection(); // The origin offset is where we should start looking for layout // opportunities. It needs to be adjusted by the child's clearance. @@ -1461,7 +1462,7 @@ return layout_result; } - NGFragment fragment(writing_mode, layout_result->PhysicalFragment()); + NGFragment fragment(writing_direction, layout_result->PhysicalFragment()); // Check if the fragment will fit in this layout opportunity, if not proceed // to the next opportunity. @@ -1483,7 +1484,7 @@ LayoutUnit marker_inline_size; if (!marker_fragment.Children().empty()) { marker_inline_size = - NGFragment(writing_mode, *marker_fragment.Children().front()) + NGFragment(writing_direction, *marker_fragment.Children().front()) .InlineSize(); } auto_margins.inline_start = @@ -1815,7 +1816,8 @@ } const auto& physical_fragment = layout_result->PhysicalFragment(); - NGFragment fragment(ConstraintSpace().GetWritingMode(), physical_fragment); + NGFragment fragment(ConstraintSpace().GetWritingDirection(), + physical_fragment); LogicalOffset logical_offset = CalculateLogicalOffset( fragment, layout_result->BfcLineOffset(), child_bfc_block_offset); @@ -2342,9 +2344,9 @@ if (!needs_inline_size && !child_style.MayHaveMargin()) return {}; - NGBoxStrut margins = ComputeMarginsFor( - child_style, child_percentage_size_.inline_size, - ConstraintSpace().GetWritingMode(), ConstraintSpace().Direction()); + NGBoxStrut margins = + ComputeMarginsFor(child_style, child_percentage_size_.inline_size, + ConstraintSpace().GetWritingDirection()); // As long as the child isn't establishing a new formatting context, we need // to know its line-left offset before layout, to be able to position child @@ -2547,8 +2549,7 @@ return; } - NGBoxFragment fragment(ConstraintSpace().GetWritingMode(), - ConstraintSpace().Direction(), + NGBoxFragment fragment(ConstraintSpace().GetWritingDirection(), To<NGPhysicalBoxFragment>(child)); if (!container_builder_.Baseline()) {
diff --git a/third_party/blink/renderer/core/layout/ng/ng_block_node.cc b/third_party/blink/renderer/core/layout/ng/ng_block_node.cc index 975e028..30dbfd71 100644 --- a/third_party/blink/renderer/core/layout/ng/ng_block_node.cc +++ b/third_party/blink/renderer/core/layout/ng/ng_block_node.cc
@@ -726,9 +726,9 @@ scoped_refptr<const NGLayoutResult> layout_result = Layout(*constraint_space); DCHECK_EQ(layout_result->Status(), NGLayoutResult::kSuccess); - sizes = - NGFragment(container_writing_mode, layout_result->PhysicalFragment()) - .InlineSize(); + sizes = NGFragment({container_writing_mode, TextDirection::kLtr}, + layout_result->PhysicalFragment()) + .InlineSize(); return {sizes, /* depends_on_percentage_block_size */ false}; } @@ -1015,8 +1015,8 @@ const auto& physical_fragment = To<NGPhysicalBoxFragment>(layout_result.PhysicalFragment()); - NGBoxFragment fragment(constraint_space.GetWritingMode(), - constraint_space.Direction(), physical_fragment); + NGBoxFragment fragment(constraint_space.GetWritingDirection(), + physical_fragment); LogicalSize fragment_logical_size = fragment.Size(); NGBoxStrut borders = fragment.Borders(); NGBoxStrut scrollbars = ComputeScrollbars(constraint_space, *this); @@ -1798,8 +1798,8 @@ void NGBlockNode::StoreMargins(const NGConstraintSpace& constraint_space, const NGBoxStrut& margins) { - NGPhysicalBoxStrut physical_margins = margins.ConvertToPhysical( - constraint_space.GetWritingMode(), constraint_space.Direction()); + NGPhysicalBoxStrut physical_margins = + margins.ConvertToPhysical(constraint_space.GetWritingDirection()); box_->SetMargin(physical_margins); }
diff --git a/third_party/blink/renderer/core/layout/ng/ng_box_fragment.cc b/third_party/blink/renderer/core/layout/ng/ng_box_fragment.cc index dfb9bcd8..5219110 100644 --- a/third_party/blink/renderer/core/layout/ng/ng_box_fragment.cc +++ b/third_party/blink/renderer/core/layout/ng/ng_box_fragment.cc
@@ -23,7 +23,7 @@ } if (const base::Optional<LayoutUnit> baseline = Baseline()) { - FontHeight metrics = IsFlippedLinesWritingMode(writing_mode_) + FontHeight metrics = writing_direction_.IsFlippedLines() ? FontHeight(BlockSize() - *baseline, *baseline) : FontHeight(*baseline, BlockSize() - *baseline);
diff --git a/third_party/blink/renderer/core/layout/ng/ng_box_fragment.h b/third_party/blink/renderer/core/layout/ng/ng_box_fragment.h index 58ed4aa6..99c1829 100644 --- a/third_party/blink/renderer/core/layout/ng/ng_box_fragment.h +++ b/third_party/blink/renderer/core/layout/ng/ng_box_fragment.h
@@ -16,13 +16,13 @@ class CORE_EXPORT NGBoxFragment final : public NGFragment { public: - NGBoxFragment(WritingMode writing_mode, - TextDirection direction, + NGBoxFragment(WritingDirectionMode writing_direction, const NGPhysicalBoxFragment& physical_fragment) - : NGFragment(writing_mode, physical_fragment), direction_(direction) {} + : NGFragment(writing_direction, physical_fragment) {} base::Optional<LayoutUnit> FirstBaseline() const { - if (writing_mode_ != physical_fragment_.Style().GetWritingMode()) + if (writing_direction_.GetWritingMode() != + physical_fragment_.Style().GetWritingMode()) return base::nullopt; return To<NGPhysicalBoxFragment>(physical_fragment_).Baseline(); @@ -37,7 +37,8 @@ // - The fragment has no baseline. // - The writing modes differ. base::Optional<LayoutUnit> Baseline() const { - if (writing_mode_ != physical_fragment_.Style().GetWritingMode()) + if (writing_direction_.GetWritingMode() != + physical_fragment_.Style().GetWritingMode()) return base::nullopt; if (auto last_baseline = @@ -60,18 +61,13 @@ NGBoxStrut Borders() const { const NGPhysicalBoxFragment& physical_box_fragment = To<NGPhysicalBoxFragment>(physical_fragment_); - return physical_box_fragment.Borders().ConvertToLogical(writing_mode_, - direction_); + return physical_box_fragment.Borders().ConvertToLogical(writing_direction_); } NGBoxStrut Padding() const { const NGPhysicalBoxFragment& physical_box_fragment = To<NGPhysicalBoxFragment>(physical_fragment_); - return physical_box_fragment.Padding().ConvertToLogical(writing_mode_, - direction_); + return physical_box_fragment.Padding().ConvertToLogical(writing_direction_); } - - protected: - TextDirection direction_; }; } // namespace blink
diff --git a/third_party/blink/renderer/core/layout/ng/ng_box_fragment_builder.cc b/third_party/blink/renderer/core/layout/ng/ng_box_fragment_builder.cc index a19b8bf..a0b3db7 100644 --- a/third_party/blink/renderer/core/layout/ng/ng_box_fragment_builder.cc +++ b/third_party/blink/renderer/core/layout/ng/ng_box_fragment_builder.cc
@@ -246,7 +246,7 @@ if (child.IsCSSBox()) { margins = ComputeMarginsFor(child.Style(), child_available_size_.inline_size, - GetWritingMode(), Direction()); + GetWritingDirection()); } // If we are in block-flow layout we use the end *margin-strut* as the @@ -257,7 +257,7 @@ margins.block_end = end_margin_strut.Sum(); } - NGFragment fragment(GetWritingMode(), child); + NGFragment fragment(GetWritingDirection(), child); // Use the original offset (*without* relative-positioning applied), and // clamp any negative margins to zero.
diff --git a/third_party/blink/renderer/core/layout/ng/ng_column_layout_algorithm.cc b/third_party/blink/renderer/core/layout/ng/ng_column_layout_algorithm.cc index 30ee2a7..eeec391a 100644 --- a/third_party/blink/renderer/core/layout/ng/ng_column_layout_algorithm.cc +++ b/third_party/blink/renderer/core/layout/ng/ng_column_layout_algorithm.cc
@@ -741,9 +741,9 @@ const NGBlockBreakToken* break_token, NGMarginStrut* margin_strut) { const ComputedStyle& spanner_style = spanner_node.Style(); - NGBoxStrut margins = ComputeMarginsFor( - spanner_style, ChildAvailableSize().inline_size, - ConstraintSpace().GetWritingMode(), ConstraintSpace().Direction()); + NGBoxStrut margins = + ComputeMarginsFor(spanner_style, ChildAvailableSize().inline_size, + ConstraintSpace().GetWritingDirection()); AdjustMarginsForFragmentation(break_token, &margins); // Collapse the block-start margin of this spanner with the block-end margin @@ -789,7 +789,7 @@ const auto& spanner_fragment = To<NGPhysicalBoxFragment>(result->PhysicalFragment()); - NGFragment logical_fragment(ConstraintSpace().GetWritingMode(), + NGFragment logical_fragment(ConstraintSpace().GetWritingDirection(), spanner_fragment); ResolveInlineMargins(spanner_style, Style(), ChildAvailableSize().inline_size, @@ -831,8 +831,8 @@ NGBaselineAlgorithmType::kFirstLine) return; - NGBoxFragment logical_fragment(ConstraintSpace().GetWritingMode(), - ConstraintSpace().Direction(), child); + NGBoxFragment logical_fragment(ConstraintSpace().GetWritingDirection(), + child); if (auto baseline = logical_fragment.FirstBaseline()) container_builder_.SetBaseline(block_offset + *baseline);
diff --git a/third_party/blink/renderer/core/layout/ng/ng_fieldset_layout_algorithm.cc b/third_party/blink/renderer/core/layout/ng/ng_fieldset_layout_algorithm.cc index 706d0d3..e99e2831 100644 --- a/third_party/blink/renderer/core/layout/ng/ng_fieldset_layout_algorithm.cc +++ b/third_party/blink/renderer/core/layout/ng/ng_fieldset_layout_algorithm.cc
@@ -59,7 +59,7 @@ NGFieldsetLayoutAlgorithm::NGFieldsetLayoutAlgorithm( const NGLayoutAlgorithmParams& params) : NGLayoutAlgorithm(params), - writing_mode_(ConstraintSpace().GetWritingMode()), + writing_direction_(ConstraintSpace().GetWritingDirection()), consumed_block_size_(BreakToken() ? BreakToken()->ConsumedBlockSize() : LayoutUnit()) { DCHECK(params.fragment_geometry.scrollbar.IsEmpty()); @@ -227,9 +227,9 @@ // box had the fieldset been a regular block with no weirdness. LogicalSize percentage_size = CalculateChildPercentageSize( ConstraintSpace(), Node(), ChildAvailableSize()); - NGBoxStrut legend_margins = ComputeMarginsFor( - legend.Style(), percentage_size.inline_size, - ConstraintSpace().GetWritingMode(), ConstraintSpace().Direction()); + NGBoxStrut legend_margins = + ComputeMarginsFor(legend.Style(), percentage_size.inline_size, + ConstraintSpace().GetWritingDirection()); auto legend_space = CreateConstraintSpaceForLegend( legend, ChildAvailableSize(), percentage_size); @@ -242,7 +242,7 @@ const auto& physical_fragment = result->PhysicalFragment(); LayoutUnit legend_border_box_block_size = - NGFragment(writing_mode_, physical_fragment).BlockSize(); + NGFragment(writing_direction_, physical_fragment).BlockSize(); LayoutUnit legend_margin_box_block_size = legend_margins.block_start + legend_border_box_block_size + legend_margins.block_end; @@ -275,7 +275,7 @@ LayoutUnit legend_inline_start = ComputeLegendInlineOffset( legend.Style(), - NGFragment(writing_mode_, result->PhysicalFragment()).InlineSize(), + NGFragment(writing_direction_, result->PhysicalFragment()).InlineSize(), legend_margins, Style(), BorderScrollbarPadding().inline_start, ChildAvailableSize().inline_size); LogicalOffset legend_offset = {legend_inline_start, block_offset}; @@ -335,7 +335,7 @@ LogicalOffset offset(borders_.inline_start, intrinsic_block_size_); container_builder_.AddResult(*result, offset); intrinsic_block_size_ += - NGFragment(writing_mode_, result->PhysicalFragment()).BlockSize(); + NGFragment(writing_direction_, result->PhysicalFragment()).BlockSize(); container_builder_.SetHasSeenAllChildren(); }
diff --git a/third_party/blink/renderer/core/layout/ng/ng_fieldset_layout_algorithm.h b/third_party/blink/renderer/core/layout/ng/ng_fieldset_layout_algorithm.h index 0b54f2b2..d8f42ef2 100644 --- a/third_party/blink/renderer/core/layout/ng/ng_fieldset_layout_algorithm.h +++ b/third_party/blink/renderer/core/layout/ng/ng_fieldset_layout_algorithm.h
@@ -54,7 +54,7 @@ LayoutUnit block_offset); bool IsFragmentainerOutOfSpace(LayoutUnit block_offset) const; - const WritingMode writing_mode_; + const WritingDirectionMode writing_direction_; NGBoxStrut borders_; NGBoxStrut padding_;
diff --git a/third_party/blink/renderer/core/layout/ng/ng_floats_utils.cc b/third_party/blink/renderer/core/layout/ng/ng_floats_utils.cc index 6ae1098..df5451a 100644 --- a/third_party/blink/renderer/core/layout/ng/ng_floats_utils.cc +++ b/third_party/blink/renderer/core/layout/ng/ng_floats_utils.cc
@@ -123,10 +123,10 @@ NGBoxStrut strut = ComputeBorders(space, unpositioned_float.node); if (style.ShapeOutside()->CssBox() == CSSBoxType::kContent) strut += ComputePadding(space, style); - shape_insets = - strut.ConvertToPhysical(style.GetWritingMode(), style.Direction()) - .ConvertToLogical(parent_space.GetWritingMode(), - TextDirection::kLtr); + // |TextDirection::kLtr| is used as this is line relative. + shape_insets = strut.ConvertToPhysical(style.GetWritingDirection()) + .ConvertToLogical({parent_space.GetWritingMode(), + TextDirection::kLtr}); break; } @@ -187,7 +187,8 @@ const NGConstraintSpace& parent_space = unpositioned_float->parent_space; - return (NGFragment(parent_space.GetWritingMode(), fragment).InlineSize() + + return (NGFragment(parent_space.GetWritingDirection(), fragment) + .InlineSize() + unpositioned_float->margins.InlineSum()) .ClampNegativeToZero(); } @@ -215,7 +216,7 @@ layout_result = unpositioned_float->layout_result; fragment_margins = unpositioned_float->margins; - NGFragment float_fragment(parent_space.GetWritingMode(), + NGFragment float_fragment(parent_space.GetWritingDirection(), layout_result->PhysicalFragment()); // Find a layout opportunity that will fit our float. @@ -225,7 +226,7 @@ } else { fragment_margins = ComputeMarginsFor( node.Style(), unpositioned_float->percentage_size.inline_size, - parent_space.GetWritingMode(), parent_space.Direction()); + parent_space.GetWritingDirection()); AdjustMarginsForFragmentation(unpositioned_float->token.get(), &fragment_margins); @@ -238,7 +239,7 @@ if (unpositioned_float->layout_result) { // We have already laid out the float to find its inline-size. NGFragment float_fragment( - parent_space.GetWritingMode(), + parent_space.GetWritingDirection(), unpositioned_float->layout_result->PhysicalFragment()); // We can find a layout opportunity and set the fragmentainer offset right // away. @@ -267,7 +268,7 @@ if (!optimistically_placed) break; - NGFragment float_fragment(parent_space.GetWritingMode(), + NGFragment float_fragment(parent_space.GetWritingDirection(), layout_result->PhysicalFragment()); // Find a layout opportunity that will fit our float, and see if our @@ -330,7 +331,7 @@ } } - NGFragment float_fragment(parent_space.GetWritingMode(), + NGFragment float_fragment(parent_space.GetWritingDirection(), layout_result->PhysicalFragment()); // Calculate the float's margin box BFC offset.
diff --git a/third_party/blink/renderer/core/layout/ng/ng_fragment.h b/third_party/blink/renderer/core/layout/ng/ng_fragment.h index 97fe4a1..0e66ebd 100644 --- a/third_party/blink/renderer/core/layout/ng/ng_fragment.h +++ b/third_party/blink/renderer/core/layout/ng/ng_fragment.h
@@ -8,7 +8,7 @@ #include "third_party/blink/renderer/core/core_export.h" #include "third_party/blink/renderer/core/layout/ng/ng_physical_fragment.h" #include "third_party/blink/renderer/platform/geometry/layout_unit.h" -#include "third_party/blink/renderer/platform/text/writing_mode.h" +#include "third_party/blink/renderer/platform/text/writing_direction_mode.h" namespace blink { @@ -18,28 +18,28 @@ STACK_ALLOCATED(); public: - NGFragment(WritingMode writing_mode, + NGFragment(WritingDirectionMode writing_direction, const NGPhysicalFragment& physical_fragment) - : physical_fragment_(physical_fragment), writing_mode_(writing_mode) {} + : physical_fragment_(physical_fragment), + writing_direction_(writing_direction) {} // Returns the border-box size. LayoutUnit InlineSize() const { - return writing_mode_ == WritingMode::kHorizontalTb - ? physical_fragment_.Size().width - : physical_fragment_.Size().height; + return writing_direction_.IsHorizontal() ? physical_fragment_.Size().width + : physical_fragment_.Size().height; } LayoutUnit BlockSize() const { - return writing_mode_ == WritingMode::kHorizontalTb - ? physical_fragment_.Size().height - : physical_fragment_.Size().width; + return writing_direction_.IsHorizontal() ? physical_fragment_.Size().height + : physical_fragment_.Size().width; } LogicalSize Size() const { - return physical_fragment_.Size().ConvertToLogical(writing_mode_); + return physical_fragment_.Size().ConvertToLogical( + writing_direction_.GetWritingMode()); } protected: const NGPhysicalFragment& physical_fragment_; - const WritingMode writing_mode_; + const WritingDirectionMode writing_direction_; }; } // namespace blink
diff --git a/third_party/blink/renderer/core/layout/ng/ng_fragmentation_utils.cc b/third_party/blink/renderer/core/layout/ng/ng_fragmentation_utils.cc index 95deff8..2b6acad 100644 --- a/third_party/blink/renderer/core/layout/ng/ng_fragmentation_utils.cc +++ b/third_party/blink/renderer/core/layout/ng/ng_fragmentation_utils.cc
@@ -537,7 +537,7 @@ // fragmentainer. If layout aborted, though, we can't propagate anything. if (layout_result.Status() != NGLayoutResult::kSuccess) return; - NGFragment fragment(space.GetWritingMode(), + NGFragment fragment(space.GetWritingDirection(), layout_result.PhysicalFragment()); space_shortage = fragmentainer_block_offset + fragment.BlockSize() - space.FragmentainerBlockSize(); @@ -569,7 +569,7 @@ } const auto& physical_fragment = layout_result.PhysicalFragment(); - NGFragment fragment(space.GetWritingMode(), physical_fragment); + NGFragment fragment(space.GetWritingDirection(), physical_fragment); if (!space.HasKnownFragmentainerBlockSize()) { if (space.IsInitialColumnBalancingPass() && builder) {
diff --git a/third_party/blink/renderer/core/layout/ng/ng_layout_overflow_calculator.cc b/third_party/blink/renderer/core/layout/ng/ng_layout_overflow_calculator.cc index 29769fd..b1842a7 100644 --- a/third_party/blink/renderer/core/layout/ng/ng_layout_overflow_calculator.cc +++ b/third_party/blink/renderer/core/layout/ng/ng_layout_overflow_calculator.cc
@@ -29,7 +29,7 @@ NGPhysicalBoxStrut scrollbar; if (fragment.IsCSSBox()) { scrollbar = ComputeScrollbarsForNonAnonymous(node).ConvertToPhysical( - writing_direction.GetWritingMode(), writing_direction.Direction()); + writing_direction); } NGLayoutOverflowCalculator calculator( @@ -129,10 +129,7 @@ LogicalOffset(converter.ToLogical(padding_rect_).offset.inline_offset, converter.ToLogical(*inflow_bounds).BlockEndOffset()), LogicalSize(LayoutUnit(), - padding_ - .ConvertToLogical(writing_direction_.GetWritingMode(), - writing_direction_.Direction()) - .block_end)}; + padding_.ConvertToLogical(writing_direction_).block_end)}; PhysicalRect alternate_overflow = layout_overflow_; alternate_overflow.UniteEvenIfEmpty(AdjustOverflowForScrollOrigin(
diff --git a/third_party/blink/renderer/core/layout/ng/ng_layout_result.cc b/third_party/blink/renderer/core/layout/ng/ng_layout_result.cc index 581bee4..12349787 100644 --- a/third_party/blink/renderer/core/layout/ng/ng_layout_result.cc +++ b/third_party/blink/renderer/core/layout/ng/ng_layout_result.cc
@@ -211,7 +211,7 @@ DCHECK(!physical_fragment_->IsFormattingContextRoot()); // Self-collapsing children must have a block-size of zero. - NGFragment fragment(physical_fragment_->Style().GetWritingMode(), + NGFragment fragment(physical_fragment_->Style().GetWritingDirection(), *physical_fragment_); DCHECK_EQ(LayoutUnit(), fragment.BlockSize()); }
diff --git a/third_party/blink/renderer/core/layout/ng/ng_layout_utils.cc b/third_party/blink/renderer/core/layout/ng/ng_layout_utils.cc index d6b652b..add2c50 100644 --- a/third_party/blink/renderer/core/layout/ng/ng_layout_utils.cc +++ b/third_party/blink/renderer/core/layout/ng/ng_layout_utils.cc
@@ -173,8 +173,7 @@ const ComputedStyle& style = node.Style(); const NGPhysicalBoxFragment& physical_fragment = To<NGPhysicalBoxFragment>(layout_result.PhysicalFragment()); - NGBoxFragment fragment(style.GetWritingMode(), style.Direction(), - physical_fragment); + NGBoxFragment fragment(style.GetWritingDirection(), physical_fragment); if (fragment_geometry.border_box_size.inline_size != fragment.InlineSize()) return NGLayoutCacheStatus::kNeedsLayout; @@ -340,7 +339,7 @@ if (!*fragment_geometry) *fragment_geometry = CalculateInitialFragmentGeometry(new_space, node); - LayoutUnit inline_size = NGFragment(style.GetWritingMode(), + LayoutUnit inline_size = NGFragment(style.GetWritingDirection(), cached_layout_result.PhysicalFragment()) .InlineSize();
diff --git a/third_party/blink/renderer/core/layout/ng/ng_length_utils.cc b/third_party/blink/renderer/core/layout/ng/ng_length_utils.cc index 4d56a3b..ade37ca 100644 --- a/third_party/blink/renderer/core/layout/ng/ng_length_utils.cc +++ b/third_party/blink/renderer/core/layout/ng/ng_length_utils.cc
@@ -895,7 +895,7 @@ LayoutUnit percentage_resolution_size = constraint_space.PercentageResolutionInlineSizeForParentWritingMode(); return ComputePhysicalMargins(style, percentage_resolution_size) - .ConvertToLogical(compute_for.GetWritingMode(), compute_for.Direction()); + .ConvertToLogical(compute_for.GetWritingDirection()); } NGBoxStrut ComputeMinMaxMargins(const ComputedStyle& parent_style,
diff --git a/third_party/blink/renderer/core/layout/ng/ng_length_utils.h b/third_party/blink/renderer/core/layout/ng/ng_length_utils.h index bb6984a..d8ae284 100644 --- a/third_party/blink/renderer/core/layout/ng/ng_length_utils.h +++ b/third_party/blink/renderer/core/layout/ng/ng_length_utils.h
@@ -425,12 +425,12 @@ const ComputedStyle&, const NGConstraintSpace& compute_for); -inline NGBoxStrut ComputeMarginsFor(const ComputedStyle& child_style, - LayoutUnit percentage_resolution_size, - WritingMode container_writing_mode, - TextDirection container_direction) { +inline NGBoxStrut ComputeMarginsFor( + const ComputedStyle& child_style, + LayoutUnit percentage_resolution_size, + WritingDirectionMode container_writing_direction) { return ComputePhysicalMargins(child_style, percentage_resolution_size) - .ConvertToLogical(container_writing_mode, container_direction); + .ConvertToLogical(container_writing_direction); } // Compute margins for the style owner. @@ -442,7 +442,7 @@ LayoutUnit percentage_resolution_size = constraint_space.PercentageResolutionInlineSizeForParentWritingMode(); return ComputePhysicalMargins(style, percentage_resolution_size) - .ConvertToLogical(style.GetWritingMode(), style.Direction()); + .ConvertToLogical(style.GetWritingDirection()); } // Compute line logical margins for the style owner. @@ -457,7 +457,7 @@ LayoutUnit percentage_resolution_size = constraint_space.PercentageResolutionInlineSizeForParentWritingMode(); return ComputePhysicalMargins(style, percentage_resolution_size) - .ConvertToLineLogical(style.GetWritingMode(), style.Direction()); + .ConvertToLineLogical(style.GetWritingDirection()); } // Compute line logical margins for the constraint space, in the visual order @@ -470,8 +470,8 @@ LayoutUnit percentage_resolution_size = constraint_space.PercentageResolutionInlineSizeForParentWritingMode(); return ComputePhysicalMargins(style, percentage_resolution_size) - .ConvertToLineLogical(constraint_space.GetWritingMode(), - TextDirection::kLtr); + .ConvertToLineLogical( + {constraint_space.GetWritingMode(), TextDirection::kLtr}); } // Compute margins for a child during the min-max size calculation.
diff --git a/third_party/blink/renderer/core/layout/ng/ng_out_of_flow_layout_part.cc b/third_party/blink/renderer/core/layout/ng/ng_out_of_flow_layout_part.cc index 429e2b6..6d26cfc1 100644 --- a/third_party/blink/renderer/core/layout/ng/ng_out_of_flow_layout_part.cc +++ b/third_party/blink/renderer/core/layout/ng/ng_out_of_flow_layout_part.cc
@@ -129,6 +129,7 @@ void NGOutOfFlowLayoutPart::Run(const LayoutBox* only_layout) { if (container_builder_->IsBlockFragmentationContextRoot() && + !container_space_.HasBlockFragmentation() && container_builder_->HasOutOfFlowFragmentainerDescendants()) { Vector<NGLogicalOutOfFlowPositionedNode> fragmentainer_descendants; container_builder_->SwapOutOfFlowFragmentainerDescendants( @@ -317,8 +318,8 @@ To<NGPhysicalBoxFragment>(containing_block_fragment); // TODO(1079031): This should eventually include scrollbar and border. - NGBoxStrut border = fragment->Borders().ConvertToLogical( - style.GetWritingMode(), style.Direction()); + NGBoxStrut border = + fragment->Borders().ConvertToLogical(style.GetWritingDirection()); LogicalSize content_size = ShrinkLogicalSize(size, border); LogicalOffset container_offset = LogicalOffset(border.inline_start, border.block_start); @@ -715,14 +716,15 @@ const LayoutBox* only_layout, bool is_fragmentainer_descendant) { const ComputedStyle& candidate_style = node.Style(); - const WritingMode candidate_writing_mode = candidate_style.GetWritingMode(); - const TextDirection candidate_direction = candidate_style.Direction(); + const WritingDirectionMode candidate_writing_direction = + candidate_style.GetWritingDirection(); const TextDirection container_direction = container_info.direction; PhysicalSize container_physical_content_size = ToPhysicalSize(container_content_size, default_writing_mode); LogicalSize container_content_size_in_candidate_writing_mode = - container_physical_content_size.ConvertToLogical(candidate_writing_mode); + container_physical_content_size.ConvertToLogical( + candidate_writing_direction.GetWritingMode()); NGBoxStrut border_padding = ComputeBorders(candidate_constraint_space, node) + ComputePadding(candidate_constraint_space, candidate_style); @@ -775,14 +777,15 @@ MinMaxSizesInput intrinsic_input(input); intrinsic_input.type = MinMaxSizesType::kIntrinsic; minmax_intrinsic_sizes_for_ar = - node.ComputeMinMaxSizes(candidate_writing_mode, intrinsic_input, - &candidate_constraint_space) + node.ComputeMinMaxSizes(candidate_writing_direction.GetWritingMode(), + intrinsic_input, &candidate_constraint_space) .sizes; } - min_max_sizes = node.ComputeMinMaxSizes(candidate_writing_mode, input, - &candidate_constraint_space) - .sizes; + min_max_sizes = + node.ComputeMinMaxSizes(candidate_writing_direction.GetWritingMode(), + input, &candidate_constraint_space) + .sizes; } base::Optional<LogicalSize> replaced_size; @@ -852,7 +855,7 @@ // TODO(layout-dev): Handle abortions caused by block fragmentation. DCHECK(layout_result->Status() != NGLayoutResult::kOutOfFragmentainerSpace); - NGFragment fragment(candidate_writing_mode, + NGFragment fragment(candidate_writing_direction, layout_result->PhysicalFragment()); block_estimate = fragment.BlockSize(); @@ -870,9 +873,8 @@ // Calculate the offsets. NGBoxStrut inset = - node_dimensions.inset - .ConvertToPhysical(candidate_writing_mode, candidate_direction) - .ConvertToLogical(default_writing_mode, default_direction); + node_dimensions.inset.ConvertToPhysical(candidate_writing_direction) + .ConvertToLogical({default_writing_mode, default_direction}); // |inset| is relative to the container's padding-box. Convert this to being // relative to the default container's border-box. @@ -982,7 +984,7 @@ ->Style() ->IsDisplayFlexibleOrGridBox()) { node.GetLayoutBox()->SetMargin(node_dimensions.margins.ConvertToPhysical( - candidate_writing_mode, candidate_direction)); + candidate_writing_direction)); } layout_result->GetMutableForOutOfFlow().SetOutOfFlowPositionedOffset(
diff --git a/third_party/blink/renderer/core/layout/ng/ng_out_of_flow_layout_part_test.cc b/third_party/blink/renderer/core/layout/ng/ng_out_of_flow_layout_part_test.cc index 5e70bb5d..f75694a 100644 --- a/third_party/blink/renderer/core/layout/ng/ng_out_of_flow_layout_part_test.cc +++ b/third_party/blink/renderer/core/layout/ng/ng_out_of_flow_layout_part_test.cc
@@ -1247,5 +1247,65 @@ EXPECT_EQ(expectation, dump); } +// Fragmented OOF element inside a nested multi-column. +TEST_F(NGOutOfFlowLayoutPartTest, AbsposNestedFragmentation) { + SetBodyInnerHTML( + R"HTML( + <style> + .multicol { + columns:2; column-fill:auto; column-gap:0px; + } + .rel { + position: relative; width:55px; + } + .abs { + position:absolute; top:0px; bottom:0px; width:5px; + } + </style> + <div id="container"> + <div class="multicol" id="outer" style="height:100px;"> + <div style="height:40px; width:40px;"></div> + <div class="multicol" id="inner"> + <div class="rel"> + <div class="abs"></div> + <div style="height:250px; width:25px;"></div> + </div> + </div> + </div> + </div> + )HTML"); + String dump = DumpFragmentTree(GetElementById("container")); + + // TODO(almaher): There should be two abspos fragments with height 60 in the + // first outer column, and two with height 100/30 in the second outer column. + // There should not be a third outer column. + String expectation = R"DUMP(.:: LayoutNG Physical Fragment Tree ::. + offset:unplaced size:1000x100 + offset:0,0 size:1000x100 + offset:0,0 size:500x100 + offset:0,0 size:40x40 + offset:0,40 size:500x60 + offset:0,0 size:250x60 + offset:0,0 size:55x60 + offset:0,0 size:25x60 + offset:250,0 size:250x60 + offset:0,0 size:55x60 + offset:0,0 size:25x60 + offset:0,40 size:5x60 + offset:500,0 size:500x100 + offset:0,0 size:500x100 + offset:0,0 size:250x100 + offset:0,0 size:55x100 + offset:0,0 size:25x100 + offset:250,0 size:250x100 + offset:0,0 size:55x30 + offset:0,0 size:25x30 + offset:0,0 size:5x100 + offset:1000,0 size:500x100 + offset:0,0 size:5x90 +)DUMP"; + EXPECT_EQ(expectation, dump); +} + } // namespace } // namespace blink
diff --git a/third_party/blink/renderer/core/layout/ng/ng_page_layout_algorithm.cc b/third_party/blink/renderer/core/layout/ng/ng_page_layout_algorithm.cc index 7475a1c..c26527f 100644 --- a/third_party/blink/renderer/core/layout/ng/ng_page_layout_algorithm.cc +++ b/third_party/blink/renderer/core/layout/ng/ng_page_layout_algorithm.cc
@@ -24,7 +24,8 @@ NGConstraintSpace child_space = CreateConstraintSpaceForPages(page_size); - WritingMode writing_mode = ConstraintSpace().GetWritingMode(); + WritingDirectionMode writing_direction = + ConstraintSpace().GetWritingDirection(); scoped_refptr<const NGBlockBreakToken> break_token = BreakToken(); LayoutUnit intrinsic_block_size; LogicalOffset page_offset = BorderScrollbarPadding().StartOffset(); @@ -44,7 +45,8 @@ container_builder_.AddChild(page, page_offset); - LayoutUnit page_block_size = NGFragment(writing_mode, page).BlockSize(); + LayoutUnit page_block_size = + NGFragment(writing_direction, page).BlockSize(); intrinsic_block_size = std::max(intrinsic_block_size, page_offset.block_offset + page_block_size); page_offset += page_progression;
diff --git a/third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.cc b/third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.cc index a30439d..f33d852f 100644 --- a/third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.cc +++ b/third_party/blink/renderer/core/layout/ng/ng_physical_box_fragment.cc
@@ -43,18 +43,19 @@ scoped_refptr<const NGPhysicalBoxFragment> NGPhysicalBoxFragment::Create( NGBoxFragmentBuilder* builder, WritingMode block_or_line_writing_mode) { + const auto writing_direction = builder->GetWritingDirection(); const NGPhysicalBoxStrut borders = builder->initial_fragment_geometry_->border.ConvertToPhysical( - builder->GetWritingMode(), builder->Direction()); + writing_direction); bool has_borders = !borders.IsZero(); const NGPhysicalBoxStrut padding = builder->initial_fragment_geometry_->padding.ConvertToPhysical( - builder->GetWritingMode(), builder->Direction()); + writing_direction); bool has_padding = !padding.IsZero(); const PhysicalSize physical_size = ToPhysicalSize(builder->Size(), builder->GetWritingMode()); - WritingModeConverter converter(builder->GetWritingDirection(), physical_size); + WritingModeConverter converter(writing_direction, physical_size); base::Optional<PhysicalRect> inflow_bounds; if (builder->inflow_bounds_) @@ -64,11 +65,11 @@ if (builder->node_ && !builder->is_legacy_layout_root_) { const NGPhysicalBoxStrut scrollbar = builder->initial_fragment_geometry_->scrollbar.ConvertToPhysical( - builder->GetWritingMode(), builder->Direction()); + writing_direction); NGLayoutOverflowCalculator calculator( To<NGBlockNode>(builder->node_), /* is_css_box */ builder->box_type_ != NGBoxType::kColumnBox, borders, - scrollbar, padding, physical_size, builder->GetWritingDirection()); + scrollbar, padding, physical_size, writing_direction); if (NGFragmentItemsBuilder* items_builder = builder->ItemsBuilder()) calculator.AddItems(items_builder->Items(physical_size)); @@ -79,10 +80,9 @@ if (!box_fragment) continue; - calculator.AddChild( - *box_fragment, - child.offset.ConvertToPhysical(builder->GetWritingDirection(), - physical_size, box_fragment->Size())); + calculator.AddChild(*box_fragment, child.offset.ConvertToPhysical( + writing_direction, physical_size, + box_fragment->Size())); } layout_overflow = calculator.Result(inflow_bounds); @@ -503,7 +503,7 @@ ToLayoutBox(container.GetLayoutObject()); padding_strut = NGBoxStrut(LayoutUnit(), layout_object->PaddingEnd(), LayoutUnit(), layout_object->PaddingAfter()) - .ConvertToPhysical(writing_mode, direction); + .ConvertToPhysical({writing_mode, direction}); } }
diff --git a/third_party/blink/renderer/core/layout/ng/ng_simplified_layout_algorithm.cc b/third_party/blink/renderer/core/layout/ng/ng_simplified_layout_algorithm.cc index b9bf9e5..38850b3 100644 --- a/third_party/blink/renderer/core/layout/ng/ng_simplified_layout_algorithm.cc +++ b/third_party/blink/renderer/core/layout/ng/ng_simplified_layout_algorithm.cc
@@ -121,8 +121,7 @@ container_builder_.SetFragmentBlockSize(new_block_size); } else { LayoutUnit old_block_size = - NGFragment(writing_direction_.GetWritingMode(), physical_fragment) - .BlockSize(); + NGFragment(writing_direction_, physical_fragment).BlockSize(); DCHECK_EQ(old_block_size, new_block_size); container_builder_.SetFragmentBlockSize(old_block_size); }
diff --git a/third_party/blink/renderer/core/layout/ng/table/layout_ng_table_caption.cc b/third_party/blink/renderer/core/layout/ng/table/layout_ng_table_caption.cc index c564cccd9..67a85480 100644 --- a/third_party/blink/renderer/core/layout/ng/table/layout_ng_table_caption.cc +++ b/third_party/blink/renderer/core/layout/ng/table/layout_ng_table_caption.cc
@@ -26,16 +26,14 @@ const NGPhysicalFragment& physical_fragment) { const ComputedStyle& containing_block_style = ContainingBlock()->StyleRef(); - NGBoxFragment box_fragment(containing_block_style.GetWritingMode(), - containing_block_style.Direction(), + NGBoxFragment box_fragment(containing_block_style.GetWritingDirection(), To<NGPhysicalBoxFragment>(physical_fragment)); NGPhysicalBoxStrut physical_margins = ComputePhysicalMargins(constraint_space, StyleRef()); - NGBoxStrut logical_margins = - physical_margins.ConvertToLogical(containing_block_style.GetWritingMode(), - containing_block_style.Direction()); + NGBoxStrut logical_margins = physical_margins.ConvertToLogical( + containing_block_style.GetWritingDirection()); LayoutUnit caption_inline_size_in_cb_writing_mode = box_fragment.InlineSize(); @@ -49,9 +47,8 @@ available_inline_size_in_cb_writing_mode, caption_inline_size_in_cb_writing_mode, &logical_margins); - SetMargin( - logical_margins.ConvertToPhysical(containing_block_style.GetWritingMode(), - containing_block_style.Direction())); + SetMargin(logical_margins.ConvertToPhysical( + containing_block_style.GetWritingDirection())); } void LayoutNGTableCaption::InsertedIntoTree() {
diff --git a/third_party/blink/renderer/core/layout/ng/table/ng_table_layout_algorithm_utils.cc b/third_party/blink/renderer/core/layout/ng/table/ng_table_layout_algorithm_utils.cc index db58211d..92c4ef6 100644 --- a/third_party/blink/renderer/core/layout/ng/table/ng_table_layout_algorithm_utils.cc +++ b/third_party/blink/renderer/core/layout/ng/table/ng_table_layout_algorithm_utils.cc
@@ -110,8 +110,7 @@ scoped_refptr<const NGLayoutResult> layout_result = cell.Layout(cell_constraint_space); const NGBoxFragment fragment( - table_writing_direction.GetWritingMode(), - table_writing_direction.Direction(), + table_writing_direction, To<NGPhysicalBoxFragment>(layout_result->PhysicalFragment())); bool is_parallel = IsParallelWritingMode(table_writing_direction.GetWritingMode(),
diff --git a/third_party/blink/renderer/core/layout/ng/table/ng_table_row_layout_algorithm.cc b/third_party/blink/renderer/core/layout/ng/table/ng_table_row_layout_algorithm.cc index 2faeff6..7edbb40e 100644 --- a/third_party/blink/renderer/core/layout/ng/table/ng_table_row_layout_algorithm.cc +++ b/third_party/blink/renderer/core/layout/ng/table/ng_table_row_layout_algorithm.cc
@@ -126,12 +126,12 @@ &cell_location_start_column); scoped_refptr<const NGLayoutResult> layout_result = cell.Layout(cell_constraint_space); - const NGBoxFragment fragment( - table_data.table_writing_direction.GetWritingMode(), - table_data.table_writing_direction.Direction(), - To<NGPhysicalBoxFragment>(layout_result->PhysicalFragment())); - LayoutUnit baseline = fragment.FirstBaselineOrSynthesize(); + LayoutUnit baseline = + NGBoxFragment( + table_data.table_writing_direction, + To<NGPhysicalBoxFragment>(layout_result->PhysicalFragment())) + .FirstBaselineOrSynthesize(); row_baseline = std::max(row_baseline, baseline); } } @@ -154,13 +154,13 @@ container_builder_.AddResult(*cell_result, cell_offset); if (NGTableAlgorithmUtils::IsBaseline(cell.Style().VerticalAlign())) { - const NGBoxFragment fragment( - table_data.table_writing_direction.GetWritingMode(), - table_data.table_writing_direction.Direction(), - To<NGPhysicalBoxFragment>(cell_result->PhysicalFragment())); + LayoutUnit baseline = + NGBoxFragment( + table_data.table_writing_direction, + To<NGPhysicalBoxFragment>(cell_result->PhysicalFragment())) + .FirstBaselineOrSynthesize(); reported_row_baseline = - std::max(reported_row_baseline.value_or(LayoutUnit::Min()), - fragment.FirstBaselineOrSynthesize()); + std::max(reported_row_baseline.value_or(LayoutUnit::Min()), baseline); } } container_builder_.SetFragmentBlockSize(row.block_size);
diff --git a/third_party/blink/renderer/core/loader/BUILD.gn b/third_party/blink/renderer/core/loader/BUILD.gn index 9fca35ed..f32339f 100644 --- a/third_party/blink/renderer/core/loader/BUILD.gn +++ b/third_party/blink/renderer/core/loader/BUILD.gn
@@ -5,6 +5,8 @@ import("//third_party/blink/renderer/core/core.gni") blink_core_sources("loader") { + configs += [ "//build/config/compiler:noshadowing" ] + sources = [ "address_space_feature.cc", "address_space_feature.h",
diff --git a/third_party/blink/renderer/core/loader/image_loader.cc b/third_party/blink/renderer/core/loader/image_loader.cc index 57d5b6a4..b287d067 100644 --- a/third_party/blink/renderer/core/loader/image_loader.cc +++ b/third_party/blink/renderer/core/loader/image_loader.cc
@@ -592,9 +592,10 @@ if (ShouldEnableSubresourceRedirect( DynamicTo<HTMLImageElement>(GetElement()), params.Url())) { - auto& resource_request = params.MutableResourceRequest(); - resource_request.SetPreviewsState(resource_request.GetPreviewsState() | - PreviewsTypes::kSubresourceRedirectOn); + auto& subresource_request = params.MutableResourceRequest(); + subresource_request.SetPreviewsState( + subresource_request.GetPreviewsState() | + PreviewsTypes::kSubresourceRedirectOn); } new_image_content = ImageResourceContent::Fetch(params, document.Fetcher());
diff --git a/third_party/blink/renderer/core/loader/resource_load_observer_for_frame.cc b/third_party/blink/renderer/core/loader/resource_load_observer_for_frame.cc index 3ae86ba..0dabf5ad 100644 --- a/third_party/blink/renderer/core/loader/resource_load_observer_for_frame.cc +++ b/third_party/blink/renderer/core/loader/resource_load_observer_for_frame.cc
@@ -127,14 +127,16 @@ } if (response_source == ResponseSource::kFromMemoryCache) { - ResourceRequest request(resource->GetResourceRequest()); + ResourceRequest resource_request(resource->GetResourceRequest()); - if (!request.Url().ProtocolIs(url::kDataScheme)) { - frame_client->DispatchDidLoadResourceFromMemoryCache(request, response); + if (!resource_request.Url().ProtocolIs(url::kDataScheme)) { + frame_client->DispatchDidLoadResourceFromMemoryCache(resource_request, + response); frame->GetLocalFrameHostRemote().DidLoadResourceFromMemoryCache( - request.Url(), String::FromUTF8(request.HttpMethod().Utf8()), + resource_request.Url(), + String::FromUTF8(resource_request.HttpMethod().Utf8()), String::FromUTF8(response.MimeType().Utf8()), - request.GetRequestDestination()); + resource_request.GetRequestDestination()); } // Note: probe::WillSendRequest needs to precede before this probe method.
diff --git a/third_party/blink/renderer/core/mathml/BUILD.gn b/third_party/blink/renderer/core/mathml/BUILD.gn index fe6f74ce..d435ba1 100644 --- a/third_party/blink/renderer/core/mathml/BUILD.gn +++ b/third_party/blink/renderer/core/mathml/BUILD.gn
@@ -5,6 +5,8 @@ import("//third_party/blink/renderer/core/core.gni") blink_core_sources("mathml") { + configs += [ "//build/config/compiler:noshadowing" ] + sources = [ "mathml_element.cc", "mathml_element.h",
diff --git a/third_party/blink/renderer/core/mathml/mathml_operator_element.cc b/third_party/blink/renderer/core/mathml/mathml_operator_element.cc index f00f9d2..df7273d 100644 --- a/third_party/blink/renderer/core/mathml/mathml_operator_element.cc +++ b/third_party/blink/renderer/core/mathml/mathml_operator_element.cc
@@ -197,7 +197,7 @@ fallback_form++) { if (fallback_form == form) continue; - auto category = FindCategory( + category = FindCategory( GetOperatorContent().characters, static_cast<MathMLOperatorDictionaryForm>(fallback_form)); if (category != MathMLOperatorDictionaryCategory::kNone) {
diff --git a/third_party/blink/renderer/core/page/spatial_navigation_controller.cc b/third_party/blink/renderer/core/page/spatial_navigation_controller.cc index 455cb4c3..781ca4602 100644 --- a/third_party/blink/renderer/core/page/spatial_navigation_controller.cc +++ b/third_party/blink/renderer/core/page/spatial_navigation_controller.cc
@@ -31,7 +31,6 @@ #include "third_party/blink/renderer/core/page/page.h" #include "third_party/blink/renderer/core/page/spatial_navigation.h" #include "third_party/blink/renderer/platform/geometry/layout_rect.h" -#include "third_party/blink/renderer/platform/instrumentation/histogram.h" #include "third_party/blink/renderer/core/css/style_change_reason.h" @@ -294,8 +293,6 @@ bool SpatialNavigationController::Advance( SpatialNavigationDirection direction) { - SCOPED_BLINK_UMA_HISTOGRAM_TIMER("Blink.SpatialNavigation.Advance"); - Node* interest_node = StartingNode(); if (!interest_node) return false;
diff --git a/third_party/blink/renderer/core/paint/BUILD.gn b/third_party/blink/renderer/core/paint/BUILD.gn index 3db4233..b7ad1cbb 100644 --- a/third_party/blink/renderer/core/paint/BUILD.gn +++ b/third_party/blink/renderer/core/paint/BUILD.gn
@@ -5,6 +5,8 @@ import("//third_party/blink/renderer/core/core.gni") blink_core_sources("paint") { + configs += [ "//build/config/compiler:noshadowing" ] + sources = [ "applied_decoration_painter.cc", "applied_decoration_painter.h",
diff --git a/third_party/blink/renderer/core/paint/compositing/graphics_layer_updater.cc b/third_party/blink/renderer/core/paint/compositing/graphics_layer_updater.cc index 53309d89..5ef60f52 100644 --- a/third_party/blink/renderer/core/paint/compositing/graphics_layer_updater.cc +++ b/third_party/blink/renderer/core/paint/compositing/graphics_layer_updater.cc
@@ -165,9 +165,9 @@ // If we have a forced update, we notify the display lock to ensure that the // forced update resumes after the lock has been removed. if (update_type == kForceUpdate) { - auto* context = layer.GetLayoutObject().GetDisplayLockContext(); - DCHECK(context); - context->NotifyForcedGraphicsLayerUpdateBlocked(); + auto* child_context = layer.GetLayoutObject().GetDisplayLockContext(); + DCHECK(child_context); + child_context->NotifyForcedGraphicsLayerUpdateBlocked(); } }
diff --git a/third_party/blink/renderer/core/paint/inline_text_box_painter.cc b/third_party/blink/renderer/core/paint/inline_text_box_painter.cc index e68f583..840c4ff 100644 --- a/third_party/blink/renderer/core/paint/inline_text_box_painter.cc +++ b/third_party/blink/renderer/core/paint/inline_text_box_painter.cc
@@ -420,7 +420,7 @@ // the first time, we draw the glyphs outside the selection area, with // the original style. { - GraphicsContextStateSaver state_saver(context); + GraphicsContextStateSaver inner_state_saver(context); context.ClipOut(FloatRect(selection_rect)); text_painter.Paint(selection_start, selection_end, length, text_style, node_id); @@ -428,7 +428,7 @@ // the second time, we draw the glyphs inside the selection area, with // the selection style. { - GraphicsContextStateSaver state_saver(context); + GraphicsContextStateSaver inner_state_saver(context); context.Clip(FloatRect(selection_rect)); text_painter.Paint(selection_start, selection_end, length, selection_style, node_id);
diff --git a/third_party/blink/renderer/core/paint/ng/ng_inline_box_fragment_painter.cc b/third_party/blink/renderer/core/paint/ng/ng_inline_box_fragment_painter.cc index 45b15d82..0aea9fe 100644 --- a/third_party/blink/renderer/core/paint/ng/ng_inline_box_fragment_painter.cc +++ b/third_party/blink/renderer/core/paint/ng/ng_inline_box_fragment_painter.cc
@@ -218,7 +218,8 @@ TextDirection direction, LayoutUnit* offset_on_line, LayoutUnit* total_width) const { - WritingMode writing_mode = inline_box_fragment_.Style().GetWritingMode(); + WritingDirectionMode writing_direction = + inline_box_fragment_.Style().GetWritingDirection(); NGInlineCursor cursor; DCHECK(inline_box_fragment_.GetLayoutObject()); cursor.MoveTo(*inline_box_fragment_.GetLayoutObject()); @@ -244,13 +245,14 @@ const NGPhysicalBoxFragment* box_fragment = cursor.Current().BoxFragment(); DCHECK(box_fragment); if (before_self) - before += NGFragment(writing_mode, *box_fragment).InlineSize(); + before += NGFragment(writing_direction, *box_fragment).InlineSize(); else - after += NGFragment(writing_mode, *box_fragment).InlineSize(); + after += NGFragment(writing_direction, *box_fragment).InlineSize(); } - NGFragment logical_fragment(writing_mode, inline_box_fragment_); - *total_width = before + after + logical_fragment.InlineSize(); + *total_width = + before + after + + NGFragment(writing_direction, inline_box_fragment_).InlineSize(); // We're iterating over the fragments in physical order before so we need to // swap before and after for RTL.
diff --git a/third_party/blink/renderer/modules/sanitizer_api/sanitizer.cc b/third_party/blink/renderer/modules/sanitizer_api/sanitizer.cc index 7bbc247..32e2fb69 100644 --- a/third_party/blink/renderer/modules/sanitizer_api/sanitizer.cc +++ b/third_party/blink/renderer/modules/sanitizer_api/sanitizer.cc
@@ -27,7 +27,7 @@ Sanitizer::Sanitizer(const SanitizerConfig* config) : config_(const_cast<SanitizerConfig*>(config)) { - // Format dropElements to uppercases. + // Format dropElements to uppercase. Vector<String> drop_elements = default_drop_elements_; if (config->hasDropElements()) { for (const String& s : config->dropElements()) { @@ -38,7 +38,7 @@ } config_->setDropElements(drop_elements); - // Format allowElements to uppercases. + // Format allowElements to uppercase. if (config->hasAllowElements()) { Vector<String> l; for (const String& s : config->allowElements()) { @@ -48,14 +48,21 @@ config_->setAllowElements(l); } - // Format dropAttributes to lowercases. + // Format dropAttributes to lowercase. if (config->hasDropAttributes()) { - Vector<String> l; + drop_attributes_ = default_drop_attributes_; for (const String& s : config->dropAttributes()) { - l.push_back(s.LowerASCII()); drop_attributes_.push_back(WTF::AtomicString(s.LowerASCII())); } - config_->setDropAttributes(l); + } else if (config->hasAllowAttributes()) { + Vector<String> l; + for (const String& s : config->allowAttributes()) { + if (!default_drop_attributes_.Contains(s)) + l.push_back(s.LowerASCII()); + } + config_->setAllowAttributes(l); + } else { + drop_attributes_ = default_drop_attributes_; } } @@ -113,8 +120,6 @@ } else { parent->appendChild(n, exception_state); } - // TODO(lyf): review and make a proper decision for exceptions may - // happened here. if (exception_state.HadException()) { return nullptr; } @@ -126,10 +131,13 @@ // Otherwise, remove any attributes to be dropped from the current // element, and proceed to the next node (preorder, depth-first // traversal). - if (config_->hasDropAttributes()) { - for (auto attr : drop_attributes_) { - To<Element>(node)->removeAttribute(attr); - } + Element* element = To<Element>(node); + for (const auto& name : element->getAttributeNames()) { + bool drop = drop_attributes_.Contains(name) || + (config_->hasAllowAttributes() && + !config_->allowAttributes().Contains(name)); + if (drop) + element->removeAttribute(name); } node = NodeTraversal::Next(*node, fragment); }
diff --git a/third_party/blink/renderer/modules/sanitizer_api/sanitizer.h b/third_party/blink/renderer/modules/sanitizer_api/sanitizer.h index 1c732e66..21dfb2e 100644 --- a/third_party/blink/renderer/modules/sanitizer_api/sanitizer.h +++ b/third_party/blink/renderer/modules/sanitizer_api/sanitizer.h
@@ -48,6 +48,7 @@ "SVG", "TEMPLATE", "THEAD", "TITLE", "VIDEO", "XMP"}; + const Vector<AtomicString> default_drop_attributes_ = {"onclick", "onsubmit"}; }; } // namespace blink
diff --git a/third_party/blink/renderer/modules/sanitizer_api/sanitizer_config.idl b/third_party/blink/renderer/modules/sanitizer_api/sanitizer_config.idl index 0b59849..884d783 100644 --- a/third_party/blink/renderer/modules/sanitizer_api/sanitizer_config.idl +++ b/third_party/blink/renderer/modules/sanitizer_api/sanitizer_config.idl
@@ -7,5 +7,6 @@ dictionary SanitizerConfig { sequence<DOMString> allowElements; sequence<DOMString> dropElements; + sequence<DOMString> allowAttributes; sequence<DOMString> dropAttributes; };
diff --git a/third_party/blink/renderer/platform/graphics/canvas_resource_provider.cc b/third_party/blink/renderer/platform/graphics/canvas_resource_provider.cc index 83ffde1..7807757 100644 --- a/third_party/blink/renderer/platform/graphics/canvas_resource_provider.cc +++ b/third_party/blink/renderer/platform/graphics/canvas_resource_provider.cc
@@ -444,17 +444,27 @@ resource_ = NewOrRecycledResource(); DCHECK(resource_); - if (use_oop_rasterization_) { + auto* raster_interface = RasterInterface(); + if (raster_interface) { + if (!use_oop_rasterization_) + TearDownSkSurface(); + if (mode_ == SkSurface::kRetain_ContentChangeMode) { auto old_mailbox = old_resource_shared_image->GetOrCreateGpuMailbox( kOrderingBarrier); auto mailbox = resource()->GetOrCreateGpuMailbox(kOrderingBarrier); - RasterInterface()->CopySubTexture( + raster_interface->CopySubTexture( old_mailbox, mailbox, GetBackingTextureTarget(), 0, 0, 0, 0, Size().Width(), Size().Height(), false /* unpack_flip_y */, false /* unpack_premultiply_alpha */); } + + // In non-OOPR mode we need to update the client side SkSurface with the + // copied texture. Recreating SkSurface here matches the GPU process + // behaviour that will happen in OOPR mode. + if (!use_oop_rasterization_) + GetSkSurface(); } else { EnsureWriteAccess(); if (surface_) { @@ -1492,6 +1502,11 @@ return recorder_ && recorder_->ListHasDrawOps(); } +void CanvasResourceProvider::TearDownSkSurface() { + skia_canvas_ = nullptr; + surface_ = nullptr; +} + size_t CanvasResourceProvider::ComputeSurfaceSize() const { if (!surface_) return 0;
diff --git a/third_party/blink/renderer/platform/graphics/canvas_resource_provider.h b/third_party/blink/renderer/platform/graphics/canvas_resource_provider.h index 1ee50ad..89671f6 100644 --- a/third_party/blink/renderer/platform/graphics/canvas_resource_provider.h +++ b/third_party/blink/renderer/platform/graphics/canvas_resource_provider.h
@@ -265,6 +265,7 @@ cc::PaintImage MakeImageSnapshot(); virtual void RasterRecord(sk_sp<cc::PaintRecord>); CanvasImageProvider* GetOrCreateCanvasImageProvider(); + void TearDownSkSurface(); ResourceProviderType type_; mutable sk_sp<SkSurface> surface_; // mutable for lazy init
diff --git a/third_party/blink/renderer/platform/runtime_enabled_features.json5 b/third_party/blink/renderer/platform/runtime_enabled_features.json5 index 3c192ab..eda38c9 100644 --- a/third_party/blink/renderer/platform/runtime_enabled_features.json5 +++ b/third_party/blink/renderer/platform/runtime_enabled_features.json5
@@ -613,9 +613,6 @@ // removed after M87. { name: "CustomElementsV0", - origin_trial_feature_name: "WebComponentsV0", - origin_trial_type: "deprecation", - origin_trial_allows_insecure: true, status: "test", }, { @@ -893,9 +890,6 @@ // removed after M87. { name: "HTMLImports", - origin_trial_feature_name: "WebComponentsV0", - origin_trial_type: "deprecation", - origin_trial_allows_insecure: true, status: "test", }, { @@ -1735,9 +1729,6 @@ // removed after M87. { name: "ShadowDOMV0", - origin_trial_feature_name: "WebComponentsV0", - origin_trial_type: "deprecation", - origin_trial_allows_insecure: true, status: "test", }, {
diff --git a/third_party/blink/renderer/platform/widget/input/input_handler_proxy_unittest.cc b/third_party/blink/renderer/platform/widget/input/input_handler_proxy_unittest.cc index 1e0f8f5..d4ea33f 100644 --- a/third_party/blink/renderer/platform/widget/input/input_handler_proxy_unittest.cc +++ b/third_party/blink/renderer/platform/widget/input/input_handler_proxy_unittest.cc
@@ -2598,7 +2598,8 @@ testing::Mock::VerifyAndClearExpectations(&mock_input_handler_); } -#if defined(ADDRESS_SANITIZER) || defined(THREAD_SANITIZER) +#if defined(ADDRESS_SANITIZER) || defined(THREAD_SANITIZER) || \ + defined(MEMORY_SANITIZER) // Flaky under sanitizers and in other "slow" bot configs: // https://crbug.com/1029250 #define MAYBE_VSyncAlignedGestureScrollPinchScroll \
diff --git a/third_party/blink/renderer/platform/widget/input/scroll_predictor.cc b/third_party/blink/renderer/platform/widget/input/scroll_predictor.cc index 64858a6..95e5f3f 100644 --- a/third_party/blink/renderer/platform/widget/input/scroll_predictor.cc +++ b/third_party/blink/renderer/platform/widget/input/scroll_predictor.cc
@@ -13,7 +13,8 @@ namespace blink { -ScrollPredictor::ScrollPredictor() { +ScrollPredictor::ScrollPredictor() + : metrics_handler_("Event.InputEventPrediction.Scroll") { // Get the predictor from feature flags std::string predictor_name = GetFieldTrialParamValueByFeature( blink::features::kResamplingScrollEvents, "predictor");
diff --git a/third_party/blink/web_tests/FlagExpectations/composite-after-paint b/third_party/blink/web_tests/FlagExpectations/composite-after-paint index 307f2917f..82d5975 100644 --- a/third_party/blink/web_tests/FlagExpectations/composite-after-paint +++ b/third_party/blink/web_tests/FlagExpectations/composite-after-paint
@@ -19,7 +19,6 @@ virtual/threaded/printing/* [ Skip ] virtual/threaded/http/tests/devtools/tracing/* [ Skip ] virtual/controls-refresh-hc/* [ Skip ] -virtual/web-components-v0-disabled/* [ Skip ] # They test Layer::ScrollsWithRespectTo() which is for pre-CompositeAfterPaint only. compositing/overflow/scrolls-with-respect-to-nested.html [ Skip ]
diff --git a/third_party/blink/web_tests/FlagExpectations/disable-layout-ng b/third_party/blink/web_tests/FlagExpectations/disable-layout-ng index a830421..0113c94 100644 --- a/third_party/blink/web_tests/FlagExpectations/disable-layout-ng +++ b/third_party/blink/web_tests/FlagExpectations/disable-layout-ng
@@ -416,9 +416,6 @@ ### virtual/omt-worker-fetch/external/wpt/service-workers/service-worker/ crbug.com/591099 virtual/omt-worker-fetch/external/wpt/service-workers/service-worker/registration-updateviacache.https.html [ Failure ] -### virtual/web-components-v0-disabled/ -virtual/web-components-v0-disabled/* [ Skip ] - crbug.com/591099 external/wpt/css/css-tables/absolute-tables-002.html [ Failure ] crbug.com/591099 external/wpt/css/css-tables/absolute-tables-007.html [ Failure ] crbug.com/591099 external/wpt/css/css-tables/absolute-tables-011.tentative.html [ Failure ]
diff --git a/third_party/blink/web_tests/FlagExpectations/enable-blink-features=ForceSynchronousHTMLParsing b/third_party/blink/web_tests/FlagExpectations/enable-blink-features=ForceSynchronousHTMLParsing index f8e6daa3..24567ec 100644 --- a/third_party/blink/web_tests/FlagExpectations/enable-blink-features=ForceSynchronousHTMLParsing +++ b/third_party/blink/web_tests/FlagExpectations/enable-blink-features=ForceSynchronousHTMLParsing
@@ -59,10 +59,6 @@ ### external/wpt/preload/ crbug.com/901056 external/wpt/preload/link-header-preload-imagesrcset.html [ Failure ] -### http/tests/htmlimports/ -# Known failure, but won't fix because HTML imports are going away fairly soon -crbug.com/901056 crbug.com/240592 http/tests/htmlimports/import-async-grandchild.html [ Failure ] - ### http/tests/preload/ crbug.com/901056 http/tests/preload/meta-csp.html [ Failure ]
diff --git a/third_party/blink/web_tests/TestExpectations b/third_party/blink/web_tests/TestExpectations index 45852ed..9968714 100644 --- a/third_party/blink/web_tests/TestExpectations +++ b/third_party/blink/web_tests/TestExpectations
@@ -1311,30 +1311,12 @@ crbug.com/1053725 [ Mac ] transforms/transformed-focused-text-input.html [ Skip ] crbug.com/1053725 [ Mac ] transforms/2d/zoom-menulist.html [ Skip ] crbug.com/1053725 [ Mac ] transforms/3d/general/perspective-non-layer.html [ Skip ] - - -# Still need eval: -crbug.com/1053725 [ Mac ] virtual/web-components-v0-disabled/html/details_summary/details-add-summary-1-and-click.html [ Skip ] -crbug.com/1053725 [ Mac ] virtual/web-components-v0-disabled/external/wpt/dom/events/Event-dispatch-redispatch.html [ Skip ] -crbug.com/1053725 [ Mac ] virtual/web-components-v0-disabled/html/details_summary/details-add-summary-3-and-click.html [ Skip ] - - - -# Needs further triage: crbug.com/1053725 [ Mac ] fast/forms/implicit-submission.html [ Skip ] crbug.com/1053725 [ Mac ] fast/forms/select/option-mouseevents.html [ Skip ] crbug.com/1053725 [ Mac ] fast/forms/select/menulist-popup-open-hide-using-keyboard.html [ Skip ] -crbug.com/1053725 [ Mac ] virtual/web-components-v0-disabled/fast/dom/title-text-property.html [ Skip ] - - - -# Needs triage: crbug.com/1053725 [ Mac ] fast/css/button-height.html [ Skip ] crbug.com/1053725 [ Mac ] fast/css-grid-layout/preferred-width-computed-after-layout.html [ Skip ] crbug.com/1053725 [ Mac ] editing/selection/replaced-boundaries-3.html [ Skip ] - - -# Need triage: crbug.com/1053725 [ Mac ] fast/forms/textarea/textarea-metrics.html [ Skip ] # Flaky on Win7 @@ -1353,29 +1335,6 @@ # ====== Form Controls Refresh failures until here ====== -# ===== These tests fail when Web Components v0 is removed ===== - -crbug.com/1081941 web-components-v0-only/* [ Skip ] -crbug.com/1081941 virtual/web-components-v0-disabled/* [ Skip ] -crbug.com/1081941 http/tests/htmlimports/* [ Skip ] -crbug.com/1081941 http/tests/custom/xhr-response-does-not-have-registry.html [ Skip ] -crbug.com/1081941 http/tests/custom-elements/no-registry-test.html [ Skip ] -crbug.com/1081941 http/tests/devtools/import-open-inspector.js [ Skip ] -crbug.com/1081941 http/tests/devtools/elements/html-link-import.js [ Skip ] -crbug.com/1081941 http/tests/devtools/elements/styles-3/style-rule-from-imported-stylesheet.js [ Skip ] -crbug.com/1081941 http/tests/devtools/network/network-imported-resource-content.js [ Skip ] -crbug.com/1081941 http/tests/devtools/resource-tree/resource-tree-htmlimports.js [ Skip ] -crbug.com/1081941 http/tests/linkHeader/link-rel-import-css-rule-capital.html [ Skip ] -crbug.com/1081941 http/tests/security/contentSecurityPolicy/nonces/import-enforce-allowed.php [ Skip ] -crbug.com/1081941 http/tests/security/contentSecurityPolicy/nonces/import-enforce-blocked.php [ Skip ] -crbug.com/1081941 http/tests/security/contentSecurityPolicy/nonces/import-multiple-allowed.php [ Skip ] -crbug.com/1081941 http/tests/security/contentSecurityPolicy/nonces/import-multiple-blocked.php [ Skip ] -crbug.com/1081941 http/tests/security/contentSecurityPolicy/nonces/import-reportonly-allowed.php [ Skip ] -crbug.com/1081941 http/tests/security/referrer-policy-attribute-import-no-referrer.html [ Skip ] -crbug.com/1081941 http/tests/subresource_filter/resource-in-import-disallowed.html [ Skip ] - -# ===== Web Components v0 until here ===== - # Bug in FormControlsRefresh <select multiple> tap behavior: crbug.com/1045672 fast/forms/select/listbox-tap.html [ Failure ] @@ -4433,132 +4392,6 @@ crbug.com/789139 http/tests/devtools/sources/debugger/live-edit-no-reveal.js [ Failure Pass Timeout Crash ] - -# ====== Begin web-components-v0-disabled virtual suite tests ====== - -# Ignore these - they are tests of the disabled features. Eventually remove these. -crbug.com/937746 virtual/web-components-v0-disabled/fast/dom/shadow/access-document-of-detached-stylesheetlist-crash.html [ Skip ] -crbug.com/937746 virtual/web-components-v0-disabled/fast/dom/shadow/distribution-update-fonts-load.html [ Skip ] -crbug.com/937746 virtual/web-components-v0-disabled/fast/dom/shadow/form-in-shadow.html [ Skip ] -crbug.com/937746 virtual/web-components-v0-disabled/fast/dom/shadow/no-style-sharing-with-uncommon-attribute-nodes.html [ Skip ] -crbug.com/937746 virtual/web-components-v0-disabled/fast/dom/shadow/shadow-dynamic-style-change-via-mutation-and-selector.html [ Skip ] -crbug.com/937746 virtual/web-components-v0-disabled/fast/dom/shadow/shadowhost-keyframes.html [ Skip ] -crbug.com/937746 virtual/web-components-v0-disabled/fast/dom/shadow/shadowroot-keyframes.html [ Skip ] -crbug.com/937746 virtual/web-components-v0-disabled/fast/dom/shadow/transition-on-shadow-host-createshadowroot.html [ Skip ] -crbug.com/937746 virtual/web-components-v0-disabled/fast/dom/gc-treescope.html [ Skip ] -crbug.com/937746 virtual/web-components-v0-disabled/fast/dom/StyleSheet/css-insert-import-rule-to-shadow-stylesheets.html [ Skip ] -crbug.com/937746 virtual/web-components-v0-disabled/fast/dom/shadow/gesture-tapHighlight-shadow-tree.html [ Skip ] -crbug.com/937746 virtual/web-components-v0-disabled/fast/dom/shadow/import-rule-in-shadow-tree-needs-document-style-recalc.html [ Skip ] -crbug.com/937746 virtual/web-components-v0-disabled/fast/dom/shadow/scrollbar.html [ Skip ] -crbug.com/937746 virtual/web-components-v0-disabled/fast/dom/shadow/text-node-in-shadow.html [ Skip ] -crbug.com/937746 virtual/web-components-v0-disabled/fast/dom/shadow/custom-pseudo-scope.html [ Skip ] -crbug.com/937746 virtual/web-components-v0-disabled/fast/dom/shadow/dynamically-created-shadow-root.html [ Skip ] -crbug.com/937746 virtual/web-components-v0-disabled/fast/dom/shadow/new-fallback.html [ Skip ] -crbug.com/937746 virtual/web-components-v0-disabled/fast/dom/shadow/shadow-on-image.html [ Skip ] - - -# == These fail with or without the WCv0 features disabled, and most/all already -# == exist somewhere else in this file, outside the virtual suite. -crbug.com/937746 virtual/web-components-v0-disabled/dom/legacy_dom_conformance/xhtml/level3/core/nodecomparedocumentposition38.xhtml [ Skip ] -crbug.com/937746 virtual/web-components-v0-disabled/external/wpt/dom/events/Event-dispatch-on-disabled-elements.html [ Skip ] -crbug.com/937746 virtual/web-components-v0-disabled/external/wpt/dom/events/EventListener-incumbent-global-1.sub.html [ Skip ] -crbug.com/937746 virtual/web-components-v0-disabled/external/wpt/dom/events/EventListener-incumbent-global-2.sub.html [ Skip ] -crbug.com/937746 virtual/web-components-v0-disabled/external/wpt/dom/ranges/Range-compareBoundaryPoints.html [ Skip ] -crbug.com/937746 virtual/web-components-v0-disabled/external/wpt/html/dom/elements/global-attributes/title-manual.html [ Skip ] -crbug.com/937746 virtual/web-components-v0-disabled/external/wpt/html/semantics/document-metadata/styling/LinkStyle.html [ Skip ] -crbug.com/937746 virtual/web-components-v0-disabled/external/wpt/html/semantics/document-metadata/the-link-element/link-multiple-error-events.html [ Skip ] -crbug.com/937746 virtual/web-components-v0-disabled/external/wpt/html/semantics/document-metadata/the-link-element/link-multiple-load-events.html [ Skip ] -crbug.com/937746 virtual/web-components-v0-disabled/external/wpt/html/semantics/document-metadata/the-link-element/stylesheet-not-removed-until-next-stylesheet-loads.html [ Skip ] -crbug.com/937746 virtual/web-components-v0-disabled/external/wpt/html/semantics/embedded-content/media-elements/audio_controls_present-manual.html [ Skip ] -crbug.com/937746 virtual/web-components-v0-disabled/external/wpt/html/semantics/embedded-content/media-elements/audio_muted_overriding_volume-manual.html [ Skip ] -crbug.com/937746 virtual/web-components-v0-disabled/external/wpt/html/semantics/embedded-content/media-elements/audio_muted_present-manual.html [ Skip ] -crbug.com/937746 virtual/web-components-v0-disabled/external/wpt/html/semantics/embedded-content/media-elements/audio_volume_loudest-manual.html [ Skip ] -crbug.com/937746 virtual/web-components-v0-disabled/external/wpt/html/semantics/embedded-content/media-elements/audio_volume_silent-manual.html [ Skip ] -crbug.com/937746 virtual/web-components-v0-disabled/external/wpt/html/semantics/embedded-content/media-elements/src_object_blob.html [ Skip ] -crbug.com/937746 virtual/web-components-v0-disabled/external/wpt/html/semantics/embedded-content/media-elements/video_controls_present-manual.html [ Skip ] -crbug.com/937746 virtual/web-components-v0-disabled/external/wpt/html/semantics/embedded-content/media-elements/video_muted_overriding_volume-manual.html [ Skip ] -crbug.com/937746 virtual/web-components-v0-disabled/external/wpt/html/semantics/embedded-content/media-elements/video_muted_present-manual.html [ Skip ] -crbug.com/937746 virtual/web-components-v0-disabled/external/wpt/html/semantics/embedded-content/media-elements/video_volume_loudest-manual.html [ Skip ] -crbug.com/937746 virtual/web-components-v0-disabled/external/wpt/html/semantics/embedded-content/media-elements/video_volume_silent-manual.html [ Skip ] -crbug.com/937746 virtual/web-components-v0-disabled/external/wpt/html/semantics/embedded-content/media-elements/mime-types/canPlayType.html [ Skip ] -crbug.com/937746 virtual/web-components-v0-disabled/external/wpt/html/semantics/embedded-content/media-elements/track/track-element/track-cue-rendering-after-controls-removed.html [ Skip ] -crbug.com/937746 virtual/web-components-v0-disabled/external/wpt/html/semantics/embedded-content/the-embed-element/embed-represent-nothing-04.html [ Skip ] -crbug.com/937746 virtual/web-components-v0-disabled/external/wpt/html/semantics/embedded-content/the-iframe-element/sandbox_003-manual.htm [ Skip ] -crbug.com/937746 virtual/web-components-v0-disabled/external/wpt/html/semantics/embedded-content/the-iframe-element/sandbox_004-manual.htm [ Skip ] -crbug.com/937746 virtual/web-components-v0-disabled/external/wpt/html/semantics/embedded-content/the-iframe-element/sandbox_006-manual.htm [ Skip ] -crbug.com/937746 virtual/web-components-v0-disabled/external/wpt/html/semantics/embedded-content/the-iframe-element/sandbox_007-manual.htm [ Skip ] -crbug.com/937746 virtual/web-components-v0-disabled/external/wpt/html/semantics/embedded-content/the-iframe-element/sandbox_008-manual.htm [ Skip ] -crbug.com/937746 virtual/web-components-v0-disabled/external/wpt/html/semantics/embedded-content/the-iframe-element/sandbox_010-manual.htm [ Skip ] -crbug.com/937746 virtual/web-components-v0-disabled/external/wpt/html/semantics/embedded-content/the-iframe-element/sandbox_020-manual.htm [ Skip ] -crbug.com/937746 virtual/web-components-v0-disabled/external/wpt/html/semantics/embedded-content/the-iframe-element/sandbox_021-manual.htm [ Skip ] -crbug.com/937746 virtual/web-components-v0-disabled/external/wpt/html/semantics/embedded-content/the-iframe-element/sandbox_022-manual.htm [ Skip ] -crbug.com/937746 virtual/web-components-v0-disabled/external/wpt/html/semantics/embedded-content/the-img-element/ismap/img-ismap-coordinates-manual.html [ Skip ] -crbug.com/937746 virtual/web-components-v0-disabled/external/wpt/html/semantics/embedded-content/the-object-element/object-events.html [ Skip ] -crbug.com/937746 virtual/web-components-v0-disabled/external/wpt/html/semantics/embedded-content/the-video-element/video_initially_paused.html [ Skip ] -crbug.com/937746 virtual/web-components-v0-disabled/external/wpt/html/semantics/forms/attributes-common-to-form-controls/dirname-rtl-manual.html [ Skip ] -crbug.com/937746 virtual/web-components-v0-disabled/external/wpt/html/semantics/forms/constraints/tooShort-input-email-add-manual.html [ Skip ] -crbug.com/937746 virtual/web-components-v0-disabled/external/wpt/html/semantics/forms/constraints/tooShort-input-password-add-manual.html [ Skip ] -crbug.com/937746 virtual/web-components-v0-disabled/external/wpt/html/semantics/forms/constraints/tooShort-input-search-add-manual.html [ Skip ] -crbug.com/937746 virtual/web-components-v0-disabled/external/wpt/html/semantics/forms/constraints/tooShort-input-tel-add-manual.html [ Skip ] -crbug.com/937746 virtual/web-components-v0-disabled/external/wpt/html/semantics/forms/constraints/tooShort-input-text-add-manual.html [ Skip ] -crbug.com/937746 virtual/web-components-v0-disabled/external/wpt/html/semantics/forms/constraints/tooShort-input-url-add-manual.html [ Skip ] -crbug.com/937746 virtual/web-components-v0-disabled/external/wpt/html/semantics/forms/constraints/tooShort-textarea-add-manual.html [ Skip ] -crbug.com/937746 virtual/web-components-v0-disabled/external/wpt/html/semantics/forms/the-input-element/event-select-manual.html [ Skip ] -crbug.com/937746 virtual/web-components-v0-disabled/external/wpt/html/semantics/forms/the-optgroup-element/optgroup-disabled-manual.html [ Skip ] -crbug.com/937746 virtual/web-components-v0-disabled/external/wpt/html/semantics/forms/the-option-element/option-disabled-manual.html [ Skip ] -crbug.com/937746 virtual/web-components-v0-disabled/external/wpt/html/semantics/forms/the-textarea-element/textarea-placeholder-manual.html [ Skip ] -crbug.com/937746 virtual/web-components-v0-disabled/external/wpt/html/semantics/forms/the-textarea-element/textarea-select-manual.html [ Skip ] -crbug.com/937746 virtual/web-components-v0-disabled/external/wpt/html/semantics/interactive-elements/commands/legend/first-input-after-legend-manual.html [ Skip ] -crbug.com/937746 virtual/web-components-v0-disabled/external/wpt/html/semantics/interactive-elements/commands/legend/first-input-before-legend-manual.html [ Skip ] -crbug.com/937746 virtual/web-components-v0-disabled/external/wpt/html/semantics/interactive-elements/commands/legend/first-input-inside-legend-manual.html [ Skip ] -crbug.com/937746 virtual/web-components-v0-disabled/external/wpt/html/semantics/interactive-elements/commands/legend/focusable-legend-manual.html [ Skip ] -crbug.com/937746 virtual/web-components-v0-disabled/external/wpt/html/semantics/interactive-elements/commands/legend/focusable-legend-sibling-manual.html [ Skip ] -crbug.com/937746 virtual/web-components-v0-disabled/external/wpt/html/semantics/interactive-elements/commands/legend/input-outside-fieldset-manual.html [ Skip ] -crbug.com/937746 virtual/web-components-v0-disabled/external/wpt/html/semantics/interactive-elements/commands/legend/label-sibling-manual.html [ Skip ] -crbug.com/937746 virtual/web-components-v0-disabled/external/wpt/html/semantics/interactive-elements/commands/legend/no-fieldset-parent-manual.html [ Skip ] -crbug.com/937746 virtual/web-components-v0-disabled/external/wpt/html/semantics/scripting-1/the-script-element/json-module/parse-error.tentative.html [ Skip ] -crbug.com/937746 virtual/web-components-v0-disabled/external/wpt/html/semantics/scripting-1/the-script-element/module/module-in-xhtml.xhtml [ Skip ] -crbug.com/937746 virtual/web-components-v0-disabled/external/wpt/html/semantics/scripting-1/the-script-element/module/dynamic-import/no-active-script-manual-classic.html [ Skip ] -crbug.com/937746 virtual/web-components-v0-disabled/external/wpt/html/semantics/scripting-1/the-script-element/module/dynamic-import/no-active-script-manual-module.html [ Skip ] -crbug.com/937746 virtual/web-components-v0-disabled/external/wpt/html/semantics/scripting-1/the-script-element/module/dynamic-import/string-compilation-base-url-external-classic.html [ Skip ] -crbug.com/937746 virtual/web-components-v0-disabled/external/wpt/html/semantics/scripting-1/the-script-element/module/dynamic-import/string-compilation-base-url-external-module.html [ Skip ] -crbug.com/937746 virtual/web-components-v0-disabled/external/wpt/html/semantics/scripting-1/the-script-element/module/dynamic-import/string-compilation-base-url-inline-classic.html [ Skip ] -crbug.com/937746 virtual/web-components-v0-disabled/external/wpt/html/semantics/scripting-1/the-script-element/module/dynamic-import/string-compilation-base-url-inline-module.html [ Skip ] -crbug.com/937746 virtual/web-components-v0-disabled/external/wpt/html/semantics/selectors/pseudo-classes/checked-001-manual.html [ Skip ] -crbug.com/937746 virtual/web-components-v0-disabled/external/wpt/html/semantics/tabular-data/processing-model-1/span-limits.html [ Skip ] -crbug.com/937746 virtual/web-components-v0-disabled/external/wpt/shadow-dom/directionality-002.tentative.html [ Skip ] -crbug.com/937746 virtual/web-components-v0-disabled/fast/dom/HTMLImageElement/image-sizes-meta-viewport.html [ Skip ] -crbug.com/937746 virtual/web-components-v0-disabled/fast/dom/Window/window-postmessage-clone-deep-array.html [ Skip ] -crbug.com/937746 virtual/web-components-v0-disabled/fast/dom/shadow/focus-controller-recursion-crash.html [ Skip ] -crbug.com/937746 virtual/web-components-v0-disabled/html/marquee/marquee-scroll.html [ Skip ] -crbug.com/937746 virtual/web-components-v0-disabled/html/marquee/marquee-scrollamount.html [ Skip ] -crbug.com/937746 virtual/web-components-v0-disabled/external/wpt/dom/ranges/Range-set.html [ Skip ] -crbug.com/937746 virtual/web-components-v0-disabled/external/wpt/html/semantics/embedded-content/media-elements/ready-states/autoplay-hidden.optional.html [ Skip ] -crbug.com/937746 virtual/web-components-v0-disabled/external/wpt/html/semantics/embedded-content/media-elements/track/track-element/track-webvtt-non-snap-to-lines.html [ Skip ] -crbug.com/937746 virtual/web-components-v0-disabled/external/wpt/html/semantics/forms/the-textarea-element/multiline-placeholder-cr.html [ Skip ] -crbug.com/937746 virtual/web-components-v0-disabled/external/wpt/html/semantics/grouping-content/the-li-element/grouping-li-reftest-list-owner-menu.html [ Skip ] -crbug.com/937746 virtual/web-components-v0-disabled/external/wpt/html/semantics/grouping-content/the-li-element/grouping-li-reftest-list-owner-skip-no-boxes.html [ Skip ] -crbug.com/937746 virtual/web-components-v0-disabled/fast/parser/residual-style-hang.html [ Skip ] -crbug.com/937746 virtual/web-components-v0-disabled/fast/dom/rtl-scroll-to-leftmost-and-resize.html [ Skip ] -crbug.com/937746 virtual/web-components-v0-disabled/external/wpt/html/semantics/embedded-content/the-video-element/resize-during-playback.html [ Skip ] -crbug.com/937746 [ Win7 ] virtual/web-components-v0-disabled/external/wpt/html/dom/documents/resource-metadata-management/document-lastModified-01.html [ Skip ] -crbug.com/937746 [ Mac ] virtual/web-components-v0-disabled/fast/dom/inert/inert-node-is-uneditable.html [ Skip ] -# These are in NeverFixTests: -crbug.com/937746 [ Mac ] virtual/web-components-v0-disabled/external/wpt/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-009a.html [ Skip ] -crbug.com/937746 [ Mac ] virtual/web-components-v0-disabled/external/wpt/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-009b.html [ Skip ] -crbug.com/937746 [ Mac ] virtual/web-components-v0-disabled/external/wpt/html/dom/elements/requirements-relating-to-bidirectional-algorithm-formatting-characters/dir-isolation-009c.html [ Skip ] - -# Sheriffs, please add any newly discovered flaky tests within -# the virtual/web-components-v0-disabled suite here: -###crbug.com/937746 virtual/web-components-v0-disabled/my/test/here [ Skip ] - -crbug.com/937746 virtual/web-components-v0-disabled/external/wpt/html/semantics/links/following-hyperlinks/activation-behavior.window.html [ Skip ] -crbug.com/937746 virtual/web-components-v0-disabled/external/wpt/dom/idlharness.any.serviceworker.html [ Skip ] -crbug.com/937746 virtual/web-components-v0-disabled/external/wpt/html/dom/idlharness.worker.html [ Skip ] -crbug.com/937746 virtual/web-components-v0-disabled/fast/dom/gc-acid3.html [ Pass Timeout ] - -# ====== End web-components-v0-disabled virtual suite tests ====== - # ====== Begin of display: contents tests ====== crbug.com/795217 external/wpt/css/css-display/display-contents-details.html [ Failure ] @@ -5958,7 +5791,6 @@ # Sheriff 2020-01-20 crbug.com/1043357 http/tests/credentialmanager/credentialscontainer-get-with-virtual-authenticator.html [ Pass Timeout Failure ] -crbug.com/1043774 [ Linux ] virtual/web-components-v0-disabled/external/wpt/html/dom/reflection-grouping.html [ Pass Failure ] # Sheriff 2020-01-22 crbug.com/1044712 [ Win ] fast/forms/suggestion-picker/datetimelocal-suggestion-picker-appearance-with-scroll-bar.html [ Pass Failure ] @@ -6382,9 +6214,6 @@ # Disabled for landing DevTools change crbug.com/1011811 http/tests/devtools/persistence/automapping-sourcemap.js [ Pass Failure ] -# Sheriff 2020-06-04 -crbug.com/1041973 virtual/web-components-v0-disabled/external/wpt/html/semantics/forms/constraints/form-validation-reportValidity.html [ Pass Failure Timeout ] - # Sheriff 2020-06-05 crbug.com/1091829 [ Mac ] fast/scrolling/scroll-non-composited-scroller.html [ Pass Failure ] crbug.com/1091829 [ Linux ] virtual/threaded-prefer-compositing/fast/scrolling/scroll-non-composited-scroller.html [ Pass Failure ]
diff --git a/third_party/blink/web_tests/VirtualTestSuites b/third_party/blink/web_tests/VirtualTestSuites index db8f4ae..01630b2 100644 --- a/third_party/blink/web_tests/VirtualTestSuites +++ b/third_party/blink/web_tests/VirtualTestSuites
@@ -645,20 +645,6 @@ "args": ["--disable-features=SplitCacheByNetworkIsolationKey"] }, { - "prefix": "web-components-v0-disabled", - "bases": ["external/wpt/dom", - "external/wpt/shadow-dom", - "external/wpt/html/dom", - "external/wpt/html/semantics", - "dom", - "shadow-dom", - "html", - "fast/dom", - "fast/html", - "fast/parser"], - "args": ["--disable-blink-features=ShadowDOMV0,CustomElementsV0,HTMLImports"] - }, - { "prefix": "raw-clipboard", "bases": ["clipboard/async-clipboard", "external/wpt/clipboard-apis/clipboard-item.https.html"],
diff --git a/third_party/blink/web_tests/external/WPT_BASE_MANIFEST_8.json b/third_party/blink/web_tests/external/WPT_BASE_MANIFEST_8.json index 78ae39a..bd54b4d 100644 --- a/third_party/blink/web_tests/external/WPT_BASE_MANIFEST_8.json +++ b/third_party/blink/web_tests/external/WPT_BASE_MANIFEST_8.json
@@ -248386,7 +248386,7 @@ [] ], "browser.py": [ - "13ffa3f08b34d981ac574c76bfa6e17b972ee1fc", + "726d5598f524539bceb131d230b7a02bed36361c", [] ], "commands.json": [ @@ -248422,7 +248422,7 @@ [] ], "run.py": [ - "dc130a16d117085c72e047edbfa49be506987e24", + "561b8e85aa73f156854fe2ba292164a285e928ec", [] ], "testfiles.py": [
diff --git a/third_party/blink/web_tests/external/wpt/css/css-overflow/overflow-clip-hit-testing.html b/third_party/blink/web_tests/external/wpt/css/css-overflow/overflow-clip-hit-testing.html new file mode 100644 index 0000000..b2249760 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/css/css-overflow/overflow-clip-hit-testing.html
@@ -0,0 +1,50 @@ +<!doctype html> +<meta charset="utf-8"> +<title>Overflow: clip hit testing doesn't include overflow: clip</title> +<link rel="help" href="https://www.w3.org/TR/css-overflow-3/#valdef-overflow-clip"> +<link rel="author" title="Scott Violet" href="mailto:sky@chromium.org"> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<style> + .parent { + width: 100px; + height: 100px; + flex: none; + } + + .child1, .child2 { + width: 100px; + height: 100px; + flex: none; + } + + .child1 { + background-color: green; + } + + .child2 { + background-color: red; + } +</style> +<div class="parent" style="display: flex; overflow-x: visible; overflow-y: clip"> + <div id="c1" class="child1"></div> + <div id="hit1" class="child2"></div> +</div> +<div class="parent" style="overflow-x: clip; overflow-y: visible"> + <div id="c2" class="child1"></div> + <div id="hit2" class="child2"></div> +</div> + +<script> +test(() => { + var c1Bounds = document.getElementById("c1").getBoundingClientRect(); + var hitElement = document.elementFromPoint(c1Bounds.x + 150, + c1Bounds.y + 50); + assert_equals(hitElement.id, "hit1"); + + var c2Bounds = document.getElementById("c2").getBoundingClientRect(); + hitElement = document.elementFromPoint(c2Bounds.x + 50, + c2Bounds.y + 150); + assert_equals(hitElement.id, "hit2"); +}, "Ensure elements in overflow:visible are returned from elementFromPoint"); +</script>
diff --git a/third_party/blink/web_tests/external/wpt/html/rendering/the-details-element/details-blockification.html b/third_party/blink/web_tests/external/wpt/html/rendering/the-details-element/details-blockification.html new file mode 100644 index 0000000..cc94e92 --- /dev/null +++ b/third_party/blink/web_tests/external/wpt/html/rendering/the-details-element/details-blockification.html
@@ -0,0 +1,35 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title>CSS Test: details children blockification</title> +<link rel="author" title="Mason Freed" href="mailto:masonfreed@chromium.org"> +<link rel="help" href="https://html.spec.whatwg.org/multipage/rendering.html#the-details-and-summary-elements"> +<meta name="assert" content="Ensure blockification of <details> children"> +<script src=/resources/testharness.js></script> +<script src=/resources/testharnessreport.js></script> + +<div id="example1"> + <details style="display: grid" open> + <summary style="display: inline">foo</summary> + <div style="display: inline">bar</span> + </details> +</div> + +<div id="example2" style="display: grid"> + <details style="display: contents" open> + <summary style="display: inline">foo</summary> + <div style="display: inline">bar</span> + </details> +</div> + +<script> + function checkDetails(details) { + assert_equals(getComputedStyle(details.querySelector('summary')).display, "block"); + assert_equals(getComputedStyle(details.querySelector('div')).display, "block"); + } + test(() => { + checkDetails(document.querySelector('#example1')); + checkDetails(document.querySelector('#example2')); + assert_equals(getComputedStyle(document.querySelector('#example2>details')).display, "contents"); + }, "Summary and content should have display:block computed value"); + +</script>
diff --git a/third_party/blink/web_tests/external/wpt/tools/wpt/browser.py b/third_party/blink/web_tests/external/wpt/tools/wpt/browser.py index 13ffa3f..726d559 100644 --- a/third_party/blink/web_tests/external/wpt/tools/wpt/browser.py +++ b/third_party/blink/web_tests/external/wpt/tools/wpt/browser.py
@@ -661,7 +661,7 @@ def find_webdriver(self, venv_path=None, channel=None, browser_binary=None): return find_executable("chromedriver") - def webdriver_supports_browser(self, webdriver_binary, browser_binary): + def webdriver_supports_browser(self, webdriver_binary, browser_binary, browser_channel): chromedriver_version = self.webdriver_version(webdriver_binary) if not chromedriver_version: self.logger.warning( @@ -676,9 +676,17 @@ return True # Check that the ChromeDriver version matches the Chrome version. - chromedriver_major = chromedriver_version.split('.')[0] - browser_major = browser_version.split('.')[0] + chromedriver_major = int(chromedriver_version.split('.')[0]) + browser_major = int(browser_version.split('.')[0]) if chromedriver_major != browser_major: + # There is no official ChromeDriver release for the dev channel - + # it switches between beta and tip-of-tree, so we accept version+1 + # too for dev. + if browser_channel == "dev" and chromedriver_major == (browser_major + 1): + self.logger.debug( + "Accepting ChromeDriver %s for Chrome/Chromium Dev %s" % + (chromedriver_version, browser_version)) + return True self.logger.warning( "ChromeDriver %s does not match Chrome/Chromium %s" % (chromedriver_version, browser_version))
diff --git a/third_party/blink/web_tests/external/wpt/tools/wpt/run.py b/third_party/blink/web_tests/external/wpt/tools/wpt/run.py index dc130a1..561b8e8 100644 --- a/third_party/blink/web_tests/external/wpt/tools/wpt/run.py +++ b/third_party/blink/web_tests/external/wpt/tools/wpt/run.py
@@ -345,7 +345,7 @@ if not kwargs["install_webdriver"]: webdriver_binary = self.browser.find_webdriver() if webdriver_binary and not self.browser.webdriver_supports_browser( - webdriver_binary, kwargs["binary"]): + webdriver_binary, kwargs["binary"], browser_channel): webdriver_binary = None if webdriver_binary is None:
diff --git a/third_party/blink/web_tests/fast/dom/shadow/shadow-dom-event-dispatching-details-summary-expected.txt b/third_party/blink/web_tests/fast/dom/shadow/shadow-dom-event-dispatching-details-summary-expected.txt index f78414e..611b103 100644 --- a/third_party/blink/web_tests/fast/dom/shadow/shadow-dom-event-dispatching-details-summary-expected.txt +++ b/third_party/blink/web_tests/fast/dom/shadow/shadow-dom-event-dispatching-details-summary-expected.txt
@@ -8,8 +8,7 @@ SUMMARY id=summary DIV id=details-marker SLOT - DIV id=details-content - SLOT + SLOT id=details-content Moving mouse from details to summary
diff --git a/third_party/blink/web_tests/http/tests/custom-elements/no-registry-test.html b/third_party/blink/web_tests/http/tests/custom-elements/no-registry-test.html deleted file mode 100644 index 007315c..0000000 --- a/third_party/blink/web_tests/http/tests/custom-elements/no-registry-test.html +++ /dev/null
@@ -1,37 +0,0 @@ -<!DOCTYPE html> -<script src="../../../resources/testharness.js"></script> -<script src="../../../resources/testharnessreport.js"></script> -<script> -test(function() { - var doc = document.implementation.createDocument(null, 'test', null); - assert_throws_dom( - 'NotSupportedError', - function() { doc.registerElement('x-element'); }, - 'Registering valid custom element in a document ' + - 'without registry should fail'); -}, 'Document of type other than HTML, not loaded into browsing context, must not have a registry'); - -async_test(function(t) { - var request = new XMLHttpRequest(); - request.onreadystatechange = t.step_func(function() { - if (request.readyState == 4) { - assert_equals(request.status, 200, 'Test document is not loaded correctly'); - var doc = request.response; - assert_true(doc instanceof HTMLDocument, - 'XMLHttpRequest\'s asynchronous response should be HTML document'); - assert_throws_dom( - 'NotSupportedError', - function() { doc.registerElement('x-element'); }, - 'Registering valid custom element in ' + - 'an XMLHttpRequest\'s response document should fail'); - t.done(); - } - }); - - request.open('GET', 'resources/blank.html', true); - request.responseType = 'document'; - request.send(); -}, 'XMLHttpRequest\'s asynchronous response HTML document must not have a registry'); -</script> -</body> -</html>
diff --git a/third_party/blink/web_tests/http/tests/custom/xhr-response-does-not-have-registry.html b/third_party/blink/web_tests/http/tests/custom/xhr-response-does-not-have-registry.html deleted file mode 100644 index 5fac8c2..0000000 --- a/third_party/blink/web_tests/http/tests/custom/xhr-response-does-not-have-registry.html +++ /dev/null
@@ -1,23 +0,0 @@ -<!DOCTYPE html> -<script src="../../../resources/testharness.js"></script> -<script src="../../../resources/testharnessreport.js"></script> -<script> -(function() { - -var t = async_test('an XHR response document must not have a registry'); - -var req = new XMLHttpRequest(); -req.onreadystatechange = t.step_func(function() { - if (req.readyState == 4 && req.status == 200) { - assert_throws_dom( - 'NOT_SUPPORTED_ERR', - function () { req.response.registerElement('x-a'); }); - t.done(); - } -}); -req.open('GET', 'resources/blank.html', true); -req.responseType = 'document'; -req.send(); - -})(); -</script>
diff --git a/third_party/blink/web_tests/http/tests/devtools/elements/html-link-import.js b/third_party/blink/web_tests/http/tests/devtools/elements/html-link-import.js deleted file mode 100644 index ac20dc5..0000000 --- a/third_party/blink/web_tests/http/tests/devtools/elements/html-link-import.js +++ /dev/null
@@ -1,25 +0,0 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -(async function() { - TestRunner.addResult(`This test verifies that imported document is rendered within the import link.\n`); - await TestRunner.loadModule('elements_test_runner'); - await TestRunner.showPanel('elements'); - - await TestRunner.loadHTML(` - <head> - <link rel="import" href="../resources/imported-document.html"> - <head> - `); - - // Warm up highlighter module. - runtime.loadModulePromise('source_frame').then(function() { - ElementsTestRunner.expandElementsTree(callback); - }); - - function callback() { - ElementsTestRunner.dumpElementsTree(); - TestRunner.completeTest(); - } -})();
diff --git a/third_party/blink/web_tests/http/tests/devtools/elements/styles-3/style-rule-from-imported-stylesheet.js b/third_party/blink/web_tests/http/tests/devtools/elements/styles-3/style-rule-from-imported-stylesheet.js deleted file mode 100644 index d5679846..0000000 --- a/third_party/blink/web_tests/http/tests/devtools/elements/styles-3/style-rule-from-imported-stylesheet.js +++ /dev/null
@@ -1,29 +0,0 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -(async function() { - TestRunner.addResult( - `Tests that rules from imported stylesheets are correctly shown and are editable in inspector.\n`); - await TestRunner.loadModule('elements_test_runner'); - await TestRunner.showPanel('elements'); - await TestRunner.loadHTML(` - <div id="square" class="square"></div> - `); - await TestRunner.addHTMLImport('../styles/resources/imported-stylesheet.html'); - - ElementsTestRunner.selectNodeAndWaitForStyles('square', step1); - - async function step1() { - TestRunner.addResult('Rules before toggling:'); - await ElementsTestRunner.dumpSelectedElementStyles(true, false, true); - ElementsTestRunner.waitForStyleApplied(step2); - ElementsTestRunner.toggleMatchedStyleProperty('background-color', false); - } - - async function step2() { - TestRunner.addResult('Rules after toggling:'); - await ElementsTestRunner.dumpSelectedElementStyles(true, false, true); - TestRunner.completeTest(); - } -})();
diff --git a/third_party/blink/web_tests/http/tests/devtools/import-open-inspector.js b/third_party/blink/web_tests/http/tests/devtools/import-open-inspector.js deleted file mode 100644 index 5622f4f9..0000000 --- a/third_party/blink/web_tests/http/tests/devtools/import-open-inspector.js +++ /dev/null
@@ -1,44 +0,0 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -(async function() { - TestRunner.addResult( - `This tests that reloading a page with the inspector opened does not crash (rewritten test from r156199).\n`); - - await TestRunner.evaluateInPageAsync(` - (function(){ - var link = document.createElement('link'); - link.rel = 'import'; - link.href = 'resources/import-open-inspector-linked.html'; - document.head.append(link); - return new Promise(f => link.onload = f); - })(); - `); - - await TestRunner.evaluateInPagePromise(` - function getGreeting() - { - return window.greeting; - } - `); - - TestRunner.runTestSuite([ - function checkGreetingSet(next) { - TestRunner.evaluateInPage('getGreeting()', callback); - function callback(result) { - TestRunner.addResult('Received: ' + result); - next(); - } - }, - - function reloadPage(next) { - TestRunner.reloadPage(next); - }, - - function checkReloaded(next) { - TestRunner.addResult('Page successfully reloaded'); - next(); - } - ]); -})();
diff --git a/third_party/blink/web_tests/http/tests/devtools/network/network-imported-resource-content.js b/third_party/blink/web_tests/http/tests/devtools/network/network-imported-resource-content.js deleted file mode 100644 index 1aa090e..0000000 --- a/third_party/blink/web_tests/http/tests/devtools/network/network-imported-resource-content.js +++ /dev/null
@@ -1,34 +0,0 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -(async function() { - TestRunner.addResult(`Tests content is available for imported resource request.\n`); - await TestRunner.loadModule('network_test_runner'); - await TestRunner.showPanel('network'); - await TestRunner.evaluateInPagePromise(` - function loadData() - { - var link = document.createElement("link"); - link.rel = "import"; - link.href = "resources/imported.html"; - document.head.appendChild(link); - } - `); - - NetworkTestRunner.recordNetwork(); - TestRunner.evaluateInPage('loadData()', step2); - - function step2() { - var request = NetworkTestRunner.networkRequests().pop(); - TestRunner.addResult(request.url()); - TestRunner.addResult('resource.type: ' + request.resourceType()); - TestRunner.assertTrue(!request.failed, 'Resource loading failed.'); - request.requestContent().then(step3); - } - - function step3({ content, error, isEncoded }) { - TestRunner.addResult('resource.content after requesting content: ' + content); - TestRunner.completeTest(); - } -})();
diff --git a/third_party/blink/web_tests/http/tests/devtools/resource-tree/resource-tree-htmlimports.js b/third_party/blink/web_tests/http/tests/devtools/resource-tree/resource-tree-htmlimports.js deleted file mode 100644 index 9c9f406..0000000 --- a/third_party/blink/web_tests/http/tests/devtools/resource-tree/resource-tree-htmlimports.js +++ /dev/null
@@ -1,24 +0,0 @@ -// Copyright 2017 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -(async function() { - TestRunner.addResult(`Tests resource tree model for imports.\n`); - await TestRunner.loadModule('sources_test_runner'); - await TestRunner.loadModule('application_test_runner'); - await TestRunner.showPanel('resources'); - await TestRunner.loadHTML(` - <link rel="import" href="resources/import-hello.html"> - <!-- import-hello.html shouldn't be shown twice as it shares same resource as above --> - <link rel="import" href="resources/import-hello.html"> - `); - - await Promise.all([ - TestRunner.waitForUISourceCode('import-hello.html'), - TestRunner.waitForUISourceCode('import-child.html'), - TestRunner.waitForUISourceCode('import-hello.js'), - ]); - - ApplicationTestRunner.dumpResourceTreeEverything(); - TestRunner.completeTest(); -})();
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/OWNERS b/third_party/blink/web_tests/http/tests/htmlimports/OWNERS deleted file mode 100644 index 422c227..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/OWNERS +++ /dev/null
@@ -1 +0,0 @@ -# TEAM: dom-dev@chromium.org
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/already-in-import-map.html b/third_party/blink/web_tests/http/tests/htmlimports/already-in-import-map.html deleted file mode 100644 index 3f26240..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/already-in-import-map.html +++ /dev/null
@@ -1,26 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<title>Fetching import</title> -<link rel="help" href="http://w3c.github.io/webcomponents/spec/imports/#fetching-import"> -<script src="/resources/testharness.js"></script> -<script src="/resources/testharnessreport.js"></script> - -<link id="first" rel="import" href="resources/hello.html"> -<link id="shouldBeInImportMap" rel="import" href="resources/hello.html"> -<link id="parentOfFirst" rel="import" href="resources/hello-parent.html"> - -</head> -<body> -<div id="log"></div> -<script> -test(function() { - assert_true(window.first.import === window.shouldBeInImportMap.import); -}, 'If LOCATION is already in the import map, let IMPORT be the imported document for LOCATION and stop. (1)'); - -test(function() { - assert_true(window.first.import === window.parentOfFirst.import.getElementById('original').import); -}, 'If LOCATION is already in the import map, let IMPORT be the imported document for LOCATION and stop. (2)'); -</script> -</body> -</html>
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/block-cookies-expected.txt b/third_party/blink/web_tests/http/tests/htmlimports/block-cookies-expected.txt deleted file mode 100644 index efa9ba9f..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/block-cookies-expected.txt +++ /dev/null
@@ -1,7 +0,0 @@ -CONSOLE WARNING: line 4: HTML Imports is deprecated and will be removed in M80, around February 2020. Please use ES modules instead. See https://www.chromestatus.com/features/5144752345317376 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -PASS target.import.querySelector('h1').innerHTML is 'Cookie Sent!' -PASS document.cookie.indexOf('htmlimport=hello') is -1 -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/block-cookies.html b/third_party/blink/web_tests/http/tests/htmlimports/block-cookies.html deleted file mode 100644 index f3c27af..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/block-cookies.html +++ /dev/null
@@ -1,13 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<link id="target" rel="import" href="resources/cookie.cgi"> -<script src="/js-test-resources/js-test.js"></script> -</head> -<body> -<script> -shouldBe("target.import.querySelector('h1').innerHTML", "'Cookie Sent!'"); -shouldBe("document.cookie.indexOf('htmlimport=hello')", "-1"); -</script> -</body> -</html>
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/cached-import-expected.txt b/third_party/blink/web_tests/http/tests/htmlimports/cached-import-expected.txt deleted file mode 100644 index beb3dc9..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/cached-import-expected.txt +++ /dev/null
@@ -1,11 +0,0 @@ -CONSOLE WARNING: line 5: HTML Imports is deprecated and will be removed in M80, around February 2020. Please use ES modules instead. See https://www.chromestatus.com/features/5144752345317376 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -CONSOLE WARNING: line 5: HTML Imports is deprecated and will be removed in M80, around February 2020. Please use ES modules instead. See https://www.chromestatus.com/features/5144752345317376 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -HTML Imports should work with cached resources. - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - -PASS -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/cached-import.html b/third_party/blink/web_tests/http/tests/htmlimports/cached-import.html deleted file mode 100644 index a81f80e8..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/cached-import.html +++ /dev/null
@@ -1,22 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script src="/js-test-resources/js-test.js"></script> -<link rel="import" href="http://127.0.0.1:8000/htmlimports/resources/hello-parent.html"> -<script> -description("HTML Imports should work with cached resources."); -window.jsTestIsAsync = true; -if (window.location.search.toString() == "?reloaded") { - debug("PASS"); - window.requestAnimationFrame(finishJSTest, 0); -} else { - // This need to be async so that js-test-post.js is executed. - window.setTimeout(function() { - window.location = window.location.toString() + "?reloaded"; - }, 0); -} -</script> -</head> -<body> -</body> -</html>
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/cors-same-origin-expected.txt b/third_party/blink/web_tests/http/tests/htmlimports/cors-same-origin-expected.txt deleted file mode 100644 index 2cb88c35c..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/cors-same-origin-expected.txt +++ /dev/null
@@ -1,11 +0,0 @@ -CONSOLE WARNING: line 4: HTML Imports is deprecated and will be removed in M80, around February 2020. Please use ES modules instead. See https://www.chromestatus.com/features/5144752345317376 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -CONSOLE ERROR: Access to imported resource at 'http://localhost:8080/htmlimports/resources/resources/hello.html?1' from origin 'http://127.0.0.1:8000' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. -PASS basic.import.querySelector('h1').innerHTML is "Hello, CORS!" -PASS nested.import.querySelector('#sameOriginNoCors').import is null -PASS nested.import.querySelector('#sameOriginCors').import.querySelector('h1').innerHTML is "Hello, CORS!" -PASS nested.import.querySelector('#masterOriginNoCors').import.querySelector('h1').innerHTML is "Hello" -PASS nested.import.querySelector('#masterOriginCors').import.querySelector('h1').innerHTML is "Hello, CORS!" -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/cors-same-origin.html b/third_party/blink/web_tests/http/tests/htmlimports/cors-same-origin.html deleted file mode 100644 index 8539b53..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/cors-same-origin.html +++ /dev/null
@@ -1,19 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<link id="basic" rel="import" href="http://localhost:8080/htmlimports/resources/cors-basic.cgi"> -<link id="nested" rel="import" href="http://localhost:8080/htmlimports/resources/cors-subimports.cgi"> -<script src="/js-test-resources/js-test.js"></script> -</head> -<body> -<script> - -shouldBeEqualToString("basic.import.querySelector('h1').innerHTML", "Hello, CORS!"); -shouldBeNull("nested.import.querySelector('#sameOriginNoCors').import"); -shouldBeEqualToString("nested.import.querySelector('#sameOriginCors').import.querySelector('h1').innerHTML", "Hello, CORS!"); -shouldBeEqualToString("nested.import.querySelector('#masterOriginNoCors').import.querySelector('h1').innerHTML", "Hello"); -shouldBeEqualToString("nested.import.querySelector('#masterOriginCors').import.querySelector('h1').innerHTML", "Hello, CORS!"); - -</script> -</body> -</html>
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/cross-origin-expected.txt b/third_party/blink/web_tests/http/tests/htmlimports/cross-origin-expected.txt deleted file mode 100644 index 2e16fda5..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/cross-origin-expected.txt +++ /dev/null
@@ -1,7 +0,0 @@ -CONSOLE WARNING: line 4: HTML Imports is deprecated and will be removed in M80, around February 2020. Please use ES modules instead. See https://www.chromestatus.com/features/5144752345317376 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -CONSOLE ERROR: Access to imported resource at 'http://localhost:8080/htmlimports/resources/hello.html' from origin 'http://127.0.0.1:8000' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. -PASS target.import is null -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/cross-origin.html b/third_party/blink/web_tests/http/tests/htmlimports/cross-origin.html deleted file mode 100644 index cc3a1d7..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/cross-origin.html +++ /dev/null
@@ -1,12 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<link id="target" rel="import" href="http://localhost:8080/htmlimports/resources/hello.html"> -<script src="/js-test-resources/js-test.js"></script> -</head> -<body> -<script> -shouldBeNull("target.import"); -</script> -</body> -</html>
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/csp-block-import-expected.txt b/third_party/blink/web_tests/http/tests/htmlimports/csp-block-import-expected.txt deleted file mode 100644 index 08b30ef..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/csp-block-import-expected.txt +++ /dev/null
@@ -1,5 +0,0 @@ -CONSOLE WARNING: line 5: HTML Imports is deprecated and will be removed in M80, around February 2020. Please use ES modules instead. See https://www.chromestatus.com/features/5144752345317376 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -CONSOLE ERROR: line 5: Refused to load the script 'http://127.0.0.1:8000/htmlimports/resources/hello.html' because it violates the following Content Security Policy directive: "script-src 'unsafe-inline'". Note that 'script-src-elem' was not explicitly set, so 'script-src' is used as a fallback. - -PASS -
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/csp-block-import-non-self-expected.txt b/third_party/blink/web_tests/http/tests/htmlimports/csp-block-import-non-self-expected.txt deleted file mode 100644 index cd0ca53..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/csp-block-import-non-self-expected.txt +++ /dev/null
@@ -1,6 +0,0 @@ -CONSOLE WARNING: line 5: HTML Imports is deprecated and will be removed in M80, around February 2020. Please use ES modules instead. See https://www.chromestatus.com/features/5144752345317376 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -CONSOLE ERROR: line 6: Refused to load the script 'http://localhost:8080/htmlimports/resources/cors-basic.cgi' because it violates the following Content Security Policy directive: "script-src 'self' 'unsafe-inline'". Note that 'script-src-elem' was not explicitly set, so 'script-src' is used as a fallback. - -PASS -PASS -
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/csp-block-import-non-self.html b/third_party/blink/web_tests/http/tests/htmlimports/csp-block-import-non-self.html deleted file mode 100644 index 9ebb01170..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/csp-block-import-non-self.html +++ /dev/null
@@ -1,25 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<meta http-equiv="Content-Security-Policy" content="script-src 'self' 'unsafe-inline'"> -<link id="selfImport" rel="import" href="resources/hello.html"> -<link id="nonSelfImport" rel="import" href="http://localhost:8080/htmlimports/resources/cors-basic.cgi"> -</head> -<body> -<pre id="result"></pre> -<script> -if (window.testRunner) - testRunner.dumpAsText(); - -if (window.selfImport.import != null) - result.innerHTML += "PASS\n"; -else - result.innerHTML += "FAIL: The import should be allowed.\n"; - -if (window.nonSelfImport.import == null) - result.innerHTML += "PASS\n"; -else - result.innerHTML += "FAIL: The import should be blocked.\n"; -</script> -</body> -</html>
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/csp-block-import.html b/third_party/blink/web_tests/http/tests/htmlimports/csp-block-import.html deleted file mode 100644 index 21ed78bd..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/csp-block-import.html +++ /dev/null
@@ -1,19 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<meta http-equiv="Content-Security-Policy" content="script-src 'unsafe-inline'"> -<link id="target" rel="import" href="resources/hello.html"> -</head> -<body> -<pre id="result"></pre> -<script> -if (window.testRunner) - testRunner.dumpAsText(); - -if (window.target.import == null) - result.innerHTML = "PASS\n"; -else - result.innerHTML = "FAIL: The import should be blocked.\n"; -</script> -</body> -</html>
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/csp-import-block-but-domain-expected.txt b/third_party/blink/web_tests/http/tests/htmlimports/csp-import-block-but-domain-expected.txt deleted file mode 100644 index af86e6d..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/csp-import-block-but-domain-expected.txt +++ /dev/null
@@ -1,14 +0,0 @@ -CONSOLE WARNING: line 5: HTML Imports is deprecated and will be removed in M80, around February 2020. Please use ES modules instead. See https://www.chromestatus.com/features/5144752345317376 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -CONSOLE ERROR: Refused to load the script 'http://127.0.0.1:8000/htmlimports/resources/external-script.js' because it violates the following Content Security Policy directive: "script-src http://localhost:8000". Note that 'script-src-elem' was not explicitly set, so 'script-src' is used as a fallback. - -CONSOLE ERROR: line 2: Uncaught EvalError: Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: "script-src http://localhost:8000". - -CONSOLE ERROR: line 6: Refused to execute inline script because it violates the following Content Security Policy directive: "script-src http://localhost:8000". Either the 'unsafe-inline' keyword, a hash ('sha256-wnLyUqsXhUuQ5NVNJO+JjNabqB1yo9OPLLJWPopauN0='), or a nonce ('nonce-...') is required to enable inline execution. - -CONSOLE MESSAGE: line 7: PASS -CONSOLE MESSAGE: line 7: PASS -CONSOLE MESSAGE: line 7: PASS -CONSOLE MESSAGE: line 7: PASS -CONSOLE MESSAGE: line 7: PASS -CONSOLE MESSAGE: line 7: PASS -
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/csp-import-block-but-domain-nested-expected.txt b/third_party/blink/web_tests/http/tests/htmlimports/csp-import-block-but-domain-nested-expected.txt deleted file mode 100644 index af86e6d..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/csp-import-block-but-domain-nested-expected.txt +++ /dev/null
@@ -1,14 +0,0 @@ -CONSOLE WARNING: line 5: HTML Imports is deprecated and will be removed in M80, around February 2020. Please use ES modules instead. See https://www.chromestatus.com/features/5144752345317376 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -CONSOLE ERROR: Refused to load the script 'http://127.0.0.1:8000/htmlimports/resources/external-script.js' because it violates the following Content Security Policy directive: "script-src http://localhost:8000". Note that 'script-src-elem' was not explicitly set, so 'script-src' is used as a fallback. - -CONSOLE ERROR: line 2: Uncaught EvalError: Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: "script-src http://localhost:8000". - -CONSOLE ERROR: line 6: Refused to execute inline script because it violates the following Content Security Policy directive: "script-src http://localhost:8000". Either the 'unsafe-inline' keyword, a hash ('sha256-wnLyUqsXhUuQ5NVNJO+JjNabqB1yo9OPLLJWPopauN0='), or a nonce ('nonce-...') is required to enable inline execution. - -CONSOLE MESSAGE: line 7: PASS -CONSOLE MESSAGE: line 7: PASS -CONSOLE MESSAGE: line 7: PASS -CONSOLE MESSAGE: line 7: PASS -CONSOLE MESSAGE: line 7: PASS -CONSOLE MESSAGE: line 7: PASS -
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/csp-import-block-but-domain-nested.html b/third_party/blink/web_tests/http/tests/htmlimports/csp-import-block-but-domain-nested.html deleted file mode 100644 index 7600ac4..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/csp-import-block-but-domain-nested.html +++ /dev/null
@@ -1,10 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<meta http-equiv="Content-Security-Policy" content="script-src http://localhost:8000"> -<link id="target" rel="import" href="http://localhost:8000/htmlimports/resources/child-having-domain-policy.cgi"> -</head> -<body> -<script src="http://localhost:8000/htmlimports/resources/csp-import-block-but-domain.js"></script> -</body> -</html>
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/csp-import-block-but-domain.html b/third_party/blink/web_tests/http/tests/htmlimports/csp-import-block-but-domain.html deleted file mode 100644 index 42e48bc..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/csp-import-block-but-domain.html +++ /dev/null
@@ -1,10 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<meta http-equiv="Content-Security-Policy" content="script-src http://localhost:8000"> -<link id="target" rel="import" href="http://localhost:8000/htmlimports/resources/having-domain-policy.cgi"> -</head> -<body> -<script src="http://localhost:8000/htmlimports/resources/csp-import-block-but-domain.js"></script> -</body> -</html>
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/csp-import-block-but-nonce-expected.txt b/third_party/blink/web_tests/http/tests/htmlimports/csp-import-block-but-nonce-expected.txt deleted file mode 100644 index f58a6113..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/csp-import-block-but-nonce-expected.txt +++ /dev/null
@@ -1,18 +0,0 @@ -CONSOLE WARNING: line 5: HTML Imports is deprecated and will be removed in M80, around February 2020. Please use ES modules instead. See https://www.chromestatus.com/features/5144752345317376 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -CONSOLE ERROR: Refused to load the script 'http://localhost:8080/htmlimports/resources/external-script.js' because it violates the following Content Security Policy directive: "script-src http://localhost:8000 'nonce-hello'". Note that 'script-src-elem' was not explicitly set, so 'script-src' is used as a fallback. - -CONSOLE ERROR: line 4: Uncaught EvalError: Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: "script-src http://localhost:8000 'nonce-hello'". - -CONSOLE ERROR: line 6: Refused to execute inline script because it violates the following Content Security Policy directive: "script-src http://localhost:8000 'nonce-hello'". Either the 'unsafe-inline' keyword, a hash ('sha256-wnLyUqsXhUuQ5NVNJO+JjNabqB1yo9OPLLJWPopauN0='), or a nonce ('nonce-...') is required to enable inline execution. - -CONSOLE ERROR: line 13: Uncaught EvalError: Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: "script-src http://localhost:8000 'nonce-hello'". - -CONSOLE MESSAGE: line 12: PASS -CONSOLE MESSAGE: line 12: PASS -CONSOLE MESSAGE: line 12: PASS -CONSOLE MESSAGE: line 12: PASS -CONSOLE MESSAGE: line 12: PASS -CONSOLE MESSAGE: line 12: PASS -CONSOLE MESSAGE: line 12: PASS -CONSOLE MESSAGE: line 12: PASS -
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/csp-import-block-but-nonce-nested-expected.txt b/third_party/blink/web_tests/http/tests/htmlimports/csp-import-block-but-nonce-nested-expected.txt deleted file mode 100644 index f58a6113..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/csp-import-block-but-nonce-nested-expected.txt +++ /dev/null
@@ -1,18 +0,0 @@ -CONSOLE WARNING: line 5: HTML Imports is deprecated and will be removed in M80, around February 2020. Please use ES modules instead. See https://www.chromestatus.com/features/5144752345317376 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -CONSOLE ERROR: Refused to load the script 'http://localhost:8080/htmlimports/resources/external-script.js' because it violates the following Content Security Policy directive: "script-src http://localhost:8000 'nonce-hello'". Note that 'script-src-elem' was not explicitly set, so 'script-src' is used as a fallback. - -CONSOLE ERROR: line 4: Uncaught EvalError: Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: "script-src http://localhost:8000 'nonce-hello'". - -CONSOLE ERROR: line 6: Refused to execute inline script because it violates the following Content Security Policy directive: "script-src http://localhost:8000 'nonce-hello'". Either the 'unsafe-inline' keyword, a hash ('sha256-wnLyUqsXhUuQ5NVNJO+JjNabqB1yo9OPLLJWPopauN0='), or a nonce ('nonce-...') is required to enable inline execution. - -CONSOLE ERROR: line 13: Uncaught EvalError: Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: "script-src http://localhost:8000 'nonce-hello'". - -CONSOLE MESSAGE: line 12: PASS -CONSOLE MESSAGE: line 12: PASS -CONSOLE MESSAGE: line 12: PASS -CONSOLE MESSAGE: line 12: PASS -CONSOLE MESSAGE: line 12: PASS -CONSOLE MESSAGE: line 12: PASS -CONSOLE MESSAGE: line 12: PASS -CONSOLE MESSAGE: line 12: PASS -
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/csp-import-block-but-nonce-nested.html b/third_party/blink/web_tests/http/tests/htmlimports/csp-import-block-but-nonce-nested.html deleted file mode 100644 index e7e9461f..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/csp-import-block-but-nonce-nested.html +++ /dev/null
@@ -1,30 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<meta http-equiv="Content-Security-Policy" content="script-src http://localhost:8000 'nonce-hello'"> -<link id="target" rel="import" href="http://localhost:8000/htmlimports/resources/child-having-nonce-policy.cgi"> -</head> -<body> -<script nonce="hello"> -function test(actual, expected, message) -{ - if (actual === expected) - console.log("PASS"); - else - console.log("FAIL:" + message); -} - -if (window.testRunner) - testRunner.dumpAsText(); - -test(document.inlineScriptHasRun, undefined, "document.inlineScriptHasRun"); -test(document.externalScriptHasRun, undefined, "document.externalScriptHasRun"); -test(document.externalScriptWithNonceHasRun, true, "document.externalScriptWithNonceHasRun"); -test(document.inlineScriptWithNonceHasRun, true, "document.inlineScriptWithNonceHasRun"); -test(document.evalFromInlineHasRun, undefined, "document.evalFromInlineHasRun"); -test(document.evalFromExternalHasRun, undefined, "document.evalFromExternalHasRun"); -test(document.evalFromInlineWithNonceHasRun, undefined, "document.evalFromInlineWithNonceHasRun"); -test(document.evalFromExternalWithNonceHasRun, undefined, "document.evalFromExternalWithNonceHasRun"); -</script> -</body> -</html>
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/csp-import-block-but-nonce.html b/third_party/blink/web_tests/http/tests/htmlimports/csp-import-block-but-nonce.html deleted file mode 100644 index 18e6eac..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/csp-import-block-but-nonce.html +++ /dev/null
@@ -1,30 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<meta http-equiv="Content-Security-Policy" content="script-src http://localhost:8000 'nonce-hello'"> -<link id="target" rel="import" href="http://localhost:8000/htmlimports/resources/having-nonce-policy.cgi"> -</head> -<body> -<script nonce="hello"> -function test(actual, expected, message) -{ - if (actual === expected) - console.log("PASS"); - else - console.log("FAIL:" + message); -} - -if (window.testRunner) - testRunner.dumpAsText(); - -test(document.inlineScriptHasRun, undefined, "document.inlineScriptHasRun"); -test(document.externalScriptHasRun, undefined, "document.externalScriptHasRun"); -test(document.externalScriptWithNonceHasRun, true, "document.externalScriptWithNonceHasRun"); -test(document.inlineScriptWithNonceHasRun, true, "document.inlineScriptWithNonceHasRun"); -test(document.evalFromInlineHasRun, undefined, "document.evalFromInlineHasRun"); -test(document.evalFromExternalHasRun, undefined, "document.evalFromExternalHasRun"); -test(document.evalFromInlineWithNonceHasRun, undefined, "document.evalFromInlineWithNonceHasRun"); -test(document.evalFromExternalWithNonceHasRun, undefined, "document.evalFromExternalWithNonceHasRun"); -</script> -</body> -</html>
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/csp-import-block-but-self-expected.txt b/third_party/blink/web_tests/http/tests/htmlimports/csp-import-block-but-self-expected.txt deleted file mode 100644 index 965a3785..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/csp-import-block-but-self-expected.txt +++ /dev/null
@@ -1,14 +0,0 @@ -CONSOLE WARNING: line 5: HTML Imports is deprecated and will be removed in M80, around February 2020. Please use ES modules instead. See https://www.chromestatus.com/features/5144752345317376 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -CONSOLE ERROR: line 2: Uncaught EvalError: Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: "script-src 'self'". - -CONSOLE ERROR: Refused to load the script 'http://localhost:8000//htmlimports/resources/cors-js.cgi' because it violates the following Content Security Policy directive: "script-src 'self'". Note that 'script-src-elem' was not explicitly set, so 'script-src' is used as a fallback. - -CONSOLE ERROR: line 6: Refused to execute inline script because it violates the following Content Security Policy directive: "script-src 'self'". Either the 'unsafe-inline' keyword, a hash ('sha256-wnLyUqsXhUuQ5NVNJO+JjNabqB1yo9OPLLJWPopauN0='), or a nonce ('nonce-...') is required to enable inline execution. - -CONSOLE MESSAGE: line 4: PASS -CONSOLE MESSAGE: line 4: PASS -CONSOLE MESSAGE: line 4: PASS -CONSOLE MESSAGE: line 4: PASS -CONSOLE MESSAGE: line 4: PASS -CONSOLE MESSAGE: line 4: PASS -
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/csp-import-block-but-self-nested-expected.txt b/third_party/blink/web_tests/http/tests/htmlimports/csp-import-block-but-self-nested-expected.txt deleted file mode 100644 index 965a3785..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/csp-import-block-but-self-nested-expected.txt +++ /dev/null
@@ -1,14 +0,0 @@ -CONSOLE WARNING: line 5: HTML Imports is deprecated and will be removed in M80, around February 2020. Please use ES modules instead. See https://www.chromestatus.com/features/5144752345317376 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -CONSOLE ERROR: line 2: Uncaught EvalError: Refused to evaluate a string as JavaScript because 'unsafe-eval' is not an allowed source of script in the following Content Security Policy directive: "script-src 'self'". - -CONSOLE ERROR: Refused to load the script 'http://localhost:8000//htmlimports/resources/cors-js.cgi' because it violates the following Content Security Policy directive: "script-src 'self'". Note that 'script-src-elem' was not explicitly set, so 'script-src' is used as a fallback. - -CONSOLE ERROR: line 6: Refused to execute inline script because it violates the following Content Security Policy directive: "script-src 'self'". Either the 'unsafe-inline' keyword, a hash ('sha256-wnLyUqsXhUuQ5NVNJO+JjNabqB1yo9OPLLJWPopauN0='), or a nonce ('nonce-...') is required to enable inline execution. - -CONSOLE MESSAGE: line 4: PASS -CONSOLE MESSAGE: line 4: PASS -CONSOLE MESSAGE: line 4: PASS -CONSOLE MESSAGE: line 4: PASS -CONSOLE MESSAGE: line 4: PASS -CONSOLE MESSAGE: line 4: PASS -
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/csp-import-block-but-self-nested.html b/third_party/blink/web_tests/http/tests/htmlimports/csp-import-block-but-self-nested.html deleted file mode 100644 index cc9f0996..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/csp-import-block-but-self-nested.html +++ /dev/null
@@ -1,10 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<meta http-equiv="Content-Security-Policy" content="script-src 'self'"> -<link id="target" rel="import" href="resources/child-having-self-policy.html"> -</head> -<body> -<script src="resources/csp-import-block-but-self.js"></script> -</body> -</html>
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/csp-import-block-but-self.html b/third_party/blink/web_tests/http/tests/htmlimports/csp-import-block-but-self.html deleted file mode 100644 index 67f77ec..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/csp-import-block-but-self.html +++ /dev/null
@@ -1,10 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<meta http-equiv="Content-Security-Policy" content="script-src 'self'"> -<link id="target" rel="import" href="resources/having-self-policy.html"> -</head> -<body> -<script src="resources/csp-import-block-but-self.js"></script> -</body> -</html>
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/csp-in-imports-expected.txt b/third_party/blink/web_tests/http/tests/htmlimports/csp-in-imports-expected.txt deleted file mode 100644 index ebebe75..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/csp-in-imports-expected.txt +++ /dev/null
@@ -1,4 +0,0 @@ -CONSOLE WARNING: line 4: HTML Imports is deprecated and will be removed in M80, around February 2020. Please use ES modules instead. See https://www.chromestatus.com/features/5144752345317376 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -PASS -PASS -
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/csp-in-imports.html b/third_party/blink/web_tests/http/tests/htmlimports/csp-in-imports.html deleted file mode 100644 index 7e8b91c..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/csp-in-imports.html +++ /dev/null
@@ -1,25 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<link id="havingDirectiveInMeta" rel="import" href="resources/having-csp-directive.html"> -<link id="havingDirectiveInHTTP" rel="import" href="resources/csp-blocking.cgi"> -</head> -<body> -<pre id="result"></pre> -<script> -if (window.testRunner) - testRunner.dumpAsText(); - -if (window.havingDirectiveInMeta.import.querySelector("#shouldBeBlocked").import != null) - result.innerHTML += "PASS\n"; -else - result.innerHTML += "FAIL: The import should not be blocked.\n"; - -if (window.havingDirectiveInHTTP.import.querySelector("#shouldBeBlocked").import != null) - result.innerHTML += "PASS\n"; -else - result.innerHTML += "FAIL: The import should not be blocked.\n"; - -</script> -</body> -</html>
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/csp-not-block-import-in-import-expected.txt b/third_party/blink/web_tests/http/tests/htmlimports/csp-not-block-import-in-import-expected.txt deleted file mode 100644 index 0b14f07..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/csp-not-block-import-in-import-expected.txt +++ /dev/null
@@ -1,5 +0,0 @@ -CONSOLE WARNING: line 5: HTML Imports is deprecated and will be removed in M80, around February 2020. Please use ES modules instead. See https://www.chromestatus.com/features/5144752345317376 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -CONSOLE ERROR: Refused to load the script 'http://localhost:8000/htmlimports/resources/cors-basic.cgi' because it violates the following Content Security Policy directive: "script-src 'self' 'unsafe-inline'". Note that 'script-src-elem' was not explicitly set, so 'script-src' is used as a fallback. - -PASS -
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/csp-not-block-import-in-import.html b/third_party/blink/web_tests/http/tests/htmlimports/csp-not-block-import-in-import.html deleted file mode 100644 index 6c88fa9..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/csp-not-block-import-in-import.html +++ /dev/null
@@ -1,20 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<meta http-equiv="Content-Security-Policy" content="script-src 'self' 'unsafe-inline'"> -<link id="target" rel="import" href="resources/importing-cors.html"> -</head> -<body> -<pre id="result"></pre> -<!-- FIXME: The test should be renamed to csp-block-import-in-import.html --> -<script> -if (window.testRunner) - testRunner.dumpAsText(); - -if (window.target.import.querySelector('#cors').import == null) - result.innerHTML = "PASS\n"; -else - result.innerHTML = "FAIL: The import should be blocked.\n"; -</script> -</body> -</html>
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/document-method-changes.html b/third_party/blink/web_tests/http/tests/htmlimports/document-method-changes.html deleted file mode 100644 index 03f44626..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/document-method-changes.html +++ /dev/null
@@ -1,22 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<title>The import attribute</title> -<link rel="help" href="http://w3c.github.io/webcomponents/spec/imports/#interface-import"> -<script src="/resources/testharness.js"></script> -<script src="/resources/testharnessreport.js"></script> - -<link id="importLink" rel="import" href="resources/body-only.html"> -<link rel="import" href="resources/test-in-import.html"> -</head> -<body> -<div id="log"></div> -<script> -test(function() { - assert_throws_dom('INVALID_STATE_ERR', function() { importLink.import.open(); }, 'document.open()'); - assert_throws_dom('INVALID_STATE_ERR', function() { importLink.import.write('Hello'); }, 'document.write()'); - assert_throws_dom('INVALID_STATE_ERR', function() { importLink.import.open(); }, 'document.close()'); -}, 'Throws an InvalidStateError exception if the Document is an import: From the master document'); -</script> -</body> -</html>
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/encoding-expected.txt b/third_party/blink/web_tests/http/tests/htmlimports/encoding-expected.txt deleted file mode 100644 index 6c488e2..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/encoding-expected.txt +++ /dev/null
@@ -1,13 +0,0 @@ -CONSOLE WARNING: line 4: HTML Imports is deprecated and will be removed in M80, around February 2020. Please use ES modules instead. See https://www.chromestatus.com/features/5144752345317376 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -Test that UTF-8 decoding is applied appropriately to imports - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - -Default encoding should be UTF-8... -PASS links[0].import.characterSet is "UTF-8" -And Content-Type headers should be ignored... -PASS links[1].import.characterSet is "UTF-8" -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/encoding.html b/third_party/blink/web_tests/http/tests/htmlimports/encoding.html deleted file mode 100644 index a096a1f1..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/encoding.html +++ /dev/null
@@ -1,20 +0,0 @@ -<!DOCTYPE html> -<head> - <script src="/js-test-resources/js-test.js"></script> - <link rel="import" href="resources/no-encoding.cgi"> - <link rel="import" href="resources/http-encoding.cgi"> -</head> -<body> -<script> -description("Test that UTF-8 decoding is applied appropriately to imports"); -jsTestIsAsync = true; -window.onload = function() { - links = document.querySelectorAll('link[rel=import]'); - debug("Default encoding should be UTF-8..."); - shouldBeEqualToString("links[0].import.characterSet", "UTF-8"); - debug("And Content-Type headers should be ignored..."); - shouldBeEqualToString("links[1].import.characterSet", "UTF-8"); - finishJSTest(); -}; -</script> -</body>
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/import-and-script-module-external.html b/third_party/blink/web_tests/http/tests/htmlimports/import-and-script-module-external.html deleted file mode 100644 index d965bc7..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/import-and-script-module-external.html +++ /dev/null
@@ -1,10 +0,0 @@ -<!DOCTYPE html> -<script src="../../../resources/testharness.js"></script> -<script src="../../../resources/testharnessreport.js"></script> -<link rel="import" href="resources/module-script-external.html"> -<script> -test(() => { - assert_true(window.runExternalScript); -}, "External module script ran in HTML import."); -</script> -
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/import-and-script-module-inline.html b/third_party/blink/web_tests/http/tests/htmlimports/import-and-script-module-inline.html deleted file mode 100644 index 2b6ffff..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/import-and-script-module-inline.html +++ /dev/null
@@ -1,9 +0,0 @@ -<!DOCTYPE html> -<script src="../../../resources/testharness.js"></script> -<script src="../../../resources/testharnessreport.js"></script> -<link rel="import" href="resources/module-script-inline.html"> -<script> -test(() => { - assert_true(window.runInlineScript); -}, "Inline module script ran in HTML import."); -</script>
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/import-async-grandchild-not-child.html b/third_party/blink/web_tests/http/tests/htmlimports/import-async-grandchild-not-child.html deleted file mode 100644 index 31c2f9ccf..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/import-async-grandchild-not-child.html +++ /dev/null
@@ -1,35 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script src="../../../resources/testharness.js"></script> -<script src="../../../resources/testharnessreport.js"></script> -<script src="resources/async-block-helper.js"></script> -<script> -var test = async_test('With the async attribute, link element don\'t block the script execution of following imports.'); - -function grandchildReady() { - test.step(function() { - assert_true(window.masterScriptExecuted, 'A script in master is executed wihtout waiting slow script.'); - assert_true(isImportLoaded('has-slow-child-async.html'), 'A script (in child) is executed wihtout waiting slow script.'); - assert_true(isImportLoaded('has-slow-script.html'), 'A script in slow aync import is eventually exeuted.'); - test.done(); - }); -} - -function notifyImportLoaded(name) { - if (name == "has-slow-script.html") - grandchildReady(); -} - -</script> -<link id="asyncLink" rel="import" href="resources/has-slow-child-async.html"> -<script> -test.step(function() { - assert_false(isImportLoaded('has-slow-script.html'), 'A script in async import (in grandchild) has not to be excuted yet.'); - assert_true(isImportLoaded('has-slow-child-async.html'), 'A script in sync import (in child) has not to be excuted yet.'); - window.masterScriptExecuted = true; -}); -</script> -</head> -<body></body> -</html>
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/import-async-grandchild.html b/third_party/blink/web_tests/http/tests/htmlimports/import-async-grandchild.html deleted file mode 100644 index ba8e820..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/import-async-grandchild.html +++ /dev/null
@@ -1,49 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script src="../../../resources/testharness.js"></script> -<script src="../../../resources/testharnessreport.js"></script> -<script src="resources/async-block-helper.js"></script> -<script> -var test = async_test('With the async attribute, link element don\'t block the script execution of following imports.'); - -function childReady() { - test.step(function() { - assert_true(window.masterScriptExecuted, 'A script in master is executed wihtout waiting slow script.'); - assert_true(isImportLoaded('has-slow-child-async.html'), 'A script (in child) is executed wihtout waiting slow script.'); - assert_false(isImportLoaded('has-slow-script.html'), 'A script in slow aync import has not to be excuted yet.'); - }); -} - -function grandchildReady() { - test.step(function() { - assert_true(window.masterScriptExecuted, 'A script in master is executed wihtout waiting slow script.'); - assert_true(isImportLoaded('has-slow-child-async.html'), 'A script (in child) is executed wihtout waiting slow script.'); - assert_true(isImportLoaded('has-slow-script.html'), 'A script in slow aync import is eventually exeuted.'); - test.done(); - }); -} - -function notifyImportLoaded(name) { - switch (name) { - case "has-slow-child-async.html": - childReady(); - break; - case "has-slow-script.html": - grandchildReady(); - break; - } -} - -</script> -<link id="asyncLink" async rel="import" href="resources/has-slow-child-async.html"> -<script> -test.step(function() { - assert_false(isImportLoaded('has-slow-script.html'), 'A script in async import (in grandchild) has not to be excuted yet.'); - assert_false(isImportLoaded('has-slow-child-async.html'), 'A script in sync import (in child) has not to be excuted yet.'); - window.masterScriptExecuted = true; -}); -</script> -</head> -<body></body> -</html>
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/import-async-previous-async.html b/third_party/blink/web_tests/http/tests/htmlimports/import-async-previous-async.html deleted file mode 100644 index fcdd777..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/import-async-previous-async.html +++ /dev/null
@@ -1,22 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script src="../../../resources/testharness.js"></script> -<script src="../../../resources/testharnessreport.js"></script> -<script src="resources/async-block-helper.js"></script> -<script> -var test = async_test('With the async attribute, link element don\'t block the script execution of following imports.'); - -function ready() { - test.step(function() { - assert_false(isImportLoaded('has-slow-script.html'), 'A script in sync import has not to be excuted yet.'); - assert_true(isImportLoaded('not-slow.html'), 'A script in following import is executed wihtout waiting slow script.'); - test.done(); - }); -} -</script> -<link id="asyncLink" async rel="import" href="resources/has-slow-script.html"> -<link id="followingLink" async rel="import" href="resources/not-slow.html" onload="ready()"> -</head> -<body></body> -</html>
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/import-async-previous.html b/third_party/blink/web_tests/http/tests/htmlimports/import-async-previous.html deleted file mode 100644 index 174652f..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/import-async-previous.html +++ /dev/null
@@ -1,29 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script src="../../../resources/testharness.js"></script> -<script src="../../../resources/testharnessreport.js"></script> -<script src="resources/async-block-helper.js"></script> -<script> -var test = async_test('With the async attribute, link element don\'t block the script execution of following imports.'); - -function readySync() { - test.step(function() { - assert_false(isImportLoaded('has-slow-script.html'), 'A script in sync import has not to be excuted yet.'); - assert_true(isImportLoaded('not-slow.html'), 'A script in following import is executed wihtout waiting slow script.'); - }); -} - -function readyAsync() { - test.step(function() { - assert_true(isImportLoaded('has-slow-script.html'), 'A script in sync import has not to be excuted yet.'); - assert_true(isImportLoaded('not-slow.html'), 'A script in following import is executed wihtout waiting slow script.'); - test.done(); - }); -} -</script> -<link async rel="import" href="resources/has-slow-script.html" onload="readyAsync()"> -<link rel="import" href="resources/not-slow.html" onload="readySync()"> -</head> -<body></body> -</html>
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/import-async-sync-grandchild.html b/third_party/blink/web_tests/http/tests/htmlimports/import-async-sync-grandchild.html deleted file mode 100644 index c84a2d6..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/import-async-sync-grandchild.html +++ /dev/null
@@ -1,31 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script src="../../../resources/testharness.js"></script> -<script src="../../../resources/testharnessreport.js"></script> -<script src="resources/async-block-helper.js"></script> -<script> -var test = async_test('Even with the async attribute, its subimports are loaded in order.'); - -function childReady() { - test.step(function() { - assert_true(window.masterScriptExecuted, 'A script in master is executed wihtout waiting slow script.'); - assert_true(isImportLoaded('has-slow-script.html'), 'A script in async import (in grandchild) has not to be excuted yet.'); - assert_true(isImportLoaded('not-slow.html'), 'A script in async import (in grandchild) has not to be excuted yet.'); - assert_true(isImportLoaded('has-sync-children.html'), 'A script in sync import (in child) has not to be excuted yet.'); - test.done(); - }); -} - -</script> -<link id="asyncLink" async rel="import" href="resources/has-sync-children.html" onload="childReady()"> -<script> -test.step(function() { - assert_false(isImportLoaded('has-slow-script.html'), 'A script in async import (in grandchild) has not to be excuted yet.'); - assert_false(isImportLoaded('has-sync-children.html'), 'A script in sync import (in child) has not to be excuted yet.'); - window.masterScriptExecuted = true; -}); -</script> -</head> -<body></body> -</html>
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/import-async.html b/third_party/blink/web_tests/http/tests/htmlimports/import-async.html deleted file mode 100644 index 66fffb6..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/import-async.html +++ /dev/null
@@ -1,26 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script src="../../../resources/testharness.js"></script> -<script src="../../../resources/testharnessreport.js"></script> -<link id="target" async rel="import" href="../../../resources/redirect.php?delay=100&url=../htmlimports/resources/hello.html"> -</head> -<body> -<script> -(function() { -var test = async_test('With the async attribute, link element don\'t block the script execution.'); - -test.step(function() { - assert_true(window.target.import === null, "Script goes without waiting the link loaded"); -}); - -window.target.onload = function() { - test.step(function() { - assert_true(window.target.import instanceof HTMLDocument, "Ensureing that the import being loaded eventually."); - test.done(); - }); -}; -})(); -</script> -</body> -</html>
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/import-attribute.html b/third_party/blink/web_tests/http/tests/htmlimports/import-attribute.html deleted file mode 100644 index 41b63751..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/import-attribute.html +++ /dev/null
@@ -1,43 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<title>The import attribute</title> -<link rel="help" href="http://w3c.github.io/webcomponents/spec/imports/#interface-import"> -<script src="/resources/testharness.js"></script> -<script src="/resources/testharnessreport.js"></script> - -<link id="nonImportLink" rel="stylesheet" href="resources/hello.css"> -<link id="goOutFromDocument" rel="import" href="resources/body-only-0.html"> -<link id="importLink" rel="import" href="resources/body-only-1.html"> -<link id="anotherImportLink" rel="import" href="resources/body-only-2.html"> - -</head> -<body> -<div id="log"></div> -<script> -test(function() { - assert_equals(nonImportLink.import, null); -}, 'The import attribute must return null if the link does not represent an import.'); - -test(function() { - var link = goOutFromDocument; - assert_true(link.import != null); - document.head.removeChild(link); - assert_equals(link.import, null); -}, 'The import attribute must return null if the link element is not in a Document.'); - -test(function() { - assert_equals(importLink.import.body.id, 'body-only-1'); -}, 'The attribute must return the imported document for the import.'); - -test(function() { - var importA = importLink.import; - var importB = document.querySelector('#importLink').import; - var anotherImport = document.querySelector('#anotherImportLink').import; - assert_true(importA === importB); - assert_true(importA !== anotherImport); -}, 'The same object must be returned each time.'); -</script> -</body> -</html> -
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/import-blocking-child-blocks-child-expected.txt b/third_party/blink/web_tests/http/tests/htmlimports/import-blocking-child-blocks-child-expected.txt deleted file mode 100644 index 4be4514d..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/import-blocking-child-blocks-child-expected.txt +++ /dev/null
@@ -1,6 +0,0 @@ -CONSOLE WARNING: line 5: HTML Imports is deprecated and will be removed in M80, around February 2020. Please use ES modules instead. See https://www.chromestatus.com/features/5144752345317376 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -PASS blockingScriptHasRun is true -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/import-blocking-child-blocks-child.html b/third_party/blink/web_tests/http/tests/htmlimports/import-blocking-child-blocks-child.html deleted file mode 100644 index b9623a5..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/import-blocking-child-blocks-child.html +++ /dev/null
@@ -1,11 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script src="/js-test-resources/js-test.js"></script> -<link id="leaf" rel="import" href="resources/import-blocking-child-1.html"> -<link id="leaf" rel="import" href="resources/import-blocking-child-2.html"> -</head> -<body> -<script src="resources/empty-script.js"></script> -</body> -</html>
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/import-blocking-child-expected.txt b/third_party/blink/web_tests/http/tests/htmlimports/import-blocking-child-expected.txt deleted file mode 100644 index 4be4514d..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/import-blocking-child-expected.txt +++ /dev/null
@@ -1,6 +0,0 @@ -CONSOLE WARNING: line 5: HTML Imports is deprecated and will be removed in M80, around February 2020. Please use ES modules instead. See https://www.chromestatus.com/features/5144752345317376 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -PASS blockingScriptHasRun is true -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/import-blocking-child.html b/third_party/blink/web_tests/http/tests/htmlimports/import-blocking-child.html deleted file mode 100644 index e6c7867..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/import-blocking-child.html +++ /dev/null
@@ -1,12 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script src="/js-test-resources/js-test.js"></script> -<link id="leaf" rel="import" href="resources/import-blocking-child-1.html"> -</head> -<body> -<script> -shouldBeTrue("blockingScriptHasRun"); -</script> -</body> -</html>
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/import-blocking-nested-child-blocks-child-expected.txt b/third_party/blink/web_tests/http/tests/htmlimports/import-blocking-nested-child-blocks-child-expected.txt deleted file mode 100644 index 4be4514d..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/import-blocking-nested-child-blocks-child-expected.txt +++ /dev/null
@@ -1,6 +0,0 @@ -CONSOLE WARNING: line 5: HTML Imports is deprecated and will be removed in M80, around February 2020. Please use ES modules instead. See https://www.chromestatus.com/features/5144752345317376 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -PASS blockingScriptHasRun is true -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/import-blocking-nested-child-blocks-child.html b/third_party/blink/web_tests/http/tests/htmlimports/import-blocking-nested-child-blocks-child.html deleted file mode 100644 index 055d217..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/import-blocking-nested-child-blocks-child.html +++ /dev/null
@@ -1,11 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script src="/js-test-resources/js-test.js"></script> -<link id="leaf" rel="import" href="resources/import-blocking-nested-child-1.html"> -<link id="leaf" rel="import" href="resources/import-blocking-child-2.html"> -</head> -<body> -<script src="resources/empty-script.js"></script> -</body> -</html>
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/import-blocking-nested-child-blocks-nested-child-expected.txt b/third_party/blink/web_tests/http/tests/htmlimports/import-blocking-nested-child-blocks-nested-child-expected.txt deleted file mode 100644 index 4be4514d..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/import-blocking-nested-child-blocks-nested-child-expected.txt +++ /dev/null
@@ -1,6 +0,0 @@ -CONSOLE WARNING: line 5: HTML Imports is deprecated and will be removed in M80, around February 2020. Please use ES modules instead. See https://www.chromestatus.com/features/5144752345317376 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -PASS blockingScriptHasRun is true -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/import-blocking-nested-child-blocks-nested-child.html b/third_party/blink/web_tests/http/tests/htmlimports/import-blocking-nested-child-blocks-nested-child.html deleted file mode 100644 index 16301dc..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/import-blocking-nested-child-blocks-nested-child.html +++ /dev/null
@@ -1,11 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script src="/js-test-resources/js-test.js"></script> -<link id="leaf" rel="import" href="resources/import-blocking-nested-child-1.html"> -<link id="leaf" rel="import" href="resources/import-blocking-nested-child-2.html"> -</head> -<body> -<script src="resources/empty-script.js"></script> -</body> -</html>
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/import-blocking-nested-child-expected.txt b/third_party/blink/web_tests/http/tests/htmlimports/import-blocking-nested-child-expected.txt deleted file mode 100644 index 4be4514d..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/import-blocking-nested-child-expected.txt +++ /dev/null
@@ -1,6 +0,0 @@ -CONSOLE WARNING: line 5: HTML Imports is deprecated and will be removed in M80, around February 2020. Please use ES modules instead. See https://www.chromestatus.com/features/5144752345317376 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -PASS blockingScriptHasRun is true -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/import-blocking-nested-child.html b/third_party/blink/web_tests/http/tests/htmlimports/import-blocking-nested-child.html deleted file mode 100644 index 03b35e4..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/import-blocking-nested-child.html +++ /dev/null
@@ -1,12 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script src="/js-test-resources/js-test.js"></script> -<link id="leaf" rel="import" href="resources/import-blocking-nested-child-1.html"> -</head> -<body> -<script> -shouldBeTrue("blockingScriptHasRun"); -</script> -</body> -</html>
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/import-cors-credentials-expected.txt b/third_party/blink/web_tests/http/tests/htmlimports/import-cors-credentials-expected.txt deleted file mode 100644 index b9511d5..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/import-cors-credentials-expected.txt +++ /dev/null
@@ -1,9 +0,0 @@ -CONSOLE WARNING: line 3: HTML Imports is deprecated and will be removed in M80, around February 2020. Please use ES modules instead. See https://www.chromestatus.com/features/5144752345317376 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -PASS sameOrigin.import.body.innerHTML is "PASS" -PASS crossOrigin.import.body.innerHTML is "PASS" -PASS fromSameToCrossOrigin.import.getElementById('crossOrigin').import.body.innerHTML is "PASS" -PASS fromCrossToSameOrigin.import.getElementById('sameOrigin').import.body.innerHTML is "PASS" -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/import-cors-credentials.html b/third_party/blink/web_tests/http/tests/htmlimports/import-cors-credentials.html deleted file mode 100644 index bba700a1a..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/import-cors-credentials.html +++ /dev/null
@@ -1,10 +0,0 @@ -<!DOCTYPE html> -<script> -if (window.testRunner) { - testRunner.dumpAsText(); - testRunner.waitUntilDone(); -} - -document.cookie = "key=HelloCredentials"; -window.location = "resources/import-cors-credentials-body.html"; -</script>
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/import-custom-element-order.html b/third_party/blink/web_tests/http/tests/htmlimports/import-custom-element-order.html deleted file mode 100644 index fcb0b4a..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/import-custom-element-order.html +++ /dev/null
@@ -1,37 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script src="../../../resources/testharness.js"></script> -<script src="../../../resources/testharnessreport.js"></script> -<script src="resources/import-custom-element-helper.js"></script> -<script> - - -var Hello = registerTestingCustomElement('x-hello'); -var numberOfLinks = 2; -var t1 = async_test('Custom elements in async imports wait preceeding sync import before upgraded.'); -var t2 = async_test('Custom elements in async imports wait preceeding sync import before resolved.'); - -var latch = new ImportTestLatch(function() { - window.setTimeout(function() { - t1.step(function() { - assert_array_equals(['hello-slow', 'hello-2', 'hello-1'], Hello.ids); - t1.done(); - }); - - t2.step(function() { - var Bye = registerTestingCustomElement('x-bye'); - assert_array_equals(['bye-slow', 'bye-2', 'bye-1'], Bye.ids); - t2.done(); - }); - }, 0); -}, numberOfLinks); -</script> -</head> -<body> -<link rel=import href="resources/import-slow-custom-element-hello.cgi" onload="latch.loaded()"> -<link rel=import async href="resources/import-custom-element-hello-1.html" onload="latch.loaded()"> -<x-hello id="hello-2"></x-hello> -<x-bye id="bye-2"></x-bye> -</body> -</html>
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/import-dup-custom-element.html b/third_party/blink/web_tests/http/tests/htmlimports/import-dup-custom-element.html deleted file mode 100644 index c956639..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/import-dup-custom-element.html +++ /dev/null
@@ -1,48 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script src="../../../resources/testharness.js"></script> -<script src="../../../resources/testharnessreport.js"></script> -<script> -var records = []; - -function addRecord(str) -{ - console.log(str); - records.push(str); -} - -function recordElement(element) -{ - addRecord(element.tagName + ":" + element.id); -} -</script> -<my-custom id="using-toplevel-1"></my-custom> -<!-- - |using-custom-element-1.html| reaches |def-custom-element.html| with one indirection - while |using-custom-element-2.html| imports it directly. - So |using-custom-element-2.html| triggers importing |def-custom-element.html| and - |using-custom-element-1.html| finds it and de-dups later. - --> -<link rel="import" href="resources/using-custom-element-1.html"> -<link rel="import" href="resources/using-custom-element-2.html"> -<my-custom id="using-toplevel-2"></my-custom> -</head> -<body> -<script> -test(function () { - assert_array_equals(records, ['MY-CUSTOM:using-toplevel-1', - 'MY-CUSTOM:using-1-before', - 'MY-CUSTOM:pointing-before', - 'MY-CUSTOM:def-before', - 'MY-CUSTOM:def-after', - 'MY-CUSTOM:pointing-after', - 'MY-CUSTOM:using-1-after', - 'MY-CUSTOM:using-2-before', - 'MY-CUSTOM:using-2-after', - 'MY-CUSTOM:using-toplevel-2'], - 'Custom Element invocations preserve tree order across imports'); -}, 'Custom Element invocations preserve tree order across imports regardless the loading order.'); -</script> -</body> -</html>
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/import-dynamic-async-notblock-sync.html b/third_party/blink/web_tests/http/tests/htmlimports/import-dynamic-async-notblock-sync.html deleted file mode 100644 index 2e858ca3..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/import-dynamic-async-notblock-sync.html +++ /dev/null
@@ -1,26 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script src="../../../resources/testharness.js"></script> -<script src="../../../resources/testharnessreport.js"></script> -</head> -<body> -<script> -(function() { - var link = document.createElement('link'); - link.id = 'dynamicLink' - link.rel = 'import'; - link.setAttribute('async', ''); - link.href = 'resources/import-slow-child.cgi'; - document.head.appendChild(link); -})(); -</script> -<link id="followingLink" rel="import" href="resources/hello.html"> -<script> -test(function() { - assert_true(null == dynamicLink.import, 'Dynamic import'); - assert_true(null != followingLink.import, 'Following import'); -}, 'Dynamically added async import doesn\'t block following import.'); -</script> -</body> -</html>
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/import-dynamic-block-async.html b/third_party/blink/web_tests/http/tests/htmlimports/import-dynamic-block-async.html deleted file mode 100644 index fe847cfbd..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/import-dynamic-block-async.html +++ /dev/null
@@ -1,29 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script src="../../../resources/testharness.js"></script> -<script src="../../../resources/testharnessreport.js"></script> -</head> -<body> -<script> -var t = async_test('Dynamically added import blocks following import.'); - -function followerReady() { - t.step(function() { - assert_true(null != dynamicLink.import, 'Dynamic import'); - assert_true(null != followingLink.import, 'Following import'); - t.done(); - }); -} - -(function() { - var link = document.createElement('link'); - link.id = 'dynamicLink' - link.rel = 'import'; - link.href = 'resources/import-slow-child.cgi'; - document.head.appendChild(link); -})(); -</script> -<link async id="followingLink" rel="import" href="resources/hello.html" onload="followerReady()"> -</body> -</html>
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/import-dynamic-block-dynamic.html b/third_party/blink/web_tests/http/tests/htmlimports/import-dynamic-block-dynamic.html deleted file mode 100644 index 86db2b8b5..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/import-dynamic-block-dynamic.html +++ /dev/null
@@ -1,32 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script src="../../../resources/testharness.js"></script> -<script src="../../../resources/testharnessreport.js"></script> -</head> -<body> -<script> -(function() { - var t = async_test('Dynamically added import blocks dynamic added imports.'); - - function createLink(url, onload) { - var link = document.createElement('link'); - link.rel = 'import'; - link.href = url; - link.onload = onload; - document.head.appendChild(link); - return link; - } - - var dynamicLink = createLink('resources/import-slow-child.cgi'); - var followingLink = createLink('resources/import-slow-child.cgi', function() { - t.step(function() { - assert_true(null != dynamicLink.import, 'Dynamic import'); - assert_true(null != followingLink.import, 'Following import'); - t.done(); - }); - }); -})(); -</script> -</body> -</html>
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/import-dynamic-block-sync.html b/third_party/blink/web_tests/http/tests/htmlimports/import-dynamic-block-sync.html deleted file mode 100644 index 72b9cc92..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/import-dynamic-block-sync.html +++ /dev/null
@@ -1,25 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script src="../../../resources/testharness.js"></script> -<script src="../../../resources/testharnessreport.js"></script> -</head> -<body> -<script> -(function() { - var link = document.createElement('link'); - link.id = 'dynamicLink' - link.rel = 'import'; - link.href = 'resources/import-slow-child.cgi'; - document.head.appendChild(link); -})(); -</script> -<link id="followingLink" rel="import" href="resources/hello.html"> -<script> -test(function() { - assert_true(null != dynamicLink.import, 'Dynamic import'); - assert_true(null != followingLink.import, 'Following import'); -}, 'Dynamically added import blocks following import.'); -</script> -</body> -</html>
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/import-dynamic-descendant-block.html b/third_party/blink/web_tests/http/tests/htmlimports/import-dynamic-descendant-block.html deleted file mode 100644 index ddb48ac..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/import-dynamic-descendant-block.html +++ /dev/null
@@ -1,16 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script src="../../../resources/testharness.js"></script> -<script src="../../../resources/testharnessreport.js"></script> -</head> -<body> -<link id="parentOfDynamicChild" rel="import" href="resources/having-dynamic-child.html"> -<script> -test(function() { - assert_true(null != parentOfDynamicChild.import, 'Parent of dynamic child'); - assert_true(null != parentOfDynamicChild.import.querySelector('#dynamicLink').import, 'Dynamically added child'); -}, 'Dynamically added import in a descendant blocks.'); -</script> -</body> -</html>
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/import-normalize-123.html b/third_party/blink/web_tests/http/tests/htmlimports/import-normalize-123.html deleted file mode 100644 index 4e6ce71..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/import-normalize-123.html +++ /dev/null
@@ -1,18 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script src="../../../resources/testharness.js"></script> -<script src="../../../resources/testharnessreport.js"></script> -<script src="resources/normalize-test-helper.js"></script> -<link rel="import" href="resources/normalize-child-1.cgi"> -<link rel="import" href="resources/normalize-child-2.html"> -<link rel="import" href="resources/normalize-child-3.html"> -</head> -<body> -<script> -test(function() { - assert_array_equals(importedDocumentList, ['normalize-child-4.html', 'normalize-child-3.html', 'normalize-child-2.html', 'normalize-child-1.cgi']); -}, 'Imports are evaluated in dependency order regardeless of the availability order.'); -</script> -</body> -</html>
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/import-normalize-132.html b/third_party/blink/web_tests/http/tests/htmlimports/import-normalize-132.html deleted file mode 100644 index 623195e..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/import-normalize-132.html +++ /dev/null
@@ -1,18 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script src="../../../resources/testharness.js"></script> -<script src="../../../resources/testharnessreport.js"></script> -<script src="resources/normalize-test-helper.js"></script> -<link rel="import" href="resources/normalize-child-1.cgi"> -<link rel="import" href="resources/normalize-child-3.html"> -<link rel="import" href="resources/normalize-child-2.html"> -</head> -<body> -<script> -test(function() { - assert_array_equals(importedDocumentList, ['normalize-child-4.html', 'normalize-child-3.html', 'normalize-child-2.html', 'normalize-child-1.cgi']); -}, 'Imports are evaluated in dependency order regardeless of the availability order.'); -</script> -</body> -</html>
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/import-normalize-213.html b/third_party/blink/web_tests/http/tests/htmlimports/import-normalize-213.html deleted file mode 100644 index 8708e68..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/import-normalize-213.html +++ /dev/null
@@ -1,18 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script src="../../../resources/testharness.js"></script> -<script src="../../../resources/testharnessreport.js"></script> -<script src="resources/normalize-test-helper.js"></script> -<link rel="import" href="resources/normalize-child-2.html"> -<link rel="import" href="resources/normalize-child-1.cgi"> -<link rel="import" href="resources/normalize-child-3.html"> -</head> -<body> -<script> -test(function() { - assert_array_equals(importedDocumentList, ['normalize-child-4.html', 'normalize-child-3.html', 'normalize-child-2.html', 'normalize-child-1.cgi']); -}, 'Imports are evaluated in dependency order regardeless of the availability order.'); -</script> -</body> -</html>
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/import-normalize-231.html b/third_party/blink/web_tests/http/tests/htmlimports/import-normalize-231.html deleted file mode 100644 index 5af7e6c..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/import-normalize-231.html +++ /dev/null
@@ -1,18 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script src="../../../resources/testharness.js"></script> -<script src="../../../resources/testharnessreport.js"></script> -<script src="resources/normalize-test-helper.js"></script> -<link rel="import" href="resources/normalize-child-2.html"> -<link rel="import" href="resources/normalize-child-3.html"> -<link rel="import" href="resources/normalize-child-1.cgi"> -</head> -<body> -<script> -test(function() { - assert_array_equals(importedDocumentList, ['normalize-child-4.html', 'normalize-child-3.html', 'normalize-child-2.html', 'normalize-child-1.cgi']); -}, 'Imports are evaluated in dependency order regardeless of the availability order.'); -</script> -</body> -</html>
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/import-normalize-312.html b/third_party/blink/web_tests/http/tests/htmlimports/import-normalize-312.html deleted file mode 100644 index 4b794a1d..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/import-normalize-312.html +++ /dev/null
@@ -1,18 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script src="../../../resources/testharness.js"></script> -<script src="../../../resources/testharnessreport.js"></script> -<script src="resources/normalize-test-helper.js"></script> -<link rel="import" href="resources/normalize-child-3.html"> -<link rel="import" href="resources/normalize-child-1.cgi"> -<link rel="import" href="resources/normalize-child-2.html"> -</head> -<body> -<script> -test(function() { - assert_array_equals(importedDocumentList, ['normalize-child-4.html', 'normalize-child-3.html', 'normalize-child-2.html', 'normalize-child-1.cgi']); -}, 'Imports are evaluated in dependency order regardeless of the availability order.'); -</script> -</body> -</html>
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/import-normalize-321.html b/third_party/blink/web_tests/http/tests/htmlimports/import-normalize-321.html deleted file mode 100644 index d420802..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/import-normalize-321.html +++ /dev/null
@@ -1,18 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script src="../../../resources/testharness.js"></script> -<script src="../../../resources/testharnessreport.js"></script> -<script src="resources/normalize-test-helper.js"></script> -<link rel="import" href="resources/normalize-child-3.html"> -<link rel="import" href="resources/normalize-child-2.html"> -<link rel="import" href="resources/normalize-child-1.cgi"> -</head> -<body> -<script> -test(function() { - assert_array_equals(importedDocumentList, ['normalize-child-4.html', 'normalize-child-3.html', 'normalize-child-2.html', 'normalize-child-1.cgi']); -}, 'Imports are evaluated in dependency order regardeless of the availability order.'); -</script> -</body> -</html>
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/import-onerror-expected.txt b/third_party/blink/web_tests/http/tests/htmlimports/import-onerror-expected.txt deleted file mode 100644 index ed99c545..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/import-onerror-expected.txt +++ /dev/null
@@ -1,6 +0,0 @@ -CONSOLE WARNING: line 19: HTML Imports is deprecated and will be removed in M80, around February 2020. Please use ES modules instead. See https://www.chromestatus.com/features/5144752345317376 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -PASS ['invalid', 'notFound', 'notFoundShared'] is givenLoadEventTargets.sort() -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/import-onerror.html b/third_party/blink/web_tests/http/tests/htmlimports/import-onerror.html deleted file mode 100644 index 9b0ffeb9..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/import-onerror.html +++ /dev/null
@@ -1,24 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script src="/js-test-resources/js-test.js"></script> -<script> -window.jsTestIsAsync = true; -testRunner.waitUntilDone(); - -var givenLoadEventTargets = []; -function handleError(event) -{ - givenLoadEventTargets.push(event.target.id); - if (givenLoadEventTargets.length == 3) { - shouldBe("['invalid', 'notFound', 'notFoundShared']", "givenLoadEventTargets.sort()"); - finishJSTest(); - } -} -</script> -<link id="notFound" rel="import" href="notfound.html" onerror="handleError(event)"> -<link id="notFoundShared" rel="import" href="notfound.html" onerror="handleError(event)"> -<link id="invalid" rel="import" href="" onerror="handleError(event)"> -</head> -<body></body> -</html>
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/import-onload-expected.txt b/third_party/blink/web_tests/http/tests/htmlimports/import-onload-expected.txt deleted file mode 100644 index 219a301..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/import-onload-expected.txt +++ /dev/null
@@ -1,6 +0,0 @@ -CONSOLE WARNING: line 19: HTML Imports is deprecated and will be removed in M80, around February 2020. Please use ES modules instead. See https://www.chromestatus.com/features/5144752345317376 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -PASS ['bye', 'hello1', 'hello2', 'hello3'] is givenLoadEventTargets.sort() -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/import-onload.html b/third_party/blink/web_tests/http/tests/htmlimports/import-onload.html deleted file mode 100644 index e374236..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/import-onload.html +++ /dev/null
@@ -1,33 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script src="/js-test-resources/js-test.js"></script> -<script> -window.jsTestIsAsync = true; -testRunner.waitUntilDone(); - -var givenLoadEventTargets = []; -function handleLoad(event) -{ - givenLoadEventTargets.push(event.target.id); - if (givenLoadEventTargets.length == 4) { - shouldBe("['bye', 'hello1', 'hello2', 'hello3']", "givenLoadEventTargets.sort()"); - finishJSTest(); - } -} -</script> -<link id="hello1" rel="import" href="resources/hello.html" onload="handleLoad(event)"> -<link id="hello2" rel="import" href="resources/hello.html" onload="handleLoad(event)"> -</head> -<body> -<script> -var linkToInsert = document.createElement("link"); -linkToInsert.id = "bye"; -linkToInsert.setAttribute("rel", "import"); -linkToInsert.setAttribute("href", "resources/bye.html"); -linkToInsert.onload = handleLoad; -document.head.appendChild(linkToInsert); -</script> -<link id="hello3" rel="import" href="resources/hello.html" onload="handleLoad(event)"> -</body> -</html>
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/import-preload-expected.txt b/third_party/blink/web_tests/http/tests/htmlimports/import-preload-expected.txt deleted file mode 100644 index dfd24ba..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/import-preload-expected.txt +++ /dev/null
@@ -1,3 +0,0 @@ -CONSOLE MESSAGE: line 9: PASS: resources/preload.html is preloaded. -CONSOLE WARNING: line 19: HTML Imports is deprecated and will be removed in M80, around February 2020. Please use ES modules instead. See https://www.chromestatus.com/features/5144752345317376 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/import-preload.html b/third_party/blink/web_tests/http/tests/htmlimports/import-preload.html deleted file mode 100644 index fe2cfd0..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/import-preload.html +++ /dev/null
@@ -1,20 +0,0 @@ -<!DOCTYPE html> -<head> -<script> -if (window.testRunner) - testRunner.dumpAsText(); -function testPreload(url, doc) -{ - if (internals.isPreloadedBy(url, doc)) { - console.log("PASS: " + url + " is preloaded."); - } else { - console.log("FAIL: " + url + " should be preloaded"); - } -} -</script> -<script src="http://127.0.0.1:8000/resources/slow-script.pl?delay=100"></script> -<script> -testPreload('resources/preload.html', document); -</script> -<link id=target rel=import href="resources/preload.html"> -</head>
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/import-script-block-crossorigin-dynamic-expected.txt b/third_party/blink/web_tests/http/tests/htmlimports/import-script-block-crossorigin-dynamic-expected.txt deleted file mode 100644 index e15e6a7..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/import-script-block-crossorigin-dynamic-expected.txt +++ /dev/null
@@ -1,12 +0,0 @@ -CONSOLE WARNING: line 5: HTML Imports is deprecated and will be removed in M80, around February 2020. Please use ES modules instead. See https://www.chromestatus.com/features/5144752345317376 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -This test ensures that crossorigin-marked script elements are blocked properly - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - -PASS document.externalScriptHasRun is true -PASS document.corsExternalScriptHasRun is true -PASS document.corsExternalScriptForLocalhostHasRun is true -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/import-script-block-crossorigin-dynamic.html b/third_party/blink/web_tests/http/tests/htmlimports/import-script-block-crossorigin-dynamic.html deleted file mode 100644 index de5238c70..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/import-script-block-crossorigin-dynamic.html +++ /dev/null
@@ -1,28 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script src="/js-test-resources/js-test.js"></script> -<link id="target" rel="import" href="http://localhost:8000/htmlimports/resources/cors-having-crossorigin-scripts.cgi"> -</head> -<body> -<script> -description("This test ensures that crossorigin-marked script elements are blocked properly"); -window.jsTestIsAsync = true; - -function testAndDone() -{ - shouldBeTrue("document.externalScriptHasRun"); - shouldBeTrue("document.corsExternalScriptHasRun"); - shouldBeTrue("document.corsExternalScriptForLocalhostHasRun"); - finishJSTest(); -} - -// This should be called by resources/run-check.js -function check() -{ - testAndDone(); -} - -</script> -</body> -</html>
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/import-script-nosniff-expected.txt b/third_party/blink/web_tests/http/tests/htmlimports/import-script-nosniff-expected.txt deleted file mode 100644 index 6fb15de..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/import-script-nosniff-expected.txt +++ /dev/null
@@ -1,7 +0,0 @@ -CONSOLE WARNING: line 4: HTML Imports is deprecated and will be removed in M80, around February 2020. Please use ES modules instead. See https://www.chromestatus.com/features/5144752345317376 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -CONSOLE ERROR: Refused to execute script from 'http://127.0.0.1:8000/htmlimports/resources/sniff-js.cgi' because its MIME type ('text/plain') is not executable, and strict MIME type checking is enabled. -PASS document.sniffing is undefined -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/import-script-nosniff.html b/third_party/blink/web_tests/http/tests/htmlimports/import-script-nosniff.html deleted file mode 100644 index 8998f42..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/import-script-nosniff.html +++ /dev/null
@@ -1,13 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<link id="target" rel="import" href="resources/having-sniffing-script.html"> -<script src="/js-test-resources/js-test.js"></script> -</head> -<body> -<pre id="result"></pre> -<script> -shouldBe("document.sniffing", "undefined"); -</script> -</body> -</html>
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/import-slow-child-expected.txt b/third_party/blink/web_tests/http/tests/htmlimports/import-slow-child-expected.txt deleted file mode 100644 index 77a52610..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/import-slow-child-expected.txt +++ /dev/null
@@ -1,6 +0,0 @@ -CONSOLE WARNING: line 14: HTML Imports is deprecated and will be removed in M80, around February 2020. Please use ES modules instead. See https://www.chromestatus.com/features/5144752345317376 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -PASS window.childLoaded is true -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/import-slow-child.html b/third_party/blink/web_tests/http/tests/htmlimports/import-slow-child.html deleted file mode 100644 index c42be83..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/import-slow-child.html +++ /dev/null
@@ -1,21 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script src="/js-test-resources/js-test.js"></script> -<script> -window.childLoaded = false; -function parentLoaded() -{ - shouldBeTrue('window.childLoaded'); - finishJSTest(); -} - -</script> -<link id="leaf" rel="import" href="resources/import-slow-child-parent.html" onload="parentLoaded()"> -</head> -<body> -<script> -window.jsTestIsAsync = true; -</script> -</body> -</html>
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/import-upgrade-iframe-expected.txt b/third_party/blink/web_tests/http/tests/htmlimports/import-upgrade-iframe-expected.txt deleted file mode 100644 index b4401fb..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/import-upgrade-iframe-expected.txt +++ /dev/null
@@ -1,7 +0,0 @@ -CONSOLE WARNING: line 11: document.registerElement is deprecated and will be removed in M80, around February 2020. Please use window.customElements.define instead. See https://www.chromestatus.com/features/4642138092470272 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -CONSOLE WARNING: line 2: HTML Imports is deprecated and will be removed in M80, around February 2020. Please use ES modules instead. See https://www.chromestatus.com/features/5144752345317376 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -PASS target.isCreated is true -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/import-upgrade-iframe.html b/third_party/blink/web_tests/http/tests/htmlimports/import-upgrade-iframe.html deleted file mode 100644 index 9280fb0b..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/import-upgrade-iframe.html +++ /dev/null
@@ -1,24 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script src="/js-test-resources/js-test.js"></script> -<script> -var proto = Object.create(HTMLElement.prototype); -proto.createdCallback = function () { - this.isCreated = true; -}; - -document.registerElement('x-foo', { prototype: proto }); -</script> -</head> -<body> -<!-- This contains slow import but it shouldn't block anything in this document --> -<iframe src="resources/linking-slow-import.html"></iframe> -<!-- Let the parser wait for a while to ensure the iframe content be parsed --> -<script src="resources/do-nothing-js.cgi"></script> -<x-foo id=target></x-foo> -<script> -shouldBeTrue('target.isCreated'); -</script> -</body> -</html>
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/imported-document.html b/third_party/blink/web_tests/http/tests/htmlimports/imported-document.html deleted file mode 100644 index 8558cc6..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/imported-document.html +++ /dev/null
@@ -1,21 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script src="../../../resources/testharness.js"></script> -<script src="../../../resources/testharnessreport.js"></script> -<link id="target" rel="import" href="resources/hello.html"> -</head> -<body> -<script> -test(function() { - var target = document.getElementById("target"); - assert_equals(target.href, target.import.URL); - assert_true(target.import instanceof Document) -}, -"Check on the document URL of loaded document", -{ - "help": ["https://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/imports/index.html#imported-document"], -}); -</script> -</body> -</html>
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/loading-attempt.html b/third_party/blink/web_tests/http/tests/htmlimports/loading-attempt.html deleted file mode 100644 index dc3002b9..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/loading-attempt.html +++ /dev/null
@@ -1,82 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<title>Fetching import</title> -<link rel="help" href="http://w3c.github.io/webcomponents/spec/imports/#fetching-import"> -<script src="/resources/testharness.js"></script> -<script src="/resources/testharnessreport.js"></script> - -<script> -var onloadWasCalledOnSuccess = false; -var onerrorWasCalledOnSuccess = false; -function helloLoadHandler() { onloadWasCalledOnSuccess = true; } -function helloErrorHandler() { onerrorWasCalledOnSuccess = true; } - -var onloadWasCalledOnFail = false; -var onerrorWasCalledOnFail = false; -function nosuchLoadHandler() { onloadWasCalledOnFail = true; } -function nosuchErrorHandler() { onerrorWasCalledOnFail = true; } -</script> - -<link rel="import" href="resources/hello.html" onload="helloLoadHandler()" onerror="helloLoadHandler()"> -<link rel="import" href="resources/no-such.html" onload="nosuchLoadHandler()" onerror="nosuchErrorHandler()"> - -<script> -var onloadTest = async_test("Testing html import load order"); - -window.onload = function () { - test(() => { - assert_true(onloadWasCalledOnSuccess); - assert_false(onerrorWasCalledOnSuccess); - }, 'The loading attempt must be considered successful if IMPORT is not null on the algorithm completion, and failed otherwise. (1)'); - - test(() => { - assert_false(onloadWasCalledOnFail); - assert_true(onerrorWasCalledOnFail); - }, 'The loading attempt must be considered successful if IMPORT is not null on the algorithm completion, and failed otherwise. (2)'); - - onloadTest.done(); -}; - -t1 = async_test('The loading attempt must be considered successful if IMPORT is not null on the algorithm completion, and failed otherwise. (3)') -t1.step(function() { - var importElement = document.createElement('link'); - importElement.setAttribute('rel', 'import'); - importElement.setAttribute('href', 'resources/dynamic.html'); - importElement.addEventListener("error", assert_unreached); - importElement.addEventListener("load", function() { - t1.done(); - }); - - document.head.appendChild(importElement); -}); - -var onloadWasCalledOnAsync = false; -var onerrorWasCalledOnAsync = false; -var asyncAttemptDone = function() { assert_unreached(); }; - -function asyncLoadHandler() { - onloadWasCalledOnAsync = true; - asyncAttemptDone(); -} -function asyncErrorHandler() { - onerrorWasCalledOnAsync = true; - asyncAttemptDone(); -} - -t2 = async_test('Every import that is not marked as async delays the load event in the Document.'); -asyncAttemptDone = function() { - t2.step(function() { - assert_true(onloadWasCalledOnAsync); - assert_false(onerrorWasCalledOnAsync); - t2.done(); - }); -}; - -</script> -<link rel="import" href="resources/async.html" onload="asyncLoadHandler()" onerror="asyncErrorHandler()" async> -</head> -<body> -<div id="log"></div> -</body> -</html>
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/redirect-cross-origin-cross-same-2.html b/third_party/blink/web_tests/http/tests/htmlimports/redirect-cross-origin-cross-same-2.html deleted file mode 100644 index 258beef..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/redirect-cross-origin-cross-same-2.html +++ /dev/null
@@ -1,29 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script src="../../../resources/testharness.js"></script> -<script src="../../../resources/testharnessreport.js"></script> -<link rel="help" "https://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/imports/index.html#imported-document" /> - -<link id="same-cors-same" rel="import" href="/security/resources/redir.php?url=http%3A%2F%2Flocalhost%3A8000%2Fsecurity%2Fresources%2Fcors-redir.php%3Furl%3Dhttp%3A%2F%2F127.0.0.1%3A8000%2Fhtmlimports%2Fresources%2Fhello.html"> -</head> -<body> -<script> -function assert_loaded(id) -{ - var target = document.getElementById(id); - assert_true(target.import instanceof Document) - assert_true(0 <= target.import.querySelector("h1").innerHTML.indexOf("Hello")); -} - -function assert_not_loaded(id) -{ - var target = document.getElementById(id); - assert_equals(target.import, null); -} - -// The final resource is accessed with a 'null' origin as the 2nd redirect changes origin. -test(function() { assert_not_loaded("same-cors-same"); }, "Accessing to a same origin import including intermediate CORS domain redirect"); -</script> -</body> -</html>
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/redirect-cross-origin-cross-same.html b/third_party/blink/web_tests/http/tests/htmlimports/redirect-cross-origin-cross-same.html deleted file mode 100644 index 74fd157..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/redirect-cross-origin-cross-same.html +++ /dev/null
@@ -1,29 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script src="../../../resources/testharness.js"></script> -<script src="../../../resources/testharnessreport.js"></script> -<link rel="help" "https://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/imports/index.html#imported-document" /> - -<link id="cors-same" rel="import" href="http://localhost:8000/security/resources/cors-redir.php?url=http://127.0.0.1:8000/htmlimports/resources/hello.html"> -</head> - -<script> -function assert_loaded(id) -{ - var target = document.getElementById(id); - assert_true(target.import instanceof Document) - assert_true(0 <= target.import.querySelector("h1").innerHTML.indexOf("Hello")); -} - -function assert_not_loaded(id) -{ - var target = document.getElementById(id); - assert_equals(target.import, null); -} - -// Redirect passes CORS check, but the redirect is to another origin (hence a unique origin must be used.) This does not pass the final access control check. -test(function() { assert_not_loaded("cors-same"); }, "Accessing to a same origin import including CORS domain redirect"); -</script> -</body> -</html>
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/redirect-cross-origin-cross.html b/third_party/blink/web_tests/http/tests/htmlimports/redirect-cross-origin-cross.html deleted file mode 100644 index 1c7ce9f8..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/redirect-cross-origin-cross.html +++ /dev/null
@@ -1,28 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script src="../../../resources/testharness.js"></script> -<script src="../../../resources/testharnessreport.js"></script> -<link rel="help" "https://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/imports/index.html#imported-document" /> - -<link id="cors-xs" rel="import" href="http://localhost:8000/security/resources/cors-redir.php?url=http://localhost:8000/htmlimports/resources/hello.html"> -</head> - -<script> -function assert_loaded(id) -{ - var target = document.getElementById(id); - assert_true(target.import instanceof Document) - assert_true(0 <= target.import.querySelector("h1").innerHTML.indexOf("Hello")); -} - -function assert_not_loaded(id) -{ - var target = document.getElementById(id); - assert_equals(target.import, null); -} - -test(function() { assert_not_loaded("cors-xs"); }, "Blocking access to a cross origin import including CORS domain redirect"); -</script> -</body> -</html>
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/redirect-cross-origin.html b/third_party/blink/web_tests/http/tests/htmlimports/redirect-cross-origin.html deleted file mode 100644 index dbab007..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/redirect-cross-origin.html +++ /dev/null
@@ -1,40 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script src="../../../resources/testharness.js"></script> -<script src="../../../resources/testharnessreport.js"></script> -<link rel="help" "https://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/imports/index.html#imported-document" /> - -<link id="xs-same" rel="import" href="http://localhost:8000/security/resources/redir.php?url=http://127.0.0.1:8000/htmlimports/resources/hello.html"> -<link id="xs-cors" rel="import" href="http://localhost:8000/security/resources/redir.php?url=http://127.0.0.1:8000/htmlimports/resources/cors-basic.cgi"> - -<link id="same-xs-same" rel="import" href="/security/resources/redir.php?url=http%3A%2F%2Flocalhost%3A8000%2Fsecurity%2Fresources%2Fredir.php%3Furl%3Dhttp%3A%2F%2F127.0.0.1%3A8000%2Fhtmlimports%2Fresources%2Fhello.html"> -<link id="same-xs-cors" rel="import" href="/security/resources/redir.php?url=http%3A%2F%2Flocalhost%3A8000%2Fsecurity%2Fresources%2Fredir.php%3Furl%3Dhttp%3A%2F%2F127.0.0.1%3A8000%2Fhtmlimports%2Fresources%2Fcors-basic.cgi"> - -<link id="cors-xs-same" rel="import" href="http://localhost:8000//security/resources/cors-redir.php?url=http%3A%2F%2Flocalhost%3A8000%2Fsecurity%2Fresources%2Fredir.php%3Furl%3Dhttp%3A%2F%2F127.0.0.1%3A8000%2Fhtmlimports%2Fresources%2Fhello.html"> -</head> -<body> -<script> -function assert_loaded(id) -{ - var target = document.getElementById(id); - assert_true(target.import instanceof Document) - assert_true(0 <= target.import.querySelector("h1").innerHTML.indexOf("Hello")); -} - -function assert_not_loaded(id) -{ - var target = document.getElementById(id); - assert_equals(target.import, null); -} - -test(function() { assert_not_loaded("xs-same"); }, "Blocking access to a same origin import including cross domain redirect"); -test(function() { assert_not_loaded("xs-cors"); }, "Blocking access to a CORS origin import including cross domain redirect"); - -test(function() { assert_not_loaded("same-xs-same"); }, "Blocking access to a same origin import including intermediate cross domain redirect"); -test(function() { assert_not_loaded("same-xs-cors"); }, "Blocking access to a CORS origin import including intermediate cross domain redirect"); - -test(function() { assert_not_loaded("cors-xs-same"); }, "Blocking access to a CORS requested but eventually same origin import including intermediate cross domain redirect"); -</script> -</body> -</html>
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/redirect.html b/third_party/blink/web_tests/http/tests/htmlimports/redirect.html deleted file mode 100644 index acc31b6..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/redirect.html +++ /dev/null
@@ -1,42 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script src="../../../resources/testharness.js"></script> -<script src="../../../resources/testharnessreport.js"></script> -<link rel="help" "https://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/imports/index.html#imported-document" /> - -<link id="same" rel="import" href="http://127.0.0.1:8000/htmlimports/resources/hello.html"> -<link id="cors" rel="import" href="http://localhost:8000/htmlimports/resources/cors-basic.cgi"> -<link id="xs" rel="import" href="http://localhost:8000/htmlimports/resources/hello.html"> - -<link id="same-same" rel="import" href="/security/resources/redir.php?url=http://127.0.0.1:8000/htmlimports/resources/hello.html"> -<link id="same-cors" rel="import" href="/security/resources/redir.php?url=http://localhost:8000/htmlimports/resources/cors-basic.cgi"> -<link id="same-xs" rel="import" href="/security/resources/redir.php?url=http://localhost:8000/htmlimports/resources/hello.html"> - -</head> -<body> -<script> -function assert_loaded(id) -{ - var target = document.getElementById(id); - assert_true(target.import instanceof Document) - assert_true(0 <= target.import.querySelector("h1").innerHTML.indexOf("Hello")); -} - -function assert_not_loaded(id) -{ - var target = document.getElementById(id); - assert_equals(target.import, null); -} - -test(function() { assert_loaded("same"); }, "Accessing to a same origin import"); -test(function() { assert_loaded("cors"); }, "Accessing to CORS-enabled origin import"); -test(function() { assert_not_loaded("xs"); }, "Blocking access to a cross origin import"); - -test(function() { assert_loaded("same-same"); }, "Accessing to a same origin import including same domain redirect"); -test(function() { assert_loaded("same-cors"); }, "Accessing to a CORS origin import including same domain redirect"); -test(function() { assert_not_loaded("same-xs"); }, "Blocking access to a cross origin iamport including same domain redirect"); - -</script> -</body> -</html>
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/reject-content-disposition.html b/third_party/blink/web_tests/http/tests/htmlimports/reject-content-disposition.html deleted file mode 100644 index cd03169..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/reject-content-disposition.html +++ /dev/null
@@ -1,20 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script src="../../../resources/testharness.js"></script> -<script src="../../../resources/testharnessreport.js"></script> -<link id="target" rel="import" href="resources/content-disposition.cgi"> -</head> -<body> -<script> -test(function() { - var target = document.getElementById("target"); - assert_true(target.import === null); -}, -"Check if Content-Disposition prevents imports from loading", -{ - "help": ["http://w3c.github.io/webcomponents/spec/imports/#fetching-import"], -}); -</script> -</body> -</html>
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/resources/async-block-helper.js b/third_party/blink/web_tests/http/tests/htmlimports/resources/async-block-helper.js deleted file mode 100644 index c1faaebad..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/resources/async-block-helper.js +++ /dev/null
@@ -1,13 +0,0 @@ - -var loadedImports = []; - -function importLoaded(loadedDocument) { - var name = loadedDocument.URL.substr(loadedDocument.URL.lastIndexOf("/") + 1); - loadedImports.push(name); - if (window.notifyImportLoaded) - window.notifyImportLoaded(name); -} - -function isImportLoaded(url) { - return 0 <= loadedImports.indexOf(url); -} \ No newline at end of file
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/resources/async.html b/third_party/blink/web_tests/http/tests/htmlimports/resources/async.html deleted file mode 100644 index 18de086..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/resources/async.html +++ /dev/null
@@ -1,2 +0,0 @@ -<!DOCTYPE html> -<body>Async</body>
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/resources/blocked-script.js b/third_party/blink/web_tests/http/tests/htmlimports/resources/blocked-script.js deleted file mode 100644 index 663cd1e..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/resources/blocked-script.js +++ /dev/null
@@ -1 +0,0 @@ -shouldBeTrue("blockingScriptHasRun"); \ No newline at end of file
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/resources/blocking-script-js.cgi b/third_party/blink/web_tests/http/tests/htmlimports/resources/blocking-script-js.cgi deleted file mode 100755 index f9746cc80..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/resources/blocking-script-js.cgi +++ /dev/null
@@ -1,10 +0,0 @@ -#!/usr/bin/perl -wT -use strict; - -print "Content-Type: text/javascript\n\n"; -# If you want to make things super predictable, this will help for the cost of slowness. -# In practice, CGI invocation overhead is sufficiently slow. -# sleep 1; -print <<EOF -blockingScriptHasRun = true; -EOF
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/resources/body-only-0.html b/third_party/blink/web_tests/http/tests/htmlimports/resources/body-only-0.html deleted file mode 100644 index cac33c7a..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/resources/body-only-0.html +++ /dev/null
@@ -1,4 +0,0 @@ -<!DOCTYPE html> -<html> -<body id="body-only-0">Hello</body> -</html>
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/resources/body-only-1.html b/third_party/blink/web_tests/http/tests/htmlimports/resources/body-only-1.html deleted file mode 100644 index c0eedf4e..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/resources/body-only-1.html +++ /dev/null
@@ -1,4 +0,0 @@ -<!DOCTYPE html> -<html> -<body id="body-only-1">Hello</body> -</html>
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/resources/body-only-2.html b/third_party/blink/web_tests/http/tests/htmlimports/resources/body-only-2.html deleted file mode 100644 index 9a6a1e43..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/resources/body-only-2.html +++ /dev/null
@@ -1,4 +0,0 @@ -<!DOCTYPE html> -<html> -<body id="body-only-2">Hello</body> -</html>
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/resources/body-only.html b/third_party/blink/web_tests/http/tests/htmlimports/resources/body-only.html deleted file mode 100644 index 0ed2a55b..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/resources/body-only.html +++ /dev/null
@@ -1,4 +0,0 @@ -<!DOCTYPE html> -<html> -<body id="body-only">Hello</body> -</html>
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/resources/bye.html b/third_party/blink/web_tests/http/tests/htmlimports/resources/bye.html deleted file mode 100644 index e7f74dc..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/resources/bye.html +++ /dev/null
@@ -1,7 +0,0 @@ -<!DOCTYPE html> -<html> -<head></head> -<body> - <h1>Bye</h1> -</body> -</html>
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/resources/child-having-domain-policy.cgi b/third_party/blink/web_tests/http/tests/htmlimports/resources/child-having-domain-policy.cgi deleted file mode 100755 index 45e61429..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/resources/child-having-domain-policy.cgi +++ /dev/null
@@ -1,15 +0,0 @@ -#!/usr/bin/perl -wT -use strict; - -print "Content-Type: text/html\n"; -print "Access-Control-Allow-Credentials: true\n"; -print "Access-Control-Allow-Origin: http://127.0.0.1:8000\n\n"; - -print <<EOF -<!DOCTYPE html> -<html> -<head> -<link rel="import" href="having-domain-policy.cgi"> -</head> -</html> -EOF
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/resources/child-having-domain-policy.html b/third_party/blink/web_tests/http/tests/htmlimports/resources/child-having-domain-policy.html deleted file mode 100644 index 60a08c1..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/resources/child-having-domain-policy.html +++ /dev/null
@@ -1,6 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<link rel="import" href="having-domain-policy.html"> -</head> -</html>
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/resources/child-having-nonce-policy.cgi b/third_party/blink/web_tests/http/tests/htmlimports/resources/child-having-nonce-policy.cgi deleted file mode 100755 index 143c7cbd..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/resources/child-having-nonce-policy.cgi +++ /dev/null
@@ -1,15 +0,0 @@ -#!/usr/bin/perl -wT -use strict; - -print "Content-Type: text/html\n"; -print "Access-Control-Allow-Credentials: true\n"; -print "Access-Control-Allow-Origin: http://127.0.0.1:8000\n\n"; - -print <<EOF -<!DOCTYPE html> -<html> -<head> -<link rel="import" href="having-nonce-policy.cgi"> -</head> -</html> -EOF
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/resources/child-having-nonce-policy.html b/third_party/blink/web_tests/http/tests/htmlimports/resources/child-having-nonce-policy.html deleted file mode 100644 index 2d84d6d..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/resources/child-having-nonce-policy.html +++ /dev/null
@@ -1,6 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<link rel="import" href="having-nonce-policy.html"> -</head> -</html>
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/resources/child-having-self-policy.html b/third_party/blink/web_tests/http/tests/htmlimports/resources/child-having-self-policy.html deleted file mode 100644 index 3aa461e..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/resources/child-having-self-policy.html +++ /dev/null
@@ -1,6 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<link rel="import" href="having-self-policy.html"> -</head> -</html>
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/resources/child-having-unsafe-eval-policy.html b/third_party/blink/web_tests/http/tests/htmlimports/resources/child-having-unsafe-eval-policy.html deleted file mode 100644 index 13f3636..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/resources/child-having-unsafe-eval-policy.html +++ /dev/null
@@ -1,6 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<link rel="import" href="having-unsafe-eval-policy.html"> -</head> -</html>
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/resources/child-having-unsafe-inline-policy.html b/third_party/blink/web_tests/http/tests/htmlimports/resources/child-having-unsafe-inline-policy.html deleted file mode 100644 index f142e4e..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/resources/child-having-unsafe-inline-policy.html +++ /dev/null
@@ -1,6 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<link rel="import" href="having-unsafe-inline-policy.html"> -</head> -</html>
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/resources/content-disposition.cgi b/third_party/blink/web_tests/http/tests/htmlimports/resources/content-disposition.cgi deleted file mode 100755 index f6a89bec..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/resources/content-disposition.cgi +++ /dev/null
@@ -1,6 +0,0 @@ -#!/usr/bin/perl -print "Content-Type: text/html; charset=EUC-JP\n"; -print "Content-Disposition: attachment; filename=hello.txt\n"; -print "\n"; - -print "<!DOCTYPE html><body>Hello, world</body>\n\n";
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/resources/cookie-match.cgi b/third_party/blink/web_tests/http/tests/htmlimports/resources/cookie-match.cgi deleted file mode 100755 index 0dda946..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/resources/cookie-match.cgi +++ /dev/null
@@ -1,18 +0,0 @@ -#!/usr/bin/perl -wT -use strict; - -my $query = $ENV{"QUERY_STRING"}; -my $cookie = $ENV{"HTTP_COOKIE"}; - -$query =~ s/\?//g; # Squash "?" that is added to prevent dedup. - -print "Content-Type: text/html\n"; -print "Access-Control-Allow-Credentials: true\n"; -print "Access-Control-Allow-Origin: *\n"; -print "\n"; - -if ($query eq $cookie) { - print "<body>PASS</body>" -} else { - print "<body>FAIL: Cookie:" . $cookie .", Query:" . $query . "</body>"; -}
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/resources/cookie.cgi b/third_party/blink/web_tests/http/tests/htmlimports/resources/cookie.cgi deleted file mode 100755 index 91570c8..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/resources/cookie.cgi +++ /dev/null
@@ -1,9 +0,0 @@ -#!/usr/bin/perl -wT -use strict; - -print "Content-Type: text/html\n"; -print "Cache-Control: no-store\n"; -print 'Cache-Control: no-cache="set-cookie"' . "\n"; -print "Set-Cookie: htmlimport=hello\n\n"; - -print "<html><body><h1>Cookie Sent!</h1></body></html>\n"; \ No newline at end of file
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/resources/cors-basic.cgi b/third_party/blink/web_tests/http/tests/htmlimports/resources/cors-basic.cgi deleted file mode 100755 index ea43bdaf..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/resources/cors-basic.cgi +++ /dev/null
@@ -1,8 +0,0 @@ -#!/usr/bin/perl -wT -use strict; - -print "Content-Type: text/html\n"; -print "Access-Control-Allow-Credentials: true\n"; -print "Access-Control-Allow-Origin: http://127.0.0.1:8000\n\n"; - -print "<html><body><h1>Hello, CORS!</h1></body></html>\n";
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/resources/cors-having-crossorigin-scripts.cgi b/third_party/blink/web_tests/http/tests/htmlimports/resources/cors-having-crossorigin-scripts.cgi deleted file mode 100755 index 33978896..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/resources/cors-having-crossorigin-scripts.cgi +++ /dev/null
@@ -1,42 +0,0 @@ -#!/usr/bin/perl -wT -use strict; - -print "Content-Type: text/html\n"; -print "Access-Control-Allow-Credentials: true\n"; -print "Access-Control-Allow-Origin: http://127.0.0.1:8000\n\n"; - -print <<EOF -<html><body> -<script> -var scriptListToLoad = [ - 'http://127.0.0.1:8000/htmlimports/resources/external-script.js', - 'http://127.0.0.1:8000/htmlimports/resources/cors-js.cgi', - 'http://127.0.0.1:8000/htmlimports/resources/cors-js-for-localhost.cgi', - 'http://127.0.0.1:8000/htmlimports/resources/run-check.js' -]; - -thisDocument = document.currentScript.ownerDocument; -function loadTestIfReady() { - if (scriptListToLoad.length) - loadPendingScript(); -} - -function loadScriptFrom(url) { - var element = thisDocument.createElement("script"); - element.setAttribute("crossorigin", ""); - element.setAttribute("src", url); - element.onload = element.onerror = loadTestIfReady; - thisDocument.head.appendChild(element); - return element; -} - -function loadPendingScript() -{ - var url = scriptListToLoad.shift(); - loadScriptFrom(url); -} - -loadPendingScript(); -</script> -</body></html> -EOF
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/resources/cors-js-for-localhost.cgi b/third_party/blink/web_tests/http/tests/htmlimports/resources/cors-js-for-localhost.cgi deleted file mode 100755 index d213ced..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/resources/cors-js-for-localhost.cgi +++ /dev/null
@@ -1,9 +0,0 @@ -#!/usr/bin/perl -wT -use strict; - -print "Content-Type: text/javascript\n"; -print "Access-Control-Allow-Credentials: true\n"; -print "Access-Control-Allow-Origin: http://localhost:8000\n\n"; - -print "document.corsExternalScriptForLocalhostHasRun = true;\n"; -print "eval(\"document.evalFromCorsExternalLocalhostHasRun = true;\");";
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/resources/cors-js.cgi b/third_party/blink/web_tests/http/tests/htmlimports/resources/cors-js.cgi deleted file mode 100755 index f270a3a..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/resources/cors-js.cgi +++ /dev/null
@@ -1,9 +0,0 @@ -#!/usr/bin/perl -wT -use strict; - -print "Content-Type: text/javascript\n"; -print "Access-Control-Allow-Credentials: true\n"; -print "Access-Control-Allow-Origin: http://127.0.0.1:8000\n\n"; - -print "document.corsExternalScriptHasRun = true;\n"; -print "eval(\"document.evalFromCorsExternalHasRun = true;\");";
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/resources/cors-subimports.cgi b/third_party/blink/web_tests/http/tests/htmlimports/resources/cors-subimports.cgi deleted file mode 100755 index d66142f..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/resources/cors-subimports.cgi +++ /dev/null
@@ -1,15 +0,0 @@ -#!/usr/bin/perl -wT -use strict; - -print "Content-Type: text/html\n"; -print "Access-Control-Allow-Credentials: true\n"; -print "Access-Control-Allow-Origin: http://127.0.0.1:8000\n\n"; - -print <<EOF -<!DOCTYPE html> -<link id="sameOriginCors" rel="import" href="cors-basic.cgi?1"> -<link id="sameOriginNoCors" rel="import" href="resources/hello.html?1"> -<link id="masterOriginNoCors" rel="import" href="http://127.0.0.1:8000/htmlimports/resources/hello.html?2"> -<link id="masterOriginCors" rel="import" href="http://127.0.0.1:8000/htmlimports/resources/cors-basic.cgi?2"> -EOF -
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/resources/csp-blocking.cgi b/third_party/blink/web_tests/http/tests/htmlimports/resources/csp-blocking.cgi deleted file mode 100755 index f0584e2..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/resources/csp-blocking.cgi +++ /dev/null
@@ -1,9 +0,0 @@ -#!/usr/bin/perl -wT -use strict; - -print "Content-Type: text/html\n"; -print "Content-Security-Policy: script-src 'unsafe-inline'\n\n"; - -print "<html><head>"; -print "<link id=\"shouldBeBlocked\" rel=\"import\" href=\"hello.html\">"; -print "</head></html>\n";
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/resources/csp-import-block-but-domain.js b/third_party/blink/web_tests/http/tests/htmlimports/resources/csp-import-block-but-domain.js deleted file mode 100644 index ca4d0bea..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/resources/csp-import-block-but-domain.js +++ /dev/null
@@ -1,18 +0,0 @@ -if (window.testRunner) - testRunner.dumpAsText(); - -function test(actual, expected, message) -{ - if (actual === expected) - console.log("PASS"); - else - console.log("FAIL:" + message); -} - -test(document.inlineScriptHasRun, undefined, "document.inlineScriptHasRun"); -test(document.externalScriptHasRun, undefined, "document.externalScriptHasRun"); -test(document.corsExternalScriptHasRun, true, "document.corsExternalScriptHasRun"); -test(document.evalFromInlineHasRun, undefined, "document.evalFromInlineHasRun"); -test(document.evalFromExternalHasRun, undefined, "document.evalFromExternalHasRun"); -test(document.evalFromCorsExternalHasRun, undefined, "document.evalFromCorsExternalHasRun"); -
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/resources/csp-import-block-but-self.js b/third_party/blink/web_tests/http/tests/htmlimports/resources/csp-import-block-but-self.js deleted file mode 100644 index e2d48246..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/resources/csp-import-block-but-self.js +++ /dev/null
@@ -1,18 +0,0 @@ -function test(actual, expected, message) -{ - if (actual === expected) - console.log("PASS"); - else - console.log("FAIL:" + message); -} - -if (window.testRunner) - testRunner.dumpAsText(); - -test(document.inlineScriptHasRun, undefined, "document.inlineScriptHasRun"); -test(document.externalScriptHasRun, true, "document.externalScriptHasRun"); -test(document.corsExternalScriptHasRun, undefined, "document.corsExternalScriptHasRun"); -test(document.evalFromInlineHasRun, undefined, "document.evalFromInlineHasRun"); -test(document.evalFromExternalHasRun, undefined, "document.evalFromExternalHasRun"); -test(document.evalFromCorsExternalHasRun, undefined, "document.evalFromCorsExternalHasRun"); -
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/resources/custom-element-def.html b/third_party/blink/web_tests/http/tests/htmlimports/resources/custom-element-def.html deleted file mode 100644 index f72f65f..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/resources/custom-element-def.html +++ /dev/null
@@ -1,15 +0,0 @@ -<!DOCTYPE html> -<my-custom id="def-before"></my-custom> -<script> -(function() -{ - var proto = Object.create(HTMLElement.prototype); - proto.createdCallback = function () - { - recordElement(this); - }; - - document.registerElement('my-custom', {prototype: proto}); -})(); -</script> -<my-custom id="def-after"></my-custom>
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/resources/do-nothing-js.cgi b/third_party/blink/web_tests/http/tests/htmlimports/resources/do-nothing-js.cgi deleted file mode 100755 index 5e96e1c..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/resources/do-nothing-js.cgi +++ /dev/null
@@ -1,10 +0,0 @@ -#!/usr/bin/perl -wT -use strict; -use Time::HiRes qw(sleep); - -sleep 0.2; - -print "Content-Type: text/javascript\n\n"; -print <<EOF -// Do nothing -EOF
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/resources/dynamic.html b/third_party/blink/web_tests/http/tests/htmlimports/resources/dynamic.html deleted file mode 100644 index bf17a13..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/resources/dynamic.html +++ /dev/null
@@ -1,2 +0,0 @@ -<!DOCTYPE html> -<body>Dyamic</body>
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/resources/empty-script.js b/third_party/blink/web_tests/http/tests/htmlimports/resources/empty-script.js deleted file mode 100644 index e69de29..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/resources/empty-script.js +++ /dev/null
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/resources/external-script-with-nonce.js b/third_party/blink/web_tests/http/tests/htmlimports/resources/external-script-with-nonce.js deleted file mode 100644 index f8b1358..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/resources/external-script-with-nonce.js +++ /dev/null
@@ -1,4 +0,0 @@ -if (document.currentScript.getAttribute("nonce") == null) - throw "Should be included by nonce-annotated element!"; -document.externalScriptWithNonceHasRun = true; -eval("document.evalFromExternalWithNonceHasRun = true;");
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/resources/external-script.js b/third_party/blink/web_tests/http/tests/htmlimports/resources/external-script.js deleted file mode 100644 index 4a4cfef..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/resources/external-script.js +++ /dev/null
@@ -1,2 +0,0 @@ -document.externalScriptHasRun = true; -eval("document.evalFromExternalHasRun = true;");
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/resources/has-slow-child-async.html b/third_party/blink/web_tests/http/tests/htmlimports/resources/has-slow-child-async.html deleted file mode 100644 index 8bbd801..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/resources/has-slow-child-async.html +++ /dev/null
@@ -1,4 +0,0 @@ -<link async rel="import" href="has-slow-script.html"> -<script> -window.importLoaded(document.currentScript.ownerDocument); -</script>
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/resources/has-slow-child.html b/third_party/blink/web_tests/http/tests/htmlimports/resources/has-slow-child.html deleted file mode 100644 index b53fab7..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/resources/has-slow-child.html +++ /dev/null
@@ -1,4 +0,0 @@ -<link rel="import" href="has-slow-script.html"> -<script> -window.importLoaded(document.currentScript.ownerDocument); -</script>
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/resources/has-slow-script.html b/third_party/blink/web_tests/http/tests/htmlimports/resources/has-slow-script.html deleted file mode 100644 index 73e4f15..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/resources/has-slow-script.html +++ /dev/null
@@ -1,4 +0,0 @@ -<script src="../../resources/slow-script.pl?delay=1000"></script> -<script> -window.importLoaded(document.currentScript.ownerDocument); -</script>
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/resources/has-sync-children.html b/third_party/blink/web_tests/http/tests/htmlimports/resources/has-sync-children.html deleted file mode 100644 index 6016819..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/resources/has-sync-children.html +++ /dev/null
@@ -1,5 +0,0 @@ -<link rel="import" href="has-slow-script.html"> -<link rel="import" href="not-slow.html"> -<script> -window.importLoaded(document.currentScript.ownerDocument); -</script>
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/resources/having-cookie-match-8080.html b/third_party/blink/web_tests/http/tests/htmlimports/resources/having-cookie-match-8080.html deleted file mode 100644 index 3b835530..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/resources/having-cookie-match-8080.html +++ /dev/null
@@ -1,3 +0,0 @@ -<!DOCTYPE html> -<!-- Put ? at the end of the URL to prevent de-deup --> -<link id="crossOrigin" rel="import" href="http://localhost:8080/htmlimports/resources/cookie-match.cgi?">
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/resources/having-cookie-match-same.cgi b/third_party/blink/web_tests/http/tests/htmlimports/resources/having-cookie-match-same.cgi deleted file mode 100755 index 2becd2fa..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/resources/having-cookie-match-same.cgi +++ /dev/null
@@ -1,12 +0,0 @@ -#!/usr/bin/perl -wT -use strict; - -print "Content-Type: text/html\n"; -print "Access-Control-Allow-Credentials: true\n"; -print "Access-Control-Allow-Origin: *\n"; -print "\n"; -print <<EOF -<!DOCTYPE html> -<!-- Put an extra "?" in the URL to prevent de-deup --> -<link id="sameOrigin" rel="import" href="http://127.0.0.1:8000/htmlimports/resources/cookie-match.cgi?key=HelloCredentials?"> -EOF
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/resources/having-csp-directive.html b/third_party/blink/web_tests/http/tests/htmlimports/resources/having-csp-directive.html deleted file mode 100644 index 57f26dd..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/resources/having-csp-directive.html +++ /dev/null
@@ -1,8 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<meta http-equiv="Content-Security-Policy" content="script-src 'unsafe-inline'"> -<link id="shouldBeBlocked" rel="import" href="hello.html"> -</head> -<body><h1>Importing a CORS Import</h1></body> -</html>
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/resources/having-domain-policy.cgi b/third_party/blink/web_tests/http/tests/htmlimports/resources/having-domain-policy.cgi deleted file mode 100755 index 0a79cf95..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/resources/having-domain-policy.cgi +++ /dev/null
@@ -1,21 +0,0 @@ -#!/usr/bin/perl -wT -use strict; - -print "Content-Type: text/html\n"; -print "Access-Control-Allow-Credentials: true\n"; -print "Access-Control-Allow-Origin: http://127.0.0.1:8000\n\n"; - -print <<EOF -<!DOCTYPE html> -<html> -<head> -<script src="http://127.0.0.1:8000/htmlimports/resources/external-script.js"></script> -<script src="http://localhost:8000/htmlimports/resources/cors-js.cgi"></script> -<script> -document.inlineScriptHasRun = true; -eval("document.evalFromInlineHasRun = true;"); -</script> - -</head> -</html> -EOF
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/resources/having-domain-policy.html b/third_party/blink/web_tests/http/tests/htmlimports/resources/having-domain-policy.html deleted file mode 100644 index 0e601863..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/resources/having-domain-policy.html +++ /dev/null
@@ -1,12 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script src="http://127.0.0.1:8000/htmlimports/resources/external-script.js"></script> -<script src="http://localhost:8000/htmlimports/resources/cors-js.cgi"></script> -<script> -document.inlineScriptHasRun = true; -eval("document.evalFromInlineHasRun = true;"); -</script> - -</head> -</html>
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/resources/having-dynamic-child.html b/third_party/blink/web_tests/http/tests/htmlimports/resources/having-dynamic-child.html deleted file mode 100644 index 61a8ae4..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/resources/having-dynamic-child.html +++ /dev/null
@@ -1,10 +0,0 @@ -<script> -(function() { - var currentDocument = document.currentScript.ownerDocument; - var link = currentDocument.createElement('link'); - link.id = 'dynamicLink' - link.rel = 'import'; - link.href = 'import-slow-child.cgi'; - currentDocument.head.appendChild(link); -})(); -</script>
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/resources/having-nonce-policy.cgi b/third_party/blink/web_tests/http/tests/htmlimports/resources/having-nonce-policy.cgi deleted file mode 100755 index d7854006..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/resources/having-nonce-policy.cgi +++ /dev/null
@@ -1,25 +0,0 @@ -#!/usr/bin/perl -wT -use strict; - -print "Content-Type: text/html\n"; -print "Access-Control-Allow-Credentials: true\n"; -print "Access-Control-Allow-Origin: http://127.0.0.1:8000\n\n"; - -print <<EOF -<!DOCTYPE html> -<html> -<head> -<script src="http://localhost:8080/htmlimports/resources/external-script.js"></script> -<script nonce="hello" src="http://localhost:8080/htmlimports/resources/external-script-with-nonce.js"></script> -<script> -document.inlineScriptHasRun = true; -eval("document.evalFromInlineHasRun = true;"); -</script> - -<script nonce="hello"> -document.inlineScriptWithNonceHasRun = true; -eval("document.evalFromInlineWithNonceHasRun = true;"); -</script> -</head> -</html> -EOF
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/resources/having-nonce-policy.html b/third_party/blink/web_tests/http/tests/htmlimports/resources/having-nonce-policy.html deleted file mode 100644 index 6f4ae14..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/resources/having-nonce-policy.html +++ /dev/null
@@ -1,16 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script src="external-script.js"></script> -<script nonce="hello" src="external-script-with-nonce.js"></script> -<script> -document.inlineScriptHasRun = true; -eval("document.evalFromInlineHasRun = true;"); -</script> - -<script nonce="hello"> -document.inlineScriptWithNonceHasRun = true; -eval("document.evalFromInlineWithNonceHasRun = true;"); -</script> -</head> -</html>
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/resources/having-self-policy.html b/third_party/blink/web_tests/http/tests/htmlimports/resources/having-self-policy.html deleted file mode 100644 index 3a684515..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/resources/having-self-policy.html +++ /dev/null
@@ -1,12 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script src="external-script.js"></script> -<script src="http://localhost:8000//htmlimports/resources/cors-js.cgi"></script> -<script> -document.inlineScriptHasRun = true; -eval("document.evalFromInlineHasRun = true;"); -</script> - -</head> -</html>
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/resources/having-sniffing-script.html b/third_party/blink/web_tests/http/tests/htmlimports/resources/having-sniffing-script.html deleted file mode 100644 index dd8bb983..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/resources/having-sniffing-script.html +++ /dev/null
@@ -1,11 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script src="sniff-js.cgi"></script> -<script> -document.inlineScriptHasRun = true; -eval("document.evalFromInlineHasRun = true;"); -</script> - -</head> -</html>
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/resources/having-unsafe-eval-policy.html b/third_party/blink/web_tests/http/tests/htmlimports/resources/having-unsafe-eval-policy.html deleted file mode 100644 index a593c16..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/resources/having-unsafe-eval-policy.html +++ /dev/null
@@ -1,13 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<meta http-equiv="Content-Security-Policy" content="script-src 'unsafe-inline' 'unsafe-eval'"> -<script src="external-script.js"></script> -<script src="http://localhost:8000//htmlimports/resources/cors-js.cgi"></script> -<script> -document.inlineScriptHasRun = true; -eval("document.evalFromInlineHasRun = true;"); -</script> - -</head> -</html>
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/resources/having-unsafe-inline-policy.html b/third_party/blink/web_tests/http/tests/htmlimports/resources/having-unsafe-inline-policy.html deleted file mode 100644 index 6d55bdd7..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/resources/having-unsafe-inline-policy.html +++ /dev/null
@@ -1,9 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script> -document.inlineScriptHasRun = true; -eval("document.evalFromInlineHasRun = true;"); -</script> -</head> -</html>
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/resources/hello-parent.html b/third_party/blink/web_tests/http/tests/htmlimports/resources/hello-parent.html deleted file mode 100644 index e44ef89..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/resources/hello-parent.html +++ /dev/null
@@ -1,9 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<link id="original" rel="import" href="hello.html"> -</head> -<body> - <h1>Parent</h1> -</body> -</html>
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/resources/hello.css b/third_party/blink/web_tests/http/tests/htmlimports/resources/hello.css deleted file mode 100644 index 76e9447..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/resources/hello.css +++ /dev/null
@@ -1,4 +0,0 @@ - -.hello { - color: black; -} \ No newline at end of file
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/resources/hello.html b/third_party/blink/web_tests/http/tests/htmlimports/resources/hello.html deleted file mode 100644 index 43e056fc..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/resources/hello.html +++ /dev/null
@@ -1,5 +0,0 @@ -<!DOCTYPE html> -<html> -<head></head> -<body><h1>Hello</h1></body> -</html>
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/resources/hello.js b/third_party/blink/web_tests/http/tests/htmlimports/resources/hello.js deleted file mode 100644 index a3daf92c..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/resources/hello.js +++ /dev/null
@@ -1,3 +0,0 @@ - -function hello() { -} \ No newline at end of file
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/resources/http-encoding.cgi b/third_party/blink/web_tests/http/tests/htmlimports/resources/http-encoding.cgi deleted file mode 100755 index 157c002..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/resources/http-encoding.cgi +++ /dev/null
@@ -1,6 +0,0 @@ -#!/usr/bin/perl -print "Content-Type: text/html; charset=EUC-JP\n"; -print "Access-Control-Allow-Credentials: true\n"; -print "Access-Control-Allow-Origin: http://127.0.0.1:8000\n\n"; - -print "<!DOCTYPE html><body>Hello, world</body>\n\n";
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/resources/import-blocking-child-1.html b/third_party/blink/web_tests/http/tests/htmlimports/resources/import-blocking-child-1.html deleted file mode 100644 index 6f622e0..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/resources/import-blocking-child-1.html +++ /dev/null
@@ -1,8 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script src="blocking-script-js.cgi"></script> -</head> -<body> -</body> -</html>
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/resources/import-blocking-child-2.html b/third_party/blink/web_tests/http/tests/htmlimports/resources/import-blocking-child-2.html deleted file mode 100644 index 099deb4d..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/resources/import-blocking-child-2.html +++ /dev/null
@@ -1,8 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script src="blocked-script.js"></script> -</head> -<body> -</body> -</html>
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/resources/import-blocking-nested-child-1.html b/third_party/blink/web_tests/http/tests/htmlimports/resources/import-blocking-nested-child-1.html deleted file mode 100644 index 21dbe72..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/resources/import-blocking-nested-child-1.html +++ /dev/null
@@ -1,8 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<link id="leaf" rel="import" href="import-blocking-child-1.html"> -</head> -<body> -</body> -</html>
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/resources/import-blocking-nested-child-2.html b/third_party/blink/web_tests/http/tests/htmlimports/resources/import-blocking-nested-child-2.html deleted file mode 100644 index 7b82ce8b..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/resources/import-blocking-nested-child-2.html +++ /dev/null
@@ -1,8 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<link id="leaf" rel="import" href="import-blocking-child-2.html"> -</head> -<body> -</body> -</html>
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/resources/import-cors-credentials-body.html b/third_party/blink/web_tests/http/tests/htmlimports/resources/import-cors-credentials-body.html deleted file mode 100644 index 9c6332f..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/resources/import-cors-credentials-body.html +++ /dev/null
@@ -1,16 +0,0 @@ -<!DOCTYPE html> -<script src="/js-test-resources/js-test.js"></script> -<link id="sameOrigin" rel="import" href="cookie-match.cgi?key=HelloCredentials"> -<link id="crossOrigin" rel="import" href="http://localhost:8080/htmlimports/resources/cookie-match.cgi"> -<link id="fromSameToCrossOrigin" rel="import" href="having-cookie-match-8080.html"> -<link id="fromCrossToSameOrigin" rel="import" href="http://localhost:8080/htmlimports/resources/having-cookie-match-same.cgi"> -<script> -shouldBeEqualToString("sameOrigin.import.body.innerHTML", "PASS"); -shouldBeEqualToString("crossOrigin.import.body.innerHTML", "PASS"); -shouldBeEqualToString("fromSameToCrossOrigin.import.getElementById('crossOrigin').import.body.innerHTML", "PASS"); -shouldBeEqualToString("fromCrossToSameOrigin.import.getElementById('sameOrigin').import.body.innerHTML", "PASS"); - -if (window.testRunner) - window.setTimeout(function() { testRunner.notifyDone(); }, 0); - -</script>
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/resources/import-custom-element-hello-1.html b/third_party/blink/web_tests/http/tests/htmlimports/resources/import-custom-element-hello-1.html deleted file mode 100644 index 7df7222..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/resources/import-custom-element-hello-1.html +++ /dev/null
@@ -1,2 +0,0 @@ -<x-hello id="hello-1"></x-hello> -<x-bye id="bye-1"></x-bye>
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/resources/import-custom-element-helper.js b/third_party/blink/web_tests/http/tests/htmlimports/resources/import-custom-element-helper.js deleted file mode 100644 index 47d3e5c..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/resources/import-custom-element-helper.js +++ /dev/null
@@ -1,21 +0,0 @@ - -function registerTestingCustomElement(tagName) { - var definition = function() {}; - definition.prototype = Object.create(HTMLElement.prototype); - definition.prototype.createdCallback = function() { - if (typeof this.constructor.ids === "undefined") - this.constructor.ids = []; - this.constructor.ids.push(this.id); - } - - var ctor = document.registerElement(tagName, definition); - return ctor; -} - -function ImportTestLatch(test, count) { - this.loaded = function() { - count--; - if (!count) - test(); - }; -}
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/resources/import-slow-child-parent.html b/third_party/blink/web_tests/http/tests/htmlimports/resources/import-slow-child-parent.html deleted file mode 100644 index 8583c8a..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/resources/import-slow-child-parent.html +++ /dev/null
@@ -1,8 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<link rel="import" href="import-slow-child.cgi"> -</head> -<body> -</body> -</html>
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/resources/import-slow-child.cgi b/third_party/blink/web_tests/http/tests/htmlimports/resources/import-slow-child.cgi deleted file mode 100755 index 3a6d697d..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/resources/import-slow-child.cgi +++ /dev/null
@@ -1,11 +0,0 @@ -#!/usr/bin/perl -wT -use strict; -use Time::HiRes qw(sleep); - -print "Content-Type: text/html\n\n"; -sleep 0.2; -print <<EOF -<script> -window.childLoaded = true; -</script> -EOF
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/resources/import-slow-custom-element-hello.cgi b/third_party/blink/web_tests/http/tests/htmlimports/resources/import-slow-custom-element-hello.cgi deleted file mode 100755 index 4093c38e..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/resources/import-slow-custom-element-hello.cgi +++ /dev/null
@@ -1,10 +0,0 @@ -#!/usr/bin/perl -wT -use strict; -use Time::HiRes qw(sleep); - -print "Content-Type: text/html\n\n"; -sleep 1.0; -print <<EOF -<x-hello id="hello-slow"></x-hello> -<x-bye id="bye-slow"></x-bye> -EOF
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/resources/importing-cors.html b/third_party/blink/web_tests/http/tests/htmlimports/resources/importing-cors.html deleted file mode 100644 index f0bdcab..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/resources/importing-cors.html +++ /dev/null
@@ -1,7 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<link id="cors" rel="import" href="http://localhost:8000/htmlimports/resources/cors-basic.cgi"> -</head> -<body><h1>Importing a CORS Import</h1></body> -</html>
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/resources/linking-slow-import.html b/third_party/blink/web_tests/http/tests/htmlimports/resources/linking-slow-import.html deleted file mode 100644 index 84307c4..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/resources/linking-slow-import.html +++ /dev/null
@@ -1,2 +0,0 @@ -<!DOCTYPE html> -<link rel=import href="slow-but-empty.cgi">
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/resources/module-script-external.html b/third_party/blink/web_tests/http/tests/htmlimports/resources/module-script-external.html deleted file mode 100644 index 72553df..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/resources/module-script-external.html +++ /dev/null
@@ -1 +0,0 @@ -<script type="module" src="module.js"></script>
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/resources/module-script-inline.html b/third_party/blink/web_tests/http/tests/htmlimports/resources/module-script-inline.html deleted file mode 100644 index 8e025f0..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/resources/module-script-inline.html +++ /dev/null
@@ -1,6 +0,0 @@ -<script type="module"> -window.runInlineScript = true; -test(() => { - assert_true(true); -}, "HTML Imports run inline module script."); -</script>
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/resources/module.js b/third_party/blink/web_tests/http/tests/htmlimports/resources/module.js deleted file mode 100644 index 1527370..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/resources/module.js +++ /dev/null
@@ -1,4 +0,0 @@ -window.runExternalScript = true; -test(() => { - assert_true(true); -}, "HTML Imports run external module script.");
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/resources/no-encoding.cgi b/third_party/blink/web_tests/http/tests/htmlimports/resources/no-encoding.cgi deleted file mode 100755 index 26e855fc..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/resources/no-encoding.cgi +++ /dev/null
@@ -1,6 +0,0 @@ -#!/usr/bin/perl -print "Content-Type: text/html\n"; -print "Access-Control-Allow-Credentials: true\n"; -print "Access-Control-Allow-Origin: http://127.0.0.1:8000\n\n"; - -print "<!DOCTYPE html><body>Hello, world</body>\n\n";
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/resources/normalize-child-1.cgi b/third_party/blink/web_tests/http/tests/htmlimports/resources/normalize-child-1.cgi deleted file mode 100755 index 3ec0c3d18..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/resources/normalize-child-1.cgi +++ /dev/null
@@ -1,12 +0,0 @@ -#!/usr/bin/perl -use strict; -use Time::HiRes qw(sleep); - -print "Content-Type: text/html\n\n"; -sleep 0.5; -print <<EOF -<link rel="import" href="normalize-child-2.html"> -<script> -recordImported(); -</script> -EOF
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/resources/normalize-child-2.html b/third_party/blink/web_tests/http/tests/htmlimports/resources/normalize-child-2.html deleted file mode 100644 index 9d630b7..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/resources/normalize-child-2.html +++ /dev/null
@@ -1,5 +0,0 @@ -<link rel="import" href="normalize-child-3.html"> -<script> -recordImported(); -</script> -
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/resources/normalize-child-3.html b/third_party/blink/web_tests/http/tests/htmlimports/resources/normalize-child-3.html deleted file mode 100644 index 4daab685..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/resources/normalize-child-3.html +++ /dev/null
@@ -1,5 +0,0 @@ -<link rel="import" href="normalize-child-4.html"> -<script> -recordImported(); -</script> -
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/resources/normalize-child-4.html b/third_party/blink/web_tests/http/tests/htmlimports/resources/normalize-child-4.html deleted file mode 100644 index eb118318..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/resources/normalize-child-4.html +++ /dev/null
@@ -1,4 +0,0 @@ -<script> -recordImported(); -</script> -
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/resources/normalize-test-helper.js b/third_party/blink/web_tests/http/tests/htmlimports/resources/normalize-test-helper.js deleted file mode 100644 index 1da8f65a..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/resources/normalize-test-helper.js +++ /dev/null
@@ -1,9 +0,0 @@ - -var importedDocumentList = []; - -function recordImported() -{ - var url = document.currentScript.ownerDocument.URL; - var name = url.substr(url.lastIndexOf('/') + 1); - importedDocumentList.push(name); -} \ No newline at end of file
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/resources/not-slow.html b/third_party/blink/web_tests/http/tests/htmlimports/resources/not-slow.html deleted file mode 100644 index 07bc7ac5..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/resources/not-slow.html +++ /dev/null
@@ -1,3 +0,0 @@ -<script> -window.importLoaded(document.currentScript.ownerDocument); -</script>
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/resources/pointing-custom-element-def.html b/third_party/blink/web_tests/http/tests/htmlimports/resources/pointing-custom-element-def.html deleted file mode 100644 index 20186a6..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/resources/pointing-custom-element-def.html +++ /dev/null
@@ -1,6 +0,0 @@ -<!DOCTYPE html> -<head> -<my-custom id="pointing-before"></my-custom> -<link rel="import" href="custom-element-def.html"> -<my-custom id="pointing-after"></my-custom> -</head>
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/resources/preload.html b/third_party/blink/web_tests/http/tests/htmlimports/resources/preload.html deleted file mode 100644 index da2e13d..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/resources/preload.html +++ /dev/null
@@ -1,10 +0,0 @@ -<head> -<script src="http://127.0.0.1:8000/resources/slow-script.pl?delay=100"></script> -<script> -// TODO(yoichio): Should preload these resouces. -// testPreload('hello.css', document.currentScript.ownerDocument); -// testPreload('hello.js', document.currentScript.ownerDocument); -</script> -<link rel="stylesheet" href="hello.css"> -<script src="hello.js"></script> -</head>
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/resources/run-check.js b/third_party/blink/web_tests/http/tests/htmlimports/resources/run-check.js deleted file mode 100644 index 2b806773c..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/resources/run-check.js +++ /dev/null
@@ -1 +0,0 @@ -check(); \ No newline at end of file
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/resources/slow-but-emtpy.cgi b/third_party/blink/web_tests/http/tests/htmlimports/resources/slow-but-emtpy.cgi deleted file mode 100755 index 064552b..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/resources/slow-but-emtpy.cgi +++ /dev/null
@@ -1,10 +0,0 @@ -#!/usr/bin/perl -use strict; -use Time::HiRes qw(sleep); - -sleep 0.5; - -print "Content-Type: text/html\n\n"; -print <<EOF -<!DOCTYPE html> -EOF
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/resources/sniff-js.cgi b/third_party/blink/web_tests/http/tests/htmlimports/resources/sniff-js.cgi deleted file mode 100755 index d283c31..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/resources/sniff-js.cgi +++ /dev/null
@@ -1,7 +0,0 @@ -#!/usr/bin/perl -wT -use strict; - -print "X-Content-Type-Options: nosniff\n"; -print "Content-Type: text/plain\n\n"; - -print "document.sniffing = true;\n";
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/resources/test-in-import.html b/third_party/blink/web_tests/http/tests/htmlimports/resources/test-in-import.html deleted file mode 100644 index 60705ec1..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/resources/test-in-import.html +++ /dev/null
@@ -1,13 +0,0 @@ -<!DOCTYPE html> -<html> -<body> -<script> -test(function() { - var doc = document.currentScript.ownerDocument; - assert_throws_dom('INVALID_STATE_ERR', function() { doc.open(); }, 'document.open()'); - assert_throws_dom('INVALID_STATE_ERR', function() { doc.write('Hello'); }, 'document.write()'); - assert_throws_dom('INVALID_STATE_ERR', function() { doc.open(); }, 'document.close()'); -}, 'Throws an InvalidStateError exception if the Document is an import: From an import'); -</script> -</body> -</html>
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/resources/using-custom-element-1.html b/third_party/blink/web_tests/http/tests/htmlimports/resources/using-custom-element-1.html deleted file mode 100644 index a89756c..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/resources/using-custom-element-1.html +++ /dev/null
@@ -1,10 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<my-custom id="using-1-before"></my-custom> -<link rel="import" href="pointing-custom-element-def.html"> -</head> -<body> -<my-custom id="using-1-after"></my-custom> -</body> -</html>
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/resources/using-custom-element-2.html b/third_party/blink/web_tests/http/tests/htmlimports/resources/using-custom-element-2.html deleted file mode 100644 index cb50a0d..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/resources/using-custom-element-2.html +++ /dev/null
@@ -1,10 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<my-custom id="using-2-before"></my-custom> -<link rel="import" href="custom-element-def.html"> -</head> -<body> -<my-custom id="using-2-after"></my-custom> -</body> -</html>
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/same-origin-expected.txt b/third_party/blink/web_tests/http/tests/htmlimports/same-origin-expected.txt deleted file mode 100644 index 5ed96ed..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/same-origin-expected.txt +++ /dev/null
@@ -1,6 +0,0 @@ -CONSOLE WARNING: line 4: HTML Imports is deprecated and will be removed in M80, around February 2020. Please use ES modules instead. See https://www.chromestatus.com/features/5144752345317376 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -PASS target.import.querySelector('h1').innerHTML is 'Hello' -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/blink/web_tests/http/tests/htmlimports/same-origin.html b/third_party/blink/web_tests/http/tests/htmlimports/same-origin.html deleted file mode 100644 index ab2f392..0000000 --- a/third_party/blink/web_tests/http/tests/htmlimports/same-origin.html +++ /dev/null
@@ -1,12 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<link id="target" rel="import" href="resources/hello.html"> -<script src="/js-test-resources/js-test.js"></script> -</head> -<body> -<script> -shouldBe("target.import.querySelector('h1').innerHTML", "'Hello'"); -</script> -</body> -</html>
diff --git a/third_party/blink/web_tests/http/tests/linkHeader/link-rel-import-css-rule-capital.html b/third_party/blink/web_tests/http/tests/linkHeader/link-rel-import-css-rule-capital.html deleted file mode 100644 index 709e8c6..0000000 --- a/third_party/blink/web_tests/http/tests/linkHeader/link-rel-import-css-rule-capital.html +++ /dev/null
@@ -1,26 +0,0 @@ -<script src="../../../resources/testharness.js"></script> -<script src="../../../resources/testharnessreport.js"></script> - -<style> -#target2 { color: 008000; } -</style> - -<link rel="import" href="data:text/html,<style>.test .testWithCapital { background-color: green; } .test .testwithoutcapital { border: 2px green; } %23target2 { color: ff0000 } %23tArGeT1 { color: green }</style>"> -<div class="test"> - <div id="target1" class="testwithoutcapital testWithCapital"></div> -</div> -<div id="target2"></div> - -<script> -var green = "rgb(0, 128, 0)"; - -test(function() { - assert_equals(getComputedStyle(target1).color, green); - assert_equals(getComputedStyle(target1).borderColor, green); - assert_equals(getComputedStyle(target1).backgroundColor, green); -}, "Test that rules with capital letters in <link rel=import> are not ignored"); - -test(function() { - assert_equals(getComputedStyle(target2).color, green); -}, "Test that rules in <link rel=import> are parsed in strict mode"); -</script>
diff --git a/third_party/blink/web_tests/http/tests/security/contentSecurityPolicy/nonces/import-enforce-allowed.php b/third_party/blink/web_tests/http/tests/security/contentSecurityPolicy/nonces/import-enforce-allowed.php deleted file mode 100644 index e1f91e9..0000000 --- a/third_party/blink/web_tests/http/tests/security/contentSecurityPolicy/nonces/import-enforce-allowed.php +++ /dev/null
@@ -1,24 +0,0 @@ -<?php - header("Content-Security-Policy: script-src 'nonce-abc'"); -?> -<!doctype html> -<script nonce="abc" src="/resources/testharness.js"></script> -<script nonce="abc" src="/resources/testharnessreport.js"></script> -<script nonce="abc"> - async_test(t => { - document.addEventListener('securitypolicyviolation', t.unreached_func("No report should be generated")); - window.onload = t.step_func(_ => { - var link = document.createElement('link'); - link.setAttribute("rel", "import"); - link.setAttribute("nonce", "abc"); - link.setAttribute("href", "/security/resources/blank.html"); - - link.onerror = t.unreached_func("The import should load."); - link.onload = t.step_func_done(_ => { - assert_true(!!link.import); - }); - - document.body.appendChild(link); - }); - }, "Nonced imports load, and do not trigger reports."); -</script>
diff --git a/third_party/blink/web_tests/http/tests/security/contentSecurityPolicy/nonces/import-enforce-blocked.php b/third_party/blink/web_tests/http/tests/security/contentSecurityPolicy/nonces/import-enforce-blocked.php deleted file mode 100644 index 5b3d138..0000000 --- a/third_party/blink/web_tests/http/tests/security/contentSecurityPolicy/nonces/import-enforce-blocked.php +++ /dev/null
@@ -1,37 +0,0 @@ -<?php - header("Content-Security-Policy: script-src 'nonce-abc'"); -?> -<!doctype html> -<script nonce="abc" src="/resources/testharness.js"></script> -<script nonce="abc" src="/resources/testharnessreport.js"></script> -<script nonce="abc"> - // HTML imports are render-blocking, therefore the test must not complete - // before the import finishes (or fails) loading, otherwise, the test output - // will be empty (or at least flaky). - // - // This is because testharness.js appends the results as <pre> elements to the - // DOM, and then dumps the document as text. However, in a non-rendering-ready - // document, all elements are effectively `display: none`, and as such would - // not appear in the dump. - async_test(t => { - window.onload = t.step_func(_ => { - var link = document.createElement('link'); - link.setAttribute("rel", "import"); - link.setAttribute("nonce", "zyx"); - link.setAttribute("href", "/security/resources/blank.html"); - link.onload = t.unreached_func(); - link.onerror = t.step_func_done(); - document.body.appendChild(link); - }); - }, "Incorrectly nonced imports do not load."); - - async_test(t => { - var watcher = new EventWatcher(t, document, ['securitypolicyviolation']); - watcher - .wait_for('securitypolicyviolation') - .then(t.step_func_done(e => { - assert_equals(e.blockedURI, "http://127.0.0.1:8000/security/resources/blank.html"); - assert_equals(e.lineNumber, 21); - })); - }, "Incorrectly nonced imports trigger reports."); -</script>
diff --git a/third_party/blink/web_tests/http/tests/security/contentSecurityPolicy/nonces/import-multiple-allowed.php b/third_party/blink/web_tests/http/tests/security/contentSecurityPolicy/nonces/import-multiple-allowed.php deleted file mode 100644 index ddbf9da..0000000 --- a/third_party/blink/web_tests/http/tests/security/contentSecurityPolicy/nonces/import-multiple-allowed.php +++ /dev/null
@@ -1,25 +0,0 @@ -<?php - header("Content-Security-Policy: script-src 'unsafe-inline' 'self'"); - header("Content-Security-Policy-Report-Only: script-src 'nonce-abc'"); -?> -<!doctype html> -<script nonce="abc" src="/resources/testharness.js"></script> -<script nonce="abc" src="/resources/testharnessreport.js"></script> -<script nonce="abc"> - async_test(t => { - document.addEventListener('securitypolicyviolation', t.unreached_func("No report should be generated")); - window.onload = t.step_func(_ => { - var link = document.createElement('link'); - link.setAttribute("rel", "import"); - link.setAttribute("nonce", "abc"); - link.setAttribute("href", "/security/resources/blank.html"); - - link.onerror = t.unreached_func("The import should load."); - link.onload = t.step_func_done(_ => { - assert_true(!!link.import); - }); - - document.body.appendChild(link); - }); - }, "Nonced imports load, and do not trigger reports."); -</script>
diff --git a/third_party/blink/web_tests/http/tests/security/contentSecurityPolicy/nonces/import-multiple-blocked.php b/third_party/blink/web_tests/http/tests/security/contentSecurityPolicy/nonces/import-multiple-blocked.php deleted file mode 100644 index 49f31d8..0000000 --- a/third_party/blink/web_tests/http/tests/security/contentSecurityPolicy/nonces/import-multiple-blocked.php +++ /dev/null
@@ -1,27 +0,0 @@ -<?php - header("Content-Security-Policy: script-src 'unsafe-inline' 'self'"); - header("Content-Security-Policy-Report-Only: script-src 'nonce-abc'"); -?> -<!doctype html> -<script nonce="abc" src="/resources/testharness.js"></script> -<script nonce="abc" src="/resources/testharnessreport.js"></script> -<script nonce="abc"> - async_test(t => { - var link = document.createElement('link'); - link.setAttribute("rel", "import"); - link.setAttribute("nonce", "zyx"); - link.setAttribute("href", "/security/resources/blank.html"); - link.onerror = t.unreached_func("The import should load."); - link.onload = t.step_func(_ => assert_true(!!link.import, "The import was loaded.")); - - var watcher = new EventWatcher(t, document, ['securitypolicyviolation']); - watcher - .wait_for('securitypolicyviolation') - .then(t.step_func_done(e => { - assert_equals(e.blockedURI, "http://127.0.0.1:8000/security/resources/blank.html"); - assert_equals(e.lineNumber, 21); - })); - - document.head.appendChild(link); - }, "Nonced imports load, and do not trigger reports."); -</script>
diff --git a/third_party/blink/web_tests/http/tests/security/contentSecurityPolicy/nonces/import-reportonly-allowed.php b/third_party/blink/web_tests/http/tests/security/contentSecurityPolicy/nonces/import-reportonly-allowed.php deleted file mode 100644 index 0fa0ec4c..0000000 --- a/third_party/blink/web_tests/http/tests/security/contentSecurityPolicy/nonces/import-reportonly-allowed.php +++ /dev/null
@@ -1,26 +0,0 @@ -<?php - header("Content-Security-Policy-Report-Only: script-src 'nonce-abc'"); -?> -<!doctype html> -<script nonce="abc" src="/resources/testharness.js"></script> -<script nonce="abc" src="/resources/testharnessreport.js"></script> -<script nonce="abc"> - async_test(t => { - var link = document.createElement('link'); - link.setAttribute("rel", "import"); - link.setAttribute("nonce", "zyx"); - link.setAttribute("href", "/security/resources/blank.html"); - link.onerror = t.unreached_func("The import should load."); - link.onload = t.step_func(_ => assert_true(!!link.import, "The import was loaded.")); - - var watcher = new EventWatcher(t, document, ['securitypolicyviolation', 'securitypolicyviolation']); - watcher - .wait_for('securitypolicyviolation') - .then(t.step_func_done(e => { - assert_equals(e.blockedURI, "http://127.0.0.1:8000/security/resources/blank.html"); - assert_equals(e.lineNumber, 21); - })); - - document.head.appendChild(link); - }, "Nonced imports load, and do not trigger reports."); -</script>
diff --git a/third_party/blink/web_tests/http/tests/security/referrer-policy-attribute-import-no-referrer.html b/third_party/blink/web_tests/http/tests/security/referrer-policy-attribute-import-no-referrer.html deleted file mode 100644 index 82ad99e..0000000 --- a/third_party/blink/web_tests/http/tests/security/referrer-policy-attribute-import-no-referrer.html +++ /dev/null
@@ -1,11 +0,0 @@ -<!DOCTYPE html> -<html> - <meta name="referrer" content="origin"> - <link rel=import href="resources/pass-if-no-referrer.php" - referrerpolicy="no-referrer" onload="console.log('PASS');" - onerror="console.log('FAIL');"> - <script> - if (testRunner) - testRunner.dumpAsText(); - </script> -</html>
diff --git a/third_party/blink/web_tests/http/tests/subresource_filter/resource-in-import-disallowed.html b/third_party/blink/web_tests/http/tests/subresource_filter/resource-in-import-disallowed.html deleted file mode 100644 index 35dd1e4..0000000 --- a/third_party/blink/web_tests/http/tests/subresource_filter/resource-in-import-disallowed.html +++ /dev/null
@@ -1,46 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script src="../resources/testharness.js"></script> -<script src="../resources/testharnessreport.js"></script> -</head> -<body> -<script type="text/javascript"> -if (window.testRunner) { - // Inject a subresource filter to disallow 'beta.js' (but not 'alpha.js'). - // Furthermore, try to block the imported document itself, which should have no effect - // as subresource filtering should not apply directly to import document resources. - testRunner.setDisallowedSubresourcePathSuffixes(["beta.js", "include-scripts.html"], true /* block_subresources */); -} - -document.scriptsLoaded = []; -document.notifyScriptLoaded = function(basename) { - document.scriptsLoaded.push(basename); -} - -document.scriptsFailed = []; -document.notifyScriptFailed = function(basename) { - document.scriptsFailed.push(basename); -} - -document.scriptsExecuted = []; -document.notifyScriptExecuted = function(basename) { - document.scriptsExecuted.push(basename); -} - -async_test(t => { - var i = document.createElement("link"); - i.rel = "import"; - i.onload = t.step_func_done(_ => { - assert_array_equals(document.scriptsLoaded, ["alpha"], "Resources whose URLs are not disallowed are still loaded."); - assert_array_equals(document.scriptsFailed, ["beta"], "Resources whose URLs are disallowed are not loaded."); - assert_array_equals(document.scriptsExecuted, ["alpha"], "Scripts that are not disallowed are executed."); - }); - i.onerror = t.unreached_func("Subresouce filter should not apply directly to HTML import documents."); - i.href = "resources/include-scripts.html"; - document.body.appendChild(i); -}, "Resource loads in import documents respect the subresource filter of the master document."); - -</script> -</body> -</html>
diff --git a/third_party/blink/web_tests/virtual/web-components-v0-disabled/README.md b/third_party/blink/web_tests/virtual/web-components-v0-disabled/README.md deleted file mode 100644 index 9ab39d1..0000000 --- a/third_party/blink/web_tests/virtual/web-components-v0-disabled/README.md +++ /dev/null
@@ -1,5 +0,0 @@ -This directory contains tests run with the Web Components v0 features disabled. - -See http://go/web-components-v0 for more details. - -
diff --git a/third_party/blink/web_tests/virtual/web-components-v0-disabled/README.txt b/third_party/blink/web_tests/virtual/web-components-v0-disabled/README.txt deleted file mode 100644 index 9ab39d1..0000000 --- a/third_party/blink/web_tests/virtual/web-components-v0-disabled/README.txt +++ /dev/null
@@ -1,5 +0,0 @@ -This directory contains tests run with the Web Components v0 features disabled. - -See http://go/web-components-v0 for more details. - -
diff --git a/third_party/blink/web_tests/virtual/web-components-v0-disabled/external/wpt/html/semantics/interactive-elements/the-dialog-element/dialog-form-submission-expected.txt b/third_party/blink/web_tests/virtual/web-components-v0-disabled/external/wpt/html/semantics/interactive-elements/the-dialog-element/dialog-form-submission-expected.txt deleted file mode 100644 index c6d2ab5..0000000 --- a/third_party/blink/web_tests/virtual/web-components-v0-disabled/external/wpt/html/semantics/interactive-elements/the-dialog-element/dialog-form-submission-expected.txt +++ /dev/null
@@ -1,9 +0,0 @@ -This is a testharness.js-based test. -PASS click the form submission button should close the dialog -PASS form submission should return correct value -PASS no returnValue when there's no result. -FAIL input image button should return the coordianates assert_equals: returnValue should be the offsets of the click expected "20.5,20.5" but got "20,20" -PASS formmethod attribute should use dialog form submission -PASS closing the dialog while submitting should stop the submission -Harness: the test ran to completion. -
diff --git a/third_party/blink/web_tests/virtual/web-components-v0-disabled/external/wpt/html/semantics/interfaces-expected.txt b/third_party/blink/web_tests/virtual/web-components-v0-disabled/external/wpt/html/semantics/interfaces-expected.txt deleted file mode 100644 index 69d418d..0000000 --- a/third_party/blink/web_tests/virtual/web-components-v0-disabled/external/wpt/html/semantics/interfaces-expected.txt +++ /dev/null
@@ -1,296 +0,0 @@ -This is a testharness.js-based test. -PASS Interfaces for a -PASS Interfaces for A -PASS Interfaces for abbr -PASS Interfaces for ABBR -PASS Interfaces for acronym -PASS Interfaces for ACRONYM -PASS Interfaces for address -PASS Interfaces for ADDRESS -PASS Interfaces for applet -PASS Interfaces for APPLET -PASS Interfaces for area -PASS Interfaces for AREA -PASS Interfaces for article -PASS Interfaces for ARTICLE -PASS Interfaces for aside -PASS Interfaces for ASIDE -PASS Interfaces for audio -PASS Interfaces for AUDIO -PASS Interfaces for b -PASS Interfaces for B -PASS Interfaces for base -PASS Interfaces for BASE -PASS Interfaces for basefont -PASS Interfaces for BASEFONT -PASS Interfaces for bdi -PASS Interfaces for BDI -PASS Interfaces for bdo -PASS Interfaces for BDO -PASS Interfaces for bgsound -PASS Interfaces for BGSOUND -PASS Interfaces for big -PASS Interfaces for BIG -PASS Interfaces for blink -PASS Interfaces for BLINK -PASS Interfaces for blockquote -PASS Interfaces for BLOCKQUOTE -PASS Interfaces for body -PASS Interfaces for BODY -PASS Interfaces for br -PASS Interfaces for BR -PASS Interfaces for button -PASS Interfaces for BUTTON -PASS Interfaces for canvas -PASS Interfaces for CANVAS -PASS Interfaces for caption -PASS Interfaces for CAPTION -PASS Interfaces for center -PASS Interfaces for CENTER -PASS Interfaces for cite -PASS Interfaces for CITE -PASS Interfaces for code -PASS Interfaces for CODE -PASS Interfaces for col -PASS Interfaces for COL -PASS Interfaces for colgroup -PASS Interfaces for COLGROUP -PASS Interfaces for command -PASS Interfaces for COMMAND -PASS Interfaces for data -PASS Interfaces for DATA -PASS Interfaces for datalist -PASS Interfaces for DATALIST -PASS Interfaces for dd -PASS Interfaces for DD -PASS Interfaces for del -PASS Interfaces for DEL -PASS Interfaces for details -PASS Interfaces for DETAILS -PASS Interfaces for dfn -PASS Interfaces for DFN -PASS Interfaces for dialog -PASS Interfaces for DIALOG -PASS Interfaces for dir -PASS Interfaces for DIR -PASS Interfaces for directory -PASS Interfaces for DIRECTORY -PASS Interfaces for div -PASS Interfaces for DIV -PASS Interfaces for dl -PASS Interfaces for DL -PASS Interfaces for dt -PASS Interfaces for DT -PASS Interfaces for em -PASS Interfaces for EM -PASS Interfaces for embed -PASS Interfaces for EMBED -PASS Interfaces for fieldset -PASS Interfaces for FIELDSET -PASS Interfaces for figcaption -PASS Interfaces for FIGCAPTION -PASS Interfaces for figure -PASS Interfaces for FIGURE -PASS Interfaces for font -PASS Interfaces for FONT -PASS Interfaces for foo-BAR -PASS Interfaces for foo-bar -PASS Interfaces for FOO-BAR -PASS Interfaces for foo -PASS Interfaces for FOO -PASS Interfaces for footer -PASS Interfaces for FOOTER -PASS Interfaces for form -PASS Interfaces for FORM -PASS Interfaces for frame -PASS Interfaces for FRAME -PASS Interfaces for frameset -PASS Interfaces for FRAMESET -PASS Interfaces for h1 -PASS Interfaces for H1 -PASS Interfaces for h2 -PASS Interfaces for H2 -PASS Interfaces for h3 -PASS Interfaces for H3 -PASS Interfaces for h4 -PASS Interfaces for H4 -PASS Interfaces for h5 -PASS Interfaces for H5 -PASS Interfaces for h6 -PASS Interfaces for H6 -PASS Interfaces for head -PASS Interfaces for HEAD -PASS Interfaces for header -PASS Interfaces for HEADER -PASS Interfaces for hgroup -PASS Interfaces for HGROUP -PASS Interfaces for hr -PASS Interfaces for HR -PASS Interfaces for html -PASS Interfaces for HTML -PASS Interfaces for i -PASS Interfaces for I -PASS Interfaces for iframe -PASS Interfaces for IFRAME -PASS Interfaces for image -PASS Interfaces for IMAGE -PASS Interfaces for img -PASS Interfaces for IMG -PASS Interfaces for input -PASS Interfaces for INPUT -PASS Interfaces for ins -PASS Interfaces for INS -PASS Interfaces for isindex -PASS Interfaces for ISINDEX -PASS Interfaces for kbd -PASS Interfaces for KBD -PASS Interfaces for keygen -PASS Interfaces for KEYGEN -PASS Interfaces for label -PASS Interfaces for LABEL -PASS Interfaces for legend -PASS Interfaces for LEGEND -PASS Interfaces for li -PASS Interfaces for LI -PASS Interfaces for link -PASS Interfaces for LINK -PASS Interfaces for listing -PASS Interfaces for LISTING -PASS Interfaces for main -PASS Interfaces for MAIN -PASS Interfaces for map -PASS Interfaces for MAP -PASS Interfaces for mark -PASS Interfaces for MARK -PASS Interfaces for marquee -PASS Interfaces for MARQUEE -PASS Interfaces for menu -PASS Interfaces for MENU -PASS Interfaces for meta -PASS Interfaces for META -PASS Interfaces for meter -PASS Interfaces for METER -PASS Interfaces for mod -PASS Interfaces for MOD -PASS Interfaces for multicol -PASS Interfaces for MULTICOL -PASS Interfaces for nav -PASS Interfaces for NAV -PASS Interfaces for nextid -PASS Interfaces for NEXTID -PASS Interfaces for nobr -PASS Interfaces for NOBR -PASS Interfaces for noembed -PASS Interfaces for NOEMBED -PASS Interfaces for noframes -PASS Interfaces for NOFRAMES -PASS Interfaces for noscript -PASS Interfaces for NOSCRIPT -PASS Interfaces for object -PASS Interfaces for OBJECT -PASS Interfaces for ol -PASS Interfaces for OL -PASS Interfaces for optgroup -PASS Interfaces for OPTGROUP -PASS Interfaces for option -PASS Interfaces for OPTION -PASS Interfaces for output -PASS Interfaces for OUTPUT -PASS Interfaces for p -PASS Interfaces for P -PASS Interfaces for param -PASS Interfaces for PARAM -PASS Interfaces for picture -PASS Interfaces for PICTURE -PASS Interfaces for plaintext -PASS Interfaces for PLAINTEXT -PASS Interfaces for pre -PASS Interfaces for PRE -PASS Interfaces for progress -PASS Interfaces for PROGRESS -PASS Interfaces for q -PASS Interfaces for Q -PASS Interfaces for quasit -PASS Interfaces for QUASIT -PASS Interfaces for rb -PASS Interfaces for RB -PASS Interfaces for rp -PASS Interfaces for RP -PASS Interfaces for rt -PASS Interfaces for RT -PASS Interfaces for rtc -PASS Interfaces for RTC -PASS Interfaces for ruby -PASS Interfaces for RUBY -PASS Interfaces for s -PASS Interfaces for S -PASS Interfaces for samp -PASS Interfaces for SAMP -PASS Interfaces for script -PASS Interfaces for SCRIPT -PASS Interfaces for section -PASS Interfaces for SECTION -PASS Interfaces for select -PASS Interfaces for SELECT -PASS Interfaces for slot -PASS Interfaces for SLOT -PASS Interfaces for small -PASS Interfaces for SMALL -PASS Interfaces for source -PASS Interfaces for SOURCE -PASS Interfaces for spacer -PASS Interfaces for SPACER -PASS Interfaces for span -PASS Interfaces for SPAN -PASS Interfaces for strike -PASS Interfaces for STRIKE -PASS Interfaces for strong -PASS Interfaces for STRONG -PASS Interfaces for style -PASS Interfaces for STYLE -PASS Interfaces for sub -PASS Interfaces for SUB -PASS Interfaces for summary -PASS Interfaces for SUMMARY -PASS Interfaces for sup -PASS Interfaces for SUP -PASS Interfaces for table -PASS Interfaces for TABLE -PASS Interfaces for tbody -PASS Interfaces for TBODY -PASS Interfaces for td -PASS Interfaces for TD -PASS Interfaces for textarea -PASS Interfaces for TEXTAREA -PASS Interfaces for tfoot -PASS Interfaces for TFOOT -PASS Interfaces for th -PASS Interfaces for TH -PASS Interfaces for thead -PASS Interfaces for THEAD -PASS Interfaces for time -PASS Interfaces for TIME -PASS Interfaces for title -PASS Interfaces for TITLE -PASS Interfaces for tr -PASS Interfaces for TR -PASS Interfaces for track -PASS Interfaces for TRACK -PASS Interfaces for tt -PASS Interfaces for TT -PASS Interfaces for u -PASS Interfaces for U -PASS Interfaces for ul -PASS Interfaces for UL -PASS Interfaces for var -PASS Interfaces for VAR -PASS Interfaces for video -PASS Interfaces for VIDEO -PASS Interfaces for wbr -PASS Interfaces for WBR -PASS Interfaces for xmp -PASS Interfaces for XMP -PASS Interfaces for å-bar -PASS Interfaces for Å-BAR -Harness: the test ran to completion. -
diff --git a/third_party/blink/web_tests/virtual/web-components-v0-disabled/external/wpt/shadow-dom/historical-expected.txt b/third_party/blink/web_tests/virtual/web-components-v0-disabled/external/wpt/shadow-dom/historical-expected.txt deleted file mode 100644 index 14ab3be..0000000 --- a/third_party/blink/web_tests/virtual/web-components-v0-disabled/external/wpt/shadow-dom/historical-expected.txt +++ /dev/null
@@ -1,8 +0,0 @@ -This is a testharness.js-based test. -PASS element.createShadowRoot should not exist -PASS element.getDestinationInsertionPoints should not exist -PASS text.getDestinationInsertionPoints should not exist -FAIL event.path should not exist assert_false: expected false got true -FAIL HTMLContentElement should not exist assert_false: expected false got true -Harness: the test ran to completion. -
diff --git a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/HTMLMeterElement/meter-element-expected.png b/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/HTMLMeterElement/meter-element-expected.png deleted file mode 100644 index 95b569f..0000000 --- a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/HTMLMeterElement/meter-element-expected.png +++ /dev/null Binary files differ
diff --git a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/HTMLMeterElement/meter-element-repaint-on-update-value-expected.png b/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/HTMLMeterElement/meter-element-repaint-on-update-value-expected.png deleted file mode 100644 index 4ad508f8..0000000 --- a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/HTMLMeterElement/meter-element-repaint-on-update-value-expected.png +++ /dev/null Binary files differ
diff --git a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/HTMLProgressElement/progress-element-expected.png b/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/HTMLProgressElement/progress-element-expected.png deleted file mode 100644 index 4edca46..0000000 --- a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/HTMLProgressElement/progress-element-expected.png +++ /dev/null Binary files differ
diff --git a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/HTMLTemplateElement/custom-element-wrapper-gc-expected.txt b/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/HTMLTemplateElement/custom-element-wrapper-gc-expected.txt deleted file mode 100644 index 932371e..0000000 --- a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/HTMLTemplateElement/custom-element-wrapper-gc-expected.txt +++ /dev/null
@@ -1,10 +0,0 @@ -CONSOLE ERROR: line 14: Uncaught TypeError: document.querySelector(...).content.ownerDocument.registerElement is not a function -Custom element wrappers in templates should be retained - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - -FAIL Unexpected error: Uncaught TypeError: document.querySelector(...).content.ownerDocument.registerElement is not a function -FAIL successfullyParsed should be true. Was false. - -TEST COMPLETE -
diff --git a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/HTMLTemplateElement/import-template-expected.txt b/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/HTMLTemplateElement/import-template-expected.txt deleted file mode 100644 index 9ddd9e9..0000000 --- a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/HTMLTemplateElement/import-template-expected.txt +++ /dev/null
@@ -1,7 +0,0 @@ -CONSOLE ERROR: line 19: Uncaught TypeError: document.registerElement is not a function -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - -FAIL successfullyParsed should be true. Was false. - -TEST COMPLETE -
diff --git a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/HTMLTemplateElement/ownerDocument-import-expected.txt b/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/HTMLTemplateElement/ownerDocument-import-expected.txt deleted file mode 100644 index 68f4d1a..0000000 --- a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/HTMLTemplateElement/ownerDocument-import-expected.txt +++ /dev/null
@@ -1,11 +0,0 @@ -CONSOLE WARNING: HTML Imports is deprecated and has now been removed as of M80. See https://www.chromestatus.com/features/5144752345317376 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -CONSOLE ERROR: line 14: Uncaught TypeError: Cannot read property 'querySelector' of undefined -HTMLTemplateElement content ownerDocument in HTML imports should differ from import document - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - -FAIL Unexpected error: Uncaught TypeError: Cannot read property 'querySelector' of undefined -FAIL successfullyParsed should be true. Was false. - -TEST COMPLETE -
diff --git a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/SelectorAPI/only-shadow-host-in-shadow-tree-expected.txt b/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/SelectorAPI/only-shadow-host-in-shadow-tree-expected.txt deleted file mode 100644 index f570b47..0000000 --- a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/SelectorAPI/only-shadow-host-in-shadow-tree-expected.txt +++ /dev/null
@@ -1,10 +0,0 @@ -CONSOLE ERROR: line 87: Uncaught TypeError: element.createShadowRoot is not a function -crbug.com/359854: test for traversing elements in shadow tree. - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - -FAIL successfullyParsed should be true. Was false. - -TEST COMPLETE - -
diff --git a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/StyleSheet/css-insert-import-rule-to-shadow-stylesheets-expected.txt b/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/StyleSheet/css-insert-import-rule-to-shadow-stylesheets-expected.txt deleted file mode 100644 index 0e6ff99c..0000000 --- a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/StyleSheet/css-insert-import-rule-to-shadow-stylesheets-expected.txt +++ /dev/null
@@ -1 +0,0 @@ -CONSOLE ERROR: line 11: Uncaught TypeError: host.createShadowRoot is not a function
diff --git a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/adopt-node-with-shadow-root-expected.txt b/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/adopt-node-with-shadow-root-expected.txt deleted file mode 100644 index 90afdf21..0000000 --- a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/adopt-node-with-shadow-root-expected.txt +++ /dev/null
@@ -1,5 +0,0 @@ -CONSOLE ERROR: line 12: Uncaught TypeError: foreignDocument.getElementById(...).createShadowRoot is not a function -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/anchor-content-projected-expected.txt b/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/anchor-content-projected-expected.txt deleted file mode 100644 index 274b500..0000000 --- a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/anchor-content-projected-expected.txt +++ /dev/null
@@ -1,11 +0,0 @@ -CONSOLE ERROR: line 27: Uncaught TypeError: host.createShadowRoot is not a function -Links should be clickable even when their content is projected into them. - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - -FAIL Unexpected error: Uncaught TypeError: host.createShadowRoot is not a function -FAIL successfullyParsed should be true. Was false. - -TEST COMPLETE - -Example link
diff --git a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/attr-dir-inherit-expected.txt b/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/attr-dir-inherit-expected.txt deleted file mode 100644 index 95f1828..0000000 --- a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/attr-dir-inherit-expected.txt +++ /dev/null
@@ -1,5 +0,0 @@ -CONSOLE ERROR: line 29: Uncaught TypeError: parent.createShadowRoot is not a function -This is a testharness.js-based test. -Harness Error. harness_status.status = 1 , harness_status.message = Uncaught TypeError: parent.createShadowRoot is not a function -Harness: the test ran to completion. -
diff --git a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/cascade-of-treeboundary-crossing-rules-expected.txt b/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/cascade-of-treeboundary-crossing-rules-expected.txt deleted file mode 100644 index 2d41e8a..0000000 --- a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/cascade-of-treeboundary-crossing-rules-expected.txt +++ /dev/null
@@ -1,10 +0,0 @@ -Test for casacde of treeboundary crossing rules. - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - -FAIL borderColorOf(getNodeInComposedTree("target")) should be rgb(0, 128, 0). Was rgb(0, 0, 255). -PASS borderColorOf(getNodeInComposedTree("host/target")) is "rgb(0, 128, 0)" -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/content-element-distributed-nodes-expected.txt b/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/content-element-distributed-nodes-expected.txt deleted file mode 100644 index 932c9b6..0000000 --- a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/content-element-distributed-nodes-expected.txt +++ /dev/null
@@ -1,10 +0,0 @@ -CONSOLE ERROR: line 87: Uncaught TypeError: element.createShadowRoot is not a function -Tests for content element's getDistributedNodes(). - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - -FAIL successfullyParsed should be true. Was false. - -TEST COMPLETE - -
diff --git a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/content-element-fallback-display-none-dynamic-expected.txt b/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/content-element-fallback-display-none-dynamic-expected.txt deleted file mode 100644 index b76b4b1..0000000 --- a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/content-element-fallback-display-none-dynamic-expected.txt +++ /dev/null
@@ -1 +0,0 @@ -CONSOLE ERROR: line 5: Uncaught TypeError: host.createShadowRoot is not a function
diff --git a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/content-element-includer-expected.txt b/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/content-element-includer-expected.txt deleted file mode 100644 index a72c7b79..0000000 --- a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/content-element-includer-expected.txt +++ /dev/null
@@ -1,9 +0,0 @@ -CONSOLE ERROR: line 32: Uncaught TypeError: elementWithShadow.createShadowRoot is not a function -This tests the correctness of includers of forwarded children. -Note that this test needs internals object thus cannot run outside DRT. - -FAIL includerFor(childOfElementWithoutShadow) should be null. Threw exception TypeError: element.getDestinationInsertionPoints is not a function -FAIL successfullyParsed should be true. Was false. - -TEST COMPLETE -
diff --git a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/content-element-outside-shadow-style-expected.txt b/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/content-element-outside-shadow-style-expected.txt deleted file mode 100644 index c72e3b1..0000000 --- a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/content-element-outside-shadow-style-expected.txt +++ /dev/null
@@ -1 +0,0 @@ -CONSOLE ERROR: line 22: Uncaught TypeError: hostWithChild.createShadowRoot is not a function
diff --git a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/content-element-renderers-expected.txt b/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/content-element-renderers-expected.txt deleted file mode 100644 index c6bfae8..0000000 --- a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/content-element-renderers-expected.txt +++ /dev/null
@@ -1,2 +0,0 @@ -CONSOLE ERROR: line 83: Uncaught TypeError: host.createShadowRoot is not a function -
diff --git a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/content-element-select-namespace-expected.txt b/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/content-element-select-namespace-expected.txt deleted file mode 100644 index 43ec756..0000000 --- a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/content-element-select-namespace-expected.txt +++ /dev/null
@@ -1 +0,0 @@ -CONSOLE ERROR: line 9: Uncaught TypeError: h.createShadowRoot is not a function
diff --git a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/content-pseudo-element-dynamic-class-expected.txt b/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/content-pseudo-element-dynamic-class-expected.txt deleted file mode 100644 index 5027d56..0000000 --- a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/content-pseudo-element-dynamic-class-expected.txt +++ /dev/null
@@ -1 +0,0 @@ -CONSOLE ERROR: line 14: Uncaught TypeError: host1.createShadowRoot is not a function
diff --git a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/content-pseudo-element-expected.txt b/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/content-pseudo-element-expected.txt deleted file mode 100644 index a2ca8a33..0000000 --- a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/content-pseudo-element-expected.txt +++ /dev/null
@@ -1 +0,0 @@ -CONSOLE ERROR: line 87: Uncaught TypeError: element.createShadowRoot is not a function
diff --git a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/content-pseudo-element-match-all-expected.txt b/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/content-pseudo-element-match-all-expected.txt deleted file mode 100644 index a2ca8a33..0000000 --- a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/content-pseudo-element-match-all-expected.txt +++ /dev/null
@@ -1 +0,0 @@ -CONSOLE ERROR: line 87: Uncaught TypeError: element.createShadowRoot is not a function
diff --git a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/content-pseudo-element-match-descendant-expected.txt b/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/content-pseudo-element-match-descendant-expected.txt deleted file mode 100644 index a2ca8a33..0000000 --- a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/content-pseudo-element-match-descendant-expected.txt +++ /dev/null
@@ -1 +0,0 @@ -CONSOLE ERROR: line 87: Uncaught TypeError: element.createShadowRoot is not a function
diff --git a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/content-pseudo-element-nested-expected.txt b/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/content-pseudo-element-nested-expected.txt deleted file mode 100644 index a2ca8a33..0000000 --- a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/content-pseudo-element-nested-expected.txt +++ /dev/null
@@ -1 +0,0 @@ -CONSOLE ERROR: line 87: Uncaught TypeError: element.createShadowRoot is not a function
diff --git a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/content-pseudo-element-not-last-expected.txt b/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/content-pseudo-element-not-last-expected.txt deleted file mode 100644 index c0c98b5..0000000 --- a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/content-pseudo-element-not-last-expected.txt +++ /dev/null
@@ -1,10 +0,0 @@ -CONSOLE ERROR: line 9: Uncaught TypeError: host.createShadowRoot is not a function -Accept simple selectors after ::content For Polymer 0.5 compat - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - -FAIL successfullyParsed should be true. Was false. - -TEST COMPLETE - -This text should be green
diff --git a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/content-pseudo-element-overridden-2-expected.txt b/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/content-pseudo-element-overridden-2-expected.txt deleted file mode 100644 index fcee69b..0000000 --- a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/content-pseudo-element-overridden-2-expected.txt +++ /dev/null
@@ -1,9 +0,0 @@ -CONSOLE ERROR: line 87: Uncaught TypeError: element.createShadowRoot is not a function -Test for crbug.com/274059. Compare rules from a style in a shadow tree with ::content in a different shadow tree. - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - -FAIL successfullyParsed should be true. Was false. - -TEST COMPLETE -
diff --git a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/content-pseudo-element-overridden-expected.txt b/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/content-pseudo-element-overridden-expected.txt deleted file mode 100644 index 055702f..0000000 --- a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/content-pseudo-element-overridden-expected.txt +++ /dev/null
@@ -1,11 +0,0 @@ -CONSOLE ERROR: line 33: Uncaught TypeError: host.createShadowRoot is not a function -content - -Test for crbug.com/274059. Should be able to override ::content styles in shadow root style sheet from the document. - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - -FAIL successfullyParsed should be true. Was false. - -TEST COMPLETE -
diff --git a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/content-pseudo-element-relative-selector-expected.txt b/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/content-pseudo-element-relative-selector-expected.txt deleted file mode 100644 index a2ca8a33..0000000 --- a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/content-pseudo-element-relative-selector-expected.txt +++ /dev/null
@@ -1 +0,0 @@ -CONSOLE ERROR: line 87: Uncaught TypeError: element.createShadowRoot is not a function
diff --git a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/content-pseudo-element-reprojection-expected.txt b/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/content-pseudo-element-reprojection-expected.txt deleted file mode 100644 index a2ca8a33..0000000 --- a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/content-pseudo-element-reprojection-expected.txt +++ /dev/null
@@ -1 +0,0 @@ -CONSOLE ERROR: line 87: Uncaught TypeError: element.createShadowRoot is not a function
diff --git a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/content-pseudo-element-specifiers-in-left-side-expected.txt b/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/content-pseudo-element-specifiers-in-left-side-expected.txt deleted file mode 100644 index a2ca8a33..0000000 --- a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/content-pseudo-element-specifiers-in-left-side-expected.txt +++ /dev/null
@@ -1 +0,0 @@ -CONSOLE ERROR: line 87: Uncaught TypeError: element.createShadowRoot is not a function
diff --git a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/content-pseudo-element-support-selector-expected.txt b/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/content-pseudo-element-support-selector-expected.txt deleted file mode 100644 index a2ca8a33..0000000 --- a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/content-pseudo-element-support-selector-expected.txt +++ /dev/null
@@ -1 +0,0 @@ -CONSOLE ERROR: line 87: Uncaught TypeError: element.createShadowRoot is not a function
diff --git a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/content-pseudo-element-used-in-selector-list-expected.txt b/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/content-pseudo-element-used-in-selector-list-expected.txt deleted file mode 100644 index a2ca8a33..0000000 --- a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/content-pseudo-element-used-in-selector-list-expected.txt +++ /dev/null
@@ -1 +0,0 @@ -CONSOLE ERROR: line 87: Uncaught TypeError: element.createShadowRoot is not a function
diff --git a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/content-pseudo-element-with-any-expected.txt b/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/content-pseudo-element-with-any-expected.txt deleted file mode 100644 index a2ca8a33..0000000 --- a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/content-pseudo-element-with-any-expected.txt +++ /dev/null
@@ -1 +0,0 @@ -CONSOLE ERROR: line 87: Uncaught TypeError: element.createShadowRoot is not a function
diff --git a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/content-pseudo-element-with-host-pseudo-class-2-expected.txt b/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/content-pseudo-element-with-host-pseudo-class-2-expected.txt deleted file mode 100644 index e8676e86..0000000 --- a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/content-pseudo-element-with-host-pseudo-class-2-expected.txt +++ /dev/null
@@ -1,9 +0,0 @@ -CONSOLE ERROR: line 87: Uncaught TypeError: element.createShadowRoot is not a function -Test for crbug.com/274063: cannot style ::content with a rule that includes :host. - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - -FAIL successfullyParsed should be true. Was false. - -TEST COMPLETE -
diff --git a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/content-pseudo-element-with-host-pseudo-class-expected.txt b/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/content-pseudo-element-with-host-pseudo-class-expected.txt deleted file mode 100644 index c64f5870..0000000 --- a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/content-pseudo-element-with-host-pseudo-class-expected.txt +++ /dev/null
@@ -1,11 +0,0 @@ -CONSOLE ERROR: line 34: Uncaught TypeError: host.createShadowRoot is not a function -content - -Test for crbug.com/274063, cannot style ::content with a rule that includes :host. - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - -FAIL successfullyParsed should be true. Was false. - -TEST COMPLETE -
diff --git a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/content-pseudo-element-with-nested-shadow-expected.txt b/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/content-pseudo-element-with-nested-shadow-expected.txt deleted file mode 100644 index 4d97abd..0000000 --- a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/content-pseudo-element-with-nested-shadow-expected.txt +++ /dev/null
@@ -1,9 +0,0 @@ -CONSOLE ERROR: line 87: Uncaught TypeError: element.createShadowRoot is not a function -Test for http://crbug.com/360679, ::content rules in nested ShadowDOM should match correctly. - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - -FAIL successfullyParsed should be true. Was false. - -TEST COMPLETE -
diff --git a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/content-reprojection-complex-expected.txt b/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/content-reprojection-complex-expected.txt deleted file mode 100644 index da559eb4..0000000 --- a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/content-reprojection-complex-expected.txt +++ /dev/null
@@ -1 +0,0 @@ -CONSOLE ERROR: line 15: Uncaught TypeError: host1.createShadowRoot is not a function
diff --git a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/content-reprojection-fallback-crash-expected.txt b/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/content-reprojection-fallback-crash-expected.txt deleted file mode 100644 index 6a351e8f..0000000 --- a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/content-reprojection-fallback-crash-expected.txt +++ /dev/null
@@ -1,7 +0,0 @@ -CONSOLE ERROR: line 13: Uncaught TypeError: host1.createShadowRoot is not a function -A crash should not happen when fallback elements are reprojected. - -FAIL successfullyParsed should be true. Was false. - -TEST COMPLETE -
diff --git a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/content-reprojection-fallback-expected.txt b/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/content-reprojection-fallback-expected.txt deleted file mode 100644 index 183516c5..0000000 --- a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/content-reprojection-fallback-expected.txt +++ /dev/null
@@ -1 +0,0 @@ -CONSOLE ERROR: line 10: Uncaught TypeError: host1.createShadowRoot is not a function
diff --git a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/content-reprojection-fallback-reprojection-expected.txt b/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/content-reprojection-fallback-reprojection-expected.txt deleted file mode 100644 index 183516c5..0000000 --- a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/content-reprojection-fallback-reprojection-expected.txt +++ /dev/null
@@ -1 +0,0 @@ -CONSOLE ERROR: line 10: Uncaught TypeError: host1.createShadowRoot is not a function
diff --git a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/content-reprojection-reattach-expected.txt b/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/content-reprojection-reattach-expected.txt deleted file mode 100644 index ecf46d1..0000000 --- a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/content-reprojection-reattach-expected.txt +++ /dev/null
@@ -1 +0,0 @@ -CONSOLE ERROR: line 9: Uncaught TypeError: host.createShadowRoot is not a function
diff --git a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/content-reprojection-recalc-expected.txt b/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/content-reprojection-recalc-expected.txt deleted file mode 100644 index da4a13c..0000000 --- a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/content-reprojection-recalc-expected.txt +++ /dev/null
@@ -1,10 +0,0 @@ -CONSOLE ERROR: line 16: Uncaught TypeError: host.createShadowRoot is not a function -Redistribution into same position should not cause style recalc - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - -PASS window.internals is defined. -FAIL successfullyParsed should be true. Was false. - -TEST COMPLETE -
diff --git a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/content-reprojection-shadow-expected.txt b/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/content-reprojection-shadow-expected.txt deleted file mode 100644 index 5027d56..0000000 --- a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/content-reprojection-shadow-expected.txt +++ /dev/null
@@ -1 +0,0 @@ -CONSOLE ERROR: line 14: Uncaught TypeError: host1.createShadowRoot is not a function
diff --git a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/content-whitespace-attach-expected.txt b/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/content-whitespace-attach-expected.txt deleted file mode 100644 index b76b4b1..0000000 --- a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/content-whitespace-attach-expected.txt +++ /dev/null
@@ -1 +0,0 @@ -CONSOLE ERROR: line 5: Uncaught TypeError: host.createShadowRoot is not a function
diff --git a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/create-content-element-expected.txt b/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/create-content-element-expected.txt deleted file mode 100644 index 172d081..0000000 --- a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/create-content-element-expected.txt +++ /dev/null
@@ -1,4 +0,0 @@ -CONSOLE ERROR: line 27: Uncaught TypeError: target.createShadowRoot is not a function -Hello,contentWorld. -This test compares a shadow-based render tree with one for a reference DOM tree. -
diff --git a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/custom-pseudo-scope-expected.txt b/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/custom-pseudo-scope-expected.txt deleted file mode 100644 index 183516c5..0000000 --- a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/custom-pseudo-scope-expected.txt +++ /dev/null
@@ -1 +0,0 @@ -CONSOLE ERROR: line 10: Uncaught TypeError: host1.createShadowRoot is not a function
diff --git a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/disconnected-distribution-cycle-expected.txt b/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/disconnected-distribution-cycle-expected.txt deleted file mode 100644 index cac97e36..0000000 --- a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/disconnected-distribution-cycle-expected.txt +++ /dev/null
@@ -1,9 +0,0 @@ -CONSOLE ERROR: line 19: Uncaught TypeError: a.getDestinationInsertionPoints is not a function -Distributions from disconnected subtrees should be cleared when inserted again to avoid cycles. - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - -FAIL successfullyParsed should be true. Was false. - -TEST COMPLETE -
diff --git a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/distributed-node-focus-expected.txt b/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/distributed-node-focus-expected.txt deleted file mode 100644 index b993f6d..0000000 --- a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/distributed-node-focus-expected.txt +++ /dev/null
@@ -1,6 +0,0 @@ -CONSOLE ERROR: line 87: Uncaught TypeError: element.createShadowRoot is not a function -FAIL successfullyParsed should be true. Was false. - -TEST COMPLETE - -
diff --git a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/distribution-for-detached-subtree-expected.txt b/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/distribution-for-detached-subtree-expected.txt deleted file mode 100644 index 0a16acef..0000000 --- a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/distribution-for-detached-subtree-expected.txt +++ /dev/null
@@ -1,9 +0,0 @@ -CONSOLE ERROR: line 8: Uncaught TypeError: shadowHost.createShadowRoot is not a function -distribution should be recalculated correctly for a detached subtree. - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - -FAIL successfullyParsed should be true. Was false. - -TEST COMPLETE -
diff --git a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/distribution-for-event-path-expected.txt b/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/distribution-for-event-path-expected.txt deleted file mode 100644 index 3500e4e..0000000 --- a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/distribution-for-event-path-expected.txt +++ /dev/null
@@ -1,4 +0,0 @@ -CONSOLE ERROR: line 11: Uncaught TypeError: a.createShadowRoot is not a function - - -
diff --git a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/distribution-update-recalcs-style-expected.txt b/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/distribution-update-recalcs-style-expected.txt deleted file mode 100644 index 7f7cbc5..0000000 --- a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/distribution-update-recalcs-style-expected.txt +++ /dev/null
@@ -1,25 +0,0 @@ -CONSOLE ERROR: line 27: Uncaught TypeError: document.getElementById(...).createShadowRoot is not a function -Tests to ensure that updating the select rule in projection causes style recalc. - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - - - - - - - - - - - - - - - - - -FAIL successfullyParsed should be true. Was false. - -TEST COMPLETE -
diff --git a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/dynamically-created-shadow-root-expected.txt b/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/dynamically-created-shadow-root-expected.txt deleted file mode 100644 index 5f1b07a..0000000 --- a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/dynamically-created-shadow-root-expected.txt +++ /dev/null
@@ -1 +0,0 @@ -CONSOLE ERROR: line 11: Uncaught TypeError: host1.createShadowRoot is not a function
diff --git a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/event-path-in-shadow-tree-expected.txt b/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/event-path-in-shadow-tree-expected.txt deleted file mode 100644 index 3929523..0000000 --- a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/event-path-in-shadow-tree-expected.txt +++ /dev/null
@@ -1,14 +0,0 @@ - -event.path on node #C -#C, #B, #A, #sandbox, [object HTMLBodyElement], [object HTMLHtmlElement], [object HTMLDocument], [object Window], length: 8 - -event.path on node #B -#C, #B, #A, #sandbox, [object HTMLBodyElement], [object HTMLHtmlElement], [object HTMLDocument], [object Window], length: 8 - -event.path on node #A -#C, #B, #A, #sandbox, [object HTMLBodyElement], [object HTMLHtmlElement], [object HTMLDocument], [object Window], length: 8 -PASS successfullyParsed is true - -TEST COMPLETE - -
diff --git a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/event-path-with-dom-mutation-expected.txt b/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/event-path-with-dom-mutation-expected.txt deleted file mode 100644 index 65bbe25..0000000 --- a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/event-path-with-dom-mutation-expected.txt +++ /dev/null
@@ -1,16 +0,0 @@ - -event.path on node #C -#C, #B, #A, #sandbox, [object HTMLBodyElement], [object HTMLHtmlElement], [object HTMLDocument], [object Window], length: 8 - -event.path on node #B -#C, #B, #A, #sandbox, [object HTMLBodyElement], [object HTMLHtmlElement], [object HTMLDocument], [object Window], length: 8 - -Removing node #C - -event.path on node #A -#C, #B, #A, #sandbox, [object HTMLBodyElement], [object HTMLHtmlElement], [object HTMLDocument], [object Window], length: 8 -PASS successfullyParsed is true - -TEST COMPLETE - -
diff --git a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/events-stopped-at-shadow-boundary-expected.txt b/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/events-stopped-at-shadow-boundary-expected.txt deleted file mode 100644 index 389d613d..0000000 --- a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/events-stopped-at-shadow-boundary-expected.txt +++ /dev/null
@@ -1,52 +0,0 @@ -Tests to ensure that all kinds of events are not stopeed at shadow boundary if created by users. - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - -None of the events should be stopped at a Shadow boundary if created by users. - - abort - @target (target: target) - @parent-of-target (target: target) - - select - @target (target: target) - @parent-of-target (target: target) - - change - @target (target: target) - @parent-of-target (target: target) - - reset - @target (target: target) - @parent-of-target (target: target) - - resize - @target (target: target) - @parent-of-target (target: target) - - scroll - @target (target: target) - @parent-of-target (target: target) - - selectstart - @target (target: target) - @parent-of-target (target: target) - - load - @target (target: target) - @parent-of-target (target: target) - - click - @target (target: target) - @parent-of-target (target: target) - -An event fired on a distributed child should not be stopped at the shadow boundary of its host (host2), but should be stopped at the nearest shadow boundary (host1). - - selectstart - @distributed-child (target: distributed-child) - @host2 (target: distributed-child) -PASS successfullyParsed is true - -TEST COMPLETE - -
diff --git a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/flat-tree-traversal-expected.txt b/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/flat-tree-traversal-expected.txt deleted file mode 100644 index 7dea089e..0000000 --- a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/flat-tree-traversal-expected.txt +++ /dev/null
@@ -1,306 +0,0 @@ -Tests for Composed Shadow DOM Tree Traversal APIs. Can only run within DRT - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - -ShadowRoot should be used. -Flat Tree: -#a - #b - -Traverse in forward. -#a -#b -Traverse in backward. -#b -#a - -A content element should select light children -Flat Tree: -#a - #b - [object HTMLContentElement] - -Traverse in forward. -#a -#b -[object HTMLContentElement] -Traverse in backward. -[object HTMLContentElement] -#b -#a - -Test for content element selector. -Flat Tree: -#a - #b - [object HTMLContentElement] - -Traverse in forward. -#a -#b -[object HTMLContentElement] -Traverse in backward. -[object HTMLContentElement] -#b -#a - -Light children should be selected only at once. -Flat Tree: -#a - #b - [object HTMLContentElement] - [object HTMLContentElement] - -Traverse in forward. -#a -#b -[object HTMLContentElement] -[object HTMLContentElement] -Traverse in backward. -[object HTMLContentElement] -[object HTMLContentElement] -#b -#a - -A content element can have fallback elements. -Flat Tree: -#a - #b - [object HTMLContentElement] - #f1 - #f2 - -Traverse in forward. -#a -#b -[object HTMLContentElement] -#f1 -#f2 -Traverse in backward. -#f2 -#f1 -[object HTMLContentElement] -#b -#a - -Fallback elements should not be used if a content element selects an element. -Flat Tree: -#a - #b - [object HTMLContentElement] - #f1 - #f2 - -Traverse in forward. -#a -#b -[object HTMLContentElement] -#f1 -#f2 -Traverse in backward. -#f2 -#f1 -[object HTMLContentElement] -#b -#a - -Test for traversal, starting with a fallback element which is not used. -Flat Tree: -#f1 - #f2 - -Traverse in forward. -#f1 -#f2 -Traverse in backward. -#f2 -#f1 - -Next node of [#f1] is [#f2] -Next node of [#f2] is [[object Text]] - -Test for Nested ShadowRoots. -Flat Tree: -#a - #b - #c - [object HTMLContentElement] - #d - #f - [object HTMLContentElement] - #g - -Traverse in forward. -#a -#b -#c -[object HTMLContentElement] -#d -#f -[object HTMLContentElement] -#g -Traverse in backward. -#g -[object HTMLContentElement] -#f -#d -[object HTMLContentElement] -#c -#b -#a - -Test for inactive insertion points. -Flat Tree: -#a - #b - #c - -Traverse in forward. -#a -#b -#c -Traverse in backward. -#c -#b -#a - -Test for a content element which does not select any nodes nor have fallback elements. -Flat Tree: -#a - [object HTMLContentElement] - #b - [object HTMLContentElement] - #c - [object HTMLContentElement] - -Traverse in forward. -#a -[object HTMLContentElement] -#b -[object HTMLContentElement] -#c -[object HTMLContentElement] -Traverse in backward. -[object HTMLContentElement] -#c -[object HTMLContentElement] -#b -[object HTMLContentElement] -#a - -Test for a nested insertion point. -Flat Tree: -#a - #b - [object HTMLContentElement] - -Traverse in forward. -#a -#b -[object HTMLContentElement] -Traverse in backward. -[object HTMLContentElement] -#b -#a - -Test for nested insertion points. Some of them are either empty insertion points or inactive insertion points. -Flat Tree: -#a - [object HTMLContentElement] - #b - [object HTMLContentElement] - #c - [object HTMLContentElement] - -Traverse in forward. -#a -[object HTMLContentElement] -#b -[object HTMLContentElement] -#c -[object HTMLContentElement] -Traverse in backward. -[object HTMLContentElement] -#c -[object HTMLContentElement] -#b -[object HTMLContentElement] -#a - -Test for a re-projection. -Flat Tree: -#a - #b - [object HTMLContentElement] - -Traverse in forward. -#a -#b -[object HTMLContentElement] -Traverse in backward. -[object HTMLContentElement] -#b -#a - -Test for a content element which is selected by another content element. -Flat Tree: -#a - #b - [object HTMLContentElement] - #most-inner-child - [object HTMLContentElement] - -Traverse in forward. -#a -#b -[object HTMLContentElement] -#most-inner-child -[object HTMLContentElement] -Traverse in backward. -[object HTMLContentElement] -#most-inner-child -[object HTMLContentElement] -#b -#a - -Test for a reprojection. Content elements should be used in document order. -Flat Tree: -#a - [object HTMLContentElement] - #b - [object HTMLContentElement] - -Traverse in forward. -#a -[object HTMLContentElement] -#b -[object HTMLContentElement] -Traverse in backward. -[object HTMLContentElement] -#b -[object HTMLContentElement] -#a - -Test for complex re-projections. -Flat Tree: -#a - #b - [object HTMLContentElement] - #c - -Traverse in forward. -#a -#b -[object HTMLContentElement] -#c -Traverse in backward. -#c -[object HTMLContentElement] -#b -#a - -PASS successfullyParsed is true - -TEST COMPLETE - -
diff --git a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/focus-navigation-with-distributed-nodes-expected.txt b/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/focus-navigation-with-distributed-nodes-expected.txt deleted file mode 100644 index a5a8924a..0000000 --- a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/focus-navigation-with-distributed-nodes-expected.txt +++ /dev/null
@@ -1,8 +0,0 @@ -CONSOLE ERROR: line 87: Uncaught TypeError: element.createShadowRoot is not a function -This tests that pressing Tab key should traverse into shadow DOM subtrees, and pressing Shift-Tab should reverse the order. - -FAIL successfullyParsed should be true. Was false. - -TEST COMPLETE - -
diff --git a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/gesture-tap-expected.txt b/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/gesture-tap-expected.txt deleted file mode 100644 index 68d2af2..0000000 --- a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/gesture-tap-expected.txt +++ /dev/null
@@ -1,12 +0,0 @@ -FAIL event.eventPhase should be 2. Threw exception TypeError: Cannot read property 'eventPhase' of undefined -FAIL event.eventPhase should be 2. Threw exception TypeError: Cannot read property 'eventPhase' of undefined -FAIL event.eventPhase should be 2. Threw exception TypeError: Cannot read property 'eventPhase' of undefined - - gesturetap - @div1-shadow-root-child (target: div1-shadow-root-child) - @div1 (target: div1) -PASS successfullyParsed is true - -TEST COMPLETE - -
diff --git a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/gesture-tapHighlight-shadow-tree-expected.txt b/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/gesture-tapHighlight-shadow-tree-expected.txt deleted file mode 100644 index e9675938..0000000 --- a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/gesture-tapHighlight-shadow-tree-expected.txt +++ /dev/null
@@ -1,2 +0,0 @@ -CONSOLE ERROR: line 17: Uncaught TypeError: document.querySelector(...).createShadowRoot is not a function -CONSOLE ERROR: line 22: Uncaught TypeError: Cannot read property 'getBoundingClientRect' of undefined
diff --git a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/get-destination-insertion-points-skips-user-agent-shadow-expected.txt b/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/get-destination-insertion-points-skips-user-agent-shadow-expected.txt deleted file mode 100644 index 20124e9..0000000 --- a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/get-destination-insertion-points-skips-user-agent-shadow-expected.txt +++ /dev/null
@@ -1,10 +0,0 @@ -CONSOLE ERROR: line 20: Uncaught TypeError: document.getElementById(...).getDestinationInsertionPoints is not a function -Tests that getDestinationInsertionPoints() should skip insertion points in user-agent shadow roots. - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - -FAIL successfullyParsed should be true. Was false. - -TEST COMPLETE - -
diff --git a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/get-distributed-nodes-orphan-expected.txt b/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/get-distributed-nodes-orphan-expected.txt deleted file mode 100644 index d1528f8a..0000000 --- a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/get-distributed-nodes-orphan-expected.txt +++ /dev/null
@@ -1,10 +0,0 @@ -CONSOLE ERROR: line 26: Uncaught TypeError: host.createShadowRoot is not a function -getDistributedNodes() should work out of Document - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - -FAIL successfullyParsed should be true. Was false. - -TEST COMPLETE - -
diff --git a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/getComputedStyle-with-distribution-expected.txt b/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/getComputedStyle-with-distribution-expected.txt deleted file mode 100644 index bbb299c..0000000 --- a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/getComputedStyle-with-distribution-expected.txt +++ /dev/null
@@ -1,10 +0,0 @@ -crbug.com/337618: computedStyle should be cleared when distribution is updated - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - -FAIL window.getComputedStyle(getNodeInComposedTree("child/bar")).color should be rgb(0, 128, 0). Was rgb(0, 0, 0). -PASS window.getComputedStyle(getNodeInComposedTree("child/bar")).color is "rgb(0, 0, 0)" -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/host-context-class-change-expected.txt b/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/host-context-class-change-expected.txt deleted file mode 100644 index 5a763ce..0000000 --- a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/host-context-class-change-expected.txt +++ /dev/null
@@ -1,11 +0,0 @@ -Class change affecting a node in a distributed node's subtree. - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - -PASS getComputedStyle(b, null).backgroundColor is transparent -FAIL getComputedStyle(b, null).backgroundColor should be rgb(0, 128, 0). Was rgba(0, 0, 0, 0). -PASS successfullyParsed is true - -TEST COMPLETE - -
diff --git a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/hostcontext-pseudo-class-expected.txt b/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/hostcontext-pseudo-class-expected.txt deleted file mode 100644 index 84e82580..0000000 --- a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/hostcontext-pseudo-class-expected.txt +++ /dev/null
@@ -1,47 +0,0 @@ -Test whether :host-context matches a shadow host correctly. - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - -:host-context out of shadow tree should not match any shadow hosts. -PASS backgroundColorOf('host') is "rgba(0, 0, 0, 0)" -:host-context with * should not match any shadow hosts. -PASS backgroundColorOf('host') is "rgba(0, 0, 0, 0)" -:host-context with tag selector should not match any shadow hosts. -PASS backgroundColorOf('host') is "rgba(0, 0, 0, 0)" -:host-context with class selector should not match any shadow hosts. -PASS backgroundColorOf('host') is "rgba(0, 0, 0, 0)" -:host-context with id selector should not match any shadow hosts. -PASS backgroundColorOf('host') is "rgba(0, 0, 0, 0)" -:host-context with attribute selector should not match any shadow hosts. -PASS backgroundColorOf('host') is "rgba(0, 0, 0, 0)" -:host-context in a shadow tree should match its shadow host. -PASS backgroundColorOf('host') is "rgb(0, 128, 0)" -:host-context with :host in a shadow tree should match its shadow host. -PASS backgroundColorOf('host') is "rgb(0, 128, 0)" -crbug.com/552602 :host-context with non-matching selector with :host should not crash. -PASS backgroundColorOf('host') is "rgba(0, 0, 0, 0)" -:host-context takes simple selectors and matches when one of the simple selectors matches. -PASS backgroundColorOf('host') is "rgb(0, 128, 0)" -:host-context matches a shadow host in just a nested shadow tree, not all enclosing shadow trees. -PASS backgroundColorOf('host1') is "rgba(0, 0, 0, 0)" -PASS backgroundColorOf('host1/host2') is "rgb(0, 128, 0)" -:host-context matches based on a flat tree. -FAIL backgroundColorOf('host/target') should be rgb(0, 128, 0). Was rgba(0, 0, 0, 0). -:host-context is updated when its matched ancestor changes className or id. -PASS backgroundColorOf('host') is "rgb(0, 128, 0)" -PASS backgroundColorOf('host') is "rgba(0, 0, 0, 0)" -PASS backgroundColorOf('host') is "rgb(0, 128, 0)" -PASS backgroundColorOf('host') is "rgba(0, 0, 0, 0)" -Compare :host-context with :host-context. -PASS backgroundColorOf('host') is "rgb(0, 128, 0)" -PASS backgroundColorOf('host') is "rgb(255, 0, 0)" -PASS backgroundColorOf('host/target') is "rgb(0, 128, 0)" -PASS backgroundColorOf('host/target') is "rgb(0, 128, 0)" -PASS backgroundColorOf('host/target') is "rgb(0, 128, 0)" -:host-context without functional notation should not match any shadow hosts. -PASS backgroundColorOf('host') is "rgba(0, 0, 0, 0)" -PASS successfullyParsed is true - -TEST COMPLETE - -
diff --git a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/hover-active-drag-distributed-nodes-expected.txt b/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/hover-active-drag-distributed-nodes-expected.txt deleted file mode 100644 index e13a9d8..0000000 --- a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/hover-active-drag-distributed-nodes-expected.txt +++ /dev/null
@@ -1,7 +0,0 @@ -CONSOLE ERROR: line 56: Uncaught TypeError: host.createShadowRoot is not a function -Top-level text Nested text -Other div -FAIL successfullyParsed should be true. Was false. - -TEST COMPLETE -
diff --git a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/import-rule-in-shadow-tree-needs-document-style-recalc-expected.txt b/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/import-rule-in-shadow-tree-needs-document-style-recalc-expected.txt deleted file mode 100644 index e4ab008..0000000 --- a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/import-rule-in-shadow-tree-needs-document-style-recalc-expected.txt +++ /dev/null
@@ -1 +0,0 @@ -CONSOLE ERROR: line 6: Uncaught TypeError: host.createShadowRoot is not a function
diff --git a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/new-fallback-expected.txt b/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/new-fallback-expected.txt deleted file mode 100644 index a2ca8a33..0000000 --- a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/new-fallback-expected.txt +++ /dev/null
@@ -1 +0,0 @@ -CONSOLE ERROR: line 87: Uncaught TypeError: element.createShadowRoot is not a function
diff --git a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/no-style-sharing-with-distributed-nodes-expected.txt b/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/no-style-sharing-with-distributed-nodes-expected.txt deleted file mode 100644 index b8fe741..0000000 --- a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/no-style-sharing-with-distributed-nodes-expected.txt +++ /dev/null
@@ -1 +0,0 @@ -CONSOLE ERROR: line 6: Uncaught TypeError: document.querySelector(...).createShadowRoot is not a function
diff --git a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/outer-scope-lower-specificity-wins-expected.txt b/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/outer-scope-lower-specificity-wins-expected.txt deleted file mode 100644 index 8d00b6d..0000000 --- a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/outer-scope-lower-specificity-wins-expected.txt +++ /dev/null
@@ -1,10 +0,0 @@ -Inner scope rules wins, with higher specificity (v0 bug compatibility). - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - -FAIL getComputedStyle(target).color should be rgb(255, 0, 0). Was rgb(0, 128, 0). -PASS successfullyParsed is true - -TEST COMPLETE - -
diff --git a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/pseudo-not-expected.txt b/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/pseudo-not-expected.txt deleted file mode 100644 index 025c4d1..0000000 --- a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/pseudo-not-expected.txt +++ /dev/null
@@ -1,9 +0,0 @@ -CONSOLE ERROR: line 14: Uncaught TypeError: host.createShadowRoot is not a function -Test the :not pseudo selector in - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - -FAIL successfullyParsed should be true. Was false. - -TEST COMPLETE -
diff --git a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/querySelector-with-detached-node-distribution-expected.txt b/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/querySelector-with-detached-node-distribution-expected.txt deleted file mode 100644 index 607cf1a..0000000 --- a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/querySelector-with-detached-node-distribution-expected.txt +++ /dev/null
@@ -1,10 +0,0 @@ -crbug.com/337618: querySelector needs ensure distribution. - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - -FAIL barShadowRoot.querySelectorAll(":host-context(.foo)::shadow div")[0].id should be bar. Threw exception TypeError: Cannot read property 'id' of undefined -PASS barShadowRoot.querySelectorAll(":host-context(.foo)::shadow div")[0] is undefined -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/querySelector-with-distribution-expected.txt b/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/querySelector-with-distribution-expected.txt deleted file mode 100644 index 607cf1a..0000000 --- a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/querySelector-with-distribution-expected.txt +++ /dev/null
@@ -1,10 +0,0 @@ -crbug.com/337618: querySelector needs ensure distribution. - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - -FAIL barShadowRoot.querySelectorAll(":host-context(.foo)::shadow div")[0].id should be bar. Threw exception TypeError: Cannot read property 'id' of undefined -PASS barShadowRoot.querySelectorAll(":host-context(.foo)::shadow div")[0] is undefined -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/querySelector-with-shadow-all-and-shadow-deep-expected.txt b/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/querySelector-with-shadow-all-and-shadow-deep-expected.txt deleted file mode 100644 index d8c8fefe..0000000 --- a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/querySelector-with-shadow-all-and-shadow-deep-expected.txt +++ /dev/null
@@ -1,5 +0,0 @@ -CONSOLE ERROR: line 87: Uncaught TypeError: element.createShadowRoot is not a function -FAIL successfullyParsed should be true. Was false. - -TEST COMPLETE -
diff --git a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/reattach-content-ancestor-expected.txt b/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/reattach-content-ancestor-expected.txt deleted file mode 100644 index ae0f9ef..0000000 --- a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/reattach-content-ancestor-expected.txt +++ /dev/null
@@ -1 +0,0 @@ -CONSOLE ERROR: line 7: Uncaught TypeError: host.createShadowRoot is not a function
diff --git a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/scrollbar-expected.txt b/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/scrollbar-expected.txt deleted file mode 100644 index cdec2ec9..0000000 --- a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/scrollbar-expected.txt +++ /dev/null
@@ -1 +0,0 @@ -CONSOLE ERROR: line 34: Uncaught TypeError: host.createShadowRoot is not a function
diff --git a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/shadow-boundary-events-expected.txt b/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/shadow-boundary-events-expected.txt deleted file mode 100644 index b3a33d7b..0000000 --- a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/shadow-boundary-events-expected.txt +++ /dev/null
@@ -1,158 +0,0 @@ -Tests to ensure that shadow DOM boundary is not crossed during event propagation. Can only run within DRT. - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - - -Move mouse from a node to its sibling node. All nodes are outside of shadow boundary. -Moving mouse from divB to divC -PASS dispatchedEvent("mouseover") is ["divC(<-divB)(@divC)", "divC(<-divB)(@divA)"] -PASS dispatchedEvent("mouseout") is ["divB(<-divC)(@divB)", "divB(<-divC)(@divA)"] - -Target is an ancestor of relatedTarget. All nodes are outside of shadow boundary. -Moving mouse from divB to divA -PASS dispatchedEvent("mouseover") is ["divA(<-divB)(@divA)"] -PASS dispatchedEvent("mouseout") is ["divB(<-divA)(@divB)", "divB(<-divA)(@divA)"] - -RelatedTarget is an ancestor of target. All nodes are outside of shadow boundary. -Moving mouse from divA to divB -PASS dispatchedEvent("mouseover") is ["divB(<-divA)(@divB)", "divB(<-divA)(@divA)"] -PASS dispatchedEvent("mouseout") is ["divA(<-divB)(@divA)"] - -Both target and relatedTarget are immediate children of the same shadow root. -Moving mouse from shadowD/shadowF/shadowG/divH to shadowD/shadowF/shadowG/divI -FAIL event.eventPhase should be 2. Threw exception TypeError: Cannot read property 'eventPhase' of undefined -FAIL event.eventPhase should be 2. Threw exception TypeError: Cannot read property 'eventPhase' of undefined -FAIL event.eventPhase should be 2. Threw exception TypeError: Cannot read property 'eventPhase' of undefined -FAIL event.eventPhase should be 2. Threw exception TypeError: Cannot read property 'eventPhase' of undefined -FAIL event.eventPhase should be 2. Threw exception TypeError: Cannot read property 'eventPhase' of undefined -PASS dispatchedEvent("mouseover") is ["divI(<-divH)(@divI)"] -PASS dispatchedEvent("mouseout") is ["divH(<-divI)(@divH)"] - -Target is an ancestor of relatedTarget. -Moving mouse from shadowD/shadowF/shadowG/divI to shadowD/divE -FAIL event.eventPhase should be 2. Threw exception TypeError: Cannot read property 'eventPhase' of undefined -FAIL event.eventPhase should be 2. Threw exception TypeError: Cannot read property 'eventPhase' of undefined -FAIL event.eventPhase should be 2. Threw exception TypeError: Cannot read property 'eventPhase' of undefined -FAIL event.eventPhase should be 2. Threw exception TypeError: Cannot read property 'eventPhase' of undefined -PASS dispatchedEvent("mouseover") is ["divE(<-shadowF)(@divE)"] -PASS dispatchedEvent("mouseout") is ["divI(<-divE)(@divI)", "shadowG(<-divE)(@shadowG)", "shadowF(<-divE)(@shadowF)", "shadowF(<-divE)(@divE)"] - -Target (shadow host) is an ancestor of relatedTarget. -Moving mouse from shadowD/shadowF/shadowG/divI to shadowD/shadowF -FAIL event.eventPhase should be 2. Threw exception TypeError: Cannot read property 'eventPhase' of undefined -FAIL event.eventPhase should be 2. Threw exception TypeError: Cannot read property 'eventPhase' of undefined -FAIL event.eventPhase should be 2. Threw exception TypeError: Cannot read property 'eventPhase' of undefined -FAIL event.eventPhase should be 2. Threw exception TypeError: Cannot read property 'eventPhase' of undefined -FAIL event.eventPhase should be 2. Threw exception TypeError: Cannot read property 'eventPhase' of undefined -FAIL event.eventPhase should be 2. Threw exception TypeError: Cannot read property 'eventPhase' of undefined -PASS dispatchedEvent("mouseover") is [] -PASS dispatchedEvent("mouseout") is ["divI(<-shadowF)(@divI)", "shadowG(<-shadowF)(@shadowG)"] - -Target (shadow host) is an ancestor of relatedTarget (shadow host). -Moving mouse from shadowD/shadowF/shadowG to shadowD -FAIL event.eventPhase should be 2. Threw exception TypeError: Cannot read property 'eventPhase' of undefined -FAIL event.eventPhase should be 2. Threw exception TypeError: Cannot read property 'eventPhase' of undefined -FAIL event.eventPhase should be 2. Threw exception TypeError: Cannot read property 'eventPhase' of undefined -PASS dispatchedEvent("mouseover") is [] -PASS dispatchedEvent("mouseout") is ["shadowG(<-shadowD)(@shadowG)", "shadowF(<-shadowD)(@shadowF)", "shadowF(<-shadowD)(@divE)"] - -RelatedTarget is ancestor of target. -Moving mouse from shadowD/divE to shadowD/shadowF/shadowG/divI -FAIL event.eventPhase should be 2. Threw exception TypeError: Cannot read property 'eventPhase' of undefined -FAIL event.eventPhase should be 2. Threw exception TypeError: Cannot read property 'eventPhase' of undefined -FAIL event.eventPhase should be 2. Threw exception TypeError: Cannot read property 'eventPhase' of undefined -FAIL event.eventPhase should be 2. Threw exception TypeError: Cannot read property 'eventPhase' of undefined -FAIL event.eventPhase should be 2. Threw exception TypeError: Cannot read property 'eventPhase' of undefined -PASS dispatchedEvent("mouseover") is ["divI(<-divE)(@divI)", "shadowG(<-divE)(@shadowG)", "shadowF(<-divE)(@shadowF)", "shadowF(<-divE)(@divE)"] -PASS dispatchedEvent("mouseout") is ["divE(<-shadowF)(@divE)"] - -RelatedTarget (shadow host) is ancestor of target. -Moving mouse from shadowD/shadowF to shadowD/shadowF/shadowG/divI -FAIL event.eventPhase should be 2. Threw exception TypeError: Cannot read property 'eventPhase' of undefined -FAIL event.eventPhase should be 2. Threw exception TypeError: Cannot read property 'eventPhase' of undefined -FAIL event.eventPhase should be 2. Threw exception TypeError: Cannot read property 'eventPhase' of undefined -FAIL event.eventPhase should be 2. Threw exception TypeError: Cannot read property 'eventPhase' of undefined -PASS dispatchedEvent("mouseover") is ["divI(<-shadowF)(@divI)", "shadowG(<-shadowF)(@shadowG)"] -PASS dispatchedEvent("mouseout") is [] - -RelatedTarget (shadow host) is an ancestor of target (shadow host). -Moving mouse from shadowD to shadowD/shadowF/shadowG -FAIL event.eventPhase should be 2. Threw exception TypeError: Cannot read property 'eventPhase' of undefined -FAIL event.eventPhase should be 2. Threw exception TypeError: Cannot read property 'eventPhase' of undefined -FAIL event.eventPhase should be 2. Threw exception TypeError: Cannot read property 'eventPhase' of undefined -FAIL event.eventPhase should be 2. Threw exception TypeError: Cannot read property 'eventPhase' of undefined -FAIL event.eventPhase should be 2. Threw exception TypeError: Cannot read property 'eventPhase' of undefined -PASS dispatchedEvent("mouseover") is ["shadowG(<-shadowD)(@shadowG)", "shadowF(<-shadowD)(@shadowF)", "shadowF(<-shadowD)(@divE)"] -PASS dispatchedEvent("mouseout") is [] - -Target and relatedTarget exist in separated subtree, crossing shadow boundaries. Making sure that event is not dispatched beyond the lowest common boundary. -Moving mouse from shadowD/shadowF/shadowG/divH to shadowD/shadowK/divL -FAIL event.eventPhase should be 2. Threw exception TypeError: Cannot read property 'eventPhase' of undefined -FAIL event.eventPhase should be 2. Threw exception TypeError: Cannot read property 'eventPhase' of undefined -FAIL event.eventPhase should be 2. Threw exception TypeError: Cannot read property 'eventPhase' of undefined -FAIL event.eventPhase should be 2. Threw exception TypeError: Cannot read property 'eventPhase' of undefined -FAIL event.eventPhase should be 2. Threw exception TypeError: Cannot read property 'eventPhase' of undefined -FAIL event.eventPhase should be 2. Threw exception TypeError: Cannot read property 'eventPhase' of undefined -PASS dispatchedEvent("mouseover") is ["divL(<-shadowF)(@divL)", "shadowK(<-shadowF)(@shadowK)", "shadowK(<-shadowF)(@divJ)"] -PASS dispatchedEvent("mouseout") is ["divH(<-shadowK)(@divH)", "shadowG(<-shadowK)(@shadowG)", "shadowF(<-shadowK)(@shadowF)", "shadowF(<-shadowK)(@divE)"] - -Move focus from a node to its sibling node. All nodes are outside of shadow boundary. -Moving focus from divB to divC -PASS dispatchedEvent("focusin") is ["divC(<-divB)(@divC)", "divC(<-divB)(@divA)"] -PASS dispatchedEvent("focusout") is ["divB(<-divC)(@divB)", "divB(<-divC)(@divA)"] - -Old focused node and new focused node exist in separated subtrees, crossing shadow boundaries. Making sure that an event is not dispatched beyond the lowest common boundary. -Moving focus from shadowD/shadowF/shadowG/divH to shadowD/shadowK/divL -FAIL event.eventPhase should be 2. Threw exception TypeError: Cannot read property 'eventPhase' of undefined -FAIL event.eventPhase should be 2. Threw exception TypeError: Cannot read property 'eventPhase' of undefined -FAIL event.eventPhase should be 2. Threw exception TypeError: Cannot read property 'eventPhase' of undefined -FAIL event.eventPhase should be 2. Threw exception TypeError: Cannot read property 'eventPhase' of undefined -FAIL event.eventPhase should be 2. Threw exception TypeError: Cannot read property 'eventPhase' of undefined -FAIL event.eventPhase should be 2. Threw exception TypeError: Cannot read property 'eventPhase' of undefined -FAIL event.eventPhase should be 2. Threw exception TypeError: Cannot read property 'eventPhase' of undefined -FAIL event.eventPhase should be 2. Threw exception TypeError: Cannot read property 'eventPhase' of undefined -FAIL event.eventPhase should be 2. Threw exception TypeError: Cannot read property 'eventPhase' of undefined -FAIL event.eventPhase should be 2. Threw exception TypeError: Cannot read property 'eventPhase' of undefined -FAIL event.eventPhase should be 2. Threw exception TypeError: Cannot read property 'eventPhase' of undefined -FAIL event.eventPhase should be 2. Threw exception TypeError: Cannot read property 'eventPhase' of undefined -FAIL event.eventPhase should be 2. Threw exception TypeError: Cannot read property 'eventPhase' of undefined -FAIL event.eventPhase should be 2. Threw exception TypeError: Cannot read property 'eventPhase' of undefined -FAIL event.eventPhase should be 2. Threw exception TypeError: Cannot read property 'eventPhase' of undefined -FAIL event.eventPhase should be 2. Threw exception TypeError: Cannot read property 'eventPhase' of undefined -PASS dispatchedEvent("focusin") is ["divL(<-shadowF)(@divL)", "shadowK(<-shadowF)(@shadowK)", "shadowK(<-shadowF)(@divJ)"] -PASS dispatchedEvent("focusout") is ["divH(<-shadowK)(@divH)", "shadowG(<-shadowK)(@shadowG)", "shadowF(<-shadowK)(@shadowF)", "shadowF(<-shadowK)(@divE)"] - -Move focus from a node to its sibling node. All nodes are outside of shadow boundary. -Moving focus from divB to divC -FAIL event.eventPhase should be 2. Threw exception TypeError: Cannot read property 'eventPhase' of undefined -FAIL event.eventPhase should be 2. Threw exception TypeError: Cannot read property 'eventPhase' of undefined -FAIL event.eventPhase should be 2. Threw exception TypeError: Cannot read property 'eventPhase' of undefined -FAIL event.eventPhase should be 2. Threw exception TypeError: Cannot read property 'eventPhase' of undefined -PASS dispatchedEvent("focus") is ["divC(<-divB)(@divA)(capturing phase)", "divC(<-divB)(@divC)"] -PASS dispatchedEvent("blur") is ["divB(<-divC)(@divA)(capturing phase)", "divB(<-divC)(@divB)"] - -Old focused node and new focused node exist in separated subtrees, crossing shadow boundaries. Making sure that an event is not dispatched beyond the lowest common boundary. -Moving focus from shadowD/shadowF/shadowG/divH to shadowD/shadowK/divL -FAIL event.eventPhase should be 2. Threw exception TypeError: Cannot read property 'eventPhase' of undefined -FAIL event.eventPhase should be 2. Threw exception TypeError: Cannot read property 'eventPhase' of undefined -FAIL event.eventPhase should be 2. Threw exception TypeError: Cannot read property 'eventPhase' of undefined -FAIL event.eventPhase should be 2. Threw exception TypeError: Cannot read property 'eventPhase' of undefined -FAIL event.eventPhase should be 2. Threw exception TypeError: Cannot read property 'eventPhase' of undefined -FAIL event.eventPhase should be 2. Threw exception TypeError: Cannot read property 'eventPhase' of undefined -FAIL event.eventPhase should be 2. Threw exception TypeError: Cannot read property 'eventPhase' of undefined -FAIL event.eventPhase should be 2. Threw exception TypeError: Cannot read property 'eventPhase' of undefined -FAIL event.eventPhase should be 2. Threw exception TypeError: Cannot read property 'eventPhase' of undefined -FAIL event.eventPhase should be 2. Threw exception TypeError: Cannot read property 'eventPhase' of undefined -FAIL event.eventPhase should be 2. Threw exception TypeError: Cannot read property 'eventPhase' of undefined -FAIL event.eventPhase should be 2. Threw exception TypeError: Cannot read property 'eventPhase' of undefined -FAIL event.eventPhase should be 2. Threw exception TypeError: Cannot read property 'eventPhase' of undefined -FAIL event.eventPhase should be 2. Threw exception TypeError: Cannot read property 'eventPhase' of undefined -FAIL event.eventPhase should be 2. Threw exception TypeError: Cannot read property 'eventPhase' of undefined -FAIL event.eventPhase should be 2. Threw exception TypeError: Cannot read property 'eventPhase' of undefined -PASS dispatchedEvent("focus") is ["shadowK(<-shadowF)(@divJ)(capturing phase)", "shadowK(<-shadowF)(@shadowK)", "divL(<-shadowF)(@divL)"] -PASS dispatchedEvent("blur") is ["shadowF(<-shadowK)(@divE)(capturing phase)", "shadowF(<-shadowK)(@shadowF)", "shadowG(<-shadowK)(@shadowG)", "divH(<-shadowK)(@divH)"] -PASS successfullyParsed is true - -TEST COMPLETE - -
diff --git a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/shadow-content-crash-expected.txt b/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/shadow-content-crash-expected.txt deleted file mode 100644 index 4fddd91..0000000 --- a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/shadow-content-crash-expected.txt +++ /dev/null
@@ -1 +0,0 @@ -CONSOLE ERROR: line 13: Uncaught TypeError: div.createShadowRoot is not a function
diff --git a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/shadow-contents-fallback-expected.txt b/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/shadow-contents-fallback-expected.txt deleted file mode 100644 index 8933920..0000000 --- a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/shadow-contents-fallback-expected.txt +++ /dev/null
@@ -1,2 +0,0 @@ -CONSOLE ERROR: line 63: Uncaught TypeError: target.createShadowRoot is not a function -
diff --git a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/shadow-contents-select-expected.txt b/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/shadow-contents-select-expected.txt deleted file mode 100644 index caf82db5..0000000 --- a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/shadow-contents-select-expected.txt +++ /dev/null
@@ -1 +0,0 @@ -CONSOLE ERROR: line 12: Uncaught TypeError: target.createShadowRoot is not a function
diff --git a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/shadow-disable-expected.txt b/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/shadow-disable-expected.txt deleted file mode 100644 index 3cc1669..0000000 --- a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/shadow-disable-expected.txt +++ /dev/null
@@ -1,52 +0,0 @@ -Tests to ensure that shadow element cannot be created in elements having dynamically created shadow root. - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - -DIV -FAIL element.createShadowRoot() should not be null. Threw exception TypeError: element.createShadowRoot is not a function -SPAN -FAIL element.createShadowRoot() should not be null. Threw exception TypeError: element.createShadowRoot is not a function -A -FAIL element.createShadowRoot() should not be null. Threw exception TypeError: element.createShadowRoot is not a function -SECTION -FAIL element.createShadowRoot() should not be null. Threw exception TypeError: element.createShadowRoot is not a function -g -FAIL element.createShadowRoot() should not be null. Threw exception TypeError: element.createShadowRoot is not a function -rect -FAIL element.createShadowRoot() should not be null. Threw exception TypeError: element.createShadowRoot is not a function -svg -FAIL element.createShadowRoot() should not be null. Threw exception TypeError: element.createShadowRoot is not a function -INPUT -PASS element.createShadowRoot() threw exception TypeError: element.createShadowRoot is not a function. -EMBED -PASS element.createShadowRoot() threw exception TypeError: element.createShadowRoot is not a function. -OBJECT -PASS element.createShadowRoot() threw exception TypeError: element.createShadowRoot is not a function. -AUDIO -PASS element.createShadowRoot() threw exception TypeError: element.createShadowRoot is not a function. -VIDEO -PASS element.createShadowRoot() threw exception TypeError: element.createShadowRoot is not a function. -SELECT -PASS element.createShadowRoot() threw exception TypeError: element.createShadowRoot is not a function. -IMG -PASS element.createShadowRoot() threw exception TypeError: element.createShadowRoot is not a function. -TEXTAREA -PASS element.createShadowRoot() threw exception TypeError: element.createShadowRoot is not a function. -IFRAME -PASS element.createShadowRoot() threw exception TypeError: element.createShadowRoot is not a function. -CANVAS -PASS element.createShadowRoot() threw exception TypeError: element.createShadowRoot is not a function. -METER -PASS element.createShadowRoot() threw exception TypeError: element.createShadowRoot is not a function. -PROGRESS -PASS element.createShadowRoot() threw exception TypeError: element.createShadowRoot is not a function. -VIDEO -PASS element.createShadowRoot() threw exception TypeError: element.createShadowRoot is not a function. -AUDIO -PASS element.createShadowRoot() threw exception TypeError: element.createShadowRoot is not a function. -FIELDSET -PASS element.createShadowRoot() threw exception TypeError: element.createShadowRoot is not a function. -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/shadow-dom-event-dispatching-child-of-inactive-content-expected.txt b/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/shadow-dom-event-dispatching-child-of-inactive-content-expected.txt deleted file mode 100644 index c882e4b..0000000 --- a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/shadow-dom-event-dispatching-child-of-inactive-content-expected.txt +++ /dev/null
@@ -1,22 +0,0 @@ - - -Flat Tree will be: -DIV id=sandbox - DIV id=top - DIV id=A - DIV id=B - CONTENT id=active-content - - -Moving mouse from A to child-of-inactive-content - - mouseout - @A (target: A) (related: ) - @top (target: A) (related: ) - - mouseover -PASS successfullyParsed is true - -TEST COMPLETE - -
diff --git a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/shadow-dom-event-dispatching-distributed-child-expected.txt b/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/shadow-dom-event-dispatching-distributed-child-expected.txt deleted file mode 100644 index b993f6d..0000000 --- a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/shadow-dom-event-dispatching-distributed-child-expected.txt +++ /dev/null
@@ -1,6 +0,0 @@ -CONSOLE ERROR: line 87: Uncaught TypeError: element.createShadowRoot is not a function -FAIL successfullyParsed should be true. Was false. - -TEST COMPLETE - -
diff --git a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/shadow-dom-event-dispatching-distributed-text-node-expected.txt b/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/shadow-dom-event-dispatching-distributed-text-node-expected.txt deleted file mode 100644 index b993f6d..0000000 --- a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/shadow-dom-event-dispatching-distributed-text-node-expected.txt +++ /dev/null
@@ -1,6 +0,0 @@ -CONSOLE ERROR: line 87: Uncaught TypeError: element.createShadowRoot is not a function -FAIL successfullyParsed should be true. Was false. - -TEST COMPLETE - -
diff --git a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/shadow-dom-event-dispatching-fallback-nodes-expected.txt b/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/shadow-dom-event-dispatching-fallback-nodes-expected.txt deleted file mode 100644 index bc449b6..0000000 --- a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/shadow-dom-event-dispatching-fallback-nodes-expected.txt +++ /dev/null
@@ -1,47 +0,0 @@ - - -Flat Tree will be: -DIV id=sandbox - DIV id=top - DIV id=A - CONTENT id=content1 - DIV id=used-fallback - CONTENT id=content2 - DIV id=non-used-fallback - - -Moving mouse from A/used-fallback to A -FAIL event.eventPhase should be 2. Threw exception TypeError: Cannot read property 'eventPhase' of undefined -FAIL event.eventPhase should be 2. Threw exception TypeError: Cannot read property 'eventPhase' of undefined - - mouseout - @used-fallback (target: used-fallback) (related: A) - @content1 (target: used-fallback) (related: A) - @shadow-root (target: used-fallback) (related: A) - - mouseover - -Moving mouse from A to A/used-fallback -FAIL event.eventPhase should be 2. Threw exception TypeError: Cannot read property 'eventPhase' of undefined - - mouseout - - mouseover - @used-fallback (target: used-fallback) (related: A) - @content1 (target: used-fallback) (related: A) - @shadow-root (target: used-fallback) (related: A) - -Click non-used-fallback node -FAIL event.eventPhase should be 2. Threw exception TypeError: Cannot read property 'eventPhase' of undefined - - click - @non-used-fallback (target: non-used-fallback) - @content2 (target: non-used-fallback) - @shadow-root (target: non-used-fallback) - @A (target: A) - @top (target: A) -PASS successfullyParsed is true - -TEST COMPLETE - -
diff --git a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/shadow-dom-event-dispatching-nested-shadow-roots-expected.txt b/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/shadow-dom-event-dispatching-nested-shadow-roots-expected.txt deleted file mode 100644 index 76b763d..0000000 --- a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/shadow-dom-event-dispatching-nested-shadow-roots-expected.txt +++ /dev/null
@@ -1,73 +0,0 @@ - - -Flat Tree will be: -DIV id=sandbox - DIV id=top - DIV id=A - DIV id=B - DIV id=G - DIV id=J - CONTENT id=N - DIV id=L - CONTENT id=O - - -Moving mouse from F to D - - mouseout - - mouseover - -Moving mouse from B/G/L to D -FAIL event.eventPhase should be 2. Threw exception TypeError: Cannot read property 'eventPhase' of undefined -FAIL event.eventPhase should be 2. Threw exception TypeError: Cannot read property 'eventPhase' of undefined -FAIL event.eventPhase should be 2. Threw exception TypeError: Cannot read property 'eventPhase' of undefined -FAIL event.eventPhase should be 2. Threw exception TypeError: Cannot read property 'eventPhase' of undefined - - mouseout - @L (target: L) (related: ) - @shadow-root-G (target: L) (related: ) - @G (target: G) (related: ) - @shadow-root-B (target: G) (related: ) - @B (target: B) (related: ) - @A (target: B) (related: ) - @top (target: B) (related: ) - - mouseover - -Moving mouse from B/G/L to B/G/J -FAIL event.eventPhase should be 2. Threw exception TypeError: Cannot read property 'eventPhase' of undefined -FAIL event.eventPhase should be 2. Threw exception TypeError: Cannot read property 'eventPhase' of undefined -FAIL event.eventPhase should be 2. Threw exception TypeError: Cannot read property 'eventPhase' of undefined -FAIL event.eventPhase should be 2. Threw exception TypeError: Cannot read property 'eventPhase' of undefined - - mouseout - @L (target: L) (related: J) - @shadow-root-G (target: L) (related: J) - - mouseover - @J (target: J) (related: L) - @shadow-root-G (target: J) (related: L) - -Moving mouse from A to D -FAIL event.eventPhase should be 2. Threw exception TypeError: Cannot read property 'eventPhase' of undefined -FAIL event.eventPhase should be 2. Threw exception TypeError: Cannot read property 'eventPhase' of undefined - - mouseout - @A (target: A) (related: ) - @top (target: A) (related: ) - - mouseover - -Moving mouse from D to A - - mouseout - - mouseover - @A (target: A) (related: ) - @top (target: A) (related: ) -PASS successfullyParsed is true - -TEST COMPLETE - -
diff --git a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/shadow-dom-event-dispatching-svg-in-shadow-subtree-expected.txt b/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/shadow-dom-event-dispatching-svg-in-shadow-subtree-expected.txt deleted file mode 100644 index a30fee7..0000000 --- a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/shadow-dom-event-dispatching-svg-in-shadow-subtree-expected.txt +++ /dev/null
@@ -1,25 +0,0 @@ - - -Flat Tree will be: -DIV id=sandbox - DIV id=top - DIV id=shadow-host - svg id=svg-in-shadow-tree class=[object SVGAnimatedString] - - -Moving mouse from shadow-host/svg-in-shadow-tree to top -FAIL event.eventPhase should be 2. Threw exception TypeError: Cannot read property 'eventPhase' of undefined -FAIL event.eventPhase should be 2. Threw exception TypeError: Cannot read property 'eventPhase' of undefined - - mouseout - @svg-in-shadow-tree (target: svg-in-shadow-tree) (related: top) - @shadow-root (target: svg-in-shadow-tree) (related: top) - @top (target: shadow-host) (related: top) - - mouseover - @top (target: top) (related: shadow-host) -PASS successfullyParsed is true - -TEST COMPLETE - -
diff --git a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/shadow-element-distributed-nodes-expected.txt b/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/shadow-element-distributed-nodes-expected.txt deleted file mode 100644 index 46ee971..0000000 --- a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/shadow-element-distributed-nodes-expected.txt +++ /dev/null
@@ -1,13 +0,0 @@ -CONSOLE ERROR: line 87: Uncaught TypeError: element.createShadowRoot is not a function -Tests for a shadow element's getDistributedNodes(). - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - - -getDistributedNodes() for "shadow" should return [] -PASS distributedNodes.length is expectedDistributedNodes.length -FAIL successfullyParsed should be true. Was false. - -TEST COMPLETE - -
diff --git a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/shadow-insertion-point-rendering-expected.txt b/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/shadow-insertion-point-rendering-expected.txt deleted file mode 100644 index a2ca8a33..0000000 --- a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/shadow-insertion-point-rendering-expected.txt +++ /dev/null
@@ -1 +0,0 @@ -CONSOLE ERROR: line 87: Uncaught TypeError: element.createShadowRoot is not a function
diff --git a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/shadow-on-image-expected.txt b/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/shadow-on-image-expected.txt deleted file mode 100644 index f7a73c3c..0000000 --- a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/shadow-on-image-expected.txt +++ /dev/null
@@ -1 +0,0 @@ -CONSOLE ERROR: line 11: Uncaught TypeError: imageDiv.createShadowRoot is not a function
diff --git a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/shadow-root-activeElement-expected.txt b/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/shadow-root-activeElement-expected.txt deleted file mode 100644 index ca1d8ae..0000000 --- a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/shadow-root-activeElement-expected.txt +++ /dev/null
@@ -1,27 +0,0 @@ -This tests the activeElement property of a ShadowRoot. - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - -PASS shadowRoot1.activeElement is defined. -PASS shadowRoot2.activeElement is defined. -PASS nodeInDocument.focus(); document.activeElement is nodeInDocument -PASS nodeInDocument.focus(); shadowRoot1.activeElement is null -PASS nodeInDocument.focus(); shadowRoot2.activeElement is null -FAIL distributedLightChild.focus(); document.activeElement should be [object HTMLDivElement]. Was [object HTMLDivElement]. -FAIL distributedLightChild.focus(); shadowRoot1.activeElement should be [object HTMLDivElement]. Was null. -PASS distributedLightChild.focus(); shadowRoot2.activeElement is null -PASS childInShadowRoot1.focus(); document.activeElement is shadowHost1 -PASS childInShadowRoot1.focus(); shadowRoot1.activeElement is childInShadowRoot1 -PASS childInShadowRoot1.focus(); shadowRoot2.activeElement is null -PASS childInShadowRoot2.focus(); document.activeElement is shadowHost1 -PASS childInShadowRoot2.focus(); shadowRoot1.activeElement is shadowHost2 -PASS childInShadowRoot2.focus(); shadowRoot2.activeElement is childInShadowRoot2 -childInShadowRoot2.blur(); -PASS document.activeElement is document.body -PASS shadowRoot1.activeElement is null -PASS shadowRoot2.activeElement is null -PASS successfullyParsed is true - -TEST COMPLETE - -
diff --git a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/shadowdom-for-button-complex-shadow-expected.txt b/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/shadowdom-for-button-complex-shadow-expected.txt deleted file mode 100644 index 69cd796..0000000 --- a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/shadowdom-for-button-complex-shadow-expected.txt +++ /dev/null
@@ -1 +0,0 @@ -CONSOLE ERROR: line 12: Uncaught TypeError: host.createShadowRoot is not a function
diff --git a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/shadowdom-for-button-only-shadow-expected.txt b/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/shadowdom-for-button-only-shadow-expected.txt deleted file mode 100644 index 69cd796..0000000 --- a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/shadowdom-for-button-only-shadow-expected.txt +++ /dev/null
@@ -1 +0,0 @@ -CONSOLE ERROR: line 12: Uncaught TypeError: host.createShadowRoot is not a function
diff --git a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/shadowdom-for-button-without-shadow-expected.txt b/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/shadowdom-for-button-without-shadow-expected.txt deleted file mode 100644 index 69cd796..0000000 --- a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/shadowdom-for-button-without-shadow-expected.txt +++ /dev/null
@@ -1 +0,0 @@ -CONSOLE ERROR: line 12: Uncaught TypeError: host.createShadowRoot is not a function
diff --git a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/shadowdom-for-unknown-with-form-expected.txt b/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/shadowdom-for-unknown-with-form-expected.txt deleted file mode 100644 index 494f9bc..0000000 --- a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/shadowdom-for-unknown-with-form-expected.txt +++ /dev/null
@@ -1,2 +0,0 @@ -CONSOLE ERROR: line 4: Uncaught TypeError: tCF5.createShadowRoot is not a function -
diff --git a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/shadowdom-reprojection-1-expected.txt b/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/shadowdom-reprojection-1-expected.txt deleted file mode 100644 index a2ca8a33..0000000 --- a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/shadowdom-reprojection-1-expected.txt +++ /dev/null
@@ -1 +0,0 @@ -CONSOLE ERROR: line 87: Uncaught TypeError: element.createShadowRoot is not a function
diff --git a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/shadowdom-reprojection-2-expected.txt b/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/shadowdom-reprojection-2-expected.txt deleted file mode 100644 index a2ca8a33..0000000 --- a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/shadowdom-reprojection-2-expected.txt +++ /dev/null
@@ -1 +0,0 @@ -CONSOLE ERROR: line 87: Uncaught TypeError: element.createShadowRoot is not a function
diff --git a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/shadowroot-of-insertionpoint-expected.txt b/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/shadowroot-of-insertionpoint-expected.txt deleted file mode 100644 index 69cd796..0000000 --- a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/shadowroot-of-insertionpoint-expected.txt +++ /dev/null
@@ -1 +0,0 @@ -CONSOLE ERROR: line 12: Uncaught TypeError: host.createShadowRoot is not a function
diff --git a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/shadowroot-type-expected.txt b/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/shadowroot-type-expected.txt deleted file mode 100644 index abb1079..0000000 --- a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/shadowroot-type-expected.txt +++ /dev/null
@@ -1,9 +0,0 @@ -CONSOLE ERROR: line 15: Uncaught TypeError: host.createShadowRoot is not a function -This test ensures ShadowRootType is correctly reflected - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - -FAIL successfullyParsed should be true. Was false. - -TEST COMPLETE -
diff --git a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/style-of-distributed-node-expected.txt b/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/style-of-distributed-node-expected.txt deleted file mode 100644 index 12e92770..0000000 --- a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/style-of-distributed-node-expected.txt +++ /dev/null
@@ -1,26 +0,0 @@ -CONSOLE ERROR: line 27: Uncaught TypeError: document.getElementById(...).createShadowRoot is not a function -Tests to ensure that styles of distributed nodes are different if their parent styles are different. - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - - - - - - - - - - - - - - - - - - -FAIL successfullyParsed should be true. Was false. - -TEST COMPLETE -
diff --git a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/style-sharing-with-content-and-host-expected.txt b/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/style-sharing-with-content-and-host-expected.txt deleted file mode 100644 index e1862bdb..0000000 --- a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/style-sharing-with-content-and-host-expected.txt +++ /dev/null
@@ -1 +0,0 @@ -CONSOLE ERROR: line 14: Uncaught TypeError: document.querySelector(...).createShadowRoot is not a function
diff --git a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/svg-style-in-shadow-tree-crash-expected.txt b/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/svg-style-in-shadow-tree-crash-expected.txt deleted file mode 100644 index befddd8..0000000 --- a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/svg-style-in-shadow-tree-crash-expected.txt +++ /dev/null
@@ -1,12 +0,0 @@ -CONSOLE ERROR: line 9: Uncaught TypeError: document.registerElement is not a function -CONSOLE ERROR: line 9: Uncaught TypeError: document.registerElement is not a function -CONSOLE ERROR: line 9: Uncaught TypeError: document.registerElement is not a function -CONSOLE ERROR: line 9: Uncaught TypeError: document.registerElement is not a function -CONSOLE ERROR: line 9: Uncaught TypeError: document.registerElement is not a function -CONSOLE ERROR: line 9: Uncaught TypeError: document.registerElement is not a function -CONSOLE ERROR: line 9: Uncaught TypeError: document.registerElement is not a function -CONSOLE ERROR: line 9: Uncaught TypeError: document.registerElement is not a function -CONSOLE ERROR: line 9: Uncaught TypeError: document.registerElement is not a function -CONSOLE ERROR: line 9: Uncaught TypeError: document.registerElement is not a function -CONSOLE ERROR: line 9: Uncaught TypeError: document.registerElement is not a function -PASS
diff --git a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/svg-style-in-shadow-tree-expected.txt b/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/svg-style-in-shadow-tree-expected.txt deleted file mode 100644 index 3f28528..0000000 --- a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/svg-style-in-shadow-tree-expected.txt +++ /dev/null
@@ -1 +0,0 @@ -CONSOLE ERROR: line 19: Uncaught TypeError: document.registerElement is not a function
diff --git a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/tab-order-iframe-and-shadow-expected.txt b/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/tab-order-iframe-and-shadow-expected.txt deleted file mode 100644 index c612888..0000000 --- a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/tab-order-iframe-and-shadow-expected.txt +++ /dev/null
@@ -1,8 +0,0 @@ -CONSOLE ERROR: line 28: Uncaught TypeError: shadowHost.createShadowRoot is not a function -This tests that pressing Tab key should traverse into iframe and shadow tree, and pressing Shift-Tab should reverse the order. - -FAIL successfullyParsed should be true. Was false. - -TEST COMPLETE - -
diff --git a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/table-border-expected.txt b/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/table-border-expected.txt deleted file mode 100644 index 1a73b320..0000000 --- a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/table-border-expected.txt +++ /dev/null
@@ -1 +0,0 @@ -CONSOLE ERROR: line 19: Uncaught TypeError: host1.createShadowRoot is not a function
diff --git a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/text-node-in-shadow-expected.txt b/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/text-node-in-shadow-expected.txt deleted file mode 100644 index 69cd796..0000000 --- a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/text-node-in-shadow-expected.txt +++ /dev/null
@@ -1 +0,0 @@ -CONSOLE ERROR: line 12: Uncaught TypeError: host.createShadowRoot is not a function
diff --git a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/touch-event-retargeting-expected.txt b/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/touch-event-retargeting-expected.txt deleted file mode 100644 index 99fd7cbb..0000000 --- a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/touch-event-retargeting-expected.txt +++ /dev/null
@@ -1,17 +0,0 @@ -Touch event retargeting. - -foo -FAIL event.eventPhase should be 2. Threw exception TypeError: Cannot read property 'eventPhase' of undefined -FAIL event.eventPhase should be 2. Threw exception TypeError: Cannot read property 'eventPhase' of undefined - - touchstart - @div1 (target: div1) (touches: div1, div2, div3) (targetTouches: div1) (changedTouches: div1, div2, div3) - @div2 (target: div2) (touches: div1, div2, div3) (targetTouches: div2) (changedTouches: div1, div2, div3) - @div2-shadow-root-child (target: div2-shadow-root-child) (touches: div1, div2-shadow-root-child, div3) (targetTouches: div2-shadow-root-child) (changedTouches: div1, div2-shadow-root-child, div3) - @div3 (target: div3) (touches: div1, div2, div3) (targetTouches: div3) (changedTouches: div1, div2, div3) - @div3-shadow-root-child (target: div3-shadow-root-child) (touches: div1, div2, div3-shadow-root-child) (targetTouches: div3-shadow-root-child) (changedTouches: div1, div2, div3-shadow-root-child) -PASS successfullyParsed is true - -TEST COMPLETE - -
diff --git a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/user-modify-inheritance-expected.txt b/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/user-modify-inheritance-expected.txt deleted file mode 100644 index bbf759dd..0000000 --- a/third_party/blink/web_tests/virtual/web-components-v0-disabled/fast/dom/shadow/user-modify-inheritance-expected.txt +++ /dev/null
@@ -1,19 +0,0 @@ -Tests to ensure that a '-webkit-user-modify' CSS property is not inherited across shadow boundaries. - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - -FAIL computedStyle(prepareNodeInShadowRoot(document.getElementById("contenteditable-host1"), null)) should be read-only. Threw exception TypeError: host.createShadowRoot is not a function -FAIL computedStyle(prepareNodeInShadowRoot(document.getElementById("contenteditable-host2"), "false")) should be read-only. Threw exception TypeError: host.createShadowRoot is not a function -FAIL computedStyle(prepareNodeInShadowRoot(document.getElementById("contenteditable-host3"), "true")) should be read-write. Threw exception TypeError: host.createShadowRoot is not a function -FAIL computedStyle(prepareNodeInShadowRoot(document.getElementById("non-contenteditable-host1"), null)) should be read-only. Threw exception TypeError: host.createShadowRoot is not a function -FAIL computedStyle(prepareNodeInShadowRoot(document.getElementById("non-contenteditable-host2"), "false")) should be read-only. Threw exception TypeError: host.createShadowRoot is not a function -FAIL computedStyle(prepareNodeInShadowRoot(document.getElementById("non-contenteditable-host3"), "true")) should be read-write. Threw exception TypeError: host.createShadowRoot is not a function -FAIL getUserModifyProperty("child-a") should be read-write. Was read-only. -FAIL getUserModifyProperty("child-b") should be read-write. Was read-only. -PASS getUserModifyProperty("child-c") is "read-only" -PASS getUserModifyProperty("child-d") is "read-only" -PASS successfullyParsed is true - -TEST COMPLETE - -
diff --git a/third_party/blink/web_tests/virtual/web-components-v0-disabled/html/dialog/form-method-dialog-expected.txt b/third_party/blink/web_tests/virtual/web-components-v0-disabled/html/dialog/form-method-dialog-expected.txt deleted file mode 100644 index 02363ff..0000000 --- a/third_party/blink/web_tests/virtual/web-components-v0-disabled/html/dialog/form-method-dialog-expected.txt +++ /dev/null
@@ -1,11 +0,0 @@ -CONSOLE ERROR: line 177: Uncaught TypeError: host.createShadowRoot is not a function -Tests form submission with method=dialog - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - -FAIL Unexpected error: Uncaught TypeError: host.createShadowRoot is not a function -FAIL successfullyParsed should be true. Was false. - -TEST COMPLETE - -
diff --git a/third_party/blink/web_tests/virtual/web-components-v0-disabled/html/dialog/modal-dialog-distributed-child-is-not-inert-expected.txt b/third_party/blink/web_tests/virtual/web-components-v0-disabled/html/dialog/modal-dialog-distributed-child-is-not-inert-expected.txt deleted file mode 100644 index ddb5e7c..0000000 --- a/third_party/blink/web_tests/virtual/web-components-v0-disabled/html/dialog/modal-dialog-distributed-child-is-not-inert-expected.txt +++ /dev/null
@@ -1,11 +0,0 @@ -CONSOLE ERROR: line 28: Uncaught TypeError: document.querySelector(...).createShadowRoot is not a function -Tests that nodes transposed into the dialog are not inert. The test passes if you can click the button. - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - -FAIL Unexpected error: Uncaught TypeError: document.querySelector(...).createShadowRoot is not a function -FAIL successfullyParsed should be true. Was false. - -TEST COMPLETE - -Click me
diff --git a/third_party/blink/web_tests/virtual/web-components-v0-disabled/shadow-dom/css-cascade-upgrade-from-another-tree-expected.txt b/third_party/blink/web_tests/virtual/web-components-v0-disabled/shadow-dom/css-cascade-upgrade-from-another-tree-expected.txt deleted file mode 100644 index 16de410..0000000 --- a/third_party/blink/web_tests/virtual/web-components-v0-disabled/shadow-dom/css-cascade-upgrade-from-another-tree-expected.txt +++ /dev/null
@@ -1,5 +0,0 @@ -CONSOLE ERROR: line 12: Uncaught TypeError: host.createShadowRoot is not a function -This is a testharness.js-based test. -Harness Error. harness_status.status = 1 , harness_status.message = Uncaught TypeError: host.createShadowRoot is not a function -Harness: the test ran to completion. -
diff --git a/third_party/blink/web_tests/virtual/web-components-v0-disabled/shadow-dom/css-cascade-upgrade-from-v0-to-v1-expected.txt b/third_party/blink/web_tests/virtual/web-components-v0-disabled/shadow-dom/css-cascade-upgrade-from-v0-to-v1-expected.txt deleted file mode 100644 index 16de410..0000000 --- a/third_party/blink/web_tests/virtual/web-components-v0-disabled/shadow-dom/css-cascade-upgrade-from-v0-to-v1-expected.txt +++ /dev/null
@@ -1,5 +0,0 @@ -CONSOLE ERROR: line 12: Uncaught TypeError: host.createShadowRoot is not a function -This is a testharness.js-based test. -Harness Error. harness_status.status = 1 , harness_status.message = Uncaught TypeError: host.createShadowRoot is not a function -Harness: the test ran to completion. -
diff --git a/third_party/blink/web_tests/virtual/web-components-v0-disabled/shadow-dom/css-focus-pseudo-match-shadow-host1-expected.txt b/third_party/blink/web_tests/virtual/web-components-v0-disabled/shadow-dom/css-focus-pseudo-match-shadow-host1-expected.txt deleted file mode 100644 index 327ec21..0000000 --- a/third_party/blink/web_tests/virtual/web-components-v0-disabled/shadow-dom/css-focus-pseudo-match-shadow-host1-expected.txt +++ /dev/null
@@ -1,25 +0,0 @@ -:focus and shadow host without delegatesFocus for crbug/479050 -PASS backgroundColorOf('shadow-host') is "rgb(255, 255, 255)" -Test shadow host without tabindex -PASS backgroundColorOf('shadow-host') is "rgb(255, 255, 255)" -PASS backgroundColorOf('shadow-host') is "rgb(255, 255, 255)" -PASS backgroundColorOf('shadow-host') is "rgb(255, 255, 255)" -PASS backgroundColorOf('shadow-host') is "rgb(255, 255, 255)" -PASS backgroundColorOf('shadow-host') is "rgb(255, 255, 255)" -Test shadow host with tabindex=-1 -PASS backgroundColorOf('shadow-host') is "rgb(255, 255, 255)" -PASS backgroundColorOf('shadow-host') is "rgb(255, 255, 255)" -PASS backgroundColorOf('shadow-host') is "rgb(255, 255, 255)" -PASS backgroundColorOf('shadow-host') is "rgb(255, 255, 255)" -PASS backgroundColorOf('shadow-host') is "rgb(0, 128, 0)" -Test shadow host without tabindex=0 -PASS backgroundColorOf('shadow-host') is "rgb(255, 255, 255)" -PASS backgroundColorOf('shadow-host') is "rgb(255, 255, 255)" -PASS backgroundColorOf('shadow-host') is "rgb(255, 255, 255)" -PASS backgroundColorOf('shadow-host') is "rgb(255, 255, 255)" -PASS backgroundColorOf('shadow-host') is "rgb(0, 128, 0)" -PASS successfullyParsed is true - -TEST COMPLETE - -
diff --git a/third_party/blink/web_tests/web-components-v0-only/css-cascade-upgrade-from-another-tree.html b/third_party/blink/web_tests/web-components-v0-only/css-cascade-upgrade-from-another-tree.html deleted file mode 100644 index ceaae6f..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/css-cascade-upgrade-from-another-tree.html +++ /dev/null
@@ -1,25 +0,0 @@ -<!DOCTYPE html> -<script src='../resources/testharness.js'></script> -<script src='../resources/testharnessreport.js'></script> -<style> -div { color: red; } -</style> -<div id='host'></div> -<div id='dummy'></div> -<script> -'use strict'; - -var root = host.createShadowRoot(); -root.innerHTML = '<style>:host(#host) { color: green; }</style>'; - -test(() => { - assert_equals(window.getComputedStyle(host).color, 'rgb(0, 128, 0)'); - // Trigger "V1" shadow cascading order. - let doc_v1 = document.implementation.createHTMLDocument('v1 document'); - let div_v1 = doc_v1.createElement('div'); - doc_v1.body.appendChild(div_v1); - div_v1.attachShadow({mode: 'open'}); - dummy.appendChild(div_v1); - assert_equals(window.getComputedStyle(host).color, 'rgb(255, 0, 0)'); -}, 'Upgrading V0 to V1 should cause style recalculation.'); -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/css-cascade-upgrade-from-v0-to-v1.html b/third_party/blink/web_tests/web-components-v0-only/css-cascade-upgrade-from-v0-to-v1.html deleted file mode 100644 index ff0ee104..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/css-cascade-upgrade-from-v0-to-v1.html +++ /dev/null
@@ -1,37 +0,0 @@ -<!DOCTYPE html> -<script src='../resources/testharness.js'></script> -<script src='../resources/testharnessreport.js'></script> -<style> -div { color: red; } -</style> -<div id='host'></div> -<div id='dummy'></div> -<script> -'use strict'; - -var root = host.createShadowRoot(); -root.innerHTML = '<style>:host(#host) { color: green; }</style>'; - -test(() => { - assert_equals(window.getComputedStyle(host).color, 'rgb(0, 128, 0)', - 'V0 cascade order should be used by default.'); - - // Adding V1 user-agent shadow should not switch cascading order. - var option = document.createElement('option'); - dummy.appendChild(option); - assert_equals(window.getComputedStyle(host).color, 'rgb(0, 128, 0)', - 'Adding UA shadow should not change the cascade order.'); - - // Adopting V1 user-agent shadow should not switch cascading order. - var doc2 = document.implementation.createHTMLDocument(); - var option2 = doc2.createElement('option'); - dummy.appendChild(option2); - assert_equals(window.getComputedStyle(host).color, 'rgb(0, 128, 0)', - 'Adopting UA shadow should not change the cascade order.'); - - // Trigger "V1" shadow cascading order. - dummy.attachShadow({mode: 'open'}); - assert_equals(window.getComputedStyle(host).color, 'rgb(255, 0, 0)', - 'Adding author V1 shadow should change the cascade order.'); -}, 'Upgrading V0 to V1 should cause style recalculation.'); -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/custom-elements-expected.txt b/third_party/blink/web_tests/web-components-v0-only/custom-elements-expected.txt deleted file mode 100644 index fbf94ba..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/custom-elements-expected.txt +++ /dev/null
@@ -1,30 +0,0 @@ -CONSOLE WARNING: :unresolved pseudo selector is deprecated and will be removed in M80, around February 2020. Please use :not(:defined) instead. See https://www.chromestatus.com/features/4642138092470272 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -Tests basic web-exposure of Custom Elements - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - -Document.prototype.hasOwnProperty("registerElement") -true - - -typeof Document.prototype.registerElement -function - - -document.createElement("x-a") instanceof HTMLUnknownElement -false - - -document.querySelector(":unresolved") -[object HTMLDivElement] - - -span.getAttribute("is") -type-extension - - -PASS window.customElements.define("a-a", A, {extends: "b"}) did not throw exception. -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/blink/web_tests/web-components-v0-only/custom-elements-imports/adopted-callback.html b/third_party/blink/web_tests/web-components-v0-only/custom-elements-imports/adopted-callback.html deleted file mode 100644 index b99e6b6..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/custom-elements-imports/adopted-callback.html +++ /dev/null
@@ -1,82 +0,0 @@ -<!DOCTYPE html> -<script src="../../resources/testharness.js"></script> -<script src="../../resources/testharnessreport.js"></script> -<link id="import1" rel="import" href="resources/adopted-nodes.html"> -<body> -<b-b id="x"></b-b> -<b-b id="y"></b-b> -<b-b id="z"></b-b> -</body> -<script> -'use strict'; - -test(() => { - let reactions = []; - - customElements.define('a-a', class extends HTMLElement { - adoptedCallback() { - reactions.push(this); - } - }); - - let importDoc = import1.import; - - let a = importDoc.querySelector('#a'); - assert_equals(a.ownerDocument, importDoc); - document.body.appendChild(a); - assert_equals(a.ownerDocument, document, 'After appendChild(), node document should change.'); - - let b = importDoc.querySelector('#b'); - assert_equals(b.ownerDocument, importDoc); - let b2 = document.importNode(b); - assert_equals(b.ownerDocument, importDoc, 'importNode() should not change node document.'); - assert_equals(b2.ownerDocument, document, - 'importNode() should copy node from one document to another.'); - - let c = importDoc.querySelector('#c'); - assert_equals(c.ownerDocument, importDoc); - let c2 = document.adoptNode(c); - assert_equals(c.ownerDocument, document, 'adoptNode should have changed node document.'); - assert_equals(c, c2, 'adoptNode() should move node from another document.'); - - assert_array_equals(importDoc.querySelectorAll('a-a'), [b], - 'Only <a-a#b> should remain in the imported document.'); - assert_array_equals(reactions, [a, c], - 'appendChild() and adoptNode() should cause adoptedCallback.'); -}, 'adoptedCallback should be invoked when moving custom element from import to client document'); - -test(() => { - let reactions = []; - - customElements.define('b-b', class extends HTMLElement { - adoptedCallback() { - reactions.push(this); - } - }); - - let importDoc = import1.import; - - let x = document.querySelector('#x'); - assert_equals(x.ownerDocument, document); - importDoc.body.appendChild(x); - assert_equals(x.ownerDocument, importDoc, 'After appendChild(), node document should change.'); - - let y = document.querySelector('#y'); - assert_equals(y.ownerDocument, document); - let y2 = importDoc.importNode(y); - assert_equals(y.ownerDocument, document, 'importNode() should not change node document.'); - assert_equals(y2.ownerDocument, importDoc, - 'importNode() should copy node from one document to another.'); - - let z = document.querySelector('#z'); - assert_equals(z.ownerDocument, document); - let z2 = importDoc.adoptNode(z); - assert_equals(z.ownerDocument, importDoc, 'adoptNode should have changed node document.'); - assert_equals(z, z2, 'adoptNode() should move node from another document.'); - - assert_array_equals(document.querySelectorAll('b-b'), [y], - 'Only <b-b#y> should remain in the imported document.'); - assert_array_equals(reactions, [x, z], - 'appendChild() and adoptNode() should cause adoptedCallback.'); -}, 'adoptedCallback should be invoked when moving custom element from client document to import'); -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/custom-elements-imports/async-imports.html b/third_party/blink/web_tests/web-components-v0-only/custom-elements-imports/async-imports.html deleted file mode 100644 index 6a3e5fa..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/custom-elements-imports/async-imports.html +++ /dev/null
@@ -1,21 +0,0 @@ -<!DOCTYPE html> -<script src="../../resources/testharness.js"></script> -<script src="../../resources/testharnessreport.js"></script> -<script src="../spec/resources/custom-elements-helpers.js"></script> -<link id="import1" rel="import" href="resources/async-component.html" async> -<a-a></a-a> -<script> -'use strict'; - -promise_test(() => { - return customElements.whenDefined('a-a').then(() => { - let a = document.querySelector('a-a'); - assert_is_upgraded(a, AsyncComponent, - '<async-component> in this document should have been upgraded.'); - - let b = import1.import.querySelector('a-a'); - assert_is_upgraded(b, AsyncComponent, - '<async-component> in imported document should have been upgraded.'); - }); -}, 'custom elements definition in async import should work.'); -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/custom-elements-imports/async-nested-imports.html b/third_party/blink/web_tests/web-components-v0-only/custom-elements-imports/async-nested-imports.html deleted file mode 100644 index c2643d9..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/custom-elements-imports/async-nested-imports.html +++ /dev/null
@@ -1,30 +0,0 @@ -<!DOCTYPE html> -<script src="../../resources/testharness.js"></script> -<script src="../../resources/testharnessreport.js"></script> -<script src="../spec/resources/custom-elements-helpers.js"></script> -<script> -'use strict'; - -let constructors = []; -</script> -<link id="import1" rel="import" href="resources/async-nested-component.html" async> -<script> -'use strict'; - -async_test((test) => { - import1.onload = test.step_func_done(() => { - let n1 = import1.import.querySelector('a-a'); - let n2 = import1.import.querySelector('b-b'); - let n3 = import1.import.querySelector('c-c'); - - assert_is_upgraded(n1, NestedLevel1, 'nested-level1 in import should be custom'); - assert_is_upgraded(n2, NestedLevel2, 'nested-level2 in import should be custom'); - assert_is_upgraded(n3, NestedLevel3, 'nested-level3 in import should be custom'); - - // As subimports are sync, the upgrade order should be the order of script execution. - let types = constructors.map(e => e.type); - assert_array_equals(types, ['nested-level3', 'nested-level2', 'nested-level1'], - 'upgrade order should be the order of script execution in imports'); - }, 'top-level async import should properly run dependent subimports and get elements defined.'); -}, 'custom elements defined in nested imports from an async import should work.'); -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/custom-elements-imports/attribute-changed-callback.html b/third_party/blink/web_tests/web-components-v0-only/custom-elements-imports/attribute-changed-callback.html deleted file mode 100644 index cf854ed..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/custom-elements-imports/attribute-changed-callback.html +++ /dev/null
@@ -1,53 +0,0 @@ -<!DOCTYPE html> -<script src="../../resources/testharness.js"></script> -<script src="../../resources/testharnessreport.js"></script> -<link id="import1" rel="import" href="resources/attribute-upgrade.html"> -<script> -'use strict'; - -let reactions = []; - -customElements.define('a-a', class extends HTMLElement { - static get observedAttributes() { return ['attr']; } - attributeChangedCallback() { - reactions.push(this); - } -}); -</script> -<link id="import2" rel="import" href="resources/attribute-parsercreate.html"> -<script> -'use strict'; - -test(() => { - let importDoc1 = import1.import; - let importDoc2 = import2.import; - - let a = importDoc1.querySelector('#a'); - let b = importDoc1.querySelector('#b'); - let c = importDoc2.querySelector('#c'); - let d = importDoc2.querySelector('#d'); - - assert_array_equals(reactions, [b, d], - 'attributeChangedCallback should be called for both upgrade and create.'); - - reactions = []; - - a.setAttribute('attr', 'a'); - b.setAttribute('attr', 'b'); - c.setAttribute('attr', 'c'); - d.setAttribute('attr', 'd'); - - assert_array_equals(reactions, [a, b, c, d], - 'attributeChangedCallback should be called for setAttribute().'); - - reactions = []; - - d.removeAttribute('attr', 'd'); - c.removeAttribute('attr', 'c'); - b.removeAttribute('attr', 'b'); - a.removeAttribute('attr', 'a'); - - assert_array_equals(reactions, [d, c, b, a], - 'attributeChangedCallback should be called for removeAttribute().'); -}, 'attributeChangedCallback should be invoked for elements in import'); -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/custom-elements-imports/circular-imports.html b/third_party/blink/web_tests/web-components-v0-only/custom-elements-imports/circular-imports.html deleted file mode 100644 index 66dc282..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/custom-elements-imports/circular-imports.html +++ /dev/null
@@ -1,21 +0,0 @@ -<!DOCTYPE html> -<script src="../../resources/testharness.js"></script> -<script src="../../resources/testharnessreport.js"></script> -<script> -'use strict'; - -let constructors = []; -</script> -<a-a></a-a> -<b-b></b-b> -<link rel="import" href="resources/circular-level1.html"> -<script> -'use strict'; - -test(() => { - // At the point of imports, <a-a> and <b-b> are already parsed and will be - // upgraded when the definitions are ready. - assert_array_equals(constructors, ['circular-level2', 'circular-level1'], - 'The constructor order should be script execution order of definition.'); -}, 'custom element definitions in circularly-dependent imports should work.'); -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/custom-elements-imports/connected-callback.html b/third_party/blink/web_tests/web-components-v0-only/custom-elements-imports/connected-callback.html deleted file mode 100644 index 3f3fb58..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/custom-elements-imports/connected-callback.html +++ /dev/null
@@ -1,70 +0,0 @@ -<!DOCTYPE html> -<script src="../../resources/testharness.js"></script> -<script src="../../resources/testharnessreport.js"></script> -<link id="import1" rel="import" href="resources/connected-upgrade.html"> -<script> -'use strict'; - -let reactions = []; - -customElements.define('a-a', class extends HTMLElement { - connectedCallback() { - reactions.push(this); - } - disconnectedCallback() { - reactions.push(this); - } -}); -</script> -<link id="import2" rel="import" href="resources/connected-parsercreate.html"> -<script> -'use strict'; - -test(() => { - let importDoc1 = import1.import; - let importDoc2 = import2.import; - - let a = importDoc1.querySelector('#a'); - let b = importDoc1.querySelector('#b'); - let c = importDoc2.querySelector('#c'); - let d = importDoc2.querySelector('#d'); - - assert_array_equals(reactions, [a, b, c, d], - 'connectedCallback should be called for both upgrade and create.'); - - reactions = []; - - d.remove(); - c.remove(); - b.remove(); - a.remove(); - - assert_array_equals(reactions, [d, c, b, a], - 'disconnectedCallback should be called in imports.'); - - reactions = []; - - let div1 = document.createElement('div'); - let div2 = document.createElement('div'); - let div3 = document.createElement('div'); - - div1.appendChild(div2); - div1.appendChild(a); - div1.appendChild(div3); - - div2.appendChild(d); - div2.appendChild(c); - div3.appendChild(b); - - importDoc1.body.appendChild(div1); - - assert_array_equals(reactions, [d, c, a, b], - 'connectedCallback should be called in document order.'); - - reactions = []; - - div1.remove(); - assert_array_equals(reactions, [d, c, a, b], - 'disconnectedCallback should be called in document order.'); -}, 'connectedCallback and disconnectedCallback should be invoked for elements in import'); -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/custom-elements-imports/create-element-in-import.html b/third_party/blink/web_tests/web-components-v0-only/custom-elements-imports/create-element-in-import.html deleted file mode 100644 index 97b22f9..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/custom-elements-imports/create-element-in-import.html +++ /dev/null
@@ -1,4 +0,0 @@ -<!DOCTYPE html> -<script src="../../resources/testharness.js"></script> -<script src="../../resources/testharnessreport.js"></script> -<link rel="import" href="resources/create-element.html">
diff --git a/third_party/blink/web_tests/web-components-v0-only/custom-elements-imports/detached-import.html b/third_party/blink/web_tests/web-components-v0-only/custom-elements-imports/detached-import.html deleted file mode 100644 index 1886b4b..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/custom-elements-imports/detached-import.html +++ /dev/null
@@ -1,21 +0,0 @@ -<!DOCTYPE html> -<script src="../../resources/testharness.js"></script> -<script src="../../resources/testharnessreport.js"></script> -<link id="import1" rel="import" href="resources/import-custom.html"> -<script> -'use strict'; - -test(() => { - let a = import1.import.querySelector('x-x'); - assert_equals(Object.getPrototypeOf(a), HTMLElement.prototype, - '<x-x> should not have been upgreaded yet.'); - - import1.remove(); - assert_equals(document.querySelector('link[rel=import]'), null, - 'imported document should be detached'); - - customElements.define('x-x', class extends HTMLElement{}); - assert_equals(Object.getPrototypeOf(a), HTMLElement.prototype, - 'detached <x-x> should not have been upgreaded.'); -}, 'custom elements in detached imports should not upgrade.'); -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/custom-elements-imports/inner-html-in-import.html b/third_party/blink/web_tests/web-components-v0-only/custom-elements-imports/inner-html-in-import.html deleted file mode 100644 index a7162e8..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/custom-elements-imports/inner-html-in-import.html +++ /dev/null
@@ -1,4 +0,0 @@ -<!DOCTYPE html> -<script src="../../resources/testharness.js"></script> -<script src="../../resources/testharnessreport.js"></script> -<link rel="import" href="resources/inner-html.html">
diff --git a/third_party/blink/web_tests/web-components-v0-only/custom-elements-imports/nested-imports.html b/third_party/blink/web_tests/web-components-v0-only/custom-elements-imports/nested-imports.html deleted file mode 100644 index 812aed8..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/custom-elements-imports/nested-imports.html +++ /dev/null
@@ -1,20 +0,0 @@ -<!DOCTYPE html> -<script src="../../resources/testharness.js"></script> -<script src="../../resources/testharnessreport.js"></script> -<script> -'use strict'; - -let constructors = []; -</script> -<a-a></a-a> -<b-b></b-b> -<c-c></c-c> -<link rel="import" href="resources/nested-level1.html"> -<script> -'use strict'; -test(() => { - let types = constructors.map(e => e.type); - assert_array_equals(types, ['nested-level3', 'nested-level2', 'nested-level1'], - 'The constructor order should be script execution order of definition.'); -}, 'custom element definitions in nested imports should work.'); -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/custom-elements-imports/resources/adopted-nodes.html b/third_party/blink/web_tests/web-components-v0-only/custom-elements-imports/resources/adopted-nodes.html deleted file mode 100644 index 0da4b696..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/custom-elements-imports/resources/adopted-nodes.html +++ /dev/null
@@ -1,4 +0,0 @@ -<!DOCTYPE html> -<a-a id="a"></a-a> -<a-a id="b"></a-a> -<a-a id="c"></a-a>
diff --git a/third_party/blink/web_tests/web-components-v0-only/custom-elements-imports/resources/async-component.html b/third_party/blink/web_tests/web-components-v0-only/custom-elements-imports/resources/async-component.html deleted file mode 100644 index 4b7d7d8f..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/custom-elements-imports/resources/async-component.html +++ /dev/null
@@ -1,8 +0,0 @@ -<!DOCTYPE html> -<a-a></a-a> -<script> -'use strict'; - -class AsyncComponent extends HTMLElement {} -customElements.define('a-a', AsyncComponent); -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/custom-elements-imports/resources/async-nested-component.html b/third_party/blink/web_tests/web-components-v0-only/custom-elements-imports/resources/async-nested-component.html deleted file mode 100644 index 7702fe4d..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/custom-elements-imports/resources/async-nested-component.html +++ /dev/null
@@ -1,5 +0,0 @@ -<!DOCTYPE html> -<link rel="import" href="nested-level1.html"> -<a-a></a-a> -<b-b></b-b> -<c-c></c-c>
diff --git a/third_party/blink/web_tests/web-components-v0-only/custom-elements-imports/resources/attribute-parsercreate.html b/third_party/blink/web_tests/web-components-v0-only/custom-elements-imports/resources/attribute-parsercreate.html deleted file mode 100644 index c97af20b..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/custom-elements-imports/resources/attribute-parsercreate.html +++ /dev/null
@@ -1,3 +0,0 @@ -<!DOCTYPE html> -<a-a id="c"></a-a> -<a-a id="d" attr="attr"></a-a>
diff --git a/third_party/blink/web_tests/web-components-v0-only/custom-elements-imports/resources/attribute-upgrade.html b/third_party/blink/web_tests/web-components-v0-only/custom-elements-imports/resources/attribute-upgrade.html deleted file mode 100644 index 2a26d6a4..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/custom-elements-imports/resources/attribute-upgrade.html +++ /dev/null
@@ -1,3 +0,0 @@ -<!DOCTYPE html> -<a-a id="a"></a-a> -<a-a id="b" attr="attr"></a-a>
diff --git a/third_party/blink/web_tests/web-components-v0-only/custom-elements-imports/resources/circular-level1.html b/third_party/blink/web_tests/web-components-v0-only/custom-elements-imports/resources/circular-level1.html deleted file mode 100644 index 2cf6604..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/custom-elements-imports/resources/circular-level1.html +++ /dev/null
@@ -1,12 +0,0 @@ -<!DOCTYPE html> -<link rel="import" href="circular-level2.html"> -<script> -'use strict'; - -customElements.define('a-a', class extends HTMLElement { - constructor() { - super(); - constructors.push('circular-level1'); - } -}); -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/custom-elements-imports/resources/circular-level2.html b/third_party/blink/web_tests/web-components-v0-only/custom-elements-imports/resources/circular-level2.html deleted file mode 100644 index d450ca86..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/custom-elements-imports/resources/circular-level2.html +++ /dev/null
@@ -1,12 +0,0 @@ -<!DOCTYPE html> -<link rel="import" href="circular-level1.html"> -<script> -'use strict'; - -customElements.define('b-b', class extends HTMLElement { - constructor() { - super(); - constructors.push('circular-level2'); - } -}); -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/custom-elements-imports/resources/connected-parsercreate.html b/third_party/blink/web_tests/web-components-v0-only/custom-elements-imports/resources/connected-parsercreate.html deleted file mode 100644 index 50a61de..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/custom-elements-imports/resources/connected-parsercreate.html +++ /dev/null
@@ -1,3 +0,0 @@ -<!DOCTYPE html> -<a-a id="c"></a-a> -<a-a id="d"></a-a>
diff --git a/third_party/blink/web_tests/web-components-v0-only/custom-elements-imports/resources/connected-upgrade.html b/third_party/blink/web_tests/web-components-v0-only/custom-elements-imports/resources/connected-upgrade.html deleted file mode 100644 index 34cb5dcc..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/custom-elements-imports/resources/connected-upgrade.html +++ /dev/null
@@ -1,3 +0,0 @@ -<!DOCTYPE html> -<a-a id="a"></a-a> -<a-a id="b"></a-a>
diff --git a/third_party/blink/web_tests/web-components-v0-only/custom-elements-imports/resources/create-element.html b/third_party/blink/web_tests/web-components-v0-only/custom-elements-imports/resources/create-element.html deleted file mode 100644 index a98bd07..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/custom-elements-imports/resources/create-element.html +++ /dev/null
@@ -1,38 +0,0 @@ -<script> -'use strict'; - -let constructors = []; - -test(() => { - assert_equals(constructors.length, 0); - - class MyElement extends HTMLElement { - constructor() { - super(); - constructors.push(this); - } - } - - customElements.define('a-a', MyElement); - - // createElement should synchronously call constructor. - let a = document.createElement('a-a'); - assert_equals(constructors.length, 1); - assert_equals(a.ownerDocument, document); - - let importDoc = document.currentScript.ownerDocument; - - // TODO(kochi): crbug.com/640465 createElement returns wrong ownerDocument - // createElement should work in imported document. - let b = importDoc.createElement('a-a') - assert_equals(b.ownerDocument, importDoc); - assert_equals(constructors.length, 2); - - // new MyElement() should synchronously call constructor. - let c = new MyElement(); - assert_equals(c.ownerDocument, document); - assert_equals(constructors.length, 3); - - assert_array_equals(constructors, [a, b, c]); -}, 'createElement() and new MyElement should work in imported document.'); -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/custom-elements-imports/resources/import-custom.html b/third_party/blink/web_tests/web-components-v0-only/custom-elements-imports/resources/import-custom.html deleted file mode 100644 index 010bcd15..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/custom-elements-imports/resources/import-custom.html +++ /dev/null
@@ -1,2 +0,0 @@ -<!DOCTYPE html> -<x-x></x-x>
diff --git a/third_party/blink/web_tests/web-components-v0-only/custom-elements-imports/resources/inner-html.html b/third_party/blink/web_tests/web-components-v0-only/custom-elements-imports/resources/inner-html.html deleted file mode 100644 index b227e754..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/custom-elements-imports/resources/inner-html.html +++ /dev/null
@@ -1,28 +0,0 @@ -<!DOCTYPE html> -<script src="../../spec/resources/custom-elements-helpers.js"></script> -<div id="sandbox"></div> -<script> -'use strict'; - -test(() => { - let constructors = []; - assert_equals(constructors.length, 0); - - class MyElement extends HTMLElement { - constructor() { - super(); - constructors.push(this); - } - } - customElements.define('a-a', MyElement); - - let importDoc = document.currentScript.ownerDocument; - let sandbox = importDoc.querySelector('#sandbox'); - - sandbox.innerHTML = '<a-a></a-a>'; - - let a = importDoc.querySelector('a-a'); - assert_is_upgraded(a, MyElement, '<a-a> should be upgraded.'); - assert_array_equals(constructors, [a]); -}, 'innerHTML with custom elements should work in imported document.'); -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/custom-elements-imports/resources/nested-level1.html b/third_party/blink/web_tests/web-components-v0-only/custom-elements-imports/resources/nested-level1.html deleted file mode 100644 index b7388cff..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/custom-elements-imports/resources/nested-level1.html +++ /dev/null
@@ -1,14 +0,0 @@ -<!DOCTYPE html> -<link rel="import" href="nested-level2.html"> -<script> -'use strict'; - -class NestedLevel1 extends HTMLElement { - constructor() { - super(); - constructors.push({element: this, type: 'nested-level1'}); - } -} - -customElements.define('a-a', NestedLevel1); -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/custom-elements-imports/resources/nested-level2.html b/third_party/blink/web_tests/web-components-v0-only/custom-elements-imports/resources/nested-level2.html deleted file mode 100644 index 4af6cf4..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/custom-elements-imports/resources/nested-level2.html +++ /dev/null
@@ -1,13 +0,0 @@ -<!DOCTYPE html> -<link rel="import" href="nested-level3.html"> -<script> -'use strict'; - -class NestedLevel2 extends HTMLElement { - constructor() { - super(); - constructors.push({element: this, type: 'nested-level2'}); - } -} -customElements.define('b-b', NestedLevel2); -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/custom-elements-imports/resources/nested-level3.html b/third_party/blink/web_tests/web-components-v0-only/custom-elements-imports/resources/nested-level3.html deleted file mode 100644 index 3f69b5e8..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/custom-elements-imports/resources/nested-level3.html +++ /dev/null
@@ -1,12 +0,0 @@ -<!DOCTYPE html> -<script> -'use strict'; - -class NestedLevel3 extends HTMLElement { - constructor() { - super(); - constructors.push({element: this, type: 'nested-level3'}); - } -} -customElements.define('c-c', NestedLevel3); -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/custom-elements-imports/resources/upgrade.html b/third_party/blink/web_tests/web-components-v0-only/custom-elements-imports/resources/upgrade.html deleted file mode 100644 index ad5e0e5..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/custom-elements-imports/resources/upgrade.html +++ /dev/null
@@ -1,13 +0,0 @@ -<!DOCTYPE html> -<x-x id="aa"></x-x> -<y-y id="bb"></y-y> -<script> -'use strict'; - -customElements.define('x-x', class extends HTMLElement { - constructor() { - super(); - reactions.push({ type: 'constructor', element: this }); - } -}); -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/custom-elements-imports/sync-create-element-order.html b/third_party/blink/web_tests/web-components-v0-only/custom-elements-imports/sync-create-element-order.html deleted file mode 100644 index 178c3d1..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/custom-elements-imports/sync-create-element-order.html +++ /dev/null
@@ -1,45 +0,0 @@ -<!DOCTYPE html> -<script src="../../resources/testharness.js"></script> -<script src="../../resources/testharnessreport.js"></script> -<script> -'use strict'; - -let reactions = []; - -let test = async_test('Constructor should run in the order elements are created'); - -test.step(() => { - customElements.define('x-x', class extends HTMLElement { - constructor() { - super(); - reactions.push(this); - } - }); - assert_array_equals(reactions, [], 'Should not have parsed <x-x> yet'); -}); -</script> - -<x-x></x-x> - -<script> -'use strict'; - -test.step(() => { - assert_equals(reactions.length, 1, 'Parser should invoke the custom element constructor'); -}); - -let import1 = document.createElement('link'); -import1.rel = 'import'; -import1.href = 'resources/import-custom.html'; - -// TODO(kochi): crbug.com/640465 synchronous creation fails in imports. -import1.onload = test.step_func_done(() => { - let elementInClient = document.querySelector('x-x'); - let elementInImport = import1.import.querySelector('x-x'); - - assert_array_equals(reactions, [elementInClient, elementInImport], - 'Constructor should run in the order elements are created'); -}); - -document.head.appendChild(import1); -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/custom-elements-imports/upgrade-order.html b/third_party/blink/web_tests/web-components-v0-only/custom-elements-imports/upgrade-order.html deleted file mode 100644 index eb9728e..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/custom-elements-imports/upgrade-order.html +++ /dev/null
@@ -1,30 +0,0 @@ -<!DOCTYPE html> -<script src="../../resources/testharness.js"></script> -<script src="../../resources/testharnessreport.js"></script> -<script> -'use strict'; - -let reactions = []; -</script> -<x-x id="a"></x-x> -<y-y id="x"></y-y> -<link id="import1" rel="import" href="resources/upgrade.html"> -<x-x id="b"></x-x> -<y-y id="y"></y-y> -<script> -'use strict' - -async_test((test) => { - window.onload = test.step_func_done(() => { - customElements.define('y-y', class extends HTMLElement { - constructor() { - super(); - reactions.push({ type: 'constructor', element: this }); - } - }); - - let elements = reactions.map(e => e.element.id); - assert_array_equals(elements, ['a', 'aa', 'b', 'x', 'bb', 'y']); - }, 'Upgrade of custom elements should happen in document order.'); -}); -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/custom-elements.html b/third_party/blink/web_tests/web-components-v0-only/custom-elements.html deleted file mode 100644 index 4e6dfe6..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/custom-elements.html +++ /dev/null
@@ -1,38 +0,0 @@ -<!DOCTYPE html> -<script src="../resources/js-test.js"></script> -<body> -<script> -description('Tests basic web-exposure of Custom Elements'); - -function evalAndLogValue(s) { - debug(evalAndLog(s)); - debug(''); -} - -evalAndLogValue('Document.prototype.hasOwnProperty("registerElement")'); -evalAndLogValue('typeof Document.prototype.registerElement'); -evalAndLogValue('document.createElement("x-a") instanceof HTMLUnknownElement'); - -var div = document.createElement('div'); -div.innerHTML = '<div is="x-b">'; -document.body.appendChild(div); -evalAndLogValue('document.querySelector(":unresolved")'); -div.remove(); - -var span = document.createElement('span', 'type-extension'); -evalAndLogValue('span.getAttribute("is")'); - -class A extends HTMLButtonElement { - constructor() { - super(); - } -} - -if (shouldNotThrow('window.customElements.define("a-a", A, {extends: "b"})')) { - if (window.internals) { - shouldBeTrue(internals.runtimeFlags.customElementsBuiltinEnabled); - } -} - -successfullyParsed = true; -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/editing-selection/modify_move/move_backward_line_import_crash.html b/third_party/blink/web_tests/web-components-v0-only/editing-selection/modify_move/move_backward_line_import_crash.html deleted file mode 100644 index b1ccd24..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/editing-selection/modify_move/move_backward_line_import_crash.html +++ /dev/null
@@ -1,28 +0,0 @@ -<!doctype html> -<script src="../../../resources/testharness.js"></script> -<script src="../../../resources/testharnessreport.js"></script> -<div id="sample"></div> -<div id="log"></div> -<script> -test(() => { - var sample = document.getElementById('sample'); - sample.innerHTML = '<select><option>1</option></select><style>@import url(-)</style>'; - // Mark tree dirty - document.body.appendChild(sample); - // Force layout - sample.offsetHeight; - - var importElement = document.createElement('link'); - importElement.setAttribute('rel', 'import'); - sample.appendChild(importElement); - - var selection = window.getSelection(); - selection.collapse(sample, 1); - selection.modify('move', 'backward', 'line'); - - assert_equals(selection.anchorNode, sample, 'anchorNode'); - assert_equals(selection.anchorOffset, 0, 'anchorOffset'); - assert_equals(selection.focusNode, sample, 'focusNode'); - assert_equals(selection.focusOffset, 0, 'focusOffset'); -}, 'move backward line should not crash with link/import'); -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/editing-shadow/adjusting-editing-boundary-with-table-in-shadow-expected.txt b/third_party/blink/web_tests/web-components-v0-only/editing-shadow/adjusting-editing-boundary-with-table-in-shadow-expected.txt deleted file mode 100644 index a8eb172..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/editing-shadow/adjusting-editing-boundary-with-table-in-shadow-expected.txt +++ /dev/null
@@ -1,4 +0,0 @@ -CONSOLE WARNING: line 19: Element.createShadowRoot is deprecated and will be removed in M80, around February 2020. Please use Element.attachShadow instead. See https://www.chromestatus.com/features/4507242028072960 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -Selecting around a table which is distributed from shadow subtree to nested shadow subtree will trigger an assertion. To try manually, select from "shadow 2" to around "after" and confirm a crash does not occur. - -PASS
diff --git a/third_party/blink/web_tests/web-components-v0-only/editing-shadow/adjusting-editing-boundary-with-table-in-shadow.html b/third_party/blink/web_tests/web-components-v0-only/editing-shadow/adjusting-editing-boundary-with-table-in-shadow.html deleted file mode 100644 index d3c7587..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/editing-shadow/adjusting-editing-boundary-with-table-in-shadow.html +++ /dev/null
@@ -1,42 +0,0 @@ -<!DOCTYPE html> -<html> -<body> -<script src="../../fast/dom/resources/event-sender-util.js"></script> - -<div id="container" contenteditable> - <table border="1" id="host" contenteditable> - <tr><td>host 1</td></tr> - <tr><td>host 2</td></tr> - </table> -</div> - -<p id="description">Selecting around a table which is distributed from shadow subtree to nested shadow subtree will trigger an assertion. To try manually, select from "shadow 2" to around "after" and confirm a crash does not occur.</p> - -<script> -if (window.testRunner) - testRunner.dumpAsText(); - -var shadowRoot = host.createShadowRoot(); -var div = document.createElement('div'); -shadowRoot.appendChild(div); -div.innerHTML = "<table border='1'><tr><td>shadow 1</td></tr><tr><td id='src'>shadow 2</td></tr></table>"; - -var nestedShadowRoot = div.createShadowRoot(); -nestedShadowRoot.innerHTML = "<div contenteditable>before<shadow></shadow>after</div>"; - -var src = shadowRoot.getElementById('src'); - -if (window.eventSender) { - eventSender.mouseMoveTo(src.offsetLeft + 10, src.offsetTop + src.offsetHeight / 2); - eventSender.mouseDown(); - eventSender.mouseMoveTo(src.offsetLeft - 10, src.offsetTop + src.offsetHeight / 2); - eventSender.mouseUp(); - - container.innerHTML = "PASS"; -} - -// When description comes before container, this test will not fail if code is wrong. So let's move here. -container.parentNode.insertBefore(description, container); -</script> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/editing-shadow/contenteditable-propagation-to-distributed-node-expected.txt b/third_party/blink/web_tests/web-components-v0-only/editing-shadow/contenteditable-propagation-to-distributed-node-expected.txt deleted file mode 100644 index c051aba..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/editing-shadow/contenteditable-propagation-to-distributed-node-expected.txt +++ /dev/null
@@ -1,9 +0,0 @@ -CONSOLE WARNING: line 13: Element.createShadowRoot is deprecated and will be removed in M80, around February 2020. Please use Element.attachShadow instead. See https://www.chromestatus.com/features/4507242028072960 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -This test checks that contenteditable is propagated to distributed nodes. - -PASS getComputedStyle(shadowRoot.querySelector('span'), null).webkitUserModify is "read-only" -PASS getComputedStyle(shadowRoot.querySelector('content').getDistributedNodes()[0], null).webkitUserModify is "read-write" -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/blink/web_tests/web-components-v0-only/editing-shadow/contenteditable-propagation-to-distributed-node.html b/third_party/blink/web_tests/web-components-v0-only/editing-shadow/contenteditable-propagation-to-distributed-node.html deleted file mode 100644 index a7813b3..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/editing-shadow/contenteditable-propagation-to-distributed-node.html +++ /dev/null
@@ -1,23 +0,0 @@ -<!DOCTYPE html> -<script src="../../resources/js-test.js"></script> -<p>This test checks that contenteditable is propagated to distributed nodes.</p> -<div id="host" contenteditable><span></span></div> -<pre id="console"></pre> -<script> -if (window.testRunner) - testRunner.dumpAsText(); - -// An important part is that the span created below triggers a check for -// re-using inherited props from the cache for the distributed span. - -var shadowRoot = host.createShadowRoot(); -var span = document.createElement("span"); -var content = document.createElement("content"); -shadowRoot.appendChild(span); -shadowRoot.appendChild(content); - -shouldBeEqualToString("getComputedStyle(shadowRoot.querySelector('span'), null).webkitUserModify", "read-only"); -shouldBeEqualToString("getComputedStyle(shadowRoot.querySelector('content').getDistributedNodes()[0], null).webkitUserModify", "read-write"); - -successfullyParsed = true; -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/editing-shadow/delete-characters-in-distributed-node-crash-expected.txt b/third_party/blink/web_tests/web-components-v0-only/editing-shadow/delete-characters-in-distributed-node-crash-expected.txt deleted file mode 100644 index 73b5e77..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/editing-shadow/delete-characters-in-distributed-node-crash-expected.txt +++ /dev/null
@@ -1,4 +0,0 @@ -CONSOLE WARNING: line 9: Element.createShadowRoot is deprecated and will be removed in M80, around February 2020. Please use Element.attachShadow instead. See https://www.chromestatus.com/features/4507242028072960 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -This tests the deletion of text in distributed node does not crash. To run it outside of DRT, you must delete text, 'foo', manually. - -PASS
diff --git a/third_party/blink/web_tests/web-components-v0-only/editing-shadow/delete-characters-in-distributed-node-crash.html b/third_party/blink/web_tests/web-components-v0-only/editing-shadow/delete-characters-in-distributed-node-crash.html deleted file mode 100644 index 536cf06..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/editing-shadow/delete-characters-in-distributed-node-crash.html +++ /dev/null
@@ -1,19 +0,0 @@ -<!DOCTYPE html> -<html> -<body> -<p id="description">This tests the deletion of text in distributed node does not crash. To run it outside of DRT, you must delete text, 'foo', manually.</p> -<div id="wrapper"><div id="shadowhost" contenteditable><div>foo</div></div></div> -<script> -if (window.testRunner) - testRunner.dumpAsText(); -var shadowRoot = document.getElementById('shadowhost').createShadowRoot(); -shadowRoot.innerHTML = "<content></content>"; - -var textNode = document.getElementById('shadowhost').firstChild.firstChild; -window.getSelection().setBaseAndExtent(textNode, 0, textNode, 3); -document.execCommand('Delete'); - -document.getElementById("wrapper").innerHTML = "PASS"; -</script> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/editing-shadow/delete-list-in-shadow-expected.txt b/third_party/blink/web_tests/web-components-v0-only/editing-shadow/delete-list-in-shadow-expected.txt deleted file mode 100644 index 248d188..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/editing-shadow/delete-list-in-shadow-expected.txt +++ /dev/null
@@ -1,10 +0,0 @@ -CONSOLE WARNING: line 22: Element.createShadowRoot is deprecated and will be removed in M80, around February 2020. Please use Element.attachShadow instead. See https://www.chromestatus.com/features/4507242028072960 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -Elements distributed to Shadow DOM should be deleted correctly when pressing delete key. - -To test manually, select somewhere in ABCDE from somehwere in 12345, and press delete, and check the selected text is deleted correctly. - -PASS hostTextContent is 'AB345' -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/blink/web_tests/web-components-v0-only/editing-shadow/delete-list-in-shadow.html b/third_party/blink/web_tests/web-components-v0-only/editing-shadow/delete-list-in-shadow.html deleted file mode 100644 index 70e94810..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/editing-shadow/delete-list-in-shadow.html +++ /dev/null
@@ -1,45 +0,0 @@ -<!DOCTYPE html> -<html> -<body> -<script src="../../resources/js-test.js"></script> - -<p>Elements distributed to Shadow DOM should be deleted correctly when pressing delete key.</p> -<p>To test manually, select somewhere in ABCDE from somehwere in 12345, and press delete, and check the selected text is deleted correctly.</p> - -<div id="container"> - <ol id="host" contenteditable> - <li id="list1">ABCDE</li> - <li id="list2">abcde</li> - <li id="list3">12345</li> - </ol> -</div> -<pre id="console"></pre> - -<script> -if (window.testRunner) - testRunner.dumpAsText(); - -var shadowRoot = host.createShadowRoot(); -var li = document.createElement('li'); -li.innerHTML = 'hogehoge'; -shadowRoot.appendChild(li); -var shadow = document.createElement('shadow'); -shadow.appendChild(document.createElement('content')); -shadowRoot.appendChild(shadow); - -if (window.eventSender) { - eventSender.mouseMoveTo(list1.offsetLeft + 20, list1.offsetTop + list1.offsetHeight / 2); - eventSender.mouseDown(); - eventSender.mouseMoveTo(list3.offsetLeft + 20, list3.offsetTop + list3.offsetHeight / 2); - eventSender.mouseUp(); - - eventSender.keyDown('Delete'); - - var hostTextContent = host.textContent.replace(/^\s+|\s+$/g, ''); - shouldBe("hostTextContent", "'AB345'"); - container.innerHTML = ""; -} -</script> - -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/editing-shadow/pressing-enter-on-list-expected.txt b/third_party/blink/web_tests/web-components-v0-only/editing-shadow/pressing-enter-on-list-expected.txt deleted file mode 100644 index cf4f374..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/editing-shadow/pressing-enter-on-list-expected.txt +++ /dev/null
@@ -1,6 +0,0 @@ -CONSOLE WARNING: line 22: Element.createShadowRoot is deprecated and will be removed in M80, around February 2020. Please use Element.attachShadow instead. See https://www.chromestatus.com/features/4507242028072960 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -Pressing enter on the last character of <li> element in Shadow DOM was triggering assertion, because modifying Shadow DOM removes the renderer in Shadow DOM and desendant of shadow host. - -This tests confirms it won't happen any more. - -PASS
diff --git a/third_party/blink/web_tests/web-components-v0-only/editing-shadow/pressing-enter-on-list.html b/third_party/blink/web_tests/web-components-v0-only/editing-shadow/pressing-enter-on-list.html deleted file mode 100644 index 54e6109f..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/editing-shadow/pressing-enter-on-list.html +++ /dev/null
@@ -1,37 +0,0 @@ -<!DOCTYPE html> -<html> -<body> -<script src="../../fast/dom/resources/event-sender-util.js"></script> - -<p>Pressing enter on the last character of <li> element in Shadow DOM was triggering assertion, -because modifying Shadow DOM removes the renderer in Shadow DOM and desendant of shadow host.</p> -<p>This tests confirms it won't happen any more.</p> - -<div id="container"> - <ol id="host" contenteditable> - <li>LIST 1</li> - <li id="list2">LIST 2</li> - <li>LIST 3</li> - </ol> -</div> - -<script> -if (window.testRunner) - testRunner.dumpAsText(); - -var shadowRoot = host.createShadowRoot(); -var li = document.createElement('li'); -li.innerHTML = 'inside shadow'; -shadowRoot.appendChild(li); -shadowRoot.appendChild(document.createElement('shadow')); - -eventSender.mouseMoveTo(list2.offsetLeft + list2.offsetWidth - 10, list2.offsetTop + list2.offsetHeight / 2); -eventSender.mouseDown(); -eventSender.mouseUp(); - -eventSender.keyDown('\n'); - -container.innerHTML = "PASS"; -</script> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast-css/boundary-crossing-scopes-null-resolver-crash.html b/third_party/blink/web_tests/web-components-v0-only/fast-css/boundary-crossing-scopes-null-resolver-crash.html deleted file mode 100644 index 721a35c92e..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast-css/boundary-crossing-scopes-null-resolver-crash.html +++ /dev/null
@@ -1,29 +0,0 @@ -<!DOCTYPE html> -<script src="../../resources/testharness.js"></script> -<script src="../../resources/testharnessreport.js"></script> -<style>.green { color: green }</style> -<div id="host"> - <div id="inner">Green, should not crash.</div> -</div> -<script> - var root = host.createShadowRoot(); - - test(() => { - root.innerHTML = "<style>:host ::content * { color:red }</style><content>"; - document.body.offsetTop; - assert_equals(getComputedStyle(inner).color, "rgb(255, 0, 0)", "#inner is initially red."); - }, "Check that #inner is initially red."); - - test(() => { - // Inserting a document stylesheet before another one causes a - // StyleResolver Reconstruct. - var newSheet = document.createElement("style"); - newSheet.innerText = "#nomatch { color: red }"; - document.head.insertBefore(newSheet, document.querySelector("style")); - // Removing the shadow stylesheet will cause the ScopedStyleResolver - // to be nuked. - root.innerHTML = "<content>"; - inner.className = "green"; - assert_equals(getComputedStyle(inner).color, "rgb(0, 128, 0)", "Check that #inner is green after the class is set."); - }, "Reconstructing StyleResolver should not leave any treeBoundaryCrossingScopes with null ScopedStyleResolvers in StyleEngine."); -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast-css/media-query-in-html-import.html b/third_party/blink/web_tests/web-components-v0-only/fast-css/media-query-in-html-import.html deleted file mode 100644 index 699d77b..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast-css/media-query-in-html-import.html +++ /dev/null
@@ -1,10 +0,0 @@ -<!DOCTYPE html> -<script src="../../resources/testharness.js"></script> -<script src="../../resources/testharnessreport.js"></script> -<link rel="import" href="data:text/html,<style>@media (max-width: 0px){div{background:red}}</style>"> -<div></div> -<script> - test(() => { - assert_equals(getComputedStyle(document.querySelector("div")).backgroundColor, "rgba(0, 0, 0, 0)"); - }, "(max-width: 0px) media query in import document should not evaluate to true."); -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast-loader/javascript-detached-frame-no-crash-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast-loader/javascript-detached-frame-no-crash-expected.txt deleted file mode 100644 index 260231ae..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast-loader/javascript-detached-frame-no-crash-expected.txt +++ /dev/null
@@ -1,10 +0,0 @@ -CONSOLE WARNING: line 2: HTML Imports is deprecated and will be removed in M80, around February 2020. Please use ES modules instead. See https://www.chromestatus.com/features/5144752345317376 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -Navigating to a javascript: URL from a document having html imports should not crash. - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - -PASS no crash. -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast-loader/javascript-detached-frame-no-crash.html b/third_party/blink/web_tests/web-components-v0-only/fast-loader/javascript-detached-frame-no-crash.html deleted file mode 100644 index cfce12b4..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast-loader/javascript-detached-frame-no-crash.html +++ /dev/null
@@ -1,20 +0,0 @@ -<!DOCTYPE html> -<script src="../../resources/js-test.js"></script> -<script> -description("Navigating to a javascript: URL from a document having html imports should not crash."); -self.jsTestIsAsync = true; -if (window.testRunner) { - testRunner.dumpAsText(); - testRunner.waitUntilDone(); -} - -var iframeLoadCount = 0; -function runTest() { - // Both the initial load and completion of the javascript: navigation will trigger a 'load'. - if (++iframeLoadCount == 2) { - testPassed("no crash."); - setTimeout(finishJSTest, 0); - } -} -</script> -<iframe onload="runTest();" src="resources/javascript-detached-frame-iframe.html"></iframe>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast-loader/resources/javascript-detached-frame-iframe.html b/third_party/blink/web_tests/web-components-v0-only/fast-loader/resources/javascript-detached-frame-iframe.html deleted file mode 100644 index 90d20ff..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast-loader/resources/javascript-detached-frame-iframe.html +++ /dev/null
@@ -1,7 +0,0 @@ -<!DOCTYPE html> -<link href="empty.html" rel="import"/> -<script> -window.onload = function() { - window.location.href = "javascript:'pass'"; -} -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/canvas/bug535171-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/canvas/bug535171-expected.txt deleted file mode 100644 index 14d67b8..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/canvas/bug535171-expected.txt +++ /dev/null
@@ -1,2 +0,0 @@ -CONSOLE WARNING: line 7: Element.createShadowRoot is deprecated and will be removed in M80, around February 2020. Please use Element.attachShadow instead. See https://www.chromestatus.com/features/4507242028072960 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/canvas/bug535171.html b/third_party/blink/web_tests/web-components-v0-only/fast/canvas/bug535171.html deleted file mode 100644 index cdd926e..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/canvas/bug535171.html +++ /dev/null
@@ -1,11 +0,0 @@ -<!DOCTYPE HTML> -<script> -//Test passes by not crashing -if (window.testRunner) { - testRunner.dumpAsText(); -} -document.documentElement.createShadowRoot(); -var canvas = document.createElement('canvas'); -var context = canvas.getContext('2d'); -context.font = 'italic 40pt Calibri'; -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/content-distributed-nodes-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/content-distributed-nodes-expected.txt deleted file mode 100644 index 974787b..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/content-distributed-nodes-expected.txt +++ /dev/null
@@ -1,12 +0,0 @@ -CONSOLE WARNING: line 10: Element.createShadowRoot is deprecated and will be removed in M80, around February 2020. Please use Element.attachShadow instead. See https://www.chromestatus.com/features/4507242028072960 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -Checking if styles in the nested shadow roots apply properly to distributed elements. (v0 bug compatible) - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - -PASS getComputedStyle(span).color is "rgb(255, 0, 0)" -PASS getComputedStyle(span).backgroundColor is "rgb(0, 128, 0)" -PASS successfullyParsed is true - -TEST COMPLETE - -red?
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/content-distributed-nodes.html b/third_party/blink/web_tests/web-components-v0-only/fast/content-distributed-nodes.html deleted file mode 100644 index 3c2b9ed..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/content-distributed-nodes.html +++ /dev/null
@@ -1,17 +0,0 @@ -<!DOCTYPE html> -<script src="../../resources/js-test.js"></script> -<div id="host"> - <div> - <span class="red" id="span">red?</span> - </div> -</div> -<script> -description('Checking if styles in the nested shadow roots apply properly to distributed elements. (v0 bug compatible)'); -var root = document.querySelector('#host').createShadowRoot(); -root.innerHTML = '<div><content></content></div><style>::content .red { color: green; }</style>'; -var root2 = root.firstChild.createShadowRoot(); -root2.innerHTML = '<style>::content .red { background-color: green; color: red; }</style><content></content>'; -var span = document.querySelector('#span'); -shouldBeEqualToString('getComputedStyle(span).color', 'rgb(255, 0, 0)'); -shouldBeEqualToString('getComputedStyle(span).backgroundColor', 'rgb(0, 128, 0)'); -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/content-element-select-null.html b/third_party/blink/web_tests/web-components-v0-only/fast/content-element-select-null.html deleted file mode 100644 index 47034c6..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/content-element-select-null.html +++ /dev/null
@@ -1,15 +0,0 @@ -<!DOCTYPE HTML> -<title>content element test for select attribute, null and undefined arguments</title> -<script src="../../resources/testharness.js"></script> -<script src="../../resources/testharnessreport.js"></script> -<script> - -test(function() { - var element = document.createElement('content'); - assert_equals(element.select, ''); - element.select = null - assert_equals(element.select, 'null'); - element.select = undefined - assert_equals(element.select, 'undefined'); -}); -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/css-invalidation/content-pseudo-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/css-invalidation/content-pseudo-expected.txt deleted file mode 100644 index 3b864a0..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/css-invalidation/content-pseudo-expected.txt +++ /dev/null
@@ -1,13 +0,0 @@ -CONSOLE WARNING: line 11: Element.createShadowRoot is deprecated and will be removed in M80, around February 2020. Please use Element.attachShadow instead. See https://www.chromestatus.com/features/4507242028072960 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -No need to invalidate for selectors right of ::content as ::content causes subtree invalidation. - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - -PASS getComputedStyle(green).color is "rgb(0, 0, 0)" -PASS internals.updateStyleAndReturnAffectedElementCount() is 2 -PASS getComputedStyle(green).color is "rgb(0, 128, 0)" -PASS successfullyParsed is true - -TEST COMPLETE - -This text should be green
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/css-invalidation/content-pseudo.html b/third_party/blink/web_tests/web-components-v0-only/fast/css-invalidation/content-pseudo.html deleted file mode 100644 index b3e6cf4d..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/css-invalidation/content-pseudo.html +++ /dev/null
@@ -1,23 +0,0 @@ -<!DOCTYPE html> -<script src="../../../resources/js-test.js"></script> -<host id="host"> - <div> - <div id="green" class="b">This text should be green</div> - </div> -</host> -<script> -description("No need to invalidate for selectors right of ::content as ::content causes subtree invalidation."); - -var root = host.createShadowRoot(); -root.innerHTML = '<style>.a ::content .b { color: green }</style><div id="outer"><div class="b"><div class="b"><div class="b"><content/></div></div></div></div>'; - -shouldBeEqualToString("getComputedStyle(green).color", "rgb(0, 0, 0)"); - -host.offsetTop; // force recalc - -root.querySelector("#outer").className = "a"; -if (window.internals) - shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "2"); - -shouldBeEqualToString("getComputedStyle(green).color", "rgb(0, 128, 0)"); -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/css-invalidation/targeted-class-content-pseudo-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/css-invalidation/targeted-class-content-pseudo-expected.txt deleted file mode 100644 index 668b859..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/css-invalidation/targeted-class-content-pseudo-expected.txt +++ /dev/null
@@ -1,18 +0,0 @@ -CONSOLE WARNING: line 25: Element.createShadowRoot is deprecated and will be removed in M80, around February 2020. Please use Element.attachShadow instead. See https://www.chromestatus.com/features/4507242028072960 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -Check that targeted class invalidation works for ::content selectors. - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - -PASS getComputedStyle(r1, null).backgroundColor is transparent -PASS internals.updateStyleAndReturnAffectedElementCount() is 5 -PASS getComputedStyle(r1, null).backgroundColor is green -PASS getComputedStyle(r2, null).backgroundColor is transparent -PASS internals.updateStyleAndReturnAffectedElementCount() is 3 -PASS getComputedStyle(r2, null).backgroundColor is green -PASS getComputedStyle(r3, null).backgroundColor is transparent -PASS internals.updateStyleAndReturnAffectedElementCount() is 1 -PASS getComputedStyle(r3, null).backgroundColor is green -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/css-invalidation/targeted-class-content-pseudo.html b/third_party/blink/web_tests/web-components-v0-only/fast/css-invalidation/targeted-class-content-pseudo.html deleted file mode 100644 index 849fe4e..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/css-invalidation/targeted-class-content-pseudo.html +++ /dev/null
@@ -1,66 +0,0 @@ -<!DOCTYPE html> -<script src="../../../resources/js-test.js"></script> -<div id="host1"> - <div id="r1"> - <div></div> - <div></div> - </div> - <div></div> - <div></div> -</div> -<div id="host2"> - <div> - <div id="r2"></div> - </div> - <div></div> -</div> -<div id="host3"> - <div id="r3"></div> -</div> -<script> -description("Check that targeted class invalidation works for ::content selectors."); - -// Create shadow trees - -host1.createShadowRoot().innerHTML = '<style>.c1::content #r1 { background-color: green }</style><content id="i1"></content>'; -host2.createShadowRoot().innerHTML = '<style>.c2 ::content #r2 { background-color: green }</style><div id="i2"><div><content></content></div><div></div><div></div></div>'; -host3.createShadowRoot().innerHTML = '<style>.c3::content * { background-color: green }</style><content id="i3"></content>'; - -var transparent = "rgba(0, 0, 0, 0)"; -var green = "rgb(0, 128, 0)"; - - -shouldBe("getComputedStyle(r1, null).backgroundColor", "transparent"); - -document.body.offsetTop; // Force style recalc. -var i1 = host1.shadowRoot.getElementById("i1"); -i1.className = "c1"; - -if (window.internals) - shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "5"); - -shouldBe("getComputedStyle(r1, null).backgroundColor", "green"); - -shouldBe("getComputedStyle(r2, null).backgroundColor", "transparent"); - -document.body.offsetTop; // Force style recalc. -var i2 = host2.shadowRoot.getElementById("i2"); -i2.className = "c2"; - -if (window.internals) - shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "3"); - -shouldBe("getComputedStyle(r2, null).backgroundColor", "green"); - -shouldBe("getComputedStyle(r3, null).backgroundColor", "transparent"); - -document.body.offsetTop; // Force style recalc. -var i3 = host3.shadowRoot.getElementById("i3"); -i3.className = "c3"; - -if (window.internals) - shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "1"); - -shouldBe("getComputedStyle(r3, null).backgroundColor", "green"); - -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/css/remove-pending-sheet-html-import-crash-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/css/remove-pending-sheet-html-import-crash-expected.txt deleted file mode 100644 index 47326bb..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/css/remove-pending-sheet-html-import-crash-expected.txt +++ /dev/null
@@ -1,2 +0,0 @@ -CONSOLE WARNING: line 2: HTML Imports is deprecated and will be removed in M80, around February 2020. Please use ES modules instead. See https://www.chromestatus.com/features/5144752345317376 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -PASS if this test didn't crash.
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/css/remove-pending-sheet-html-import-crash.html b/third_party/blink/web_tests/web-components-v0-only/fast/css/remove-pending-sheet-html-import-crash.html deleted file mode 100644 index dda9887..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/css/remove-pending-sheet-html-import-crash.html +++ /dev/null
@@ -1,7 +0,0 @@ -<!DOCTYPE html> -<link rel="import" href="resources/import-layout-with-pending-sheet.html"> -<script> -if (window.testRunner) - testRunner.dumpAsText(); -</script> -<p>PASS if this test didn't crash.</p>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/css/resources/import-layout-with-pending-sheet.html b/third_party/blink/web_tests/web-components-v0-only/fast/css/resources/import-layout-with-pending-sheet.html deleted file mode 100644 index 54c28ee1..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/css/resources/import-layout-with-pending-sheet.html +++ /dev/null
@@ -1,8 +0,0 @@ -<!DOCTYPE html> -<script> -window.addEventListener('DOMContentLoaded', function() { - document.querySelector("link").import.querySelector("p").scrollLeft; -}); -</script> -<p></p> -<link rel="stylesheet" href="style.css">
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-HTMLTemplateElement/custom-element-wrapper-gc-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-HTMLTemplateElement/custom-element-wrapper-gc-expected.txt deleted file mode 100644 index d3bab9f..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-HTMLTemplateElement/custom-element-wrapper-gc-expected.txt +++ /dev/null
@@ -1,13 +0,0 @@ -CONSOLE WARNING: line 14: document.registerElement is deprecated and will be removed in M80, around February 2020. Please use window.customElements.define instead. See https://www.chromestatus.com/features/4642138092470272 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -Custom element wrappers in templates should be retained - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - -Testing major GC... -PASS customElement.expando is "present" -Testing minor GC... -PASS customElement.expando is "present" -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-HTMLTemplateElement/custom-element-wrapper-gc.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-HTMLTemplateElement/custom-element-wrapper-gc.html deleted file mode 100644 index 0a25ed6..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-HTMLTemplateElement/custom-element-wrapper-gc.html +++ /dev/null
@@ -1,42 +0,0 @@ -<!DOCTYPE html> -<div id="container"> -<template> -<x-custom></x-custom> -</template> -</div> -<script src="../../../resources/gc.js"></script> -<script src="../../../resources/js-test.js"></script> -<script> -description('Custom element wrappers in templates should be retained'); - -jsTestIsAsync = true; - -document.querySelector('template').content.ownerDocument.registerElement('x-custom', { - prototype: { - createdCallback: function() { - this.expando = 'present'; - } - } -}); - -var template, customElement; - -debug("Testing major GC..."); -asyncGC(function() { - template = document.querySelector('template'); - customElement = template.content.querySelector('x-custom'); - shouldBeEqualToString('customElement.expando', 'present'); - - container.innerHTML = container.innerHTML; - - debug("Testing minor GC..."); - asyncMinorGC(function() { - template = document.querySelector('template'); - customElement = template.content.querySelector('x-custom'); - shouldBeEqualToString('customElement.expando', 'present'); - finishJSTest(); - }); -}); - - -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-HTMLTemplateElement/import-template-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-HTMLTemplateElement/import-template-expected.txt deleted file mode 100644 index 896768a7..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-HTMLTemplateElement/import-template-expected.txt +++ /dev/null
@@ -1,9 +0,0 @@ -CONSOLE WARNING: line 19: document.registerElement is deprecated and will be removed in M80, around February 2020. Please use window.customElements.define instead. See https://www.chromestatus.com/features/4642138092470272 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - -mf1 created - -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-HTMLTemplateElement/import-template.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-HTMLTemplateElement/import-template.html deleted file mode 100644 index 7a6aae1..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-HTMLTemplateElement/import-template.html +++ /dev/null
@@ -1,23 +0,0 @@ -<!DOCTYPE html> -<script src='../../../resources/js-test.js'></script> - -<div id='console'></div> -<template id='temp'> - <my-foo id='mf1'></my-foo> - <template> - <my-foo id='mf2'></my-foo> - </template> -</template> -<script> -description(''); -var proto = Object.create(HTMLElement.prototype); -proto.createdCallback = function() { - var message = this.id + ' created\n'; - document.getElementById('console').innerText = message; -} - -document.registerElement('my-foo', {prototype: proto}); - -var template = document.getElementById('temp'); -var dom = document.importNode(template.content, true); -</script> \ No newline at end of file
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-HTMLTemplateElement/ownerDocument-import-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-HTMLTemplateElement/ownerDocument-import-expected.txt deleted file mode 100644 index 445c48f9..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-HTMLTemplateElement/ownerDocument-import-expected.txt +++ /dev/null
@@ -1,10 +0,0 @@ -CONSOLE WARNING: line 3: HTML Imports is deprecated and will be removed in M80, around February 2020. Please use ES modules instead. See https://www.chromestatus.com/features/5144752345317376 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -HTMLTemplateElement content ownerDocument in HTML imports should differ from import document - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - -PASS template.ownerDocument is not template.content.ownerDocument -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-HTMLTemplateElement/ownerDocument-import.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-HTMLTemplateElement/ownerDocument-import.html deleted file mode 100644 index fa0d277b..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-HTMLTemplateElement/ownerDocument-import.html +++ /dev/null
@@ -1,19 +0,0 @@ -<!DOCTYPE html> -<head> -<link rel=import href="resources/template-import.html"> -</head> -<body onload="runTest()"> -<script src="../../../resources/js-test.js"></script> -<script> -jsTestIsAsync = true; -description('HTMLTemplateElement content ownerDocument in HTML imports should differ from import document'); - -function runTest() { - var link = document.querySelector('link[rel=import]'); - var importDocument = link.import; - window.template = importDocument.querySelector('template'); - shouldNotBe("template.ownerDocument", "template.content.ownerDocument"); - finishJSTest(); -} -</script> -</body>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-HTMLTemplateElement/resources/template-import.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-HTMLTemplateElement/resources/template-import.html deleted file mode 100644 index ba045f7..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-HTMLTemplateElement/resources/template-import.html +++ /dev/null
@@ -1,2 +0,0 @@ -<!DOCTYPE html> -<template><div></div></template>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-SelectorAPI/only-shadow-host-in-shadow-tree-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-SelectorAPI/only-shadow-host-in-shadow-tree-expected.txt deleted file mode 100644 index 33a478bc..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-SelectorAPI/only-shadow-host-in-shadow-tree-expected.txt +++ /dev/null
@@ -1,11 +0,0 @@ -CONSOLE WARNING: line 87: Element.createShadowRoot is deprecated and will be removed in M80, around February 2020. Please use Element.attachShadow instead. See https://www.chromestatus.com/features/4507242028072960 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -crbug.com/359854: test for traversing elements in shadow tree. - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - -PASS document.querySelector('body /deep/ #target').id is "target" -PASS successfullyParsed is true - -TEST COMPLETE - -
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-SelectorAPI/only-shadow-host-in-shadow-tree.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-SelectorAPI/only-shadow-host-in-shadow-tree.html deleted file mode 100644 index 0102165..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-SelectorAPI/only-shadow-host-in-shadow-tree.html +++ /dev/null
@@ -1,24 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script src="../../../resources/js-test.js"></script> -<script src="../dom-shadow/resources/shadow-dom.js"></script> -</head> -<body> - <div id="sandbox"></div> - <pre id="console"></pre> -</body> -<script> -description("crbug.com/359854: test for traversing elements in shadow tree."); - -document.getElementById("sandbox").appendChild( - createDOM("div", {"id": "host"}, - createShadowRoot( - createDOM("div", {"id": "host2"}, - createShadowRoot( - createDOM("div", {})))), - createDOM("div", {"id": "target"}))); - -shouldBe("document.querySelector('body /deep/ #target').id", '"target"'); -</script> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/attribute-changed-callback.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/attribute-changed-callback.html deleted file mode 100644 index 195b1ae..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/attribute-changed-callback.html +++ /dev/null
@@ -1,75 +0,0 @@ -<!DOCTYPE html> -<script src="../../../resources/testharness.js"></script> -<script src="../../../resources/testharnessreport.js"></script> -<body> -<script> -test(function () { - var attributeChangedInvocations = 0; - function attributeChanged(_, _, _) { - attributeChangedInvocations++; - } - - var getterInvocations = 0; - function getter() { - getterInvocations++; - return attributeChanged; - } - - function failer() { - assert_unreached('the attribute changed callback must not be retrieved after registration'); - } - - var proto = Object.create(HTMLElement.prototype, { - attributeChangedCallback: { - get: getter - } - }); - var ctor = document.registerElement('x-a', {prototype: proto}); - assert_equals(getterInvocations, 1, 'the attribute changed callback must have been retrieved'); - - proto.attributeChangedCallback = failer; - var element = new ctor(); - element.setAttribute('a', 'b'); - assert_equals(attributeChangedInvocations, 1, 'the attribute changed callback retrieved at registration must be invoked'); -}, 'transfer attribute changed callback'); - -test(function () { - var invocations = []; - function created() { - invocations.push('created'); - } - function attributeChanged(name, oldValue, newValue) { - invocations.push(name + ': ' + oldValue + ' => ' + newValue); - } - - var proto = Object.create(HTMLElement.prototype); - proto.createdCallback = created; - proto.attributeChangedCallback = attributeChanged; - var B = document.registerElement('x-b', {prototype: proto}); - - var b = new B(); - b.id = 'x'; - assert_array_equals(invocations, ['created', 'id: null => x'], 'setting a reflected attribute should invoke the attributeChanged callback'); - - invocations = []; - b.removeAttribute('id'); - assert_array_equals(invocations, ['id: x => null'], 'removing an attribute should invoke the attributeChangedCallback'); - - invocations = []; - b.setAttribute('data-s', 't'); - assert_array_equals(invocations, ['data-s: null => t'], 'adding an attribute with setAttribute should invoke the attributeChangedCallback'); - - invocations = []; - b.classList.toggle('u'); - assert_array_equals(invocations, ['class: null => u'], 'adding a class attribute through classList should invoke the attributeChangedCallback'); - - b.setAttribute('data-v', 'w'); - invocations = []; - b.setAttribute('data-v', 'x'); - assert_array_equals(invocations, ['data-v: w => x'], 'changing an attribute with setAttribute should invoke the attributeChangedCallback'); - - invocations = []; - b.setAttribute('data-v', 'x'); - assert_array_equals(invocations, [], 'setting an attribute to the existing value with setAttribute should not invoke the attributeChangedCallback'); -}, 'add, change and remove an attribute'); -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/callback-context.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/callback-context.html deleted file mode 100644 index bbb9cbd..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/callback-context.html +++ /dev/null
@@ -1,76 +0,0 @@ -<!DOCTYPE html> -<!DOCTYPE html> -<script src="../../../resources/testharness.js"></script> -<script src="../../../resources/testharnessreport.js"></script> -<script src="test-harness-utils.js"></script> -<body> -<script> -(function () { - -var test = async_test('callbacks created in the outer frame\'s context are ' + - 'invoked in that context'); - -withFrame(function (frame) { - var outerDocument = document; - var proto = Object.create(frame.contentWindow.HTMLElement.prototype); - proto.createdCallback = test.step_func(function () { - assert_equals(document, outerDocument, - 'the context should be the outer window'); - }); - var doc = frame.contentDocument; - doc.registerElement('x-a', {prototype: proto}); - var script = doc.createElement('script'); - script.textContent = 'document.body.innerHTML = "<x-a></x-a>";'; - doc.body.appendChild(script); - frame.remove(); - test.done(); -}); - -})(); - - -(function () { - -var test = async_test('callbacks created in the inner frame\'s context are ' + - 'invoked in that context'); - -withFrame(function (frame) { - document.name = 'outer document'; - - var doc = frame.contentDocument; - doc.name = 'inner document'; - - var step = test.step_func(function (event) { - switch (event.data.step) { - case 'remove': - doc.body.firstChild.remove(); - break; - - case 'assert': - window.removeEventListener('message', step); - assert_equals(event.data.name, 'inner document', - 'the context should be the inner window'); - frame.remove(); - test.done(); - - default: - assert_not_reached(); - }; - }); - window.addEventListener('message', step); - - var script = doc.createElement('script'); - script.textContent = - 'var proto = Object.create(HTMLElement.prototype); ' + - 'proto.detachedCallback = function () { ' + - ' window.parent.postMessage(' + - ' {step: "assert", name: document.name}, "*");' + - '}; ' + - 'document.registerElement("x-a", {prototype: proto}); ' + - 'document.body.innerHTML = "<x-a></x-a>"; ' + - 'window.parent.postMessage({step: "remove"}, "*");'; - doc.body.appendChild(script); -}); - -})(); -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/callback-timing-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/callback-timing-expected.txt deleted file mode 100644 index 8f30a23..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/callback-timing-expected.txt +++ /dev/null
@@ -1,12 +0,0 @@ -CONSOLE WARNING: line 22: document.registerElement is deprecated and will be removed in M80, around February 2020. Please use window.customElements.define instead. See https://www.chromestatus.com/features/4642138092470272 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -Ensure that custom element callback fires before DOMContentLoaded event - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - -PASS successfullyParsed is true - -TEST COMPLETE - -PASS eventlog[0] is 'created x-foo' -PASS eventlog[1] is 'DOMContentLoaded event' -PASS eventlog[2] is 'load event'
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/callback-timing.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/callback-timing.html deleted file mode 100644 index f778f5e9..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/callback-timing.html +++ /dev/null
@@ -1,23 +0,0 @@ -<script src='../../../resources/js-test.js'></script> -<x-foo></x-foo> -<script> -description('Ensure that custom element callback fires before DOMContentLoaded event'); - -var eventlog = []; - -addEventListener('DOMContentLoaded', function(e) { - eventlog.push('DOMContentLoaded event'); -}); -addEventListener('load', function(e) { - eventlog.push('load event'); - - shouldBe("eventlog[0]", "'created x-foo'"); - shouldBe("eventlog[1]", "'DOMContentLoaded event'"); - shouldBe("eventlog[2]", "'load event'"); -}); -var proto = Object.create(HTMLElement.prototype); -proto.createdCallback = function() { - eventlog.push('created ' + this.localName); -}; -document.registerElement('x-foo', {prototype: proto}); -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/class-side-inheritance.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/class-side-inheritance.html deleted file mode 100644 index 11177c0..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/class-side-inheritance.html +++ /dev/null
@@ -1,26 +0,0 @@ -<!DOCTYPE html> -<script src="../../../resources/testharness.js"></script> -<script src="../../../resources/testharnessreport.js"></script> -<body> -<script> -test(function () { - "use strict"; - - class Foo extends HTMLDivElement { - static staticFunction () { return "static function called"; } - } - - var customFoo = document.registerElement("custom-foo", { - prototype: Foo.prototype, - }); - - assert_equals(Object.getPrototypeOf(customFoo), Foo, - 'generated constructor prototype should be base element constructor'); - - assert_equals(customFoo.staticFunction(), "static function called", - 'static function should be called using inherited element'); - - assert_equals(Object.getPrototypeOf(customFoo).__proto__, HTMLDivElement, - 'prototype chain should have base constructor\'s prototype'); -}, 'should inherit from passed constructor'); -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/constructor-calls-created-synchronously-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/constructor-calls-created-synchronously-expected.txt deleted file mode 100644 index 4dfb32be..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/constructor-calls-created-synchronously-expected.txt +++ /dev/null
@@ -1,10 +0,0 @@ -CONSOLE WARNING: line 12: document.registerElement is deprecated and will be removed in M80, around February 2020. Please use window.customElements.define instead. See https://www.chromestatus.com/features/4642138092470272 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -Tests that custom element constructors run the createdCallback synchronously. - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - -PASS ncallbacks is 1 -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/constructor-calls-created-synchronously.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/constructor-calls-created-synchronously.html deleted file mode 100644 index 69a643d..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/constructor-calls-created-synchronously.html +++ /dev/null
@@ -1,17 +0,0 @@ -<!DOCTYPE html> -<script src="../../../resources/js-test.js"></script> -<div id="container"></div> -<script> -description('Tests that custom element constructors run the createdCallback synchronously.'); - -var proto = Object.create(HTMLElement.prototype); -var ncallbacks = 0; -proto.createdCallback = function () { - ncallbacks++; -}; -var A = document.registerElement('x-a', {prototype: proto}); -var x = new A(); -shouldBe('ncallbacks', '1'); - -successfullyParsed = true; -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/crash-in-getTypeExtension.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/crash-in-getTypeExtension.html deleted file mode 100644 index a1426453..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/crash-in-getTypeExtension.html +++ /dev/null
@@ -1,12 +0,0 @@ -<!DOCTYPE html> -<script src="../../../resources/testharness.js"></script> -<script src="../../../resources/testharnessreport.js"></script> -<script> -test(() => { - // TODO(a.obzhirov): Use customElements.define when customized built-in elements are supported. - document.registerElement('x-foo', { prototype: Object.create(HTMLDivElement.prototype) }); - var toStringCalled = false; - document.createElement('div', { toString: () => { toStringCalled = true; return 'x-foo'; } }) - assert_false(toStringCalled, 'toString should not have been called.'); -}, 'Test for crbug/666610: Crash in blink::getTypeExtension'); -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/crash-without-dom-wrapper.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/crash-without-dom-wrapper.html deleted file mode 100644 index b5e7e44..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/crash-without-dom-wrapper.html +++ /dev/null
@@ -1,28 +0,0 @@ -<script src="../../../resources/testharness.js"></script> -<script src="../../../resources/testharnessreport.js"></script> -<script>setTimeout("document.querySelector('iframe').remove()", 20);</script> -<script src="test-harness-utils.js"></script> -<body> -<script> -(function () { - var test = async_test('crash expected without crbug/446076 fix'); - withFrame(function (frame) { - var doc = frame.contentDocument; - var step = test.step_func(function(event) { - doc.body.firstChild.remove(); - window.removeEventListener('message', step); - frame.remove(); - test.done(); - }); - window.addEventListener('message', step); - - var script = doc.createElement('script'); - script.textContent = - 'var proto = Object.create(HTMLElement.prototype); ' + - 'document.registerElement("x-a", {prototype: proto}); ' + - 'document.body.innerHTML = "<x-a>"; ' + - 'window.parent.postMessage({step: "remove"}, "*");'; - doc.body.appendChild(script); - }); -})(); -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/created-callback.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/created-callback.html deleted file mode 100644 index 2819227..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/created-callback.html +++ /dev/null
@@ -1,144 +0,0 @@ -<!DOCTYPE html> -<script src="../../../resources/testharness.js"></script> -<script src="../../../resources/testharnessreport.js"></script> -<script src="test-harness-utils.js"></script> -<body> -<script> -test(function() { - var createdInvocations = 0; - function created() { - createdInvocations++; - } - - var getterInvocations = 0; - function getter() { - getterInvocations++; - return created; - } - - function failer() { - assert_unreached('the created callback must not be retrieved after registration'); - } - - var proto = Object.create(HTMLElement.prototype, { - createdCallback: { - get: getter - } - }); - var ctor = document.registerElement('x-a', {prototype: proto}); - assert_equals(getterInvocations, 1, 'the created callback must have been retrieved'); - - proto.createdCallback = failer; - var element = new ctor(); - assert_equals(createdInvocations, 1, 'the created callback retrieved at registration must be invoked'); -}, 'transfer created callback'); - -(function() { - -t = async_test('__proto__, :unresolved and created callback timing'); -t.step(function() { - var createdInvocations = 0; - function created() { - createdInvocations++; - - if (this.id != 'u') - return; - - t.step(function() { - var t = div.querySelector('#t'); - var v = div.querySelector('#v'); - var w = div.querySelector('#w'); - - assert_equals(div.querySelector('x-b:not(:unresolved)'), this, 'the :unresolved pseudoclass should cease to apply when the created callback is invoked'); - assert_array_equals(div.querySelectorAll(':unresolved'), [v, w], 'the :unresolved pseudoclass should be processed in order'); - - assert_true(t instanceof C, 'prototype upgrade should happen in order (#t)'); - assert_false(v instanceof C, 'prototype upgrade should happen in order (#v)'); - }, this); - } - - var protoB = Object.create(HTMLElement.prototype); - var B = document.registerElement('x-b', {prototype: protoB}); - - var protoC = Object.create(HTMLElement.prototype); - protoC.createdCallback = created; - var C = document.registerElement('x-c', {prototype: protoC}); - - var div = document.createElement('div'); - div.innerHTML = '<x-c id="t"></x-c>' + - '<x-b id="u"></x-b>' + - '<x-c id="v"></x-c>' + - '<x-b id="w"></x-b>'; - assert_equals(createdInvocations, 2, 'the created callback should have been invoked once for each x-c element'); - assert_true(div.querySelector('#w') instanceof B, '#w\'s prototype should have ultimately been upgraded'); - t.done(); -}); - -})(); - -(function() { - -t = async_test('other callbacks for a given element are queued during the ' + - 'created callback and dispatched when the created callback ' + - 'completes'); -withFrame(t.step_func(function(frame) { - var messages = []; - function log(msg) { - messages.push(msg); - } - - var proto = Object.create(frame.contentWindow.HTMLElement.prototype); - proto.createdCallback = function() { - log('created started'); - this.remove(); - this.setAttribute('prey', 'gargoyles'); - log('created finished'); - }; - proto.attachedCallback = function() { log('entered'); }; - proto.detachedCallback = function() { log('left'); }; - proto.attributeChangedCallback = function() { log('attribute changed'); }; - var D = frame.contentDocument.registerElement('x-d', {prototype: proto}); - - frame.contentDocument.body.innerHTML = '<x-d></x-d>'; - log('done'); - - assert_array_equals( - messages, - ['created started', 'created finished', 'entered', 'left', - 'attribute changed', 'done'], - 'callbacks should not be dispatched until the created callback has ' + - 'finished'); - t.done(); -})); - -})(); - -(function() { - -t = async_test('callback is called even if the element is moved to foreign document'); -var callbackInvoked = false; - -withFrame(t.step_func(function(originalFrame) { - withFrame(function(destinationFrame) { - var protoA = Object.create(originalFrame.contentWindow.HTMLElement.prototype); - protoA.createdCallback = function() { - var toBeMoved = originalFrame.contentDocument.getElementById('toBeMoved'); - destinationFrame.contentDocument.body.appendChild(toBeMoved); - }; - - var protoB = Object.create(originalFrame.contentWindow.HTMLElement.prototype); - protoB.createdCallback = function() { - callbackInvoked = true; - }; - - originalFrame.contentDocument.registerElement('x-a', {prototype: protoA}); - originalFrame.contentDocument.registerElement('x-b', {prototype: protoB}); - originalFrame.contentDocument.body.innerHTML = '<x-a></x-a><x-b id="toBeMoved"></x-b>'; - assert_true(callbackInvoked); - - t.done(); - }); -})); - -})(); -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/custom-element-name-sensivity.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/custom-element-name-sensivity.html deleted file mode 100644 index 93a9103..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/custom-element-name-sensivity.html +++ /dev/null
@@ -1,17 +0,0 @@ -<!DOCTYPE html> -<script src="../../../resources/testharness.js"></script> -<script src="../../../resources/testharnessreport.js"></script> -<script> -test(function () { - var A = document.registerElement('mixed-CASE-custom-TAG'); - assert_true(document.createElement('MIXED-case-CUSTOM-tag') instanceof A); - assert_true( - document.createElement('MIXED-case-CUSTOM-tag', null) instanceof A); -}, 'createElement is case insensitive for custom tags'); - -test(function () { - var B = document.registerElement('mixed-CASE-type-EXTENSION', {extends: 'span'}); - assert_true(document.createElement('span', 'MIXED-case-TYPE-extension') - instanceof B); -}, 'createElement is case insensitive for type extensions'); -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/custom-elements-registry.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/custom-elements-registry.html deleted file mode 100644 index b2d37231..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/custom-elements-registry.html +++ /dev/null
@@ -1,20 +0,0 @@ -<!DOCTYPE html> -<script src="../../../resources/testharness.js"></script> -<script src="../../../resources/testharnessreport.js"></script> -<script> -test(function () { - assert_true('customElements' in window, '"customElements" exists in window'); - assert_true('define' in window.customElements, '"define" exists in window.customElements'); -}, 'window.customElements.define is defined'); - -test(function () { - assert_throws_js(TypeError, function () { window.customElements.define(); }, - '"define" without arguments should throw TypeError'); - assert_throws_js(TypeError, function () { window.customElements.define("x-x"); }, - '"define" with one argument should throw TypeError'); - - window.customElements.define('x-empty-function', function () { }); - window.customElements.define('x-empty-class', class { }); - -}, 'window.customElements.define requires two arguments'); -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/default-prototype.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/default-prototype.html deleted file mode 100644 index 12a4d8d..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/default-prototype.html +++ /dev/null
@@ -1,21 +0,0 @@ -<!DOCTYPE html> -<script src="../../../resources/testharness.js"></script> -<script src="../../../resources/testharnessreport.js"></script> -<body> -<script> -test(function () { - var A = document.registerElement('x-a'); - assert_equals(A.prototype.constructor, A, - 'the default prototype\'s constructor should be the ' + - 'generated constructor'); - - assert_true(A.prototype instanceof HTMLElement, - 'the default prototype should be HTMLElement'); - - function m() { } - A.prototype.myMethod = m; - var x = new A(); - assert_equals(x.myMethod, m, - 'the element should get methods from the default prototype'); -}, 'a default prototype object should be provided if one is not specified'); -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/define-with-default-style.css b/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/define-with-default-style.css deleted file mode 100644 index b057770..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/define-with-default-style.css +++ /dev/null
@@ -1 +0,0 @@ -* { color: red; }
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/define-with-default-style.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/define-with-default-style.html deleted file mode 100644 index e50762c..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/define-with-default-style.html +++ /dev/null
@@ -1,415 +0,0 @@ -<!DOCTYPE html> -<script src = '../../../resources/testharness.js'></script> -<script src = '../../../resources/testharnessreport.js'></script> -<section id ="testSection"> - <test-element id="testElement">test</test-element> -</section> -<div id="stylesDiv"> -</div> - -<style id="universal"> - *, div { - color: red; - background-color: green; - } -</style> - -<style id="classIdTag"> - .test, #testId { - color: red; - background-color: red !important; - } -</style> - -<style id="compoundClass"> - .test1.test2, test-element-compound.test3 { - color: red; background-color: green; - } -</style> - -<style id="complex"> - * > .testA, * .testB, * ~ .testC { - color: red; - } -</style> - -<style id="cascade"> - * { - color: red; - background-color: red !important; - } -</style> - -<style id="stylesColor"> - test-multiple { - color: green; - } -</style> - -<style id="stylesBackground"> - test-multiple { - background-color: green; - } -</style> - -<style id="stylesBothGreen"> - * { - color: green; - background-color: green; - } -</style> - -<style id="stylesMultiSpec"> - multi-spec { - color: red; - } -</style> - -<script> -`use strict`; -const universalStyleSheet = universal.sheet; -const classIdTagStyleSheet = classIdTag.sheet; -const compoundClassStyleSheet = compoundClass.sheet; -const complexStyleSheet = complex.sheet; -const cascadeStyleSheet = cascade.sheet; -const stylesColorSheet = stylesColor.sheet; -const stylesBackgroundSheet = stylesBackground.sheet; -const stylesBothGreenSheet = stylesBothGreen.sheet; -const stylesMultiSpecSheet = stylesMultiSpec.sheet; - -// If these style elements aren't removed, they will be collected into global rule set automatically. -// To test that default style is added to global rule set properly, these style elements need to be removed here. -universal.remove(); -classIdTag.remove(); -compoundClass.remove(); -complex.remove(); -cascade.remove(); -stylesBothGreen.remove(); - -const redValue = "rgb(255, 0, 0)"; -const greenValue = "rgb(0, 128, 0)"; -const colorNotStyledValue = "rgb(0, 0, 0)"; -const backgroundColorNotStyledValue = "rgba(0, 0, 0, 0)"; - -test (() => { - window.customElements.define("test-element", class extends HTMLElement { - constructor() { - super(); - } - }, { styles: [universalStyleSheet] }); - assert_equals(getComputedStyle(testElement).color, redValue, "Color should follow default style"); - assert_equals(getComputedStyle(testElement).backgroundColor, greenValue, "Background color should follow default style"); - let testDiv = document.createElement("div"); - testElement.appendChild(testDiv); - assert_equals(getComputedStyle(testDiv).color, redValue, "Color should inherit default style"); - assert_equals(getComputedStyle(testDiv).backgroundColor, backgroundColorNotStyledValue, "Background color should not inherit default style"); -}, "Upgraded custom element has style from definition"); - -test (() => { - window.customElements.define("test-element-createlement", class extends HTMLElement { - constructor() { - super(); - } - }, { styles: [universalStyleSheet] }); - const el = document.createElement("test-element-createlement"); - testSection.appendChild(el); - assert_equals(getComputedStyle(el).color, redValue, "Color should follow default style"); - assert_equals(getComputedStyle(el).backgroundColor, greenValue, "Background color should follow default style"); - let testDiv = document.createElement("div"); - el.appendChild(testDiv); - assert_equals(getComputedStyle(testDiv).color, redValue, "Color should inherit default style"); - assert_equals(getComputedStyle(testDiv).backgroundColor, backgroundColorNotStyledValue, "Background color should not inherit default style"); -}, "Custom Element created with createElement has style from definition"); - -test (() => { - window.customElements.define("test-element-invalidation", class extends HTMLElement { - constructor() { - super(); - } - }, { styles: [classIdTagStyleSheet] }); - const el = document.createElement("test-element-invalidation"); - testSection.appendChild(el); - assert_equals(getComputedStyle(el).color, colorNotStyledValue, "Color should not follow default style before class added"); - el.classList.add("test"); - assert_equals(getComputedStyle(el).color, redValue , "Color should follow default style after class added"); - el.classList.remove("test"); - assert_equals(getComputedStyle(el).color, colorNotStyledValue, "Color should not follow default style after class removed"); - el.setAttribute("id", "testId"); - assert_equals(getComputedStyle(el).color, redValue , "Color should follow default style after ID added"); - el.removeAttribute("id"); - assert_equals(getComputedStyle(el).color, colorNotStyledValue, "Color should not follow default style after id removed"); -}, "Style invalidation should work"); - -test (() => { - window.customElements.define("test-element-author", class extends HTMLElement { - constructor() { - super(); - } - }, { styles: [classIdTagStyleSheet] }); - const el = document.createElement("test-element-author"); - testSection.appendChild(el); - el.classList.add("test"); - assert_equals(getComputedStyle(el).color, redValue , "Color should follow default style after class added"); - assert_equals(getComputedStyle(el).backgroundColor, redValue, "Background color should follow default style after class added"); - let styleEl = document.createElement("style"); - styleEl.innerHTML = ".test { color: green; background-color: green !important; }"; - testSection.appendChild(styleEl); - assert_equals(getComputedStyle(el).color, greenValue , "Default style should lose to normal author style"); - assert_equals(getComputedStyle(el).backgroundColor, redValue, "!important declaration in default style should win over !important declaration in author style"); - // Remove the style element after each test. Otherwise it styles elements unexpectedly later on. - testSection.removeChild(styleEl); -}, "Normal default style should lose to normal author style, !important declaration in default style should win over important declaration in author style"); - -test (() => { - window.customElements.define("test-element-important", class extends HTMLElement { - constructor() { - super(); - } - }, { styles: [classIdTagStyleSheet] }); - const el = document.createElement("test-element-important"); - testSection.appendChild(el); - el.classList.add("test"); - assert_equals(getComputedStyle(el).color, redValue , "Color should follow default style after class added"); - assert_equals(getComputedStyle(el).backgroundColor, redValue, "Background color should follow default style after class added"); - let styleImportant = document.createElement("style"); - styleImportant.innerHTML = ".test { color: green !important; background-color: green; }"; - testSection.appendChild(styleImportant); - assert_equals(getComputedStyle(el).color, greenValue , "Default style is an author style, normal declaration should lose to !important declaration in author style"); - assert_equals(getComputedStyle(el).backgroundColor, redValue, "!important declaration in default style should win over normal author style"); - testSection.removeChild(styleImportant); -}, "Default style should be treated as an author style"); - -test (() => { - window.customElements.define("test-element-order", class extends HTMLElement { - constructor() { - super(); - } - }, { styles: [cascadeStyleSheet] }); - const el = document.createElement("test-element-order"); - testSection.appendChild(el); - assert_equals(getComputedStyle(el).color, redValue, "Color should follow default style"); - assert_equals(getComputedStyle(el).backgroundColor, redValue, "Background color should follow default style"); - let shadowRoot = el.attachShadow({mode:"open"}) - let styleShadow = document.createElement("style"); - shadowRoot.appendChild(styleShadow); - styleShadow.innerHTML = ":host { color: green; background-color: green !important; }"; - assert_equals(getComputedStyle(el).color, greenValue , "Normal default style should lose to normal styles in shadow tree under the custom element"); - assert_equals(getComputedStyle(el).backgroundColor, greenValue, "!important declaration in default style should lose to !important declaration in styles in shadow tree under the custom element"); -}, "Default style in custom element with a shadow root should act like the first style in the shadow tree and have the same cascading order as styles in the shadow tree"); - -test (() => { - window.customElements.define("test-element-compound", class extends HTMLElement { - constructor() { - super(); - } - }, { styles: [compoundClassStyleSheet] }); - const el = document.createElement("test-element-compound"); - testSection.appendChild(el); - assert_equals(getComputedStyle(el).color, colorNotStyledValue, "Custom element should not be styled"); - assert_equals(getComputedStyle(el).backgroundColor, backgroundColorNotStyledValue, "Custom element should not be styled"); - el.classList.add("test1"); - el.classList.add("test2"); - assert_equals(getComputedStyle(el).color, redValue, "Custom element matching compound selector should follow default style"); - assert_equals(getComputedStyle(el).backgroundColor, greenValue, "Custom element matching compound selector should follow default style"); - el.classList.remove("test2"); - el.classList.add("test3"); - assert_equals(getComputedStyle(el).color, redValue, "Custom element matching compound selector with tagname equal to custom element name should follow default style"); - assert_equals(getComputedStyle(el).backgroundColor, greenValue, "Custom element matching compound selector with tagname equal to custom element should follow default style"); - el.classList.remove("test1"); - el.classList.remove("test3"); - let testDiv = document.createElement("div"); - el.appendChild(testDiv); - testDiv.classList.add("test1"); - assert_equals(getComputedStyle(testDiv).color, colorNotStyledValue, "Child element not matching compound selector should not be styled"); - assert_equals(getComputedStyle(testDiv).backgroundColor, backgroundColorNotStyledValue, "Child element not matching compound selector should not be styled"); - testDiv.classList.add("test2"); - assert_equals(getComputedStyle(testDiv).color, colorNotStyledValue, "Child element matching compound selector should not be styled"); - assert_equals(getComputedStyle(testDiv).backgroundColor, backgroundColorNotStyledValue, "Child element matching compound selector should not be styled"); -}, "Compound selectors should work"); - -test (() => { - window.customElements.define("test-element-complex", class extends HTMLElement { - constructor() { - super(); - } - }, { styles: [complexStyleSheet] }); - const el = document.createElement("test-element-complex"); - testSection.appendChild(el); - assert_equals(getComputedStyle(el).color, colorNotStyledValue, "Custom element should not be styled"); - assert_equals(getComputedStyle(el).backgroundColor, backgroundColorNotStyledValue, "Custom element should not be styled"); - let testDiv = document.createElement("div"); - el.appendChild(testDiv); - testDiv.classList.add("testA"); - assert_equals(getComputedStyle(testDiv).color, colorNotStyledValue, "Child element matching complex selector should not be styled"); - assert_equals(getComputedStyle(testDiv).backgroundColor, backgroundColorNotStyledValue, "Child element matching complex selector should not be styled"); - testDiv.classList.add("testB"); - assert_equals(getComputedStyle(testDiv).color, colorNotStyledValue, "Child element matching complex selector should not be styled"); - assert_equals(getComputedStyle(testDiv).backgroundColor, backgroundColorNotStyledValue, "Child element matching complex selector should not be styled"); - let testSpan = document.createElement("span"); - testSection.appendChild(testSpan); - assert_equals(getComputedStyle(testSpan).color, colorNotStyledValue, "Sibling element matching complex selector should not be styled"); - assert_equals(getComputedStyle(testSpan).backgroundColor, backgroundColorNotStyledValue, "Sibling element matching complex selector should not be styled"); -}, "Complex selectors should be ignored"); - -test (() => { - window.customElements.define("test-element-shadow", class extends HTMLElement { - constructor() { - super(); - } - }, { styles: [universalStyleSheet] }); - const el = document.createElement("test-element-shadow"); - testSection.appendChild(el); - assert_equals(getComputedStyle(el).color, redValue, "Color of the custom element should follow defaultStyle"); - assert_equals(getComputedStyle(el).backgroundColor, greenValue, "Background color of the custom element should follow default style"); - let childDiv = document.createElement("div"); - el.appendChild(childDiv); - assert_equals(getComputedStyle(childDiv).color, redValue, "Color of the child element should inherit defaultStyle"); - assert_equals(getComputedStyle(childDiv).backgroundColor, backgroundColorNotStyledValue, "Background color of the child element should not inherit default style"); - let shadowRoot = el.attachShadow({mode:'open'}) - let shadowDiv = document.createElement("div"); - shadowRoot.appendChild(shadowDiv); - assert_equals(getComputedStyle(shadowDiv).color, redValue, "Color of elements in shadow tree should inherit defaultStyle"); - assert_equals(getComputedStyle(shadowDiv).backgroundColor, backgroundColorNotStyledValue, "Background Color of elements in shadow tree should not inherit defaultStyle"); - assert_equals(getComputedStyle(childDiv).color, colorNotStyledValue, "Color of the child element should not inherit defaultStyle"); - assert_equals(getComputedStyle(childDiv).backgroundColor, backgroundColorNotStyledValue, "Background color of the child element should not inherit default style"); -}, "Default style should not style shadow tree under a custom element"); - -test(() => { - customElements.define("test-multiple", class extends HTMLElement { - constructor() { - super(); - } - }, { styles: [stylesColorSheet, stylesBackgroundSheet]} ); - const el = document.createElement("test-multiple"); - testSection.appendChild(el); - assert_equals(getComputedStyle(el).color, greenValue, "Color of the custom element should follow defaultStyle"); - assert_equals(getComputedStyle(el).backgroundColor, greenValue, "Background color of the custom element should follow default style"); - stylesBackgroundSheet.deleteRule(0); - assert_equals(getComputedStyle(el).color, greenValue, "Color of the custom element should still follow defaultStyle"); - assert_equals(getComputedStyle(el).backgroundColor, backgroundColorNotStyledValue, "Background color of the custom element should follow update of default style"); - stylesBackgroundSheet.insertRule("test-multiple { color: red; }"); - assert_equals(getComputedStyle(el).color, redValue, "Order of stylesheet is preserved, same specifity rule means following the last one."); -}, "Multiple default style should work." ); - -test(() => { - customElements.define("same-spec", class extends HTMLElement { - constructor() { - super(); - } - }, { styles: [stylesBothGreenSheet, universalStyleSheet]}); - const el = document.createElement("same-spec"); - testSection.appendChild(el); - assert_equals(getComputedStyle(el).color, redValue, "Color of the custom element should follow last rule when specificity is the same"); - customElements.define("multi-spec", class extends HTMLElement { - constructor() { - super(); - } - }, { styles: [stylesBothGreenSheet, stylesMultiSpecSheet]}); - const anotherEl = document.createElement("multi-spec"); - testSection.appendChild(anotherEl); - assert_equals(getComputedStyle(anotherEl).color, redValue, "Color of the custom element should follow rule with higher specificity."); -}, "Multiple stylesheets specificity."); - -</script> - -<section id="secondTestSection"> - <test-element id="secondTest">test</test-element> - <div id="divForStyle"></div> - <div id ="divForShadowElement"></div> -</section> - -<script> -`use strict`; - -// In order to have an instance of non-constructed stylesheet with non-null OwnerNode, -// we need to create a style element and keep it part of the DOM tree. -// This style has to be under a shadow tree so that the style from this style element will -// not be applied to elements outside. -const shadowRootNonConstructed = divForStyle.attachShadow({mode:'open'}); -nonConstructedStyle = document.createElement("style"); -shadowRootNonConstructed.appendChild(nonConstructedStyle); -nonConstructedStyle.sheet.insertRule("* { color: red; }", 0); -const nonConstructedStyleSheet = nonConstructedStyle.sheet; -const shadowRoot = divForShadowElement.attachShadow({mode:'open'}); - -test (() => { - let testElementLast = document.getElementById("secondTest"); - assert_equals(getComputedStyle(testElementLast).color, redValue, "Color should follow default style"); - assert_equals(getComputedStyle(testElementLast).backgroundColor, greenValue, "Background color should follow default style"); -}, "Custom element constructed from HTML parser should work"); - -test (() => { - window.customElements.define("el-nc", class SomeClass extends HTMLElement { - constructor() { - super(); - } - }, { styles: [nonConstructedStyleSheet] }); - const el = document.createElement("el-nc"); - secondTestSection.appendChild(el); - let shadowEl = document.createElement("el-nc"); - shadowRoot.appendChild(shadowEl); - assert_equals(getComputedStyle(el).color, redValue, "Color should follow defaultStyle"); - assert_equals(getComputedStyle(shadowEl).color, redValue, "Color of custom element under shadow tree should follow defaultStyle"); - - nonConstructedStyleSheet.deleteRule(0); - assert_equals(getComputedStyle(el).color, colorNotStyledValue, "Rule deletion in non-constructed stylesheet should be reflected"); - assert_equals(getComputedStyle(shadowEl).color, colorNotStyledValue, "Rule deletion in non-constructed stylesheet should be reflected in custom elements under shadow tree"); - - nonConstructedStyleSheet.insertRule("* { color: green; }"); - assert_equals(getComputedStyle(el).color, greenValue, "Rule addition in non-constructed stylesheet should be reflected"); - assert_equals(getComputedStyle(shadowEl).color, greenValue, "Rule addition in non-constructed stylesheet should be reflected in custom elements under shadow tree"); -}, "CSSOM changes to non-constructed stylesheet should affect default style"); - -test (() => { - const constructedStyleSheet = new CSSStyleSheet(); - const redStyleText = "* { color: red; }"; - constructedStyleSheet.insertRule(redStyleText); - window.customElements.define("element-constructed", class extends HTMLElement { - constructor() { - super(); - } - }, { styles: [constructedStyleSheet] }); - const el = document.createElement("element-constructed"); - secondTestSection.appendChild(el); - let shadowEl = document.createElement("element-constructed"); - shadowRoot.appendChild(shadowEl); - assert_equals(getComputedStyle(el).color, redValue, "Color should follow defaultStyle"); - assert_equals(getComputedStyle(shadowEl).color, redValue, "Color of custom elements under shadow tree should follow defaultStyle"); - constructedStyleSheet.deleteRule(0); - assert_equals(getComputedStyle(el).color, colorNotStyledValue, "Rule deletion in constructed stylesheet should be reflected"); - assert_equals(getComputedStyle(shadowEl).color, colorNotStyledValue, "Rule deletion in constructed stylesheet should be reflected in custom elements under shadow tree") - constructedStyleSheet.insertRule("* { color: green; }"); - assert_equals(getComputedStyle(el).color, greenValue, "Rule addition in constructed stylesheet should be reflected"); - assert_equals(getComputedStyle(shadowEl).color, greenValue, "Rule addition in constructed stylesheet should be reflected in custom elements under shadow tree"); -}, "CSSOM changes to constructed stylesheet should affect default style"); - -</script> - -<section id="thirdTestSection"> -</section> - -<script> -const linkSR = thirdTestSection.attachShadow({ mode: "open" }); -linkSR.innerHTML = '<link rel="stylesheet" type="text/css" href="define-with-default-style.css" id="linkedStyle">'; -const linkStyle = linkSR.querySelector("#linkedStyle"); - -async_test(t => { - linkStyle.addEventListener("load", t.step_func_done(() => { - const linkedStyleSheet = linkStyle.sheet; - window.customElements.define("element-link", class extends HTMLElement { - constructor() { - super(); - } - }, { styles: [linkedStyleSheet] }); - - const el = document.createElement("element-link"); - thirdTestSection.appendChild(el); - assert_equals(getComputedStyle(el).color, redValue, "Color should follow defaultStyle"); - linkedStyleSheet.deleteRule(0); - assert_equals(getComputedStyle(el).color, colorNotStyledValue, "Rule deletion in non-constructed stylesheet after the style being removed will be reflected in custom elements under shadow tree"); - linkedStyleSheet.insertRule("* { color: green; }"); - assert_equals(getComputedStyle(el).color, greenValue, "Rule addition in non-constructed stylesheet after the style being removed will be reflected in custom elements under shadow tree"); - })); -}, "CSSOM changes to non-constructed stylesheet from link element affect default style after link element is removed"); - -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/document-register-basic-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/document-register-basic-expected.txt deleted file mode 100644 index d679172..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/document-register-basic-expected.txt +++ /dev/null
@@ -1,40 +0,0 @@ -CONSOLE WARNING: line 21: document.registerElement is deprecated and will be removed in M80, around February 2020. Please use window.customElements.define instead. See https://www.chromestatus.com/features/4642138092470272 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -Testing document.registerElement() basic behaviors. - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - -PASS typeof fooConstructor is "function" -PASS fooConstructor.prototype.__proto__ is HTMLElement.prototype -PASS fooConstructor.prototype.thisIsPrototype is true -PASS document.registerElement("x-bad-a", HTMLElement) threw exception NotSupportedError: Failed to execute 'registerElement' on 'Document': Registration failed for type 'x-bad-a'. The prototype is already in-use as an interface prototype object.. -PASS document.registerElement("x-bad-b", fooConstructor) threw exception NotSupportedError: Failed to execute 'registerElement' on 'Document': Registration failed for type 'x-bad-b'. The prototype is already in-use as an interface prototype object.. -PASS document.registerElement("x-bad-c", { prototype: proto }) threw exception NotSupportedError: Failed to execute 'registerElement' on 'Document': Registration failed for type 'x-bad-c'. Prototype constructor property is not configurable.. -PASS fooConstructor() threw exception TypeError: DOM object constructor cannot be called as a function.. -PASS createdFoo.__proto__ is fooConstructor.prototype -PASS createdFoo.constructor is fooConstructor -PASS createdFoo.tagName is "X-FOO" -PASS createdFoo.textContent is "Hello" -PASS createdFoo.lastChild is childDiv -PASS parsedFoo.__proto__ is fooConstructor.prototype -PASS parsedFoo.tagName is "X-FOO" -PASS parsedFoo.someProperty is container.firstChild.someProperty -PASS barConstructor !== fooConstructor is true -PASS createdBar.tagName is "X-BAR" -PASS createdBaz.tagName is "X-BAZ" -PASS createdBaz.thisIsPrototype is true -PASS createdBaz.thisIsAlsoPrototype is true -PASS createdUpperBar.constructor is barConstructor -PASS createdUpperBar.tagName is "X-BAR" -PASS createdMixedBar.constructor is barConstructor -PASS createdMixedBar.tagName is "X-BAR" -PASS container.firstChild.constructor is barConstructor -PASS container.firstChild.tagName is "X-BAR" -PASS container.lastChild.constructor is barConstructor -PASS container.lastChild.tagName is "X-BAR" -PASS (new fooConstructor).tagName is "X-FOO" -PASS (new barConstructor).tagName is "X-BAR" -PASS (new bazConstructor).tagName is "X-BAZ" -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/document-register-basic.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/document-register-basic.html deleted file mode 100644 index a79832f..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/document-register-basic.html +++ /dev/null
@@ -1,103 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script src="../../../resources/js-test.js"></script> -</head> -<body> -<div id="container"></div> -<script> -description('Testing document.registerElement() basic behaviors.'); - -if (window.testRunner) - testRunner.dumpAsText(); - -function createRegisterParameters() -{ - return { - prototype: Object.create(HTMLElement.prototype, { thisIsPrototype: { value: true } }) - }; -} - -var fooConstructor = document.registerElement('x-foo', createRegisterParameters()); -shouldBe('typeof fooConstructor', '"function"'); -shouldBe('fooConstructor.prototype.__proto__', 'HTMLElement.prototype'); -shouldBeTrue('fooConstructor.prototype.thisIsPrototype'); - -// Bad prototype: prototype is already a built-in interface prototype object -shouldThrow('document.registerElement("x-bad-a", HTMLElement)', '"NotSupportedError: Failed to execute \'registerElement\' on \'Document\': Registration failed for type \'x-bad-a\'. The prototype is already in-use as an interface prototype object."'); -// Bad prototype: prototype is already a Custom Element interface prototype object -shouldThrow('document.registerElement("x-bad-b", fooConstructor)', '"NotSupportedError: Failed to execute \'registerElement\' on \'Document\': Registration failed for type \'x-bad-b\'. The prototype is already in-use as an interface prototype object."'); -// Bad prototype: 'constructor' is not configurable -var proto = Object.create(HTMLElement.prototype, { - constructor: {configurable: false, writable: true} -}); -shouldThrow('document.registerElement("x-bad-c", { prototype: proto })', '"NotSupportedError: Failed to execute \'registerElement\' on \'Document\': Registration failed for type \'x-bad-c\'. Prototype constructor property is not configurable."'); -// Call as function -shouldThrow('fooConstructor()', '"TypeError: DOM object constructor cannot be called as a function."') - -// Constructor initiated instantiation -var createdFoo = new fooConstructor(); - -// JS built-in properties -shouldBe('createdFoo.__proto__', 'fooConstructor.prototype'); -shouldBe('createdFoo.constructor', 'fooConstructor'); - -// Native getter -shouldBe('createdFoo.tagName', '"X-FOO"'); - -// Native setter -createdFoo.innerHTML = 'Hello'; -shouldBe('createdFoo.textContent', '"Hello"'); - -// Native method -var childDiv = document.createElement('div'); -createdFoo.appendChild(childDiv); -shouldBe('createdFoo.lastChild', 'childDiv'); - -// Parser initiated instantiation -var container = document.getElementById('container'); -container.innerHTML = '<x-foo></x-foo>'; -parsedFoo = container.firstChild; - -shouldBe('parsedFoo.__proto__', 'fooConstructor.prototype'); -shouldBe('parsedFoo.tagName', '"X-FOO"'); - -// Ensuring the wrapper is retained -parsedFoo.someProperty = 'hello'; -shouldBe('parsedFoo.someProperty', 'container.firstChild.someProperty'); - -// Having another constructor -var barConstructor = document.registerElement('x-bar', createRegisterParameters()); -shouldBeTrue('barConstructor !== fooConstructor'); -var createdBar = new barConstructor(); -shouldBe('createdBar.tagName', '"X-BAR"'); - -// Having a subclass -var bazConstructor = document.registerElement('x-baz', { prototype: Object.create(fooConstructor.prototype, { thisIsAlsoPrototype: { value: true } }) }); -var createdBaz = new bazConstructor(); -shouldBe('createdBaz.tagName', '"X-BAZ"'); -shouldBeTrue('createdBaz.thisIsPrototype'); -shouldBeTrue('createdBaz.thisIsAlsoPrototype'); - -// With irregular cases -var createdUpperBar = document.createElement('X-BAR'); -var createdMixedBar = document.createElement('X-Bar'); -shouldBe('createdUpperBar.constructor', 'barConstructor'); -shouldBe('createdUpperBar.tagName', '"X-BAR"'); -shouldBe('createdMixedBar.constructor', 'barConstructor'); -shouldBe('createdMixedBar.tagName', '"X-BAR"'); - -container.innerHTML = '<X-BAR></X-BAR><X-Bar></X-Bar>'; -shouldBe('container.firstChild.constructor', 'barConstructor'); -shouldBe('container.firstChild.tagName', '"X-BAR"'); -shouldBe('container.lastChild.constructor', 'barConstructor'); -shouldBe('container.lastChild.tagName', '"X-BAR"'); - -// Constructors shouldn't interfere with each other -shouldBe('(new fooConstructor).tagName', '"X-FOO"'); -shouldBe('(new barConstructor).tagName', '"X-BAR"'); -shouldBe('(new bazConstructor).tagName', '"X-BAZ"'); - -</script> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/document-register-constructor.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/document-register-constructor.html deleted file mode 100644 index 88b7f725..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/document-register-constructor.html +++ /dev/null
@@ -1,48 +0,0 @@ -<!DOCTYPE html> -<script src="../../../resources/testharness.js"></script> -<script src="../../../resources/testharnessreport.js"></script> -<body> -<script> -test(function () { - var proto = Object.create(HTMLElement.prototype); - var ctor = document.registerElement('x-a', {prototype: proto}); - assert_true(ctor instanceof Function, 'constructor must be a function'); - assert_equals(typeof ctor, 'function', 'constructor must be a function instance'); -}, 'constructor type'); - -test(function () { - var proto = Object.create(HTMLElement.prototype); - var ctor = document.registerElement('x-b', {prototype: proto}); - - // FIXME: These are not specified yet. Update these assertions - // when the name is specified. - assert_equals(ctor.name, 'x-b', 'the constructor\'s name should match the type'); -}, 'constructor name'); - -test(function () { - var proto = Object.create(HTMLElement.prototype); - var ctor = document.registerElement('x-c', {prototype: proto}); - assert_own_property(proto, 'constructor', 'document.register must configure the constructor property of the prototype'); - - assert_equals(proto.constructor, ctor, 'the value of the constructor property must be the constructor function'); - - var desc = Object.getOwnPropertyDescriptor(proto, 'constructor'); - assert_true(desc.writable, 'constructor property must be writable'); - assert_false(desc.enumerable, 'constructor property must be non-enumerable'); - assert_true(desc.configurable, 'constructor property must be configurable'); -}, 'prototype "constructor" property'); - -test(function () { - var proto = Object.create(HTMLElement.prototype); - var ctor = document.registerElement('x-d', {prototype: proto}); - assert_own_property(ctor, 'prototype', 'document.register must configure the prototype property of the constructor'); - - assert_equals(ctor.prototype, proto, 'the value of the prototype property must be the prototype object'); - - var desc = Object.getOwnPropertyDescriptor(ctor, 'prototype'); - assert_false(desc.writable, 'prototype property must not be writable'); - assert_false(desc.enumerable, 'prototype property must be non-enumerable'); - assert_false(desc.configurable, 'prototype property must not be configurable'); -}, 'constructor "prototype" property'); -</script> -
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/document-register-namespace-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/document-register-namespace-expected.txt deleted file mode 100644 index cd73467..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/document-register-namespace-expected.txt +++ /dev/null
@@ -1,34 +0,0 @@ -CONSOLE WARNING: line 24: document.registerElement is deprecated and will be removed in M80, around February 2020. Please use window.customElements.define instead. See https://www.chromestatus.com/features/4642138092470272 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -Using document.registerElement() for extending HTML and non-HTML elements. - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - -PASS html1.namespaceURI is "http://www.w3.org/1999/xhtml" -PASS html2.namespaceURI is "http://www.w3.org/1999/xhtml" -PASS html3.namespaceURI is "http://www.w3.org/1999/xhtml" -PASS html4.namespaceURI is "http://www.w3.org/1999/xhtml" -PASS notHTML.namespaceURI is "http://www.example.com/" -PASS notHTML instanceof CustomHTMLElement is false -PASS notHTML instanceof HTMLElement is false -PASS svg1.tagName is "g" -PASS svg1 instanceof SVGGElement is true -PASS svg1 instanceof CustomSVGElement is true -PASS svg1.namespaceURI is "http://www.w3.org/2000/svg" -PASS svg2.tagName is "svg-foo" -PASS svg2.namespaceURI is "http://www.w3.org/2000/svg" -PASS svg3.tagName is "svg-foo" -PASS svg3.namespaceURI is "http://www.w3.org/2000/svg" -PASS notSVG1.namespaceURI is "http://www.w3.org/1999/xhtml" -PASS notSVG1 instanceof CustomSVGElement is false -PASS notSVG1 instanceof HTMLUnknownElement is false -PASS notSVG1 instanceof HTMLElement is true -PASS Object.getPrototypeOf(notSVG1) is HTMLElement.prototype -PASS notSVG2.namespaceURI is "http://www.w3.org/1999/xhtml" -PASS notSVG2 instanceof CustomSVGElement is false -PASS notSVG2 instanceof HTMLUnknownElement is false -PASS notSVG2 instanceof HTMLElement is true -PASS Object.getPrototypeOf(notSVG2) is HTMLElement.prototype -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/document-register-namespace.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/document-register-namespace.html deleted file mode 100644 index 5ff5433..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/document-register-namespace.html +++ /dev/null
@@ -1,67 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script src="../../../resources/js-test.js"></script> -</head> -<body> -<script> -description('Using document.registerElement() for extending HTML and non-HTML elements.'); - -function createElementFromHTML(html) -{ - var container = document.createElement('div'); - container.innerHTML = html; - return container.firstChild; -} - -function createElementFromSVG(svg) -{ - var container = document.createElement('div'); - container.innerHTML = '<svg xmlns="http://www.w3.org/2000/svg">' + svg + '</svg>'; - return container.firstChild.firstChild; -} - -CustomHTMLElement = document.registerElement('html-foo', { prototype: Object.create(HTMLElement.prototype) }); -CustomSVGElement = document.registerElement('svg-foo', { prototype: Object.create(SVGGElement.prototype), extends: 'g' }); - -var html1 = new CustomHTMLElement(); -shouldBe('html1.namespaceURI', '"http://www.w3.org/1999/xhtml"'); -var html2 = document.createElement('html-foo'); -shouldBe('html2.namespaceURI', '"http://www.w3.org/1999/xhtml"'); -var html3 = document.createElementNS('http://www.w3.org/1999/xhtml', 'html-foo'); -shouldBe('html3.namespaceURI', '"http://www.w3.org/1999/xhtml"'); -var html4 = createElementFromHTML('<html-foo></html-foo>'); -shouldBe('html4.namespaceURI', '"http://www.w3.org/1999/xhtml"'); - -var notHTML = document.createElementNS('http://www.example.com/', 'html-foo'); -shouldBe('notHTML.namespaceURI', '"http://www.example.com/"'); -shouldBeFalse('notHTML instanceof CustomHTMLElement'); -shouldBeFalse('notHTML instanceof HTMLElement'); - -var svg1 = new CustomSVGElement(); -shouldBe('svg1.tagName', '"g"'); -shouldBeTrue('svg1 instanceof SVGGElement'); -shouldBeTrue('svg1 instanceof CustomSVGElement'); -shouldBe('svg1.namespaceURI', '"http://www.w3.org/2000/svg"'); -var svg2 = document.createElementNS('http://www.w3.org/2000/svg', 'svg-foo'); -shouldBe('svg2.tagName', '"svg-foo"'); -shouldBe('svg2.namespaceURI', '"http://www.w3.org/2000/svg"'); -var svg3 = createElementFromSVG('<svg-foo></svg-foo>'); -shouldBe('svg3.tagName', '"svg-foo"'); -shouldBe('svg3.namespaceURI', '"http://www.w3.org/2000/svg"'); - -var notSVG1 = document.createElement('svg-foo'); -shouldBe('notSVG1.namespaceURI', '"http://www.w3.org/1999/xhtml"'); -shouldBeFalse('notSVG1 instanceof CustomSVGElement'); -shouldBeFalse('notSVG1 instanceof HTMLUnknownElement'); -shouldBeTrue('notSVG1 instanceof HTMLElement'); -shouldBe('Object.getPrototypeOf(notSVG1)', 'HTMLElement.prototype'); -var notSVG2 = createElementFromHTML('<svg-foo></svg-foo>'); -shouldBe('notSVG2.namespaceURI', '"http://www.w3.org/1999/xhtml"'); -shouldBeFalse('notSVG2 instanceof CustomSVGElement'); -shouldBeFalse('notSVG2 instanceof HTMLUnknownElement'); -shouldBeTrue('notSVG2 instanceof HTMLElement'); -shouldBe('Object.getPrototypeOf(notSVG2)', 'HTMLElement.prototype'); -</script> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/document-register-on-create-callback.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/document-register-on-create-callback.html deleted file mode 100644 index c689984..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/document-register-on-create-callback.html +++ /dev/null
@@ -1,32 +0,0 @@ -<!DOCTYPE html> -<script src="../../../resources/testharness.js"></script> -<script src="../../../resources/testharnessreport.js"></script> -<script> -(function() { - -var test = async_test('document.registerElement() in a createdCallback should upgrade elements that are in the same processing queue.'); - -var createdElements = []; - -var protoA = Object.create(HTMLElement.prototype); -protoA.createdCallback = function() { - createdElements.push(this.id); - var protoB = Object.create(HTMLElement.prototype); - protoB.createdCallback = function () { - createdElements.push(this.id); - }; - - document.registerElement('x-b', {prototype: protoB}); - test.step(function() { - assert_array_equals(createdElements, ['elemA0', 'elemB0', 'elemB1']); - test.done(); - }); -}; - -document.registerElement('x-a', {prototype: protoA}); - -})(); -</script> -<x-b id='elemB0'></x-b> -<x-a id='elemA0'></x-a> -<x-b id='elemB1'></x-b>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/document-register-reentrant-null-constructor-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/document-register-reentrant-null-constructor-expected.txt deleted file mode 100644 index f8677f9..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/document-register-reentrant-null-constructor-expected.txt +++ /dev/null
@@ -1,9 +0,0 @@ -CONSOLE WARNING: line 32: document.registerElement is deprecated and will be removed in M80, around February 2020. Please use window.customElements.define instead. See https://www.chromestatus.com/features/4642138092470272 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -Fuzzing document.registerElement() through getters. PASS uless crash. - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/document-register-reentrant-null-constructor.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/document-register-reentrant-null-constructor.html deleted file mode 100644 index 8eea6e1..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/document-register-reentrant-null-constructor.html +++ /dev/null
@@ -1,22 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script src="../../../resources/js-test.js"></script> -<script src="./resources/document-register-fuzz.js"></script> -</head> -<body> -<div id="container"></div> -<script> -description("Fuzzing document.registerElement() through getters. PASS uless crash."); - -setupObjectHooks({ - prototypeGet: function() { }, - prototypeSet: function(value) { }, - constructorGet: function() { }, - constructorSet: function(value) { } -}); - -exerciseDocumentRegister(); -</script> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/document-register-reentrant-returning-fake-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/document-register-reentrant-returning-fake-expected.txt deleted file mode 100644 index ab2c8f9..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/document-register-reentrant-returning-fake-expected.txt +++ /dev/null
@@ -1,10 +0,0 @@ -CONSOLE WARNING: line 32: document.registerElement is deprecated and will be removed in M80, around February 2020. Please use window.customElements.define instead. See https://www.chromestatus.com/features/4642138092470272 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -Fuzzing document.registerElement() through getters. PASS uless crash. - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - -Constructor object isn't created. -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/document-register-reentrant-returning-fake.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/document-register-reentrant-returning-fake.html deleted file mode 100644 index 429b1fde..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/document-register-reentrant-returning-fake.html +++ /dev/null
@@ -1,25 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script src="../../../resources/js-test.js"></script> -<script src="./resources/document-register-fuzz.js"></script> -</head> -<body> -<div id="container"></div> -<script> -description("Fuzzing document.registerElement() through getters. PASS uless crash."); - -var badPrototype = Image.prototype; -var badConstructor = Image.prototype.constructor; - -setupObjectHooks({ - prototypeGet: function() { return badPrototype; }, - prototypeSet: function(value) { }, - constructorGet: function() { return badConstructor; }, - constructorSet: function(value) { } -}); - -exerciseDocumentRegister(); -</script> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/document-register-reentrant-throwing-constructor-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/document-register-reentrant-throwing-constructor-expected.txt deleted file mode 100644 index 2f947df..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/document-register-reentrant-throwing-constructor-expected.txt +++ /dev/null
@@ -1,10 +0,0 @@ -CONSOLE WARNING: line 32: document.registerElement is deprecated and will be removed in M80, around February 2020. Please use window.customElements.define instead. See https://www.chromestatus.com/features/4642138092470272 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -Fuzzing document.registerElement() through getters. PASS unless crash. - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - -Constructor object isn't created. -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/document-register-reentrant-throwing-constructor.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/document-register-reentrant-throwing-constructor.html deleted file mode 100644 index 0c34556..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/document-register-reentrant-throwing-constructor.html +++ /dev/null
@@ -1,22 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script src="../../../resources/js-test.js"></script> -<script src="./resources/document-register-fuzz.js"></script> -</head> -<body> -<div id="container"></div> -<script> -description("Fuzzing document.registerElement() through getters. PASS unless crash."); - -setupObjectHooks({ - prototypeGet: function() { throw "Error"; }, - prototypeSet: function(value) { throw "Error"; }, - constructorGet: function() { throw "Error"; }, - constructorSet: function(value) { throw "Error"; } -}); - -exerciseDocumentRegister(); -</script> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/document-register-svg-extends.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/document-register-svg-extends.html deleted file mode 100644 index 6e17b942..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/document-register-svg-extends.html +++ /dev/null
@@ -1,19 +0,0 @@ -<!DOCTYPE html> -<script src="../../../resources/testharness.js"></script> -<script src="../../../resources/testharnessreport.js"></script> -<body> -<script> -test(function () { - var proto = Object.create(SVGGElement.prototype); - - assert_throws_dom('NOT_SUPPORTED_ERR', function() { - document.registerElement('x-foo', {prototype: proto}); - }, 'register of an SVG element requires the extends parameter'); - - var XFoo = document.registerElement('x-foo', {prototype: proto, extends: 'g'}); - - var created = new XFoo(); - assert_true(created instanceof SVGGElement, 'created element should be an SVG element'); - -}, 'registration of SVG types'); -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/document-register-type-extensions-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/document-register-type-extensions-expected.txt deleted file mode 100644 index 1fa21d11..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/document-register-type-extensions-expected.txt +++ /dev/null
@@ -1,71 +0,0 @@ -CONSOLE WARNING: line 28: document.registerElement is deprecated and will be removed in M80, around February 2020. Please use window.customElements.define instead. See https://www.chromestatus.com/features/4642138092470272 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -Testing document.registerElement() type extension behaviours through createElement(). - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - -PASS document.registerElement("x-foo", { prototype: Object.create(HTMLDivElement.prototype) }) threw exception NotSupportedError: Failed to execute 'registerElement' on 'Document': Registration failed for type 'x-foo'. A type with that name is already registered.. -PASS fooNewed.outerHTML is "<x-foo></x-foo>" -PASS fooNewed instanceof fooConstructor && fooNewed instanceof HTMLElement is true -PASS fooNewed instanceof HTMLUnknownElement is false -PASS barNewed.outerHTML is "<input is=\"x-bar\">" -PASS barNewed instanceof barConstructor && barNewed instanceof HTMLInputElement is true -PASS isFormControl(barNewed) is true -PASS bazNewed.outerHTML is "<x-baz></x-baz>" -PASS bazNewed instanceof bazConstructor && bazNewed instanceof HTMLElement is true -PASS bazNewed instanceof HTMLUnknownElement is false -PASS quxNewed instanceof quxConstructor && quxNewed instanceof barConstructor && quxNewed instanceof HTMLInputElement is true -PASS quxNewed.outerHTML is "<input is=\"x-qux\">" -PASS isFormControl(quxNewed) is true -PASS fooCreated.outerHTML is "<x-foo></x-foo>" -PASS fooCreated instanceof fooConstructor is true -PASS barCreated.outerHTML is "<x-bar></x-bar>" -PASS barCreated instanceof barConstructor is false -PASS barCreated instanceof HTMLUnknownElement is false -PASS barCreated instanceof HTMLElement is true -PASS bazCreated.outerHTML is "<x-baz></x-baz>" -PASS bazCreated instanceof bazConstructor is true -PASS bazCreated instanceof HTMLUnknownElement is false -PASS quxCreated.outerHTML is "<x-qux></x-qux>" -PASS quxCreated instanceof quxConstructor is false -PASS quxCreated instanceof HTMLUnknownElement is false -PASS quxCreated instanceof HTMLElement is true -PASS divFooCreated.outerHTML is "<div is=\"x-foo\"></div>" -PASS divFooCreated instanceof fooConstructor is false -PASS divFooCreated instanceof HTMLDivElement is true -PASS inputBarCreated.outerHTML is "<input is=\"x-bar\">" -PASS inputBarCreated instanceof barConstructor is true -PASS inputBarCreated instanceof HTMLUnknownElement is false -PASS isFormControl(inputBarCreated) is true -PASS divBarCreated.outerHTML is "<div is=\"x-bar\"></div>" -PASS divBarCreated instanceof barConstructor is false -PASS divBarCreated instanceof HTMLDivElement is true -PASS fooBarCreated.outerHTML is "<x-foo is=\"x-bar\"></x-foo>" -PASS fooBarCreated instanceof fooConstructor is true -PASS barFooCreated.outerHTML is "<x-bar is=\"x-foo\"></x-bar>" -PASS barFooCreated instanceof HTMLUnknownElement is false -PASS barFooCreated instanceof HTMLElement is true -PASS fooCreatedNull.outerHTML is "<x-foo></x-foo>" -PASS fooCreatedNull instanceof fooConstructor is true -PASS fooCreatedEmpty.outerHTML is "<x-foo></x-foo>" -PASS fooCreatedEmpty instanceof fooConstructor is true -PASS document.createElement("@invalid", "x-bar") threw exception InvalidCharacterError: Failed to execute 'createElement' on 'Document': The tag name provided ('@invalid') is not a valid name.. -PASS fooCreatedNS.outerHTML is "<x-foo></x-foo>" -PASS fooCreatedNS instanceof fooConstructor is true -PASS barCreatedNS.outerHTML is "<input is=\"x-bar\">" -PASS barCreatedNS instanceof barConstructor is true -PASS isFormControl(barCreatedNS) is true -PASS document.createElementNS("http://example.com/2013/no-such-namespace", "xml:lang", "x-bar") threw exception NamespaceError: Failed to execute 'createElementNS' on 'Document': The namespace URI provided ('http://example.com/2013/no-such-namespace') is not valid for the qualified name provided ('xml:lang').. -PASS fooParsed instanceof fooConstructor is true -PASS barParsed instanceof barConstructor is true -PASS isFormControl(barParsed) is true -PASS divFooParsed instanceof fooConstructor is false -PASS divFooParsed instanceof HTMLDivElement is true -PASS namedBarParsed instanceof barConstructor is false -PASS namedBarParsed instanceof HTMLUnknownElement is false -PASS namedBarParsed instanceof HTMLElement is true -PASS divBarParsed instanceof barConstructor is false -PASS divBarParsed instanceof HTMLDivElement is true -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/document-register-type-extensions.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/document-register-type-extensions.html deleted file mode 100644 index 01c5ac3..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/document-register-type-extensions.html +++ /dev/null
@@ -1,172 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script src="../../../resources/js-test.js"></script> -</head> -<body> -<div id="container"></div> -<form id="testForm"></form> -<script> -description('Testing document.registerElement() type extension behaviours through createElement().'); - -function isFormControl(element) -{ - testForm.appendChild(element); - return element.form == testForm; -} - -if (window.testRunner) - testRunner.dumpAsText(); - -// -// Inheritance here is shaped like this: -// -// HTMLElement <- input <- x-bar <- x-qux -// <- x-foo <- x-baz -// - -fooConstructor = document.registerElement('x-foo', { prototype: Object.create(HTMLElement.prototype) }); -barConstructor = document.registerElement('x-bar', { extends: 'input', prototype: Object.create(HTMLInputElement.prototype) }); -bazConstructor = document.registerElement('x-baz', { prototype: Object.create(fooConstructor.prototype) }); -quxConstructor = document.registerElement('x-qux', { extends: 'input', prototype: Object.create(barConstructor.prototype) }); - -// Same name, different local name -shouldThrow('document.registerElement("x-foo", { prototype: Object.create(HTMLDivElement.prototype) })', '"NotSupportedError: Failed to execute \'registerElement\' on \'Document\': Registration failed for type \'x-foo\'. A type with that name is already registered."'); - -// -// Generated constructors -// - -fooNewed = new fooConstructor(); -fooOuterHTML = '<x-foo></x-foo>'; -shouldBeEqualToString('fooNewed.outerHTML', fooOuterHTML); -shouldBeTrue('fooNewed instanceof fooConstructor && fooNewed instanceof HTMLElement'); -shouldBeFalse('fooNewed instanceof HTMLUnknownElement'); - -barNewed = new barConstructor(); -barOuterHTML = '<input is="x-bar">'; -shouldBeEqualToString('barNewed.outerHTML', barOuterHTML); -shouldBeTrue('barNewed instanceof barConstructor && barNewed instanceof HTMLInputElement'); -shouldBeTrue('isFormControl(barNewed)'); - -bazNewed = new bazConstructor(); -bazOuterHTML = '<x-baz></x-baz>'; -shouldBeEqualToString('bazNewed.outerHTML', bazOuterHTML); -shouldBeTrue('bazNewed instanceof bazConstructor && bazNewed instanceof HTMLElement'); -shouldBeFalse('bazNewed instanceof HTMLUnknownElement'); - -quxNewed = new quxConstructor(); -quxOuterHTML = '<input is="x-qux">'; -shouldBeTrue('quxNewed instanceof quxConstructor && quxNewed instanceof barConstructor && quxNewed instanceof HTMLInputElement'); -shouldBeEqualToString('quxNewed.outerHTML', quxOuterHTML); -shouldBeTrue('isFormControl(quxNewed)'); - -// -// Single parameter createElement() -// - -fooCreated = document.createElement('x-foo'); -shouldBeEqualToString('fooCreated.outerHTML', fooOuterHTML); -shouldBeTrue('fooCreated instanceof fooConstructor'); - -barCreated = document.createElement('x-bar'); -shouldBeEqualToString('barCreated.outerHTML', '<x-bar></x-bar>'); -shouldBeFalse('barCreated instanceof barConstructor'); -shouldBeFalse('barCreated instanceof HTMLUnknownElement'); -shouldBeTrue('barCreated instanceof HTMLElement'); - -bazCreated = document.createElement('x-baz'); -shouldBeEqualToString('bazCreated.outerHTML', '<x-baz></x-baz>'); -shouldBeTrue('bazCreated instanceof bazConstructor'); -shouldBeFalse('bazCreated instanceof HTMLUnknownElement'); - -quxCreated = document.createElement('x-qux'); -shouldBeEqualToString('quxCreated.outerHTML', '<x-qux></x-qux>'); -shouldBeFalse('quxCreated instanceof quxConstructor'); -shouldBeFalse('quxCreated instanceof HTMLUnknownElement'); -shouldBeTrue('quxCreated instanceof HTMLElement'); - -// -// createElement() with type extensions -// - -divFooCreated = document.createElement('div', 'x-foo'); -shouldBeEqualToString('divFooCreated.outerHTML', '<div is="x-foo"></div>'); -shouldBeFalse('divFooCreated instanceof fooConstructor'); -shouldBeTrue('divFooCreated instanceof HTMLDivElement'); - -inputBarCreated = document.createElement('input', 'x-bar'); -shouldBeEqualToString('inputBarCreated.outerHTML', barOuterHTML); -shouldBeTrue('inputBarCreated instanceof barConstructor'); -shouldBeFalse('inputBarCreated instanceof HTMLUnknownElement'); -shouldBeTrue('isFormControl(inputBarCreated)'); - -divBarCreated = document.createElement('div', 'x-bar'); -shouldBeEqualToString('divBarCreated.outerHTML', '<div is="x-bar"></div>'); -shouldBeFalse('divBarCreated instanceof barConstructor'); -shouldBeTrue('divBarCreated instanceof HTMLDivElement'); - -fooBarCreated = document.createElement('x-foo', 'x-bar'); -shouldBeEqualToString('fooBarCreated.outerHTML', '<x-foo is="x-bar"></x-foo>'); -shouldBeTrue('fooBarCreated instanceof fooConstructor'); - -barFooCreated = document.createElement('x-bar', 'x-foo'); -shouldBeEqualToString('barFooCreated.outerHTML', '<x-bar is="x-foo"></x-bar>'); -shouldBeFalse('barFooCreated instanceof HTMLUnknownElement'); -shouldBeTrue('barFooCreated instanceof HTMLElement'); - -fooCreatedNull = document.createElement('x-foo', null); -shouldBeEqualToString('fooCreatedNull.outerHTML', fooOuterHTML); -shouldBeTrue('fooCreatedNull instanceof fooConstructor'); - -fooCreatedEmpty = document.createElement('x-foo', ''); -shouldBeEqualToString('fooCreatedEmpty.outerHTML', fooOuterHTML); -shouldBeTrue('fooCreatedEmpty instanceof fooConstructor'); - -shouldThrow('document.createElement("@invalid", "x-bar")', '"InvalidCharacterError: Failed to execute \'createElement\' on \'Document\': The tag name provided (\'@invalid\') is not a valid name."'); - -// -// createElementNS() with type extensions -// - -fooCreatedNS = document.createElementNS('http://www.w3.org/1999/xhtml', 'x-foo', null); -shouldBeEqualToString('fooCreatedNS.outerHTML', fooOuterHTML); -shouldBeTrue('fooCreatedNS instanceof fooConstructor'); - -barCreatedNS = document.createElementNS('http://www.w3.org/1999/xhtml', 'input', 'x-bar'); -shouldBeEqualToString('barCreatedNS.outerHTML', barOuterHTML); -shouldBeTrue('barCreatedNS instanceof barConstructor'); -shouldBeTrue('isFormControl(barCreatedNS)'); - -shouldThrow('document.createElementNS("http://example.com/2013/no-such-namespace", "xml:lang", "x-bar")', '"NamespaceError: Failed to execute \'createElementNS\' on \'Document\': The namespace URI provided (\'http://example.com/2013/no-such-namespace\') is not valid for the qualified name provided (\'xml:lang\')."'); - -// parser -function createElementFromHTML(html) { - var container = document.createElement('div'); - container.innerHTML = html; - return container.firstChild; -} - -fooParsed = createElementFromHTML('<x-foo>'); -shouldBeTrue('fooParsed instanceof fooConstructor'); - -barParsed = createElementFromHTML('<input is="x-bar">') -shouldBeTrue('barParsed instanceof barConstructor'); -shouldBeTrue('isFormControl(barParsed)'); - -divFooParsed = createElementFromHTML('<div is="x-foo">') -shouldBeFalse('divFooParsed instanceof fooConstructor'); -shouldBeTrue('divFooParsed instanceof HTMLDivElement'); - -namedBarParsed = createElementFromHTML('<x-bar>') -shouldBeFalse('namedBarParsed instanceof barConstructor'); -shouldBeFalse('namedBarParsed instanceof HTMLUnknownElement'); -shouldBeTrue('namedBarParsed instanceof HTMLElement'); - -divBarParsed = createElementFromHTML('<div is="x-bar">') -shouldBeFalse('divBarParsed instanceof barConstructor'); -shouldBeTrue('divBarParsed instanceof HTMLDivElement'); - -</script> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/element-names.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/element-names.html deleted file mode 100644 index eb2cbc6..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/element-names.html +++ /dev/null
@@ -1,59 +0,0 @@ -<!DOCTYPE html> -<script src="../../../resources/testharness.js"></script> -<script src="../../../resources/testharnessreport.js"></script> -<body> -<script> -function createRegisterParameters() { - return { - prototype: Object.create(HTMLElement.prototype, { thisIsPrototype: { value: true } }) - }; -} - -test(function () { - var invalidNames = [ - // Hyphen missing: - 'foo', - 'xfoo', - // Reserved names: - // hyphen-containing names from the applicable specifications, - // namely the SVG and the MathML. - 'annotation-xml', - // names containing colon - ':-xfoo', - 'xfoo-:yfoo' - ]; - - for (var i = 0; i < invalidNames.length; i++) { - var invalidName = invalidNames[i]; - assert_throws_dom('SYNTAX_ERR', function (){ - document.registerElement(invalidName, createRegisterParameters()); - }, 'register invalid custom element name: ' + invalidName); - } - -}, 'invalid and reserved names'); - -test(function (){ - document.registerElement('x-foo', createRegisterParameters()); - assert_throws_dom('NOT_SUPPORTED_ERR', function (){ - document.registerElement('x-foo', createRegisterParameters()); - }, 'register already registered "x-foo"'); - assert_throws_dom('NOT_SUPPORTED_ERR', function (){ - document.registerElement('X-FOO', createRegisterParameters()); - }, 'register "X-FOO", same as already registered "x-foo"'); -}, 'name conflicts'); - -test(function () { - var validNameTagMap = { - 'y-bar': 'Y-BAR', - 'yz-bar': 'YZ-BAR', - 'y-z-bar': 'Y-Z-BAR', - 'y--bar' : 'Y--BAR' - }; - for(var elementName in validNameTagMap) { - var expectedTagName = validNameTagMap[elementName]; - var tagName = (new (document.registerElement(elementName, createRegisterParameters()))()).tagName; - assert_equals(tagName, expectedTagName, tagName + ' must be treated as a custom element'); - } -}, 'strange but valid names'); - -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/element-type-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/element-type-expected.txt deleted file mode 100644 index 5d4bcaf9..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/element-type-expected.txt +++ /dev/null
@@ -1,14 +0,0 @@ -CONSOLE WARNING: line 28: document.registerElement is deprecated and will be removed in M80, around February 2020. Please use window.customElements.define instead. See https://www.chromestatus.com/features/4642138092470272 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -Test that changing an instantiated custom element's 'is' attribute does not affect its element type. - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - -PASS window.testRunner is non-null. -PASS a.getAttribute("is") is "x-y" -PASS a instanceof X is true -PASS createdBy is "X" -PASS createdCallCount is 1 -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/element-type.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/element-type.html deleted file mode 100644 index 688e666..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/element-type.html +++ /dev/null
@@ -1,39 +0,0 @@ -<!DOCTYPE html> -<script src="../../../resources/js-test.js"></script> -<body> -<span is="x-x" id="a"></span> -<script> -description('Test that changing an instantiated custom element\'s \'is\' attribute does not affect its element type.'); -shouldBeNonNull('window.testRunner', 'This test requires testRunner.'); - -// Some custom definition lookup happens at wrapper generation time so -// do the change in another world to avoid hiding the bug. -var worldId = 1; -testRunner.evaluateScriptInIsolatedWorld( - worldId, - 'var a = document.querySelector("#a");' + - 'a.setAttribute("is", "x-y");'); - -var createdCallCount = 0; -var createdBy = ''; -function onCreate(msg) { - return function () { - createdBy = msg; - createdCallCount++; - }; -} - -var protoX = Object.create(HTMLSpanElement.prototype); -protoX.createdCallback = onCreate('X'); -var X = document.registerElement('x-x', {extends: 'span', prototype: protoX}); - -var protoY = Object.create(HTMLSpanElement.prototype); -protoY.createdCallback = onCreate('Y'); -var Y = document.registerElement('x-y', {extends: 'span', prototype: protoY}); - -var a = document.querySelector('#a'); -shouldBe('a.getAttribute("is")', '"x-y"'); -shouldBeTrue('a instanceof X'); -shouldBe('createdBy', '"X"'); -shouldBe('createdCallCount', '1'); -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/element-upgrade-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/element-upgrade-expected.txt deleted file mode 100644 index 69fd882..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/element-upgrade-expected.txt +++ /dev/null
@@ -1,18 +0,0 @@ -CONSOLE WARNING: line 17: document.registerElement is deprecated and will be removed in M80, around February 2020. Please use window.customElements.define instead. See https://www.chromestatus.com/features/4642138092470272 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -CONSOLE WARNING: :unresolved pseudo selector is deprecated and will be removed in M80, around February 2020. Please use :not(:defined) instead. See https://www.chromestatus.com/features/4642138092470272 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -Tests the element upgrade algorithm. - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - -PASS host.firstChild instanceof A is true -PASS element instanceof B is true -PASS callCount is 1 -PASS element instanceof C is false -PASS Object.getPrototypeOf(element) is HTMLElement.prototype -PASS host.firstChild instanceof D is false -PASS document.querySelector(":unresolved") is host.firstChild -PASS upgradedOrder is ["e1","e2","e3","e4","e5"] -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/element-upgrade-no-register-and-leak-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/element-upgrade-no-register-and-leak-expected.txt deleted file mode 100644 index 1f89ab0b..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/element-upgrade-no-register-and-leak-expected.txt +++ /dev/null
@@ -1,8 +0,0 @@ -Tests unresolved element not leaking if never resolved. - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/element-upgrade-no-register-and-leak.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/element-upgrade-no-register-and-leak.html deleted file mode 100644 index 2ee61b7f..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/element-upgrade-no-register-and-leak.html +++ /dev/null
@@ -1,11 +0,0 @@ -<!DOCTYPE html> -<script src="../../../resources/js-test.js"></script> -<div id="container"></div> -<script> -description('Tests unresolved element not leaking if never resolved.'); - -// Verify that a custom tag for which no element is ever registered -// doesn't cause a document nor elements to leak. -var host = document.createElement('div'); -host.innerHTML = '<x-a></x-a>'; -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/element-upgrade.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/element-upgrade.html deleted file mode 100644 index 73b10e5..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/element-upgrade.html +++ /dev/null
@@ -1,58 +0,0 @@ -<!DOCTYPE html> -<script src="../../../resources/js-test.js"></script> -<div id="container"></div> -<script> -description('Tests the element upgrade algorithm.'); - -// "Element Upgrade" is the processing of custom elements which were -// created before their definition was available, when the definition -// becomes available. The following scenarios cover a lot but are not -// exhaustive. - -// Scenario A: Custom tag; upgrade candidate is not in the document; -// upgrade candidate did not have a JavaScript wrapper at upgrade -// time; custom element does not have a created callback. -var host = document.createElement('div'); -host.innerHTML = '<x-a></x-a>'; // Using innerHTML avoids wrapping x-a -var A = document.registerElement('x-a', {prototype: Object.create(HTMLElement.prototype)}); -shouldBeTrue('host.firstChild instanceof A'); - -// Scenario B: Type extension; upgrade candidate is in the document; -// upgrade candidate did have a JavaScript wrapper at upgrade time; -// custom element has a created callback. -var element = document.createElement('span', 'x-b'); -var proto = Object.create(HTMLSpanElement.prototype); -var callCount = 0; -proto.createdCallback = function () { - callCount++; -}; -var B = document.registerElement('x-b', {extends: 'span', prototype: proto}); -shouldBeTrue('element instanceof B'); -shouldBe('callCount', '1'); - -// Scenario C: The candidate is a custom tag but the definition is a -// type extension. Upgrade should not happen. -element = document.createElement('x-c'); -var C = document.registerElement('x-c', {extends: 'span', prototype: Object.create(HTMLSpanElement.prototype)}); -shouldBeFalse('element instanceof C'); -shouldBe('Object.getPrototypeOf(element)', 'HTMLElement.prototype'); - -// Scenario D: The candidate is a type extension, but the definition -// extends a different tag. Upgrade should not happen. -document.body.appendChild(host); -host.innerHTML = '<span is="x-d"></span>'; -var D = document.registerElement('x-d', {extends: 'div', prototype: Object.create(HTMLDivElement.prototype)}); -shouldBeFalse('host.firstChild instanceof D'); -shouldBe('document.querySelector(":unresolved")', 'host.firstChild'); - -// Scenario E: The order of upgrades should be the order of completing parsing. -// Use a good number of elements to avoid false positives from random correct ordering. -host.innerHTML = '<x-e id="e1"><x-e id="e2"></x-e></x-e><x-e id="e3"></x-e><x-e id="e4"></x-e><x-e id="e5"></x-e>'; -var upgradedOrder = []; -var protoE = Object.create(HTMLElement.prototype); -protoE.createdCallback = function() { upgradedOrder.push(this.id); }; -document.registerElement('x-e', {prototype: protoE}); -shouldBe('upgradedOrder', '["e1","e2","e3","e4","e5"]'); - -successfullyParsed = true; -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/entered-left-document.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/entered-left-document.html deleted file mode 100644 index 362661a..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/entered-left-document.html +++ /dev/null
@@ -1,145 +0,0 @@ -<!DOCTYPE html> -<script src="../../../resources/testharness.js"></script> -<script src="../../../resources/testharnessreport.js"></script> -<script src="test-harness-utils.js"></script> -<body> -<script> -(function () { -var t = async_test('entered, left callbacks should only be invoked when ' + - 'entering or leaving a document with a view'); -withFrame(t.step_func(function (frame) { - // Set up a definition - - var docA = frame.contentDocument; - var docB = docA.implementation.createHTMLDocument(); - - var invocations = []; - function log(msg) { - return function () { invocations.push(msg); }; - } - - var proto = Object.create(frame.contentWindow.HTMLElement.prototype); - proto.createdCallback = log('created'); - proto.attributeChangedCallback = log('attribute changed'); - proto.attachedCallback = log('entered'); - proto.detachedCallback = log('left'); - - // Created, owned by a document without a view - - var A = docB.registerElement('x-a', {prototype: proto}); - var a = new A(); - assert_equals(a.ownerDocument, docB, - 'new instance should be owned by the document the ' + - 'definition was registered with'); - assert_array_equals(invocations, ['created'], - 'calling the constructor should invoke the created ' + - 'callback'); - - // Entered document without a view - - invocations = []; - docB.body.appendChild(a); - assert_array_equals(invocations, [], - 'entered callback should not be invoked when ' + - 'entering a document without a view'); - - // Attribute changed in document without a view - - a.setAttribute('data-foo', 'bar'); - assert_array_equals(invocations, ['attribute changed'], - 'changing an attribute should invoke the callback, ' + - 'even in a document without a view'); - - // Entered document with a view - - invocations = []; - docA.body.appendChild(a); - assert_array_equals(invocations, ['entered'], - 'entered callback should be invoked when entering ' + - 'a document with a view'); - - // Left document with a view - - invocations = []; - a.remove(); - assert_array_equals(invocations, ['left'], - 'left callback should be invoked when leaving a ' + - 'document with a view'); - - // Created in a document without a view - - invocations = []; - docB.body.innerHTML = '<x-a></x-a>'; - assert_array_equals(invocations, ['created'], - 'only created callback should be invoked when ' + - 'parsing a custom element in a document without a ' + - 'view'); - - // Created in Shadow DOM that is not in a document - - var div = docB.createElement('div'); - var s = div.createShadowRoot(); - invocations = []; - s.innerHTML = '<x-a></x-a>'; - assert_array_equals(invocations, ['created'], - 'the entered callback should not be invoked when ' + - 'entering a Shadow DOM subtree not in the document'); - - // Leaves Shadow DOM that is not in a document - - invocations = []; - s.innerHTML = ''; - assert_array_equals(invocations, [], - 'the left callback should not be invoked when ' + - 'leaving a Shadow DOM subtree not in the document'); - - // Enters a document with a view as a constituent of Shadow DOM - - s.innerHTML = '<x-a></x-a>'; - invocations = []; - docA.body.appendChild(div); - assert_array_equals(invocations, ['entered'], - 'the entered callback should be invoked when ' + - 'inserted into a document with a view as part of ' + - 'Shadow DOM'); - - // Leaves a document with a view as a constituent of Shadow DOM - - invocations = []; - docB.body.appendChild(div); - assert_array_equals(invocations, ['left'], - 'the left callback should be invoked when removed ' + - 'from a document with a view as part of Shadow DOM'); - - // Enters a disconnected subtree of DOM - - invocations = []; - div = docA.createElement('div'); - div.innerHTML = '<x-a></x-a>'; - assert_array_equals(invocations, ['created'], - 'the entered callback should not be invoked when ' + - 'inserted into a disconnected subtree'); - - // Leaves a disconnected subtree of DOM - - invocations = []; - div.innerHTML = ''; - assert_array_equals(invocations, [], - 'the left callback should not be invoked when ' + - 'removed from a disconnected subtree'); - - // Enters a document with a view as a constituent of a subtree - - div.innerHTML = '<x-a></x-a>'; - invocations = []; - docA.body.appendChild(div); - assert_array_equals(invocations, ['entered'], - 'the entered callback should be invoked when ' + - 'inserted into a document with a view as part of ' + - 'a subtree'); - - frame.remove(); - t.done(); -})); -})(); -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/exception-from-constructor-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/exception-from-constructor-expected.txt deleted file mode 100644 index 95f22a1..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/exception-from-constructor-expected.txt +++ /dev/null
@@ -1,10 +0,0 @@ -CONSOLE WARNING: document.registerElement is deprecated and will be removed in M80, around February 2020. Please use window.customElements.define instead. See https://www.chromestatus.com/features/4642138092470272 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -Tests throwing an exception during registration of constructor - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - -PASS document.registerElement("x-a", {prototype: proto}) threw exception Exception thrown from getter. -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/exception-from-constructor.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/exception-from-constructor.html deleted file mode 100644 index decefa7..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/exception-from-constructor.html +++ /dev/null
@@ -1,18 +0,0 @@ -<!DOCTYPE html> -<script src="../../../resources/js-test.js"></script> -<body> -<script> -description('Tests throwing an exception during registration of constructor'); - -if (window.testRunner) - testRunner.dumpAsText(); - -var proto = Object.create(HTMLElement.prototype, { - constructor: { - configurable: true, - get: function () { throw "Exception thrown from getter"; } - } - }); - -shouldThrow('document.registerElement("x-a", {prototype: proto})', '"Exception thrown from getter"'); -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/frameElement-crash-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/frameElement-crash-expected.txt deleted file mode 100644 index 6b18f6f6..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/frameElement-crash-expected.txt +++ /dev/null
@@ -1,10 +0,0 @@ -CONSOLE WARNING: line 17: document.registerElement is deprecated and will be removed in M80, around February 2020. Please use window.customElements.define instead. See https://www.chromestatus.com/features/4642138092470272 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -Test that accessing window.frameElement from a custom iframe does not crash. - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - -PASS Did not crash -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/frameElement-crash.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/frameElement-crash.html deleted file mode 100644 index e24bf0f2..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/frameElement-crash.html +++ /dev/null
@@ -1,25 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script src="../../../resources/js-test.js"></script> -</head> -<body> -<script> -function test() { - testPassed('Did not crash'); - finishJSTest(); -} - -window.jsTestIsAsync = true; -description('Test that accessing window.frameElement from a custom iframe does not crash.'); - -var proto = Object.create(HTMLIFrameElement.prototype); -document.registerElement('x-iframe', {prototype: proto, extends: 'iframe'}); -</script> -<iframe onload="test();" is="x-iframe" srcdoc=" - <script> - window.frameElement; - </script> -"></iframe> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/html-element-type-extension-assert-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/html-element-type-extension-assert-expected.txt deleted file mode 100644 index e138de8..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/html-element-type-extension-assert-expected.txt +++ /dev/null
@@ -1,9 +0,0 @@ -Tests that type extension of a element whose DOM interface is HTMLElement does not assert - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - -PASS did not crash -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/html-element-type-extension-assert.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/html-element-type-extension-assert.html deleted file mode 100644 index b530bed..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/html-element-type-extension-assert.html +++ /dev/null
@@ -1,17 +0,0 @@ -<!DOCTYPE html> -<script src="../../../resources/js-test.js"></script> -<section id="a" is="x-a"></section> -<script> -description('Tests that type extension of a element whose DOM interface is ' + - 'HTMLElement does not assert'); - -var u = document.querySelector('#a'); -var v = document.createElement('section', 'x-a'); - -// FIXME: When the 'extends' option is implemented, test registering the -// the Custom Element. - -testPassed('did not crash'); - -var successfullyParsed = true; -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/imports-block-upgrade-in-client.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/imports-block-upgrade-in-client.html deleted file mode 100644 index b32a5af..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/imports-block-upgrade-in-client.html +++ /dev/null
@@ -1,16 +0,0 @@ -<!DOCTYPE html> -<script src="../../../resources/testharness.js"></script> -<script src="../../../resources/testharnessreport.js"></script> -<script> -var upgradeIds = []; -</script> -<x-a id='a1'></x-a> -<link rel="import" href="resources/import-block-upgrade-in-client-child.html"> -<body> -<x-a id='a2'></x-a> -<script> -test(function () { - assert_array_equals(window.upgradeIds, ['a1', 'a2'], 'Elements in the client should be upgraded by a definition in an import.'); -}, 'upgrade in the client'); -</script> -</body>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/imports-block-upgrade-in-import.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/imports-block-upgrade-in-import.html deleted file mode 100644 index 2462a95..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/imports-block-upgrade-in-import.html +++ /dev/null
@@ -1,18 +0,0 @@ -<!DOCTYPE html> -<script src="../../../resources/testharness.js"></script> -<script src="../../../resources/testharnessreport.js"></script> -<script> -var upgradeIds = []; -</script> -<x-a id="a1"></x-a> -<link rel="import" href="resources/import-block-upgrade-in-import-child.html"> -<body> -<x-b id="b4"></x-b> -<x-a id="a5"></x-a> -<script> -test(function () { - assert_array_equals(window.upgradeIds, ['a1', 'a2', 'a3', 'b0', 'b1', 'b2', 'a4', 'b3', 'b4', 'a5'], - 'Elements in the client and imports should be upgraded by a definition in an import.'); -}, 'upgrade in the client'); -</script> -</body>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/imports-custom-element-abort.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/imports-custom-element-abort.html deleted file mode 100644 index 397d4e89..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/imports-custom-element-abort.html +++ /dev/null
@@ -1,17 +0,0 @@ -<!DOCTYPE html> -<script src="../../../resources/testharness.js"></script> -<script src="../../../resources/testharnessreport.js"></script> -<body> -<script> -t = async_test('Abort page inside custom element callback inside import'); - -function checkLater() { - window.setTimeout(check, 0); -} - -function check() { - t.done(); -} -</script> -<iframe src="resources/import-custom-element-abort-parent.html"></iframe> -</body>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/inherited-prototype.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/inherited-prototype.html deleted file mode 100644 index c95f4769..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/inherited-prototype.html +++ /dev/null
@@ -1,43 +0,0 @@ -<!DOCTYPE html> -<script src="../../../resources/testharness.js"></script> -<script src="../../../resources/testharnessreport.js"></script> -<body> -<script> -test(function () { - var protoA = Object.create(HTMLDivElement.prototype); - var A = document.registerElement('x-a', { - extends: 'div', prototype: protoA}); - - assert_equals( - Object.getPrototypeOf(A), HTMLDivElement, - 'generated constructor prototype should be base element constructor ' + - '(extend built-in element)'); - - assert_equals( - A.__proto__, HTMLDivElement, - 'Internal prototype should also be base element function object ' + - '(extend built-in element)'); - - assert_equals( - A.prototype.__proto__, HTMLDivElement.prototype, - 'Internal prototype of generated constructor prototype should be ' + - 'prototype of base element function object (extend built-in element)'); - - var protoB = Object.create(protoA); - var B = document.registerElement('x-b', {prototype: protoB}); - assert_equals( - Object.getPrototypeOf(B), A, - 'generated constructor prototype should be base element constructor ' + - '(extend Custom Element)'); - - assert_equals( - B.__proto__, A, - 'Internal prototype should also be base element function object ' + - '(extend Custom Element)'); - - assert_equals( - B.prototype.__proto__, A.prototype, - 'Internal prototype of generated constructor prototype should be ' + - 'prototype of base element function object (extend Custom Element)'); -}, 'generated constructor prototype property'); -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/invalid-first-char-combinators.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/invalid-first-char-combinators.html deleted file mode 100644 index ed22a71..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/invalid-first-char-combinators.html +++ /dev/null
@@ -1,18 +0,0 @@ -<!DOCTYPE html> -<script src="../../../resources/testharness.js"></script> -<script src="../../../resources/testharnessreport.js"></script> - -<script> -test(function () { - var invalidCombinators = [ 0x0B83, 0x0F88, 0x0F89, 0x0F8A, 0x0F8B ]; - - for (var i = 0; i < invalidCombinators.length; i++) { - var invalidCombinator = String.fromCharCode(invalidCombinators[i]) + '-xfoo'; - assert_throws_dom('SYNTAX_ERR', function () { - document.registerElement(invalidCombinator); - }, 'registering custom element: *' + - invalidCombinator + '* should throw syntax error'); - } - -}, 'registering invalid first letter combinators, not covered in Document::validNames'); -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/invalid-type-extension-crash.svg b/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/invalid-type-extension-crash.svg deleted file mode 100644 index f8e2483..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/invalid-type-extension-crash.svg +++ /dev/null
@@ -1,9 +0,0 @@ -<html xmlns="http://www.w3.org/1999/xhtml"><x-test is="x-a" id="t"></x-test> -<script src="../../../resources/testharness.js"></script> -<script src="../../../resources/testharnessreport.js"></script> -<script><![CDATA[ -test(() => assert_true(document.getElementById("t") instanceof Element), - 'Accessing an XML element that looks like a Custom Element ' + - 'should not crash.'); -]]></script> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/isolated-world-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/isolated-world-expected.txt deleted file mode 100644 index 1f233bd..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/isolated-world-expected.txt +++ /dev/null
@@ -1,11 +0,0 @@ -CONSOLE WARNING: document.registerElement is deprecated and will be removed in M80, around February 2020. Please use window.customElements.define instead. See https://www.chromestatus.com/features/4642138092470272 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -Tests that accessing custom elements from an isolated world does not cause worlds to collide and destroy the galaxy. - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - -PASS window.testRunner is non-null. -PASS did not crash -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/isolated-world.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/isolated-world.html deleted file mode 100644 index 6f2a846..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/isolated-world.html +++ /dev/null
@@ -1,104 +0,0 @@ -<!DOCTYPE html> -<script src="../../../resources/js-test.js"></script> -<body> -<div id="container-a"><span is="x-a" id="x"></span></div> -<div id="container-b"><span is="x-a" id="y"></span></div> -<script> -description('Tests that accessing custom elements from an isolated world ' + - 'does not cause worlds to collide and destroy the galaxy.'); - -shouldBeNonNull('window.testRunner', 'this test requires testRunner'); - -var containerA = document.querySelector('#container-a'); - -// Access an upgrade candidate from an isolated world. -var world = 1; -testRunner.evaluateScriptInIsolatedWorld( - world, - 'window.containerA = document.querySelector("#container-a"); ' + - 'window.a = containerA.firstElementChild; ' + - 'containerA.remove();'); - -// Registering an exception in the isolated world should raise an exception. -result = testRunner.evaluateScriptInIsolatedWorldAndReturnValue( - world, - '(function () { ' + - ' var proto = Object.create(HTMLSpanElement.prototype); ' + - ' proto.createdCallback = function () { ' + - ' console.log(this.id + " entered (isolated)"); ' + - ' }; ' + - ' try { ' + - ' document.registerElement("x-a", {extends: "span", prototype: proto}); ' + - ' return "register succeeded"; ' + - ' } catch (e) { ' + - ' return e.code; ' + - ' } ' + - '})()'); - -shouldBe('result', 'DOMException.NOT_SUPPORTED_ERR', - 'calling register from an isolated world should throw an exception'); - -// Now access this element from the main world. -a = containerA.querySelector('#x'); -shouldBe('a.__proto__', 'HTMLSpanElement.prototype', - 'the main world should see the usual main world prototype'); - -// Upgrade from the main world - -var proto = Object.create(HTMLSpanElement.prototype); -invocations = []; -proto.attachedCallback = function () { - invocations.push(this.id + ' entered (main)'); -}; -document.registerElement('x-a', {extends: 'span', prototype: proto}); -shouldBe('invocations', '["y entered (main)"]', - 'only the element in the document should generate entered events'); - -// Insert from the isolated world - -invocations = []; -testRunner.evaluateScriptInIsolatedWorld(world, - 'document.body.appendChild(a);'); -shouldBe('invocations', '["x entered (main)"]', - 'modification in the isolated world should have caused callbacks ' + - 'in the main world'); - -// Examine prototypes from the isolated world - -proto.p = 'p'; -HTMLSpanElement.prototype.q = 'q'; - -result = testRunner.evaluateScriptInIsolatedWorldAndReturnValue( - world, - '(function () { ' + - ' try { ' + - ' var messages = []; ' + - ' function log(message) { messages.push(message); } ' + - ' function inspect(obj) { ' + - ' log(obj.id + " prototype is HTMLSpanElement.prototype? " + ' + - ' (obj.__proto__ === HTMLSpanElement.prototype)); ' + - ' log(obj.id + ".p ~> " + obj.p); ' + - ' log(obj.id + ".q ~> " + obj.q); ' + - ' } ' + - ' inspect(window.a); ' + - ' inspect(document.querySelector("#y")); ' + - ' return messages.join(", "); ' + - ' } catch (e) { ' + - ' return e.toString(); ' + - ' } ' + - '})()'); -shouldBe( - 'result', - '"x prototype is HTMLSpanElement.prototype? true,' + - ' x.p ~> undefined,' + - ' x.q ~> undefined,' + - ' y prototype is HTMLSpanElement.prototype? true,' + - ' y.p ~> undefined,' + - ' y.q ~> undefined"', - 'the isolated world should not see main world prototypes'); - -// Lastly, collect some wrappers (e.g #b in isolated world) -document.querySelector('#container-b').innerHTML = ''; -gc(); -testPassed('did not crash'); -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/lifecycle-created-createElement-recursion-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/lifecycle-created-createElement-recursion-expected.txt deleted file mode 100644 index 72c80e17..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/lifecycle-created-createElement-recursion-expected.txt +++ /dev/null
@@ -1,7 +0,0 @@ -CONSOLE WARNING: line 8: document.registerElement is deprecated and will be removed in M80, around February 2020. Please use window.customElements.define instead. See https://www.chromestatus.com/features/4642138092470272 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -CONSOLE ERROR: line 8: Uncaught RangeError: Maximum call stack size exceeded. -PASS unless crash -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/lifecycle-created-createElement-recursion.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/lifecycle-created-createElement-recursion.html deleted file mode 100644 index 5f9d983..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/lifecycle-created-createElement-recursion.html +++ /dev/null
@@ -1,15 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script src="../../../resources/js-test.js"></script> -</head> -<body> -<script> -document.registerElement("x-foo", { prototype: Object.create(HTMLElement.prototype, { createdCallback: { value: function () { this.innerHTML = "<x-foo>Hello</x-foo>"; } } }) }); -if (window.testRunner) - testRunner.dumpAsText(); -document.createElement("x-foo"); -debug("PASS unless crash"); -</script> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/lifecycle-created-createElement-reentrancy-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/lifecycle-created-createElement-reentrancy-expected.txt deleted file mode 100644 index ca6f54bd..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/lifecycle-created-createElement-reentrancy-expected.txt +++ /dev/null
@@ -1,13 +0,0 @@ -CONSOLE WARNING: line 22: document.registerElement is deprecated and will be removed in M80, around February 2020. Please use window.customElements.define instead. See https://www.chromestatus.com/features/4642138092470272 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -This test ensures that the lifecycle callback of a parser-made element is visible in following script block. - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - -PASS window.callbacksCalled is [] -PASS window.callbacksCalled is ['X-FOO'] -PASS window.callbacksCalled is ['X-FOO', 'X-BAR'] -PASS window.callbacksCalled is ['X-FOO', 'X-BAR'] -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/lifecycle-created-createElement-reentrancy.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/lifecycle-created-createElement-reentrancy.html deleted file mode 100644 index c9620fa..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/lifecycle-created-createElement-reentrancy.html +++ /dev/null
@@ -1,32 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script src="../../../resources/js-test.js"></script> -<script> -description("This test ensures that the lifecycle callback of a parser-made element is visible in following script block.") - -window.callbacksCalled = []; - -function fooCreatedFunction() { - shouldBe("window.callbacksCalled", "[]"); - window.callbacksCalled.push(this.tagName); - this.innerHTML = "<x-bar></x-bar>"; - shouldBe("window.callbacksCalled", "['X-FOO', 'X-BAR']"); -} - -function barCreatedFunction() { - shouldBe("window.callbacksCalled", "['X-FOO']"); - window.callbacksCalled.push(this.tagName); -} - -document.registerElement("x-foo", { prototype: Object.create(HTMLElement.prototype, { createdCallback: { value: fooCreatedFunction } }) }); -document.registerElement("x-bar", { prototype: Object.create(HTMLElement.prototype, { createdCallback: { value: barCreatedFunction } }) }); -</script> -</head> -<body> -<script> -document.createElement("x-foo"); -shouldBe("window.callbacksCalled", "['X-FOO', 'X-BAR']"); -</script> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/lifecycle-created-creation-api-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/lifecycle-created-creation-api-expected.txt deleted file mode 100644 index 903938e..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/lifecycle-created-creation-api-expected.txt +++ /dev/null
@@ -1,27 +0,0 @@ -CONSOLE WARNING: line 13: document.registerElement is deprecated and will be removed in M80, around February 2020. Please use window.customElements.define instead. See https://www.chromestatus.com/features/4642138092470272 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -This test ensures that the lifecycle callbacks of API-originated elements are visible in following script block. - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - -PASS document.createElement('x-foo').callbacksCalled is true -PASS document.createElement('div', 'x-bar').callbacksCalled is true -PASS document.createElementNS('http://www.w3.org/1999/xhtml', 'x-foo').callbacksCalled is true -PASS document.createElementNS('http://www.w3.org/1999/xhtml', 'div', 'x-bar').callbacksCalled is true -PASS foo.cloneNode().callbacksCalled is true -PASS foo.cloneNode(true).firstChild.callbacksCalled is true -PASS bar.cloneNode().callbacksCalled is true -PASS bar.cloneNode(true).firstChild.callbacksCalled is true -PASS foreignFoo.callbacksCalled is true -PASS foreignFoo.firstChild.callbacksCalled is true -PASS importedFoo.callbacksCalled is true -PASS importedFoo.firstChild.callbacksCalled is true -PASS window.callbacksCalled is ['div', 'x-foo'] -PASS importedBar.callbacksCalled is true -PASS importedBar.firstChild.callbacksCalled is true -PASS window.callbacksCalled is ['DIV', 'X-FOO'] -PASS window.callbacksCalled is ['X-FOO'] -PASS window.callbacksCalled is ['X-FOO'] -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/lifecycle-created-creation-api.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/lifecycle-created-creation-api.html deleted file mode 100644 index 7a3ba8f1..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/lifecycle-created-creation-api.html +++ /dev/null
@@ -1,73 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script src="../../../resources/js-test.js"></script> -<script> -description("This test ensures that the lifecycle callbacks of API-originated elements are visible in following script block.") -window.callbacksCalled = []; -function markingReadyCallback() { - window.callbacksCalled.push(this.tagName); - this.callbacksCalled = true; -} - -document.registerElement("x-foo", { prototype: Object.create(HTMLElement.prototype, { createdCallback: { value: markingReadyCallback } }) }); -document.registerElement("x-bar", { extends: "div", prototype: Object.create(HTMLDivElement.prototype, { createdCallback: { value: markingReadyCallback } }) }); -</script> -</head> -<body> -<div id="container"></div> -<div id="host"></div> - -<script> - -shouldBeTrue("document.createElement('x-foo').callbacksCalled"); -shouldBeTrue("document.createElement('div', 'x-bar').callbacksCalled"); - -shouldBeTrue("document.createElementNS('http://www.w3.org/1999/xhtml', 'x-foo').callbacksCalled"); -shouldBeTrue("document.createElementNS('http://www.w3.org/1999/xhtml', 'div', 'x-bar').callbacksCalled"); - -var foo = document.createElement('x-foo'); -foo.appendChild(document.createElement('div', 'x-bar')); -shouldBeTrue("foo.cloneNode().callbacksCalled"); -shouldBeTrue("foo.cloneNode(true).firstChild.callbacksCalled"); - -var bar = document.createElement('div', 'x-bar'); -bar.appendChild(document.createElement('x-foo')); -shouldBeTrue("bar.cloneNode().callbacksCalled"); -shouldBeTrue("bar.cloneNode(true).firstChild.callbacksCalled"); - -var foreignDoc = document.implementation.createDocument('http://www.w3.org/1999/xhtml', 'html', null); - -var foreignFoo = foreignDoc.createElement('x-foo'); -foreignFoo.appendChild(foreignDoc.createElement('div', 'x-bar')); -shouldBeTrue("foreignFoo.callbacksCalled"); -shouldBeTrue("foreignFoo.firstChild.callbacksCalled"); -importedFoo = document.importNode(foreignFoo, true) -shouldBeTrue("importedFoo.callbacksCalled"); -shouldBeTrue("importedFoo.firstChild.callbacksCalled"); - -window.callbacksCalled = []; -var foreignBar = foreignDoc.createElement('div', 'x-bar'); -foreignBar.appendChild(foreignDoc.createElement('x-foo')); -shouldBe("window.callbacksCalled", "['div', 'x-foo']"); -window.callbacksCalled = []; -importedBar = document.importNode(foreignBar, true); -shouldBeTrue("importedBar.callbacksCalled"); -shouldBeTrue("importedBar.firstChild.callbacksCalled"); -shouldBe("window.callbacksCalled", "['DIV', 'X-FOO']"); - -window.callbacksCalled = []; -var toBeReplaced = document.createElement("div"); -document.body.appendChild(toBeReplaced); -toBeReplaced.outerHTML = "<x-foo></x-foo>"; -shouldBe("window.callbacksCalled", "['X-FOO']"); - -window.callbacksCalled = []; -var insertionPlaceHolder = document.createElement("div"); -document.body.appendChild(insertionPlaceHolder); -insertionPlaceHolder.insertAdjacentHTML("beforebegin", "<x-foo></x-foo>"); -shouldBe("window.callbacksCalled", "['X-FOO']"); - -</script> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/lifecycle-created-innerHTML-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/lifecycle-created-innerHTML-expected.txt deleted file mode 100644 index 0503c67..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/lifecycle-created-innerHTML-expected.txt +++ /dev/null
@@ -1,11 +0,0 @@ -CONSOLE WARNING: line 15: document.registerElement is deprecated and will be removed in M80, around February 2020. Please use window.customElements.define instead. See https://www.chromestatus.com/features/4642138092470272 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -This test ensures that the lifecycle callback of a parser-made element is visible in following script block. - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - -PASS window.callbacksCalled is ['a', 'b', 'c'] -PASS window.callbacksCalled is ['a', 'b', 'c'] -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/lifecycle-created-innerHTML.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/lifecycle-created-innerHTML.html deleted file mode 100644 index 336d6cb..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/lifecycle-created-innerHTML.html +++ /dev/null
@@ -1,34 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script src="../../../resources/js-test.js"></script> -<script> -description("This test ensures that the lifecycle callback of a parser-made element is visible in following script block.") - -window.callbacksCalled = []; - -function trackingReadyCallback() -{ - window.callbacksCalled.push(this.id); -} - -document.registerElement("x-foo", { prototype: Object.create(HTMLElement.prototype, { createdCallback: { value: trackingReadyCallback } }) }); -document.registerElement("x-bar", { extends: "div", prototype: Object.create(HTMLDivElement.prototype, { createdCallback: { value: trackingReadyCallback } }) }); -document.registerElement("x-baz", { prototype: Object.create(HTMLElement.prototype, { createdCallback: { value: trackingReadyCallback } }) }); -</script> -</head> -<body> -<div id="container"> -<script> -// Testing element siblings -window.callbacksCalled = []; -container.innerHTML = "<x-foo id='a'></x-foo><div id='b' is='x-bar'></div><x-baz id='c'></x-baz>"; -shouldBe("window.callbacksCalled", "['a', 'b', 'c']"); - -// Testing nested elements -window.callbacksCalled = []; -container.innerHTML = "<x-foo id='a'><div id='b' is='x-bar'><x-baz id='c'></x-baz></div></x-foo>"; -shouldBe("window.callbacksCalled", "['a', 'b', 'c']"); -</script> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/lifecycle-created-parser-only-expected.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/lifecycle-created-parser-only-expected.html deleted file mode 100644 index 96fd8074..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/lifecycle-created-parser-only-expected.html +++ /dev/null
@@ -1,6 +0,0 @@ -<!DOCTYPE html> -<html> -<body> -<span>Hello</span> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/lifecycle-created-parser-only-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/lifecycle-created-parser-only-expected.txt deleted file mode 100644 index 2015443..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/lifecycle-created-parser-only-expected.txt +++ /dev/null
@@ -1 +0,0 @@ -CONSOLE WARNING: line 6: document.registerElement is deprecated and will be removed in M80, around February 2020. Please use window.customElements.define instead. See https://www.chromestatus.com/features/4642138092470272 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details.
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/lifecycle-created-parser-only.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/lifecycle-created-parser-only.html deleted file mode 100644 index ec4e702..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/lifecycle-created-parser-only.html +++ /dev/null
@@ -1,12 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script> -proto = Object.create(HTMLElement.prototype, { createdCallback: { value: function() { this.innerHTML = "Hello"; } } }); -document.registerElement("x-foo", { prototype: proto }); -</script> -</head> -<body> -<x-foo></x-foo> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/lifecycle-created-parser-script-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/lifecycle-created-parser-script-expected.txt deleted file mode 100644 index e7bfddf2..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/lifecycle-created-parser-script-expected.txt +++ /dev/null
@@ -1,10 +0,0 @@ -CONSOLE WARNING: line 8: document.registerElement is deprecated and will be removed in M80, around February 2020. Please use window.customElements.define instead. See https://www.chromestatus.com/features/4642138092470272 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -This test ensures that the lifecycle callback of a parser-made element is visible in following script block. - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - -PASS window.callbacksCalled is true -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/lifecycle-created-parser-script.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/lifecycle-created-parser-script.html deleted file mode 100644 index f983a7ce..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/lifecycle-created-parser-script.html +++ /dev/null
@@ -1,17 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script src="../../../resources/js-test.js"></script> -<script> -description("This test ensures that the lifecycle callback of a parser-made element is visible in following script block.") -proto = Object.create(HTMLElement.prototype, { createdCallback: { value: function() { window.callbacksCalled = true; } } }); -document.registerElement("x-foo", { prototype: proto }); -</script> -</head> -<body> -<x-foo></x-foo> -<script> -shouldBeTrue("window.callbacksCalled"); -</script> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/lifecycle-created-paste-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/lifecycle-created-paste-expected.txt deleted file mode 100644 index 8047b06..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/lifecycle-created-paste-expected.txt +++ /dev/null
@@ -1,11 +0,0 @@ -CONSOLE WARNING: line 8: document.registerElement is deprecated and will be removed in M80, around February 2020. Please use window.customElements.define instead. See https://www.chromestatus.com/features/4642138092470272 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -This test ensures that the lifecycle callbacks of editing-originated elements are visible in following script block. - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - -PASS window.callbacksCalled is ['X-FOO', 'DIV'] -PASS window.callbacksCalled is ['X-FOO', 'DIV', 'X-FOO', 'DIV'] -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/lifecycle-created-paste.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/lifecycle-created-paste.html deleted file mode 100644 index d26706f..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/lifecycle-created-paste.html +++ /dev/null
@@ -1,28 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script src="../../../resources/js-test.js"></script> -<script> -description("This test ensures that the lifecycle callbacks of editing-originated elements are visible in following script block.") -window.callbacksCalled = []; -document.registerElement("x-foo", { prototype: Object.create(HTMLElement.prototype, { createdCallback: { value: function() { window.callbacksCalled.push(this.tagName); } } }) }); -document.registerElement("x-bar", { extends: "div", prototype: Object.create(HTMLDivElement.prototype, { createdCallback: { value: function() { window.callbacksCalled.push(this.tagName); } } }) }); -</script> -</head> -<body> -<div id="container" contenteditable>[<x-foo>Foo</x-foo><div is='x-bar'>Bar</div>]</div> -<script> -var selection = window.getSelection(); - -selection.selectAllChildren(container); -document.execCommand("Copy"); - -shouldBe("window.callbacksCalled", "['X-FOO', 'DIV']"); -selection.collapseToEnd(); -document.execCommand("Paste"); -shouldBe("window.callbacksCalled", "['X-FOO', 'DIV', 'X-FOO', 'DIV']"); - -container.style.display = "none"; -</script> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/prerender-insert-after-stop-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/prerender-insert-after-stop-expected.txt deleted file mode 100644 index 47cd89c..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/prerender-insert-after-stop-expected.txt +++ /dev/null
@@ -1,11 +0,0 @@ -CONSOLE WARNING: line 4: document.registerElement is deprecated and will be removed in M80, around February 2020. Please use window.customElements.define instead. See https://www.chromestatus.com/features/4642138092470272 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -Test that Custom Element should be defined while navigating between frames. - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - -PASS customBody is defined. -PASS customBody.toLocaleString() is "[object HTMLBodyElement]" -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/prerender-insert-after-stop.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/prerender-insert-after-stop.html deleted file mode 100644 index 18c92a11b..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/prerender-insert-after-stop.html +++ /dev/null
@@ -1,25 +0,0 @@ -<!DOCTYPE html> -<script src='../../../resources/js-test.js'></script> -<script> -description('Test that Custom Element should be defined while navigating between frames.'); - -var customBody; -var jsTestIsAsync = true; - -function linkInserter(doc) { - return function() { - customBody = doc.getElementById('thebody'); - shouldBeDefined('customBody'); - shouldBeEqualToString('customBody.toLocaleString()', '[object HTMLBodyElement]'); - finishJSTest(); - } -} - -function navigateIFrameThenInsertLink() { - var iframe = document.getElementById('iframe'); - iframe.onload = linkInserter(iframe.contentDocument); - iframe.contentWindow.location = 'resources/empty-custom-body.html'; -} -</script> -<iframe id='iframe' onload='navigateIFrameThenInsertLink()' src='resources/empty-custom-body.html'> -</iframe> \ No newline at end of file
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/processing-stack-recursion.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/processing-stack-recursion.html deleted file mode 100644 index 27fcf582..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/processing-stack-recursion.html +++ /dev/null
@@ -1,157 +0,0 @@ -<!DOCTYPE html> -<script src="../../../resources/testharness.js"></script> -<script src="../../../resources/testharnessreport.js"></script> -<body> -<template id="expected">A entered -A removing parent node - A left - A inserting parent node - A entered - A removing parent node - A left - A inserting parent node - A entered - B entered - B left - B entered - B setting attribute on C - C entered - C left - C entered - C left - C entered - C@by null->b - C setting attribute on B - B left - B entered - B@by null->c - B setting attribute on A - A@by null->b - done - done - done - done - done - done -done</template> -<script> -test(function () { - // Helpers for logging - var buffer = []; - var indentation = ''; - function log(msg) { - buffer.push(indentation + msg); - } - function indented(msg) { - log(msg); - indentation += ' '; - } - function unindent() { - indentation = indentation.substring(3); - log('done'); - } - - // This tests recursion and the processing stack. Specifically: - // - // (1) Scheduling callbacks for an element that has callbacks - // scheduled at an outer level of recursion, but that have not - // begun to be processed yet. - // - // (2) Scheduling callbacks for an element that is in the middle - // of processing callbacks at an outer level of recursion. - // - // (3) Scheduling callbacks for an element that exhaustively - // processed callbacks at an outer level of recursion. - // - // appendChild and remove are used on a subtree containing - // multiple custom elements. In this way it is possible to - // schedule callbacks for multiple custom elements with one DOM - // call. - // - // The test creates this tree: - // - // <div> - // <x-a></x-a> - // <x-b></x-b> - // <x-c></x-c> - // </div> - // - // x-a pushes its parent in and out of the document, thus scheduling - // work for x-b and x-c at every level of recursion. - // - // Then x-b processes half its queue before setting an attribute - // on x-c. This tests case (1) because x-c has not begun its queue - // yet. - // - // x-c turns around and sets and attribute on x-b. This tests case - // (2) because x-b is half way through processing its queue. - // - // x-b turns around and sets an attribute on x-a. This tests case - // (3) because x-a has finished processing its queue. - - var protoA = Object.create(HTMLElement.prototype); - var n = 0; - protoA.attachedCallback = function () { - log('A entered'); - n++; - if (n < 3) { - indented('A removing parent node'); - this.parentNode.remove(); - unindent(); - } - }; - protoA.detachedCallback = function () { - log('A left'); - indented('A inserting parent node'); - document.body.appendChild(this.parentNode); - unindent(); - }; - protoA.attributeChangedCallback = function (name, oldValue, newValue) { - log('A@' + name + ' ' + oldValue + '->' + newValue); - }; - var A = document.registerElement('x-a', {prototype: protoA}); - - var protoB = Object.create(HTMLElement.prototype); - var m = 0; - protoB.attachedCallback = function () { - log('B entered'); - m++; - if (m == 2) { - indented('B setting attribute on C'); - this.parentNode.querySelector('x-c').setAttribute('by', 'b'); - unindent(); - } - }; - protoB.detachedCallback = function () { - log('B left'); - }; - protoB.attributeChangedCallback = function (name, oldValue, newValue) { - log('B@' + name + ' ' + oldValue + '->' + newValue); - indented('B setting attribute on A'); - this.parentNode.querySelector('x-a').setAttribute('by', 'b'); - unindent(); - }; - var B = document.registerElement('x-b', {prototype: protoB}); - - var protoC = Object.create(HTMLElement.prototype); - protoC.attachedCallback = function () { - log('C entered'); - }; - protoC.detachedCallback = function () { - log('C left'); - }; - protoC.attributeChangedCallback = function (name, oldValue, newValue) { - log('C@' + name + ' ' + oldValue + '->' + newValue); - indented('C setting attribute on B'); - this.parentNode.querySelector('x-b').setAttribute('by', 'c'); - unindent(); - }; - var C = document.registerElement('x-c', {prototype: protoC}); - - var div = document.createElement('div'); - div.innerHTML = '<div><x-a></x-a><x-b></x-b><x-c></x-c></div>'; - document.body.appendChild(div); - - assert_equals(buffer.join('\n'), expected.content.textContent, 'should have generated an identical log'); -}, 'recursively scheduled callbacks'); -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/register-element-with-U212A.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/register-element-with-U212A.html deleted file mode 100644 index 2f10600..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/register-element-with-U212A.html +++ /dev/null
@@ -1,16 +0,0 @@ -<!DOCTYPE html> -<script src="../../../resources/testharness.js"></script> -<script src="../../../resources/testharnessreport.js"></script> -<script> -test(function () { - - var A = document.registerElement('x-tkent'); - assert_true(document.createElement('x-tkent') instanceof A); - - var B = document.registerElement('x-t\u212Aent'); - assert_true(document.createElement('x-t\u212Aent') instanceof B); - -}, 'registerElement should register type with U+212A'); - -</script> -
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/registration-context-delete-during-attribute-changed-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/registration-context-delete-during-attribute-changed-expected.txt deleted file mode 100644 index f13360c0..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/registration-context-delete-during-attribute-changed-expected.txt +++ /dev/null
@@ -1,11 +0,0 @@ -CONSOLE WARNING: line 20: document.registerElement is deprecated and will be removed in M80, around February 2020. Please use window.customElements.define instead. See https://www.chromestatus.com/features/4642138092470272 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -Tests destroying a context during attributeChanged callback. - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - -PASS destroyed context -PASS child done -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/registration-context-delete-during-attribute-changed-retrieval-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/registration-context-delete-during-attribute-changed-retrieval-expected.txt deleted file mode 100644 index dd5e5e37..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/registration-context-delete-during-attribute-changed-retrieval-expected.txt +++ /dev/null
@@ -1,12 +0,0 @@ -CONSOLE WARNING: line 24: document.registerElement is deprecated and will be removed in M80, around February 2020. Please use window.customElements.define instead. See https://www.chromestatus.com/features/4642138092470272 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -Tests destroying a context during registration at the point when the attributeChanged callback is retrieved. - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - -PASS destroyed context -PASS caught expected exception "InvalidStateError: Failed to execute 'registerElement' on 'Document': Registration failed for type 'x-a'. The context is no longer valid." -PASS child done -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/registration-context-delete-during-attribute-changed-retrieval.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/registration-context-delete-during-attribute-changed-retrieval.html deleted file mode 100644 index 3981bd7..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/registration-context-delete-during-attribute-changed-retrieval.html +++ /dev/null
@@ -1,31 +0,0 @@ -<!DOCTYPE html> -<script src="../../../resources/js-test.js"></script> -<script src="testutils.js"></script> -<body> -<script> -if (fork()) { - // The controlling parent frame - description('Tests destroying a context during registration at the point when the attributeChanged callback is retrieved.'); - jsTestIsAsync = true; - successfullyParsed = true; -} else { - // The child frame - - var proto = Object.create(HTMLElement.prototype, { - attributeChangedCallback: { - get: function () { - destroyContext(); - return function () { } - } - } - }); - - try { - document.registerElement('x-a', {prototype: proto}); - log('FAIL expected register to throw an exception'); - } catch (ex) { - log('PASS caught expected exception "' + ex + '"'); - } - done(); -} -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/registration-context-delete-during-attribute-changed.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/registration-context-delete-during-attribute-changed.html deleted file mode 100644 index 0783b98d..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/registration-context-delete-during-attribute-changed.html +++ /dev/null
@@ -1,25 +0,0 @@ -<!DOCTYPE html> -<script src="../../../resources/js-test.js"></script> -<script src="testutils.js"></script> -<body> -<x-a></x-a> -<script> -if (fork()) { - // The controlling parent frame - description('Tests destroying a context during attributeChanged callback.'); - jsTestIsAsync = true; - successfullyParsed = true; -} else { - // The child frame - - var proto = Object.create(HTMLElement.prototype); - proto.attributeChangedCallback = function () { - destroyContext(); - }; - - var A = document.registerElement('x-a', {prototype: proto}); - var a = new A(); - a.id = 'boom'; - done(); -} -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/registration-context-delete-during-callback-recursion-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/registration-context-delete-during-callback-recursion-expected.txt deleted file mode 100644 index be02c91..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/registration-context-delete-during-callback-recursion-expected.txt +++ /dev/null
@@ -1,11 +0,0 @@ -CONSOLE WARNING: line 29: document.registerElement is deprecated and will be removed in M80, around February 2020. Please use window.customElements.define instead. See https://www.chromestatus.com/features/4642138092470272 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -Tests destroying a context during attributeChanged callback. - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - -PASS destroyed context -PASS child done -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/registration-context-delete-during-callback-recursion.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/registration-context-delete-during-callback-recursion.html deleted file mode 100644 index 1418f3379..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/registration-context-delete-during-callback-recursion.html +++ /dev/null
@@ -1,38 +0,0 @@ -<!DOCTYPE html> -<script src="../../../resources/js-test.js"></script> -<script src="testutils.js"></script> -<body> -<div id="s"> -</div> -<script> -if (fork()) { - // The controlling parent frame - description('Tests destroying a context during attributeChanged callback.'); - jsTestIsAsync = true; - successfullyParsed = true; -} else { - // The child frame - - var n = 0; - var proto = Object.create(HTMLElement.prototype); - proto.createdCallback = function () { - if (n++ == 2) - this.previousSibling.setAttribute('tick', '...'); - }; - proto.attributeChangedCallback = function (name) { - if (name == 'tick') - this.previousSibling.setAttribute('boom', 'tsk'); - if (name == 'boom') - destroyContext(); - }; - - var A = document.registerElement('x-a', {prototype: proto}); - s.innerHTML = - '<x-a id="t"></x-a>' + - '<x-a id="u"></x-a>' + - '<x-a id="v"></x-a>' + - '<x-a id="w"></x-a>'; - - done(); -} -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/registration-context-delete-during-register-base-constructor-retrieval-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/registration-context-delete-during-register-base-constructor-retrieval-expected.txt deleted file mode 100644 index 5998bccc..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/registration-context-delete-during-register-base-constructor-retrieval-expected.txt +++ /dev/null
@@ -1,12 +0,0 @@ -CONSOLE WARNING: line 25: document.registerElement is deprecated and will be removed in M80, around February 2020. Please use window.customElements.define instead. See https://www.chromestatus.com/features/4642138092470272 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -Tests destroying a context during registration at the point when the prototype's constructor property is retrieved. - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - -PASS destroyed context -PASS caught expected exception "InvalidStateError: Failed to execute 'registerElement' on 'Document': Registration failed for type 'x-a'. The context is no longer valid." -PASS child done -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/registration-context-delete-during-register-base-constructor-retrieval.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/registration-context-delete-during-register-base-constructor-retrieval.html deleted file mode 100644 index 158f4c9..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/registration-context-delete-during-register-base-constructor-retrieval.html +++ /dev/null
@@ -1,32 +0,0 @@ -<!DOCTYPE html> -<script src="../../../resources/js-test.js"></script> -<script src="testutils.js"></script> -<body> -<script> -if (fork()) { - // The controlling parent frame - description('Tests destroying a context during registration at the' + - ' point when the prototype\'s constructor property is retrieved.'); - jsTestIsAsync = true; - successfullyParsed = true; -} else { - // The child frame - var proto = Object.create(HTMLElement.prototype, { - constructor: { - configurable: true, - get: function () { - destroyContext(); - return HTMLElement; - } - } - }); - - try { - var element = document.registerElement('x-a', {prototype: proto}); - log('FAIL expected register to throw an exception'); - } catch (ex) { - log('PASS caught expected exception "' + ex + '"'); - } - done(); -} -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/registration-context-delete-during-register-created-retrieval-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/registration-context-delete-during-register-created-retrieval-expected.txt deleted file mode 100644 index b2eed89..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/registration-context-delete-during-register-created-retrieval-expected.txt +++ /dev/null
@@ -1,12 +0,0 @@ -CONSOLE WARNING: line 24: document.registerElement is deprecated and will be removed in M80, around February 2020. Please use window.customElements.define instead. See https://www.chromestatus.com/features/4642138092470272 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -Tests destroying a context during registration at the point when the created callback is retrieved. - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - -PASS destroyed context -PASS caught expected exception "InvalidStateError: Failed to execute 'registerElement' on 'Document': Registration failed for type 'x-a'. The context is no longer valid." -PASS child done -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/registration-context-delete-during-register-created-retrieval.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/registration-context-delete-during-register-created-retrieval.html deleted file mode 100644 index 488859f..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/registration-context-delete-during-register-created-retrieval.html +++ /dev/null
@@ -1,31 +0,0 @@ -<!DOCTYPE html> -<script src="../../../resources/js-test.js"></script> -<script src="testutils.js"></script> -<body> -<script> -if (fork()) { - // The controlling parent frame - description('Tests destroying a context during registration at the point when the created callback is retrieved.'); - jsTestIsAsync = true; - successfullyParsed = true; -} else { - // The child frame - - var proto = Object.create(HTMLElement.prototype, { - createdCallback: { - get: function () { - destroyContext(); - return function () { } - } - } - }); - - try { - document.registerElement('x-a', {prototype: proto}); - log('FAIL expected register to throw an exception'); - } catch (ex) { - log('PASS caught expected exception "' + ex + '"'); - } - done(); -} -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/registration-context-delete-during-register-extends-retrieval-and-throw-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/registration-context-delete-during-register-extends-retrieval-and-throw-expected.txt deleted file mode 100644 index 2c502a6..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/registration-context-delete-during-register-extends-retrieval-and-throw-expected.txt +++ /dev/null
@@ -1,12 +0,0 @@ -CONSOLE WARNING: line 24: document.registerElement is deprecated and will be removed in M80, around February 2020. Please use window.customElements.define instead. See https://www.chromestatus.com/features/4642138092470272 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -Tests destroying a context during registration at the point when the "extends" option is retrieved, then throws an exception. - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - -PASS destroyed context -PASS caught expected exception "future events such as these will affect you in the future" -PASS child done -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/registration-context-delete-during-register-extends-retrieval-and-throw.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/registration-context-delete-during-register-extends-retrieval-and-throw.html deleted file mode 100644 index 32e34de1..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/registration-context-delete-during-register-extends-retrieval-and-throw.html +++ /dev/null
@@ -1,31 +0,0 @@ -<!DOCTYPE html> -<script src="../../../resources/js-test.js"></script> -<script src="testutils.js"></script> -<body> -<script> -if (fork()) { - // The controlling parent frame - description('Tests destroying a context during registration at the point when the "extends" option is retrieved, then throws an exception.'); - jsTestIsAsync = true; - successfullyParsed = true; -} else { - // The child frame - - var options = Object.create(Object.prototype, { - extends: { - get: function () { - destroyContext(); - throw 'future events such as these will affect you in the future'; - } - } - }); - - try { - document.registerElement('x-a', options); - log('FAIL expected register to throw an exception'); - } catch (ex) { - log('PASS caught expected exception "' + ex + '"'); - } - done(); -} -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/registration-context-delete-during-register-extends-retrieval-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/registration-context-delete-during-register-extends-retrieval-expected.txt deleted file mode 100644 index 81d3337d..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/registration-context-delete-during-register-extends-retrieval-expected.txt +++ /dev/null
@@ -1,12 +0,0 @@ -CONSOLE WARNING: line 24: document.registerElement is deprecated and will be removed in M80, around February 2020. Please use window.customElements.define instead. See https://www.chromestatus.com/features/4642138092470272 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -Tests destroying a context during registration at the point when the "extends" option is retrieved. - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - -PASS destroyed context -PASS caught expected exception "InvalidStateError: Failed to execute 'registerElement' on 'Document': Registration failed for type 'x-a'. The context is no longer valid." -PASS child done -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/registration-context-delete-during-register-extends-retrieval.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/registration-context-delete-during-register-extends-retrieval.html deleted file mode 100644 index a381077b..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/registration-context-delete-during-register-extends-retrieval.html +++ /dev/null
@@ -1,31 +0,0 @@ -<!DOCTYPE html> -<script src="../../../resources/js-test.js"></script> -<script src="testutils.js"></script> -<body> -<script> -if (fork()) { - // The controlling parent frame - description('Tests destroying a context during registration at the point when the "extends" option is retrieved.'); - jsTestIsAsync = true; - successfullyParsed = true; -} else { - // The child frame - - var options = Object.create(Object.prototype, { - extends: { - get: function () { - destroyContext(); - return 'a'; - } - } - }); - - try { - document.registerElement('x-a', options); - log('FAIL expected register to throw an exception'); - } catch (ex) { - log('PASS caught expected exception "' + ex + '"'); - } - done(); -} -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/registration-context-delete-during-register-prototype-retrieval-and-throw-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/registration-context-delete-during-register-prototype-retrieval-and-throw-expected.txt deleted file mode 100644 index a608dc4..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/registration-context-delete-during-register-prototype-retrieval-and-throw-expected.txt +++ /dev/null
@@ -1,12 +0,0 @@ -CONSOLE WARNING: line 24: document.registerElement is deprecated and will be removed in M80, around February 2020. Please use window.customElements.define instead. See https://www.chromestatus.com/features/4642138092470272 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -Tests destroying a context during registration at the point when the prototype is retrieved, then throws an exception. - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - -PASS destroyed context -PASS caught expected exception "future events such as these will affect you in the future" -PASS child done -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/registration-context-delete-during-register-prototype-retrieval-and-throw.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/registration-context-delete-during-register-prototype-retrieval-and-throw.html deleted file mode 100644 index a7b8067..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/registration-context-delete-during-register-prototype-retrieval-and-throw.html +++ /dev/null
@@ -1,31 +0,0 @@ -<!DOCTYPE html> -<script src="../../../resources/js-test.js"></script> -<script src="testutils.js"></script> -<body> -<script> -if (fork()) { - // The controlling parent frame - description('Tests destroying a context during registration at the point when the prototype is retrieved, then throws an exception.'); - jsTestIsAsync = true; - successfullyParsed = true; -} else { - // The child frame - - var options = Object.create(Object.prototype, { - prototype: { - get: function () { - destroyContext(); - throw 'future events such as these will affect you in the future'; - } - } - }); - - try { - document.registerElement('x-a', options); - log('FAIL expected register to throw an exception'); - } catch (ex) { - log('PASS caught expected exception "' + ex + '"'); - } - done(); -} -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/registration-context-delete-during-register-prototype-retrieval-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/registration-context-delete-during-register-prototype-retrieval-expected.txt deleted file mode 100644 index fe64f62a..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/registration-context-delete-during-register-prototype-retrieval-expected.txt +++ /dev/null
@@ -1,12 +0,0 @@ -CONSOLE WARNING: line 25: document.registerElement is deprecated and will be removed in M80, around February 2020. Please use window.customElements.define instead. See https://www.chromestatus.com/features/4642138092470272 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -Tests destroying a context during registration at the point when the prototype is retrieved. - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - -PASS destroyed context -PASS caught expected exception "InvalidStateError: Failed to execute 'registerElement' on 'Document': Registration failed for type 'x-a'. The context is no longer valid." -PASS child done -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/registration-context-delete-during-register-prototype-retrieval.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/registration-context-delete-during-register-prototype-retrieval.html deleted file mode 100644 index 7b288ca4..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/registration-context-delete-during-register-prototype-retrieval.html +++ /dev/null
@@ -1,32 +0,0 @@ -<!DOCTYPE html> -<script src="../../../resources/js-test.js"></script> -<script src="testutils.js"></script> -<body> -<script> -if (fork()) { - // The controlling parent frame - description('Tests destroying a context during registration at the point when the prototype is retrieved.'); - jsTestIsAsync = true; - successfullyParsed = true; -} else { - // The child frame - - var proto = Object.create(HTMLElement.prototype); - var options = Object.create(Object.prototype, { - prototype: { - get: function () { - destroyContext(); - return proto; - } - } - }); - - try { - document.registerElement('x-a', options); - log('FAIL expected register to throw an exception'); - } catch (ex) { - log('PASS caught expected exception "' + ex + '"'); - } - done(); -} -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/registration-context-delete-during-upgrade-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/registration-context-delete-during-upgrade-expected.txt deleted file mode 100644 index e2e977e..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/registration-context-delete-during-upgrade-expected.txt +++ /dev/null
@@ -1,11 +0,0 @@ -CONSOLE WARNING: line 24: document.registerElement is deprecated and will be removed in M80, around February 2020. Please use window.customElements.define instead. See https://www.chromestatus.com/features/4642138092470272 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -Tests destroying a context during element upgrade. - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - -PASS destroyed context -PASS child done -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/registration-context-delete-during-upgrade.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/registration-context-delete-during-upgrade.html deleted file mode 100644 index 61fb832..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/registration-context-delete-during-upgrade.html +++ /dev/null
@@ -1,28 +0,0 @@ -<!DOCTYPE html> -<script src="../../../resources/js-test.js"></script> -<script src="testutils.js"></script> -<body> -<x-a></x-a> -<x-a></x-a> -<x-a></x-a> -<script> -if (fork()) { - // The controlling parent frame - description('Tests destroying a context during element upgrade.'); - jsTestIsAsync = true; - successfullyParsed = true; -} else { - // The child frame - - var n = 0; - var proto = Object.create(HTMLElement.prototype); - proto.createdCallback = function () { - if (++n == 2) - destroyContext(); - }; - - var A = document.registerElement('x-a', {prototype: proto}); - new A(); - done(); -} -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/registration-context-delete-then-register-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/registration-context-delete-then-register-expected.txt deleted file mode 100644 index 3676f79..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/registration-context-delete-then-register-expected.txt +++ /dev/null
@@ -1,11 +0,0 @@ -Tests destroying a context, then trying to register a new custom element. - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - -PASS destroyed context -PASS caught expected exception "InvalidStateError: Failed to execute 'registerElement' on 'Document': Registration failed for type 'x-a'. The context is no longer valid." -PASS child done -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/registration-context-delete-then-register.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/registration-context-delete-then-register.html deleted file mode 100644 index 38bbf62d..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/registration-context-delete-then-register.html +++ /dev/null
@@ -1,25 +0,0 @@ -<!DOCTYPE html> -<script src="../../../resources/js-test.js"></script> -<script src="testutils.js"></script> -<body> -<script> -if (fork()) { - // The controlling parent frame - description('Tests destroying a context, then trying to register a new custom element.'); - jsTestIsAsync = true; - successfullyParsed = true; -} else { - // The child frame - - var proto = Object.create(HTMLElement.prototype); - destroyContext(); - - try { - document.registerElement('x-a', {prototype: proto}); - log('FAIL expected register to throw an exception'); - } catch (ex) { - log('PASS caught expected exception "' + ex + '"'); - } - done(); -} -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/registration-context-isolation.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/registration-context-isolation.html deleted file mode 100644 index caefa0eb3..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/registration-context-isolation.html +++ /dev/null
@@ -1,191 +0,0 @@ -<!DOCTYPE html> -<script src="../../../resources/testharness.js"></script> -<script src="../../../resources/testharnessreport.js"></script> -<script src="test-harness-utils.js"></script> -<body> -<script> -function TestRegistrationContextIsolation(windowA, documentA, - windowB, documentB) { - this.windowA = windowA; - this.documentA = documentA; - this.windowB = windowB; - this.documentB = documentB; -} - -TestRegistrationContextIsolation.prototype. -testRegistrationContextIsNotShared = function () { - this.testRegisterInAInstantiateInB_shouldNotActivateDefinition(); - this.testRegisterSameName_definitionsShouldNotConflict(); - this.testRegisterSameName_lazyWrappingShouldNotSharePrototypes(); -}; - -TestRegistrationContextIsolation.prototype. -testRegisterInAInstantiateInB_shouldNotActivateDefinition = function () { - - // Test that element x-u registered in document A is not activated when - // x-u is parsed in document B - - var protoU = Object.create(this.windowA.HTMLElement.prototype); - protoU.createdCallback = function () { - assert_unreached('creating an x-u in a different context should ' + - 'not invoke a callback in this context'); - }; - this.documentA.registerElement('x-u', {prototype: protoU}); - - var container = this.documentB.createElement('div'); - container.innerHTML = '<x-u></x-u>'; - // if protoU.createdCallback is not invoked; this passed -}; - -TestRegistrationContextIsolation.prototype. -testRegisterSameName_definitionsShouldNotConflict = function () { - // Test that registering two different custom elements with the same - // tag name in each document doesn't lead to any crossed wires - - var invocations = []; - function created(name) { - return function () { - invocations.push('created ' + name + ' in ' + this.dataset.doc); - }; - } - - var protoAV = Object.create(this.windowA.HTMLElement.prototype); - protoAV.createdCallback = created('document A\'s element V'); - this.documentA.registerElement('x-v', {prototype: protoAV}); - - var protoBV = Object.create(this.windowB.HTMLElement.prototype); - protoBV.createdCallback = created('document B\'s element V'); - this.documentB.registerElement('x-v', {prototype: protoBV}); - - var containerB = this.documentB.createElement('div'); - containerB.innerHTML = '<x-v data-doc="document B"></x-v>'; - var containerA = this.documentA.createElement('div'); - containerA.innerHTML = '<x-v data-doc="document A"></x-v>'; - - assert_array_equals( - invocations, - ['created document B\'s element V in document B', - 'created document A\'s element V in document A'], - 'should have invoked the created callbacks in reverse creation order'); - - assert_equals( - Object.getPrototypeOf(containerA.firstChild), - protoAV, - 'the prototype of element V in document A should be the prototype ' + - 'registered in document A'); - - assert_equals( - Object.getPrototypeOf(containerB.firstChild), - protoBV, - 'the prototype of element V in document B should be the prototype ' + - 'registered in document B'); -}; - -TestRegistrationContextIsolation.prototype. -testRegisterSameName_lazyWrappingShouldNotSharePrototypes = function () { - // Registering two different custom elements with the same tag - // name should not mix up prototypes. These do not have any - // callbacks, to try to tickle lazy wrapping. - - var protoAW = Object.create(this.windowA.HTMLElement.prototype); - this.documentA.registerElement('x-w', {prototype: protoAW}); - - var protoBW = Object.create(this.windowB.HTMLElement.prototype); - protoBW.createdCallback = function () {}; - this.documentB.registerElement('x-w', {prototype: protoBW}); - - var elementA = this.documentA.createElement('x-w'); - var elementB = this.documentB.createElement('x-w'); - - assert_equals( - Object.getPrototypeOf(elementB), protoBW, - 'the prototype of element W in document B should be the prototype ' + - 'registered in document B'); - - assert_equals( - Object.getPrototypeOf(elementA), protoAW, - 'the prototype of element W in document A should be the prototype ' + - 'registered in document A'); -}; - -(function () { - -var t = async_test('registration context should not be shared with an ' + - 'iframe\'s document'); - -withFrame(t.step_func(function (frameA) { - withFrame(t.step_func(function (frameB) { - var documentA = frameA.contentDocument; - var documentB = frameB.contentDocument; - var tester = new TestRegistrationContextIsolation( - frameA.contentWindow, frameA.contentDocument, - frameB.contentWindow, frameB.contentDocument); - tester.testRegistrationContextIsNotShared(); - frameA.remove(); - frameB.remove(); - t.done(); - })); -})); - -})(); - -(function () { - -var t = async_test('registration context should not be shared with the ' + - 'template document'); - -withFrame(t.step_func(function (frame) { - var documentA = frame.contentDocument; - documentA.body.innerHTML = '<template>foo</template>'; - var documentB = documentA.body.firstChild.content.ownerDocument; - var tester = new TestRegistrationContextIsolation( - frame.contentWindow, documentA, - frame.contentWindow, documentB); - tester.testRegistrationContextIsNotShared(); - frame.remove(); - t.done(); -})); - -})(); - -(function () { - -var t = async_test('registration context should not be created by ' + - 'DOMImplementation-created documents'); - -withFrame(t.step_func(function (frame) { - // Test transitively sloughing off a registration context through - // multiple createDocument/createHTMLDocument steps. - - var documentA = frame.contentDocument; - - // This document is not HTML, XHTML; it will not process custom elements. - var documentB = documentA.implementation.createDocument(null, ''); - assert_throws_dom( - 'NOT_SUPPORTED_ERR', - frame.contentWindow.DOMException, - function() { documentB.registerElement('x-a'); }); - - // This document will not process custom elements because there is - // nothing to inherit from B. - var documentC = documentB.implementation.createHTMLDocument(); - assert_throws_dom( - 'NOT_SUPPORTED_ERR', - frame.contentWindow.DOMException, - function() { documentC.registerElement('x-b'); }); - - // Nor this one. - var documentD = documentC.implementation.createDocument( - 'http://www.w3.org/1999/xhtml', 'html'); - assert_throws_dom( - 'NOT_SUPPORTED_ERR', - frame.contentWindow.DOMException, - function() { documentD.registerElement('x-c'); }); - - frame.remove(); - t.done(); -})); - -})(); - -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/registration-context-sharing.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/registration-context-sharing.html deleted file mode 100644 index 9a9e8f9f..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/registration-context-sharing.html +++ /dev/null
@@ -1,130 +0,0 @@ -<!DOCTYPE html> -<script src="../../../resources/testharness.js"></script> -<script src="../../../resources/testharnessreport.js"></script> -<script src="test-harness-utils.js"></script> -<body> -<script> -function TestRegistrationContextSharing(window, documentA, documentB) { - this.window = window; - this.documentA = documentA; - this.documentB = documentB; -} - -TestRegistrationContextSharing.prototype. -testRegistrationContextIsShared = function () { - this.testUpgrade_oneDefinitionShouldUpgradeMultipleDocuments(); - this.testRegisterInAInstantiateInB_shouldActivateDefinition(); -}; - -TestRegistrationContextSharing.prototype. -testUpgrade_oneDefinitionShouldUpgradeMultipleDocuments = function () { - var documentAUpgradeCandidate = this.documentA.createElement('x-u'); - documentAUpgradeCandidate.dataset.name = 'document A upgrade candidate'; - - var documentBUpgradeCandidate = this.documentB.createElement('x-u'); - documentBUpgradeCandidate.dataset.name = 'document B upgrade candidate'; - - var invocations = []; - function created() { - invocations.push('created ' + this.dataset.name + ' with prototype ' + - 'tagged ' + this.prototypeTag); - } - - var protoU = Object.create(this.window.HTMLElement.prototype); - protoU.prototypeTag = 'U'; - protoU.createdCallback = created; - this.documentB.registerElement('x-u', {prototype: protoU}); - - assert_array_equals( - invocations, - ['created document A upgrade candidate with prototype tagged U', - 'created document B upgrade candidate with prototype tagged U'], - 'the created callback should have been called for both elements ' + - 'in creation order'); -}; - -TestRegistrationContextSharing.prototype. -testRegisterInAInstantiateInB_shouldActivateDefinition = function () { - var invocations = []; - function created() { - invocations.push('created ' + this.dataset.name + ' with prototype ' + - 'tagged ' + this.prototypeTag); - } - - var protoV = Object.create(this.window.HTMLElement.prototype); - protoV.prototypeTag = 'V'; - protoV.createdCallback = created; - this.documentA.registerElement('x-v', {prototype: protoV}); - - var div = this.documentB.createElement('div'); - div.innerHTML = '<x-v data-name="document B element V"></x-v>'; - assert_array_equals( - invocations, - ['created document B element V with prototype tagged V'], - 'the created callback should have been called for the x-v element'); -}; - -(function () { - -var t = async_test('registration context is shared with some ' + - 'DOMImplementation-created documents'); - -withFrame(t.step_func(function (frame) { - var documentA = frame.contentDocument; - var documentB = documentA.implementation.createHTMLDocument(); - var tester = new TestRegistrationContextSharing( - frame.contentWindow, documentA, documentB); - tester.testRegistrationContextIsShared(); - frame.remove(); -})); - -withFrame(t.step_func(function (frame) { - var documentA = frame.contentDocument; - var documentB = documentA.implementation.createDocument( - 'http://www.w3.org/1999/xhtml', 'html'); - var tester = new TestRegistrationContextSharing( - frame.contentWindow, documentA, documentB); - tester.testRegistrationContextIsShared(); - frame.remove(); -})); - -withFrame(t.step_func(function (frame) { - var documentA = frame.contentDocument; - var documentB = documentA.implementation.createDocument( - 'http://www.w3.org/1999/xhtml', 'html'); - var documentC = documentB.implementation.createHTMLDocument(); - var tester = new TestRegistrationContextSharing( - frame.contentWindow, documentA, documentC); - tester.testRegistrationContextIsShared(); - frame.remove(); - t.done(); -})); - -})(); - -(function () { - -var t = async_test('registration context is shared with imported documents'); -var link; -var documentA; - -withFrame(t.step_func(function (frame) { - documentA = frame.contentDocument; - - link = documentA.createElement('link'); - link.rel = 'import'; - link.href = 'resources/empty-document.html'; - link.onload = t.step_func(function () { - var documentB = link.import; - var tester = new TestRegistrationContextSharing(window, - documentA, documentB); - tester.testRegistrationContextIsShared(); - t.done(); - }); - - documentA.head.appendChild(link); -})); - -})(); - -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/reparent-unwrapped-custom-element-crash-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/reparent-unwrapped-custom-element-crash-expected.txt deleted file mode 100644 index e094f8f..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/reparent-unwrapped-custom-element-crash-expected.txt +++ /dev/null
@@ -1,6 +0,0 @@ -CONSOLE WARNING: line 4: document.registerElement is deprecated and will be removed in M80, around February 2020. Please use window.customElements.define instead. See https://www.chromestatus.com/features/4642138092470272 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -PASS successfullyParsed is true - -TEST COMPLETE - -If this doesn't crash, it passed.
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/reparent-unwrapped-custom-element-crash.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/reparent-unwrapped-custom-element-crash.html deleted file mode 100644 index 2d8e42b..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/reparent-unwrapped-custom-element-crash.html +++ /dev/null
@@ -1,20 +0,0 @@ -<script src="../../../resources/js-test.js"></script> -<body> -If this doesn't crash, it passed. -<iframe id=iframe src=resources/empty-custom-body.html></iframe> -</body> -<script> -window.jsTestIsAsync = true; - -if (window.testRunner) - testRunner.dumpAsText(); - -iframe.onload = function() { - document.body.appendChild(iframe.contentDocument.documentElement); - document.querySelector('#thebody'); - iframe.remove(); - finishJSTest(); -}; - -successfullyParsed = true; -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/resources/document-register-fuzz.js b/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/resources/document-register-fuzz.js deleted file mode 100644 index db4ba33..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/resources/document-register-fuzz.js +++ /dev/null
@@ -1,54 +0,0 @@ - -function setupObjectHooks(hooks) -{ - // Wrapper for these object should be materialized before setting hooks. - console.log; - document.register; - HTMLSpanElement.prototype; - - Object.defineProperty(Object.prototype, "prototype", { - get: function() { return hooks.prototypeGet(); }, - set: function(value) { return hooks.prototypeSet(value); } - }); - - Object.defineProperty(Object.prototype, "constructor", { - get: function() { return hooks.constructorGet(); }, - set: function(value) { return hooks.constructorSet(value); } - }); - - return hooks; -} - -function exerciseDocumentRegister() -{ - register('x-a', {}); - register('x-b', {prototype: Object.create(HTMLElement.prototype)}); -} - -function register(name, options) -{ - var myConstructor = null; - try { - myConstructor = document.registerElement(name, options); - } catch (e) { } - - try { - if (!myConstructor) { - debug("Constructor object isn't created."); - return; - } - - if (options.prototype !== undefined && myConstructor.prototype != options.prototype) { - console.log("FAIL: bad prototype"); - return; - } - - var element = new myConstructor(); - if (!element) - return; - if (element.constructor != myConstructor) { - console.log("FAIL: bad constructor"); - return; - } - } catch (e) { console.log(e); } -}
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/resources/empty-custom-body.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/resources/empty-custom-body.html deleted file mode 100644 index 6dc790f..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/resources/empty-custom-body.html +++ /dev/null
@@ -1,8 +0,0 @@ -<!DOCTYPE html> -<script> -var proto = Object.create(HTMLBodyElement.prototype); -document.registerElement('x-body', {prototype: proto, extends: 'body'}); -</script> - -<body id="thebody" is="x-body"> -</body>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/resources/empty-document.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/resources/empty-document.html deleted file mode 100644 index 38ef8eb..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/resources/empty-document.html +++ /dev/null
@@ -1,2 +0,0 @@ -<!DOCTYPE html> -
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/resources/import-block-upgrade-in-client-child.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/resources/import-block-upgrade-in-client-child.html deleted file mode 100644 index a5b0db2..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/resources/import-block-upgrade-in-client-child.html +++ /dev/null
@@ -1,15 +0,0 @@ -<!DOCTYPE html> -<script> -(function() { - var proto = Object.create(HTMLElement.prototype); - proto.createdCallback = function () { - window.upgradeIds.push(this.id); - }; - - var ctor = document.registerElement('x-a', {prototype: proto}); -})(); - -test(function () { - assert_array_equals(window.upgradeIds, ['a1'], "This import shouldn't upgrade elements built by overrunning parser."); -}, 'upgrade in an import'); -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/resources/import-block-upgrade-in-import-child.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/resources/import-block-upgrade-in-import-child.html deleted file mode 100644 index e6e3d49..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/resources/import-block-upgrade-in-import-child.html +++ /dev/null
@@ -1,22 +0,0 @@ -<!DOCTYPE html> -<x-a id="a2"></x-a> -<script> -(function() { - var proto = Object.create(HTMLElement.prototype); - proto.createdCallback = function () { - window.upgradeIds.push(this.id); - }; - - var ctor = document.registerElement('x-a', {prototype: proto}); -})(); - -test(function () { - assert_array_equals(window.upgradeIds, ['a1', 'a2'], 'Elements in an import should be upgraded by a definition in the import.'); -}, 'upgrade in an import (in import)'); -</script> -<x-a id="a3"></x-a> -<x-b id="b0"></x-b> -<link rel="import" href="import-block-upgrade-in-import-grandchild.html"> -<x-a id="a4"></x-a> -<x-b id="b3"></x-b> -
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/resources/import-block-upgrade-in-import-grandchild.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/resources/import-block-upgrade-in-import-grandchild.html deleted file mode 100644 index 3d97e86..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/resources/import-block-upgrade-in-import-grandchild.html +++ /dev/null
@@ -1,17 +0,0 @@ -<!DOCTYPE html> -<x-b id="b1"></x-b> -<script> -(function() { - var proto = Object.create(HTMLElement.prototype); - proto.createdCallback = function () { - window.upgradeIds.push(this.id); - }; - - var ctor = document.registerElement('x-b', {prototype: proto}); -})(); - -test(function () { - assert_array_equals(window.upgradeIds, ['a1', 'a2', 'a3', 'b0', 'b1'], 'Elements should got upgrade from the import.'); -}, 'upgrade in an import (in nested import)'); -</script> -<x-b id="b2"></x-b>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/resources/import-custom-element-abort-child.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/resources/import-custom-element-abort-child.html deleted file mode 100644 index b1bfbb3..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/resources/import-custom-element-abort-child.html +++ /dev/null
@@ -1,20 +0,0 @@ -<!DOCTYPE html> -<script> -(function() { - var proto = Object.create(HTMLElement.prototype); - proto.createdCallback = function () { - if (this.id == 'abortIt') { - window.parent.checkLater(); - var e = window.frameElement - e.parentNode.removeChild(e); - } - }; - - var ctor = document.registerElement('x-a', {prototype: proto}); -})(); -</script> -<x-a></x-a> -<x-a></x-a> -<x-a id="abortIt"></x-a> -<x-a></x-a> -<x-a></x-a>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/resources/import-custom-element-abort-parent.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/resources/import-custom-element-abort-parent.html deleted file mode 100644 index 3203a60..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/resources/import-custom-element-abort-parent.html +++ /dev/null
@@ -1,6 +0,0 @@ -<!DOCTYPE html> -<link rel="import" href="import-custom-element-abort-child.html"> -<body> -<script> -</script> -</body>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/svg-use-shadow-tree-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/svg-use-shadow-tree-expected.txt deleted file mode 100644 index 8d0ff7226f..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/svg-use-shadow-tree-expected.txt +++ /dev/null
@@ -1,5 +0,0 @@ -CONSOLE WARNING: line 71: document.registerElement is deprecated and will be removed in M80, around February 2020. Please use window.customElements.define instead. See https://www.chromestatus.com/features/4642138092470272 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -This is a testharness.js-based test. -FAIL SVG <use> shadow trees should not be exposed through custom elements. assert_false: Should not call createdCallback in UA ShadowRoot. expected false got true -Harness: the test ran to completion. -
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/svg-use-shadow-tree.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/svg-use-shadow-tree.html deleted file mode 100644 index 8ebf7f12..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/svg-use-shadow-tree.html +++ /dev/null
@@ -1,115 +0,0 @@ -<!DOCTYPE html> -<script src="../../../resources/testharness.js"></script> -<script src="../../../resources/testharnessreport.js"></script> - -<template id="template"> -<svg> - <defs> - <g id="used-group"> - <rect - id="rect" - is="x-rect" - x="10" y="10" - width="100" height="100" - fill="red"/> - </g> - </defs> - <use xlink:href="#used-group"/> -</svg> -</template> - -<div id="container"></div> - -<script> -"use strict"; - -var t = async_test("SVG <use> shadow trees should not be exposed through custom elements."); - -var instances = []; - -function createPrototype(superClass) { - class ElementType extends superClass { - get ownerScope() { - var scope = this.parentNode; - while (scope && scope.parentNode) - scope = scope.parentNode; - return scope; - } - createdCallback() { - t.step(() => { - this.instanceId = instances.length; - instances[this.instanceId] = this; - assert_false(this.ownerScope instanceof ShadowRoot, - "Should not call createdCallback in UA ShadowRoot."); - }); - } - attachedCallback() { - t.step(() => { - assert_false(this.ownerScope instanceof ShadowRoot, - "Should not call attachedCallback in UA ShadowRoot."); - assert_equals(instances[this.instanceId], this); - }); - } - detachedCallback() { - t.step(() => { - assert_false(this.ownerScope instanceof ShadowRoot, - "Should not call detachedCallback in UA ShadowRoot."); - assert_equals(instances[this.instanceId], this); - }); - } - attributeChangedCallback() { - t.step(() => { - assert_unreached("attributeChangedCallback should never be called."); - }); - } - }; - return ElementType.prototype; -} - -t.step(function () { - // <rect is=x-rect> - var XRectElement = document.registerElement('x-rect', { - extends: 'rect', - prototype: createPrototype(SVGRectElement), - }); - - // <x-test> - var XTestElement = document.registerElement('x-test', { - prototype: createPrototype(HTMLElement), - }); - - var template = document.getElementById("template"); - var svg = document.importNode(template.content, true).firstElementChild; - var usedGroup = svg.getElementById("used-group"); - document.body.appendChild(svg); - - // Force a recreation of the use trees. - document.body.offsetTop; - assert_array_equals([usedGroup.firstElementChild], instances); - - var elements = [ - usedGroup.firstElementChild, - new XRectElement(), - new XTestElement(), - new XRectElement(), - ]; - - // Add another <rect is=x-rect>, and a child <x-test> that also contains one. - usedGroup.appendChild(elements[1]); - var test = usedGroup.appendChild(elements[2]); - test.appendChild(elements[3]); - - // Force a recreation of the use trees. - document.body.offsetTop; - assert_array_equals(elements, instances); - - for (var i = 0; i < instances.length; ++i) { - assert_true(instances[i].ownerScope instanceof Document, - "No instances should be inside a ShadowRoot."); - } - - // Any callbacks will have been scheduled and run in microtasks, - // so end test after that. - t.step_timeout(t.step_func_done()); -}); -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/test-harness-utils.js b/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/test-harness-utils.js deleted file mode 100644 index ddfbe368..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/test-harness-utils.js +++ /dev/null
@@ -1,12 +0,0 @@ -// Creates a frame and invokes f when the frame is ready. -window.withFrame = function (opt_url, f) { - var url = typeof opt_url == 'string' ? opt_url : 'about:blank'; - f = f || opt_url; - - var frame = document.createElement('iframe'); - frame.onload = function () { - f(frame); - }; - frame.src = url; - document.body.appendChild(frame); -};
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/testutils.js b/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/testutils.js deleted file mode 100644 index 3b267c4..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/testutils.js +++ /dev/null
@@ -1,59 +0,0 @@ -(function () { - -function isParentFrame() { - return window.parent === window; -} - -var childDoneMessage = 'PASS child done'; - -fork = function () { - if (isParentFrame()) { - window.addEventListener('message', function (event) { - debug(event.data); - if (event.data == childDoneMessage) - finishJSTest(); - }); - - var iframe = document.createElement('iframe'); - iframe.src = window.location; - document.body.appendChild(iframe); - iframe = null; - } - - return isParentFrame(); -}; - -if (!isParentFrame()) { - var parent = window.parent; - log = function (msg) { - parent.postMessage(msg, '*'); - }; - - done = function () { - log(childDoneMessage); - }; - - destroyContext = function () { - // This function can be called more than once so we need to check whether the iframe exists. - var frame = parent.document.querySelector('iframe'); - if (frame) { - frame.remove(); - log('PASS destroyed context'); - } - }; -} - -withFrame = function (f) { - var frame = document.createElement('iframe'); - frame.onload = function () { - try { - f(frame); - } catch (e) { - testFailed(e); - } - }; - frame.src = 'about:blank'; - document.body.appendChild(frame); -}; - -})();
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/type-extension-is-null.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/type-extension-is-null.html deleted file mode 100644 index 263b608..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/type-extension-is-null.html +++ /dev/null
@@ -1,15 +0,0 @@ -<!DOCTYPE html> -<script src="../../../resources/testharness.js"></script> -<script src="../../../resources/testharnessreport.js"></script> -<body> -<script> -test(function() { - var A = document.registerElement('x-foo', {extends: null, prototype: null}); - assert_equals(new A().outerHTML, '<x-foo></x-foo>', - 'localName should not be "null" and type extension should not have "is" attribute'); - - assert_equals(new A().localName, 'x-foo', - 'localName should be set to TYPE if extends is null'); - -}, 'type extension from null should be treated as if "extends" is not given'); -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/type-extension-undo-assert-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/type-extension-undo-assert-expected.txt deleted file mode 100644 index 89e1131..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/type-extension-undo-assert-expected.txt +++ /dev/null
@@ -1,10 +0,0 @@ -Tests that execCommand undo doesn't hork custom elements - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - -PASS did not crash -PASS successfullyParsed is true - -TEST COMPLETE - -Hello, world!
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/type-extension-undo-assert.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/type-extension-undo-assert.html deleted file mode 100644 index f21c42e..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/type-extension-undo-assert.html +++ /dev/null
@@ -1,21 +0,0 @@ -<!DOCTYPE html> -<script src="../../../resources/js-test.js"></script> -<div id="test" contenteditable><b is="x-a" style="font-style: italic;">Hello, world!</b></div> -<script> -// This test is based on -// editing/undo/replace-by-span-then-remove.html. Fuzzing tickled an -// assert; this is the reduced test case. Bolding will swap the B for -// a SPAN; undoing and redoing the command will reapply the "is" -// attribute to the original custom element. - -description('Tests that execCommand undo doesn\'t hork custom elements'); - -var test = document.getElementById('test'); -window.getSelection().selectAllChildren(test); -document.execCommand('bold', false, null); -document.execCommand('undo', false, null); -document.execCommand('undo', false, null); - -testPassed('did not crash'); -var successfullyParsed = true; -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/type-extensions.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/type-extensions.html deleted file mode 100644 index f471ca14..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/type-extensions.html +++ /dev/null
@@ -1,70 +0,0 @@ -<!DOCTYPE html> -<script src="../../../resources/testharness.js"></script> -<script src="../../../resources/testharnessreport.js"></script> -<body> -<script> -var outerHTML = Object.getOwnPropertyDescriptor(Element.prototype, 'outerHTML'); -var tagName = Object.getOwnPropertyDescriptor(Element.prototype, 'tagName'); - -test(function() { - var p = Object.create(HTMLDivElement.prototype); - var C = document.registerElement('x-div', {extends: 'div', prototype: p}); - assert_equals(new C().outerHTML, '<div is="x-div"></div>', - 'type extensions should have an "is" attribute'); - assert_equals(new C().tagName, 'DIV', - 'tag name should be that of the base element'); -}, 'register a type extension'); - -test(function() { - var p = Object.create(Window.prototype); - var C = document.registerElement('x-em', {extends: 'em', prototype: p}); - var e = new C(); - Node.prototype.appendChild.call(e, document.createTextNode('Hi!')); - assert_equals(outerHTML.get.call(e), '<em is="x-em">Hi!</em>', - 'the type extension must not depend on the author-' + - 'specified prototype'); -}, 'register a type extension with a non-element prototype'); - -test(function() { - var p = Object.create(HTMLUnknownElement.prototype); - var C = document.registerElement('x-unknown', {extends: 'unknown', prototype: p}); - assert_equals(new C().outerHTML, '<unknown is="x-unknown"></unknown>'); -}, 'register a type extension of an unknown element'); - -test(function() { - // registering an SVG element requires an SVGElement prototype - var p = Object.create(SVGElement.prototype); - var C = document.registerElement('x-use', {extends: 'use', prototype: p}); - assert_equals(new C().namespaceURI, 'http://www.w3.org/2000/svg', - 'SVG type extensions should have the SVG namespace'); -}, 'register a type extension of an SVG element'); - -test(function() { - var p = Object.create(HTMLElement.prototype); - var C = document.registerElement('x-sect', {extends: 'section', prototype: p}); - assert_equals(new C().outerHTML, '<section is="x-sect"></section>'); -}, 'register a type extension of an element whose interface is HTMLElement'); - -test(function() { - var C = document.registerElement('x-augment', {extends: 'ins', prototype: {}}); - assert_equals(outerHTML.get.call(new C()), '<ins is="x-augment"></ins>'); - var D = document.registerElement('x-elide', {extends: 'del', prototype: {}}); - assert_equals(outerHTML.get.call(new D()), '<del is="x-elide"></del>'); -}, 'register a type extensions of an interface with multiple element names'); - -test(function() { - var C = document.registerElement('x-ins', {extends: 'InS', prototype: {}}); - assert_equals(tagName.get.call(new C()), 'INS', - 'tag name should be that of the base element'); -}, 'register a type extension with unusual case'); - -test(function() { - assert_throws_dom( - 'NOT_SUPPORTED_ERR', - function() { - var p = Object.create(HTMLElement.prototype); - document.registerElement('x-bespoke', {extends: 'x-spoke', prototype: p}); - }, - 'registering a type extension of a custom tag should fail'); -}, 'registering a type extension of a custom tag should fail'); -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/unresolved-pseudoclass-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/unresolved-pseudoclass-expected.txt deleted file mode 100644 index 99d4537..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/unresolved-pseudoclass-expected.txt +++ /dev/null
@@ -1,18 +0,0 @@ -CONSOLE WARNING: line 18: :unresolved pseudo selector is deprecated and will be removed in M80, around February 2020. Please use :not(:defined) instead. See https://www.chromestatus.com/features/4642138092470272 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -CONSOLE WARNING: line 34: document.registerElement is deprecated and will be removed in M80, around February 2020. Please use window.customElements.define instead. See https://www.chromestatus.com/features/4642138092470272 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -Tests the :unresolved pseudoclass. - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - -PASS document.querySelector("x-x:unresolved") is a -PASS window.getComputedStyle(a).color is "rgb(0, 0, 222)" -PASS window.getComputedStyle(b).color is "rgb(0, 0, 222)" -PASS window.getComputedStyle(b).borderColor is "rgb(0, 0, 111)" -PASS window.getComputedStyle(c).color is "rgb(0, 222, 0)" -PASS window.getComputedStyle(a).color is "rgb(0, 222, 0)" -PASS window.getComputedStyle(d).color is "rgb(0, 111, 0)" -PASS window.getComputedStyle(b).color is "rgb(0, 111, 0)" -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/unresolved-pseudoclass.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/unresolved-pseudoclass.html deleted file mode 100644 index dab422ff..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/unresolved-pseudoclass.html +++ /dev/null
@@ -1,51 +0,0 @@ -<!DOCTYPE html> -<style> -x-x { - color: rgb(0, 222, 0); -} - -[is=x-y]:not(:unresolved) { - color: rgb(0, 111, 0); -} - -:unresolved { - color: rgb(0, 0, 222); -} - -[is=x-y]:unresolved { - border-color: rgb(0, 0, 111); -} -</style> -<script src="../../../resources/js-test.js"></script> -<div id="container"></div> -<x-x id="a"></x-x> -<span id="b" is="x-y"></span> -<script> -description('Tests the :unresolved pseudoclass.'); - -var a = document.querySelector('#a'); -shouldBe('document.querySelector("x-x:unresolved")', 'a'); -shouldBe('window.getComputedStyle(a).color', '"rgb(0, 0, 222)"'); - -var b = document.querySelector('#b'); -shouldBe('window.getComputedStyle(b).color', '"rgb(0, 0, 222)"'); -shouldBe('window.getComputedStyle(b).borderColor', '"rgb(0, 0, 111)"'); - -var X = document.registerElement('x-x', {prototype: Object.create(HTMLElement.prototype)}); -var c = new X(); -document.body.insertBefore(c, b); -shouldBe('window.getComputedStyle(c).color', '"rgb(0, 222, 0)"'); - -// Registering x-x should have changed the styles of #a. -shouldBe('window.getComputedStyle(a).color', '"rgb(0, 222, 0)"'); - -var Y = document.registerElement('x-y', {extends: 'span', prototype: Object.create(HTMLSpanElement.prototype)}); -var d = new Y(); -document.body.insertBefore(d, b); -shouldBe('window.getComputedStyle(d).color', '"rgb(0, 111, 0)"'); - -// Registering is="x-y" should have changed the styles of #b. -shouldBe('window.getComputedStyle(b).color', '"rgb(0, 111, 0)"'); - -successfullyParsed = true; -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/upgrade-candidate-adopt-crash-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/upgrade-candidate-adopt-crash-expected.txt deleted file mode 100644 index 117135f..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/upgrade-candidate-adopt-crash-expected.txt +++ /dev/null
@@ -1,10 +0,0 @@ -CONSOLE WARNING: line 27: document.registerElement is deprecated and will be removed in M80, around February 2020. Please use window.customElements.define instead. See https://www.chromestatus.com/features/4642138092470272 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -Tests that an element is not upgraded after being moved to a different document, then destroyed - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - -PASS Did not crash. -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/upgrade-candidate-adopt-crash.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/upgrade-candidate-adopt-crash.html deleted file mode 100644 index b8090de..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/upgrade-candidate-adopt-crash.html +++ /dev/null
@@ -1,36 +0,0 @@ -<!DOCTYPE html> -<script src="../../../resources/js-test.js"></script> -<script src="testutils.js"></script> -<body> -<script> -description('Tests that an element is not upgraded after being moved to ' + - 'a different document, then destroyed'); - -jsTestIsAsync = true; - -withFrame(function (frame) { - // Create an upgrade candidate. Don't wrap it. - var div = document.createElement('div'); - div.innerHTML = '<span is="x-a"></span>'; - - // Move the upgrade candidate to a different document. - frame.contentDocument.body.appendChild(div); - - // Delete the upgrade candidate. - div.innerHTML = ''; - - // Provide a definition that would have matched. - var proto = Object.create(HTMLSpanElement.prototype); - proto.createdCallback = function () { - testFailed('unreachable'); - }; - document.registerElement('x-a', {prototype: proto}); - - testPassed('Did not crash.'); - - frame.remove(); - finishJSTest(); -}); - -successfullyParsed = true; -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/upgrade-candidate-remove-crash-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/upgrade-candidate-remove-crash-expected.txt deleted file mode 100644 index 1db6c1e3..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/upgrade-candidate-remove-crash-expected.txt +++ /dev/null
@@ -1,10 +0,0 @@ -CONSOLE WARNING: line 19: document.registerElement is deprecated and will be removed in M80, around February 2020. Please use window.customElements.define instead. See https://www.chromestatus.com/features/4642138092470272 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -Tests that an element is not upgraded after being destroyed - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - -PASS Did not crash. -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/upgrade-candidate-remove-crash.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/upgrade-candidate-remove-crash.html deleted file mode 100644 index 95f4411..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-custom/upgrade-candidate-remove-crash.html +++ /dev/null
@@ -1,24 +0,0 @@ -<!DOCTYPE html> -<script src="../../../resources/js-test.js"></script> -<body> -<script> -description('Tests that an element is not upgraded after being destroyed'); - -// Create an upgrade candidate. Don't wrap it. -var div = document.createElement('div'); -div.innerHTML = '<span is="x-a"></span>'; - -// Delete the upgrade candidate. -div.innerHTML = ''; - -// Provide a definition that would have matched. -var proto = Object.create(HTMLSpanElement.prototype); -proto.createdCallback = function () { - testFailed('unreachable'); -}; -document.registerElement('x-a', {prototype: proto}); - -testPassed('Did not crash.'); - -successfullyParsed = true; -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/adopt-node-with-shadow-root-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/adopt-node-with-shadow-root-expected.txt deleted file mode 100644 index 3adc17f..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/adopt-node-with-shadow-root-expected.txt +++ /dev/null
@@ -1,6 +0,0 @@ -CONSOLE WARNING: line 12: Element.createShadowRoot is deprecated and will be removed in M80, around February 2020. Please use Element.attachShadow instead. See https://www.chromestatus.com/features/4507242028072960 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -PASS successfullyParsed is true - -TEST COMPLETE - -PASS document.adoptNode(shadow) threw exception HierarchyRequestError: Failed to execute 'adoptNode' on 'Document': The node provided is a shadow root, which may not be adopted..
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/adopt-node-with-shadow-root.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/adopt-node-with-shadow-root.html deleted file mode 100644 index 31f32f66..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/adopt-node-with-shadow-root.html +++ /dev/null
@@ -1,17 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script src="../../../resources/js-test.js"></script> -</head> -<body> -<div id="console"></div> -<object data="resources/svg_placeholder.svg" id="root" onload="test()"/> -<script> -function test() { - var foreignDocument = document.getElementById('root').contentDocument; - shadow = foreignDocument.getElementById('s').createShadowRoot(); - shouldThrow("document.adoptNode(shadow)"); -} -</script> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/anchor-content-projected-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/anchor-content-projected-expected.txt deleted file mode 100644 index fa5cec05..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/anchor-content-projected-expected.txt +++ /dev/null
@@ -1,12 +0,0 @@ -CONSOLE WARNING: line 27: Element.createShadowRoot is deprecated and will be removed in M80, around February 2020. Please use Element.attachShadow instead. See https://www.chromestatus.com/features/4507242028072960 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -Links should be clickable even when their content is projected into them. - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - -Cursor Info: type=Hand -PASS window.location.hash is "#link-clicked" -PASS successfullyParsed is true - -TEST COMPLETE - -Example link
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/anchor-content-projected.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/anchor-content-projected.html deleted file mode 100644 index 6a307e5..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/anchor-content-projected.html +++ /dev/null
@@ -1,44 +0,0 @@ -<!DOCTYPE html> - -<script> - window.jsTestIsAsync = true; -</script> -<script src="../../../resources/js-test.js"></script> - -<style> - * { - margin: 0; - padding: 0; - } - - #host { - position: absolute; - top: 0; - left: 0; - } -</style> - -<div id="host">Example link</div> - -<script> -description("Links should be clickable even when their content is projected into them."); - -var host = document.getElementById("host"); -var shadow = host.createShadowRoot(); -shadow.innerHTML = '<a href="#link-clicked"><content></content></a>'; - -window.onload = function() { - if (window.eventSender) { - eventSender.mouseMoveTo(0, 0); - eventSender.mouseDown(); - eventSender.mouseUp(); - } -}; - -window.onhashchange = function() { - if (window.internals) - debug('Cursor Info: ' + internals.getCurrentCursorInfo()); - shouldBeEqualToString("window.location.hash", "#link-clicked"); - finishJSTest(); -}; -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/apply-deep-in-document-scope-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/apply-deep-in-document-scope-expected.txt deleted file mode 100644 index c6891e7..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/apply-deep-in-document-scope-expected.txt +++ /dev/null
@@ -1,11 +0,0 @@ -CONSOLE WARNING: /deep/ combinator is no longer supported in CSS dynamic profile. It is now effectively no-op, acting as if it were a descendant combinator. /deep/ combinator will be removed, and will be invalid at M65. You should remove it. See https://www.chromestatus.com/features/4964279606312960 for more details. -/deep/ as a descendant selector in document without shadow trees. - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - -PASS getComputedStyle(inner).color is "rgb(0, 128, 0)" -PASS successfullyParsed is true - -TEST COMPLETE - -This text should be green
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/apply-deep-in-document-scope.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/apply-deep-in-document-scope.html deleted file mode 100644 index 4421f5e..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/apply-deep-in-document-scope.html +++ /dev/null
@@ -1,11 +0,0 @@ -<!DOCTYPE html> -<script src="../../../resources/js-test.js"></script> -<style>div /deep/ #inner { color: green }</style> -<div> - <div id="inner">This text should be green</div> -</div> -<script> - description("/deep/ as a descendant selector in document without shadow trees."); - - shouldBeEqualToString("getComputedStyle(inner).color", "rgb(0, 128, 0)"); -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/attr-dir-inherit-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/attr-dir-inherit-expected.txt deleted file mode 100644 index efdc59b5..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/attr-dir-inherit-expected.txt +++ /dev/null
@@ -1,9 +0,0 @@ -This is a testharness.js-based test. -PASS dir=rtl inherits into shadow trees -FAIL dir=rtl applies to the distributed content assert_equals: dir=rtl should be right-to-left expected "rgb(0, 128, 0)" but got "rgb(255, 0, 0)" -FAIL dir=rtl applies to the distributed content (multiple levels) assert_equals: dir=rtl should be right-to-left expected "rgb(0, 128, 0)" but got "rgb(255, 0, 0)" -PASS dir=auto the first character in the shadow trees -FAIL dir=auto the first character in the distributed content assert_equals: Hebrew text should be right-to-left expected "rgb(0, 128, 0)" but got "rgb(255, 0, 0)" -FAIL dir=auto the first character in the distributed content with multiple levels of shadow roots assert_equals: Hebrew text should be right-to-left expected "rgb(0, 128, 0)" but got "rgb(255, 0, 0)" -Harness: the test ran to completion. -
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/attr-dir-inherit.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/attr-dir-inherit.html deleted file mode 100644 index 477d17a..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/attr-dir-inherit.html +++ /dev/null
@@ -1,136 +0,0 @@ -<!DOCTYPE html> -<meta charset="utf-8"> -<script src="../../../resources/testharness.js"></script> -<script src="../../../resources/testharnessreport.js"></script> -<script src="../../../shadow-dom/resources/shadow-dom.js"></script> -<script src="resources/shadow-dom.js"></script> -<div id="container"> - <h2>dir=rtl inherits into shadow trees</h2> - <div id="dir-rtl-inherits" dir="rtl" data-dir-expected="rtl"> - <template> - <div id="target">The dir=rtl of host should inherit to shadow trees</div> - </template> - </div> - <div> - <div id="dir-rtl-distributed" data-dir-expected="rtl">dir=rtl in shadow trees apply to distributed content</div> - <template> - <div dir="rtl"><content></content></div> - </template> - </div> - <div> - <div id="dir-rtl-redistributed-multilevel" data-dir-expected="rtl">dir=rtl in shadow trees apply to distributed content</div> - <template> - <div> - <content></content> - <template> - <div dir="rtl"><content></content></div> - </template> - </div> - </template> - </div> - - <h2>dir=auto determines the first character in the flat tree</h2> - <div id="dir-auto-english" dir="auto" data-dir-expected="ltr"> - <template>English text</template> - </div> - <div id="dir-auto-hebrew" dir="auto" data-dir-expected="rtl"> - <template>מקור השם עברית</template> - </div> - <div id="dir-auto-hebrew-span" dir="auto" data-dir-expected="rtl"> - <template><span>מקור השם עברית</span></template> - </div> - <div id="dir-auto-distributed-english" dir="auto" data-dir-expected="ltr"> - <span>מקור השם עברית</span> - <span id="e">English text</span> - <template> - <content select="#e"></content> - </template> - </div> - <div id="dir-auto-distributed-hebrew" dir="auto" data-dir-expected="rtl"> - <span>English text</span> - <span id="h">מקור השם עברית</span> - <template> - <content select="#h"></content> - </template> - </div> - <div id="dir-auto-multilevel-english" dir="auto" data-dir-expected="ltr"> - <span>מקור השם עברית</span> - <span id="e">English text</span> - <template> - <div> - <content></content> - <template> - <content select="#e"></content> - </template> - </div> - </template> - </div> - <div id="dir-auto-multilevel-hebrew" dir="auto" data-dir-expected="rtl"> - <span>English text</span> - <span id="h">מקור השם עברית</span> - <template> - <div> - <content></content> - <template> - <content select="#h"></content> - </template> - </div> - </template> - </div> -</div> -<script> -convertTemplatesToShadowRootsWithin(container); - -// Test dir="rtl" inherits in shadow trees - -test(function () { - assert_direction("dir=rtl", getNodeInComposedTree("dir-rtl-inherits/target")); -}, "dir=rtl inherits into shadow trees"); - -test(function () { - assert_direction("dir=rtl", getNodeInComposedTree("dir-rtl-distributed")); -}, "dir=rtl applies to the distributed content"); - -test(function () { - assert_direction("dir=rtl", getNodeInComposedTree("dir-rtl-redistributed-multilevel")); -}, "dir=rtl applies to the distributed content (multiple levels)"); - -// Test dir="auto" inherits in shadow trees -// dir="auto" calculates the directionality by the first character - -test(function () { - assert_direction("English text", getNodeInComposedTree("dir-auto-english")); - assert_direction("Hebrew text", getNodeInComposedTree("dir-auto-hebrew")); - assert_direction("Hebrew text", getNodeInComposedTree("dir-auto-hebrew-span")); -}, "dir=auto the first character in the shadow trees"); - -test(function () { - assert_direction("English text", getNodeInComposedTree("dir-auto-distributed-english")); - assert_direction("Hebrew text", getNodeInComposedTree("dir-auto-distributed-hebrew")); -}, "dir=auto the first character in the distributed content"); - -test(function () { - assert_direction("English text", getNodeInComposedTree("dir-auto-multilevel-english")); - assert_direction("Hebrew text", getNodeInComposedTree("dir-auto-multilevel-hebrew")); -}, "dir=auto the first character in the distributed content with multiple levels of shadow roots"); - -function assert_direction(description, elementToTest) { - elementToTest.style.borderInlineStart = "5px solid green"; - elementToTest.style.borderInlineEnd = "5px solid red"; - var actualColor = document.defaultView.getComputedStyle(elementToTest).getPropertyValue("border-right-color"); - var dirExpected = elementToTest.dataset.dirExpected; - switch (dirExpected) { - case "ltr": - assert_equals(actualColor, "rgb(255, 0, 0)", description + " should be left-to-right"); - break; - case "rtl": - assert_equals(actualColor, "rgb(0, 128, 0)", description + " should be right-to-left"); - break; - default: - break; - } -} - -if (window.testRunner) - container.style.display = "none"; -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/cascade-of-treeboundary-crossing-rules-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/cascade-of-treeboundary-crossing-rules-expected.txt deleted file mode 100644 index 6983829..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/cascade-of-treeboundary-crossing-rules-expected.txt +++ /dev/null
@@ -1,11 +0,0 @@ -CONSOLE WARNING: line 87: Element.createShadowRoot is deprecated and will be removed in M80, around February 2020. Please use Element.attachShadow instead. See https://www.chromestatus.com/features/4507242028072960 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -Test for casacde of treeboundary crossing rules. - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - -PASS borderColorOf(getNodeInComposedTree("target")) is "rgb(0, 128, 0)" -PASS borderColorOf(getNodeInComposedTree("host/target")) is "rgb(0, 128, 0)" -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/cascade-of-treeboundary-crossing-rules.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/cascade-of-treeboundary-crossing-rules.html deleted file mode 100644 index 9a99e34..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/cascade-of-treeboundary-crossing-rules.html +++ /dev/null
@@ -1,77 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script src="resources/shadow-dom.js"></script> -<script src="../../../resources/js-test.js"></script> -</head> -<body> - <div id='sandbox'></div> - <pre id='console'></pre> -</body> -<script> -var borderColor; - -function borderColorOf(node) -{ - return document.defaultView.getComputedStyle(node, null).getPropertyValue('border-color'); -} - -function borderColorShouldBe(selector, color) -{ - var text = 'borderColorOf(getNodeInComposedTree("' + selector + '"))'; - shouldBeEqualToString(text, color); -} - -function borderColorShouldNotBe(selector, color) -{ - var text = 'borderColorOf(getNodeInComposedTree("' + selector + '"))'; - var unevaledString = '"' + color.replace(/\\/g, "\\\\").replace(/"/g, "\"") + '"'; - shouldNotBe(text, unevaledString); -} - -function cleanUp() -{ - document.getElementById('sandbox').innerHTML = ''; -} - -description('Test for casacde of treeboundary crossing rules.'); - -// Rules declared in inner treescope should win. -// TODO: V1 inverts this order. -sandbox.appendChild( - createDOM('div', {'id': 'host'}, - createDOM('style', {}, - document.createTextNode('p:empty { border: 1px solid blue; }')), - createShadowRoot( - createDOM('style', {}, - document.createTextNode('::content > p { border: 1px solid red; }')), - createDOM('div', {}, - createShadowRoot( - createDOM('style', {}, - document.createTextNode('::content > p { border: 1px solid green; }')), - createDOM('content', {})), - createDOM('content', {}))), - createDOM('p', {'id': 'target'}))); - -borderColorShouldBe('target', 'rgb(0, 128, 0)'); - -cleanUp(); - -// Comparing important rules declared in outer treescope with important rules declared in inner treescope. -// Inner's should win. -sandbox.appendChild( - createDOM('div', {}, - createDOM('style', {}, - document.createTextNode('div { border: 1px solid red !important; }')), - createDOM('div', {'id': 'host'}, - createShadowRoot( - createDOM('style', {}, - document.createTextNode('#target { border: 1px solid green !important; }')), - createDOM('p', {'id': 'target'}))))); - -borderColorShouldBe('host/target', 'rgb(0, 128, 0)'); - -cleanUp(); - -</script> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-after-style-expected.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-after-style-expected.html deleted file mode 100644 index 46f8c31..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-after-style-expected.html +++ /dev/null
@@ -1,6 +0,0 @@ -<!DOCTYPE html> -<html> -<body> -<div id="host">text<div>host content</div></div> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-after-style-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-after-style-expected.txt deleted file mode 100644 index 4690024..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-after-style-expected.txt +++ /dev/null
@@ -1 +0,0 @@ -CONSOLE WARNING: line 8: Element.createShadowRoot is deprecated and will be removed in M80, around February 2020. Please use Element.attachShadow instead. See https://www.chromestatus.com/features/4507242028072960 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details.
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-after-style.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-after-style.html deleted file mode 100644 index 0ac5e18..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-after-style.html +++ /dev/null
@@ -1,17 +0,0 @@ -<!DOCTYPE html> -<html> -<body> -<div id="host"><div>host content</div></div> -<script> -if (window.testRunner) - testRunner.waitUntilDone(); -var root = document.querySelector('#host').createShadowRoot(); -root.innerHTML = '<style>invalid { }</style>' + - 'text<content></content>'; -window.setTimeout(function() { - if (window.testRunner) - testRunner.notifyDone(); -}, 0); -</script> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-child-whitespace-between-span-expected.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-child-whitespace-between-span-expected.html deleted file mode 100644 index f37c65e3..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-child-whitespace-between-span-expected.html +++ /dev/null
@@ -1,20 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<style> -span { background-color: red; } -</style> -</head> -<body> -<div> -<div> -<div> -<div>Hello1</div> -<span>Hello2</span> -<span>Hello3</span> -<span style="display: none;"></span> -</div> -</div> -</div> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-child-whitespace-between-span.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-child-whitespace-between-span.html deleted file mode 100644 index d298b87..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-child-whitespace-between-span.html +++ /dev/null
@@ -1,21 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<style> -summary { display: none; } -span { background-color: red; } -</style> -</head> -<body> -<div> -<div> -<details open> -<div>Hello1</div> -<span>Hello2</span> -<span>Hello3</span> -<summary></summary> -</details> -</div> -</div> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-element-api-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-element-api-expected.txt deleted file mode 100644 index 80c8185..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-element-api-expected.txt +++ /dev/null
@@ -1,13 +0,0 @@ -This test ensure that the content element is available. - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - -PASS contentSimplest.select is '' -PASS contentSimplest.select is 'foo' -PASS contentSimplest.getAttribute('select') is 'bar' -PASS 0 <= contentSimplest.constructor.toString().indexOf('HTMLContentElement') is true -PASS window.HTMLContentElement is contentSimplest.constructor -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-element-api.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-element-api.html deleted file mode 100644 index ac71913..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-element-api.html +++ /dev/null
@@ -1,22 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script src="../../../resources/js-test.js"></script> -</head> -<body> -<div> - <content id="content-simplest"></content> -</div> -<script> -description("This test ensure that the content element is available."); -var contentSimplest = document.getElementById("content-simplest"); -shouldBe("contentSimplest.select", "''"); -contentSimplest.setAttribute("select", "foo"); -shouldBe("contentSimplest.select", "'foo'"); -contentSimplest.select = "bar" -shouldBe("contentSimplest.getAttribute('select')", "'bar'"); -shouldBeTrue("0 <= contentSimplest.constructor.toString().indexOf('HTMLContentElement')"); -shouldBe("window.HTMLContentElement", "contentSimplest.constructor"); -</script> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-element-change-select-attribute-after-deleted-crash.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-element-change-select-attribute-after-deleted-crash.html deleted file mode 100644 index f7ed27e..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-element-change-select-attribute-after-deleted-crash.html +++ /dev/null
@@ -1,23 +0,0 @@ -<!DOCTYPE html> -<script src='../../../resources/testharness.js'></script> -<script src='../../../resources/testharnessreport.js'></script> -<div id=host1></div> -<script> -'use strict'; -const sr = host1.createShadowRoot(); -sr.innerHTML = '<div id="host2"></div>'; -const sr2 = sr.getElementById('host2').createShadowRoot(); -sr.innerHTML = null; -// TODO(hayato): Find a more reliable way to reproduce the crash. This is the only reliable way as of now. -// Using GCController.collect() does not reproduce the crash. -for (var i = 1; i < 20000; i++) { - "abc" + i; -} -const selectTest = async_test("Testing select attribute change"); -setTimeout(() => { - selectTest.step(() => { - sr2.appendChild(document.createElement('content')).select = 'foo'; - }); - selectTest.done(); -}, 0); -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-element-crash-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-element-crash-expected.txt deleted file mode 100644 index 506fd2f5..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-element-crash-expected.txt +++ /dev/null
@@ -1,2 +0,0 @@ -CONSOLE WARNING: line 10: Element.createShadowRoot is deprecated and will be removed in M80, around February 2020. Please use Element.attachShadow instead. See https://www.chromestatus.com/features/4507242028072960 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -PASS unless crash.
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-element-crash.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-element-crash.html deleted file mode 100644 index 0a4bcdc1..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-element-crash.html +++ /dev/null
@@ -1,19 +0,0 @@ -<!DOCTYPE html> -<html> -<head></head> -<body> -<div id="target"></div> -<script> -if (window.testRunner) - testRunner.dumpAsText(); -var target = document.getElementById("target"); -var shadow = target.createShadowRoot(); -shadow.innerHTML = "<div> <content></content> </div>"; - -var style = document.createElement("style"); -style.innerHTML = " p { display: none; } "; // Contents doesn't matter. -document.head.appendChild(style); -</script> -<div>PASS unless crash.</div> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-element-distributed-nodes-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-element-distributed-nodes-expected.txt deleted file mode 100644 index e14b137b..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-element-distributed-nodes-expected.txt +++ /dev/null
@@ -1,20 +0,0 @@ -CONSOLE WARNING: line 87: Element.createShadowRoot is deprecated and will be removed in M80, around February 2020. Please use Element.attachShadow instead. See https://www.chromestatus.com/features/4507242028072960 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -Tests for content element's getDistributedNodes(). - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - -PASS nodeList.length is expectedNodes.length -PASS nodeList.item(0) is expectedNodes[0] -PASS nodeList.length is expectedNodes.length -PASS nodeList.item(0) is expectedNodes[0] -PASS nodeList.length is expectedNodes.length -PASS nodeList.item(0) is expectedNodes[0] -Verify that getDistributedNodes() returns a static NodeList. -PASS nodeList.length is expectedNodes.length -PASS nodeList.item(0) is expectedNodes[0] -PASS nodeList.length is expectedNodes.length -PASS successfullyParsed is true - -TEST COMPLETE - -
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-element-distributed-nodes.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-element-distributed-nodes.html deleted file mode 100644 index a7e5456..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-element-distributed-nodes.html +++ /dev/null
@@ -1,60 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script src="../../../resources/js-test.js"></script> -<script src="resources/shadow-dom.js"></script> -</head> -<body> -<script> -description("Tests for content element's getDistributedNodes()."); - -document.body.appendChild( - createDOM('div', {}, - createDOM('div', {'id': 'host-1'}, - createShadowRoot( - createDOM('content', {'id': 'content-1'})), - createDOM('div', {'id': 'child-1'})), - createDOM('div', {'id': 'host-2'}, - createShadowRoot( - createDOM('content', {'id': 'content-2'}), - createDOM('div', {'id': 'host-3'}, - createShadowRoot( - createDOM('content', {'id': 'content-3'})), - createDOM('div', {'id': 'child-3'}))), - createDOM('div', {'id': 'child-2'})))); - - -var content1 = getNodeInComposedTree('host-1/content-1'); -var content2 = getNodeInComposedTree('host-2/content-2'); -var content3 = getNodeInComposedTree('host-2/host-3/content-3'); - -var child1 = getNodeInComposedTree('child-1'); -var child2 = getNodeInComposedTree('child-2'); -var child3 = getNodeInComposedTree('host-2/child-3'); - -var distributedNodes1 = content1.getDistributedNodes(); -var distributedNodes2 = content2.getDistributedNodes(); -var distributedNodes3 = content3.getDistributedNodes(); - -function assertNodeList(nodeList, expectedNodes) -{ - window.nodeList = nodeList; - window.expectedNodes = expectedNodes; - shouldBe("nodeList.length", "expectedNodes.length"); - for (var i = 0; i < nodeList.length; ++i) { - shouldBe("nodeList.item(" + i + ")", "expectedNodes[" + i + "]"); - } -} - -assertNodeList(distributedNodes1, [child1]); -assertNodeList(distributedNodes2, [child2]); -assertNodeList(distributedNodes3, [child3]); - -debug('Verify that getDistributedNodes() returns a static NodeList.'); -document.getElementById('host-1').innerHTML = ''; -assertNodeList(distributedNodes1, [child1]); -assertNodeList(content1.getDistributedNodes(), []); - -</script> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-element-fallback-display-none-dynamic-expected.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-element-fallback-display-none-dynamic-expected.html deleted file mode 100644 index c1ec51cf..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-element-fallback-display-none-dynamic-expected.html +++ /dev/null
@@ -1,3 +0,0 @@ -<!doctype html> -<p>You should see the word PASS below.</p> -<div>PASS</div>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-element-fallback-display-none-dynamic-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-element-fallback-display-none-dynamic-expected.txt deleted file mode 100644 index 9a13424f..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-element-fallback-display-none-dynamic-expected.txt +++ /dev/null
@@ -1 +0,0 @@ -CONSOLE WARNING: line 5: Element.createShadowRoot is deprecated and will be removed in M80, around February 2020. Please use Element.attachShadow instead. See https://www.chromestatus.com/features/4507242028072960 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details.
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-element-fallback-display-none-dynamic.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-element-fallback-display-none-dynamic.html deleted file mode 100644 index 4042c9b8..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-element-fallback-display-none-dynamic.html +++ /dev/null
@@ -1,9 +0,0 @@ -<!doctype html> -<p>You should see the word PASS below.</p> -<div id="host"></div> -<script> - const root = host.createShadowRoot(); - root.innerHTML = '<content><span style="display:none">PASS</span></content>'; - host.offsetTop; - root.firstChild.firstChild.style.display = ""; -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-element-in-media-element-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-element-in-media-element-expected.txt deleted file mode 100644 index 66b15ee..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-element-in-media-element-expected.txt +++ /dev/null
@@ -1,5 +0,0 @@ -CONSOLE WARNING: line 29: Element.createShadowRoot is deprecated and will be removed in M80, around February 2020. Please use Element.attachShadow instead. See https://www.chromestatus.com/features/4507242028072960 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -contentElementInVideoElement -PASS -TEST COMPLETED -
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-element-in-media-element.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-element-in-media-element.html deleted file mode 100644 index ea1b8e5..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-element-in-media-element.html +++ /dev/null
@@ -1,48 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<style> -/* relative positioning ensures underlying Layer */ -.container { - position: relative; -} - -.span { - display: boxed-inline; - margin: 2px; - border: solid; -} -</style> -<script src="../resources/shadow-test-driver.js"></script> -<script> - -var testFuncs = []; - -testFuncs.push(function contentElementInVideoElement(callIfDone) { - document.getElementById('expect-container').innerHTML = "<div><video><div></div></video></div>"; - - var div = document.createElement('div'); - div.appendChild(document.createElement('div')); - - document.getElementById('actual-container').appendChild(div); - - var sr = div.createShadowRoot(); - - var video = document.createElement('video'); - var content = document.createElement('content'); - video.appendChild(content); - sr.appendChild(video); - document.body.offsetWidth; // force style recalc. - callIfDone(); -}); - -</script> -</head> -<body onload="doTest(testFuncs)"> - -<div id="actual-container" class="container"></div> -<div id="expect-container" class="container"></div> -<pre id="console"></pre> - -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-element-in-meter-element-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-element-in-meter-element-expected.txt deleted file mode 100644 index 50fb4e4..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-element-in-meter-element-expected.txt +++ /dev/null
@@ -1,5 +0,0 @@ -CONSOLE WARNING: line 29: Element.createShadowRoot is deprecated and will be removed in M80, around February 2020. Please use Element.attachShadow instead. See https://www.chromestatus.com/features/4507242028072960 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -contentElementInMeterElement -PASS -TEST COMPLETED -
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-element-in-meter-element.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-element-in-meter-element.html deleted file mode 100644 index d128c46..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-element-in-meter-element.html +++ /dev/null
@@ -1,48 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<style> -/* relative positioning ensures underlying Layer */ -.container { - position: relative; -} - -.span { - display: boxed-inline; - margin: 2px; - border: solid; -} -</style> -<script src="../resources/shadow-test-driver.js"></script> -<script> - -var testFuncs = []; - -testFuncs.push(function contentElementInMeterElement(callIfDone) { - document.getElementById('expect-container').innerHTML = "<div><meter><div></div></meter></div>"; - - var div = document.createElement('div'); - div.appendChild(document.createElement('div')); - - document.getElementById('actual-container').appendChild(div); - - var sr = div.createShadowRoot(); - - var meter = document.createElement('meter'); - var content = document.createElement('content'); - meter.appendChild(content); - sr.appendChild(meter); - document.body.offsetWidth; // force style recalc. - callIfDone(); -}); - -</script> -</head> -<body onload="doTest(testFuncs)"> - -<div id="actual-container" class="container"></div> -<div id="expect-container" class="container"></div> -<pre id="console"></pre> - -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-element-in-progress-element-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-element-in-progress-element-expected.txt deleted file mode 100644 index c82e09b..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-element-in-progress-element-expected.txt +++ /dev/null
@@ -1,5 +0,0 @@ -CONSOLE WARNING: line 29: Element.createShadowRoot is deprecated and will be removed in M80, around February 2020. Please use Element.attachShadow instead. See https://www.chromestatus.com/features/4507242028072960 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -contentElementInProgressElement -PASS -TEST COMPLETED -
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-element-in-progress-element.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-element-in-progress-element.html deleted file mode 100644 index a91557b..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-element-in-progress-element.html +++ /dev/null
@@ -1,48 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<style> -/* relative positioning ensures underlying Layer */ -.container { - position: relative; -} - -.span { - display: boxed-inline; - margin: 2px; - border: solid; -} -</style> -<script src="../resources/shadow-test-driver.js"></script> -<script> - -var testFuncs = []; - -testFuncs.push(function contentElementInProgressElement(callIfDone) { - document.getElementById('expect-container').innerHTML = "<div><progress><div></div></progress></div>"; - - var div = document.createElement('div'); - div.appendChild(document.createElement('div')); - - document.getElementById('actual-container').appendChild(div); - - var sr = div.createShadowRoot(); - - var progress = document.createElement('progress'); - var content = document.createElement('content'); - progress.appendChild(content); - sr.appendChild(progress); - document.body.offsetWidth; // force style recalc. - callIfDone(); -}); - -</script> -</head> -<body onload="doTest(testFuncs)"> - -<div id="actual-container" class="container"></div> -<div id="expect-container" class="container"></div> -<pre id="console"></pre> - -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-element-in-select-element-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-element-in-select-element-expected.txt deleted file mode 100644 index 3833d78f..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-element-in-select-element-expected.txt +++ /dev/null
@@ -1,5 +0,0 @@ -CONSOLE WARNING: line 29: Element.createShadowRoot is deprecated and will be removed in M80, around February 2020. Please use Element.attachShadow instead. See https://www.chromestatus.com/features/4507242028072960 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -contentElementInSelectElement -PASS -TEST COMPLETED -
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-element-in-select-element.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-element-in-select-element.html deleted file mode 100644 index 9c6ab54..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-element-in-select-element.html +++ /dev/null
@@ -1,48 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<style> -/* relative positioning ensures underlying Layer */ -.container { - position: relative; -} - -.span { - display: boxed-inline; - margin: 2px; - border: solid; -} -</style> -<script src="../resources/shadow-test-driver.js"></script> -<script> - -var testFuncs = []; - -testFuncs.push(function contentElementInSelectElement(callIfDone) { - document.getElementById('expect-container').innerHTML = "<div><select><div></div></select></div>"; - - var div = document.createElement('div'); - div.appendChild(document.createElement('div')); - - document.getElementById('actual-container').appendChild(div); - - var sr = div.createShadowRoot(); - - var select = document.createElement('select'); - var content = document.createElement('content'); - select.appendChild(content); - sr.appendChild(select); - document.body.offsetWidth; // force style recalc. - callIfDone(); -}); - -</script> -</head> -<body onload="doTest(testFuncs)"> - -<div id="actual-container" class="container"></div> -<div id="expect-container" class="container"></div> -<pre id="console"></pre> - -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-element-includer-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-element-includer-expected.txt deleted file mode 100644 index 0fdc32e0..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-element-includer-expected.txt +++ /dev/null
@@ -1,14 +0,0 @@ -CONSOLE WARNING: line 32: Element.createShadowRoot is deprecated and will be removed in M80, around February 2020. Please use Element.attachShadow instead. See https://www.chromestatus.com/features/4507242028072960 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -This tests the correctness of includers of forwarded children. -Note that this test needs internals object thus cannot run outside DRT. - -PASS includerFor(childOfElementWithoutShadow) is null -PASS includerFor(childOfElementWithShadow) is null -PASS includerFor(childOfElementWithShadowContent) is shadowContentOfElementWithShadowContent -PASS includerFor(movingChild) is null -PASS includerFor(movingChild) is null -PASS includerFor(movingChild) is anotherShadowContentOfElementWithShadowContent -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-element-includer.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-element-includer.html deleted file mode 100644 index 84676e4..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-element-includer.html +++ /dev/null
@@ -1,75 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script src="../../../resources/js-test.js"></script> -</head> -<body> -<pre id="console"> -This tests the correctness of includers of forwarded children. -Note that this test needs internals object thus cannot run outside DRT. -</pre> -<div id="container"></div> -<script> -function includerFor(element) { - var insertionPoints = element.getDestinationInsertionPoints(); - if (insertionPoints.length == 0) - return null; - return insertionPoints.item(insertionPoints.length - 1); -} -var container = document.getElementById("container"); - -var shadowRoot = null; - -var elementWithoutShadow = document.createElement("div"); -container.appendChild(elementWithoutShadow); -var childOfElementWithoutShadow = document.createElement("span"); -elementWithoutShadow.appendChild(childOfElementWithoutShadow); -container.offsetLeft; -shouldBe("includerFor(childOfElementWithoutShadow)", "null"); - -var elementWithShadow = document.createElement("div"); -container.appendChild(elementWithShadow); -var shadowRootOfElementWithShadow = elementWithShadow.createShadowRoot(); -shadowRootOfElementWithShadow.appendChild(document.createElement("div")); // Gives non-content child. -var childOfElementWithShadow = document.createElement("span"); -elementWithShadow.appendChild(childOfElementWithShadow); -container.offsetLeft; -shouldBe("includerFor(childOfElementWithShadow)", "null"); - -var elementWithShadowContent = document.createElement("div"); -container.appendChild(elementWithShadowContent); -var shadowRootOfElementWithShadowContent = elementWithShadowContent.createShadowRoot(); -var shadowContentOfElementWithShadowContent = document.createElement('content'); -shadowRootOfElementWithShadowContent.appendChild(shadowContentOfElementWithShadowContent); -var childOfElementWithShadowContent = document.createElement("span"); -elementWithShadowContent.appendChild(childOfElementWithShadowContent); -container.offsetLeft; -shouldBe("includerFor(childOfElementWithShadowContent)", "shadowContentOfElementWithShadowContent"); - -// -// Testing dynamic change -// -var movingChild = childOfElementWithShadowContent; - -// Removing -elementWithShadowContent.removeChild(movingChild); -shouldBe("includerFor(movingChild)", "null"); - -// Moving to content-less tree -elementWithShadow.appendChild(movingChild); -shouldBe("includerFor(movingChild)", "null"); -elementWithShadow.removeChild(movingChild); - -// Moving to another content-full tree -var anotherElementWithShadowContent = document.createElement("div"); -container.appendChild(anotherElementWithShadowContent); -var anotherShadowRootOfElementWithShadowContent = anotherElementWithShadowContent.createShadowRoot(); -var anotherShadowContentOfElementWithShadowContent = document.createElement('content'); -anotherShadowRootOfElementWithShadowContent.appendChild(anotherShadowContentOfElementWithShadowContent); - -anotherElementWithShadowContent.appendChild(movingChild); -container.offsetLeft; -shouldBe("includerFor(movingChild)", "anotherShadowContentOfElementWithShadowContent"); -</script> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-element-move-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-element-move-expected.txt deleted file mode 100644 index 48621eb..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-element-move-expected.txt +++ /dev/null
@@ -1,23 +0,0 @@ -CONSOLE WARNING: line 26: Element.createShadowRoot is deprecated and will be removed in M80, around February 2020. Please use Element.attachShadow instead. See https://www.chromestatus.com/features/4507242028072960 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -testRemoveContent -PASS -testRemoveContentToRecalc1 -PASS -testRemoveContentToRecalc2 -PASS -testRemoveContentAndRemoveLightChildren -PASS -testAppendContent1 -PASS -testAppendContent2 -PASS -testAppendContent3 -PASS -testChangeOrderOfContent -PASS -testMoveLightChildOut -PASS -testInsertBeforeFallback -PASS -TEST COMPLETED -
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-element-move.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-element-move.html deleted file mode 100644 index 1c2ce89..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-element-move.html +++ /dev/null
@@ -1,326 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<style> -/* relative positioning ensures underlying Layer */ -.container { - position: relative; -} - -.span { - display: boxed-inline; - margin: 2px; - border: solid; -} -</style> -<script src="../resources/shadow-test-driver.js"></script> -<script> -function testRemoveContent(callIfDone) { - var root = document.createElement('div'); - - // Create light tree. - root.innerHTML = "<span>LIGHT</span>"; - - // Create shadow tree. - var content = createContentWithSelect('span', 'FALLBACK'); - var sr = root.createShadowRoot(); - sr.appendChild(createSpanWithText("BEFORE")); - sr.appendChild(content); - sr.appendChild(createSpanWithText("AFTER")); - - document.getElementById('actual-container').appendChild(root); - - var f = (function(root, content, callIfDone) { - return function() { - content.parentNode.removeChild(content); - document.getElementById('expect-container').innerHTML = "<div><span>BEFORE</span><span>AFTER</span></div>"; - callIfDone(); - }; - })(root, content, callIfDone); - - setTimeout(f, 0); -} - -function testRemoveContentToRecalc1(callIfDone) { - var root = document.createElement('div'); - - // Create light tree. - root.innerHTML = "<span class='c1'>LIGHT 1</span><span>LIGHT 2</span>"; - - // Create shadow tree. - var content1 = createContentWithSelect('.c1', 'FALLBACK'); - var content2 = createContentWithSelect('span', 'FALLBACK'); - var sr = root.createShadowRoot(); - sr.appendChild(createSpanWithText("BEFORE")); - sr.appendChild(content1); - sr.appendChild(createSpanWithText("MID")); - sr.appendChild(content2); - sr.appendChild(createSpanWithText("AFTER")); - - document.getElementById('actual-container').appendChild(root); - - var f = (function(root, content1, callIfDone) { - return function() { - content1.parentNode.removeChild(content1); - document.getElementById('expect-container').innerHTML = "<div><span>BEFORE</span><span>MID</span><span>LIGHT 1</span><span>LIGHT 2</span><span>AFTER</span></div>"; - callIfDone(); - }; - })(root, content1, callIfDone); - - setTimeout(f, 0); -} - -function testRemoveContentToRecalc2(callIfDone) { - var root = document.createElement('div'); - - // Create light tree. - root.innerHTML = "<span>LIGHT 1</span><span class='c1'>LIGHT 2</span>"; - - // Create shadow tree. - var content1 = createContentWithSelect('.c1', 'FALLBACK'); - var content2 = createContentWithSelect('span', 'FALLBACK'); - var sr = root.createShadowRoot(); - sr.appendChild(createSpanWithText("BEFORE")); - sr.appendChild(content1); - sr.appendChild(createSpanWithText("MID")); - sr.appendChild(content2); - sr.appendChild(createSpanWithText("AFTER")); - - document.getElementById('actual-container').appendChild(root); - - var f = (function(root, content1, callIfDone) { - return function() { - content1.parentNode.removeChild(content1); - document.getElementById('expect-container').innerHTML = "<div><span>BEFORE</span><span>MID</span><span>LIGHT 1</span><span>LIGHT 2</span><span>AFTER</span></div>"; - callIfDone(); - }; - })(root, content1, callIfDone); - - setTimeout(f, 0); -} - -function testRemoveContentAndRemoveLightChildren(callIfDone) { - var root = document.createElement('div'); - - // Create light tree. - root.innerHTML = "<span>LIGHT</span>"; - - // Create shadow tree. - var content = createContentWithSelect('span'); - var sr = root.createShadowRoot(); - sr.appendChild(createSpanWithText("BEFORE")); - sr.appendChild(content); - sr.appendChild(createSpanWithText("AFTER")); - - document.getElementById('actual-container').appendChild(root); - - var f = (function(root, content, callIfDone) { - return function() { - content.parentNode.removeChild(content); - removeAllChildren(root); - document.getElementById('expect-container').innerHTML = "<div><span>BEFORE</span><span>AFTER</span></div>"; - callIfDone(); - }; - })(root, content, callIfDone); - - setTimeout(f, 0); -} - -function testAppendContent1(callIfDone) { - var root = document.createElement('div'); - - // Create light tree. - root.innerHTML = "<span>LIGHT</span>"; - - // Create shadow tree. - var sr = root.createShadowRoot(); - sr.appendChild(createSpanWithText("BEFORE")); - sr.appendChild(createSpanWithText("AFTER")); - - document.getElementById('actual-container').appendChild(root); - - var f = (function(root, callIfDone) { - return function() { - var content = createContentWithSelect('span', 'FALLBACK'); - var sr = root.shadowRoot; - sr.insertBefore(content, sr.lastChild); - document.getElementById('expect-container').innerHTML = "<div><span>BEFORE</span><SPAN>LIGHT</span><span>AFTER</span></div>"; - callIfDone(); - }; - })(root, callIfDone); - - setTimeout(f, 0); -} - -function testAppendContent2(callIfDone) { - var root = document.createElement('div'); - - // Create light tree. - root.innerHTML = "<span>LIGHT 1</span><span class='c2'>LIGHT 2</span>"; - - // Create shadow tree. - var sr = root.createShadowRoot(); - sr.appendChild(createSpanWithText("BEFORE")); - sr.appendChild(createSpanWithText("AFTER")); - - document.getElementById('actual-container').appendChild(root); - - var f = (function(root, callIfDone) { - return function() { - var content1 = createContentWithSelect('.c2', 'FALLBACK'); - var content2 = createContentWithSelect('span', 'FALLBACK'); - var sr = root.shadowRoot; - sr.insertBefore(content1, sr.lastChild); - sr.insertBefore(content2, sr.lastChild); - document.getElementById('expect-container').innerHTML = "<div><span>BEFORE</span><span>LIGHT 2</span><span>LIGHT 1</span><span>AFTER</span></div>"; - callIfDone(); - }; - })(root, callIfDone); - - setTimeout(f, 0); -} - -function testAppendContent3(callIfDone) { - var root = document.createElement('div'); - - // Create light tree. - root.innerHTML = "<span>LIGHT 1</span><span class='c2'>LIGHT 2</span>"; - - // Create shadow tree. - var sr = root.createShadowRoot(); - var mid = createSpanWithText("MID"); - sr.appendChild(createSpanWithText("BEFORE")); - sr.appendChild(mid); - sr.appendChild(createContentWithSelect('.c2', 'FALLBACK')); - sr.appendChild(createSpanWithText("AFTER")); - - document.getElementById('actual-container').appendChild(root); - - var f = (function(root, mid, callIfDone) { - return function() { - var content = createContentWithSelect('span', 'FALLBACK'); - var sr = root.shadowRoot; - sr.insertBefore(content, mid); - document.getElementById('expect-container').innerHTML = - "<div><span>BEFORE</span><span>LIGHT 1</span><span>LIGHT 2</span><span>MID</span><span>FALLBACK</span><span>AFTER</span></div>"; - callIfDone(); - }; - })(root, mid, callIfDone); - - setTimeout(f, 0); -} - -function testChangeOrderOfContent(callIfDone) { - var root = document.createElement('div'); - - // Create light tree. - root.innerHTML = "<span class='c1'>LIGHT 1</span><span>LIGHT 2</span>"; - - // Create shadow tree. - var sr = root.createShadowRoot(); - var content1 = createContentWithSelect('.c1', 'FALLBACK'); - var content2 = createContentWithSelect('span', 'FALLBACK'); - sr.appendChild(createSpanWithText("BEFORE")); - sr.appendChild(content1); - sr.appendChild(content2); - sr.appendChild(createSpanWithText("AFTER")); - - document.getElementById('actual-container').appendChild(root); - - var f = (function(root, content1, callIfDone) { - return function() { - var sr = root.shadowRoot; - sr.removeChild(content1); - sr.insertBefore(content1, sr.lastChild); - document.getElementById('expect-container').innerHTML = - "<div><span>BEFORE</span><SPAN>LIGHT 1</span><span>LIGHT 2</span><span>FALLBACK</span><span>AFTER</span></div>"; - callIfDone(); - }; - })(root, content1, callIfDone); - - setTimeout(f, 0); -} - -function testMoveLightChildOut(callIfDone) { - var root = document.createElement('div'); - - // Create light tree. - var n1 = document.createElement('div'); - n1.setAttribute('id', 'n1'); - n1.innerHTML = "<span id='light1'>LIGHT 1</span><span>LIGHT 2</span>"; - var n2 = document.createElement('div'); - n2.setAttribute('id', 'n2'); - - root.appendChild(n1); - root.appendChild(n2); - - // Create shadow tree in 'n1' - var sr = n1.createShadowRoot(); - var content = createContentWithSelect('span', 'FALLBACK'); - sr.appendChild(createSpanWithText("BEFORE")); - sr.appendChild(content); - sr.appendChild(createSpanWithText("AFTER")); - - document.getElementById('actual-container').appendChild(root); - - var f = (function(root, n2, callIfDone) { - return function() { - var e = document.getElementById('light1'); - e.parentNode.removeChild(e); - n2.appendChild(e); - - document.getElementById('expect-container').innerHTML = - "<div><div><span>BEFORE</span><span>LIGHT 2</span><span>AFTER</span></div><div><span>LIGHT 1</span></div></div>" - callIfDone(); - }; - })(root, n2, callIfDone); - - setTimeout(f, 0); -} - -function testInsertBeforeFallback(callIfDone) { - document.getElementById('expect-container').innerHTML = - "<div><span>BEFORE</span><span>HOGE</span><span>FALLBACK</span><span>AFTER</span></div>"; - - var target = document.createElement('div'); - document.getElementById('actual-container').appendChild(target); - - var span1 = document.createElement('span'); - var root = span1.createShadowRoot(); - root.appendChild(createContentWithText("FALLBACK")); - - target.appendChild(createSpanWithText('BEFORE')); - target.appendChild(span1); - target.appendChild(createSpanWithText('AFTER')); - - var f = (function(target, span1, callIfDone) { return function() { - target.insertBefore(createSpanWithText('HOGE'), span1); - callIfDone(); - };})(target, span1, callIfDone); - - setTimeout(f, 0); -} - -var testFuncs = [ - testRemoveContent, - testRemoveContentToRecalc1, - testRemoveContentToRecalc2, - testRemoveContentAndRemoveLightChildren, - testAppendContent1, - testAppendContent2, - testAppendContent3, - testChangeOrderOfContent, - testMoveLightChildOut, - testInsertBeforeFallback -]; - -</script> -</head> -<body onload="doTest(testFuncs)"> - -<div id="actual-container" class="container"></div> -<div id="expect-container" class="container"></div> -<pre id="console"></pre> - -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-element-outside-shadow-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-element-outside-shadow-expected.txt deleted file mode 100644 index 2252205..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-element-outside-shadow-expected.txt +++ /dev/null
@@ -1,20 +0,0 @@ -HTMLContentElement should be able to survive even outside shadow. - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - -<div><content></content></div> -PASS targetLayoutTree is comparisonLayoutTree -<div><content>Here is a text.</content></div> -PASS targetLayoutTree is comparisonLayoutTree -<div><content><div>Here is a </div><div>series of</div><div>blocks</div></content></div> -PASS targetLayoutTree is comparisonLayoutTree -<div><content><span>Here is a<span><span>series of</span><span>inlines.</span></content></div> -PASS targetLayoutTree is comparisonLayoutTree -<div><content>Here is a <content>nested content</content> inside content.</content></div> -PASS targetLayoutTree is comparisonLayoutTree -<div><content>Here is a <div>block and <content>nested content</content> inside the block</div>.</content></div> -PASS targetLayoutTree is comparisonLayoutTree -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-element-outside-shadow-style-expected.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-element-outside-shadow-style-expected.html deleted file mode 100644 index 8404c193..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-element-outside-shadow-style-expected.html +++ /dev/null
@@ -1,18 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<style> -span { - color: blue; -} -</style> -</head> -<body> - <div> - <span>Should be colored blue.</span> - </div> - <div> - <div>Should have no cool color.</div> - <div>Should have no cool color either.</div> - </div> -</body>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-element-outside-shadow-style-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-element-outside-shadow-style-expected.txt deleted file mode 100644 index d43c81a..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-element-outside-shadow-style-expected.txt +++ /dev/null
@@ -1 +0,0 @@ -CONSOLE WARNING: line 22: Element.createShadowRoot is deprecated and will be removed in M80, around February 2020. Please use Element.attachShadow instead. See https://www.chromestatus.com/features/4507242028072960 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details.
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-element-outside-shadow-style.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-element-outside-shadow-style.html deleted file mode 100644 index 827c5dfc..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-element-outside-shadow-style.html +++ /dev/null
@@ -1,31 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<style> -content { - color: blue; -} -</style> -</head> -<body> - <div> - <content>Should be colored blue.</content> - </div> - <div> - <div id="hostWithChild">Should have no cool color.</div> - <content id="toBeMoved">Should have no cool color either.</content> - <div id="hostEmpty"></div> - </div> -<script> -// Ensures that distributed shadow child isn't effected by the style. -var hostWithChild = document.getElementById("hostWithChild"); -var shadowForHostWithChild = hostWithChild.createShadowRoot(); -shadowForHostWithChild.appendChild(document.createElement("content")); - -// Also ensures that dynamically moved <content> elements do work. -var hostEmpty = document.getElementById("hostEmpty"); -var shadowForHostEmpty = hostEmpty.createShadowRoot(); -shadowForHostEmpty.appendChild(document.getElementById("toBeMoved")); - -</script> -</body>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-element-outside-shadow.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-element-outside-shadow.html deleted file mode 100644 index 6d8361e..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-element-outside-shadow.html +++ /dev/null
@@ -1,54 +0,0 @@ -<!DOCTYPE html> -<html> -<body> - -<div id="targetContainer" style="position: relative;"></div> -<div id="comparisonContainer" style="position: relative;"></div> - -<script src="../../../resources/js-test.js"></script> -<script><!-- -description("HTMLContentElement should be able to survive even outside shadow."); - -function removeContainerLines(text) -{ - var lines = text.split("\n"); - lines.splice(0, 2); - return lines.join("\n"); -} - -var cases = [ - ["<div><content></content></div>", - "<div><unknown></unknown></div>"], - ["<div><content>Here is a text.</content></div>", - "<div><unknown>Here is a text.</unknown></div>"], - ["<div><content><div>Here is a </div><div>series of</div><div>blocks</div></content></div>", - "<div><unknown><div>Here is a </div><div>series of</div><div>blocks</div></unknown></div>"], - ["<div><content><span>Here is a<span><span>series of</span><span>inlines.</span></content></div>", - "<div><unknown><span>Here is a<span><span>series of</span><span>inlines.</span></unknown></div>"], - ["<div><content>Here is a <content>nested content</content> inside content.</content></div>", - "<div><unknown>Here is a <unknown>nested content</unknown> inside content.</unknown></div>"], - ["<div><content>Here is a <div>block and <content>nested content</content> inside the block</div>.</content></div>", - "<div><unknown>Here is a <div>block and <unknown>nested content</unknown> inside the block</div>.</unknown></div>"] -]; - -var targetContainer = document.getElementById("targetContainer"); -var comparisonContainer = document.getElementById("comparisonContainer"); - -for (var i = 0; i < cases.length; ++i) { - var targetMarkup = cases[i][0]; - var expectedMarkup = cases[i][1]; - - targetContainer.innerHTML = targetMarkup; - comparisonContainer.innerHTML = expectedMarkup; - targetLayoutTree = removeContainerLines(internals.elementLayoutTreeAsText(targetContainer)); - targetLayoutTree = targetLayoutTree.replace(/CONTENT/g, "UNKNOWN"); - comparisonLayoutTree = removeContainerLines(internals.elementLayoutTreeAsText(comparisonContainer)); - debug(escapeHTML(targetMarkup)); - shouldBe("targetLayoutTree", "comparisonLayoutTree"); -} - -targetContainer.innerHTML = comparisonContainer.innerHTML = ""; - ---></script> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-element-renderers-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-element-renderers-expected.txt deleted file mode 100644 index 87f5eca..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-element-renderers-expected.txt +++ /dev/null
@@ -1,183 +0,0 @@ -CONSOLE WARNING: line 83: Element.createShadowRoot is deprecated and will be removed in M80, around February 2020. Please use Element.attachShadow instead. See https://www.chromestatus.com/features/4507242028072960 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -This test compares a shadow-based render tree with one for a reference DOM tree. -Note that this test only runs on DRT. -PASS[0,0]: content=<div/> shadow=<content/> -PASS[0,1]: content=<div/> shadow=<div/><content/><div/> -PASS[0,2]: content=<div/> shadow=<div/><content/><span/> -PASS[0,3]: content=<div/> shadow=<span/><content/><span/> -PASS[0,4]: content=<div/> shadow=<span/><content/><div/> -PASS[0,5]: content=<div/> shadow=<div/><content/><div/> -PASS[0,6]: content=<div/> shadow=<div/><content/><span/> -PASS[0,7]: content=<div/> shadow=<span/><content/><span/> -PASS[0,8]: content=<div/> shadow=<span/><content/><div/> -PASS[0,9]: content=<div/> shadow=<div/>#text<content/>#text<div/> -PASS[0,10]: content=<div/> shadow=<div/>#text<content/>#text<span/> -PASS[0,11]: content=<div/> shadow=<span/>#text<content/>#text<span/> -PASS[0,12]: content=<div/> shadow=<span/>#text<content/>#text<div/> -PASS[0,13]: content=<div/> shadow=<div><content/></div> -PASS[0,14]: content=<div/> shadow=<span><content/></span> -PASS[1,0]: content=#text<div/> shadow=<content/> -PASS[1,1]: content=#text<div/> shadow=<div/><content/><div/> -PASS[1,2]: content=#text<div/> shadow=<div/><content/><span/> -PASS[1,3]: content=#text<div/> shadow=<span/><content/><span/> -PASS[1,4]: content=#text<div/> shadow=<span/><content/><div/> -PASS[1,5]: content=#text<div/> shadow=<div/><content/><div/> -PASS[1,6]: content=#text<div/> shadow=<div/><content/><span/> -PASS[1,7]: content=#text<div/> shadow=<span/><content/><span/> -PASS[1,8]: content=#text<div/> shadow=<span/><content/><div/> -PASS[1,9]: content=#text<div/> shadow=<div/>#text<content/>#text<div/> -PASS[1,10]: content=#text<div/> shadow=<div/>#text<content/>#text<span/> -PASS[1,11]: content=#text<div/> shadow=<span/>#text<content/>#text<span/> -PASS[1,12]: content=#text<div/> shadow=<span/>#text<content/>#text<div/> -PASS[1,13]: content=#text<div/> shadow=<div><content/></div> -PASS[1,14]: content=#text<div/> shadow=<span><content/></span> -PASS[2,0]: content=<div/>#text shadow=<content/> -PASS[2,1]: content=<div/>#text shadow=<div/><content/><div/> -PASS[2,2]: content=<div/>#text shadow=<div/><content/><span/> -PASS[2,3]: content=<div/>#text shadow=<span/><content/><span/> -PASS[2,4]: content=<div/>#text shadow=<span/><content/><div/> -PASS[2,5]: content=<div/>#text shadow=<div/><content/><div/> -PASS[2,6]: content=<div/>#text shadow=<div/><content/><span/> -PASS[2,7]: content=<div/>#text shadow=<span/><content/><span/> -PASS[2,8]: content=<div/>#text shadow=<span/><content/><div/> -PASS[2,9]: content=<div/>#text shadow=<div/>#text<content/>#text<div/> -PASS[2,10]: content=<div/>#text shadow=<div/>#text<content/>#text<span/> -PASS[2,11]: content=<div/>#text shadow=<span/>#text<content/>#text<span/> -PASS[2,12]: content=<div/>#text shadow=<span/>#text<content/>#text<div/> -PASS[2,13]: content=<div/>#text shadow=<div><content/></div> -PASS[2,14]: content=<div/>#text shadow=<span><content/></span> -PASS[3,0]: content=#text<div/>#text shadow=<content/> -PASS[3,1]: content=#text<div/>#text shadow=<div/><content/><div/> -PASS[3,2]: content=#text<div/>#text shadow=<div/><content/><span/> -PASS[3,3]: content=#text<div/>#text shadow=<span/><content/><span/> -PASS[3,4]: content=#text<div/>#text shadow=<span/><content/><div/> -PASS[3,5]: content=#text<div/>#text shadow=<div/><content/><div/> -PASS[3,6]: content=#text<div/>#text shadow=<div/><content/><span/> -PASS[3,7]: content=#text<div/>#text shadow=<span/><content/><span/> -PASS[3,8]: content=#text<div/>#text shadow=<span/><content/><div/> -PASS[3,9]: content=#text<div/>#text shadow=<div/>#text<content/>#text<div/> -PASS[3,10]: content=#text<div/>#text shadow=<div/>#text<content/>#text<span/> -PASS[3,11]: content=#text<div/>#text shadow=<span/>#text<content/>#text<span/> -PASS[3,12]: content=#text<div/>#text shadow=<span/>#text<content/>#text<div/> -PASS[3,13]: content=#text<div/>#text shadow=<div><content/></div> -PASS[3,14]: content=#text<div/>#text shadow=<span><content/></span> -PASS[4,0]: content=<span/> shadow=<content/> -PASS[4,1]: content=<span/> shadow=<div/><content/><div/> -PASS[4,2]: content=<span/> shadow=<div/><content/><span/> -PASS[4,3]: content=<span/> shadow=<span/><content/><span/> -PASS[4,4]: content=<span/> shadow=<span/><content/><div/> -PASS[4,5]: content=<span/> shadow=<div/><content/><div/> -PASS[4,6]: content=<span/> shadow=<div/><content/><span/> -PASS[4,7]: content=<span/> shadow=<span/><content/><span/> -PASS[4,8]: content=<span/> shadow=<span/><content/><div/> -PASS[4,9]: content=<span/> shadow=<div/>#text<content/>#text<div/> -PASS[4,10]: content=<span/> shadow=<div/>#text<content/>#text<span/> -PASS[4,11]: content=<span/> shadow=<span/>#text<content/>#text<span/> -PASS[4,12]: content=<span/> shadow=<span/>#text<content/>#text<div/> -PASS[4,13]: content=<span/> shadow=<div><content/></div> -PASS[4,14]: content=<span/> shadow=<span><content/></span> -PASS[5,0]: content=#text<span/> shadow=<content/> -PASS[5,1]: content=#text<span/> shadow=<div/><content/><div/> -PASS[5,2]: content=#text<span/> shadow=<div/><content/><span/> -PASS[5,3]: content=#text<span/> shadow=<span/><content/><span/> -PASS[5,4]: content=#text<span/> shadow=<span/><content/><div/> -PASS[5,5]: content=#text<span/> shadow=<div/><content/><div/> -PASS[5,6]: content=#text<span/> shadow=<div/><content/><span/> -PASS[5,7]: content=#text<span/> shadow=<span/><content/><span/> -PASS[5,8]: content=#text<span/> shadow=<span/><content/><div/> -PASS[5,9]: content=#text<span/> shadow=<div/>#text<content/>#text<div/> -PASS[5,10]: content=#text<span/> shadow=<div/>#text<content/>#text<span/> -PASS[5,11]: content=#text<span/> shadow=<span/>#text<content/>#text<span/> -PASS[5,12]: content=#text<span/> shadow=<span/>#text<content/>#text<div/> -PASS[5,13]: content=#text<span/> shadow=<div><content/></div> -PASS[5,14]: content=#text<span/> shadow=<span><content/></span> -PASS[6,0]: content=<span/>#text shadow=<content/> -PASS[6,1]: content=<span/>#text shadow=<div/><content/><div/> -PASS[6,2]: content=<span/>#text shadow=<div/><content/><span/> -PASS[6,3]: content=<span/>#text shadow=<span/><content/><span/> -PASS[6,4]: content=<span/>#text shadow=<span/><content/><div/> -PASS[6,5]: content=<span/>#text shadow=<div/><content/><div/> -PASS[6,6]: content=<span/>#text shadow=<div/><content/><span/> -PASS[6,7]: content=<span/>#text shadow=<span/><content/><span/> -PASS[6,8]: content=<span/>#text shadow=<span/><content/><div/> -PASS[6,9]: content=<span/>#text shadow=<div/>#text<content/>#text<div/> -PASS[6,10]: content=<span/>#text shadow=<div/>#text<content/>#text<span/> -PASS[6,11]: content=<span/>#text shadow=<span/>#text<content/>#text<span/> -PASS[6,12]: content=<span/>#text shadow=<span/>#text<content/>#text<div/> -PASS[6,13]: content=<span/>#text shadow=<div><content/></div> -PASS[6,14]: content=<span/>#text shadow=<span><content/></span> -PASS[7,0]: content=#text<span/>#text shadow=<content/> -PASS[7,1]: content=#text<span/>#text shadow=<div/><content/><div/> -PASS[7,2]: content=#text<span/>#text shadow=<div/><content/><span/> -PASS[7,3]: content=#text<span/>#text shadow=<span/><content/><span/> -PASS[7,4]: content=#text<span/>#text shadow=<span/><content/><div/> -PASS[7,5]: content=#text<span/>#text shadow=<div/><content/><div/> -PASS[7,6]: content=#text<span/>#text shadow=<div/><content/><span/> -PASS[7,7]: content=#text<span/>#text shadow=<span/><content/><span/> -PASS[7,8]: content=#text<span/>#text shadow=<span/><content/><div/> -PASS[7,9]: content=#text<span/>#text shadow=<div/>#text<content/>#text<div/> -PASS[7,10]: content=#text<span/>#text shadow=<div/>#text<content/>#text<span/> -PASS[7,11]: content=#text<span/>#text shadow=<span/>#text<content/>#text<span/> -PASS[7,12]: content=#text<span/>#text shadow=<span/>#text<content/>#text<div/> -PASS[7,13]: content=#text<span/>#text shadow=<div><content/></div> -PASS[7,14]: content=#text<span/>#text shadow=<span><content/></span> -PASS[8,0]: content=<span/>#text<div/> shadow=<content/> -PASS[8,1]: content=<span/>#text<div/> shadow=<div/><content/><div/> -PASS[8,2]: content=<span/>#text<div/> shadow=<div/><content/><span/> -PASS[8,3]: content=<span/>#text<div/> shadow=<span/><content/><span/> -PASS[8,4]: content=<span/>#text<div/> shadow=<span/><content/><div/> -PASS[8,5]: content=<span/>#text<div/> shadow=<div/><content/><div/> -PASS[8,6]: content=<span/>#text<div/> shadow=<div/><content/><span/> -PASS[8,7]: content=<span/>#text<div/> shadow=<span/><content/><span/> -PASS[8,8]: content=<span/>#text<div/> shadow=<span/><content/><div/> -PASS[8,9]: content=<span/>#text<div/> shadow=<div/>#text<content/>#text<div/> -PASS[8,10]: content=<span/>#text<div/> shadow=<div/>#text<content/>#text<span/> -PASS[8,11]: content=<span/>#text<div/> shadow=<span/>#text<content/>#text<span/> -PASS[8,12]: content=<span/>#text<div/> shadow=<span/>#text<content/>#text<div/> -PASS[8,13]: content=<span/>#text<div/> shadow=<div><content/></div> -PASS[8,14]: content=<span/>#text<div/> shadow=<span><content/></span> -PASS[9,0]: content=<div/>#text<span/> shadow=<content/> -PASS[9,1]: content=<div/>#text<span/> shadow=<div/><content/><div/> -PASS[9,2]: content=<div/>#text<span/> shadow=<div/><content/><span/> -PASS[9,3]: content=<div/>#text<span/> shadow=<span/><content/><span/> -PASS[9,4]: content=<div/>#text<span/> shadow=<span/><content/><div/> -PASS[9,5]: content=<div/>#text<span/> shadow=<div/><content/><div/> -PASS[9,6]: content=<div/>#text<span/> shadow=<div/><content/><span/> -PASS[9,7]: content=<div/>#text<span/> shadow=<span/><content/><span/> -PASS[9,8]: content=<div/>#text<span/> shadow=<span/><content/><div/> -PASS[9,9]: content=<div/>#text<span/> shadow=<div/>#text<content/>#text<div/> -PASS[9,10]: content=<div/>#text<span/> shadow=<div/>#text<content/>#text<span/> -PASS[9,11]: content=<div/>#text<span/> shadow=<span/>#text<content/>#text<span/> -PASS[9,12]: content=<div/>#text<span/> shadow=<span/>#text<content/>#text<div/> -PASS[9,13]: content=<div/>#text<span/> shadow=<div><content/></div> -PASS[9,14]: content=<div/>#text<span/> shadow=<span><content/></span> -PASS[10,0]: content=<div/><span/> shadow=<content/> -PASS[10,1]: content=<div/><span/> shadow=<div/><content/><div/> -PASS[10,2]: content=<div/><span/> shadow=<div/><content/><span/> -PASS[10,3]: content=<div/><span/> shadow=<span/><content/><span/> -PASS[10,4]: content=<div/><span/> shadow=<span/><content/><div/> -PASS[10,5]: content=<div/><span/> shadow=<div/><content/><div/> -PASS[10,6]: content=<div/><span/> shadow=<div/><content/><span/> -PASS[10,7]: content=<div/><span/> shadow=<span/><content/><span/> -PASS[10,8]: content=<div/><span/> shadow=<span/><content/><div/> -PASS[10,9]: content=<div/><span/> shadow=<div/>#text<content/>#text<div/> -PASS[10,10]: content=<div/><span/> shadow=<div/>#text<content/>#text<span/> -PASS[10,11]: content=<div/><span/> shadow=<span/>#text<content/>#text<span/> -PASS[10,12]: content=<div/><span/> shadow=<span/>#text<content/>#text<div/> -PASS[10,13]: content=<div/><span/> shadow=<div><content/></div> -PASS[10,14]: content=<div/><span/> shadow=<span><content/></span> -PASS[11,0]: content=<span/><div/> shadow=<content/> -PASS[11,1]: content=<span/><div/> shadow=<div/><content/><div/> -PASS[11,2]: content=<span/><div/> shadow=<div/><content/><span/> -PASS[11,3]: content=<span/><div/> shadow=<span/><content/><span/> -PASS[11,4]: content=<span/><div/> shadow=<span/><content/><div/> -PASS[11,5]: content=<span/><div/> shadow=<div/><content/><div/> -PASS[11,6]: content=<span/><div/> shadow=<div/><content/><span/> -PASS[11,7]: content=<span/><div/> shadow=<span/><content/><span/> -PASS[11,8]: content=<span/><div/> shadow=<span/><content/><div/> -PASS[11,9]: content=<span/><div/> shadow=<div/>#text<content/>#text<div/> -PASS[11,10]: content=<span/><div/> shadow=<div/>#text<content/>#text<span/> -PASS[11,11]: content=<span/><div/> shadow=<span/>#text<content/>#text<span/> -PASS[11,12]: content=<span/><div/> shadow=<span/>#text<content/>#text<div/> -PASS[11,13]: content=<span/><div/> shadow=<div><content/></div> -PASS[11,14]: content=<span/><div/> shadow=<span><content/></span>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-element-renderers.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-element-renderers.html deleted file mode 100644 index 23e5fa2..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-element-renderers.html +++ /dev/null
@@ -1,155 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<style> -/* relative positioning ensures underlying Layer */ -.container { - position: relative; -} -</style> -<script> -function log(message) -{ - var line = document.createElement("div"); - line.textContent = message; - document.getElementById("console").appendChild(line); -} - -var contentSources = [ - "<div/>", - "#text<div/>", - "<div/>#text", - "#text<div/>#text", - - "<span/>", - "#text<span/>", - "<span/>#text", - "#text<span/>#text", - - "<span/>#text<div/>", - "<div/>#text<span/>", - "<div/><span/>", - "<span/><div/>" - -]; - -var shadowSources = [ - "<content/>", - "<div/><content/><div/>", - "<div/><content/><span/>", - "<span/><content/><span/>", - "<span/><content/><div/>", - - "<div/><content/><div/>", - "<div/><content/><span/>", - "<span/><content/><span/>", - "<span/><content/><div/>", - - "<div/>#text<content/>#text<div/>", - "<div/>#text<content/>#text<span/>", - "<span/>#text<content/>#text<span/>", - "<span/>#text<content/>#text<div/>", - - "<div><content/></div>", - "<span><content/></span>" -]; - -function createTreeFrom(html) -{ - var enhancedHtml = html.replace(/<span\/>/g, "<span> </span>").replace(/<div\/>/g, "<div> </div>").replace(/<content\/>/g, "<content></content>").replace(/#text/g, " "); - var root = document.createElement("blockquote"); - root.innerHTML = enhancedHtml; - var contentPlaceholder = root.getElementsByTagName("CONTENT")[0]; - if (contentPlaceholder) { - var contentParent = contentPlaceholder.parentNode; - contentParent.replaceChild(window.document.createElement('content'), contentPlaceholder); - }; - - return root; -} - -function moveChildren(fromParent, toParent) -{ - var children = fromParent.childNodes; - while (fromParent.firstChild) - toParent.appendChild(fromParent.firstChild); -} - -function createTargetTree(contentHtml, shadowHtml) -{ - var content = createTreeFrom(contentHtml); - var shadow = createTreeFrom(shadowHtml); - var host = document.createElement("blockquote"); - var shadowRoot = host.createShadowRoot(); - moveChildren(content, host); - moveChildren(shadow, shadowRoot); - return host; -} - -function cleanupContainer(container) -{ - var child = container.firstChild; - if (child) - container.removeChild(child); - container.offsetLeft; -} - -function testWithContentAndShadow(contentHtml, shadowHtml, label) -{ - var targetContainer = document.getElementById("targetContainer"); - cleanupContainer(targetContainer); - var target = createTargetTree(contentHtml, shadowHtml); - targetContainer.appendChild(target); - var targetLayoutTree = removeContainerLines(internals.elementLayoutTreeAsText(targetContainer)); - - var referenceContainer = document.getElementById("referenceContainer"); - cleanupContainer(referenceContainer); - var separator = "<!-- -->"; // Uses a separator for keeping text node separate. - var referenceHtml = shadowHtml.replace("<content/>", (separator + contentHtml + separator)); - var reference = createTreeFrom(referenceHtml); - referenceContainer.appendChild(reference); - var referenceLayoutTree = removeContainerLines(internals.elementLayoutTreeAsText(referenceContainer)); - if (targetLayoutTree == referenceLayoutTree) - log("PASS[" + label + "]: content=" + contentHtml + " shadow=" + shadowHtml); - else { - log("FAIL[" + label + "]: content=" + contentHtml + " shadow=" + shadowHtml); - log("Expected: (for " + reference.innerHTML + ")"); - log(referenceLayoutTree); - log("Actual: (for " + target.innerHTML + ")"); - log(targetLayoutTree); - } -} - -function removeContainerLines(text) -{ - var lines = text.split("\n"); - lines.splice(0, 2); - return lines.join("\n"); -} - -function test() -{ - testRunner.dumpAsText(); - log("This test compares a shadow-based render tree with one for a reference DOM tree."); - log("Note that this test only runs on DRT."); - - for (var i = 0; i < contentSources.length; ++i) { - for (var j = 0; j < shadowSources.length; ++j) { - var testLabel = i + "," + j; - testWithContentAndShadow(contentSources[i], shadowSources[j], testLabel); - } - } - - document.getElementById("test").style.display = "none"; - document.getElementById("console").style.display = "block"; -} -</script> -</head> -<body onload="test()"> -<div id="test"> -<div class="container" id="targetContainer"></div> -<div class="container" id="referenceContainer"></div> -</div> -<pre id="console" style="display: none;"></pre> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-element-select-dynamic-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-element-select-dynamic-expected.txt deleted file mode 100644 index dfd2d28fc..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-element-select-dynamic-expected.txt +++ /dev/null
@@ -1,13 +0,0 @@ -CONSOLE WARNING: line 29: Element.createShadowRoot is deprecated and will be removed in M80, around February 2020. Please use Element.attachShadow instead. See https://www.chromestatus.com/features/4507242028072960 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -testChangeSelect1 -PASS -testChangeSelect2 -PASS -testChangeSelectToEmpty -PASS -testChangeSelectToFallback -PASS -testChangeSelectFromFallback -PASS -TEST COMPLETED -
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-element-select-dynamic.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-element-select-dynamic.html deleted file mode 100644 index 0496296f..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-element-select-dynamic.html +++ /dev/null
@@ -1,179 +0,0 @@ - <!DOCTYPE html> -<html> -<head> -<style> -/* relative positioning ensures underlying Layer */ -.container { - position: relative; -} - -.span { - display: boxed-inline; - margin: 2px; - border: solid; -} -</style> -<script src="../resources/shadow-test-driver.js"></script> -<script> -function testChangeSelect1(callIfDone) { - document.getElementById('expect-container').innerHTML = - "<div><span>BEFORE</span><span>LIGHT 2</span><span>AFTER</span></div>"; - - var root = document.createElement('div'); - - // Create light tree. - root.innerHTML = "<span class='c1'>LIGHT 1</span><span class='c2'>LIGHT 2</span>"; - - // Create shadow tree. - var content = createContentWithSelect('.c1'); - var sr = root.createShadowRoot(); - sr.appendChild(createSpanWithText("BEFORE")); - sr.appendChild(content); - sr.appendChild(createSpanWithText("AFTER")); - - document.getElementById('actual-container').appendChild(root); - - var f = (function(root, content, callIfDone) { - return function() { - content.setAttribute('select', '.c2'); - callIfDone(); - }; - })(root, content, callIfDone); - - setTimeout(f, 0); -} - -function testChangeSelect2(callIfDone) { - document.getElementById('expect-container').innerHTML = - "<div><span>BEFORE</span><span>LIGHT 1</span><span>LIGHT 2</span><span>AFTER</span></div>"; - - var root = document.createElement('div'); - - // Create light tree. - root.innerHTML = "<span class='c1'>LIGHT 1</span><span class='c2'>LIGHT 2</span>"; - - // Create shadow tree. - var content = createContentWithSelect('.c1'); - var sr = root.createShadowRoot(); - sr.appendChild(createSpanWithText("BEFORE")); - sr.appendChild(content); - sr.appendChild(createSpanWithText("AFTER")); - - document.getElementById('actual-container').appendChild(root); - - var f = (function(root, content, callIfDone) { - return function() { - content.setAttribute('select', 'span'); - callIfDone(); - }; - })(root, content, callIfDone); - - setTimeout(f, 0); -} - -function testChangeSelectToEmpty(callIfDone) { - document.getElementById('expect-container').innerHTML = - "<div><span>BEFORE</span><span>LIGHT 1</span><span>LIGHT 2</span><span>AFTER</span></div>"; - - var root = document.createElement('div'); - - // Create light tree. - root.innerHTML = "<span class='c1'>LIGHT 1</span><span class='c2'>LIGHT 2</span>"; - - // Create shadow tree. - var content = createContentWithSelect('.c1'); - var sr = root.createShadowRoot(); - sr.appendChild(createSpanWithText("BEFORE")); - sr.appendChild(content); - sr.appendChild(createSpanWithText("AFTER")); - - document.getElementById('actual-container').appendChild(root); - - var f = (function(root, content, callIfDone) { - return function() { - content.removeAttribute('select'); - callIfDone(); - }; - })(root, content, callIfDone); - - setTimeout(f, 0); -} - -function testChangeSelectToFallback(callIfDone) { - document.getElementById('expect-container').innerHTML = - "<div><span>BEFORE</span><span>FALLBACK</span><span>AFTER</span></div>"; - - var root = document.createElement('div'); - - // Create light tree. - root.innerHTML = "<span class='c1'>LIGHT 1</span><span class='c2'>LIGHT 2</span>"; - - // Create shadow tree. - var content = createContentWithSelect('.c1'); - content.innerHTML = "<span>FALLBACK</span>" - - var sr = root.createShadowRoot(); - sr.appendChild(createSpanWithText("BEFORE")); - sr.appendChild(content); - sr.appendChild(createSpanWithText("AFTER")); - - document.getElementById('actual-container').appendChild(root); - - var f = (function(root, content, callIfDone) { - return function() { - content.setAttribute('select', 'div') - callIfDone(); - }; - })(root, content, callIfDone); - - setTimeout(f, 0); -} - -function testChangeSelectFromFallback(callIfDone) { - document.getElementById('expect-container').innerHTML = - "<div><span>BEFORE</span><span>LIGHT 1</span><span>LIGHT 2</span><span>AFTER</span></div>"; - - var root = document.createElement('div'); - - // Create light tree. - root.innerHTML = "<span class='c1'>LIGHT 1</span><span class='c2'>LIGHT 2</span>"; - - // Create shadow tree. - var content = createContentWithSelect('div'); - content.innerHTML = "<span>FALLBACK</span>" - - var sr = root.createShadowRoot(); - sr.appendChild(createSpanWithText("BEFORE")); - sr.appendChild(content); - sr.appendChild(createSpanWithText("AFTER")); - - document.getElementById('actual-container').appendChild(root); - - var f = (function(root, content, callIfDone) { - return function() { - content.setAttribute('select', 'span') - callIfDone(); - }; - })(root, content, callIfDone); - - setTimeout(f, 0); -} - -var testFuncs = [ - testChangeSelect1, - testChangeSelect2, - testChangeSelectToEmpty, - testChangeSelectToFallback, - testChangeSelectFromFallback, -]; - -</script> -</head> -<body onload="doTest(testFuncs)"> - -<div id="actual-container" class="container"></div> -<div id="expect-container" class="container"></div> -<pre id="console"></pre> - -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-element-select-namespace-expected.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-element-select-namespace-expected.html deleted file mode 100644 index 2a6c5db..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-element-select-namespace-expected.html +++ /dev/null
@@ -1,3 +0,0 @@ -<!DOCTYPE html> -<p>You should see the word PASS below.</p> -<span>PASS</span>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-element-select-namespace-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-element-select-namespace-expected.txt deleted file mode 100644 index fd094f7..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-element-select-namespace-expected.txt +++ /dev/null
@@ -1 +0,0 @@ -CONSOLE WARNING: line 9: Element.createShadowRoot is deprecated and will be removed in M80, around February 2020. Please use Element.attachShadow instead. See https://www.chromestatus.com/features/4507242028072960 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details.
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-element-select-namespace.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-element-select-namespace.html deleted file mode 100644 index 6cbdf3b..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-element-select-namespace.html +++ /dev/null
@@ -1,11 +0,0 @@ -<!DOCTYPE html> -<p>You should see the word PASS below.</p> -<host> - <span id="s1">FAIL</span> - <span id="s2">PASS</span> -</host> -<script> - var h = document.querySelector("host"); - var r = h.createShadowRoot(); - r.innerHTML = '<content select="bogus|span#s1"></content><content select="*|span#s2"></content>'; -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element-css-text-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element-css-text-expected.txt deleted file mode 100644 index f55aa51..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element-css-text-expected.txt +++ /dev/null
@@ -1,13 +0,0 @@ -Test for cssText of '::content' rule. - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - -PASS document.getElementById('style1').sheet.cssRules.item(0).cssText is ".foo::content div .bar::before { display: block; }" -PASS document.getElementById('style1').sheet.cssRules.item(1).cssText is "::content { display: block; }" -PASS document.getElementById('style1').sheet.cssRules.item(2).cssText is "div content::content div content::content div.green { color: green; }" -PASS document.getElementById('style1').sheet.cssRules.item(3).cssText is "::content * { color: blue; }" -PASS document.getElementById('style1').sheet.cssRules.length is 4 -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element-css-text.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element-css-text.html deleted file mode 100644 index 22aea9b..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element-css-text.html +++ /dev/null
@@ -1,21 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script src="../../../resources/js-test.js"></script> -<style id="style1"> -.foo::content div .bar::before { display: block; } -::content { display: block; } -div content::content div content::content div.green { color: green; } -*::content * { color: blue; } -div::shadow::shadow::content { } -</style> -</head> -<script> -description("Test for cssText of '::content' rule."); -shouldBeEqualToString("document.getElementById('style1').sheet.cssRules.item(0).cssText", ".foo::content div .bar::before { display: block; }"); -shouldBeEqualToString("document.getElementById('style1').sheet.cssRules.item(1).cssText", "::content { display: block; }"); -shouldBeEqualToString("document.getElementById('style1').sheet.cssRules.item(2).cssText", "div content::content div content::content div.green { color: green; }"); -shouldBeEqualToString("document.getElementById('style1').sheet.cssRules.item(3).cssText", "::content * { color: blue; }"); -shouldBe("document.getElementById('style1').sheet.cssRules.length", "4"); -</script> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element-dynamic-attribute-change-expected.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element-dynamic-attribute-change-expected.html deleted file mode 100644 index cb0b30d..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element-dynamic-attribute-change-expected.html +++ /dev/null
@@ -1,11 +0,0 @@ -<!DOCTYPE html> -<html> -<head> - <title>::content pseudo elements with dynamic attribute change</title> -</head> -<body> - <div id="host"> - <div id="child" style="background: green;">I should be green.</div> - </div> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element-dynamic-attribute-change-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element-dynamic-attribute-change-expected.txt deleted file mode 100644 index ec880e49..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element-dynamic-attribute-change-expected.txt +++ /dev/null
@@ -1 +0,0 @@ -CONSOLE WARNING: line 13: Element.createShadowRoot is deprecated and will be removed in M80, around February 2020. Please use Element.attachShadow instead. See https://www.chromestatus.com/features/4507242028072960 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details.
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element-dynamic-attribute-change.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element-dynamic-attribute-change.html deleted file mode 100644 index 6327c38..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element-dynamic-attribute-change.html +++ /dev/null
@@ -1,25 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<title>::content pseudo elements with dynamic attribute change</title> -</head> -<body> -<div id="host"> - <div id="child">I should be green.</div> - </div> -<script> -if (window.testRunner) - testRunner.waitUntilDone(); -var shadowRoot = document.getElementById('host').createShadowRoot(); -shadowRoot.innerHTML = '<style>content::content .selected { ' + - 'background: green; }</style>' + - '<content></content>'; - -setTimeout(function() { - document.getElementById('child').classList.add('selected'); - if (window.testRunner) - testRunner.notifyDone(); -}, 0); -</script> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element-dynamic-class-expected.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element-dynamic-class-expected.html deleted file mode 100644 index 5d62004..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element-dynamic-class-expected.html +++ /dev/null
@@ -1,8 +0,0 @@ -<!DOCTYPE html> -<style> -.square { width: 100px; height: 100px; background-color: green; } -</style> -<p>You should see two green squares below.</p> -<div class="square"></div> -<br> -<div class="square"></div>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element-dynamic-class-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element-dynamic-class-expected.txt deleted file mode 100644 index f551a8c..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element-dynamic-class-expected.txt +++ /dev/null
@@ -1 +0,0 @@ -CONSOLE WARNING: line 14: Element.createShadowRoot is deprecated and will be removed in M80, around February 2020. Please use Element.attachShadow instead. See https://www.chromestatus.com/features/4507242028072960 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details.
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element-dynamic-class.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element-dynamic-class.html deleted file mode 100644 index b23165c..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element-dynamic-class.html +++ /dev/null
@@ -1,19 +0,0 @@ -<!DOCTYPE html> -<style> -.square { width: 100px; height: 100px; } -</style> -<p>You should see two green squares below.</p> -<div id="host1"> - <div class="square"></div> -</div> -<br> -<div id="host2"> - <div class="square"></div> -</div> -<script> -host1.createShadowRoot().innerHTML = "<style>.c::content .square { background-color: green }</style><content></content>"; -host2.createShadowRoot().innerHTML = "<style>.c::content * { background-color: green }</style><content></content>"; -document.body.offsetTop; // Force style recalc. -host1.shadowRoot.querySelector("content").className = "c"; -host2.shadowRoot.querySelector("content").className = "c"; -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element-expected.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element-expected.html deleted file mode 100644 index 64c26e2..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element-expected.html +++ /dev/null
@@ -1,9 +0,0 @@ -<!DOCTYPE html> -<html> -<body> -<div id="sandbox"> - <div id="host"> - <div style="color: green">green</div> - </div> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element-expected.txt deleted file mode 100644 index 6f972e1c..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element-expected.txt +++ /dev/null
@@ -1 +0,0 @@ -CONSOLE WARNING: line 87: Element.createShadowRoot is deprecated and will be removed in M80, around February 2020. Please use Element.attachShadow instead. See https://www.chromestatus.com/features/4507242028072960 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details.
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element-match-all-expected.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element-match-all-expected.html deleted file mode 100644 index 9a60b72..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element-match-all-expected.html +++ /dev/null
@@ -1,16 +0,0 @@ -<!DOCTYPE html> -<html> -<body> -<div id="sandbox"> - <div id="host"> - <div> - normal - <div style="color: green">green</div> - </div> - <div> - normal - <div style="color: green">green</div> - </div> - </div> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element-match-all-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element-match-all-expected.txt deleted file mode 100644 index 6f972e1c..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element-match-all-expected.txt +++ /dev/null
@@ -1 +0,0 @@ -CONSOLE WARNING: line 87: Element.createShadowRoot is deprecated and will be removed in M80, around February 2020. Please use Element.attachShadow instead. See https://www.chromestatus.com/features/4507242028072960 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details.
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element-match-all.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element-match-all.html deleted file mode 100644 index 3982b70a..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element-match-all.html +++ /dev/null
@@ -1,28 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script src="resources/shadow-dom.js"></script> -</head> -<body> -<div id="sandbox"></div> -<script> -var shadowStyle = document.createElement('style'); -shadowStyle.innerHTML = 'content::content .hello { color: green; }'; - -var sandbox = document.getElementById('sandbox'); -sandbox.appendChild( - createDOM('div', {'id': 'host'}, - createShadowRoot( - shadowStyle, - createDOM('content')), - createDOM('div', {}, - document.createTextNode('normal'), - createDOM('div', {'class': 'hello'}, - document.createTextNode('green'))), - createDOM('div', {}, - document.createTextNode('normal'), - createDOM('div', {'class': 'hello'}, - document.createTextNode('green'))))); -</script> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element-match-descendant-expected.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element-match-descendant-expected.html deleted file mode 100644 index 1c18785..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element-match-descendant-expected.html +++ /dev/null
@@ -1,11 +0,0 @@ -<!DOCTYPE html> -<html> -<body> -<div id="sandbox"> - <div id="host"> - <p> - <div style="color: green">green</div> - </p> - </div> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element-match-descendant-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element-match-descendant-expected.txt deleted file mode 100644 index 6f972e1c..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element-match-descendant-expected.txt +++ /dev/null
@@ -1 +0,0 @@ -CONSOLE WARNING: line 87: Element.createShadowRoot is deprecated and will be removed in M80, around February 2020. Please use Element.attachShadow instead. See https://www.chromestatus.com/features/4507242028072960 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details.
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element-match-descendant.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element-match-descendant.html deleted file mode 100644 index 7cc0952f..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element-match-descendant.html +++ /dev/null
@@ -1,23 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script src="resources/shadow-dom.js"></script> -</head> -<body> -<div id="sandbox"></div> -<script> -var shadowStyle = document.createElement('style'); -shadowStyle.innerHTML = 'content::content div { color: green; }'; - -var sandbox = document.getElementById('sandbox'); -sandbox.appendChild( - createDOM('div', {}, - createShadowRoot( - shadowStyle, - createDOM('content')), - createDOM('p', {}, - createDOM('div', {}, - document.createTextNode('green'))))); -</script> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element-nested-expected.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element-nested-expected.html deleted file mode 100644 index e5183442..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element-nested-expected.html +++ /dev/null
@@ -1,20 +0,0 @@ -<!DOCTYPE html> -<html> -<body> -<div id="sandbox"> - <div id="host"> - <div id="nested-host"> - text1 - <div> - text2 - <div> - text3 - <div style="color: green">green</div> - <div>normal</div> - </div> - </div> - </div> - </div> -</div> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element-nested-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element-nested-expected.txt deleted file mode 100644 index 6f972e1c..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element-nested-expected.txt +++ /dev/null
@@ -1 +0,0 @@ -CONSOLE WARNING: line 87: Element.createShadowRoot is deprecated and will be removed in M80, around February 2020. Please use Element.attachShadow instead. See https://www.chromestatus.com/features/4507242028072960 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details.
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element-nested.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element-nested.html deleted file mode 100644 index 55946c7..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element-nested.html +++ /dev/null
@@ -1,32 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script src="resources/shadow-dom.js"></script> -</head> -<body> -<div id="sandbox"></div> -<script> -var shadowStyle = document.createElement('style'); -shadowStyle.innerHTML = 'div content::content div content::content div.green { color: green; }'; - -var sandbox = document.getElementById('sandbox'); -sandbox.appendChild( - createDOM('div', {'id': 'host'}, - createShadowRoot( - createDOM('div', {'id': 'nested-host'}, - createShadowRoot( - shadowStyle, - document.createTextNode('text1'), - createDOM('div', {}, - document.createTextNode('text2'), - createDOM('content', {'select': 'div'}))), - createDOM('div', {'class': 'green'}, - document.createTextNode('text3'), - createDOM('content', {})))), - createDOM('div', {'class': 'green'}, - document.createTextNode('green')), - createDOM('div', {}, - document.createTextNode('normal')))); -</script> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element-not-last-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element-not-last-expected.txt deleted file mode 100644 index 2de6713..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element-not-last-expected.txt +++ /dev/null
@@ -1,11 +0,0 @@ -CONSOLE WARNING: line 9: Element.createShadowRoot is deprecated and will be removed in M80, around February 2020. Please use Element.attachShadow instead. See https://www.chromestatus.com/features/4507242028072960 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -Accept simple selectors after ::content For Polymer 0.5 compat - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - -PASS getComputedStyle(distributed).color is "rgb(0, 128, 0)" -PASS successfullyParsed is true - -TEST COMPLETE - -This text should be green
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element-not-last.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element-not-last.html deleted file mode 100644 index 39e13ed..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element-not-last.html +++ /dev/null
@@ -1,13 +0,0 @@ -<!DOCTYPE html> -<script src="../../../resources/js-test.js"></script> -<div id="host"> - <span id="distributed">This text should be green</span> -</div> -<script> - description("Accept simple selectors after ::content For Polymer 0.5 compat"); - - var root = host.createShadowRoot(); - root.innerHTML = '<style>[select]::content.x span { color: green }</style><content class="x" select="span"></content>'; - - shouldBeEqualToString("getComputedStyle(distributed).color", "rgb(0, 128, 0)"); -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element-overridden-2-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element-overridden-2-expected.txt deleted file mode 100644 index fdad600..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element-overridden-2-expected.txt +++ /dev/null
@@ -1,10 +0,0 @@ -CONSOLE WARNING: line 87: Element.createShadowRoot is deprecated and will be removed in M80, around February 2020. Please use Element.attachShadow instead. See https://www.chromestatus.com/features/4507242028072960 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -Test for crbug.com/274059. Compare rules from a style in a shadow tree with ::content in a different shadow tree. - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - -PASS window.getComputedStyle(getNodeInComposedTree("hostChild")).color is "rgb(0, 128, 0)" -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element-overridden-2.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element-overridden-2.html deleted file mode 100644 index 18ca2dec..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element-overridden-2.html +++ /dev/null
@@ -1,31 +0,0 @@ -<!doctype html> -<html> -<head> -<script src="resources/shadow-dom.js"></script> -<script src="../../../resources/js-test.js"></script> -</head> -<body class="bodyClass"> - <div id='sandbox'></div> - <pre id='console'></pre> -</body> -<script> -description('Test for crbug.com/274059. Compare rules from a style in a shadow tree with ::content in a different shadow tree.'); - -var sandbox = document.getElementById('sandbox'); -sandbox.appendChild( - createDOM('div', {'id': 'host'}, - createShadowRoot( - createDOM('style', {}, - document.createTextNode('::content > * { color: green; }')), - createDOM('content', {})), - createDOM('div', {'id': 'hostChild', 'class': 'contentClass'}, - createShadowRoot( - createDOM('style', {}, - document.createTextNode(':host { color: red; }')), - createDOM('span', {}, - document.createTextNode('Hello')))))); -shouldBe('window.getComputedStyle(getNodeInComposedTree("hostChild")).color', '"rgb(0, 128, 0)"'); -sandbox.innerHTML = ''; - -</script> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element-overridden-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element-overridden-expected.txt deleted file mode 100644 index 811e802b6..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element-overridden-expected.txt +++ /dev/null
@@ -1,12 +0,0 @@ -CONSOLE WARNING: line 33: Element.createShadowRoot is deprecated and will be removed in M80, around February 2020. Please use Element.attachShadow instead. See https://www.chromestatus.com/features/4507242028072960 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -content - -Test for crbug.com/274059. Should be able to override ::content styles in shadow root style sheet from the document. - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - -PASS window.getComputedStyle(document.querySelector(".contentClass")).color is "rgb(0, 0, 255)" -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element-overridden.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element-overridden.html deleted file mode 100644 index 7ef8cd5..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element-overridden.html +++ /dev/null
@@ -1,38 +0,0 @@ -<!doctype html> -<html> -<head> -<script src="../../../resources/js-test.js"></script> -<style> - .contentClass { - color: blue; - } -</style> -</head> -<body class="bodyClass"> - - <template id="tmpl"> - <style> - ::content > * { - color: red; - } - </style> - <content></content> - </template> - - <div id="host" class="hostClass"> - <div class="contentClass"> - content - </div> - </div> - - <pre id='console'></pre> -</body> -<script> -description('Test for crbug.com/274059. Should be able to override ::content styles in shadow root style sheet from the document.'); -var host = document.querySelector('#host'); -var root = host.createShadowRoot(); -var template = document.querySelector('#tmpl'); -root.appendChild(template.content); -shouldBe('window.getComputedStyle(document.querySelector(".contentClass")).color', '"rgb(0, 0, 255)"'); -</script> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element-relative-selector-css-text-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element-relative-selector-css-text-expected.txt deleted file mode 100644 index ec6ec37..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element-relative-selector-css-text-expected.txt +++ /dev/null
@@ -1,9 +0,0 @@ -Test for cssText of '::content' rule. - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - -PASS document.getElementById('style1').sheet.cssRules.item(0).cssText is ".foo::content > div .bar::before { display: block; }" -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element-relative-selector-css-text.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element-relative-selector-css-text.html deleted file mode 100644 index 86959e0..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element-relative-selector-css-text.html +++ /dev/null
@@ -1,13 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script src="../../../resources/js-test.js"></script> -<style id="style1"> -.foo::content > div .bar::before { display: block; } -</style> -</head> -<script> -description("Test for cssText of '::content' rule."); -shouldBeEqualToString("document.getElementById('style1').sheet.cssRules.item(0).cssText", ".foo::content > div .bar::before { display: block; }"); -</script> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element-relative-selector-expected.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element-relative-selector-expected.html deleted file mode 100644 index fe70f0a..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element-relative-selector-expected.html +++ /dev/null
@@ -1,16 +0,0 @@ -<!DOCTYPE html> -<html> -<body> -<div id="sandbox"> - <div> - <div> - <div1> - <div2>normal</div2> - </div1> - </div> - <div1> - <div2 style="color: green">green</div2> - </div1> - </div> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element-relative-selector-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element-relative-selector-expected.txt deleted file mode 100644 index 6f972e1c..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element-relative-selector-expected.txt +++ /dev/null
@@ -1 +0,0 @@ -CONSOLE WARNING: line 87: Element.createShadowRoot is deprecated and will be removed in M80, around February 2020. Please use Element.attachShadow instead. See https://www.chromestatus.com/features/4507242028072960 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details.
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element-relative-selector.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element-relative-selector.html deleted file mode 100644 index 23b46236..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element-relative-selector.html +++ /dev/null
@@ -1,27 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script src="resources/shadow-dom.js"></script> -</head> -<body> -<div id="sandbox"></div> -<script> -var shadowStyle = document.createElement('style'); -shadowStyle.innerHTML = 'content::content > div1 div2 { color: green; }'; - -var sandbox = document.getElementById('sandbox'); -sandbox.appendChild( - createDOM('div', {}, - createShadowRoot( - shadowStyle, - createDOM('content')), - createDOM('div', {}, - createDOM('div1', {}, - createDOM('div2', {}, - document.createTextNode('normal')))), - createDOM('div1', {}, - createDOM('div2', {}, - document.createTextNode('green'))))); -</script> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element-reprojection-expected.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element-reprojection-expected.html deleted file mode 100644 index e69c912..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element-reprojection-expected.html +++ /dev/null
@@ -1,13 +0,0 @@ -<!DOCTYPE html> -<html> -<body> -<div id="sandbox"> - <div id="host"> - <div id="host2"> - <div style='color: green'> - green - </div> - </div> - </div> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element-reprojection-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element-reprojection-expected.txt deleted file mode 100644 index 6f972e1c..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element-reprojection-expected.txt +++ /dev/null
@@ -1 +0,0 @@ -CONSOLE WARNING: line 87: Element.createShadowRoot is deprecated and will be removed in M80, around February 2020. Please use Element.attachShadow instead. See https://www.chromestatus.com/features/4507242028072960 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details.
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element-reprojection.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element-reprojection.html deleted file mode 100644 index ac3c174..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element-reprojection.html +++ /dev/null
@@ -1,25 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script src="resources/shadow-dom.js"></script> -</head> -<body> -<div id="sandbox"></div> -<script> -var shadowStyle = document.createElement('style'); -shadowStyle.innerHTML = 'content::content .foo { color: green; }'; - -var sandbox = document.getElementById('sandbox'); -sandbox.appendChild( - createDOM('div', {'id': 'host'}, - createShadowRoot( - createDOM('div', {'id': 'host2'}, - createShadowRoot( - shadowStyle, - createDOM('content', {'select': '.foo'})), - createDOM('content'))), - createDOM('div', {'class': 'foo'}, - document.createTextNode('green')))); -</script> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element-specifiers-in-left-side-expected.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element-specifiers-in-left-side-expected.html deleted file mode 100644 index 6991306..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element-specifiers-in-left-side-expected.html +++ /dev/null
@@ -1,11 +0,0 @@ -<!DOCTYPE html> -<html> -<body> -<div id="sandbox"> - <div id="host"> - <div>normal</div> - <div style='color: green'>green</div> - <div style='color: blue'>blue</div> - </div> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element-specifiers-in-left-side-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element-specifiers-in-left-side-expected.txt deleted file mode 100644 index 6f972e1c..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element-specifiers-in-left-side-expected.txt +++ /dev/null
@@ -1 +0,0 @@ -CONSOLE WARNING: line 87: Element.createShadowRoot is deprecated and will be removed in M80, around February 2020. Please use Element.attachShadow instead. See https://www.chromestatus.com/features/4507242028072960 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details.
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element-specifiers-in-left-side.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element-specifiers-in-left-side.html deleted file mode 100644 index 2fa28ee..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element-specifiers-in-left-side.html +++ /dev/null
@@ -1,30 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script src="resources/shadow-dom.js"></script> -</head> -<body> -<div id="sandbox"></div> -<script> -var shadowStyle = document.createElement('style'); -shadowStyle.innerHTML = 'content.non-exist::content div { color: red; }' - + 'content.content-class::content div { color: green; }' - + '#content-id::content div { color: blue; }'; - -var sandbox = document.getElementById('sandbox'); -sandbox.appendChild( - createDOM('div', {'id': 'host'}, - createShadowRoot( - createDOM('content', {'select': '#host-child-1'}), - createDOM('content', {'class': 'content-class', 'select': '#host-child-2'}), - createDOM('content', {'id': 'content-id', 'select': '#host-child-3'}), - shadowStyle), - createDOM('div', {'id': 'host-child-1'}, - document.createTextNode('normal')), - createDOM('div', {'id': 'host-child-2'}, - document.createTextNode('green')), - createDOM('div', {'id': 'host-child-3'}, - document.createTextNode('blue')))); -</script> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element-support-selector-expected.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element-support-selector-expected.html deleted file mode 100644 index 23dede1..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element-support-selector-expected.html +++ /dev/null
@@ -1,16 +0,0 @@ -<!DOCTYPE html> -<html> -<body> -<div id="sandbox"> - <div id="host"> - <div> - normal - <div style="color: green">green</div> - </div> - <div> - normal - <div>normal</div> - </div> - </div> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element-support-selector-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element-support-selector-expected.txt deleted file mode 100644 index 6f972e1c..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element-support-selector-expected.txt +++ /dev/null
@@ -1 +0,0 @@ -CONSOLE WARNING: line 87: Element.createShadowRoot is deprecated and will be removed in M80, around February 2020. Please use Element.attachShadow instead. See https://www.chromestatus.com/features/4507242028072960 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details.
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element-support-selector.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element-support-selector.html deleted file mode 100644 index c14bdaf..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element-support-selector.html +++ /dev/null
@@ -1,28 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script src="resources/shadow-dom.js"></script> -</head> -<body> -<div id="sandbox"></div> -<script> -var shadowStyle = document.createElement('style'); -shadowStyle.innerHTML = 'content::content div.hello div { color: green; }'; - -var sandbox = document.getElementById('sandbox'); -sandbox.appendChild( - createDOM('div', {'id': 'host'}, - createShadowRoot( - shadowStyle, - createDOM('content')), - createDOM('div', {'class': 'hello'}, - document.createTextNode('normal'), - createDOM('div', {}, - document.createTextNode('green'))), - createDOM('div', {}, - document.createTextNode('normal'), - createDOM('div', {}, - document.createTextNode('normal'))))); -</script> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element-used-in-selector-list-expected.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element-used-in-selector-list-expected.html deleted file mode 100644 index bb8253e..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element-used-in-selector-list-expected.html +++ /dev/null
@@ -1,11 +0,0 @@ -<!DOCTYPE html> -<html> -<body> -<div id="sandbox"> - <div id="host"> - <div style="color: green">green</div> - <p>normal</p> - <p style="color: green">green</p> - </div> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element-used-in-selector-list-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element-used-in-selector-list-expected.txt deleted file mode 100644 index 6f972e1c..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element-used-in-selector-list-expected.txt +++ /dev/null
@@ -1 +0,0 @@ -CONSOLE WARNING: line 87: Element.createShadowRoot is deprecated and will be removed in M80, around February 2020. Please use Element.attachShadow instead. See https://www.chromestatus.com/features/4507242028072960 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details.
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element-used-in-selector-list.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element-used-in-selector-list.html deleted file mode 100644 index a5a8075..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element-used-in-selector-list.html +++ /dev/null
@@ -1,26 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script src="resources/shadow-dom.js"></script> -</head> -<body> -<div id="sandbox"></div> -<script> -var shadowStyle = document.createElement('style'); -shadowStyle.innerHTML = 'content::content div, p { color: green; }'; - -var sandbox = document.getElementById('sandbox'); -sandbox.appendChild( - createDOM('div', {'id': 'host'}, - createShadowRoot( - shadowStyle, - createDOM('content'), - createDOM('p', {}, - document.createTextNode('green'))), - createDOM('div', {}, - document.createTextNode('green')), - createDOM('p', {'class': 'hello'}, - document.createTextNode('normal')))); -</script> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element-with-any-expected.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element-with-any-expected.html deleted file mode 100644 index 1737994..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element-with-any-expected.html +++ /dev/null
@@ -1,18 +0,0 @@ -<!DOCTYPE html> -<html> -<body> -<div id="sandbox"> - <div> - <div>normal</div> - <div style="color: green">green</div> - </div> - <div> - <div>normal</div> - <div style="color: red">red</div> - </div> - <div> - <div>normal</div> - <div style="color: blue">blue</div> - </div> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element-with-any-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element-with-any-expected.txt deleted file mode 100644 index 6f972e1c..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element-with-any-expected.txt +++ /dev/null
@@ -1 +0,0 @@ -CONSOLE WARNING: line 87: Element.createShadowRoot is deprecated and will be removed in M80, around February 2020. Please use Element.attachShadow instead. See https://www.chromestatus.com/features/4507242028072960 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details.
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element-with-any.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element-with-any.html deleted file mode 100644 index bb12f11..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element-with-any.html +++ /dev/null
@@ -1,49 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script src="resources/shadow-dom.js"></script> -</head> -<body> -<div id="sandbox"></div> -<script> -var shadowStyle1 = document.createElement('style'); -shadowStyle1.innerHTML = '*::content div { color: green; }'; - -var shadowStyle2 = document.createElement('style'); -shadowStyle2.innerHTML = 'content::content * { color: red; }'; - -var shadowStyle3 = document.createElement('style'); -shadowStyle3.innerHTML = '*::content * { color: blue; }'; - -var sandbox = document.getElementById('sandbox'); -sandbox.appendChild( - createDOM('div', {}, - createShadowRoot( - shadowStyle1, - createDOM('div', {}, - document.createTextNode('normal')), - createDOM('content')), - createDOM('div', {}, - document.createTextNode('green')))); - -sandbox.appendChild( - createDOM('div', {}, - createShadowRoot( - shadowStyle2, - createDOM('div', {}, - document.createTextNode('normal')), - createDOM('content')), - createDOM('div', {}, - document.createTextNode('red')))); -sandbox.appendChild( - createDOM('div', {}, - createShadowRoot( - shadowStyle3, - createDOM('div', {}, - document.createTextNode('normal')), - createDOM('content')), - createDOM('div', {}, - document.createTextNode('blue')))); -</script> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element-with-host-pseudo-class-2-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element-with-host-pseudo-class-2-expected.txt deleted file mode 100644 index ed5d69f..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element-with-host-pseudo-class-2-expected.txt +++ /dev/null
@@ -1,12 +0,0 @@ -CONSOLE WARNING: line 87: Element.createShadowRoot is deprecated and will be removed in M80, around February 2020. Please use Element.attachShadow instead. See https://www.chromestatus.com/features/4507242028072960 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -content - -Test for crbug.com/274063: cannot style ::content with a rule that includes :host. - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - -PASS window.getComputedStyle(document.querySelector("#host1 > .content")).color is "rgb(0, 128, 0)" -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element-with-host-pseudo-class-2.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element-with-host-pseudo-class-2.html deleted file mode 100644 index 48414cb..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element-with-host-pseudo-class-2.html +++ /dev/null
@@ -1,32 +0,0 @@ -<!doctype html> -<html> -<head> -<script src="resources/shadow-dom.js"></script> -<script src="../../../resources/js-test.js"></script> -</head> -<body class="bodyClass"> - <div id="sandbox"></div> - <pre id="console"></pre> -</body> -<script> -description("Test for crbug.com/274063: cannot style ::content with a rule that includes :host."); - -var sandbox = document.getElementById('sandbox'); - -sandbox.appendChild( - createDOM('div', {'id': 'host1'}, - createShadowRoot( - createDOM('style', {}, - document.createTextNode(':host > div > ::content > * { color: green; }')), - createDOM('div', {'id': 'host2'}, - createShadowRoot( - createDOM('style', {}, - document.createTextNode(':host > ::content > * { color: red; }')), - createDOM('content', {'id': 'content2'})), - createDOM('content', {'id': 'content1'}))), - createDOM('div', {'class': 'content'}, - document.createTextNode('content')))); - -shouldBe('window.getComputedStyle(document.querySelector("#host1 > .content")).color', '"rgb(0, 128, 0)"'); -</script> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element-with-host-pseudo-class-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element-with-host-pseudo-class-expected.txt deleted file mode 100644 index 6cbf878..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element-with-host-pseudo-class-expected.txt +++ /dev/null
@@ -1,12 +0,0 @@ -CONSOLE WARNING: line 34: Element.createShadowRoot is deprecated and will be removed in M80, around February 2020. Please use Element.attachShadow instead. See https://www.chromestatus.com/features/4507242028072960 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -content - -Test for crbug.com/274063, cannot style ::content with a rule that includes :host. - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - -PASS window.getComputedStyle(document.querySelector("#host > .content")).color is "rgb(255, 0, 0)" -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element-with-host-pseudo-class.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element-with-host-pseudo-class.html deleted file mode 100644 index 68fd009..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element-with-host-pseudo-class.html +++ /dev/null
@@ -1,40 +0,0 @@ -<!doctype html> -<html> -<head> -<script src="resources/shadow-dom.js"></script> -<script src="../../../resources/js-test.js"></script> -</head> -<body class="bodyClass"> - - <template id="tmpl"> - <style> - :host > .blue { - color: blue; - } - :host > ::content > * { - color: red; - } - </style> - <div class="blue">I am blue!</div> - <content></content> - </template> - - <div id="host" class="hostClass"> - <div class="content"> - content - </div> - </div> - - <pre id="console"></pre> -</body> -<script> -description("Test for crbug.com/274063, cannot style ::content with a rule that includes :host."); - -var host = document.querySelector('#host'); -var root = host.createShadowRoot(); -var template = document.querySelector('#tmpl'); -root.appendChild(template.content); - -shouldBe('window.getComputedStyle(document.querySelector("#host > .content")).color', '"rgb(255, 0, 0)"'); -</script> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element-with-nested-shadow-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element-with-nested-shadow-expected.txt deleted file mode 100644 index caac767..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element-with-nested-shadow-expected.txt +++ /dev/null
@@ -1,11 +0,0 @@ -CONSOLE WARNING: line 87: Element.createShadowRoot is deprecated and will be removed in M80, around February 2020. Please use Element.attachShadow instead. See https://www.chromestatus.com/features/4507242028072960 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -Test for http://crbug.com/360679, ::content rules in nested ShadowDOM should match correctly. - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - -PASS window.getComputedStyle(sandbox.querySelector('#host > .special')).backgroundColor is not "rgb(255, 0, 0)" -PASS successfullyParsed is true - -TEST COMPLETE - -I should not be red.
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element-with-nested-shadow.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element-with-nested-shadow.html deleted file mode 100644 index d9d5843..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element-with-nested-shadow.html +++ /dev/null
@@ -1,30 +0,0 @@ -<!DOCTYPE html> -<script src="resources/shadow-dom.js"></script> -<script src="../../../resources/js-test.js"></script> - -<div id="sandbox"></div> - -<script> -description('Test for http://crbug.com/360679, ::content rules in nested ShadowDOM should match correctly.'); - -var sandbox = document.getElementById('sandbox'); - -sandbox.appendChild( - createDOM('div', {'id': 'host'}, - createShadowRoot( - createDOM('div', {'id': 'container'}, - createShadowRoot( - createDOM('style', {}, - document.createTextNode( - '.foo::content > .special { background: red; }')), - createDOM('content')), - createDOM('div', {}, - createDOM('content', {'class': 'foo'})))), - createDOM('div', {'class': 'special'}, - document.createTextNode( - 'I should not be red.')))); - -shouldNotBe("window.getComputedStyle(sandbox.querySelector('#host > .special')).backgroundColor", '"rgb(255, 0, 0)"'); -</script> - -
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element.html deleted file mode 100644 index 2d4d5eb4..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-pseudo-element.html +++ /dev/null
@@ -1,22 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script src="resources/shadow-dom.js"></script> -</head> -<body> -<div id="sandbox"></div> -<script> -var shadowStyle = document.createElement('style'); -shadowStyle.innerHTML = 'content::content div { color: green; }'; - -var sandbox = document.getElementById('sandbox'); -sandbox.appendChild( - createDOM('div', {}, - createShadowRoot( - shadowStyle, - createDOM('content')), - createDOM('div', {}, - document.createTextNode('green')))); -</script> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-reprojection-complex-expected.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-reprojection-complex-expected.html deleted file mode 100644 index ac819ea..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-reprojection-complex-expected.html +++ /dev/null
@@ -1,16 +0,0 @@ -<!DOCTYPE html> -<html> - -<p>This test ensures that content element can select elements assigned to a shadow element.</p> - -<div id="host1"> - <h2>A</h2> - <div>A</div> - <div>A</div> - <div>A</div> - <h2>B</h2> - <div>B</div> - <div>B</div> -</div> - -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-reprojection-complex-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-reprojection-complex-expected.txt deleted file mode 100644 index 6011eeb..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-reprojection-complex-expected.txt +++ /dev/null
@@ -1 +0,0 @@ -CONSOLE WARNING: line 15: Element.createShadowRoot is deprecated and will be removed in M80, around February 2020. Please use Element.attachShadow instead. See https://www.chromestatus.com/features/4507242028072960 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details.
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-reprojection-complex.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-reprojection-complex.html deleted file mode 100644 index d5e284de..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-reprojection-complex.html +++ /dev/null
@@ -1,22 +0,0 @@ -<!DOCTYPE html> -<html> - - -<p>This test ensures that content element can select elements assigned to a shadow element.</p> - -<div id="host1"> - <div class="A">A</div> - <div class="A">A</div> - <div class="B">B</div> - <div class="B">B</div> -</div> - -<script> -var shadowRoot1 = host1.createShadowRoot(); -shadowRoot1.innerHTML = '<div id="host2"><content select=".A"></content><shadow></shadow><div class="A">A</div></div>'; - -var shadowRoot2 = shadowRoot1.getElementById('host2').createShadowRoot(); -shadowRoot2.innerHTML = '<div><h2>A</h2><content select=".A"></content><h2>B</h2><shadow></shadow></div>' -</script> - -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-reprojection-dynamic-expected.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-reprojection-dynamic-expected.html deleted file mode 100644 index fed1408..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-reprojection-dynamic-expected.html +++ /dev/null
@@ -1,7 +0,0 @@ -<!DOCTYPE html> - -<html> - -<div id="host1"><div><div><div>dynamically added div</div></div></div></div> - -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-reprojection-dynamic-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-reprojection-dynamic-expected.txt deleted file mode 100644 index 04721e8..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-reprojection-dynamic-expected.txt +++ /dev/null
@@ -1 +0,0 @@ -CONSOLE WARNING: line 11: Element.createShadowRoot is deprecated and will be removed in M80, around February 2020. Please use Element.attachShadow instead. See https://www.chromestatus.com/features/4507242028072960 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details.
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-reprojection-dynamic.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-reprojection-dynamic.html deleted file mode 100644 index f0fa64c..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-reprojection-dynamic.html +++ /dev/null
@@ -1,32 +0,0 @@ -<!DOCTYPE html> - -<html> - -<div id="host1"></div> - -<script> -if (window.testRunner) - testRunner.waitUntilDone(); - -var shadowRoot1 = host1.createShadowRoot(); -shadowRoot1.innerHTML = '<div><div id="host2"><content></content></div></div>'; - -var host2 = shadowRoot1.getElementById('host2'); -var shadowRoot2 = host2.createShadowRoot(); -shadowRoot2.innerHTML = '<div id="host3"><content></content></div>'; - -var host3 = shadowRoot2.getElementById('host3'); -var shadowRoot3 = host3.createShadowRoot(); -shadowRoot3.innerHTML = '<div><content></content></div>'; - -setTimeout(function() { - var div = document.createElement('div'); - div.innerHTML = 'dynamically added div'; - host1.appendChild(div); - - if (window.testRunner) - testRunner.notifyDone(); -}, 0); -</script> - -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-reprojection-fallback-crash-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-reprojection-fallback-crash-expected.txt deleted file mode 100644 index 1e30133..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-reprojection-fallback-crash-expected.txt +++ /dev/null
@@ -1,9 +0,0 @@ -CONSOLE WARNING: line 13: Element.createShadowRoot is deprecated and will be removed in M80, around February 2020. Please use Element.attachShadow instead. See https://www.chromestatus.com/features/4507242028072960 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -A crash should not happen when fallback elements are reprojected. - -PASS distributedNodes.item(0) is shadowRoot1.getElementById("fallback") -PASS distributedNodes.item(1) is shadowRoot1.getElementById("div") -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-reprojection-fallback-crash.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-reprojection-fallback-crash.html deleted file mode 100644 index cd58d8c9..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-reprojection-fallback-crash.html +++ /dev/null
@@ -1,29 +0,0 @@ -<!DOCTYPE html> - -<html> -<script src="../../../resources/js-test.js"></script> - -<p>A crash should not happen when fallback elements are reprojected.</p> - -<div id="host1"></div> - -<pre id="console"></pre> - -<script> -var shadowRoot1 = host1.createShadowRoot(); -shadowRoot1.innerHTML = '<div id="host2"><content select="span"><div id="fallback">fallback element</div></content><div id="div">This should be selected.</div></div>'; - -var host2 = shadowRoot1.getElementById('host2'); -var shadowRoot2 = host2.createShadowRoot(); -shadowRoot2.innerHTML = '<content select="div"></content>'; - -var content = shadowRoot2.querySelector('content'); -var distributedNodes = content.getDistributedNodes(); - -shouldBe('distributedNodes.item(0)', 'shadowRoot1.getElementById("fallback")'); -shouldBe('distributedNodes.item(1)', 'shadowRoot1.getElementById("div")'); - -finishJSTest(); -</script> - -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-reprojection-fallback-expected.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-reprojection-fallback-expected.html deleted file mode 100644 index 71d705dc..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-reprojection-fallback-expected.html +++ /dev/null
@@ -1,14 +0,0 @@ -<!DOCTYPE html> - -<html> - -<p>Fallback elements for content insertion points should be rendered</p> - -<div id="host1"> - <div id="host2"> - <div>content fallback element</div> - <div>This should be selected.</div> - </div> -</div> - -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-reprojection-fallback-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-reprojection-fallback-expected.txt deleted file mode 100644 index 86a51cf..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-reprojection-fallback-expected.txt +++ /dev/null
@@ -1 +0,0 @@ -CONSOLE WARNING: line 10: Element.createShadowRoot is deprecated and will be removed in M80, around February 2020. Please use Element.attachShadow instead. See https://www.chromestatus.com/features/4507242028072960 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details.
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-reprojection-fallback-reprojection-expected.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-reprojection-fallback-reprojection-expected.html deleted file mode 100644 index a82d1e59..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-reprojection-fallback-reprojection-expected.html +++ /dev/null
@@ -1,18 +0,0 @@ -<!DOCTYPE html> - -<html> - -<p>Fallback elements for content insertion points should be rendered</p> - -<div id="host1"> - <div id="host2"> - <div id="host3"> - <div>content fallback element</div> - <div>This should be selected.</div> - <div>content fallback element</div> - <div>This also should be selected.</div> - </div> - </div> -</div> - -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-reprojection-fallback-reprojection-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-reprojection-fallback-reprojection-expected.txt deleted file mode 100644 index 86a51cf..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-reprojection-fallback-reprojection-expected.txt +++ /dev/null
@@ -1 +0,0 @@ -CONSOLE WARNING: line 10: Element.createShadowRoot is deprecated and will be removed in M80, around February 2020. Please use Element.attachShadow instead. See https://www.chromestatus.com/features/4507242028072960 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details.
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-reprojection-fallback-reprojection.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-reprojection-fallback-reprojection.html deleted file mode 100644 index eff8d96d..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-reprojection-fallback-reprojection.html +++ /dev/null
@@ -1,34 +0,0 @@ -<!DOCTYPE html> - -<html> - -<p>Fallback elements for content insertion points should be rendered</p> - -<div id="host1"></div> - -<script> -var shadowRoot1 = host1.createShadowRoot(); -shadowRoot1.innerHTML = - '<div id="host2">' + - '<content><div title="debugstop">content fallback element</div></content>' + - '<shadow><div>shadow fallback element</div></shadow>' + - '<div>This should be selected.</div>' + - '</div>'; - -var host2 = shadowRoot1.getElementById('host2'); -var shadowRoot2 = host2.createShadowRoot(); -shadowRoot2.innerHTML = - '<div id="host3">' + - '<content select="div"></content>' + - '<content select="span"><div>content fallback element</div></content>' + - '<div>This also should be selected.</div>' - '</div>'; - -var host3 = shadowRoot2.getElementById('host3'); -var shadowRoot3 = host3.createShadowRoot(); -shadowRoot3.innerHTML = - '<content select="div"></content>' - -</script> - -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-reprojection-fallback.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-reprojection-fallback.html deleted file mode 100644 index 12a3f867..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-reprojection-fallback.html +++ /dev/null
@@ -1,23 +0,0 @@ -<!DOCTYPE html> - -<html> - -<p>Fallback elements for content insertion points should be rendered</p> - -<div id="host1"></div> - -<script> -var shadowRoot1 = host1.createShadowRoot(); -shadowRoot1.innerHTML = - '<div id="host2">' + - '<content><div title="debugstop">content fallback element</div></content>' + - '<shadow><div>shadow fallback element</div></shadow>' + - '<div id="div">This should be selected.</div>' + - '</div>'; - -var host2 = shadowRoot1.getElementById('host2'); -var shadowRoot2 = host2.createShadowRoot(); -shadowRoot2.innerHTML = '<content select="div"></content>'; -</script> - -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-reprojection-reattach-expected.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-reprojection-reattach-expected.html deleted file mode 100644 index c3c48a3..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-reprojection-reattach-expected.html +++ /dev/null
@@ -1,3 +0,0 @@ -<!DOCTYPE html> -<p>You should see the word PASS below</p> -<div>PASS</div>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-reprojection-reattach-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-reprojection-reattach-expected.txt deleted file mode 100644 index fd094f7..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-reprojection-reattach-expected.txt +++ /dev/null
@@ -1 +0,0 @@ -CONSOLE WARNING: line 9: Element.createShadowRoot is deprecated and will be removed in M80, around February 2020. Please use Element.attachShadow instead. See https://www.chromestatus.com/features/4507242028072960 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details.
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-reprojection-reattach.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-reprojection-reattach.html deleted file mode 100644 index 15fb8cb2..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-reprojection-reattach.html +++ /dev/null
@@ -1,13 +0,0 @@ -<!DOCTYPE html> -<p>You should see the word PASS below</p> -<div id="host"> - <span class="before"></span> - <span class="before"></span> - <span class="after">PASS</span> -</div> -<script> - var root = host.createShadowRoot(); - root.innerHTML = '<content select=".before"></content>'; - host.offsetTop; - root.querySelector("content").setAttribute("select", ".after"); -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-reprojection-recalc-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-reprojection-recalc-expected.txt deleted file mode 100644 index 72ec18d..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-reprojection-recalc-expected.txt +++ /dev/null
@@ -1,11 +0,0 @@ -CONSOLE WARNING: line 16: Element.createShadowRoot is deprecated and will be removed in M80, around February 2020. Please use Element.attachShadow instead. See https://www.chromestatus.com/features/4507242028072960 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -Redistribution into same position should not cause style recalc - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - -PASS window.internals is defined. -PASS internals.updateStyleAndReturnAffectedElementCount() is 1 -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-reprojection-recalc.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-reprojection-recalc.html deleted file mode 100644 index a486de2..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-reprojection-recalc.html +++ /dev/null
@@ -1,25 +0,0 @@ -<!DOCTYPE html> -<script src="../../../resources/js-test.js"></script> -<div id="host"> - <div></div> - <div></div> - <div></div> - <div></div> - <div></div> - <div></div> -</div> -<script> -description("Redistribution into same position should not cause style recalc"); - -shouldBeDefined("window.internals"); - -var root = host.createShadowRoot(); -root.innerHTML = "<content></content>"; - -host.offsetTop; - -host.appendChild(document.createElement("div")); - -shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "1"); - -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-reprojection-shadow-expected.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-reprojection-shadow-expected.html deleted file mode 100644 index 7c9d9cad0..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-reprojection-shadow-expected.html +++ /dev/null
@@ -1,13 +0,0 @@ -<!DOCTYPE html> -<html> - -<p>This test ensures that elements distributed to a content element can be taken from a shadow element</p> - -<div id="host1"> - <div>These elements</div> - <div>should be</div> - <div>reprojected</div> - <div>A</div> -</div> - -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-reprojection-shadow-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-reprojection-shadow-expected.txt deleted file mode 100644 index f551a8c..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-reprojection-shadow-expected.txt +++ /dev/null
@@ -1 +0,0 @@ -CONSOLE WARNING: line 14: Element.createShadowRoot is deprecated and will be removed in M80, around February 2020. Please use Element.attachShadow instead. See https://www.chromestatus.com/features/4507242028072960 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details.
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-reprojection-shadow.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-reprojection-shadow.html deleted file mode 100644 index fbf481e..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-reprojection-shadow.html +++ /dev/null
@@ -1,21 +0,0 @@ -<!DOCTYPE html> -<html> - - -<p>This test ensures that elements distributed to a content element can be taken from a shadow element</p> - -<div id="host1"> - <div>These elements</div> - <div>should be</div> - <div>reprojected</div> -</div> - -<script> -var shadowRoot1 = host1.createShadowRoot(); -shadowRoot1.innerHTML = '<div id="host2"><content></content></div>'; - -var shadowRoot2 = shadowRoot1.getElementById('host2').createShadowRoot(); -shadowRoot2.innerHTML = '<div><shadow></shadow><div>A</div></div>' -</script> - -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-selector-query.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-selector-query.html deleted file mode 100644 index ecfea50..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-selector-query.html +++ /dev/null
@@ -1,68 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script src="../../../resources/testharness.js"></script> -<script src="../../../resources/testharnessreport.js"></script> -</head> -<body> -<p>This test checks select attribute of content element is valid.</p> -<pre id="console"></pre> -<div id="container"></div> - -<script> -var container = document.getElementById("container"); - -var content; -function runTest(select, valid) { - content = document.createElement('content'); - if (select != null) - content.setAttribute('select', select); - - test(() => { - assert_own_property(window, 'internals', - 'This test requires internals.isValidContentSelect'); - assert_equals(internals.isValidContentSelect(content), valid); - }, `${select} ${valid}`); -} - -var dataOfValidCases = [ - null, '', '*|div', '|div', 'div', '*|*', '|*', '*', - '.elem', 'p.elem', 'foo.elem', '*.right', - '#elem', 'p#elem', 'foo#elem', '*#something', - 'div[title]', 'div[class="example"]', 'div[hello="Cleveland"][goodbye="Columbus"]', - 'div[rel~="copyright"]', 'div[href="http://www.example.com/"]', - 'div[hreflang|="en"]', 'div[character=romeo]', - 'div, div', ' div, div ', - 'div:not(div)', -]; - -var dataOfInvalidCases = [ - 'div div', 'div > div', 'div + div', 'div ~ div', - 'ns|div', 'ns|*', 'div:root', 'div:lang(en)', - 'div::before', 'div::after', 'div::first-line', 'div::first-letter', - 'div:active', 'div:hover', 'div:focus', - 'div div:not(div)', 'div:not(div) div', 'div span div', - 'div < div', 'div - dvi', '< div', '+div', '~div', 'div:!', '!:!', 'div::!', 'div::first_of_type', - 'pe;ro', '@screen', '@import "style.css"', 'div :first-of-type', 'div::first-of-type', - ' div, ,div', 'div \'\'', - 'div:link', 'div:visited', 'div:target', 'div:enabled', 'div:checked', - 'div:indeterminate', 'div:nth-child(1)', 'div:nth-last-child(1)', 'div:nth-of-type(1)', - 'div:nth-last-of-type(1)', 'div:first-child', 'div:last-child', 'div:first-of-type', - 'div:last-of-type', 'div:only-of-type', - 'div:first-of-type:last-of-type', 'div.elem:visited', '*:visited', - 'div:first-of-type, div', 'div, div:first-of-type', 'div:first-of-type, div:last-of-type', 'div:not(:not(div))', 'div:not(:hover)', 'div:not(div div)', 'div:not(div div:not)', 'div:not(div div:hover)', 'div div:not(:hover)', -]; - -function doTest() { - for (var i = 0; i < dataOfValidCases.length; ++i) { - runTest(dataOfValidCases[i], true); - } - for (var i = 0; i < dataOfInvalidCases.length; ++i) { - runTest(dataOfInvalidCases[i], false); - } -} - -doTest(); -</script> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-text-selection-crash.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-text-selection-crash.html deleted file mode 100644 index 2bb9b17..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-text-selection-crash.html +++ /dev/null
@@ -1,14 +0,0 @@ -<!doctype html> -<script src="../../../resources/testharness.js"></script> -<script src="../../../resources/testharnessreport.js"></script> -<p>Selecting all text should not crash.</p> -<div id="host"></div> -<script> - test(() => { - const root = host.attachShadow({mode: 'open'}); - root.innerHTML = "<style>content::selection {color:green}</style><content>Fallback</content>"; - const range = document.createRange(); - range.selectNode(document.body); - window.getSelection().addRange(range); - }, "Adding ::selection style on <content> should not crash when rendering fallback."); -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-whitespace-attach-expected.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-whitespace-attach-expected.html deleted file mode 100644 index fff968a0..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-whitespace-attach-expected.html +++ /dev/null
@@ -1,3 +0,0 @@ -<!DOCTYPE html> -<p>There should be a space between 'two' and 'words' below.</p> -<div>two words</div>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-whitespace-attach-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-whitespace-attach-expected.txt deleted file mode 100644 index 9a13424f..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-whitespace-attach-expected.txt +++ /dev/null
@@ -1 +0,0 @@ -CONSOLE WARNING: line 5: Element.createShadowRoot is deprecated and will be removed in M80, around February 2020. Please use Element.attachShadow instead. See https://www.chromestatus.com/features/4507242028072960 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details.
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-whitespace-attach.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-whitespace-attach.html deleted file mode 100644 index d8aa4af..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/content-whitespace-attach.html +++ /dev/null
@@ -1,9 +0,0 @@ -<!DOCTYPE html> -<p>There should be a space between 'two' and 'words' below.</p> -<div id="host"><span style="display:block">two</span></div> -<script> - const root = host.createShadowRoot(); - root.innerHTML = "<content></content> <!---->words"; - document.body.offsetTop; - document.querySelector("span").style.display = "inline"; -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/create-content-element-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/create-content-element-expected.txt deleted file mode 100644 index cf90fd6..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/create-content-element-expected.txt +++ /dev/null
@@ -1,4 +0,0 @@ -CONSOLE WARNING: line 27: Element.createShadowRoot is deprecated and will be removed in M80, around February 2020. Please use Element.attachShadow instead. See https://www.chromestatus.com/features/4507242028072960 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -This test compares a shadow-based render tree with one for a reference DOM tree. -PASS -
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/create-content-element.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/create-content-element.html deleted file mode 100644 index 1f667eab..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/create-content-element.html +++ /dev/null
@@ -1,70 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<style> -/* relative positioning ensures underlying Layer */ -.container { - position: relative; -} -</style> -<script> -function log(message) -{ - document.getElementById("console").innerHTML += (message + "\n"); -} - -function removeContainerLines(text) -{ - var lines = text.split("\n"); - lines.splice(0, 2); - return lines.join("\n"); -} - -function setupTargetTree() -{ - var target = document.createElement("div"); - target.innerHTML = "<span>content</span>"; - var root = target.createShadowRoot(); - - var child0 = document.createElement("span"); - child0.innerHTML = "Hello,"; - root.appendChild(child0); - root.appendChild(window.document.createElement('content')); - var child1 = document.createElement("span"); - child1.innerHTML = "World."; - root.appendChild(child1); - - document.getElementById("target").appendChild(target); -} - -function test() -{ - testRunner.dumpAsText(); - log("This test compares a shadow-based render tree with one for a reference DOM tree."); - setupTargetTree(); - var targetContainerLayoutTree = internals.elementLayoutTreeAsText(document.getElementById("targetContainer")); - var targetLayoutTree = removeContainerLines(targetContainerLayoutTree); - var refContainerLayoutTree = internals.elementLayoutTreeAsText(document.getElementById("refContainer")); - var refLayoutTree = removeContainerLines(refContainerLayoutTree); - if (targetLayoutTree == refLayoutTree) - log("PASS"); - else { - log("FAIL"); - log("Expected:"); - log(refLayoutTree); - log("Actual:"); - log(targetLayoutTree); - } - - document.getElementById("test").style.display = "none"; -} -</script> -</head> -<body onload="test()"> -<div id="test"> -<div class="container" id="targetContainer"><div id="target"></div></div> -<div class="container" id="refContainer"><div><div><span>Hello,</span><span>content</span><span>World.</span></div></div></div> -</div> -<pre id="console"></pre> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/deep-combinator-for-video-expected.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/deep-combinator-for-video-expected.html deleted file mode 100644 index 9b4bf6b5..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/deep-combinator-for-video-expected.html +++ /dev/null
@@ -1,2 +0,0 @@ -<!DOCTYPE html> -<video controls></video>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/deep-combinator-for-video-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/deep-combinator-for-video-expected.txt deleted file mode 100644 index 6d8f4ee..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/deep-combinator-for-video-expected.txt +++ /dev/null
@@ -1 +0,0 @@ -CONSOLE WARNING: /deep/ combinator is no longer supported in CSS dynamic profile. It is now effectively no-op, acting as if it were a descendant combinator. /deep/ combinator will be removed, and will be invalid at M65. You should remove it. See https://www.chromestatus.com/features/4964279606312960 for more details.
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/deep-combinator-for-video.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/deep-combinator-for-video.html deleted file mode 100644 index e3a52e0..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/deep-combinator-for-video.html +++ /dev/null
@@ -1,7 +0,0 @@ -<!DOCTYPE html> -<style> -video /deep/ * { - display: none !important; -} -</style> -<video controls></video>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/disconnected-distribution-cycle-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/disconnected-distribution-cycle-expected.txt deleted file mode 100644 index 500eedd0..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/disconnected-distribution-cycle-expected.txt +++ /dev/null
@@ -1,10 +0,0 @@ -CONSOLE WARNING: line 15: Element.createShadowRoot is deprecated and will be removed in M80, around February 2020. Please use Element.attachShadow instead. See https://www.chromestatus.com/features/4507242028072960 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -Distributions from disconnected subtrees should be cleared when inserted again to avoid cycles. - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - -PASS content.getDistributedNodes().length is 0 -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/disconnected-distribution-cycle.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/disconnected-distribution-cycle.html deleted file mode 100644 index 81b0b3a..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/disconnected-distribution-cycle.html +++ /dev/null
@@ -1,33 +0,0 @@ -<!DOCTYPE html> - -<script src="../../../resources/js-test.js"></script> - -<div id="b"></div> - -<script> - description("Distributions from disconnected subtrees should be cleared when inserted again to avoid cycles."); - - var a = document.createElement("div"); - var b = document.getElementById("b"); - - // Put "a" it into a disconnected element with a shadow root with an insertion point. - var host = document.createElement("div"); - var content = host.createShadowRoot().appendChild(document.createElement("content")); - host.appendChild(a); - - // Cause a distribution of "a" into the disconnected host. - a.getDestinationInsertionPoints(); - - // Distribute "a" into a host in the page. - b.createShadowRoot().appendChild(document.createElement("content")); - b.appendChild(a); - - // Cause an attach of all elements in the page. - getComputedStyle(document.body).color; - - // Insert the disconnected host as a child of "a". - a.appendChild(host); - - // Go through distribution again... CRASH! - shouldBe("content.getDistributedNodes().length", "0"); -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/distributed-node-focus-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/distributed-node-focus-expected.txt deleted file mode 100644 index 7f7f9f8..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/distributed-node-focus-expected.txt +++ /dev/null
@@ -1,13 +0,0 @@ -CONSOLE WARNING: line 87: Element.createShadowRoot is deprecated and will be removed in M80, around February 2020. Please use Element.attachShadow instead. See https://www.chromestatus.com/features/4507242028072960 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -PASS document.activeElement.id is "input1" -PASS document.activeElement.id is "input1" -PASS shadowRoot.activeElement is null -PASS document.activeElement.id is "distributed-node" -PASS shadowRoot.activeElement.id is "distributed-node" -PASS document.activeElement.id is "distributed-node" -PASS shadowRoot.activeElement is null -PASS successfullyParsed is true - -TEST COMPLETE - -
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/distributed-node-focus.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/distributed-node-focus.html deleted file mode 100644 index ed04f0f..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/distributed-node-focus.html +++ /dev/null
@@ -1,60 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script src="../../../resources/js-test.js"></script> -<script src="resources/shadow-dom.js"></script> -</head> -<body> -<input id="input1"></input> -<div id="sandbox"></div> -<div id="console"></div> -<script> -var sandbox = document.getElementById('sandbox'); - -// A test for a non-distributed node. -sandbox.appendChild( - createDOM('div', {'id': 'host'}, - createDOM('input', {'id': 'non-distributed-node'}), - createShadowRoot({'id': 'shadow-root'}))); -sandbox.offsetLeft; - -document.getElementById('input1').focus(); -shouldBeEqualToString('document.activeElement.id', 'input1'); - -document.getElementById('non-distributed-node').focus(); -// Focus doesn't change because non-distributed-node can't get focused. -shouldBeEqualToString('document.activeElement.id', 'input1'); - -var shadowRoot = getNodeInComposedTree('host/'); -shouldBeNull('shadowRoot.activeElement'); - - -// A test for a distributed node. -sandbox.innerHTML = ''; -sandbox.appendChild( - createDOM('div', {'id': 'host'}, - createDOM('input', {'id': 'distributed-node'}), - createShadowRoot({'id': 'shadow-root'}, - createDOM('div', {'id': 'content-parent'}, - createDOM('content', {'id': 'content'}))))); -sandbox.offsetLeft; - -var distributedNode = document.getElementById('distributed-node'); -distributedNode.focus(); - -shouldBeEqualToString('document.activeElement.id', 'distributed-node'); -shadowRoot = getNodeInComposedTree("host/"); -shouldBeEqualToString('shadowRoot.activeElement.id', 'distributed-node'); - -var contentParent = getNodeInComposedTree('host/content-parent'); -contentParent.parentNode.removeChild(contentParent); -// This is a similar case where 'dispaly: none' is set to the focused element. We can't guarantee this case. -// The current implementation leaves the distributed node as document.activeElement. -// See the discussion from https://code.google.com/p/chromium/issues/detail?id=318448#c21. -shouldBeEqualToString('document.activeElement.id', 'distributed-node'); -shouldBeNull('shadowRoot.activeElement'); - -var successfullyParsed = true; -</script> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/distribution-attribute-modified-expected.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/distribution-attribute-modified-expected.html deleted file mode 100644 index 4c282c7..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/distribution-attribute-modified-expected.html +++ /dev/null
@@ -1,10 +0,0 @@ -<!DOCTYPE html> - -<html> -<body> - -<div id="host"> - <div>F</div> -</div> - -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/distribution-attribute-modified-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/distribution-attribute-modified-expected.txt deleted file mode 100644 index a4822ac..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/distribution-attribute-modified-expected.txt +++ /dev/null
@@ -1 +0,0 @@ -CONSOLE WARNING: line 20: Element.createShadowRoot is deprecated and will be removed in M80, around February 2020. Please use Element.attachShadow instead. See https://www.chromestatus.com/features/4507242028072960 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details.
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/distribution-attribute-modified.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/distribution-attribute-modified.html deleted file mode 100644 index 3afe5c6..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/distribution-attribute-modified.html +++ /dev/null
@@ -1,29 +0,0 @@ -<!DOCTYPE html> - -<html> -<body> - - -<div id="host"> - <div>A</div> - <div>B</div> - <div>C</div> - <div>D</div> - <div>E</div> - <div id="F">F</div> -</div> - -<script> -if (window.testRunner) - testRunner.waitUntilDone(); - -var shadowRoot = host.createShadowRoot(); -shadowRoot.innerHTML = '<content select="div[title]"></content>'; - -setTimeout(function() { - F.title = 'something'; - if (window.testRunner) - testRunner.notifyDone(); -}, 0); -</script> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/distribution-className-modified-expected.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/distribution-className-modified-expected.html deleted file mode 100644 index d9a695ce..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/distribution-className-modified-expected.html +++ /dev/null
@@ -1,12 +0,0 @@ -<!DOCTYPE html> - -<html> -<body> - -<div id="host"> - <div>A</div> - <div>D</div> - <div>F</div> -</div> - -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/distribution-className-modified-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/distribution-className-modified-expected.txt deleted file mode 100644 index a4822ac..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/distribution-className-modified-expected.txt +++ /dev/null
@@ -1 +0,0 @@ -CONSOLE WARNING: line 20: Element.createShadowRoot is deprecated and will be removed in M80, around February 2020. Please use Element.attachShadow instead. See https://www.chromestatus.com/features/4507242028072960 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details.
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/distribution-className-modified.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/distribution-className-modified.html deleted file mode 100644 index e18882b..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/distribution-className-modified.html +++ /dev/null
@@ -1,29 +0,0 @@ -<!DOCTYPE html> - -<html> -<body> - - -<div id="host"> - <div class="selected">A</div> - <div>B</div> - <div>C</div> - <div class="selected">D</div> - <div>E</div> - <div id="F">F</div> -</div> - -<script> -if (window.testRunner) - testRunner.waitUntilDone(); - -var shadowRoot = host.createShadowRoot(); -shadowRoot.innerHTML = '<content select=".selected"></content>'; - -setTimeout(function() { - F.className = 'selected'; - if (window.testRunner) - testRunner.notifyDone(); -}, 0); -</script> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/distribution-for-detached-subtree-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/distribution-for-detached-subtree-expected.txt deleted file mode 100644 index 740d2bac..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/distribution-for-detached-subtree-expected.txt +++ /dev/null
@@ -1,12 +0,0 @@ -CONSOLE WARNING: line 8: Element.createShadowRoot is deprecated and will be removed in M80, around February 2020. Please use Element.attachShadow instead. See https://www.chromestatus.com/features/4507242028072960 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -distribution should be recalculated correctly for a detached subtree. - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - -PASS nodeList.length is expectedNodes.length -PASS nodeList.length is expectedNodes.length -PASS nodeList.item(0) is expectedNodes[0] -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/distribution-for-detached-subtree.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/distribution-for-detached-subtree.html deleted file mode 100644 index f75186e..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/distribution-for-detached-subtree.html +++ /dev/null
@@ -1,16 +0,0 @@ -<!DOCTYPE html> -<script src="resources/shadow-dom.js"></script> -<script src="../../../resources/js-test.js"></script> -<script> -description('distribution should be recalculated correctly for a detached subtree.'); - -var shadowHost = document.createElement('div'); -var shadowRoot = shadowHost.createShadowRoot(); -var content = document.createElement('content'); -shadowRoot.appendChild(content); -shouldBeEqualAsArray(content.getDistributedNodes(), []); - -var shadowHostChild = document.createElement('div') -shadowHost.appendChild(shadowHostChild); -shouldBeEqualAsArray(content.getDistributedNodes(), [shadowHostChild]); -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/distribution-for-event-path-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/distribution-for-event-path-expected.txt deleted file mode 100644 index e3f928a..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/distribution-for-event-path-expected.txt +++ /dev/null
@@ -1,10 +0,0 @@ -CONSOLE WARNING: line 11: Element.createShadowRoot is deprecated and will be removed in M80, around February 2020. Please use Element.attachShadow instead. See https://www.chromestatus.com/features/4507242028072960 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -B, A, CAPTURING_PHASE -B, #document-fragment, CAPTURING_PHASE -B, CONTENT, CAPTURING_PHASE -B, B, AT_TARGET -B, B, AT_TARGET -B, CONTENT, BUBBLING_PHASE -B, #document-fragment, BUBBLING_PHASE -B, A, BUBBLING_PHASE -
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/distribution-for-event-path.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/distribution-for-event-path.html deleted file mode 100644 index a7bac8a..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/distribution-for-event-path.html +++ /dev/null
@@ -1,37 +0,0 @@ -<!doctype html> -<style> body { white-space: pre; } </style> -<a><b></b></a> -<script> - -if (window.testRunner) - testRunner.dumpAsText(); - -var a = document.querySelector('a'); -var b = document.querySelector('b'); -var sr = a.createShadowRoot(); -sr.innerHTML = '<content></content>'; -var content = sr.firstChild; - -var log = []; -var phases = { - 2: 'AT_TARGET', - 3: 'BUBBLING_PHASE', - 1: 'CAPTURING_PHASE', -}; - -[a, b, sr, content].forEach(function(el) { - [true, false].forEach(function(b) { - el.addEventListener('click', function(event) { - log.push([ - event.target.nodeName, - event.currentTarget.nodeName, - phases[event.eventPhase] - ].join(', ')); - }, b); - }); -}); - -b.click(); -document.body.textContent = log.join('\n'); - -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/distribution-id-modified-expected.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/distribution-id-modified-expected.html deleted file mode 100644 index 4c282c7..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/distribution-id-modified-expected.html +++ /dev/null
@@ -1,10 +0,0 @@ -<!DOCTYPE html> - -<html> -<body> - -<div id="host"> - <div>F</div> -</div> - -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/distribution-id-modified-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/distribution-id-modified-expected.txt deleted file mode 100644 index a4822ac..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/distribution-id-modified-expected.txt +++ /dev/null
@@ -1 +0,0 @@ -CONSOLE WARNING: line 20: Element.createShadowRoot is deprecated and will be removed in M80, around February 2020. Please use Element.attachShadow instead. See https://www.chromestatus.com/features/4507242028072960 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details.
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/distribution-id-modified.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/distribution-id-modified.html deleted file mode 100644 index 366260a..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/distribution-id-modified.html +++ /dev/null
@@ -1,31 +0,0 @@ -<!DOCTYPE html> - -<html> -<body> - - -<div id="host"> - <div id="selected">A</div> - <div>B</div> - <div>C</div> - <div>D</div> - <div>E</div> - <div id="F">F</div> -</div> - -<script> -if (window.testRunner) - testRunner.waitUntilDone(); - -var shadowRoot = host.createShadowRoot(); -shadowRoot.innerHTML = '<content select="#selected"></content>'; - -setTimeout(function() { - A = selected; - F.id = 'selected'; - A.id = ''; - if (window.testRunner) - testRunner.notifyDone(); -}, 0); -</script> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/distribution-update-recalcs-style-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/distribution-update-recalcs-style-expected.txt deleted file mode 100644 index ed44acf..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/distribution-update-recalcs-style-expected.txt +++ /dev/null
@@ -1,25 +0,0 @@ -CONSOLE WARNING: line 27: Element.createShadowRoot is deprecated and will be removed in M80, around February 2020. Please use Element.attachShadow instead. See https://www.chromestatus.com/features/4507242028072960 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -Tests to ensure that updating the select rule in projection causes style recalc. - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - - - - - - - - - -PASS getColorProperty("div-child") is "rgb(0, 0, 255)" -PASS getColorProperty("span-child") is "rgb(0, 0, 0)" -PASS getColorProperty("div-child") is "rgb(0, 0, 0)" -PASS getColorProperty("span-child") is "rgb(0, 0, 255)" - - - - -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/distribution-update-recalcs-style.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/distribution-update-recalcs-style.html deleted file mode 100644 index cbb0eabd..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/distribution-update-recalcs-style.html +++ /dev/null
@@ -1,41 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script src="../../../resources/js-test.js"></script> -<script> -function getColorProperty(id) { - return window.getComputedStyle(document.getElementById(id)).color; -} - -function log(message) { - var console = document.getElementById('console'); - console.innerHTML += message + '\n'; -} -</script> -</head> -<body> -<pre id="console"></div> -<div id="test"> - <div id="host" style="color: red"> - <div id="div-child"></div> - <span id="span-child"></span> - </div> -</div> -<script> -description("Tests to ensure that updating the select rule in projection causes style recalc."); - -var sr = document.getElementById("host").createShadowRoot(); -sr.innerHTML = '<style>div { color: blue }</style><div><content id="contentId" select="#div-child"></content></div>'; - -shouldBe('getColorProperty("div-child")', '"rgb(0, 0, 255)"'); -shouldBe('getColorProperty("span-child")', '"rgb(0, 0, 0)"'); - -sr.getElementById("contentId").select = "#span-child"; -shouldBe('getColorProperty("div-child")', '"rgb(0, 0, 0)"'); -shouldBe('getColorProperty("span-child")', '"rgb(0, 0, 255)"'); - -if (window.testRunner) - testRunner.notifyDone(); -</script> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/event-path-in-shadow-tree-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/event-path-in-shadow-tree-expected.txt deleted file mode 100644 index a28b01e..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/event-path-in-shadow-tree-expected.txt +++ /dev/null
@@ -1,45 +0,0 @@ -CONSOLE WARNING: line 87: Element.createShadowRoot is deprecated and will be removed in M80, around February 2020. Please use Element.attachShadow instead. See https://www.chromestatus.com/features/4507242028072960 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. - -event.path on node #C -#C, #B, #F, #J, #I, #M, #L, #K, #H, #G, #E, #D, #A, #sandbox, [object HTMLBodyElement], [object HTMLHtmlElement], [object HTMLDocument], [object Window], length: 18 - -event.path on node #B -#C, #B, #F, #J, #I, #M, #L, #K, #H, #G, #E, #D, #A, #sandbox, [object HTMLBodyElement], [object HTMLHtmlElement], [object HTMLDocument], [object Window], length: 18 - -event.path on node #F -#C, #B, #F, #J, #I, #M, #L, #K, #H, #G, #E, #D, #A, #sandbox, [object HTMLBodyElement], [object HTMLHtmlElement], [object HTMLDocument], [object Window], length: 18 - -event.path on node #J -#C, #B, #F, #J, #I, #M, #L, #K, #H, #G, #E, #D, #A, #sandbox, [object HTMLBodyElement], [object HTMLHtmlElement], [object HTMLDocument], [object Window], length: 18 - -event.path on node #I -#C, #B, #F, #J, #I, #M, #L, #K, #H, #G, #E, #D, #A, #sandbox, [object HTMLBodyElement], [object HTMLHtmlElement], [object HTMLDocument], [object Window], length: 18 - -event.path on node #M -#C, #B, #F, #J, #I, #M, #L, #K, #H, #G, #E, #D, #A, #sandbox, [object HTMLBodyElement], [object HTMLHtmlElement], [object HTMLDocument], [object Window], length: 18 - -event.path on node #L -#C, #B, #F, #J, #I, #M, #L, #K, #H, #G, #E, #D, #A, #sandbox, [object HTMLBodyElement], [object HTMLHtmlElement], [object HTMLDocument], [object Window], length: 18 - -event.path on node #K -#C, #B, #F, #J, #I, #M, #L, #K, #H, #G, #E, #D, #A, #sandbox, [object HTMLBodyElement], [object HTMLHtmlElement], [object HTMLDocument], [object Window], length: 18 - -event.path on node #H -#C, #B, #F, #J, #I, #M, #L, #K, #H, #G, #E, #D, #A, #sandbox, [object HTMLBodyElement], [object HTMLHtmlElement], [object HTMLDocument], [object Window], length: 18 - -event.path on node #G -#C, #B, #F, #J, #I, #M, #L, #K, #H, #G, #E, #D, #A, #sandbox, [object HTMLBodyElement], [object HTMLHtmlElement], [object HTMLDocument], [object Window], length: 18 - -event.path on node #E -#C, #B, #F, #J, #I, #M, #L, #K, #H, #G, #E, #D, #A, #sandbox, [object HTMLBodyElement], [object HTMLHtmlElement], [object HTMLDocument], [object Window], length: 18 - -event.path on node #D -#C, #B, #F, #J, #I, #M, #L, #K, #H, #G, #E, #D, #A, #sandbox, [object HTMLBodyElement], [object HTMLHtmlElement], [object HTMLDocument], [object Window], length: 18 - -event.path on node #A -#C, #B, #F, #J, #I, #M, #L, #K, #H, #G, #E, #D, #A, #sandbox, [object HTMLBodyElement], [object HTMLHtmlElement], [object HTMLDocument], [object Window], length: 18 -PASS successfullyParsed is true - -TEST COMPLETE - -
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/event-path-in-shadow-tree.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/event-path-in-shadow-tree.html deleted file mode 100644 index 7b595f77..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/event-path-in-shadow-tree.html +++ /dev/null
@@ -1,42 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script src="../../../resources/js-test.js"></script> -<script src="resources/shadow-dom.js"></script> -</head> -<body> -<p id="description"></p> -<div id="sandbox"></div> -<pre id="console"></pre> -<script> -var sandbox = document.getElementById('sandbox'); - -// The following DOM tree came from the picture I've drawn on a whiteboard. -// https://chromium.googlecode.com/issues/attachment?aid=2340300011000&name=IMG_20130508_160406.jpg&token=GBf6WauXYBNwzm3iC2p9qdtsPUQ%3A1367996888205&inline=1 -sandbox.appendChild( - createDOM('div', {'id': 'A'}, - createDOM('div', {'id': 'B'}, - createDOM('div', {'id': 'C'})), - createShadowRoot({'id': 'D'}, - createDOM('div', {'id': 'E'}, - createDOM('content', {'id': 'F'}), - createShadowRoot({'id': 'G'}, - createDOM('div', {'id': 'H'}, - createDOM('div', {'id': 'I'}, - createDOM('content', {'id': 'J'})), - createShadowRoot({'id': 'K'}, - createDOM('div', {'id': 'L'}, - createDOM('content', {'id': 'M'}))))))))); - -['A', 'B', 'C', 'A/', 'A/E', 'A/F', 'A/E/', 'A/E/H', 'A/E/I', 'A/E/J', 'A/E/H/', 'A/E/H/L', 'A/E/H/M'].forEach(function(path) { - getNodeInComposedTree(path).addEventListener('click', function(event) { - debug('\nevent.path on node ' + dumpNode(event.currentTarget)); - debug(dumpNodeList(event.path)); - }); -}); -var clickEvent = document.createEvent("MouseEvents"); -clickEvent.initMouseEvent('click', true, false, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null); -document.getElementById('C').dispatchEvent(clickEvent); -</script> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/event-path-with-dom-mutation-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/event-path-with-dom-mutation-expected.txt deleted file mode 100644 index 4d449e4f..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/event-path-with-dom-mutation-expected.txt +++ /dev/null
@@ -1,49 +0,0 @@ -CONSOLE WARNING: line 87: Element.createShadowRoot is deprecated and will be removed in M80, around February 2020. Please use Element.attachShadow instead. See https://www.chromestatus.com/features/4507242028072960 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. - -event.path on node #C -#C, #B, #F, #J, #I, #M, #L, #K, #H, #G, #E, #D, #A, #sandbox, [object HTMLBodyElement], [object HTMLHtmlElement], [object HTMLDocument], [object Window], length: 18 - -event.path on node #B -#C, #B, #F, #J, #I, #M, #L, #K, #H, #G, #E, #D, #A, #sandbox, [object HTMLBodyElement], [object HTMLHtmlElement], [object HTMLDocument], [object Window], length: 18 - -Removing node #C - -event.path on node #F -#C, #B, #F, #J, #I, #M, #L, #K, #H, #G, #E, #D, #A, #sandbox, [object HTMLBodyElement], [object HTMLHtmlElement], [object HTMLDocument], [object Window], length: 18 - -event.path on node #J -#C, #B, #F, #J, #I, #M, #L, #K, #H, #G, #E, #D, #A, #sandbox, [object HTMLBodyElement], [object HTMLHtmlElement], [object HTMLDocument], [object Window], length: 18 - -event.path on node #I -#C, #B, #F, #J, #I, #M, #L, #K, #H, #G, #E, #D, #A, #sandbox, [object HTMLBodyElement], [object HTMLHtmlElement], [object HTMLDocument], [object Window], length: 18 - -Removing node #J - -event.path on node #M -#C, #B, #F, #J, #I, #M, #L, #K, #H, #G, #E, #D, #A, #sandbox, [object HTMLBodyElement], [object HTMLHtmlElement], [object HTMLDocument], [object Window], length: 18 - -event.path on node #L -#C, #B, #F, #J, #I, #M, #L, #K, #H, #G, #E, #D, #A, #sandbox, [object HTMLBodyElement], [object HTMLHtmlElement], [object HTMLDocument], [object Window], length: 18 - -event.path on node #K -#C, #B, #F, #J, #I, #M, #L, #K, #H, #G, #E, #D, #A, #sandbox, [object HTMLBodyElement], [object HTMLHtmlElement], [object HTMLDocument], [object Window], length: 18 - -event.path on node #H -#C, #B, #F, #J, #I, #M, #L, #K, #H, #G, #E, #D, #A, #sandbox, [object HTMLBodyElement], [object HTMLHtmlElement], [object HTMLDocument], [object Window], length: 18 - -event.path on node #G -#C, #B, #F, #J, #I, #M, #L, #K, #H, #G, #E, #D, #A, #sandbox, [object HTMLBodyElement], [object HTMLHtmlElement], [object HTMLDocument], [object Window], length: 18 - -event.path on node #E -#C, #B, #F, #J, #I, #M, #L, #K, #H, #G, #E, #D, #A, #sandbox, [object HTMLBodyElement], [object HTMLHtmlElement], [object HTMLDocument], [object Window], length: 18 - -event.path on node #D -#C, #B, #F, #J, #I, #M, #L, #K, #H, #G, #E, #D, #A, #sandbox, [object HTMLBodyElement], [object HTMLHtmlElement], [object HTMLDocument], [object Window], length: 18 - -event.path on node #A -#C, #B, #F, #J, #I, #M, #L, #K, #H, #G, #E, #D, #A, #sandbox, [object HTMLBodyElement], [object HTMLHtmlElement], [object HTMLDocument], [object Window], length: 18 -PASS successfullyParsed is true - -TEST COMPLETE - -
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/event-path-with-dom-mutation.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/event-path-with-dom-mutation.html deleted file mode 100644 index 4038f4f..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/event-path-with-dom-mutation.html +++ /dev/null
@@ -1,49 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script src="../../../resources/js-test.js"></script> -<script src="resources/shadow-dom.js"></script> -</head> -<body> -<p id="description"></p> -<div id="sandbox"></div> -<pre id="console"></pre> -<script> -var sandbox = document.getElementById('sandbox'); - -// The following DOM tree came from the picture I've drawn on a whiteboard. -// https://chromium.googlecode.com/issues/attachment?aid=2340300011000&name=IMG_20130508_160406.jpg&token=GBf6WauXYBNwzm3iC2p9qdtsPUQ%3A1367996888205&inline=1 -sandbox.appendChild( - createDOM('div', {'id': 'A'}, - createDOM('div', {'id': 'B'}, - createDOM('div', {'id': 'C'})), - createShadowRoot({'id': 'D'}, - createDOM('div', {'id': 'E'}, - createDOM('content', {'id': 'F'}), - createShadowRoot({'id': 'G'}, - createDOM('div', {'id': 'H'}, - createDOM('div', {'id': 'I'}, - createDOM('content', {'id': 'J'})), - createShadowRoot({'id': 'K'}, - createDOM('div', {'id': 'L'}, - createDOM('content', {'id': 'M'}))))))))); - -['A', 'B', 'C', 'A/', 'A/E', 'A/F', 'A/E/', 'A/E/H', 'A/E/I', 'A/E/J', 'A/E/H/', 'A/E/H/L', 'A/E/H/M'].forEach(function(path) { - getNodeInComposedTree(path).addEventListener('click', function(event) { - debug('\nevent.path on node ' + dumpNode(event.currentTarget)); - debug(dumpNodeList(event.path)); - }); -}); -['B', 'A/E/I'].forEach(function(path) { - getNodeInComposedTree(path).addEventListener('click', function(event) { - debug('\nRemoving node ' + dumpNode(event.currentTarget.firstChild)); - event.currentTarget.removeChild(event.currentTarget.firstChild); - }); -}); - -var clickEvent = document.createEvent("MouseEvents"); -clickEvent.initMouseEvent('click', true, false, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null); -document.getElementById('C').dispatchEvent(clickEvent); -</script> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/events-stopped-at-shadow-boundary-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/events-stopped-at-shadow-boundary-expected.txt deleted file mode 100644 index c689c0c5..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/events-stopped-at-shadow-boundary-expected.txt +++ /dev/null
@@ -1,74 +0,0 @@ -CONSOLE WARNING: line 87: Element.createShadowRoot is deprecated and will be removed in M80, around February 2020. Please use Element.attachShadow instead. See https://www.chromestatus.com/features/4507242028072960 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -Tests to ensure that all kinds of events are not stopeed at shadow boundary if created by users. - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - -None of the events should be stopped at a Shadow boundary if created by users. - - abort - @target (target: target) - @parent-of-target (target: target) - @host (target: host) - @top (target: host) - - select - @target (target: target) - @parent-of-target (target: target) - @host (target: host) - @top (target: host) - - change - @target (target: target) - @parent-of-target (target: target) - @host (target: host) - @top (target: host) - - reset - @target (target: target) - @parent-of-target (target: target) - @host (target: host) - @top (target: host) - - resize - @target (target: target) - @parent-of-target (target: target) - @host (target: host) - @top (target: host) - - scroll - @target (target: target) - @parent-of-target (target: target) - @host (target: host) - @top (target: host) - - selectstart - @target (target: target) - @parent-of-target (target: target) - @host (target: host) - @top (target: host) - - load - @target (target: target) - @parent-of-target (target: target) - @host (target: host) - @top (target: host) - - click - @target (target: target) - @parent-of-target (target: target) - @host (target: host) - @top (target: host) - -An event fired on a distributed child should not be stopped at the shadow boundary of its host (host2), but should be stopped at the nearest shadow boundary (host1). - - selectstart - @distributed-child (target: distributed-child) - @content (target: distributed-child) - @parent-of-content (target: distributed-child) - @host2 (target: distributed-child) - @host1 (target: host1) -PASS successfullyParsed is true - -TEST COMPLETE - -
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/events-stopped-at-shadow-boundary.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/events-stopped-at-shadow-boundary.html deleted file mode 100644 index 0f3fc51..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/events-stopped-at-shadow-boundary.html +++ /dev/null
@@ -1,124 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script src="../../../resources/js-test.js"></script> -<script src="resources/shadow-dom.js"></script> -</head> -<body> -<p id="description"></p> -<div id="sandbox"></div> -<pre id="console"></pre> -<script> -description("Tests to ensure that all kinds of events are not stopeed at shadow boundary if created by users."); - -var eventRecords = {}; - -function dispatchedEvent(eventType) -{ - var events = eventRecords[eventType]; - if (!events) - return []; - return events; -} - -function dumpDispatchedEvent(eventType) -{ - debug('\n ' + eventType); - var events = dispatchedEvent(eventType); - for (var i = 0; i < events.length; ++i) - debug(' ' + events[i]) -} - -function recordEvent(event) -{ - var eventType = event.type - if (!eventRecords[eventType]) { - eventRecords[eventType] = [] - } - var eventString = ''; - if (event.currentTarget) - eventString += ' @' + event.currentTarget.id; - if (event.target) - eventString += ' (target: ' + event.target.id + ')'; - if (event.relatedTarget) - eventString += ' (related: ' + event.relatedTarget.id + ')'; - if (event.eventPhase == 1) - eventString += '(capturing phase)'; - if (event.target && event.currentTarget && event.target.id == event.currentTarget.id) - shouldBe("event.eventPhase", "2", true); - eventRecords[eventType].push(eventString); -} - -debug('None of the events should be stopped at a Shadow boundary if created by users.'); - -var events = ['abort', 'select', 'change', 'reset', 'resize', 'scroll', 'selectstart', 'load', 'click']; - -function addEventListeners(nodes) -{ - for (var i = 0; i < nodes.length; ++i) { - var node = getNodeInComposedTree(nodes[i]); - for (var j = 0; j < events.length; ++j) - node.addEventListener(events[j], recordEvent, false); - } -} - -function testEventsShouldNotBeStoppedAtShadowBoundary() -{ - var sandbox = document.getElementById('sandbox'); - sandbox.innerHTML = ''; - sandbox.appendChild( - createDOM('div', {'id': 'top'}, - createDOM('div', {'id': 'host'}, - createShadowRoot( - createDOM('div', {'id': 'parent-of-target'}, - createDOM('div', {'id': 'target'})), - createDOM('div', {'id': 'parent-of-content'}, - createDOM('content', {'id': 'content'}))), - createDOM('div', {'id': 'distributed-child'})))); - document.body.offsetLeft; - - addEventListeners(['top', 'host', 'host/parent-of-target', 'host/target', 'host/parent-of-content', 'host/content', 'distributed-child']); - - for (var i = 0; i < events.length; ++i) { - eventRecords = {}; - var event = document.createEvent('UIEvent'); - event.initEvent(events[i], true, false); - getNodeInComposedTree('host/target').dispatchEvent(event); - dumpDispatchedEvent(events[i]); - } - -} - -function testEventsFiredOnDistributedNodesShouldNotBeStoppedAtShadowBoundary() -{ - var sandbox = document.getElementById('sandbox'); - sandbox.innerHTML = ''; - sandbox.appendChild( - createDOM('div', {'id': 'host1'}, - createShadowRoot( - createDOM('div', {'id': 'host2'}, - createShadowRoot( - createDOM('div', {'id': 'parent-of-content'}, - createDOM('content', {'id': 'content'}))), - createDOM('div', {'id': 'distributed-child'}))))); - document.body.offsetLeft; - - addEventListeners(['host1', 'host1/host2', 'host1/host2/parent-of-content', 'host1/host2/content', 'host1/distributed-child']); - - debug('\nAn event fired on a distributed child should not be stopped at the shadow boundary of its host (host2), but should be stopped at the nearest shadow boundary (host1).'); - eventRecords = {}; - var event = document.createEvent('UIEvent'); - event.initEvent('selectstart', true, false); - getNodeInComposedTree('host1/distributed-child').dispatchEvent(event); - dumpDispatchedEvent('selectstart'); -} - -function test() -{ - testEventsShouldNotBeStoppedAtShadowBoundary(); - testEventsFiredOnDistributedNodesShouldNotBeStoppedAtShadowBoundary(); -} -test(); -</script> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/flat-tree-traversal-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/flat-tree-traversal-expected.txt deleted file mode 100644 index 958cf43..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/flat-tree-traversal-expected.txt +++ /dev/null
@@ -1,310 +0,0 @@ -CONSOLE WARNING: line 87: Element.createShadowRoot is deprecated and will be removed in M80, around February 2020. Please use Element.attachShadow instead. See https://www.chromestatus.com/features/4507242028072960 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -Tests for Composed Shadow DOM Tree Traversal APIs. Can only run within DRT - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - -ShadowRoot should be used. -Flat Tree: -#a - #b - -Traverse in forward. -#a -#b -Traverse in backward. -#b -#a - -A content element should select light children -Flat Tree: -#a - #b - #c - #d - -Traverse in forward. -#a -#b -#c -#d -Traverse in backward. -#d -#c -#b -#a - -Test for content element selector. -Flat Tree: -#a - #b - #d - -Traverse in forward. -#a -#b -#d -Traverse in backward. -#d -#b -#a - -Light children should be selected only at once. -Flat Tree: -#a - #b - #d - #c - #e - -Traverse in forward. -#a -#b -#d -#c -#e -Traverse in backward. -#e -#c -#d -#b -#a - -A content element can have fallback elements. -Flat Tree: -#a - #b - #f1 - #f2 - -Traverse in forward. -#a -#b -#f1 -#f2 -Traverse in backward. -#f2 -#f1 -#b -#a - -Fallback elements should not be used if a content element selects an element. -Flat Tree: -#a - #b - #c - -Traverse in forward. -#a -#b -#c -Traverse in backward. -#c -#b -#a - -Test for traversal, starting with a fallback element which is not used. -Flat Tree: -#f1 - #f2 - -Traverse in forward. -#f1 -#f2 -Traverse in backward. -#f2 -#f1 - -Next node of [#f1] is [#f2] -Next node of [#f2] is [null] - -Test for Nested ShadowRoots. -Flat Tree: -#a - #b - #c - #e - #d - #f - #h - #i - #g - -Traverse in forward. -#a -#b -#c -#e -#d -#f -#h -#i -#g -Traverse in backward. -#g -#i -#h -#f -#d -#e -#c -#b -#a - -Test for inactive insertion points. -Flat Tree: -#a - #b - #c - -Traverse in forward. -#a -#b -#c -Traverse in backward. -#c -#b -#a - -Test for a content element which does not select any nodes nor have fallback elements. -Flat Tree: -#a - #b - #c - -Traverse in forward. -#a -#b -#c -Traverse in backward. -#c -#b -#a - -Test for a nested insertion point. -Flat Tree: -#a - #b - #c - -Traverse in forward. -#a -#b -#c -Traverse in backward. -#c -#b -#a - -Test for nested insertion points. Some of them are either empty insertion points or inactive insertion points. -Flat Tree: -#a - #b - #c - #d - #e - -Traverse in forward. -#a -#b -#c -#d -#e -Traverse in backward. -#e -#d -#c -#b -#a - -Test for a re-projection. -Flat Tree: -#a - #b - #c - -Traverse in forward. -#a -#b -#c -Traverse in backward. -#c -#b -#a - -Test for a content element which is selected by another content element. -Flat Tree: -#a - #b - #most-inner-child - #host-child - -Traverse in forward. -#a -#b -#most-inner-child -#host-child -Traverse in backward. -#host-child -#most-inner-child -#b -#a - -Test for a reprojection. Content elements should be used in document order. -Flat Tree: -#a - #host-child1 - #b - #host-child2 - -Traverse in forward. -#a -#host-child1 -#b -#host-child2 -Traverse in backward. -#host-child2 -#b -#host-child1 -#a - -Test for complex re-projections. -Flat Tree: -#a - #b - #child-1 - #d - #e - #child-2 - #g - #f - #h - #c - -Traverse in forward. -#a -#b -#child-1 -#d -#e -#child-2 -#g -#f -#h -#c -Traverse in backward. -#c -#h -#f -#g -#child-2 -#e -#d -#child-1 -#b -#a - -PASS successfullyParsed is true - -TEST COMPLETE - -
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/flat-tree-traversal.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/flat-tree-traversal.html deleted file mode 100644 index b8427b5..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/flat-tree-traversal.html +++ /dev/null
@@ -1,194 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script src="../../../resources/js-test.js"></script> -<script src="resources/shadow-dom.js"></script> -</head> -<body> -<div id="console"></div> -<div id="sandbox"></div> -<script> -description("Tests for Composed Shadow DOM Tree Traversal APIs. Can only run within DRT"); - -function testFlatTree(node) -{ - var sandbox = document.getElementById('sandbox'); - sandbox.innerHTML = ''; - sandbox.appendChild(node); - document.body.offsetLeft; - showFlatTree(node); -} - -debug('ShadowRoot should be used.'); -testFlatTree( - createDOM('div', {'id': 'a'}, - createShadowRoot(createDOM('div', {'id': 'b'})), - createDOM('div', {'id': 'c'}))); - -debug('A content element should select light children'); -testFlatTree( - createDOM('div', {'id': 'a'}, - createShadowRoot(createDOM('div', {'id': 'b'}), - createDOM('content')), - createDOM('div', {'id': 'c'}), - createDOM('div', {'id': 'd'}))); - -debug('Test for content element selector.'); -testFlatTree( - createDOM('div', {'id': 'a'}, - createShadowRoot(createDOM('div', {'id': 'b'}), - createDOM('content', {'select': '#d'})), - createDOM('div', {'id': 'c'}), - createDOM('div', {'id': 'd'}), - createDOM('div', {'id': 'e'}))); - -debug('Light children should be selected only at once.'); -testFlatTree( - createDOM('div', {'id': 'a'}, - createShadowRoot(createDOM('div', {'id': 'b'}), - createDOM('content', {'select': '#d'}), - createDOM('content')), - createDOM('div', {'id': 'c'}), - createDOM('div', {'id': 'd'}), - createDOM('div', {'id': 'e'}))); - -debug('A content element can have fallback elements.'); -testFlatTree( - createDOM('div', {'id': 'a'}, - createShadowRoot(createDOM('div', {'id': 'b'}), - createDOM('content', {'select': '#z'}, - createDOM('div', {'id': 'f1'}), - createDOM('div', {'id': 'f2'}))), - createDOM('div', {'id': 'c'}))); - -debug('Fallback elements should not be used if a content element selects an element.'); -testFlatTree( - createDOM('div', {'id': 'a'}, - createShadowRoot(createDOM('div', {'id': 'b'}), - createDOM('content', {'select': '#c'}, - createDOM('div', {'id': 'f1'}, - createDOM('div', {'id': 'f2'})))), - createDOM('div', {'id': 'c'}))); - -debug('Test for traversal, starting with a fallback element which is not used.'); -showFlatTree(getNodeInComposedTree('a/f1')); -showNextNode(getNodeInComposedTree('a/f1')); -showNextNode(getNodeInComposedTree('a/f2')); -debug(''); - -debug('Test for Nested ShadowRoots.'); -testFlatTree( - createDOM('div', {'id': 'a'}, - createShadowRoot(createDOM('div', {'id': 'b'}, - createShadowRoot(createDOM('div', {'id': 'c'}), - createDOM('content'), - createDOM('div', {'id': 'd'})), - createDOM('div', {'id': 'e'})), - createDOM('div', {'id': 'f'}), - createDOM('content'), - createDOM('div', {'id': 'g'})), - createDOM('div', {'id': 'h'}), - createDOM('div', {'id': 'i'}))); - -debug('Test for inactive insertion points.'); -testFlatTree( - createDOM('div', {'id': 'a'}, - createDOM('content', {'id': 'b'}, - createDOM('content', {'id': 'c'})))); - -debug('Test for a content element which does not select any nodes nor have fallback elements.'); -testFlatTree( - createDOM('div', {'id': 'a'}, - createShadowRoot(createDOM('content', {'select': '#none'}), - createDOM('div', {'id': 'b'}), - createDOM('content', {'select': '#none'}), - createDOM('div', {'id': 'c'}), - createDOM('content', {'select': '#none'})))); - -debug('Test for a nested insertion point.'); -testFlatTree( - createDOM('div', {'id': 'a'}, - createShadowRoot(createDOM('div', {'id': 'b'}, - createShadowRoot(createDOM('content', {})), - createDOM('content', {}))), - createDOM('div', {'id': 'c'}))); - -debug('Test for nested insertion points. Some of them are either empty insertion points or inactive insertion points.'); -testFlatTree( - createDOM('div', {'id': 'a'}, - createShadowRoot(createDOM('content', {'select': '#none'}), - createDOM('div', {'id': 'b'}, - createShadowRoot(createDOM('content', {'select': '.select-1'}), - createDOM('div', {'id': 'c'}), - createDOM('content', {'select': '.select-2'})), - createDOM('content', {'class': 'select-1', 'select': '.select-4'}), - createDOM('content', {'class': 'select-2', 'select': '#none'}), - createDOM('div', {'id': 'd', 'class': 'select-2'}), - createDOM('content', {'class': 'select-2', 'select': '#none'}), - createDOM('div', {'id': 'e', 'class': 'select-2'}), - createDOM('content', {'class': 'select-2', 'select': '#none'}))), - createDOM('content', {'id': 'inactive-insertion-point', 'class': 'select-4'}), - createDOM('div', {'id': 'should-not-be-selected'}), - createDOM('div', {'id': 'f', 'class': 'select-4'}))); - -debug('Test for a re-projection.'); -testFlatTree( - createDOM('div', {'id': 'a'}, - createShadowRoot( - createDOM('div', {'id': 'b'}, - createShadowRoot(createDOM('content', {'select': '#c'})), - createDOM('content', {'select': '#c'}))), - createDOM('div', {'id': 'c'}))); - -debug('Test for a content element which is selected by another content element.'); -testFlatTree( - createDOM('div', {'id': 'a'}, - createShadowRoot( - createDOM('div', {'id': 'b'}, - createShadowRoot(createDOM('content', {'select': '#content'}), - createDOM('div', {'id': 'most-inner-child'}), - createDOM('content', {'select': '#host-child'})), - createDOM('content', {'id': 'content', 'select': '#host-child'}, - createDOM('div', {'id': 'should-not-be-used'})), - createDOM('div', {'id': 'inner-child', 'class': 'foo'}))), - createDOM('div', {'id': 'host-child'}))); - -debug('Test for a reprojection. Content elements should be used in document order.'); -testFlatTree( - createDOM('div', {'id': 'a'}, - createShadowRoot( - createDOM('content', {'select': '#host-child1'}), - createDOM('div', {'id': 'b'}, - createShadowRoot(createDOM('content', {'select': '.child'})), - createDOM('content', {'select': '.child'}))), - createDOM('div', {'id': 'host-child1', 'class': 'child'}), - createDOM('div', {'id': 'host-child2', 'class': 'child'}))); - -debug('Test for complex re-projections.'); -testFlatTree( - createDOM('div', {'id': 'a'}, - createShadowRoot( - createDOM('div', {'id': 'b'}, - createShadowRoot(createDOM('content', {'select': '.foo'}), - createDOM('div', {'id': 'c'})), - // Select #child-1 - createDOM('content', {'select': '#child-1'}, - createDOM('div', {'class': 'should-not-be-used'}), - // Should not select any nodes since it's inactive. - createDOM('content', {'class': 'should-be-inactive', 'select': '.foo'})), - createDOM('div', {'id': 'd', 'class': 'foo'}, - createShadowRoot(createDOM('div', {'id': 'e'}), - // Should select #child-2 and #g. - createDOM('content', {'select': '.foo'}), - createDOM('div', {'id': 'f'})), - // Select #child-2 - createDOM('content', {'select': '#child-2'}), - createDOM('div', {'id': 'g', 'class': 'foo'})), - createDOM('div', {'class': 'should-not-be-selected'}), - createDOM('div', {'id': 'h', 'class': 'foo'}))), - createDOM('div', {'id': 'child-1', 'class': 'foo'}), - createDOM('div', {'id': 'not-selected', 'class': 'foo'}), - createDOM('div', {'id': 'child-2', 'class': 'foo'}))); -</script> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/focus-navigation-with-distributed-nodes-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/focus-navigation-with-distributed-nodes-expected.txt deleted file mode 100644 index 75ae1ae..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/focus-navigation-with-distributed-nodes-expected.txt +++ /dev/null
@@ -1,38 +0,0 @@ -CONSOLE WARNING: line 87: Element.createShadowRoot is deprecated and will be removed in M80, around February 2020. Please use Element.attachShadow instead. See https://www.chromestatus.com/features/4507242028072960 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -This tests that pressing Tab key should traverse into shadow DOM subtrees, and pressing Shift-Tab should reverse the order. - -Should move from input-1 to shadowhost in forward -PASS -Should move from shadowhost to shadowhost/input-2 in forward -PASS -Should move from shadowhost/input-2 to distributed-node-2 in forward -PASS -Should move from distributed-node-2 to distributed-node-1 in forward -PASS -Should move from distributed-node-1 to input-3 in forward -PASS -Should move from input-3 to distributed-node-1 in backward -PASS -Should move from distributed-node-1 to distributed-node-2 in backward -PASS -Should move from distributed-node-2 to shadowhost/input-2 in backward -PASS -Should move from shadowhost/input-2 to shadowhost in backward -PASS -Should move from shadowhost to input-1 in backward -PASS -details/summary elements use Shadow DOM and distributed nodes internally. -Should move from input-1 to summary-1 in forward -PASS -Should move from summary-1 to input-2 in forward -PASS -Should move from input-2 to summary-1 in backward -PASS -Should move from summary-1 to input-1 in backward -PASS -Test finished. -PASS successfullyParsed is true - -TEST COMPLETE - -
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/focus-navigation-with-distributed-nodes.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/focus-navigation-with-distributed-nodes.html deleted file mode 100644 index d989121b..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/focus-navigation-with-distributed-nodes.html +++ /dev/null
@@ -1,72 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script src="../../../resources/js-test.js"></script> -<script src="resources/shadow-dom.js"></script> -</head> -<body> -<p>This tests that pressing Tab key should traverse into shadow DOM subtrees, and pressing Shift-Tab should reverse the order.</p> -<div id="sandbox"></div> -<pre id="console"></pre> -<script> - -function testWithDistributedNodes() -{ - var sandbox = document.getElementById('sandbox'); - sandbox.innerHTML = ''; - sandbox.appendChild( - createDOM('div', {'id': 'top-div'}, - createDOM('input', {'id': 'input-1', 'tabindex': 1}), - createDOM('div', {'id': 'shadowhost', 'tabindex': 1}, - createShadowRoot( - createDOM('content', {'select': '#distributed-node-1'}), - createDOM('input', {'id': 'input-2', 'tabindex': 1}), - createDOM('content', {'select': '#distributed-node-2'})), - createDOM('input', {'id': 'distributed-node-2', 'tabindex': 1}), - createDOM('input', {'id': 'distributed-node-1', 'tabindex': 1})), - createDOM('input', {'id': 'input-3', 'tabindex': 1}))); - sandbox.offsetLeft; - - var elementsInFocusNavigationOrder = ['input-1', 'shadowhost', 'shadowhost/input-2', 'distributed-node-2', 'distributed-node-1', 'input-3']; - testFocusNavigationForward(elementsInFocusNavigationOrder); - elementsInFocusNavigationOrder.reverse() - testFocusNavigationBackward(elementsInFocusNavigationOrder) -} - -function testDetailsSummary() -{ - debug('details/summary elements use Shadow DOM and distributed nodes internally.') - var sandbox = document.getElementById('sandbox'); - sandbox.innerHTML = ''; - sandbox.appendChild( - createDOM('div', {'id': 'top-div'}, - createDOM('input', {'id': 'input-1'}), - createDOM('details', {'id': 'details-1'}, - createDOM('summary', {'id': 'summary-1'})), - createDOM('input', {'id': 'input-2'}))); - sandbox.offsetLeft; - - var elementsInFocusNavigationOrder = ['input-1', 'summary-1', 'input-2']; - testFocusNavigationForward(elementsInFocusNavigationOrder); - elementsInFocusNavigationOrder.reverse() - testFocusNavigationBackward(elementsInFocusNavigationOrder); -} - - -function test() { - if (!window.eventSender) { - testFailed(''); - return; - } - - testWithDistributedNodes() - testDetailsSummary(); - - debug('Test finished.'); -} - -test(); - -</script> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/gesture-tap-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/gesture-tap-expected.txt deleted file mode 100644 index 6b34a5c..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/gesture-tap-expected.txt +++ /dev/null
@@ -1,10 +0,0 @@ -CONSOLE WARNING: line 87: Element.createShadowRoot is deprecated and will be removed in M80, around February 2020. Please use Element.attachShadow instead. See https://www.chromestatus.com/features/4507242028072960 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. - - gesturetap - @div1-shadow-root-child (target: div1-shadow-root-child) - @div1 (target: div1) -PASS successfullyParsed is true - -TEST COMPLETE - -
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/gesture-tap.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/gesture-tap.html deleted file mode 100644 index 1460de94..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/gesture-tap.html +++ /dev/null
@@ -1,41 +0,0 @@ -<!DOCTYPE html> -<html> -<head> - <script src="../../../resources/js-test.js"></script> - <script src="resources/shadow-dom.js"></script> - <script src="resources/event-dispatching.js"></script> -</head> -<body> -<div id="sandbox"> -</div> -<pre id="console"></pre> -<script> -sandbox.appendChild( - createDOM('div', {'id': 'container'}, - createDOM('div', {'id': 'div1'}, - createShadowRoot( - createDOM('div', {}, - document.createTextNode('foo')), - createDOM('div', {'id': 'div1-shadow-root-child'}, - document.createTextNode('foo')), - createDOM('div', {}, - document.createTextNode('foo')))))); - -sandbox.offsetLeft; - -function gestureTap(elementId) -{ - var element = getNodeInComposedTree(elementId); - if (window.eventSender) { - eventSender.gestureTap(element.offsetLeft + element.offsetWidth / 2, element.offsetTop + element.offsetHeight / 2); - eventSender.leapForward(10); - eventSender.keyDown(' '); - } -} - -addEventListeners(['div1', 'div1/div1-shadow-root-child']); -gestureTap('div1/div1-shadow-root-child'); -debugDispatchedEvent('gesturetap'); -</script> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/get-destination-insertion-points-skips-user-agent-shadow-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/get-destination-insertion-points-skips-user-agent-shadow-expected.txt deleted file mode 100644 index fbba17f..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/get-destination-insertion-points-skips-user-agent-shadow-expected.txt +++ /dev/null
@@ -1,13 +0,0 @@ -CONSOLE WARNING: line 87: Element.createShadowRoot is deprecated and will be removed in M80, around February 2020. Please use Element.attachShadow instead. See https://www.chromestatus.com/features/4507242028072960 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -Tests that getDestinationInsertionPoints() should skip insertion points in user-agent shadow roots. - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - -PASS nodeList.length is expectedNodes.length -PASS nodeList.item(0) is expectedNodes[0] -PASS getNodeInComposedTree('host/detail-child').getDestinationInsertionPoints().length is 0 -PASS successfullyParsed is true - -TEST COMPLETE - -
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/get-destination-insertion-points-skips-user-agent-shadow.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/get-destination-insertion-points-skips-user-agent-shadow.html deleted file mode 100644 index 495be5a..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/get-destination-insertion-points-skips-user-agent-shadow.html +++ /dev/null
@@ -1,25 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script src="../../../resources/js-test.js"></script> -<script src="resources/shadow-dom.js"></script> -</head> -<body> -<script> -description("Tests that getDestinationInsertionPoints() should skip insertion points in user-agent shadow roots."); - -document.body.appendChild( - createDOM('div', {}, - createDOM('div', {'id': 'host'}, - createShadowRoot( - createDOM('detail', {'id': 'detail'}, - createDOM('div', {'id': 'detail-child'}), - createDOM('content', {'id': 'content'}))), - createDOM('div', {'id': 'host-child'})))); - -shouldBeEqualAsArray(document.getElementById('host-child').getDestinationInsertionPoints(), - [getNodeInComposedTree('host/content')]); -shouldBeZero("getNodeInComposedTree('host/detail-child').getDestinationInsertionPoints().length"); -</script> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/get-distributed-nodes-orphan-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/get-distributed-nodes-orphan-expected.txt deleted file mode 100644 index ec773ffb..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/get-distributed-nodes-orphan-expected.txt +++ /dev/null
@@ -1,30 +0,0 @@ -CONSOLE WARNING: line 26: Element.createShadowRoot is deprecated and will be removed in M80, around February 2020. Please use Element.attachShadow instead. See https://www.chromestatus.com/features/4507242028072960 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -getDistributedNodes() should work out of Document - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - -getDistributedNodes() should work out of Document -PASS nodeList.length is expectedNodes.length -PASS nodeList.item(0) is expectedNodes[0] - -When a content element is disconnected from ShadowRoot, it should not work. -PASS nodeList.length is expectedNodes.length - -Reprojection case -PASS nodeList.length is expectedNodes.length -PASS nodeList.item(0) is expectedNodes[0] -PASS nodeList.length is expectedNodes.length -PASS nodeList.item(0) is expectedNodes[0] -PASS nodeList.item(1) is expectedNodes[1] - -rootChild is disconnected. Now content became inactive, so content element itself should be distributed. -PASS nodeList.length is expectedNodes.length -PASS nodeList.length is expectedNodes.length -PASS nodeList.item(0) is expectedNodes[0] -PASS nodeList.item(1) is expectedNodes[1] - -PASS successfullyParsed is true - -TEST COMPLETE - -
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/get-distributed-nodes-orphan.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/get-distributed-nodes-orphan.html deleted file mode 100644 index 428e724..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/get-distributed-nodes-orphan.html +++ /dev/null
@@ -1,63 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script src="../../../resources/js-test.js"></script> -<script src="resources/shadow-dom.js"></script> -</head> -<body> - -<div id="container"></div> -<pre id="console"></pre> - -<script> -description("getDistributedNodes() should work out of Document"); - -function assertNodeList(nodeList, expectedNodes) -{ - window.nodeList = nodeList; - window.expectedNodes = expectedNodes; - shouldBe("nodeList.length", "expectedNodes.length"); - for (var i = 0; i < nodeList.length; ++i) { - shouldBe("nodeList.item(" + i + ")", "expectedNodes[" + i + "]"); - } -} - -var host = document.createElement('div'); -var shadowRoot = host.createShadowRoot(); -var child = document.createElement('div'); -var rootChild = document.createElement('div'); -var content = document.createElement('content'); - -host.appendChild(child); -rootChild.appendChild(content); -shadowRoot.appendChild(rootChild); - -debug('getDistributedNodes() should work out of Document'); -assertNodeList(content.getDistributedNodes(), [child]); -debug(''); - -debug('When a content element is disconnected from ShadowRoot, it should not work.'); -shadowRoot.removeChild(rootChild); -assertNodeList(content.getDistributedNodes(), []); -debug(''); - -debug('Reprojection case'); -shadowRoot.appendChild(rootChild); -var shadowRoot2 = rootChild.createShadowRoot(); -var content2 = document.createElement('content'); -var rootChildChild = document.createElement('div'); -shadowRoot2.appendChild(content2); -rootChild.appendChild(rootChildChild); - -assertNodeList(content.getDistributedNodes(), [child]); -assertNodeList(content2.getDistributedNodes(), [child, rootChildChild]); -debug(''); - -debug('rootChild is disconnected. Now content became inactive, so content element itself should be distributed.'); -shadowRoot.removeChild(rootChild); -assertNodeList(content.getDistributedNodes(), []); -assertNodeList(content2.getDistributedNodes(), [content, rootChildChild]); -debug(''); -</script> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/getComputedStyle-with-distribution-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/getComputedStyle-with-distribution-expected.txt deleted file mode 100644 index dbed4c7..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/getComputedStyle-with-distribution-expected.txt +++ /dev/null
@@ -1,11 +0,0 @@ -CONSOLE WARNING: line 87: Element.createShadowRoot is deprecated and will be removed in M80, around February 2020. Please use Element.attachShadow instead. See https://www.chromestatus.com/features/4507242028072960 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -crbug.com/337618: computedStyle should be cleared when distribution is updated - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - -PASS window.getComputedStyle(getNodeInComposedTree("child/bar")).color is "rgb(0, 128, 0)" -PASS window.getComputedStyle(getNodeInComposedTree("child/bar")).color is "rgb(0, 0, 0)" -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/getComputedStyle-with-distribution.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/getComputedStyle-with-distribution.html deleted file mode 100644 index f3b7571..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/getComputedStyle-with-distribution.html +++ /dev/null
@@ -1,28 +0,0 @@ -<!DOCTYPE html> -<head> -<script src="resources/shadow-dom.js"></script> -<script src="../../../resources/js-test.js"></script> -</head> -<body> -</body> -<script> -description('crbug.com/337618: computedStyle should be cleared when distribution is updated'); - -document.body.appendChild( - createDOM('div', {'id': 'host'}, - createShadowRoot( - createDOM('div', {'class': 'foo'}, - createDOM('content', {'id': 'content', 'select': '*'}))), - createDOM('div', {'id': 'child'}, - createShadowRoot( - createDOM('style', {}, - document.createTextNode(":host-context(.foo) div { color: green; }")), - createDOM('div', {'id': 'bar'}, - document.createTextNode("bar")))))); - -shouldBe('window.getComputedStyle(getNodeInComposedTree("child/bar")).color', '"rgb(0, 128, 0)"'); - -var content = getNodeInComposedTree('host/content'); -content.setAttribute('select', '.foobar'); -shouldBe('window.getComputedStyle(getNodeInComposedTree("child/bar")).color', '"rgb(0, 0, 0)"'); -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/host-context-class-change-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/host-context-class-change-expected.txt deleted file mode 100644 index 60eb3c83..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/host-context-class-change-expected.txt +++ /dev/null
@@ -1,12 +0,0 @@ -CONSOLE WARNING: line 87: Element.createShadowRoot is deprecated and will be removed in M80, around February 2020. Please use Element.attachShadow instead. See https://www.chromestatus.com/features/4507242028072960 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -Class change affecting a node in a distributed node's subtree. - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - -PASS getComputedStyle(b, null).backgroundColor is transparent -PASS getComputedStyle(b, null).backgroundColor is green -PASS successfullyParsed is true - -TEST COMPLETE - -
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/host-context-class-change.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/host-context-class-change.html deleted file mode 100644 index 869bc895..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/host-context-class-change.html +++ /dev/null
@@ -1,38 +0,0 @@ -<!DOCTYPE html> -<script src="../../../resources/js-test.js"></script> -<script src="resources/shadow-dom.js"></script> -<style> -</style> -<div id="sandbox"></div> -<script> -description("Class change affecting a node in a distributed node's subtree."); - -var sandbox = document.getElementById('sandbox'); - -sandbox.appendChild( - createDOM('parent-element', {}, - createShadowRoot( - createDOM('div', {'id': 'a'}, - createDOM('content', {}))), - createDOM('child-element', {}, - createShadowRoot( - createDOM('style', {}, - document.createTextNode(':host-context(.a) .b { background-color: green; }')), - createDOM('div', {}, - createDOM('div', {'class': 'b'})))))); - -var transparent = "rgba(0, 0, 0, 0)"; -var green = "rgb(0, 128, 0)"; - -document.body.offsetTop; // force recalc - -var a = sandbox.querySelector("parent-element").shadowRoot.querySelector("#a"); -var b = sandbox.querySelector("child-element").shadowRoot.querySelector(".b"); - -shouldBe("getComputedStyle(b, null).backgroundColor", "transparent"); - -a.className = "a"; -document.body.offsetTop; // force recalc. - -shouldBe("getComputedStyle(b, null).backgroundColor", "green"); -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/hostcontext-pseudo-class-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/hostcontext-pseudo-class-expected.txt deleted file mode 100644 index a6fad19..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/hostcontext-pseudo-class-expected.txt +++ /dev/null
@@ -1,48 +0,0 @@ -CONSOLE WARNING: line 87: Element.createShadowRoot is deprecated and will be removed in M80, around February 2020. Please use Element.attachShadow instead. See https://www.chromestatus.com/features/4507242028072960 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -Test whether :host-context matches a shadow host correctly. - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - -:host-context out of shadow tree should not match any shadow hosts. -PASS backgroundColorOf('host') is "rgba(0, 0, 0, 0)" -:host-context with * should not match any shadow hosts. -PASS backgroundColorOf('host') is "rgba(0, 0, 0, 0)" -:host-context with tag selector should not match any shadow hosts. -PASS backgroundColorOf('host') is "rgba(0, 0, 0, 0)" -:host-context with class selector should not match any shadow hosts. -PASS backgroundColorOf('host') is "rgba(0, 0, 0, 0)" -:host-context with id selector should not match any shadow hosts. -PASS backgroundColorOf('host') is "rgba(0, 0, 0, 0)" -:host-context with attribute selector should not match any shadow hosts. -PASS backgroundColorOf('host') is "rgba(0, 0, 0, 0)" -:host-context in a shadow tree should match its shadow host. -PASS backgroundColorOf('host') is "rgb(0, 128, 0)" -:host-context with :host in a shadow tree should match its shadow host. -PASS backgroundColorOf('host') is "rgb(0, 128, 0)" -crbug.com/552602 :host-context with non-matching selector with :host should not crash. -PASS backgroundColorOf('host') is "rgba(0, 0, 0, 0)" -:host-context takes simple selectors and matches when one of the simple selectors matches. -PASS backgroundColorOf('host') is "rgb(0, 128, 0)" -:host-context matches a shadow host in just a nested shadow tree, not all enclosing shadow trees. -PASS backgroundColorOf('host1') is "rgba(0, 0, 0, 0)" -PASS backgroundColorOf('host1/host2') is "rgb(0, 128, 0)" -:host-context matches based on a flat tree. -PASS backgroundColorOf('host/target') is "rgb(0, 128, 0)" -:host-context is updated when its matched ancestor changes className or id. -PASS backgroundColorOf('host') is "rgb(0, 128, 0)" -PASS backgroundColorOf('host') is "rgba(0, 0, 0, 0)" -PASS backgroundColorOf('host') is "rgb(0, 128, 0)" -PASS backgroundColorOf('host') is "rgba(0, 0, 0, 0)" -Compare :host-context with :host-context. -PASS backgroundColorOf('host') is "rgb(0, 128, 0)" -PASS backgroundColorOf('host') is "rgb(255, 0, 0)" -PASS backgroundColorOf('host/target') is "rgb(0, 128, 0)" -PASS backgroundColorOf('host/target') is "rgb(0, 128, 0)" -PASS backgroundColorOf('host/target') is "rgb(0, 128, 0)" -:host-context without functional notation should not match any shadow hosts. -PASS backgroundColorOf('host') is "rgba(0, 0, 0, 0)" -PASS successfullyParsed is true - -TEST COMPLETE - -
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/hostcontext-pseudo-class.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/hostcontext-pseudo-class.html deleted file mode 100644 index 60fa1851..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/hostcontext-pseudo-class.html +++ /dev/null
@@ -1,321 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script src="../../../resources/js-test.js"></script> -<script src="resources/shadow-dom.js"></script> -<style> -:host-context(*) { - background-color: red; -} -</style> -</head> -<body class='mytheme'> - <div> - <div id='sandbox'></div> - </div> - <pre id='console'></pre> -<script> -description('Test whether :host-context matches a shadow host correctly.'); - -var sandbox = document.getElementById('sandbox'); - -function cleanUp() { - sandbox.innerHTML = ''; -} - -debug(':host-context out of shadow tree should not match any shadow hosts.'); - -sandbox.appendChild( - createDOM('div', {'id': 'host'}, - createShadowRoot( - createDOM('div', {}, - document.createTextNode('Hello'))))); - -backgroundColorShouldBe('host', 'rgba(0, 0, 0, 0)'); - -cleanUp(); - -debug(':host-context with * should not match any shadow hosts.'); - -sandbox.appendChild( - createDOM('div', {'id': 'host'}, - createShadowRoot( - createDOM('style', {}, - document.createTextNode('*:host-context(*) { background-color: red; }')), - createDOM('div', {}, - document.createTextNode('Hello'))))); - -backgroundColorShouldBe('host', 'rgba(0, 0, 0, 0)'); - -cleanUp(); - -debug(':host-context with tag selector should not match any shadow hosts.'); - -sandbox.appendChild( - createDOM('div', {'id': 'host'}, - createShadowRoot( - createDOM('style', {}, - document.createTextNode('div:host-context(*) { background-color: red; }')), - createDOM('div', {}, - document.createTextNode('Hello'))))); - -backgroundColorShouldBe('host', 'rgba(0, 0, 0, 0)'); - -cleanUp(); - -debug(':host-context with class selector should not match any shadow hosts.'); - -sandbox.appendChild( - createDOM('div', {'id': 'host', 'class': 'host'}, - createShadowRoot( - createDOM('style', {}, - document.createTextNode('.host:host-context(*) { background-color: red; }')), - createDOM('div', {}, - document.createTextNode('Hello'))))); - -backgroundColorShouldBe('host', 'rgba(0, 0, 0, 0)'); - -cleanUp(); - -debug(':host-context with id selector should not match any shadow hosts.'); - -sandbox.appendChild( - createDOM('div', {'id': 'host'}, - createShadowRoot( - createDOM('style', {}, - document.createTextNode('#host:host-context(*) { background-color: red; }')), - createDOM('div', {}, - document.createTextNode('Hello'))))); - -backgroundColorShouldBe('host', 'rgba(0, 0, 0, 0)'); - -cleanUp(); - -debug(':host-context with attribute selector should not match any shadow hosts.'); - -sandbox.appendChild( - createDOM('div', {'id': 'host', 'foo': 'bar'}, - createShadowRoot( - createDOM('style', {}, - document.createTextNode('[foo=bar]:host-context(*) { background-color: red; }')), - createDOM('div', {}, - document.createTextNode('Hello'))))); - -backgroundColorShouldBe('host', 'rgba(0, 0, 0, 0)'); - -cleanUp(); - -debug(':host-context in a shadow tree should match its shadow host.'); - -sandbox.appendChild( - createDOM('div', {'id': 'host'}, - createShadowRoot( - createDOM('style', {}, - document.createTextNode(':host-context(body.mytheme) { background-color: green; }')), - createDOM('div', {}, - document.createTextNode('Hello'))))); - -backgroundColorShouldBe('host', 'rgb(0, 128, 0)'); - -cleanUp(); - -debug(':host-context with :host in a shadow tree should match its shadow host.'); - -sandbox.appendChild( - createDOM('div', {'id': 'host'}, - createShadowRoot( - createDOM('style', {}, - document.createTextNode(':host-context(div:host) { background-color: green; }')), - createDOM('div', {}, - document.createTextNode('Hello'))))); - -backgroundColorShouldBe('host', 'rgb(0, 128, 0)'); - -cleanUp(); - -debug('crbug.com/552602 :host-context with non-matching selector with :host should not crash.'); - -sandbox.appendChild( - createDOM('host-element', {'id': 'host'}, - createShadowRoot( - createDOM('style', {}, - document.createTextNode(':host-context(div:host) { background-color: green; }')), - createDOM('div', {}, - document.createTextNode('Hello'))))); - -backgroundColorShouldBe('host', 'rgba(0, 0, 0, 0)'); - -cleanUp(); - -debug(':host-context takes simple selectors and matches when one of the simple selectors matches.'); - -sandbox.appendChild( - createDOM('div', {'id': 'parentOfHost'}, - createDOM('div', {'id': 'host'}, - createShadowRoot( - createDOM('style', {}, - document.createTextNode(':host-context(body:not(.mytheme), span, div#parentOfHost) { background-color: green; }')), - createDOM('div', {}, - document.createTextNode('Hello')))))); - -backgroundColorShouldBe('host', 'rgb(0, 128, 0)'); - -cleanUp(); - -debug(':host-context matches a shadow host in just a nested shadow tree, not all enclosing shadow trees.'); - -sandbox.appendChild( - createDOM('div', {'id': 'host1'}, - createShadowRoot( - createDOM('div', {'id': 'host2'}, - createShadowRoot( - createDOM('style', {}, - document.createTextNode(':host-context(*) { background-color: green; }')), - createDOM('div', {}, - document.createTextNode('Hello'))))))); - -backgroundColorShouldBe('host1', 'rgba(0, 0, 0, 0)'); -backgroundColorShouldBe('host1/host2', 'rgb(0, 128, 0)'); - -debug(':host-context matches based on a flat tree.'); - -sandbox.appendChild( - createDOM('div', {'id': 'parentOfHost'}, - createShadowRoot( - createDOM('span', {'id': 'spanA'}, - createDOM('content', {}))), - createDOM('div', {'id': 'host'}, - createShadowRoot( - createDOM('style', {}, - document.createTextNode(':host-context(span#spanA) > div { background-color: green; }')), - createDOM('div', {'id': 'target'}, - document.createTextNode('Hello')))))); - -backgroundColorShouldBe('host/target', 'rgb(0, 128, 0)'); - -cleanUp(); - -debug(':host-context is updated when its matched ancestor changes className or id.'); - -sandbox.appendChild( - createDOM('div', {'id': 'parentOfHost', 'class': 'sometheme' }, - createDOM('div', {'id': 'host'}, - createShadowRoot( - createDOM('style', {}, - document.createTextNode(':host-context(div#parentOfHost.sometheme) { background-color: green; }')), - createDOM('div', {}, - document.createTextNode('Hello')))))); - -backgroundColorShouldBe('host', 'rgb(0, 128, 0)'); -document.getElementById('parentOfHost').className = 'mytheme'; -backgroundColorShouldBe('host', 'rgba(0, 0, 0, 0)'); - -cleanUp(); - -sandbox.appendChild( - createDOM('div', {'id': 'parentOfHost', 'class': 'sometheme' }, - createDOM('div', {'id': 'host'}, - createShadowRoot( - createDOM('style', {}, - document.createTextNode(':host-context(div#parentOfHost.sometheme) { background-color: green; }')), - createDOM('div', {}, - document.createTextNode('Hello')))))); - -backgroundColorShouldBe('host', 'rgb(0, 128, 0)'); -var parentOfHost = document.getElementById('parentOfHost'); -parentOfHost.id = 'differntIdValue'; -backgroundColorShouldBe('host', 'rgba(0, 0, 0, 0)'); - -cleanUp(); - -debug('Compare :host-context with :host-context.'); - -sandbox.appendChild( - createDOM('div', {'id': 'host'}, - createShadowRoot( - createDOM('style', {}, - document.createTextNode(':host-context(div:host-context(*), div#sandbox) { background-color: green; }')), - createDOM('style', {}, - document.createTextNode(':host-context(body.mytheme) { background-color: red; }')), - createDOM('div', {}, - document.createTextNode('Hello'))))); - -// :host-context(div:host-context(*), div#sandbox) wins, because div#sandbox > body.mytheme. -backgroundColorShouldBe('host', 'rgb(0, 128, 0)'); - -cleanUp(); - -sandbox.appendChild( - createDOM('div', {'id': 'host'}, - createShadowRoot( - createDOM('style', {}, - document.createTextNode(':host-context(div:host-context(*), div#nomatch) { background-color: green; }')), - createDOM('style', {}, - document.createTextNode(':host-context(body.mytheme) { background-color: red; }')), - createDOM('div', {}, - document.createTextNode('Hello'))))); - -// :host-context(body.mytheme) wins, because div:host-context(*) < body.mytheme. -backgroundColorShouldBe('host', 'rgb(255, 0, 0)'); - -cleanUp(); - -// Test for specificiy of ":host-context(...) > ...". -sandbox.appendChild( - createDOM('div', {'id': 'host'}, - createShadowRoot( - createDOM('style', {}, - document.createTextNode(':host-context(div:host-context(*), div#host:host-context(*)) > div { background-color: green; }')), - createDOM('style', {}, - document.createTextNode(':host-context(body.mytheme) > div { background-color: red; }')), - createDOM('div', {'id': 'target'}, - document.createTextNode('Hello'))))); - -backgroundColorShouldBe('host/target', 'rgb(0, 128, 0)'); - -cleanUp(); - -sandbox.appendChild( - createDOM('div', {'id': 'host', 'class': 'host'}, - createShadowRoot( - createDOM('style', {}, - document.createTextNode(':host-context(div:host-context(*), div#host.host:host-context(*)) > div { background-color: green; }')), - createDOM('style', {}, - document.createTextNode(':host-context(body) > div#target { background-color: red; }')), - createDOM('div', {'id': 'target'}, - document.createTextNode('Hello'))))); - -backgroundColorShouldBe('host/target', 'rgb(0, 128, 0)'); - -cleanUp(); - -sandbox.appendChild( - createDOM('div', {'id': 'host', 'class': 'host'}, - createShadowRoot( - createDOM('style', {}, - document.createTextNode(':host-context(div:host-context(div:host-context(div:host-context(div:host-context(*))))) > div { background-color: green; }')), - createDOM('style', {}, - document.createTextNode(':host-context(div) > div { background-color: red; }')), - createDOM('div', {'id': 'target'}, - document.createTextNode('Hello'))))); - -backgroundColorShouldBe('host/target', 'rgb(0, 128, 0)'); - -cleanUp(); - -debug(':host-context without functional notation should not match any shadow hosts.'); - -sandbox.appendChild( - createDOM('div', {'id': 'host'}, - createShadowRoot( - createDOM('style', {}, - document.createTextNode(':host-context { background-color: red; }')), - createDOM('div', {}, - document.createTextNode('Hello'))))); - -backgroundColorShouldBe('host', 'rgba(0, 0, 0, 0)'); - -cleanUp(); - -</script> -</body>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/hover-active-drag-distributed-nodes-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/hover-active-drag-distributed-nodes-expected.txt deleted file mode 100644 index 659af15..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/hover-active-drag-distributed-nodes-expected.txt +++ /dev/null
@@ -1,23 +0,0 @@ -CONSOLE WARNING: line 56: Element.createShadowRoot is deprecated and will be removed in M80, around February 2020. Please use Element.attachShadow instead. See https://www.chromestatus.com/features/4507242028072960 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -Top-level text Nested text -Other div -PASS backgroundColor is "rgb(0, 128, 0)" -PASS backgroundColor is "rgb(0, 255, 255)" -PASS backgroundColor is "rgb(0, 128, 0)" -PASS backgroundColor is "rgb(255, 0, 0)" -PASS backgroundColor is "rgb(0, 128, 0)" -PASS textColor is "rgb(0, 128, 0)" -PASS backgroundColor is "rgb(0, 255, 255)" -PASS textColor is "rgb(0, 255, 255)" -PASS backgroundColor is "rgb(0, 128, 0)" -PASS textColor is "rgb(0, 128, 0)" -PASS backgroundColor is "rgb(255, 0, 0)" -PASS textColor is "rgb(0, 0, 0)" -PASS backgroundColor is "rgb(0, 128, 0)" -PASS backgroundColor is "rgb(0, 255, 255)" -PASS backgroundColor is "rgb(0, 128, 0)" -PASS backgroundColor is "rgb(255, 0, 0)" -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/hover-active-drag-distributed-nodes.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/hover-active-drag-distributed-nodes.html deleted file mode 100644 index eff2236..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/hover-active-drag-distributed-nodes.html +++ /dev/null
@@ -1,109 +0,0 @@ -<!doctype html> -<html> -<head> -<template id='template'> - <style> - div { - background-color: rgb(255, 0, 0); - } - div:hover { - background-color: rgb(0, 128, 0); - } - div:hover:active { - background-color: rgb(0, 255, 255); - } - div:active { - background-color: rgb(0, 0, 255); - } - </style> - <div id='div-in-shadow'> - <content></content> - </div> -</template> -<style> - span:hover { - color: rgb(0, 128, 0); - } - span:active:hover { - color: rgb(0, 255, 255); - } - span:active { - color: rgb(0, 0, 255); - } -</style> -</head> -<body> - <div id='host'>Top-level text <span>Nested text</span></div> - <div id='other'>Other div</div> - <pre id='console'></pre> -</body> - -<script src="../../../resources/js-test.js"></script> -<script> -var backgroundColor, textColor; - -function shouldHaveBackgroundColor(element, bg) { - backgroundColor = getComputedStyle(element, null).getPropertyValue("background-color") - shouldBeEqualToString('backgroundColor', bg) -} - -function shouldHaveTextColor(element, col) { - textColor = getComputedStyle(element, null).getPropertyValue("color") - shouldBeEqualToString('textColor', col) -} - -var host = document.getElementById('host'); -var shadowRoot = host.createShadowRoot(); -var temp = document.getElementById('template'); -shadowRoot.appendChild(temp.content.cloneNode(true)); -var div = shadowRoot.querySelector('div'); -var span = host.querySelector(':scope > span'); - -var divRect = div.getBoundingClientRect(); -var spanRect = span.getBoundingClientRect(); -var otherRect = document.getElementById('other').getBoundingClientRect(); - -eventSender.dragMode = false; -eventSender.mouseDown(); -eventSender.mouseUp(); - -var posDivNotSpanX = parseInt((spanRect.right + divRect.right) / 2); -var spanCenterPosX = parseInt((spanRect.left + spanRect.right) / 2); -var spanCenterPosY = parseInt((spanRect.top + spanRect.bottom) / 2); -var topTextPosX = parseInt((divRect.left + spanRect.left) / 2); -var topTextPosY = spanCenterPosY; -var otherPosX = parseInt((otherRect.left + otherRect.right) / 2); -var otherPosY = parseInt((otherRect.top + otherRect.bottom) / 2); - -eventSender.mouseMoveTo(posDivNotSpanX, spanCenterPosY); -shouldHaveBackgroundColor(div, 'rgb(0, 128, 0)'); -eventSender.mouseDown(); -shouldHaveBackgroundColor(div, 'rgb(0, 255, 255)'); -eventSender.mouseUp(); -shouldHaveBackgroundColor(div, 'rgb(0, 128, 0)'); -eventSender.mouseMoveTo(otherPosX, otherPosY); -shouldHaveBackgroundColor(div, 'rgb(255, 0, 0)'); - -eventSender.mouseMoveTo(spanCenterPosX, spanCenterPosY); -shouldHaveBackgroundColor(div, 'rgb(0, 128, 0)'); -shouldHaveTextColor(span, 'rgb(0, 128, 0)'); -eventSender.mouseDown(); -shouldHaveBackgroundColor(div, 'rgb(0, 255, 255)'); -shouldHaveTextColor(span, 'rgb(0, 255, 255)'); -eventSender.mouseUp(); -shouldHaveBackgroundColor(div, 'rgb(0, 128, 0)'); -shouldHaveTextColor(span, 'rgb(0, 128, 0)'); -eventSender.mouseMoveTo(otherPosX, otherPosY); -shouldHaveBackgroundColor(div, 'rgb(255, 0, 0)'); -shouldHaveTextColor(span, 'rgb(0, 0, 0)'); - -eventSender.mouseMoveTo(topTextPosX, topTextPosY); -shouldHaveBackgroundColor(div, 'rgb(0, 128, 0)'); -eventSender.mouseDown(); -shouldHaveBackgroundColor(div, 'rgb(0, 255, 255)'); -eventSender.mouseUp(); -shouldHaveBackgroundColor(div, 'rgb(0, 128, 0)'); -eventSender.mouseMoveTo(otherPosX, otherPosY); -shouldHaveBackgroundColor(div, 'rgb(255, 0, 0)'); -</script> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/img-display-contents-crash-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/img-display-contents-crash-expected.txt deleted file mode 100644 index 654ddf7f..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/img-display-contents-crash-expected.txt +++ /dev/null
@@ -1 +0,0 @@ -This test passes if it does not crash.
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/img-display-contents-crash.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/img-display-contents-crash.html deleted file mode 100644 index 24d64f4..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/img-display-contents-crash.html +++ /dev/null
@@ -1,7 +0,0 @@ -<!DOCTYPE html> -<img style="display:contents" src="invalid"> -<p>This test passes if it does not crash.</p> -<script> -if (window.testRunner) - testRunner.dumpAsText(); -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/input-date-display-contents-crash-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/input-date-display-contents-crash-expected.txt deleted file mode 100644 index 654ddf7f..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/input-date-display-contents-crash-expected.txt +++ /dev/null
@@ -1 +0,0 @@ -This test passes if it does not crash.
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/input-date-display-contents-crash.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/input-date-display-contents-crash.html deleted file mode 100644 index f0e3e675..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/input-date-display-contents-crash.html +++ /dev/null
@@ -1,9 +0,0 @@ -<!DOCTYPE HTML> -<p>This test passes if it does not crash.</p> -<input id="date" type="date" value="1986-07-31"> -<script> - document.getElementById('date').focus(); - document.getElementById('date').style.display = "contents"; - if (window.testRunner) - testRunner.dumpAsText(); -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/no-style-sharing-with-distributed-nodes-expected.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/no-style-sharing-with-distributed-nodes-expected.html deleted file mode 100644 index f2c9391..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/no-style-sharing-with-distributed-nodes-expected.html +++ /dev/null
@@ -1,34 +0,0 @@ -<!doctype html> -<html> -<head> -<style> -.container { - border:1px solid black; -} -.container>.number { - color:red; -} -.container>.letters { - color:blue; -} -</style> -</head> -<body> -<div id="test1"> - <div class="number">1</div> - <div class="letters">QUX</div> -</div> - -<div id="test2"> - <div class="container"> - <div class="number"><div class="number">2</div></div> - <div class="letters"><div class="letters">FOO</div></div> - </div> -</div> - -<div id="test3"> - <div class="number">3</div> - <div class="letters">BAR</div> -</div> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/no-style-sharing-with-distributed-nodes-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/no-style-sharing-with-distributed-nodes-expected.txt deleted file mode 100644 index 4b2608b..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/no-style-sharing-with-distributed-nodes-expected.txt +++ /dev/null
@@ -1 +0,0 @@ -CONSOLE WARNING: line 6: Element.createShadowRoot is deprecated and will be removed in M80, around February 2020. Please use Element.attachShadow instead. See https://www.chromestatus.com/features/4507242028072960 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details.
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/no-style-sharing-with-distributed-nodes.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/no-style-sharing-with-distributed-nodes.html deleted file mode 100644 index 88f40ad..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/no-style-sharing-with-distributed-nodes.html +++ /dev/null
@@ -1,46 +0,0 @@ -<!doctype html> -<html> -<head> -<script> -function runTest() { - var shadow = document.querySelector('#test2').createShadowRoot(); - var template = document.querySelector('template'); - shadow.appendChild(template.content); -} -</script> -</head> -<body onload="runTest()"> -<template> - <style> - .container { - border:1px solid black; - } - .container>.number { - color:red; - } - .container>.letters { - color:blue; - } - </style> - <div class="container"> - <div class="number"><content select=".number"></content></div> - <div class="letters"><content select=".letters"></content></div> - </div> -</template> - -<div id="test1"> - <div class="number">1</div> - <div class="letters">QUX</div> -</div> - -<div id="test2"> - <div class="number">2</div> - <div class="letters">FOO</div> -</div> - -<div id="test3"> - <div class="number">3</div> - <div class="letters">BAR</div> -</div> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/no-style-sharing-with-uncommon-attribute-and-pseudo-content-expected.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/no-style-sharing-with-uncommon-attribute-and-pseudo-content-expected.html deleted file mode 100644 index 0d8fda79..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/no-style-sharing-with-uncommon-attribute-and-pseudo-content-expected.html +++ /dev/null
@@ -1,9 +0,0 @@ -<!doctype html> -<html> -<head> -<body> - <div> - <p>NotHidden</p> - </div> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/no-style-sharing-with-uncommon-attribute-and-pseudo-content-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/no-style-sharing-with-uncommon-attribute-and-pseudo-content-expected.txt deleted file mode 100644 index fd094f7..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/no-style-sharing-with-uncommon-attribute-and-pseudo-content-expected.txt +++ /dev/null
@@ -1 +0,0 @@ -CONSOLE WARNING: line 9: Element.createShadowRoot is deprecated and will be removed in M80, around February 2020. Please use Element.attachShadow instead. See https://www.chromestatus.com/features/4507242028072960 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details.
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/no-style-sharing-with-uncommon-attribute-and-pseudo-content.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/no-style-sharing-with-uncommon-attribute-and-pseudo-content.html deleted file mode 100644 index f347ded..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/no-style-sharing-with-uncommon-attribute-and-pseudo-content.html +++ /dev/null
@@ -1,26 +0,0 @@ -<!doctype html> -<html> -<head> -<script> -if (window.testRunner) - testRunner.waitUntilDone(); - -function runTest() { - var shadow = host.createShadowRoot(); - shadow.innerHTML = "<div id='hostInShadow'><div class='parent'><p ishidden='false'>NotHidden</p><p ishidden='true' id='target'>Hidden</p></div></div>"; - - var innerShadow = shadow.getElementById('hostInShadow').createShadowRoot(); - innerShadow.innerHTML = "<style>content::content .parent [ishidden=true] { display: none; }</style><content>"; - - window.setTimeout(function() { - if (window.testRunner) - testRunner.notifyDone(); - }, 0); -} -</script> -</head> -<body onload="runTest()"> -<div id="host"> -</div> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/outer-scope-lower-specificity-wins-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/outer-scope-lower-specificity-wins-expected.txt deleted file mode 100644 index 739cc51..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/outer-scope-lower-specificity-wins-expected.txt +++ /dev/null
@@ -1,11 +0,0 @@ -CONSOLE WARNING: line 87: Element.createShadowRoot is deprecated and will be removed in M80, around February 2020. Please use Element.attachShadow instead. See https://www.chromestatus.com/features/4507242028072960 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -Inner scope rules wins, with higher specificity (v0 bug compatibility). - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - -PASS getComputedStyle(target).color is "rgb(255, 0, 0)" -PASS successfullyParsed is true - -TEST COMPLETE - -
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/outer-scope-lower-specificity-wins.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/outer-scope-lower-specificity-wins.html deleted file mode 100644 index e71107f..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/outer-scope-lower-specificity-wins.html +++ /dev/null
@@ -1,21 +0,0 @@ -<!DOCTYPE html> -<script src="../../../resources/js-test.js"></script> -<script src="resources/shadow-dom.js"></script> -<div id="sandbox"></div> -<script> -description('Inner scope rules wins, with higher specificity (v0 bug compatibility).'); - -sandbox.appendChild( - createDOM('div', {'id': 'host'}, - createShadowRoot( - createDOM('style', {}, - document.createTextNode( - '::content #target { color: red; }')), - createDOM('content', {})), - createDOM('style', {}, - document.createTextNode( - 'span { color: green; }')), - createDOM('span', {'id': 'target'}))); - -shouldBeEqualToString('getComputedStyle(target).color', 'rgb(255, 0, 0)'); -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/pseudo-not-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/pseudo-not-expected.txt deleted file mode 100644 index ca5b429d..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/pseudo-not-expected.txt +++ /dev/null
@@ -1,13 +0,0 @@ -CONSOLE WARNING: line 14: Element.createShadowRoot is deprecated and will be removed in M80, around February 2020. Please use Element.attachShadow instead. See https://www.chromestatus.com/features/4507242028072960 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -Test the :not pseudo selector in - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - -PASS content.getDistributedNodes().length is 1 -PASS content.getDistributedNodes()[0].className is "second" -PASS content.getDistributedNodes().length is 1 -PASS content.getDistributedNodes()[0].className is "first" -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/pseudo-not.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/pseudo-not.html deleted file mode 100644 index ffc4fac..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/pseudo-not.html +++ /dev/null
@@ -1,25 +0,0 @@ -<!DOCTYPE html> - -<script src="../../../resources/js-test.js"></script> - -<div id="host"> - <span class="first"></span> - <span class="second"></span> -</div> - -<script> -description("Test the :not pseudo selector in <content select>"); - -var host = document.getElementById("host"); -var root = host.createShadowRoot(); -var content = document.createElement("content"); -root.appendChild(content); - -content.select = ":not(.first)"; -shouldBe("content.getDistributedNodes().length", "1"); -shouldBeEqualToString("content.getDistributedNodes()[0].className", "second"); - -content.select = ":not(.second)"; -shouldBe("content.getDistributedNodes().length", "1"); -shouldBeEqualToString("content.getDistributedNodes()[0].className", "first"); -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/querySelector-for-useragent-shadowroot-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/querySelector-for-useragent-shadowroot-expected.txt deleted file mode 100644 index e24c78a..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/querySelector-for-useragent-shadowroot-expected.txt +++ /dev/null
@@ -1,25 +0,0 @@ - - -crbug.com/337616: test for querySelectorAll with ::shadow and /deep/ - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - -PASS document.querySelectorAll("form /deep/ *").length is 1 -PASS document.querySelectorAll("form /deep/ *")[0].id is "input" -PASS document.querySelectorAll("form::shadow *").length is 0 -PASS document.querySelectorAll("input /deep/ *").length is 0 -PASS document.querySelectorAll("input::shadow *").length is 0 -PASS document.querySelectorAll("details /deep/ *").length is 2 -PASS document.querySelectorAll("details /deep/ *")[0].id is "summary" -PASS document.querySelectorAll("details /deep/ *")[1].id is "p" -PASS document.querySelectorAll("details::shadow *").length is 0 -PASS document.querySelectorAll("summary /deep/ *").length is 0 -PASS document.querySelectorAll("summary::shadow *").length is 0 -PASS document.querySelectorAll("meter /deep/ *").length is 0 -PASS document.querySelectorAll("meter::shadow *").length is 0 -PASS document.querySelectorAll("progress /deep/ *").length is 0 -PASS document.querySelectorAll("progress::shadow *").length is 0 -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/querySelector-for-useragent-shadowroot.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/querySelector-for-useragent-shadowroot.html deleted file mode 100644 index 97c1160..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/querySelector-for-useragent-shadowroot.html +++ /dev/null
@@ -1,36 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script src="resources/shadow-dom.js"></script> -<script src="../../../resources/js-test.js"></script> -</head> -<body> - <form id="form"><input id="input" type="text" name="text"></form> - <details id="details"> - <summary id="summary"></summary> - <p id="p"></p> - </details> - <meter value="2" min="0" max="10" id="meter"></meter> - <progress value="22" max="100" id="progress"></progress> - <pre id="console"></pre> -</body> -<script> -description('crbug.com/337616: test for querySelectorAll with ::shadow and /deep/'); - -shouldBe('document.querySelectorAll("form /deep/ *").length', '1'); -shouldBe('document.querySelectorAll("form /deep/ *")[0].id', '"input"'); -shouldBe('document.querySelectorAll("form::shadow *").length', '0'); -shouldBe('document.querySelectorAll("input /deep/ *").length', '0'); -shouldBe('document.querySelectorAll("input::shadow *").length', '0'); -shouldBe('document.querySelectorAll("details /deep/ *").length', '2'); -shouldBe('document.querySelectorAll("details /deep/ *")[0].id', '"summary"'); -shouldBe('document.querySelectorAll("details /deep/ *")[1].id', '"p"'); -shouldBe('document.querySelectorAll("details::shadow *").length', '0'); -shouldBe('document.querySelectorAll("summary /deep/ *").length', '0'); -shouldBe('document.querySelectorAll("summary::shadow *").length', '0'); -shouldBe('document.querySelectorAll("meter /deep/ *").length', '0'); -shouldBe('document.querySelectorAll("meter::shadow *").length', '0'); -shouldBe('document.querySelectorAll("progress /deep/ *").length', '0'); -shouldBe('document.querySelectorAll("progress::shadow *").length', '0'); -</script> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/querySelector-with-detached-node-distribution-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/querySelector-with-detached-node-distribution-expected.txt deleted file mode 100644 index 66b5e92..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/querySelector-with-detached-node-distribution-expected.txt +++ /dev/null
@@ -1,11 +0,0 @@ -CONSOLE WARNING: line 87: Element.createShadowRoot is deprecated and will be removed in M80, around February 2020. Please use Element.attachShadow instead. See https://www.chromestatus.com/features/4507242028072960 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -crbug.com/337618: querySelector needs ensure distribution. - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - -PASS barShadowRoot.querySelectorAll(":host-context(.foo)::shadow div")[0].id is "bar" -PASS barShadowRoot.querySelectorAll(":host-context(.foo)::shadow div")[0] is undefined -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/querySelector-with-detached-node-distribution.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/querySelector-with-detached-node-distribution.html deleted file mode 100644 index 0aa7e9c..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/querySelector-with-detached-node-distribution.html +++ /dev/null
@@ -1,25 +0,0 @@ -<!DOCTYPE html> -<head> -<script src="resources/shadow-dom.js"></script> -<script src="../../../resources/js-test.js"></script> -</head> -<body></body> -<script> -description('crbug.com/337618: querySelector needs ensure distribution.'); - -var host = createDOM('div', {'id': 'host'}, - createShadowRoot( - createDOM('div', {'class': 'foo'}, - createDOM('content', {'id': 'content', 'select': '*'}))), - createDOM('div', {'id': 'child'}, - createShadowRoot( - createDOM('div', {'id': 'bar'}, - document.createTextNode("bar"))))); - -var barShadowRoot = host.querySelector('#child').shadowRoot; -shouldBe('barShadowRoot.querySelectorAll(":host-context(.foo)::shadow div")[0].id', '"bar"'); - -var content = host.shadowRoot.querySelector('#content'); -content.setAttribute('select', '.foobar'); -shouldBe('barShadowRoot.querySelectorAll(":host-context(.foo)::shadow div")[0]', "undefined"); -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/querySelector-with-distribution-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/querySelector-with-distribution-expected.txt deleted file mode 100644 index 66b5e92..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/querySelector-with-distribution-expected.txt +++ /dev/null
@@ -1,11 +0,0 @@ -CONSOLE WARNING: line 87: Element.createShadowRoot is deprecated and will be removed in M80, around February 2020. Please use Element.attachShadow instead. See https://www.chromestatus.com/features/4507242028072960 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -crbug.com/337618: querySelector needs ensure distribution. - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - -PASS barShadowRoot.querySelectorAll(":host-context(.foo)::shadow div")[0].id is "bar" -PASS barShadowRoot.querySelectorAll(":host-context(.foo)::shadow div")[0] is undefined -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/querySelector-with-distribution.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/querySelector-with-distribution.html deleted file mode 100644 index abd5dcd..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/querySelector-with-distribution.html +++ /dev/null
@@ -1,26 +0,0 @@ -<!DOCTYPE html> -<head> -<script src="resources/shadow-dom.js"></script> -<script src="../../../resources/js-test.js"></script> -</head> -<body></body> -<script> -description('crbug.com/337618: querySelector needs ensure distribution.'); - -document.body.appendChild( - createDOM('div', {'id': 'host'}, - createShadowRoot( - createDOM('div', {'class': 'foo'}, - createDOM('content', {'id': 'content', 'select': '*'}))), - createDOM('div', {'id': 'child'}, - createShadowRoot( - createDOM('div', {'id': 'bar'}, - document.createTextNode("bar")))))); - -var barShadowRoot = getNodeInComposedTree('child/'); -shouldBe('barShadowRoot.querySelectorAll(":host-context(.foo)::shadow div")[0].id', '"bar"'); - -var content = getNodeInComposedTree('host/content'); -content.setAttribute('select', '.foobar'); -shouldBe('barShadowRoot.querySelectorAll(":host-context(.foo)::shadow div")[0]', "undefined"); -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/querySelector-with-shadow-all-and-shadow-deep-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/querySelector-with-shadow-all-and-shadow-deep-expected.txt deleted file mode 100644 index d1aaba3..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/querySelector-with-shadow-all-and-shadow-deep-expected.txt +++ /dev/null
@@ -1,59 +0,0 @@ -CONSOLE WARNING: line 87: Element.createShadowRoot is deprecated and will be removed in M80, around February 2020. Please use Element.attachShadow instead. See https://www.chromestatus.com/features/4507242028072960 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -crbug.com/337616: test for querySelectorAll with ::shadow and /deep/ - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - -PASS document.querySelectorAll("#foo-host::shadow span").length is 3 -PASS document.querySelectorAll("#foo-host::shadow span")[0].id is "not-top" -PASS document.querySelectorAll("#foo-host::shadow span")[1].id is "top" -PASS document.querySelectorAll("#foo-host::shadow span")[2].id is "inner-host" -PASS document.querySelectorAll("#foo-host /deep/ span").length is 5 -PASS document.querySelectorAll("#foo-host /deep/ span")[0].id is "not-top" -PASS document.querySelectorAll("#foo-host /deep/ span")[1].id is "top" -PASS document.querySelectorAll("#foo-host /deep/ span")[2].id is "nested" -PASS document.querySelectorAll("#foo-host /deep/ span")[3].id is "inner-host" -PASS document.querySelectorAll("#foo-host /deep/ span")[4].id is "outer-host" -PASS document.querySelector("::before, #foo-host /deep/ span").id is "not-top" -PASS fooShadowRoot.querySelectorAll("*::shadow span").length is 1 -PASS fooShadowRoot.querySelectorAll("*::shadow span")[0].id is "nested" -PASS fooShadowRoot.querySelectorAll("* /deep/ span").length is 3 -PASS fooShadowRoot.querySelectorAll("* /deep/ span")[0].id is "not-top" -PASS fooShadowRoot.querySelectorAll("* /deep/ span")[1].id is "nested" -PASS fooShadowRoot.querySelectorAll("* /deep/ span")[2].id is "inner-host" -PASS fooShadowRoot.querySelectorAll("#foo-host /deep/ span").length is 0 -PASS fooShadowRoot.querySelectorAll(":host(div#foo-host)::shadow span").length is 3 -PASS fooShadowRoot.querySelectorAll(":host(div#foo-host)::shadow span")[0].id is "not-top" -PASS fooShadowRoot.querySelectorAll(":host(div#foo-host)::shadow span")[1].id is "top" -PASS fooShadowRoot.querySelectorAll(":host(div#foo-host)::shadow span")[2].id is "inner-host" -PASS fooShadowRoot.querySelectorAll(":host-context(body)::shadow span").length is 3 -PASS fooShadowRoot.querySelectorAll(":host-context(body)::shadow span")[0].id is "not-top" -PASS fooShadowRoot.querySelectorAll(":host-context(body)::shadow span")[1].id is "top" -PASS fooShadowRoot.querySelectorAll(":host-context(body)::shadow span")[2].id is "inner-host" -PASS barHost.querySelectorAll("#bar-host::shadow span").length is 1 -PASS barHost.querySelectorAll("#bar-host::shadow span")[0].id is "nested" -PASS barHost.querySelectorAll(":host :scope span").length is 1 -PASS barHost.querySelectorAll(":host :scope span")[0].id is "inner-host" -PASS barHost.querySelectorAll(":host /deep/ #bar-host span").length is 1 -PASS barHost.querySelectorAll(":host /deep/ #bar-host span")[0].id is "inner-host" -PASS barShadowRoot.querySelectorAll("*::shadow span").length is 0 -PASS barShadowRoot.querySelectorAll("* /deep/ span").length is 0 -PASS barShadowRoot.querySelectorAll(":host(div#bar-host)::shadow span").length is 1 -PASS barShadowRoot.querySelectorAll(":host(div#bar-host)::shadow span")[0].id is "nested" -PASS barShadowRoot.querySelectorAll(":host(div#bar-host) /deep/ span").length is 1 -PASS barShadowRoot.querySelectorAll(":host(div#bar-host) /deep/ span")[0].id is "nested" -PASS barShadowRoot.querySelectorAll(":host-context(div#foo-host)::shadow span").length is 1 -PASS barShadowRoot.querySelectorAll(":host-context(div#foo-host)::shadow span")[0].id is "nested" -PASS barShadowRoot.querySelectorAll(":host-context(div#foo-host) /deep/ span").length is 1 -PASS barShadowRoot.querySelectorAll(":host-context(div#foo-host) /deep/ span")[0].id is "nested" -PASS fooHost.querySelectorAll("::shadow span").length is 3 -PASS fooHost.querySelectorAll("::shadow span")[0].id is "not-top" -PASS fooHost.querySelectorAll("::shadow span")[1].id is "top" -PASS fooHost.querySelectorAll("::shadow span")[2].id is "inner-host" -PASS document.querySelectorAll("::shadow span").length is 3 -PASS document.querySelectorAll("::shadow span")[0].id is "not-top" -PASS document.querySelectorAll("::shadow span")[1].id is "top" -PASS document.querySelectorAll("::shadow span")[2].id is "inner-host" -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/querySelector-with-shadow-all-and-shadow-deep.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/querySelector-with-shadow-all-and-shadow-deep.html deleted file mode 100644 index 5f73227..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/querySelector-with-shadow-all-and-shadow-deep.html +++ /dev/null
@@ -1,93 +0,0 @@ -<!DOCTYPE html> -<script src="resources/shadow-dom.js"></script> -<script src="../../../resources/js-test.js"></script> -<body></body> -<script> -document.body.appendChild( - createDOM('div', {'id': 'foo-host'}, - createShadowRoot( - createDOM('div', {}, - createDOM('span', {'id': 'not-top'})), - createDOM('span', {'id': 'top'}), - createDOM('div', {'id': 'bar-host'}, - createShadowRoot( - createDOM('span', {'id': 'nested'})), - createDOM('span', {'id': 'inner-host'}))), - createDOM('span', {'id': 'outer-host'}))); - -description('crbug.com/337616: test for querySelectorAll with ::shadow and /deep/'); - -shouldBe('document.querySelectorAll("#foo-host::shadow span").length', '3'); -shouldBe('document.querySelectorAll("#foo-host::shadow span")[0].id', '"not-top"'); -shouldBe('document.querySelectorAll("#foo-host::shadow span")[1].id', '"top"'); -shouldBe('document.querySelectorAll("#foo-host::shadow span")[2].id', '"inner-host"'); - -shouldBe('document.querySelectorAll("#foo-host /deep/ span").length', '5'); -shouldBe('document.querySelectorAll("#foo-host /deep/ span")[0].id', '"not-top"'); -shouldBe('document.querySelectorAll("#foo-host /deep/ span")[1].id', '"top"'); -shouldBe('document.querySelectorAll("#foo-host /deep/ span")[2].id', '"nested"'); -shouldBe('document.querySelectorAll("#foo-host /deep/ span")[3].id', '"inner-host"'); -shouldBe('document.querySelectorAll("#foo-host /deep/ span")[4].id', '"outer-host"'); - -shouldBe('document.querySelector("::before, #foo-host /deep/ span").id', '"not-top"'); - -// FIXME: after making "*" in shadow tree not to match shadow host, rebaseline. -var fooShadowRoot = getNodeInComposedTree('foo-host/'); -shouldBe('fooShadowRoot.querySelectorAll("*::shadow span").length', '1'); -shouldBe('fooShadowRoot.querySelectorAll("*::shadow span")[0].id', '"nested"'); - -shouldBe('fooShadowRoot.querySelectorAll("* /deep/ span").length', '3'); -shouldBe('fooShadowRoot.querySelectorAll("* /deep/ span")[0].id', '"not-top"'); -shouldBe('fooShadowRoot.querySelectorAll("* /deep/ span")[1].id', '"nested"'); -shouldBe('fooShadowRoot.querySelectorAll("* /deep/ span")[2].id', '"inner-host"'); - -// #foo-host in foo's shadow tree cannot match div#foo-host. -shouldBe('fooShadowRoot.querySelectorAll("#foo-host /deep/ span").length', '0'); - -// :host in foo's shadow tree can match div#foo-host. -shouldBe('fooShadowRoot.querySelectorAll(":host(div#foo-host)::shadow span").length', '3'); -shouldBe('fooShadowRoot.querySelectorAll(":host(div#foo-host)::shadow span")[0].id', '"not-top"'); -shouldBe('fooShadowRoot.querySelectorAll(":host(div#foo-host)::shadow span")[1].id', '"top"'); -shouldBe('fooShadowRoot.querySelectorAll(":host(div#foo-host)::shadow span")[2].id', '"inner-host"'); - -// :host-context in foo's shadow tree can match div#foo-host. -shouldBe('fooShadowRoot.querySelectorAll(":host-context(body)::shadow span").length', '3'); -shouldBe('fooShadowRoot.querySelectorAll(":host-context(body)::shadow span")[0].id', '"not-top"'); -shouldBe('fooShadowRoot.querySelectorAll(":host-context(body)::shadow span")[1].id', '"top"'); -shouldBe('fooShadowRoot.querySelectorAll(":host-context(body)::shadow span")[2].id', '"inner-host"'); - -var barHost = fooShadowRoot.getElementById('bar-host'); -shouldBe('barHost.querySelectorAll("#bar-host::shadow span").length', '1'); -shouldBe('barHost.querySelectorAll("#bar-host::shadow span")[0].id', '"nested"'); -shouldBe('barHost.querySelectorAll(":host :scope span").length', '1'); -shouldBe('barHost.querySelectorAll(":host :scope span")[0].id', '"inner-host"'); -shouldBe('barHost.querySelectorAll(":host /deep/ #bar-host span").length', '1'); -shouldBe('barHost.querySelectorAll(":host /deep/ #bar-host span")[0].id', '"inner-host"'); - -var barShadowRoot = getNodeInComposedTree('foo-host/bar-host/'); -shouldBe('barShadowRoot.querySelectorAll("*::shadow span").length', '0'); -shouldBe('barShadowRoot.querySelectorAll("* /deep/ span").length', '0'); - -shouldBe('barShadowRoot.querySelectorAll(":host(div#bar-host)::shadow span").length', '1'); -shouldBe('barShadowRoot.querySelectorAll(":host(div#bar-host)::shadow span")[0].id', '"nested"'); -shouldBe('barShadowRoot.querySelectorAll(":host(div#bar-host) /deep/ span").length', '1'); -shouldBe('barShadowRoot.querySelectorAll(":host(div#bar-host) /deep/ span")[0].id', '"nested"'); - -shouldBe('barShadowRoot.querySelectorAll(":host-context(div#foo-host)::shadow span").length', '1'); -shouldBe('barShadowRoot.querySelectorAll(":host-context(div#foo-host)::shadow span")[0].id', '"nested"'); -shouldBe('barShadowRoot.querySelectorAll(":host-context(div#foo-host) /deep/ span").length', '1'); -shouldBe('barShadowRoot.querySelectorAll(":host-context(div#foo-host) /deep/ span")[0].id', '"nested"'); - -// crbug.com/390301 -var fooHost = document.getElementById("foo-host"); -shouldBe('fooHost.querySelectorAll("::shadow span").length', '3'); -shouldBe('fooHost.querySelectorAll("::shadow span")[0].id', '"not-top"'); -shouldBe('fooHost.querySelectorAll("::shadow span")[1].id', '"top"'); -shouldBe('fooHost.querySelectorAll("::shadow span")[2].id', '"inner-host"'); - -// crbug.com/511486 -shouldBe('document.querySelectorAll("::shadow span").length', '3'); -shouldBe('document.querySelectorAll("::shadow span")[0].id', '"not-top"'); -shouldBe('document.querySelectorAll("::shadow span")[1].id', '"top"'); -shouldBe('document.querySelectorAll("::shadow span")[2].id', '"inner-host"'); -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/reattach-content-ancestor-expected.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/reattach-content-ancestor-expected.html deleted file mode 100644 index b4cc7a72..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/reattach-content-ancestor-expected.html +++ /dev/null
@@ -1,3 +0,0 @@ -<!DOCTYPE html> - -<div>Should be visible.</div>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/reattach-content-ancestor-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/reattach-content-ancestor-expected.txt deleted file mode 100644 index 0e08839..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/reattach-content-ancestor-expected.txt +++ /dev/null
@@ -1 +0,0 @@ -CONSOLE WARNING: line 7: Element.createShadowRoot is deprecated and will be removed in M80, around February 2020. Please use Element.attachShadow instead. See https://www.chromestatus.com/features/4507242028072960 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details.
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/reattach-content-ancestor.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/reattach-content-ancestor.html deleted file mode 100644 index 066f3b1..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/reattach-content-ancestor.html +++ /dev/null
@@ -1,11 +0,0 @@ -<!DOCTYPE html> - -<div id="host">Should be visible.</div> - -<script> - var host = document.getElementById('host'); - var root = host.createShadowRoot(); - root.innerHTML = "<div style='display: none'><content></content></div>"; - document.body.offsetTop; - root.firstElementChild.style.display = 'block'; -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/reprojection-attribute-modified-expected.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/reprojection-attribute-modified-expected.html deleted file mode 100644 index 2e5a4219..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/reprojection-attribute-modified-expected.html +++ /dev/null
@@ -1,10 +0,0 @@ -<!DOCTYPE html> - -<html> -<body> - -<div id="host"><div> - <div>F</div> -</div></div> - -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/reprojection-attribute-modified-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/reprojection-attribute-modified-expected.txt deleted file mode 100644 index a4822ac..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/reprojection-attribute-modified-expected.txt +++ /dev/null
@@ -1 +0,0 @@ -CONSOLE WARNING: line 20: Element.createShadowRoot is deprecated and will be removed in M80, around February 2020. Please use Element.attachShadow instead. See https://www.chromestatus.com/features/4507242028072960 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details.
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/reprojection-attribute-modified.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/reprojection-attribute-modified.html deleted file mode 100644 index e4b1c9e..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/reprojection-attribute-modified.html +++ /dev/null
@@ -1,33 +0,0 @@ -<!DOCTYPE html> - -<html> -<body> - - -<div id="host1"> - <div>A</div> - <div>B</div> - <div>C</div> - <div>D</div> - <div>E</div> - <div id="F">F</div> -</div> - -<script> -if (window.testRunner) - testRunner.waitUntilDone(); - -var shadowRoot1 = host1.createShadowRoot(); -shadowRoot1.innerHTML = '<div id="host2"><shadow></shadow></div>'; - -var host2 = shadowRoot1.getElementById('host2'); -var shadowRoot2 = host2.createShadowRoot(); -shadowRoot2.innerHTML = '<content select="div[title=selected]"></content>'; - -setTimeout(function() { - F.title = 'selected'; - if (window.testRunner) - testRunner.notifyDone(); -}, 0); -</script> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/reprojection-className-modified-expected.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/reprojection-className-modified-expected.html deleted file mode 100644 index 0ee8a60..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/reprojection-className-modified-expected.html +++ /dev/null
@@ -1,12 +0,0 @@ -<!DOCTYPE html> - -<html> -<body> - -<div id="host"><div> - <div>A</div> - <div>D</div> - <div>F</div> -</div></div> - -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/reprojection-className-modified-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/reprojection-className-modified-expected.txt deleted file mode 100644 index a4822ac..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/reprojection-className-modified-expected.txt +++ /dev/null
@@ -1 +0,0 @@ -CONSOLE WARNING: line 20: Element.createShadowRoot is deprecated and will be removed in M80, around February 2020. Please use Element.attachShadow instead. See https://www.chromestatus.com/features/4507242028072960 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details.
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/reprojection-className-modified.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/reprojection-className-modified.html deleted file mode 100644 index 8b0c6c43..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/reprojection-className-modified.html +++ /dev/null
@@ -1,33 +0,0 @@ -<!DOCTYPE html> - -<html> -<body> - - -<div id="host1"> - <div class="selected">A</div> - <div>B</div> - <div>C</div> - <div class="selected">D</div> - <div>E</div> - <div id="F">F</div> -</div> - -<script> -if (window.testRunner) - testRunner.waitUntilDone(); - -var shadowRoot1 = host1.createShadowRoot(); -shadowRoot1.innerHTML = '<div id="host2"><shadow></shadow></div>'; - -var host2 = shadowRoot1.getElementById('host2'); -var shadowRoot2 = host2.createShadowRoot(); -shadowRoot2.innerHTML = '<content select=".selected"></content>'; - -setTimeout(function() { - F.className = 'selected'; - if (window.testRunner) - testRunner.notifyDone(); -}, 0); -</script> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/reprojection-id-modified-expected.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/reprojection-id-modified-expected.html deleted file mode 100644 index 2e5a4219..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/reprojection-id-modified-expected.html +++ /dev/null
@@ -1,10 +0,0 @@ -<!DOCTYPE html> - -<html> -<body> - -<div id="host"><div> - <div>F</div> -</div></div> - -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/reprojection-id-modified-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/reprojection-id-modified-expected.txt deleted file mode 100644 index a4822ac..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/reprojection-id-modified-expected.txt +++ /dev/null
@@ -1 +0,0 @@ -CONSOLE WARNING: line 20: Element.createShadowRoot is deprecated and will be removed in M80, around February 2020. Please use Element.attachShadow instead. See https://www.chromestatus.com/features/4507242028072960 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details.
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/reprojection-id-modified.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/reprojection-id-modified.html deleted file mode 100644 index 0aed8fc..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/reprojection-id-modified.html +++ /dev/null
@@ -1,35 +0,0 @@ -<!DOCTYPE html> - -<html> -<body> - - -<div id="host1"> - <div id="selected">A</div> - <div>B</div> - <div>C</div> - <div>D</div> - <div>E</div> - <div id="F">F</div> -</div> - -<script> -if (window.testRunner) - testRunner.waitUntilDone(); - -var shadowRoot1 = host1.createShadowRoot(); -shadowRoot1.innerHTML = '<div id="host2"><shadow></shadow></div>'; - -var host2 = shadowRoot1.getElementById('host2'); -var shadowRoot2 = host2.createShadowRoot(); -shadowRoot2.innerHTML = '<content select="#selected"></content>'; - -setTimeout(function() { - A = selected; - A.id = ''; - F.id = 'selected'; - if (window.testRunner) - testRunner.notifyDone(); -}, 0); -</script> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/resources/event-dispatching.js b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/resources/event-dispatching.js deleted file mode 100644 index 24e5141..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/resources/event-dispatching.js +++ /dev/null
@@ -1,178 +0,0 @@ -var defaultPaddingSize = 40; - -function moveMouseOver(element) -{ - if (!window.eventSender || !window.internals) - return; - - var rect = element.getBoundingClientRect(); - var x = rect.left + rect.width / 2; - var y; - if (element.hasChildNodes() || internals.shadowRoot(element)) - y = rect.top + defaultPaddingSize / 2; - else - y = rect.top + rect.height / 2; - eventSender.mouseMoveTo(x, y); -} - -function touchLocation(node) -{ - var rect = node.getBoundingClientRect(); - var x = rect.left + 5; - var y = rect.top + defaultPaddingSize + 5; - eventSender.addTouchPoint(x, y); - eventSender.touchStart(); - eventSender.leapForward(100); - eventSender.touchEnd(); - eventSender.cancelTouchPoint(0); -} - -function selectTextNode(node) -{ - getSelection().setBaseAndExtent(node, 0, node, node.length); -} - -function dragMouse(node) -{ - var rect = node.getBoundingClientRect(); - var x = rect.left + 5; - var y = rect.top + defaultPaddingSize + 5; - - eventSender.mouseMoveTo(x, y); - eventSender.mouseDown(); - eventSender.leapForward(100); - eventSender.mouseMoveTo(x + 100, y + 100); - eventSender.mouseUp(); - eventSender.mouseMoveTo(x, y); -} - -var eventRecords = {}; - -function clearEventRecords() -{ - eventRecords = {}; -} - -function dispatchedEvent(eventType) -{ - var events = eventRecords[eventType]; - if (!events) - return []; - return events; -} - -function recordEvent(event) -{ - var eventType = event.type; - if (!eventRecords[eventType]) { - eventRecords[eventType] = []; - } - var eventString = ''; - if (event.currentTarget) - eventString += ' @' + (event.currentTarget.id || event.currentTarget); - if (event.target) - eventString += ' (target: ' + event.target.id + ')'; - if (event.relatedTarget) - eventString += ' (related: ' + event.relatedTarget.id + ')'; - if (event.touches) - eventString += ' (touches: ' + dumpTouchList(event.touches) + ')'; - if (event.targetTouches) - eventString += ' (targetTouches: ' + dumpTouchList(event.targetTouches) + ')'; - if (event.changedTouches) - eventString += ' (changedTouches: ' + dumpTouchList(event.changedTouches) + ')'; - if (event.eventPhase == 1) - eventString += '(capturing phase)'; - if (event.target && event.currentTarget && event.target.id == event.currentTarget.id) - shouldBe("event.eventPhase", "2", true); - eventRecords[eventType].push(eventString); -} - -function dumpNode(node) -{ - var output = node.nodeName + "\t"; - if (node.id) - output += ' id=' + node.id; - if (node.className) - output += ' class=' + node.className; - return output; -} - -function dumpTouchList(touches) { - var ids = []; - for (var i = 0; i < touches.length; ++i) { - if (touches.item(i).target && touches.item(i).target.id) - ids.push(touches.item(i).target.id); - } - ids.sort(); - var result = ''; - for (i = 0; i < ids.length; ++i) { - result += ids[i]; - if (i != ids.length - 1) - result += ', '; - } - return result; -} - -function addEventListeners(nodes) -{ - for (var i = 0; i < nodes.length; ++i) { - addEventListenersToNode(getNodeInComposedTree(nodes[i])); - } -} - -function addEventListenersToNode(node) -{ - node.addEventListener('click', recordEvent, false); - node.addEventListener('dragstart', recordEvent, false); - node.addEventListener('mouseout', recordEvent, false); - node.addEventListener('mouseover', recordEvent, false); - node.addEventListener('mousewheel', recordEvent, false); - node.addEventListener('touchstart', recordEvent, false); - node.addEventListener('gesturetap', recordEvent, false); - // <content> might be an inactive insertion point, so style it also. - if (node.tagName == 'DIV' || node.tagName == 'DETAILS' || node.tagName == 'SUMMARY' || node.tagName == 'CONTENT') - node.setAttribute('style', 'padding-top: ' + defaultPaddingSize + 'px;'); -} - -function debugDispatchedEvent(eventType) -{ - debug('\n ' + eventType); - var events = dispatchedEvent(eventType); - for (var i = 0; i < events.length; ++i) - debug(' ' + events[i]) -} - -function sortDispatchedEvent(eventType) -{ - dispatchedEvent(eventType).sort(); -} - -function moveMouse(oldElementId, newElementId) -{ - clearEventRecords(); - debug('\n' + 'Moving mouse from ' + oldElementId + ' to ' + newElementId); - moveMouseOver(getNodeInComposedTree(oldElementId)); - - clearEventRecords(); - moveMouseOver(getNodeInComposedTree(newElementId)); - - debugDispatchedEvent('mouseout'); - debugDispatchedEvent('mouseover'); -} - -function clickElement(elementId) -{ - clearEventRecords(); - debug('\n' + 'Click ' + elementId); - var clickEvent = document.createEvent("MouseEvents"); - clickEvent.initMouseEvent('click', true, false, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null); - getNodeInComposedTree(elementId).dispatchEvent(clickEvent); - debugDispatchedEvent('click'); -} - -function showSandboxTree() -{ - var sandbox = document.getElementById('sandbox'); - sandbox.clientLeft; - debug('\n\nFlat Tree will be:\n' + dumpFlatTree(sandbox)); -}
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/resources/shadow-dom.js b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/resources/shadow-dom.js deleted file mode 100644 index 6dd3e38..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/resources/shadow-dom.js +++ /dev/null
@@ -1,353 +0,0 @@ -// TODO(yuzus): These two functions below need cleaning up. They are currently -// from js-test.js. -function getOrCreateTestElement(id, tagName) -{ - var element = document.getElementById(id); - if (element) - return element; - - element = document.createElement(tagName); - element.id = id; - var refNode; - var parent = document.body || document.documentElement; - if (id == "description") - refNode = getOrCreateTestElement("console", "div"); - else - refNode = parent.firstChild; - - parent.insertBefore(element, refNode); - return element; -} - -function debug(msg) -{ - if (self._lazyTestResults) { - self._lazyTestResults.push(msg); - } else { - var span = document.createElement("span"); - // insert it first so XHTML knows the namespace; - getOrCreateTestElement("console", "div").appendChild(span); - span.innerHTML = msg + '<br />'; - }; -} - - -function createShadowRoot() -{ - var children = Array.prototype.slice.call(arguments); - if ((children[0] instanceof Object) && !(children[0] instanceof Node)) - return attachShadow.apply(null, children); - return {'isShadowRoot': true, - 'children': children}; -} - -// TODO(kochi): This is not pure attachShadow wrapper, but also handles createShadowRoot() -// with attributes. -function attachShadow() -{ - var children = Array.prototype.slice.call(arguments); - var attributes = {}; - var parameter = {}; - for (var key in children[0]) { - if (key == 'mode' || key == 'delegatesFocus') - parameter[key] = children[0][key]; - else - attributes[key] = children[0][key]; - } - return {'isShadowRoot': true, - 'parameter': parameter, - 'attributes': attributes, - 'children': children.slice(1)}; -} - -function createUserAgentShadowRoot() -{ - var shadowRoot = createShadowRoot.apply(null, arguments); - shadowRoot.isUserAgentShadowRoot = true; - return shadowRoot; -} - -// This function can take optional child elements, which might be a result of createShadowRoot(), as arguments[2:]. -function createDOM(tagName, attributes) -{ - var element = document.createElement(tagName); - for (var name in attributes) - element.setAttribute(name, attributes[name]); - var childElements = Array.prototype.slice.call(arguments, 2); - for (var i = 0; i < childElements.length; ++i) { - var child = childElements[i]; - if (child.isShadowRoot) { - var shadowRoot; - if (child.isUserAgentShadowRoot) { - shadowRoot = internals.createUserAgentShadowRoot(element); - } else { - if (child.parameter && Object.keys(child.parameter).length > 0) - shadowRoot = element.attachShadow(child.parameter); - else - shadowRoot = element.createShadowRoot(); - } - if (child.attributes) { - for (var attribute in child.attributes) { - // Shadow Root does not have setAttribute. - shadowRoot[attribute] = child.attributes[attribute]; - } - } - for (var j = 0; j < child.children.length; ++j) - shadowRoot.appendChild(child.children[j]); - } else - element.appendChild(child); - } - return element; -} - -function isShadowHost(node) -{ - return internals.shadowRoot(node); -} - -function isShadowRoot(node) -{ - return node instanceof window.ShadowRoot; -} - -function isIframeElement(element) -{ - return element && element.nodeName == 'IFRAME'; -} - -function getNodeInComposedTree(path) -{ - var ids = path.split('/'); - var node = document.getElementById(ids[0]); - for (var i = 1; node != null && i < ids.length; ++i) { - if (isIframeElement(node)) { - node = node.contentDocument.getElementById(ids[i]); - continue; - } - if (internals.shadowRoot(node)) - node = internals.shadowRoot(node); - else - return null; - if (ids[i] != '') - node = node.getElementById(ids[i]); - } - return node; -} - -function dumpNode(node) -{ - if (!node) - return 'null'; - if (node.id) - return '#' + node.id; - return '' + node; -} - -function dumpNodeList(nodeList) { - var result = ""; - var length = nodeList.length; - for (var i = 0; i < length; i++) - result += dumpNode(nodeList[i]) + ", "; - result += "length: " + length; - return result; -} - -function shouldBeEqualAsArray(nodeList, expectedNodes) -{ - // FIXME: Avoid polluting the global namespace. - window.nodeList = nodeList; - window.expectedNodes = expectedNodes; - shouldBe("nodeList.length", "expectedNodes.length"); - for (var i = 0; i < nodeList.length; ++i) { - shouldBe("nodeList.item(" + i + ")", "expectedNodes[" + i + "]"); - } -} - -function innermostActiveElement(element) -{ - element = element || document.activeElement; - if (isIframeElement(element)) { - if (element.contentDocument.activeElement) - return innermostActiveElement(element.contentDocument.activeElement); - return element; - } - if (isShadowHost(element)) { - var shadowRoot = internals.shadowRoot(element); - if (shadowRoot) { - if (shadowRoot.activeElement) - return innermostActiveElement(shadowRoot.activeElement); - } - } - return element; -} - -function isInnermostActiveElement(id) -{ - var element = getNodeInComposedTree(id); - if (!element) { - debug('FAIL: There is no such element with id: '+ id); - return false; - } - if (element == innermostActiveElement()) - return true; - debug('Expected innermost activeElement is ' + id + ', but actual innermost activeElement is ' + dumpNode(innermostActiveElement())); - return false; -} - -function shouldNavigateFocus(from, to, direction) -{ - debug('Should move from ' + from + ' to ' + to + ' in ' + direction); - var fromElement = getNodeInComposedTree(from); - if (!fromElement) { - debug('FAIL: There is no such element with id: '+ from); - return; - } - fromElement.focus(); - if (!isInnermostActiveElement(from)) { - debug('FAIL: Can not be focused: '+ from); - return; - } - if (direction == 'forward') - navigateFocusForward(); - else - navigateFocusBackward(); - if (isInnermostActiveElement(to)) - debug('PASS'); - else - debug('FAIL'); - return isInnermostActiveElement(to); -} - -function navigateFocusForward() -{ - eventSender.keyDown('\t'); -} - -function navigateFocusBackward() -{ - eventSender.keyDown('\t', ['shiftKey']); -} - -function testFocusNavigationForward(elements) -{ - for (var i = 0; i + 1 < elements.length; ++i) - shouldNavigateFocus(elements[i], elements[i + 1], 'forward'); -} - -function testFocusNavigationBackward(elements) -{ - for (var i = 0; i + 1 < elements.length; ++i) - shouldNavigateFocus(elements[i], elements[i + 1], 'backward'); -} - -function dumpFlatTree(node, indent) -{ - indent = indent || ""; - var output = indent + dumpNode(node) + "\n"; - var child; - for (child = internals.firstChildInFlatTree(node); child; child = internals.nextSiblingInFlatTree(child)) - output += dumpFlatTree(child, indent + "\t"); - return output; -} - -function lastNodeInFlatTree(root) -{ - var lastNode = root; - while (internals.lastChildInFlatTree(lastNode)) - lastNode = internals.lastChildInFlatTree(lastNode); - return lastNode; -} - -function showFlatTreeByTraversingInForward(root) -{ - var node = root; - var last = lastNodeInFlatTree(root); - while (node) { - debug(dumpNode(node)); - if (node == last) - break; - node = internals.nextInFlatTree(node); - } -} - -function showFlatTreeByTraversingInBackward(root) -{ - var node = lastNodeInFlatTree(root); - while (node) { - debug(dumpNode(node)); - if (node == root) - break; - node = internals.previousInFlatTree(node); - } -} - -function showFlatTree(node) -{ - debug('Flat Tree:'); - debug(dumpFlatTree(node)); - - debug('Traverse in forward.'); - showFlatTreeByTraversingInForward(node); - - debug('Traverse in backward.'); - showFlatTreeByTraversingInBackward(node); - - debug(''); -} - -function showNextNode(node) -{ - var next = internals.nextInFlatTree(node); - debug('Next node of [' + dumpNode(node) + '] is [' + dumpNode(next) + ']'); -} - -function backgroundColorOf(selector) -{ - return window.getComputedStyle(getNodeInComposedTree(selector)).backgroundColor; -} - -function backgroundColorShouldBe(selector, expected) -{ - shouldBeEqualToString('backgroundColorOf(\'' + selector + '\')', expected); -} - -function backgroundColorShouldNotBe(selector, color) -{ - var text = 'backgroundColorOf(\'' + selector + '\')'; - var unevaledString = '"' + color.replace(/\\/g, "\\\\").replace(/"/g, "\"") + '"'; - shouldNotBe(text, unevaledString); -} - -function getElementByIdConsideringShadowDOM(root, id) { - function iter(root, id) { - if (!root) - return null; - - if (root.id == id) - return root; - - // We don't collect div having a shadow root, since we cannot point it correctly. - // Such div should have an inner div to be pointed correctly. - for (var child = root.firstChild; child; child = child.nextSibling) { - var node = iter(child, id); - if (node != null) - return node; - } - - if (root.nodeType != 1) - return null; - - var shadowRoot = internals.shadowRoot(root); - if (shadowRoot) { - var node = iter(shadowRoot, id); - if (node != null) - return node; - } - - return null; - }; - - if (!window.internals) - return null; - return iter(root, id); -}
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/resources/svg_placeholder.svg b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/resources/svg_placeholder.svg deleted file mode 100644 index d0516c04..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/resources/svg_placeholder.svg +++ /dev/null
@@ -1 +0,0 @@ -<SVGTestCase id="s"></SVGTestCase>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadow-boundary-events-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadow-boundary-events-expected.txt deleted file mode 100644 index 30747335..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadow-boundary-events-expected.txt +++ /dev/null
@@ -1,85 +0,0 @@ -CONSOLE WARNING: line 87: Element.createShadowRoot is deprecated and will be removed in M80, around February 2020. Please use Element.attachShadow instead. See https://www.chromestatus.com/features/4507242028072960 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -Tests to ensure that shadow DOM boundary is not crossed during event propagation. Can only run within DRT. - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - - -Move mouse from a node to its sibling node. All nodes are outside of shadow boundary. -Moving mouse from divB to divC -PASS dispatchedEvent("mouseover") is ["divC(<-divB)(@divC)", "divC(<-divB)(@divA)"] -PASS dispatchedEvent("mouseout") is ["divB(<-divC)(@divB)", "divB(<-divC)(@divA)"] - -Target is an ancestor of relatedTarget. All nodes are outside of shadow boundary. -Moving mouse from divB to divA -PASS dispatchedEvent("mouseover") is ["divA(<-divB)(@divA)"] -PASS dispatchedEvent("mouseout") is ["divB(<-divA)(@divB)", "divB(<-divA)(@divA)"] - -RelatedTarget is an ancestor of target. All nodes are outside of shadow boundary. -Moving mouse from divA to divB -PASS dispatchedEvent("mouseover") is ["divB(<-divA)(@divB)", "divB(<-divA)(@divA)"] -PASS dispatchedEvent("mouseout") is ["divA(<-divB)(@divA)"] - -Both target and relatedTarget are immediate children of the same shadow root. -Moving mouse from shadowD/shadowF/shadowG/divH to shadowD/shadowF/shadowG/divI -PASS dispatchedEvent("mouseover") is ["divI(<-divH)(@divI)"] -PASS dispatchedEvent("mouseout") is ["divH(<-divI)(@divH)"] - -Target is an ancestor of relatedTarget. -Moving mouse from shadowD/shadowF/shadowG/divI to shadowD/divE -PASS dispatchedEvent("mouseover") is ["divE(<-shadowF)(@divE)"] -PASS dispatchedEvent("mouseout") is ["divI(<-divE)(@divI)", "shadowG(<-divE)(@shadowG)", "shadowF(<-divE)(@shadowF)", "shadowF(<-divE)(@divE)"] - -Target (shadow host) is an ancestor of relatedTarget. -Moving mouse from shadowD/shadowF/shadowG/divI to shadowD/shadowF -PASS dispatchedEvent("mouseover") is [] -PASS dispatchedEvent("mouseout") is ["divI(<-shadowF)(@divI)", "shadowG(<-shadowF)(@shadowG)"] - -Target (shadow host) is an ancestor of relatedTarget (shadow host). -Moving mouse from shadowD/shadowF/shadowG to shadowD -PASS dispatchedEvent("mouseover") is [] -PASS dispatchedEvent("mouseout") is ["shadowG(<-shadowD)(@shadowG)", "shadowF(<-shadowD)(@shadowF)", "shadowF(<-shadowD)(@divE)"] - -RelatedTarget is ancestor of target. -Moving mouse from shadowD/divE to shadowD/shadowF/shadowG/divI -PASS dispatchedEvent("mouseover") is ["divI(<-divE)(@divI)", "shadowG(<-divE)(@shadowG)", "shadowF(<-divE)(@shadowF)", "shadowF(<-divE)(@divE)"] -PASS dispatchedEvent("mouseout") is ["divE(<-shadowF)(@divE)"] - -RelatedTarget (shadow host) is ancestor of target. -Moving mouse from shadowD/shadowF to shadowD/shadowF/shadowG/divI -PASS dispatchedEvent("mouseover") is ["divI(<-shadowF)(@divI)", "shadowG(<-shadowF)(@shadowG)"] -PASS dispatchedEvent("mouseout") is [] - -RelatedTarget (shadow host) is an ancestor of target (shadow host). -Moving mouse from shadowD to shadowD/shadowF/shadowG -PASS dispatchedEvent("mouseover") is ["shadowG(<-shadowD)(@shadowG)", "shadowF(<-shadowD)(@shadowF)", "shadowF(<-shadowD)(@divE)"] -PASS dispatchedEvent("mouseout") is [] - -Target and relatedTarget exist in separated subtree, crossing shadow boundaries. Making sure that event is not dispatched beyond the lowest common boundary. -Moving mouse from shadowD/shadowF/shadowG/divH to shadowD/shadowK/divL -PASS dispatchedEvent("mouseover") is ["divL(<-shadowF)(@divL)", "shadowK(<-shadowF)(@shadowK)", "shadowK(<-shadowF)(@divJ)"] -PASS dispatchedEvent("mouseout") is ["divH(<-shadowK)(@divH)", "shadowG(<-shadowK)(@shadowG)", "shadowF(<-shadowK)(@shadowF)", "shadowF(<-shadowK)(@divE)"] - -Move focus from a node to its sibling node. All nodes are outside of shadow boundary. -Moving focus from divB to divC -PASS dispatchedEvent("focusin") is ["divC(<-divB)(@divC)", "divC(<-divB)(@divA)"] -PASS dispatchedEvent("focusout") is ["divB(<-divC)(@divB)", "divB(<-divC)(@divA)"] - -Old focused node and new focused node exist in separated subtrees, crossing shadow boundaries. Making sure that an event is not dispatched beyond the lowest common boundary. -Moving focus from shadowD/shadowF/shadowG/divH to shadowD/shadowK/divL -PASS dispatchedEvent("focusin") is ["divL(<-shadowF)(@divL)", "shadowK(<-shadowF)(@shadowK)", "shadowK(<-shadowF)(@divJ)"] -PASS dispatchedEvent("focusout") is ["divH(<-shadowK)(@divH)", "shadowG(<-shadowK)(@shadowG)", "shadowF(<-shadowK)(@shadowF)", "shadowF(<-shadowK)(@divE)"] - -Move focus from a node to its sibling node. All nodes are outside of shadow boundary. -Moving focus from divB to divC -PASS dispatchedEvent("focus") is ["divC(<-divB)(@divA)(capturing phase)", "divC(<-divB)(@divC)"] -PASS dispatchedEvent("blur") is ["divB(<-divC)(@divA)(capturing phase)", "divB(<-divC)(@divB)"] - -Old focused node and new focused node exist in separated subtrees, crossing shadow boundaries. Making sure that an event is not dispatched beyond the lowest common boundary. -Moving focus from shadowD/shadowF/shadowG/divH to shadowD/shadowK/divL -PASS dispatchedEvent("focus") is ["shadowK(<-shadowF)(@divJ)(capturing phase)", "shadowK(<-shadowF)(@shadowK)", "divL(<-shadowF)(@divL)"] -PASS dispatchedEvent("blur") is ["shadowF(<-shadowK)(@divE)(capturing phase)", "shadowF(<-shadowK)(@shadowF)", "shadowG(<-shadowK)(@shadowG)", "divH(<-shadowK)(@divH)"] -PASS successfullyParsed is true - -TEST COMPLETE - -
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadow-boundary-events.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadow-boundary-events.html deleted file mode 100644 index 004ce4b..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadow-boundary-events.html +++ /dev/null
@@ -1,207 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script src="../../../resources/js-test.js"></script> -<script src="resources/shadow-dom.js"></script> -</head> -<body> -<p id="description"></p> -<div id="sandbox"></div> -<pre id="console"></pre> -<script> -description("Tests to ensure that shadow DOM boundary is not crossed during event propagation. Can only run within DRT."); - -function moveMouseOver(element) -{ - if (!window.eventSender || !window.internals) - return; - - var defaultPaddingSize = 20; - var x = element.offsetLeft + element.offsetWidth / 2; - var y; - if (element.hasChildNodes() || internals.shadowRoot(element)) - y = element.offsetTop + defaultPaddingSize; - else - y = element.offsetTop + element.offsetHeight / 2; - eventSender.mouseMoveTo(x, y); -} - -var eventRecords = {}; - -function clearEventRecords() -{ - eventRecords = {}; -} - -function dispatchedEvent(eventType) -{ - var events = eventRecords[eventType]; - if (!events) - return []; - return events; -} - -function recordEvent(event) -{ - var eventType = event.type - if (!eventRecords[eventType]) { - eventRecords[eventType] = [] - } - // Records each event in the following format per event type: - // eventRecords[eventType] = ['target.id(<-relatedTarget.id)(@currentTarget.id)',,,] - // * RelatedTarget and currentTarget may be omitted if they are not defined. - // A new event is pushed back to the array of its event type. - var eventString = ''; - eventString += event.target.id; - if (event.relatedTarget) - eventString += '(<-' + event.relatedTarget.id + ')'; - if (event.currentTarget) - eventString += '(@' + event.currentTarget.id + ')'; - if (event.eventPhase == 1) - eventString += '(capturing phase)'; - if (event.target && event.currentTarget && event.target.id == event.currentTarget.id) - shouldBe("event.eventPhase", "2", true); - eventRecords[eventType].push(eventString); -} - -function prepareDOMTree(parent) -{ - parent.appendChild( - createDOM('div', {'id': 'divA', 'style': 'padding-top: 40px'}, - createDOM('div', {'id': 'divB', 'style': 'width: 40px; height: 40px', 'tabindex': 0}), - createDOM('div', {'id': 'divC', 'style': 'width: 40px; height: 40px', 'tabindex': 0}), - createDOM('div', {'id': 'shadowD', 'style': 'padding-top: 40px'}, - createShadowRoot( - createDOM('div', {'id': 'divE', 'style': 'padding-top: 40px'}, - createDOM('div', {'id': 'shadowF', 'style': 'padding-top: 40px'}, - createShadowRoot( - createDOM('div', {'id': 'shadowG', 'style': 'padding-top: 40px'}, - createShadowRoot( - createDOM('div', {'id': 'divH', 'style': 'width: 40px; height: 40px', 'tabindex': 0}), - createDOM('div', {'id': 'divI', 'style': 'width: 40px; height: 40px', 'tabindex': 0})))))), - createDOM('div', {'id': 'divJ', 'style': 'padding-top: 40px'}, - createDOM('div', {'id': 'shadowK', 'style': 'padding-top: 40px'}, - createShadowRoot( - createDOM('div', {'id': 'divL', 'style': 'width: 40px; height: 40px', 'tabindex': 0})))))))); - - var ids = ['divA', 'divB', 'divC', - 'shadowD', 'shadowD/divE', 'shadowD/shadowF', 'shadowD/shadowF/shadowG', - 'shadowD/shadowF/shadowG/divH', 'shadowD/shadowF/shadowG/divI', - 'shadowD/divJ', 'shadowD/shadowK', 'shadowD/shadowK/divL']; - for (var i = 0; i < ids.length; ++i) { - var element = getNodeInComposedTree(ids[i]); - element.addEventListener('mouseover', recordEvent, false); - element.addEventListener('mouseout', recordEvent, false); - element.addEventListener('focusin', recordEvent, false); - element.addEventListener('focusout', recordEvent, false); - element.addEventListener('focus', recordEvent, true); // capturing phase - element.addEventListener('blur', recordEvent, true); // capturing phase - } -} - -function moveMouse(oldElementId, newElementId, message) -{ - debug('\n' + message + '\n' + 'Moving mouse from ' + oldElementId + ' to ' + newElementId); - moveMouseOver(getNodeInComposedTree(oldElementId)); - clearEventRecords(); - moveMouseOver(getNodeInComposedTree(newElementId)); -} - -function moveFocus(oldElementId, newElementId, message) -{ - debug('\n' + message + '\n' + 'Moving focus from ' + oldElementId + ' to ' + newElementId); - getNodeInComposedTree(oldElementId).focus(); - clearEventRecords(); - getNodeInComposedTree(newElementId).focus(); -} - -function test() -{ - prepareDOMTree(document.getElementById('sandbox')); - - // Test for mouseover/mouseout events. - moveMouse('divB', 'divC', - 'Move mouse from a node to its sibling node. All nodes are outside of shadow boundary.'); - shouldBe('dispatchedEvent("mouseover")', '["divC(<-divB)(@divC)", "divC(<-divB)(@divA)"]'); - shouldBe('dispatchedEvent("mouseout")', '["divB(<-divC)(@divB)", "divB(<-divC)(@divA)"]'); - - moveMouse('divB', 'divA', - 'Target is an ancestor of relatedTarget. All nodes are outside of shadow boundary.'); - shouldBe('dispatchedEvent("mouseover")', '["divA(<-divB)(@divA)"]'); - shouldBe('dispatchedEvent("mouseout")', '["divB(<-divA)(@divB)", "divB(<-divA)(@divA)"]'); - - moveMouse('divA', 'divB', - 'RelatedTarget is an ancestor of target. All nodes are outside of shadow boundary.'); - shouldBe('dispatchedEvent("mouseover")', '["divB(<-divA)(@divB)", "divB(<-divA)(@divA)"]'); - shouldBe('dispatchedEvent("mouseout")', '["divA(<-divB)(@divA)"]'); - - moveMouse('shadowD/shadowF/shadowG/divH', 'shadowD/shadowF/shadowG/divI', - 'Both target and relatedTarget are immediate children of the same shadow root.'); - shouldBe('dispatchedEvent("mouseover")', '["divI(<-divH)(@divI)"]'); - shouldBe('dispatchedEvent("mouseout")', '["divH(<-divI)(@divH)"]'); - - moveMouse('shadowD/shadowF/shadowG/divI', 'shadowD/divE', - 'Target is an ancestor of relatedTarget.'); - shouldBe('dispatchedEvent("mouseover")', '["divE(<-shadowF)(@divE)"]'); - shouldBe('dispatchedEvent("mouseout")', '["divI(<-divE)(@divI)", "shadowG(<-divE)(@shadowG)", "shadowF(<-divE)(@shadowF)", "shadowF(<-divE)(@divE)"]'); - - moveMouse('shadowD/shadowF/shadowG/divI', 'shadowD/shadowF', - 'Target (shadow host) is an ancestor of relatedTarget.'); - shouldBe('dispatchedEvent("mouseover")', '[]'); - shouldBe('dispatchedEvent("mouseout")', '["divI(<-shadowF)(@divI)", "shadowG(<-shadowF)(@shadowG)"]'); - - moveMouse('shadowD/shadowF/shadowG', 'shadowD', - 'Target (shadow host) is an ancestor of relatedTarget (shadow host).'); - shouldBe('dispatchedEvent("mouseover")', '[]'); - shouldBe('dispatchedEvent("mouseout")', '["shadowG(<-shadowD)(@shadowG)", "shadowF(<-shadowD)(@shadowF)", "shadowF(<-shadowD)(@divE)"]'); - - moveMouse('shadowD/divE', 'shadowD/shadowF/shadowG/divI', - 'RelatedTarget is ancestor of target.'); - shouldBe('dispatchedEvent("mouseover")', '["divI(<-divE)(@divI)", "shadowG(<-divE)(@shadowG)", "shadowF(<-divE)(@shadowF)", "shadowF(<-divE)(@divE)"]'); - shouldBe('dispatchedEvent("mouseout")', '["divE(<-shadowF)(@divE)"]'); - - moveMouse('shadowD/shadowF', 'shadowD/shadowF/shadowG/divI', - 'RelatedTarget (shadow host) is ancestor of target.'); - shouldBe('dispatchedEvent("mouseover")', '["divI(<-shadowF)(@divI)", "shadowG(<-shadowF)(@shadowG)"]'); - shouldBe('dispatchedEvent("mouseout")', '[]'); - - moveMouse('shadowD', 'shadowD/shadowF/shadowG', - 'RelatedTarget (shadow host) is an ancestor of target (shadow host).'); - shouldBe('dispatchedEvent("mouseover")', '["shadowG(<-shadowD)(@shadowG)", "shadowF(<-shadowD)(@shadowF)", "shadowF(<-shadowD)(@divE)"]'); - shouldBe('dispatchedEvent("mouseout")', '[]'); - - moveMouse('shadowD/shadowF/shadowG/divH', 'shadowD/shadowK/divL', - 'Target and relatedTarget exist in separated subtree, crossing shadow boundaries. Making sure that event is not dispatched beyond the lowest common boundary.'); - shouldBe('dispatchedEvent("mouseover")', '["divL(<-shadowF)(@divL)", "shadowK(<-shadowF)(@shadowK)", "shadowK(<-shadowF)(@divJ)"]'); - shouldBe('dispatchedEvent("mouseout")', '["divH(<-shadowK)(@divH)", "shadowG(<-shadowK)(@shadowG)", "shadowF(<-shadowK)(@shadowF)", "shadowF(<-shadowK)(@divE)"]'); - - // Test for focusin/focusout events. - moveFocus('divB', 'divC', - 'Move focus from a node to its sibling node. All nodes are outside of shadow boundary.'); - shouldBe('dispatchedEvent("focusin")', '["divC(<-divB)(@divC)", "divC(<-divB)(@divA)"]'); - shouldBe('dispatchedEvent("focusout")', '["divB(<-divC)(@divB)", "divB(<-divC)(@divA)"]'); - - moveFocus('shadowD/shadowF/shadowG/divH', 'shadowD/shadowK/divL', - 'Old focused node and new focused node exist in separated subtrees, crossing shadow boundaries. Making sure that an event is not dispatched beyond the lowest common boundary.'); - shouldBe('dispatchedEvent("focusin")', '["divL(<-shadowF)(@divL)", "shadowK(<-shadowF)(@shadowK)", "shadowK(<-shadowF)(@divJ)"]'); - shouldBe('dispatchedEvent("focusout")', '["divH(<-shadowK)(@divH)", "shadowG(<-shadowK)(@shadowG)", "shadowF(<-shadowK)(@shadowF)", "shadowF(<-shadowK)(@divE)"]'); - - // Omitted test cases where either a oldFocusedNode or newFocusedNode is an ancestor of the other. - // Due to a focus transfer mechanism on shadow hosts, a focused node should be a leaf node in general. - - // Test for focus/blur events. Event listeners should be registerd on captureing phase. - moveFocus('divB', 'divC', - 'Move focus from a node to its sibling node. All nodes are outside of shadow boundary.'); - shouldBe('dispatchedEvent("focus")', '["divC(<-divB)(@divA)(capturing phase)", "divC(<-divB)(@divC)"]'); - shouldBe('dispatchedEvent("blur")', '["divB(<-divC)(@divA)(capturing phase)", "divB(<-divC)(@divB)"]'); - - moveFocus('shadowD/shadowF/shadowG/divH', 'shadowD/shadowK/divL', - 'Old focused node and new focused node exist in separated subtrees, crossing shadow boundaries. Making sure that an event is not dispatched beyond the lowest common boundary.'); - shouldBe('dispatchedEvent("focus")', '["shadowK(<-shadowF)(@divJ)(capturing phase)", "shadowK(<-shadowF)(@shadowK)", "divL(<-shadowF)(@divL)"]'); - shouldBe('dispatchedEvent("blur")', '["shadowF(<-shadowK)(@divE)(capturing phase)", "shadowF(<-shadowK)(@shadowF)", "shadowG(<-shadowK)(@shadowG)", "divH(<-shadowK)(@divH)"]'); -} - -test(); -</script> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadow-content-crash-expected.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadow-content-crash-expected.html deleted file mode 100644 index bde89f13..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadow-content-crash-expected.html +++ /dev/null
@@ -1,11 +0,0 @@ -<!DOCTYPE html> -<html> -<head> - <title>Shadow Content Element Crash</title> -</head> -<body> -<p>This test confirms adding a content element into a shadow root does not cause crash.</p> - -<div>PASS<div> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadow-content-crash.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadow-content-crash.html deleted file mode 100644 index dd128e5..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadow-content-crash.html +++ /dev/null
@@ -1,18 +0,0 @@ -<!DOCTYPE html> -<html> -<head> - <title>Shadow Content Element Crash</title> -</head> -<body> -<p>This test confirms adding a content element into a shadow root does not cause crash.</p> - -<div id='container'>FAIL</div> - -<script> -var div = document.getElementById('container'); -var root = div.attachShadow({mode: 'open'}); -root.innerHTML = "<content select='span'>PASS</content>"; -</script> - -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadow-contents-event-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadow-contents-event-expected.txt deleted file mode 100644 index be639bb..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadow-contents-event-expected.txt +++ /dev/null
@@ -1,18 +0,0 @@ -Tests to ensure that moving mouse from 'summary' to 'details' should dispatch events correctly. Note that 'details' is a shadow host and has a 'summary' element as a immediate child element. There is no shadow root between them. - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - -summary -details - -Moving mouse from summary to details -PASS dispatchedEvent("mouseover") is ["details(<-summary)(@details)", "details(<-summary)(@sandbox)"] -PASS dispatchedEvent("mouseout") is ["summary(<-details)(@summary)", "summary(<-details)(@details)", "summary(<-details)(@sandbox)"] - -Moving mouse from details to summary -PASS dispatchedEvent("mouseover") is ["summary(<-details)(@summary)", "summary(<-details)(@details)", "summary(<-details)(@sandbox)"] -PASS dispatchedEvent("mouseout") is ["details(<-summary)(@details)", "details(<-summary)(@sandbox)"] -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadow-contents-event.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadow-contents-event.html deleted file mode 100644 index ba0fc0c..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadow-contents-event.html +++ /dev/null
@@ -1,92 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script src="../../../resources/js-test.js"></script> -</head> -<body> -<p id="description"></p> -<div id="sandbox"> - <details open id="details" style="height: 200px"> - <summary id="summary">summary</summary> - details - </details> -</div> -<pre id="console"></pre> -<script> -description("Tests to ensure that moving mouse from 'summary' to 'details' should dispatch events correctly. " - + "Note that 'details' is a shadow host and has a 'summary' element as a immediate child element. " - + "There is no shadow root between them."); - -function moveMouseOver(element) -{ - if (!window.eventSender) - return; - var x = element.offsetLeft + element.offsetWidth / 2; - var y = element.offsetTop + element.offsetHeight / 2; - eventSender.mouseMoveTo(x, y); -} - -var eventRecords = {}; - -function clearEventRecords() -{ - eventRecords = {}; -} - -function dispatchedEvent(eventType) -{ - var events = eventRecords[eventType]; - if (!events) - return []; - return events; -} - -function recordEvent(event) -{ - var eventType = event.type - if (!eventRecords[eventType]) { - eventRecords[eventType] = [] - } - // Records each event in the following format per event type: - // eventRecords[eventType] = ['target.id(<-relatedTarget.id)(@currentTarget.id)',,,] - // * RelatedTarget and currentTarget may be omitted if they are not defined. - // A new event is pushed back to the array of its event type. - var eventString = ''; - eventString += event.target.id; - if (event.relatedTarget) - eventString += '(<-' + event.relatedTarget.id + ')'; - if (event.currentTarget) - eventString += '(@' + event.currentTarget.id + ')'; - eventRecords[eventType].push(eventString); -} - -function moveMouse(oldElementId, newElementId) -{ - debug('\n' + 'Moving mouse from ' + oldElementId + ' to ' + newElementId); - moveMouseOver(document.getElementById(oldElementId)); - clearEventRecords(); - moveMouseOver(document.getElementById(newElementId)); -} - -function test() -{ - var ids = ['sandbox', 'details', 'summary']; - for (var i = 0; i < ids.length; ++i) { - var element = document.getElementById(ids[i]); - element.addEventListener('mouseover', recordEvent, false); - element.addEventListener('mouseout', recordEvent, false); - } - - moveMouse('summary', 'details'); - shouldBe('dispatchedEvent("mouseover")', '["details(<-summary)(@details)", "details(<-summary)(@sandbox)"]'); - shouldBe('dispatchedEvent("mouseout")', '["summary(<-details)(@summary)", "summary(<-details)(@details)", "summary(<-details)(@sandbox)"]'); - - moveMouse('details', 'summary'); - shouldBe('dispatchedEvent("mouseover")', '["summary(<-details)(@summary)", "summary(<-details)(@details)", "summary(<-details)(@sandbox)"]'); - shouldBe('dispatchedEvent("mouseout")', '["details(<-summary)(@details)", "details(<-summary)(@sandbox)"]'); -} - -test(); -</script> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadow-contents-fallback-dynamic-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadow-contents-fallback-dynamic-expected.txt deleted file mode 100644 index 26b1bf7..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadow-contents-fallback-dynamic-expected.txt +++ /dev/null
@@ -1,33 +0,0 @@ -CONSOLE WARNING: line 62: Element.createShadowRoot is deprecated and will be removed in M80, around February 2020. Please use Element.attachShadow instead. See https://www.chromestatus.com/features/4507242028072960 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -testAppendFallback -PASS -testAppendFallbackDeep -PASS -testRemoveFallback -PASS -testRemoveFallbackDeep -PASS -testRemove1 -PASS -testRemove2 -PASS -testRemove3 -PASS -testReplaceFallback -PASS -testFallbackContentChanged -PASS -testComplexAppend -PASS -testComplexRemove -PASS -testComplexReplace -PASS -testContentInContent -PASS -testContentInContentFallback -PASS -testContentInContentFallbackDirect -PASS -TEST COMPLETED -
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadow-contents-fallback-dynamic.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadow-contents-fallback-dynamic.html deleted file mode 100644 index 08738d7c..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadow-contents-fallback-dynamic.html +++ /dev/null
@@ -1,491 +0,0 @@ - <!DOCTYPE html> -<html> -<head> -<style> -/* relative positioning ensures underlying Layer */ -.container { - position: relative; -} - -.span { - display: boxed-inline; - margin: 2px; - border: solid; -} -</style> -<script> -function log(message) { - document.getElementById('console').innerHTML += (message + "\n"); -} - -function removeAllChildren(elem) { - while (elem.firstChild) - elem.removeChild(elem.firstChild); -} - -function cleanUp() { - removeAllChildren(document.getElementById('actual-container')); - removeAllChildren(document.getElementById('expect-container')); -} - -function removeContainerLines(text) { - var lines = text.split('\n'); - lines.splice(0, 2); - return lines.join('\n'); -} - -function check() { - var refContainerLayoutTree = internals.elementLayoutTreeAsText(document.getElementById('expect-container')); - var refLayoutTree = removeContainerLines(refContainerLayoutTree); - - var targetContainerLayoutTree = internals.elementLayoutTreeAsText(document.getElementById('actual-container')); - var targetLayoutTree = removeContainerLines(targetContainerLayoutTree); - - if (targetLayoutTree == refLayoutTree) - log("PASS"); - else { - log("FAIL"); - log("Expected: "); - log(refLayoutTree); - log("Actual: "); - log(targetLayoutTree); - } -} - -function createSpanWithText(text) { - var span = document.createElement('span'); - span.appendChild(document.createTextNode(text)); - return span; -} - -function appendShadow(target, select) { - var root = target.createShadowRoot(); - - var content = document.createElement('content'); - content.setAttribute('select', select); - content.appendChild(createSpanWithText("FALLBACK")); - - root.appendChild(document.createTextNode("{SHADOW: ")); - root.appendChild(content); - root.appendChild(document.createTextNode("}")); -} - -function appendShadowDeep(target, select) { - var root = target.createShadowRoot(); - - var child = document.createElement("span"); - { - var content = document.createElement('content'); - content.setAttribute('select', select); - content.appendChild(createSpanWithText("FALLBACK")); - - child.appendChild(document.createTextNode("{INNER: ")); - child.appendChild(content); - child.appendChild(document.createTextNode("}")); - } - - root.appendChild(document.createTextNode("{SHADOW: ")); - root.appendChild(child); - root.appendChild(document.createTextNode("}")); -} - -function testAppendFallback(callIfDone) { - var target = document.createElement('div'); - target.innerHTML = "<span>content</span>"; - - appendShadow(target, "#append"); - - document.getElementById('actual-container').appendChild(target); - - var f = (function(target, callIfDone) { - return function() { - target.innerHTML = "<span id='append'>appended</span>"; - document.getElementById('expect-container').innerHTML = "<div>{SHADOW: <span>appended</span>}</div>"; - callIfDone(); - }; - })(target, callIfDone); - - setTimeout(f, 0); -} - -function testAppendFallbackDeep(callIfDone) { - var target = document.createElement('div'); - target.innerHTML = "<span>content</span>"; - - appendShadowDeep(target, "#append-deep"); - - document.getElementById('actual-container').appendChild(target); - - var f = (function(target, callIfDone) { - return function() { - target.innerHTML = "<span id='append-deep'>appended</span>"; - document.getElementById('expect-container').innerHTML = "<div>{SHADOW: <span>{INNER: <span>appended</span>}</span>}</div>"; - callIfDone(); - }; - })(target, callIfDone); - - setTimeout(f, 0); -} - -function testRemoveFallback(callIfDone) { - var target = document.createElement('div'); - target.innerHTML = "<span id='remove'>content</span>"; - - appendShadow(target, "#remove"); - - document.getElementById('actual-container').appendChild(target); - - var f = (function(target, callIfDone) { - return function() { - target.innerHTML = "<span>content</span>" - document.getElementById('expect-container').innerHTML = "<div>{SHADOW: <span>FALLBACK</span>}</div>"; - callIfDone(); - }; - })(target, callIfDone); - - setTimeout(f, 0); -} - -function testRemoveFallbackDeep(callIfDone) { - var target = document.createElement('div'); - target.innerHTML = "<span id='remove-deep'>content</span>"; - - appendShadowDeep(target, "#remove-deep"); - - document.getElementById('actual-container').appendChild(target); - - var f = (function(target, callIfDone) { - return function() { - target.innerHTML = "<span>content</span>" - document.getElementById('expect-container').innerHTML = "<div>{SHADOW: <span>{INNER: <span>FALLBACK</span>}</span>}</div>"; - callIfDone(); - }; - })(target, callIfDone); - - setTimeout(f, 0); -} - -function testRemove1(callIfDone) { - var target = document.createElement('div'); - target.innerHTML = "<span id='remove1-1'>content 1</span><span id='remove1-2'>content 2</span>"; - appendShadow(target, "span"); - - document.getElementById('actual-container').appendChild(target); - - var f = (function(target, callIfDone) { - return function() { - target.removeChild(document.getElementById('remove1-1')); - document.getElementById('expect-container').innerHTML = "<div>{SHADOW: <span>content 2</span>}</div>"; - callIfDone(); - }; - })(target, callIfDone); - - setTimeout(f, 0); -} - -function testRemove2(callIfDone) { - var target = document.createElement('div'); - target.innerHTML = "<span id='testremove2-1'>content 1</span><span id='testremove2-2'>content 2</span>"; - appendShadow(target, "span"); - - document.getElementById('actual-container').appendChild(target); - - var f = (function(target, callIfDone) { - return function() { - target.removeChild(document.getElementById('testremove2-2')); - document.getElementById('expect-container').innerHTML = "<div>{SHADOW: <span>content 1</span>}</div>"; - callIfDone(); - }; - })(target, callIfDone); - - setTimeout(f, 0); -} - -function testRemove3(callIfDone) { - var target = document.createElement('div'); - target.innerHTML = "<span id='testremove3-1'>content 1</span><span id='testremove3-2'>content 2</span>"; - appendShadow(target, "span"); - - document.getElementById('actual-container').appendChild(target); - - var f = (function(target, callIfDone) { - return function() { - target.removeChild(document.getElementById('testremove3-1')); - target.removeChild(document.getElementById('testremove3-2')); - document.getElementById('expect-container').innerHTML = "<div>{SHADOW: <span>FALLBACK</span>}</div>"; - callIfDone(); - }; - })(target, callIfDone); - - setTimeout(f, 0); -} - -function testReplaceFallback(callIfDone) { - var target = document.createElement('div'); - target.innerHTML = "<span id='to-replace'>content</span>"; - - appendShadow(target, "#to-replace"); - - document.getElementById('actual-container').appendChild(target); - - var f = (function(target, callIfDone) { - return function() { - target.innerHTML = "<span id='to-replace'>replaced</span>"; - document.getElementById('expect-container').innerHTML = "<div>{SHADOW: <span>replaced</span>}</div>"; - callIfDone(); - }; - })(target, callIfDone); - - setTimeout(f, 0); -} - -function testFallbackContentChanged(callIfDone) { - var target = document.createElement('div'); - target.innerHTML = "<span>content</span>"; - - appendShadow(target, "#non-element"); - - document.getElementById('actual-container').appendChild(target); - - var f = (function(target, callIfDone) { - return function() { - target.appendChild(createSpanWithText('appended content')); - document.getElementById('expect-container').innerHTML = "<div>{SHADOW: <span>FALLBACK</span>}</div>"; - callIfDone(); - }; - })(target, callIfDone); - - setTimeout(f, 0); -} - -function testComplexAppend(callIfDone) { - var target = document.createElement('div'); - appendShadow(target, '#complex-1'); - - var selectContent = document.createElement('span'); - selectContent.setAttribute('id', 'complex-1'); - appendShadow(selectContent, 'span'); - - target.appendChild(document.createTextNode('[WONT SELECTED]')); - target.appendChild(selectContent); - target.appendChild(document.createTextNode('[WONT SELECTED]')); - - document.getElementById('actual-container').appendChild(target); - - var f = (function(target, selectContent, callIfDone) { - return function() { - selectContent.appendChild(createSpanWithText('SELECTED')); - document.getElementById('expect-container').innerHTML = - "<div>{SHADOW: <span>{SHADOW: <span>SELECTED</span>}</span>}</div>"; - callIfDone(); - }; - })(target, selectContent, callIfDone); - - setTimeout(f, 0); -} - -function testComplexRemove(callIfDone) { - var target = document.createElement('div'); - appendShadow(target, '#complex-2'); - - var selectContent = document.createElement('span'); - selectContent.setAttribute('id', 'complex-2'); - { - selectContent.appendChild(createSpanWithText('SELECTED')); - } - appendShadow(selectContent, 'span'); - - target.appendChild(document.createTextNode('[WONT SELECTED]')); - target.appendChild(selectContent); - target.appendChild(document.createTextNode('[WONT SELECTED]')); - - document.getElementById('actual-container').appendChild(target); - - var f = (function(target, selectContent, callIfDone) { - return function() { - removeAllChildren(selectContent); - document.getElementById('expect-container').innerHTML = - "<div>{SHADOW: <span>{SHADOW: <span>FALLBACK</span>}</span>}</div>"; - callIfDone(); - }; - })(target, selectContent, callIfDone); - - setTimeout(f, 0); -} - -function testComplexReplace(callIfDone) { - var target = document.createElement('div'); - appendShadow(target, '#complex-3'); - - var selectContent = document.createElement('span'); - selectContent.setAttribute('id', 'complex-3'); - appendShadow(selectContent, 'span'); - - target.appendChild(document.createTextNode('[WONT SELECTED]')); - target.appendChild(selectContent); - target.appendChild(document.createTextNode('[WONT SELECTED]')); - - document.getElementById('actual-container').appendChild(target); - - var f = (function(target, selectContent, callIfDone) { - return function() { - removeAllChildren(selectContent); - selectContent.appendChild(createSpanWithText('REPLACED')); - document.getElementById('expect-container').innerHTML = - "<div>{SHADOW: <span>{SHADOW: <span>REPLACED</span>}</span>}</div>"; - callIfDone(); - }; - })(target, selectContent, callIfDone); - - setTimeout(f, 0); -} - -function testContentInContent(callIfDone) { - document.getElementById('expect-container').innerHTML = - "<div>{SHADOW: <content><span>CONTENT 2 FALLBACK</span></content>}</div>"; - - var target = document.createElement('div'); - target.appendChild(createSpanWithText('S1')); - target.appendChild(createSpanWithText('S2')); - - var root = target.createShadowRoot(); - var content1 = document.createElement('content'); - content1.setAttribute('select', 'div'); - - root.appendChild(document.createTextNode("{SHADOW: ")); - root.appendChild(content1); - root.appendChild(document.createTextNode("}")); - - document.getElementById('actual-container').appendChild(target); - - var f = (function(target, content1, callIfDone) { - return function() { - var content2 = document.createElement('content'); - content2.setAttribute('select', 'span'); - content2.appendChild(createSpanWithText('CONTENT 2 FALLBACK')); - content1.appendChild(content2); - callIfDone(); - }; - })(target, content1, callIfDone); - - setTimeout(f, 0); -} - -function testContentInContentFallback(callIfDone) { - document.getElementById('expect-container').innerHTML = - "<div>{SHADOW: <content><span>CONTENT 2 FALLBACK</span></content>}</div>"; - - var target = document.createElement('div'); - target.appendChild(createSpanWithText('S1')); - target.appendChild(createSpanWithText('S2')); - - var root = target.createShadowRoot(); - var content1 = document.createElement('content'); - content1.setAttribute('select', 'div'); - - root.appendChild(document.createTextNode("{SHADOW: ")); - root.appendChild(content1); - root.appendChild(document.createTextNode("}")); - - document.getElementById('actual-container').appendChild(target); - - var f = (function(target, content1, callIfDone) { - return function() { - var content2 = document.createElement('content'); - content2.setAttribute('select', 'div'); - content2.appendChild(createSpanWithText('CONTENT 2 FALLBACK')); - content1.appendChild(content2); - callIfDone(); - }; - })(target, content1, callIfDone); - - setTimeout(f, 0); -} - -function testContentInContentFallbackDirect(callIfDone) { - document.getElementById('expect-container').innerHTML = - "<div><content><span>CONTENT 2 FALLBACK</span></content></div>"; - - var target = document.createElement('div'); - target.appendChild(createSpanWithText('S1')); - target.appendChild(createSpanWithText('S2')); - - var root = target.createShadowRoot(); - var content1 = document.createElement('content'); - content1.setAttribute('select', 'div'); - root.appendChild(content1); - - document.getElementById('actual-container').appendChild(target); - - var f = (function(target, content1, callIfDone) { - return function() { - var content2 = document.createElement('content'); - content2.setAttribute('select', 'div'); - content2.appendChild(createSpanWithText('CONTENT 2 FALLBACK')); - content1.appendChild(content2); - callIfDone(); - }; - })(target, content1, callIfDone); - - setTimeout(f, 0); -} - -var testFuncs = [ - testAppendFallback, - testAppendFallbackDeep, - testRemoveFallback, - testRemoveFallbackDeep, - testRemove1, - testRemove2, - testRemove3, - testReplaceFallback, - testFallbackContentChanged, - testComplexAppend, - testComplexRemove, - testComplexReplace, - testContentInContent, - testContentInContentFallback, - testContentInContentFallbackDirect -]; - -function doTestIfLeft() { - var test = testFuncs.shift(); - if (test == null) - return doneTest(); - - var callIfDone = function() { - setTimeout(function() { - check(); - cleanUp(); - doTestIfLeft(); - }, 0); - }; - - log(test.name); - test(callIfDone); -} - -function doneTest() { - log("TEST COMPLETED"); - testRunner.notifyDone(); -} - -function doTest() { - if (window.testRunner) { - testRunner.waitUntilDone(); - testRunner.dumpAsText(); - } - - cleanUp(); - doTestIfLeft(); -} -</script> -</head> -<body onload="doTest()"> - -<div id="actual-container" class="container"></div> -<div id="expect-container" class="container"></div> -<pre id="console"></pre> - -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadow-contents-fallback-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadow-contents-fallback-expected.txt deleted file mode 100644 index 3bebad1..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadow-contents-fallback-expected.txt +++ /dev/null
@@ -1,15 +0,0 @@ -CONSOLE WARNING: line 63: Element.createShadowRoot is deprecated and will be removed in M80, around February 2020. Please use Element.attachShadow instead. See https://www.chromestatus.com/features/4507242028072960 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -PASS -PASS -PASS -PASS -PASS -PASS -PASS -PASS -PASS -PASS -PASS -PASS -PASS -
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadow-contents-fallback.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadow-contents-fallback.html deleted file mode 100644 index 23ad782..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadow-contents-fallback.html +++ /dev/null
@@ -1,378 +0,0 @@ - <!DOCTYPE html> -<html> -<head> -<style> -/* relative positioning ensures underlying Layer */ -.container { - position: relative; -} - -.span { - display: boxed-inline; - margin: 2px; - border: solid; -} -</style> -<script> -function log(message) { - document.getElementById('console').innerHTML += (message + "\n"); -} - -function removeAllChildren(elem) { - while (elem.firstChild) - elem.removeChild(elem.firstChild); -} - -function cleanUp() { - removeAllChildren(document.getElementById('actual-container')); - removeAllChildren(document.getElementById('expect-container')); -} - -function removeContainerLines(text) { - var lines = text.split('\n'); - lines.splice(0, 2); - return lines.join('\n'); -} - -function check() { - var refContainerLayoutTree = internals.elementLayoutTreeAsText(document.getElementById('expect-container')); - var refLayoutTree = removeContainerLines(refContainerLayoutTree); - - var targetContainerLayoutTree = internals.elementLayoutTreeAsText(document.getElementById('actual-container')); - var targetLayoutTree = removeContainerLines(targetContainerLayoutTree); - - if (targetLayoutTree == refLayoutTree) - log("PASS"); - else { - log("FAIL"); - log("Expected: "); - log(refLayoutTree); - log("Actual: "); - log(targetLayoutTree); - } - -} - -function createSpanWithText(text) { - var span = document.createElement('span'); - span.appendChild(document.createTextNode(text)); - return span; -} - -function appendShadow(target, select) { - var root = target.createShadowRoot(); - - var content = document.createElement('content'); - content.setAttribute('select', select); - content.appendChild(createSpanWithText("FALLBACK")); - - root.appendChild(document.createTextNode("{SHADOW: ")); - root.appendChild(content); - root.appendChild(document.createTextNode("}")); -} - -function appendShadowDeep(target, select) { - var root = target.createShadowRoot(); - - var child = document.createElement("span"); - { - var content = document.createElement('content'); - content.setAttribute('select', select); - content.appendChild(createSpanWithText("FALLBACK")); - - child.appendChild(document.createTextNode("{INNER: ")); - child.appendChild(content); - child.appendChild(document.createTextNode("}")); - } - - root.appendChild(document.createTextNode("{SHADOW: ")); - root.appendChild(child); - root.appendChild(document.createTextNode("}")); -} - -function testFallback() { - var target = document.createElement('div'); - target.innerHTML = "<span>SELECTED</span>"; - - appendShadow(target, "#non-element"); - - document.getElementById('actual-container').appendChild(target); - document.getElementById('expect-container').innerHTML = - "<div>{SHADOW: <span>FALLBACK</span>}</div>"; -} - -function testFallbackDeep() { - var target = document.createElement('div'); - target.innerHTML = "<span>SELECTED</span>"; - - appendShadowDeep(target, "#non-element"); - - document.getElementById('actual-container').appendChild(target); - document.getElementById('expect-container').innerHTML = - "<div>{SHADOW: <span>{INNER: <span>FALLBACK</span>}</span>}</div>"; -} - -function testNonFallbackWithLightChildren() { - var target = document.createElement('div'); - target.innerHTML = "<span id='selected-1'>SELECTED</span>"; - - appendShadow(target, "#selected-1"); - - document.getElementById('actual-container').appendChild(target); - document.getElementById('expect-container').innerHTML = - "<div>{SHADOW: <span>SELECTED</span>}</div>"; -} - -function testNonFallbackDeepWithLightChildren() { - var target = document.createElement('div'); - target.innerHTML = "<span id='selected-2'>SELECTED</span>"; - - appendShadowDeep(target, "#selected-2"); - - document.getElementById('actual-container').appendChild(target); - document.getElementById('expect-container').innerHTML = - "<div>{SHADOW: <span>{INNER: <span>SELECTED</span>}</span>}</div>"; -} - -function testComplexFallback() { - var target = document.createElement('div'); - appendShadow(target, '#complex-1'); - - var selectContent = document.createElement('span'); - selectContent.setAttribute('id', 'complex-1'); - { - selectContent.appendChild(createSpanWithText('SELECTED')); - } - appendShadow(selectContent, 'span'); - - target.appendChild(document.createTextNode('[WONT SELECTED]')); - target.appendChild(selectContent); - target.appendChild(document.createTextNode('[WONT SELECTED]')); - - document.getElementById('actual-container').appendChild(target); - document.getElementById('expect-container').innerHTML = - "<div>{SHADOW: <span>{SHADOW: <span>SELECTED</span>}</span>}</div>"; -} - -function testComplexFallbackDeep() { - var target = document.createElement('div'); - appendShadowDeep(target, '#complex-2'); - - var selectContent = document.createElement('span'); - selectContent.setAttribute('id', 'complex-2'); - { - selectContent.appendChild(createSpanWithText('SELECTED')); - } - appendShadowDeep(selectContent, 'span'); - - target.appendChild(document.createTextNode('[WONT SELECTED]')); - target.appendChild(selectContent); - target.appendChild(document.createTextNode('[WONT SELECTED]')); - - document.getElementById('actual-container').appendChild(target); - document.getElementById('expect-container').innerHTML = - "<div>{SHADOW: <span>{INNER: <span>{SHADOW: <span>{INNER: <span>SELECTED</span>}</span>}</span>}</span>}</span></div>"; -} - -function testComplexFallbackAgain() { - var target = document.createElement('div'); - appendShadow(target, '#complex-3'); - - var selectContent = document.createElement('span'); - selectContent.setAttribute('id', 'complex-3'); - { - selectContent.appendChild(createSpanWithText('SELECTED')); - } - appendShadow(selectContent, '#non-element'); - - target.appendChild(document.createTextNode('[WONT SELECTED]')); - target.appendChild(selectContent); - target.appendChild(document.createTextNode('[WONT SELECTED]')); - - document.getElementById('actual-container').appendChild(target); - document.getElementById('expect-container').innerHTML = - "<div>{SHADOW: <span>{SHADOW: <span>FALLBACK</span>}</span>}</span></div>"; -} - -function testComplexFallbackDeepAgain() { - var target = document.createElement('div'); - appendShadowDeep(target, '#complex-4'); - - var selectContent = document.createElement('span'); - selectContent.setAttribute('id', 'complex-4'); - { - selectContent.appendChild(createSpanWithText('SELECTED')); - } - appendShadowDeep(selectContent, '#non-element'); - - target.appendChild(document.createTextNode('[WONT SELECTED]')); - target.appendChild(selectContent); - target.appendChild(document.createTextNode('[WONT SELECTED]')); - - document.getElementById('actual-container').appendChild(target); - document.getElementById('expect-container').innerHTML = - "<div>{SHADOW: <span>{INNER: <span>{SHADOW: <span>{INNER: <span>FALLBACK</span>}</span>}</span>}</span>}</span></div>"; -} - -function testContentkWithDisplayNone() { - var target = document.createElement('div'); - - var span1 = createSpanWithText('NOT RENDERED'); - span1.style.display = 'none'; - var span2 = createSpanWithText('NOT RENDERED'); - span2.style.display = 'none'; - var span3 = createSpanWithText('NOT RENDERED'); - span3.style.display = 'none'; - - target.appendChild(span1); - target.appendChild(createSpanWithText('S1')); - target.appendChild(span2); - target.appendChild(createSpanWithText('S2')); - target.appendChild(span3); - - var root = target.createShadowRoot(); - var content = document.createElement('content'); - content.setAttribute('select', 'span'); - content.appendChild(createSpanWithText('FALLBACK')); - - var s = createSpanWithText('NOT RENDERED'); - s.style.display = 'none'; - root.appendChild(s); - root.appendChild(document.createTextNode("{SHADOW: ")); - root.appendChild(content); - root.appendChild(document.createTextNode("}")); - - document.getElementById('actual-container').appendChild(target); - document.getElementById('expect-container').innerHTML = - "<div>{SHADOW: <span>S1</span><span>S2</span>}</div>"; -} - -function testContentInContent() { - var target = document.createElement('div'); - target.appendChild(createSpanWithText('S1')); - target.appendChild(createSpanWithText('S2')); - - var root = target.createShadowRoot(); - var content2 = document.createElement('content'); - content2.setAttribute('select', 'span'); - content2.appendChild(createSpanWithText('CONTENT 2 FALLBACK')); - - var content1 = document.createElement('content'); - content1.setAttribute('select', 'div'); - content1.appendChild(content2); - - root.appendChild(document.createTextNode("{SHADOW: ")); - root.appendChild(content1); - root.appendChild(document.createTextNode("}")); - - document.getElementById('actual-container').appendChild(target); - document.getElementById('expect-container').innerHTML = - "<div>{SHADOW: <content><span>CONTENT 2 FALLBACK</span></content>}</div>"; -} - -function testContentInContentFallback() { - var target = document.createElement('div'); - target.appendChild(createSpanWithText('S1')); - target.appendChild(createSpanWithText('S2')); - - var root = target.createShadowRoot(); - var content2 = document.createElement('content'); - content2.setAttribute('select', 'div'); - content2.appendChild(createSpanWithText('CONTENT 2 FALLBACK')); - - var content1 = document.createElement('content'); - content1.setAttribute('select', 'div'); - content1.appendChild(content2); - - root.appendChild(document.createTextNode("{SHADOW: ")); - root.appendChild(content1); - root.appendChild(document.createTextNode("}")); - - document.getElementById('actual-container').appendChild(target); - document.getElementById('expect-container').innerHTML = - "<div>{SHADOW: <content><span>CONTENT 2 FALLBACK</span></content>}</div>"; -} - -function testContentInContentFallbackWithDisplayNone() { - var target = document.createElement('div'); - target.appendChild(createSpanWithText('S1')); - target.appendChild(createSpanWithText('S2')); - - var root = target.createShadowRoot(); - var content2 = document.createElement('content'); - content2.setAttribute('select', 'div'); - content2.appendChild(createSpanWithText('CONTENT 2 FALLBACK')); - - var content1 = document.createElement('content'); - content1.setAttribute('select', 'div'); - content1.appendChild(content2); - - var s = createSpanWithText('NOT RENDERED'); - s.style.display = 'none'; - root.appendChild(s); - root.appendChild(document.createTextNode("{SHADOW: ")); - root.appendChild(content1); - root.appendChild(document.createTextNode("}")); - - document.getElementById('actual-container').appendChild(target); - document.getElementById('expect-container').innerHTML = - "<div>{SHADOW: <content><span>CONTENT 2 FALLBACK</span></content>}</div>"; -} - -function testContentInContentFallbackDirect() { - var target = document.createElement('div'); - target.appendChild(createSpanWithText('S1')); - target.appendChild(createSpanWithText('S2')); - - var root = target.createShadowRoot(); - var content2 = document.createElement('content'); - content2.setAttribute('select', 'div'); - content2.appendChild(createSpanWithText('CONTENT 2 FALLBACK')); - - var content1 = document.createElement('content'); - content1.setAttribute('select', 'div'); - content1.appendChild(content2); - - root.appendChild(content1); - - document.getElementById('actual-container').appendChild(target); - document.getElementById('expect-container').innerHTML = - "<div><content><span>CONTENT 2 FALLBACK</span></content></div>"; -} - -var testFuncs = [ - testFallback, - testFallbackDeep, - testNonFallbackWithLightChildren, - testNonFallbackDeepWithLightChildren, - testComplexFallback, - testComplexFallbackDeep, - testComplexFallbackAgain, - testComplexFallbackDeepAgain, - testContentkWithDisplayNone, - testContentInContent, - testContentInContentFallback, - testContentInContentFallbackWithDisplayNone, - testContentInContentFallbackDirect -]; - -function doTest() { - testRunner.dumpAsText(); - cleanUp(); - - for (var i = 0; i < testFuncs.length; ++i) { - testFuncs[i](); - check(); - cleanUp(); - } -} -</script> -</head> -<body onload="doTest()"> - -<div id="actual-container" class="container"></div> -<div id="expect-container" class="container"></div> -<pre id="console"></pre> - -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadow-contents-select-expected.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadow-contents-select-expected.html deleted file mode 100644 index afccd8ed..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadow-contents-select-expected.html +++ /dev/null
@@ -1,35 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<style> -/* relative positioning ensures underlying Layer */ -.container { - position: relative; -} -</style> -</head> -<body> -<div id="container"> -<!-- testSelectIsNull --> -<div><span>Hello,</span><span>content</span><span>World.</span></div> -<!-- testSelectIsId --> -<div><span>Hello,</span><span>content</span><span>World.</span></div> -<!-- testSelectIsIdButNotMatched --> -<div><span>Hello,</span><span>World.</span></div> -<!-- testSelectIsIdButNotChild --> -<div><span>Hello,</span><span>World.</span></div> -<!-- testSelectIsMultiId --> -<div><span>Hello,</span><span>content</span><span>content</span><span>World.</span></div> -<!-- testSelectIsType --> -<div><span>Hello,</span><span>content</span><span>World.</span></div> -<!-- testSelectIsTypeWithAttribute --> -<div><span>Hello,</span><span>content</span><span>World.</span></div> -<!-- testSelectIsDetails --> -<div><span>Hello,</span><details>content</details><span>World.</span></div> -<!-- testSelectIsDetails2 --> -<div><span>Hello,</span><details><summary>content</summary></details><span>World.</span></div> -<!-- testSelectWhenDynamicallyChildrenChanged --> -<div><span>Hello,</span><span>content</span><span>World.</span></div> -</div> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadow-contents-select-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadow-contents-select-expected.txt deleted file mode 100644 index 572d65f..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadow-contents-select-expected.txt +++ /dev/null
@@ -1 +0,0 @@ -CONSOLE WARNING: line 12: Element.createShadowRoot is deprecated and will be removed in M80, around February 2020. Please use Element.attachShadow instead. See https://www.chromestatus.com/features/4507242028072960 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details.
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadow-contents-select.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadow-contents-select.html deleted file mode 100644 index 72b901d7..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadow-contents-select.html +++ /dev/null
@@ -1,144 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<style> -/* relative positioning ensures underlying Layer */ -.container { - position: relative; -} -</style> -<script> -function appendShadow(target, select) { - var root = target.createShadowRoot(); - - var child0 = document.createElement("span"); - child0.innerHTML = "Hello,"; - root.appendChild(child0); - - var content = document.createElement('content'); - content.setAttribute('select', select); - root.appendChild(content); - - var child1 = document.createElement("span"); - child1.innerHTML = "World."; - root.appendChild(child1); -} - -function testSelectIsNull() { - var target = document.createElement('div'); - target.innerHTML = "<span>content</span>"; - - appendShadow(target, ""); - - document.getElementById('container').appendChild(target); -} - -function testSelectIsId() { - var target = document.createElement('div'); - target.innerHTML = "<span id='foo'>content</span><span id='azunyan'>peropero</span>"; - - appendShadow(target, "#foo"); - - document.getElementById('container').appendChild(target); -} - -function testSelectIsIdButNotMatched() { - var target = document.createElement('div'); - target.innerHTML = "<span id='foo'>content</span><span id='azunyan'>peropero</span>"; - - appendShadow(target, "#foobar"); - - document.getElementById('container').appendChild(target); -} - -function testSelectIsIdButNotChild() { - var target = document.createElement('div'); - target.innerHTML = "<span><span id='foo'>content</span><span id='azunyan'>peropero</span></span>"; - - appendShadow(target, "#foo"); - - document.getElementById('container').appendChild(target); -} - -function testSelectIsMultiId() { - var target = document.createElement('div'); - target.innerHTML = "<span id='foo'>content</span><span id='azunyan'>peropero</span><span id='foo'>content</span>"; - - appendShadow(target, "#foo"); - - // All matched elements will be selected. - document.getElementById('container').appendChild(target); -} - -function testSelectIsType() { - var target = document.createElement('div'); - target.innerHTML = "<div>azunyan</div><span>content</span><div>peropero</div>"; - - appendShadow(target, "span"); - - document.getElementById('container').appendChild(target); -} - -function testSelectIsTypeWithAttribute() { - var target = document.createElement('div'); - target.innerHTML = "<span>azunyan</span><span title='content'>content</span><span>peropero</span>"; - - appendShadow(target, "span[title='content']"); - - document.getElementById('container').appendChild(target); -} - -function testSelectIsDetails() { - var target = document.createElement('div'); - target.innerHTML = "<details>content</details>"; - - appendShadow(target, "details"); - - document.getElementById('container').appendChild(target); -} - -function testSelectIsDetails2() { - var target = document.createElement('div'); - target.innerHTML = "<details><summary>content</summary></details>"; - - appendShadow(target, "details"); - - document.getElementById('container').appendChild(target); -} - -function testSelectWhenDynamicallyChildrenChanged() { - var target = document.createElement('div'); - target.innerHTML = "<span>content</span><span id='toberemoved'>anunyan peropero</span>"; - - appendShadow(target, "span"); - - document.getElementById('container').appendChild(target); - - var elem = document.getElementById('toberemoved'); - elem.parentNode.removeChild(elem); -} - -var testFuncs = [ - testSelectIsNull, - testSelectIsId, - testSelectIsIdButNotMatched, - testSelectIsIdButNotChild, - testSelectIsMultiId, - testSelectIsType, - testSelectIsTypeWithAttribute, - testSelectIsDetails, - testSelectIsDetails2, - testSelectWhenDynamicallyChildrenChanged, -] - -function doTest() { - for (var i = 0; i < testFuncs.length; ++i) { - testFuncs[i](); - } -} -</script> -</head> -<body onload="doTest()"> -<div id="container"></div> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadow-disable-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadow-disable-expected.txt deleted file mode 100644 index 10f285fe..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadow-disable-expected.txt +++ /dev/null
@@ -1,53 +0,0 @@ -CONSOLE WARNING: Element.createShadowRoot is deprecated and will be removed in M80, around February 2020. Please use Element.attachShadow instead. See https://www.chromestatus.com/features/4507242028072960 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -Tests to ensure that shadow element cannot be created in elements having dynamically created shadow root. - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - -DIV -PASS element.createShadowRoot() is not null -SPAN -PASS element.createShadowRoot() is not null -A -PASS element.createShadowRoot() is not null -SECTION -PASS element.createShadowRoot() is not null -g -PASS element.createShadowRoot() is not null -rect -PASS element.createShadowRoot() is not null -svg -PASS element.createShadowRoot() is not null -INPUT -PASS element.createShadowRoot() threw exception InvalidStateError: Failed to execute 'createShadowRoot' on 'Element': Shadow root cannot be created on a host which already hosts a user-agent shadow tree.. -EMBED -PASS element.createShadowRoot() threw exception InvalidStateError: Failed to execute 'createShadowRoot' on 'Element': Shadow root cannot be created on a host which already hosts a user-agent shadow tree.. -OBJECT -PASS element.createShadowRoot() threw exception InvalidStateError: Failed to execute 'createShadowRoot' on 'Element': Shadow root cannot be created on a host which already hosts a user-agent shadow tree.. -AUDIO -PASS element.createShadowRoot() threw exception InvalidStateError: Failed to execute 'createShadowRoot' on 'Element': Shadow root cannot be created on a host which already hosts a user-agent shadow tree.. -VIDEO -PASS element.createShadowRoot() threw exception InvalidStateError: Failed to execute 'createShadowRoot' on 'Element': Shadow root cannot be created on a host which already hosts a user-agent shadow tree.. -SELECT -PASS element.createShadowRoot() threw exception InvalidStateError: Failed to execute 'createShadowRoot' on 'Element': Shadow root cannot be created on a host which already hosts a user-agent shadow tree.. -IMG -PASS element.createShadowRoot() threw exception HierarchyRequestError: Failed to execute 'createShadowRoot' on 'Element': Author-created shadow roots are disabled for this element.. -TEXTAREA -PASS element.createShadowRoot() threw exception InvalidStateError: Failed to execute 'createShadowRoot' on 'Element': Shadow root cannot be created on a host which already hosts a user-agent shadow tree.. -IFRAME -PASS element.createShadowRoot() threw exception HierarchyRequestError: Failed to execute 'createShadowRoot' on 'Element': Author-created shadow roots are disabled for this element.. -CANVAS -PASS element.createShadowRoot() threw exception HierarchyRequestError: Failed to execute 'createShadowRoot' on 'Element': Author-created shadow roots are disabled for this element.. -METER -PASS element.createShadowRoot() threw exception InvalidStateError: Failed to execute 'createShadowRoot' on 'Element': Shadow root cannot be created on a host which already hosts a user-agent shadow tree.. -PROGRESS -PASS element.createShadowRoot() threw exception InvalidStateError: Failed to execute 'createShadowRoot' on 'Element': Shadow root cannot be created on a host which already hosts a user-agent shadow tree.. -VIDEO -PASS element.createShadowRoot() threw exception InvalidStateError: Failed to execute 'createShadowRoot' on 'Element': Shadow root cannot be created on a host which already hosts a user-agent shadow tree.. -AUDIO -PASS element.createShadowRoot() threw exception InvalidStateError: Failed to execute 'createShadowRoot' on 'Element': Shadow root cannot be created on a host which already hosts a user-agent shadow tree.. -FIELDSET -PASS element.createShadowRoot() threw exception HierarchyRequestError: Failed to execute 'createShadowRoot' on 'Element': Author-created shadow roots are disabled for this element.. -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadow-disable.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadow-disable.html deleted file mode 100644 index f484abb..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadow-disable.html +++ /dev/null
@@ -1,68 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script src="../../../resources/js-test.js"></script> -</head> -<body> -<p id="description"></p> -<svg xmlns="http://www.w3.org/2000/svg" style="display:none"> - <g id="g"></g> - <rect id="rect"></rect> - <svg id="svg"></svg> -</svg> -<pre id="console"></pre> -<script> -description("Tests to ensure that shadow element cannot be created in elements having dynamically created shadow root."); - -function testToAddShadowRoot(element, success) { - debug(element.nodeName); - - if (success) - shouldNotBe("element.createShadowRoot()", "null"); - else - shouldThrow("element.createShadowRoot()"); -} - -var elementsToSuccess = [ - document.createElement('div'), - document.createElement('span'), - document.createElement('a'), - document.createElement('section'), - document.getElementById('g'), - document.getElementById('rect'), - document.getElementById('svg'), -]; - -// See crbug.com/234020 . -var elementsToFail = [ - document.createElement('input'), - document.createElement('embed'), - document.createElement('object'), - document.createElement('audio'), - document.createElement('video'), - document.createElement('select'), - document.createElement('img'), - document.createElement('textarea'), - document.createElement('iframe'), - document.createElement('canvas'), - document.createElement('meter'), - document.createElement('progress'), - document.createElement('video'), - document.createElement('audio'), - document.createElement('fieldset'), -]; - -for (var i = 0; i < elementsToSuccess.length; ++i) { - var element = elementsToSuccess[i]; - testToAddShadowRoot(element, true); -} - -for (var i = 0; i < elementsToFail.length; ++i) { - var element = elementsToFail[i]; - testToAddShadowRoot(element, false); -} - -var successfullyParsed = true; -</script> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadow-dom-event-dispatching-child-of-inactive-content-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadow-dom-event-dispatching-child-of-inactive-content-expected.txt deleted file mode 100644 index 784f5c3..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadow-dom-event-dispatching-child-of-inactive-content-expected.txt +++ /dev/null
@@ -1,32 +0,0 @@ -CONSOLE WARNING: line 87: Element.createShadowRoot is deprecated and will be removed in M80, around February 2020. Please use Element.attachShadow instead. See https://www.chromestatus.com/features/4507242028072960 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. - - -Flat Tree will be: -DIV id=sandbox - DIV id=top - DIV id=A - DIV id=B - DIV id=parent-of-inactive-content - CONTENT id=inactive-content - DIV id=child-of-inactive-content - - -Moving mouse from A to child-of-inactive-content - - mouseout - @A (target: A) (related: child-of-inactive-content) - @top (target: A) (related: child-of-inactive-content) - - mouseover - @child-of-inactive-content (target: child-of-inactive-content) (related: A) - @inactive-content (target: child-of-inactive-content) (related: A) - @parent-of-inactive-content (target: child-of-inactive-content) (related: A) - @active-content (target: child-of-inactive-content) (related: A) - @shadow-root-B (target: child-of-inactive-content) (related: A) - @B (target: child-of-inactive-content) (related: A) - @top (target: child-of-inactive-content) (related: A) -PASS successfullyParsed is true - -TEST COMPLETE - -
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadow-dom-event-dispatching-child-of-inactive-content.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadow-dom-event-dispatching-child-of-inactive-content.html deleted file mode 100644 index 044ca97e..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadow-dom-event-dispatching-child-of-inactive-content.html +++ /dev/null
@@ -1,31 +0,0 @@ -<!DOCTYPE html> -<html> -<head> - <script src="../../../resources/js-test.js"></script> - <script src="resources/shadow-dom.js"></script> - <script src="resources/event-dispatching.js"></script> -</head> -<body> - <p id="description"></p> - <div id="sandbox"></div> - <pre id="console"></pre> - <script> - var sandbox = document.getElementById('sandbox'); - - sandbox.appendChild( - createDOM('div', {'id': 'top'}, - createDOM('div', {'id': 'A'}), - createDOM('div', {'id': 'B'}, - createShadowRoot({'id': 'shadow-root-B'}, - createDOM('content', {'id': 'active-content', 'select': '#parent-of-inactive-content'})), - createDOM('div', {'id': 'parent-of-inactive-content'}, - createDOM('content', {'id': 'inactive-content'}, - createDOM('div', {'id': 'child-of-inactive-content'})))))); - - addEventListeners(['top', 'A', 'B', 'B/', 'B/active-content', - 'parent-of-inactive-content', 'inactive-content', 'child-of-inactive-content']); - showSandboxTree(); - moveMouse('A', 'child-of-inactive-content'); - </script> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadow-dom-event-dispatching-distributed-child-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadow-dom-event-dispatching-distributed-child-expected.txt deleted file mode 100644 index b9905d3..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadow-dom-event-dispatching-distributed-child-expected.txt +++ /dev/null
@@ -1,87 +0,0 @@ -CONSOLE WARNING: line 87: Element.createShadowRoot is deprecated and will be removed in M80, around February 2020. Please use Element.attachShadow instead. See https://www.chromestatus.com/features/4507242028072960 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. - - -Flat Tree will be: -DIV id=sandbox - DIV id=top - DIV id=shadow-host - DIV id=distributed-light-child - DIV id=shadow-root-child - - -Moving mouse from shadow-host to shadow-host/shadow-root-child - - mouseout - - mouseover - @shadow-root-child (target: shadow-root-child) (related: shadow-host) - @shadow-root (target: shadow-root-child) (related: shadow-host) - -Moving mouse from shadow-host/shadow-root-child to shadow-host - - mouseout - @shadow-root-child (target: shadow-root-child) (related: shadow-host) - @shadow-root (target: shadow-root-child) (related: shadow-host) - - mouseover - -Moving mouse from shadow-host to distributed-light-child - - mouseout - @shadow-host (target: shadow-host) (related: distributed-light-child) - @top (target: shadow-host) (related: distributed-light-child) - - mouseover - @distributed-light-child (target: distributed-light-child) (related: shadow-host) - @content (target: distributed-light-child) (related: shadow-host) - @shadow-root (target: distributed-light-child) (related: shadow-host) - @shadow-host (target: distributed-light-child) (related: shadow-host) - @top (target: distributed-light-child) (related: shadow-host) - -Moving mouse from distributed-light-child to shadow-host - - mouseout - @distributed-light-child (target: distributed-light-child) (related: shadow-host) - @content (target: distributed-light-child) (related: shadow-host) - @shadow-root (target: distributed-light-child) (related: shadow-host) - @shadow-host (target: distributed-light-child) (related: shadow-host) - @top (target: distributed-light-child) (related: shadow-host) - - mouseover - @shadow-host (target: shadow-host) (related: distributed-light-child) - @top (target: shadow-host) (related: distributed-light-child) - -Moving mouse from shadow-host/shadow-root-child to distributed-light-child - - mouseout - @shadow-root-child (target: shadow-root-child) (related: distributed-light-child) - @shadow-root (target: shadow-root-child) (related: distributed-light-child) - @shadow-host (target: shadow-host) (related: distributed-light-child) - @top (target: shadow-host) (related: distributed-light-child) - - mouseover - @distributed-light-child (target: distributed-light-child) (related: shadow-host) - @content (target: distributed-light-child) (related: shadow-root-child) - @shadow-root (target: distributed-light-child) (related: shadow-root-child) - @shadow-host (target: distributed-light-child) (related: shadow-host) - @top (target: distributed-light-child) (related: shadow-host) - -Moving mouse from distributed-light-child to shadow-host/shadow-root-child - - mouseout - @distributed-light-child (target: distributed-light-child) (related: shadow-host) - @content (target: distributed-light-child) (related: shadow-root-child) - @shadow-root (target: distributed-light-child) (related: shadow-root-child) - @shadow-host (target: distributed-light-child) (related: shadow-host) - @top (target: distributed-light-child) (related: shadow-host) - - mouseover - @shadow-root-child (target: shadow-root-child) (related: distributed-light-child) - @shadow-root (target: shadow-root-child) (related: distributed-light-child) - @shadow-host (target: shadow-host) (related: distributed-light-child) - @top (target: shadow-host) (related: distributed-light-child) -PASS successfullyParsed is true - -TEST COMPLETE - -
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadow-dom-event-dispatching-distributed-child.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadow-dom-event-dispatching-distributed-child.html deleted file mode 100644 index 0684f90..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadow-dom-event-dispatching-distributed-child.html +++ /dev/null
@@ -1,38 +0,0 @@ -<!DOCTYPE html> -<html> -<head> - <script src="../../../resources/js-test.js"></script> - <script src="resources/shadow-dom.js"></script> - <script src="resources/event-dispatching.js"></script> -</head> -<body> - <p id="description"></p> - <div id="sandbox"></div> - <pre id="console"></pre> - <script> - var sandbox = document.getElementById('sandbox'); - - sandbox.appendChild( - createDOM('div', {'id': 'top'}, - createDOM('div', {'id': 'shadow-host'}, - createShadowRoot({'id': 'shadow-root'}, - createDOM('content', {'id': 'content', 'select': '#distributed-light-child',}), - createDOM('div', {'id': 'shadow-root-child'})), - createDOM('div', {'id': 'distributed-light-child'}), - createDOM('div', {'id': 'non-distributed-light-child'})))); - - addEventListeners(['top', 'shadow-host', 'shadow-host/', 'shadow-host/content', 'shadow-host/shadow-root-child', - 'distributed-light-child', 'non-distributed-light-child']); - showSandboxTree(); - - moveMouse('shadow-host', 'shadow-host/shadow-root-child'); - moveMouse('shadow-host/shadow-root-child', 'shadow-host'); - - moveMouse('shadow-host', 'distributed-light-child'); - moveMouse('distributed-light-child', 'shadow-host'); - - moveMouse('shadow-host/shadow-root-child', 'distributed-light-child'); - moveMouse('distributed-light-child', 'shadow-host/shadow-root-child'); - </script> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadow-dom-event-dispatching-distributed-text-node-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadow-dom-event-dispatching-distributed-text-node-expected.txt deleted file mode 100644 index eca519fc..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadow-dom-event-dispatching-distributed-text-node-expected.txt +++ /dev/null
@@ -1,39 +0,0 @@ -CONSOLE WARNING: line 87: Element.createShadowRoot is deprecated and will be removed in M80, around February 2020. Please use Element.attachShadow instead. See https://www.chromestatus.com/features/4507242028072960 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -Text Node - - -Flat Tree will be: -DIV id=sandbox - DIV id=top - DIV id=shadow-host - DIV id=content-parent - #text - - -Moving mouse from a distributed text node to top - - mouseout - @content-parent (target: content-parent) (related: top) - @shadow-root (target: content-parent) (related: top) - @shadow-host (target: shadow-host) (related: top) - @top (target: shadow-host) (related: top) - - mouseover - @top (target: top) (related: shadow-host) - - mousewheel - @content-parent (target: content-parent) - @shadow-root (target: content-parent) - @shadow-host (target: shadow-host) - @top (target: shadow-host) - - touchstart - @content-parent (target: content-parent) (touches: content-parent) (targetTouches: content-parent) (changedTouches: content-parent) - @shadow-root (target: content-parent) (touches: content-parent) (targetTouches: content-parent) (changedTouches: content-parent) - @shadow-host (target: shadow-host) (touches: shadow-host) (targetTouches: shadow-host) (changedTouches: shadow-host) - @top (target: shadow-host) (touches: shadow-host) (targetTouches: shadow-host) (changedTouches: shadow-host) -PASS successfullyParsed is true - -TEST COMPLETE - -
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadow-dom-event-dispatching-distributed-text-node.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadow-dom-event-dispatching-distributed-text-node.html deleted file mode 100644 index 1d26b6b..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadow-dom-event-dispatching-distributed-text-node.html +++ /dev/null
@@ -1,54 +0,0 @@ -<!DOCTYPE html> -<html> -<head> - <script src="../../../resources/js-test.js"></script> - <script src="../../../resources/gesture-util.js"></script> - <script src="resources/shadow-dom.js"></script> - <script src="resources/event-dispatching.js"></script> -</head> -<body onload="runTest();"> - <p id="description"></p> - <div id="sandbox"></div> - <pre id="console"></pre> - <script> - jsTestIsAsync = true; - - async function runTest() { - var sandbox = document.getElementById('sandbox'); - - // Makes sure the parent of the insertion point can receive an event when a distributed text node is clicked. - sandbox.appendChild( - createDOM('div', {'id': 'top'}, - createDOM('div', {'id': 'shadow-host'}, - createShadowRoot({'id': 'shadow-root'}, - createDOM('div', {'id': 'content-parent'}, - createDOM('content', {'id': 'content'}))), - document.createTextNode('Text Node')))); - addEventListeners(['top', 'shadow-host', 'shadow-host/', 'shadow-host/content-parent', 'shadow-host/content']); - showSandboxTree(); - - // Calculates the position of the text node. - var host = document.getElementById('shadow-host'); - var x = host.offsetLeft + 5; - var y = host.offsetTop + defaultPaddingSize + 5; - debug('\n' + 'Moving mouse from a distributed text node to top'); - eventSender.mouseMoveTo(x, y); - clearEventRecords(); - - moveMouseOver(document.getElementById('top')); - debugDispatchedEvent('mouseout'); - debugDispatchedEvent('mouseover'); - - clearEventRecords(); - var host_center = elementCenter(host); - await wheelTick(0, 1, host_center); - debugDispatchedEvent('mousewheel'); - - clearEventRecords(); - touchLocation(host); - debugDispatchedEvent('touchstart'); - finishJSTest(); - } - </script> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadow-dom-event-dispatching-fallback-nodes-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadow-dom-event-dispatching-fallback-nodes-expected.txt deleted file mode 100644 index 2f03ba3..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadow-dom-event-dispatching-fallback-nodes-expected.txt +++ /dev/null
@@ -1,42 +0,0 @@ -CONSOLE WARNING: line 87: Element.createShadowRoot is deprecated and will be removed in M80, around February 2020. Please use Element.attachShadow instead. See https://www.chromestatus.com/features/4507242028072960 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. - - -Flat Tree will be: -DIV id=sandbox - DIV id=top - DIV id=A - DIV id=used-fallback - DIV id=B - - -Moving mouse from A/used-fallback to A - - mouseout - @used-fallback (target: used-fallback) (related: A) - @content1 (target: used-fallback) (related: A) - @shadow-root (target: used-fallback) (related: A) - - mouseover - -Moving mouse from A to A/used-fallback - - mouseout - - mouseover - @used-fallback (target: used-fallback) (related: A) - @content1 (target: used-fallback) (related: A) - @shadow-root (target: used-fallback) (related: A) - -Click non-used-fallback node - - click - @non-used-fallback (target: non-used-fallback) - @content2 (target: non-used-fallback) - @shadow-root (target: non-used-fallback) - @A (target: A) - @top (target: A) -PASS successfullyParsed is true - -TEST COMPLETE - -
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadow-dom-event-dispatching-fallback-nodes.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadow-dom-event-dispatching-fallback-nodes.html deleted file mode 100644 index 14cfc25..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadow-dom-event-dispatching-fallback-nodes.html +++ /dev/null
@@ -1,37 +0,0 @@ -<!DOCTYPE html> -<html> -<head> - <script src="../../../resources/js-test.js"></script> - <script src="resources/shadow-dom.js"></script> - <script src="resources/event-dispatching.js"></script> -</head> -<body> - <p id="description"></p> - <div id="sandbox"></div> - <pre id="console"></pre> - <script> - var sandbox = document.getElementById('sandbox'); - - sandbox.appendChild( - createDOM('div', {'id': 'top'}, - createDOM('div', {'id': 'A'}, - createShadowRoot({'id': 'shadow-root'}, - createDOM('content', {'id': 'content1', 'select': '#none'}, - createDOM('div', {'id': 'used-fallback'})), - createDOM('content', {'id': 'content2'}, - createDOM('div', {'id': 'non-used-fallback'}))), - createDOM('div', {'id': 'B'})))); - - addEventListeners(['top', 'A', 'B', 'A/', 'A/content1', 'A/used-fallback', 'A/content2', 'A/non-used-fallback']); - showSandboxTree(); - - moveMouse('A/used-fallback', 'A'); - moveMouse('A', 'A/used-fallback'); - - clearEventRecords(); - debug('\nClick non-used-fallback node'); - getNodeInComposedTree('A/non-used-fallback').click(); - debugDispatchedEvent('click'); - </script> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadow-dom-event-dispatching-nested-shadow-roots-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadow-dom-event-dispatching-nested-shadow-roots-expected.txt deleted file mode 100644 index bd37d98..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadow-dom-event-dispatching-nested-shadow-roots-expected.txt +++ /dev/null
@@ -1,131 +0,0 @@ -CONSOLE WARNING: line 87: Element.createShadowRoot is deprecated and will be removed in M80, around February 2020. Please use Element.attachShadow instead. See https://www.chromestatus.com/features/4507242028072960 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. - - -Flat Tree will be: -DIV id=sandbox - DIV id=top - DIV id=A - DIV id=B - DIV id=G - DIV id=J - DIV id=C - DIV id=D - DIV id=L - DIV id=E - DIV id=F - - -Moving mouse from F to D - - mouseout - @F (target: F) (related: D) - @E (target: F) (related: D) - @I (target: F) (related: D) - @M (target: F) (related: D) - @O (target: F) (related: D) - @shadow-root-L (target: F) (related: D) - @L (target: F) (related: D) - @shadow-root-G (target: F) (related: D) - @G (target: F) (related: D) - @shadow-root-B (target: F) (related: D) - @B (target: F) (related: D) - @A (target: F) (related: D) - @top (target: F) (related: D) - - mouseover - @D (target: D) (related: F) - @C (target: D) (related: F) - @H (target: D) (related: F) - @K (target: D) (related: F) - @N (target: D) (related: F) - @shadow-root-J (target: D) (related: F) - @J (target: D) (related: F) - @shadow-root-G (target: D) (related: F) - @G (target: D) (related: F) - @shadow-root-B (target: D) (related: F) - @B (target: D) (related: F) - @A (target: D) (related: F) - @top (target: D) (related: F) - -Moving mouse from B/G/L to D - - mouseout - @L (target: L) (related: D) - @shadow-root-G (target: L) (related: D) - @G (target: G) (related: D) - @shadow-root-B (target: G) (related: D) - @B (target: B) (related: D) - @A (target: B) (related: D) - @top (target: B) (related: D) - - mouseover - @D (target: D) (related: B) - @C (target: D) (related: B) - @H (target: D) (related: G) - @K (target: D) (related: L) - @N (target: D) (related: L) - @shadow-root-J (target: D) (related: L) - @J (target: D) (related: L) - @shadow-root-G (target: D) (related: L) - @G (target: D) (related: G) - @shadow-root-B (target: D) (related: G) - @B (target: D) (related: B) - @A (target: D) (related: B) - @top (target: D) (related: B) - -Moving mouse from B/G/L to B/G/J - - mouseout - @L (target: L) (related: J) - @shadow-root-G (target: L) (related: J) - - mouseover - @J (target: J) (related: L) - @shadow-root-G (target: J) (related: L) - -Moving mouse from A to D - - mouseout - @A (target: A) (related: D) - @top (target: A) (related: D) - - mouseover - @D (target: D) (related: A) - @C (target: D) (related: A) - @H (target: D) (related: A) - @K (target: D) (related: A) - @N (target: D) (related: A) - @shadow-root-J (target: D) (related: A) - @J (target: D) (related: A) - @shadow-root-G (target: D) (related: A) - @G (target: D) (related: A) - @shadow-root-B (target: D) (related: A) - @B (target: D) (related: A) - @A (target: D) (related: A) - @top (target: D) (related: A) - -Moving mouse from D to A - - mouseout - @D (target: D) (related: A) - @C (target: D) (related: A) - @H (target: D) (related: A) - @K (target: D) (related: A) - @N (target: D) (related: A) - @shadow-root-J (target: D) (related: A) - @J (target: D) (related: A) - @shadow-root-G (target: D) (related: A) - @G (target: D) (related: A) - @shadow-root-B (target: D) (related: A) - @B (target: D) (related: A) - @A (target: D) (related: A) - @top (target: D) (related: A) - - mouseover - @A (target: A) (related: D) - @top (target: A) (related: D) -PASS successfullyParsed is true - -TEST COMPLETE - -
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadow-dom-event-dispatching-nested-shadow-roots.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadow-dom-event-dispatching-nested-shadow-roots.html deleted file mode 100644 index a239ca1..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadow-dom-event-dispatching-nested-shadow-roots.html +++ /dev/null
@@ -1,48 +0,0 @@ -<!DOCTYPE html> -<html> -<head> - <script src="../../../resources/js-test.js"></script> - <script src="resources/shadow-dom.js"></script> - <script src="resources/event-dispatching.js"></script> -</head> -<body> - <p id="description"></p> - <div id="sandbox"></div> - <pre id="console"></pre> - <script> - var sandbox = document.getElementById('sandbox'); - - sandbox.appendChild( - createDOM('div', {'id': 'top'}, - createDOM('div', {'id': 'A'}, - createDOM('div', {'id': 'B'}, - createShadowRoot({'id': 'shadow-root-B'}, - createDOM('div', {'id': 'G'}, - createShadowRoot({'id': 'shadow-root-G'}, - createDOM('div', {'id': 'J'}, - createShadowRoot({'id': 'shadow-root-J'}, - createDOM('content', {'id': 'N', 'select': '#C'})), - createDOM('content', {'id': 'K', 'select': '#C'})), - createDOM('div', {'id': 'L'}, - createShadowRoot({'id': 'shadow-root-L'}, - createDOM('content', {'id': 'O', 'select': '#E'})), - createDOM('content', {'id': 'M', 'select': '#E'}))), - createDOM('content', {'id': 'H', 'select': '#C'}), - createDOM('content', {'id': 'I', 'select': '#E'}))), - createDOM('div', {'id': 'C'}, - createDOM('div', {'id': 'D'})), - createDOM('div', {'id': 'E'}, - createDOM('div', {'id': 'F'})))))); - - addEventListeners(['top', 'A', 'B', 'C', 'D', 'E', 'F', 'B/', 'B/G', 'B/H', 'B/I', 'B/G/', 'B/G/J', 'B/G/K', 'B/G/L', 'B/G/M', - 'B/G/J/', 'B/G/J/N', 'B/G/L/', 'B/G/L/O']); - showSandboxTree(); - - moveMouse('F', 'D'); - moveMouse('B/G/L', 'D'); - moveMouse('B/G/L', 'B/G/J'); - moveMouse('A', 'D'); - moveMouse('D', 'A'); - </script> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadow-dom-event-dispatching-svg-in-shadow-subtree-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadow-dom-event-dispatching-svg-in-shadow-subtree-expected.txt deleted file mode 100644 index 4f2813a..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadow-dom-event-dispatching-svg-in-shadow-subtree-expected.txt +++ /dev/null
@@ -1,24 +0,0 @@ -CONSOLE WARNING: line 87: Element.createShadowRoot is deprecated and will be removed in M80, around February 2020. Please use Element.attachShadow instead. See https://www.chromestatus.com/features/4507242028072960 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. - - -Flat Tree will be: -DIV id=sandbox - DIV id=top - DIV id=shadow-host - svg id=svg-in-shadow-tree class=[object SVGAnimatedString] - - -Moving mouse from shadow-host/svg-in-shadow-tree to top - - mouseout - @svg-in-shadow-tree (target: svg-in-shadow-tree) (related: top) - @shadow-root (target: svg-in-shadow-tree) (related: top) - @top (target: shadow-host) (related: top) - - mouseover - @top (target: top) (related: shadow-host) -PASS successfullyParsed is true - -TEST COMPLETE - -
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadow-dom-event-dispatching-svg-in-shadow-subtree.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadow-dom-event-dispatching-svg-in-shadow-subtree.html deleted file mode 100644 index 85965aaf..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadow-dom-event-dispatching-svg-in-shadow-subtree.html +++ /dev/null
@@ -1,29 +0,0 @@ -<!DOCTYPE html> -<html> -<head> - <script src="../../../resources/js-test.js"></script> - <script src="resources/shadow-dom.js"></script> - <script src="resources/event-dispatching.js"></script> -</head> -<body> - <p id="description"></p> - <div id="sandbox"></div> - <pre id="console"></pre> - <script> - var sandbox = document.getElementById('sandbox'); - - sandbox.appendChild( - createDOM('div', {'id': 'top'}, - createDOM('div', {'id': 'shadow-host'}, - createShadowRoot({'id': 'shadow-root'})))); - var svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg'); - svg.id = 'svg-in-shadow-tree'; - getNodeInComposedTree('shadow-host/').appendChild(svg); - - addEventListeners(['top', 'shadow-host/', 'shadow-host/svg-in-shadow-tree']); - showSandboxTree(); - - moveMouse('shadow-host/svg-in-shadow-tree', 'top'); - </script> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadow-element-distributed-nodes-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadow-element-distributed-nodes-expected.txt deleted file mode 100644 index 5c2d898..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadow-element-distributed-nodes-expected.txt +++ /dev/null
@@ -1,27 +0,0 @@ -CONSOLE WARNING: line 87: Element.createShadowRoot is deprecated and will be removed in M80, around February 2020. Please use Element.attachShadow instead. See https://www.chromestatus.com/features/4507242028072960 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -Tests for a shadow element's getDistributedNodes(). - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - - -getDistributedNodes() for "shadow" should return [] -PASS distributedNodes.length is expectedDistributedNodes.length - -getDistributedNodes() for "host/shadow" should return [] -PASS distributedNodes.length is expectedDistributedNodes.length - -getDistributedNodes() for "host/shadow" should return [] -PASS distributedNodes.length is expectedDistributedNodes.length - -getDistributedNodes() for "host/shadow" should return [host-child] -PASS distributedNodes.length is expectedDistributedNodes.length -PASS distributedNodes.item(0) is getNodeInComposedTree(expectedDistributedNodes[0]) - -getDistributedNodes() for "host/shadow" should return [host-child] -PASS distributedNodes.length is expectedDistributedNodes.length -PASS distributedNodes.item(0) is getNodeInComposedTree(expectedDistributedNodes[0]) -PASS successfullyParsed is true - -TEST COMPLETE - -
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadow-element-distributed-nodes.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadow-element-distributed-nodes.html deleted file mode 100644 index cc92ea3..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadow-element-distributed-nodes.html +++ /dev/null
@@ -1,65 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script src="../../../resources/js-test.js"></script> -<script src="resources/shadow-dom.js"></script> -</head> -<body> -<div id='console'></div> -<div id='sandbox'></div> -<script> -description("Tests for a shadow element's getDistributedNodes()."); - -var sandbox = document.getElementById('sandbox'); - -function prepareTree(root) { - sandbox.innerHTML = ''; - sandbox.appendChild(root); -} - -function assertDistributedNodes(insertionPointId, expectedDistributedNodes) { - debug('\ngetDistributedNodes() for "' + insertionPointId + '" should return [' + expectedDistributedNodes + ']'); - var insertionPoint = getNodeInComposedTree(insertionPointId); - var distributedNodes = insertionPoint.getDistributedNodes(); - window.distributedNodes = distributedNodes; - window.expectedDistributedNodes = expectedDistributedNodes; - shouldBe("distributedNodes.length", "expectedDistributedNodes.length"); - for (var i = 0; i < distributedNodes.length && i < expectedDistributedNodes.length; ++i) { - shouldBe("distributedNodes.item(" + i + ")", "getNodeInComposedTree(expectedDistributedNodes[" + i + "])"); - } -} - -prepareTree( - createDOM('shadow', {'id': 'shadow'})); -assertDistributedNodes('shadow', []); - -prepareTree( - createDOM('div', {'id': 'host'}, - createShadowRoot( - createDOM('shadow', {'id': 'shadow'})))); -assertDistributedNodes('host/shadow', []); - -prepareTree( - createDOM('div', {'id': 'host'}, - createShadowRoot( - createDOM('shadow', {'id': 'shadow'}, - createDOM('div', {'id': 'shadow-child'}))))); -assertDistributedNodes('host/shadow', []); - -prepareTree( - createDOM('div', {'id': 'host'}, - createShadowRoot( - createDOM('shadow', {'id': 'shadow'})), - createDOM('div', {'id': 'host-child'}))); -assertDistributedNodes('host/shadow', ['host-child']); - -prepareTree( - createDOM('div', {'id': 'host'}, - createShadowRoot( - createDOM('shadow', {'id': 'shadow'}, - createDOM('div'))), - createDOM('div', {'id': 'host-child'}))); -assertDistributedNodes('host/shadow', ['host-child']); -</script> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadow-element-rendering-single-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadow-element-rendering-single-expected.txt deleted file mode 100644 index c0f74f2..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadow-element-rendering-single-expected.txt +++ /dev/null
@@ -1,11 +0,0 @@ -CONSOLE WARNING: line 27: Element.createShadowRoot is deprecated and will be removed in M80, around February 2020. Please use Element.attachShadow instead. See https://www.chromestatus.com/features/4507242028072960 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -renderingShadowElementDynamicallyAdded -PASS -renderingShadowElementDynamicallyRemoved -PASS -renderingLightChildrenDynamicallyAdded -PASS -renderingLightChildrenDynamicallyRemoved -PASS -TEST COMPLETED -
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadow-element-rendering-single.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadow-element-rendering-single.html deleted file mode 100644 index b60306e2..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadow-element-rendering-single.html +++ /dev/null
@@ -1,121 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<style> -/* relative positioning ensures underlying Layer */ -.container { - position: relative; -} - -.span { - display: boxed-inline; - margin: 2px; - border: solid; -} -</style> -<script src="../resources/shadow-test-driver.js"></script> -<script> -var testFuncs = []; - -testFuncs.push(function renderingShadowElementDynamicallyAdded(callIfDone) { - document.getElementById('expect-container').innerHTML = - "<div><span>BEFORE</span><span>MID</span><span>AFTER</span></div>" - - var root = document.createElement('div'); - root.appendChild(createSpanWithText('AFTER')); - - var sr = root.createShadowRoot(); - sr.appendChild(createSpanWithText('BEFORE')); - sr.appendChild(createSpanWithText('MID')); - - document.getElementById('actual-container').appendChild(root); - - var f = (function(callIfDone, root, sr) { return function() { - var shadow = document.createElement('shadow'); - sr.appendChild(shadow); - callIfDone(); - }})(callIfDone, root, sr); - - setTimeout(f, 0); -}); - -testFuncs.push(function renderingShadowElementDynamicallyRemoved(callIfDone) { - document.getElementById('expect-container').innerHTML = - "<div><span>BEFORE</span><span>AFTER</span></div>" - - var root = document.createElement('div'); - root.appendChild(createSpanWithText('SHOULD NOT BE RENDERED')); - - var shadow = document.createElement('shadow'); - - var sr = root.createShadowRoot(); - sr.appendChild(createSpanWithText('BEFORE')); - sr.appendChild(shadow); - sr.appendChild(createSpanWithText('AFTER')); - - document.getElementById('actual-container').appendChild(root); - - var f = (function(callIfDone, sr, shadow) { return function() { - sr.removeChild(shadow); - callIfDone(); - }})(callIfDone, sr, shadow); - - setTimeout(f, 0); -}); - -testFuncs.push(function renderingLightChildrenDynamicallyAdded(callIfDone) { - document.getElementById('expect-container').innerHTML = - "<div><span>BEFORE</span><span>MID</span><span>AFTER</span></div>" - - var root = document.createElement('div'); - - var sr = root.createShadowRoot(); - sr.appendChild(createSpanWithText('BEFORE')); - var shadow = document.createElement('shadow'); - sr.appendChild(shadow); - sr.appendChild(createSpanWithText('AFTER')); - - document.getElementById('actual-container').appendChild(root); - - var f = (function(callIfDone, root) { return function() { - root.appendChild(createSpanWithText('MID')); - callIfDone(); - }})(callIfDone, root); - - setTimeout(f, 0); -}); - -testFuncs.push(function renderingLightChildrenDynamicallyRemoved(callIfDone) { - document.getElementById('expect-container').innerHTML = - "<div><span>BEFORE</span><span>AFTER</span></div>" - - var root = document.createElement('div'); - root.appendChild(createSpanWithText('SHOULD NOT BE RENDERED')); - - var shadow = document.createElement('shadow'); - - var sr = root.createShadowRoot(); - sr.appendChild(createSpanWithText('BEFORE')); - sr.appendChild(shadow); - sr.appendChild(createSpanWithText('AFTER')); - - document.getElementById('actual-container').appendChild(root); - - var f = (function(callIfDone, root) { return function() { - root.removeChild(root.firstChild); - callIfDone(); - }})(callIfDone, root); - - setTimeout(f, 0); -}); - -</script> -</head> -<body onload="doTest(testFuncs)"> - -<div id="actual-container" class="container"></div> -<div id="expect-container" class="container"></div> -<pre id="console"></pre> - -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadow-insertion-point-rendering-expected.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadow-insertion-point-rendering-expected.html deleted file mode 100644 index e9c2f988..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadow-insertion-point-rendering-expected.html +++ /dev/null
@@ -1,23 +0,0 @@ -<!DOCTYPE html> -<html> -<body> - <div>A shadow element with a content element</div> - <div>before host-child after</div> - - <div>A shadow element without a content element</div> - <div>before host-child after</div> - - <div>A shadow element with a parameter</div> - <div> before host-child after</div> - - <div>An inactive shadow element</div> - <div>before host-child middle<shadow> shadow-child</shadow> after</div> - - <div>A shadow element comes before a content element</div> - <div> before middle host-child after</div> - - <div>A shadow element comes after a content element</div> - <div>before host-child middle after</div> - -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadow-insertion-point-rendering-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadow-insertion-point-rendering-expected.txt deleted file mode 100644 index 6f972e1c..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadow-insertion-point-rendering-expected.txt +++ /dev/null
@@ -1 +0,0 @@ -CONSOLE WARNING: line 87: Element.createShadowRoot is deprecated and will be removed in M80, around February 2020. Please use Element.attachShadow instead. See https://www.chromestatus.com/features/4507242028072960 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details.
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadow-insertion-point-rendering.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadow-insertion-point-rendering.html deleted file mode 100644 index 0d807b3..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadow-insertion-point-rendering.html +++ /dev/null
@@ -1,83 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script src="resources/shadow-dom.js"></script> -</head> -<body> -<script> -function description(text) { - return createDOM("div", {}, - document.createTextNode(text)); -} - -function createSpanWithText(text) { - return createDOM("span", {}, - document.createTextNode(text + " ")); -} - -var testcases = [ - description('A shadow element with a content element'), - createDOM('div', {}, - createSpanWithText("host-child"), - createShadowRoot( - createSpanWithText("before"), - createDOM("shadow", {}, - createDOM("content", {})), - createSpanWithText("after"))), - - description('A shadow element without a content element'), - createDOM('div', {}, - createSpanWithText("host-child"), - createShadowRoot( - createSpanWithText("before"), - createDOM("shadow", {}), - createSpanWithText("after"))), - - description('A shadow element with a parameter'), - createDOM('div', {}, - createSpanWithText("host-child"), - createShadowRoot( - createSpanWithText("before"), - createDOM("shadow", {}, - createSpanWithText("shadow-child")), - createSpanWithText("after"))), - - description('An inactive shadow element'), - createDOM('div', {}, - createSpanWithText("host-child"), - createShadowRoot( - createSpanWithText("before"), - createDOM("shadow", {}, - createDOM("content", {})), - createSpanWithText("middle"), - createDOM("shadow", {}, - createSpanWithText("shadow-child")), - createSpanWithText("after"))), - - description('A shadow element comes before a content element'), - createDOM('div', {}, - createSpanWithText("host-child"), - createShadowRoot( - createSpanWithText("before"), - createDOM("shadow", {}), - createSpanWithText("middle"), - createDOM("content", {}), - createSpanWithText("after"))), - - description('A shadow element comes after a content element'), - createDOM('div', {}, - createSpanWithText("host-child"), - createShadowRoot( - createSpanWithText("before"), - createDOM("content", {}), - createSpanWithText("middle"), - createDOM("shadow", {}, - createDOM("content", {})), - createSpanWithText("after"))), -]; - -testcases.forEach(function(element) { - document.body.appendChild(element); -}); -</script> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadow-root-activeElement-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadow-root-activeElement-expected.txt deleted file mode 100644 index 7069d9c..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadow-root-activeElement-expected.txt +++ /dev/null
@@ -1,28 +0,0 @@ -CONSOLE WARNING: line 87: Element.createShadowRoot is deprecated and will be removed in M80, around February 2020. Please use Element.attachShadow instead. See https://www.chromestatus.com/features/4507242028072960 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -This tests the activeElement property of a ShadowRoot. - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - -PASS shadowRoot1.activeElement is defined. -PASS shadowRoot2.activeElement is defined. -PASS nodeInDocument.focus(); document.activeElement is nodeInDocument -PASS nodeInDocument.focus(); shadowRoot1.activeElement is null -PASS nodeInDocument.focus(); shadowRoot2.activeElement is null -PASS distributedLightChild.focus(); document.activeElement is distributedLightChild -PASS distributedLightChild.focus(); shadowRoot1.activeElement is distributedLightChild -PASS distributedLightChild.focus(); shadowRoot2.activeElement is null -PASS childInShadowRoot1.focus(); document.activeElement is shadowHost1 -PASS childInShadowRoot1.focus(); shadowRoot1.activeElement is childInShadowRoot1 -PASS childInShadowRoot1.focus(); shadowRoot2.activeElement is null -PASS childInShadowRoot2.focus(); document.activeElement is shadowHost1 -PASS childInShadowRoot2.focus(); shadowRoot1.activeElement is shadowHost2 -PASS childInShadowRoot2.focus(); shadowRoot2.activeElement is childInShadowRoot2 -childInShadowRoot2.blur(); -PASS document.activeElement is document.body -PASS shadowRoot1.activeElement is null -PASS shadowRoot2.activeElement is null -PASS successfullyParsed is true - -TEST COMPLETE - -
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadow-root-activeElement.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadow-root-activeElement.html deleted file mode 100644 index 8745fa0..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadow-root-activeElement.html +++ /dev/null
@@ -1,66 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script src="../../../resources/js-test.js"></script> -<script src="resources/shadow-dom.js"></script> -</head> -<body> -<div id="console"></div> -<div id="sandbox"> -</div> -<script> -description("This tests the activeElement property of a ShadowRoot."); - -if (!window.internals) - debug('This test runs on DRT only'); - -document.getElementById('sandbox').appendChild( - createDOM('div', {}, - createDOM('div', {'id': 'node-in-document', 'tabindex': 1}), - createDOM('div', {'id': 'shadow-host-1'}, - createShadowRoot( - createDOM('div', {'id': 'shadow-host-2'}, - createShadowRoot( - createDOM('div', {'id': 'child-in-shadow-root-2', 'tabindex': 1}))), - createDOM('div', {'id': 'child-in-shadow-root-1', 'tabindex': 1}), - createDOM('content', {'select': '#distributed-light-child'})), - createDOM('div', {'id': 'distributed-light-child', 'tabindex': 1})))); - -var shadowHost1 = getNodeInComposedTree('shadow-host-1'); -var shadowHost2 = getNodeInComposedTree('shadow-host-1/shadow-host-2'); -var shadowRoot1 = getNodeInComposedTree('shadow-host-1/'); -var shadowRoot2 = getNodeInComposedTree('shadow-host-1/shadow-host-2/'); - -var nodeInDocument = document.getElementById('node-in-document'); -var distributedLightChild = document.getElementById('distributed-light-child'); -var childInShadowRoot1 = getNodeInComposedTree('shadow-host-1/child-in-shadow-root-1'); -var childInShadowRoot2 = getNodeInComposedTree('shadow-host-1/shadow-host-2/child-in-shadow-root-2'); - -shouldBeDefined("shadowRoot1.activeElement"); -shouldBeDefined("shadowRoot2.activeElement"); - -shouldBe("nodeInDocument.focus(); document.activeElement", "nodeInDocument"); -shouldBe("nodeInDocument.focus(); shadowRoot1.activeElement", "null"); -shouldBe("nodeInDocument.focus(); shadowRoot2.activeElement", "null"); - -shouldBe("distributedLightChild.focus(); document.activeElement", "distributedLightChild"); -shouldBe("distributedLightChild.focus(); shadowRoot1.activeElement", "distributedLightChild"); -shouldBe("distributedLightChild.focus(); shadowRoot2.activeElement", "null"); - -shouldBe("childInShadowRoot1.focus(); document.activeElement", "shadowHost1"); -shouldBe("childInShadowRoot1.focus(); shadowRoot1.activeElement", "childInShadowRoot1"); -shouldBe("childInShadowRoot1.focus(); shadowRoot2.activeElement", "null"); - -shouldBe("childInShadowRoot2.focus(); document.activeElement", "shadowHost1"); -shouldBe("childInShadowRoot2.focus(); shadowRoot1.activeElement", "shadowHost2"); -shouldBe("childInShadowRoot2.focus(); shadowRoot2.activeElement", "childInShadowRoot2"); - -evalAndLog("childInShadowRoot2.blur();"); -shouldBe("document.activeElement", "document.body"); -shouldBe("shadowRoot1.activeElement", "null"); -shouldBe("shadowRoot2.activeElement", "null"); - -var successfullyParsed = true; -</script> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadowdom-for-button-complex-shadow-expected.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadowdom-for-button-complex-shadow-expected.html deleted file mode 100644 index 3f621f4..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadowdom-for-button-complex-shadow-expected.html +++ /dev/null
@@ -1,11 +0,0 @@ -<!DOCTYPE html> -<html> -<body> - -<p>A mixed case of a shadow element and content element.</p> -<form> - <button><span>button 2</span>button 1</button> -</form> - -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadowdom-for-button-complex-shadow-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadowdom-for-button-complex-shadow-expected.txt deleted file mode 100644 index 572d65f..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadowdom-for-button-complex-shadow-expected.txt +++ /dev/null
@@ -1 +0,0 @@ -CONSOLE WARNING: line 12: Element.createShadowRoot is deprecated and will be removed in M80, around February 2020. Please use Element.attachShadow instead. See https://www.chromestatus.com/features/4507242028072960 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details.
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadowdom-for-button-complex-shadow.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadowdom-for-button-complex-shadow.html deleted file mode 100644 index 53327eb..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadowdom-for-button-complex-shadow.html +++ /dev/null
@@ -1,17 +0,0 @@ -<!DOCTYPE html> -<html> -<body> - -<p>A mixed case of a shadow element and content element.</p> -<form> - <button id="host">button 1<span>button 2</span></button> -</form> - -<script> -var host = document.getElementById('host'); -var shadowRoot = host.createShadowRoot(); -shadowRoot.innerHTML = '<div><content select="span"></content><shadow></shadow></div>' -</script> - -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadowdom-for-button-only-shadow-expected.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadowdom-for-button-only-shadow-expected.html deleted file mode 100644 index 5ecf60e..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadowdom-for-button-only-shadow-expected.html +++ /dev/null
@@ -1,11 +0,0 @@ -<!DOCTYPE html> -<html> -<body> - -<p>When the AuthorShadowDOM has only a shadow element, this should be rendered like no Shadow DOM is added.</p> -<form> - <button>button</button> -</form> - -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadowdom-for-button-only-shadow-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadowdom-for-button-only-shadow-expected.txt deleted file mode 100644 index 572d65f..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadowdom-for-button-only-shadow-expected.txt +++ /dev/null
@@ -1 +0,0 @@ -CONSOLE WARNING: line 12: Element.createShadowRoot is deprecated and will be removed in M80, around February 2020. Please use Element.attachShadow instead. See https://www.chromestatus.com/features/4507242028072960 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details.
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadowdom-for-button-only-shadow.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadowdom-for-button-only-shadow.html deleted file mode 100644 index c0076e3..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadowdom-for-button-only-shadow.html +++ /dev/null
@@ -1,16 +0,0 @@ -<!DOCTYPE html> -<html> -<body> - -<p>When the AuthorShadowDOM has only a shadow element, this should be rendered like no Shadow DOM is added.</p> -<form> - <button id="host">button</button> -</form> - -<script> -var host = document.getElementById('host'); -var shadowRoot = host.createShadowRoot(); -shadowRoot.innerHTML = "<shadow></shadow>" -</script> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadowdom-for-button-without-shadow-expected.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadowdom-for-button-without-shadow-expected.html deleted file mode 100644 index a84e177..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadowdom-for-button-without-shadow-expected.html +++ /dev/null
@@ -1,11 +0,0 @@ -<!DOCTYPE html> -<html> -<body> - -<p>When the AuthorShadowDOM does not have a shadow element, the content should not be rendered.</p> -<form> - <button></button> -</form> - -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadowdom-for-button-without-shadow-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadowdom-for-button-without-shadow-expected.txt deleted file mode 100644 index 572d65f..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadowdom-for-button-without-shadow-expected.txt +++ /dev/null
@@ -1 +0,0 @@ -CONSOLE WARNING: line 12: Element.createShadowRoot is deprecated and will be removed in M80, around February 2020. Please use Element.attachShadow instead. See https://www.chromestatus.com/features/4507242028072960 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details.
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadowdom-for-button-without-shadow.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadowdom-for-button-without-shadow.html deleted file mode 100644 index ca5cce93..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadowdom-for-button-without-shadow.html +++ /dev/null
@@ -1,16 +0,0 @@ -<!DOCTYPE html> -<html> -<body> - -<p>When the AuthorShadowDOM does not have a shadow element, the content should not be rendered.</p> -<form> - <button id="host">something</button> -</form> - -<script> -var host = document.getElementById('host'); -var shadowRoot = host.createShadowRoot(); -</script> - -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadowdom-for-unknown-with-form-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadowdom-for-unknown-with-form-expected.txt deleted file mode 100644 index c95a51f..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadowdom-for-unknown-with-form-expected.txt +++ /dev/null
@@ -1,2 +0,0 @@ -CONSOLE WARNING: line 4: Element.createShadowRoot is deprecated and will be removed in M80, around February 2020. Please use Element.attachShadow instead. See https://www.chromestatus.com/features/4507242028072960 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -PASS if not crashed.
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadowdom-for-unknown-with-form.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadowdom-for-unknown-with-form.html deleted file mode 100644 index 1cd0248..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadowdom-for-unknown-with-form.html +++ /dev/null
@@ -1,8 +0,0 @@ -<foo id=tCF5><table><form id=tCF87><script> -if (window.testRunner) - testRunner.dumpAsText(); -tCF5.createShadowRoot().appendChild(tCF87); -window.onload = function() { - document.body.innerHTML = 'PASS if not crashed.'; -}; -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadowdom-reprojection-1-expected.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadowdom-reprojection-1-expected.html deleted file mode 100644 index 84802c1a..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadowdom-reprojection-1-expected.html +++ /dev/null
@@ -1,12 +0,0 @@ -<!DOCTYPE html> -<html> -<body> - -<div> - <div> - <div>a-1</div> - </div> -</div> - -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadowdom-reprojection-1-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadowdom-reprojection-1-expected.txt deleted file mode 100644 index 6f972e1c..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadowdom-reprojection-1-expected.txt +++ /dev/null
@@ -1 +0,0 @@ -CONSOLE WARNING: line 87: Element.createShadowRoot is deprecated and will be removed in M80, around February 2020. Please use Element.attachShadow instead. See https://www.chromestatus.com/features/4507242028072960 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details.
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadowdom-reprojection-1.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadowdom-reprojection-1.html deleted file mode 100644 index df94d3e..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadowdom-reprojection-1.html +++ /dev/null
@@ -1,21 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script src="resources/shadow-dom.js"></script> -</head> -<body> -<script> -function text(contents) { - return document.createTextNode(contents); -} -document.body.appendChild( - createDOM('div', {}, - createShadowRoot({}, - createDOM('div', {}, - createShadowRoot({}, - createDOM('content', {'select': '#a-1'})), - createDOM('content', {'select': '#a-1'}))), - createDOM('div', {'id': 'a-1'}, text('a-1')))); -</script> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadowdom-reprojection-2-expected.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadowdom-reprojection-2-expected.html deleted file mode 100644 index 84002e8..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadowdom-reprojection-2-expected.html +++ /dev/null
@@ -1,34 +0,0 @@ -<!DOCTYPE html> -<html> -<body> - -<div> - <div> - <div>b-1</div> - <div>b-2</div> - </div> -</div> - -<div> - <div>c-1</div> - <div> - <div>c-2</div> - </div> -</div> - -<div> - <div> - <div>d-child-1</div> - <div> - <div>d-2</div> - <div>d-child-2</div> - <div>d-4</div> - <div>d-3</div> - </div> - <div>d-5</div> - <div>d-1</div> - </div> -</div> - -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadowdom-reprojection-2-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadowdom-reprojection-2-expected.txt deleted file mode 100644 index 6f972e1c..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadowdom-reprojection-2-expected.txt +++ /dev/null
@@ -1 +0,0 @@ -CONSOLE WARNING: line 87: Element.createShadowRoot is deprecated and will be removed in M80, around February 2020. Please use Element.attachShadow instead. See https://www.chromestatus.com/features/4507242028072960 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details.
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadowdom-reprojection-2.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadowdom-reprojection-2.html deleted file mode 100644 index c8743ea..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadowdom-reprojection-2.html +++ /dev/null
@@ -1,67 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script src="resources/shadow-dom.js"></script> -</head> -<body> -<script> -function text(contents) { - return document.createTextNode(contents); -} - -// Test for a content element which is selected by another content element. -document.body.appendChild( - createDOM('div', {}, - createShadowRoot({}, - createDOM('div', {}, - createShadowRoot({}, - createDOM('content', {'select': '#b-content'}), - createDOM('div', {}, text('b-1')), - createDOM('content', {'select': '#b-2'})), - createDOM('content', {'id': 'b-content', 'select': '#b-2'}, - createDOM('div', {}, text('should-not-be-used'))), - createDOM('div', {}, text('should-not-be-used')))), - createDOM('div', {'id': 'b-2'}, text('b-2')))); - -// debug('Test for a reprojection. Content elements should be used in document order.'); -document.body.appendChild( - createDOM('div', {}, - createShadowRoot({}, - createDOM('content', {'select': '#c-1'}), - createDOM('div', {}, - createShadowRoot({}, - createDOM('content', {'select': '.child'})), - createDOM('content', {'select': '.child'}))), - createDOM('div', {'id': 'c-1', 'class': 'child'}, text('c-1')), - createDOM('div', {'id': 'c-2', 'class': 'child'}, text('c-2')))); - -// debug('Test for complex re-projections.'); -document.body.appendChild( - createDOM('div', {}, - createShadowRoot({}, - createDOM('div', {}, - createShadowRoot({}, - // Select #d-child-1, div, d-5 - createDOM('content', {'select': '.foo'}), - createDOM('div', {}, text('d-1'))), - // Select #d-child-1 - createDOM('content', {'select': '#d-child-1'}, - createDOM('div', {}, text('Should not be used')), - createDOM('content', {'select': '.foo'}, text('Should not select any nodes. This is inactive.'))), - createDOM('div', {'class': 'foo'}, - createShadowRoot({}, - createDOM('div', {}, text('d-2')), - // Select #d-child-2 and #d-4. - createDOM('content', {'select': '.foo'}), - createDOM('div', {}, text('d-3'))), - // Select #d-child-2 - createDOM('content', {'select': '#d-child-2'}), - createDOM('div', {'id': 'd-4', 'class': 'foo'}, text('d-4'))), - createDOM('div', {}, text('Should not be selected')), - createDOM('div', {'class': 'foo'}, text('d-5')))), - createDOM('div', {'id': 'd-child-1', 'class': 'foo'}, text('d-child-1')), - createDOM('div', {'class': 'foo'}, text('should-not-be-selected')), - createDOM('div', {'id': 'd-child-2', 'class': 'foo'}, text('d-child-2')))); -</script> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadowroot-of-insertionpoint-expected.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadowroot-of-insertionpoint-expected.html deleted file mode 100644 index 0cdfc0c..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadowroot-of-insertionpoint-expected.html +++ /dev/null
@@ -1,12 +0,0 @@ -<!DOCTYPE html> - -<html> - -<p>ShadowRoot for InsertionPoint should not be rendered if the InsertionPoint is active, while it should be rendered if not active.</p> - -<div id="host"><div> - <div>host children</div> - <content><div>For Inactive content</div></content> -</div></div> - -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadowroot-of-insertionpoint-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadowroot-of-insertionpoint-expected.txt deleted file mode 100644 index 572d65f..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadowroot-of-insertionpoint-expected.txt +++ /dev/null
@@ -1 +0,0 @@ -CONSOLE WARNING: line 12: Element.createShadowRoot is deprecated and will be removed in M80, around February 2020. Please use Element.attachShadow instead. See https://www.chromestatus.com/features/4507242028072960 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details.
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadowroot-of-insertionpoint.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadowroot-of-insertionpoint.html deleted file mode 100644 index f00f412..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadowroot-of-insertionpoint.html +++ /dev/null
@@ -1,28 +0,0 @@ -<!DOCTYPE html> - -<html> - -<p>ShadowRoot for InsertionPoint should not be rendered if the InsertionPoint is active, while it should be rendered if not active.</p> - -<div id="host"> - <div>host children</div> -</div> - -<script> -var shadowRoot = host.createShadowRoot(); -shadowRoot.innerHTML = - '<div>' + - '<content id="active-content" select="div"><div>fallback</div></content>' + - '<content select="span"><content id="inactive-content"></content></content>' + - '</div>'; - -var activeContent = shadowRoot.getElementById('active-content'); -var shadowRootForActiveContent = activeContent.createShadowRoot(); -shadowRootForActiveContent.innerHTML = '<div>For active content</div>'; - -var inactiveContent = shadowRoot.getElementById('inactive-content'); -var shadowRootForInactiveContent = inactiveContent.createShadowRoot(); -shadowRootForInactiveContent.innerHTML = '<div>For Inactive content</div>'; -</script> - -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadowroot-type-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadowroot-type-expected.txt deleted file mode 100644 index 2483f0b..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadowroot-type-expected.txt +++ /dev/null
@@ -1,11 +0,0 @@ -CONSOLE WARNING: line 15: Element.createShadowRoot is deprecated and will be removed in M80, around February 2020. Please use Element.attachShadow instead. See https://www.chromestatus.com/features/4507242028072960 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -This test ensures ShadowRootType is correctly reflected - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - -PASS "V0ShadowRoot" is internals.shadowRootType(shadowRootForDiv) -PASS "UserAgentShadowRoot" is internals.shadowRootType(shadowRootForInput) -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadowroot-type.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadowroot-type.html deleted file mode 100644 index 0e402ed..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/shadowroot-type.html +++ /dev/null
@@ -1,26 +0,0 @@ -<!DOCTYPE html> -<html> -<body> -<script src="../../../resources/js-test.js"></script> - -<div id="container"> - <div id="host"></div> - <input id="input" type="text"> -</div> -<pre id="console"></pre> - -<script> -description("This test ensures ShadowRootType is correctly reflected"); - -var shadowRootForDiv = host.createShadowRoot(); -var shadowRootForInput = internals.shadowRoot(input); - -shouldBe('"V0ShadowRoot"', 'internals.shadowRootType(shadowRootForDiv)'); -shouldBe('"UserAgentShadowRoot"', 'internals.shadowRootType(shadowRootForInput)'); - -container.innerHTML = ""; - -finishJSTest(); -</script> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/style-of-distributed-node-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/style-of-distributed-node-expected.txt deleted file mode 100644 index bfb356f3..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/style-of-distributed-node-expected.txt +++ /dev/null
@@ -1,19 +0,0 @@ -CONSOLE WARNING: line 27: Element.createShadowRoot is deprecated and will be removed in M80, around February 2020. Please use Element.attachShadow instead. See https://www.chromestatus.com/features/4507242028072960 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -Tests to ensure that styles of distributed nodes are different if their parent styles are different. - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - - - - - -PASS getColorProperty("child-a") is "rgb(255, 0, 0)" -PASS getColorProperty("child-b") is "rgb(0, 0, 255)" - - - - -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/style-of-distributed-node.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/style-of-distributed-node.html deleted file mode 100644 index 3727019..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/style-of-distributed-node.html +++ /dev/null
@@ -1,36 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script src="../../../resources/js-test.js"></script> -<script> -function getColorProperty(id) { - return window.getComputedStyle(document.getElementById(id)).color; -} - -function log(message) { - var console = document.getElementById('console'); - console.innerHTML += message + '\n'; -} -</script> -</head> -<body> -<pre id="console"></div> -<div id="test"> - <div id="host" style="color: red"> - <div id="child-a"></div> - <div id="child-b"></div> - </div> -</div> -<script> -description("Tests to ensure that styles of distributed nodes are different if their parent styles are different."); - -var sr = document.getElementById("host").createShadowRoot(); -sr.innerHTML = '<content select="#child-a"></content><div style="color: blue"><content select="#child-b"></content></div>'; - -shouldBe('getColorProperty("child-a")', '"rgb(255, 0, 0)"'); -shouldBe('getColorProperty("child-b")', '"rgb(0, 0, 255)"'); - -document.getElementById("test").innerHTML = ''; -</script> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/style-sharing-with-content-and-host-expected.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/style-sharing-with-content-and-host-expected.html deleted file mode 100644 index 73800ef..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/style-sharing-with-content-and-host-expected.html +++ /dev/null
@@ -1,12 +0,0 @@ -<!DOCTYPE html> -<html> -<body> -<div> - <header> - <h1>I should be plain</h1> - </header> - <header style="color:green;"> - <h1>I should be red w/ a gray background</h1> - </header> -</div> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/style-sharing-with-content-and-host-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/style-sharing-with-content-and-host-expected.txt deleted file mode 100644 index f551a8c..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/style-sharing-with-content-and-host-expected.txt +++ /dev/null
@@ -1 +0,0 @@ -CONSOLE WARNING: line 14: Element.createShadowRoot is deprecated and will be removed in M80, around February 2020. Please use Element.attachShadow instead. See https://www.chromestatus.com/features/4507242028072960 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details.
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/style-sharing-with-content-and-host.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/style-sharing-with-content-and-host.html deleted file mode 100644 index 1e97f15b..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/style-sharing-with-content-and-host.html +++ /dev/null
@@ -1,18 +0,0 @@ -<!DOCTYPE html> -<html> -<body> -<div> - <header> - <h1>I should be plain</h1> - </header> - <header selected> - <h1>I should be red w/ a gray background</h1> - </header> -</div> - -<script> -var root = document.querySelector('div').createShadowRoot(); -root.innerHTML = '<style>:host content::content [selected] { color: green; }</style><content></content>'; -</script> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/svg-style-in-shadow-tree-crash-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/svg-style-in-shadow-tree-crash-expected.txt deleted file mode 100644 index 7ef22e9..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/svg-style-in-shadow-tree-crash-expected.txt +++ /dev/null
@@ -1 +0,0 @@ -PASS
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/svg-style-in-shadow-tree-crash.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/svg-style-in-shadow-tree-crash.html deleted file mode 100644 index 0c2de89..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/svg-style-in-shadow-tree-crash.html +++ /dev/null
@@ -1,42 +0,0 @@ -<!DOCTYPE html> -<head> -<script> -var match = /([0-9]+)/g.exec(window.location.hash); -var count = 0; -if (match) - count = match[0]; - -var continueTest = true; -if (count == 10) - continueTest = false; - -if (window.testRunner) { - testRunner.dumpAsText(); - if (continueTest) - testRunner.waitUntilDone(); -} - -function runTest() { - document.body.querySelector('iframe').src = 'data:text/html,<body>PASS</body>'; - document.body.offsetLeft; -} - -onload = function() { - runTest(); - if (continueTest) { - window.setTimeout(function() { - count++; - window.location.hash = '#run' + count; - window.location.reload(); - }, 10); - } else { - document.body.innerHTML = 'PASS'; - if (window.testRunner) - testRunner.notifyDone(); - } -}; -</script> -</head> -<body> -<iframe src='resources/svg-style-in-shadow-tree-crash-1.html'></iframe> -</body>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/svg-style-in-shadow-tree-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/svg-style-in-shadow-tree-expected.txt deleted file mode 100644 index 4b3319a..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/svg-style-in-shadow-tree-expected.txt +++ /dev/null
@@ -1,2 +0,0 @@ -CONSOLE WARNING: line 19: document.registerElement is deprecated and will be removed in M80, around February 2020. Please use window.customElements.define instead. See https://www.chromestatus.com/features/4642138092470272 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -CONSOLE WARNING: line 24: Element.createShadowRoot is deprecated and will be removed in M80, around February 2020. Please use Element.attachShadow instead. See https://www.chromestatus.com/features/4507242028072960 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details.
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/svg-style-in-shadow-tree-expected.xhtml b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/svg-style-in-shadow-tree-expected.xhtml deleted file mode 100644 index da349dd..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/svg-style-in-shadow-tree-expected.xhtml +++ /dev/null
@@ -1,11 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"> -<body> -<div id='container'> -<svg id="svg" xmlns="http://www.w3.org/2000/svg" width="200" height="200" viewBox="0 0 200 200"> - <rect id="red" x="0" y="0" width="200" height="200" fill="red"/> - <rect id="blue" x="0" y="0" width="100" height="100" fill="blue"/> -</svg> -</div> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/svg-style-in-shadow-tree.xhtml b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/svg-style-in-shadow-tree.xhtml deleted file mode 100644 index 6a84e22..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/svg-style-in-shadow-tree.xhtml +++ /dev/null
@@ -1,33 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml"> -<head> -<style> -rect { - fill: red; -}; -</style> -</head> -<body> -<div id='container'> -<svg id="svg" xmlns="http://www.w3.org/2000/svg" width="200" height="200" viewBox="0 0 200 200"> - <rect x="0" y="0" width="200" height="200"></rect> - <g is="x-rect"></g> -</svg> -</div> -<script type="text/javascript"> -<![CDATA[ -document.registerElement("x-rect", { - extends: "g", - prototype: { - __proto__: SVGRectElement.prototype, - createdCallback: function() { - this.createShadowRoot(); - this.shadowRoot.innerHTML = - '<style>rect { fill: blue; }</style><rect width="100" height="100" x="0" y="0"></rect>'; - } - } -}); -]]> -</script> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/tab-order-iframe-and-shadow-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/tab-order-iframe-and-shadow-expected.txt deleted file mode 100644 index 872a3e5..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/tab-order-iframe-and-shadow-expected.txt +++ /dev/null
@@ -1,62 +0,0 @@ -CONSOLE WARNING: line 28: Element.createShadowRoot is deprecated and will be removed in M80, around February 2020. Please use Element.attachShadow instead. See https://www.chromestatus.com/features/4507242028072960 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -This tests that pressing Tab key should traverse into iframe and shadow tree, and pressing Shift-Tab should reverse the order. - -Should move from input-01 to input-13 in forward -PASS -Should move from input-13 to input-15 in forward -PASS -Should move from input-15 to input-02 in forward -PASS -Should move from input-02 to host-01/input-03 in forward -PASS -Should move from host-01/input-03 to input-04 in forward -PASS -Should move from input-04 to iframe/input-06 in forward -PASS -Should move from iframe/input-06 to iframe/host-02 in forward -PASS -Should move from iframe/host-02 to iframe/host-02/input-09 in forward -PASS -Should move from iframe/host-02/input-09 to iframe/host-02/input-08 in forward -PASS -Should move from iframe/host-02/input-08 to iframe/input-12 in forward -PASS -Should move from iframe/input-12 to iframe/input-11 in forward -PASS -Should move from iframe/input-11 to iframe/input-05 in forward -PASS -Should move from iframe/input-05 to input-14 in forward -PASS -Should move from input-14 to iframe/input-05 in backward -PASS -Should move from iframe/input-05 to iframe/input-11 in backward -PASS -Should move from iframe/input-11 to iframe/input-12 in backward -PASS -Should move from iframe/input-12 to iframe/host-02/input-08 in backward -PASS -Should move from iframe/host-02/input-08 to iframe/host-02/input-09 in backward -PASS -Should move from iframe/host-02/input-09 to iframe/host-02 in backward -PASS -Should move from iframe/host-02 to iframe/input-06 in backward -PASS -Should move from iframe/input-06 to input-04 in backward -PASS -Should move from input-04 to host-01/input-03 in backward -PASS -Should move from host-01/input-03 to input-02 in backward -PASS -Should move from input-02 to input-15 in backward -PASS -Should move from input-15 to input-13 in backward -PASS -Should move from input-13 to input-01 in backward -PASS - -Test finished. -PASS successfullyParsed is true - -TEST COMPLETE - -
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/tab-order-iframe-and-shadow.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/tab-order-iframe-and-shadow.html deleted file mode 100644 index 5d3da12..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/tab-order-iframe-and-shadow.html +++ /dev/null
@@ -1,105 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script src="../../../resources/js-test.js"></script> -<script src="resources/shadow-dom.js"></script> -</head> -<body> -<p>This tests that pressing Tab key should traverse into iframe and shadow tree, and pressing Shift-Tab should reverse the order.</p> -<pre id="console"></pre> -<script> -function createTextInputElement(doc, id, tabIndex) { - var input = doc.createElement('input'); - input.type = 'text'; - input.id = id; - input.tabIndex = tabIndex; - return input; -} - -var doc = document; - -doc.body.appendChild(createTextInputElement(doc, 'input-01', 1)); -doc.body.appendChild(createTextInputElement(doc, 'input-02', 0)); - -function addShadowHost(doc) { - var shadowHost = doc.createElement('p'); - shadowHost.id = 'host-01'; - shadowHost.tabIndex = -1; - var shadow = shadowHost.createShadowRoot(); - doc.body.appendChild(shadowHost); - shadow.appendChild(createTextInputElement(doc, 'input-03', 0)); -} -addShadowHost(doc); - -doc.body.appendChild(createTextInputElement(doc, 'input-04', 0)); - -function addIframe(doc) { - var iframe = doc.createElement('iframe'); - iframe.id = 'iframe'; - doc.body.appendChild(iframe); - doc = iframe.contentDocument; - - doc.body.appendChild(createTextInputElement(doc, 'input-05', 0)); - doc.body.appendChild(createTextInputElement(doc, 'input-06', 1)); - doc.body.appendChild(createTextInputElement(doc, 'input-07', -1)); - - function addShadowHost(doc) { - var shadowHost = doc.createElement('p'); - shadowHost.id = 'host-02'; - shadowHost.tabIndex = 1; - var shadow = shadowHost.createShadowRoot(); - doc.body.appendChild(shadowHost); - - shadow.appendChild(createTextInputElement(doc, 'input-08', 0)); - shadow.appendChild(createTextInputElement(doc, 'input-09', 1)); - shadow.appendChild(createTextInputElement(doc, 'input-10', -1)); - } - addShadowHost(doc); - - doc.body.appendChild(createTextInputElement(doc, 'input-11', 2)); - doc.body.appendChild(createTextInputElement(doc, 'input-12', 1)); -} -addIframe(doc); - -doc.body.appendChild(createTextInputElement(doc, 'input-13', 1)); -doc.body.appendChild(createTextInputElement(doc, 'input-14', 0)); -doc.body.appendChild(createTextInputElement(doc, 'input-15', 2)); - -testFocusNavigationForward([ - 'input-01', - 'input-13', - 'input-15', - 'input-02', - 'host-01/input-03', - 'input-04', - 'iframe/input-06', - 'iframe/host-02', - 'iframe/host-02/input-09', - 'iframe/host-02/input-08', - 'iframe/input-12', - 'iframe/input-11', - 'iframe/input-05', - 'input-14', -]); - -testFocusNavigationBackward([ - 'input-14', - 'iframe/input-05', - 'iframe/input-11', - 'iframe/input-12', - 'iframe/host-02/input-08', - 'iframe/host-02/input-09', - 'iframe/host-02', - 'iframe/input-06', - 'input-04', - 'host-01/input-03', - 'input-02', - 'input-15', - 'input-13', - 'input-01', -]); - -debug('\nTest finished.'); -</script> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/table-border-expected.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/table-border-expected.html deleted file mode 100644 index a0742c3a..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/table-border-expected.html +++ /dev/null
@@ -1,21 +0,0 @@ -<html> -<body> -<table border> - <tr><td>A</td><td>B</td></tr> - <tr><td>C</td><td>D</td></tr> -</table> -<table border> - <tr><td>E</td><td>F</td><td>G</td></tr> - <tr><td>H</td><td>I</td><td>J</td></tr> -</table> -<table border> - <tr><td>K</td></tr> - <tr><td>L</td></tr> -</table> -<div> -<table border> - <tr><td>M</td></tr> -</table> -</div> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/table-border-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/table-border-expected.txt deleted file mode 100644 index 8765761..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/table-border-expected.txt +++ /dev/null
@@ -1 +0,0 @@ -CONSOLE WARNING: line 19: Element.createShadowRoot is deprecated and will be removed in M80, around February 2020. Please use Element.attachShadow instead. See https://www.chromestatus.com/features/4507242028072960 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details.
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/table-border.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/table-border.html deleted file mode 100644 index 50167f2..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/table-border.html +++ /dev/null
@@ -1,31 +0,0 @@ -<!DOCTYPE html> -<html> -<body> -<table border> - <tr><td>A</td><td>B</td></tr> - <tr id="host1"></tr> -</table> -<table border> - <tr><td>E</td><td>F</td><td>G</td></tr> - <tr id="host2"><td>I</td></tr> -</table> -<table border> - <tr><td>K</td></tr> - <tr id="host3"></tr> -</table> -<div id="host4"> -</div> -<script> -host1.createShadowRoot().innerHTML = "<td>C</td><td>D</td>" -host2.createShadowRoot().innerHTML = "<td>H</td><content /><td>J</td>"; -host3.createShadowRoot().innerHTML = "<content select='no-match'><td>L</td></content>"; - -var td = document.createElement("td"); -td.innerHTML = "M"; -host4.appendChild(td); -shadow4 = host4.createShadowRoot(); -shadow4.innerHTML = "<table border><tr id='contentParent'></tr></table>"; -shadow4.getElementById("contentParent").appendChild(document.createElement("content")); -</script> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/touch-event-retargeting-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/touch-event-retargeting-expected.txt deleted file mode 100644 index f249b788..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/touch-event-retargeting-expected.txt +++ /dev/null
@@ -1,16 +0,0 @@ -CONSOLE WARNING: line 87: Element.createShadowRoot is deprecated and will be removed in M80, around February 2020. Please use Element.attachShadow instead. See https://www.chromestatus.com/features/4507242028072960 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -Touch event retargeting. - -foo - - touchstart - @div1 (target: div1) (touches: div1, div2, div3) (targetTouches: div1) (changedTouches: div1, div2, div3) - @div2 (target: div2) (touches: div1, div2, div3) (targetTouches: div2) (changedTouches: div1, div2, div3) - @div2-shadow-root-child (target: div2-shadow-root-child) (touches: div1, div2-shadow-root-child, div3) (targetTouches: div2-shadow-root-child) (changedTouches: div1, div2-shadow-root-child, div3) - @div3 (target: div3) (touches: div1, div2, div3) (targetTouches: div3) (changedTouches: div1, div2, div3) - @div3-shadow-root-child (target: div3-shadow-root-child) (touches: div1, div2, div3-shadow-root-child) (targetTouches: div3-shadow-root-child) (changedTouches: div1, div2, div3-shadow-root-child) -PASS successfullyParsed is true - -TEST COMPLETE - -
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/touch-event-retargeting.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/touch-event-retargeting.html deleted file mode 100644 index 40cfc97..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/touch-event-retargeting.html +++ /dev/null
@@ -1,59 +0,0 @@ -<!DOCTYPE html> -<html> -<head> - <script src="../../../resources/js-test.js"></script> - <script src="resources/shadow-dom.js"></script> - <script src="resources/event-dispatching.js"></script> -</head> -<body> -<p>Touch event retargeting.</p> -<div id="sandbox"> -</div> -<pre id="console"></pre> - -<script> -sandbox.appendChild( - createDOM('div', {'id': 'container'}, - createDOM('div', {'id': 'div1'}, - document.createTextNode('foo')), - createDOM('div', {'id': 'div2'}, - createShadowRoot( - createDOM('div', {}, - document.createTextNode('foo')), - createDOM('div', {'id': 'div2-shadow-root-child'}, - document.createTextNode('foo')), - createDOM('div', {}, - document.createTextNode('foo')))), - createDOM('div', {'id': 'div3'}, - createShadowRoot( - createDOM('div', {}, - document.createTextNode('foo')), - createDOM('div', {'id': 'div3-shadow-root-child'}, - document.createTextNode('foo')), - createDOM('div', {}, - document.createTextNode('foo')))))); - -sandbox.offsetLeft; - -function addTouchPoint(target) -{ - eventSender.addTouchPoint(target.offsetLeft + target.offsetWidth / 2, target.offsetTop + target.offsetHeight / 2); -} - -function sendTouchEvent(elements) -{ - eventSender.clearTouchPoints(); - for (var i = 0; i < elements.length; ++i) - addTouchPoint(getNodeInComposedTree(elements[i])); - eventSender.touchStart(); - eventSender.touchEnd(); -} - -addEventListeners(['div1', 'div2', 'div3', - 'div2/div2-shadow-root-child', 'div3/div3-shadow-root-child']); -sendTouchEvent(['div1', 'div2/div2-shadow-root-child', 'div3/div3-shadow-root-child']); -sortDispatchedEvent('touchstart'); -debugDispatchedEvent('touchstart'); -</script> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/transition-on-shadow-host-with-distributed-node-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/transition-on-shadow-host-with-distributed-node-expected.txt deleted file mode 100644 index 1ee9197b..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/transition-on-shadow-host-with-distributed-node-expected.txt +++ /dev/null
@@ -1,3 +0,0 @@ -CONSOLE WARNING: line 30: Element.createShadowRoot is deprecated and will be removed in M80, around February 2020. Please use Element.attachShadow instead. See https://www.chromestatus.com/features/4507242028072960 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -PASS - "opacity" property for "box" element at 0.5s saw something close to: 0.5 -
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/transition-on-shadow-host-with-distributed-node.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/transition-on-shadow-host-with-distributed-node.html deleted file mode 100644 index a1abccb..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/transition-on-shadow-host-with-distributed-node.html +++ /dev/null
@@ -1,52 +0,0 @@ -<!doctype html> -<html> -<head> -<style> -.box { - height: 100px; - width: 100px; - margin: 10px; - background-color: gray; -} - -#box { - opacity: 1; - -webkit-transition: opacity 1s linear; -} - -#box.fade { - opacity: 0; -} -</style> -<script src="../../../animations/resources/animation-test-helpers.js"></script> -<script> -const expectedValues = [ - // [time, element-id, property, expected-value, tolerance] - [0.5, 'box', 'opacity', 0.5, 0.1], -]; - -function setupTest() { - var box = document.getElementById('box'); - var shadowRoot = box.createShadowRoot(); - shadowRoot.innerHTML = '<content select="*:first-child"></content>'; - setTimeout(function() { - shadowRoot.querySelector("content").setAttribute("select", "*:last-child"); - box.className = 'box fade'; - }, 0); -} - -runTransitionTest(expectedValues, setupTest); -</script> -</head> -<body> - <!-- Test for [bug 93755] ShadowRoot insertion point change aborts css transition, https://bugs.webkit.org/show_bug.cgi?id=93755 --> - <!-- If this test pass, css transition will be started and --> - <!-- the css transition will be paused by using pauseAnimations. --> - <div id="box" class="box" style="background: green;"> - <div>Content</div> - <div>New Content</div> - </div> - - <div id="result"></div> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/user-modify-inheritance-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/user-modify-inheritance-expected.txt deleted file mode 100644 index 6f648761..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/user-modify-inheritance-expected.txt +++ /dev/null
@@ -1,20 +0,0 @@ -CONSOLE WARNING: line 30: Element.createShadowRoot is deprecated and will be removed in M80, around February 2020. Please use Element.attachShadow instead. See https://www.chromestatus.com/features/4507242028072960 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -Tests to ensure that a '-webkit-user-modify' CSS property is not inherited across shadow boundaries. - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - -PASS computedStyle(prepareNodeInShadowRoot(document.getElementById("contenteditable-host1"), null)) is "read-only" -PASS computedStyle(prepareNodeInShadowRoot(document.getElementById("contenteditable-host2"), "false")) is "read-only" -PASS computedStyle(prepareNodeInShadowRoot(document.getElementById("contenteditable-host3"), "true")) is "read-write" -PASS computedStyle(prepareNodeInShadowRoot(document.getElementById("non-contenteditable-host1"), null)) is "read-only" -PASS computedStyle(prepareNodeInShadowRoot(document.getElementById("non-contenteditable-host2"), "false")) is "read-only" -PASS computedStyle(prepareNodeInShadowRoot(document.getElementById("non-contenteditable-host3"), "true")) is "read-write" -PASS getUserModifyProperty("child-a") is "read-write" -PASS getUserModifyProperty("child-b") is "read-write" -PASS getUserModifyProperty("child-c") is "read-only" -PASS getUserModifyProperty("child-d") is "read-only" -PASS successfullyParsed is true - -TEST COMPLETE - -
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/user-modify-inheritance.html b/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/user-modify-inheritance.html deleted file mode 100644 index 1ff88ea3..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/dom-shadow/user-modify-inheritance.html +++ /dev/null
@@ -1,72 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script src="../../../resources/js-test.js"></script> -<script src="resources/shadow-dom.js"></script> -</head> -<body> -<p id="description"></p> -<div id="contenteditable-host1" contenteditable></div> -<div id="contenteditable-host2" contenteditable></div> -<div id="contenteditable-host3" contenteditable></div> -<div id="non-contenteditable-host1"></div> -<div id="non-contenteditable-host2"></div> -<div id="non-contenteditable-host3"></div> -<div id="sandbox"></div> -<div id="sandbox2"></div> -<pre id="console"></pre> -<script> -description("Tests to ensure that a '-webkit-user-modify' CSS property is not inherited across shadow boundaries."); - -function computedStyle(element) { - return window.getComputedStyle(element).webkitUserModify; -} - -function getUserModifyProperty(id) { - return computedStyle(document.getElementById(id)); -} - -function prepareNodeInShadowRoot(host, contentEditableAttributeValueForNode) { - var shadowRoot = host.createShadowRoot(); - var nodeInShadow = document.createElement('div'); - if (contentEditableAttributeValueForNode != null) - nodeInShadow.setAttribute('contenteditable', contentEditableAttributeValueForNode); - shadowRoot.appendChild(nodeInShadow); - document.body.offsetLeft; - return nodeInShadow; -} - -shouldBeEqualToString('computedStyle(prepareNodeInShadowRoot(document.getElementById("contenteditable-host1"), null))', 'read-only'); -shouldBeEqualToString('computedStyle(prepareNodeInShadowRoot(document.getElementById("contenteditable-host2"), "false"))', 'read-only'); -shouldBeEqualToString('computedStyle(prepareNodeInShadowRoot(document.getElementById("contenteditable-host3"), "true"))', 'read-write'); -shouldBeEqualToString('computedStyle(prepareNodeInShadowRoot(document.getElementById("non-contenteditable-host1"), null))', 'read-only'); -shouldBeEqualToString('computedStyle(prepareNodeInShadowRoot(document.getElementById("non-contenteditable-host2"), "false"))', 'read-only'); -shouldBeEqualToString('computedStyle(prepareNodeInShadowRoot(document.getElementById("non-contenteditable-host3"), "true"))', 'read-write'); - -document.getElementById('sandbox').appendChild( - createDOM('div', {'id': 'host', 'contenteditable': 'true'}, - createShadowRoot(createDOM('content', {'select': '#child-a'}), - createDOM('div', {}, - createDOM('content', {'select': '#child-b'}))), - createDOM('div', {'id': 'child-a'}), - createDOM('div', {'id': 'child-b'}))); - -document.body.offsetLeft; - -shouldBeEqualToString('getUserModifyProperty("child-a")', 'read-write'); -shouldBeEqualToString('getUserModifyProperty("child-b")', 'read-write'); - -document.getElementById('sandbox2').appendChild( - createDOM('div', {'id': 'host', 'contenteditable': 'false'}, - createShadowRoot(createDOM('content', {'select': '#child-c'}), - createDOM('div', {'contenteditable' : 'true'}, - createDOM('content', {'select': '#child-d'}))), - createDOM('div', {'id': 'child-c'}), - createDOM('div', {'id': 'child-d'}))); - -shouldBeEqualToString('getUserModifyProperty("child-c")', 'read-only'); -shouldBeEqualToString('getUserModifyProperty("child-d")', 'read-only'); - -</script> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/custom-element-style-block.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/custom-element-style-block.html deleted file mode 100644 index 0352483..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/custom-element-style-block.html +++ /dev/null
@@ -1,18 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script src="../../../resources/testharness.js"></script> -<script src="../../../resources/testharnessreport.js"></script> -<link rel="import" href="resources/custom-element-style.html"> -</head> -<body> -<x-test></x-test> -<script> -test(function(){ - var x = document.querySelector('x-test'); - var port = x.shadowRoot.querySelector('style').sheet.cssRules[0]; - assert_true(port.styleSheet instanceof StyleSheet); -}, "The @import style in custom element shadow DOM blocks following script element."); -</script> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/encoding-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/encoding-expected.txt deleted file mode 100644 index dfad90c..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/encoding-expected.txt +++ /dev/null
@@ -1,13 +0,0 @@ -CONSOLE WARNING: line 4: HTML Imports is deprecated and will be removed in M80, around February 2020. Please use ES modules instead. See https://www.chromestatus.com/features/5144752345317376 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -Test that UTF-8 decoding is applied appropriately to imports - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - -Default encoding should be UTF-8... -PASS links[0].import.characterSet is "UTF-8" -And a meta tag should not override it... -PASS links[1].import.characterSet is "UTF-8" -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/encoding.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/encoding.html deleted file mode 100644 index 8a235419..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/encoding.html +++ /dev/null
@@ -1,21 +0,0 @@ -<!DOCTYPE html> -<head> - <script src="../../../resources/js-test.js"></script> - <link rel="import" href="resources/no-encoding.html"> - <link rel="import" href="resources/meta-encoding.html"> -</head> -<body> -<script> -jsTestIsAsync = true; -window.onload = function() { - description("Test that UTF-8 decoding is applied appropriately to imports"); - - links = document.querySelectorAll('link[rel=import]'); - debug("Default encoding should be UTF-8..."); - shouldBeEqualToString("links[0].import.characterSet", "UTF-8"); - debug("And a meta tag should not override it..."); - shouldBeEqualToString("links[1].import.characterSet", "UTF-8"); - finishJSTest(); -}; -</script> -</body>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-add-child-to-change-order-of-dup-css.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-add-child-to-change-order-of-dup-css.html deleted file mode 100644 index 585bc24..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-add-child-to-change-order-of-dup-css.html +++ /dev/null
@@ -1,24 +0,0 @@ -<!DOCTYPE html> -<script src="../../../resources/testharness.js"></script> -<script src="../../../resources/testharnessreport.js"></script> -<link rel="import" href="resources/bye.html"></link> -<style>.target { color: green }</style> -<link rel="import" href="resources/style-red.html"></link> -<div class="target">This text should be green.</div> -<script> - var importDoc = document.querySelectorAll("link")[0].import; - var newLink = importDoc.createElement("link"); - newLink.setAttribute("rel", "import"); - newLink.setAttribute("href", "style-red.html"); - var targetElement = document.querySelector(".target"); - - test(() => { - assert_equals(getComputedStyle(targetElement).color, "rgb(255, 0, 0)"); - }, ".target should initially be red"); - - importDoc.head.appendChild(newLink); - - test(() => { - assert_equals(getComputedStyle(targetElement).color, "rgb(0, 128, 0)"); - }, ".target should be green after style-red.html is inserted as an import child before the inline green style."); -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-child-null-document-crash.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-child-null-document-crash.html deleted file mode 100644 index 48242b9a..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-child-null-document-crash.html +++ /dev/null
@@ -1,9 +0,0 @@ -<!DOCTYPE html> -<script src="../../../resources/testharness.js"></script> -<script src="../../../resources/testharnessreport.js"></script> -<link id="importLink" rel="import" href="dummy.html"> -<script> - test(() => { - document.head.appendChild(importLink.cloneNode()); - }, "Cloning and appending the loading import should not crash."); -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-client-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-client-expected.txt deleted file mode 100644 index 92c92543..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-client-expected.txt +++ /dev/null
@@ -1,9 +0,0 @@ -CONSOLE WARNING: line 4: HTML Imports is deprecated and will be removed in M80, around February 2020. Please use ES modules instead. See https://www.chromestatus.com/features/5144752345317376 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -Importing client - -PASS -PASS - - - -
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-client.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-client.html deleted file mode 100644 index 426de8a..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-client.html +++ /dev/null
@@ -1,26 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<link id="client" rel="import" href="import-client.html"> -</head> -<body> -<h1 style="dipslay: none;">Importing client</h1> -<pre id="resultConsole"></screen> -<script> -if (window.testRunner) - testRunner.dumpAsText(); - -if (document == document.currentScript.ownerDocument) { - if (client.import.querySelector('h1').innerHTML != "Importing client") - resultConsole.innerHTML += "FAIL: Loaded wrong nested document.\n"; - else - resultConsole.innerHTML += "PASS\n"; - - if (client.import.querySelector('#client').import != client.import) - resultConsole.innerHTML += "FAIL: Imported object is shared with nested one.\n"; - else - resultConsole.innerHTML += "PASS\n"; -} -</script> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-css-sheet-in-shadow.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-css-sheet-in-shadow.html deleted file mode 100644 index af6cab56..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-css-sheet-in-shadow.html +++ /dev/null
@@ -1,25 +0,0 @@ -<!DOCTYPE html> -<script src="../../../resources/testharness.js"></script> -<script src="../../../resources/testharnessreport.js"></script> -<link id="importLink" rel="import" href="data:text/html,<div id=host></div>"> -<script> - var importDoc = importLink.import; - var root = importDoc.querySelector("#host").attachShadow({mode:"open"}); - var shadowStyle = importDoc.createElement("style"); - shadowStyle.appendChild(importDoc.createTextNode("div{color:pink}")); - root.appendChild(shadowStyle); - - test(() => { - assert_true(!!shadowStyle.sheet, - "The shadow tree Element.sheet should be defined."); - assert_equals(shadowStyle.sheet.cssRules.length, 1, - "The number of rules in the shadow tree stylesheet should 1."); - }, "Element.sheet on style element in shadow tree in html import."); - - test(() => { - assert_equals(root.styleSheets.length, 1, - "Length of the ShadowRoot.styleSheets should be 1."); - assert_equals(root.styleSheets[0].cssRules.length, 1, - "The number of rules in the shadow stylesheet should be 1."); - }, "ShadowRoot.styleSheets on shadow root in html import."); -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-custom-element-abort-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-custom-element-abort-expected.txt deleted file mode 100644 index a675c27..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-custom-element-abort-expected.txt +++ /dev/null
@@ -1,4 +0,0 @@ -CONSOLE WARNING: line 8: document.registerElement is deprecated and will be removed in M80, around February 2020. Please use window.customElements.define instead. See https://www.chromestatus.com/features/4642138092470272 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -CONSOLE WARNING: line 10: HTML Imports is deprecated and will be removed in M80, around February 2020. Please use ES modules instead. See https://www.chromestatus.com/features/5144752345317376 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -CONSOLE MESSAGE: line 4: PASS unless crash. -
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-custom-element-abort.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-custom-element-abort.html deleted file mode 100644 index c490c2e..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-custom-element-abort.html +++ /dev/null
@@ -1,14 +0,0 @@ -<!DOCTYPE html> -<script> -if (window.testRunner) { - testRunner.waitUntilDone(); - testRunner.dumpAsText(); -} - -document.registerElement('x-hello'); -</script> -<link rel="import" href="resources/custom-element-hello.html"> -<link async rel="import" href="resources/custom-element-hello.html"> -<script> -window.location = 'resources/notify-done.html'; -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-custom-element-async-resolve.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-custom-element-async-resolve.html deleted file mode 100644 index fb17f60..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-custom-element-async-resolve.html +++ /dev/null
@@ -1,65 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script src="../../../resources/testharness.js"></script> -<script src="../../../resources/testharnessreport.js"></script> -<script src="../../../http/tests/htmlimports/resources/import-custom-element-helper.js"></script> -</head> -<body> -<script> -var Hello = registerTestingCustomElement('x-hello'); - -var t1 = async_test('Instantiate custom elements in async imports.'); -var t2 = async_test('Resolve custom elements in async imports later.'); -var numberOfLinks = 6 + 4; // + 4 for grandchildren -var expectedHelloList = ['hello-1', 'hello-2', 'hello-3', 'hello-4', 'hello-5', 'hello-6', 'hello-7', 'hello-8', 'hello-p34-1', 'hello-p34-2', 'hello-p56-1', 'hello-p56-2']; -var expectedByeList = ['bye-1', 'bye-2', 'bye-3', 'bye-4', 'bye-5', 'bye-6', 'bye-7', 'bye-8', 'bye-p34-1', 'bye-p34-2', 'bye-p56-1', 'bye-p56-2']; - -var latch = new ImportTestLatch(function() { - - t1.step(function() { - assert_equals('hello-1', Hello.ids[0]); - assert_array_equals(expectedHelloList, Hello.ids.slice(0).sort()); - - assert_true(Hello.ids.indexOf('hello-p34-1') < Hello.ids.indexOf('hello-3'), 'Order check heello-3'); - assert_true(Hello.ids.indexOf('hello-3') < Hello.ids.indexOf('hello-p34-2'), 'Order check hello-p34-2'); - assert_true(Hello.ids.indexOf('hello-3') < Hello.ids.indexOf('hello-7'), 'Order check hello-7'); - - // Even though parent-2 is loaded in async, its content should follow the order. - assert_true(Hello.ids.indexOf('hello-p56-1') < Hello.ids.indexOf('hello-5'), 'Order check hello-5'); - assert_true(Hello.ids.indexOf('hello-5') < Hello.ids.indexOf('hello-p56-2'), 'Order check hellop56-2'); - - t1.done(); - }); - - t2.step(function() { - var Bye = registerTestingCustomElement('x-bye'); - - assert_equals('bye-1', Bye.ids[0]); - assert_array_equals(expectedByeList, Bye.ids.slice(0).sort()); - assert_true(Bye.ids.indexOf('bye-p34-1') < Bye.ids.indexOf('bye-3')); - assert_true(Bye.ids.indexOf('bye-3') < Bye.ids.indexOf('bye-p34-2')); - assert_true(Bye.ids.indexOf('bye-3') < Bye.ids.indexOf('bye-7')); - assert_true(Bye.ids.indexOf('bye-p56-1') < Bye.ids.indexOf('bye-5')); - assert_true(Bye.ids.indexOf('bye-5') < Bye.ids.indexOf('bye-p56-2')); - - t2.done(); - }); -}, numberOfLinks); -</script> -<link rel="import" href="resources/custom-element-hello-1.html" onload="latch.loaded()"> -<link rel="import" href="resources/custom-element-hello-2.html" async onload="latch.loaded()"> -<link rel="import" href="resources/custom-element-hello-parent-34.html" onload="latch.loaded()"> -<link rel="import" href="resources/custom-element-hello-parent-56.html" async onload="latch.loaded()"> -<link rel="import" href="resources/custom-element-hello-7.html" onload="latch.loaded()"> -<script> -(function() { - var link = document.createElement('link'); - link.href = 'resources/custom-element-hello-8.html'; - link.rel = 'import'; - link.onload = latch.loaded.bind(latch); - document.head.appendChild(link); -})(); -</script> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-custom-element-cycle.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-custom-element-cycle.html deleted file mode 100644 index 6b536ae..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-custom-element-cycle.html +++ /dev/null
@@ -1,30 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script src="../../../resources/testharness.js"></script> -<script src="../../../resources/testharnessreport.js"></script> -<script src="../../../http/tests/htmlimports/resources/import-custom-element-helper.js"></script> -</head> -<body> -<script> -var Hello = registerTestingCustomElement('x-hello'); - -var numberOfLinks = 1; -var t1 = async_test('Elements are upgraded ignoring the cycle.'); -var t2 = async_test('Elements are resolved ignoring the cycle.'); -var latch = new ImportTestLatch(function() { - t1.step(function() { - assert_array_equals(['hello-cycle-p1', 'hello-cycle-1', 'hello-cycle-2', 'hello-cycle-p2'], Hello.ids); - t1.done(); - }); - - t2.step(function() { - var Bye = registerTestingCustomElement('x-bye'); - assert_array_equals(['bye-cycle-p1', 'bye-cycle-1', 'bye-cycle-2', 'bye-cycle-p2'], Bye.ids); - t2.done(); - }); -}, numberOfLinks); -</script> -<link rel="import" href="resources/custom-element-hello-cycle-parent.html" onload="latch.loaded()"> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-custom-element-dup-resolve.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-custom-element-dup-resolve.html deleted file mode 100644 index 283810d..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-custom-element-dup-resolve.html +++ /dev/null
@@ -1,43 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script src="../../../resources/testharness.js"></script> -<script src="../../../resources/testharnessreport.js"></script> -<script src="../../../http/tests/htmlimports/resources/import-custom-element-helper.js"></script> -</head> -<body> -<script> -var Hello = registerTestingCustomElement('x-hello'); - -var numberOfLinks = 10; -var t1 = async_test('Instantiate custom elements in async imports.'); -var t2 = async_test('Resolve custom elements in async imports later.'); -var latch = new ImportTestLatch(function() { - t1.step(function() { - assert_array_equals(['hello-3', 'hello-4', 'hello-5', 'hello-6', 'hello-p34-1', 'hello-p34-2', 'hello-p56-1', 'hello-p56-2'], Hello.ids.slice(0).sort(), 'All elements are upgraded only once'); - // Remove async links whose loading orders aren't deterministic. - Hello.ids.splice(Hello.ids.indexOf('hello-4'), 1); - Hello.ids.splice(Hello.ids.indexOf('hello-6'), 1); - assert_array_equals(['hello-p34-1', 'hello-3', 'hello-p34-2', 'hello-5', 'hello-p56-1', 'hello-p56-2'], Hello.ids, 'Elements from non async improts are upgraded in order'); - t1.done(); - }); - - t2.step(function() { - var Bye = registerTestingCustomElement('x-bye'); - assert_array_equals(['bye-3', 'bye-4', 'bye-5', 'bye-6', 'bye-p34-1', 'bye-p34-2', 'bye-p56-1', 'bye-p56-2'], Bye.ids.slice(0).sort(), 'All elements are upgraded only once'); - // Remove async links whose loading orders are't deterministic. - Bye.ids.splice(Bye.ids.indexOf('bye-4'), 1); - Bye.ids.splice(Bye.ids.indexOf('bye-6'), 1); - assert_array_equals(['bye-p34-1', 'bye-3', 'bye-p34-2', 'bye-5', 'bye-p56-1', 'bye-p56-2'], Bye.ids, 'Elements from non async improts are upgraded in order'); - t2.done(); - }); -}, numberOfLinks); -</script> -<link rel="import" href="resources/custom-element-hello-parent-34.html" onload="latch.loaded()"> -<link rel="import" href="resources/custom-element-hello-3.html" onload="latch.loaded()"> -<link rel="import" href="resources/custom-element-hello-4.html" async onload="latch.loaded()"> -<link rel="import" href="resources/custom-element-hello-5.html" onload="latch.loaded()"> -<link rel="import" href="resources/custom-element-hello-6.html" async onload="latch.loaded()"> -<link rel="import" href="resources/custom-element-hello-parent-56.html" onload="latch.loaded()"> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-custom-element-in-client-and-grandchild.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-custom-element-in-client-and-grandchild.html deleted file mode 100644 index 5d58b3c..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-custom-element-in-client-and-grandchild.html +++ /dev/null
@@ -1,37 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script src="../../../resources/testharness.js"></script> -<script src="../../../resources/testharnessreport.js"></script> -<script src="../../../http/tests/htmlimports/resources/import-custom-element-helper.js"></script> -</head> -<body> -<script> -var Hello = registerTestingCustomElement('x-hello'); -var numberOfLinks = 3; -var t1 = async_test('Custom elements in an indirect import and the client are both upgraded.'); -var t2 = async_test('Custom elements in an indirect import and the client are both resolved.'); -var latch = new ImportTestLatch(function() { - t1.step(function() { - assert_array_equals(Hello.ids.slice(0).sort(), ['hello-1', 'hello-2', 'hello-root-1', 'hello-root-2'], 'All custom elements are upgraded'); - Hello.ids.splice(Hello.ids.indexOf('hello-2'), 1); // Remove an asynchronously loaded element. - assert_array_equals(Hello.ids, ['hello-root-1', 'hello-1', 'hello-root-2'], 'The upgrade order follows imports'); - t1.done(); - }, 0); - - t2.step(function() { - var Bye = registerTestingCustomElement('x-bye'); - assert_array_equals(Bye.ids.slice(0).sort(), ['bye-1', 'bye-2', 'bye-root-1', 'bye-root-2'], 'All custom elements are upgraded'); - Bye.ids.splice(Bye.ids.indexOf('bye-2'), 1); // Remove an asynchronously loaded element. - assert_array_equals(Bye.ids, ['bye-root-1', 'bye-1', 'bye-root-2'], 'The upgrade order follows imports'); - t2.done(); - }); -}, numberOfLinks); -</script> -<x-hello id="hello-root-1"></x-hello> -<x-bye id="bye-root-1"></x-bye> -<link rel="import" href="resources/custom-element-hello-parent-12.html" onload="latch.loaded()"> -<x-hello id="hello-root-2"></x-hello> -<x-bye id="bye-root-2"></x-bye> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-custom-element-in-grandchild.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-custom-element-in-grandchild.html deleted file mode 100644 index 92e7ed3c..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-custom-element-in-grandchild.html +++ /dev/null
@@ -1,31 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script src="../../../resources/testharness.js"></script> -<script src="../../../resources/testharnessreport.js"></script> -<script src="../../../http/tests/htmlimports/resources/import-custom-element-helper.js"></script> -</head> -<body> -<script> -var Hello = registerTestingCustomElement('x-hello'); -var numberOfLinks = 3; -var t1 = async_test('Custom elements in an indirect import are upgraded.'); -var t2 = async_test('Custom elements in an indirect import are resolved.'); -var latch = new ImportTestLatch(function() { - t1.step(function() { - assert_equals('hello-1', Hello.ids[0]); - assert_array_equals(['hello-1', 'hello-2'], Hello.ids.slice(0).sort()); - t1.done(); - }, 0); - - t2.step(function() { - var Bye = registerTestingCustomElement('x-bye'); - assert_equals('bye-1', Bye.ids[0]); - assert_array_equals(['bye-1', 'bye-2'], Bye.ids.slice(0).sort()); - t2.done(); - }); -}, numberOfLinks); -</script> -<link rel="import" href="resources/custom-element-hello-parent-12.html" onload="latch.loaded()"> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-custom-element-onload.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-custom-element-onload.html deleted file mode 100644 index b570630..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-custom-element-onload.html +++ /dev/null
@@ -1,28 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script src="../../../resources/testharness.js"></script> -<script src="../../../resources/testharnessreport.js"></script> -<script> -hello = Object.create(HTMLElement.prototype); -hello.ids = []; -hello.createdCallback = function() { - hello.ids.push(this.id); -}; - -document.registerElement('x-hello', {prototype: hello}); - -t = async_test('Custom elements in an import are upgraded inside load event handlers of the import.'); - -function ready() { - t.step(function() { - assert_array_equals(['1', '2', '3'], hello.ids); - t.done(); - }); -} -</script> -<link rel="import" href="resources/import-custom-element-onload-child.html" onload="ready()"> -</head> -<body> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-cycle-grandparent.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-cycle-grandparent.html deleted file mode 100644 index 751524e..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-cycle-grandparent.html +++ /dev/null
@@ -1,20 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script src="../../../resources/testharness.js"></script> -<script src="../../../resources/testharnessreport.js"></script> -<script src="../../../http/tests/htmlimports/resources/normalize-test-helper.js"></script> -<script> -var t = async_test('Imports with cycle complete loading in a defined order.'); -window.addEventListener('load', function() { - t.step(function() { - assert_array_equals(['cycle-grandparent-c.html', 'cycle-grandparent-b.html', 'cycle-grandparent-a.html'], importedDocumentList); - t.done(); - }); -}); -</script> -</head> -<body> -<link rel="import" href="resources/cycle-grandparent-a.html"> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-cycle-parent-child-1.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-cycle-parent-child-1.html deleted file mode 100644 index e511d46b..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-cycle-parent-child-1.html +++ /dev/null
@@ -1,20 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script src="../../../resources/testharness.js"></script> -<script src="../../../resources/testharnessreport.js"></script> -<script src="../../../http/tests/htmlimports/resources/normalize-test-helper.js"></script> -<script> -var t = async_test('Imports with cycle complete loading in a defined order.'); -window.addEventListener('load', function() { - t.step(function() { - assert_array_equals(['cycle-parent-child-1-c.html', 'cycle-parent-child-1-d.html', 'cycle-parent-child-1-b.html', 'cycle-parent-child-1-a.html'], importedDocumentList); - t.done(); - }); -}); -</script> -</head> -<body> -<link rel="import" href="resources/cycle-parent-child-1-a.html"> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-cycle-parent-child-2.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-cycle-parent-child-2.html deleted file mode 100644 index 47bcdd3..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-cycle-parent-child-2.html +++ /dev/null
@@ -1,20 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script src="../../../resources/testharness.js"></script> -<script src="../../../resources/testharnessreport.js"></script> -<script src="../../../http/tests/htmlimports/resources/normalize-test-helper.js"></script> -<script> -var t = async_test('Imports with cycle complete loading in a defined order.'); -window.addEventListener('load', function() { - t.step(function() { - assert_array_equals(['cycle-parent-child-1-c.html', 'cycle-parent-child-1-d.html', 'cycle-parent-child-2-b.html', 'cycle-parent-child-2-a.html'], importedDocumentList); - t.done(); - }); -}); -</script> -</head> -<body> -<link rel="import" href="resources/cycle-parent-child-2-a.html"> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-cycle-parent-child-3.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-cycle-parent-child-3.html deleted file mode 100644 index 52e25d8..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-cycle-parent-child-3.html +++ /dev/null
@@ -1,20 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script src="../../../resources/testharness.js"></script> -<script src="../../../resources/testharnessreport.js"></script> -<script src="../../../http/tests/htmlimports/resources/normalize-test-helper.js"></script> -<script> -var t = async_test('Imports with cycle complete loading in a defined order.'); -window.addEventListener('load', function() { - t.step(function() { - assert_array_equals(['cycle-parent-child-1-c.html', 'cycle-parent-child-1-d.html', 'cycle-parent-child-3-b.html', 'cycle-parent-child-3-a.html'], importedDocumentList); - t.done(); - }); -}); -</script> -</head> -<body> -<link rel="import" href="resources/cycle-parent-child-3-a.html"> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-cycle-parent-grandparent.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-cycle-parent-grandparent.html deleted file mode 100644 index c6b5bf7..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-cycle-parent-grandparent.html +++ /dev/null
@@ -1,20 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script src="../../../resources/testharness.js"></script> -<script src="../../../resources/testharnessreport.js"></script> -<script src="../../../http/tests/htmlimports/resources/normalize-test-helper.js"></script> -<script> -var t = async_test('Imports with cycle complete loading in a defined order.'); -window.addEventListener('load', function() { - t.step(function() { - assert_array_equals(['cycle-parent-grandparent-c.html', 'cycle-parent-grandparent-b.html', 'cycle-parent-grandparent-a.html'], importedDocumentList); - t.done(); - }); -}); -</script> -</head> -<body> -<link rel="import" href="resources/cycle-parent-grandparent-a.html"> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-cycle-parent.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-cycle-parent.html deleted file mode 100644 index 8fbed7c..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-cycle-parent.html +++ /dev/null
@@ -1,20 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script src="../../../resources/testharness.js"></script> -<script src="../../../resources/testharnessreport.js"></script> -<script src="../../../http/tests/htmlimports/resources/normalize-test-helper.js"></script> -<script> -var t = async_test('Imports with cycle complete loading in a defined order.'); -window.addEventListener('load', function() { - t.step(function() { - assert_array_equals(['cycle-parent-b.html', 'cycle-parent-a.html'], importedDocumentList); - t.done(); - }); -}); -</script> -</head> -<body> -<link rel="import" href="resources/cycle-parent-a.html"> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-cycle-two-parents-1.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-cycle-two-parents-1.html deleted file mode 100644 index 4759bd3d..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-cycle-two-parents-1.html +++ /dev/null
@@ -1,21 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script src="../../../resources/testharness.js"></script> -<script src="../../../resources/testharnessreport.js"></script> -<script src="../../../http/tests/htmlimports/resources/normalize-test-helper.js"></script> -<script> -var t = async_test('Imports with cycle complete loading in a defined order.'); -window.addEventListener('load', function() { - t.step(function() { - assert_array_equals(['cycle-two-parents-1-b.html', 'cycle-two-parents-1-c.html', 'cycle-two-parents-1-a.html'], importedDocumentList); - t.done(); - }); -}); -</script> -</head> -<body> -<link rel="import" href="resources/cycle-two-parents-1-a.html"> -<link rel="import" href="resources/cycle-two-parents-1-b.html"> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-cycle-two-parents-2.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-cycle-two-parents-2.html deleted file mode 100644 index e19efb26..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-cycle-two-parents-2.html +++ /dev/null
@@ -1,21 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script src="../../../resources/testharness.js"></script> -<script src="../../../resources/testharnessreport.js"></script> -<script src="../../../http/tests/htmlimports/resources/normalize-test-helper.js"></script> -<script> -var t = async_test('Imports with cycle complete loading in a defined order.'); -window.addEventListener('load', function() { - t.step(function() { - assert_array_equals(['cycle-two-parents-2-c.html', 'cycle-two-parents-2-a.html', 'cycle-two-parents-2-b.html'], importedDocumentList); - t.done(); - }); -}); -</script> -</head> -<body> -<link rel="import" href="resources/cycle-two-parents-2-a.html"> -<link rel="import" href="resources/cycle-two-parents-2-b.html"> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-cycle-two-parents-3.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-cycle-two-parents-3.html deleted file mode 100644 index 648a19d..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-cycle-two-parents-3.html +++ /dev/null
@@ -1,21 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script src="../../../resources/testharness.js"></script> -<script src="../../../resources/testharnessreport.js"></script> -<script src="../../../http/tests/htmlimports/resources/normalize-test-helper.js"></script> -<script> -var t = async_test('Imports with cycle complete loading in a defined order.'); -window.addEventListener('load', function() { - t.step(function() { - assert_array_equals(['cycle-two-parents-3-b.html', 'cycle-two-parents-3-c.html', 'cycle-two-parents-3-a.html'], importedDocumentList); - t.done(); - }); -}); -</script> -</head> -<body> -<link rel="import" href="resources/cycle-two-parents-3-a.html"> -<link rel="import" href="resources/cycle-two-parents-3-b.html"> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-defaultView-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-defaultView-expected.txt deleted file mode 100644 index e32e85a..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-defaultView-expected.txt +++ /dev/null
@@ -1,8 +0,0 @@ -CONSOLE WARNING: line 5: HTML Imports is deprecated and will be removed in M80, around February 2020. Please use ES modules instead. See https://www.chromestatus.com/features/5144752345317376 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -PASS importLink.import.defaultView is null -PASS xhr.response.defaultView is null -PASS createdDoc.defaultView is null -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-defaultView.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-defaultView.html deleted file mode 100644 index 9c5cbb4..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-defaultView.html +++ /dev/null
@@ -1,29 +0,0 @@ -<!DOCTYPE html> -<html> -<script src="../../../resources/js-test.js"></script> -<head> -<link id="importLink" rel="import" href="resources/hello.html"> -</head> -<body> -<script> -// This used to be non-null but not longer is. -// See http://crbug.com/408272 -shouldBeNull("importLink.import.defaultView"); - -window.jsTestIsAsync = true; - -var xhr = new XMLHttpRequest(); -xhr.open("GET", "resources/root.html", true); -xhr.responseType = "document"; -xhr.onload = function() { - shouldBeNull("xhr.response.defaultView"); - - createdDoc = document.implementation.createHTMLDocument("Hello"); - shouldBeNull("createdDoc.defaultView"); - finishJSTest(); -}; -xhr.send(); - -</script> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-destroy-stress-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-destroy-stress-expected.txt deleted file mode 100644 index d9038df..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-destroy-stress-expected.txt +++ /dev/null
@@ -1,27 +0,0 @@ -CONSOLE WARNING: line 3: HTML Imports is deprecated and will be removed in M80, around February 2020. Please use ES modules instead. See https://www.chromestatus.com/features/5144752345317376 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -CONSOLE WARNING: line 3: HTML Imports is deprecated and will be removed in M80, around February 2020. Please use ES modules instead. See https://www.chromestatus.com/features/5144752345317376 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -CONSOLE WARNING: line 3: HTML Imports is deprecated and will be removed in M80, around February 2020. Please use ES modules instead. See https://www.chromestatus.com/features/5144752345317376 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -CONSOLE WARNING: line 3: HTML Imports is deprecated and will be removed in M80, around February 2020. Please use ES modules instead. See https://www.chromestatus.com/features/5144752345317376 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -CONSOLE WARNING: line 3: HTML Imports is deprecated and will be removed in M80, around February 2020. Please use ES modules instead. See https://www.chromestatus.com/features/5144752345317376 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -CONSOLE WARNING: line 3: HTML Imports is deprecated and will be removed in M80, around February 2020. Please use ES modules instead. See https://www.chromestatus.com/features/5144752345317376 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -CONSOLE WARNING: line 3: HTML Imports is deprecated and will be removed in M80, around February 2020. Please use ES modules instead. See https://www.chromestatus.com/features/5144752345317376 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -CONSOLE WARNING: line 3: HTML Imports is deprecated and will be removed in M80, around February 2020. Please use ES modules instead. See https://www.chromestatus.com/features/5144752345317376 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -CONSOLE WARNING: line 3: HTML Imports is deprecated and will be removed in M80, around February 2020. Please use ES modules instead. See https://www.chromestatus.com/features/5144752345317376 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -CONSOLE WARNING: line 3: HTML Imports is deprecated and will be removed in M80, around February 2020. Please use ES modules instead. See https://www.chromestatus.com/features/5144752345317376 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -CONSOLE WARNING: line 3: HTML Imports is deprecated and will be removed in M80, around February 2020. Please use ES modules instead. See https://www.chromestatus.com/features/5144752345317376 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -CONSOLE WARNING: line 3: HTML Imports is deprecated and will be removed in M80, around February 2020. Please use ES modules instead. See https://www.chromestatus.com/features/5144752345317376 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -CONSOLE WARNING: line 3: HTML Imports is deprecated and will be removed in M80, around February 2020. Please use ES modules instead. See https://www.chromestatus.com/features/5144752345317376 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -CONSOLE WARNING: line 3: HTML Imports is deprecated and will be removed in M80, around February 2020. Please use ES modules instead. See https://www.chromestatus.com/features/5144752345317376 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -CONSOLE WARNING: line 3: HTML Imports is deprecated and will be removed in M80, around February 2020. Please use ES modules instead. See https://www.chromestatus.com/features/5144752345317376 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -CONSOLE WARNING: line 3: HTML Imports is deprecated and will be removed in M80, around February 2020. Please use ES modules instead. See https://www.chromestatus.com/features/5144752345317376 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -CONSOLE WARNING: line 3: HTML Imports is deprecated and will be removed in M80, around February 2020. Please use ES modules instead. See https://www.chromestatus.com/features/5144752345317376 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -CONSOLE WARNING: line 3: HTML Imports is deprecated and will be removed in M80, around February 2020. Please use ES modules instead. See https://www.chromestatus.com/features/5144752345317376 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -CONSOLE WARNING: line 3: HTML Imports is deprecated and will be removed in M80, around February 2020. Please use ES modules instead. See https://www.chromestatus.com/features/5144752345317376 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -CONSOLE WARNING: line 3: HTML Imports is deprecated and will be removed in M80, around February 2020. Please use ES modules instead. See https://www.chromestatus.com/features/5144752345317376 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -CONSOLE WARNING: line 3: HTML Imports is deprecated and will be removed in M80, around February 2020. Please use ES modules instead. See https://www.chromestatus.com/features/5144752345317376 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -CONSOLE WARNING: line 3: HTML Imports is deprecated and will be removed in M80, around February 2020. Please use ES modules instead. See https://www.chromestatus.com/features/5144752345317376 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -PASS unless crash -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-destroy-stress.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-destroy-stress.html deleted file mode 100644 index 29ef98a..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-destroy-stress.html +++ /dev/null
@@ -1,17 +0,0 @@ -<!DOCTYPE html> -<script src="../../../resources/js-test.js"></script> -<link rel="import" href="resources/import-destroy-stress-ref.html"> -<script> - -window.jsTestIsAsync = true; - -var iteration = 20; -var count = parseInt(window.localStorage['count'] || '0'); -if (iteration < count) { - debug('PASS unless crash') - finishJSTest(); -} else { - window.localStorage['count'] = (count + 1).toString(); - window.location.reload(); -} -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-document-ready-state-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-document-ready-state-expected.txt deleted file mode 100644 index 4994825..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-document-ready-state-expected.txt +++ /dev/null
@@ -1,10 +0,0 @@ -CONSOLE WARNING: line 15: HTML Imports is deprecated and will be removed in M80, around February 2020. Please use ES modules instead. See https://www.chromestatus.com/features/5144752345317376 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -Tests that an imported document's readyState is "complete" - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - -PASS i.import.readyState is "complete" -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-document-ready-state.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-document-ready-state.html deleted file mode 100644 index a50ffee97..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-document-ready-state.html +++ /dev/null
@@ -1,15 +0,0 @@ -<!DOCTYPE html> -<script src="../../../resources/js-test.js"></script> -<body> -<script> -jsTestIsAsync = true; -successfullyParsed = true; - -description('Tests that an imported document\'s readyState is "complete"'); - -function importLoaded() { - shouldBe('i.import.readyState', '"complete"'); - finishJSTest(); -} -</script> -<link id="i" rel="import" onload="importLoaded()" href="resources/hello.html" async>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-document-write.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-document-write.html deleted file mode 100644 index f9677c8..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-document-write.html +++ /dev/null
@@ -1,19 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script src="../../../resources/testharness.js"></script> -<script src="../../../resources/testharnessreport.js"></script> -<link rel="import" href="resources/do-document-write.html"> -</head> -<body> -<x-test></x-test> -<script> -test(function(){ - var importedDocument = document.querySelector("link").import; - assert_throws_dom("InvalidStateError", function() { importedDocument.open() }, "open() doesn't work for imports"); - assert_throws_dom("InvalidStateError", function() { importedDocument.write("Hello") }, "write() doesn't work for imports"); - assert_throws_dom("InvalidStateError", function() { importedDocument.close() }, "close() doesn't work for imports"); -}, "The document write and family isn't supported."); -</script> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-dynamic-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-dynamic-expected.txt deleted file mode 100644 index b5717f6..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-dynamic-expected.txt +++ /dev/null
@@ -1,14 +0,0 @@ -CONSOLE WARNING: line 16: HTML Imports is deprecated and will be removed in M80, around February 2020. Please use ES modules instead. See https://www.chromestatus.com/features/5144752345317376 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -This test ensures that script-added import doesn't block scripts - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - -In onload handler - This should be called later. -PASS importIsLoaded is true -FAIL scriptIsExecuted should be true. Was false. -In script tag - This should be called first. -PASS importIsLoaded is true -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-dynamic-shared-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-dynamic-shared-expected.txt deleted file mode 100644 index 50f7dc8..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-dynamic-shared-expected.txt +++ /dev/null
@@ -1,10 +0,0 @@ -CONSOLE WARNING: line 5: HTML Imports is deprecated and will be removed in M80, around February 2020. Please use ES modules instead. See https://www.chromestatus.com/features/5144752345317376 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -This test ensures that de-duped import can be dynamically added. - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - -PASS linkEl.import is harness.import -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-dynamic-shared.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-dynamic-shared.html deleted file mode 100644 index 11bbb17..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-dynamic-shared.html +++ /dev/null
@@ -1,24 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script src="../../../resources/js-test.js"></script> -<link id="harness" rel="import" href="resources/async-child.html"> -</head> -<body> -<script> -description("This test ensures that de-duped import can be dynamically added."); - -window.jsTestIsAsync = true; - -var linkEl = document.createElement("link"); -linkEl.setAttribute("rel", "import"); -linkEl.setAttribute("href", "resources/async-child.html"); -document.head.appendChild(linkEl); -linkEl.onload = function(evt) { - shouldBe("linkEl.import", "harness.import"); - finishJSTest(); -}; - -</script> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-dynamic-tree-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-dynamic-tree-expected.txt deleted file mode 100644 index a3d233e..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-dynamic-tree-expected.txt +++ /dev/null
@@ -1,10 +0,0 @@ -CONSOLE WARNING: line 14: HTML Imports is deprecated and will be removed in M80, around February 2020. Please use ES modules instead. See https://www.chromestatus.com/features/5144752345317376 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -This test ensures that script-added import lets its child blocks following scripts. - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - -PASS window.trace is ['START root', 'child1', 'child2', 'END root'] -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-dynamic-tree.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-dynamic-tree.html deleted file mode 100644 index 5fa2422a..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-dynamic-tree.html +++ /dev/null
@@ -1,24 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script src="../../../resources/js-test.js"></script> -</head> -<body> -<script> -description("This test ensures that script-added import lets its child blocks following scripts."); - -window.jsTestIsAsync = true; -window.trace = []; - -var linkEl = document.createElement("link"); -linkEl.setAttribute("rel", "import"); -linkEl.setAttribute("href", "resources/async-root.html"); -document.head.appendChild(linkEl); -linkEl.onload = function(evt) { - shouldBe("window.trace", "['START root', 'child1', 'child2', 'END root']"); - finishJSTest(); -}; - -</script> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-dynamic.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-dynamic.html deleted file mode 100644 index 84070ce6..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-dynamic.html +++ /dev/null
@@ -1,33 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script src="../../../resources/js-test.js"></script> -</head> -<body> -<script> -description("This test ensures that script-added import doesn't block scripts"); - -window.jsTestIsAsync = true; - -var importIsLoaded = false; -var scriptIsExecuted = false; - -var linkEl = document.createElement("link"); -linkEl.setAttribute("rel", "import"); -linkEl.setAttribute("href", "resources/async-child.html"); -document.head.appendChild(linkEl); -linkEl.onload = function(evt) { - debug("In onload handler - This should be called later."); - shouldBeTrue("importIsLoaded"); - shouldBeTrue("scriptIsExecuted"); - finishJSTest(); -}; - -</script> -<script> -debug("In script tag - This should be called first."); -shouldBeTrue("importIsLoaded"); -scriptIsExecuted = true; -</script> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-element-removed-flag-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-element-removed-flag-expected.txt deleted file mode 100644 index ef5cd518..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-element-removed-flag-expected.txt +++ /dev/null
@@ -1,17 +0,0 @@ -CONSOLE WARNING: line 5: HTML Imports is deprecated and will be removed in M80, around February 2020. Please use ES modules instead. See https://www.chromestatus.com/features/5144752345317376 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -This tests 'element removed flag' behavior defined in https://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/imports/index.html#dfn-element-removed-flag. - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - -PASS staticImport.import is non-null. -PASS staticImport.import is null -PASS staticImport.import is non-null. -PASS dynamicImport.import is non-null. -PASS dynamicImport.import is null -PASS dynamicImport.import is non-null. -PASS dynamicImportEager.import is null -PASS dynamicImportEager.import is non-null. -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-element-removed-flag.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-element-removed-flag.html deleted file mode 100644 index 1b7272b..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-element-removed-flag.html +++ /dev/null
@@ -1,80 +0,0 @@ -<!DOCTYPE html> -<html> -<script src="../../../resources/js-test.js"></script> -<head> -<link id="staticImportLink" rel="import" href="resources/hello.html"> -</head> -<body> -<script> -description("This tests 'element removed flag' behavior defined in https://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/imports/index.html#dfn-element-removed-flag."); -window.jsTestIsAsync = true; - -function testStaticImport() -{ - // element-removed flag is not set at start - staticImport = window.staticImportLink; - shouldBeNonNull("staticImport.import"); - - // element-removed flag is set when the element removed. - staticImport.remove(); - shouldBeNull("staticImport.import"); - - // And comes back even after re-insertion. - document.head.appendChild(staticImport); - shouldBeNonNull("staticImport.import"); -} - -function testDynamicImport() -{ - function check() - { - shouldBeNonNull("dynamicImport.import"); - dynamicImport.remove(); - shouldBeNull("dynamicImport.import"); - document.head.appendChild(dynamicImport); - shouldBeNonNull("dynamicImport.import"); - - testDynamicImportRemovingEagerly(); - }; - - dynamicImport = document.createElement("link"); - dynamicImport.setAttribute("rel", "import"); - dynamicImport.setAttribute("href", "resources/bye.html"); - dynamicImport.addEventListener("load", check); - document.head.appendChild(dynamicImport); -} - -function testDynamicImportRemovingEagerly() -{ - dynamicImportEager = document.createElement("link"); - dynamicImportEager.setAttribute("rel", "import"); - dynamicImportEager.setAttribute("href", "resources/setting-greet-var.html"); - document.head.appendChild(dynamicImportEager); - - // Reoving <link> just after appending it. - // This should start import loading, but shouldn't make .import visible. - dynamicImportEager.remove(); - - function check() - { - if (window.greet != "Hello") { - window.setTimeout(check, 0); - return; - } - - shouldBeNull("dynamicImportEager.import"); - document.head.appendChild(dynamicImportEager); - shouldBeNonNull("dynamicImportEager.import"); - - window.requestAnimationFrame(function() { finishJSTest(); }, 0); - } - - setTimeout(check, 0); -} - -testStaticImport(); -testDynamicImport(); - -</script> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-events-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-events-expected.txt deleted file mode 100644 index d5ef42c..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-events-expected.txt +++ /dev/null
@@ -1,10 +0,0 @@ -CONSOLE WARNING: line 5: HTML Imports is deprecated and will be removed in M80, around February 2020. Please use ES modules instead. See https://www.chromestatus.com/features/5144752345317376 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -Test that events can be fired on imported documents. - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - -PASS window.caughtFoo is ['foo@target', 'foo@root'] -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-events-inline-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-events-inline-expected.txt deleted file mode 100644 index b23e6cd..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-events-inline-expected.txt +++ /dev/null
@@ -1,10 +0,0 @@ -CONSOLE WARNING: line 17: HTML Imports is deprecated and will be removed in M80, around February 2020. Please use ES modules instead. See https://www.chromestatus.com/features/5144752345317376 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -Test that inline event handler is fired on an imported document. - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - -PASS window.list is expected -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-events-inline.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-events-inline.html deleted file mode 100644 index 0e515ac..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-events-inline.html +++ /dev/null
@@ -1,25 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script src="../../../resources/js-test.js"></script> -<script> -var list = []; -function handle(event) -{ - list.push(event.type + '@' + event.target.id); - if (list.length < 3) - return; - expected = ['load@shouldLoad', 'error@shouldError', 'click@toClick']; - shouldBe('window.list', 'expected'); - finishJSTest(); -} -</script> -<link id="harness" rel="import" href="resources/events-inline.html"> -</head> -<body> -<script> -window.jsTestIsAsync = true; -description('Test that inline event handler is fired on an imported document.'); -</script> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-events.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-events.html deleted file mode 100644 index bebcc7f..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-events.html +++ /dev/null
@@ -1,32 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script src="../../../resources/js-test.js"></script> -<link id="harness" rel="import" href="resources/import-events-target.html"> -</head> -<body> -<script> -description("Test that events can be fired on imported documents."); - -function handle(list, id, event) -{ - list.push(event.type + "@" + id); -} - -function testEventsFiredOn(doc) -{ - window.caughtFoo = []; - var root = doc.documentElement; - var target = doc.getElementById("target"); - - target.addEventListener("foo", handle.bind(null, caughtFoo, "target")); - root.addEventListener("foo", handle.bind(null, caughtFoo, "root")); - target.dispatchEvent(new CustomEvent("foo", { bubbles: true })); - - shouldBe("window.caughtFoo", "['foo@target', 'foo@root']"); -} - -testEventsFiredOn(harness.import); -</script> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-expando-gc-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-expando-gc-expected.txt deleted file mode 100644 index 75a5200..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-expando-gc-expected.txt +++ /dev/null
@@ -1,11 +0,0 @@ -CONSOLE WARNING: line 5: HTML Imports is deprecated and will be removed in M80, around February 2020. Please use ES modules instead. See https://www.chromestatus.com/features/5144752345317376 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -Properties in imported dom nodes should be retained. - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - -PASS getNodeInImport().foo is "Hello" -PASS getNodeInImport().foo is "Hello" -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-expando-gc.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-expando-gc.html deleted file mode 100644 index 4ff09b9..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-expando-gc.html +++ /dev/null
@@ -1,34 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script src="../../../resources/js-test.js"></script> -<link rel="import" href="resources/hello.html"> -</head> -<body> -<script> -description('Properties in imported dom nodes should be retained.'); - -var importedDocument; - -function getNodeInImport() { - if (!importedDocument) - importedDocument = document.querySelector('link').import; - return importedDocument.querySelector('h1'); -} - -function test(gcFunction) { - (function() { - getNodeInImport().foo = 'Hello'; - })(); - - gcFunction(); - shouldBeEqualToString('getNodeInImport().foo', 'Hello'); -} - -// The minor one should be first. The wrapped node is moved to older space otherwise. -test(GCController.minorCollect.bind(GCController)); -test(GCController.collectAll.bind(GCController)); - -</script> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-ignore-document-write-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-ignore-document-write-expected.txt deleted file mode 100644 index 0283392f..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-ignore-document-write-expected.txt +++ /dev/null
@@ -1,12 +0,0 @@ -CONSOLE WARNING: line 9: HTML Imports is deprecated and will be removed in M80, around February 2020. Please use ES modules instead. See https://www.chromestatus.com/features/5144752345317376 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -CONSOLE WARNING: line 5: Failed to execute 'write' on 'Document': It isn't possible to write into a document from an asynchronously-loaded external script unless it is explicitly opened. -Document.write should be ignored in imports - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - -About to call document.write()... -...after calling document.write() -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-ignore-document-write.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-ignore-document-write.html deleted file mode 100644 index b39a992..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-ignore-document-write.html +++ /dev/null
@@ -1,12 +0,0 @@ -<!DOCTYPE html> -<head> -<script src="../../../resources/js-test.js"></script> -<script> -description("Document.write should be ignored in imports"); -jsTestIsAsync = true; -window.addEventListener("load", function() { finishJSTest(); }); -</script> -<link rel="import" href="resources/script-document-write.html"> -</head> -<body> -</body>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-in-iframe-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-in-iframe-expected.txt deleted file mode 100644 index ddd1251..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-in-iframe-expected.txt +++ /dev/null
@@ -1,7 +0,0 @@ -CONSOLE WARNING: line 29: HTML Imports is deprecated and will be removed in M80, around February 2020. Please use ES modules instead. See https://www.chromestatus.com/features/5144752345317376 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -PASS wrongImport is null -PASS headlineText is "Hello" -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-in-iframe.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-in-iframe.html deleted file mode 100644 index cc0b7ee..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-in-iframe.html +++ /dev/null
@@ -1,10 +0,0 @@ -<!DOCTYPE html> -<html> -<script src="../../../resources/js-test.js"></script> -<body> -<iframe src="resources/child-frame-with-import.html"></iframe> -<script> -window.jsTestIsAsync = true; -</script> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-insert-domcontentloaded-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-insert-domcontentloaded-expected.txt deleted file mode 100644 index 4337184..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-insert-domcontentloaded-expected.txt +++ /dev/null
@@ -1,2 +0,0 @@ -CONSOLE WARNING: line 12: HTML Imports is deprecated and will be removed in M80, around February 2020. Please use ES modules instead. See https://www.chromestatus.com/features/5144752345317376 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -PASS unless crash
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-insert-domcontentloaded.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-insert-domcontentloaded.html deleted file mode 100644 index 962f5f2..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-insert-domcontentloaded.html +++ /dev/null
@@ -1,23 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script> -if (window.testRunner) { - testRunner.waitUntilDone(); - testRunner.dumpAsText(); -} - -document.addEventListener('DOMContentLoaded', function() { - var link = document.createElement('link'); - link.setAttribute('rel', 'import'); - link.setAttribute('href', 'resources/hello.html'); - document.head.appendChild(link); - window.onload = function() { - testRunner.notifyDone(); - }; -}); - -</script> -</head> -<body>PASS unless crash</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-insert-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-insert-expected.txt deleted file mode 100644 index 5b0ba17..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-insert-expected.txt +++ /dev/null
@@ -1,9 +0,0 @@ -CONSOLE WARNING: line 6: HTML Imports is deprecated and will be removed in M80, around February 2020. Please use ES modules instead. See https://www.chromestatus.com/features/5144752345317376 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -It shouldn't be loaded before insertion. -PASS toInsert.import is null -It should be loaded once it is inserted. -PASS toInsert.import.querySelector('h1').innerHTML is 'Hello' -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-insert.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-insert.html deleted file mode 100644 index b2914fe..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-insert.html +++ /dev/null
@@ -1,27 +0,0 @@ -<!DOCTYPE html> - -<script> - jsTestIsAsync = true; -</script> - -<script src="../../../resources/js-test.js"></script> -<script src="resources/import-helpers.js"></script> - -<script> -debug("It shouldn't be loaded before insertion."); - -var placeholder = createPlaceholder(); -var toInsert = document.createElement("link"); -toInsert.setAttribute("rel", "import"); -toInsert.setAttribute("href", "resources/hello.html"); - -placeholder.onload = function() { - shouldBeNull("toInsert.import"); - debug("It should be loaded once it is inserted."); - document.head.appendChild(toInsert); - toInsert.onload = function() { - shouldBe("toInsert.import.querySelector('h1').innerHTML", "'Hello'"); - finishJSTest(); - }; -}; -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-link-with-media-query-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-link-with-media-query-expected.txt deleted file mode 100644 index 5e9543e..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-link-with-media-query-expected.txt +++ /dev/null
@@ -1,2 +0,0 @@ -CONSOLE WARNING: line 13: HTML Imports is deprecated and will be removed in M80, around February 2020. Please use ES modules instead. See https://www.chromestatus.com/features/5144752345317376 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -This test passes if it does not crash under ASAN.
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-link-with-media-query.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-link-with-media-query.html deleted file mode 100644 index 1dcad56..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-link-with-media-query.html +++ /dev/null
@@ -1,14 +0,0 @@ -<!DOCTYPE html> -<script> -if (window.testRunner) { - testRunner.dumpAsText(); - testRunner.waitUntilDone(); - window.addEventListener("load", function() { - if (null == document.querySelector("link").import) - console.log("FAIL"); - requestAnimationFrame(testRunner.notifyDone.bind(testRunner)); - }); -} -</script> -<link href="resources/import-link-with-media-query.html" rel=import> -This test passes if it does not crash under ASAN.
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-mode-quirks.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-mode-quirks.html deleted file mode 100644 index f4a4ad1..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-mode-quirks.html +++ /dev/null
@@ -1,19 +0,0 @@ -<html> -<head> -<script src="../../../resources/testharness.js"></script> -<script src="../../../resources/testharnessreport.js"></script> -<link rel="import" id=withDTD href="resources/hello.html"> -<link rel="import" id=noDTD href="resources/hello-nodtd.html"> -<link rel="import" id=legacyDTD href="resources/hello-legacy.html"> -</head> -<body> -<script> -test(function(){ - assert_equals(document.compatMode, "BackCompat"); - assert_equals(withDTD.import.compatMode, "CSS1Compat"); - assert_equals(noDTD.import.compatMode, "CSS1Compat"); - assert_equals(legacyDTD.import.compatMode, "CSS1Compat"); -}, "Each HTML Import is standard mode regardless of the mode of the client document."); -</script> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-mode-standard.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-mode-standard.html deleted file mode 100644 index 6cda1eb..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-mode-standard.html +++ /dev/null
@@ -1,20 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script src="../../../resources/testharness.js"></script> -<script src="../../../resources/testharnessreport.js"></script> -<link rel="import" id=withDTD href="resources/hello.html"> -<link rel="import" id=noDTD href="resources/hello-nodtd.html"> -<link rel="import" id=legacyDTD href="resources/hello-legacy.html"> -</head> -<body> -<script> -test(function(){ - assert_equals(document.compatMode, "CSS1Compat"); - assert_equals(withDTD.import.compatMode, "CSS1Compat"); - assert_equals(noDTD.import.compatMode, "CSS1Compat"); - assert_equals(legacyDTD.import.compatMode, "CSS1Compat"); -}, "Each HTML Import is standard mode"); -</script> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-nested-dup-2-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-nested-dup-2-expected.txt deleted file mode 100644 index f4e5f2f..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-nested-dup-2-expected.txt +++ /dev/null
@@ -1,24 +0,0 @@ -CONSOLE WARNING: line 23: HTML Imports is deprecated and will be removed in M80, around February 2020. Please use ES modules instead. See https://www.chromestatus.com/features/5144752345317376 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -Test that a subimport should be loaded even if is linked as a top-level import. - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - -PASS marks[i] is expected[i] -PASS marks[i] is expected[i] -PASS marks[i] is expected[i] -PASS marks[i] is expected[i] -PASS marks[i] is expected[i] -PASS marks[i] is expected[i] -PASS marks[i] is expected[i] -PASS marks[i] is expected[i] -PASS marks[i] is expected[i] -PASS marks[i] is expected[i] -PASS marks[i] is expected[i] -PASS marks[i] is expected[i] -PASS marks[i] is expected[i] -PASS marks[i] is expected[i] -PASS marks.length is expected.length -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-nested-dup-2.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-nested-dup-2.html deleted file mode 100644 index a0b311f4..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-nested-dup-2.html +++ /dev/null
@@ -1,49 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script src="../../../resources/js-test.js"></script> -<script> -var marks = []; -function start() -{ - var url = document.currentScript.ownerDocument.URL; - var path = url.match(/[^\/]+$/) - marks.push("START:" + path); -} - -function end() -{ - var url = document.currentScript.ownerDocument.URL; - var path = url.match(/[^\/]+$/) - marks.push("END :" + path); -} - -start(); -</script> -<link id="harness" rel="import" href="resources/nest-dup-grand-parent.html"> -<link id="harness" rel="import" href="resources/nest-dup-2-parent.html"> -</head> -<body> -<script> -end(); -description("Test that a subimport should be loaded even if is linked as a top-level import."); -var expected = ["START:import-nested-dup-2.html", - "START:nest-dup-grand-parent.html", - "START:nest-dup-parent.html", - "START:nest-dup.html", - "START:nest-dup-child.html", - "END :nest-dup-child.html", - "END :nest-dup.html", - "END :nest-dup-parent.html", - "END :nest-dup-grand-parent.html", - "START:nest-dup-2-parent.html", - "START:nest-dup-2.html", - "END :nest-dup-2.html", - "END :nest-dup-2-parent.html", - "END :import-nested-dup-2.html"] -for (var i = 0; i < expected.length; ++i) - shouldBe("marks[i]", "expected[i]"); -shouldBe("marks.length", "expected.length"); -</script> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-nested-dup-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-nested-dup-expected.txt deleted file mode 100644 index c11c9ed..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-nested-dup-expected.txt +++ /dev/null
@@ -1,18 +0,0 @@ -CONSOLE WARNING: line 23: HTML Imports is deprecated and will be removed in M80, around February 2020. Please use ES modules instead. See https://www.chromestatus.com/features/5144752345317376 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -Test that a subimport should be loaded even if is linked as a top-level import. - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - -PASS marks[i] is expected[i] -PASS marks[i] is expected[i] -PASS marks[i] is expected[i] -PASS marks[i] is expected[i] -PASS marks[i] is expected[i] -PASS marks[i] is expected[i] -PASS marks[i] is expected[i] -PASS marks[i] is expected[i] -PASS marks.length is expected.length -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-nested-dup.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-nested-dup.html deleted file mode 100644 index 55d29dd..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-nested-dup.html +++ /dev/null
@@ -1,43 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script src="../../../resources/js-test.js"></script> -<script> -var marks = []; -function start() -{ - var url = document.currentScript.ownerDocument.URL; - var path = url.match(/[^\/]+$/) - marks.push("START:" + path); -} - -function end() -{ - var url = document.currentScript.ownerDocument.URL; - var path = url.match(/[^\/]+$/) - marks.push("END :" + path); -} - -start(); -</script> -<link id="harness" rel="import" href="resources/nest-dup-parent.html"> -<link id="harness" rel="import" href="resources/nest-dup.html"> -</head> -<body> -<script> -end(); -description("Test that a subimport should be loaded even if is linked as a top-level import."); -var expected = ["START:import-nested-dup.html", - "START:nest-dup-parent.html", - "START:nest-dup.html", - "START:nest-dup-child.html", - "END :nest-dup-child.html", - "END :nest-dup.html", - "END :nest-dup-parent.html", - "END :import-nested-dup.html"] -for (var i = 0; i < expected.length; ++i) - shouldBe("marks[i]", "expected[i]"); -shouldBe("marks.length", "expected.length"); -</script> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-normalize-resolve-1-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-normalize-resolve-1-expected.txt deleted file mode 100644 index bf43355..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-normalize-resolve-1-expected.txt +++ /dev/null
@@ -1,14 +0,0 @@ -CONSOLE WARNING: line 9: document.registerElement is deprecated and will be removed in M80, around February 2020. Please use window.customElements.define instead. See https://www.chromestatus.com/features/4642138092470272 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -CONSOLE WARNING: line 11: HTML Imports is deprecated and will be removed in M80, around February 2020. Please use ES modules instead. See https://www.chromestatus.com/features/5144752345317376 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -CONSOLE MESSAGE: line 8: e01 -CONSOLE MESSAGE: line 8: e02 -CONSOLE MESSAGE: line 8: e03 -CONSOLE MESSAGE: line 8: e04 -CONSOLE MESSAGE: line 8: e05 -CONSOLE MESSAGE: line 8: e06 -CONSOLE MESSAGE: line 8: e07 -CONSOLE MESSAGE: line 8: e08 -CONSOLE MESSAGE: line 8: e09 -CONSOLE MESSAGE: line 8: e10 -CONSOLE MESSAGE: line 8: e11 -
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-normalize-resolve-1.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-normalize-resolve-1.html deleted file mode 100644 index b3eaf7fa..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-normalize-resolve-1.html +++ /dev/null
@@ -1,18 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script> -// root=[L(i1),L(i5)] -> i0=[e01,L(i1),e09] -> i1=[e02,L(i2),e08] -> i2=[e03,L(i3),e07] -> i3=[e04,L(i4),e06] -> i4[e05] -// -> i5=[e10,L(i3),e11] -var proto = Object.create(HTMLElement.prototype); -proto.createdCallback = function() { console.log(this.getAttribute('name')); }; -document.registerElement('order-test', {prototype: proto}); -</script> -<link rel="import" href="resources/nr1-i0.html"> -<link rel="import" href="resources/nr1-i5.html"> -<script> -if (window.testRunner) - testRunner.dumpAsText(); -</script> -</head> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-normalize-resolve-2-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-normalize-resolve-2-expected.txt deleted file mode 100644 index fb3d3bc..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-normalize-resolve-2-expected.txt +++ /dev/null
@@ -1,18 +0,0 @@ -CONSOLE WARNING: line 10: document.registerElement is deprecated and will be removed in M80, around February 2020. Please use window.customElements.define instead. See https://www.chromestatus.com/features/4642138092470272 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -CONSOLE WARNING: line 12: HTML Imports is deprecated and will be removed in M80, around February 2020. Please use ES modules instead. See https://www.chromestatus.com/features/5144752345317376 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -CONSOLE MESSAGE: line 9: e01 -CONSOLE MESSAGE: line 9: e02 -CONSOLE MESSAGE: line 9: e03 -CONSOLE MESSAGE: line 9: e04 -CONSOLE MESSAGE: line 9: e05 -CONSOLE MESSAGE: line 9: e06 -CONSOLE MESSAGE: line 9: e07 -CONSOLE MESSAGE: line 9: e08 -CONSOLE MESSAGE: line 9: e09 -CONSOLE MESSAGE: line 9: e10 -CONSOLE MESSAGE: line 9: e11 -CONSOLE MESSAGE: line 9: e12 -CONSOLE MESSAGE: line 9: e13 -CONSOLE MESSAGE: line 9: e14 -CONSOLE MESSAGE: line 9: e15 -
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-normalize-resolve-2.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-normalize-resolve-2.html deleted file mode 100644 index e399e9b..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-normalize-resolve-2.html +++ /dev/null
@@ -1,20 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script> -// root=[L(i1),L(i6),L(i7)] -> i0=[E01,L(i1),E11] -> i1=[E02,L(i2),E10] -> i2=[E03,L(i3),E09] -> i3=[E04,L(i4),E08] -> i4=[E05,L(i5),E07] -> i5=[E06] -// -> i6=[E12,L(i3),E13] -// -> i7=[E14,L(i4),E15] -var proto = Object.create(HTMLElement.prototype); -proto.createdCallback = function() { console.log(this.getAttribute('name')); }; -document.registerElement('order-test', {prototype: proto}); -</script> -<link rel="import" href="resources/nr2-i0.html"> -<link rel="import" href="resources/nr2-i6.html"> -<link rel="import" href="resources/nr2-i7.html"> -<script> -if (window.testRunner) - testRunner.dumpAsText(); -</script> -</head> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-normalize-resolve-3-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-normalize-resolve-3-expected.txt deleted file mode 100644 index d028c7d0d..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-normalize-resolve-3-expected.txt +++ /dev/null
@@ -1,18 +0,0 @@ -CONSOLE WARNING: line 10: document.registerElement is deprecated and will be removed in M80, around February 2020. Please use window.customElements.define instead. See https://www.chromestatus.com/features/4642138092470272 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -CONSOLE WARNING: line 13: HTML Imports is deprecated and will be removed in M80, around February 2020. Please use ES modules instead. See https://www.chromestatus.com/features/5144752345317376 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -CONSOLE MESSAGE: line 9: e01 -CONSOLE MESSAGE: line 9: e02 -CONSOLE MESSAGE: line 9: e03 -CONSOLE MESSAGE: line 9: e04 -CONSOLE MESSAGE: line 9: e05 -CONSOLE MESSAGE: line 9: e06 -CONSOLE MESSAGE: line 9: e07 -CONSOLE MESSAGE: line 9: e08 -CONSOLE MESSAGE: line 9: e09 -CONSOLE MESSAGE: line 9: e10 -CONSOLE MESSAGE: line 9: e11 -CONSOLE MESSAGE: line 9: e12 -CONSOLE MESSAGE: line 9: e13 -CONSOLE MESSAGE: line 9: e14 -CONSOLE MESSAGE: line 9: e15 -
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-normalize-resolve-3.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-normalize-resolve-3.html deleted file mode 100644 index 74cfe04..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-normalize-resolve-3.html +++ /dev/null
@@ -1,21 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script> -// root=[L(i1),L(i6),L(i7)] -> i0=[E01,L(i1),E11] -> i1=[E02,L(i2),E10] -> i2=[E03,L(i3),E09] -> i3=[E04,L(i4),E08] -> i4=[E05,L(i5),E07] -> i5=[E06] -// -> i6=[E12,L(i4),E13] -// -> i7=[E14,L(i3),E15] -var proto = Object.create(HTMLElement.prototype); -proto.createdCallback = function() { console.log(this.getAttribute('name')); }; -document.registerElement('order-test', {prototype: proto}); -</script> -<!-- The first chain is same as nr2-*.html --> -<link rel="import" href="resources/nr2-i0.html"> -<link rel="import" href="resources/nr3-i6.html"> -<link rel="import" href="resources/nr3-i7.html"> -<script> -if (window.testRunner) - testRunner.dumpAsText(); -</script> -</head> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-normalize-resolve-4-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-normalize-resolve-4-expected.txt deleted file mode 100644 index d56aaa7d..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-normalize-resolve-4-expected.txt +++ /dev/null
@@ -1,24 +0,0 @@ -CONSOLE WARNING: line 11: document.registerElement is deprecated and will be removed in M80, around February 2020. Please use window.customElements.define instead. See https://www.chromestatus.com/features/4642138092470272 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -CONSOLE WARNING: line 13: HTML Imports is deprecated and will be removed in M80, around February 2020. Please use ES modules instead. See https://www.chromestatus.com/features/5144752345317376 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -CONSOLE MESSAGE: line 10: e01 -CONSOLE MESSAGE: line 10: e02 -CONSOLE MESSAGE: line 10: e03 -CONSOLE MESSAGE: line 10: e04 -CONSOLE MESSAGE: line 10: e05 -CONSOLE MESSAGE: line 10: e06 -CONSOLE MESSAGE: line 10: e07 -CONSOLE MESSAGE: line 10: e08 -CONSOLE MESSAGE: line 10: e09 -CONSOLE MESSAGE: line 10: e10 -CONSOLE MESSAGE: line 10: e11 -CONSOLE MESSAGE: line 10: e12 -CONSOLE MESSAGE: line 10: e13 -CONSOLE MESSAGE: line 10: e14 -CONSOLE MESSAGE: line 10: e15 -CONSOLE MESSAGE: line 10: e16 -CONSOLE MESSAGE: line 10: e17 -CONSOLE MESSAGE: line 10: e18 -CONSOLE MESSAGE: line 10: e19 -CONSOLE MESSAGE: line 10: e20 -CONSOLE MESSAGE: line 10: e21 -
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-normalize-resolve-4.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-normalize-resolve-4.html deleted file mode 100644 index 6c6c94c..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-normalize-resolve-4.html +++ /dev/null
@@ -1,21 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script> -// root=[L(i0),L(i9),L(ia)] -> i0=[e01,L(i1),e17] -> i1=[e02,L(i2),e16] -> i2=[e03,L(i3),e09,L(i6),e15] -> i3=[e04,L(i4),e08] -> i4=[e05,L(i5),e07] -> i5=[e06] -// -> i6=[e10,L(i7),e14] -> i7=[e11,L(i8),e13] -> i8=[e12] -// -> i9=[e18,L(i4),e19] -// -> ia=[e20,L(i7),e21] -var proto = Object.create(HTMLElement.prototype); -proto.createdCallback = function() { console.log(this.getAttribute('name')); }; -document.registerElement('order-test', {prototype: proto}); -</script> -<link rel="import" href="resources/nr4-i0.html"> -<link rel="import" href="resources/nr4-i9.html"> -<link rel="import" href="resources/nr4-ia.html"> -<script> -if (window.testRunner) - testRunner.dumpAsText(); -</script> -</head> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-normalize-resolve-5-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-normalize-resolve-5-expected.txt deleted file mode 100644 index 9612ec9..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-normalize-resolve-5-expected.txt +++ /dev/null
@@ -1,24 +0,0 @@ -CONSOLE WARNING: line 11: document.registerElement is deprecated and will be removed in M80, around February 2020. Please use window.customElements.define instead. See https://www.chromestatus.com/features/4642138092470272 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -CONSOLE WARNING: line 14: HTML Imports is deprecated and will be removed in M80, around February 2020. Please use ES modules instead. See https://www.chromestatus.com/features/5144752345317376 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -CONSOLE MESSAGE: line 10: e01 -CONSOLE MESSAGE: line 10: e02 -CONSOLE MESSAGE: line 10: e03 -CONSOLE MESSAGE: line 10: e04 -CONSOLE MESSAGE: line 10: e05 -CONSOLE MESSAGE: line 10: e06 -CONSOLE MESSAGE: line 10: e07 -CONSOLE MESSAGE: line 10: e08 -CONSOLE MESSAGE: line 10: e09 -CONSOLE MESSAGE: line 10: e10 -CONSOLE MESSAGE: line 10: e11 -CONSOLE MESSAGE: line 10: e12 -CONSOLE MESSAGE: line 10: e13 -CONSOLE MESSAGE: line 10: e14 -CONSOLE MESSAGE: line 10: e15 -CONSOLE MESSAGE: line 10: e16 -CONSOLE MESSAGE: line 10: e17 -CONSOLE MESSAGE: line 10: e18 -CONSOLE MESSAGE: line 10: e19 -CONSOLE MESSAGE: line 10: e20 -CONSOLE MESSAGE: line 10: e21 -
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-normalize-resolve-5.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-normalize-resolve-5.html deleted file mode 100644 index e3238ff..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-normalize-resolve-5.html +++ /dev/null
@@ -1,22 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script> -// root=[L(i0),L(i9),L(ia)] -> i0=[e01,L(i1),e17] -> i1=[e02,L(i2),e16] -> i2=[e03,L(i3),e09,L(i6),e15] -> i3=[e04,L(i4),e08] -> i4=[e05,L(i5),e07] -> i5=[e06] -// -> i6=[e10,L(i7),e14] -> i7=[e11,L(i8),e13] -> i8=[e12] -// -> i9=[e18,L(i7),e19] -// -> ia=[e20,L(i4),e21] -var proto = Object.create(HTMLElement.prototype); -proto.createdCallback = function() { console.log(this.getAttribute('name')); }; -document.registerElement('order-test', {prototype: proto}); -</script> -<!-- The first chain is same as nr4 --> -<link rel="import" href="resources/nr4-i0.html"> -<link rel="import" href="resources/nr5-i9.html"> -<link rel="import" href="resources/nr5-ia.html"> -<script> -if (window.testRunner) - testRunner.dumpAsText(); -</script> -</head> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-onerror-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-onerror-expected.txt deleted file mode 100644 index ed99c545..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-onerror-expected.txt +++ /dev/null
@@ -1,6 +0,0 @@ -CONSOLE WARNING: line 19: HTML Imports is deprecated and will be removed in M80, around February 2020. Please use ES modules instead. See https://www.chromestatus.com/features/5144752345317376 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -PASS ['invalid', 'notFound', 'notFoundShared'] is givenLoadEventTargets.sort() -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-onerror.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-onerror.html deleted file mode 100644 index 050612b..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-onerror.html +++ /dev/null
@@ -1,24 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script src="../../../resources/js-test.js"></script> -<script> -window.jsTestIsAsync = true; -testRunner.waitUntilDone(); - -var givenLoadEventTargets = []; -function handleError(event) -{ - givenLoadEventTargets.push(event.target.id); - if (givenLoadEventTargets.length == 3) { - shouldBe("['invalid', 'notFound', 'notFoundShared']", "givenLoadEventTargets.sort()"); - finishJSTest(); - } -} -</script> -<link id="notFound" rel="import" href="notfound.html" onerror="handleError(event)"> -<link id="notFoundShared" rel="import" href="notfound.html" onerror="handleError(event)"> -<link id="invalid" rel="import" href="" onerror="handleError(event)"> -</head> -<body></body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-onload-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-onload-expected.txt deleted file mode 100644 index 219a301..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-onload-expected.txt +++ /dev/null
@@ -1,6 +0,0 @@ -CONSOLE WARNING: line 19: HTML Imports is deprecated and will be removed in M80, around February 2020. Please use ES modules instead. See https://www.chromestatus.com/features/5144752345317376 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -PASS ['bye', 'hello1', 'hello2', 'hello3'] is givenLoadEventTargets.sort() -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-onload-with-stylesheets-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-onload-with-stylesheets-expected.txt deleted file mode 100644 index 9d6ab4a..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-onload-with-stylesheets-expected.txt +++ /dev/null
@@ -1,6 +0,0 @@ -CONSOLE WARNING: line 14: HTML Imports is deprecated and will be removed in M80, around February 2020. Please use ES modules instead. See https://www.chromestatus.com/features/5144752345317376 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -PASS event.target.import.querySelector('link').sheet instanceof StyleSheet is true -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-onload-with-stylesheets.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-onload-with-stylesheets.html deleted file mode 100644 index b21a942..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-onload-with-stylesheets.html +++ /dev/null
@@ -1,14 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script src="../../../resources/js-test.js"></script> -<script> -window.jsTestIsAsync = true; - -function importLoaded(event) -{ - shouldBeTrue("event.target.import.querySelector('link').sheet instanceof StyleSheet"); - finishJSTest(); -} -</script> -<link rel="import" href="resources/hello-css.html" onload="importLoaded(event)">
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-onload.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-onload.html deleted file mode 100644 index 6a2238bf..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-onload.html +++ /dev/null
@@ -1,33 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script src="../../../resources/js-test.js"></script> -<script> -window.jsTestIsAsync = true; -testRunner.waitUntilDone(); - -var givenLoadEventTargets = []; -function handleLoad(event) -{ - givenLoadEventTargets.push(event.target.id); - if (givenLoadEventTargets.length == 4) { - shouldBe("['bye', 'hello1', 'hello2', 'hello3']", "givenLoadEventTargets.sort()"); - finishJSTest(); - } -} -</script> -<link id="hello1" rel="import" href="resources/hello.html" onload="handleLoad(event)"> -<link id="hello2" rel="import" href="resources/hello.html" onload="handleLoad(event)"> -</head> -<body> -<script> -var linkToInsert = document.createElement("link"); -linkToInsert.id = "bye"; -linkToInsert.setAttribute("rel", "import"); -linkToInsert.setAttribute("href", "resources/bye.html"); -linkToInsert.onload = handleLoad; -document.head.appendChild(linkToInsert); -</script> -<link id="hello3" rel="import" href="resources/hello.html" onload="handleLoad(event)"> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-readd-dup-nested.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-readd-dup-nested.html deleted file mode 100644 index 2630f89..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-readd-dup-nested.html +++ /dev/null
@@ -1,34 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script src="../../../resources/testharness.js"></script> -<script src="../../../resources/testharnessreport.js"></script> -<link rel=import id=redImport href="./resources/style-red.html"> -<link rel=import id=blueImport href="./resources/style-blue.html"> -<link rel=import id=redImportDup href="./resources/style-red-parent.html"> -</head> -<body> -<h1 class="target">Should be red</h1> -<h1 class="another-red-target">Should be red</h1> -<script> -var t = async_test('Styles are re-applied in correct ordder after removed imports are re-added in new place'); -window.onload = function() { - t.step(function() { - var firstLink = document.querySelector('#redImport') - var dupLink = document.querySelector('#redImportDup'); - document.head.removeChild(dupLink); - assert_equals(window.getComputedStyle(document.querySelector('.target')).color, 'rgb(0, 0, 255)', 'Removal reveals shadowed style.'); - assert_equals(window.getComputedStyle(document.querySelector('.another-red-target')).color, 'rgb(255, 0, 0)', 'But sheet is still there.'); - - document.head.removeChild(firstLink); - document.head.appendChild(dupLink); - assert_equals(window.getComputedStyle(document.querySelector('.target')).color, 'rgb(255, 0, 0)', 'Used-to-be-a-dup sheet is applied now.'); - assert_equals(window.getComputedStyle(document.querySelector('.another-red-target')).color, 'rgb(255, 0, 0)', 'That means this should be applied as well.'); - - Array.prototype.forEach.call(document.querySelectorAll("h1"), function(e) { e.style.display = "none"; }); - t.done(); - }); -} -</script> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-readd-dup-order.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-readd-dup-order.html deleted file mode 100644 index fca3cddc..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-readd-dup-order.html +++ /dev/null
@@ -1,34 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script src="../../../resources/testharness.js"></script> -<script src="../../../resources/testharnessreport.js"></script> -<link rel=import id=redImport href="./resources/style-red.html"> -<link rel=import id=blueImport href="./resources/style-blue.html"> -<link rel=import id=redImportDup href="./resources/style-red.html"> -</head> -<body> -<h1 class="target">Should be red</h1> -<h1 class="another-red-target">Should be red</h1> -<script> -var t = async_test('Styles are re-applied in correct ordder after removed imports are re-added in new place'); -window.onload = function() { - t.step(function() { - var firstLink = document.querySelector('#redImport') - var dupLink = document.querySelector('#redImportDup'); - document.head.removeChild(dupLink); - assert_equals(window.getComputedStyle(document.querySelector('.target')).color, 'rgb(0, 0, 255)', 'Removal reveals shadowed style.'); - assert_equals(window.getComputedStyle(document.querySelector('.another-red-target')).color, 'rgb(255, 0, 0)', 'But sheet is still there.'); - - document.head.removeChild(firstLink); - document.head.appendChild(dupLink); - assert_equals(window.getComputedStyle(document.querySelector('.target')).color, 'rgb(255, 0, 0)', 'Used-to-be-a-dup sheet is applied now.'); - assert_equals(window.getComputedStyle(document.querySelector('.another-red-target')).color, 'rgb(255, 0, 0)', 'That means this should be applied as well.'); - - Array.prototype.forEach.call(document.querySelectorAll("h1"), function(e) { e.style.display = "none"; }); - t.done(); - }); -} -</script> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-readd-nested.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-readd-nested.html deleted file mode 100644 index 6f5219e..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-readd-nested.html +++ /dev/null
@@ -1,24 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script src="../../../resources/testharness.js"></script> -<script src="../../../resources/testharnessreport.js"></script> -<link rel=import href="./resources/style-red-parent.html"> -</head> -<body> -<h1 class="target">Should be red</h1> -<script> -var t = async_test('Styles in grandchild are re-applied after removed imports are re-added'); -window.onload = function() { - t.step(function() { - var importLink = document.querySelector('link'); - document.head.removeChild(importLink); - document.head.appendChild(importLink); - assert_equals(window.getComputedStyle(document.querySelector('.target')).color, 'rgb(255, 0, 0)'); - Array.prototype.forEach.call(document.querySelectorAll("h1"), function(e) { e.style.display = "none"; }); - t.done(); - }); -} -</script> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-readd-order-1.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-readd-order-1.html deleted file mode 100644 index f2da6b4..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-readd-order-1.html +++ /dev/null
@@ -1,26 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script src="../../../resources/testharness.js"></script> -<script src="../../../resources/testharnessreport.js"></script> -<link rel=import id=redImport href="./resources/style-red.html"> -<link rel=import id=blueImport href="./resources/style-blue.html"> -</head> -<body> -<h1 class="target">Should be red</h1> -<script> -var t = async_test('Styles are re-applied in correct ordder after removed imports are re-added in new place'); -window.onload = function() { - t.step(function() { - assert_equals(window.getComputedStyle(document.querySelector('.target')).color, 'rgb(0, 0, 255)'); - var importLink = document.querySelector('#redImport'); - document.head.removeChild(importLink); - document.head.appendChild(importLink); - assert_equals(window.getComputedStyle(document.querySelector('.target')).color, 'rgb(255, 0, 0)'); - Array.prototype.forEach.call(document.querySelectorAll("h1"), function(e) { e.style.display = "none"; }); - t.done(); - }); -} -</script> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-readd-order-2.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-readd-order-2.html deleted file mode 100644 index 3c93f9d..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-readd-order-2.html +++ /dev/null
@@ -1,26 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script src="../../../resources/testharness.js"></script> -<script src="../../../resources/testharnessreport.js"></script> -<link rel=import id=redImport href="./resources/style-red.html"> -<link rel=import id=blueImport href="./resources/style-blue.html"> -</head> -<body> -<h1 class="target">Should be red</h1> -<script> -var t = async_test('Styles are re-applied in correct ordder after removed imports are re-added in new place'); -window.onload = function() { - t.step(function() { - assert_equals(window.getComputedStyle(document.querySelector('.target')).color, 'rgb(0, 0, 255)'); - var importLink = document.querySelector('#blueImport'); - document.head.removeChild(importLink); - document.head.insertBefore(importLink, document.head.lastElementChild); - assert_equals(window.getComputedStyle(document.querySelector('.target')).color, 'rgb(255, 0, 0)'); - Array.prototype.forEach.call(document.querySelectorAll("h1"), function(e) { e.style.display = "none"; }); - t.done(); - }); -} -</script> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-readd.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-readd.html deleted file mode 100644 index 7686c67..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-readd.html +++ /dev/null
@@ -1,24 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script src="../../../resources/testharness.js"></script> -<script src="../../../resources/testharnessreport.js"></script> -<link rel=import href="./resources/style-red.html"> -</head> -<body> -<h1 class="target">Should be red</h1> -<script> -var t = async_test('Styles are re-applied after removed imports are re-added'); -window.onload = function() { - t.step(function() { - var importLink = document.querySelector('link'); - document.head.removeChild(importLink); - document.head.appendChild(importLink); - assert_equals(window.getComputedStyle(document.querySelector('.target')).color, 'rgb(255, 0, 0)'); - Array.prototype.forEach.call(document.querySelectorAll("h1"), function(e) { e.style.display = "none"; }); - t.done(); - }); -} -</script> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-remove-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-remove-expected.txt deleted file mode 100644 index f0114b3..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-remove-expected.txt +++ /dev/null
@@ -1,10 +0,0 @@ -CONSOLE WARNING: line 5: HTML Imports is deprecated and will be removed in M80, around February 2020. Please use ES modules instead. See https://www.chromestatus.com/features/5144752345317376 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -PASS hello.import is non-null. -Node removal should make import deleted. -PASS hello.import is null -Re-inserting it shouldn't help. -PASS hello.import is non-null. -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-remove.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-remove.html deleted file mode 100644 index 5ffc20e..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-remove.html +++ /dev/null
@@ -1,26 +0,0 @@ -<!DOCTYPE html> -<html> -<script src="../../../resources/js-test.js"></script> -<head> -<link id="hello" rel="import" href="resources/hello.html"> -</head> -<body> -<script> -jsTestIsAsync = true; -var hello = document.getElementById("hello"); -shouldBeNonNull("hello.import"); - -debug("Node removal should make import deleted."); -hello.parentNode.removeChild(hello); -shouldBeNull("hello.import"); - -debug("Re-inserting it shouldn't help."); -document.head.appendChild(hello); -window.setTimeout(function() { - shouldBeNonNull("hello.import"); - finishJSTest(); -}, 0); - -</script> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-same-url-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-same-url-expected.txt deleted file mode 100644 index 98dd4e5..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-same-url-expected.txt +++ /dev/null
@@ -1,8 +0,0 @@ -CONSOLE WARNING: line 5: HTML Imports is deprecated and will be removed in M80, around February 2020. Please use ES modules instead. See https://www.chromestatus.com/features/5144752345317376 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -PASS target1.import is non-null. -PASS target1.import is target2.import -PASS target1.import is target3.import -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-same-url.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-same-url.html deleted file mode 100644 index b7dbff7..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-same-url.html +++ /dev/null
@@ -1,16 +0,0 @@ -<!DOCTYPE html> -<html> -<script src="../../../resources/js-test.js"></script> -<head> -<link id="target1" rel="import" href="resources/hello.html"> -<link id="target2" rel="import" href="resources/hello.html"> -<link id="target3" rel="import" href="resources/hello.html#fragment"> -</head> -<body> -<script> -shouldBeNonNull("target1.import"); -shouldBe("target1.import", "target2.import"); -shouldBe("target1.import", "target3.import"); -</script> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-script-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-script-expected.txt deleted file mode 100644 index c1a96ad..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-script-expected.txt +++ /dev/null
@@ -1,20 +0,0 @@ -CONSOLE WARNING: line 26: HTML Imports is deprecated and will be removed in M80, around February 2020. Please use ES modules instead. See https://www.chromestatus.com/features/5144752345317376 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -Test that scripts in imported documents are executed - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - -PASS givenDocument is document -PASS givenDocument.currentScript.ownerDocument is leaf.import -PASS givenDocument is document -PASS givenDocument.currentScript.ownerDocument is leaf.import -PASS givenDocument is document -PASS givenDocument.currentScript.ownerDocument is leaf.import -PASS givenDocument is document -PASS givenDocument.currentScript.ownerDocument is leaf.import -PASS givenDocument is document -PASS givenDocument.currentScript.ownerDocument is leaf.import -PASS labels is loadedLabels -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-script-prototypes-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-script-prototypes-expected.txt deleted file mode 100644 index 584c8d59..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-script-prototypes-expected.txt +++ /dev/null
@@ -1,16 +0,0 @@ -CONSOLE WARNING: line 7: HTML Imports is deprecated and will be removed in M80, around February 2020. Please use ES modules instead. See https://www.chromestatus.com/features/5144752345317376 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -This test ensures each import and client is in same JS context. - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - -PASS stringInClient.__proto__ is stringInImport.__proto__ -PASS thisDocument !== document is true -PASS thisDocument.__proto__ is document.__proto__ -PASS thisDocument.head.__proto__ is document.head.__proto__ -PASS (new Image()).ownerDocument is document -PASS thisDocument.createElement('div').ownerDocument is thisDocument -PASS document.createElement('div').ownerDocument is document -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-script-prototypes.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-script-prototypes.html deleted file mode 100644 index e58c7951..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-script-prototypes.html +++ /dev/null
@@ -1,12 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script> -var stringInClient = "Client"; -</script> -<link id="target" rel="import" href="resources/script-prototype-test.html"> -<script> -</script> -</head> -</html> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-script.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-script.html deleted file mode 100644 index c3926fdb..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-script.html +++ /dev/null
@@ -1,42 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script src="../../../resources/js-test.js"></script> -<script> -var loadedScripts = []; -var numLoaded = 0; -var labels = ["InlineParser", "InlineDynamic", "ExternalParser", "ExternalDynamic", "ExternalAsync"].sort(); - -document.notifyLoaded = function(label, doc) -{ - givenDocument = doc; - shouldBe("givenDocument", "document"); - shouldBe("givenDocument.currentScript.ownerDocument", "leaf.import"); - - loadedScripts.push({ label: label, document: document, script: document.currentScript, order: numLoaded++ }); - if (labels.length != numLoaded) - return; - - loadedLabels = loadedScripts.map(function(o) { return o.label; }).sort(); - shouldBe("labels", "loadedLabels"); - - finishJSTest(); -}; -</script> -<link id="leaf" rel="import" href="resources/script-leaf.html"> -</head> -<body> -<script> -description("Test that scripts in imported documents are executed"); -window.jsTestIsAsync = true; - -var dynamicallyInsertedInlineScript = leaf.import.createElement("script"); -dynamicallyInsertedInlineScript.innerHTML = "document.notifyLoaded('InlineDynamic', document);" -leaf.import.body.appendChild(dynamicallyInsertedInlineScript); - -var dynamicallyInsertedExternalScript = leaf.import.createElement("script"); -dynamicallyInsertedExternalScript.setAttribute("src", "script-leaf-external-dynamic.js"); -leaf.import.body.appendChild(dynamicallyInsertedExternalScript); -</script> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-shared-crash-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-shared-crash-expected.txt deleted file mode 100644 index f605e19d..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-shared-crash-expected.txt +++ /dev/null
@@ -1,6 +0,0 @@ -CONSOLE WARNING: line 5: HTML Imports is deprecated and will be removed in M80, around February 2020. Please use ES modules instead. See https://www.chromestatus.com/features/5144752345317376 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -PASS unless crash. -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-shared-crash.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-shared-crash.html deleted file mode 100644 index 6533cad..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-shared-crash.html +++ /dev/null
@@ -1,10 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script src="../../../resources/js-test.js"></script> -<link rel="import" href="resources/shared-crash-root.html"> -</head> -<script> -debug("PASS unless crash.") -</script> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-shared-remove.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-shared-remove.html deleted file mode 100644 index 04fc16e..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-shared-remove.html +++ /dev/null
@@ -1,36 +0,0 @@ -<!DOCTYPE html> -<html> -<script src="../../../resources/testharness.js"></script> -<script src="../../../resources/testharnessreport.js"></script> -<head> -<link id="main" rel="import" href="resources/hello.html"> -<link id="shared1" rel="import" href="resources/hello.html"> -<link id="shared2" rel="import" href="resources/hello.html"> -</head> -<body> -<script> -test(function() { - var main = document.getElementById("main"); - var shared1 = document.getElementById("shared1"); - var shared2 = document.getElementById("shared2"); - - assert_true(main.import != null); - assert_true(shared1.import != null); - assert_true(shared2.import != null); - - document.head.removeChild(shared1); - assert_true(main.import != null); - assert_true(shared1.import == null); - assert_true(shared2.import != null); - - document.head.removeChild(main); - assert_true(main.import == null); - assert_true(shared1.import == null); - assert_true(shared2.import != null); - -}, -"Check that change on a link with same url doesn't affect others." -); -</script> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-style-append-to-main-after-load-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-style-append-to-main-after-load-expected.txt deleted file mode 100644 index 3b825b21..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-style-append-to-main-after-load-expected.txt +++ /dev/null
@@ -1,2 +0,0 @@ -CONSOLE WARNING: line 8: HTML Imports is deprecated and will be removed in M80, around February 2020. Please use ES modules instead. See https://www.chromestatus.com/features/5144752345317376 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -This test checks that style is applied w/o deprecation warning.
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-style-append-to-main-after-load.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-style-append-to-main-after-load.html deleted file mode 100644 index c14f52ee..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-style-append-to-main-after-load.html +++ /dev/null
@@ -1,9 +0,0 @@ -<!DOCTYPE html> -<script> -if (window.testRunner) { - testRunner.dumpAsText(); - testRunner.waitUntilDone(); -} -</script> -<link rel="import" href="resources/style-append-to-main-after-load.html"> -This test checks that style is applied w/o deprecation warning.
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-style-append-to-main-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-style-append-to-main-expected.txt deleted file mode 100644 index 1964729..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-style-append-to-main-expected.txt +++ /dev/null
@@ -1,2 +0,0 @@ -CONSOLE WARNING: line 11: HTML Imports is deprecated and will be removed in M80, around February 2020. Please use ES modules instead. See https://www.chromestatus.com/features/5144752345317376 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -This test checks that style is applied w/o deprecation warning.
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-style-append-to-main.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-style-append-to-main.html deleted file mode 100644 index e1dd686..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-style-append-to-main.html +++ /dev/null
@@ -1,12 +0,0 @@ -<!DOCTYPE html> -<script> - if (window.testRunner) { - testRunner.dumpAsText(); - testRunner.waitUntilDone(); - window.addEventListener("load", function () { - requestAnimationFrame(testRunner.notifyDone.bind(testRunner)); - }); - } -</script> -<link rel="import" href="resources/style-append-to-main.html"> -This test checks that style is applied w/o deprecation warning.
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-style-basic-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-style-basic-expected.txt deleted file mode 100644 index 1fd891c..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-style-basic-expected.txt +++ /dev/null
@@ -1,26 +0,0 @@ -CONSOLE WARNING: line 5: HTML Imports is deprecated and will be removed in M80, around February 2020. Please use ES modules instead. See https://www.chromestatus.com/features/5144752345317376 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -PASS document.styleSheets.length is 2 -PASS importLink.import.styleSheets.length is 1 -PASS window.getComputedStyle(shouldBeBlue).color is "rgb(0, 0, 255)" -PASS window.getComputedStyle(shouldBeYellow).color is "rgb(255, 255, 0)" -PASS window.getComputedStyle(shouldBeWhite).color is "rgb(255, 255, 255)" -PASS window.getComputedStyle(shouldBeTeal).color is "rgb(0, 128, 128)" -PASS window.getComputedStyle(shouldBeGreen).color is "rgb(0, 0, 0)" -PASS window.getComputedStyle(shouldBeGreen).color is "rgb(0, 128, 0)" -PASS importLink.import.styleSheets.length is 2 -PASS window.getComputedStyle(shouldBeBlue).color is "rgb(0, 0, 0)" -PASS window.getComputedStyle(shouldBeGreen).color is "rgb(0, 0, 0)" -PASS importLink.import.styleSheets.length is 0 -PASS window.getComputedStyle(shouldBeAqua).color is "rgb(0, 255, 255)" -PASS importLinkDynamic.import.styleSheets.length is 1 -PASS successfullyParsed is true - -TEST COMPLETE - -These elements should be styled appropriately: -Should be blue. -Should be white. -Should be yellow. -Should be teal. -Should become green. -Should become aqua.
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-style-basic.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-style-basic.html deleted file mode 100644 index 7a50382..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-style-basic.html +++ /dev/null
@@ -1,69 +0,0 @@ -<!DOCTYPE html> -<html> -<script src="../../../resources/js-test.js"></script> -<head> -<link id="importLink" rel="import" href="resources/style-basic-child.html"> -<style> -.red-from-import { - color: white; // Overriding with white. -}; -</style> -</head> -<body> -<h1>These elements should be styled appropriately:</h1> -<div id="testContainer"> - <div id="shouldBeBlue" class="blue-from-import">Should be blue.</div> - <div id="shouldBeWhite" class="red-from-import">Should be white.</div> - <div id="shouldBeYellow" class="yellow-from-import">Should be yellow.</div> - <div id="shouldBeTeal" class="gray-from-subimport">Should be teal.</div> - <div id="shouldBeGreen" class="green-from-import">Should become green.</div> - <div id="shouldBeAqua" class="aqua-from-import">Should become aqua.</div> -</div> - -<script> -window.jsTestIsAsync = true; - -// client's CSSOM contains client's sheets only. -shouldBe("document.styleSheets.length", "2"); // Extra one comes from js-test.js -// Import's CSS should have its own -shouldBe("importLink.import.styleSheets.length", "1"); - -// a trivial case -shouldBeEqualToString("window.getComputedStyle(shouldBeBlue).color", "rgb(0, 0, 255)"); -// Nested case -shouldBeEqualToString("window.getComputedStyle(shouldBeYellow).color", "rgb(255, 255, 0)"); -// Overriding import from the client -shouldBeEqualToString("window.getComputedStyle(shouldBeWhite).color", "rgb(255, 255, 255)"); -// Overriding subimport from parent import -shouldBeEqualToString("window.getComputedStyle(shouldBeTeal).color", "rgb(0, 128, 128)"); - -// Dynamically adding -shouldBeEqualToString("window.getComputedStyle(shouldBeGreen).color", "rgb(0, 0, 0)"); -var styleWithGreen = importLink.import.createElement("style"); -styleWithGreen.innerHTML = ".green-from-import { color: green; }"; -importLink.import.head.appendChild(styleWithGreen); -shouldBeEqualToString("window.getComputedStyle(shouldBeGreen).color", "rgb(0, 128, 0)"); -shouldBe("importLink.import.styleSheets.length", "2"); - -// Dyanically removing -Array.prototype.forEach.call(importLink.import.querySelectorAll("style"), function(e) { e.remove(); }); -shouldBeEqualToString("window.getComputedStyle(shouldBeBlue).color", "rgb(0, 0, 0)"); -shouldBeEqualToString("window.getComputedStyle(shouldBeGreen).color", "rgb(0, 0, 0)"); -shouldBe("importLink.import.styleSheets.length", "0"); - -// Dymically adding an import -var dynamicLink = document.createElement("link"); -dynamicLink.setAttribute("rel", "import"); -dynamicLink.id = "importLinkDynamic"; -dynamicLink.setAttribute("href", "resources/style-basic-child-dynamic.html"); -dynamicLink.onload = function() { - shouldBeEqualToString("window.getComputedStyle(shouldBeAqua).color", "rgb(0, 255, 255)"); - shouldBe("importLinkDynamic.import.styleSheets.length", "1"); - finishJSTest(); -}; - -document.head.appendChild(dynamicLink); - -</script> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-style-link-block-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-style-link-block-expected.txt deleted file mode 100644 index 4abfe4c..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-style-link-block-expected.txt +++ /dev/null
@@ -1,7 +0,0 @@ -CONSOLE WARNING: line 3: HTML Imports is deprecated and will be removed in M80, around February 2020. Please use ES modules instead. See https://www.chromestatus.com/features/5144752345317376 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -PASS childStyleLink.sheet.title is "Script Blocker" -PASS importLink.import is non-null. -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-style-link-block.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-style-link-block.html deleted file mode 100644 index f99d261..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-style-link-block.html +++ /dev/null
@@ -1,6 +0,0 @@ -<!DOCTYPE html> -<script src="../../../resources/js-test.js"></script> -<link id="importLink" rel="import" href="resources/style-link-block-child.html"> -<script> -shouldBeNonNull("importLink.import"); -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-style-link-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-style-link-expected.txt deleted file mode 100644 index dc595a9..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-style-link-expected.txt +++ /dev/null
@@ -1,22 +0,0 @@ -CONSOLE WARNING: line 5: HTML Imports is deprecated and will be removed in M80, around February 2020. Please use ES modules instead. See https://www.chromestatus.com/features/5144752345317376 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -PASS childStyleLink.sheet.title is "Script Blocker" -PASS window.getComputedStyle(shouldBeBlue).color is "rgb(0, 0, 255)" -PASS window.getComputedStyle(shouldBeAqua).color is "rgb(0, 255, 255)" -PASS window.getComputedStyle(shouldBeYellow).color is "rgb(255, 255, 0)" -PASS window.getComputedStyle(shouldBeWhite).color is "rgb(255, 255, 255)" -PASS window.getComputedStyle(shouldBeTeal).color is "rgb(0, 128, 128)" -PASS window.getComputedStyle(shouldBeGreen).color is "rgb(0, 0, 0)" -PASS window.getComputedStyle(shouldBeGreen).color is "rgb(0, 128, 0)" -PASS window.getComputedStyle(shouldBeBlue).color is "rgb(0, 0, 0)" -PASS window.getComputedStyle(shouldBeGreen).color is "rgb(0, 0, 0)" -PASS successfullyParsed is true - -TEST COMPLETE - -These elements should be styled appropriately: -Should be blue. -Should become aqua. -Should be white. -Should be yellow. -Should be teal. -Should become green.
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-style-link.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-style-link.html deleted file mode 100644 index 0134f6d6..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-style-link.html +++ /dev/null
@@ -1,56 +0,0 @@ -<!DOCTYPE html> -<html> -<script src="../../../resources/js-test.js"></script> -<head> -<link id="importLink" rel="import" href="resources/style-link-child.html"> -<style> -.red-from-import { - color: white; // Overriding with white. -}; -</style> -</head> -<body> -<h1>These elements should be styled appropriately:</h1> -<div id="testContainer"> - <div id="shouldBeBlue" class="blue-from-import">Should be blue.</div> - <div id="shouldBeAqua" class="aqua-from-import">Should become aqua.</div> - <div id="shouldBeWhite" class="red-from-import">Should be white.</div> - <div id="shouldBeYellow" class="yellow-from-import">Should be yellow.</div> - <div id="shouldBeTeal" class="gray-from-subimport">Should be teal.</div> - <div id="shouldBeGreen" class="green-from-import">Should become green.</div> -</div> - -<script> -window.jsTestIsAsync = true; - -// a trivial case -shouldBeEqualToString("window.getComputedStyle(shouldBeBlue).color", "rgb(0, 0, 255)"); -// @import from rel=import-ed stylesheet -shouldBeEqualToString("window.getComputedStyle(shouldBeAqua).color", "rgb(0, 255, 255)"); -// Nested case -shouldBeEqualToString("window.getComputedStyle(shouldBeYellow).color", "rgb(255, 255, 0)"); -// Overriding import from the client -shouldBeEqualToString("window.getComputedStyle(shouldBeWhite).color", "rgb(255, 255, 255)"); -// Overriding subimport from parent import -shouldBeEqualToString("window.getComputedStyle(shouldBeTeal).color", "rgb(0, 128, 128)"); - -// Dynamically adding -shouldBeEqualToString("window.getComputedStyle(shouldBeGreen).color", "rgb(0, 0, 0)"); -var linkWithGreen = importLink.import.createElement("link"); -linkWithGreen.setAttribute("href", "style-link-dynamic.css"); -linkWithGreen.setAttribute("rel", "stylesheet"); -linkWithGreen.setAttribute("type", "text/css"); -importLink.import.head.appendChild(linkWithGreen); -linkWithGreen.onload = function() { - shouldBeEqualToString("window.getComputedStyle(shouldBeGreen).color", "rgb(0, 128, 0)"); - - // Dyanically removing - Array.prototype.forEach.call(importLink.import.querySelectorAll("link"), function(e) { e.remove(); }); - shouldBeEqualToString("window.getComputedStyle(shouldBeBlue).color", "rgb(0, 0, 0)"); - shouldBeEqualToString("window.getComputedStyle(shouldBeGreen).color", "rgb(0, 0, 0)"); - finishJSTest(); -} - -</script> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-style-no-quirks.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-style-no-quirks.html deleted file mode 100644 index ce64d363..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-style-no-quirks.html +++ /dev/null
@@ -1,46 +0,0 @@ -<!DOCTYPE html> -<html> -<head> - <script src="../../../resources/testharness.js"></script> - <script src="../../../resources/testharnessreport.js"></script> - <link rel="import" href="resources/import-quirks.html"> - <link rel="import" href="resources/import-no-quirks.html"> -</head> -<body> - <div id="MyElement">MyElement</div> - <div class="MyClass" id="OtherElement">OtherElement</div> -</body> -<script> -'use strict'; - -let client_my_el = document.getElementById('MyElement'); -let client_my_class = document.getElementById('OtherElement'); - -test(() => { - assert_equals(document.compatMode, 'CSS1Compat'); -}, 'This document should be in no quirks mode.'); - -test(() => { - assert_equals(document.getElementById('myelement'), null); - assert_equals(document.getElementById('MyElement'), client_my_el); - assert_equals(document.getElementById('MYELEMENT'), null); -}, 'getElementById should be case sensitive regardless of mode.'); - -test(() => { - assert_equals(document.getElementsByClassName('myclass').length, 0); - assert_equals(document.getElementsByClassName('MyClass')[0], - client_my_class); - assert_equals(document.getElementsByClassName('MYCLASS').length, 0); -}, 'getElementsByClassName should be case sensitive in no quirks mode.'); - -test(() => { - assert_equals(document.querySelector('#myelement'), null); - assert_equals(document.querySelector('#MyElement'), client_my_el); - assert_equals(document.querySelector('#MYELEMENT'), null); - - assert_equals(document.querySelector('.myclass'), null); - assert_equals(document.querySelector('.MyClass'), client_my_class); - assert_equals(document.querySelector('.MYCLASS'), null); -}, 'querySelector should be case sensitive when in no quirks mode.'); -</script> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-style-quirks.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-style-quirks.html deleted file mode 100644 index 76ad769d..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-style-quirks.html +++ /dev/null
@@ -1,48 +0,0 @@ -<!-- quirks mode --> -<html> -<head> - <script src="../../../resources/testharness.js"></script> - <script src="../../../resources/testharnessreport.js"></script> - <link rel="import" href="resources/import-quirks.html"> - <link rel="import" href="resources/import-no-quirks.html"> -</head> -<body> - <div id="MyElement">MyElement</div> - <div class="MyClass" id="OtherElement">OtherElement</div> -</body> -<script> -'use strict'; - -let client_my_el = document.getElementById('MyElement'); -let client_my_class = document.getElementById('OtherElement'); - -test(() => { - assert_equals(document.compatMode, 'BackCompat'); -}, 'This document should be in quirks mode.'); - -test(() => { - assert_equals(document.getElementById('myelement'), null); - assert_equals(document.getElementById('MyElement'), client_my_el); - assert_equals(document.getElementById('MYELEMENT'), null); -}, 'getElementById should be case sensitive regardless of mode.'); - -test(() => { - assert_equals(document.getElementsByClassName('myclass')[0], - client_my_class); - assert_equals(document.getElementsByClassName('MyClass')[0], - client_my_class); - assert_equals(document.getElementsByClassName('MYCLASS')[0], - client_my_class); -}, 'getElementsByClassName should be case insensitive in quirks mode.'); - -test(() => { - assert_equals(document.querySelector('#myelement'), client_my_el); - assert_equals(document.querySelector('#MyElement'), client_my_el); - assert_equals(document.querySelector('#MYELEMENT'), client_my_el); - - assert_equals(document.querySelector('.myclass'), client_my_class); - assert_equals(document.querySelector('.MyClass'), client_my_class); - assert_equals(document.querySelector('.MYCLASS'), client_my_class); -}, 'querySelector should be case insensitive when in quirks mode.'); -</script> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-style-tree-order-dedup-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-style-tree-order-dedup-expected.txt deleted file mode 100644 index 3e0eec9..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-style-tree-order-dedup-expected.txt +++ /dev/null
@@ -1,15 +0,0 @@ -CONSOLE WARNING: line 5: HTML Imports is deprecated and will be removed in M80, around February 2020. Please use ES modules instead. See https://www.chromestatus.com/features/5144752345317376 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -PASS colorOf(target1) is 'rgb(0, 128, 0)' -PASS colorOf(target2) is 'rgb(255, 0, 0)' -PASS colorOf(target3) is 'rgb(255, 0, 0)' -PASS colorOf(target1) is 'rgb(0, 128, 0)' -PASS colorOf(target2) is 'rgb(0, 0, 255)' -PASS colorOf(target3) is 'rgb(255, 0, 0)' -PASS colorOf(target1) is 'rgb(0, 128, 0)' -PASS colorOf(target2) is 'rgb(0, 0, 255)' -PASS colorOf(target3) is 'rgb(255, 0, 0)' -PASS successfullyParsed is true - -TEST COMPLETE - -Hello! Hello! Hello!
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-style-tree-order-dedup.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-style-tree-order-dedup.html deleted file mode 100644 index 63b531e2..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-style-tree-order-dedup.html +++ /dev/null
@@ -1,57 +0,0 @@ -<!DOCTYPE html> -<body> -<script src="../../../resources/js-test.js"></script> - -<link id="owningLink" rel="import" href="resources/style-target-blue.html"> - -<style id="styleRed"> -.target1, .target2, .target3 { - color: red; -} -</style> - -<link id="sharedLink" rel="import" href="resources/style-target-blue.html"> - -<style id="styleGreen"> -.target1 { - color: green; -} -</style> - -<div id="placeholder"></div> - -<span id="target1" class="target1">Hello!</span> -<span id="target2" class="target2">Hello!</span> -<span id="target3" class="target3">Hello!</span> - -<script> -function colorOf(element) -{ - return window.getComputedStyle(element).color; -} - -// owninigLink, styleRed, styleGreen - -shouldBe("colorOf(target1)", "'rgb(0, 128, 0)'"); -shouldBe("colorOf(target2)", "'rgb(255, 0, 0)'"); -shouldBe("colorOf(target3)", "'rgb(255, 0, 0)'"); - -var owningLinkElement = document.getElementById("owningLink"); -document.body.removeChild(owningLinkElement); - -// styleRed, sharedLink, styleGreen - -shouldBe("colorOf(target1)", "'rgb(0, 128, 0)'"); -shouldBe("colorOf(target2)", "'rgb(0, 0, 255)'"); -shouldBe("colorOf(target3)", "'rgb(255, 0, 0)'"); - -document.body.insertBefore(owningLinkElement, placeholder); - -// styleRed, sharedLink, styleGreen - owningLinkElement shouldn't affect others - -shouldBe("colorOf(target1)", "'rgb(0, 128, 0)'"); -shouldBe("colorOf(target2)", "'rgb(0, 0, 255)'"); -shouldBe("colorOf(target3)", "'rgb(255, 0, 0)'"); - -</script> -</body>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-style-tree-order-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-style-tree-order-expected.txt deleted file mode 100644 index 259a40dc..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-style-tree-order-expected.txt +++ /dev/null
@@ -1,12 +0,0 @@ -CONSOLE WARNING: line 11: HTML Imports is deprecated and will be removed in M80, around February 2020. Please use ES modules instead. See https://www.chromestatus.com/features/5144752345317376 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -PASS window.getComputedStyle(styleShouldBeHiddenByImport).color is "rgb(0, 128, 0)" -PASS window.getComputedStyle(linkShouldBeHiddenByImport).color is "rgb(0, 128, 0)" -PASS window.getComputedStyle(importShouldBeHiddenByImport).color is "rgb(0, 128, 0)" -PASS window.getComputedStyle(subimportShouldBeHiddenByImport).color is "rgb(0, 128, 0)" -PASS window.getComputedStyle(sharedImportShouldBeIgnored).color is "rgb(0, 128, 0)" -PASS window.getComputedStyle(styleShouldBeHiddenByDynamicallyAddedFollower).color is "rgb(0, 128, 0)" -PASS window.getComputedStyle(styleShouldNotBeHiddenByDynamicallyAddedLeader).color is "rgb(0, 128, 0)" -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-style-tree-order.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-style-tree-order.html deleted file mode 100644 index 7c4e687..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-style-tree-order.html +++ /dev/null
@@ -1,88 +0,0 @@ -<!DOCTYPE html> -<html> -<script src="../../../resources/js-test.js"></script> -<head> - -<style> -div#styleShouldBeHiddenByImport { - color: red; -} -</style> -<link rel="import" href="resources/style-tree-order-hide-style.html"> - -<link rel="stylesheet" href="resources/style-tree-order-hide-link.css"> -<link rel="import" href="resources/style-tree-order-hide-link.html"> - -<link rel="import" href="resources/style-tree-order-hide-import-red.html"> -<link rel="import" href="resources/style-tree-order-hide-import-green.html"> - -<link rel="import" href="resources/style-tree-order-hide-subimport.html"> - - -<link rel="import" href="resources/style-tree-order-hide-shared.html"> -<style> -div#sharedImportShouldBeIgnored { - color: green; -} -</style> -<link rel="import" href="resources/style-tree-order-hide-shared.html"> - -<style id="anchorStyle"> -div#styleShouldBeHiddenByDynamicallyAddedFollower { - color: red; -} - -div#styleShouldNotBeHiddenByDynamicallyAddedLeader { - color: green; -} -</style> - -</head> -<body> -<div id="container"> -<div id="styleShouldBeHiddenByImport">Hello</div> -<div id="linkShouldBeHiddenByImport">Hello</div> -<div id="importShouldBeHiddenByImport">Hello</div> -<div id="subimportShouldBeHiddenByImport">Hello</div> -<div id="sharedImportShouldBeIgnored">Hello</div> -<div id="styleShouldBeHiddenByDynamicallyAddedFollower">Hello</div> -<div id="styleShouldNotBeHiddenByDynamicallyAddedLeader">Hello</div> -</div> -<script> -window.jsTestIsAsync = true; -shouldBeEqualToString('window.getComputedStyle(styleShouldBeHiddenByImport).color', 'rgb(0, 128, 0)'); -shouldBeEqualToString('window.getComputedStyle(linkShouldBeHiddenByImport).color', 'rgb(0, 128, 0)'); -shouldBeEqualToString('window.getComputedStyle(importShouldBeHiddenByImport).color', 'rgb(0, 128, 0)'); -shouldBeEqualToString('window.getComputedStyle(subimportShouldBeHiddenByImport).color', 'rgb(0, 128, 0)'); -shouldBeEqualToString('window.getComputedStyle(sharedImportShouldBeIgnored).color', 'rgb(0, 128, 0)'); - -function createImportLink(url, onload) -{ - var link = document.createElement('link'); - link.setAttribute('rel', 'import'); - link.setAttribute('href', url); - link.onload = onload; - return link; -} - -var linkCount = 0; -function testIfReady() -{ - linkCount++; - if (linkCount < 2) - return; - - shouldBeEqualToString('window.getComputedStyle(styleShouldBeHiddenByDynamicallyAddedFollower).color', 'rgb(0, 128, 0)'); - shouldBeEqualToString('window.getComputedStyle(styleShouldNotBeHiddenByDynamicallyAddedLeader).color', 'rgb(0, 128, 0)'); - - container.style.display = 'none'; - finishJSTest(); -} - -// Dynamic addition. -document.head.insertBefore(createImportLink('resources/style-tree-order-dynamic-leading.html', testIfReady), anchorStyle); -document.head.appendChild(createImportLink('resources/style-tree-order-dynamic-following.html', testIfReady), anchorStyle); - -</script> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-success-fail-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-success-fail-expected.txt deleted file mode 100644 index 42b7e03c..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-success-fail-expected.txt +++ /dev/null
@@ -1,9 +0,0 @@ -CONSOLE WARNING: line 5: HTML Imports is deprecated and will be removed in M80, around February 2020. Please use ES modules instead. See https://www.chromestatus.com/features/5144752345317376 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -PASS toSuccess.import.querySelector('h1').innerHTML is 'Hello' -PASS toSuccess.import.querySelector('html') is non-null. -PASS toFail.import is null -PASS notImport.import is null -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-success-fail.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-success-fail.html deleted file mode 100644 index 9dc8438..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/import-success-fail.html +++ /dev/null
@@ -1,17 +0,0 @@ -<!DOCTYPE html> -<html> -<script src="../../../resources/js-test.js"></script> -<head> -<link id="toSuccess" rel="import" href="resources/hello.html"> -<link id="toFail" rel="import" href="resources/no-such-file.html"> -<link id="notImport" rel="stylesheet" href="resources/no-such-file.css"> -</head> -<body> -<script> -shouldBe("toSuccess.import.querySelector('h1').innerHTML", "'Hello'"); -shouldBeNonNull("toSuccess.import.querySelector('html')"); -shouldBeNull("toFail.import"); -shouldBeNull("notImport.import"); -</script> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/no-browsing-context-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/no-browsing-context-expected.txt deleted file mode 100644 index 4eaeaa9b..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/no-browsing-context-expected.txt +++ /dev/null
@@ -1,10 +0,0 @@ -CONSOLE WARNING: HTML Imports is deprecated and will be removed in M80, around February 2020. Please use ES modules instead. See https://www.chromestatus.com/features/5144752345317376 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -This ensures that @import doesn't work with headless documents. - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - -PASS xhr.response.getElementById('hello').import is null -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/no-browsing-context.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/no-browsing-context.html deleted file mode 100644 index 304c450..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/no-browsing-context.html +++ /dev/null
@@ -1,20 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script src="../../../resources/js-test.js"></script> -</head> -<body> -<script> -description("This ensures that @import doesn't work with headless documents.") -window.jsTestIsAsync = true; -var xhr = new XMLHttpRequest(); -xhr.open("GET", "resources/root.html"); -xhr.responseType = 'document'; -xhr.send(null); -xhr.onload = function() { - shouldBeNull("xhr.response.getElementById('hello').import"); - finishJSTest(); -}; -</script> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/rel-import-to-style-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/rel-import-to-style-expected.txt deleted file mode 100644 index df153b5d..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/rel-import-to-style-expected.txt +++ /dev/null
@@ -1,15 +0,0 @@ -CONSOLE WARNING: line 6: HTML Imports is deprecated and will be removed in M80, around February 2020. Please use ES modules instead. See https://www.chromestatus.com/features/5144752345317376 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -Updating attribute value shouldn't invalidate loaded import. - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - -Before update: -PASS target.sheet is null -PASS target.import is non-null. -After update: -PASS target.sheet is null -PASS target.import is non-null. -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/rel-import-to-style.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/rel-import-to-style.html deleted file mode 100644 index db916168..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/rel-import-to-style.html +++ /dev/null
@@ -1,28 +0,0 @@ -<!DOCTYPE html> -<html> -<script src="../../../resources/js-test.js"></script> -<script src="resources/import-helpers.js"></script> -<head> -<link id="target", rel="import" href="resources/hello.html"> -</head> -<body> -<script> -window.jsTestIsAsync = true; -description('Updating attribute value shouldn\'t invalidate loaded import.'); -(function() { - debug('Before update:'); - shouldBeNull('target.sheet'); - shouldBeNonNull('target.import'); - target.setAttribute('href', 'resources/hello.css'); - target.setAttribute('rel', 'stylesheet'); - window.placeholder = createPlaceholder(); - window.placeholder.onload = function() { - debug('After update:'); - shouldBeNull('target.sheet'); - shouldBeNonNull('target.import'); - window.addEventListener('load', function() { requestAnimationFrame(finishJSTest); }); - } -})(); -</script> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/rel-style-to-import-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/rel-style-to-import-expected.txt deleted file mode 100644 index 5ad9794e..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/rel-style-to-import-expected.txt +++ /dev/null
@@ -1,13 +0,0 @@ -CONSOLE WARNING: line 18: HTML Imports is deprecated and will be removed in M80, around February 2020. Please use ES modules instead. See https://www.chromestatus.com/features/5144752345317376 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -CONSOLE WARNING: CSS cannot be loaded from `file:` URLs unless they end in a `.css` file extension. -Updating attribute value shouldn't result import loading. -Before update: -PASS target.sheet is non-null. -PASS target.import is null -After update: -PASS target.sheet is non-null. -PASS target.import is null -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/rel-style-to-import.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/rel-style-to-import.html deleted file mode 100644 index 6613ac5a..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/rel-style-to-import.html +++ /dev/null
@@ -1,36 +0,0 @@ -<!DOCTYPE html> - -<script> - jsTestIsAsync = true; -</script> - -<script src="../../../resources/js-test.js"></script> -<script src="resources/import-helpers.js"></script> - -<link id="target" rel="stylesheet" href="resources/hello.css"> - -<script> -debug("Updating attribute value shouldn't result import loading."); -debug("Before update:"); -shouldBeNonNull("target.sheet"); -shouldBeNull("target.import"); -target.setAttribute("href", "resources/hello.html"); -target.setAttribute("rel", "import"); -var targetLoaded = new Promise(function(resolve) { - target.onload = function() { - resolve(); - }; -}); -var placeholder = createPlaceholder(); -var placeholderLoaded = new Promise(function(resolve) { - placeholder.onload = function() { - resolve(); - }; -}); -Promise.all([placeholderLoaded, targetLoaded]).then(function() { - debug("After update:"); - shouldBeNonNull("target.sheet"); - shouldBeNull("target.import"); - finishJSTest(); -}); -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/async-child.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/async-child.html deleted file mode 100644 index c17c1c0f..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/async-child.html +++ /dev/null
@@ -1,9 +0,0 @@ -<!DOCTYPE html> -<html> -<head></head> -<body> -<script> -importIsLoaded = true; -</script> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/async-root-child-1.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/async-root-child-1.html deleted file mode 100644 index f009281d..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/async-root-child-1.html +++ /dev/null
@@ -1,8 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script> -window.trace.push("child1"); -</script> -</head> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/async-root-child-2.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/async-root-child-2.html deleted file mode 100644 index b23a04b9..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/async-root-child-2.html +++ /dev/null
@@ -1,8 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script> -window.trace.push("child2"); -</script> -</head> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/async-root.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/async-root.html deleted file mode 100644 index 3689f4a5..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/async-root.html +++ /dev/null
@@ -1,14 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script> -window.trace.push("START root"); -</script> -<link id="harness" rel="import" href="async-root-child-1.html"> -<link id="harness" rel="import" href="async-root-child-2.html"> -<script> -window.trace.push("END root"); -</script> -</head> -<body></body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/bye.css b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/bye.css deleted file mode 100644 index c2140b8..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/bye.css +++ /dev/null
@@ -1,3 +0,0 @@ -h1 { - color: blue; -} \ No newline at end of file
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/bye.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/bye.html deleted file mode 100644 index e7f74dc..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/bye.html +++ /dev/null
@@ -1,7 +0,0 @@ -<!DOCTYPE html> -<html> -<head></head> -<body> - <h1>Bye</h1> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/child-frame-with-import.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/child-frame-with-import.html deleted file mode 100644 index 87720e8..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/child-frame-with-import.html +++ /dev/null
@@ -1,34 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script> -var callbackCount = 0; - -function finishJSTestIfNeeded() -{ - callbackCount++; - if (2 == callbackCount) { - importError(); - importLoaded(); - window.parent.finishJSTest(); - } -} - -function importLoaded() -{ - window.parent.headlineText = target.import.querySelector('h1').innerHTML; - window.parent.shouldBe('headlineText', '"Hello"'); -} - -function importError() -{ - window.parent.wrongImport = wrong.import; - window.parent.shouldBeNull('wrongImport'); -} -</script> -<link id="target" rel="import" href="hello.html" onload="finishJSTestIfNeeded()"> -<link id="wrong" rel="import" href="nosuch.html" onerror="finishJSTestIfNeeded()"> -</head> -<body> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/custom-element-hello-1.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/custom-element-hello-1.html deleted file mode 100644 index 7df7222..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/custom-element-hello-1.html +++ /dev/null
@@ -1,2 +0,0 @@ -<x-hello id="hello-1"></x-hello> -<x-bye id="bye-1"></x-bye>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/custom-element-hello-2.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/custom-element-hello-2.html deleted file mode 100644 index 21a24ec..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/custom-element-hello-2.html +++ /dev/null
@@ -1,2 +0,0 @@ -<x-hello id="hello-2"></x-hello> -<x-bye id="bye-2"></x-bye>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/custom-element-hello-3.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/custom-element-hello-3.html deleted file mode 100644 index 0ac633f..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/custom-element-hello-3.html +++ /dev/null
@@ -1,2 +0,0 @@ -<x-hello id="hello-3"></x-hello> -<x-bye id="bye-3"></x-bye>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/custom-element-hello-4.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/custom-element-hello-4.html deleted file mode 100644 index 0d30591..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/custom-element-hello-4.html +++ /dev/null
@@ -1,2 +0,0 @@ -<x-hello id="hello-4"></x-hello> -<x-bye id="bye-4"></x-bye>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/custom-element-hello-5.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/custom-element-hello-5.html deleted file mode 100644 index 8a9ea7b..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/custom-element-hello-5.html +++ /dev/null
@@ -1,2 +0,0 @@ -<x-hello id="hello-5"></x-hello> -<x-bye id="bye-5"></x-bye>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/custom-element-hello-6.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/custom-element-hello-6.html deleted file mode 100644 index ee3fa8c..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/custom-element-hello-6.html +++ /dev/null
@@ -1,2 +0,0 @@ -<x-hello id="hello-6"></x-hello> -<x-bye id="bye-6"></x-bye>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/custom-element-hello-7.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/custom-element-hello-7.html deleted file mode 100644 index dd8ca640..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/custom-element-hello-7.html +++ /dev/null
@@ -1,2 +0,0 @@ -<x-hello id="hello-7"></x-hello> -<x-bye id="bye-7"></x-bye>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/custom-element-hello-8.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/custom-element-hello-8.html deleted file mode 100644 index 54dda77..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/custom-element-hello-8.html +++ /dev/null
@@ -1,2 +0,0 @@ -<x-hello id="hello-8"></x-hello> -<x-bye id="bye-8"></x-bye>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/custom-element-hello-cycle-child.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/custom-element-hello-cycle-child.html deleted file mode 100644 index d2317bb..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/custom-element-hello-cycle-child.html +++ /dev/null
@@ -1,5 +0,0 @@ -<x-hello id="hello-cycle-1"></x-hello> -<x-bye id="bye-cycle-1"></x-hello> -<link rel="import" href="custom-element-hello-cycle-parent.html"> -<x-hello id="hello-cycle-2"></x-hello> -<x-bye id="bye-cycle-2"></x-hello>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/custom-element-hello-cycle-parent.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/custom-element-hello-cycle-parent.html deleted file mode 100644 index ce7e24a..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/custom-element-hello-cycle-parent.html +++ /dev/null
@@ -1,5 +0,0 @@ -<x-hello id="hello-cycle-p1"></x-hello> -<x-bye id="bye-cycle-p1"></x-hello> -<link rel="import" href="custom-element-hello-cycle-child.html"> -<x-hello id="hello-cycle-p2"></x-hello> -<x-bye id="bye-cycle-p2"></x-hello>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/custom-element-hello-parent-12.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/custom-element-hello-parent-12.html deleted file mode 100644 index c96e838e..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/custom-element-hello-parent-12.html +++ /dev/null
@@ -1,2 +0,0 @@ -<link rel="import" href="custom-element-hello-1.html" onload="latch.loaded()"> -<link rel="import" href="custom-element-hello-2.html" async onload="latch.loaded()">
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/custom-element-hello-parent-34.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/custom-element-hello-parent-34.html deleted file mode 100644 index 0bbae584..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/custom-element-hello-parent-34.html +++ /dev/null
@@ -1,6 +0,0 @@ -<x-hello id="hello-p34-1"></x-hello> -<x-bye id="bye-p34-1"></x-bye> -<link rel="import" href="custom-element-hello-3.html" onload="latch.loaded()"> -<link rel="import" href="custom-element-hello-4.html" async onload="latch.loaded()"> -<x-hello id="hello-p34-2"></x-hello> -<x-bye id="bye-p34-2"></x-bye>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/custom-element-hello-parent-56.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/custom-element-hello-parent-56.html deleted file mode 100644 index 02ba0e9..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/custom-element-hello-parent-56.html +++ /dev/null
@@ -1,6 +0,0 @@ -<x-hello id="hello-p56-1"></x-hello> -<x-bye id="bye-p56-1"></x-bye> -<link rel="import" href="custom-element-hello-5.html" onload="latch.loaded()"> -<link rel="import" href="custom-element-hello-6.html" async onload="latch.loaded()"> -<x-hello id="hello-p56-2"></x-hello> -<x-bye id="bye-p56-2"></x-bye>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/custom-element-hello.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/custom-element-hello.html deleted file mode 100644 index 9950c216..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/custom-element-hello.html +++ /dev/null
@@ -1 +0,0 @@ -<x-hello></x-hello>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/custom-element-style.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/custom-element-style.html deleted file mode 100644 index 00c4145..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/custom-element-style.html +++ /dev/null
@@ -1,16 +0,0 @@ -<!DOCTYPE html> -<template> -<style> -@import url(hello.css); -</style> -<h1>Hello</h1> -</template> -<script> -var t = document.currentScript.ownerDocument.querySelector('template'); -var proto = Object.create(HTMLElement.prototype); -proto.createdCallback = function() { - var root = this.createShadowRoot(); - root.appendChild(document.importNode(t.content, true)); -}; -document.registerElement('x-test', {prototype: proto}); -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/cycle-grandparent-a.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/cycle-grandparent-a.html deleted file mode 100644 index b1239c5..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/cycle-grandparent-a.html +++ /dev/null
@@ -1,4 +0,0 @@ -<link rel="import" href="cycle-grandparent-b.html"> -<script> -recordImported(); -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/cycle-grandparent-b.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/cycle-grandparent-b.html deleted file mode 100644 index c01b54a..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/cycle-grandparent-b.html +++ /dev/null
@@ -1,4 +0,0 @@ -<link rel="import" href="cycle-grandparent-c.html"> -<script> -recordImported(); -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/cycle-grandparent-c.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/cycle-grandparent-c.html deleted file mode 100644 index 30151e6..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/cycle-grandparent-c.html +++ /dev/null
@@ -1,4 +0,0 @@ -<link rel="import" href="cycle-grandparent-a.html"> -<script> -recordImported(); -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/cycle-parent-a.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/cycle-parent-a.html deleted file mode 100644 index 24aa471..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/cycle-parent-a.html +++ /dev/null
@@ -1,4 +0,0 @@ -<link rel="import" href="cycle-parent-b.html"> -<script> -recordImported(); -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/cycle-parent-b.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/cycle-parent-b.html deleted file mode 100644 index 70c959e7..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/cycle-parent-b.html +++ /dev/null
@@ -1,4 +0,0 @@ -<link rel="import" href="cycle-parent-a.html"> -<script> -recordImported(); -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/cycle-parent-child-1-a.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/cycle-parent-child-1-a.html deleted file mode 100644 index 9ec8fca..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/cycle-parent-child-1-a.html +++ /dev/null
@@ -1,4 +0,0 @@ -<link rel="import" href="cycle-parent-child-1-b.html"> -<script> -recordImported(); -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/cycle-parent-child-1-b.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/cycle-parent-child-1-b.html deleted file mode 100644 index 62a92b5..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/cycle-parent-child-1-b.html +++ /dev/null
@@ -1,6 +0,0 @@ -<link rel="import" href="cycle-parent-child-1-a.html"> -<link rel="import" href="cycle-parent-child-1-c.html"> -<link rel="import" href="cycle-parent-child-1-d.html"> -<script> -recordImported(); -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/cycle-parent-child-1-c.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/cycle-parent-child-1-c.html deleted file mode 100644 index 2d2107b..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/cycle-parent-child-1-c.html +++ /dev/null
@@ -1,3 +0,0 @@ -<script> -recordImported(); -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/cycle-parent-child-1-d.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/cycle-parent-child-1-d.html deleted file mode 100644 index 2d2107b..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/cycle-parent-child-1-d.html +++ /dev/null
@@ -1,3 +0,0 @@ -<script> -recordImported(); -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/cycle-parent-child-2-a.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/cycle-parent-child-2-a.html deleted file mode 100644 index a8dea7be..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/cycle-parent-child-2-a.html +++ /dev/null
@@ -1,4 +0,0 @@ -<link rel="import" href="cycle-parent-child-2-b.html"> -<script> -recordImported(); -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/cycle-parent-child-2-b.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/cycle-parent-child-2-b.html deleted file mode 100644 index f5ee56c..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/cycle-parent-child-2-b.html +++ /dev/null
@@ -1,6 +0,0 @@ -<link rel="import" href="cycle-parent-child-1-c.html"> -<link rel="import" href="cycle-parent-child-1-d.html"> -<link rel="import" href="cycle-parent-child-2-a.html"> -<script> -recordImported(); -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/cycle-parent-child-3-a.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/cycle-parent-child-3-a.html deleted file mode 100644 index 170c80af..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/cycle-parent-child-3-a.html +++ /dev/null
@@ -1,4 +0,0 @@ -<link rel="import" href="cycle-parent-child-3-b.html"> -<script> -recordImported(); -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/cycle-parent-child-3-b.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/cycle-parent-child-3-b.html deleted file mode 100644 index e05ff55c..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/cycle-parent-child-3-b.html +++ /dev/null
@@ -1,6 +0,0 @@ -<link rel="import" href="cycle-parent-child-1-c.html"> -<link rel="import" href="cycle-parent-child-3-a.html"> -<link rel="import" href="cycle-parent-child-1-d.html"> -<script> -recordImported(); -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/cycle-parent-grandparent-a.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/cycle-parent-grandparent-a.html deleted file mode 100644 index a4bc53fd..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/cycle-parent-grandparent-a.html +++ /dev/null
@@ -1,4 +0,0 @@ -<link rel="import" href="cycle-parent-grandparent-b.html"> -<script> -recordImported(); -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/cycle-parent-grandparent-b.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/cycle-parent-grandparent-b.html deleted file mode 100644 index 63efed4..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/cycle-parent-grandparent-b.html +++ /dev/null
@@ -1,5 +0,0 @@ -<link rel="import" href="cycle-parent-grandparent-a.html"> -<link rel="import" href="cycle-parent-grandparent-c.html"> -<script> -recordImported(); -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/cycle-parent-grandparent-c.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/cycle-parent-grandparent-c.html deleted file mode 100644 index 05bb725..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/cycle-parent-grandparent-c.html +++ /dev/null
@@ -1,4 +0,0 @@ -<link rel="import" href="cycle-parnet-grandparent-b.html"> -<script> -recordImported(); -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/cycle-two-parents-1-a.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/cycle-two-parents-1-a.html deleted file mode 100644 index 37e6062..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/cycle-two-parents-1-a.html +++ /dev/null
@@ -1,4 +0,0 @@ -<link rel="import" href="cycle-two-parents-1-c.html"> -<script> -recordImported(); -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/cycle-two-parents-1-b.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/cycle-two-parents-1-b.html deleted file mode 100644 index 37e6062..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/cycle-two-parents-1-b.html +++ /dev/null
@@ -1,4 +0,0 @@ -<link rel="import" href="cycle-two-parents-1-c.html"> -<script> -recordImported(); -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/cycle-two-parents-1-c.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/cycle-two-parents-1-c.html deleted file mode 100644 index 189b65e..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/cycle-two-parents-1-c.html +++ /dev/null
@@ -1,5 +0,0 @@ -<link rel="import" href="cycle-two-parents-1-a.html"> -<link rel="import" href="cycle-two-parents-1-b.html"> -<script> -recordImported(); -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/cycle-two-parents-2-a.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/cycle-two-parents-2-a.html deleted file mode 100644 index 43fa53d2..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/cycle-two-parents-2-a.html +++ /dev/null
@@ -1,4 +0,0 @@ -<link rel="import" href="cycle-two-parents-2-c.html"> -<script> -recordImported(); -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/cycle-two-parents-2-b.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/cycle-two-parents-2-b.html deleted file mode 100644 index 43fa53d2..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/cycle-two-parents-2-b.html +++ /dev/null
@@ -1,4 +0,0 @@ -<link rel="import" href="cycle-two-parents-2-c.html"> -<script> -recordImported(); -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/cycle-two-parents-2-c.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/cycle-two-parents-2-c.html deleted file mode 100644 index 29ccf2d..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/cycle-two-parents-2-c.html +++ /dev/null
@@ -1,4 +0,0 @@ -<link rel="import" href="cycle-two-parents-2-a.html"> -<script> -recordImported(); -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/cycle-two-parents-3-a.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/cycle-two-parents-3-a.html deleted file mode 100644 index 2aa3954f..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/cycle-two-parents-3-a.html +++ /dev/null
@@ -1,4 +0,0 @@ -<link rel="import" href="cycle-two-parents-3-c.html"> -<script> -recordImported(); -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/cycle-two-parents-3-b.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/cycle-two-parents-3-b.html deleted file mode 100644 index 2aa3954f..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/cycle-two-parents-3-b.html +++ /dev/null
@@ -1,4 +0,0 @@ -<link rel="import" href="cycle-two-parents-3-c.html"> -<script> -recordImported(); -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/cycle-two-parents-3-c.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/cycle-two-parents-3-c.html deleted file mode 100644 index 2e1ba819..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/cycle-two-parents-3-c.html +++ /dev/null
@@ -1,4 +0,0 @@ -<link rel="import" href="cycle-two-parents-3-b.html"> -<script> -recordImported(); -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/do-document-write.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/do-document-write.html deleted file mode 100644 index ef18669..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/do-document-write.html +++ /dev/null
@@ -1,10 +0,0 @@ -<!DOCTYPE html> -<html> -<body> -<script> -test(function(){ - -}, "The document write and family isn't supported in imports."); -</script> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/events-inline.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/events-inline.html deleted file mode 100644 index 77305e9..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/events-inline.html +++ /dev/null
@@ -1,13 +0,0 @@ -<!DOCTYPE html> -<html> -<head> - <link id="shouldLoad" rel="import" href="hello.html" onload="handle(event)"> - <link id="shouldError" rel="import" href="nosuch.html" onerror="handle(event)"> -</head> -<body> -<div id="toClick" onclick="handle(event)"></div> -<script> -document.currentScript.ownerDocument.getElementById('toClick').click(); -</script> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/hello-css.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/hello-css.html deleted file mode 100644 index 7545549..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/hello-css.html +++ /dev/null
@@ -1,6 +0,0 @@ -<!DOCTYPE html> -<html> -<head> - <link rel="stylesheet" href="hello.css"> -</head> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/hello-legacy.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/hello-legacy.html deleted file mode 100644 index 69c39ce4..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/hello-legacy.html +++ /dev/null
@@ -1,7 +0,0 @@ -<!DOCTYPE html PUBLIC "-//IETF//DTD HTML 2.0 Level 1//"> -<html> -<head></head> -<body> - <h1>Hello</h1> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/hello-nodtd.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/hello-nodtd.html deleted file mode 100644 index 08155dcc..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/hello-nodtd.html +++ /dev/null
@@ -1,6 +0,0 @@ -<html> -<head></head> -<body> - <h1>Hello</h1> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/hello.css b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/hello.css deleted file mode 100644 index 4717ad4..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/hello.css +++ /dev/null
@@ -1,3 +0,0 @@ -h1 { - color: red; -} \ No newline at end of file
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/hello.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/hello.html deleted file mode 100644 index bc02198..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/hello.html +++ /dev/null
@@ -1,7 +0,0 @@ -<!DOCTYPE html> -<html> -<head></head> -<body> - <h1>Hello</h1> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/import-custom-element-onload-child.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/import-custom-element-onload-child.html deleted file mode 100644 index 792182f..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/import-custom-element-onload-child.html +++ /dev/null
@@ -1,3 +0,0 @@ -<x-hello id="1"></x-hello> -<link rel="import" href="import-custom-element-onload-grandchild.html"> -<x-hello id="3"></x-hello>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/import-custom-element-onload-grandchild.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/import-custom-element-onload-grandchild.html deleted file mode 100644 index 0ec27d68..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/import-custom-element-onload-grandchild.html +++ /dev/null
@@ -1 +0,0 @@ -<x-hello id="2"></x-hello>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/import-destroy-stress-ref.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/import-destroy-stress-ref.html deleted file mode 100644 index 4f18cea9..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/import-destroy-stress-ref.html +++ /dev/null
@@ -1,5 +0,0 @@ -<!DOCTYPE html> -<link rel="import" href="hello.html"> -<script> -var deliberateWrapper = document.querySelector('link').import.querySelector('link'); -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/import-events-target.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/import-events-target.html deleted file mode 100644 index 3fde0ee..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/import-events-target.html +++ /dev/null
@@ -1,6 +0,0 @@ -<!DOCTYPE html> -<html> -<body> - <div id="target"></div> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/import-helpers.js b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/import-helpers.js deleted file mode 100644 index 875a159..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/import-helpers.js +++ /dev/null
@@ -1,9 +0,0 @@ - -function createPlaceholder() -{ - var link = document.createElement("link"); - link.setAttribute("href", "resources/placeholder.html"); - link.setAttribute("rel", "import"); - document.head.appendChild(link); - return link; -}
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/import-link-with-media-query.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/import-link-with-media-query.html deleted file mode 100644 index cfa136e0..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/import-link-with-media-query.html +++ /dev/null
@@ -1 +0,0 @@ -<link href="nonexistant.html" rel=stylesheet media=all>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/import-no-quirks.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/import-no-quirks.html deleted file mode 100644 index c7e49605..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/import-no-quirks.html +++ /dev/null
@@ -1,39 +0,0 @@ -<!DOCTYPE html> -<body> - <div id="MyElement">MyElement</div> - <div class="MyClass" id="OtherElement">OtherElement</div> -</body> -<script> -'use strict'; - -let noquirks_doc = document.currentScript.ownerDocument; -let noquirks_my_el = noquirks_doc.getElementById('MyElement'); -let noquirks_my_class = noquirks_doc.getElementById('OtherElement'); - -test(() => { - assert_equals(quirks_doc.compatMode, 'CSS1Compat'); -}, 'This import should be no quirks mode.'); - -test(() => { - assert_equals(quirks_doc.getElementById('myelement'), null); - assert_equals(quirks_doc.getElementById('MyElement'), quirks_my_el); - assert_equals(quirks_doc.getElementById('MYELEMENT'), null); -}, 'getElementById should be case sensitive in import with doctype.'); - -test(() => { - assert_equals(quirks_doc.getElementsByClassName('myclass').length, 0); - assert_equals(quirks_doc.getElementsByClassName('MyClass')[0], - quirks_my_class); - assert_equals(quirks_doc.getElementsByClassName('MYCLASS').length, 0); -}, 'getElementsByClassName should be case sensitive in import with doctype.'); - -test(() => { - assert_equals(quirks_doc.querySelector('#myelement'), null); - assert_equals(quirks_doc.querySelector('#MyElement'), quirks_my_el); - assert_equals(quirks_doc.querySelector('#MYELEMENT'), null); - - assert_equals(quirks_doc.querySelector('.myclass'), null); - assert_equals(quirks_doc.querySelector('.MyClass'), quirks_my_class); - assert_equals(quirks_doc.querySelector('.MYCLASS'), null); -}, 'querySelector should be case sensitive in import with doctype.'); -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/import-quirks.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/import-quirks.html deleted file mode 100644 index 970317d9..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/import-quirks.html +++ /dev/null
@@ -1,43 +0,0 @@ -<!-- -Note: All HTML Import files are treated as no quirks mode, and omitting doctype - is not turning on quirks mode, therefore this file is in no quirks mode, - on contrary to the filename. ---> -<body> - <div id="MyElement">MyElement</div> - <div class="MyClass" id="OtherElement">OtherElement</div> -</body> -<script> -'use strict'; - -let quirks_doc = document.currentScript.ownerDocument; -let quirks_my_el = quirks_doc.getElementById('MyElement'); -let quirks_my_class = quirks_doc.getElementById('OtherElement'); - -test(() => { - assert_equals(quirks_doc.compatMode, 'CSS1Compat'); -}, 'This import should be in no quirks mode without doctype.'); - -test(() => { - assert_equals(quirks_doc.getElementById('myelement'), null); - assert_equals(quirks_doc.getElementById('MyElement'), quirks_my_el); - assert_equals(quirks_doc.getElementById('MYELEMENT'), null); -}, 'getElementById should be case sensitive in import without doctype.'); - -test(() => { - assert_equals(quirks_doc.getElementsByClassName('myclass').length, 0); - assert_equals(quirks_doc.getElementsByClassName('MyClass')[0], - quirks_my_class); - assert_equals(quirks_doc.getElementsByClassName('MYCLASS').length, 0); -}, 'getElementsByClassName should be case sensitive in import without doctype.'); - -test(() => { - assert_equals(quirks_doc.querySelector('#myelement'), null); - assert_equals(quirks_doc.querySelector('#MyElement'), quirks_my_el); - assert_equals(quirks_doc.querySelector('#MYELEMENT'), null); - - assert_equals(quirks_doc.querySelector('.myclass'), null); - assert_equals(quirks_doc.querySelector('.MyClass'), quirks_my_class); - assert_equals(quirks_doc.querySelector('.MYCLASS'), null); -}, 'querySelector should be case sensitive in import wihout doctype.'); -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/loop-child.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/loop-child.html deleted file mode 100644 index fdb1600..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/loop-child.html +++ /dev/null
@@ -1,9 +0,0 @@ -<!DOCTYPE html> -<html> -<head> - <link id="target" rel="import" href="loop-root.html"> -</head> -<body> - <h1>Child</h1> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/loop-root.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/loop-root.html deleted file mode 100644 index 2010446..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/loop-root.html +++ /dev/null
@@ -1,9 +0,0 @@ -<!DOCTYPE html> -<html> -<head> - <link id="target" rel="import" href="loop-child.html"> -</head> -<body> - <h1>Root</h1> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/meta-encoding.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/meta-encoding.html deleted file mode 100644 index d57057e..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/meta-encoding.html +++ /dev/null
@@ -1,5 +0,0 @@ -<!DOCTYPE html> -<head> - <meta charset="EUC-JP"> -</head> -<body>Hello, world</body>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/nest-dup-2-parent.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/nest-dup-2-parent.html deleted file mode 100644 index 979328b..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/nest-dup-2-parent.html +++ /dev/null
@@ -1,13 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script> -start(); -</script> -<link id="harness" rel="import" href="nest-dup.html"> -<link id="harness" rel="import" href="nest-dup-2.html"> -<script> -end(); -</script> -</head> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/nest-dup-2.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/nest-dup-2.html deleted file mode 100644 index 090ca6e6..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/nest-dup-2.html +++ /dev/null
@@ -1,11 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script> -start(); -</script> -<script> -end(); -</script> -</head> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/nest-dup-child.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/nest-dup-child.html deleted file mode 100644 index 090ca6e6..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/nest-dup-child.html +++ /dev/null
@@ -1,11 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script> -start(); -</script> -<script> -end(); -</script> -</head> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/nest-dup-grand-parent.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/nest-dup-grand-parent.html deleted file mode 100644 index 701347a..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/nest-dup-grand-parent.html +++ /dev/null
@@ -1,12 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script> -start(); -</script> -<link id="harness" rel="import" href="nest-dup-parent.html"> -<script> -end(); -</script> -</head> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/nest-dup-parent.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/nest-dup-parent.html deleted file mode 100644 index 839c4d2..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/nest-dup-parent.html +++ /dev/null
@@ -1,12 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script> -start(); -</script> -<link id="harness" rel="import" href="nest-dup.html"> -<script> -end(); -</script> -</head> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/nest-dup.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/nest-dup.html deleted file mode 100644 index dd9f59b4..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/nest-dup.html +++ /dev/null
@@ -1,12 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script> -start(); -</script> -<link id="harness" rel="import" href="nest-dup-child.html"> -<script> -end(); -</script> -</head> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/no-encoding.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/no-encoding.html deleted file mode 100644 index 488eefe..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/no-encoding.html +++ /dev/null
@@ -1,2 +0,0 @@ -<!DOCTYPE html> -<body>Hello, world</body>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/notify-done.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/notify-done.html deleted file mode 100644 index 77f05aa..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/notify-done.html +++ /dev/null
@@ -1,7 +0,0 @@ -<!DOCTYPE html> -<script> -gc(); -console.log("PASS unless crash."); -if (window.testRunner) - testRunner.notifyDone(); -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/nr1-i0.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/nr1-i0.html deleted file mode 100644 index 676afc0..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/nr1-i0.html +++ /dev/null
@@ -1,4 +0,0 @@ -<!DOCTYPE html> -<order-test name="e01"></order-test> -<link rel="import" href="nr1-i1.html"> -<order-test name="e09"></order-test>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/nr1-i1.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/nr1-i1.html deleted file mode 100644 index 8d85e511..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/nr1-i1.html +++ /dev/null
@@ -1,4 +0,0 @@ -<!DOCTYPE html> -<order-test name="e02"></order-test> -<link rel="import" href="nr1-i2.html"> -<order-test name="e08"></order-test>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/nr1-i2.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/nr1-i2.html deleted file mode 100644 index 791e2d2..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/nr1-i2.html +++ /dev/null
@@ -1,4 +0,0 @@ -<!DOCTYPE html> -<order-test name="e03"></order-test> -<link rel="import" href="nr1-i3.html"> -<order-test name="e07"></order-test>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/nr1-i3.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/nr1-i3.html deleted file mode 100644 index 1e5bfb71..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/nr1-i3.html +++ /dev/null
@@ -1,4 +0,0 @@ -<!DOCTYPE html> -<order-test name="e04"></order-test> -<link rel="import" href="nr1-i4.html"> -<order-test name="e06"></order-test>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/nr1-i4.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/nr1-i4.html deleted file mode 100644 index 85fde3ee..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/nr1-i4.html +++ /dev/null
@@ -1,2 +0,0 @@ -<!DOCTYPE html> -<order-test name="e05"></order-test>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/nr1-i5.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/nr1-i5.html deleted file mode 100644 index 3c8b223..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/nr1-i5.html +++ /dev/null
@@ -1,4 +0,0 @@ -<!DOCTYPE html> -<order-test name="e10"></order-test> -<link rel="import" href="nr1-i3.html"> -<order-test name="e11"></order-test>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/nr2-i0.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/nr2-i0.html deleted file mode 100644 index 34acc8d..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/nr2-i0.html +++ /dev/null
@@ -1,4 +0,0 @@ -<!DOCTYPE html> -<order-test name="e01"></order-test> -<link rel="import" href="nr2-i1.html"> -<order-test name="e11"></order-test>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/nr2-i1.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/nr2-i1.html deleted file mode 100644 index dcbd0e1..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/nr2-i1.html +++ /dev/null
@@ -1,4 +0,0 @@ -<!DOCTYPE html> -<order-test name="e02"></order-test> -<link rel="import" href="nr2-i2.html"> -<order-test name="e10"></order-test>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/nr2-i2.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/nr2-i2.html deleted file mode 100644 index 08fe3bac..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/nr2-i2.html +++ /dev/null
@@ -1,4 +0,0 @@ -<!DOCTYPE html> -<order-test name="e03"></order-test> -<link rel="import" href="nr2-i3.html"> -<order-test name="e09"></order-test>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/nr2-i3.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/nr2-i3.html deleted file mode 100644 index 306d67a..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/nr2-i3.html +++ /dev/null
@@ -1,4 +0,0 @@ -<!DOCTYPE html> -<order-test name="e04"></order-test> -<link rel="import" href="nr2-i4.html"> -<order-test name="e08"></order-test>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/nr2-i4.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/nr2-i4.html deleted file mode 100644 index 085aac3e..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/nr2-i4.html +++ /dev/null
@@ -1,4 +0,0 @@ -<!DOCTYPE html> -<order-test name="e05"></order-test> -<link rel="import" href="nr2-i5.html"> -<order-test name="e07"></order-test>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/nr2-i5.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/nr2-i5.html deleted file mode 100644 index f687010e..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/nr2-i5.html +++ /dev/null
@@ -1,2 +0,0 @@ -<!DOCTYPE html> -<order-test name="e06"></order-test>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/nr2-i6.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/nr2-i6.html deleted file mode 100644 index 67780396..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/nr2-i6.html +++ /dev/null
@@ -1,4 +0,0 @@ -<!DOCTYPE html> -<order-test name="e12"></order-test> -<link rel="import" href="nr2-i3.html"> -<order-test name="e13"></order-test>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/nr2-i7.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/nr2-i7.html deleted file mode 100644 index dfdd52c..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/nr2-i7.html +++ /dev/null
@@ -1,4 +0,0 @@ -<!DOCTYPE html> -<order-test name="e14"></order-test> -<link rel="import" href="nr2-i4.html"> -<order-test name="e15"></order-test>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/nr3-i6.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/nr3-i6.html deleted file mode 100644 index 8ee39ec..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/nr3-i6.html +++ /dev/null
@@ -1,4 +0,0 @@ -<!DOCTYPE html> -<order-test name="e12"></order-test> -<link rel="import" href="nr2-i4.html"> -<order-test name="e13"></order-test>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/nr3-i7.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/nr3-i7.html deleted file mode 100644 index 9b25ac6..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/nr3-i7.html +++ /dev/null
@@ -1,4 +0,0 @@ -<!DOCTYPE html> -<order-test name="e14"></order-test> -<link rel="import" href="nr2-i3.html"> -<order-test name="e15"></order-test>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/nr4-i0.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/nr4-i0.html deleted file mode 100644 index 346b83c..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/nr4-i0.html +++ /dev/null
@@ -1,4 +0,0 @@ -<!DOCTYPE html> -<order-test name="e01"></order-test> -<link rel="import" href="nr4-i1.html"> -<order-test name="e17"></order-test>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/nr4-i1.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/nr4-i1.html deleted file mode 100644 index 161a8fa..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/nr4-i1.html +++ /dev/null
@@ -1,4 +0,0 @@ -<!DOCTYPE html> -<order-test name="e02"></order-test> -<link rel="import" href="nr4-i2.html"> -<order-test name="e16"></order-test>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/nr4-i2.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/nr4-i2.html deleted file mode 100644 index 712129a..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/nr4-i2.html +++ /dev/null
@@ -1,6 +0,0 @@ -<!DOCTYPE html> -<order-test name="e03"></order-test> -<link rel="import" href="nr4-i3.html"> -<order-test name="e09"></order-test> -<link rel="import" href="nr4-i6.html"> -<order-test name="e15"></order-test>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/nr4-i3.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/nr4-i3.html deleted file mode 100644 index 010bdc7..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/nr4-i3.html +++ /dev/null
@@ -1,4 +0,0 @@ -<!DOCTYPE html> -<order-test name="e04"></order-test> -<link rel="import" href="nr4-i4.html"> -<order-test name="e08"></order-test>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/nr4-i4.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/nr4-i4.html deleted file mode 100644 index 81203d38..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/nr4-i4.html +++ /dev/null
@@ -1,4 +0,0 @@ -<!DOCTYPE html> -<order-test name="e05"></order-test> -<link rel="import" href="nr4-i5.html"> -<order-test name="e07"></order-test>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/nr4-i5.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/nr4-i5.html deleted file mode 100644 index f687010e..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/nr4-i5.html +++ /dev/null
@@ -1,2 +0,0 @@ -<!DOCTYPE html> -<order-test name="e06"></order-test>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/nr4-i6.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/nr4-i6.html deleted file mode 100644 index aca0e81..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/nr4-i6.html +++ /dev/null
@@ -1,4 +0,0 @@ -<!DOCTYPE html> -<order-test name="e10"></order-test> -<link rel="import" href="nr4-i7.html"> -<order-test name="e14"></order-test>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/nr4-i7.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/nr4-i7.html deleted file mode 100644 index ef5d94b..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/nr4-i7.html +++ /dev/null
@@ -1,4 +0,0 @@ -<!DOCTYPE html> -<order-test name="e11"></order-test> -<link rel="import" href="nr4-i8.html"> -<order-test name="e13"></order-test>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/nr4-i8.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/nr4-i8.html deleted file mode 100644 index 6fd17a0..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/nr4-i8.html +++ /dev/null
@@ -1,2 +0,0 @@ -<!DOCTYPE html> -<order-test name="e12"></order-test>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/nr4-i9.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/nr4-i9.html deleted file mode 100644 index e3db7fd2..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/nr4-i9.html +++ /dev/null
@@ -1,4 +0,0 @@ -<!DOCTYPE html> -<order-test name="e18"></order-test> -<link rel="import" href="nr4-i4.html"> -<order-test name="e19"></order-test>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/nr4-ia.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/nr4-ia.html deleted file mode 100644 index 46efff5d..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/nr4-ia.html +++ /dev/null
@@ -1,4 +0,0 @@ -<!DOCTYPE html> -<order-test name="e20"></order-test> -<link rel="import" href="nr4-i7.html"> -<order-test name="e21"></order-test>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/nr5-i9.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/nr5-i9.html deleted file mode 100644 index 10ca6638..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/nr5-i9.html +++ /dev/null
@@ -1,4 +0,0 @@ -<!DOCTYPE html> -<order-test name="e18"></order-test> -<link rel="import" href="nr4-i8.html"> -<order-test name="e19"></order-test>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/nr5-ia.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/nr5-ia.html deleted file mode 100644 index 6405ca2..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/nr5-ia.html +++ /dev/null
@@ -1,4 +0,0 @@ -<!DOCTYPE html> -<order-test name="e20"></order-test> -<link rel="import" href="nr4-i4.html"> -<order-test name="e21"></order-test>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/onload-root.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/onload-root.html deleted file mode 100644 index 4f55a9c3..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/onload-root.html +++ /dev/null
@@ -1,22 +0,0 @@ -<!DOCTYPE html> -<html> -<head></head> -<body> -<script> -function createImportLink(doc, url) -{ - var link = doc.createElement("link"); - link.setAttribute("rel", "import"); - link.setAttribute("href", url); - link.addEventListener("load", handleEvent); - link.addEventListener("error", handleEvent); - doc.head.appendChild(link); - window.scheduledImportCount++; -} - -var doc = document.currentScript.ownerDocument; -createImportLink(doc, "no-such-file.html"); -createImportLink(doc, "hello.html"); -</script> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/placeholder.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/placeholder.html deleted file mode 100644 index a899295..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/placeholder.html +++ /dev/null
@@ -1,7 +0,0 @@ -<!DOCTYPE html> -<html> -<head></head> -<body> - <h1>Placeholder</h1> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/root.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/root.html deleted file mode 100644 index 3099194..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/root.html +++ /dev/null
@@ -1,10 +0,0 @@ -<!DOCTYPE html> -<html> -<head> - <link id="hello" rel="import" href="hello.html"> - <link id="bye" rel="import" href="bye.html"> -</head> -<body> - <h1>Root</h1> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/script-document-write.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/script-document-write.html deleted file mode 100644 index 4ac449f..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/script-document-write.html +++ /dev/null
@@ -1,7 +0,0 @@ -<!DOCTYPE html> -<script> -debug('About to call document.write()...'); -// Should be ignored, with a console warning. -document.write('Hello, world'); -debug('...after calling document.write()'); -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/script-leaf-external-async.js b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/script-leaf-external-async.js deleted file mode 100644 index e52a0e1..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/script-leaf-external-async.js +++ /dev/null
@@ -1 +0,0 @@ -document.notifyLoaded("ExternalAsync", document); \ No newline at end of file
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/script-leaf-external-dynamic.js b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/script-leaf-external-dynamic.js deleted file mode 100644 index 9b7e2a5..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/script-leaf-external-dynamic.js +++ /dev/null
@@ -1 +0,0 @@ -document.notifyLoaded("ExternalDynamic", document);
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/script-leaf-external.js b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/script-leaf-external.js deleted file mode 100644 index 348318dc..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/script-leaf-external.js +++ /dev/null
@@ -1 +0,0 @@ -document.notifyLoaded("ExternalParser", document); \ No newline at end of file
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/script-leaf.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/script-leaf.html deleted file mode 100644 index efc7217..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/script-leaf.html +++ /dev/null
@@ -1,10 +0,0 @@ -<!DOCTYPE html> -<html> -<body> -<script src="script-leaf-external.js"></script> -<script src="script-leaf-external-async.js" async></script> -<script> -document.notifyLoaded("InlineParser", document); -</script> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/script-prototype-test.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/script-prototype-test.html deleted file mode 100644 index 65e25c8..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/script-prototype-test.html +++ /dev/null
@@ -1,27 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script src="../../../../resources/js-test.js"></script> -</head> -<body> -<script> -description("This test ensures each import and client is in same JS context."); - -var stringInImport = "Import"; -shouldBe("stringInClient.__proto__", "stringInImport.__proto__"); - -var thisDocument = document.currentScript.ownerDocument; -shouldBeTrue("thisDocument !== document"); -shouldBe("thisDocument.__proto__", "document.__proto__"); -shouldBe("thisDocument.head.__proto__", "document.head.__proto__"); - -// Since the construcdtor belongs to client's window, its owner document is the client -shouldBe("(new Image()).ownerDocument", "document"); - -// With createElement(), we know who is the owner. -shouldBe("thisDocument.createElement('div').ownerDocument", "thisDocument"); -shouldBe("document.createElement('div').ownerDocument", "document"); - -</script> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/setting-greet-var.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/setting-greet-var.html deleted file mode 100644 index 8995f4c..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/setting-greet-var.html +++ /dev/null
@@ -1,8 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script> -window.greet = "Hello"; -</script> -</head> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/shared-crash-child.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/shared-crash-child.html deleted file mode 100644 index 1f9a4d2..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/shared-crash-child.html +++ /dev/null
@@ -1,2 +0,0 @@ -<!DOCTYPE html> -<link rel="import" href="shared-crash-grandchild.html">
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/shared-crash-dup.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/shared-crash-dup.html deleted file mode 100644 index 0e76edd6..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/shared-crash-dup.html +++ /dev/null
@@ -1 +0,0 @@ -<!DOCTYPE html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/shared-crash-grandchild.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/shared-crash-grandchild.html deleted file mode 100644 index 53c2130b..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/shared-crash-grandchild.html +++ /dev/null
@@ -1,2 +0,0 @@ -<!DOCTYPE html> -<link rel="import" href="shared-crash-dup.html">
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/shared-crash-root.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/shared-crash-root.html deleted file mode 100644 index 7d606fd..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/shared-crash-root.html +++ /dev/null
@@ -1,3 +0,0 @@ -<!DOCTYPE html> -<link rel="import" href="shared-crash-child.html"> -<link rel="import" href="shared-crash-dup.html">
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/style-append-to-main-after-load.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/style-append-to-main-after-load.html deleted file mode 100644 index 5b5b72c7..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/style-append-to-main-after-load.html +++ /dev/null
@@ -1,13 +0,0 @@ -<style> -.target { - color: blue; -} -</style> -<script> -let importDoc = document.currentScript.ownerDocument; -requestAnimationFrame(() => { - var style = importDoc.querySelector('style'); - document.head.appendChild(style); - requestAnimationFrame(testRunner.notifyDone.bind(testRunner)); -}); -</script> \ No newline at end of file
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/style-append-to-main.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/style-append-to-main.html deleted file mode 100644 index 57c367a..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/style-append-to-main.html +++ /dev/null
@@ -1,10 +0,0 @@ -<style> -.target { - color: blue; -} -</style> -<script> -var importDoc = document.currentScript.ownerDocument; -var style = importDoc.querySelector('style'); -document.head.appendChild(style); -</script> \ No newline at end of file
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/style-basic-child-dynamic.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/style-basic-child-dynamic.html deleted file mode 100644 index 086feadd..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/style-basic-child-dynamic.html +++ /dev/null
@@ -1,10 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<style> -.aqua-from-import { - color: aqua; -} -</style> -</head> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/style-basic-child.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/style-basic-child.html deleted file mode 100644 index 0cf005e..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/style-basic-child.html +++ /dev/null
@@ -1,19 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<link id="importLink" rel="import" href="style-basic-grandchild.html"> -<style> -.blue-from-import { - color: blue; -} - -.red-from-import { - color: red; -} - -.gray-from-subimport { - color: teal; -} -</style> -</head> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/style-basic-grandchild.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/style-basic-grandchild.html deleted file mode 100644 index a5d22cb..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/style-basic-grandchild.html +++ /dev/null
@@ -1,14 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<style> -.yellow-from-import { - color: yellow; -} - -.gray-from-subimport { - color: gray; -} -</style> -</head> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/style-blue.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/style-blue.html deleted file mode 100644 index abc15b1..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/style-blue.html +++ /dev/null
@@ -1,5 +0,0 @@ -<style> -.target { - color: blue; -} -</style>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/style-link-atimport.css b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/style-link-atimport.css deleted file mode 100644 index e858c51..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/style-link-atimport.css +++ /dev/null
@@ -1,3 +0,0 @@ -.aqua-from-import { - color: aqua; -}
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/style-link-block-child.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/style-link-block-child.html deleted file mode 100644 index c8e80ba..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/style-link-block-child.html +++ /dev/null
@@ -1,11 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<link id="styleLink" rel="stylesheet" type="text/css" title="Script Blocker" href="style-link-child.css"> -<script> -var theDocument = document.currentScript.ownerDocument; -childStyleLink = theDocument.getElementById("styleLink"); -shouldBeEqualToString("childStyleLink.sheet.title", "Script Blocker"); -</script> -</head> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/style-link-child.css b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/style-link-child.css deleted file mode 100644 index 243b83f..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/style-link-child.css +++ /dev/null
@@ -1,14 +0,0 @@ - -@import url("style-link-atimport.css"); - -.blue-from-import { - color: blue; -} - -.red-from-import { - color: red; -} - -.gray-from-subimport { - color: teal; -}
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/style-link-child.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/style-link-child.html deleted file mode 100644 index eb40f30..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/style-link-child.html +++ /dev/null
@@ -1,12 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<link id="importLink" rel="import" href="style-link-grandchild.html"> -<link id="styleLink" rel="stylesheet" type="text/css" title="Script Blocker" href="style-link-child.css"> -<script> -var theDocument = document.currentScript.ownerDocument; -childStyleLink = theDocument.getElementById("styleLink"); -shouldBeEqualToString("childStyleLink.sheet.title", "Script Blocker"); -</script> -</head> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/style-link-dynamic.css b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/style-link-dynamic.css deleted file mode 100644 index bdc50a0d..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/style-link-dynamic.css +++ /dev/null
@@ -1 +0,0 @@ -.green-from-import { color: green; } \ No newline at end of file
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/style-link-grandchild.css b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/style-link-grandchild.css deleted file mode 100644 index b9c9e79..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/style-link-grandchild.css +++ /dev/null
@@ -1,7 +0,0 @@ -.yellow-from-import { - color: yellow; -} - -.gray-from-subimport { - color: gray; -}
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/style-link-grandchild.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/style-link-grandchild.html deleted file mode 100644 index 9ca8dbe..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/style-link-grandchild.html +++ /dev/null
@@ -1,6 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<link rel="stylesheet" type="text/css" href="style-link-grandchild.css"> -</head> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/style-red-parent.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/style-red-parent.html deleted file mode 100644 index 46f29b2..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/style-red-parent.html +++ /dev/null
@@ -1 +0,0 @@ -<link rel=import href="style-red.html"></link>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/style-red.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/style-red.html deleted file mode 100644 index 4624589d..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/style-red.html +++ /dev/null
@@ -1,9 +0,0 @@ -<style> -.target { - color: red; -} - -.another-red-target { - color: red; -} -</style>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/style-target-blue.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/style-target-blue.html deleted file mode 100644 index c92debe..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/style-target-blue.html +++ /dev/null
@@ -1,8 +0,0 @@ -<!DOCTYPE html> -<html> -<style> -.target1, .target2 { - color: blue; -} -</style> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/style-tree-order-dynamic-following.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/style-tree-order-dynamic-following.html deleted file mode 100644 index bef3fc1..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/style-tree-order-dynamic-following.html +++ /dev/null
@@ -1,10 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<style> -div#styleShouldBeHiddenByDynamicallyAddedFollower { - color: green; -} -</style> -</head> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/style-tree-order-dynamic-leading.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/style-tree-order-dynamic-leading.html deleted file mode 100644 index dd98db31..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/style-tree-order-dynamic-leading.html +++ /dev/null
@@ -1,10 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<style> -div#styleShouldNotBeHiddenByDynamicallyAddedLeader { - color: red; -} -</style> -</head> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/style-tree-order-hide-import-green.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/style-tree-order-hide-import-green.html deleted file mode 100644 index 6b7ba010..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/style-tree-order-hide-import-green.html +++ /dev/null
@@ -1,10 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<style> -div#importShouldBeHiddenByImport { - color: green; -} -</style> -</head> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/style-tree-order-hide-import-red.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/style-tree-order-hide-import-red.html deleted file mode 100644 index 61b99d8..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/style-tree-order-hide-import-red.html +++ /dev/null
@@ -1,10 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<style> -div#importShouldBeHiddenByImport { - color: red; -} -</style> -</head> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/style-tree-order-hide-link.css b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/style-tree-order-hide-link.css deleted file mode 100644 index 930820f..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/style-tree-order-hide-link.css +++ /dev/null
@@ -1,3 +0,0 @@ -div#linkShouldBeHiddenByImport { - color: red; -}
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/style-tree-order-hide-link.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/style-tree-order-hide-link.html deleted file mode 100644 index 14af6c9..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/style-tree-order-hide-link.html +++ /dev/null
@@ -1,10 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<style> -div#linkShouldBeHiddenByImport { - color: green; -} -</style> -</head> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/style-tree-order-hide-shared.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/style-tree-order-hide-shared.html deleted file mode 100644 index f4a5f6b..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/style-tree-order-hide-shared.html +++ /dev/null
@@ -1,10 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<style> -div#sharedImportShouldBeIgnored { - color: red; -} -</style> -</head> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/style-tree-order-hide-style.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/style-tree-order-hide-style.html deleted file mode 100644 index f0e8bd1..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/style-tree-order-hide-style.html +++ /dev/null
@@ -1,10 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<style> -div#styleShouldBeHiddenByImport { - color: green; -} -</style> -</head> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/style-tree-order-hide-subimport-green.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/style-tree-order-hide-subimport-green.html deleted file mode 100644 index 09e2254..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/style-tree-order-hide-subimport-green.html +++ /dev/null
@@ -1,10 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<style> -div#subimportShouldBeHiddenByImport { - color: green; -} -</style> -</head> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/style-tree-order-hide-subimport-red.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/style-tree-order-hide-subimport-red.html deleted file mode 100644 index ad1aa04..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/style-tree-order-hide-subimport-red.html +++ /dev/null
@@ -1,10 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<style> -div#subimportShouldBeHiddenByImport { - color: red; -} -</style> -</head> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/style-tree-order-hide-subimport.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/style-tree-order-hide-subimport.html deleted file mode 100644 index d4af567..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/resources/style-tree-order-hide-subimport.html +++ /dev/null
@@ -1,7 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<link rel="import" href="style-tree-order-hide-subimport-red.html"> -<link rel="import" href="style-tree-order-hide-subimport-green.html"> -</head> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/sub-imports-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/sub-imports-expected.txt deleted file mode 100644 index f9fad4a..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/sub-imports-expected.txt +++ /dev/null
@@ -1,8 +0,0 @@ -CONSOLE WARNING: line 5: HTML Imports is deprecated and will be removed in M80, around February 2020. Please use ES modules instead. See https://www.chromestatus.com/features/5144752345317376 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -PASS root.import.querySelector('h1').innerHTML is 'Root' -PASS hello.import.querySelector('h1').innerHTML is 'Hello' -PASS bye.import.querySelector('h1').innerHTML is 'Bye' -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/sub-imports-loop-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/sub-imports-loop-expected.txt deleted file mode 100644 index d1a9dce..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/sub-imports-loop-expected.txt +++ /dev/null
@@ -1,6 +0,0 @@ -CONSOLE WARNING: line 5: HTML Imports is deprecated and will be removed in M80, around February 2020. Please use ES modules instead. See https://www.chromestatus.com/features/5144752345317376 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -PASS rootImport is rootImportFromChild -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/sub-imports-loop.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/sub-imports-loop.html deleted file mode 100644 index 09f471e..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/sub-imports-loop.html +++ /dev/null
@@ -1,15 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script src="../../../resources/js-test.js"></script> -<link id="root" rel="import" href="resources/loop-root.html"> -</head> -<body> -<script> -rootImport = root.import; -childImport = rootImport.querySelector("link").import; -rootImportFromChild = childImport.querySelector("link").import; -shouldBe("rootImport", "rootImportFromChild"); -</script> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/sub-imports-onload-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/sub-imports-onload-expected.txt deleted file mode 100644 index d3d7e61c..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/sub-imports-onload-expected.txt +++ /dev/null
@@ -1,13 +0,0 @@ -CONSOLE WARNING: line 31: HTML Imports is deprecated and will be removed in M80, around February 2020. Please use ES modules instead. See https://www.chromestatus.com/features/5144752345317376 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -This ensures that load and error events are fired on sub-imports. - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - -PASS theEvent.type is 'error' -PASS theEvent.target.ownerDocument is root.import -PASS theEvent.type is 'load' -PASS theEvent.target.ownerDocument is root.import -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/sub-imports-onload.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/sub-imports-onload.html deleted file mode 100644 index 26c4d60..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/sub-imports-onload.html +++ /dev/null
@@ -1,35 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script src="../../../resources/js-test.js"></script> -<script> -window.jsTestIsAsync = true; -window.scheduledImportCount = 0; - -description("This ensures that load and error events are fired on sub-imports."); - -function handleEvent(event) -{ - theEvent = event; - switch (event.target.getAttribute("href")) { - case "hello.html": - shouldBe("theEvent.type", "'load'"); - shouldBe("theEvent.target.ownerDocument", "root.import"); - break; - case "no-such-file.html": - shouldBe("theEvent.type", "'error'"); - shouldBe("theEvent.target.ownerDocument", "root.import"); - break; - default: - } - - window.scheduledImportCount--; - if (!window.scheduledImportCount) - finishJSTest(); -} -</script> -<link id="root" rel="import" href="resources/onload-root.html"> -</head> -<body> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/sub-imports.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/sub-imports.html deleted file mode 100644 index bf37661..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/sub-imports.html +++ /dev/null
@@ -1,18 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script src="../../../resources/js-test.js"></script> -<link id="root" rel="import" href="resources/root.html"> -</head> -<body> -<script> -shouldBe("root.import.querySelector('h1').innerHTML", "'Root'"); - -hello = root.import.querySelector('#hello'); -shouldBe("hello.import.querySelector('h1').innerHTML", "'Hello'"); -bye = root.import.querySelector('#bye'); -shouldBe("bye.import.querySelector('h1').innerHTML", "'Bye'"); - -</script> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/window-onload-with-import-stylesheet-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/window-onload-with-import-stylesheet-expected.txt deleted file mode 100644 index 1ec18b1..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/window-onload-with-import-stylesheet-expected.txt +++ /dev/null
@@ -1,6 +0,0 @@ -CONSOLE WARNING: line 14: HTML Imports is deprecated and will be removed in M80, around February 2020. Please use ES modules instead. See https://www.chromestatus.com/features/5144752345317376 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -PASS target.import.querySelector('link').sheet instanceof StyleSheet is true -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/window-onload-with-import-stylesheet.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/window-onload-with-import-stylesheet.html deleted file mode 100644 index fd7c99ca..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/window-onload-with-import-stylesheet.html +++ /dev/null
@@ -1,14 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script src="../../../resources/js-test.js"></script> -<script> -window.jsTestIsAsync = true; - -window.onload = function(event) -{ - shouldBeTrue("target.import.querySelector('link').sheet instanceof StyleSheet"); - finishJSTest(); -} -</script> -<link id="target" rel="import" href="resources/hello-css.html">
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/xhr-expected.txt b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/xhr-expected.txt deleted file mode 100644 index 7b17975..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/xhr-expected.txt +++ /dev/null
@@ -1,10 +0,0 @@ -CONSOLE WARNING: line 5: HTML Imports is deprecated and will be removed in M80, around February 2020. Please use ES modules instead. See https://www.chromestatus.com/features/5144752345317376 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -Ensure XHR document doesn't load imports - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - -PASS link.import is null -PASS successfullyParsed is true - -TEST COMPLETE -
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/xhr.html b/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/xhr.html deleted file mode 100644 index 4160b29..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/html-imports/xhr.html +++ /dev/null
@@ -1,25 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script src="../../../resources/js-test.js"></script> -<link id="client" rel="import" href="import-client.html"> -</head> -<body> -<script> -description("Ensure XHR document doesn't load imports"); -window.jsTestIsAsync = true; - -var xhr = new XMLHttpRequest(); -xhr.open("GET", "resources/root.html", true); -xhr.responseType = "document"; -xhr.onload = function(e) { - link = xhr.response.head.querySelector("#hello"); - shouldBeNull("link.import"); - finishJSTest(); -} - -xhr.send(); - -</script> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/fast/resources/shadow-test-driver.js b/third_party/blink/web_tests/web-components-v0-only/fast/resources/shadow-test-driver.js deleted file mode 100644 index 047607a8..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/fast/resources/shadow-test-driver.js +++ /dev/null
@@ -1,158 +0,0 @@ -// -// shadow-test-driver.js -// -// To use shadow-test-driver.js, you should have -// <div id="actual-container"></div> -// <div id="expect-container"></div> -// <pre id="console"></pre> -// in your body. -// -// Then, define test functions having one argument 'callIfDone'. -// callIfDone should be called when your test function finished. -// -// In body.onload, call doTest(testFuncs) where testFuncs is an array of test functions. -// -// See content-element-move.html as an example. -// - -function log(message) { - document.getElementById('console').innerHTML += (message + "\n"); -} - -function removeAllChildren(elem) { - while (elem.firstChild) - elem.removeChild(elem.firstChild); -} - -function cleanUp() { - removeAllChildren(document.getElementById('actual-container')); - removeAllChildren(document.getElementById('expect-container')); -} - -function removeContainerLines(text) { - var lines = text.split('\n'); - lines.splice(0, 2); - return lines.join('\n'); -} - -function check() { - var expectContainer = document.getElementById('expect-container'); - var actualContainer = document.getElementById('actual-container'); - var originalDisplayValue = actualContainer.style.display; - actualContainer.style.display = 'none'; - expectContainer.offsetLeft; - var refContainerLayoutTree = internals.elementLayoutTreeAsText(expectContainer); - var refLayoutTree = removeContainerLines(refContainerLayoutTree); - actualContainer.style.display = originalDisplayValue; - - originalDisplayValue = expectContainer.style.display; - expectContainer.style.display = 'none'; - actualContainer.offsetLeft; - var targetContainerLayoutTree = internals.elementLayoutTreeAsText(actualContainer); - var targetLayoutTree = removeContainerLines(targetContainerLayoutTree); - expectContainer.style.display = originalDisplayValue; - - if (targetLayoutTree == refLayoutTree) - log("PASS"); - else { - log("FAIL"); - log("Expected: "); - log(refLayoutTree); - log("Actual: "); - log(targetLayoutTree); - } -} - -function createSpanWithText(text, className) { - var span = document.createElement('span'); - span.appendChild(document.createTextNode(text)); - if (className) - span.className = className; - return span; -} - -function createContentWithSelect(select, fallbackText) { - var content = document.createElement('content'); - content.setAttribute('select', select); - if (fallbackText) - content.appendChild(createSpanWithText(fallbackText)); - - return content; -} - -function createContentWithText(fallbackText) { - var content = document.createElement('content'); - if (fallbackText) - content.innerHTML = fallbackText; - - return content; -} - -function appendShadow(target, select) { - var root = target.createShadowRoot(); - - var content = document.createElement('content'); - content.setAttribute('select', select); - content.appendChild(createSpanWithText("FALLBACK")); - - root.appendChild(document.createTextNode("{SHADOW: ")); - root.appendChild(content); - root.appendChild(document.createTextNode("}")); -} - -function appendShadowDeep(target, select) { - var root = target.createShadowRoot(); - - var child = document.createElement("span"); - { - var content = document.createElement('content'); - content.setAttribute('select', select); - content.appendChild(createSpanWithText("FALLBACK")); - - child.appendChild(document.createTextNode("{INNER: ")); - child.appendChild(content); - child.appendChild(document.createTextNode("}")); - } - - root.appendChild(document.createTextNode("{SHADOW: ")); - root.appendChild(child); - root.appendChild(document.createTextNode("}")); -} - -function doTestIfLeft(restTests) { - var test = restTests.shift(); - if (test == null) - return doneTest(); - - var callIfDone = function() { - setTimeout(function() { - check(); - cleanUp(); - doTestIfLeft(restTests); - }, 0); - }; - - log(test.name); - test(callIfDone); -} - -function doneTest() { - log("TEST COMPLETED"); - if (window.tearDownOnce) - window.tearDownOnce(); - testRunner.notifyDone(); -} - -// A test driver. Call this body.onload. -function doTest(tests) { - if (window.setUpOnce) - window.setUpOnce(); - - if (window.testRunner) { - testRunner.waitUntilDone(); - testRunner.dumpAsText(); - } - - cleanUp(); - doTestIfLeft(tests); -}
diff --git a/third_party/blink/web_tests/web-components-v0-only/html-dialog/form-method-dialog-expected.txt b/third_party/blink/web_tests/web-components-v0-only/html-dialog/form-method-dialog-expected.txt deleted file mode 100644 index 73aa85e..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/html-dialog/form-method-dialog-expected.txt +++ /dev/null
@@ -1,106 +0,0 @@ -CONSOLE WARNING: line 177: Element.createShadowRoot is deprecated and will be removed in M80, around February 2020. Please use Element.attachShadow instead. See https://www.chromestatus.com/features/4507242028072960 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -Tests form submission with method=dialog - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - -Clicking outer-submit-empty-string -PASS outer; dialog.open is false -PASS outer; dialog.returnValue is "" -PASS inner; dialog.open is true -PASS inner; dialog.returnValue is "init" -PASS host; dialog.open is true -PASS host; dialog.returnValue is "init" - - -Clicking outer-submit-no-value -PASS outer; dialog.open is false -PASS outer; dialog.returnValue is "init" -PASS inner; dialog.open is true -PASS inner; dialog.returnValue is "init" -PASS host; dialog.open is true -PASS host; dialog.returnValue is "init" - - -Clicking inner-submit-yes -PASS outer; dialog.open is true -PASS outer; dialog.returnValue is "init" -PASS inner; dialog.open is false -PASS inner; dialog.returnValue is "Yes" -PASS host; dialog.open is true -PASS host; dialog.returnValue is "init" - - -Clicking inner-submit-no -PASS outer; dialog.open is true -PASS outer; dialog.returnValue is "init" -PASS inner; dialog.open is false -PASS inner; dialog.returnValue is "No" -PASS host; dialog.open is true -PASS host; dialog.returnValue is "init" - - -Clicking no-dialog-ancestor-1 -PASS outer; dialog.open is true -PASS outer; dialog.returnValue is "init" -PASS inner; dialog.open is true -PASS inner; dialog.returnValue is "init" -PASS host; dialog.open is true -PASS host; dialog.returnValue is "init" - - -Clicking no-dialog-ancestor-2 -PASS outer; dialog.open is true -PASS outer; dialog.returnValue is "init" -PASS inner; dialog.open is true -PASS inner; dialog.returnValue is "init" -PASS host; dialog.open is true -PASS host; dialog.returnValue is "init" - - -Clicking host-submit-yes -PASS outer; dialog.open is true -PASS outer; dialog.returnValue is "init" -PASS inner; dialog.open is true -PASS inner; dialog.returnValue is "init" -PASS host; dialog.open is false -PASS host; dialog.returnValue is "Yes" - - -Submitting a form without submit button (this should not crash) - - -Clicking a button in a closed dialog -PASS dialog.open is false -PASS dialog.returnValue is "init" - - -Activating an image button by click() -PASS outer; dialog.open is true -PASS outer; dialog.returnValue is "init" -PASS inner; dialog.open is false -PASS inner; dialog.returnValue is "0,0" -PASS host; dialog.open is true -PASS host; dialog.returnValue is "init" - - -Activating an image button by keyboard -PASS outer; dialog.open is true -PASS outer; dialog.returnValue is "init" -PASS inner; dialog.open is false -PASS inner; dialog.returnValue is "0,0" -PASS host; dialog.open is true -PASS host; dialog.returnValue is "init" - - -Clicking an image button -PASS outer; dialog.open is true -PASS outer; dialog.returnValue is "init" -PASS inner; dialog.open is false -PASS inner; dialog.returnValue is "10,5" -PASS host; dialog.open is true -PASS host; dialog.returnValue is "init" -PASS successfullyParsed is true - -TEST COMPLETE - -
diff --git a/third_party/blink/web_tests/web-components-v0-only/html-dialog/form-method-dialog.html b/third_party/blink/web_tests/web-components-v0-only/html-dialog/form-method-dialog.html deleted file mode 100644 index 8815d81..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/html-dialog/form-method-dialog.html +++ /dev/null
@@ -1,213 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script src="../../resources/js-test.js"></script> -<style> -/* Position on an integer offset to avoid rounding errors during the test to click on a coordinate. */ -#image { - position: fixed; - top: 50px; - left: 50px; -} -</style> -</head> -<body> -<dialog id="outer"> - <form method="dialog"> - <input id="outer-submit-empty-string" type="submit" value=""> - </form> - <dialog id="inner"> - <form method="dialog"> - <input id="inner-submit-yes" type="submit" value="Yes"> - <input id="inner-submit-no" type="submit" value="No"> - <input id="image" type="image" - src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAANcAAACuCAIAAAAqMg/rAAAAAXNSR0IArs4c6QAAAU9JREFUeNrt0jERAAAIxDDAv+dHAxNLIqHXTlLwaiTAheBCXAguxIXgQlwILsSF4EJcCC7EheBCXAguxIXgQlwILsSF4EJcCC7EheBCXAguxIXgQlwILsSF4EJcCC7EheBCXAguxIXgQlwILsSF4EJcCC7EheBCXAguxIXgQlwILsSF4EJcCC7EheBCXAguxIXgQlwILsSF4EJcCC7EheBCXAguxIXgQlwILsSF4EJcCC7EheBCXAguxIXgQlwILsSF4EJcCC7EheBCXAguxIXgQlwILsSF4EJcCC7EheBCXAguxIXgQlwILsSF4EJcCC7EheBCXAguxIXgQlwILsSFEuBCcCEuBBfiQnAhLgQX4kJwIS4EF+JCcCEuBBfiQnAhLgQX4kJwIS4EF+JCcCEuBBfiQnAhLgQX4kJwIS4EF+JCcCEuBBfiQnAhLoSDBZXqBFnkRyeqAAAAAElFTkSuQmCC"> - </form> - </dialog> - <form> - <input id="outer-submit-no-value" formmethod="dialog" type="submit"> - </form> -</dialog> -<dialog id="host"></dialog> -<form method="dialog"> - <input id="no-dialog-ancestor-1" type="submit" value="Clicking me shouldn't submit"> - <input id="no-dialog-ancestor-2" formmethod="dialog" type="submit" value="I also don't submit"> -</form> -<form id="form_without_submit_button" method="dialog"> -</form> -<script> -window.jsTestIsAsync = true; - -function openDialogs() -{ - var dialogs = document.querySelectorAll('dialog'); - for (var i = 0; i < dialogs.length; ++i) { - dialogs[i].returnValue = 'init'; - dialogs[i].show(); - } -} - -function closeDialogs() -{ - var dialogs = document.querySelectorAll('dialog'); - for (var i = 0; i < dialogs.length; ++i) { - if (dialogs[i].open) - dialogs[i].close(); - } -} - -function checkDialogs(button, targetDialog, expectedResult) -{ - dialogs = document.querySelectorAll('dialog'); - for (var i = 0; i < dialogs.length; ++i) { - dialog = dialogs[i]; - if (dialog == targetDialog) - shouldBeFalse(dialog.id + '; dialog.open'); - else - shouldBeTrue(dialog.id + '; dialog.open'); - - if (dialog == targetDialog && expectedResult !== null) - shouldBeEqualToString(dialog.id + '; dialog.returnValue', expectedResult); - else - shouldBeEqualToString(dialog.id + '; dialog.returnValue', 'init'); - } -} - -function $(id) -{ - return document.getElementById(id); -} - -function testDialogWithoutSubmitButton() -{ - debug('Submitting a form without submit button (this should not crash)'); - form = $('form_without_submit_button'); - form.submit(); - debug(''); -} - -function testClosedDialog() -{ - debug('Clicking a button in a closed dialog'); - closeDialogs(); - button = $('outer-submit-empty-string'); - dialog = $('outer'); - dialog.returnValue = 'init'; - button.click(); - shouldBeFalse('dialog.open'); - shouldBeEqualToString('dialog.returnValue', 'init'); - debug(''); -} - -function testClickMethodOnImageButton() -{ - debug('Activating an image button by click()'); - openDialogs(); - $('inner').addEventListener('close', testClickMethodOnImageButtonClose); - $('image').click(); -} - -function testClickMethodOnImageButtonClose() -{ - var image = $('image'); - var inner = $('inner'); - inner.removeEventListener('close', testClickMethodOnImageButtonClose); - checkDialogs(image, inner, '0,0'); - debug(''); - setTimeout(testKeyboardActivatingImageButton, 0); -} - -function testKeyboardActivatingImageButton() -{ - debug('Activating an image button by keyboard'); - openDialogs(); - $('inner').addEventListener('close', testKeyboardActivatingImageButtonClose); - if (!window.eventSender) { - debug('This test requires eventSender.'); - return; - } - $('image').focus(); - eventSender.keyDown(' '); -} - -function testKeyboardActivatingImageButtonClose() -{ - var image = $('image'); - var inner = $('inner'); - - inner.removeEventListener('close', testKeyboardActivatingImageButtonClose); - checkDialogs(image, inner, '0,0'); - debug(''); - setTimeout(testClickingImageButton, 0); -} - -function testClickingImageButton() -{ - debug('Clicking an image button'); - openDialogs(); - var image = $('image'); - var inner = $('inner'); - var x = image.getBoundingClientRect().left + 10; - var y = image.getBoundingClientRect().top + 5; - - inner.addEventListener('close', testClickingImageButtonClose); - if (!window.eventSender) { - debug('This test requires eventSender'); - return; - } - eventSender.mouseMoveTo(x, y); - eventSender.mouseDown(); - eventSender.mouseUp(); -} - -function testClickingImageButtonClose() -{ - var image = $('image'); - var inner = $('inner'); - - inner.removeEventListener('close', testClickingImageButtonClose); - checkDialogs(image, inner, '10,5'); - finishJSTest(); -} - -function test() -{ - description('Tests form submission with method=dialog'); - var host = document.querySelector('#host'); - var shadowRoot = host.createShadowRoot(); - shadowRoot.innerHTML = - '<form method="dialog">' + - ' <input id="host-submit-yes" type=submit value=Yes>' + - '</form>'; - - var tests = [ - { button: $('outer-submit-empty-string'), targetDialog: $('outer'), result: '' }, - { button: $('outer-submit-no-value'), targetDialog: $('outer'), result: null }, - { button: $('inner-submit-yes'), targetDialog: $('inner'), result: 'Yes' }, - { button: $('inner-submit-no'), targetDialog: $('inner'), result: 'No' }, - { button: $('no-dialog-ancestor-1'), targetDialog: null }, - { button: $('no-dialog-ancestor-2'), targetDialog: null }, - { button: host.shadowRoot.querySelector('#host-submit-yes'), targetDialog: $('host'), result: 'Yes' } - ]; - - for (var i = 0; i < tests.length; ++i) { - var button = tests[i].button; - openDialogs(); - debug('Clicking ' + button.id); - button.click(); - checkDialogs(button, tests[i].targetDialog, tests[i].result); - debug(''); - } - - testDialogWithoutSubmitButton(); - - testClosedDialog(); - - // The tests involving image button seem to need to be async. - testClickMethodOnImageButton(); -} - -test(); -</script> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/html-dialog/modal-dialog-distributed-child-is-not-inert-expected.txt b/third_party/blink/web_tests/web-components-v0-only/html-dialog/modal-dialog-distributed-child-is-not-inert-expected.txt deleted file mode 100644 index 2c94fbc..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/html-dialog/modal-dialog-distributed-child-is-not-inert-expected.txt +++ /dev/null
@@ -1,11 +0,0 @@ -CONSOLE WARNING: line 28: Element.createShadowRoot is deprecated and will be removed in M80, around February 2020. Please use Element.attachShadow instead. See https://www.chromestatus.com/features/4507242028072960 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -Tests that nodes transposed into the dialog are not inert. The test passes if you can click the button. - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - -PASS button was clicked -PASS successfullyParsed is true - -TEST COMPLETE - -Click me
diff --git a/third_party/blink/web_tests/web-components-v0-only/html-dialog/modal-dialog-distributed-child-is-not-inert.html b/third_party/blink/web_tests/web-components-v0-only/html-dialog/modal-dialog-distributed-child-is-not-inert.html deleted file mode 100644 index a0292a1..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/html-dialog/modal-dialog-distributed-child-is-not-inert.html +++ /dev/null
@@ -1,43 +0,0 @@ -<!DOCTYPE html> -<html> -<head> -<script src="../../resources/js-test.js"></script> -</head> -<body> -<dialog> - <content></content> -</dialog> -<div id="host"> - <button>Click me</button> -</div> -<script> -function clickOn(element) -{ - if (!window.eventSender) - return; - var rect = element.getBoundingClientRect(); - eventSender.mouseMoveTo(rect.left + rect.width / 2, rect.top + rect.height / 2); - eventSender.mouseDown(); - eventSender.mouseUp(); -} - -jsTestIsAsync = true; -description('Tests that nodes transposed into the dialog are not inert. The test passes if you can click the button.'); - -dialog = document.querySelector('dialog'); -root = document.querySelector('#host').createShadowRoot(); -root.appendChild(dialog); -dialog.showModal(); - -button = document.querySelector('button'); -dialog.addEventListener('click', function(event) { - if (event.target == button) - testPassed('button was clicked'); - else - testFailed('button was not clicked'); - finishJSTest(); -}); -clickOn(button); -</script> -</body> -</html>
diff --git a/third_party/blink/web_tests/web-components-v0-only/resources/shadow-dom.js b/third_party/blink/web_tests/web-components-v0-only/resources/shadow-dom.js deleted file mode 100644 index 7828095..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/resources/shadow-dom.js +++ /dev/null
@@ -1,180 +0,0 @@ -function removeWhiteSpaceOnlyTextNodes(node) { - for (var i = 0; i < node.childNodes.length; i++) { - var child = node.childNodes[i]; - if (child.nodeType === Node.TEXT_NODE && - child.nodeValue.trim().length == 0) { - node.removeChild(child); - i--; - } else if ( - child.nodeType === Node.ELEMENT_NODE || - child.nodeType === Node.DOCUMENT_FRAGMENT_NODE) { - removeWhiteSpaceOnlyTextNodes(child); - } - } - if (node.shadowRoot) { - removeWhiteSpaceOnlyTextNodes(node.shadowRoot); - } -} - -function convertTemplatesToShadowRootsWithin(node) { - var nodes = node.querySelectorAll('template'); - for (var i = 0; i < nodes.length; ++i) { - var template = nodes[i]; - var mode = template.getAttribute('data-mode'); - var delegatesFocus = template.hasAttribute('data-delegatesFocus'); - var parent = template.parentNode; - parent.removeChild(template); - var shadowRoot; - if (!mode || mode == 'v0') { - shadowRoot = parent.createShadowRoot(); - } else { - shadowRoot = - parent.attachShadow({'mode': mode, 'delegatesFocus': delegatesFocus}); - } - var expose = template.getAttribute('data-expose-as'); - if (expose) - window[expose] = shadowRoot; - if (template.id) - shadowRoot.id = template.id; - var fragments = document.importNode(template.content, true); - shadowRoot.appendChild(fragments); - - convertTemplatesToShadowRootsWithin(shadowRoot); - } -} - -function isShadowHost(node) { - return node && node.nodeType == Node.ELEMENT_NODE && node.shadowRoot; -} - -function isIFrameElement(element) { - return element && element.nodeName == 'IFRAME'; -} - -// Returns node from shadow/iframe tree "path". -function getNodeInComposedTree(path) { - var ids = path.split('/'); - var node = document.getElementById(ids[0]); - for (var i = 1; node != null && i < ids.length; ++i) { - if (isIFrameElement(node)) - node = node.contentDocument.getElementById(ids[i]); - else if (isShadowHost(node)) - node = node.shadowRoot.getElementById(ids[i]); - else - return null; - } - return node; -} - -function createTestTree(node) { - let ids = {}; - - function attachShadowFromTemplate(template) { - let parent = template.parentNode; - parent.removeChild(template); - let shadowRoot; - if (template.getAttribute('data-mode') === 'v0') { - // For legacy Shadow DOM - shadowRoot = parent.createShadowRoot(); - } else if (template.getAttribute('data-slot-assignment') === 'manual') { - shadowRoot = - parent.attachShadow({mode: template.getAttribute('data-mode'), - slotAssignment: 'manual'}); - } else { - shadowRoot = - parent.attachShadow({mode: template.getAttribute('data-mode')}); - } - let id = template.id; - if (id) { - shadowRoot.id = id; - ids[id] = shadowRoot; - } - shadowRoot.appendChild(document.importNode(template.content, true)); - return shadowRoot; - } - - function walk(root) { - if (root.id) { - ids[root.id] = root; - } - for (let e of Array.from(root.querySelectorAll('[id]'))) { - ids[e.id] = e; - } - for (let e of Array.from(root.querySelectorAll('template'))) { - walk(attachShadowFromTemplate(e)); - } - } - - walk(node.cloneNode(true)); - return ids; -} - -function dispatchEventWithLog(nodes, target, event) { - function labelFor(e) { - return e.id || e.tagName; - } - - let log = []; - let attachedNodes = []; - for (let label in nodes) { - let startingNode = nodes[label]; - for (let node = startingNode; node; node = node.parentNode) { - if (attachedNodes.indexOf(node) >= 0) - continue; - let id = node.id; - if (!id) - continue; - attachedNodes.push(node); - node.addEventListener(event.type, (e) => { - // Record [currentTarget, target, relatedTarget, composedPath()] - log.push([ - id, labelFor(e.target), - e.relatedTarget ? labelFor(e.relatedTarget) : null, - e.composedPath().map((n) => { - return labelFor(n); - }) - ]); - }); - } - } - target.dispatchEvent(event); - return log; -} - -function debugEventLog(log) { - for (let i = 0; i < log.length; i++) { - console.log( - '[' + i + '] currentTarget: ' + log[i][0] + ' target: ' + log[i][1] + - ' relatedTarget: ' + log[i][2] + ' composedPath(): ' + log[i][3]); - } -} - -function debugCreateTestTree(nodes) { - for (let k in nodes) { - console.log(k + ' -> ' + nodes[k]); - } -} - -// This function assumes that testharness.js is available. -function assert_event_path_equals(actual, expected) { - assert_equals(actual.length, expected.length); - for (let i = 0; i < actual.length; ++i) { - assert_equals( - actual[i][0], expected[i][0], - 'currentTarget at ' + i + ' should be same'); - assert_equals( - actual[i][1], expected[i][1], 'target at ' + i + ' should be same'); - assert_equals( - actual[i][2], expected[i][2], - 'relatedTarget at ' + i + ' should be same'); - assert_array_equals( - actual[i][3], expected[i][3], - 'composedPath at ' + i + ' should be same'); - } -} - -function assert_background_color(path, color) { - assert_equals( - window.getComputedStyle(getNodeInComposedTree(path)).backgroundColor, - color, 'backgroundColor for ' + path + ' should be ' + color); -}
diff --git a/third_party/blink/web_tests/web-components-v0-only/shadow-dom-crashes/offsetParent-layoutObject-lifecycle.html b/third_party/blink/web_tests/web-components-v0-only/shadow-dom-crashes/offsetParent-layoutObject-lifecycle.html deleted file mode 100644 index 8a1d08d..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/shadow-dom-crashes/offsetParent-layoutObject-lifecycle.html +++ /dev/null
@@ -1,25 +0,0 @@ -<!DOCTYPE html> -<script src='../../resources/testharness.js'></script> -<script src='../../resources/testharnessreport.js'></script> -<script> -// This case is created from reproduction case by cloudfuzzer. -window.addEventListener('load', () => { - test(() => { - var link = document.createElement('link'); - link.setAttribute('rel','import'); - document.head.appendChild(link); - - var style = document.createElement('style'); - style.textContent = '@import url(x)'; - document.head.appendChild(style); - - var frame = document.createElement('frame'); - document.body.appendChild(frame); - - // This could cause crash. - frame.offsetHeight; - assert_true(true, 'This test must run without crash.'); - }, "HTMLElement.offsetHeight should not cause crash."); -}, false); -</script> -<body></body>
diff --git a/third_party/blink/web_tests/web-components-v0-only/shadow-dom-v0/closed-mode-deep-combinator-and-shadow-pseudo-expected.txt b/third_party/blink/web_tests/web-components-v0-only/shadow-dom-v0/closed-mode-deep-combinator-and-shadow-pseudo-expected.txt deleted file mode 100644 index 647d5094..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/shadow-dom-v0/closed-mode-deep-combinator-and-shadow-pseudo-expected.txt +++ /dev/null
@@ -1,88 +0,0 @@ -CONSOLE WARNING: line 306: /deep/ combinator is no longer supported in CSS dynamic profile. It is now effectively no-op, acting as if it were a descendant combinator. /deep/ combinator will be removed, and will be invalid at M65. You should remove it. See https://www.chromestatus.com/features/4964279606312960 for more details. -(1/6) /deep/ style rule on top-level document. -PASS backgroundColorOf('host_open_open') is "rgba(0, 0, 0, 0)" -PASS backgroundColorOf('host_open_open/div1') is "rgba(0, 0, 0, 0)" -PASS backgroundColorOf('host_open_open/div1/div2') is "rgba(0, 0, 0, 0)" -PASS backgroundColorOf('host_open_open/div1b') is "rgba(0, 0, 0, 0)" -PASS backgroundColorOf('host_open_closed') is "rgba(0, 0, 0, 0)" -PASS backgroundColorOf('host_open_closed/div3') is "rgba(0, 0, 0, 0)" -PASS backgroundColorOf('host_open_closed/div3/div4') is "rgba(0, 0, 0, 0)" -PASS backgroundColorOf('host_open_closed/div3b') is "rgba(0, 0, 0, 0)" -PASS backgroundColorOf('host_closed_open') is "rgba(0, 0, 0, 0)" -PASS backgroundColorOf('host_closed_open/div5') is "rgba(0, 0, 0, 0)" -PASS backgroundColorOf('host_closed_open/div5/div6') is "rgba(0, 0, 0, 0)" -PASS backgroundColorOf('host_closed_open/div5b') is "rgba(0, 0, 0, 0)" -PASS backgroundColorOf('host_closed_closed') is "rgba(0, 0, 0, 0)" -PASS backgroundColorOf('host_closed_closed/div7') is "rgba(0, 0, 0, 0)" -PASS backgroundColorOf('host_closed_closed/div7/div8') is "rgba(0, 0, 0, 0)" -PASS backgroundColorOf('host_closed_closed/div7b') is "rgba(0, 0, 0, 0)" -(2/6) ::shadow style rule on top-level document. -PASS backgroundColorOf('host_open_open') is "rgba(0, 0, 0, 0)" -PASS backgroundColorOf('host_open_open/div1') is "rgba(0, 0, 0, 0)" -PASS backgroundColorOf('host_open_open/div1/div2') is "rgba(0, 0, 0, 0)" -PASS backgroundColorOf('host_open_open/div1b') is "rgba(0, 0, 0, 0)" -PASS backgroundColorOf('host_open_closed') is "rgba(0, 0, 0, 0)" -PASS backgroundColorOf('host_open_closed/div3') is "rgba(0, 0, 0, 0)" -PASS backgroundColorOf('host_open_closed/div3/div4') is "rgba(0, 0, 0, 0)" -PASS backgroundColorOf('host_open_closed/div3b') is "rgba(0, 0, 0, 0)" -PASS backgroundColorOf('host_closed_open') is "rgba(0, 0, 0, 0)" -PASS backgroundColorOf('host_closed_open/div5') is "rgba(0, 0, 0, 0)" -PASS backgroundColorOf('host_closed_open/div5/div6') is "rgba(0, 0, 0, 0)" -PASS backgroundColorOf('host_closed_open/div5b') is "rgba(0, 0, 0, 0)" -PASS backgroundColorOf('host_closed_closed') is "rgba(0, 0, 0, 0)" -PASS backgroundColorOf('host_closed_closed/div7') is "rgba(0, 0, 0, 0)" -PASS backgroundColorOf('host_closed_closed/div7/div8') is "rgba(0, 0, 0, 0)" -PASS backgroundColorOf('host_closed_closed/div7b') is "rgba(0, 0, 0, 0)" -(3/6) /deep/ style on shadow tree. -PASS backgroundColorOf('host_open_open/div1') is "rgba(0, 0, 0, 0)" -PASS backgroundColorOf('host_open_open/div1/div2') is "rgba(0, 0, 0, 0)" -PASS backgroundColorOf('host_open_open/div1b') is "rgb(0, 0, 255)" -PASS backgroundColorOf('host_open_closed/div3') is "rgba(0, 0, 0, 0)" -PASS backgroundColorOf('host_open_closed/div3/div4') is "rgba(0, 0, 0, 0)" -PASS backgroundColorOf('host_open_closed/div3b') is "rgb(0, 0, 255)" -PASS backgroundColorOf('host_closed_open/div5') is "rgba(0, 0, 0, 0)" -PASS backgroundColorOf('host_closed_open/div5/div6') is "rgba(0, 0, 0, 0)" -PASS backgroundColorOf('host_closed_open/div5b') is "rgb(0, 0, 255)" -PASS backgroundColorOf('host_closed_closed/div7') is "rgba(0, 0, 0, 0)" -PASS backgroundColorOf('host_closed_closed/div7/div8') is "rgba(0, 0, 0, 0)" -PASS backgroundColorOf('host_closed_closed/div7b') is "rgb(0, 0, 255)" -(4/6) ::shadow style on shadow tree. -PASS backgroundColorOf('host_open_open/div1') is "rgba(0, 0, 0, 0)" -PASS backgroundColorOf('host_open_open/div1/div2') is "rgba(0, 0, 0, 0)" -PASS backgroundColorOf('host_open_open/div1b') is "rgba(0, 0, 0, 0)" -PASS backgroundColorOf('host_open_closed/div3') is "rgba(0, 0, 0, 0)" -PASS backgroundColorOf('host_open_closed/div3/div4') is "rgba(0, 0, 0, 0)" -PASS backgroundColorOf('host_open_closed/div3b') is "rgba(0, 0, 0, 0)" -PASS backgroundColorOf('host_closed_open/div5') is "rgba(0, 0, 0, 0)" -PASS backgroundColorOf('host_closed_open/div5/div6') is "rgba(0, 0, 0, 0)" -PASS backgroundColorOf('host_closed_open/div5b') is "rgba(0, 0, 0, 0)" -PASS backgroundColorOf('host_closed_closed/div7') is "rgba(0, 0, 0, 0)" -PASS backgroundColorOf('host_closed_closed/div7/div8') is "rgba(0, 0, 0, 0)" -PASS backgroundColorOf('host_closed_closed/div7b') is "rgba(0, 0, 0, 0)" -(5/6) /deep/ selector in querySelectorAll() -PASS host_open_open.querySelectorAll("div /deep/ div").length is 0 -PASS host_open_closed.querySelectorAll("div /deep/ div").length is 0 -PASS host_closed_open.querySelectorAll("div /deep/ div").length is 0 -PASS host_closed_closed.querySelectorAll("div /deep/ div").length is 0 -PASS results.length is 1 -PASS node.id is "div1b" -PASS results.length is 1 -PASS node.id is "div3b" -PASS results.length is 1 -PASS node.id is "div5b" -PASS results.length is 1 -PASS node.id is "div7b" -(6/6) ::shadow selector in querySelectorAll() -PASS host_open_open.querySelectorAll("div::shadow div").length is 0 -PASS host_open_closed.querySelectorAll("div::shadow div").length is 0 -PASS host_closed_open.querySelectorAll("div::shadow div").length is 0 -PASS host_closed_closed.querySelectorAll("div::shadow div").length is 0 -PASS div1.querySelectorAll("div::shadow div").length is 0 -PASS div3.querySelectorAll("div::shadow div").length is 0 -PASS div5.querySelectorAll("div::shadow div").length is 0 -PASS div7.querySelectorAll("div::shadow div").length is 0 -PASS successfullyParsed is true - -TEST COMPLETE - -
diff --git a/third_party/blink/web_tests/web-components-v0-only/shadow-dom-v0/closed-mode-deep-combinator-and-shadow-pseudo.html b/third_party/blink/web_tests/web-components-v0-only/shadow-dom-v0/closed-mode-deep-combinator-and-shadow-pseudo.html deleted file mode 100644 index 4d90d4e..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/shadow-dom-v0/closed-mode-deep-combinator-and-shadow-pseudo.html +++ /dev/null
@@ -1,154 +0,0 @@ -<!doctype html> -<script src="../../resources/js-test.js"></script> -<script src="../fast/dom-shadow/resources/shadow-dom.js"></script> -<style id="style1"> -</style> -<body></body> -<script> -function prepareShadowTree(hostId, mode1, mode2, div1, div2, div3) { - var parent = document.body; - parent.appendChild( - createDOM('div', {'id': hostId}, - attachShadow({'mode': mode1}, - createDOM('div', {'id': div1}, - attachShadow({'mode': mode2}, - createDOM('div', {'id': div2})), - createDOM('div', {'id': div3}))))); -} - -var results; -var expected; -var node; -function queryResultsShouldBe(host, query, expectedArgument) { - results = host.querySelectorAll(query); - expected = expectedArgument; - shouldBe('results.length', '' + expected.length); - for (var i = 0; i < expected.length; ++i) { - node = results[i]; - shouldBeEqualToString.bind(this)('node.id', expected[i]); - } -} - -prepareShadowTree('host_open_open', 'open', 'open', 'div1', 'div2', 'div1b'); -prepareShadowTree('host_open_closed', 'open', 'closed', 'div3', 'div4', 'div3b'); -prepareShadowTree('host_closed_open', 'closed', 'open', 'div5', 'div6', 'div5b'); -prepareShadowTree('host_closed_closed', 'closed', 'closed', 'div7', 'div8', 'div7b'); - -debug('(1/6) /deep/ style rule on top-level document.'); -var styleElement = document.getElementById('style1'); -styleElement.textContent = 'div /deep/ div { background-color: blue; }'; - -backgroundColorShouldBe('host_open_open', 'rgba(0, 0, 0, 0)'); -backgroundColorShouldBe('host_open_open/div1', 'rgba(0, 0, 0, 0)'); -backgroundColorShouldBe('host_open_open/div1/div2', 'rgba(0, 0, 0, 0)'); -backgroundColorShouldBe('host_open_open/div1b', 'rgba(0, 0, 0, 0)'); -backgroundColorShouldBe('host_open_closed', 'rgba(0, 0, 0, 0)'); -backgroundColorShouldBe('host_open_closed/div3', 'rgba(0, 0, 0, 0)'); -backgroundColorShouldBe('host_open_closed/div3/div4', 'rgba(0, 0, 0, 0)'); -backgroundColorShouldBe('host_open_closed/div3b', 'rgba(0, 0, 0, 0)'); -backgroundColorShouldBe('host_closed_open', 'rgba(0, 0, 0, 0)'); -backgroundColorShouldBe('host_closed_open/div5', 'rgba(0, 0, 0, 0)'); -backgroundColorShouldBe('host_closed_open/div5/div6', 'rgba(0, 0, 0, 0)'); -backgroundColorShouldBe('host_closed_open/div5b', 'rgba(0, 0, 0, 0)'); -backgroundColorShouldBe('host_closed_closed', 'rgba(0, 0, 0, 0)'); -backgroundColorShouldBe('host_closed_closed/div7', 'rgba(0, 0, 0, 0)'); -backgroundColorShouldBe('host_closed_closed/div7/div8', 'rgba(0, 0, 0, 0)'); -backgroundColorShouldBe('host_closed_closed/div7b', 'rgba(0, 0, 0, 0)'); - -debug('(2/6) ::shadow style rule on top-level document.'); -styleElement.innerHTML = 'div::shadow div { background-color: green; }'; - -backgroundColorShouldBe('host_open_open', 'rgba(0, 0, 0, 0)'); -backgroundColorShouldBe('host_open_open/div1', 'rgba(0, 0, 0, 0)'); -backgroundColorShouldBe('host_open_open/div1/div2', 'rgba(0, 0, 0, 0)'); -backgroundColorShouldBe('host_open_open/div1b', 'rgba(0, 0, 0, 0)'); -backgroundColorShouldBe('host_open_closed', 'rgba(0, 0, 0, 0)'); -backgroundColorShouldBe('host_open_closed/div3', 'rgba(0, 0, 0, 0)'); -backgroundColorShouldBe('host_open_closed/div3/div4', 'rgba(0, 0, 0, 0)'); -backgroundColorShouldBe('host_open_closed/div3b', 'rgba(0, 0, 0, 0)'); -backgroundColorShouldBe('host_closed_open', 'rgba(0, 0, 0, 0)'); -backgroundColorShouldBe('host_closed_open/div5', 'rgba(0, 0, 0, 0)'); -backgroundColorShouldBe('host_closed_open/div5/div6', 'rgba(0, 0, 0, 0)'); -backgroundColorShouldBe('host_closed_open/div5b', 'rgba(0, 0, 0, 0)'); -backgroundColorShouldBe('host_closed_closed', 'rgba(0, 0, 0, 0)'); -backgroundColorShouldBe('host_closed_closed/div7', 'rgba(0, 0, 0, 0)'); -backgroundColorShouldBe('host_closed_closed/div7/div8', 'rgba(0, 0, 0, 0)'); -backgroundColorShouldBe('host_closed_closed/div7b', 'rgba(0, 0, 0, 0)'); - -debug('(3/6) /deep/ style on shadow tree.'); -styleElement.innerHTML = ''; -var div1 = getNodeInComposedTree('host_open_open/div1'); -div1.insertAdjacentHTML('afterbegin', '<style>div /deep/ div { background-color: blue; }</style>'); -backgroundColorShouldBe('host_open_open/div1', 'rgba(0, 0, 0, 0)'); -backgroundColorShouldBe('host_open_open/div1/div2', 'rgba(0, 0, 0, 0)'); -backgroundColorShouldBe('host_open_open/div1b', 'rgb(0, 0, 255)'); -div1.removeChild(div1.firstElementChild); - -var div3 = getNodeInComposedTree('host_open_closed/div3'); -div3.insertAdjacentHTML('afterbegin', '<style>div /deep/ div { background-color: blue; }</style>'); -backgroundColorShouldBe('host_open_closed/div3', 'rgba(0, 0, 0, 0)'); -backgroundColorShouldBe('host_open_closed/div3/div4', 'rgba(0, 0, 0, 0)'); -backgroundColorShouldBe('host_open_closed/div3b', 'rgb(0, 0, 255)'); -div3.removeChild(div3.firstElementChild); - -var div5 = getNodeInComposedTree('host_closed_open/div5'); -div5.insertAdjacentHTML('afterbegin', '<style>div /deep/ div { background-color: blue; }</style>'); -backgroundColorShouldBe('host_closed_open/div5', 'rgba(0, 0, 0, 0)'); -backgroundColorShouldBe('host_closed_open/div5/div6', 'rgba(0, 0, 0, 0)'); -backgroundColorShouldBe('host_closed_open/div5b', 'rgb(0, 0, 255)'); -div5.removeChild(div5.firstElementChild); - -var div7 = getNodeInComposedTree('host_closed_closed/div7'); -div7.insertAdjacentHTML('afterbegin', '<style>div /deep/ div { background-color: blue; }</style>'); -backgroundColorShouldBe('host_closed_closed/div7', 'rgba(0, 0, 0, 0)'); -backgroundColorShouldBe('host_closed_closed/div7/div8', 'rgba(0, 0, 0, 0)'); -backgroundColorShouldBe('host_closed_closed/div7b', 'rgb(0, 0, 255)'); -div7.removeChild(div7.firstElementChild); - -debug('(4/6) ::shadow style on shadow tree.'); -div1.insertAdjacentHTML('afterbegin', '<style>div::shadow div { background-color: green; }</style>'); -backgroundColorShouldBe('host_open_open/div1', 'rgba(0, 0, 0, 0)'); -backgroundColorShouldBe('host_open_open/div1/div2', 'rgba(0, 0, 0, 0)'); -backgroundColorShouldBe('host_open_open/div1b', 'rgba(0, 0, 0, 0)'); -div1.removeChild(div1.firstElementChild); - -div3.insertAdjacentHTML('afterbegin', '<style>div::shadow div { background-color: green; }</style>'); -backgroundColorShouldBe('host_open_closed/div3', 'rgba(0, 0, 0, 0)'); -backgroundColorShouldBe('host_open_closed/div3/div4', 'rgba(0, 0, 0, 0)'); -backgroundColorShouldBe('host_open_closed/div3b', 'rgba(0, 0, 0, 0)'); -div3.removeChild(div3.firstElementChild); - -div5.insertAdjacentHTML('afterbegin', '<style>div::shadow div { background-color: green; }</style>'); -backgroundColorShouldBe('host_closed_open/div5', 'rgba(0, 0, 0, 0)'); -backgroundColorShouldBe('host_closed_open/div5/div6', 'rgba(0, 0, 0, 0)'); -backgroundColorShouldBe('host_closed_open/div5b', 'rgba(0, 0, 0, 0)'); -div5.removeChild(div5.firstElementChild); - -div7.insertAdjacentHTML('afterbegin', '<style>div::shadow div { background-color: green; }</style>'); -backgroundColorShouldBe('host_closed_closed/div7', 'rgba(0, 0, 0, 0)'); -backgroundColorShouldBe('host_closed_closed/div7/div8', 'rgba(0, 0, 0, 0)'); -backgroundColorShouldBe('host_closed_closed/div7b', 'rgba(0, 0, 0, 0)'); -div7.removeChild(div7.firstElementChild); - -debug('(5/6) /deep/ selector in querySelectorAll()'); -shouldBe('host_open_open.querySelectorAll("div /deep/ div").length', '0'); -shouldBe('host_open_closed.querySelectorAll("div /deep/ div").length', '0'); -shouldBe('host_closed_open.querySelectorAll("div /deep/ div").length', '0'); -shouldBe('host_closed_closed.querySelectorAll("div /deep/ div").length', '0'); - -queryResultsShouldBe(div1, 'div /deep/ div', ['div1b']); -queryResultsShouldBe(div3, 'div /deep/ div', ['div3b']); -queryResultsShouldBe(div5, 'div /deep/ div', ['div5b']); -queryResultsShouldBe(div7, 'div /deep/ div', ['div7b']); - -debug('(6/6) ::shadow selector in querySelectorAll()'); -shouldBe('host_open_open.querySelectorAll("div::shadow div").length', '0'); -shouldBe('host_open_closed.querySelectorAll("div::shadow div").length', '0'); -shouldBe('host_closed_open.querySelectorAll("div::shadow div").length', '0'); -shouldBe('host_closed_closed.querySelectorAll("div::shadow div").length', '0'); - -shouldBe('div1.querySelectorAll("div::shadow div").length', '0'); -shouldBe('div3.querySelectorAll("div::shadow div").length', '0'); -shouldBe('div5.querySelectorAll("div::shadow div").length', '0'); -shouldBe('div7.querySelectorAll("div::shadow div").length', '0'); -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/shadow-dom-v0/closed-mode-deep-combinators-expected.txt b/third_party/blink/web_tests/web-components-v0-only/shadow-dom-v0/closed-mode-deep-combinators-expected.txt deleted file mode 100644 index a9cc7f3e..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/shadow-dom-v0/closed-mode-deep-combinators-expected.txt +++ /dev/null
@@ -1,14 +0,0 @@ -CONSOLE WARNING: line 87: Element.createShadowRoot is deprecated and will be removed in M80, around February 2020. Please use Element.attachShadow instead. See https://www.chromestatus.com/features/4507242028072960 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -PASS result.length is 7 -PASS node.id is "openhost" -PASS node.id is "closedhost" -PASS node.id is "v0host" -PASS node.id is "v0host_in_v0host" -PASS node.id is "div_v0_in_v0" -PASS node.id is "openhost_in_v0host" -PASS node.id is "closedhost_in_v0host" -PASS successfullyParsed is true - -TEST COMPLETE - -
diff --git a/third_party/blink/web_tests/web-components-v0-only/shadow-dom-v0/closed-mode-deep-combinators.html b/third_party/blink/web_tests/web-components-v0-only/shadow-dom-v0/closed-mode-deep-combinators.html deleted file mode 100644 index 908af24..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/shadow-dom-v0/closed-mode-deep-combinators.html +++ /dev/null
@@ -1,68 +0,0 @@ -<!doctype html> -<script src="../../resources/js-test.js"></script> -<script src="../fast/dom-shadow/resources/shadow-dom.js"></script> -<body> - <div id="parent"></div> -</body> -<script> -function prepareShadowTree() { - var parent = document.getElementById('parent'); - parent.appendChild( - createDOM('div', {id: 'toplevel'}, - createDOM('div', {id: 'openhost'}, - attachShadow({mode: 'open'}, - createDOM('div', {id: 'v0host_in_openshadow'}, - createShadowRoot( - createDOM('div', {id: 'div_v0_in_open'}))), - createDOM('div', {id: 'openhost_in_openshadow'}, - attachShadow({'mode': 'open'}, - createDOM('div', {id: 'div_open_in_open'}))), - createDOM('div', {id: 'closedhost_in_openshadow'}, - attachShadow({'mode': 'closed'}, - createDOM('div', {id: 'div_closed_in_open'}))))), - createDOM('div', {id: 'closedhost'}, - attachShadow({mode: 'closed'}, - createDOM('div', {id: 'v0host_in_closedshadow'}, - createShadowRoot( - createDOM('div', {id: 'div_v0_in_closed'}))), - createDOM('div', {id: 'openhost_in_closedshadow'}, - attachShadow({'mode': 'open'}, - createDOM('div', {id: 'div_open_in_closed'}))), - createDOM('div', {id: 'closedhost_in_closedshadow'}, - attachShadow({'mode': 'closed'}, - createDOM('div', {id: 'div_closed_in_closed'}))))), - createDOM('div', {id: 'v0host'}, - createShadowRoot( - createDOM('div', {id: 'v0host_in_v0host'}, - createShadowRoot( - createDOM('div', {id: 'div_v0_in_v0'}))), - createDOM('div', {id: 'openhost_in_v0host'}, - attachShadow({'mode': 'open'}, - createDOM('div', {id: 'div_open_in_v0'}))), - createDOM('div', {id: 'closedhost_in_v0host'}, - attachShadow({'mode': 'closed'}, - createDOM('div', {id: 'div_closed_in_v0'}))))))); -} - -prepareShadowTree(); - -var parent = document.getElementById('parent'); -var result = parent.querySelectorAll("div /deep/ div /deep/ div"); -shouldBe('result.length', '7'); - -var expected = [ - 'openhost', - 'closedhost', - 'v0host', - 'v0host_in_v0host', - 'div_v0_in_v0', - 'openhost_in_v0host', - 'closedhost_in_v0host' -]; - -var node; -for (var i = 0; i < result.length; ++i) { - node = result[i]; - shouldBeEqualToString('node.id', expected[i]); -} -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/shadow-dom-v0/deep-in-selectors.html b/third_party/blink/web_tests/web-components-v0-only/shadow-dom-v0/deep-in-selectors.html deleted file mode 100644 index 1681bd7..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/shadow-dom-v0/deep-in-selectors.html +++ /dev/null
@@ -1,13 +0,0 @@ -<!DOCTYPE html> -<script src="../../resources/testharness.js"></script> -<script src="../../resources/testharnessreport.js"></script> -<div id=a><div id=b></div></div> -<script> -test(() => { - const sr = a.createShadowRoot(); - const p = document.createElement('p'); - sr.appendChild(p); - - assert_array_equals(document.querySelectorAll('#a *, #a /deep/ *'), [p, b]); -}, '/deep/ should be valid in the second selector of selectors'); -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/shadow-dom-v0/event-composed-path-closed-shadowroot2-expected.txt b/third_party/blink/web_tests/web-components-v0-only/shadow-dom-v0/event-composed-path-closed-shadowroot2-expected.txt deleted file mode 100644 index 852f1cc..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/shadow-dom-v0/event-composed-path-closed-shadowroot2-expected.txt +++ /dev/null
@@ -1,35 +0,0 @@ -Event.composedPath() should include only unclosed nodes. -The full event path should be (length=12): -div#target, #shadow-root (open), div#div3_open, #shadow-root (closed), -div#div2_closed, #shadow-root (open), div#host_open, div#host_closed, -body, html, #document, window - -On #host_closed, #host_open, and #div2_closed, -div#target, #shadow-root (open), div#div3_open, #shadow-root (closed) -will be trimmed (length=8). - - -Dispaching a click event on #target, listening on #host_closed. -Got event.composedPath() for #host_closed: -#div2_closed, [object ShadowRoot], #host_open, #host_closed, [object HTMLBodyElement], [object HTMLHtmlElement], [object HTMLDocument], [object Window], length: 8 - -Dispaching a click event on #target, listening on #host_open. -Got event.composedPath() for #host_open: -#div2_closed, [object ShadowRoot], #host_open, #host_closed, [object HTMLBodyElement], [object HTMLHtmlElement], [object HTMLDocument], [object Window], length: 8 - -Dispaching a click event on #target, listening on #div2_closed. -Got event.composedPath() for #div2_closed: -#div2_closed, [object ShadowRoot], #host_open, #host_closed, [object HTMLBodyElement], [object HTMLHtmlElement], [object HTMLDocument], [object Window], length: 8 - -Dispaching a click event on #target, listening on #div3_open. -Got event.composedPath() for #div3_open: -#target, [object ShadowRoot], #div3_open, [object ShadowRoot], #div2_closed, [object ShadowRoot], #host_open, #host_closed, [object HTMLBodyElement], [object HTMLHtmlElement], [object HTMLDocument], [object Window], length: 12 - -Dispaching a click event on #target, listening on #target. -Got event.composedPath() for #target: -#target, [object ShadowRoot], #div3_open, [object ShadowRoot], #div2_closed, [object ShadowRoot], #host_open, #host_closed, [object HTMLBodyElement], [object HTMLHtmlElement], [object HTMLDocument], [object Window], length: 12 -PASS successfullyParsed is true - -TEST COMPLETE - -
diff --git a/third_party/blink/web_tests/web-components-v0-only/shadow-dom-v0/event-composed-path-closed-shadowroot2.html b/third_party/blink/web_tests/web-components-v0-only/shadow-dom-v0/event-composed-path-closed-shadowroot2.html deleted file mode 100644 index 2e7a808..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/shadow-dom-v0/event-composed-path-closed-shadowroot2.html +++ /dev/null
@@ -1,54 +0,0 @@ -<!doctype html> -<script src="../../resources/js-test.js"></script> -<script src="../fast/dom-shadow/resources/shadow-dom.js"></script> -<body></body> -<script> -function prepareTree() { - // Note: #target will be distributed to furthest <content>. - document.body.appendChild( - createDOM('div', {id: 'host_closed'}, - attachShadow({mode: 'closed'}, - createDOM('div', {id: 'div1_open'}, - createDOM('content', {id: 'c1'}), - attachShadow({mode: 'open'}, - createDOM('content', {id: 'c2'})))), - createDOM('div', {id: 'host_open'}, - attachShadow({mode: 'open'}, - createDOM('div', {id: 'div2_closed'}, - attachShadow({mode: 'closed'}, - createDOM('div', {id: 'div3_open'}, - attachShadow({mode: 'open'}, - createDOM('div', {id: 'target'}))))))))); -} - -debug('Event.composedPath() should include only unclosed nodes.'); - -prepareTree(); - -var target = getNodeInComposedTree('host_open/div2_closed/div3_open/target'); - -debug('The full event path should be (length=12):\n' + - 'div#target, #shadow-root (open), div#div3_open, #shadow-root (closed),\n' + - 'div#div2_closed, #shadow-root (open), div#host_open, div#host_closed,\n' + - 'body, html, #document, window\n'); - -debug('On #host_closed, #host_open, and #div2_closed,\n' + - 'div#target, #shadow-root (open), div#div3_open, #shadow-root (closed)\n' + - 'will be trimmed (length=8).\n'); - -['host_closed', 'host_open', 'host_open/div2_closed', 'host_open/div2_closed/div3_open', 'host_open/div2_closed/div3_open/target'].forEach(function(nodePath) { - var node = getNodeInComposedTree(nodePath); - - var eventPath; - var clickHandler = function(e) { eventPath = e.composedPath(); }; - node.addEventListener('click', clickHandler, false); - - debug('\nDispaching a click event on #target, listening on #' + node.id + '.'); - eventPath = null; - target.click(); - debug('Got event.composedPath() for #' + node.id + ':'); - debug(dumpNodeList(eventPath)); - - node.removeEventListener('click', clickHandler, false); -}); -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/shadow-dom-v0/event-composed-path.html b/third_party/blink/web_tests/web-components-v0-only/shadow-dom-v0/event-composed-path.html deleted file mode 100644 index c2c619b..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/shadow-dom-v0/event-composed-path.html +++ /dev/null
@@ -1,35 +0,0 @@ -<!DOCTYPE html> -<script src="../../resources/testharness.js"></script> -<script src="../../resources/testharnessreport.js"></script> -<script src="../resources/shadow-dom.js"></script> -<div id="test1"> - <input id="input" slot="slot"> - <template id="shadowroot-v1" data-mode="open"> - <div id="host"> - <div id="slot-parent"> - <slot id="slot" name="slot"></slot> - </div> - <template id="shadowroot-v0" data-mode="v0"> - <content id="content" select="#slot-parent"></content> - </template> - </div> - </template> -</div> -<script> -test(() => { - let n = createTestTree(test1); - removeWhiteSpaceOnlyTextNodes(n.test1); - let log = dispatchEventWithLog(n, n.input, new Event('my-event', { bubbles: true, compsoed: true })); - let path = ['input', 'slot', 'slot-parent', 'content', 'shadowroot-v0', 'host', - 'shadowroot-v1', 'test1']; - assert_event_path_equals(log, - [['input', 'input', null, path], - ['slot', 'input', null, path], - ['slot-parent', 'input', null, path], - ['content', 'input', null, path], - ['shadowroot-v0', 'input', null, path], - ['host', 'input', null, path], - ['shadowroot-v1', 'input', null, path], - ['test1', 'input', null, path]]); -}, 'EventPath works fine with v0 insertion points & v1 slots.'); -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/shadow-dom-v0/event-path.html b/third_party/blink/web_tests/web-components-v0-only/shadow-dom-v0/event-path.html deleted file mode 100644 index 990d366..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/shadow-dom-v0/event-path.html +++ /dev/null
@@ -1,14 +0,0 @@ -<!DOCTYPE html> -<script src="../../resources/testharness.js"></script> -<script src="../../resources/testharnessreport.js"></script> -<img id="img" src="../../images/resources/test-load.jpg"> -<script> - -// Basic functionality test for Event.path. -img.onload = function(e) { - test(function() { - assert_array_equals(e.composedPath(), e.path); - }, "Event.composedPath() should be the same as Event.path."); -}; - -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/shadow-dom-v0/fullscreen-element-in-v0.html b/third_party/blink/web_tests/web-components-v0-only/shadow-dom-v0/fullscreen-element-in-v0.html deleted file mode 100644 index 66e94db..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/shadow-dom-v0/fullscreen-element-in-v0.html +++ /dev/null
@@ -1,45 +0,0 @@ -<!DOCTYPE html> -<script src='../../resources/testharness.js'></script> -<script src='../../resources/testharnessreport.js'></script> -<script src='../resources/shadow-dom.js'></script> -<script src='../../fullscreen/trusted-click.js'></script> - -<div id='host0'> - <template data-mode='v0'> - <canvas></canvas> - </template> -</div> - -<script> -convertTemplatesToShadowRootsWithin(host0); - -async_test((test) => { - document.onfullscreenerror = test.unreached_func('onfullscreenerror is not expected.'); - - // All fullscreenElement should default to null. - assert_equals(document.fullscreenElement, null); - assert_equals(document.webkitFullscreenElement, null); - assert_equals(document.webkitCurrentFullScreenElement, null); - assert_equals(host0.shadowRoot.fullscreenElement, null); - - var canvas = host0.shadowRoot.querySelector('canvas'); - trusted_request(test, canvas); - - document.onfullscreenchange = test.step_func(() => { - // Not interested in handling before or after exitFullscreen. - if (document.fullscreenElement === null) - return; - - // fullscreen element in V0 shadow root will not be retargeted. - assert_equals(document.fullscreenElement, canvas); - assert_equals(document.webkitFullscreenElement, canvas); - assert_equals(document.webkitCurrentFullScreenElement, canvas); - - assert_equals(host0.shadowRoot.fullscreenElement, null); - - document.exitFullscreen(); - test.done(); - }); - -}, 'Test for fullscreenElement adjustment for single shadow tree.'); -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/shadow-dom-v0/get-destination-insertion-points-expected.txt b/third_party/blink/web_tests/web-components-v0-only/shadow-dom-v0/get-destination-insertion-points-expected.txt deleted file mode 100644 index cc05e5dc..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/shadow-dom-v0/get-destination-insertion-points-expected.txt +++ /dev/null
@@ -1,15 +0,0 @@ -CONSOLE WARNING: line 87: Element.createShadowRoot is deprecated and will be removed in M80, around February 2020. Please use Element.attachShadow instead. See https://www.chromestatus.com/features/4507242028072960 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -Tests for getDestinationInsertionPoints(). - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - -PASS nodeList.length is expectedNodes.length -PASS nodeList.item(0) is expectedNodes[0] -Insertion points should be inactive in v1 shadow trees. -PASS document.getElementById("child-2").getDestinationInsertionPoints().length is 0 -PASS document.getElementById("child-3").getDestinationInsertionPoints().length is 0 -PASS successfullyParsed is true - -TEST COMPLETE - -
diff --git a/third_party/blink/web_tests/web-components-v0-only/shadow-dom-v0/get-destination-insertion-points-re-distribution-expected.txt b/third_party/blink/web_tests/web-components-v0-only/shadow-dom-v0/get-destination-insertion-points-re-distribution-expected.txt deleted file mode 100644 index 9ea6925..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/shadow-dom-v0/get-destination-insertion-points-re-distribution-expected.txt +++ /dev/null
@@ -1,18 +0,0 @@ -CONSOLE WARNING: line 87: Element.createShadowRoot is deprecated and will be removed in M80, around February 2020. Please use Element.attachShadow instead. See https://www.chromestatus.com/features/4507242028072960 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -Tests for getDestinationInsertionPoints() which involves re-distribution. - -On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". - -PASS nodeList.length is expectedNodes.length -PASS nodeList.item(0) is expectedNodes[0] -PASS nodeList.item(1) is expectedNodes[1] -PASS nodeList.length is expectedNodes.length -PASS nodeList.item(0) is expectedNodes[0] -PASS nodeList.length is expectedNodes.length -PASS nodeList.item(0) is expectedNodes[0] -PASS document.getElementById("child-12").getDestinationInsertionPoints().length is 0 -PASS successfullyParsed is true - -TEST COMPLETE - -
diff --git a/third_party/blink/web_tests/web-components-v0-only/shadow-dom-v0/get-destination-insertion-points-re-distribution.html b/third_party/blink/web_tests/web-components-v0-only/shadow-dom-v0/get-destination-insertion-points-re-distribution.html deleted file mode 100644 index 1aa66cc..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/shadow-dom-v0/get-destination-insertion-points-re-distribution.html +++ /dev/null
@@ -1,61 +0,0 @@ -<!DOCTYPE html> -<script src="../../resources/js-test.js"></script> -<script src="../fast/dom-shadow/resources/shadow-dom.js"></script> -<body></body> -<script> -description("Tests for getDestinationInsertionPoints() which involves re-distribution."); - -document.body.appendChild( - createDOM('div', {}, - createDOM('div', {'id': 'host-1'}, - createShadowRoot( - createDOM('div', {'id': 'host-2'}, - createShadowRoot( - createDOM('content', {'id': 'content-2'})), - createDOM('content', {'id': 'content-1'}))), - createDOM('div', {'id': 'child-1'})))); - -shouldBeEqualAsArray(document.getElementById('child-1').getDestinationInsertionPoints(), - [getNodeInComposedTree('host-1/content-1'), getNodeInComposedTree('host-1/host-2/content-2')]); - -document.body.appendChild( - createDOM('div', {}, - createDOM('div', {'id': 'host-10'}, - createShadowRoot( - createDOM('div', {'id': 'host-20'}, - attachShadow( - {'mode': 'open'}, - createDOM('content', {'id': 'content-20'})), - createDOM('content', {'id': 'content-10'}))), - createDOM('div', {'id': 'child-10'})))); - -shouldBeEqualAsArray(document.getElementById('child-10').getDestinationInsertionPoints(), - [getNodeInComposedTree('host-10/content-10')]); - -document.body.appendChild( - createDOM('div', {}, - createDOM('div', {'id': 'host-11'}, - createShadowRoot( - createDOM('div', {'id': 'host-21'}, - attachShadow( - {'mode': 'closed'}, - createDOM('content', {'id': 'content-21'})), - createDOM('content', {'id': 'content-11'}))), - createDOM('div', {'id': 'child-11'})))); - -shouldBeEqualAsArray(document.getElementById('child-11').getDestinationInsertionPoints(), - [getNodeInComposedTree('host-11/content-11')]); - -document.body.appendChild( - createDOM('div', {}, - createDOM('div', {'id': 'host-12'}, - attachShadow( - {'mode': 'closed'}, - createDOM('div', {'id': 'host-22'}, - createShadowRoot( - createDOM('content', {'id': 'content-22'})), - createDOM('content', {'id': 'content-12'}))), - createDOM('div', {'id': 'child-12'})))); - -shouldBe('document.getElementById("child-12").getDestinationInsertionPoints().length', '0'); -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/shadow-dom-v0/get-destination-insertion-points.html b/third_party/blink/web_tests/web-components-v0-only/shadow-dom-v0/get-destination-insertion-points.html deleted file mode 100644 index aae5d35..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/shadow-dom-v0/get-destination-insertion-points.html +++ /dev/null
@@ -1,40 +0,0 @@ -<!DOCTYPE html> -<script src="../../resources/js-test.js"></script> -<script src="../fast/dom-shadow/resources/shadow-dom.js"></script> -<body></body> -<script> -description("Tests for getDestinationInsertionPoints()."); - -document.body.appendChild( - createDOM('div', {}, - createDOM('div', {'id': 'host-1'}, - createShadowRoot( - createDOM('content', {'id': 'content-1'})), - createDOM('div', {'id': 'child-1'})))); - -shouldBeEqualAsArray(document.getElementById('child-1').getDestinationInsertionPoints(), - [getNodeInComposedTree('host-1/content-1')]); - -debug('Insertion points should be inactive in v1 shadow trees.'); - -document.body.appendChild( - createDOM('div', {}, - createDOM('div', {'id': 'host-2'}, - attachShadow( - {'mode': 'open'}, - createDOM('content', {'id': 'content-2'})), - createDOM('div', {'id': 'child-2'})))); - -shouldBe('document.getElementById("child-2").getDestinationInsertionPoints().length', '0'); - -document.body.appendChild( - createDOM('div', {}, - createDOM('div', {'id': 'host-3'}, - attachShadow( - {'mode': 'closed'}, - createDOM('content', {'id': 'content-3'})), - createDOM('div', {'id': 'child-3'})))); - -shouldBe('document.getElementById("child-3").getDestinationInsertionPoints().length', '0'); - -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/shadow-dom-v0/pointer-lock-in-shadow.html b/third_party/blink/web_tests/web-components-v0-only/shadow-dom-v0/pointer-lock-in-shadow.html deleted file mode 100644 index 7537f01..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/shadow-dom-v0/pointer-lock-in-shadow.html +++ /dev/null
@@ -1,45 +0,0 @@ -<!DOCTYPE html> -<script src='../../resources/testharness.js'></script> -<script src='../../resources/testharnessreport.js'></script> -<script src='../resources/shadow-dom.js'></script> - -<div id='host'> - <template data-mode='v0'> - <content></content> - </template> - <div id='hostV0'> - <template data-mode='v0'> - <canvas></canvas> - </template> - </div> -</div> - -<script> -async_test((test) => { - document.onpointerlockerror = test.unreached_func('onpointerlockerror is not expected.'); - - document.onpointerlockchange = test.step_func(() => { - // Not interested in handling before or after exitPointerLock. - if (document.pointerLockElement === null) - return; - - assert_equals(document.pointerLockElement, canvas, 'if in V0, return the target itself.'); - assert_equals(host.shadowRoot.pointerLockElement, null); - assert_equals(hostV0.shadowRoot.pointerLockElement, null); - - document.exitPointerLock(); - test.done(); - }); - - convertTemplatesToShadowRootsWithin(host); - - test.step(() => { - assert_equals(document.pointerLockElement, null); - assert_equals(host.shadowRoot.pointerLockElement, null); - assert_equals(hostV0.shadowRoot.pointerLockElement, null); - }); - - var canvas = hostV0.shadowRoot.querySelector('canvas'); - canvas.requestPointerLock(); -}, 'Test for pointerLockElement adjustment for Shadow DOM V0/V1 combination.'); -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/shadow-dom-v0/pointer-lock-in-shadow2.html b/third_party/blink/web_tests/web-components-v0-only/shadow-dom-v0/pointer-lock-in-shadow2.html deleted file mode 100644 index 763d4a4..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/shadow-dom-v0/pointer-lock-in-shadow2.html +++ /dev/null
@@ -1,52 +0,0 @@ -<!DOCTYPE html> -<script src='../../resources/testharness.js'></script> -<script src='../../resources/testharnessreport.js'></script> -<script src='../resources/shadow-dom.js'></script> - -<div id='host'> - <template data-mode='v0'> - <content></content> - </template> - <div id='hostV0'> - <template data-mode='v0'> - <div id='hostV1inV0'> - <template data-mode='open'> - <canvas></canvas> - </template> - </div> - </template> - </div> -</div> - -<script> -async_test((test) => { - document.onpointerlockerror = test.unreached_func('onpointerlockerror is not expected.'); - - document.onpointerlockchange = test.step_func(() => { - // Not interested in handling before or after exitPointerLock. - if (document.pointerLockElement === null) - return; - - assert_equals(document.pointerLockElement, hostV1inV0, 'if it is in V1, return shadow host.'); - assert_equals(host.shadowRoot.pointerLockElement, null); - assert_equals(hostV0.shadowRoot.pointerLockElement, null); - assert_equals(hostV1inV0.shadowRoot.pointerLockElement, canvas); - - document.exitPointerLock(); - test.done(); - }); - - convertTemplatesToShadowRootsWithin(host); - var hostV1inV0 = hostV0.shadowRoot.querySelector('#hostV1inV0'); - - test.step(() => { - assert_equals(document.pointerLockElement, null); - assert_equals(host.shadowRoot.pointerLockElement, null); - assert_equals(hostV0.shadowRoot.pointerLockElement, null); - assert_equals(hostV1inV0.shadowRoot.pointerLockElement, null); - }); - - var canvas = hostV1inV0.shadowRoot.querySelector('canvas'); - canvas.requestPointerLock(); -}, 'Test for pointerLockElement adjustment for Shadow DOM V0/V1 combination.'); -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/shadow-dom-v0/pointer-lock-in-shadow3.html b/third_party/blink/web_tests/web-components-v0-only/shadow-dom-v0/pointer-lock-in-shadow3.html deleted file mode 100644 index 1050004..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/shadow-dom-v0/pointer-lock-in-shadow3.html +++ /dev/null
@@ -1,59 +0,0 @@ -<!DOCTYPE html> -<script src='../../resources/testharness.js'></script> -<script src='../../resources/testharnessreport.js'></script> -<script src='../resources/shadow-dom.js'></script> - -<div id='host'> - <template data-mode='v0'> - <content></content> - </template> - <div id='hostV1'> - <template data-mode='open'> - <div id='hostV1inV1'> - <template data-mode='open'> - <div id='hostV0inV1inV1'> - <template data-mode='v0'> - <canvas></canvas> - </template> - </div> - </template> - </div> - </template> - </div> -</div> - -<script> -async_test((test) => { - document.onpointerlockerror = test.unreached_func('onpointerlockerror is not expected.'); - - document.onpointerlockchange = test.step_func(() => { - // Not interested in handling before or after exitPointerLock. - if (document.pointerLockElement === null) - return; - - assert_equals(document.pointerLockElement, canvas, 'if it is in V0 shadow, return as it is.'); - assert_equals(host.shadowRoot.pointerLockElement, null); - assert_equals(hostV1.shadowRoot.pointerLockElement, hostV1inV1) - assert_equals(hostV1inV1.shadowRoot.pointerLockElement, canvas); - assert_equals(hostV0inV1inV1.shadowRoot.pointerLockElement, null); - - document.exitPointerLock(); - test.done(); - }); - - convertTemplatesToShadowRootsWithin(host); - var hostV1inV1 = hostV1.shadowRoot.querySelector('#hostV1inV1'); - var hostV0inV1inV1 = hostV1inV1.shadowRoot.querySelector('#hostV0inV1inV1'); - - test.step(() => { - assert_equals(document.pointerLockElement, null); - assert_equals(host.shadowRoot.pointerLockElement, null); - assert_equals(hostV1.shadowRoot.pointerLockElement, null); - assert_equals(hostV1inV1.shadowRoot.pointerLockElement, null); - assert_equals(hostV0inV1inV1.shadowRoot.pointerLockElement, null); - }); - - var canvas = hostV0inV1inV1.shadowRoot.querySelector('canvas'); - canvas.requestPointerLock(); -}, 'Test for pointerLockElement adjustment for Shadow DOM V0/V1 combination.'); -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/shadow-dom-v0/reattach-content-parent-crash.html b/third_party/blink/web_tests/web-components-v0-only/shadow-dom-v0/reattach-content-parent-crash.html deleted file mode 100644 index ffa1c4bd..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/shadow-dom-v0/reattach-content-parent-crash.html +++ /dev/null
@@ -1,12 +0,0 @@ -<!DOCTYPE html> -<script src="../../resources/testharness.js"></script> -<script src="../../resources/testharnessreport.js"></script> -<div id="host"><option></option></div> -<script> - test(() => { - const root = host.createShadowRoot(); - root.innerHTML = '<span style="display:none"><content /></span>'; - document.body.offsetTop; - root.firstChild.style.display = "block"; - }, "This test passes if there is no crash or DCHECK failure."); -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/shadow-dom-v0/slots-api-in-v0.html b/third_party/blink/web_tests/web-components-v0-only/shadow-dom-v0/slots-api-in-v0.html deleted file mode 100644 index 3d1bbb31..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/shadow-dom-v0/slots-api-in-v0.html +++ /dev/null
@@ -1,41 +0,0 @@ -<!DOCTYPE html> -<script src='../../resources/testharness.js'></script> -<script src='../../resources/testharnessreport.js'></script> -<script src='../resources/shadow-dom.js'></script> -<div id='host'> - <template data-mode='v0'> - <slot name='slot1'> - <div id='fallback1'></div> - </slot> - <slot name='slot2'> - <div id='fallback2'></div> - </slot> - </template> - <slot id='slot0'> - <div id='fallback0'></div> - </slot> - <div id='child1' slot='slot1'></div> -</div> -<script> -'use strict'; -convertTemplatesToShadowRootsWithin(host); -removeWhiteSpaceOnlyTextNodes(host); - -const slot1 = host.shadowRoot.querySelector('[name=slot1]'); -const slot2 = host.shadowRoot.querySelector('[name=slot2]'); -const fallback1 = host.shadowRoot.querySelector('#fallback1'); -const fallback2 = host.shadowRoot.querySelector('#fallback2'); - -test(() => { - assert_equals(fallback0.assignedSlot, null); - assert_equals(fallback1.assignedSlot, null); - assert_equals(fallback2.assignedSlot, null); - assert_equals(child1.assignedSlot, null); -}, "assignedSlot"); - -test(() => { - assert_array_equals(slot0.assignedNodes(), []); - assert_array_equals(slot1.assignedNodes(), []); - assert_array_equals(slot2.assignedNodes(), []); -}, "assignedNodes"); -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/shadow-dom-v0/slots-in-v0-expected.html b/third_party/blink/web_tests/web-components-v0-only/shadow-dom-v0/slots-in-v0-expected.html deleted file mode 100644 index 3dedb03..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/shadow-dom-v0/slots-in-v0-expected.html +++ /dev/null
@@ -1,5 +0,0 @@ -<!DOCTYPE html> -<div id='host'> - <div id='fallback1'></div> - <div id='fallback2'></div> -</div>
diff --git a/third_party/blink/web_tests/web-components-v0-only/shadow-dom-v0/slots-in-v0-expected.txt b/third_party/blink/web_tests/web-components-v0-only/shadow-dom-v0/slots-in-v0-expected.txt deleted file mode 100644 index 1187fa8a..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/shadow-dom-v0/slots-in-v0-expected.txt +++ /dev/null
@@ -1 +0,0 @@ -CONSOLE WARNING: line 29: Element.createShadowRoot is deprecated and will be removed in M80, around February 2020. Please use Element.attachShadow instead. See https://www.chromestatus.com/features/4507242028072960 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details.
diff --git a/third_party/blink/web_tests/web-components-v0-only/shadow-dom-v0/slots-in-v0.html b/third_party/blink/web_tests/web-components-v0-only/shadow-dom-v0/slots-in-v0.html deleted file mode 100644 index 2cf4b5a..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/shadow-dom-v0/slots-in-v0.html +++ /dev/null
@@ -1,19 +0,0 @@ -<!DOCTYPE html> -<script src='../resources/shadow-dom.js'></script> -<div id='host'> - <template data-mode='v0'> - <slot name='slot1'> - <div id='fallback1'></div> - </slot> - <slot name='slot2'> - <div id='fallback2'></div> - </slot> - </template> - <slot id='slot0'> - <div id='fallback0'></div> - </slot> - <div id='child1' slot='slot1'></div> -</div> -<script> -convertTemplatesToShadowRootsWithin(host); -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/shadow-dom-v0/slotted-pseudo-element-in-v0v1-mixed.html b/third_party/blink/web_tests/web-components-v0-only/shadow-dom-v0/slotted-pseudo-element-in-v0v1-mixed.html deleted file mode 100644 index 7a9091a..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/shadow-dom-v0/slotted-pseudo-element-in-v0v1-mixed.html +++ /dev/null
@@ -1,20 +0,0 @@ -<!DOCTYPE html> -<script src="../../resources/testharness.js"></script> -<script src="../../resources/testharnessreport.js"></script> -<div id="v0host">v0</div> -<div id="v1host"><span id="green">v1, should be green</span></div> -<script src='../resources/shadow-dom.js'></script> -<script> -// Test case for ensuring ::slotted() rules applied in v0/v1 mixed doc -// for catching any regression. -var v0root = v0host.createShadowRoot(); -v0root.innerHTML = '<content></content>'; - -test(() => { - var v1root = v1host.attachShadow({mode:'open'}); - v1root.innerHTML = '<style>::slotted(span) {color:green}</style><slot/>'; - var span = document.querySelector('#green'); - assert_equals(window.getComputedStyle(span).color, 'rgb(0, 128, 0)', - 'span element should be styled green.'); -}, 'slotted rule should apply properly in v0/v1 mixed document.'); -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/shadow-dom-v0/v0-added-after-v1-and-slotted-expected.html b/third_party/blink/web_tests/web-components-v0-only/shadow-dom-v0/v0-added-after-v1-and-slotted-expected.html deleted file mode 100644 index 8cf02410..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/shadow-dom-v0/v0-added-after-v1-and-slotted-expected.html +++ /dev/null
@@ -1,7 +0,0 @@ -<!DOCTYPE html> -<style> -div { color: green; } -a { background-color: red; } -</style> -<div><a href="#">Should be red</a></div> -<div>Should be green</div>
diff --git a/third_party/blink/web_tests/web-components-v0-only/shadow-dom-v0/v0-added-after-v1-and-slotted-expected.txt b/third_party/blink/web_tests/web-components-v0-only/shadow-dom-v0/v0-added-after-v1-and-slotted-expected.txt deleted file mode 100644 index d43c81a..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/shadow-dom-v0/v0-added-after-v1-and-slotted-expected.txt +++ /dev/null
@@ -1 +0,0 @@ -CONSOLE WARNING: line 22: Element.createShadowRoot is deprecated and will be removed in M80, around February 2020. Please use Element.attachShadow instead. See https://www.chromestatus.com/features/4507242028072960 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details.
diff --git a/third_party/blink/web_tests/web-components-v0-only/shadow-dom-v0/v0-added-after-v1-and-slotted.html b/third_party/blink/web_tests/web-components-v0-only/shadow-dom-v0/v0-added-after-v1-and-slotted.html deleted file mode 100644 index 781d9b0..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/shadow-dom-v0/v0-added-after-v1-and-slotted.html +++ /dev/null
@@ -1,28 +0,0 @@ -<!DOCTYPE html> -<div id="v1host"><a href="#">Should be red</a></div> -<div id="v0host"></div> -<script> -const v1root = v1host.attachShadow({mode: 'open'}); -v1root.innerHTML = ` -<style> -::slotted(*) { - background: red; -} -</style> -<slot></slot> -`; - -// Foce style recalc. -document.body.offsetTop; - -// The following DOM/Style modification has to be done after the style -// for v1host/v1root is resolved to reproduce the issue. - -// Turns Document.MayContainV0Shadow() flag on. -const v0root = v0host.createShadowRoot(); -// Force style recalc on the v1host/v1root. -const new_style = document.createElement('style'); -new_style.textContent = 'div { color: green; }'; -document.head.appendChild(new_style); -v0root.innerHTML = '<div>Should be green</div>'; -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/shadow-dom-v0/v0-inert-features-in-v1-shadow-trees.html b/third_party/blink/web_tests/web-components-v0-only/shadow-dom-v0/v0-inert-features-in-v1-shadow-trees.html deleted file mode 100644 index fcbd8a2..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/shadow-dom-v0/v0-inert-features-in-v1-shadow-trees.html +++ /dev/null
@@ -1,22 +0,0 @@ -<!DOCTYPE html> -<meta charset="utf-8"> -<title>v0 features should be inert in v1 shadow trees.</title> -<script src='../../resources/testharness.js'></script> -<script src='../../resources/testharnessreport.js'></script> -<script src='../resources/shadow-dom.js'></script> -<div id='host'> - <template data-mode='open'> - <content></content> - <shadow></shadow> - </template> - <div id='child'></div> -</div> -<script> -convertTemplatesToShadowRootsWithin(host); -test(function () { - var content = host.shadowRoot.querySelector('content'); - var shadow = host.shadowRoot.querySelector('shadow'); - assert_equals(content.getDistributedNodes().length, 0); - assert_equals(shadow.getDistributedNodes().length, 0); -}, "insertion points should be inert in v1"); -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/slotted-pseudo-element-in-v0-tree-crash-expected.txt b/third_party/blink/web_tests/web-components-v0-only/slotted-pseudo-element-in-v0-tree-crash-expected.txt deleted file mode 100644 index c2541f4..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/slotted-pseudo-element-in-v0-tree-crash-expected.txt +++ /dev/null
@@ -1 +0,0 @@ -PASS if no crash.
diff --git a/third_party/blink/web_tests/web-components-v0-only/slotted-pseudo-element-in-v0-tree-crash.html b/third_party/blink/web_tests/web-components-v0-only/slotted-pseudo-element-in-v0-tree-crash.html deleted file mode 100644 index 30798da..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/slotted-pseudo-element-in-v0-tree-crash.html +++ /dev/null
@@ -1,14 +0,0 @@ -<!DOCTYPE html> -<script> - if (window.testRunner) - testRunner.dumpAsText(); -</script> -<p>PASS if no crash.</p> -<div id="host"> - <div id="inner"></div> -</div> -<script> -var root = host.attachShadow({mode: 'open'}); -root.innerHTML = '<style>::slotted(*) { color: green }</style>'; -getComputedStyle(inner).color; -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/spec/resources/custom-elements-helpers.js b/third_party/blink/web_tests/web-components-v0-only/spec/resources/custom-elements-helpers.js deleted file mode 100644 index 1f8a6025..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/spec/resources/custom-elements-helpers.js +++ /dev/null
@@ -1,82 +0,0 @@ -function create_window_in_test(t, srcdoc) { - let p = new Promise((resolve) => { - let f = document.createElement('iframe'); - f.srcdoc = srcdoc ? srcdoc : ''; - f.onload = (event) => { - let w = f.contentWindow; - t.add_cleanup(() => f.parentNode && f.remove()); - resolve(w); - }; - document.body.appendChild(f); - }); - return p; -} - -function test_with_window(f, name, srcdoc) { - promise_test((t) => { - return create_window_in_test(t, srcdoc) - .then((w) => { - f(w); - }); - }, name); -} - -function assert_array_equals_callback_invocations(actual, expected, description) { - assert_equals(actual.length, expected.length); - for (let len=actual.length, i=0; i<len; ++i) { - let callback = expected[i][0]; - assert_equals(actual[i][0], expected[i][0], callback + ' callback should be invoked'); - assert_equals(actual[i][1], expected[i][1], callback + ' should be invoked on the element ' + expected[i][1]); - assert_array_equals(actual[i][2], expected[i][2], callback + ' should be invoked with the arguments ' + expected[i][2]); - } -} - -function assert_is_upgraded(element, className, description) { - assert_true(element.matches(':defined'), description); - assert_equals(Object.getPrototypeOf(element), className.prototype, description); -} - -// Asserts that func synchronously invokes the error event handler in w. -// Captures and returns the error that is reported. -// -// Do not use this function directly; instead use one of assert_reports_js, -// assert_reports_dom, or assert_reports_exactly. Those functions also check -// that the error reported is the expected one. -function assert_reports_impl(w, func) { - let old_onerror = w.onerror; - let errors = []; - w.onerror = (event, source, line_number, column_number, error) => { - errors.push(error); - return true; // the error is handled - }; - try { - func(); - } catch (e) { - assert_unreached(`should report, not throw, an exception: ${e}`); - } finally { - w.onerror = old_onerror; - } - assert_equals(errors.length, 1, 'only one error should have been reported'); - return errors[0]; -} - -// Asserts that func synchronously invokes the error event handler in w -// with the expected DOMException. -function assert_reports_dom(w, expected_error, func, description) { - const e = assert_reports_impl(w, func); - assert_throws_dom(expected_error, w.DOMException, () => { throw e; }, description); -} - -// Asserts that func synchronously invokes the error event handler in w -// with the expected JavaScript error. -function assert_reports_js(w, expected_error, func, description) { - const e = assert_reports_impl(w, func); - assert_throws_js(expected_error, () => { throw e; }, description); -} - -// Asserts that func synchronously invokes the error event handler in w -// with exactly the expected error. -function assert_reports_exactly(w, expected_error, func, description) { - const e = assert_reports_impl(w, func); - assert_throws_exactly(expected_error, () => { throw e; }, description); -}
diff --git a/third_party/blink/web_tests/web-components-v0-only/svg-foreignObject/shadow-dom-v0-crash.html b/third_party/blink/web_tests/web-components-v0-only/svg-foreignObject/shadow-dom-v0-crash.html deleted file mode 100644 index 44ac3b0..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/svg-foreignObject/shadow-dom-v0-crash.html +++ /dev/null
@@ -1,11 +0,0 @@ -<!DOCTYPE html> -<script src="../../resources/testharness.js"></script> -<script src="../../resources/testharnessreport.js"></script> -<p>PASS if no crash or DCHECK failure.</p> -<svg id="svg"><g /></svg> -<script> - test(() => { - const root = svg.createShadowRoot(); - root.innerHTML = '<foreignObject><div><content></content></div></foreignObject>'; - }, "Rendering an svg g element distributed into a foreignObject will crash."); -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/svg/custom-elements-expected.html b/third_party/blink/web_tests/web-components-v0-only/svg/custom-elements-expected.html deleted file mode 100644 index 355ed01..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/svg/custom-elements-expected.html +++ /dev/null
@@ -1,16 +0,0 @@ -<!DOCTYPE HTML> -<svg width="30px" height="30px" xmlns="http://www.w3.org/2000/svg"> - <rect width="20" height="20" fill="green"></rect> -</svg><br> - -<svg width="30px" height="30px" xmlns="http://www.w3.org/2000/svg"> - <rect width="20" height="20" fill="green"></rect> -</svg><br> - -<svg width="30px" height="30px" xmlns="http://www.w3.org/2000/svg"> - <rect width="20" height="20" fill="green"></rect> -</svg><br> - -<svg width="30px" height="30px" xmlns="http://www.w3.org/2000/svg"> - <text font-size="10px" y="20">PASS</text> -</svg>
diff --git a/third_party/blink/web_tests/web-components-v0-only/svg/custom-elements-expected.txt b/third_party/blink/web_tests/web-components-v0-only/svg/custom-elements-expected.txt deleted file mode 100644 index 16c6a44..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/svg/custom-elements-expected.txt +++ /dev/null
@@ -1,2 +0,0 @@ -CONSOLE WARNING: line 3: document.registerElement is deprecated and will be removed in M80, around February 2020. Please use window.customElements.define instead. See https://www.chromestatus.com/features/4642138092470272 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -CONSOLE WARNING: line 10: Element.createShadowRoot is deprecated and will be removed in M80, around February 2020. Please use Element.attachShadow instead. See https://www.chromestatus.com/features/4507242028072960 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details.
diff --git a/third_party/blink/web_tests/web-components-v0-only/svg/custom-elements.html b/third_party/blink/web_tests/web-components-v0-only/svg/custom-elements.html deleted file mode 100644 index c3040ea..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/svg/custom-elements.html +++ /dev/null
@@ -1,60 +0,0 @@ -<!DOCTYPE HTML> -<script> -document.registerElement("x-g", { extends: "g", prototype: { - __proto__: SVGGElement.prototype, - createdCallback: function() { - var greenBox = document.createElementNS('http://www.w3.org/2000/svg', 'rect'); - greenBox.setAttribute('width', '20'); - greenBox.setAttribute('height', '20'); - greenBox.setAttribute('fill', 'green'); - this.createShadowRoot().appendChild(greenBox); - } - } -}); - -document.registerElement("x-green", { extends: "g", prototype: { - __proto__: SVGGElement.prototype, - createdCallback: function() { - var shadow = this.createShadowRoot(); - var style = document.createElement('style'); - style.appendChild(document.createTextNode('* { fill: green; }')); - shadow.appendChild(style); - var rect = document.createElementNS('http://www.w3.org/2000/svg', 'rect'); - rect.setAttribute('width', '20'); - rect.setAttribute('height', '20'); - shadow.appendChild(rect); - } - } -}); - -document.registerElement("x-pass", { extends: "text", prototype: { - __proto__: SVGTextElement.prototype, - createdCallback: function() { - this.innerHTML = this.innerHTML.replace('FAIL', 'PASS'); - } - } -}); -</script> - -<svg width="30px" height="30px" xmlns="http://www.w3.org/2000/svg"> - <g is="x-g"> - <rect width="100" height="100" fill="red"></rect> - </g> -</svg><br> - -<svg width="30px" height="30px" xmlns="http://www.w3.org/2000/svg"> - <defs> - <rect id="use-green" width="20" height="20" fill="green"></rect> - </defs> - <use xlink:href="#use-green"></use> -</svg><br> - -<svg width="30px" height="30px" xmlns="http://www.w3.org/2000/svg"> - <g is="x-green"> - <rect width="100" height="100" fill="red"></rect> - </g> -</svg><br> - -<svg width="30px" height="30px" xmlns="http://www.w3.org/2000/svg"> - <text is="x-pass" font-size="10px" y="20">FAIL</text> -</svg>
diff --git a/third_party/blink/web_tests/web-components-v0-only/svg/foreign-object-under-shadow-root-under-hidden-expected.txt b/third_party/blink/web_tests/web-components-v0-only/svg/foreign-object-under-shadow-root-under-hidden-expected.txt deleted file mode 100644 index d0f351d..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/svg/foreign-object-under-shadow-root-under-hidden-expected.txt +++ /dev/null
@@ -1,2 +0,0 @@ -CONSOLE WARNING: line 6: Element.createShadowRoot is deprecated and will be removed in M80, around February 2020. Please use Element.attachShadow instead. See https://www.chromestatus.com/features/4507242028072960 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -Passes if it does not crash.
diff --git a/third_party/blink/web_tests/web-components-v0-only/svg/foreign-object-under-shadow-root-under-hidden.html b/third_party/blink/web_tests/web-components-v0-only/svg/foreign-object-under-shadow-root-under-hidden.html deleted file mode 100644 index 9168d32f..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/svg/foreign-object-under-shadow-root-under-hidden.html +++ /dev/null
@@ -1,21 +0,0 @@ -<style> -* { column-count: 28; } -</style> -<script> -function go() { - var shadow_root = svgvar00023.createShadowRoot(); - var outer_html = foreign.outerHTML; - shadow_root.innerHTML = outer_html; -} -if (window.testRunner) - testRunner.dumpAsText(); -</script> -Passes if it does not crash. -<body onload=go()> - <svg> - <foreignObject id=foreign> - <input> - </foreignObject> - <clipPath id=svgvar00023> - </svg> -</body>
diff --git a/third_party/blink/web_tests/web-components-v0-only/svg/overflow-clip-in-hidden-container-crash-expected.txt b/third_party/blink/web_tests/web-components-v0-only/svg/overflow-clip-in-hidden-container-crash-expected.txt deleted file mode 100644 index 40d5aae5..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/svg/overflow-clip-in-hidden-container-crash-expected.txt +++ /dev/null
@@ -1,2 +0,0 @@ -CONSOLE WARNING: line 12: Element.createShadowRoot is deprecated and will be removed in M80, around February 2020. Please use Element.attachShadow instead. See https://www.chromestatus.com/features/4507242028072960 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -PASS: did not crash.
diff --git a/third_party/blink/web_tests/web-components-v0-only/svg/overflow-clip-in-hidden-container-crash.html b/third_party/blink/web_tests/web-components-v0-only/svg/overflow-clip-in-hidden-container-crash.html deleted file mode 100644 index 615470e..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/svg/overflow-clip-in-hidden-container-crash.html +++ /dev/null
@@ -1,15 +0,0 @@ -<!DOCTYPE html> -<!-- - Tests that an element with an overflow clip inside a LayoutSVGHiddenContainer - can be laid out without crashing. This entails that we create a PaintLayer, - since the layout code assumes that overflow clip gets a scrollable area. - --> -<svg> - <clipPath id="c"></clipPath> -</svg> -<p>PASS: did not crash.</p> -<script> - c.createShadowRoot().innerHTML = "<foreignObject><input>"; - if (window.testRunner) - testRunner.dumpAsText(); -</script>
diff --git a/third_party/blink/web_tests/web-components-v0-only/svg/stop-style-crash-expected.txt b/third_party/blink/web_tests/web-components-v0-only/svg/stop-style-crash-expected.txt deleted file mode 100644 index b3e40a8..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/svg/stop-style-crash-expected.txt +++ /dev/null
@@ -1,2 +0,0 @@ -CONSOLE WARNING: line 13: Element.createShadowRoot is deprecated and will be removed in M80, around February 2020. Please use Element.attachShadow instead. See https://www.chromestatus.com/features/4507242028072960 and https://developers.google.com/web/updates/2019/07/web-components-time-to-upgrade for more details. -PASS: did not crash.
diff --git a/third_party/blink/web_tests/web-components-v0-only/svg/stop-style-crash.svg b/third_party/blink/web_tests/web-components-v0-only/svg/stop-style-crash.svg deleted file mode 100644 index 1d50f5b..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/svg/stop-style-crash.svg +++ /dev/null
@@ -1,15 +0,0 @@ -<svg xmlns="http://www.w3.org/2000/svg"> - <defs> - <linearGradient id="a"> - <stop stop-color="green" offset="0"/> - <stop stop-color="green" offset="1"/> - </linearGradient> - </defs> - <rect width="100" height="100" fill="url(#a)"/> - <text y="120">PASS: did not crash.</text> - <script> - if (window.testRunner) - testRunner.dumpAsText(); - document.getElementById("a").createShadowRoot(); - </script> -</svg>
diff --git a/third_party/blink/web_tests/web-components-v0-only/v0-v1-interop.html b/third_party/blink/web_tests/web-components-v0-only/v0-v1-interop.html deleted file mode 100644 index dcc2ff8..0000000 --- a/third_party/blink/web_tests/web-components-v0-only/v0-v1-interop.html +++ /dev/null
@@ -1,81 +0,0 @@ -<!DOCTYPE html> -<script src="../resources/testharness.js"></script> -<script src="../resources/testharnessreport.js"></script> -<script src="spec/resources/custom-elements-helpers.js"></script> -<body> -<script> -'use strict'; - -test_with_window((w) => { - class X extends w.HTMLElement {} - - w.customElements.define('new-old', X); - assert_throws_dom("NotSupportedError", w.DOMException, () => { - w.document.registerElement('new-old', {prototype: X.prototype}); - }, '"registering" (v0) a name already "defined" should throw'); - - w.document.registerElement('old-new', { - prototype: Object.create(w.HTMLElement.prototype) - }); - class Y extends w.HTMLElement {} - assert_throws_dom("NotSupportedError", w.DOMException, () => { - w.customElements.define('old-new', Y); - }, '"defining" (v1) a name already "registered" (v0) should throw'); -}, 'Overlapping old and new-style custom elements are not allowed'); - -test_with_window((w) => { - var A = w.document.registerElement('a-a', { - prototype: Object.create(w.HTMLDivElement.prototype), - extends: 'div' - }); - var a = w.document.createElement('div', 'a-a'); - - assert_true(a instanceof A, - 'V0 createElement syntax works with V0 registerElement'); - assert_equals(w.document.createElement('div', {is: 'a-a'}).constructor, - w.HTMLDivElement, - 'V1 createElement syntax does not work with V0 registerElement'); - assert_equals(w.document.createElementNS('http://www.w3.org/1999/xhtml', 'div', {is: 'a-a'}).constructor, - w.HTMLDivElement, - 'V1 createElementNS syntax does not work with V0 registerElement'); - - class B extends w.HTMLDivElement { - constructor() { - super(); - this.addEventListener("click", () => { - console.log("CLICKED B!"); - }); - } - } - w.customElements.define('b-b', B, {extends: 'div' }); - - assert_true(w.document.createElement('div', {is: 'b-b'}) instanceof B, - 'V1 createElement syntax works with V1 defined element'); - assert_true(w.document.createElement('div', 'b-b') instanceof w.HTMLDivElement, - 'V0 createElement syntax does not work with V1 defined element'); -}, 'V0 and V1 definition and createElement cannot be used together'); - -test_with_window((w) => { - const element = w.document.createElement('my-element'); - assert_true(element.matches(':unresolved'), 'Undefined element should be matched to :unresolved'); - assert_false(element.matches(':defined'), 'Undefined element should not be matched to :defined'); - - class MyElement extends w.HTMLElement {}; - w.document.registerElement('my-element', {prototype: MyElement.prototype}); - assert_true(element instanceof MyElement, 'Make sure V0-upgraded'); - assert_false(element.matches(':unresolved'), 'V0-defined element should not be matched to :unresolved'); - assert_true(element.matches(':defined'), 'V0-defined element should be matched to :defined'); - - const element1 = w.document.createElement('my-element1'); - w.customElements.define('my-element1', MyElement); - w.customElements.upgrade(element1); - assert_true(element1 instanceof MyElement, 'Make sure V1-upgraded'); - assert_false(element1.matches(':unresolved'), 'V1-defined element should not be matched to :unresolved'); - assert_true(element1.matches(':defined'), 'V1-defined element should be matched to :defined'); - - const builtin = w.document.createElement('span'); - assert_false(builtin.matches(':unresolved'), 'Built-in element should not be matched to :unresolved'); - assert_true(builtin.matches(':defined'), 'Built-in element should be matched to :defined'); - -}, ':unresolved and :defined work with both of V0 and V1 custom elements'); -</script>
diff --git a/third_party/blink/web_tests/wpt_internal/sanitizer-api/sanitizer-config.tentative.html b/third_party/blink/web_tests/wpt_internal/sanitizer-api/sanitizer-config.tentative.html index 3897109..f3c9fb3 100644 --- a/third_party/blink/web_tests/wpt_internal/sanitizer-api/sanitizer-config.tentative.html +++ b/third_party/blink/web_tests/wpt_internal/sanitizer-api/sanitizer-config.tentative.html
@@ -55,17 +55,28 @@ }, "SanitizerAPI config dropElements is not editable."); test(t => { - let options = {dropAttributes: ["onclick"]}; + let options = {allowAttributes: ["id"]}; let s = new Sanitizer(options); assert_true(s instanceof Sanitizer); - assert_equals(s.sanitizeToString("<button id='btn' onclick='submit()'>balabala</button>"), "<button id=\"btn\">balabala</button>"); + assert_equals(s.sanitizeToString("<button id='btn' style='color: black'>balabala</button>"), "<button id=\"btn\">balabala</button>"); - options.dropAttributes.push("id"); - assert_equals(s.sanitizeToString("<button id='btn' onclick='submit()'>balabala</button>"), "<button id=\"btn\">balabala</button>"); + options.allowAttributes.push("style"); + assert_equals(s.sanitizeToString("<button id='btn' style='color: black'>balabala</button>"), "<button id=\"btn\">balabala</button>"); + }, "SanitizerAPI config allowAttributes is not editable."); + + test(t => { + let options = {dropAttributes: ["id"]}; + + let s = new Sanitizer(options); + assert_true(s instanceof Sanitizer); + assert_equals(s.sanitizeToString("<button id='btn' style='color: black'>balabala</button>"), "<button style=\"color: black\">balabala</button>"); + + options.dropAttributes.push("style"); + assert_equals(s.sanitizeToString("<button id='btn' style='color: black'>balabala</button>"), "<button style=\"color: black\">balabala</button>"); }, "SanitizerAPI config dropAttributes is not editable."); - const config_names = ["dropElements", "allowElements", "dropAttributes"]; + const config_names = ["dropElements", "allowElements", "dropAttributes", "allowAttributes"]; config_names.forEach(cname => { let options = {}; options[cname] = []; @@ -75,6 +86,8 @@ if (cname == "allowElements") { assert_equals(s.sanitizeToString("<div id='div'>balabala<i>test</i></div>"), "balabalatest"); + } else if (cname == "allowAttributes") { + assert_equals(s.sanitizeToString("<div id='div'>balabala<i>test</i></div>"), "<div>balabala<i>test</i></div>"); } else { assert_equals(s.sanitizeToString("<div id='div'>balabala<i>test</i></div>"), "<div id=\"div\">balabala<i>test</i></div>"); }
diff --git a/third_party/blink/web_tests/wpt_internal/sanitizer-api/sanitizer-sanitize.tentative-expected.txt b/third_party/blink/web_tests/wpt_internal/sanitizer-api/sanitizer-sanitize.tentative-expected.txt index 52887a9..b7983077 100644 --- a/third_party/blink/web_tests/wpt_internal/sanitizer-api/sanitizer-sanitize.tentative-expected.txt +++ b/third_party/blink/web_tests/wpt_internal/sanitizer-api/sanitizer-sanitize.tentative-expected.txt
@@ -13,7 +13,7 @@ PASS SanitizerAPI with config: document, sanitize function for document PASS SanitizerAPI with config: html without close tag, sanitize function for html without close tag PASS SanitizerAPI with config: scripts for default configs, sanitize function for scripts for default configs -FAIL SanitizerAPI with config: onclick scripts, sanitize function for onclick scripts assert_equals: expected "<p>Click.</p>" but got "<p onclick=\"a= 123\">Click.</p>" +PASS SanitizerAPI with config: onclick scripts, sanitize function for onclick scripts PASS SanitizerAPI with config: invalid config_input, sanitize function for invalid config_input PASS SanitizerAPI with config: empty dropElements list, sanitize function for empty dropElements list PASS SanitizerAPI with config: test html without close tag with dropElements list ['div'], sanitize function for test html without close tag with dropElements list ['div'] @@ -24,10 +24,12 @@ PASS SanitizerAPI with config: dropElements list with invalid values}, sanitize function for dropElements list with invalid values} PASS SanitizerAPI with config: allowElements list ["p"]., sanitize function for allowElements list ["p"]. PASS SanitizerAPI with config: allowElements list has no influence to dropElements., sanitize function for allowElements list has no influence to dropElements. -PASS SanitizerAPI with config: dropAttributes list ["onclick"] with onclick scripts, sanitize function for dropAttributes list ["onclick"] with onclick scripts -PASS SanitizerAPI with config: empty dropAttributes list with onclick scripts, sanitize function for empty dropAttributes list with onclick scripts -PASS SanitizerAPI with config: dropAttributes list ["id"] with onclick scripts, sanitize function for dropAttributes list ["id"] with onclick scripts -PASS SanitizerAPI with config: dropAttributes list ["ONCLICK"] with onclick scripts, sanitize function for dropAttributes list ["ONCLICK"] with onclick scripts +PASS SanitizerAPI with config: dropAttributes list ["style"] with style attribute, sanitize function for dropAttributes list ["style"] with style attribute +PASS SanitizerAPI with config: empty dropAttributes list with id attribute, sanitize function for empty dropAttributes list with id attribute +PASS SanitizerAPI with config: dropAttributes list ["id"] with id attribute, sanitize function for dropAttributes list ["id"] with id attribute +PASS SanitizerAPI with config: dropAttributes list ["ID"] with id attribute, sanitize function for dropAttributes list ["ID"] with id attribute FAIL SanitizerAPI with config: dropAttributes list ["data-attribute-with-dashes"] with dom dataset js access., sanitize function for dropAttributes list ["data-attribute-with-dashes"] with dom dataset js access. assert_equals: expected "<p id=\"p\">Click.</p><script></script>" but got "<p id=\"p\">Click.</p>" +PASS SanitizerAPI with config: allowAttributes list ["id"] with id attribute and onclick scripts, sanitize function for allowAttributes list ["id"] with id attribute and onclick scripts +PASS SanitizerAPI with config: allowAttributes list has no influence to dropAttributes, sanitize function for allowAttributes list has no influence to dropAttributes Harness: the test ran to completion.
diff --git a/third_party/blink/web_tests/wpt_internal/sanitizer-api/sanitizer-sanitizeToString.tentative-expected.txt b/third_party/blink/web_tests/wpt_internal/sanitizer-api/sanitizer-sanitizeToString.tentative-expected.txt index 1f60983..db93a3e2 100644 --- a/third_party/blink/web_tests/wpt_internal/sanitizer-api/sanitizer-sanitizeToString.tentative-expected.txt +++ b/third_party/blink/web_tests/wpt_internal/sanitizer-api/sanitizer-sanitizeToString.tentative-expected.txt
@@ -13,7 +13,7 @@ PASS SanitizerAPI config: document, sanitizeToString function for document PASS SanitizerAPI config: html without close tag, sanitizeToString function for html without close tag PASS SanitizerAPI config: scripts for default configs, sanitizeToString function for scripts for default configs -FAIL SanitizerAPI config: onclick scripts, sanitizeToString function for onclick scripts assert_equals: expected "<p>Click.</p>" but got "<p onclick=\"a= 123\">Click.</p>" +PASS SanitizerAPI config: onclick scripts, sanitizeToString function for onclick scripts PASS SanitizerAPI config: invalid config_input, sanitizeToString function for invalid config_input PASS SanitizerAPI config: empty dropElements list, sanitizeToString function for empty dropElements list PASS SanitizerAPI config: test html without close tag with dropElements list ['div'], sanitizeToString function for test html without close tag with dropElements list ['div'] @@ -24,10 +24,12 @@ PASS SanitizerAPI config: dropElements list with invalid values}, sanitizeToString function for dropElements list with invalid values} PASS SanitizerAPI config: allowElements list ["p"]., sanitizeToString function for allowElements list ["p"]. PASS SanitizerAPI config: allowElements list has no influence to dropElements., sanitizeToString function for allowElements list has no influence to dropElements. -PASS SanitizerAPI config: dropAttributes list ["onclick"] with onclick scripts, sanitizeToString function for dropAttributes list ["onclick"] with onclick scripts -PASS SanitizerAPI config: empty dropAttributes list with onclick scripts, sanitizeToString function for empty dropAttributes list with onclick scripts -PASS SanitizerAPI config: dropAttributes list ["id"] with onclick scripts, sanitizeToString function for dropAttributes list ["id"] with onclick scripts -PASS SanitizerAPI config: dropAttributes list ["ONCLICK"] with onclick scripts, sanitizeToString function for dropAttributes list ["ONCLICK"] with onclick scripts +PASS SanitizerAPI config: dropAttributes list ["style"] with style attribute, sanitizeToString function for dropAttributes list ["style"] with style attribute +PASS SanitizerAPI config: empty dropAttributes list with id attribute, sanitizeToString function for empty dropAttributes list with id attribute +PASS SanitizerAPI config: dropAttributes list ["id"] with id attribute, sanitizeToString function for dropAttributes list ["id"] with id attribute +PASS SanitizerAPI config: dropAttributes list ["ID"] with id attribute, sanitizeToString function for dropAttributes list ["ID"] with id attribute FAIL SanitizerAPI config: dropAttributes list ["data-attribute-with-dashes"] with dom dataset js access., sanitizeToString function for dropAttributes list ["data-attribute-with-dashes"] with dom dataset js access. assert_equals: expected "<p id=\"p\">Click.</p><script></script>" but got "<p id=\"p\">Click.</p>" +PASS SanitizerAPI config: allowAttributes list ["id"] with id attribute and onclick scripts, sanitizeToString function for allowAttributes list ["id"] with id attribute and onclick scripts +PASS SanitizerAPI config: allowAttributes list has no influence to dropAttributes, sanitizeToString function for allowAttributes list has no influence to dropAttributes Harness: the test ran to completion.
diff --git a/third_party/blink/web_tests/wpt_internal/sanitizer-api/support/testcases.sub.js b/third_party/blink/web_tests/wpt_internal/sanitizer-api/support/testcases.sub.js index 9e97563..c8f4784 100644 --- a/third_party/blink/web_tests/wpt_internal/sanitizer-api/support/testcases.sub.js +++ b/third_party/blink/web_tests/wpt_internal/sanitizer-api/support/testcases.sub.js
@@ -23,9 +23,11 @@ {config_input: {dropElements: [123, [], "test", "i"]}, value: "<div>balabala<i>test</i></div><test>t</test>", result: "<div>balabala</div>", message: "dropElements list with invalid values}"}, {config_input: {allowElements: ["p"]}, value: "<div>test<div>p</div>tt<p>div</p></div>", result: "testptt<p>div</p>", message: "allowElements list [\"p\"]."}, {config_input: {dropElements: ["div"], allowElements: ["div"]}, value: "<div>test</div><c>bla", result: "bla", message: "allowElements list has no influence to dropElements."}, - {config_input: {dropAttributes: ["onclick"]}, value: "<p onclick='a= 123'>Click.</p>", result: "<p>Click.</p>", message: "dropAttributes list [\"onclick\"] with onclick scripts"}, - {config_input: {dropAttributes: []}, value: "<p onclick='a= 123'>Click.</p>", result: "<p onclick=\"a= 123\">Click.</p>", message: "empty dropAttributes list with onclick scripts"}, - {config_input: {dropAttributes: ["id"]}, value: "<p onclick='a= 123'>Click.</p>", result: "<p onclick=\"a= 123\">Click.</p>", message: "dropAttributes list [\"id\"] with onclick scripts"}, - {config_input: {dropAttributes: ["ONCLICK"]}, value: "<p onclick='a= 123'>Click.</p>", result: "<p>Click.</p>", message: "dropAttributes list [\"ONCLICK\"] with onclick scripts"}, + {config_input: {dropAttributes: ["style"]}, value: "<p style='color: black'>Click.</p>", result: "<p>Click.</p>", message: "dropAttributes list [\"style\"] with style attribute"}, + {config_input: {dropAttributes: []}, value: "<p id='test'>Click.</p>", result: "<p id=\"test\">Click.</p>", message: "empty dropAttributes list with id attribute"}, + {config_input: {dropAttributes: ["id"]}, value: "<p id='test'>Click.</p>", result: "<p>Click.</p>", message: "dropAttributes list [\"id\"] with id attribute"}, + {config_input: {dropAttributes: ["ID"]}, value: "<p id='test'>Click.</p>", result: "<p>Click.</p>", message: "dropAttributes list [\"ID\"] with id attribute"}, {config_input: {dropAttributes: ["data-attribute-with-dashes"]}, value: "<p id='p' data-attribute-with-dashes='123'>Click.</p><script>document.getElementById('p').dataset.attributeWithDashes=123;</script>", result: "<p id=\"p\">Click.</p><script></script>", message: "dropAttributes list [\"data-attribute-with-dashes\"] with dom dataset js access."}, + {config_input: {allowAttributes: ["id"]}, value: "<p id='test' onclick='a= 123'>Click.</p>", result: "<p id=\"test\">Click.</p>", message: "allowAttributes list [\"id\"] with id attribute and onclick scripts"}, + {config_input: {dropAttributes: ["style"], allowAttributes: ["style"]}, value: "<p style='color: black'>Click.</p>", result: "<p>Click.</p>", message: "allowAttributes list has no influence to dropAttributes"}, ];
diff --git a/tools/metrics/histograms/enums.xml b/tools/metrics/histograms/enums.xml index eced207..97d0f47 100644 --- a/tools/metrics/histograms/enums.xml +++ b/tools/metrics/histograms/enums.xml
@@ -26737,9 +26737,9 @@ <int value="665" label="MixedContentFormPresent"/> <int value="666" label="GetUserMediaInsecureOrigin"/> <int value="667" label="GetUserMediaSecureOrigin"/> - <int value="668" label="DeviceMotionInsecureOrigin_Obsolete"/> + <int value="668" label="OBSOLETE_DeviceMotionInsecureOrigin"/> <int value="669" label="DeviceMotionSecureOrigin"/> - <int value="670" label="DeviceOrientationInsecureOrigin_Obsolete"/> + <int value="670" label="OBSOLETE_DeviceOrientationInsecureOrigin"/> <int value="671" label="DeviceOrientationSecureOrigin"/> <int value="672" label="SandboxViaIFrame"/> <int value="673" label="SandboxViaCSP"/> @@ -26810,7 +26810,7 @@ <int value="738" label="CryptoAlgorithmPbkdf2"/> <int value="739" label="DocumentSetDomain"/> <int value="740" label="UpgradeInsecureRequestsEnabled"/> - <int value="741" label="UpgradeInsecureRequestsUpgradedRequest_Obsolete"/> + <int value="741" label="OBSOLETE_UpgradeInsecureRequestsUpgradedRequest"/> <int value="742" label="DocumentDesignMode"/> <int value="743" label="GlobalCacheStorage"/> <int value="744" label="NetInfo"/> @@ -27022,7 +27022,7 @@ <int value="937" label="CSSAnimationsStackedNeutralKeyframe"/> <int value="938" label="ReadingCheckedInClickHandler"/> <int value="939" label="FlexboxIntrinsicSizeAlgorithmIsDifferent"/> - <int value="940" label="HTMLImportsHasStyleSheets_Obsolete"/> + <int value="940" label="OBSOLETE_HTMLImportsHasStyleSheets"/> <int value="941" label="WebkitTextInClipProperty"/> <int value="942" label="WebkitTextInColorProperty"/> <int value="943" label="HeaderValueNotMatchingRFC7230"/> @@ -27070,7 +27070,7 @@ <int value="984" label="BluetoothDeviceInstanceId"/> <int value="985" label="HTMLLabelElementFormIDLAttribute"/> <int value="986" label="HTMLLabelElementFormContentAttribute"/> - <int value="987" label="DeviceOrientationAbsoluteInsecureOrigin_Obsolete"/> + <int value="987" label="OBSOLETE_DeviceOrientationAbsoluteInsecureOrigin"/> <int value="988" label="DeviceOrientationAbsoluteSecureOrigin"/> <int value="989" label="FontFaceConstructor"/> <int value="990" label="ServiceWorkerControlledPage"/> @@ -29023,9 +29023,11 @@ <int value="2844" label="CSSStyleSheetReplace"/> <int value="2845" label="CSSStyleSheetReplaceSync"/> <int value="2846" label="AdoptedStyleSheets"/> - <int value="2847" label="HTMLImportsOnReverseOriginTrials"/> - <int value="2848" label="ElementCreateShadowRootOnReverseOriginTrials"/> - <int value="2849" label="DocumentRegisterElementOnReverseOriginTrials"/> + <int value="2847" label="OBSOLETE_HTMLImportsOnReverseOriginTrials"/> + <int value="2848" + label="OBSOLETE_ElementCreateShadowRootOnReverseOriginTrials"/> + <int value="2849" + label="OBSOLETE_DocumentRegisterElementOnReverseOriginTrials"/> <int value="2850" label="InputTypeRadio"/> <int value="2851" label="InputTypeCheckbox"/> <int value="2852" label="InputTypeImage"/> @@ -29311,8 +29313,8 @@ <int value="3118" label="LongTaskBufferFull"/> <int value="3119" label="HTMLMetaElementMonetization"/> <int value="3120" label="HTMLLinkElementMonetization"/> - <int value="3121" label="InputTypeCheckboxRenderedNonSquare_Obsolete"/> - <int value="3122" label="InputTypeRadioRenderedNonSquare_Obsolete"/> + <int value="3121" label="OBSOLETE_InputTypeCheckboxRenderedNonSquare"/> + <int value="3122" label="OBSOLETE_InputTypeRadioRenderedNonSquare"/> <int value="3123" label="WebkitBoxPackJustifyDoesSomething"/> <int value="3124" label="WebkitBoxPackCenterDoesSomething"/> <int value="3125" label="WebkitBoxPackEndDoesSomething"/> @@ -41851,6 +41853,7 @@ <int value="-1691668194" label="enable-new-bookmark-apps"/> <int value="-1691602043" label="DisableOfficeEditingComponentApp:enabled"/> <int value="-1691281364" label="enable-notification-action-icons"/> + <int value="-1687407363" label="KaleidoscopeModule:disabled"/> <int value="-1687406612" label="UseSkiaRenderer:disabled"/> <int value="-1686782572" label="ChromeHomeInactivitySheetExpansion:disabled"/> <int value="-1684773837" label="TabEngagementReportingAndroid:disabled"/> @@ -44197,6 +44200,7 @@ <int value="664591021" label="EnableContinueReading:enabled"/> <int value="665409384" label="AutofillToolkitViewsCreditCardDialogsMac:enabled"/> + <int value="666871156" label="KaleidoscopeModule:enabled"/> <int value="667643314" label="LitePageServerPreviews:enabled"/> <int value="669097106" label="NtpRealboxMatchOmniboxTheme:disabled"/> <int value="673588373" label="OmniboxPedalSuggestions:disabled"/> @@ -59784,6 +59788,27 @@ </int> </enum> +<enum name="ProfileDeleteContext"> + <int value="0" label="Without browser window: the last profile"> + The deletion happened from the profile picker when no browser window is + shown (which is a good proxy for happening on startup). It is the last + remaining profile. + </int> + <int value="1" label="Without browser window: an additional profile"> + The deletion happened from the profile picker when no browser window is + shown (which is a good proxy for happening on startup). It is not the last + remaining profile. + </int> + <int value="2" label="With a browser window: the last profile"> + The deletion happened with at least one browser window open. It is the last + remaining profile. + </int> + <int value="3" label="With a browser window: an additional profile"> + The deletion happened with at least one browser window open. It is not the + last remaining profile. + </int> +</enum> + <enum name="ProfileDesktopMenu"> <obsolete> Deprecated. Code was deleted in M81.
diff --git a/tools/metrics/histograms/histograms.xml b/tools/metrics/histograms/histograms.xml index 936278e..8e6213c7 100644 --- a/tools/metrics/histograms/histograms.xml +++ b/tools/metrics/histograms/histograms.xml
@@ -6,7 +6,7 @@ <!-- This file will soon be removed. Please put all new histograms into the correct -folder in tools/metrics/histograms/histogram_xml/. +folder in tools/metrics/histograms/histograms_xml/. --> <histogram-configuration>
diff --git a/tools/metrics/histograms/histograms_xml/blink/histograms.xml b/tools/metrics/histograms/histograms_xml/blink/histograms.xml index 547592a7c..8731400 100644 --- a/tools/metrics/histograms/histograms_xml/blink/histograms.xml +++ b/tools/metrics/histograms/histograms_xml/blink/histograms.xml
@@ -1789,6 +1789,9 @@ <histogram name="Blink.SpatialNavigation.Advance" units="microseconds" expires_after="M85"> + <obsolete> + Expired in M85. + </obsolete> <owner>bokan@chromium.org</owner> <summary> Time it takes to find best candidate element, set focus or scroll for given
diff --git a/tools/metrics/histograms/histograms_xml/histogram_suffixes_list.xml b/tools/metrics/histograms/histograms_xml/histogram_suffixes_list.xml index bb37f903..b4571ee 100644 --- a/tools/metrics/histograms/histograms_xml/histogram_suffixes_list.xml +++ b/tools/metrics/histograms/histograms_xml/histogram_suffixes_list.xml
@@ -14842,6 +14842,7 @@ label="Recorded only for users with >=2 profiles but only one active; recorded only for the non-active profiles."/> <suffix name="SingleProfile" label="Recorded only for single-profile users."/> + <suffix name="UponDeletion" label="Recorded for a profile upon its deletion"/> <affected-histogram name="Profile.State.Avatar"/> <affected-histogram name="Profile.State.LastUsed"/> <affected-histogram name="Profile.State.Name"/>
diff --git a/tools/metrics/histograms/histograms_xml/profile/histograms.xml b/tools/metrics/histograms/histograms_xml/profile/histograms.xml index 5a69b37..3d3b2b9 100644 --- a/tools/metrics/histograms/histograms_xml/profile/histograms.xml +++ b/tools/metrics/histograms/histograms_xml/profile/histograms.xml
@@ -148,7 +148,20 @@ <summary> This histogram tracks which UI screen was used to initiate and confirm the deletion of a profile. This does not track when the profile is actually - deleted, which is an asynchronous process that happens later. + deleted, which is an asynchronous process that happens later. Not all + buckets in the histogram correspond to profile deletion so the sum is not + the count of deleted profiles. + </summary> +</histogram> + +<histogram name="Profile.DeleteProfileContext" enum="ProfileDeleteContext" + expires_after="2021-10-08"> + <owner>jkrcal@chromium.org</owner> + <owner>droger@chromium.org</owner> + <summary> + This histogram tracks the context of profile deletion whenever a profile is + scheduled for deletion (from user action in the UI). Only recorded if the + profile has a valid entry in ProfileAttributesStorage. </summary> </histogram>
diff --git a/tools/metrics/histograms/histograms_xml/tab/histograms.xml b/tools/metrics/histograms/histograms_xml/tab/histograms.xml index 04a9ddd5..24b16e37 100644 --- a/tools/metrics/histograms/histograms_xml/tab/histograms.xml +++ b/tools/metrics/histograms/histograms_xml/tab/histograms.xml
@@ -159,6 +159,27 @@ <summary>Records how a tab preview image was generated.</summary> </histogram> +<histogram name="Tab.Preview.MemoryUsage.CompressedData.PerThumbnailKiB" + units="KB" expires_after="M92"> + <owner>dfried@chromium.org</owner> + <owner>collinbaker@chromium.org</owner> + <summary> + Memory used by compressed thumbnails. Recorded once per thumbnail every 5 + minutes. + </summary> +</histogram> + +<histogram name="Tab.Preview.MemoryUsage.CompressedData.TotalKiB" units="KB" + expires_after="M92"> + <owner>dfried@chromium.org</owner> + <owner>collinbaker@chromium.org</owner> + <summary> + Memory used by compressed thumbnails. Recorded once every 5 minutes at the + same time as Tab.Preview.MemoryUsage.CompressedData.PerThumbnailKiB. Each + sample is the sum of the corresponding samples in PerThumbnailKiB. + </summary> +</histogram> + <histogram name="Tab.Preview.TimeToFirstUsableFrameAfterStartCapture" units="ms" expires_after="2020-12-15"> <owner>dfried@chromium.org</owner>
diff --git a/tools/perf/core/perfetto_binary_roller/binary_deps.json b/tools/perf/core/perfetto_binary_roller/binary_deps.json index 41ecf46..2741b26 100644 --- a/tools/perf/core/perfetto_binary_roller/binary_deps.json +++ b/tools/perf/core/perfetto_binary_roller/binary_deps.json
@@ -5,12 +5,12 @@ "remote_path": "perfetto_binaries/trace_processor_shell/win/935a915963e1482109b102c82585d78c12112b31/trace_processor_shell.exe" }, "mac": { - "hash": "f644b77335cd634c1e6c176e031ce0e1d592f489", - "remote_path": "perfetto_binaries/trace_processor_shell/mac/2bf76269e147bdf1f3d6b6b749eb44375c4fa3ff/trace_processor_shell" + "hash": "002f2269c464fd57c15cac6a921fad003228af1e", + "remote_path": "perfetto_binaries/trace_processor_shell/mac/0ad07c924552f3fb777e79ae04c5b3e925926388/trace_processor_shell" }, "linux": { - "hash": "3cb342f0066d4eaa41f167cae302c9052530142d", - "remote_path": "perfetto_binaries/trace_processor_shell/linux/c251d370b65ed2b50c02e89c8d8852026c2fda24/trace_processor_shell" + "hash": "5ee28a927ebcff327e0ef054a0fc33ea07dca9f7", + "remote_path": "perfetto_binaries/trace_processor_shell/linux/0ad07c924552f3fb777e79ae04c5b3e925926388/trace_processor_shell" } }, "power_profile.sql": {
diff --git a/tools/perf/expectations.config b/tools/perf/expectations.config index 71f32ebe..66042526 100644 --- a/tools/perf/expectations.config +++ b/tools/perf/expectations.config
@@ -255,9 +255,6 @@ crbug.com/1036357 [ android-nexus-5 ] rendering.mobile/balls_svg_animations [ Skip ] crbug.com/1116469 [ android-webview ] rendering.mobile/webgl_to_texture [ Skip ] crbug.com/1124237 [ android-nexus-5x android-webview ] rendering.mobile/toBlob_duration.html [ Skip ] -crbug.com/1136227 [ android-pixel-2 android-webview ] rendering.mobile/animometer_webgl_indexed [ Skip ] -crbug.com/1136227 [ android-pixel-2 android-webview ] rendering.mobile/animometer_webgl_indexed_multi_draw_base_vertex_base_instance [ Skip ] -crbug.com/1136227 [ android-pixel-2 android-webview ] rendering.mobile/animometer_webgl_indexed_multi_draw [ Skip ] # Benchmark: rasterize_and_record_micro.top_25 crbug.com/764543 rasterize_and_record_micro.top_25/file://static_top_25/wikipedia.html [ Skip ]
diff --git a/tools/perf/page_sets/rendering/tough_webgl_cases.py b/tools/perf/page_sets/rendering/tough_webgl_cases.py index 0676c5d6..24657b7 100644 --- a/tools/perf/page_sets/rendering/tough_webgl_cases.py +++ b/tools/perf/page_sets/rendering/tough_webgl_cases.py
@@ -4,6 +4,7 @@ from page_sets.rendering import rendering_story from page_sets.rendering import story_tags +from page_sets.system_health import platforms class ToughWebglPage(rendering_story.RenderingStory): @@ -107,18 +108,21 @@ class AnimometerWebGLIndexed(ToughWebglPage): BASE_NAME = 'animometer_webgl_indexed' + SUPPORTED_PLATFORMS = platforms.DESKTOP_ONLY # pylint: disable=line-too-long URL = 'http://kenrussell.github.io/webgl-animometer/Animometer/tests/3d/webgl-indexed-instanced.html?webgl_version=2&use_attributes=1&num_geometries=120000' class AnimometerWebGLIndexedMultiDraw(ToughWebglPage): BASE_NAME = 'animometer_webgl_indexed_multi_draw' + SUPPORTED_PLATFORMS = platforms.DESKTOP_ONLY # pylint: disable=line-too-long URL = 'http://kenrussell.github.io/webgl-animometer/Animometer/tests/3d/webgl-indexed-instanced.html?webgl_version=2&use_attributes=1&use_multi_draw=1&num_geometries=120000' class AnimometerWebGLIndexedBaseVertexBaseInstancePage(ToughWebglPage): BASE_NAME = 'animometer_webgl_indexed_multi_draw_base_vertex_base_instance' + SUPPORTED_PLATFORMS = platforms.DESKTOP_ONLY # pylint: disable=line-too-long URL = 'http://kenrussell.github.io/webgl-animometer/Animometer/tests/3d/webgl-indexed-instanced.html?webgl_version=2&use_attributes=1&use_multi_draw=1&use_base_vertex_base_instance=1&num_geometries=120000'
diff --git a/ui/accessibility/ax_tree_manager.h b/ui/accessibility/ax_tree_manager.h index 45388a8..2e2d4d87 100644 --- a/ui/accessibility/ax_tree_manager.h +++ b/ui/accessibility/ax_tree_manager.h
@@ -8,6 +8,7 @@ #include "ui/accessibility/ax_export.h" #include "ui/accessibility/ax_node.h" #include "ui/accessibility/ax_tree_id.h" +#include "ui/accessibility/ax_tree_observer.h" namespace ui { @@ -26,6 +27,9 @@ // Returns nullptr if |node_id| is not found. virtual AXNode* GetNodeFromTree(const AXNode::AXID node_id) const = 0; + virtual void AddObserver(AXTreeObserver* observer) {} + virtual void RemoveObserver(AXTreeObserver* observer) {} + // Returns the tree id of the tree managed by this AXTreeManager. virtual AXTreeID GetTreeID() const = 0;
diff --git a/ui/accessibility/platform/ax_platform_node_textrangeprovider_win.cc b/ui/accessibility/platform/ax_platform_node_textrangeprovider_win.cc index 5a93955..80796c7 100644 --- a/ui/accessibility/platform/ax_platform_node_textrangeprovider_win.cc +++ b/ui/accessibility/platform/ax_platform_node_textrangeprovider_win.cc
@@ -961,6 +961,8 @@ std::vector<gfx::NativeViewAccessible> descendants; const AXNode* common_anchor = start()->LowestCommonAnchor(*end()); + if (!common_anchor) + return UIA_E_ELEMENTNOTAVAILABLE; const AXTreeID tree_id = common_anchor->tree()->GetAXTreeID(); const AXNode::AXID node_id = common_anchor->id(); AXPlatformNodeDelegate* delegate = GetDelegate(tree_id, node_id); @@ -1419,7 +1421,90 @@ !TextAttributeIsUiaReservedValue(attribute_value); } -AXPlatformNodeTextRangeProviderWin::TextRangeEndpoints::TextRangeEndpoints() {} +AXPlatformNodeTextRangeProviderWin::TextRangeEndpoints::TextRangeEndpoints() { + start_ = AXNodePosition::CreateNullPosition(); + end_ = AXNodePosition::CreateNullPosition(); +} + AXPlatformNodeTextRangeProviderWin::TextRangeEndpoints::~TextRangeEndpoints() {} +void AXPlatformNodeTextRangeProviderWin::TextRangeEndpoints::SetStart( + AXPositionInstance new_start) { + bool did_tree_change = start_->tree_id() != new_start->tree_id(); + if (did_tree_change && !start_->IsNullPosition() && + start_->tree_id() != end_->tree_id()) { + RemoveObserver(start_->tree_id()); + } + + start_ = std::move(new_start); + + if (did_tree_change && !start_->IsNullPosition() && + start_->tree_id() != end_->tree_id()) { + AddObserver(start_->tree_id()); + } +} + +void AXPlatformNodeTextRangeProviderWin::TextRangeEndpoints::SetEnd( + AXPositionInstance new_end) { + bool did_tree_change = end_->tree_id() != new_end->tree_id(); + if (did_tree_change && !end_->IsNullPosition() && + end_->tree_id() != start_->tree_id()) { + RemoveObserver(end_->tree_id()); + } + + end_ = std::move(new_end); + + if (did_tree_change && !end_->IsNullPosition() && + start_->tree_id() != end_->tree_id()) { + AddObserver(end_->tree_id()); + } +} + +void AXPlatformNodeTextRangeProviderWin::TextRangeEndpoints::AddObserver( + const AXTreeID tree_id) { + AXTreeManager* ax_tree_manager = + AXTreeManagerMap::GetInstance().GetManager(tree_id); + DCHECK(ax_tree_manager); + observer_.Add(ax_tree_manager); +} + +void AXPlatformNodeTextRangeProviderWin::TextRangeEndpoints::RemoveObserver( + const AXTreeID tree_id) { + AXTreeManager* ax_tree_manager = + AXTreeManagerMap::GetInstance().GetManager(tree_id); + DCHECK(ax_tree_manager); + observer_.Remove(ax_tree_manager); +} + +void AXPlatformNodeTextRangeProviderWin::TextRangeEndpoints:: + OnNodeWillBeDeleted(AXTree* tree, AXNode* node) { + // If an endpoint is on a node that will be deleted, move endpoint up to a + // parent since we want to ensure that the endpoints of a text range provider + // are always valid positions. Otherwise, the range will be stuck on nodes + // that don't exist anymore. + DCHECK(tree); + DCHECK(node); + DCHECK_EQ(tree->GetAXTreeID(), node->tree()->GetAXTreeID()); + if (tree->GetAXTreeID() == start_->tree_id() && + node->id() == start_->anchor_id()) { + AXPositionInstance new_start = start_->CreateParentPosition(); + // Create a degenerate range at |end_| if we have an inverted range - + // which occurs when the |end_| comes before the |start_|. However, if the + // |end_| is positioned on the deleted node, don't create a degenerate range + // yet as that position will be updated below. + if (node->id() != end_->anchor_id() && *end_ < *new_start) + new_start = end_->Clone(); + SetStart(std::move(new_start)); + } + if (tree->GetAXTreeID() == end_->tree_id() && + node->id() == end_->anchor_id()) { + AXPositionInstance new_end = end_->CreateParentPosition(); + // Create a degenerate range at |start_| if we have an inverted range - + // which occurs when the |end_| comes before the |start_|. + if (*new_end < *start_) + new_end = start_->Clone(); + SetEnd(std::move(new_end)); + } +} + } // namespace ui
diff --git a/ui/accessibility/platform/ax_platform_node_textrangeprovider_win.h b/ui/accessibility/platform/ax_platform_node_textrangeprovider_win.h index d09f3861..ee1b7261 100644 --- a/ui/accessibility/platform/ax_platform_node_textrangeprovider_win.h +++ b/ui/accessibility/platform/ax_platform_node_textrangeprovider_win.h
@@ -11,6 +11,7 @@ #include <tuple> #include <vector> +#include "base/scoped_observer.h" #include "ui/accessibility/ax_node_position.h" #include "ui/accessibility/ax_position.h" #include "ui/accessibility/ax_range.h" @@ -187,20 +188,24 @@ Microsoft::WRL::ComPtr<AXPlatformNodeWin> owner_; - class TextRangeEndpoints { + class TextRangeEndpoints : public AXTreeObserver { public: TextRangeEndpoints(); - ~TextRangeEndpoints(); + ~TextRangeEndpoints() override; const AXPositionInstance& GetStart() const { return start_; } const AXPositionInstance& GetEnd() const { return end_; } - void SetStart(AXPositionInstance new_start) { - start_ = std::move(new_start); - } - void SetEnd(AXPositionInstance new_end) { end_ = std::move(new_end); } + void SetStart(AXPositionInstance new_start); + void SetEnd(AXPositionInstance new_end); + + void AddObserver(const AXTreeID tree_id); + void RemoveObserver(const AXTreeID tree_id); + void OnNodeWillBeDeleted(AXTree* tree, AXNode* node) override; private: AXPositionInstance start_; AXPositionInstance end_; + + ScopedObserver<AXTreeManager, AXTreeObserver> observer_{this}; }; TextRangeEndpoints endpoints_; };
diff --git a/ui/accessibility/platform/ax_platform_node_textrangeprovider_win_unittest.cc b/ui/accessibility/platform/ax_platform_node_textrangeprovider_win_unittest.cc index cd986cf..8fc60a8 100644 --- a/ui/accessibility/platform/ax_platform_node_textrangeprovider_win_unittest.cc +++ b/ui/accessibility/platform/ax_platform_node_textrangeprovider_win_unittest.cc
@@ -5718,4 +5718,149 @@ /*expected_text*/ L"ome tex", /*expected_count*/ 1); } + +TEST_F(AXPlatformNodeTextRangeProviderTest, + TestReplaceStartAndEndEndpointNode) { + // This test updates the tree structure to ensure that the text range is still + // valid after a text node gets replaced by another one. This case occurs + // every time an AT's focus moves to a node whose style is affected by focus, + // thus generating a tree update. + // + // ++1 kRootWebArea + // ++++2 kStaticText/++++3 kStaticText (replacement node) + // ++++4 kStaticText/++++5 kStaticText (replacement node) + AXNodeData root_1; + AXNodeData text_2; + AXNodeData text_3; + AXNodeData text_4; + AXNodeData text_5; + + root_1.id = 1; + text_2.id = 2; + text_3.id = 3; + text_4.id = 4; + text_5.id = 5; + + root_1.role = ax::mojom::Role::kRootWebArea; + root_1.child_ids = {text_2.id, text_4.id}; + + text_2.role = ax::mojom::Role::kStaticText; + text_2.SetName("some text"); + + // Replacement node of |text_2|. + text_3.role = ax::mojom::Role::kStaticText; + text_3.SetName("some text"); + + text_4.role = ax::mojom::Role::kStaticText; + text_4.SetName("more text"); + + // Replacement node of |text_4|. + text_5.role = ax::mojom::Role::kStaticText; + text_5.SetName("more text"); + + ui::AXTreeUpdate update; + ui::AXTreeID tree_id = ui::AXTreeID::CreateNewAXTreeID(); + update.root_id = root_1.id; + update.tree_data.tree_id = tree_id; + update.has_tree_data = true; + update.nodes = {root_1, text_2, text_4}; + Init(update); + + // Create a position at MaxTextOffset. + // Making |owner| AXID:1 so that |TestAXNodeWrapper::BuildAllWrappers| + // will build the entire tree. + AXPlatformNodeWin* owner = static_cast<AXPlatformNodeWin*>( + AXPlatformNodeFromNode(GetNodeFromTree(tree_id, 1))); + + // start: TextPosition, anchor_id=2, text_offset=0, annotated_text=<s>ome text + // end : TextPosition, anchor_id=4, text_offset=9, annotated_text=more text<> + ComPtr<AXPlatformNodeTextRangeProviderWin> range; + CreateTextRangeProviderWin( + range, owner, tree_id, + /*start_anchor_id*/ 2, /*start_offset*/ 0, + /*start_affinity*/ ax::mojom::TextAffinity::kDownstream, + /*end_anchor_id*/ 4, /*end_offset*/ 9, + /*end_affinity*/ ax::mojom::TextAffinity::kDownstream); + + EXPECT_UIA_TEXTRANGE_EQ(range, /*expected_text*/ L"some textmore text"); + + // 1. Replace the node on which |start_| is. + { + // Replace node |text_2| with |text_3|. + root_1.child_ids = {text_3.id, text_4.id}; + AXTreeUpdate test_update; + test_update.nodes = {root_1, text_3}; + ASSERT_TRUE(GetTree()->Unserialize(test_update)); + + // Replacing that node shouldn't impact the range. + base::win::ScopedSafearray children; + range->GetChildren(children.Receive()); + EXPECT_UIA_TEXTRANGE_EQ(range, /*expected_text*/ L"some textmore text"); + + // The |start_| endpoint should have moved to its parent. + EXPECT_EQ(1, GetStart(range.Get())->anchor_id()); + EXPECT_EQ(0, GetStart(range.Get())->text_offset()); + + // The |end_| endpoint should not have moved. + EXPECT_EQ(4, GetEnd(range.Get())->anchor_id()); + EXPECT_EQ(9, GetEnd(range.Get())->text_offset()); + } + + // 2. Replace the node on which |end_| is. + { + // Replace node |text_4| with |text_5|. + root_1.child_ids = {text_3.id, text_5.id}; + AXTreeUpdate test_update; + test_update.nodes = {root_1, text_5}; + ASSERT_TRUE(GetTree()->Unserialize(test_update)); + + // Replacing that node shouldn't impact the range. + base::win::ScopedSafearray children; + range->GetChildren(children.Receive()); + EXPECT_UIA_TEXTRANGE_EQ(range, /*expected_text*/ L"some textmore text"); + + // The |start_| endpoint should still be on its parent. + EXPECT_EQ(1, GetStart(range.Get())->anchor_id()); + EXPECT_EQ(0, GetStart(range.Get())->text_offset()); + + // The |end_| endpoint should have moved to its parent. + EXPECT_EQ(1, GetEnd(range.Get())->anchor_id()); + EXPECT_EQ(18, GetEnd(range.Get())->text_offset()); + } + + // 3. Replace the node on which |end_| is. + { + // start: TextPosition, anchor_id=3, text_offset=0, annotated_text=<s>ome + // end : TextPosition, anchor_id=3, text_offset=4, annotated_text=some<> + ComPtr<AXPlatformNodeTextRangeProviderWin> range_2; + CreateTextRangeProviderWin( + range_2, owner, tree_id, + /*start_anchor_id*/ 3, /*start_offset*/ 0, + /*start_affinity*/ ax::mojom::TextAffinity::kDownstream, + /*end_anchor_id*/ 3, /*end_offset*/ 4, + /*end_affinity*/ ax::mojom::TextAffinity::kDownstream); + + EXPECT_UIA_TEXTRANGE_EQ(range_2, /*expected_text*/ L"some"); + + // Replace node |text_3| with |text_2|. + root_1.child_ids = {text_2.id, text_5.id}; + AXTreeUpdate test_update; + test_update.nodes = {root_1, text_2}; + ASSERT_TRUE(GetTree()->Unserialize(test_update)); + + // Replacing that node shouldn't impact the range. + base::win::ScopedSafearray children; + range_2->GetChildren(children.Receive()); + EXPECT_UIA_TEXTRANGE_EQ(range_2, /*expected_text*/ L"some"); + + // The |start_| endpoint should have moved to its parent. + EXPECT_EQ(1, GetStart(range_2.Get())->anchor_id()); + EXPECT_EQ(0, GetStart(range_2.Get())->text_offset()); + + // The |end_| endpoint should have moved to its parent. + EXPECT_EQ(1, GetEnd(range_2.Get())->anchor_id()); + EXPECT_EQ(4, GetEnd(range_2.Get())->text_offset()); + } +} + } // namespace ui
diff --git a/ui/accessibility/test_ax_tree_manager.cc b/ui/accessibility/test_ax_tree_manager.cc index e699a87..16dfbd6 100644 --- a/ui/accessibility/test_ax_tree_manager.cc +++ b/ui/accessibility/test_ax_tree_manager.cc
@@ -53,6 +53,16 @@ return tree_ ? tree_->GetFromId(node_id) : nullptr; } +void TestAXTreeManager::AddObserver(AXTreeObserver* observer) { + if (tree_) + tree_->AddObserver(observer); +} + +void TestAXTreeManager::RemoveObserver(AXTreeObserver* observer) { + if (tree_) + tree_->RemoveObserver(observer); +} + AXTreeID TestAXTreeManager::GetTreeID() const { return tree_ ? tree_->data().tree_id : AXTreeIDUnknown(); }
diff --git a/ui/accessibility/test_ax_tree_manager.h b/ui/accessibility/test_ax_tree_manager.h index 958761d4..117f020 100644 --- a/ui/accessibility/test_ax_tree_manager.h +++ b/ui/accessibility/test_ax_tree_manager.h
@@ -43,6 +43,8 @@ AXNode* GetNodeFromTree(const AXTreeID tree_id, const AXNode::AXID node_id) const override; AXNode* GetNodeFromTree(const AXNode::AXID node_id) const override; + void AddObserver(AXTreeObserver* observer) override; + void RemoveObserver(AXTreeObserver* observer) override; AXTreeID GetTreeID() const override; AXTreeID GetParentTreeID() const override; AXNode* GetRootAsAXNode() const override;
diff --git a/ui/base/cursor/BUILD.gn b/ui/base/cursor/BUILD.gn index f4e3f83c..14c64f03 100644 --- a/ui/base/cursor/BUILD.gn +++ b/ui/base/cursor/BUILD.gn
@@ -55,8 +55,6 @@ "cursor_util.h", "cursors_aura.cc", "cursors_aura.h", - "image_cursors.cc", - "image_cursors.h", ] defines = [ "IS_UI_BASE_CURSOR_IMPL" ] public_deps = [
diff --git a/ui/base/cursor/cursor_factory.h b/ui/base/cursor/cursor_factory.h index f038a42..3eef1dd 100644 --- a/ui/base/cursor/cursor_factory.h +++ b/ui/base/cursor/cursor_factory.h
@@ -46,6 +46,7 @@ // cursors are referenced counted and have an initial refcount of 1. // Therefore, each CreateAnimatedCursor call must be matched with a call to // UnrefImageCursor. + // |frame_delay_ms| is the delay between frames in millisecond. virtual PlatformCursor CreateAnimatedCursor( const std::vector<SkBitmap>& bitmaps, const gfx::Point& hotspot,
diff --git a/ui/base/cursor/cursor_loader.h b/ui/base/cursor/cursor_loader.h index 2553c54..b8e55ef3 100644 --- a/ui/base/cursor/cursor_loader.h +++ b/ui/base/cursor/cursor_loader.h
@@ -5,71 +5,70 @@ #ifndef UI_BASE_CURSOR_CURSOR_LOADER_H_ #define UI_BASE_CURSOR_CURSOR_LOADER_H_ +#include <memory> + #include "base/component_export.h" -#include "base/macros.h" +#include "ui/base/cursor/cursor_size.h" #include "ui/base/cursor/mojom/cursor_type.mojom-forward.h" #include "ui/display/display.h" #include "ui/gfx/native_widget_types.h" -namespace gfx { -class Point; -} - namespace ui { class COMPONENT_EXPORT(UI_BASE_CURSOR) CursorLoader { public: - CursorLoader() : scale_(1.f), rotation_(display::Display::ROTATE_0) {} - virtual ~CursorLoader() {} + CursorLoader() = default; + CursorLoader(const CursorLoader&) = delete; + CursorLoader& operator=(const CursorLoader&) = delete; + virtual ~CursorLoader() = default; + // Returns the rotation and scale of the currently loaded cursor. display::Display::Rotation rotation() const { return rotation_; } + float scale() const { return scale_; } - void set_rotation(display::Display::Rotation rotation) { + // Sets the rotation and scale the cursors are loaded for. + // Returns true if the cursor image was reloaded. + bool SetDisplayData(display::Display::Rotation rotation, float scale) { + if (rotation_ == rotation && scale_ == scale) + return false; + rotation_ = rotation; - } - - // Returns the current scale of the mouse cursor icon. - float scale() const { - return scale_; - } - - // Sets the scale of the mouse cursor icon. - void set_scale(const float scale) { scale_ = scale; + UnloadAll(); + return true; } - // Creates a cursor from an image resource and puts it in the cursor map. - virtual void LoadImageCursor(mojom::CursorType id, - int resource_id, - const gfx::Point& hot) = 0; + // Returns the size of the currently loaded cursor. + CursorSize size() { return size_; } - // Creates an animated cursor from an image resource and puts it in the - // cursor map. The image is assumed to be a concatenation of animation frames - // from left to right. Also, each frame is assumed to be square - // (width == height). - // |frame_delay_ms| is the delay between frames in millisecond. - virtual void LoadAnimatedCursor(mojom::CursorType id, - int resource_id, - const gfx::Point& hot, - int frame_delay_ms) = 0; + // Sets the size of the mouse cursor icon. + void set_size(CursorSize size) { + if (size_ == size) + return; - // Unloads all the cursors. - virtual void UnloadAll() = 0; + size_ = size; + UnloadAll(); + } // Sets the platform cursor based on the native type of |cursor|. virtual void SetPlatformCursor(gfx::NativeCursor* cursor) = 0; // Creates a CursorLoader. - static CursorLoader* Create(); + static std::unique_ptr<CursorLoader> Create(bool use_platform_cursors = true); + + protected: + // Resets the cursor cache. + virtual void UnloadAll() = 0; private: // The current scale of the mouse cursor icon. - float scale_; + float scale_ = 1.0f; // The current rotation of the mouse cursor icon. - display::Display::Rotation rotation_; + display::Display::Rotation rotation_ = display::Display::ROTATE_0; - DISALLOW_COPY_AND_ASSIGN(CursorLoader); + // The preferred size of the mouse cursor icon. + CursorSize size_ = CursorSize::kNormal; }; } // namespace ui
diff --git a/ui/base/cursor/cursor_loader_ozone.cc b/ui/base/cursor/cursor_loader_ozone.cc index 6df16b5f..40ea981 100644 --- a/ui/base/cursor/cursor_loader_ozone.cc +++ b/ui/base/cursor/cursor_loader_ozone.cc
@@ -6,47 +6,33 @@ #include <vector> +#include "base/ranges/algorithm.h" #include "ui/base/cursor/cursor_factory.h" #include "ui/base/cursor/cursor_size.h" #include "ui/base/cursor/cursor_util.h" #include "ui/base/cursor/cursors_aura.h" #include "ui/base/cursor/mojom/cursor_type.mojom-shared.h" +#include "ui/gfx/geometry/point.h" namespace ui { -CursorLoaderOzone::CursorLoaderOzone() { - factory_ = CursorFactory::GetInstance(); -} +namespace { + +constexpr mojom::CursorType kAnimatedCursorTypes[] = { + mojom::CursorType::kWait, mojom::CursorType::kProgress}; + +const int kAnimatedCursorFrameDelayMs = 25; + +} // namespace + +CursorLoaderOzone::CursorLoaderOzone(bool use_platform_cursors) + : use_platform_cursors_(use_platform_cursors), + factory_(CursorFactory::GetInstance()) {} CursorLoaderOzone::~CursorLoaderOzone() { UnloadAll(); } -void CursorLoaderOzone::LoadImageCursor(mojom::CursorType id, - int resource_id, - const gfx::Point& hot) { - SkBitmap bitmap; - gfx::Point hotspot = hot; - - GetImageCursorBitmap(resource_id, scale(), rotation(), &hotspot, &bitmap); - - image_cursors_[id] = factory_->CreateImageCursor(bitmap, hotspot); -} - -void CursorLoaderOzone::LoadAnimatedCursor(mojom::CursorType id, - int resource_id, - const gfx::Point& hot, - int frame_delay_ms) { - std::vector<SkBitmap> bitmaps; - gfx::Point hotspot = hot; - - GetAnimatedCursorBitmaps( - resource_id, scale(), rotation(), &hotspot, &bitmaps); - - image_cursors_[id] = - factory_->CreateAnimatedCursor(bitmaps, hotspot, frame_delay_ms); -} - void CursorLoaderOzone::UnloadAll() { for (const auto& image_cursor : image_cursors_) factory_->UnrefImageCursor(image_cursor.second); @@ -63,43 +49,61 @@ cursor->SetPlatformCursor(CursorFromType(cursor->type())); } +void CursorLoaderOzone::LoadImageCursor(mojom::CursorType type, + int resource_id, + const gfx::Point& hot) { + gfx::Point hotspot = hot; + if (base::ranges::count(kAnimatedCursorTypes, type) == 0) { + SkBitmap bitmap; + GetImageCursorBitmap(resource_id, scale(), rotation(), &hotspot, &bitmap); + image_cursors_[type] = factory_->CreateImageCursor(bitmap, hotspot); + } else { + std::vector<SkBitmap> bitmaps; + GetAnimatedCursorBitmaps(resource_id, scale(), rotation(), &hotspot, + &bitmaps); + image_cursors_[type] = factory_->CreateAnimatedCursor( + bitmaps, hotspot, kAnimatedCursorFrameDelayMs); + } +} + PlatformCursor CursorLoaderOzone::CursorFromType(mojom::CursorType type) { // An image cursor is loaded for this type. if (image_cursors_.count(type)) return image_cursors_[type]; // Check if there's a default platform cursor available. - base::Optional<PlatformCursor> default_cursor = - factory_->GetDefaultCursor(type); - if (default_cursor) - return *default_cursor; + if (use_platform_cursors_) { + base::Optional<PlatformCursor> default_cursor = + factory_->GetDefaultCursor(type); + if (default_cursor) + return *default_cursor; + } // Loads the default Aura cursor bitmap for the cursor type. Falls back on // pointer cursor if this fails. - PlatformCursor platform = CreateFallbackCursor(type); + PlatformCursor platform = LoadCursorFromAsset(type); if (!platform && type != mojom::CursorType::kPointer) { platform = CursorFromType(mojom::CursorType::kPointer); factory_->RefImageCursor(platform); image_cursors_[type] = platform; } - DCHECK(platform) << "Failed to load a fallback bitmap for cursor " << type; + DCHECK(platform) << "Failed to load a bitmap for the pointer cursor."; return platform; } // Gets default Aura cursor bitmap/hotspot and creates a PlatformCursor with it. -PlatformCursor CursorLoaderOzone::CreateFallbackCursor(mojom::CursorType type) { +PlatformCursor CursorLoaderOzone::LoadCursorFromAsset(mojom::CursorType type) { int resource_id; - gfx::Point point; - if (ui::GetCursorDataFor(ui::CursorSize::kNormal, type, scale(), &resource_id, - &point)) { - LoadImageCursor(type, resource_id, point); + gfx::Point hotspot; + if (GetCursorDataFor(size(), type, scale(), &resource_id, &hotspot)) { + LoadImageCursor(type, resource_id, hotspot); return image_cursors_[type]; } return nullptr; } -CursorLoader* CursorLoader::Create() { - return new CursorLoaderOzone(); +std::unique_ptr<CursorLoader> CursorLoader::Create(bool use_platform_cursors) { + return std::make_unique<CursorLoaderOzone>(use_platform_cursors); } } // namespace ui
diff --git a/ui/base/cursor/cursor_loader_ozone.h b/ui/base/cursor/cursor_loader_ozone.h index ccd23a3..4da2230 100644 --- a/ui/base/cursor/cursor_loader_ozone.h +++ b/ui/base/cursor/cursor_loader_ozone.h
@@ -13,28 +13,35 @@ #include "ui/base/cursor/cursor_loader.h" #include "ui/base/cursor/mojom/cursor_type.mojom-forward.h" +namespace gfx { +class Point; +} + namespace ui { class CursorFactory; class COMPONENT_EXPORT(UI_BASE_CURSOR) CursorLoaderOzone : public CursorLoader { public: - CursorLoaderOzone(); + explicit CursorLoaderOzone(bool use_platform_cursors); ~CursorLoaderOzone() override; // CursorLoader overrides: - void LoadImageCursor(mojom::CursorType id, - int resource_id, - const gfx::Point& hot) override; - void LoadAnimatedCursor(mojom::CursorType id, - int resource_id, - const gfx::Point& hot, - int frame_delay_ms) override; - void UnloadAll() override; void SetPlatformCursor(gfx::NativeCursor* cursor) override; private: + // CursorLoader overrides: + void UnloadAll() override; + + void LoadImageCursor(mojom::CursorType id, + int resource_id, + const gfx::Point& hot); PlatformCursor CursorFromType(mojom::CursorType type); - PlatformCursor CreateFallbackCursor(mojom::CursorType type); + PlatformCursor LoadCursorFromAsset(mojom::CursorType type); + + // Whether to use cursors provided by the underlying platform (e.g. X11 + // cursors). If false or in the case of a failure, Chromium assets will be + // used instead. + const bool use_platform_cursors_; // Pointers are owned by ResourceBundle and must not be freed here. std::map<mojom::CursorType, PlatformCursor> image_cursors_;
diff --git a/ui/base/cursor/cursor_loader_win.cc b/ui/base/cursor/cursor_loader_win.cc index 735568d..f960b8a 100644 --- a/ui/base/cursor/cursor_loader_win.cc +++ b/ui/base/cursor/cursor_loader_win.cc
@@ -122,8 +122,8 @@ } // namespace -CursorLoader* CursorLoader::Create() { - return new CursorLoaderWin; +std::unique_ptr<CursorLoader> CursorLoader::Create(bool use_platform_cursors) { + return std::make_unique<CursorLoaderWin>(); } CursorLoaderWin::CursorLoaderWin() { @@ -132,19 +132,6 @@ CursorLoaderWin::~CursorLoaderWin() { } -void CursorLoaderWin::LoadImageCursor(mojom::CursorType id, - int resource_id, - const gfx::Point& hot) { - // NOTIMPLEMENTED(); -} - -void CursorLoaderWin::LoadAnimatedCursor(mojom::CursorType id, - int resource_id, - const gfx::Point& hot, - int frame_delay_ms) { - // NOTIMPLEMENTED(); -} - void CursorLoaderWin::UnloadAll() { // NOTIMPLEMENTED(); }
diff --git a/ui/base/cursor/cursor_loader_win.h b/ui/base/cursor/cursor_loader_win.h index bf3ec63..d534e24 100644 --- a/ui/base/cursor/cursor_loader_win.h +++ b/ui/base/cursor/cursor_loader_win.h
@@ -18,13 +18,6 @@ ~CursorLoaderWin() override; // Overridden from CursorLoader: - void LoadImageCursor(mojom::CursorType id, - int resource_id, - const gfx::Point& hot) override; - void LoadAnimatedCursor(mojom::CursorType id, - int resource_id, - const gfx::Point& hot, - int frame_delay_ms) override; void UnloadAll() override; void SetPlatformCursor(gfx::NativeCursor* cursor) override;
diff --git a/ui/base/cursor/cursor_util.cc b/ui/base/cursor/cursor_util.cc index a19a4dd..ee513696 100644 --- a/ui/base/cursor/cursor_util.cc +++ b/ui/base/cursor/cursor_util.cc
@@ -133,6 +133,9 @@ ResourceBundle::GetSharedInstance().GetImageSkiaNamed(resource_id); const gfx::ImageSkiaRep& image_rep = image->GetRepresentation(scale); SkBitmap bitmap = image_rep.GetBitmap(); + + // The image is assumed to be a concatenation of animation frames from left to + // right. Also, each frame is assumed to be square (width == height). int frame_width = bitmap.height(); int frame_height = frame_width; int total_width = bitmap.width();
diff --git a/ui/base/cursor/cursors_aura.cc b/ui/base/cursor/cursors_aura.cc index 710fb8d..c527ac4d 100644 --- a/ui/base/cursor/cursors_aura.cc +++ b/ui/base/cursor/cursors_aura.cc
@@ -42,8 +42,6 @@ const CursorSize id; const CursorData* cursors; const int length; - const CursorData* animated_cursors; - const int animated_length; }; const CursorData kNormalCursors[] = { @@ -127,6 +125,8 @@ {24, 23}}, {mojom::CursorType::kGrab, IDR_AURA_CURSOR_GRAB, {8, 5}, {16, 10}}, {mojom::CursorType::kGrabbing, IDR_AURA_CURSOR_GRABBING, {9, 9}, {18, 18}}, + {mojom::CursorType::kWait, IDR_AURA_CURSOR_THROBBER, {7, 7}, {14, 14}}, + {mojom::CursorType::kProgress, IDR_AURA_CURSOR_THROBBER, {7, 7}, {14, 14}}, }; const CursorData kLargeCursors[] = { @@ -233,20 +233,12 @@ IDR_AURA_CURSOR_BIG_GRABBING, {20, 12}, {40, 24}}, -}; - -const CursorData kAnimatedCursors[] = { - {mojom::CursorType::kWait, IDR_AURA_CURSOR_THROBBER, {7, 7}, {14, 14}}, - {mojom::CursorType::kProgress, IDR_AURA_CURSOR_THROBBER, {7, 7}, {14, 14}}, + // TODO(https://crbug.com/336867): create IDR_AURA_CURSOR_BIG_THROBBER. }; const CursorSizeData kCursorSizes[] = { - {CursorSize::kNormal, kNormalCursors, base::size(kNormalCursors), - kAnimatedCursors, base::size(kAnimatedCursors)}, - {CursorSize::kLarge, kLargeCursors, base::size(kLargeCursors), - // TODO(yoshiki): Replace animated cursors with big assets. - // crbug.com/247254 - kAnimatedCursors, base::size(kAnimatedCursors)}, + {CursorSize::kNormal, kNormalCursors, base::size(kNormalCursors)}, + {CursorSize::kLarge, kLargeCursors, base::size(kLargeCursors)}, }; const CursorSizeData* GetCursorSizeByType(CursorSize cursor_size) { @@ -302,25 +294,6 @@ resource_id, point); } -bool GetAnimatedCursorDataFor(CursorSize cursor_size, - mojom::CursorType id, - float scale_factor, - int* resource_id, - gfx::Point* point) { - const CursorSizeData* cursor_set = GetCursorSizeByType(cursor_size); - if (cursor_set && - SearchTable(cursor_set->animated_cursors, cursor_set->animated_length, id, - scale_factor, resource_id, point)) { - return true; - } - - // Falls back to the default cursor set. - cursor_set = GetCursorSizeByType(ui::CursorSize::kNormal); - DCHECK(cursor_set); - return SearchTable(cursor_set->animated_cursors, cursor_set->animated_length, - id, scale_factor, resource_id, point); -} - SkBitmap GetDefaultBitmap(const Cursor& cursor) { #if defined(OS_WIN) Cursor cursor_copy = cursor;
diff --git a/ui/base/cursor/cursors_aura.h b/ui/base/cursor/cursors_aura.h index cc82d97..69e514e 100644 --- a/ui/base/cursor/cursors_aura.h +++ b/ui/base/cursor/cursors_aura.h
@@ -18,8 +18,6 @@ class Cursor; enum class CursorSize; -const int kAnimatedCursorFrameDelayMs = 25; - // Returns data about |id|, where id is a cursor constant like // ui::mojom::CursorType::kHelp. The IDR will be placed in |resource_id| and // the hotspots for the different DPIs will be placed in |hot_1x| and @@ -31,14 +29,6 @@ int* resource_id, gfx::Point* point); -// Like above, but for animated cursors. -COMPONENT_EXPORT(UI_BASE_CURSOR) -bool GetAnimatedCursorDataFor(CursorSize cursor_size, - mojom::CursorType id, - float scale_factor, - int* resource_id, - gfx::Point* point); - SkBitmap GetDefaultBitmap(const Cursor& cursor); gfx::Point GetDefaultHotspot(const Cursor& cursor);
diff --git a/ui/base/cursor/image_cursors.cc b/ui/base/cursor/image_cursors.cc deleted file mode 100644 index 42fd3249..0000000 --- a/ui/base/cursor/image_cursors.cc +++ /dev/null
@@ -1,120 +0,0 @@ -// Copyright 2014 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "ui/base/cursor/image_cursors.h" - -#include "base/check.h" -#include "ui/base/cursor/cursor_loader.h" -#include "ui/base/cursor/cursors_aura.h" -#include "ui/base/cursor/mojom/cursor_type.mojom-shared.h" -#include "ui/gfx/geometry/point.h" - -namespace ui { - -namespace { - -constexpr mojom::CursorType kImageCursorIds[] = { - mojom::CursorType::kNull, - mojom::CursorType::kPointer, - mojom::CursorType::kNoDrop, - mojom::CursorType::kNotAllowed, - mojom::CursorType::kCopy, - mojom::CursorType::kHand, - mojom::CursorType::kMove, - mojom::CursorType::kNorthEastResize, - mojom::CursorType::kSouthWestResize, - mojom::CursorType::kSouthEastResize, - mojom::CursorType::kNorthWestResize, - mojom::CursorType::kNorthResize, - mojom::CursorType::kSouthResize, - mojom::CursorType::kEastResize, - mojom::CursorType::kWestResize, - mojom::CursorType::kIBeam, - mojom::CursorType::kAlias, - mojom::CursorType::kCell, - mojom::CursorType::kContextMenu, - mojom::CursorType::kCross, - mojom::CursorType::kHelp, - mojom::CursorType::kVerticalText, - mojom::CursorType::kZoomIn, - mojom::CursorType::kZoomOut, - mojom::CursorType::kRowResize, - mojom::CursorType::kColumnResize, - mojom::CursorType::kEastWestResize, - mojom::CursorType::kNorthSouthResize, - mojom::CursorType::kNorthEastSouthWestResize, - mojom::CursorType::kNorthWestSouthEastResize, - mojom::CursorType::kGrab, - mojom::CursorType::kGrabbing, -}; - -constexpr mojom::CursorType kAnimatedCursorIds[] = { - mojom::CursorType::kWait, mojom::CursorType::kProgress}; - -} // namespace - -ImageCursors::ImageCursors() - : cursor_loader_(CursorLoader::Create()), - cursor_size_(CursorSize::kNormal) {} - -ImageCursors::~ImageCursors() = default; - -float ImageCursors::GetScale() const { - return cursor_loader_->scale(); -} - -display::Display::Rotation ImageCursors::GetRotation() const { - return cursor_loader_->rotation(); -} - -bool ImageCursors::SetDisplay(const display::Display& display, - float scale_factor) { - if (cursor_loader_->rotation() == display.panel_rotation() && - cursor_loader_->scale() == scale_factor) - return false; - - cursor_loader_->set_rotation(display.panel_rotation()); - cursor_loader_->set_scale(scale_factor); - ReloadCursors(); - return true; -} - -void ImageCursors::ReloadCursors() { - float device_scale_factor = cursor_loader_->scale(); - - cursor_loader_->UnloadAll(); - - for (auto cursor_id : kImageCursorIds) { - int resource_id = -1; - gfx::Point hot_point; - bool success = GetCursorDataFor( - cursor_size_, cursor_id, device_scale_factor, &resource_id, &hot_point); - DCHECK(success); - cursor_loader_->LoadImageCursor(cursor_id, resource_id, hot_point); - } - for (auto cursor_id : kAnimatedCursorIds) { - int resource_id = -1; - gfx::Point hot_point; - bool success = GetAnimatedCursorDataFor( - cursor_size_, cursor_id, device_scale_factor, &resource_id, &hot_point); - DCHECK(success); - cursor_loader_->LoadAnimatedCursor(cursor_id, resource_id, hot_point, - kAnimatedCursorFrameDelayMs); - } -} - -void ImageCursors::SetCursorSize(CursorSize cursor_size) { - if (cursor_size_ == cursor_size) - return; - - cursor_size_ = cursor_size; - - ReloadCursors(); -} - -void ImageCursors::SetPlatformCursor(gfx::NativeCursor* cursor) { - cursor_loader_->SetPlatformCursor(cursor); -} - -} // namespace ui
diff --git a/ui/base/cursor/image_cursors.h b/ui/base/cursor/image_cursors.h deleted file mode 100644 index b5b5ec2..0000000 --- a/ui/base/cursor/image_cursors.h +++ /dev/null
@@ -1,52 +0,0 @@ -// Copyright 2014 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef UI_BASE_CURSOR_IMAGE_CURSORS_H_ -#define UI_BASE_CURSOR_IMAGE_CURSORS_H_ - -#include <memory> - -#include "base/component_export.h" -#include "ui/base/cursor/cursor_size.h" -#include "ui/display/display.h" -#include "ui/gfx/native_widget_types.h" - -namespace ui { - -class CursorLoader; - -// A utility class that provides cursors for NativeCursors for which we have -// image resources. -class COMPONENT_EXPORT(UI_BASE_CURSOR) ImageCursors { - public: - ImageCursors(); - ImageCursors(const ImageCursors&) = delete; - ImageCursors& operator=(const ImageCursors&) = delete; - ~ImageCursors(); - - // Returns the scale and rotation of the currently loaded cursor. - float GetScale() const; - display::Display::Rotation GetRotation() const; - - // Sets the display the cursors are loaded for. |scale_factor| determines the - // size of the image to load. Returns true if the cursor image is reloaded. - bool SetDisplay(const display::Display& display, float scale_factor); - - // Sets the size of the mouse cursor icon. - void SetCursorSize(CursorSize cursor_size); - - // Sets the platform cursor based on the native type of |cursor|. - void SetPlatformCursor(gfx::NativeCursor* cursor); - - private: - // Reloads the all loaded cursors in the cursor loader. - void ReloadCursors(); - - std::unique_ptr<CursorLoader> cursor_loader_; - CursorSize cursor_size_; -}; - -} // namespace ui - -#endif // UI_BASE_CURSOR_IMAGE_CURSORS_H_
diff --git a/ui/base/prediction/prediction_metrics_handler.cc b/ui/base/prediction/prediction_metrics_handler.cc index e782e67..f1d9b1d8 100644 --- a/ui/base/prediction/prediction_metrics_handler.cc +++ b/ui/base/prediction/prediction_metrics_handler.cc
@@ -2,14 +2,18 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. +#include <utility> + #include "ui/base/prediction/prediction_metrics_handler.h" #include "base/metrics/histogram_functions.h" +#include "base/strings/strcat.h" namespace ui { -PredictionMetricsHandler::PredictionMetricsHandler() {} -PredictionMetricsHandler::~PredictionMetricsHandler() {} +PredictionMetricsHandler::PredictionMetricsHandler(const char* histogram_name) + : histogram_name_(std::move(histogram_name)) {} +PredictionMetricsHandler::~PredictionMetricsHandler() = default; void PredictionMetricsHandler::AddRealEvent(const gfx::PointF& pos, const base::TimeTicks& time_stamp, @@ -130,25 +134,25 @@ for (int i = 0; i < first_needed_event - 1; i++) events_queue_.pop_front(); - std::string kPredictionMetrics = "Event.InputEventPrediction.Scroll."; - double score = ComputeOverUnderPredictionMetric(); if (score >= 0) { - base::UmaHistogramCounts1000(kPredictionMetrics + "OverPrediction", score); + base::UmaHistogramCounts1000( + base::StrCat({histogram_name_, ".OverPrediction"}), score); } else { - base::UmaHistogramCounts1000(kPredictionMetrics + "UnderPrediction", - -score); + base::UmaHistogramCounts1000( + base::StrCat({histogram_name_, ".UnderPrediction"}), -score); } // Need |last_predicted_| to compute WrongDirection and Jitter metrics. if (!last_predicted_.has_value()) return; - base::UmaHistogramBoolean(kPredictionMetrics + "WrongDirection", + base::UmaHistogramBoolean(base::StrCat({histogram_name_, ".WrongDirection"}), ComputeWrongDirectionMetric()); - base::UmaHistogramCounts1000(kPredictionMetrics + "PredictionJitter", - ComputePredictionJitterMetric()); - base::UmaHistogramCounts1000(kPredictionMetrics + "VisualJitter", + base::UmaHistogramCounts1000( + base::StrCat({histogram_name_, ".PredictionJitter"}), + ComputePredictionJitterMetric()); + base::UmaHistogramCounts1000(base::StrCat({histogram_name_, ".VisualJitter"}), ComputeVisualJitterMetric()); }
diff --git a/ui/base/prediction/prediction_metrics_handler.h b/ui/base/prediction/prediction_metrics_handler.h index 648ccdd..24167f5 100644 --- a/ui/base/prediction/prediction_metrics_handler.h +++ b/ui/base/prediction/prediction_metrics_handler.h
@@ -25,7 +25,7 @@ // few metrics. class COMPONENT_EXPORT(UI_BASE_PREDICTION) PredictionMetricsHandler { public: - explicit PredictionMetricsHandler(); + explicit PredictionMetricsHandler(const char* histogram_name); ~PredictionMetricsHandler(); // Struct used to store predicted and real event information. @@ -103,6 +103,12 @@ base::Optional<gfx::PointF> last_predicted_ = base::nullopt; // The first real event position which time is later than the predicted time. gfx::PointF next_real_; + + // Beginning of the full histogram name. It will have the various metrics' + // names (.OverPrediction, .UnderPrediction, .WrongDirection, + // .PredictionJitter, .VisualJitter) appended to it when counting the metric + // in a histogram. + const char* const histogram_name_; }; } // namespace ui
diff --git a/ui/base/prediction/prediction_metrics_handler_unittest.cc b/ui/base/prediction/prediction_metrics_handler_unittest.cc index f44df0d..fcfa9c0 100644 --- a/ui/base/prediction/prediction_metrics_handler_unittest.cc +++ b/ui/base/prediction/prediction_metrics_handler_unittest.cc
@@ -29,7 +29,8 @@ explicit PredictionMetricsHandlerTest() {} void SetUp() override { - metrics_handler_ = std::make_unique<PredictionMetricsHandler>(); + metrics_handler_ = std::make_unique<PredictionMetricsHandler>( + "Event.InputEventPrediction.Scroll"); histogram_tester_ = std::make_unique<base::HistogramTester>(); }
diff --git a/ui/views/widget/desktop_aura/desktop_native_cursor_manager.cc b/ui/views/widget/desktop_aura/desktop_native_cursor_manager.cc index ab7213a3..1a49f90 100644 --- a/ui/views/widget/desktop_aura/desktop_native_cursor_manager.cc +++ b/ui/views/widget/desktop_aura/desktop_native_cursor_manager.cc
@@ -14,8 +14,14 @@ namespace views { -DesktopNativeCursorManager::DesktopNativeCursorManager() - : cursor_loader_(ui::CursorLoader::Create()) {} +DesktopNativeCursorManager::DesktopNativeCursorManager() { +#if BUILDFLAG(IS_LACROS) + const bool use_platform_cursors = false; +#else + const bool use_platform_cursors = true; +#endif + cursor_loader_ = ui::CursorLoader::Create(use_platform_cursors); +} DesktopNativeCursorManager::~DesktopNativeCursorManager() = default; @@ -37,9 +43,8 @@ void DesktopNativeCursorManager::SetDisplay( const display::Display& display, wm::NativeCursorManagerDelegate* delegate) { - cursor_loader_->UnloadAll(); - cursor_loader_->set_rotation(display.rotation()); - cursor_loader_->set_scale(display.device_scale_factor()); + cursor_loader_->SetDisplayData(display.rotation(), + display.device_scale_factor()); SetCursor(delegate->GetCursor(), delegate); }
diff --git a/ui/views/widget/desktop_aura/desktop_native_widget_aura.cc b/ui/views/widget/desktop_aura/desktop_native_widget_aura.cc index 3d70eb2..d2cc34b 100644 --- a/ui/views/widget/desktop_aura/desktop_native_widget_aura.cc +++ b/ui/views/widget/desktop_aura/desktop_native_widget_aura.cc
@@ -523,9 +523,6 @@ if (!cursor_manager_) { cursor_manager_ = new wm::CursorManager( std::unique_ptr<wm::NativeCursorManager>(native_cursor_manager_)); - cursor_manager_->SetDisplay( - display::Screen::GetScreen()->GetDisplayNearestWindow( - host_->window())); } native_cursor_manager_->AddHost(host()); aura::client::SetCursorClient(host_->window(), cursor_manager_);
diff --git a/weblayer/browser/android/javatests/src/org/chromium/weblayer/test/BrowserControlsOffsetCallbackTest.java b/weblayer/browser/android/javatests/src/org/chromium/weblayer/test/BrowserControlsOffsetCallbackTest.java index 2d5b657..e3cca96 100644 --- a/weblayer/browser/android/javatests/src/org/chromium/weblayer/test/BrowserControlsOffsetCallbackTest.java +++ b/weblayer/browser/android/javatests/src/org/chromium/weblayer/test/BrowserControlsOffsetCallbackTest.java
@@ -21,7 +21,6 @@ import org.chromium.base.test.util.CallbackHelper; import org.chromium.base.test.util.CommandLineFlags; -import org.chromium.base.test.util.DisabledTest; import org.chromium.content_public.browser.test.util.TestThreadUtils; import org.chromium.weblayer.BrowserControlsOffsetCallback; import org.chromium.weblayer.shell.InstrumentationActivity; @@ -116,7 +115,6 @@ @Test @SmallTest - @DisabledTest(message = "TODO(sky): enable") public void testTopScroll() throws Exception { int topViewHeight = mBrowserControlsHelper.getTopViewHeight(); CallbackHelper callbackHelper = mBrowserControlsOffsetCallback.mCallbackHelper; @@ -156,7 +154,6 @@ @Test @SmallTest - @DisabledTest(message = "TODO(sky): enable") public void testBottomScroll() throws Exception { CallbackHelper callbackHelper = mBrowserControlsOffsetCallback.mCallbackHelper; int topViewHeight = mBrowserControlsHelper.getTopViewHeight();